Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrects offer request creation slice type #903

Merged
merged 1 commit into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 31 additions & 1 deletion src/booking/OfferRequests/OfferRequestsTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,37 @@ export interface CreateOfferRequest {
* up this offer request. One-way journeys can be expressed using one slice,
* whereas return trips will need two.
*/
slices: Omit<OfferRequestSlice, 'origin_type' | 'destination_type'>[]
slices: CreateOfferRequestSlice[]
}

export interface CreateOfferRequestSlice {
/**
* The 3-letter IATA code for the city or airport where this slice ends
* Example: "JFK"
*/
destination: string

/**
* The 3-letter IATA code for the city or airport where this slice starts
* Example: "LHR"
*/
origin: string

/**
* The ISO 8601 date on which the passengers want to depart
* Example: "2020-04-24"
*/
departure_date: string

/**
* The inclusive time range for the arrival of the slice
*/
arrival_time?: string | null

/**
* The inclusive time range for the departure of the slice
*/
departure_time?: string | null
}

export interface CreateOfferRequestQueryParameters {
Expand Down
28 changes: 2 additions & 26 deletions src/booking/OfferRequests/mockOfferRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,8 @@ import { CreateOfferRequest, OfferRequest } from '../../types'
export const mockCreateOfferRequest: CreateOfferRequest = {
slices: [
{
origin: {
iata_code: 'LHR',
type: 'airport',
name: 'Heathrow Airport',
longitude: -0.458118,
latitude: 51.470311,
id: 'arp_lhr_gb',
icao_code: 'EGLL',
iata_country_code: 'GB',
iata_city_code: 'LON',
time_zone: 'Europe/London',
city_name: 'London',
},
destination: {
iata_code: 'JFK',
type: 'airport',
time_zone: 'America/New_York',
name: 'John F. Kennedy International Airport',
longitude: -73.778519,
latitude: 40.640556,
id: 'arp_jfk_us',
icao_code: 'KJFK',
iata_country_code: 'US',
iata_city_code: 'NYC',
city_name: 'New York',
},
origin: 'LHR',
destination: 'JFK',
departure_date: '2020-04-24',
},
],
Expand Down
28 changes: 2 additions & 26 deletions src/booking/PartialOfferRequests/mockPartialOfferRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,8 @@ import { CreateOfferRequest, OfferRequest } from '../../types'
export const mockCreatePartialOfferRequest: CreateOfferRequest = {
slices: [
{
origin: {
iata_code: 'LHR',
type: 'airport',
name: 'Heathrow Airport',
longitude: -0.458118,
latitude: 51.470311,
id: 'arp_lhr_gb',
icao_code: 'EGLL',
iata_country_code: 'GB',
iata_city_code: 'LON',
time_zone: 'Europe/London',
city_name: 'London',
},
destination: {
iata_code: 'JFK',
type: 'airport',
time_zone: 'America/New_York',
name: 'John F. Kennedy International Airport',
longitude: -73.778519,
latitude: 40.640556,
id: 'arp_jfk_us',
icao_code: 'KJFK',
iata_country_code: 'US',
iata_city_code: 'NYC',
city_name: 'New York',
},
origin: 'LHR',
destination: 'JFK',
departure_date: '2020-04-24',
},
],
Expand Down