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:
1 parent
28d6085d07
commit
52c71ee46a
78 files changed
+7423
-1702
No files matched your search
@@ -50,6 +50,23 @@ def _pin_maturity_lag_legacy(request):
|
||||
app.config["IN_TRANSIT_TRANSFER_MATURITY_LAG_DAYS"] = 1
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def _seed_default_transfer_type(request):
|
||||
"""默认启用类型配置种子(autouse,出生翻转后匹配创建必填且配置驱动)。
|
||||
|
||||
用途:Task 11 切换后 run_matching/create_matching 必填 transfer_type 且类型
|
||||
合法值=配置表 code;本 fixture 为请求 app 的用例预置一条与旧「类型 1
|
||||
硬编码」语义对齐的启用配置(doc_no 前缀 HOM/HOX/WTP + WTP→HOW 转换 +
|
||||
from/to 全 mapped),存量用例随语义平移后行为等价。专项用例可按 code
|
||||
覆盖/停用/补建其它类型。
|
||||
"""
|
||||
if "app" in getattr(request, "fixturenames", []):
|
||||
request.getfixturevalue("app")
|
||||
from tests.services.in_transit_transfer.factories import seed_transfer_type_config
|
||||
|
||||
seed_transfer_type_config()
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def fixed_clock() -> FakeClock:
|
||||
"""固定时钟:默认 2026-08-06 09:00:00+08:00(业务日 T=2026-08-06)。"""
|
||||
|
||||
Reference in new issue
Block a user