Skip to content

Commit c7d4cdf

Browse files
authored
Merge pull request #1083 from duffelhq/new-stays-features
feat: add new fields to Stays types [STAY-3590]
2 parents 4eaaf28 + f769637 commit c7d4cdf

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

src/Stays/StaysTypes.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,13 @@ export interface StaysAccommodation {
395395
*/
396396
rating: number | null
397397

398+
/**
399+
* The number of reviews that contributed to the aggregated review score
400+
401+
* Example: 336
402+
*/
403+
review_count: number | null
404+
398405
/**
399406
* A review score of this accommodation, aggregated from guest reviews. If available, the value is a score from the 1.0-10.0 range. This value is consolidated by Duffel based on user review data from multiple sources.
400407
*/
@@ -527,6 +534,22 @@ export interface StaysQuote {
527534
*/
528535
due_at_accommodation_currency: string
529536

537+
/**
538+
* The portion of total_amount that is payable before check in as deposit for the stay.
539+
* It may be null if the quote is for a deposit rate but we couldn't get full deposit information —
540+
* in that case, deposit details are expected to be specified in the rate conditions.
541+
*
542+
* Example: "159.80"
543+
*/
544+
deposit_amount: string | null
545+
546+
/**
547+
* The currency of the tax_amount, as an ISO 4217 currency code.
548+
*
549+
* Example: "GBP"
550+
*/
551+
deposit_currency: string
552+
530553
/**
531554
* The loyalty programme that this quote supports.
532555
*/
@@ -686,8 +709,12 @@ export interface StaysSearchResult {
686709
guests: Array<Guest>
687710
cheapest_rate_total_amount: string
688711
cheapest_rate_currency: string
712+
cheapest_rate_base_amount: string | null
713+
cheapest_rate_base_currency: string | null
689714
cheapest_rate_public_amount: string | null
690715
cheapest_rate_public_currency: string
716+
cheapest_rate_due_at_accommodation_amount: string | null
717+
cheapest_rate_due_at_accommodation_currency: string | null
691718
}
692719

693720
export interface StaysLoyaltyProgramme {

src/Stays/mocks.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export const MOCK_ACCOMMODATION: StaysAccommodation = {
3333
],
3434
rating: 4,
3535
review_score: 8.8,
36+
review_count: 336,
3637
rooms: [
3738
{
3839
rates: [
@@ -196,6 +197,10 @@ export const MOCK_SEARCH_RESULT: StaysSearchResult = {
196197
cheapest_rate_currency: 'GBP',
197198
cheapest_rate_public_amount: null,
198199
cheapest_rate_public_currency: 'GBP',
200+
cheapest_rate_base_amount: '665.83',
201+
cheapest_rate_base_currency: 'GBP',
202+
cheapest_rate_due_at_accommodation_amount: '39.95',
203+
cheapest_rate_due_at_accommodation_currency: 'GBP',
199204
}
200205

201206
export const MOCK_BOOKING: StaysBooking = {
@@ -255,6 +260,8 @@ export const MOCK_QUOTE: StaysQuote = {
255260
fee_currency: 'USD',
256261
tax_amount: null,
257262
tax_currency: 'USD',
263+
deposit_amount: '0.00',
264+
deposit_currency: 'USD',
258265
due_at_accommodation_amount: null,
259266
due_at_accommodation_currency: 'USD',
260267
supported_loyalty_programme: 'duffel_hotel_group_rewards',

0 commit comments

Comments
 (0)