@odynn/awayz-core 0.9.19 → 0.9.21
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/TripsService-GImsS17_.js +148 -0
- package/dist/assets/_styles6.css +1 -1
- package/dist/components/Bookings/FlightBooking/FlightBooking.js +123 -85
- package/dist/components/CashValue/CashValue.js +1 -1
- package/dist/components/CashValue/CashValue.stories.js +1 -1
- package/dist/components/ClientPointsValue/ClientPointsValue.js +1 -1
- package/dist/components/Wallet/Card/Card.stories.js +1 -1
- package/dist/hooks/useAwayzAuth/useAwayzAuth.js +1 -1
- package/dist/hooks/useBookingManagement/useBookingManagement.js +1 -1
- package/dist/hooks/useBookingManagement/useBookingManagement.test.js +2 -2
- package/dist/hooks/useFeatureFlags.js +13 -11
- package/dist/hooks/useSearchLimit.js +1 -1
- package/dist/hooks/useTripManagement/mocks/index.js +12 -12
- package/dist/hooks/useTripManagement/useTripManagement.js +2 -2
- package/dist/hooks/useTripManagement/useTripManagement.test.js +122 -92
- package/dist/hooks/useWallet/useWallet.js +1 -1
- package/dist/hooks/useWallet/useWallet.test.js +2 -2
- package/dist/lib/components/Bookings/FlightBooking/FlightBooking.d.ts +15 -3
- package/dist/lib/hooks/useFeatureFlags.d.ts +1 -1
- package/dist/lib/hooks/useTripManagement/mocks/UncategorisedBookings200.json.d.ts +88 -0
- package/dist/lib/services/trips/TripService.types.d.ts +11 -0
- package/dist/magic-string.es-uPKorP4O.js +663 -0
- package/dist/main.js +1 -1
- package/dist/{noRetryInstance-De2sH_IH.js → noRetryInstance-DKhe8ju0.js} +35 -35
- package/dist/providers/AwayzProvider.js +1 -1
- package/dist/services/account/AccountService.js +1 -1
- package/dist/services/bookings/BookingService.js +1 -1
- package/dist/services/currency/CurrencyService.js +1 -1
- package/dist/services/features/featureService.js +1 -1
- package/dist/services/index.js +1 -1
- package/dist/services/instance.js +1 -1
- package/dist/services/instanceConfig.js +1 -1
- package/dist/services/noRetryInstance.js +1 -1
- package/dist/services/preferences/PreferencesService.js +1 -1
- package/dist/services/rewards/RewardsService.js +1 -1
- package/dist/services/trips/TripsService.js +3 -3
- package/dist/services/wallet/WalletService.js +1 -1
- package/dist/tests/TestWrapper.js +1130 -1153
- package/dist/utils/clientPoints.js +1 -1
- package/dist/vi.2VT5v0um-lKoi8TEt.js +10573 -0
- package/package.json +4 -2
- package/dist/TripsService-BJPYRlRO.js +0 -141
- package/dist/magic-string.es-D4UQQyt0.js +0 -859
- package/dist/vi.ClIskdbk-k6t29WRA.js +0 -12860
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useQuery as u, useMutation as p } from "@tanstack/react-query";
|
|
2
2
|
import { h as m } from "../../arrayExtensions-DlcBOj5a.js";
|
|
3
|
-
import { E as e } from "../../noRetryInstance-
|
|
3
|
+
import { E as e } from "../../noRetryInstance-DKhe8ju0.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import "react/jsx-runtime";
|
|
6
6
|
import "react-i18next";
|
|
@@ -13,7 +13,7 @@ import { awayzClient as o } from "../../configs/awayzClient.js";
|
|
|
13
13
|
import "../../index-Cv-wvFlM.js";
|
|
14
14
|
import "../../context/AwayzContext.js";
|
|
15
15
|
/* empty css */
|
|
16
|
-
import { T as n } from "../../TripsService-
|
|
16
|
+
import { T as n } from "../../TripsService-GImsS17_.js";
|
|
17
17
|
const b = ({
|
|
18
18
|
tripId: t,
|
|
19
19
|
tripDetails: s
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h as p } from "../../arrayExtensions-DlcBOj5a.js";
|
|
2
|
-
import { D as f } from "../../TripsService-
|
|
2
|
+
import { D as f } from "../../TripsService-GImsS17_.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import { renderHook as o, waitFor as i } from "../../tests/TestWrapper.js";
|
|
5
5
|
import { EMyTripsEndpoints as c } from "../../configs/endpoints.js";
|
|
@@ -10,80 +10,80 @@ import "../../_styles.flight-booking-CaUgKcMC.js";
|
|
|
10
10
|
/* empty css */
|
|
11
11
|
import "@tanstack/react-query";
|
|
12
12
|
import "../../configs/awayzClient.js";
|
|
13
|
-
import { c as d } from "../../noRetryInstance-
|
|
13
|
+
import { c as d } from "../../noRetryInstance-DKhe8ju0.js";
|
|
14
14
|
/* empty css */
|
|
15
15
|
/* empty css */
|
|
16
16
|
import "../../index-Cv-wvFlM.js";
|
|
17
17
|
import "../../context/AwayzContext.js";
|
|
18
|
-
import { EBookingType as
|
|
18
|
+
import { EBookingType as g } from "../../services/trips/TripService.types.js";
|
|
19
19
|
import { useTripManagement as n } from "./useTripManagement.js";
|
|
20
20
|
/* empty css */
|
|
21
|
-
import { UncategorisedBookings200 as
|
|
22
|
-
import { d as u, v as
|
|
23
|
-
let
|
|
24
|
-
past: [...
|
|
25
|
-
upcoming: [...
|
|
21
|
+
import { UncategorisedBookings200 as T, PastTrip200 as y, UpcomingTrip200 as B, UpdatedTrip200 as b } from "./mocks/index.js";
|
|
22
|
+
import { d as u, v as k, b as D, t as s, g as e } from "../../vi.2VT5v0um-lKoi8TEt.js";
|
|
23
|
+
let l = {
|
|
24
|
+
past: [...y.data],
|
|
25
|
+
upcoming: [...B.data].concat(b.data)
|
|
26
26
|
};
|
|
27
27
|
u("useTripManagement", () => {
|
|
28
|
-
|
|
29
|
-
var a,
|
|
30
|
-
return
|
|
31
|
-
data:
|
|
32
|
-
}) : ((a =
|
|
33
|
-
data: { ...
|
|
34
|
-
}) : ((
|
|
35
|
-
data: { ...
|
|
28
|
+
k.mocked(d.get).mockImplementation((r, t) => {
|
|
29
|
+
var a, m;
|
|
30
|
+
return r === c.UNCATEGORISED_BOOKINGS ? Promise.resolve({
|
|
31
|
+
data: T
|
|
32
|
+
}) : ((a = t == null ? void 0 : t.params) == null ? void 0 : a.status) === "past" ? Promise.resolve({
|
|
33
|
+
data: { ...y, data: l.past }
|
|
34
|
+
}) : ((m = t == null ? void 0 : t.params) == null ? void 0 : m.status) === "upcoming" ? Promise.resolve({
|
|
35
|
+
data: { ...B, data: l.upcoming }
|
|
36
36
|
}) : Promise.resolve({ data: {} });
|
|
37
|
-
}),
|
|
38
|
-
if (
|
|
39
|
-
const
|
|
40
|
-
...
|
|
37
|
+
}), k.mocked(d.put).mockImplementation((r) => {
|
|
38
|
+
if (r === `${c.TRIPS}/67fd23bc3a7cbcd0a8757cdc`) {
|
|
39
|
+
const t = {
|
|
40
|
+
...b.data,
|
|
41
41
|
name: "Updated Trip"
|
|
42
42
|
};
|
|
43
|
-
return
|
|
44
|
-
(a) => a._id === "67fd23bc3a7cbcd0a8757cdc" ?
|
|
45
|
-
),
|
|
46
|
-
(a) => a._id === "67fd23bc3a7cbcd0a8757cdc" ?
|
|
43
|
+
return l.past = l.past.map(
|
|
44
|
+
(a) => a._id === "67fd23bc3a7cbcd0a8757cdc" ? t : a
|
|
45
|
+
), l.upcoming = l.upcoming.map(
|
|
46
|
+
(a) => a._id === "67fd23bc3a7cbcd0a8757cdc" ? t : a
|
|
47
47
|
), Promise.resolve({
|
|
48
|
-
data:
|
|
48
|
+
data: b
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
|
-
return
|
|
51
|
+
return r === c.ADD_BOOKING ? Promise.resolve({
|
|
52
52
|
data: { success: !0, message: "Booking added to trip successfully" }
|
|
53
53
|
}) : Promise.resolve({ data: {} });
|
|
54
54
|
}), D(() => {
|
|
55
|
-
|
|
55
|
+
k.clearAllMocks();
|
|
56
56
|
}), u("Get User Trips", () => {
|
|
57
57
|
s("Has past trips", async () => {
|
|
58
|
-
const { result:
|
|
58
|
+
const { result: r } = o(() => n());
|
|
59
59
|
await i(() => {
|
|
60
|
-
e(
|
|
61
|
-
p(
|
|
60
|
+
e(r.current.pastTrips.length).greaterThan(0), e(
|
|
61
|
+
p(r.current.pastTrips[0].endDate).isBefore(p())
|
|
62
62
|
).toBe(!0);
|
|
63
63
|
});
|
|
64
64
|
}), s("Has upcoming trips", async () => {
|
|
65
|
-
const { result:
|
|
65
|
+
const { result: r } = o(() => n());
|
|
66
66
|
await i(() => {
|
|
67
|
-
e(
|
|
68
|
-
p(
|
|
67
|
+
e(r.current.upcomingTrips.length).greaterThan(0), e(
|
|
68
|
+
p(r.current.upcomingTrips[0].startDate).isAfter(p())
|
|
69
69
|
).toBe(!0);
|
|
70
70
|
});
|
|
71
71
|
}), s("Has correct flight booking structure", async () => {
|
|
72
|
-
const { result:
|
|
72
|
+
const { result: r } = o(() => n());
|
|
73
73
|
await i(() => {
|
|
74
|
-
const
|
|
75
|
-
e(
|
|
74
|
+
const t = r.current.uncategorisedFlightBookings[0], a = T.data.flight_bookings[0];
|
|
75
|
+
e(t).toMatchObject({
|
|
76
76
|
id: a._id,
|
|
77
77
|
reference: a.booking_reference,
|
|
78
78
|
startDate: e.any(String),
|
|
79
79
|
endDate: e.any(String),
|
|
80
|
-
bookingType:
|
|
81
|
-
airlines: a.slices.map((
|
|
80
|
+
bookingType: g.FLIGHT,
|
|
81
|
+
airlines: a.slices.map((m) => ({
|
|
82
82
|
logo: f + ".svg",
|
|
83
|
-
name:
|
|
83
|
+
name: m.carriers.operating[0]
|
|
84
84
|
})),
|
|
85
85
|
arrival: {
|
|
86
|
-
airportCode: a.slices.
|
|
86
|
+
airportCode: a.slices[0].destination,
|
|
87
87
|
location: ""
|
|
88
88
|
},
|
|
89
89
|
departure: {
|
|
@@ -95,19 +95,49 @@ u("useTripManagement", () => {
|
|
|
95
95
|
hasAirlineChanges: !1,
|
|
96
96
|
orderId: a.order_id,
|
|
97
97
|
type: a.type,
|
|
98
|
-
cancelledAt: a.cancelled_at
|
|
98
|
+
cancelledAt: a.cancelled_at,
|
|
99
|
+
isRoundTrip: !1
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
}), s("Has correct round-trip flight booking structure", async () => {
|
|
103
|
+
const { result: r } = o(() => n());
|
|
104
|
+
await i(() => {
|
|
105
|
+
const t = r.current.uncategorisedFlightBookings[1], a = T.data.flight_bookings[1];
|
|
106
|
+
e(t).toMatchObject({
|
|
107
|
+
id: a._id,
|
|
108
|
+
reference: a.booking_reference,
|
|
109
|
+
bookingType: g.FLIGHT,
|
|
110
|
+
isRoundTrip: !0,
|
|
111
|
+
departure: {
|
|
112
|
+
airportCode: "LAX",
|
|
113
|
+
location: ""
|
|
114
|
+
},
|
|
115
|
+
arrival: {
|
|
116
|
+
airportCode: "HRL",
|
|
117
|
+
location: ""
|
|
118
|
+
},
|
|
119
|
+
inboundDeparture: {
|
|
120
|
+
airportCode: "HRL",
|
|
121
|
+
location: ""
|
|
122
|
+
},
|
|
123
|
+
inboundArrival: {
|
|
124
|
+
airportCode: "LAX",
|
|
125
|
+
location: ""
|
|
126
|
+
},
|
|
127
|
+
outboundArrivalDate: "2025-07-06T22:29:00.000Z",
|
|
128
|
+
inboundDepartureDate: "2025-07-10T20:07:00.000Z"
|
|
99
129
|
});
|
|
100
130
|
});
|
|
101
131
|
}), s("Has correct hotel booking structure", async () => {
|
|
102
|
-
const { result:
|
|
132
|
+
const { result: r } = o(() => n());
|
|
103
133
|
await i(() => {
|
|
104
|
-
const
|
|
105
|
-
e(
|
|
134
|
+
const t = r.current.uncategorisedHotelBookings[0];
|
|
135
|
+
e(t).toMatchObject({
|
|
106
136
|
id: e.any(String),
|
|
107
137
|
reference: e.any(String),
|
|
108
138
|
startDate: e.any(String),
|
|
109
139
|
endDate: e.any(String),
|
|
110
|
-
bookingType:
|
|
140
|
+
bookingType: g.HOTEL,
|
|
111
141
|
name: e.any(String),
|
|
112
142
|
image: e.any(String),
|
|
113
143
|
guests: e.any(Number),
|
|
@@ -119,83 +149,83 @@ u("useTripManagement", () => {
|
|
|
119
149
|
});
|
|
120
150
|
}), u("Create Trip", () => {
|
|
121
151
|
s("Invalid Requests", async () => {
|
|
122
|
-
const { result:
|
|
123
|
-
|
|
124
|
-
var
|
|
125
|
-
e(
|
|
152
|
+
const { result: r } = o(() => n());
|
|
153
|
+
r.current.createTrip(), await i(() => {
|
|
154
|
+
var t;
|
|
155
|
+
e(r.current.isCreateTripError).toBe(!0), e((t = r.current.createTripError) == null ? void 0 : t.message).toContain(
|
|
126
156
|
"Trip details are required to create a trip"
|
|
127
157
|
);
|
|
128
|
-
}),
|
|
158
|
+
}), r.current.createTrip({
|
|
129
159
|
name: "",
|
|
130
160
|
startDate: "",
|
|
131
161
|
endDate: ""
|
|
132
162
|
}), await i(() => {
|
|
133
|
-
var
|
|
134
|
-
e(
|
|
163
|
+
var t;
|
|
164
|
+
e(r.current.isCreateTripError).toBe(!0), e((t = r.current.createTripError) == null ? void 0 : t.message).toContain(
|
|
135
165
|
"Trip name, start date, and end date are required"
|
|
136
166
|
);
|
|
137
167
|
});
|
|
138
168
|
}), s("Can successfully create a trip", async () => {
|
|
139
|
-
const
|
|
169
|
+
const r = {
|
|
140
170
|
name: "New Trip",
|
|
141
171
|
startDate: p().add(1, "days").format("YYYY-MM-DD"),
|
|
142
172
|
endDate: p().add(2, "days").format("YYYY-MM-DD")
|
|
143
|
-
}, { result:
|
|
144
|
-
|
|
173
|
+
}, { result: t } = o(() => n());
|
|
174
|
+
t.current.createTrip(r), await i(() => {
|
|
145
175
|
e(d.post).toHaveBeenCalledWith(
|
|
146
176
|
c.TRIPS,
|
|
147
177
|
e.objectContaining({
|
|
148
|
-
name:
|
|
149
|
-
start_date:
|
|
150
|
-
end_date:
|
|
178
|
+
name: r.name,
|
|
179
|
+
start_date: r.startDate,
|
|
180
|
+
end_date: r.endDate
|
|
151
181
|
})
|
|
152
182
|
);
|
|
153
183
|
});
|
|
154
184
|
});
|
|
155
185
|
}), u("Delete Trip", () => {
|
|
156
186
|
s("Can successfully delete a trip", async () => {
|
|
157
|
-
const
|
|
158
|
-
|
|
187
|
+
const r = "12345", { result: t } = o(() => n());
|
|
188
|
+
t.current.deleteTrip(r), await i(() => {
|
|
159
189
|
e(d.delete).toHaveBeenCalledWith(
|
|
160
|
-
`${c.TRIPS}/${
|
|
190
|
+
`${c.TRIPS}/${r}`
|
|
161
191
|
);
|
|
162
192
|
});
|
|
163
193
|
});
|
|
164
194
|
}), u("Update Trip", () => {
|
|
165
195
|
s("Invalid tripId arg", async () => {
|
|
166
|
-
const { result:
|
|
167
|
-
|
|
196
|
+
const { result: r } = o(() => n());
|
|
197
|
+
r.current.updateTrip({
|
|
168
198
|
tripId: "",
|
|
169
199
|
tripDetails: {
|
|
170
200
|
name: "Updated Trip"
|
|
171
201
|
}
|
|
172
202
|
}), await i(() => {
|
|
173
|
-
var
|
|
174
|
-
e(
|
|
203
|
+
var t;
|
|
204
|
+
e(r.current.isUpdateTripError).toBe(!0), e((t = r.current.updateTripError) == null ? void 0 : t.message).toContain(
|
|
175
205
|
"Trip ID is required"
|
|
176
206
|
);
|
|
177
207
|
});
|
|
178
208
|
}), s("Invalid tripDetails arg", async () => {
|
|
179
|
-
const { result:
|
|
180
|
-
|
|
209
|
+
const { result: r } = o(() => n());
|
|
210
|
+
r.current.updateTrip({
|
|
181
211
|
tripId: "123",
|
|
182
212
|
tripDetails: {}
|
|
183
213
|
}), await i(() => {
|
|
184
|
-
var
|
|
185
|
-
e(
|
|
214
|
+
var t;
|
|
215
|
+
e(r.current.isUpdateTripError).toBe(!0), e((t = r.current.updateTripError) == null ? void 0 : t.message).toContain(
|
|
186
216
|
"Trip details must be provided for update"
|
|
187
217
|
);
|
|
188
218
|
});
|
|
189
219
|
}), s("Successful update", async () => {
|
|
190
|
-
const { result:
|
|
191
|
-
|
|
192
|
-
tripId:
|
|
220
|
+
const { result: r } = o(() => n()), t = "682ffebaa6cc24f39d99fdc7";
|
|
221
|
+
r.current.updateTrip({
|
|
222
|
+
tripId: t,
|
|
193
223
|
tripDetails: {
|
|
194
224
|
name: "Updated Trip"
|
|
195
225
|
}
|
|
196
226
|
}), await i(() => {
|
|
197
227
|
e(d.put).toHaveBeenCalledWith(
|
|
198
|
-
`${c.TRIPS}/${
|
|
228
|
+
`${c.TRIPS}/${t}`,
|
|
199
229
|
e.objectContaining({
|
|
200
230
|
name: "Updated Trip"
|
|
201
231
|
})
|
|
@@ -204,52 +234,52 @@ u("useTripManagement", () => {
|
|
|
204
234
|
});
|
|
205
235
|
}), u("Add Booking to Trip", () => {
|
|
206
236
|
s("Invalid tripId arg", async () => {
|
|
207
|
-
const { result:
|
|
208
|
-
|
|
209
|
-
booking:
|
|
237
|
+
const { result: r } = o(() => n());
|
|
238
|
+
r.current.addBookingToTrip({
|
|
239
|
+
booking: r.current.uncategorisedHotelBookings[0]
|
|
210
240
|
}), await i(() => {
|
|
211
|
-
var
|
|
212
|
-
e(
|
|
241
|
+
var t;
|
|
242
|
+
e(r.current.isAddBookingToTripError).toBe(!0), e((t = r.current.addBookingToTripError) == null ? void 0 : t.message).toContain(
|
|
213
243
|
"Trip ID is required"
|
|
214
244
|
);
|
|
215
245
|
});
|
|
216
246
|
}), s("Invalid bookingId arg", async () => {
|
|
217
|
-
const { result:
|
|
218
|
-
|
|
247
|
+
const { result: r } = o(() => n());
|
|
248
|
+
r.current.addBookingToTrip({
|
|
219
249
|
tripId: "12345"
|
|
220
250
|
}), await i(() => {
|
|
221
|
-
var
|
|
222
|
-
e(
|
|
251
|
+
var t;
|
|
252
|
+
e(r.current.isAddBookingToTripError).toBe(!0), e((t = r.current.addBookingToTripError) == null ? void 0 : t.message).toContain(
|
|
223
253
|
"Booking is required"
|
|
224
254
|
);
|
|
225
255
|
});
|
|
226
256
|
}), s("Successfully add hotel booking to trip", async () => {
|
|
227
|
-
const { result:
|
|
228
|
-
|
|
257
|
+
const { result: r } = o(() => n()), t = r.current.uncategorisedHotelBookings[0], a = r.current.upcomingTrips[0];
|
|
258
|
+
r.current.addBookingToTrip({
|
|
229
259
|
tripId: a.id,
|
|
230
|
-
booking:
|
|
260
|
+
booking: t
|
|
231
261
|
}), await i(() => {
|
|
232
262
|
e(d.put).toHaveBeenCalledWith(
|
|
233
263
|
c.ADD_BOOKING,
|
|
234
264
|
e.objectContaining({
|
|
235
265
|
trip_id: a.id,
|
|
236
|
-
booking_id:
|
|
237
|
-
booking_type:
|
|
266
|
+
booking_id: t.id,
|
|
267
|
+
booking_type: g.HOTEL
|
|
238
268
|
})
|
|
239
269
|
);
|
|
240
270
|
});
|
|
241
271
|
}), s("Successfully add flight booking to trip", async () => {
|
|
242
|
-
const { result:
|
|
243
|
-
|
|
272
|
+
const { result: r } = o(() => n()), t = r.current.uncategorisedFlightBookings[0], a = r.current.upcomingTrips[0];
|
|
273
|
+
r.current.addBookingToTrip({
|
|
244
274
|
tripId: a.id,
|
|
245
|
-
booking:
|
|
275
|
+
booking: t
|
|
246
276
|
}), await i(() => {
|
|
247
277
|
e(d.put).toHaveBeenCalledWith(
|
|
248
278
|
c.ADD_BOOKING,
|
|
249
279
|
e.objectContaining({
|
|
250
280
|
trip_id: a.id,
|
|
251
|
-
booking_id:
|
|
252
|
-
booking_type:
|
|
281
|
+
booking_id: t.id,
|
|
282
|
+
booking_type: g.FLIGHT
|
|
253
283
|
})
|
|
254
284
|
);
|
|
255
285
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useQuery as n, useMutation as s } from "@tanstack/react-query";
|
|
2
2
|
import "../../arrayExtensions-DlcBOj5a.js";
|
|
3
|
-
import { E as a, d as u } from "../../noRetryInstance-
|
|
3
|
+
import { E as a, d as u } from "../../noRetryInstance-DKhe8ju0.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import "react/jsx-runtime";
|
|
6
6
|
import "react-i18next";
|
|
@@ -8,7 +8,7 @@ import "../../_styles.flight-booking-CaUgKcMC.js";
|
|
|
8
8
|
/* empty css */
|
|
9
9
|
import "@tanstack/react-query";
|
|
10
10
|
import "../../configs/awayzClient.js";
|
|
11
|
-
import { c as l } from "../../noRetryInstance-
|
|
11
|
+
import { c as l } from "../../noRetryInstance-DKhe8ju0.js";
|
|
12
12
|
/* empty css */
|
|
13
13
|
/* empty css */
|
|
14
14
|
import "../../index-Cv-wvFlM.js";
|
|
@@ -16,7 +16,7 @@ import "../../context/AwayzContext.js";
|
|
|
16
16
|
import { useWallet as t } from "./useWallet.js";
|
|
17
17
|
/* empty css */
|
|
18
18
|
import { renderHook as s, waitFor as i } from "../../tests/TestWrapper.js";
|
|
19
|
-
import { d as m, v as c, b as p, t as n, g as o } from "../../vi.
|
|
19
|
+
import { d as m, v as c, b as p, t as n, g as o } from "../../vi.2VT5v0um-lKoi8TEt.js";
|
|
20
20
|
const _ = !0, v = [{ _id: "AAAviatorBis", name: "AAdvantage Aviator Business", signupBonus: 7e4, cashBonus: 0, minimumSpend: 2e3, daysToSpend: 90, annual_fee: 95, annualFeeWaived: !1, cashPerks: 0, bank: { name: "Barclays" }, rewards_currency: "American Airlines Miles", bisCard: !0, chargeCard: !1, cardFamily: 0, websiteUrl: "https://frequentmiler.com/AviatorBiz/#Goto", network: { name: "Mastercard" }, _modified: "2022-08-30T00:24:55.568Z", colour: "#1A3251", region: "US", faredrop_card_id: "", alternateRegions: [], logoUrl: "https://s3.us-east-1.amazonaws.com/awayz/card_logos/barclays-white.svg" }, { _id: "AARed", name: "AAdvantage Aviator Red", signupBonus: 6e4, cashBonus: 0, minimumSpend: 0, daysToSpend: 30, annual_fee: 99, annualFeeWaived: !0, cashPerks: 0, bank: { name: "Barclays" }, rewards_currency: "American Airlines Miles", bisCard: !1, chargeCard: !1, cardFamily: 1, websiteUrl: "https://frequentmiler.com/AviatorRed/#Goto", network: { name: "Mastercard" }, colour: "#1A3251", region: "US", faredrop_card_id: "", alternateRegions: [], logoUrl: "https://s3.us-east-1.amazonaws.com/awayz/card_logos/barclays-white.svg" }, { _id: "AASilver", name: "AAdvantage Aviator Silver", signupBonus: 0, cashBonus: 0, minimumSpend: 0, daysToSpend: 0, annual_fee: 195, annualFeeWaived: !1, cashPerks: 75, bank: { name: "Barclays" }, rewards_currency: "American Airlines Miles", bisCard: !1, chargeCard: !1, cardFamily: 1, websiteUrl: "https://frequentmiler.boardingarea.com/AviatorSilver/#Goto", network: { name: "Mastercard" }, _modified: "2022-08-30T00:27:10.347Z", updatedAt: "2022-10-26T06:55:01.187Z", colour: "#C8C8C8", region: "US", faredrop_card_id: "", alternateRegions: [], logoUrl: "https://s3.us-east-1.amazonaws.com/awayz/card_logos/barclays-black.svg" }, { _id: "AFKLMcard", name: "Air France KLM Card", signupBonus: 7e4, cashBonus: 0, minimumSpend: 2e3, daysToSpend: 90, annual_fee: 89, annualFeeWaived: !1, cashPerks: 150, bank: { name: "BofA" }, rewards_currency: "Flying Blue Miles", bisCard: !1, chargeCard: !1, cardFamily: 6, websiteUrl: "https://frequentmiler.com/AFKLM/#Goto", network: { name: "Mastercard" }, _modified: "2022-08-30T00:41:10.038Z", colour: "#1A3251", region: "US", faredrop_card_id: "", alternateRegions: [], logoUrl: "https://s3.us-east-1.amazonaws.com/awayz/card_logos/bofa-white.svg" }, { _id: "ASBis", name: "Alaska Airlines Visa Business", signupBonus: 7e4, cashBonus: 0, minimumSpend: 4e3, daysToSpend: 90, annual_fee: 75, annualFeeWaived: !1, cashPerks: 0, bank: { name: "BofA" }, rewards_currency: "Alaska MileagePlan", bisCard: !0, chargeCard: !1, cardFamily: 10, websiteUrl: "https://frequentmiler.com/ASbiz/#Goto", network: { name: "Visa" }, _modified: "2022-08-30T00:41:42.408Z", colour: "#1A3251", region: "US", faredrop_card_id: "", alternateRegions: [], logoUrl: "https://s3.us-east-1.amazonaws.com/awayz/card_logos/bofa-white.svg" }, { _id: "AltReserve", name: "Altitude Reserve", signupBonus: 5e4, cashBonus: 0, minimumSpend: 4500, daysToSpend: 90, annual_fee: 400, annualFeeWaived: !1, cashPerks: 0, bank: { name: "US Bank" }, rewards_currency: "Altitude Reserve Points", bisCard: !1, chargeCard: !1, cardFamily: 28, websiteUrl: "https://frequentmiler.com/USBAR/#Goto", network: { name: "Visa" }, colour: "#3767A2", region: "US", faredrop_card_id: "", points_as_cash_conversion_ratio: 0.015, updatedAt: "2024-10-18T14:47:25.187Z", alternateRegions: [], logoUrl: "https://s3.us-east-1.amazonaws.com/awayz/card_logos/us-bank-white.svg" }], y = {
|
|
21
21
|
success: _,
|
|
22
22
|
data: v
|
|
@@ -14,11 +14,11 @@ export interface IFlightBookingProps {
|
|
|
14
14
|
name: string;
|
|
15
15
|
}[];
|
|
16
16
|
/**
|
|
17
|
-
* The location and time of the flight's departure
|
|
17
|
+
* The location and time of the outbound flight's departure
|
|
18
18
|
*/
|
|
19
19
|
departure: IFlightBookingLocation;
|
|
20
20
|
/**
|
|
21
|
-
* The location and time of the flight's arrival
|
|
21
|
+
* The location and time of the outbound flight's arrival
|
|
22
22
|
*/
|
|
23
23
|
arrival: IFlightBookingLocation;
|
|
24
24
|
/**
|
|
@@ -42,6 +42,18 @@ export interface IFlightBookingProps {
|
|
|
42
42
|
*/
|
|
43
43
|
hasAirlineChanges: boolean;
|
|
44
44
|
onClick?: () => void;
|
|
45
|
+
/**
|
|
46
|
+
* The location and time of the inbound (return) flight's departure.
|
|
47
|
+
* When provided, a second leg row is rendered on the card.
|
|
48
|
+
*/
|
|
49
|
+
inboundDeparture?: IFlightBookingLocation;
|
|
50
|
+
/**
|
|
51
|
+
* The location and time of the inbound (return) flight's arrival
|
|
52
|
+
* This is a change from before, where it was flightBooking.slices.getLast().destination
|
|
53
|
+
* We now explicitly arrival/departure for one-way and outbound.
|
|
54
|
+
* For round-trip, we have inboundDeparture/Arrival as optional props
|
|
55
|
+
*/
|
|
56
|
+
inboundArrival?: IFlightBookingLocation;
|
|
45
57
|
/**
|
|
46
58
|
* Context options to show in the menu
|
|
47
59
|
* Generally used for actions like "Cancel Booking", "Add to trip", etc.
|
|
@@ -55,5 +67,5 @@ export interface IFlightBookingProps {
|
|
|
55
67
|
* flight class, number of passengers, and cancellation status.
|
|
56
68
|
* It also provides a menu for additional actions if context options are provided.
|
|
57
69
|
*/
|
|
58
|
-
export declare const FlightBooking: ({ airlines, departure, arrival, bookingRef, flightClass, numberOfPassengers, cancelledAt, hasAirlineChanges, onClick, contextOptions }: IFlightBookingProps) => import("react/jsx-runtime").JSX.Element;
|
|
70
|
+
export declare const FlightBooking: ({ airlines, departure, arrival, bookingRef, flightClass, numberOfPassengers, cancelledAt, hasAirlineChanges, onClick, inboundDeparture, inboundArrival, contextOptions }: IFlightBookingProps) => import("react/jsx-runtime").JSX.Element;
|
|
59
71
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
type CamelCase<S extends string> = S extends `${infer P1}_${infer P2}${infer P3}` ? `${Lowercase<P1>}${Uppercase<P2>}${CamelCase<P3>}` : Lowercase<S>;
|
|
2
2
|
declare const StringFeatureFlag: readonly ["DEFAULT_CURRENCY_FEATURE", "TOTAL_DISPLAY_FEATURE", "HOTEL_DETAILS_LAYOUT_FEATURE", "TRIP_MANAGEMENT_FEATURE", "FLIGHT_FILTER_LAYOUT_FEATURE", "WALLET_MANAGEMENT_FEATURE", "WALLET_PROGRAM_TYPES_FEATURES", "FLIGHT_PAGINATION_FEATURE", "AVAILABILITY_ALERTS_DISPLAY_FEATURE", "PAYMENT_TYPE_FEATURE", "HOTEL_DETAILS_FEATURES", "SEARCH_RADIUS_POSITION_FEATURE", "NAVIGATION_FEATURE", "BOOKING_PAYMENT_METHOD_FEATURE", "AMOUNTS_DISPLAY_FEATURE", "FLIGHT_BOOKING_OPTIONS_DISPLAY_FEATURE"];
|
|
3
|
-
declare const BooleanFeatureFlag: readonly ["CURRENCY_FILTER_FEATURE", "FREE_HOTEL_NIGHTS_FEATURE", "SHOW_BOOKABLE_FEATURE", "FILTER_PRESETS_FEATURE", "SPLIT_HOTEL_CHAINS_FEATURE", "FLIGHT_SHOW_ANIMATION_FEATURE", "SHOW_FOOTER_FEATURE", "SHOW_AVAILABILITY_ALERTS_FEATURE", "USE_POINTS_AS_CASH_FEATURE", "HAS_HEADER_FEATURE", "SHOW_FLIGHTS_TRANSFER_PARTNER_FEATURE", "HOTEL_POINTS_ONLY_FEATURE", "FREE_HOTEL_NIGHTS_FEATURE", "HOTEL_DISPLAY_BEST_VALUE_FEATURE", "HOTEL_DISPLAY_POINTS_BREAKDOWN_FEATURE", "TAB_NAVIGATION_FEATURE", "ADD_AIRLINE_HEALTH_PAGE_FEATURE", "SHOW_NAVIGATION_POPUP_FEATURE", "SHOW_ONLY_BOOKABLE_FEATURE", "CASH_BOOKING_FEATURE", "DISABLE_FREE_USER_CASH_BOOKING_FEATURE", "ENABLE_EASY_SUPPORT_BOT_FEATURE", "SHOW_ONLY_BOOKABLE_FEATURE"];
|
|
3
|
+
declare const BooleanFeatureFlag: readonly ["CURRENCY_FILTER_FEATURE", "FREE_HOTEL_NIGHTS_FEATURE", "SHOW_BOOKABLE_FEATURE", "FILTER_PRESETS_FEATURE", "SPLIT_HOTEL_CHAINS_FEATURE", "FLIGHT_SHOW_ANIMATION_FEATURE", "SHOW_FOOTER_FEATURE", "SHOW_AVAILABILITY_ALERTS_FEATURE", "USE_POINTS_AS_CASH_FEATURE", "HAS_HEADER_FEATURE", "SHOW_FLIGHTS_TRANSFER_PARTNER_FEATURE", "HOTEL_POINTS_ONLY_FEATURE", "FREE_HOTEL_NIGHTS_FEATURE", "HOTEL_DISPLAY_BEST_VALUE_FEATURE", "HOTEL_DISPLAY_POINTS_BREAKDOWN_FEATURE", "TAB_NAVIGATION_FEATURE", "ADD_AIRLINE_HEALTH_PAGE_FEATURE", "SHOW_NAVIGATION_POPUP_FEATURE", "SHOW_ONLY_BOOKABLE_FEATURE", "CASH_BOOKING_FEATURE", "DISABLE_FREE_USER_CASH_BOOKING_FEATURE", "ENABLE_EASY_SUPPORT_BOT_FEATURE", "SHOW_ONLY_BOOKABLE_FEATURE", "HIDE_FLIGHT_SEARCH_CONTAINER_FEATURE", "HIDE_HOTEL_SEARCH_CONTAINER_FEATURE"];
|
|
4
4
|
declare const ListFeatureFlag: readonly ["WALLET_PROGRAM_TYPES_FEATURES", "HOTEL_FILTERS_FEATURES", "FLIGHT_FILTERS_FEATURES", "WALLET_FEATURES"];
|
|
5
5
|
export declare enum EBookingPaymentMethod {
|
|
6
6
|
DEFAULT = "default",
|
|
@@ -114,6 +114,94 @@ declare const _default: {
|
|
|
114
114
|
"createdAt": "2025-05-30T14:20:36.839Z",
|
|
115
115
|
"updatedAt": "2025-05-30T14:21:11.541Z",
|
|
116
116
|
"__v": 0
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"_id": "6839beb48672ca8a09862484",
|
|
120
|
+
"flight_offer_id": "off_0000AucdLMS6m6Um63c7m9",
|
|
121
|
+
"user_id": "67d82b1c52c4a4dbe4e640c0",
|
|
122
|
+
"status": "flight confirmed",
|
|
123
|
+
"available_actions": ["cancel", "change", "update"],
|
|
124
|
+
"total_currency": "USD",
|
|
125
|
+
"arrival_date": "2025-07-10T21:35:00.000Z",
|
|
126
|
+
"base_amount": "210.72",
|
|
127
|
+
"extras_amount": "0.00",
|
|
128
|
+
"extras_currency": "USD",
|
|
129
|
+
"base_currency": "USD",
|
|
130
|
+
"conditions": {
|
|
131
|
+
"refund_before_departure": {
|
|
132
|
+
"penalty_currency": "USD",
|
|
133
|
+
"penalty_amount": "25.00",
|
|
134
|
+
"allowed": true
|
|
135
|
+
},
|
|
136
|
+
"change_before_departure": {
|
|
137
|
+
"penalty_currency": null,
|
|
138
|
+
"penalty_amount": null,
|
|
139
|
+
"allowed": false
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
"departure_date": "2025-07-06T17:01:00.000Z",
|
|
143
|
+
"passengers": [{ "id": "pas_0000AucdLMBnkjS3HTz6N1", "type": null }],
|
|
144
|
+
"slices": [
|
|
145
|
+
{
|
|
146
|
+
"id": "sli_0000AucdLMS6m6Um63c7m8",
|
|
147
|
+
"origin": "LAX",
|
|
148
|
+
"destination": "HRL",
|
|
149
|
+
"fare_brand_name": "Basic Economy",
|
|
150
|
+
"carriers": {
|
|
151
|
+
"marketing": ["American Airlines"],
|
|
152
|
+
"operating": ["American Airlines"],
|
|
153
|
+
"operating_iata_codes": ["AA"]
|
|
154
|
+
},
|
|
155
|
+
"segments": [
|
|
156
|
+
{
|
|
157
|
+
"departing_at": "2025-07-06T17:01:00.000Z",
|
|
158
|
+
"arriving_at": "2025-07-06T22:29:00.000Z"
|
|
159
|
+
}
|
|
160
|
+
]
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"id": "sli_0000AucdLMS6m6Um63c7m9",
|
|
164
|
+
"origin": "HRL",
|
|
165
|
+
"destination": "LAX",
|
|
166
|
+
"fare_brand_name": "Basic Economy",
|
|
167
|
+
"carriers": {
|
|
168
|
+
"marketing": ["American Airlines"],
|
|
169
|
+
"operating": ["American Airlines"],
|
|
170
|
+
"operating_iata_codes": ["AA"]
|
|
171
|
+
},
|
|
172
|
+
"segments": [
|
|
173
|
+
{
|
|
174
|
+
"departing_at": "2025-07-10T20:07:00.000Z",
|
|
175
|
+
"arriving_at": "2025-07-10T21:35:00.000Z"
|
|
176
|
+
}
|
|
177
|
+
]
|
|
178
|
+
}
|
|
179
|
+
],
|
|
180
|
+
"tax_amount": "37.92",
|
|
181
|
+
"tax_currency": "USD",
|
|
182
|
+
"total_amount": "248.64",
|
|
183
|
+
"type": "instant",
|
|
184
|
+
"synced_at": "2025-05-30T14:21:11Z",
|
|
185
|
+
"order_id": "ord_0000AucdQ6tTnRRInXiCLh",
|
|
186
|
+
"booking_reference": "T4DNFX",
|
|
187
|
+
"cancelled_at": null,
|
|
188
|
+
"payment_status": {
|
|
189
|
+
"paid_at": "2025-05-30T14:21:11Z",
|
|
190
|
+
"price_guarantee_expires_at": null,
|
|
191
|
+
"payment_required_by": null,
|
|
192
|
+
"awaiting_payment": false
|
|
193
|
+
},
|
|
194
|
+
"documents": [
|
|
195
|
+
{
|
|
196
|
+
"passenger_ids": ["pas_0000AucdLMBnkjS3HTz6N1"],
|
|
197
|
+
"unique_identifier": "1",
|
|
198
|
+
"type": "electronic_ticket"
|
|
199
|
+
}
|
|
200
|
+
],
|
|
201
|
+
"services": [],
|
|
202
|
+
"createdAt": "2025-05-30T14:20:36.839Z",
|
|
203
|
+
"updatedAt": "2025-05-30T14:21:11.541Z",
|
|
204
|
+
"__v": 0
|
|
117
205
|
}
|
|
118
206
|
]
|
|
119
207
|
}
|
|
@@ -52,6 +52,17 @@ export interface IFlightBooking extends IBooking {
|
|
|
52
52
|
hasAirlineChanges: boolean;
|
|
53
53
|
orderId: string;
|
|
54
54
|
type: string;
|
|
55
|
+
isRoundTrip?: boolean;
|
|
56
|
+
outboundArrivalDate?: string;
|
|
57
|
+
inboundDepartureDate?: string;
|
|
58
|
+
inboundDeparture?: {
|
|
59
|
+
airportCode: string;
|
|
60
|
+
location: string;
|
|
61
|
+
};
|
|
62
|
+
inboundArrival?: {
|
|
63
|
+
airportCode: string;
|
|
64
|
+
location: string;
|
|
65
|
+
};
|
|
55
66
|
}
|
|
56
67
|
export interface IUncategorizedBookings {
|
|
57
68
|
flightBookings: IFlightBooking[];
|