@revolugo/common 7.0.0-alpha.8 → 7.0.0-alpha.9
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
CHANGED
|
@@ -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.',
|