package usecase

import (
	"context"

	brandentity "haixun-backend/internal/model/brand/domain/entity"
)

type TopicSummary struct {
	ID               string
	BrandID          string
	BrandDisplayName string
	TopicName        string
	SeedQuery        string
	Brief            string
	ProductID        string
	ResearchMap      brandentity.ResearchMap
	CreateAt         int64
	UpdateAt         int64
}

type CreateRequest struct {
	TenantID  string
	OwnerUID  string
	BrandID   string
	TopicName string
	SeedQuery string
	Brief     string
	ProductID string
}

type UpdateRequest struct {
	TenantID string
	OwnerUID string
	TopicID  string
	Patch    TopicPatch
}

type TopicPatch struct {
	BrandID           *string
	TopicName         *string
	SeedQuery         *string
	Brief             *string
	ProductID         *string
	AudienceSummary   *string
	ContentGoal       *string
	Questions         []string
	QuestionsSet      bool
	Pillars           []string
	PillarsSet        bool
	Exclusions        []string
	ExclusionsSet     bool
	PatrolKeywords    []string
	PatrolKeywordsSet bool
	ResearchMap       *brandentity.ResearchMap
}

type ListResult struct {
	List []TopicSummary
}

type UseCase interface {
	List(ctx context.Context, tenantID, ownerUID string) (*ListResult, error)
	Create(ctx context.Context, req CreateRequest) (*TopicSummary, error)
	Get(ctx context.Context, tenantID, ownerUID, topicID string) (*TopicSummary, error)
	Update(ctx context.Context, req UpdateRequest) (*TopicSummary, error)
	Delete(ctx context.Context, tenantID, ownerUID, topicID string) error
}
