docs: document merged origin goods feature
This commit is contained in:
@@ -39,6 +39,17 @@
|
||||
|
||||
宽度低于 1000px 后分类栏变为抽屉;移动端商品网格降为两列或单列,国家筛选仅在自身区域横向滚动,不会撑宽页面。
|
||||
|
||||
## 多源合并商品
|
||||
|
||||
后台支持把名称相同但工厂/仓库不同的多个 SDS 原产品合并为一个官网商品:
|
||||
|
||||
- 数据层:主源存 `goods.origin_good_id`,副源存中间表 `good_origin_goods`。
|
||||
- 详情可达性:官网上通过**任一**关联原产品的 `sdsGoodId` 都能访问到该商品详情,即副源的旧链接不会 404。
|
||||
- 变体合并:详情中的 SKU 是「主源变体 ∪ 全部副源变体」,按颜色归组展示媒体图;价格与详情页内容以主源为准。
|
||||
- 后台维护入口:
|
||||
- 配置弹窗(右栏拖拽/配置按钮):自动勾选同分类下同名兄弟原产品作为副源提交(`mergedOriginGoodIds`);
|
||||
- 编辑弹窗「关联原产品」区:可搜索添加副源、移除副源、切换主源(切换后旧主源自动转为副源)。
|
||||
|
||||
## 验证
|
||||
|
||||
```bash
|
||||
|
||||
@@ -84,6 +84,7 @@ apps/api/
|
||||
| `TagGroup` | 标签分组(含 `groupName`、`groupColor`、`groupIcon`、`sortOrder`),删除分组时组内 tag 的 `tagGroupId` 通过 `onDelete: SetNull` 自动置空 |
|
||||
| `Position` | 坑位:`(country, category)` 维度,关联多个 goods |
|
||||
| `Good` | 商品:`originGood × country × category × tag? × position?`,含 `goodPriority` |
|
||||
| `GoodOriginGood` | 副源关联中间表(多对一):一个 Good 可关联多个副源 OriginGood;主源走 `goods.origin_good_id` 不入表。用于把名称相同但工厂/仓库不同的多个原产品合并为一个商品展示 |
|
||||
| `User` | 后台用户(bcrypt 哈希) |
|
||||
| `SyncLog` | 同步任务日志,含 `SyncType`(CATEGORIES / PRODUCTS)和 `SyncStatus` |
|
||||
|
||||
|
||||
@@ -29,3 +29,5 @@ Default to all products and countries with no logistics or craft selection. Neve
|
||||
Countries, categories, tags, tag groups, and icons are backend-owned. Preserve relative backend asset paths in the database and resolve them through `runtimeConfig.public.backendUrl` in `useProductCenter.ts`. Do not add country-name flag fallbacks or infer tag groups from numeric sort positions. Versioned Figma icon assets live under `apps/api/public/product-center/`; run `pnpm --filter @inkreach/api configure:product-center-icons` to apply them to matching existing records.
|
||||
|
||||
The public goods API exposes `originGood.sdsGoodId` as the product `id`. Use that value for InkPOD detail links; never build an InkPOD URL from the local `goods.good_id` primary key.
|
||||
|
||||
A good may merge multiple origin goods (same-name variants across factories/warehouses): any associated origin's `sdsGoodId` resolves to the same detail via `/public/goods/:id`, and the detail's variants/media are the union of the primary and secondary origins. Price and detail content come from the primary origin.
|
||||
|
||||
Reference in New Issue
Block a user