feat: extend operational investigation workflows
Generic Container CI/CD / test-build-publish (push) Successful in 3m53s
Server CI/CD v2 / build-test-publish-and-deploy (push) Successful in 3m52s

This commit is contained in:
2026-10-30 17:30:19 +08:00
parent 63af998045
commit 05183aff93
82 changed files with 4644 additions and 330 deletions
@@ -24,7 +24,7 @@ class ManagedStore:
now = "2026-09-18T00:00:00Z"
return command.model_dump(mode="json", exclude={"request_id"}) | {
"work_order_id": str(uuid4()), "project_id": str(PROJECT_ID), "revision": 1,
"origin": "synthetic", "created_at": now, "updated_at": now,
"origin": getattr(command, "origin", "system_data"), "created_at": now, "updated_at": now,
"created_by": str(USER_ID), "updated_by": str(USER_ID), "activity": [],
}
@@ -88,12 +88,17 @@ def test_managed_work_order_and_data_routes_are_typed_crud():
"scenario_code": "WQ-SECONDARY-SUPPLY-001",
"feedback_requirements": ["上传检测结果"],
})
assert created.status_code == 201 and created.json()["origin"] == "synthetic"
assert created.status_code == 201 and created.json()["origin"] == "system_data"
assert created.json()["work_order_type"] == "water_quality_complaint"
assert created.json()["location"] == "演示小区"
assert created.json()["scenario_code"] == "WQ-SECONDARY-SUPPLY-001"
assert created.json()["feedback_requirements"] == ["上传检测结果"]
assert "subtasks" not in created.json()
rejected = client.post("/api/sample/v1/work-orders", json={
"request_id": str(uuid4()), "title": "非法来源", "summary": "不接受演练来源",
"origin": "synthetic",
})
assert rejected.status_code == 422
work_order_id = created.json()["work_order_id"]
changed = client.patch(f"/api/sample/v1/work-orders/{work_order_id}", json={
"request_id": str(uuid4()), "expected_revision": 1, "status": "awaiting_reply",