feat(freight-rpa): 批次R解耦编排层并切换 onhand/inbound 契约

将 RPA 编排收编至 freight_rpa,回调迁 /api/freight-rpa/*。
共享目录与 Worker 契约一次切换至 onhand/inbound/upload,
并补 outbound 骨架与 tt16 排程 job key 迁移。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
hugoandCursor committed 2026-10-17 23:18:48 +08:00
1 parent bf3154033b
commit ffc0d4a430
147 files changed
+4221 -2678

No files matched your search

+7 -7
View File
@@ -6,10 +6,10 @@ from app.models import ScheduleRun, ScheduleTask, User
def test_internal_job_shipping_inventory_rpa_writes_trigger(client, app, tmp_path):
"""POST /api/internal/jobs/shipping-inventory-rpa 应写入 batch trigger。"""
"""POST /api/internal/jobs/freight-rpa-onhand 应写入 batch trigger。"""
trigger_dir = tmp_path / "triggers"
trigger_dir.mkdir()
app.config["FREIGHT_RPA_SHARED_INVENTORY_TRIGGER_DIR"] = str(trigger_dir)
app.config["FREIGHT_RPA_SHARED_ONHAND_TRIGGER_DIR"] = str(trigger_dir)
with app.app_context():
from app import db
@@ -21,7 +21,7 @@ def test_internal_job_shipping_inventory_rpa_writes_trigger(client, app, tmp_pat
schedule_no="SCH-IJ-001",
name="货代库存每日导出",
schedule_type="platform_job",
platform_api_path="shipping-inventory-rpa",
platform_api_path="freight-rpa-onhand",
data_source_type=None,
owner_user_id=user.id,
cron_expr="0 3 * * *",
@@ -41,7 +41,7 @@ def test_internal_job_shipping_inventory_rpa_writes_trigger(client, app, tmp_pat
run_id = run.id
resp = client.post(
"/api/internal/jobs/shipping-inventory-rpa",
"/api/internal/jobs/freight-rpa-onhand",
data=json.dumps({"run_no": run_no, "schedule_task_id": task_id}),
content_type="application/json",
)
@@ -95,7 +95,7 @@ def test_internal_job_rejects_mismatched_schedule_task_id(client, app):
task_id = task.id
resp = client.post(
"/api/internal/jobs/shipping-inventory-rpa",
"/api/internal/jobs/freight-rpa-onhand",
data=json.dumps({"schedule_task_id": task_id}),
content_type="application/json",
)
@@ -114,7 +114,7 @@ def test_internal_job_rejects_foreign_run_no(client, app):
schedule_no="SCH-IJ-A",
name="shipping task",
schedule_type="platform_job",
platform_api_path="shipping-inventory-rpa",
platform_api_path="freight-rpa-onhand",
data_source_type=None,
owner_user_id=user.id,
cron_expr="0 3 * * *",
@@ -143,7 +143,7 @@ def test_internal_job_rejects_foreign_run_no(client, app):
run_no = run.run_no
resp = client.post(
"/api/internal/jobs/shipping-inventory-rpa",
"/api/internal/jobs/freight-rpa-onhand",
data=json.dumps({"schedule_task_id": task_a_id, "run_no": run_no}),
content_type="application/json",
)