Files
syops/docs/adr/0004-freight-rpa-report-ownership.md
T
hugoandCursor 39fe3c05f2 feat(freight-rpa): 库存/收料改名在手/入站,报表归属RPA,类名统一FreightRpa
把 shipping 侧 inventory/receipt 词根迁到 onhand/inbound,29 张表与
枚举/权限/前端/i18n 同步改名;在手与入站报表配置及文件改由 freight_rpa
持有,发货与调拨仅按 source_code 消费;ORM 类加 FreightRpa 前缀,
上传动作改为 freight_rpa_upload。含类名与上传动作改名规格文档。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-19 10:46:06 +08:00

13 lines
1.3 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;`handle_onhand_report` 由 `register_onhand_sinks` 注册,`handle_inbound_report` 由 `register_inbound_sinks` 注册。
文件在 RPA 事务提交之后,同一次 HTTP 请求调用 `handle_onhand_report` / `handle_inbound_report`。失败返回 5xx,文件保留,Worker 重试。在手批量 HTTP 入口只把既有发货作业入队,该作业在文件提交之后分发在手事实。不另建服务、不引入消息队列。出站抓取不在本决策内;`report_kind=outbound` 只占位。
## Consequences
- 业务方不再写站点、配置、解析方案和报表文件,只保存 `source_code`。
- 处理函数失败不回滚已提交文件,Worker 凭 5xx 重试整笔回调。
- 在手批量与单笔分叉:批量入口只入队既有发货作业,不在该 HTTP 请求内分发。
- outbound 留在事实白名单;本阶段不注册处理函数,也不做出站抓取。