"""Scenario: SFO Maintenance Delay — MEL issue cascading to 2 flights. Aircraft N82301 has APU MEL, delay cascading. Tests FCE maintenance-caused delay explanation and Handover MEL flag section. """ from datetime import datetime, timezone from mcp_servers.data.models import ( CrewMember, CrewRole, DelayCause, FlightData, FlightStatus, MELItem, MPStatus, Passenger, RebookingCase, ) SCENARIO_ID = "maintenance_delay_sfo" SCENARIO_NAME = "SFO MEL Issue" SCENARIO_DESCRIPTION = ( "Aircraft N82301 APU inoperative (MEL). Delay cascading to 2 flights. " "Route restriction if divert needed." ) SCENARIO_HUBS = ["SFO"] FLIGHTS: list[FlightData] = [ FlightData( flight_id="UA712", origin="SFO", destination="EWR", scheduled_departure=datetime(2026, 4, 11, 19, 0, tzinfo=timezone.utc), actual_departure=None, scheduled_arrival=datetime(2026, 4, 12, 3, 30, tzinfo=timezone.utc), status=FlightStatus.DELAYED, delay_minutes=65, delay_cause=DelayCause.MAINTENANCE, aircraft_tail="N82301", gate="G4", crew_ids=["CR-4001", "CR-4002", "CR-4010"], passenger_count=198, ), FlightData( flight_id="UA724", origin="SFO", destination="DEN", scheduled_departure=datetime(2026, 4, 11, 20, 30, tzinfo=timezone.utc), scheduled_arrival=datetime(2026, 4, 11, 23, 45, tzinfo=timezone.utc), status=FlightStatus.DELAYED, delay_minutes=30, delay_cause=DelayCause.LATE_AIRCRAFT, aircraft_tail="N82302", gate="G8", crew_ids=["CR-4003", "CR-4004"], passenger_count=165, ), FlightData( flight_id="UA760", origin="SFO", destination="LAX", scheduled_departure=datetime(2026, 4, 11, 18, 30, tzinfo=timezone.utc), scheduled_arrival=datetime(2026, 4, 11, 19, 45, tzinfo=timezone.utc), status=FlightStatus.ON_TIME, aircraft_tail="N82303", gate="G12", crew_ids=["CR-4005", "CR-4006"], passenger_count=140, ), ] CREW: list[CrewMember] = [ CrewMember(crew_id="CR-4001", name="Capt. Novak", role=CrewRole.CAPTAIN, duty_hours_elapsed=6.0, duty_hours_limit=14.0, rest_hours_since_last=16.0, next_scheduled_flight="UA712", base_hub="SFO"), CrewMember(crew_id="CR-4002", name="FO Agrawal", role=CrewRole.FIRST_OFFICER, duty_hours_elapsed=6.0, duty_hours_limit=14.0, rest_hours_since_last=15.0, next_scheduled_flight="UA712", base_hub="SFO"), CrewMember(crew_id="CR-4003", name="Capt. Svensson", role=CrewRole.CAPTAIN, duty_hours_elapsed=5.0, duty_hours_limit=14.0, rest_hours_since_last=18.0, next_scheduled_flight="UA724", base_hub="SFO"), CrewMember(crew_id="CR-4004", name="FO Rivera", role=CrewRole.FIRST_OFFICER, duty_hours_elapsed=5.0, duty_hours_limit=14.0, rest_hours_since_last=17.0, next_scheduled_flight="UA724", base_hub="SFO"), CrewMember(crew_id="CR-4005", name="Capt. Wallace", role=CrewRole.CAPTAIN, duty_hours_elapsed=3.0, duty_hours_limit=14.0, rest_hours_since_last=22.0, next_scheduled_flight="UA760", base_hub="SFO"), CrewMember(crew_id="CR-4006", name="FO Zhao", role=CrewRole.FIRST_OFFICER, duty_hours_elapsed=3.0, duty_hours_limit=14.0, rest_hours_since_last=20.0, next_scheduled_flight="UA760", base_hub="SFO"), CrewMember(crew_id="CR-4010", name="FA Douglas", role=CrewRole.FA, duty_hours_elapsed=5.5, duty_hours_limit=14.0, rest_hours_since_last=16.0, next_scheduled_flight="UA712", base_hub="SFO"), ] CREW_NOTES: dict[str, list[str]] = { "UA712": [ "MEL item #47-3: APU inoperative on N82301.", "Maintenance team inspecting — estimated release in 45 min.", "APU MEL restricts routing to airports with ground power only.", "Current SFO→EWR route unaffected, but flag if divert to BDL or HPN needed.", ], "UA724": [ "Delay cascading from UA712 — shared gate G8 not available until UA712 pushes.", ], } MAINTENANCE: dict[str, list[MELItem]] = { "N82301": [ MELItem( mel_id="MEL-SFO-473", aircraft_tail="N82301", system="APU", description="Auxiliary Power Unit inoperative. Aircraft requires external ground power for engine start and gate operations.", restriction="Routing restricted to airports with ground power availability. Cannot divert to airports without ground power units (e.g., BDL, HPN).", expires=datetime(2026, 4, 18, 0, 0, tzinfo=timezone.utc), ), ], } REBOOKINGS: list[RebookingCase] = [] PASSENGERS: list[Passenger] = []