feat(shipping_notice): 新增货代订单全流程业务模块及配套基建

本次提交新增货代订单处理全流程的完整业务能力、数据库迁移与测试用例:
1.  统一追加式审计事件体系,支持全链路不可篡改的业务追溯
2.  货代任务撤销、版本替代管控逻辑,规范已上传订单的合规版本更替
3.  订单抽取路由审计、模板自动冻结资格、路由计数等核心业务基建
4.  EML订单补充表解析契约与合并逻辑,完善订单补全能力
5.  Chatflow只读能力令牌校验机制,保障工具调用安全
6.  人工复核证据校验服务,规范人工审核的证据留存
所有变更均配套完整的单元测试与迁移契约测试,支持受控回退
This commit is contained in:
hugo committed 2026-07-28 08:56:58 +08:00
1 parent 90f77634d6
commit 1f3ecb87b7
128 files changed
+3635 -2074

No files matched your search

@@ -12,7 +12,7 @@ from typing import Any
from app.core.errors import ValidationError
from app.services.shipping_notice.notice_lines import non_atomic_part_number_field, normalize_notice_line
from app.services.shipping_notice.po_number import normalize_po_number
from app.services.shipping_notice.po_number import normalize_atomic_po_number
from app.services.shipping_notice.reservation_id import validated_reservation_id
BUILD_REQUIRED_FIELDS = ('part_number', 'qty')
@@ -59,7 +59,10 @@ def assess_candidate_business_summary(summary: dict[str, Any] | None) -> dict[st
normalized_summary = dict(raw)
normalized_summary['lines'] = normalized_lines
normalized_summary['po_number'] = normalize_po_number(raw.get('po_number')) or None
# customer_po_number 是动态 Schema 的正式字段;po_number 保留为 Candidate/履约链路的兼容投影。
normalized_summary['po_number'] = normalize_atomic_po_number(
raw.get('customer_po_number') or raw.get('po_number')
) or None
normalized_summary['reservation_ids'] = sorted({
normalized
for line in normalized_lines