batchCooking/apps/api
Nicolas fff8c0da26 fix(api): seed reference data (diets/allergies) on container start
Found on http://batch.dev.kyuno.fr/: GET /reference/diets and
/reference/allergies both returned [] — onboarding's "régime
alimentaire" step and the profile's food-preferences tab had nothing to
show. Cause: the Docker image's CMD only ran `prisma migrate deploy`
(schema), never the seed that populates Diet/Category/Allergy.

Adds src/scripts/seed-runtime.ts — a runtime-only seed entry point
(distinct from prisma/seed.ts, the dev-time one wired to `prisma db
seed`/`prisma migrate reset` via tsx importing from ../src, which isn't
shipped in the runtime image). This one lives under src/ so tsc compiles
it into dist/ alongside everything else, and runs via plain `node`,
reusing the same idempotent seedReferenceData() (upserts by unique name)
already used by prisma/seed.ts and test-support/reset-db.ts.

Dockerfile CMD now runs it between migrate deploy and starting the
server — safe on every container start/restart, confirmed idempotent
locally (no duplicates, no error on a second run against an
already-seeded database).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-18 00:04:14 +02:00
..
features Tests: dates fixes pour Planning + refonte des radio/checkbox 2026-08-17 22:36:02 +02:00
prisma Shared + migration: table user_preference (thème clair/sombre/système) (step 1/4) 2026-08-17 15:55:18 +02:00
src fix(api): seed reference data (diets/allergies) on container start 2026-08-18 00:04:14 +02:00
test Tests: dates fixes pour Planning + refonte des radio/checkbox 2026-08-17 22:36:02 +02:00
test-support Tests: dates fixes pour Planning + refonte des radio/checkbox 2026-08-17 22:36:02 +02:00
.env.example API: signup/login (profile creation + JWT auth) (#4) 2026-08-16 13:45:23 +02:00
.mocharc.json API: signup/login (profile creation + JWT auth) (#4) 2026-08-16 13:45:23 +02:00
cucumber.cjs Add Cucumber for readable BDD-style integration tests (apps/api) (#2) 2026-08-16 11:11:38 +02:00
Dockerfile fix(api): seed reference data (diets/allergies) on container start 2026-08-18 00:04:14 +02:00
package.json API: GET /planning?date= remplace GET /planning/current (step 2/4) 2026-08-17 14:17:46 +02:00
tsconfig.json Scaffold generic pnpm monorepo (api + web + shared) (#1) 2026-08-16 10:55:13 +02:00