Repository navigation
fix(quality): 补齐 process/final 检验关联校验并新增契约测试 - #24
Merged
Merged
Conversation
- quality/process POST: 补 cardId 存在性校验(404) 与 cardNo/cardId 一致性校验(400) - quality/final POST: 补 cardId 存在性校验(404);PUT: 补记录存在性校验(404) - 新增 tests/integration/quality-process-flow.test.ts(13 用例)、quality-final-flow.test.ts(10 用例), 沿用 incoming 已修标准的状态机/数量不变量/状态联动口径,以红→绿暴露并闭合上述缺口 - 新增迁移 20261005_repair_seed_process_card_visibility.sql: 幂等恢复 10 张被软删流程卡, sys_migration 登记 batch=164,种子过程检孤儿记录归零 已知依赖(未纳入本 PR): process route 引用的 i18n key 'cardNoMismatch' 已写入 messages/*.json, 但随并行 WIP(StandardTable/PadScan/签样/色差等) 一并提交,本 PR 不含 messages 改动。
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch had an error being deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
质量模块三检体系中,
quality/incoming(IQC) 此前已修标准(19 例契约测试)。本次按同一口径补quality/process(IPQC) 与quality/final(FQC) 的契约测试,并以红→绿暴露两组关联完整性缺口后闭合。变更内容
校验缺口修复(route 层,verify-before-act)
quality/processPOST:补cardId存在性校验(不存在 → 404k_1emlkd9)、cardNo与cardId一致性校验(错位 → 400cardNoMismatch)。修复前两者均静默成功(返 200),会写入 source_no 与流程卡 card_no 错位的孤儿过程检。quality/finalPOST:补cardId存在性校验(INSERT...SELECT 命中 0 行仍静默成功 → 404)。quality/finalPUT:补记录存在性校验(UPDATE 0 行仍静默成功 → 404k_1emlkd9)。契约测试(红→绿)
tests/integration/quality-process-flow.test.ts(13 用例):缺参/非法值 400、状态机非法 400、cardId 不存在 404、cardNo 不一致 400、resultCode 映射、数量不变量、burdening_status 联动、PUT 缺 id/不存在 404、GET 200。tests/integration/quality-final-flow.test.ts(10 用例):非法值/缺字段 400、超计划数 400、cardId 不存在 404、resultCode+数量不变量、burdening_status(3/5)、PUT 缺 id/不存在 404、GET 200。种子数据修复
database/migrations/20261005_repair_seed_process_card_visibility.sql:幂等恢复 10 张被软删流程卡(按 card_no 列表),sys_migration登记 batch=164。修复前种子过程检 10 条全为孤儿(source_no 对应卡deleted=1),现已归零。验证
quality-process-flow13 passed、quality-final-flow10 passed(共 23/23 绿)。@/lib/db等捕获 SQL 副作用,状态机/数量不变量/状态联动口径对齐 incoming 已修标准。已知依赖(未纳入本 PR)
quality/processroute 引用的 i18n keycardNoMismatch已写入messages/*.json,但随并行 WIP(StandardTable/PadScan/签样/色差等)一并提交,本 PR 不含 messages 改动。在 messages 提交前,该错误路径会回退为原始 key 字符串;合入 messages 后即恢复正常翻译。待裁定(未做)
quality/process的scrap结果目前不更新prd_process_card.burdening_status(route 无对应分支)。本次仅修种子可见性,未动此逻辑;测试已标注待裁定,留待专项评估。