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
@@ -48,10 +48,17 @@ def test_bulk_matching_300_invoices(transfer_db):
|
||||
|
||||
seed_rows_from_file("DBS-AWSBI", deps, "2026-08-06")
|
||||
started = time.perf_counter()
|
||||
summary = create_matching(source_codes=["DBS-AWSBI"], business_date="2026-08-06", deps=deps)
|
||||
summary = create_matching(source_codes=["DBS-AWSBI"], business_date="2026-08-06", deps=deps, transfer_type="in_transit_to_hub")
|
||||
elapsed = time.perf_counter() - started
|
||||
assert summary.counts.executable_count == 300
|
||||
assert summary.counts.file_invoice_count == 300
|
||||
restored = restore_matching(summary.matching_id)
|
||||
assert len(restored["items"]) == 300
|
||||
print(f"\n[perf] bulk matching 300 invoices: {elapsed:.3f}s")
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def _seed_transfer_type(transfer_db):
|
||||
"""类型配置化(Task 11/D8):性能用例预置默认启用类型(匹配创建必填)。"""
|
||||
from tests.services.in_transit_transfer.factories import seed_transfer_type_config
|
||||
|
||||
seed_transfer_type_config()
|
||||
Reference in new issue
Block a user