feat(in-transit-transfer): 调拨类型配置化与库存异动档原子切换

调拨类型从四处硬编码升级为管理页可配置:范围规则(受控字段白名单,规则间且/值间或)、
仓库定义(映射档/固定仓双模式角色解析)、字段转换(批号前缀替换,匹配时快照固化到 scope_json)。

新建 transfer_movement_ledger 库存异动档(参照 ERP inaj_t):自然键幂等增量落档
(插入/换证更新/跳过/缺席不删/执行封存永不触碰),圈档互斥保证一条档记录一生只绑一次明细;
收料证据落地改写档、停写 items。transfer_invoice_items 出生翻转为匹配时从档圈定创建
(一次匹配永久写入 matching_id+ledger_record_id),回查对账/取消释放/执行门禁/待匹配桶全链路适配。

迁移 tt10→tt13 单 head:类型配置表、异动档、items 档外键、transfer_runs.transfer_type 放宽 String(64)。

随行披露:设计文档与实施计划、ADR 0001/0002、in-transit-transfer 术语表、
demand/funclist/technical 文档更新同批入库。
This commit is contained in:
hugo committed 2026-10-15 13:02:17 +08:00
1 parent 28d6085d07
commit 52c71ee46a
78 files changed
+7423 -1702

No files matched your search

+4 -1
View File
@@ -28,11 +28,14 @@ class ValidationError(AppError):
*,
code: str = "VALIDATION.INVALID_PARAM",
details: dict[str, Any] | None = None,
http_status: int = 400,
):
super().__init__(
code=code,
message=message,
http_status=400,
# 默认 400(参数形态类校验);业务契约指定状态码时显式传入
# (如调拨类型门禁 REQUIRED/NOT_CONFIGURED/DISABLED = 422,规格 §11)。
http_status=http_status,
details=details or {},
retryable=False,
)