package agent

import (
	"context"

	"github.com/tidbcloud/AgentTeam/internal/store/attachment"
)

// FileStore is the narrow storage surface needed by upload endpoints.
type FileStore interface {
	UploadAttachmentsForMember(ctx context.Context, memberID string, workspaceID string, scopeID string, params []attachment.CreateAttachmentParams) ([]attachment.AppAttachment, error)
	UploadAgentAvatar(ctx context.Context, workspaceID string, agentID string, params attachment.CreateAttachmentParams) (string, error)
}

// AgentAvatarStore is the narrow storage surface needed to persist agent avatar URLs.
type AgentAvatarStore interface {
	UpdateAgentAvatarURL(ctx context.Context, workspaceID string, agentID string, avatarURL string) error
}

func createAttachmentParams(filename string, contentType string, blob []byte) attachment.CreateAttachmentParams {
	return attachment.CreateAttachmentParams{
		Filename:    filename,
		ContentType: contentType,
		Blob:        blob,
	}
}

func createAttachmentParamsList(filename string, contentType string, blob []byte) []attachment.CreateAttachmentParams {
	return []attachment.CreateAttachmentParams{createAttachmentParams(filename, contentType, blob)}
}
