export type MediaType = 'tv_show' | 'movie';

export type CuratorCategory = 'Full Match' | 'Definitely Like' | 'Might Like' | 'Questionable' | 'Will Not Like';

export interface CuratorOutput {
  title: string;
  explanation: string;
  category: CuratorCategory;
  genre: string;
  pros: string[];
  cons: string[];
}

export type RecommendationStatus = 'pending' | 'running' | 'done' | 'error';

export interface Recommendation {
  id: string;
  title: string;
  main_prompt: string;
  liked_series: string;
  disliked_series: string;
  themes: string;
  media_type: MediaType;
  use_web_search: boolean;
  use_validator: boolean;
  hard_requirements: boolean;
  self_expansive: boolean;
  expansive_passes: number;
  expansive_mode: 'soft' | 'extreme';
  recommendations: CuratorOutput[] | null;
  status: RecommendationStatus;
  created_at: string;
}

export interface RecommendationSummary {
  id: string;
  title: string;
  status: RecommendationStatus;
  media_type: MediaType;
  created_at: string;
}

export interface FeedbackEntry {
  id: string;
  item_name: string;
  stars: number;
  feedback: string;
  created_at: string;
}

export type PipelineStage =
  | 'interpreter'
  | 'retrieval'
  | 'validator'
  | 'ranking'
  | 'curator'
  | 'complete'
  | `pass${number}:retrieval`
  | `pass${number}:validator`
  | `pass${number}:ranking`
  | `pass${number}:curator`;

export type SSEStatus = 'start' | 'done' | 'error';

export interface SSEEvent {
  stage: PipelineStage;
  status: SSEStatus;
  data?: unknown;
}

export type StageStatus = 'pending' | 'running' | 'done' | 'error' | 'skipped';

export type StageMap = Record<string, StageStatus>;
