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>
This commit is contained in:
hugoandCursor committed 2026-10-19 10:46:06 +08:00
1 parent ffc0d4a430
commit 39fe3c05f2
453 files changed
+17945 -8646

No files matched your search

@@ -46,7 +46,7 @@ def test_upload_unknown_error_codes_are_stable():
def test_inventory_callback_id_is_checked_before_attempt_identity(app):
"""库存回调先按 callback_id 去重,跨 Attempt 重放不得写入另一条 Attempt。"""
from app import db
from app.models import ShippingNotice, ShippingTaskInventoryRpaAttempt
from app.models import ShippingNotice, FreightRpaOnhandTaskAttempt
from app.services.shipping_notice.per_source_rpa_service import per_source_callback_handler
with app.app_context():
@@ -56,13 +56,13 @@ def test_inventory_callback_id_is_checked_before_attempt_identity(app):
# 冻结的逐源 Attempt 须携带完整 v2 身份(lease_token / candidate_set / execution / gate),
# 否则回调会先在 _validate_callback_attempt_identity 被 identity_mismatch 拒绝,
# 无法走到失败分支去写 callback_id。
first = ShippingTaskInventoryRpaAttempt(
first = FreightRpaOnhandTaskAttempt(
task_no=task.task_no, source_code='SRC-A', attempt_no=1,
source_run_no='PSR-FIRST', status='failed', callback_id=None,
lease_token='lease-first',
extra_json={'candidate_set_id': 1, 'execution_id': 1, 'gate_id': 1},
)
second = ShippingTaskInventoryRpaAttempt(
second = FreightRpaOnhandTaskAttempt(
task_no='SN-CB-ID-OTHER', source_code='SRC-B', attempt_no=1,
source_run_no='PSR-SECOND', status='failed', callback_id=None,
)