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

[STAY-2408] feat: add deposit type to stays payment type #999

Merged
merged 1 commit into from
Jan 30, 2025
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
31 changes: 18 additions & 13 deletions src/Stays/StaysTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,14 @@ export type StaysLoyaltyProgrammeReference =
| 'global_hotel_alliance_discovery'
| 'duffel_hotel_group_rewards'

export type StaysPaymentType = 'balance' | 'card'
export type StaysPaymentMethod = 'balance' | 'card'
export type StaysPaymentType = 'guarantee' | 'deposit' | 'pay_now'
export type StaysSource =
| 'bookingcom'
| 'priceline'
| 'travelport'
| 'expedia'
| 'duffel_hotel_group'

export interface StaysRate {
/**
Expand Down Expand Up @@ -123,14 +130,12 @@ export interface StaysRate {
id: string

/**
* The accepted payment method for this rate. Prepaid rates require payment at time of reservation. Accepted types: pay_now, guarantee
*/
payment_type: 'pay_now' | 'guarantee'

/**
* The supplier from which Duffel got this rate
*/
supplier: 'priceline'
* The accepted payment type for this rate.
* Guarantee rates are paid at at the accommodation.
* Deposit rates require a prepayment of a deposit amount, then the remainder at the accommodation.
* Pay now rates require full prepayment.
* */
payment_type: StaysPaymentType

/**
* The fee amount, as an ISO 4217 currency code.
Expand Down Expand Up @@ -165,11 +170,11 @@ export interface StaysRate {
/**
* The methods available for payment of this rate.

A rate with the `balance` payment type can be paid for using your Duffel Balance.
A rate with the `balance` payment method can be paid for using your Duffel Balance.

A rate with the `card` payment type can be paid for with card details provided at time of booking.
A rate with the `card` payment method can be paid for with card details provided at time of booking.
*/
available_payment_methods: StaysPaymentType[]
available_payment_methods: StaysPaymentMethod[]

/**
* The loyalty programme that this rate supports.
Expand All @@ -182,7 +187,7 @@ export interface StaysRate {
* The source of the rate.
* Useful in scenarios where a rate requires explicitly showing the source.
*/
source: 'bookingcom' | 'priceline' | 'travelport' | 'duffel_hotel_group'
source: StaysSource
}

export interface StaysRoomRate extends StaysRate {
Expand Down
2 changes: 0 additions & 2 deletions src/Stays/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ export const MOCK_ACCOMMODATION: StaysAccommodation = {
total_amount: '799.00',
tax_currency: 'GBP',
tax_amount: '133.17',
supplier: 'priceline',
payment_type: 'pay_now',
id: 'rat_0000ASuebQfixzpI2v20qe',
due_at_accommodation_currency: 'USD',
Expand All @@ -67,7 +66,6 @@ export const MOCK_ACCOMMODATION: StaysAccommodation = {
total_amount: '899.00',
tax_currency: 'GBP',
tax_amount: '133.17',
supplier: 'priceline',
payment_type: 'pay_now',
id: 'rat_0000ASuebQfixzpI2v20bx',
due_at_accommodation_currency: 'GBP',
Expand Down