M18: implement operational workspaces

This commit is contained in:
NuklearRabbit
2026-08-10 12:41:28 +02:00
parent 8030753dbc
commit fe06ff75a1
33 changed files with 1082 additions and 95 deletions
+13 -2
View File
@@ -12,6 +12,18 @@ def test_attention_only_filters_flagged_vehicles(ops_client):
vehicles = response.json()
assert len(vehicles) > 0
assert all(v["attention"] for v in vehicles)
assert all(v["attention_reason"] for v in vehicles)
def test_vehicle_list_exposes_planning_and_service_context(ops_client):
vehicles = ops_client.get("/api/v1/vehicles").json()
assert vehicles
assert all("service_remaining_km" in vehicle for vehicle in vehicles)
assert all("next_booking_ref" in vehicle for vehicle in vehicles)
location = vehicles[0]["location"]
filtered = ops_client.get("/api/v1/vehicles", params={"location": location}).json()
assert filtered
assert all(vehicle["location"].casefold() == location.casefold() for vehicle in filtered)
def test_vehicle_page_preserves_filters_and_limits_rendered_records(ops_client):
@@ -56,8 +68,7 @@ def test_manager_can_record_maintenance_and_release_vehicle(ops_client):
detail = ops_client.get(f"/api/v1/vehicles/{vehicle['public_ref']}").json()
assert detail["operational_status"] == "maintenance"
assert any(
item["public_ref"] == response.json()["public_ref"]
for item in detail["maintenance"]
item["public_ref"] == response.json()["public_ref"] for item in detail["maintenance"]
)
released = ops_client.post(
f"/api/v1/vehicles/{vehicle['public_ref']}/release",