fix(product-families): sort price-matrix option arrays by canonical display order

printCounts/crafts/logistics were materialized in first-encounter order
(originGoods had no orderBy), so the H5 print/craft/logistics button
groups rendered in an unstable, per-family arbitrary order. Add
OPTION_DISPLAY_ORDER (单面→双面, 烫画→直喷→不打印, 不包邮→包邮) and
stable-sort the aggregated arrays before materializing; out-of-vocabulary
free-text labels (e.g. 海运) sink to the end preserving encounter order.
Fix traversal order with orderBy id asc so recomputes are fully
deterministic. Add recompute:families script for one-off re-materialize.
This commit is contained in:
yeuimu
2026-09-02 16:00:12 +08:00
parent 1ffd73a1af
commit a84b3b5daa
4 changed files with 151 additions and 5 deletions
+2 -1
View File
@@ -24,7 +24,8 @@
"configure:product-center-icons": "ts-node prisma/configure-product-center-icons.ts",
"import:product-detail": "ts-node prisma/import-product-detail.ts",
"backfill:product-families": "ts-node prisma/backfill-product-families.ts",
"organize": "ts-node prisma/backfill-product-families.ts"
"organize": "ts-node prisma/backfill-product-families.ts",
"recompute:families": "ts-node prisma/recompute-all-families.ts"
},
"dependencies": {
"@nestjs/axios": "^3.0.1",