Files
vmall/openspec/changes/archive/2026-09-17-replace-mock-api-wave-5/proposal.md
T
james b44ba39e8c chore(openspec): archive replace-mock-api-wave-5
The merge creates the store-directory capability (two requirements, six
scenarios) and updates the mall's store-and-marketing requirement so the store
directory and store home read live shops and order surfaces name their shop.

openspec validate --all --strict stays green at 13 specs.
2026-09-17 17:13:49 +00:00

2.1 KiB

Proposal

Why

The store directory and store home still render four hard-coded shops, and the cart, payment and order surfaces fall back to a generic "Shop" label because nothing exposes a buyer-facing shop read. Products already carry shop_id; the missing piece is the profile.

What Changes

  • Add a shop_profiles table keyed to shops — logo, banner, company, region, address, notice, after-sale text and four scores — kept separate from shops so the admin and shop-admin contracts do not change.
  • Add public GET /api/shops and GET /api/shops/{slug} returning a profile composed with its shop; the store directory, store home and product-page store card read them, taking products from the catalog API by shop_id.
  • Add PUT /api/admin/shops/{id}/profile for platform admins, and fill the four demo shops from seed-demo.mjs, which is the only place that knows the shops exist.
  • Retire the mock's distanceKm: there is no geo model behind it, so the distance column and its sort are removed rather than filled with an invented number.
  • Let the cart, payment and order surfaces resolve shop_id to a real name from that read, retiring the generic "Shop" label.

Capabilities

New Capabilities

  • store-directory: the buyer-facing view of a shop — its profile and its products — read publicly and maintained by platform admins.

Modified Capabilities

  • frontend-mall: the store directory and store home read live shops instead of fixed mock content, and order surfaces show real shop names.

Impact

A new migration and route module; packages/shared/src/{api,types}.ts; pages/stores/{index,[id]}.vue, the store card in pages/goods/[id].vue, pages/checkout/pay.vue and pages/user/orders/index.vue; scripts/seed-demo.mjs; the mall's fixed-data adapter. The contract change rebuilds all three frontends.

Non-goals

No reviews model: the four scores stay stored profile values, not derived ratings. No geo data or distance. No merchant self-service editing — platform admin only. No work on the seckill, collective or integral pages, nor coupons, favourites or addresses.