fix(engine): 确认闸条件档在发卡装配被丢 —— 类型不一致的卡从前点得动
CI / ci (push) Failing after 11s

活动声明了 gateWhen,发卡装配的手写清单没点它的名:落库载荷 undefined,
按钮禁用与服务端拒收一起无声失效(手写字段清单第四次丢值,与 variant
上次被丢的同一段)。抽 cardConditionGate 校验着转交(5 测);e2e w05
数据卡阶段补末端断言 expectCardGateWhen。活体验证:载荷带条件 → 闸关 →
API 强行确认 400;e2e 案例 0 全绿。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LKMZDwMbyKzjw6Hembwvet
This commit is contained in:
xcs
2026-09-01 11:09:48 +08:00
co-authored by Claude Fable 5
parent 0e02bb9411
commit 7ed997187e
4 changed files with 103 additions and 0 deletions
+23
View File
@@ -615,6 +615,13 @@ const SUITES = {
rowKey: 'internal_pn',
blankCol: 'brand_name',
expectGateBlock: true,
/*
* **确认闸的条件档必须跟到工单载荷上**(2026-09-01 用户实测:「两个芯片类型不一样…
* 卡片还可以点击下一步」)。配方声明了 `gateWhen`,发卡装配的手写清单没点它的名 ——
* 落库载荷里是 undefined,按钮禁用与服务端拒收一起无声失效(手写字段清单第四次丢值,
* 与 variant 上次被丢的是同一段)。这类丢值只有末端断言拦得住:卡一到手就查载荷。
*/
expectCardGateWhen: true,
edits: [],
extraTables: [
/*
@@ -1340,6 +1347,9 @@ async function runCase(suite, kase) {
let fileCheck;
let gateLeaked = false;
const gateChecked = new Set();
/** 确认闸的条件档(gateWhen)没跟到工单载荷上 —— 类型不一致将拦不住(末端断言,见 w05 数据卡阶段) */
let gateWhenMissing = false;
let gateWhenChecked = false;
let decisions = 0;
missedRows.clear();
asked.length = 0;
@@ -1540,6 +1550,15 @@ async function runCase(suite, kase) {
: ` ⚠️ 缺着必填还放过去了:提交闸失效`,
);
}
if (stage.expectCardGateWhen === true && !gateWhenChecked) {
gateWhenChecked = true;
const { body: det } = await api(`/api/desk/tasks/${taskId}`);
const wo = (det?.workOrders ?? []).find((o) => o.id === card.id);
if (wo?.gateWhen === undefined) {
gateWhenMissing = true;
console.log(' ⚠️ 确认闸的条件档(gateWhen)没跟到工单载荷上 —— 类型不一致将拦不住,判失败');
} else console.log(' 确认闸条件已随卡落库(gateWhen 在载荷上)');
}
/*
* **两阶段自定义填表**(w05「候选缺库·新建类型」专用)—— 在空手交卷的闸测过**之后**、
* 常规 `buildEdits` 之前跑一次:先铸 `parts.chip_type` 的自增 `type_id`,读回来才知道
@@ -1675,6 +1694,10 @@ async function runCase(suite, kase) {
console.log(' ⚠️ 数据工单确认即入库那道门没兑现 —— 判失败');
ok = false;
}
if (gateWhenMissing) {
console.log(' ⚠️ 确认闸条件(gateWhen)被链上丢掉 —— 判失败');
ok = false;
}
// 「超限才叫人」是 A4 的要害:该叫的那一单没叫,等于底价门禁是摆设
if (missedRows.size > 0) {
console.log(` ⚠️ 案例点名要填的行,整例跑完也没在件上出现过(${missedRows.size} 处:${[...missedRows].slice(0, 3).join('、')}…)—— 判失败`);