100d70dc2d
- Ny 'baking'-tagg (RECIPE_TAGS, text[] - ingen migration). Browse-vyn far en 'Baka'-chip som filtrerar pa taggen; befintliga lussekatter + saffransbullar taggas ocksa. - extra-recipes.ts: 16 nya recept som fyller de glesa kategorierna - 4 bak (kanelbullar, kardemummabullar, appelsmulpaj, frukostfrallor), 3 frukost, 3 mellanmal (tomma kategorin -> fylld), 3 efterratt, 3 lunch. - Endast verifierade canonical-ingredienser + berakningsbara enheter, sa seed harleder narings-/allergendata utan att krascha (run.ts 675/691). - Nytt rent invariant-test (ingen DB) kor riktiga computeRecipeNutrition pa alla 16: id:n finns, naring berakningsbar, inga slug-krockar. 5 tester grona. - Seed ar additiv (onConflictDoUpdate) - 'pnpm db:seed' lagger till + taggar om utan dataforlust. Full typecheck 20/20.
75 lines
1.9 KiB
TypeScript
75 lines
1.9 KiB
TypeScript
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";
|
||
ingredients: SeedRecipeIngredient[];
|
||
steps: SeedRecipeStep[];
|
||
}
|
||
|
||
import { VERIFIED_RECIPES } from "./verified-recipes.js";
|
||
import { EXTRA_RECIPES } from "./extra-recipes.js";
|
||
|
||
/** Hela seed-katalogen: committade verifierade recept + nya redaktionella extrarecept. */
|
||
export const SEED_RECIPES: SeedRecipe[] = [...VERIFIED_RECIPES, ...EXTRA_RECIPES];
|