package usecase

import (
	"context"
)

type CopyDraftSummary struct {
	ID                 string
	PersonaID          string
	CopyMissionID      string
	ScanPostID         string
	DraftType          string
	SortOrder          int
	Text               string
	Angle              string
	Hook               string
	Rationale          string
	ReferenceNotes     string
	Sources            []string
	Status             string
	PublishedMediaID   string
	PublishedPermalink string
	PublishedAt        int64
	CreateAt           int64
}

type MarkPublishedRequest struct {
	TenantID  string
	OwnerUID  string
	PersonaID string
	DraftID   string
	MediaID   string
	Permalink string
}

type CreateRequest struct {
	TenantID       string
	OwnerUID       string
	PersonaID      string
	CopyMissionID  string
	ScanPostID     string
	DraftType      string
	SortOrder      int
	Text           string
	Angle          string
	Hook           string
	Rationale      string
	ReferenceNotes string
	Sources        []string
}

type CreateManyRequest struct {
	TenantID  string
	OwnerUID  string
	PersonaID string
	Drafts    []CreateRequest
}

type CopyDraftPatch struct {
	Text   *string
	Hook   *string
	Angle  *string
	Status *string
}

type UpdateRequest struct {
	TenantID  string
	OwnerUID  string
	PersonaID string
	DraftID   string
	Patch     CopyDraftPatch
}

type UseCase interface {
	Create(ctx context.Context, req CreateRequest) (*CopyDraftSummary, error)
	CreateMany(ctx context.Context, req CreateManyRequest) ([]CopyDraftSummary, error)
	ReplaceMissionMatrix(ctx context.Context, tenantID, ownerUID, personaID, missionID string, drafts []CreateRequest) ([]CopyDraftSummary, error)
	Get(ctx context.Context, tenantID, ownerUID, personaID, draftID string) (*CopyDraftSummary, error)
	Update(ctx context.Context, req UpdateRequest) (*CopyDraftSummary, error)
	MarkPublished(ctx context.Context, req MarkPublishedRequest) (*CopyDraftSummary, error)
	List(ctx context.Context, tenantID, ownerUID, personaID string, limit int) ([]CopyDraftSummary, error)
	ListByMission(ctx context.Context, tenantID, ownerUID, personaID, missionID string, limit int) ([]CopyDraftSummary, error)
	ClearByMission(ctx context.Context, tenantID, ownerUID, personaID, missionID string) error
}
