export type Cuvee = {
  id: string;
  name: string;
  color: "red" | "white" | "rose" | "sweet";
  estate:
    | "chevalier"
    | "solitude"
    | "lespault-martillac"
    | "guiraud"
    | "clos-des-lunes"
    | "suau"
    | "soubian"
    | "poumey";
  appellation: string;
};

export type Vintage = {
  cuveeId: string;
  year: number;
};

export type Source =
  | "vivino"
  | "cellartracker"
  | "reddit"
  | "lpv"
  | "wine-spectator"
  | "decanter"
  | "rvf"
  | "suckling"
  | "vinatis"
  | "millesima"
  | "wine.com"
  | "berry-bros"
  | "hawesko";

export type Market =
  | "FR"
  | "US"
  | "UK"
  | "JP"
  | "HK"
  | "CN"
  | "DE"
  | "BE"
  | "CH"
  | "CA"
  | "SG"
  | "KR"
  | "BR"
  | "RU"
  | "OTHER";

export type Sentiment = "positive" | "neutral" | "negative";

export type Review = {
  id: string;
  cuveeId: string;
  vintage: number;
  source: Source;
  market: Market;
  language: string;
  date: string;
  rating?: number;
  authorPseudonym: string;
  authorType: "consumer" | "sommelier" | "critic" | "collector";
  textOriginal: string;
  textFrench: string;
  sentiment: Sentiment;
  sentimentScore: number;
  descriptors: string[];
  comparisonsTo?: string[];
  topics: string[];
  url: string;
};

export type CompetitorBrand = {
  id: string;
  name: string;
  appellation: string;
};

export type PerceptionSnapshot = {
  cuveeId: string;
  vintage?: number;
  market?: Market;
  period: { from: string; to: string };
  mentionCount: number;
  averageSentiment: number;
  averageRating: number;
  topDescriptors: { term: string; count: number; sentiment: number }[];
  emergingTerms: { term: string; growthPct: number }[];
};

export type PeriodPreset = "7d" | "30d" | "90d" | "6m" | "12m" | "24m";
