Skip to content

Commit 259e603

Browse files
committed
feat: add deposit type to stays payment type, fix some other types
1 parent 0b7f58a commit 259e603

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

src/Stays/StaysTypes.ts

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,14 @@ export type StaysLoyaltyProgrammeReference =
7474
| 'global_hotel_alliance_discovery'
7575
| 'duffel_hotel_group_rewards'
7676

77-
export type StaysPaymentType = 'balance' | 'card'
77+
export type StaysPaymentMethod = 'balance' | 'card'
78+
export type StaysPaymentType = 'guarantee' | 'deposit' | 'pay_now'
79+
export type StaysSource =
80+
| 'bookingcom'
81+
| 'priceline'
82+
| 'travelport'
83+
| 'expedia'
84+
| 'duffel_hotel_group'
7885

7986
export interface StaysRate {
8087
/**
@@ -123,14 +130,10 @@ export interface StaysRate {
123130
id: string
124131

125132
/**
126-
* The accepted payment method for this rate. Prepaid rates require payment at time of reservation. Accepted types: pay_now, guarantee
127-
*/
128-
payment_type: 'pay_now' | 'guarantee'
129-
130-
/**
131-
* The supplier from which Duffel got this rate
132-
*/
133-
supplier: 'priceline'
133+
* The accepted payment method for this rate. Prepaid rates require payment at time of reservation.
134+
* Deposit rates require a deposit payment, then the remainder at the accommodation.
135+
* */
136+
payment_type: StaysPaymentType
134137

135138
/**
136139
* The fee amount, as an ISO 4217 currency code.
@@ -169,7 +172,7 @@ export interface StaysRate {
169172
170173
A rate with the `card` payment type can be paid for with card details provided at time of booking.
171174
*/
172-
available_payment_methods: StaysPaymentType[]
175+
available_payment_methods: StaysPaymentMethod[]
173176

174177
/**
175178
* The loyalty programme that this rate supports.
@@ -182,7 +185,7 @@ export interface StaysRate {
182185
* The source of the rate.
183186
* Useful in scenarios where a rate requires explicitly showing the source.
184187
*/
185-
source: 'bookingcom' | 'priceline' | 'travelport' | 'duffel_hotel_group'
188+
source: StaysSource
186189
}
187190

188191
export interface StaysRoomRate extends StaysRate {

src/Stays/mocks.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ export const MOCK_ACCOMMODATION: StaysAccommodation = {
4040
total_amount: '799.00',
4141
tax_currency: 'GBP',
4242
tax_amount: '133.17',
43-
supplier: 'priceline',
4443
payment_type: 'pay_now',
4544
id: 'rat_0000ASuebQfixzpI2v20qe',
4645
due_at_accommodation_currency: 'USD',
@@ -67,7 +66,6 @@ export const MOCK_ACCOMMODATION: StaysAccommodation = {
6766
total_amount: '899.00',
6867
tax_currency: 'GBP',
6968
tax_amount: '133.17',
70-
supplier: 'priceline',
7169
payment_type: 'pay_now',
7270
id: 'rat_0000ASuebQfixzpI2v20bx',
7371
due_at_accommodation_currency: 'GBP',

0 commit comments

Comments
 (0)