Flow improvements

This commit is contained in:
2026-06-29 07:15:01 -04:00
parent 8d8cb9ccad
commit 0a49dfe219
16 changed files with 281 additions and 102 deletions
+28
View File
@@ -43,6 +43,34 @@ def test_authenticated_user_can_create_read_update_and_audit_ppr(auth_client, pp
assert any("Status changed from NEW to LANDED" in entry for entry in entries)
def test_ppr_departure_lifecycle_goes_landed_local_departed(auth_client, ppr_payload):
created = auth_client.post("/api/v1/pprs/", json=ppr_payload).json()
landed_response = auth_client.patch(
f"/api/v1/pprs/{created['id']}/status",
json={"status": "LANDED", "timestamp": "2026-06-20T10:30:00"},
)
local_response = auth_client.patch(
f"/api/v1/pprs/{created['id']}/status",
json={"status": "LOCAL", "timestamp": "2026-06-20T12:55:00"},
)
departed_response = auth_client.patch(
f"/api/v1/pprs/{created['id']}/status",
json={"status": "DEPARTED", "timestamp": "2026-06-20T13:05:00"},
)
assert landed_response.status_code == 200
assert local_response.status_code == 200
assert local_response.json()["status"] == "LOCAL"
assert local_response.json()["landed_dt"] == "2026-06-20T10:30:00"
assert local_response.json()["takeoff_dt"] == "2026-06-20T12:55:00"
assert local_response.json()["qsy_dt"] is None
assert departed_response.status_code == 200
assert departed_response.json()["status"] == "DEPARTED"
assert departed_response.json()["takeoff_dt"] == "2026-06-20T12:55:00"
assert departed_response.json()["qsy_dt"] == "2026-06-20T13:05:00"
def test_ppr_list_supports_status_date_and_pagination_filters(auth_client, ppr_factory):
ppr_factory(
ac_reg="G-NEW1",