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

fix: update airlines types to better match schema #879

Merged
merged 1 commit into from
Jan 31, 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
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ export const mockAirlineInitiatedChange: AirlineInitiatedChange = {
'https://assets.duffel.com/img/airlines/for-light-background/full-color-lockup/BA.svg',
id: 'arl_00009VME7DBKeMags5CliQ',
iata_code: 'BA',
conditions_of_carriage_url:
'https://www.britishairways.com/en-gb/information/legal/british-airways/general-conditions-of-carriage',
},
marketing_carrier_flight_number: '0472',
marketing_carrier: {
Expand All @@ -60,6 +62,8 @@ export const mockAirlineInitiatedChange: AirlineInitiatedChange = {
'https://assets.duffel.com/img/airlines/for-light-background/full-color-lockup/BA.svg',
id: 'arl_00009VME7DBKeMags5CliQ',
iata_code: 'BA',
conditions_of_carriage_url:
'https://www.britishairways.com/en-gb/information/legal/british-airways/general-conditions-of-carriage',
},
id: 'seg_00009htYpSCXrwaB9Dn456',
duration: 'PT2H10M',
Expand Down Expand Up @@ -173,6 +177,8 @@ export const mockAirlineInitiatedChange: AirlineInitiatedChange = {
'https://assets.duffel.com/img/airlines/for-light-background/full-color-lockup/BA.svg',
id: 'arl_00009VME7DBKeMags5CliQ',
iata_code: 'BA',
conditions_of_carriage_url:
'https://www.britishairways.com/en-gb/information/legal/british-airways/general-conditions-of-carriage',
},
marketing_carrier_flight_number: '0474',
marketing_carrier: {
Expand All @@ -183,6 +189,8 @@ export const mockAirlineInitiatedChange: AirlineInitiatedChange = {
'https://assets.duffel.com/img/airlines/for-light-background/full-color-lockup/BA.svg',
id: 'arl_00009VME7DBKeMags5CliQ',
iata_code: 'BA',
conditions_of_carriage_url:
'https://www.britishairways.com/en-gb/information/legal/british-airways/general-conditions-of-carriage',
},
id: 'seg_00009htYpSCXrwaB9Dn457',
duration: 'PT2H15M',
Expand Down
18 changes: 18 additions & 0 deletions src/booking/Offers/mockOffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,24 @@ export const mockOffer: Offer = {
name: 'British Airways',
id: 'aln_00001876aqC8c5umZmrRds',
iata_code: 'BA',
logo_symbol_url:
'https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/BA.svg',
logo_lockup_url:
'https://assets.duffel.com/img/airlines/for-light-background/full-color-lockup/BA.svg',
conditions_of_carriage_url:
'https://www.britishairways.com/en-gb/information/legal/british-airways/general-conditions-of-carriage',
},
marketing_carrier_flight_number: '1234',
marketing_carrier: {
name: 'British Airways',
id: 'aln_00001876aqC8c5umZmrRds',
iata_code: 'BA',
logo_symbol_url:
'https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/BA.svg',
logo_lockup_url:
'https://assets.duffel.com/img/airlines/for-light-background/full-color-lockup/BA.svg',
conditions_of_carriage_url:
'https://www.britishairways.com/en-gb/information/legal/british-airways/general-conditions-of-carriage',
},
id: 'seg_00009htYpSCXrwaB9Dn456',
duration: 'PT02H26M',
Expand Down Expand Up @@ -162,6 +174,12 @@ export const mockOffer: Offer = {
name: 'British Airways',
id: 'aln_00001876aqC8c5umZmrRds',
iata_code: 'BA',
logo_symbol_url:
'https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/BA.svg',
logo_lockup_url:
'https://assets.duffel.com/img/airlines/for-light-background/full-color-lockup/BA.svg',
conditions_of_carriage_url:
'https://www.britishairways.com/en-gb/information/legal/british-airways/general-conditions-of-carriage',
},
live_mode: true,
id: 'off_00009htYpSCXrwaB9DnUm0',
Expand Down
18 changes: 18 additions & 0 deletions src/booking/Offers/mockPartialOffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,24 @@ export const mockPartialOffer: Offer = {
name: 'British Airways',
id: 'aln_00001876aqC8c5umZmrRds',
iata_code: 'BA',
logo_symbol_url:
'https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/BA.svg',
logo_lockup_url:
'https://assets.duffel.com/img/airlines/for-light-background/full-color-lockup/BA.svg',
conditions_of_carriage_url:
'https://www.britishairways.com/en-gb/information/legal/british-airways/general-conditions-of-carriage',
},
marketing_carrier_flight_number: '1234',
marketing_carrier: {
name: 'British Airways',
id: 'aln_00001876aqC8c5umZmrRds',
iata_code: 'BA',
logo_symbol_url:
'https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/BA.svg',
logo_lockup_url:
'https://assets.duffel.com/img/airlines/for-light-background/full-color-lockup/BA.svg',
conditions_of_carriage_url:
'https://www.britishairways.com/en-gb/information/legal/british-airways/general-conditions-of-carriage',
},
id: 'seg_00009htYpSCXrwaB9Dn456',
duration: 'PT02H26M',
Expand Down Expand Up @@ -162,6 +174,12 @@ export const mockPartialOffer: Offer = {
name: 'British Airways',
id: 'aln_00001876aqC8c5umZmrRds',
iata_code: 'BA',
logo_symbol_url:
'https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/BA.svg',
logo_lockup_url:
'https://assets.duffel.com/img/airlines/for-light-background/full-color-lockup/BA.svg',
conditions_of_carriage_url:
'https://www.britishairways.com/en-gb/information/legal/british-airways/general-conditions-of-carriage',
},
live_mode: true,
id: 'off_00009htYpSCXrwaB9DnUm0',
Expand Down
24 changes: 24 additions & 0 deletions src/booking/OrderChangeOffers/mockOrderChangeOffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,24 @@ export const mockOrderChangeOffer: OrderChangeOffer = {
name: 'British Airways',
id: 'aln_00001876aqC8c5umZmrRds',
iata_code: 'BA',
logo_symbol_url:
'https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/BA.svg',
logo_lockup_url:
'https://assets.duffel.com/img/airlines/for-light-background/full-color-lockup/BA.svg',
conditions_of_carriage_url:
'https://www.britishairways.com/en-gb/information/legal/british-airways/general-conditions-of-carriage',
},
marketing_carrier_flight_number: '1234',
marketing_carrier: {
name: 'British Airways',
id: 'aln_00001876aqC8c5umZmrRds',
iata_code: 'BA',
logo_symbol_url:
'https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/BA.svg',
logo_lockup_url:
'https://assets.duffel.com/img/airlines/for-light-background/full-color-lockup/BA.svg',
conditions_of_carriage_url:
'https://www.britishairways.com/en-gb/information/legal/british-airways/general-conditions-of-carriage',
},
id: 'seg_00009htYpSCXrwaB9Dn456',
duration: 'PT02H26M',
Expand Down Expand Up @@ -176,12 +188,24 @@ export const mockOrderChangeOffer: OrderChangeOffer = {
name: 'British Airways',
id: 'aln_00001876aqC8c5umZmrRds',
iata_code: 'BA',
logo_symbol_url:
'https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/BA.svg',
logo_lockup_url:
'https://assets.duffel.com/img/airlines/for-light-background/full-color-lockup/BA.svg',
conditions_of_carriage_url:
'https://www.britishairways.com/en-gb/information/legal/british-airways/general-conditions-of-carriage',
},
marketing_carrier_flight_number: '1234',
marketing_carrier: {
name: 'British Airways',
id: 'aln_00001876aqC8c5umZmrRds',
iata_code: 'BA',
logo_symbol_url:
'https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/BA.svg',
logo_lockup_url:
'https://assets.duffel.com/img/airlines/for-light-background/full-color-lockup/BA.svg',
conditions_of_carriage_url:
'https://www.britishairways.com/en-gb/information/legal/british-airways/general-conditions-of-carriage',
},
id: 'seg_00009htYpSCXrwaB9Dn456',
duration: 'PT02H26M',
Expand Down
24 changes: 24 additions & 0 deletions src/booking/OrderChangeRequests/mockOrderChangeRequests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,24 @@ export const mockOrderChangeRequest: OrderChangeRequestResponse = {
name: 'British Airways',
id: 'aln_00001876aqC8c5umZmrRds',
iata_code: 'BA',
logo_symbol_url:
'https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/BA.svg',
logo_lockup_url:
'https://assets.duffel.com/img/airlines/for-light-background/full-color-lockup/BA.svg',
conditions_of_carriage_url:
'https://www.britishairways.com/en-gb/information/legal/british-airways/general-conditions-of-carriage',
},
marketing_carrier_flight_number: '1234',
marketing_carrier: {
name: 'British Airways',
id: 'aln_00001876aqC8c5umZmrRds',
iata_code: 'BA',
logo_symbol_url:
'https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/BA.svg',
logo_lockup_url:
'https://assets.duffel.com/img/airlines/for-light-background/full-color-lockup/BA.svg',
conditions_of_carriage_url:
'https://www.britishairways.com/en-gb/information/legal/british-airways/general-conditions-of-carriage',
},
id: 'seg_00009htYpSCXrwaB9Dn456',
duration: 'PT02H26M',
Expand Down Expand Up @@ -267,12 +279,24 @@ export const mockOrderChangeRequest: OrderChangeRequestResponse = {
name: 'British Airways',
id: 'aln_00001876aqC8c5umZmrRds',
iata_code: 'BA',
logo_symbol_url:
'https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/BA.svg',
logo_lockup_url:
'https://assets.duffel.com/img/airlines/for-light-background/full-color-lockup/BA.svg',
conditions_of_carriage_url:
'https://www.britishairways.com/en-gb/information/legal/british-airways/general-conditions-of-carriage',
},
marketing_carrier_flight_number: '1234',
marketing_carrier: {
name: 'British Airways',
id: 'aln_00001876aqC8c5umZmrRds',
iata_code: 'BA',
logo_symbol_url:
'https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/BA.svg',
logo_lockup_url:
'https://assets.duffel.com/img/airlines/for-light-background/full-color-lockup/BA.svg',
conditions_of_carriage_url:
'https://www.britishairways.com/en-gb/information/legal/british-airways/general-conditions-of-carriage',
},
id: 'seg_00009htYpSCXrwaB9Dn456',
duration: 'PT02H26M',
Expand Down
24 changes: 24 additions & 0 deletions src/booking/OrderChanges/mockOrderChanges.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,24 @@ export const mockOrderChange: OrderChange = {
name: 'British Airways',
id: 'aln_00001876aqC8c5umZmrRds',
iata_code: 'BA',
logo_symbol_url:
'https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/BA.svg',
logo_lockup_url:
'https://assets.duffel.com/img/airlines/for-light-background/full-color-lockup/BA.svg',
conditions_of_carriage_url:
'https://www.britishairways.com/en-gb/information/legal/british-airways/general-conditions-of-carriage',
},
marketing_carrier_flight_number: '1234',
marketing_carrier: {
name: 'British Airways',
id: 'aln_00001876aqC8c5umZmrRds',
iata_code: 'BA',
logo_symbol_url:
'https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/BA.svg',
logo_lockup_url:
'https://assets.duffel.com/img/airlines/for-light-background/full-color-lockup/BA.svg',
conditions_of_carriage_url:
'https://www.britishairways.com/en-gb/information/legal/british-airways/general-conditions-of-carriage',
},
id: 'seg_00009htYpSCXrwaB9Dn456',
duration: 'PT02H26M',
Expand Down Expand Up @@ -175,12 +187,24 @@ export const mockOrderChange: OrderChange = {
name: 'British Airways',
id: 'aln_00001876aqC8c5umZmrRds',
iata_code: 'BA',
logo_symbol_url:
'https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/BA.svg',
logo_lockup_url:
'https://assets.duffel.com/img/airlines/for-light-background/full-color-lockup/BA.svg',
conditions_of_carriage_url:
'https://www.britishairways.com/en-gb/information/legal/british-airways/general-conditions-of-carriage',
},
marketing_carrier_flight_number: '1234',
marketing_carrier: {
name: 'British Airways',
id: 'aln_00001876aqC8c5umZmrRds',
iata_code: 'BA',
logo_symbol_url:
'https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/BA.svg',
logo_lockup_url:
'https://assets.duffel.com/img/airlines/for-light-background/full-color-lockup/BA.svg',
conditions_of_carriage_url:
'https://www.britishairways.com/en-gb/information/legal/british-airways/general-conditions-of-carriage',
},
id: 'seg_00009htYpSCXrwaB9Dn456',
duration: 'PT02H26M',
Expand Down
36 changes: 36 additions & 0 deletions src/booking/Orders/mockOrders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,24 @@ export const mockOrder: Order = {
name: 'British Airways',
id: 'aln_00001876aqC8c5umZmrRds',
iata_code: 'BA',
logo_symbol_url:
'https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/BA.svg',
logo_lockup_url:
'https://assets.duffel.com/img/airlines/for-light-background/full-color-lockup/BA.svg',
conditions_of_carriage_url:
'https://www.britishairways.com/en-gb/information/legal/british-airways/general-conditions-of-carriage',
},
marketing_carrier_flight_number: '1234',
marketing_carrier: {
name: 'British Airways',
id: 'aln_00001876aqC8c5umZmrRds',
iata_code: 'BA',
logo_symbol_url:
'https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/BA.svg',
logo_lockup_url:
'https://assets.duffel.com/img/airlines/for-light-background/full-color-lockup/BA.svg',
conditions_of_carriage_url:
'https://www.britishairways.com/en-gb/information/legal/british-airways/general-conditions-of-carriage',
},
id: 'seg_00009htYpSCXrwaB9Dn456',
duration: 'PT02H26M',
Expand Down Expand Up @@ -222,6 +234,12 @@ export const mockOrder: Order = {
name: 'British Airways',
id: 'aln_00001876aqC8c5umZmrRds',
iata_code: 'BA',
logo_symbol_url:
'https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/BA.svg',
logo_lockup_url:
'https://assets.duffel.com/img/airlines/for-light-background/full-color-lockup/BA.svg',
conditions_of_carriage_url:
'https://www.britishairways.com/en-gb/information/legal/british-airways/general-conditions-of-carriage',
},
metadata: {
customer_prefs: 'window seat',
Expand Down Expand Up @@ -295,12 +313,18 @@ export const mockOnHoldOrders: Order[] = [
name: 'American Airlines',
id: 'arl_00009VME7DAGiJjwomhv32',
iata_code: 'AA',
logo_lockup_url: null,
logo_symbol_url: null,
conditions_of_carriage_url: null,
},
marketing_carrier_flight_number: '4721',
marketing_carrier: {
name: 'American Airlines',
id: 'arl_00009VME7DAGiJjwomhv32',
iata_code: 'AA',
logo_lockup_url: null,
logo_symbol_url: null,
conditions_of_carriage_url: null,
},
id: 'seg_0000A6GioOO1UDbjb7nIi9',
duration: 'PT2H45M',
Expand Down Expand Up @@ -396,6 +420,9 @@ export const mockOnHoldOrders: Order[] = [
name: 'American Airlines',
id: 'arl_00009VME7DAGiJjwomhv32',
iata_code: 'AA',
logo_symbol_url: null,
logo_lockup_url: null,
conditions_of_carriage_url: null,
},
metadata: {
customer_prefs: 'window seat',
Expand Down Expand Up @@ -454,12 +481,18 @@ export const mockOnHoldOrders: Order[] = [
name: 'American Airlines',
id: 'arl_00009VME7DAGiJjwomhv32',
iata_code: 'AA',
logo_lockup_url: null,
logo_symbol_url: null,
conditions_of_carriage_url: null,
},
marketing_carrier_flight_number: '4341',
marketing_carrier: {
name: 'American Airlines',
id: 'arl_00009VME7DAGiJjwomhv32',
iata_code: 'AA',
logo_lockup_url: null,
logo_symbol_url: null,
conditions_of_carriage_url: null,
},
id: 'seg_0000A6GiZRU4WXtdZJrivU',
duration: 'PT2H49M',
Expand Down Expand Up @@ -555,6 +588,9 @@ export const mockOnHoldOrders: Order[] = [
name: 'American Airlines',
id: 'arl_00009VME7DAGiJjwomhv32',
iata_code: 'AA',
logo_symbol_url: null,
logo_lockup_url: null,
conditions_of_carriage_url: null,
},
metadata: {
customer_prefs: 'window seat',
Expand Down
10 changes: 7 additions & 3 deletions src/supportingResources/Airlines/AirlinesTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,17 @@ export interface Airline {
/*
* The two-character IATA code for the airline. This may be null for non-IATA carriers.
*/
iata_code: string
iata_code: string | null
/*
* Path to a svg of the airline lockup logo. A lockup logo is also called a combination logo, in which it combines the logotype and logomark. This may be `null` if no logo is available.
*/
logo_lockup_url?: string
logo_lockup_url: string | null
/*
* Path to a svg of the airline logo. This may be `null` if no logo is available.
*/
logo_symbol_url?: string
logo_symbol_url: string | null
/*
* URL to the airline's conditions of carriage.
*/
conditions_of_carriage_url: string | null
}
2 changes: 2 additions & 0 deletions src/supportingResources/Airlines/mockAirline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ export const mockAirline: Airline = {
'https://assets.duffel.com/img/airlines/for-light-background/full-color-lockup/BA.svg',
logo_symbol_url:
'https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/BA.svg',
conditions_of_carriage_url:
'https://www.britishairways.com/en-gb/information/legal/british-airways/general-conditions-of-carriage',
}