Skip to content

Commit 80f77c1

Browse files
authored
[mock_uss/f3548v21/flight_planning] Validate operational intent are not in the past (#554)
1 parent c784033 commit 80f77c1

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

monitoring/mock_uss/f3548v21/flight_planning.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,16 @@ def validate_request(op_intent: f3548_v21.OperationalIntent) -> None:
8181
f"Operational intent is activated but has no volume currently active (now: {now})"
8282
)
8383

84+
# Validate intent is not (entirely) in the past
85+
now = arrow.utcnow().datetime
86+
volumes = Volume4DCollection.from_interuss_scd_api(
87+
op_intent.details.volumes + op_intent.details.off_nominal_volumes
88+
)
89+
if volumes.time_end.datetime < now:
90+
raise PlanningError(
91+
f"Operational intent is in the past (time_end: {volumes.time_end.datetime}; now: {now})"
92+
)
93+
8494

8595
def check_for_disallowed_conflicts(
8696
new_op_intent: f3548_v21.OperationalIntent,

0 commit comments

Comments
 (0)