Skip to content

Commit

Permalink
Merge pull request #760 from duffelhq/loyalty-types
Browse files Browse the repository at this point in the history
Adds loyalty types
  • Loading branch information
andrejak committed Jul 7, 2023
2 parents 4169137 + 995d727 commit 5093d99
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nodejs lts-fermium
nodejs lts-hydrogen
1 change: 1 addition & 0 deletions src/Stays/Bookings/Bookings.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ describe('Stays/Bookings', () => {
const mockResponse = { data: MOCK_BOOKING }
const mockBookingParams: StaysBookingPayload = {
quote_id: 'quo_123',
loyalty_programme_account_number: '123456789',
guests: [
{
given_name: 'John',
Expand Down
1 change: 1 addition & 0 deletions src/Stays/Bookings/Bookings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { DuffelResponse } from '../../types'

export interface StaysBookingPayload {
quote_id: string
loyalty_programme_account_number?: string
guests: Array<{
given_name: string
family_name: string
Expand Down
22 changes: 22 additions & 0 deletions src/Stays/StaysTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,28 @@ export interface StaysQuote {
* Example: "GBP"
*/
due_at_accommodation_currency: string

/**
* The loyalty programme that this quote supports.
*/
supported_loyalty_programme:
| 'wyndham_rewards'
| 'choice_privileges'
| 'marriott_bonvoy'
| 'best_western_rewards'
| 'world_of_hyatt'
| 'hilton_honors'
| 'ihg_one_rewards'
| 'leaders_club'
| 'stash_rewards'
| 'omni_select_guest'
| 'i_prefer'
| 'accor_live_limitless'
| 'my_6'
| 'jumeirah_one'
| 'global_hotel_alliance_discovery'
| 'duffel_hotel_group_rewards'
| null
}

export type StaysBookingStatus = 'confirmed' | 'cancelled'
Expand Down
2 changes: 2 additions & 0 deletions src/Stays/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ export const MOCK_BOOKING: StaysBooking = {

export const MOCK_CREATE_BOOKING_PAYLOAD: StaysBookingPayload = {
quote_id: 'quo_0000ARxBI85qTkbDDEZMO3',
loyalty_programme_account_number: '123456789',
guests: [
{
given_name: 'Jean',
Expand Down Expand Up @@ -187,4 +188,5 @@ export const MOCK_QUOTE: StaysQuote = {
tax_currency: 'USD',
due_at_accommodation_amount: null,
due_at_accommodation_currency: 'USD',
supported_loyalty_programme: 'duffel_hotel_group_rewards',
}

0 comments on commit 5093d99

Please sign in to comment.