[PK-64] BE: doplnit imageUrl do CartItemSnapshot v seed.ts #24

Merged
forge-admin merged 1 commit from agent/be-dev/782f0101 into main 2026-05-21 20:49:02 +00:00
Owner

Kontext

be/prisma/seed.ts:862 (buildCartSnapshots) skladal objekty CartItemSnapshot bez povinneho pola imageUrl (zavedene v PK-46 cez be/lib/cartService.ts:15-29). tsc --noEmit hlasil TS2741 na prisma/seed.ts:862.

Zmena

  • ProductWithMeta rozsireny o imageUrl: string | null.
  • seedProducts plni imageUrl z /products/${prod.slug}.svg (rovnaka konvencia ako runtime images[0] v be/lib/cart.ts:92).
  • buildCartSnapshots propaguje product.imageUrl do snapshotu.

Overenie

  • cd be && npx tsc --noEmit -> cisty.
  • npx vitest run -> 200/200 zelene.
## Kontext `be/prisma/seed.ts:862` (`buildCartSnapshots`) skladal objekty `CartItemSnapshot` bez povinneho pola `imageUrl` (zavedene v PK-46 cez `be/lib/cartService.ts:15-29`). `tsc --noEmit` hlasil `TS2741` na `prisma/seed.ts:862`. ## Zmena - `ProductWithMeta` rozsireny o `imageUrl: string | null`. - `seedProducts` plni `imageUrl` z `/products/${prod.slug}.svg` (rovnaka konvencia ako runtime `images[0]` v `be/lib/cart.ts:92`). - `buildCartSnapshots` propaguje `product.imageUrl` do snapshotu. ## Overenie - `cd be && npx tsc --noEmit` -> cisty. - `npx vitest run` -> 200/200 zelene.
Seed buildCartSnapshots() nesetoval imageUrl, kym CartItemSnapshot
interface ho oznacuje ako required (string | null). tsc --noEmit
hlasil TS2741 na prisma/seed.ts:862.

Riesenie: pridat imageUrl: string | null do ProductWithMeta a
naplnit ho z prod.slug placeholder SVG (rovnaka konvencia ako
images[0] v runtime cart.ts). Demo seed ordery teraz vratia
korektny image URL v snapshote.

typecheck: cisty
tests: 200/200
Co-authored-by: multica-agent <github@multica.ai>
forge-admin force-pushed agent/be-dev/782f0101 from 86fe1d37c9 to c04a4c9746 2026-05-21 20:48:53 +00:00 Compare
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
forge-admin/masox-eshop!24
No description provided.