// Forme renvoyée par `ProductCardBuilder::build()` (backend) — fiche produit
// enrichie (photo, Nutri-Score, synthèse diététique) partagée par food-lookup
// (`api/foodLookup.ts`) et tracking (`api/tracking.ts`, scan code-barres dans
// "Mon suivi"), pour que les deux affichent le même composant `ProductCard`.

export type ProductSynthesisFlag = { label: string; level: string; value: string; note: string };
export type ProductSynthesisLevel = { label: string; value: number; unit: string; level: string; pct: number; minPct: number; maxPct: number };

export type ProductMacros = {
  caloriesPer100: number | null;
  proteinPer100: number | null;
  carbsPer100: number | null;
  sugarsPer100: number | null;
  fatPer100: number | null;
  saturatedFatPer100: number | null;
  fiberPer100: number | null;
  sodiumPer100: number | null;
};

export type ProductCardData = {
  offId: string;
  name: string;
  brands: string | null;
  imageUrl: string | null;
  nutriscore: { grade: string; score: number | null } | null;
  conservationConditions: string | null;
  categories: string[];
  categoriesTags: string[];
  macros: ProductMacros;
  synthesis: { verdict: string | null; hint: string | null; flags: ProductSynthesisFlag[]; levels: ProductSynthesisLevel[] };
};
