Book in functions
This commit is contained in:
@@ -63,6 +63,28 @@ async def get_public_arrivals(db: Session = Depends(get_db)):
|
||||
'flight_type': flight.flight_type.value
|
||||
})
|
||||
|
||||
# Add booked-in arrivals
|
||||
booked_in_arrivals = crud_arrival.get_multi(db, limit=1000)
|
||||
for arrival in booked_in_arrivals:
|
||||
# Only include BOOKED_IN and LANDED arrivals
|
||||
if arrival.status not in (ArrivalStatus.BOOKED_IN, ArrivalStatus.LANDED):
|
||||
continue
|
||||
# For BOOKED_IN, only include those from today; for LANDED, include all
|
||||
if arrival.status == ArrivalStatus.BOOKED_IN:
|
||||
if not (today_start <= arrival.created_dt < today_end):
|
||||
continue
|
||||
|
||||
arrivals_list.append({
|
||||
'registration': arrival.registration,
|
||||
'callsign': arrival.callsign,
|
||||
'type': arrival.type,
|
||||
'in_from': arrival.in_from,
|
||||
'eta': arrival.eta,
|
||||
'landed_dt': arrival.landed_dt,
|
||||
'status': arrival.status.value,
|
||||
'isBookedIn': True
|
||||
})
|
||||
|
||||
return arrivals_list
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user