Files
Cibello-app/packages/database/src/seed/data/recipes.ts
T
Sven (AAMOS AI) b1b6eb994c feat(seed): import 246 verified recipes as committed seed catalog
- Convert C:\Users\Public\cibello-verified-final-result.json to
  packages/database/src/seed/data/verified-recipes.ts (committed, hermetic).
- Replace/extend the 23 placeholder SEED_RECIPES via re-export.
- Upsert on slug with onConflictDoUpdate of ALL recipe fields.
- Hard-reject recipes with unmapped canonical ingredients (0 rejected this batch).
- Derive allergens and compute nutrition per portion from ingredients at seed time.
- Run food-safety lint; auto-patch 8 legacy raw-protein recipes with safe-cooking phrase.
- Resolve 4 suspected title duplicates via variantOfSlug.
- Guard brand name: creatorDisplayName uses BRAND.name, never JSON placeholder.
- Preserve verificationStatus (editorial/verified) and source-registry FKs.
- Extend allergen-invariant test to cover full 246-recipe catalog.
- Stabilise API tests by disabling file parallelism (flakiness from shared DB state).

Refs: seed pipeline, brand-guard, safety canary
2026-08-11 00:47:08 +07:00

71 lines
1.7 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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[];
}
export { VERIFIED_RECIPES as SEED_RECIPES } from "./verified-recipes.js";