Skip to content

Commit af6f6d9

Browse files
authored
Merge pull request #861 from duffelhq/rating-and-review
Add new stays attributes
2 parents a16e88c + dedd7e5 commit af6f6d9

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

src/Stays/StaysTypes.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,16 @@ export interface StaysAccommodation {
357357
*/
358358
ratings: StaysRating[] | null
359359

360+
/**
361+
* A "star rating" of this accommodation. If available, this is an integer from 1 to 5 "stars". This value is consolidated by Duffel based on data provided by our sources and accommodation providers. For more detailed rating information, see ratings.
362+
*/
363+
rating: number | null
364+
365+
/**
366+
* 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.
367+
*/
368+
review_score: number | null
369+
360370
/**
361371
* Rooms for the accommodation
362372
*/
@@ -483,6 +493,16 @@ export interface StaysQuote {
483493
* This value will be `null` if your organisation does not have this feature enabled,
484494
*/
485495
card_component_key: string | null
496+
497+
/*
498+
* The number of adult guests this quote is for.
499+
*/
500+
adults: number
501+
502+
/*
503+
* The number of rooms this quote is for
504+
*/
505+
rooms: number
486506
}
487507

488508
export type StaysBookingStatus = 'confirmed' | 'cancelled'
@@ -581,4 +601,6 @@ export interface StaysSearchResult {
581601
check_in_date: string
582602
check_out_date: string
583603
accommodation: StaysAccommodation
604+
adults: number
605+
rooms: number
584606
}

src/Stays/mocks.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ export const MOCK_ACCOMMODATION: StaysAccommodation = {
2222
source: 'aaa',
2323
},
2424
],
25+
rating: 4,
26+
review_score: 8.8,
2527
rooms: [
2628
{
2729
rates: [
@@ -146,6 +148,8 @@ export const MOCK_SEARCH_RESULT: StaysSearchResult = {
146148
id: 'sta_something',
147149
check_in_date: '2023-03-24',
148150
check_out_date: '2023-03-28',
151+
adults: 1,
152+
rooms: 1,
149153
}
150154

151155
export const MOCK_BOOKING: StaysBooking = {
@@ -199,4 +203,6 @@ export const MOCK_QUOTE: StaysQuote = {
199203
due_at_accommodation_currency: 'USD',
200204
supported_loyalty_programme: 'duffel_hotel_group_rewards',
201205
card_component_key: null,
206+
adults: 1,
207+
rooms: 1,
202208
}

0 commit comments

Comments
 (0)