@revolugo/common 7.0.1 → 7.1.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/src/cancellation-policies.test.ts +8 -2
- package/src/cancellation-policies.ts +57 -4
- package/src/currencies/types.ts +1 -1
- package/src/currencies/utils.ts +52 -52
- package/src/schemas/hotel-room-offer.ts +18 -13
- package/src/schemas/hotel-room.ts +1 -4
- package/src/types/calendar.ts +2 -2
- package/src/types/elements/amenity.ts +10 -10
- package/src/types/elements/booking-policy.ts +7 -7
- package/src/types/elements/booking.ts +15 -15
- package/src/types/elements/contact-person.ts +7 -0
- package/src/types/elements/elements-events.ts +2 -0
- package/src/types/elements/event-metadata.ts +6 -6
- package/src/types/elements/hotel-offer-list.ts +1 -1
- package/src/types/elements/hotel-offer-request.ts +21 -21
- package/src/types/elements/hotel-offer.ts +15 -15
- package/src/types/elements/hotel-offers-filters.ts +1 -1
- package/src/types/elements/hotel-room-offer-request.ts +22 -22
- package/src/types/elements/hotel-room-offer.ts +15 -15
- package/src/types/elements/hotel-room.ts +6 -6
- package/src/types/elements/hotel-rooming-list.ts +8 -8
- package/src/types/elements/hotel.ts +6 -6
- package/src/types/elements/meta-polling.ts +6 -6
- package/src/types/event.ts +1 -1
- package/src/types/hotel-contract.ts +1 -1
- package/src/types/hotel-room-stock.ts +1 -1
- package/src/types/pagination.ts +2 -2
- package/src/utils/create-composite-key.ts +2 -2
- package/src/utils/debounce.ts +1 -1
- package/src/utils/generate-dummy-hotel-images.ts +7 -5
- package/src/utils/get-sanitized-room-count.ts +1 -1
- package/src/utils/images.ts +5 -0
- package/src/utils/parse-children.ts +1 -1
- package/src/utils/poller.ts +56 -55
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@revolugo/common",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.1.0-rc.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Revolugo common",
|
|
6
6
|
"author": "Revolugo",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"dayjs": "1.11.19",
|
|
35
35
|
"ky": "1.14.3",
|
|
36
36
|
"slugify": "1.6.6",
|
|
37
|
-
"type-fest": "5.4.
|
|
37
|
+
"type-fest": "5.4.4",
|
|
38
38
|
"uuid": "13.0.0",
|
|
39
39
|
"zod": "4.3.6"
|
|
40
40
|
},
|
|
@@ -238,7 +238,10 @@ describe('sanitizeCancellationPolicies', () => {
|
|
|
238
238
|
|
|
239
239
|
describe('when Booking Date < Release Date < Check In Date', () => {
|
|
240
240
|
const releaseDate = '2021-01-05'
|
|
241
|
-
const
|
|
241
|
+
const releaseDateCP = dayjs(releaseDate)
|
|
242
|
+
.add(1, 'day')
|
|
243
|
+
.format('YYYY-MM-DD')
|
|
244
|
+
const releaseDatetime = getFormattedUTCLocalTime(releaseDateCP, timezone)
|
|
242
245
|
const bookingDatetime = getFormattedUTCLocalTime(
|
|
243
246
|
'2021-01-01T10:00:00',
|
|
244
247
|
timezone,
|
|
@@ -404,7 +407,10 @@ describe('sanitizeCancellationPolicies', () => {
|
|
|
404
407
|
|
|
405
408
|
describe('when Booking Date < Release Date < DF_0', () => {
|
|
406
409
|
const releaseDate = '2020-12-30'
|
|
407
|
-
const
|
|
410
|
+
const releaseDateCP = dayjs(releaseDate)
|
|
411
|
+
.add(1, 'day')
|
|
412
|
+
.format('YYYY-MM-DD')
|
|
413
|
+
const releaseDatetime = getFormattedUTCLocalTime(releaseDateCP, timezone)
|
|
408
414
|
const bookingDatetime = getFormattedUTCLocalTime(
|
|
409
415
|
'2020-12-20T10:00:00',
|
|
410
416
|
timezone,
|
|
@@ -34,6 +34,31 @@ export interface SanitizeCancellationPolicies {
|
|
|
34
34
|
timezone?: string
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
function initReleaseDateUTC({
|
|
38
|
+
checkInDate,
|
|
39
|
+
releaseDate,
|
|
40
|
+
timezone,
|
|
41
|
+
}: {
|
|
42
|
+
releaseDate?: string
|
|
43
|
+
timezone: string
|
|
44
|
+
checkInDate: string
|
|
45
|
+
}): string | undefined {
|
|
46
|
+
if (!releaseDate) {
|
|
47
|
+
return undefined
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (dayjs(releaseDate).isSameOrAfter(dayjs(checkInDate))) {
|
|
51
|
+
return dayjs.tz(releaseDate, timezone).startOf('day').utc().format()
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return dayjs
|
|
55
|
+
.tz(releaseDate, timezone)
|
|
56
|
+
.add(1, 'day')
|
|
57
|
+
.startOf('day')
|
|
58
|
+
.utc()
|
|
59
|
+
.format()
|
|
60
|
+
}
|
|
61
|
+
|
|
37
62
|
// eslint-disable-next-line complexity, max-statements, max-lines-per-function
|
|
38
63
|
export function sanitizeCancellationPolicies({
|
|
39
64
|
bookingDatetime,
|
|
@@ -62,8 +87,11 @@ export function sanitizeCancellationPolicies({
|
|
|
62
87
|
|
|
63
88
|
const nextDayCheckInDateUTC = nextDay(checkInDatetimeUTC)
|
|
64
89
|
|
|
65
|
-
const releaseDatetimeUTC =
|
|
66
|
-
|
|
90
|
+
const releaseDatetimeUTC = initReleaseDateUTC({
|
|
91
|
+
checkInDate,
|
|
92
|
+
releaseDate,
|
|
93
|
+
timezone,
|
|
94
|
+
})
|
|
67
95
|
|
|
68
96
|
if (dayjs(bookingDatetimeUTC).isAfter(nextDayCheckInDateUTC)) {
|
|
69
97
|
return sanitizeCancellationPolicies({
|
|
@@ -452,10 +480,10 @@ export function getSanitizedCancellationPolicies({
|
|
|
452
480
|
initialDate,
|
|
453
481
|
timezone,
|
|
454
482
|
}: {
|
|
455
|
-
checkInDate: string
|
|
456
483
|
cancellationPolicies: ICancellationPolicy[]
|
|
457
|
-
|
|
484
|
+
checkInDate: string
|
|
458
485
|
initialDate?: string
|
|
486
|
+
timezone?: string
|
|
459
487
|
}): ICancellationPolicy[] {
|
|
460
488
|
if (!cancellationPolicies.length) {
|
|
461
489
|
return []
|
|
@@ -511,3 +539,28 @@ export function isFreeCancellable(cps: ICancellationPolicy[]): boolean {
|
|
|
511
539
|
dayjs().isBetween(dayjs(freeCp.dateFrom), dayjs(freeCp.dateTo)))
|
|
512
540
|
)
|
|
513
541
|
}
|
|
542
|
+
|
|
543
|
+
export function filterForCustomers(
|
|
544
|
+
cps: ICancellationPolicy[],
|
|
545
|
+
): ICancellationPolicy[] {
|
|
546
|
+
const now = dayjs()
|
|
547
|
+
const nowPlus2Hours = now.add(2, 'hours')
|
|
548
|
+
|
|
549
|
+
return cps.reduce<ICancellationPolicy[]>((result, cp) => {
|
|
550
|
+
if (
|
|
551
|
+
dayjs(cp.dateFrom).isSameOrBefore(nowPlus2Hours) &&
|
|
552
|
+
dayjs(cp.dateTo).isAfter(nowPlus2Hours)
|
|
553
|
+
) {
|
|
554
|
+
result.push({
|
|
555
|
+
...cp,
|
|
556
|
+
dateFrom: now.format(),
|
|
557
|
+
})
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
if (dayjs(cp.dateFrom).isAfter(nowPlus2Hours)) {
|
|
561
|
+
result.push(cp)
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
return result
|
|
565
|
+
}, [])
|
|
566
|
+
}
|
package/src/currencies/types.ts
CHANGED
|
@@ -3,11 +3,11 @@ import type { CurrencyCode } from './constants.ts'
|
|
|
3
3
|
export interface ICurrency {
|
|
4
4
|
code: CurrencyCode
|
|
5
5
|
decimalDigits: number
|
|
6
|
+
deprecated?: boolean
|
|
6
7
|
name: string
|
|
7
8
|
namePlural: string
|
|
8
9
|
rounding: number
|
|
9
10
|
symbol: string
|
|
10
11
|
symbolNative: string
|
|
11
12
|
zeroDecimal: boolean
|
|
12
|
-
deprecated?: boolean
|
|
13
13
|
}
|
package/src/currencies/utils.ts
CHANGED
|
@@ -98,49 +98,50 @@ export class MoneyCalculator {
|
|
|
98
98
|
this.isNormalized = isNormalized
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
public
|
|
102
|
-
|
|
101
|
+
public ceil(): this {
|
|
102
|
+
this.amount = Math.ceil(this.amount)
|
|
103
|
+
|
|
104
|
+
return this
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
public convert({
|
|
108
|
+
currency,
|
|
109
|
+
exchangeRate,
|
|
110
|
+
}: {
|
|
111
|
+
currency: CurrencyCode
|
|
112
|
+
exchangeRate: number
|
|
113
|
+
}): this {
|
|
114
|
+
if (this.currency === currency || this.amount === 0) {
|
|
103
115
|
return this
|
|
104
116
|
}
|
|
105
117
|
|
|
106
|
-
|
|
107
|
-
amount: this.amount,
|
|
108
|
-
currency: this.currency,
|
|
109
|
-
})
|
|
118
|
+
const startingIsNormalized = this.isNormalized
|
|
110
119
|
|
|
111
|
-
|
|
120
|
+
if (startingIsNormalized) {
|
|
121
|
+
this.denormalize()
|
|
122
|
+
}
|
|
112
123
|
|
|
113
|
-
|
|
114
|
-
|
|
124
|
+
this.amount *= exchangeRate
|
|
125
|
+
this.currency = currency
|
|
115
126
|
|
|
116
|
-
|
|
117
|
-
|
|
127
|
+
if (startingIsNormalized) {
|
|
128
|
+
this.normalize()
|
|
129
|
+
}
|
|
118
130
|
|
|
119
131
|
return this
|
|
120
132
|
}
|
|
121
133
|
|
|
122
|
-
public
|
|
123
|
-
if (this.isNormalized) {
|
|
134
|
+
public denormalize(): this {
|
|
135
|
+
if (!this.isNormalized) {
|
|
124
136
|
return this
|
|
125
137
|
}
|
|
126
138
|
|
|
127
|
-
this.amount =
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
currency: this.currency,
|
|
132
|
-
// Making sure Javascript doesnt give us back a float number
|
|
133
|
-
// 1172.64 * 100 = 117264.00000000001 💩
|
|
134
|
-
}).toFixed(0),
|
|
135
|
-
)
|
|
136
|
-
|
|
137
|
-
this.isNormalized = true
|
|
138
|
-
|
|
139
|
-
return this
|
|
140
|
-
}
|
|
139
|
+
this.amount = denormalizeAmount({
|
|
140
|
+
amount: this.amount,
|
|
141
|
+
currency: this.currency,
|
|
142
|
+
})
|
|
141
143
|
|
|
142
|
-
|
|
143
|
-
this.amount = Math.ceil(this.amount)
|
|
144
|
+
this.isNormalized = false
|
|
144
145
|
|
|
145
146
|
return this
|
|
146
147
|
}
|
|
@@ -151,12 +152,6 @@ export class MoneyCalculator {
|
|
|
151
152
|
return this
|
|
152
153
|
}
|
|
153
154
|
|
|
154
|
-
public round(): this {
|
|
155
|
-
this.amount = Math.round(this.amount)
|
|
156
|
-
|
|
157
|
-
return this
|
|
158
|
-
}
|
|
159
|
-
|
|
160
155
|
public format(locale?: string, space?: string): string {
|
|
161
156
|
return formatAmount({
|
|
162
157
|
amount: this.amount,
|
|
@@ -170,29 +165,34 @@ export class MoneyCalculator {
|
|
|
170
165
|
return this.amount
|
|
171
166
|
}
|
|
172
167
|
|
|
173
|
-
public
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
if (this.
|
|
168
|
+
public markup(percentage: number): this {
|
|
169
|
+
this.amount /= 1 - percentage
|
|
170
|
+
|
|
171
|
+
return this
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
public normalize(): this {
|
|
175
|
+
if (this.isNormalized) {
|
|
181
176
|
return this
|
|
182
177
|
}
|
|
183
178
|
|
|
184
|
-
|
|
179
|
+
this.amount = Number(
|
|
180
|
+
normalizeAmount({
|
|
181
|
+
// Making sure we only have 2 decimals after comma
|
|
182
|
+
amount: Number(this.amount.toFixed(2)),
|
|
183
|
+
currency: this.currency,
|
|
184
|
+
// Making sure Javascript doesnt give us back a float number
|
|
185
|
+
// 1172.64 * 100 = 117264.00000000001 💩
|
|
186
|
+
}).toFixed(0),
|
|
187
|
+
)
|
|
185
188
|
|
|
186
|
-
|
|
187
|
-
this.denormalize()
|
|
188
|
-
}
|
|
189
|
+
this.isNormalized = true
|
|
189
190
|
|
|
190
|
-
this
|
|
191
|
-
|
|
191
|
+
return this
|
|
192
|
+
}
|
|
192
193
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
}
|
|
194
|
+
public round(): this {
|
|
195
|
+
this.amount = Math.round(this.amount)
|
|
196
196
|
|
|
197
197
|
return this
|
|
198
198
|
}
|
|
@@ -5,12 +5,14 @@ import {
|
|
|
5
5
|
BreakfastOption,
|
|
6
6
|
HotelRoomOfferType,
|
|
7
7
|
PackageType,
|
|
8
|
+
StayTaxesInfoEnum,
|
|
8
9
|
} from '../constants/index.ts'
|
|
9
10
|
|
|
10
11
|
import { CANCELLATION_POLICY_SCHEMA } from './cancellation-policies.ts'
|
|
11
12
|
import { CURRENCY_SCHEMA } from './currency.ts'
|
|
12
13
|
import { SOURCE_MARKET_SCHEMA } from './hotel-offer-request.ts'
|
|
13
14
|
import { HOTEL_ROOMS_SCHEMA } from './hotel-room.ts'
|
|
15
|
+
import { LIST_POLLING_META_SCHEMA } from './list-polling-meta.ts'
|
|
14
16
|
import { TAGS_SCHEMA } from './tag.ts'
|
|
15
17
|
import { TAXES_SCHEMA } from './taxes.ts'
|
|
16
18
|
|
|
@@ -27,21 +29,17 @@ export const PACKAGE_TYPES_DESCRIPTION = `An **Hotel Room Offer** of type **${Ho
|
|
|
27
29
|
|
|
28
30
|
export const HOTEL_ROOM_OFFER_SCHEMA = z
|
|
29
31
|
.object({
|
|
30
|
-
breakfast_count: z.number().min(0).
|
|
32
|
+
breakfast_count: z.number().min(0).nullish().openapi({
|
|
31
33
|
description:
|
|
32
34
|
'Quantity of breakfast per night included in the given **Hotel Room Offer**',
|
|
33
35
|
}),
|
|
34
36
|
breakfast_option: z.enum(BreakfastOption).openapi({
|
|
35
37
|
description: BREAKFAST_OPTION_DESCRIPTION,
|
|
36
38
|
}),
|
|
37
|
-
breakfast_price_per_guest_per_night: z
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
.openapi({
|
|
42
|
-
description:
|
|
43
|
-
'Price of breakfast per guest per night for the given **Hotel Room Offer**, expressed in the requested **currency**, when applicable.\n\n <div style="background-color: #ffffef; padding: 20px; border: 1px solid lightgrey; border-radius: 5px;"><b style="color: red; margin-top: 10px;">🛑 DEPRECATED.</b>\n\n <b style="color: orange;">Field renamed to "breakfast_unit_price"</div>',
|
|
44
|
-
}),
|
|
39
|
+
breakfast_price_per_guest_per_night: z.number().nullish().openapi({
|
|
40
|
+
description:
|
|
41
|
+
'Price of breakfast per guest per night for the given **Hotel Room Offer**, expressed in the requested **currency**, when applicable.\n\n <div style="background-color: #ffffef; padding: 20px; border: 1px solid lightgrey; border-radius: 5px;"><b style="color: red; margin-top: 10px;">🛑 DEPRECATED.</b>\n\n <b style="color: orange;">Field renamed to "breakfast_unit_price"</div>',
|
|
42
|
+
}),
|
|
45
43
|
breakfast_unit_price: z.number().optional().nullish().openapi({
|
|
46
44
|
description:
|
|
47
45
|
'Price of breakfast per guest per night for the given **Hotel Room Offer**, expressed in the requested **currency**, when applicable.',
|
|
@@ -54,7 +52,6 @@ export const HOTEL_ROOM_OFFER_SCHEMA = z
|
|
|
54
52
|
}),
|
|
55
53
|
count: z
|
|
56
54
|
.number()
|
|
57
|
-
.optional()
|
|
58
55
|
.nullish()
|
|
59
56
|
.openapi({
|
|
60
57
|
description: `When **type = ${HotelRoomOfferType.HotelRoom}**: this parameters represents the available quantity for the given **Hotel Room Offer**.
|
|
@@ -73,13 +70,15 @@ export const HOTEL_ROOM_OFFER_SCHEMA = z
|
|
|
73
70
|
.openapi({
|
|
74
71
|
description: PACKAGE_TYPES_DESCRIPTION,
|
|
75
72
|
})
|
|
76
|
-
.nullish()
|
|
77
|
-
.optional(),
|
|
73
|
+
.nullish(),
|
|
78
74
|
price: z.number().openapi({
|
|
79
75
|
description:
|
|
80
76
|
'Price with taxes NOT INCLUDED of the given **Hotel Room Offer** including breakfast(s) when applicable, expressed in the requested **currency**.',
|
|
81
77
|
}),
|
|
82
78
|
source_market: SOURCE_MARKET_SCHEMA,
|
|
79
|
+
stay_taxes_info: z
|
|
80
|
+
.enum(StayTaxesInfoEnum)
|
|
81
|
+
.openapi({ description: 'Either INCLUDED, NOT_INCLUDED or UNKNOWN' }),
|
|
83
82
|
tags: TAGS_SCHEMA,
|
|
84
83
|
tax_included_price: z.number().openapi({
|
|
85
84
|
description: `Price of the given **Hotel Room Offer** including breakfast(s) when applicable, and including all taxes from returned **taxes** list parameter expressed in the requested **currency**.\n\nThis data is not returned for a **Hotel Room Offer** of type **${HotelRoomOfferType.HotelRoom}**, you'll need to compute and display the actual tax included price of the final **Hotel Room** package corresponding to the guest count and night count requested, or make a call to the **[Create Hotel Room Offer](/v1/documentation#operation/postV1Hotel_room_offers)** endpoint in order to get a valid and bookable **Hotel Room Offer** where **type = ${HotelRoomOfferType.Package}** based on a packaged list of **Hotel Room Offers** of type **${HotelRoomOfferType.HotelRoom}**.`,
|
|
@@ -90,10 +89,16 @@ export const HOTEL_ROOM_OFFER_SCHEMA = z
|
|
|
90
89
|
.openapi({
|
|
91
90
|
description: `Hotel Room Offer type.\n\n **Hotel Room Offers** with **type = "${HotelRoomOfferType.Package}"** are **Hotel Room Offers** that are already bookable and you'll be able to follow the next step of the **Booking Flow** calling **[Create Booking Policies endpoint](/v1/documentation#operation/postV1Booking_policies)**. \n\n Otherwise, you'll be able to create a new **Hotel Room Offer** with **type = "${HotelRoomOfferType.Package}"** from multiple **Hotel Room Offers** with **type = "${HotelRoomOfferType.HotelRoom}"**. See **[Create Hotel Room Offer endpoint](/v1/documentation#operation/postV1Hotel_room_offers)** for details.`,
|
|
92
91
|
})
|
|
93
|
-
.nullish()
|
|
94
92
|
.optional(),
|
|
95
93
|
})
|
|
96
94
|
.openapi('hotelRoomOfferApi', {
|
|
97
95
|
description: 'Description of the Hotel Room Offer.',
|
|
98
96
|
})
|
|
97
|
+
|
|
98
|
+
export const HOTEL_ROOM_OFFERS_SCHEMA = z.array(HOTEL_ROOM_OFFER_SCHEMA)
|
|
99
|
+
|
|
100
|
+
export const HOTEL_ROOM_OFFERS_RESPONSE_SCHEMA = z.object({
|
|
101
|
+
data: HOTEL_ROOM_OFFERS_SCHEMA,
|
|
102
|
+
meta: LIST_POLLING_META_SCHEMA,
|
|
103
|
+
})
|
|
99
104
|
/* eslint-enable camelcase */
|
|
@@ -57,10 +57,7 @@ export const HOTEL_ROOM_SCHEMA = z
|
|
|
57
57
|
.openapi({ description: 'Whether high resolution images are available.' })
|
|
58
58
|
.optional()
|
|
59
59
|
.nullish(),
|
|
60
|
-
id: z
|
|
61
|
-
.string()
|
|
62
|
-
.optional()
|
|
63
|
-
.openapi({ description: 'Hotel Room id, when applicable.' }),
|
|
60
|
+
id: z.string().openapi({ description: 'Hotel Room id, when applicable.' }),
|
|
64
61
|
image_indexes: z.array(z.number()).optional().nullish().openapi({
|
|
65
62
|
description:
|
|
66
63
|
'List of indexes corresponding to image names for the given Hotel Room among the related hotel images.',
|
package/src/types/calendar.ts
CHANGED
|
@@ -6,11 +6,11 @@ export interface ICalendarRange<
|
|
|
6
6
|
T extends ICalendarRangeDay = ICalendarRangeDay,
|
|
7
7
|
U = Record<string, unknown> | undefined,
|
|
8
8
|
> {
|
|
9
|
+
id: string
|
|
10
|
+
data: U
|
|
9
11
|
dateFrom: string
|
|
10
12
|
dateTo: string
|
|
11
13
|
days: T[]
|
|
12
|
-
data: U
|
|
13
|
-
id: string
|
|
14
14
|
name: string
|
|
15
15
|
resourceId: string
|
|
16
16
|
}
|
|
@@ -113,6 +113,12 @@ export interface Amenities {
|
|
|
113
113
|
* @memberof Amenities
|
|
114
114
|
*/
|
|
115
115
|
handicapAccessible?: boolean
|
|
116
|
+
/**
|
|
117
|
+
* Indoor pool.
|
|
118
|
+
* @type {boolean}
|
|
119
|
+
* @memberof Amenities
|
|
120
|
+
*/
|
|
121
|
+
indoorPool?: boolean
|
|
116
122
|
/**
|
|
117
123
|
* In house bar.
|
|
118
124
|
* @type {boolean}
|
|
@@ -131,12 +137,6 @@ export interface Amenities {
|
|
|
131
137
|
* @memberof Amenities
|
|
132
138
|
*/
|
|
133
139
|
inRoomMovies?: boolean
|
|
134
|
-
/**
|
|
135
|
-
* Indoor pool.
|
|
136
|
-
* @type {boolean}
|
|
137
|
-
* @memberof Amenities
|
|
138
|
-
*/
|
|
139
|
-
indoorPool?: boolean
|
|
140
140
|
/**
|
|
141
141
|
* Interior room entrance.
|
|
142
142
|
* @type {boolean}
|
|
@@ -216,17 +216,17 @@ export interface Amenities {
|
|
|
216
216
|
*/
|
|
217
217
|
sauna?: boolean
|
|
218
218
|
/**
|
|
219
|
-
*
|
|
219
|
+
* Tennis court.
|
|
220
220
|
* @type {boolean}
|
|
221
221
|
* @memberof Amenities
|
|
222
222
|
*/
|
|
223
|
-
|
|
223
|
+
tennisCourt?: boolean
|
|
224
224
|
/**
|
|
225
|
-
*
|
|
225
|
+
* TV in room.
|
|
226
226
|
* @type {boolean}
|
|
227
227
|
* @memberof Amenities
|
|
228
228
|
*/
|
|
229
|
-
|
|
229
|
+
tVInRoom?: boolean
|
|
230
230
|
/**
|
|
231
231
|
* 24/7 security.
|
|
232
232
|
* @type {boolean}
|
|
@@ -3,6 +3,12 @@ import type { CurrencyType } from './currency.ts'
|
|
|
3
3
|
import type { HotelRoomOffer } from './hotel-room-offer.ts'
|
|
4
4
|
|
|
5
5
|
export interface BookingPolicies {
|
|
6
|
+
/**
|
|
7
|
+
* **Booking Policy** id
|
|
8
|
+
* @type {string}
|
|
9
|
+
* @memberof BookingPolicies
|
|
10
|
+
*/
|
|
11
|
+
id: string
|
|
6
12
|
/**
|
|
7
13
|
* The total number of adults who will be staying in the property.
|
|
8
14
|
* @type {number}
|
|
@@ -39,6 +45,7 @@ export interface BookingPolicies {
|
|
|
39
45
|
* @memberof BookingPolicies
|
|
40
46
|
*/
|
|
41
47
|
currency: CurrencyType
|
|
48
|
+
|
|
42
49
|
/**
|
|
43
50
|
* Expiration date for this **Booking Policy**.
|
|
44
51
|
*
|
|
@@ -47,7 +54,6 @@ export interface BookingPolicies {
|
|
|
47
54
|
* @memberof BookingPolicies
|
|
48
55
|
*/
|
|
49
56
|
expiresAt: string | null
|
|
50
|
-
|
|
51
57
|
hasRoomingLists: boolean
|
|
52
58
|
/**
|
|
53
59
|
* Hotel id
|
|
@@ -61,12 +67,6 @@ export interface BookingPolicies {
|
|
|
61
67
|
* @memberof BookingPolicies
|
|
62
68
|
*/
|
|
63
69
|
hotelRoomOffer: HotelRoomOffer
|
|
64
|
-
/**
|
|
65
|
-
* **Booking Policy** id
|
|
66
|
-
* @type {string}
|
|
67
|
-
* @memberof BookingPolicies
|
|
68
|
-
*/
|
|
69
|
-
id: string
|
|
70
70
|
/**
|
|
71
71
|
* Indicates whether the price of the **Hotel Room Offer** (without breakfast included) has increased compared to the price returned by [Retrieve Hotel Room Offers endpoint](/v1/documentation#operation/getV1Hotel_room_offers).
|
|
72
72
|
*
|
|
@@ -10,6 +10,12 @@ import type { SourceMarket } from './source-market.ts'
|
|
|
10
10
|
import type { Tax } from './tax.ts'
|
|
11
11
|
|
|
12
12
|
export interface Booking {
|
|
13
|
+
/**
|
|
14
|
+
* Booking Id
|
|
15
|
+
* @type {string}
|
|
16
|
+
* @memberof Booking
|
|
17
|
+
*/
|
|
18
|
+
id?: string | null
|
|
13
19
|
/**
|
|
14
20
|
* The total number of adults who will be staying in the property.
|
|
15
21
|
* @type {number}
|
|
@@ -100,12 +106,6 @@ export interface Booking {
|
|
|
100
106
|
* @memberof Booking
|
|
101
107
|
*/
|
|
102
108
|
hotelId: string
|
|
103
|
-
/**
|
|
104
|
-
*
|
|
105
|
-
* @type {HotelRoomOffer}
|
|
106
|
-
* @memberof Booking
|
|
107
|
-
*/
|
|
108
|
-
hotelRoomOffer: HotelRoomOffer
|
|
109
109
|
/**
|
|
110
110
|
* Hotel rooming lists of a hotel booking
|
|
111
111
|
* @type {Array<HotelRoomingList>}
|
|
@@ -113,11 +113,11 @@ export interface Booking {
|
|
|
113
113
|
*/
|
|
114
114
|
hotelRoomingLists?: HotelRoomingList[]
|
|
115
115
|
/**
|
|
116
|
-
*
|
|
117
|
-
* @type {
|
|
116
|
+
*
|
|
117
|
+
* @type {HotelRoomOffer}
|
|
118
118
|
* @memberof Booking
|
|
119
119
|
*/
|
|
120
|
-
|
|
120
|
+
hotelRoomOffer: HotelRoomOffer
|
|
121
121
|
/**
|
|
122
122
|
* The list of invoices and credit notes (when applicable) direct urls associated to the Booking.
|
|
123
123
|
* @type {Array<InvoiceApi>}
|
|
@@ -184,18 +184,18 @@ export interface Booking {
|
|
|
184
184
|
* @memberof Booking
|
|
185
185
|
*/
|
|
186
186
|
taxAmount: number
|
|
187
|
-
/**
|
|
188
|
-
* Price of the booking including taxes expressed in the booking currency.
|
|
189
|
-
* @type {number}
|
|
190
|
-
* @memberof Booking
|
|
191
|
-
*/
|
|
192
|
-
taxIncludedPrice: number
|
|
193
187
|
/**
|
|
194
188
|
*
|
|
195
189
|
* @type {Array<Tax>}
|
|
196
190
|
* @memberof Booking
|
|
197
191
|
*/
|
|
198
192
|
taxes?: Tax[] | null
|
|
193
|
+
/**
|
|
194
|
+
* Price of the booking including taxes expressed in the booking currency.
|
|
195
|
+
* @type {number}
|
|
196
|
+
* @memberof Booking
|
|
197
|
+
*/
|
|
198
|
+
taxIncludedPrice: number
|
|
199
199
|
/**
|
|
200
200
|
* Link to Revolugo terms and conditions under which the booking is made.
|
|
201
201
|
* @type {string}
|
|
@@ -167,4 +167,11 @@ export interface PrebookFormValues {
|
|
|
167
167
|
phoneNumber: string
|
|
168
168
|
salutation: ContactPerson['salutation']
|
|
169
169
|
specialRequests: ContactPerson['remarks']
|
|
170
|
+
organizationAddress?: string
|
|
171
|
+
organizationCity?: string
|
|
172
|
+
organizationCountry?: string
|
|
173
|
+
organizationName?: string
|
|
174
|
+
organizationState?: string
|
|
175
|
+
organizationVatNumber?: string
|
|
176
|
+
organizationZipCode?: string
|
|
170
177
|
}
|
|
@@ -35,6 +35,7 @@ export enum ElementsEvent {
|
|
|
35
35
|
HotelOffersPollingStarted = 'hotel-offers:polling:started',
|
|
36
36
|
HotelOffersRetrieved = 'hotel-offers:retrieved',
|
|
37
37
|
HotelRetrieved = 'hotel:retrieved',
|
|
38
|
+
HotelRoomOfferItemVisible = 'hotel-room-offer:item:visible',
|
|
38
39
|
HotelRoomOfferRequestCreated = 'hotel-room-offer-request:created',
|
|
39
40
|
HotelRoomOfferRequestRetrieved = 'hotel-room-offer-request:retrieved',
|
|
40
41
|
HotelRoomOffersBtnClick = 'hotel-room-offers:click:btn',
|
|
@@ -68,6 +69,7 @@ export interface ElementsEventCallbacks {
|
|
|
68
69
|
[ElementsEvent.HotelOffersPollingStarted]: any
|
|
69
70
|
[ElementsEvent.HotelOffersRetrieved]: HotelOffer[]
|
|
70
71
|
[ElementsEvent.HotelRetrieved]: Hotel
|
|
72
|
+
[ElementsEvent.HotelRoomOfferItemVisible]: [HotelRoomOffer, number]
|
|
71
73
|
[ElementsEvent.HotelRoomOfferRequestCreated]: HotelRoomOfferRequestResponse
|
|
72
74
|
[ElementsEvent.HotelRoomOfferRequestRetrieved]: HotelRoomOfferRequestResponse
|
|
73
75
|
[ElementsEvent.HotelRoomOffersBtnClick]: HotelRoomOffer
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
export interface EventMetadata {
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Unique id of the event
|
|
4
4
|
* @type {string}
|
|
5
5
|
* @memberof EventMetadata
|
|
6
6
|
*/
|
|
7
|
-
|
|
7
|
+
id?: string
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* End date of the event formatted as YYYY-MM-DD.
|
|
10
10
|
* @type {string}
|
|
11
11
|
* @memberof EventMetadata
|
|
12
12
|
*/
|
|
13
|
-
|
|
13
|
+
dateEnd?: string
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* Start date of the event formatted as YYYY-MM-DD.
|
|
16
16
|
* @type {string}
|
|
17
17
|
* @memberof EventMetadata
|
|
18
18
|
*/
|
|
19
|
-
|
|
19
|
+
dateStart?: string
|
|
20
20
|
/**
|
|
21
21
|
* Image URL of the event
|
|
22
22
|
* @type {string}
|
|
@@ -12,11 +12,11 @@ export type HotelOffersSortByOrderType = `${HotelOffersSortByOrderEnum}`
|
|
|
12
12
|
|
|
13
13
|
export interface HotelOffersListPayload {
|
|
14
14
|
currency: CurrencyType
|
|
15
|
-
hotelOfferRequestId: string
|
|
16
15
|
endingBefore?: string | null
|
|
17
16
|
filterByPrice?: string
|
|
18
17
|
filterByReviewRating?: number
|
|
19
18
|
filterByStar?: string
|
|
19
|
+
hotelOfferRequestId: string
|
|
20
20
|
hotelRoomOffersLimit?: number
|
|
21
21
|
includeHotelContentDetails?: boolean | null
|
|
22
22
|
lang?: Locale
|