- Debian-based api image (bookworm-slim), docker/debian mirrors, prisma binaryTargets for openssl 3.0 - nginx: admin SPA under /admin, TLS via acme.sh (ZeroSSL) + auto-renewal cron, http->https redirect - prisma: add origin_goods.delisted migration, sync missing schema (good_image/tag_font_color/good_tags), fix users.createdAt Timestamptz - api: CORS wildcard reflection, helmet CORP cross-origin, price backfill in persistProductDetail, categoryIcon ancestor fallback, mediaByColor per-color gallery in public goods detail - admin: /admin base path (vite + router) - import-data.mjs: udt_name casting, serial sequence advance fix
1.8 KiB
Product External ID Fix Implementation Plan
For agentic workers: REQUIRED SUB-SKILL: Use executing-plans to implement this plan task-by-task. Steps use checkbox (
- [ ]) syntax for tracking.
Goal: Make the public goods API return the SDS/InkPOD product ID as id, so product-card links target the correct InkPOD detail page.
Architecture: Keep the local goods.good_id as the database identity used by admin and relations. At the public API serialization boundary, map originGood.sdsGoodId to the existing response id field; the website can continue consuming product.id without a second identifier.
Tech Stack: NestJS, Prisma, Jest, Nuxt/Vue
Task 1: Lock the public API ID contract
Files:
-
Modify:
apps/api/src/public/public.service.spec.ts -
Add an assertion that a listed public product has
idequal to the seededOriginGood.sdsGoodId, not the localGood.id. -
Run the focused API test and confirm it fails because the service currently returns
good.id.
Task 2: Return the SDS product ID
Files:
-
Modify:
apps/api/src/public/public.service.ts -
Include
sdsGoodIdin the serializer'soriginGoodtype. -
Return
good.originGood.sdsGoodIdasPublicGoodDto.id. -
Run the focused API test and confirm it passes.
Task 3: Verify consumers and document the contract
Files:
-
Modify:
docs/references/product-center.md -
Modify:
docs/references/structs.md -
Document that public product
idis the SDS/InkPOD external product ID. -
Run API public-service tests, website tests, and the website build.
-
Verify the running public endpoint returns
126673for200g纯棉T恤KRTM001when local services are available. (The API was not listening on port 3001 during verification.)