feat(freight-rpa): 增加出站报表配置与回调支持,重构相关服务

- 将 RPA 管理 API 扩展至出站报表配置,新增出站相关的回调接口。
- 重构 freight_rpa_report_config_service,支持入站与出站报表配置的管理。
- 更新 ORM 模型,增加出站报表相关的持久化模型。
- 统一命名规范,确保在手、入站与出站的概念一致性。
This commit is contained in:
hugo committed 2026-10-19 18:45:16 +08:00
1 parent 39fe3c05f2
commit 911afa0f73
152 files changed
+9861 -2984

No files matched your search

+5 -5
View File
@@ -212,7 +212,7 @@ def test_onhand_repair_envelope_matches_legacy(client, tool_auth_headers):
# ---------------------------------------------------------------------------
def test_inbound_unit_progress_envelope_matches_legacy(client, tool_auth_headers):
"""inbound-unit-progress(旧直连 jsonify({'success':True,'data':mark_receipt_unit_processing(p)})):
"""inbound-unit-progress(旧直连 jsonify({'success':True,'data':mark_inbound_unit_processing(p)})):
schema 非法分支 data={'updated':False,'reason':'callback_schema_invalid'},证明 sink 已注册
(未注册会是 404 FREIGHT_RPA.SINK_NOT_REGISTERED)且 envelope 未漂移。"""
resp = client.post("/api/freight-rpa/inbound-unit-progress", json={}, headers=tool_auth_headers)
@@ -235,17 +235,17 @@ def test_inbound_batch_progress_envelope_matches_legacy(client, tool_auth_header
def test_inbound_batch_ready_schema_invalid_reaches_business_validation(client, tool_auth_headers):
"""inbound-batch-ready sink 已注册:schema 非法穿透到业务校验(400 +
SHIPPING.RECEIPT_CALLBACK_INVALID),而非未注册 404;错误 envelope 与拆分前同形
SHIPPING.INBOUND_CALLBACK_INVALID),而非未注册 404;错误 envelope 与拆分前同形
(旧端点在 jsonify 之前由 ingest 抛 ValidationError → 全局 AppError handler)。"""
resp = client.post("/api/freight-rpa/inbound-batch-ready", json={}, headers=tool_auth_headers)
assert resp.status_code == 400
body = resp.get_json()
assert body["success"] is False
assert body["error"]["code"] == "SHIPPING.RECEIPT_CALLBACK_INVALID"
assert body["error"]["code"] == "SHIPPING.INBOUND_CALLBACK_INVALID"
def test_inbound_batch_ready_unknown_unit_is_404(client, tool_auth_headers):
"""inbound-batch-ready 未知 callback_id:404 + SHIPPING.RECEIPT_UNIT_NOT_FOUND,
"""inbound-batch-ready 未知 callback_id:404 + SHIPPING.INBOUND_UNIT_NOT_FOUND,
与拆分前 ingest 直连时的 NotFoundError 路径逐字一致。"""
resp = client.post(
"/api/freight-rpa/inbound-batch-ready",
@@ -254,7 +254,7 @@ def test_inbound_batch_ready_unknown_unit_is_404(client, tool_auth_headers):
)
assert resp.status_code == 404
body = resp.get_json()
assert body["error"]["code"] == "SHIPPING.RECEIPT_UNIT_NOT_FOUND"
assert body["error"]["code"] == "SHIPPING.INBOUND_UNIT_NOT_FOUND"
@pytest.mark.pure_unit