fix(product-families): 热转印词表以 v2 为准——归因不再映射回烫画

合并冲突的行为级裁决:develop 侧 memberMatrixCombos 曾把 热转印→烫画
归一(旧别名方案),与 v2 线上一等公民词表(8903afd)矛盾,导致 v2 侧
三个矩阵用例失败。取 v2 版 family-recompute.service.{ts,spec}(即当前
线上行为)。另修复 v2 分支 structs.md 残留的冲突标记。

Tests: api 23 suites/217 passed (runInBand), admin 27 passed, tsc clean
This commit is contained in:
yeuimu
2026-09-03 02:00:33 +08:00
parent 5e69397adc
commit a554b77379
2 changed files with 3 additions and 37 deletions
@@ -1,7 +1,7 @@
import { Injectable, Logger } from '@nestjs/common';
import { Prisma } from '@prisma/client';
import { PrismaService } from '../prisma/prisma.service';
import { isAutoTagGroupName, normalizeCraftTag } from './auto-tag-rules';
import { isAutoTagGroupName } from './auto-tag-rules';
/**
* 产品族重算:并集尺码表/包装规则 + 五维价格矩阵物化。
@@ -108,16 +108,14 @@ export function memberMatrixCombos(input: {
tagNames: string[];
customLabels?: { craft?: string | null; logistics?: string | null };
}): MatrixCombo[] {
// 旧词别名归一(热转印→烫画):只影响矩阵归因,封闭词表本身不变
const tagNames = input.tagNames.map(normalizeCraftTag);
const values = (dim: DimKey): string[] =>
DIM_VALUES[dim].filter((v) => tagNames.includes(v));
DIM_VALUES[dim].filter((v) => input.tagNames.includes(v));
let printCounts = values('printCount');
let crafts = values('craft');
let logistics = values('logistics');
// CUSTOM 成员:管理员显式标签是唯一来源(craftLabel/logisticsLabel,自由文本)
const craftLabel = normalizeCraftTag(input.customLabels?.craft ?? '');
const craftLabel = input.customLabels?.craft ?? '';
const logisticsLabel = input.customLabels?.logistics ?? '';
if (!crafts.length && craftLabel) crafts = [craftLabel];
if (!logistics.length && logisticsLabel) logistics = [logisticsLabel];