feat(shipping-notice): 库存缺口料号兜底自动放行并新增料号可用量列
- 匹配器按料号二次汇总 part_available_qty 随行级匹配事实持久化(新列,迁移 0a575f3a) - 缺口行料号总库存满足需求时系统自动放行,复用人工放行同一落库/审计/门禁链路,证据按预约优先→料号兜底自动带出 - 前端库存匹配表原「可用数量」列改为「预约数量」,其后新增「可用数量」(料号总库存)列 - DSV 连接器防误点「忘记密码」链接并参数化料号报表取数,库存 worker 按料号查询配套 - 收料就绪与来源状态联动调整;casdoor 未识别认证错误日志保留原始异常堆栈 - 同步门禁/投影/持久化测试、调拨卡片文案四语言与文档
This commit is contained in:
1 parent
4e97553f42
commit
386f93108c
62 files changed
+4000
-219
No files matched your search
@@ -625,6 +625,41 @@ def test_retry_rpa_parse_failed_still_failed_reports_not_ok(app, client, admin_h
|
||||
assert called["rpa"] == 0
|
||||
|
||||
|
||||
def test_retry_rpa_batch_requires_source_codes(app, client, admin_headers):
|
||||
"""空 source_codes → 400(批量端点参数卡控)。"""
|
||||
response = client.post(
|
||||
f"{API_PREFIX}/sources/retry-rpa-batch", headers=admin_headers, json={"source_codes": []},
|
||||
)
|
||||
assert response.status_code == 400
|
||||
|
||||
|
||||
def test_retry_rpa_batch_delegates_to_batch_trigger_service(app, client, admin_headers, monkeypatch):
|
||||
"""批量端点把 source_codes 原样交给 trigger_receipt_rpa_batch 并回传结果 envelope。"""
|
||||
captured: dict = {}
|
||||
|
||||
def fake_batch(*, source_codes, business_date, reason):
|
||||
captured.update(source_codes=source_codes, business_date=business_date, reason=reason)
|
||||
return {
|
||||
"ok": True, "triggered": True, "trigger_path": "/tmp/trigger.json",
|
||||
"results": [{"source_code": code, "ok": True} for code in source_codes],
|
||||
}
|
||||
|
||||
monkeypatch.setattr(
|
||||
"app.services.in_transit_transfer.receipt_trigger_service.trigger_receipt_rpa_batch", fake_batch,
|
||||
)
|
||||
response = client.post(
|
||||
f"{API_PREFIX}/sources/retry-rpa-batch", headers=admin_headers,
|
||||
json={"source_codes": ["DSV360_AWSDU", "DSV360_AWSSG"]},
|
||||
)
|
||||
assert response.status_code == 200
|
||||
body = response.get_json()["data"]
|
||||
# [断言意图] 端点只做参数卡控与转发:来源列表原样下传、reason 固定业务语义。
|
||||
assert captured["source_codes"] == ["DSV360_AWSDU", "DSV360_AWSSG"]
|
||||
assert captured["reason"] == "transfer_retry_receipt"
|
||||
assert body["ok"] is True and body["triggered"] is True
|
||||
assert [item["source_code"] for item in body["results"]] == ["DSV360_AWSDU", "DSV360_AWSSG"]
|
||||
|
||||
|
||||
def test_metrics_endpoint(app, transfer_db, client, admin_headers, transfer_deps):
|
||||
"""运营指标端点:返回 Run/明细/待处理/通知失败结构。"""
|
||||
response = client.get(f"{API_PREFIX}/metrics", headers=admin_headers)
|
||||
|
||||
Reference in new issue
Block a user