@odynn/awayz-hotels 0.2.24 → 0.2.26
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/dist/hooks/useHotelDetails/useHotelDetails.js +14 -14
- package/dist/lib/hooks/index.d.ts +1 -0
- package/dist/lib/hooks/useHotelDetails/useHotelDetails.api.d.ts +1 -1
- package/dist/lib/hooks/useHotelDetails/useHotelDetails.d.ts +1 -1
- package/dist/lib/hooks/useHotelDetails/useHotelDetails.types.d.ts +28 -0
- package/dist/lib/services/hotel/HotelService.d.ts +2 -2
- package/dist/lib/services/hotel/HotelService.types.d.ts +0 -28
- package/package.json +1 -1
|
@@ -8,7 +8,7 @@ import { useQuery as c } from "@tanstack/react-query";
|
|
|
8
8
|
import { h as q } from "../../moment-BGjjqtLQ.js";
|
|
9
9
|
import { useAwayzContext as ee } from "@odynn/awayz-core";
|
|
10
10
|
const te = "USD", le = (t) => {
|
|
11
|
-
var k, f,
|
|
11
|
+
var k, f, m, p, d, y, C, g, b, v, F, R;
|
|
12
12
|
if (!t)
|
|
13
13
|
throw new Error(
|
|
14
14
|
"Hotel is required in order to initiate the hotel details flow"
|
|
@@ -36,7 +36,7 @@ const te = "USD", le = (t) => {
|
|
|
36
36
|
t.hotelId,
|
|
37
37
|
t.hotelGroup,
|
|
38
38
|
(f = e == null ? void 0 : e.checkinDate) == null ? void 0 : f.valueOf(),
|
|
39
|
-
(
|
|
39
|
+
(m = e == null ? void 0 : e.checkoutDate) == null ? void 0 : m.valueOf()
|
|
40
40
|
],
|
|
41
41
|
queryFn: () => J({
|
|
42
42
|
hotel: t,
|
|
@@ -61,7 +61,7 @@ const te = "USD", le = (t) => {
|
|
|
61
61
|
} = c({
|
|
62
62
|
queryKey: [
|
|
63
63
|
"fetchAvailableRooms",
|
|
64
|
-
(
|
|
64
|
+
(p = t.cashBookingOffers) == null ? void 0 : p.accommodationId,
|
|
65
65
|
(d = e == null ? void 0 : e.checkinDate) == null ? void 0 : d.valueOf(),
|
|
66
66
|
(y = e == null ? void 0 : e.checkoutDate) == null ? void 0 : y.valueOf(),
|
|
67
67
|
o == null ? void 0 : o.guests,
|
|
@@ -86,9 +86,9 @@ const te = "USD", le = (t) => {
|
|
|
86
86
|
cashHotelDetails: t,
|
|
87
87
|
cashRooms: []
|
|
88
88
|
}, {
|
|
89
|
-
data:
|
|
90
|
-
isFetching:
|
|
91
|
-
isFetched:
|
|
89
|
+
data: P,
|
|
90
|
+
isFetching: T,
|
|
91
|
+
isFetched: x
|
|
92
92
|
} = c({
|
|
93
93
|
queryKey: [
|
|
94
94
|
"bestCheckout",
|
|
@@ -108,9 +108,9 @@ const te = "USD", le = (t) => {
|
|
|
108
108
|
bestCheckout: X(t, a),
|
|
109
109
|
isAvailable: !1
|
|
110
110
|
}
|
|
111
|
-
}), { bestCheckout: l, isAvailable: D } =
|
|
111
|
+
}), { bestCheckout: l, isAvailable: D } = P || {
|
|
112
112
|
isAvailable: !1
|
|
113
|
-
}, { data:
|
|
113
|
+
}, { data: L } = c({
|
|
114
114
|
queryKey: [
|
|
115
115
|
"pointsAsCash",
|
|
116
116
|
t.hotelId,
|
|
@@ -119,25 +119,25 @@ const te = "USD", le = (t) => {
|
|
|
119
119
|
(R = e == null ? void 0 : e.checkoutDate) == null ? void 0 : R.valueOf()
|
|
120
120
|
],
|
|
121
121
|
queryFn: () => $(l.totalCashCost),
|
|
122
|
-
enabled:
|
|
122
|
+
enabled: x && D,
|
|
123
123
|
retry: !1
|
|
124
124
|
});
|
|
125
125
|
return {
|
|
126
|
-
transferPartners: I,
|
|
126
|
+
transferPartners: I || [],
|
|
127
127
|
loadingTransferPartners: G,
|
|
128
128
|
// Points Check
|
|
129
|
-
pointsRooms: K,
|
|
129
|
+
pointsRooms: K || [],
|
|
130
130
|
loadingLivePointsCheck: n,
|
|
131
131
|
// Cash Rooms
|
|
132
|
-
cashRooms: E,
|
|
132
|
+
cashRooms: E || [],
|
|
133
133
|
loadingCashRooms: u,
|
|
134
134
|
// Best Checkout
|
|
135
135
|
bestCheckout: l,
|
|
136
|
-
loadingBestCheckout:
|
|
136
|
+
loadingBestCheckout: T,
|
|
137
137
|
// Combined availability
|
|
138
138
|
isAvailable: D,
|
|
139
139
|
// Points as Cash
|
|
140
|
-
pointsAsCash:
|
|
140
|
+
pointsAsCash: L,
|
|
141
141
|
hotelDetails: O(
|
|
142
142
|
t,
|
|
143
143
|
r,
|
|
@@ -2,3 +2,4 @@ export { useHotelSearch } from './useHotelSearch/useHotelSearch';
|
|
|
2
2
|
export { useLocationSearch } from './useLocationSearch/useLocationSearch';
|
|
3
3
|
export { useHotelDetails } from './useHotelDetails/useHotelDetails';
|
|
4
4
|
export { useHotelSort } from './useHotelSort/useHotelSort';
|
|
5
|
+
export * from './useHotelDetails/useHotelDetails.types';
|
|
@@ -3,7 +3,7 @@ import { IHotelDetails } from '../../components/HotelResult/HotelResult.types';
|
|
|
3
3
|
import { IRoom } from '../../services/booking/BookingService.types';
|
|
4
4
|
import { IPointsAsCash } from '../../utilities/pointsAsCashUtils';
|
|
5
5
|
import { IBestCheckout } from './useHotelDetails.types';
|
|
6
|
-
export declare const fetchTransferPartners: (hotelGroup: string) => Promise<import('
|
|
6
|
+
export declare const fetchTransferPartners: (hotelGroup: string) => Promise<import('./useHotelDetails.types').ITransferPartner[]>;
|
|
7
7
|
interface IPointsCheckResult {
|
|
8
8
|
pointsHotelDetails: IHotelDetails;
|
|
9
9
|
pointsRooms: IRoom[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IHotelDetails } from '../../components/HotelResult/HotelResult.types';
|
|
2
2
|
export declare const useHotelDetails: (hotel: IHotelDetails) => {
|
|
3
|
-
transferPartners: import('
|
|
3
|
+
transferPartners: import('./useHotelDetails.types').ITransferPartner[];
|
|
4
4
|
loadingTransferPartners: boolean;
|
|
5
5
|
pointsRooms: import('../../main').IRoom[];
|
|
6
6
|
loadingLivePointsCheck: boolean;
|
|
@@ -123,3 +123,31 @@ export interface IBestCheckout {
|
|
|
123
123
|
*/
|
|
124
124
|
nightlyCashCost: number;
|
|
125
125
|
}
|
|
126
|
+
export interface ITransferPartner {
|
|
127
|
+
partnerProgram: string;
|
|
128
|
+
ratio: number;
|
|
129
|
+
bonus: number;
|
|
130
|
+
transferMinutes: number;
|
|
131
|
+
minimumTransfer: number;
|
|
132
|
+
transferDenominator: number;
|
|
133
|
+
stepBonus: {
|
|
134
|
+
bonus: number;
|
|
135
|
+
stepThreshold: number;
|
|
136
|
+
};
|
|
137
|
+
steps: IStep[];
|
|
138
|
+
shortName: string;
|
|
139
|
+
program: string;
|
|
140
|
+
region: string;
|
|
141
|
+
partnerProgramCategory: string[];
|
|
142
|
+
transferTime: string;
|
|
143
|
+
}
|
|
144
|
+
export interface IStep {
|
|
145
|
+
text: string;
|
|
146
|
+
links: ITransferLink[];
|
|
147
|
+
id: string;
|
|
148
|
+
}
|
|
149
|
+
export interface ITransferLink {
|
|
150
|
+
text: string;
|
|
151
|
+
url: string;
|
|
152
|
+
id: string;
|
|
153
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { IHotelPointsCheckArgs, ISearchByHotelIdRequest, ISearchHotelsParams, ISearchLocation
|
|
1
|
+
import { IHotelPointsCheckArgs, ISearchByHotelIdRequest, ISearchHotelsParams, ISearchLocation } from './HotelService.types';
|
|
2
2
|
import { IHotelDetails, ILiveHotelCheck } from '../../components/HotelResult/HotelResult.types';
|
|
3
3
|
import { TServiceResponse } from '@type-op/shared';
|
|
4
|
-
import { IBestCheckout } from '../../hooks/useHotelDetails/useHotelDetails.types';
|
|
4
|
+
import { IBestCheckout, ITransferPartner } from '../../hooks/useHotelDetails/useHotelDetails.types';
|
|
5
5
|
declare class _HotelService {
|
|
6
6
|
getLocations: (searchInputQuery: string) => Promise<TServiceResponse<ISearchLocation[]>>;
|
|
7
7
|
searchByCoords: (request: ISearchHotelsParams) => Promise<TServiceResponse<IHotelDetails[]>>;
|
|
@@ -201,32 +201,4 @@ export interface IHotelPointsCheckArgs {
|
|
|
201
201
|
checkinDate: Moment;
|
|
202
202
|
checkoutDate: Moment;
|
|
203
203
|
}
|
|
204
|
-
export interface ITransferPartner {
|
|
205
|
-
partnerProgram: string;
|
|
206
|
-
ratio: number;
|
|
207
|
-
bonus: number;
|
|
208
|
-
transferMinutes: number;
|
|
209
|
-
minimumTransfer: number;
|
|
210
|
-
transferDenominator: number;
|
|
211
|
-
stepBonus: {
|
|
212
|
-
bonus: number;
|
|
213
|
-
stepThreshold: number;
|
|
214
|
-
};
|
|
215
|
-
steps: IStep[];
|
|
216
|
-
shortName: string;
|
|
217
|
-
program: string;
|
|
218
|
-
region: string;
|
|
219
|
-
partnerProgramCategory: string[];
|
|
220
|
-
transferTime: string;
|
|
221
|
-
}
|
|
222
|
-
export interface IStep {
|
|
223
|
-
text: string;
|
|
224
|
-
links: ITransferLink[];
|
|
225
|
-
id: string;
|
|
226
|
-
}
|
|
227
|
-
export interface ITransferLink {
|
|
228
|
-
text: string;
|
|
229
|
-
url: string;
|
|
230
|
-
id: string;
|
|
231
|
-
}
|
|
232
204
|
export {};
|