feat(in-transit-transfer): 打通ERP 写路径按票执行与已执行调拨单卡片入口

- 新增 TransferDocument 按票执行模型与单据号序列生成(document_id 独立模块,迁移 tt0d/tt8b)
- 发票行新增单位字段、matching_id 放宽可空,支持行与票两级执行口径(迁移 tt9c/tt1a)
- capability_client 新增 create_transfer 写契约与六态结果裁决,执行链补写前复查门禁
- 抽取/匹配/执行 Job 按 run/item/match 拆分并入 jobs store 队列,transfer 队列单实例 worker 配套本地启动脚本
- 首页新增「已执行调拨单」四统计卡入口与明细列表子视图,重查/重试/关闭/重新触发与筛选分页齐全
- 行评估新鲜度 TTL 从 10 分钟放宽为当日有效(86400s),跨日由文件版本对账门禁兜底
- 同步 chat/errors 文案四语言、测试全家与两份实施计划文档
This commit is contained in:
hugo committed 2026-09-27 18:13:25 +08:00
1 parent e750fa8602
commit 9f2b023a10
101 files changed
+11109 -2112

No files matched your search

@@ -15,6 +15,25 @@ import pytest
from tests.services.in_transit_transfer.fakes import FakeClock, FakeCapabilityClient, FakeRPA, FakeWeCom
@pytest.fixture(autouse=True)
def _stub_doc_sequence(monkeypatch):
"""单据级执行单号序列默认替身(autouse)。
用途:execution_service 生成 doc_no 默认读 PG 全局序列(transfer_doc_no_seq),
SQLite 测试库无序列后端;本替身按用例递增取值,需要精确序号的用例可
自行覆盖 execution_service._sequence_loader。
"""
counter = {"n": 0}
def _next() -> int:
counter["n"] += 1
return counter["n"]
monkeypatch.setattr(
"app.services.in_transit_transfer.execution_service._sequence_loader", _next,
)
@pytest.fixture
def fixed_clock() -> FakeClock:
"""固定时钟:默认 2026-08-06 09:00:00+08:00(业务日 T=2026-08-06)。"""
@@ -43,7 +62,7 @@ def wecom_fake() -> FakeWeCom:
def patch_source_file_status(monkeypatch):
"""执行文件对账门禁替身工厂:替换 execution_service 的来源文件状态投影。
用途:execute_items 门禁③按去重来源调 resolve_source_file_status(真实查询
用途:execute_items 门禁②按去重来源调 resolve_source_file_status(真实查询
收料文件表);单元测试注入替身避免触碰表数据。缺省全部来源投影为
ready 且 sha=dbs 夹具 checksum("d"*64,与 dbs_ready_file 行版本戳同源)。