When the API already enforce this by its data structure.
{
"name": "Same Flight and Cabin for All Passengers",
"description": "All passengers in a reservation must fly the same flights in the same cabin when booking.",
"references": [
"All passengers must fly the same flights in the same cabin."
],
}
def book_reservation(
self,
user_id: str,
origin: str,
destination: str,
flight_type: FlightType,
cabin: CabinClass,
flights: List[FlightInfo | dict],
**passengers: List[Passenger | dict],**
payment_methods: List[Payment | dict],
total_baggages: int,
nonfree_baggages: int,
insurance: Insurance,
) -> Reservation:
When the API already enforce this by its data structure.
example:
API: