Skip to content

Commit 3e5e4ab

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

File tree

2 files changed

+18
-15
lines changed

2 files changed

+18
-15
lines changed

src/Stays/StaysTypes.ts

Lines changed: 18 additions & 13 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,12 @@ 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 type for this rate.
134+
* Guarantee rates are paid at at the accommodation.
135+
* Deposit rates require a prepayment of a deposit amount, then the remainder at the accommodation.
136+
* Pay now rates require full prepayment.
137+
* */
138+
payment_type: StaysPaymentType
134139

135140
/**
136141
* The fee amount, as an ISO 4217 currency code.
@@ -165,11 +170,11 @@ export interface StaysRate {
165170
/**
166171
* The methods available for payment of this rate.
167172
168-
A rate with the `balance` payment type can be paid for using your Duffel Balance.
173+
A rate with the `balance` payment method can be paid for using your Duffel Balance.
169174
170-
A rate with the `card` payment type can be paid for with card details provided at time of booking.
175+
A rate with the `card` payment method can be paid for with card details provided at time of booking.
171176
*/
172-
available_payment_methods: StaysPaymentType[]
177+
available_payment_methods: StaysPaymentMethod[]
173178

174179
/**
175180
* The loyalty programme that this rate supports.
@@ -182,7 +187,7 @@ export interface StaysRate {
182187
* The source of the rate.
183188
* Useful in scenarios where a rate requires explicitly showing the source.
184189
*/
185-
source: 'bookingcom' | 'priceline' | 'travelport' | 'duffel_hotel_group'
190+
source: StaysSource
186191
}
187192

188193
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)