Files
syops/docs/adr/0004-freight-rpa-report-ownership.md
T
hugo 911afa0f73 feat(freight-rpa): 增加出站报表配置与回调支持,重构相关服务
- 将 RPA 管理 API 扩展至出站报表配置,新增出站相关的回调接口。
- 重构 freight_rpa_report_config_service,支持入站与出站报表配置的管理。
- 更新 ORM 模型,增加出站报表相关的持久化模型。
- 统一命名规范,确保在手、入站与出站的概念一致性。
2026-10-19 18:45:16 +08:00

13 lines
1.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Freight RPA 报表归 RPA,业务方只消费报表事实
阶段 A 只归位编排,写入权仍在发货代码。2026-10-18 收进同一 Flask 进程:登录连接、站点、在手配置、入站/出站配置、解析方案、在手/入站/出站文件由 `freight_rpa` 写入。业务方只消费报表事实(`report_kind`、`source_code`、`file_id`、`sha256`、`ok`、`error_code`、`error_message`,可选 `unit_run_id`)。本阶段分发 onhand、inbound 与 outbound;`handle_onhand_report` 由 `shipping_notice.rpa_sinks.register_onhand_sinks` 注册,`handle_inbound_report` / `handle_outbound_report` 由 `in_transit_transfer.rpa_sinks.register_inbound_sinks` / `register_outbound_sinks` 注册(2026-10-19 出站全栈;组合根按消费域拆分)。
文件在 RPA 事务提交之后,同一次 HTTP 请求调用 `handle_onhand_report` / `handle_inbound_report` / `handle_outbound_report`。失败返回 5xx,文件保留,Worker 重试。在手批量 HTTP 入口只把既有发货作业入队,该作业在文件提交之后分发在手事实。不另建服务、不引入消息队列。
## Consequences
- 业务方不再写站点、配置、解析方案和报表文件,只保存 `source_code`。
- 处理函数失败不回滚已提交文件,Worker 凭 5xx 重试整笔回调。
- 在手批量与单笔分叉:批量入口只入队既有发货作业,不在该 HTTP 请求内分发。
- `report_kind=outbound` 已注册 `handle_outbound_report`(在途调拨 sink);出站不建 notification_deliveries,运维与入站对称走排程。