export type PublishPlatform =
  | "official_site"
  | "media_article"
  | "comparison_review"
  | "recommendation_list";

export type CheckStatus = "pass" | "warn" | "fail";

export type QualityRuleId =
  | "industry_alignment"
  | "image_text_match"
  | "voice_consistency"
  | "platform_fit"
  | "company_name_integrity"
  | "title_quality"
  | "body_quality"
  | "hallucination_risk"
  | "claim_consistency"
  | "context_sensitive_terms";

export interface ImageInput {
  type: "description" | "link";
  content: string;
}

export interface ArticleInput {
  title: string;
  body: string;
  images: ImageInput[];
  platform: PublishPlatform;
  user_instructions: string;
}

export interface CandidateFactCard {
  company_full_name: string;
  company_short_names: string[];
  brand_names: string[];
  product_names: string[];
  target_industry: string;
  target_audience: string;
  experience_years: number | null;
  core_claims: string[];
  forbidden_claims: string[];
  image_topics: string[];
  uncertain_items: string[];
  is_ready_for_optimization: boolean;
}

export interface ConfirmedFactCard extends CandidateFactCard {
  confirmed_by_user: true;
  is_ready_for_optimization: true;
}

export interface ImageSuggestion {
  source: string;
  suggestion: string;
}

export interface OptimizedArticle {
  job_id?: string;
  revision?: number;
  title: string;
  summary: string;
  body_markdown: string;
  image_suggestions: ImageSuggestion[];
  changed_sections: string[];
  requires_user_confirmation: string[];
}

export interface QaCheck {
  rule_id: QualityRuleId;
  status: CheckStatus;
  evidence: string;
  reason: string;
  suggested_fix: string;
  target_agent: string | null;
}

export interface QaReport {
  job_id?: string;
  revision?: number;
  overall_status: CheckStatus;
  checks: QaCheck[];
}
