From 80f77c1d9bdc18eecc3dd069a232f9cc42f53557 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Misbach?= Date: Tue, 19 Mar 2024 01:14:46 +0100 Subject: [PATCH] [mock_uss/f3548v21/flight_planning] Validate operational intent are not in the past (#554) --- monitoring/mock_uss/f3548v21/flight_planning.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/monitoring/mock_uss/f3548v21/flight_planning.py b/monitoring/mock_uss/f3548v21/flight_planning.py index 72b4531c52..1f7fce5d8a 100644 --- a/monitoring/mock_uss/f3548v21/flight_planning.py +++ b/monitoring/mock_uss/f3548v21/flight_planning.py @@ -81,6 +81,16 @@ def validate_request(op_intent: f3548_v21.OperationalIntent) -> None: f"Operational intent is activated but has no volume currently active (now: {now})" ) + # Validate intent is not (entirely) in the past + now = arrow.utcnow().datetime + volumes = Volume4DCollection.from_interuss_scd_api( + op_intent.details.volumes + op_intent.details.off_nominal_volumes + ) + if volumes.time_end.datetime < now: + raise PlanningError( + f"Operational intent is in the past (time_end: {volumes.time_end.datetime}; now: {now})" + ) + def check_for_disallowed_conflicts( new_op_intent: f3548_v21.OperationalIntent,