Skip to content

Commit

Permalink
Updated seat selection on FlightBooking
Browse files Browse the repository at this point in the history
  • Loading branch information
Xedros committed Jul 2, 2024
1 parent 3ee4cba commit cd10048
Showing 1 changed file with 121 additions and 54 deletions.
175 changes: 121 additions & 54 deletions src/schema/flight-booking.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,8 @@
"sourceOutputKey": "availableInboundFares",
"inputMethod": "SelectOne"
},
"selectedSeats": {
"typeRef": "#/domains/FlightBooking/types/SelectedSegmentSeats",
"sourceOutputKey": "availableSeats",
"inputMethod": "SeatSelection",
"selectedDynamicSeats": {
"typeRef": "#/domains/FlightBooking/types/SelectedDynamicSeats",
"dynamic": true
},
"voucher": {
Expand Down Expand Up @@ -120,8 +118,8 @@
"typeRef": "#/domains/FlightBooking/types/ListOfLuggageWithPrice",
"description": "The luggage which can be selected for the passengers."
},
"availableSeats": {
"typeRef": "#/domains/FlightBooking/types/AvailableSegmentSeats",
"availableDynamicSeats": {
"typeRef": "#/domains/FlightBooking/types/AvailableDynamicSeats",
"dynamic": true
},
"availableFrequentFlyerProgrammes": {
Expand Down Expand Up @@ -658,76 +656,86 @@
"description": "A list of luggage with price.",
"items": { "$ref": "#/domains/FlightBooking/types/LuggageWithPrice" }
},
"SelectedSegmentSeats": {
"SelectedDynamicSeats": {
"type": "array",
"description": "The cardinality of this array must match that of the passengers. A mismatch leads to the input being invalidated.",
"minItems": 1,
"maxItems": 9,
"items": {
"type": "array",
"items": { "name": "#/domains/FlightBooking/types/SeatNumber" }
}
},
"AvailableDynamicSeats": {
"type": "object",
"description": "Selected seats information.",
"description": "Seat availability mapping.",
"properties": {
"segment": {
"type": "string",
"description": "Flight segments name as displayed on website.",
"pattern": "^[A-Z]{3} to [A-Z]{3}$",
"example": "LTN to ZRH"
"leg": {
"items": { "$ref": "#/domains/FlightBooking/types/Leg" }
},
"seats": {
"rows": {
"type": "array",
"items": { "$ref": "#/domains/FlightBooking/types/SeatNumber" }
"items": { "$ref": "#/domains/FlightBooking/types/Rows" }
}
},
"required": [
"seats"
"leg",
"rows"
],
"additionalProperties": false
},
"AvailableSegmentSeats": {
"type": "object",
"description": "Seat availability information.",
"Leg": {
"type": "object",
"description": "Flight leg that corresponds with the current seat map.",
"properties": {
"segment": {
"from": {
"type": "string",
"description": "Flight leg name as displayed on website.",
"example": "LTN to ZRH, Wed 7th Mar"
"description": "Origin airport name grabbed from the page.",
"example": "Deer Lake"
},
"seats": {
"type": "array",
"items": { "$ref": "#/domains/FlightBooking/types/Seat" }
"to": {
"type": "string",
"description": "Destination airport name grabbed from the page.",
"example": "Kitchener-Waterloo"
}
},
"additionalProperties": false,
"required": [
"segment",
"seats"
],
"additionalProperties": false
"from",
"to"
]
},
"Seat": {
"SeatNumber": {
"type": "string",
"description": "Seat number as extracted from website.",
"example": "7A"
},
"Rows": {
"type": "array",
"description": "An array of cabin rows.",
"minItems": 1,
"maxItems": 9,
"items": {
"type": "array",
"items": { "name": "#/domains/FlightBooking/types/Row" }
}
},
"Row": {
"type": "object",
"description": "Seat metadata.",
"description": "Information gathered on \"Booking success\" page.",
"properties": {
"seatNumber": {
"$ref": "#/domains/FlightBooking/types/SeatNumber"
},
"available": {
"type": "boolean",
"description": "<code>true</code> if website allows selecting this seat, <code>false</code> otherwise."
},
"restricted": {
"type": "boolean",
"description": "<code>true</code> if seat has restrictions for certain groups of passengers."
"number": {
"type": "integer",
"description": "Row Number.",
"example": "5"
},
"price": {
"$ref": "#/domains/Generic/types/Price",
"description": "Seat price, if such information is available."
}
"seats": { "$ref": "#/domains/FlightBooking/types/Seats" }
},
"additionalProperties": false,
"required": [
"seatNumber",
"available"
],
"additionalProperties": false
},
"SeatNumber": {
"type": "string",
"description": "Seat number as extracted from website.",
"example": "7A"
"number",
"seats"
]
},
"BookingConfirmation": {
"type": "object",
Expand All @@ -753,6 +761,65 @@
"bookingReference"
]
},
"Seats": {
"type": "array",
"description": "An array of seats.",
"minItems": 1,
"maxItems": 9,
"items": {
"type": "array",
"items": { "name": "#/domains/FlightBooking/types/Seat" }
}
},
"Seat": {
"type": "object",
"description": "Seat metadata.",
"properties": {
"column": {
"type": "string",
"description": "Column letter.",
"example": "B"
},
"number": {
"$ref": "#/domains/FlightBooking/types/SeatNumber"
},
"isAvailable": {
"type": "boolean",
"description": "<code>true</code> if website allows selecting this seat, <code>false</code> otherwise."
},
"isRestricted": {
"type": "boolean",
"description": "<code>true</code> if seat has restrictions for certain groups of passengers."
},
"seatCharacteristics": {
"$ref": "#/domains/FlightBooking/types/SeatCharacteristics"
},
"price": {
"$ref": "#/domains/Generic/types/Price",
"description": "Seat price, if such information is available."
}
},
"required": [
"column",
"number",
"isAvailable"
],
"additionalProperties": false
},
"SeatCharacteristics": {
"type": "array",
"description": "An array of seat particularities.",
"minItems": 1,
"maxItems": 9,
"items": {
"type": "array",
"items": { "name": "#/domains/FlightBooking/types/SeatCharacteristic" }
}
},
"SeatCharacteristic": {
"type": "string",
"example": "extra-legroom"
},
"PriceBreakdown": {
"type": "array",
"description": "The list of price components, as found on the website.",
Expand Down

0 comments on commit cd10048

Please sign in to comment.