package team

import (
	"context"

	storeteam "github.com/tidbcloud/AgentTeam/internal/store/team"
)

// Store is the narrow API-facing Team management port.
type Store interface {
	ListTeamsForUser(ctx context.Context, userID string, workspaceID string, filter storeteam.ListTeamsFilter) ([]storeteam.TeamView, error)
	GetTeamForUser(ctx context.Context, userID string, workspaceID string, teamID string) (storeteam.TeamView, error)
	CreateTeamForUser(ctx context.Context, userID string, workspaceID string, params storeteam.CreateTeamParams) (storeteam.TeamView, error)
	UpdateTeamForUser(ctx context.Context, userID string, workspaceID string, teamID string, params storeteam.UpdateTeamParams) (storeteam.TeamView, error)
	DeleteTeamForUser(ctx context.Context, userID string, workspaceID string, teamID string) error
	ListTeamTemplatesForUser(ctx context.Context, userID string, workspaceID string, filter storeteam.ListTeamTemplateFilter) ([]storeteam.TeamTemplateView, error)
	CreateTeamTemplateForUser(ctx context.Context, userID string, workspaceID string, params storeteam.CreateTeamTemplateParams) (storeteam.TeamTemplateView, error)
	SaveTeamTemplateFromTeamForUser(ctx context.Context, userID string, workspaceID string, teamID string, name string, description string, scope string) (storeteam.TeamTemplateView, error)
	UpdateTeamTemplateForUser(ctx context.Context, userID string, workspaceID string, templateID string, params storeteam.UpdateTeamTemplateParams) (storeteam.TeamTemplateView, error)
	DeleteTeamTemplateForUser(ctx context.Context, userID string, workspaceID string, templateID string) error
	GetTeamTemplateForUser(ctx context.Context, userID string, workspaceID string, templateID string, locale string) (storeteam.TeamTemplateView, error)
	InstantiateTeamTemplate(ctx context.Context, userID string, workspaceID string, params storeteam.InstantiateTeamTemplateParams) (storeteam.InstantiateTeamTemplateResult, error)
	InstantiateTeamTemplateForUser(ctx context.Context, userID string, workspaceID string, params storeteam.InstantiateTeamTemplateParams) (storeteam.TeamView, error)
	ListTeamMembersForUser(ctx context.Context, userID string, workspaceID string, teamID string) ([]storeteam.TeamMemberView, error)
	AddTeamMemberForUser(ctx context.Context, userID string, workspaceID string, teamID string, params storeteam.AddTeamMemberParams) (storeteam.TeamMemberView, error)
	UpdateTeamMemberForUser(ctx context.Context, userID string, workspaceID string, teamID string, teamMemberID string, params storeteam.UpdateTeamMemberParams) (storeteam.TeamMemberView, error)
	RemoveTeamMemberForUser(ctx context.Context, userID string, workspaceID string, teamID string, teamMemberID string) error
	ListTeamMentionCandidatesForUser(ctx context.Context, userID string, workspaceID string, query string, limit int, scopeID string) ([]storeteam.TeamMentionCandidate, error)
}
