feat(product-center): implement Figma-designed UI, upload module, and website tests
- Redesign website homepage & product-center per Figma (fonts, logos, hero/footer/customer cases) - Add API upload module (multer) with static serving for uploads/public assets - Add OriginGood.delisted flag and SDS request retry logic - Add admin ImageUpload component and goods import/upload flows - Add vitest suite for website components and composables (32 tests) - Add skills, docs, plans and PRODUCT.md
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
# 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`
|
||||
|
||||
- [x] Add an assertion that a listed public product has `id` equal to the seeded `OriginGood.sdsGoodId`, not the local `Good.id`.
|
||||
- [x] 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`
|
||||
|
||||
- [x] Include `sdsGoodId` in the serializer's `originGood` type.
|
||||
- [x] Return `good.originGood.sdsGoodId` as `PublicGoodDto.id`.
|
||||
- [x] 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`
|
||||
|
||||
- [x] Document that public product `id` is the SDS/InkPOD external product ID.
|
||||
- [x] Run API public-service tests, website tests, and the website build.
|
||||
- [ ] Verify the running public endpoint returns `126673` for `200g纯棉T恤KRTM001` when local services are available. (The API was not listening on port 3001 during verification.)
|
||||
@@ -0,0 +1,33 @@
|
||||
# Product Filter Selected Tags 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:** Show selected logistics and process filters as removable gray tags matching Figma.
|
||||
|
||||
**Architecture:** Keep `selectedTagIds` as the only source of truth. `ProductTagFilter` derives the selected `Tag` objects from its props and emits the existing `toggle-tag` event when a selected tag is removed.
|
||||
|
||||
**Tech Stack:** Nuxt 4, Vue 3 Composition API, TypeScript, scoped CSS, Vitest, Vue Test Utils.
|
||||
|
||||
---
|
||||
|
||||
### Task 1: Selected Filter Tags
|
||||
|
||||
**Files:**
|
||||
- Modify: `apps/website/app/components/product/ProductTagFilter.vue`
|
||||
- Create: `apps/website/test/ProductTagFilter.test.ts`
|
||||
|
||||
- [x] **Step 1: Write the failing component test**
|
||||
|
||||
Mount the component with selected logistics and process IDs. Assert that `包邮` and `烫画` appear in `.selected-tag`, and clicking the first `.selected-tag-remove` emits `toggle-tag` with the selected ID.
|
||||
|
||||
- [x] **Step 2: Run the focused test and verify RED**
|
||||
|
||||
Run `pnpm --filter @inkreach/website test -- --run test/ProductTagFilter.test.ts` and expect failure because `.selected-tag` does not exist.
|
||||
|
||||
- [x] **Step 3: Implement the selected tag row**
|
||||
|
||||
Add a pure `computed` mapping from `selectedTagIds` to tags. Render each selected tag below the dropdown row with `#f2f2f2` background, 30px height, 16px horizontal padding, 6px gap, 60px radius, 16px black text, and a 20px remove icon button.
|
||||
|
||||
- [x] **Step 4: Verify GREEN and regressions**
|
||||
|
||||
Run the focused test, the complete website test suite, and the website production build. Browser-test selection and removal at `http://localhost:3000/product-center`.
|
||||
Reference in New Issue
Block a user