import type {
  CookingMethod,
  Cuisine,
  Equipment,
  MealType,
  RecipeDifficulty,
  RecipeTag,
  RecipeVariantType,
  Season,
  Unit,
} from "@app/shared-types";

/**
 * Seed: redaktionella originalrecept skrivna för plattformen (sourceType:
 * own_editorial – egna formuleringar, ingen kopierad text, spec §15).
 * Näring + allergener beräknas deterministiskt vid seed ur ingredienserna.
 *
 * Själva receptkatalogen (246 verifierade recept) levereras från
 * verified-recipes.ts så att seed-datan är committad och hermetisk.
 */

export interface SeedRecipeIngredient {
  ing: string; // canonical ingredient id
  nameSv: string;
  qty: number;
  unit: Unit;
  note?: string;
  optional?: boolean;
  group?: string;
}

export interface SeedRecipeStep {
  text: string;
  timerSeconds?: number;
  temperatureC?: number;
  tip?: string;
}

export interface SeedRecipe {
  slug: string;
  titleSv: string;
  descriptionSv: string;
  cuisine: Cuisine;
  country?: string;
  mealTypes: MealType[];
  tags: RecipeTag[];
  methods: CookingMethod[];
  equipment: Equipment[];
  difficulty: RecipeDifficulty;
  prepMin: number;
  cookMin: number;
  portions: number;
  spiceLevel: number;
  mealPrepFriendly: boolean;
  freezerFriendly: boolean;
  peakSeasons: Season[];
  holidayTags: string[];
  variantType?: RecipeVariantType;
  variantOfSlug?: string;
  storageGuidanceSv?: string;
  dnaProtein?: string;
  dnaCarb?: string;
  dnaVegetables: string[];
  dnaFlavor: string[];
  verificationStatus?: "editorial" | "verified" | "unverified" | "community" | "rejected";
  /** Namngiven källa/kock för diskret attribution (t.ex. "Gordon Ramsay").
   * Utelämnad = husets redaktion. Visas som liten "Källa: …"-rad, aldrig badge. */
  creatorDisplayName?: string;
  ingredients: SeedRecipeIngredient[];
  steps: SeedRecipeStep[];
}

import { VERIFIED_RECIPES } from "./verified-recipes.js";
import { EXTRA_RECIPES } from "./extra-recipes.js";
import { CHEF_RECIPES } from "./chef-recipes.js";
import { CHEF_RECIPES_EXTRA } from "./chef-recipes-extra.js";
import { CHEF_RECIPES_EXTRA2 } from "./chef-recipes-extra2.js";
import { EVENT_RECIPES_EXTRA } from "./event-recipes-extra.js";

/** Hela seed-katalogen: committade verifierade recept + nya redaktionella extrarecept. */
export const SEED_RECIPES: SeedRecipe[] = [
  ...VERIFIED_RECIPES,
  ...EXTRA_RECIPES,
  ...CHEF_RECIPES,
  ...CHEF_RECIPES_EXTRA,
  ...CHEF_RECIPES_EXTRA2,
  ...EVENT_RECIPES_EXTRA,
];
