@roomstay/frontend 2.6.61-0 → 2.6.62
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/537.bundle.js +1 -1
- package/dist/663.bundle.js +1 -0
- package/dist/950.bundle.js +1 -0
- package/dist/978.bundle.js +1 -1
- package/dist/main.bundle.js +1 -1
- package/dist/src/api/ReservationAPI.d.ts +3 -18
- package/dist/src/api/ReservationAPI.js +31 -61
- package/dist/src/api/ReservationAPI.js.map +1 -1
- package/dist/src/components/User/Forms/ForgotPasswordForm.d.ts +1 -0
- package/dist/src/components/User/Forms/ForgotPasswordForm.js +6 -2
- package/dist/src/components/User/Forms/ForgotPasswordForm.js.map +1 -1
- package/dist/src/components/User/Forms/SignInForm.d.ts +1 -0
- package/dist/src/components/User/Forms/SignInForm.js +10 -4
- package/dist/src/components/User/Forms/SignInForm.js.map +1 -1
- package/dist/src/components/User/Forms/SignUpForm.js +59 -79
- package/dist/src/components/User/Forms/SignUpForm.js.map +1 -1
- package/dist/src/components/User/Forms/VerifyEmailForm.d.ts +7 -0
- package/dist/src/components/User/Forms/VerifyEmailForm.js +92 -0
- package/dist/src/components/User/Forms/VerifyEmailForm.js.map +1 -0
- package/dist/src/components/generic/BookingWizard/BookingWizard.d.ts +0 -1
- package/dist/src/components/generic/BookingWizard/BookingWizard.js +1 -7
- package/dist/src/components/generic/BookingWizard/BookingWizard.js.map +1 -1
- package/dist/src/components/generic/date/FloatingDatePicker.d.ts +5 -0
- package/dist/src/components/generic/date/FloatingDatePicker.js +1 -1
- package/dist/src/components/generic/date/FloatingDatePicker.js.map +1 -1
- package/dist/src/components/generic/modal/SigninModal/FormContent/ForgotPasswordFormContent.d.ts +1 -0
- package/dist/src/components/generic/modal/SigninModal/FormContent/ForgotPasswordFormContent.js +2 -2
- package/dist/src/components/generic/modal/SigninModal/FormContent/ForgotPasswordFormContent.js.map +1 -1
- package/dist/src/components/generic/modal/SigninModal/FormContent/SignInFormContent.d.ts +1 -0
- package/dist/src/components/generic/modal/SigninModal/FormContent/SignInFormContent.js +2 -2
- package/dist/src/components/generic/modal/SigninModal/FormContent/SignInFormContent.js.map +1 -1
- package/dist/src/components/generic/modal/SigninModal/UnauthenticatedUserModal.js +12 -4
- package/dist/src/components/generic/modal/SigninModal/UnauthenticatedUserModal.js.map +1 -1
- package/dist/src/components/members/SignInModal/ExternalMemberModal.js +4 -4
- package/dist/src/components/members/SignInModal/ExternalMemberModal.js.map +1 -1
- package/dist/src/components/reservation/ReservationItem.js +1 -1
- package/dist/src/components/reservation/ReservationItem.js.map +1 -1
- package/dist/src/components/steps/addons/AddonCard.js +14 -14
- package/dist/src/components/steps/addons/AddonCard.js.map +1 -1
- package/dist/src/components/steps/confirmation/RoomContactDetails.js +15 -14
- package/dist/src/components/steps/confirmation/RoomContactDetails.js.map +1 -1
- package/dist/src/components/steps/confirmation/StepConfirmationAcknowledgement.js +10 -11
- package/dist/src/components/steps/confirmation/StepConfirmationAcknowledgement.js.map +1 -1
- package/dist/src/components/steps/confirmation/StepConfirmationForm.js +4 -11
- package/dist/src/components/steps/confirmation/StepConfirmationForm.js.map +1 -1
- package/dist/src/components/steps/room/AvailableUpgradesModal.js +1 -1
- package/dist/src/components/steps/room/AvailableUpgradesModal.js.map +1 -1
- package/dist/src/components/steps/room/roomDetails/roomRates/PriceBreakdownBlock.js +2 -2
- package/dist/src/components/steps/room/roomDetails/roomRates/PriceBreakdownBlock.js.map +1 -1
- package/dist/src/components/summary/BESummaryAddonRow.js +1 -1
- package/dist/src/components/summary/BESummaryAddonRow.js.map +1 -1
- package/dist/src/components/summary/BESummaryRoomRow.js +2 -2
- package/dist/src/components/summary/BESummaryRoomRow.js.map +1 -1
- package/dist/src/components/summary/TransportDistanceFromHotelBlock.js +7 -6
- package/dist/src/components/summary/TransportDistanceFromHotelBlock.js.map +1 -1
- package/dist/src/contexts/BasketContext/BasketContextType.d.ts +5 -2
- package/dist/src/contexts/BasketContext/BasketContextType.js.map +1 -1
- package/dist/src/contexts/BasketContext/BasketContextWrapper.js +32 -109
- package/dist/src/contexts/BasketContext/BasketContextWrapper.js.map +1 -1
- package/dist/src/contexts/CompanyContext/CompanyContextWrapper.js +0 -1
- package/dist/src/contexts/CompanyContext/CompanyContextWrapper.js.map +1 -1
- package/dist/src/contexts/ConfirmationStepContext/ConfirmationStepContextWrapper.js +20 -20
- package/dist/src/contexts/ConfirmationStepContext/ConfirmationStepContextWrapper.js.map +1 -1
- package/dist/src/contexts/FullPageEngineContext/FullPageEngineContextWrapper.js +1 -10
- package/dist/src/contexts/FullPageEngineContext/FullPageEngineContextWrapper.js.map +1 -1
- package/dist/src/contexts/Members/AuthenticationContext/AuthenticationContext.d.ts +7 -1
- package/dist/src/contexts/Members/AuthenticationContext/AuthenticationContext.js.map +1 -1
- package/dist/src/contexts/Members/AuthenticationContext/AuthenticationContextProvider.js +32 -6
- package/dist/src/contexts/Members/AuthenticationContext/AuthenticationContextProvider.js.map +1 -1
- package/dist/src/contexts/Members/RoomstayMemberContext/RoomstayMemberContextProvider.js.map +1 -1
- package/dist/src/engines/BookingWizardEngine/BookingWizardEngine.d.ts +0 -1
- package/dist/src/engines/BookingWizardEngine/BookingWizardEngine.js.map +1 -1
- package/dist/src/engines/BookingWizardEngine/BookingWizardEngineElement.js +0 -1
- package/dist/src/engines/BookingWizardEngine/BookingWizardEngineElement.js.map +1 -1
- package/dist/src/engines/InlineRoomMiniEngine/InlineRoomMiniEngineElement.js +6 -6
- package/dist/src/engines/InlineRoomMiniEngine/InlineRoomMiniEngineElement.js.map +1 -1
- package/dist/src/events/index.d.ts +1 -0
- package/dist/src/events/index.js +1 -0
- package/dist/src/events/index.js.map +1 -1
- package/dist/src/events/views/CommittedBookingEvent.d.ts +3 -1
- package/dist/src/events/views/CommittedBookingEvent.js +2 -1
- package/dist/src/events/views/CommittedBookingEvent.js.map +1 -1
- package/dist/src/hooks/RoomRateAvailabilityListFromApi.js +0 -1
- package/dist/src/hooks/RoomRateAvailabilityListFromApi.js.map +1 -1
- package/dist/src/hooks/useSignedInMember.d.ts +1 -1
- package/dist/src/index.d.ts +0 -1
- package/dist/src/index.js +2 -4
- package/dist/src/index.js.map +1 -1
- package/dist/src/models/Addon/Addon.d.ts +64 -6
- package/dist/src/models/Addon/Addon.js +28 -14
- package/dist/src/models/Addon/Addon.js.map +1 -1
- package/dist/src/models/Api/HotelDTO.d.ts +0 -1
- package/dist/src/models/Api/HotelDTO.js.map +1 -1
- package/dist/src/models/Api/HotelOverrideDTO.d.ts +2 -0
- package/dist/src/models/Api/HotelOverrideDTO.js.map +1 -1
- package/dist/src/models/BasketAddonRow.js +2 -3
- package/dist/src/models/BasketAddonRow.js.map +1 -1
- package/dist/src/models/BasketRow.d.ts +1 -3
- package/dist/src/models/BasketRow.js +2 -32
- package/dist/src/models/BasketRow.js.map +1 -1
- package/dist/src/models/Client/Hotel/Hotel.d.ts +2 -4
- package/dist/src/models/Client/Hotel/Hotel.js.map +1 -1
- package/dist/src/models/RoomstaySession.d.ts +0 -2
- package/dist/src/models/RoomstaySession.js.map +1 -1
- package/dist/src/models/SearchParameters.d.ts +1 -1
- package/dist/src/models/SearchParameters.js.map +1 -1
- package/dist/src/models/UserProfile.d.ts +20 -20
- package/dist/src/models/UserProfile.js.map +1 -1
- package/dist/src/pages/account/Reservations/AccountReservationSinglePage.js +2 -2
- package/dist/src/pages/account/Reservations/AccountReservationSinglePage.js.map +1 -1
- package/dist/src/providers/FeatureProvider.js +0 -2
- package/dist/src/providers/FeatureProvider.js.map +1 -1
- package/dist/src/providers/feature/DerbysoftClickTrackingFeature.js +2 -2
- package/dist/src/providers/feature/DerbysoftClickTrackingFeature.js.map +1 -1
- package/dist/src/providers/feature/Feature.d.ts +0 -2
- package/dist/src/providers/feature/Feature.js +0 -4
- package/dist/src/providers/feature/Feature.js.map +1 -1
- package/dist/src/providers/storage/SessionProvider.js +0 -2
- package/dist/src/providers/storage/SessionProvider.js.map +1 -1
- package/dist/src/translations/Translation.d.ts +1 -4
- package/dist/src/translations/Translation.js +1 -4
- package/dist/src/translations/Translation.js.map +1 -1
- package/dist/src/translations/languages/en-gb.js +1 -4
- package/dist/src/translations/languages/en-gb.js.map +1 -1
- package/dist/src/util/Analytics/GoogleAnalytics4.d.ts +1 -1
- package/dist/src/util/Analytics/UniversalAnalytics.d.ts +1 -1
- package/dist/src/util/EventsHelper.js +1 -1
- package/dist/src/util/EventsHelper.js.map +1 -1
- package/dist/src/util/TotalCalculator.js +2 -2
- package/dist/src/util/TotalCalculator.js.map +1 -1
- package/dist/test.bundle.js +1 -1
- package/dist/tests/offline/entry/config/hotelSpecDefault.js +1 -0
- package/dist/tests/offline/entry/config/hotelSpecDefault.js.map +1 -1
- package/dist/vendors.bundle.js +1 -1
- package/package.json +2 -2
- package/dist/263.bundle.js +0 -1
- package/dist/458.bundle.js +0 -1
- package/dist/src/components/steps/confirmation/StepConfirmationImportantInformation.d.ts +0 -7
- package/dist/src/components/steps/confirmation/StepConfirmationImportantInformation.js +0 -54
- package/dist/src/components/steps/confirmation/StepConfirmationImportantInformation.js.map +0 -1
- package/dist/src/providers/feature/ConfirmationImportantInformationFeature.d.ts +0 -10
- package/dist/src/providers/feature/ConfirmationImportantInformationFeature.js +0 -13
- package/dist/src/providers/feature/ConfirmationImportantInformationFeature.js.map +0 -1
|
@@ -58,6 +58,7 @@ const Text_1 = __importDefault(require("../../components/generic/Text"));
|
|
|
58
58
|
const MemberSignInModal_1 = require("../../components/members/SignInModal/MemberSignInModal");
|
|
59
59
|
const PromoCodeVerificationAlert_1 = require("../../components/steps/room/UserSearchSummary/PromoCodeVerificationAlert");
|
|
60
60
|
const useSignedInMember_1 = require("../../hooks/useSignedInMember");
|
|
61
|
+
const Addon_1 = require("../../models/Addon/Addon");
|
|
61
62
|
const BasketAddonRow_1 = __importDefault(require("../../models/BasketAddonRow"));
|
|
62
63
|
const BasketRow_1 = __importDefault(require("../../models/BasketRow"));
|
|
63
64
|
const Fee_1 = require("../../models/Fee");
|
|
@@ -71,7 +72,7 @@ const GetStepRoom_1 = __importDefault(require("../../util/GetStepRoom"));
|
|
|
71
72
|
const StepManager_1 = __importDefault(require("../../util/StepManager"));
|
|
72
73
|
const StringHelper_1 = __importDefault(require("../../util/StringHelper"));
|
|
73
74
|
function BasketContextWrapper(props) {
|
|
74
|
-
var _a, _b, _c
|
|
75
|
+
var _a, _b, _c;
|
|
75
76
|
const { t } = (0, react_i18next_1.useTranslation)();
|
|
76
77
|
const { hotel } = (0, hooks_1.useCurrentHotel)();
|
|
77
78
|
const updateQueryParams = (0, UpdateQueryParameters_1.useUpdateQueryParameters)();
|
|
@@ -83,7 +84,6 @@ function BasketContextWrapper(props) {
|
|
|
83
84
|
const { showPromoCodeAlert } = (0, react_1.useContext)(contexts_1.HotelOverridesContext);
|
|
84
85
|
const initialSession = (_a = beContext === null || beContext === void 0 ? void 0 : beContext.engine) === null || _a === void 0 ? void 0 : _a.getInitialSession();
|
|
85
86
|
const [currentBasketRows, basketRowReducer] = (0, react_1.useReducer)(BasketReducer_1.BasketReducer, (_b = initialSession === null || initialSession === void 0 ? void 0 : initialSession.basketRows) !== null && _b !== void 0 ? _b : []);
|
|
86
|
-
const [pencilId, setPencilId] = (0, react_1.useState)((_c = initialSession === null || initialSession === void 0 ? void 0 : initialSession.pencilId) !== null && _c !== void 0 ? _c : undefined);
|
|
87
87
|
const [selectedBasketRow, setSelectedBasketRow] = (0, react_1.useState)(null);
|
|
88
88
|
const [basketAddonRows, setBasketAddonRows] = (0, react_1.useState)([]);
|
|
89
89
|
// This is where we store the fees that aren't included in the rates/addons.
|
|
@@ -91,7 +91,7 @@ function BasketContextWrapper(props) {
|
|
|
91
91
|
const [isLoadingPriceQuote, setIsLoadingPriceQuote] = (0, react_1.useState)(false);
|
|
92
92
|
let loadedStartDate = null;
|
|
93
93
|
let loadedEndDate = null;
|
|
94
|
-
if ((
|
|
94
|
+
if ((_c = initialSession === null || initialSession === void 0 ? void 0 : initialSession.basketRows) === null || _c === void 0 ? void 0 : _c.length) {
|
|
95
95
|
loadedStartDate = initialSession.basketRows[0].getStartDate();
|
|
96
96
|
loadedEndDate = initialSession.basketRows[0].getEndDate();
|
|
97
97
|
}
|
|
@@ -244,8 +244,6 @@ function BasketContextWrapper(props) {
|
|
|
244
244
|
queryParameters[AppQueryParameters_1.EAppQueryParameters.Children] = row.getChildren().toString();
|
|
245
245
|
if (row.getAdults() !== undefined)
|
|
246
246
|
queryParameters[AppQueryParameters_1.EAppQueryParameters.Adults] = row.getAdults().toString();
|
|
247
|
-
if (row.getRoomCode() !== '')
|
|
248
|
-
queryParameters[AppQueryParameters_1.EAppQueryParameters.Room] = row.getRoomCode();
|
|
249
247
|
updateQueryParams(queryParameters);
|
|
250
248
|
};
|
|
251
249
|
const updateBasketRow = (row, updateGlobalDates = true) => {
|
|
@@ -282,16 +280,6 @@ function BasketContextWrapper(props) {
|
|
|
282
280
|
return (0, rxjs_1.timer)(scalingDuration);
|
|
283
281
|
}), (0, operators_1.finalize)(() => console.log('We are done!')));
|
|
284
282
|
};
|
|
285
|
-
const getTotalQuoteDepositFees = () => {
|
|
286
|
-
//Retrieves the total quote deposit's fees
|
|
287
|
-
const totalQuoteFees = returnAggregationAndTranslation((row) => { var _a; return (row.quoteDetails ? (_a = row.quoteDetails) === null || _a === void 0 ? void 0 : _a.totalFees : 0); });
|
|
288
|
-
return totalQuoteFees;
|
|
289
|
-
};
|
|
290
|
-
const getTotalQuoteFullPaymentFees = () => {
|
|
291
|
-
//Retrieves the total quote full payment's fees
|
|
292
|
-
const totalQuoteFullPaymentFees = returnAggregationAndTranslation((row) => row.quoteDetails ? row.quoteDetails.fullPaymentAmount - row.quoteDetails.totalRate : 0);
|
|
293
|
-
return totalQuoteFullPaymentFees;
|
|
294
|
-
};
|
|
295
283
|
const updateBasketFeeRows = () => {
|
|
296
284
|
var _a, _b;
|
|
297
285
|
const validBasketRows = currentBasketRows === null || currentBasketRows === void 0 ? void 0 : currentBasketRows.filter((row) => row.isValid());
|
|
@@ -432,7 +420,6 @@ function BasketContextWrapper(props) {
|
|
|
432
420
|
reservationData: reservationData,
|
|
433
421
|
isLoadingPriceQuote,
|
|
434
422
|
loadedPromotion,
|
|
435
|
-
pencilId,
|
|
436
423
|
/**
|
|
437
424
|
* Adds a new basket row and applies relevant updates:
|
|
438
425
|
* - Synchronizes the selected date range.
|
|
@@ -558,17 +545,9 @@ function BasketContextWrapper(props) {
|
|
|
558
545
|
}
|
|
559
546
|
}
|
|
560
547
|
}),
|
|
561
|
-
|
|
562
|
-
const maxRetryAttempts =
|
|
563
|
-
|
|
564
|
-
// To avoid multiple requests, pencil reservation step also generates a quote (if applicable)
|
|
565
|
-
if ((hotel === null || hotel === void 0 ? void 0 : hotel.bookingFlow) === core_1.EBookingFlow.PreCheckoutPencil) {
|
|
566
|
-
callApi = BookingAPI_1.default.Reservation.pencilReservation;
|
|
567
|
-
}
|
|
568
|
-
else if (hotel === null || hotel === void 0 ? void 0 : hotel.requireDeposit) {
|
|
569
|
-
callApi = BookingAPI_1.default.Reservation.getPriceQuote;
|
|
570
|
-
}
|
|
571
|
-
else {
|
|
548
|
+
getBasketQuoteDetails: (preventApplyingOutcome) => {
|
|
549
|
+
const maxRetryAttempts = 5;
|
|
550
|
+
if (!hotel || !(hotel === null || hotel === void 0 ? void 0 : hotel.requireDeposit)) {
|
|
572
551
|
return false;
|
|
573
552
|
}
|
|
574
553
|
setIsLoadingPriceQuote(true);
|
|
@@ -580,43 +559,26 @@ function BasketContextWrapper(props) {
|
|
|
580
559
|
updateBasketRow(row);
|
|
581
560
|
}
|
|
582
561
|
});
|
|
583
|
-
const
|
|
562
|
+
const getData = () => (0, rxjs_1.defer)(() => BookingAPI_1.default.Reservation.getPriceQuote(hotel.hotelID, currentBasketRows, isExternalMemberHotel ? memberNumber : undefined)).pipe((0, operators_1.retryWhen)(genericRetryStrategy({
|
|
584
563
|
maxRetryAttempts: maxRetryAttempts,
|
|
585
564
|
})));
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
let quoteResponse;
|
|
590
|
-
if ((hotel === null || hotel === void 0 ? void 0 : hotel.bookingFlow) === core_1.EBookingFlow.PreCheckoutPencil) {
|
|
591
|
-
// Pencil call also passes back the quote (if applicable)
|
|
592
|
-
pencilResponse = response;
|
|
593
|
-
quoteResponse = pencilResponse.quote;
|
|
594
|
-
// Store parent pencil ID to pass back to the server later
|
|
595
|
-
setPencilId(pencilResponse.pencilId);
|
|
596
|
-
(_a = beContext.sessionProvider) === null || _a === void 0 ? void 0 : _a.updateSession({ pencilId: pencilResponse.pencilId });
|
|
597
|
-
// Future improvement: Handle availability errors
|
|
598
|
-
}
|
|
599
|
-
else {
|
|
600
|
-
quoteResponse = response;
|
|
601
|
-
}
|
|
602
|
-
if (!quoteResponse) {
|
|
565
|
+
const retryableObservable = getData();
|
|
566
|
+
retryableObservable.subscribe((quote) => {
|
|
567
|
+
if (quote === null)
|
|
603
568
|
return;
|
|
604
|
-
|
|
605
|
-
if (!applyQuote()) {
|
|
569
|
+
if (!preventApplyingOutcome()) {
|
|
606
570
|
// User has left the Confirmation step before the quote was ready, we'll stop here instead of updating the basket.
|
|
607
571
|
// If we don't stop here, the user will be redirected back to the Confirmation step.
|
|
608
572
|
setIsLoadingPriceQuote(false);
|
|
609
573
|
return;
|
|
610
574
|
}
|
|
611
|
-
for (const
|
|
612
|
-
const
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
}
|
|
617
|
-
if (pencilRow) {
|
|
618
|
-
basketRow.pencilId = pencilRow.pencilId;
|
|
575
|
+
for (const quoteRow of quote.rows) {
|
|
576
|
+
const basketRow = currentBasketRows.find((row) => row.getID() === quoteRow.rowId);
|
|
577
|
+
if (!basketRow) {
|
|
578
|
+
console.warn('API Returned unfamiliar row ID', quoteRow.rowId);
|
|
579
|
+
continue;
|
|
619
580
|
}
|
|
581
|
+
basketRow.quoteDetails = quoteRow;
|
|
620
582
|
updateBasketRow(basketRow);
|
|
621
583
|
}
|
|
622
584
|
}, (error) => {
|
|
@@ -649,33 +611,13 @@ function BasketContextWrapper(props) {
|
|
|
649
611
|
getNumberOfRooms: (withTranslation = false) => {
|
|
650
612
|
return returnAggregationAndTranslation(currentBasketRows.length, withTranslation ? Translation_1.Translation.Step.Date.Room : undefined);
|
|
651
613
|
},
|
|
652
|
-
/**
|
|
653
|
-
* Calculates the total booking price, including:
|
|
654
|
-
* - Nightly rates
|
|
655
|
-
* - Deposit fees
|
|
656
|
-
* - Add-ons
|
|
657
|
-
*
|
|
658
|
-
* @returns {number} The total booking price.
|
|
659
|
-
*/
|
|
660
614
|
getTotalPrice: () => {
|
|
661
|
-
let totalPrice = 0;
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
if (!(hotel === null || hotel === void 0 ? void 0 : hotel.enableCreditCardSurcharge)) {
|
|
667
|
-
// **Previous logic**: totalPrice = total Base rate + Fees on Deposit amount
|
|
668
|
-
// const totalQuoteFees = getTotalQuoteDepositFees();
|
|
669
|
-
// totalPrice += totalQuoteFees;
|
|
670
|
-
// **Updated logic**: totalPrice = total Base rate + its fees
|
|
671
|
-
totalPrice = returnAggregationAndTranslation((row) => { var _a; return (row.quoteDetails ? (_a = row.quoteDetails) === null || _a === void 0 ? void 0 : _a.fullPaymentAmount : 0); });
|
|
672
|
-
}
|
|
673
|
-
}
|
|
674
|
-
else {
|
|
675
|
-
// Otherwise, calculate the total price from valid rows
|
|
676
|
-
totalPrice = returnAggregationAndTranslation((row) => { var _a; return (row.isValid() ? (_a = row.getRate()) === null || _a === void 0 ? void 0 : _a.getTotalPrice() : 0); });
|
|
615
|
+
let totalPrice = returnAggregationAndTranslation((row) => { var _a; return (row.isValid() ? (_a = row.getRate()) === null || _a === void 0 ? void 0 : _a.getTotalPrice() : 0); });
|
|
616
|
+
// If the hotel requires a deposit, and enableCreditCardSurchase is false, we need to add the deposit fees to the total price.
|
|
617
|
+
if ((hotel === null || hotel === void 0 ? void 0 : hotel.requireDeposit) && !(hotel === null || hotel === void 0 ? void 0 : hotel.enableCreditCardSurcharge) && (hotel === null || hotel === void 0 ? void 0 : hotel.addDepositFeeToBookingTotal)) {
|
|
618
|
+
const depositFees = returnAggregationAndTranslation((row) => { var _a; return (row.quoteDetails ? (_a = row.quoteDetails) === null || _a === void 0 ? void 0 : _a.totalFees : 0); });
|
|
619
|
+
totalPrice += depositFees;
|
|
677
620
|
}
|
|
678
|
-
// Add prices from any additional add-ons in the booking basket
|
|
679
621
|
basketAddonRows.forEach((row) => {
|
|
680
622
|
totalPrice += row.getTotalPrice();
|
|
681
623
|
});
|
|
@@ -685,11 +627,6 @@ function BasketContextWrapper(props) {
|
|
|
685
627
|
});
|
|
686
628
|
return totalPrice;
|
|
687
629
|
},
|
|
688
|
-
/**
|
|
689
|
-
* Returns the total quote deposit amount, excluding fees.
|
|
690
|
-
*
|
|
691
|
-
* @returns {number} The sum of the quote deposit.
|
|
692
|
-
*/
|
|
693
630
|
getTotalDeposit: () => {
|
|
694
631
|
const totalDeposit = returnAggregationAndTranslation((row) => { var _a; return (row.quoteDetails ? (_a = row.quoteDetails) === null || _a === void 0 ? void 0 : _a.totalDeposit : 0); });
|
|
695
632
|
return totalDeposit;
|
|
@@ -702,7 +639,7 @@ function BasketContextWrapper(props) {
|
|
|
702
639
|
let totalFees = returnAggregationAndTranslation((row) => { var _a; return (row.isValid() ? (_a = row.getRate()) === null || _a === void 0 ? void 0 : _a.getTotalFees() : 0); });
|
|
703
640
|
if (totalFees == 0 && (hotel === null || hotel === void 0 ? void 0 : hotel.requireDeposit)) {
|
|
704
641
|
// Hotel may have credit card surcharges disabled, but they could still be included as a part of the quote.
|
|
705
|
-
totalFees =
|
|
642
|
+
totalFees = returnAggregationAndTranslation((row) => { var _a; return (row.quoteDetails ? (_a = row.quoteDetails) === null || _a === void 0 ? void 0 : _a.totalFees : 0); });
|
|
706
643
|
}
|
|
707
644
|
basketAddonRows.forEach((row) => {
|
|
708
645
|
totalFees += row.getTotalFees();
|
|
@@ -741,26 +678,12 @@ function BasketContextWrapper(props) {
|
|
|
741
678
|
const fees = (0, Fee_1.feeMapToArray)(feeMap);
|
|
742
679
|
return (0, Fee_1.sortFees)(fees, (hotel === null || hotel === void 0 ? void 0 : hotel.fees) || []);
|
|
743
680
|
},
|
|
744
|
-
/**
|
|
745
|
-
* Calculates the total amount to be paid immediately, including:
|
|
746
|
-
* - Required deposit
|
|
747
|
-
* - Deposit fees (if applicable)
|
|
748
|
-
* - Add-ons
|
|
749
|
-
*
|
|
750
|
-
* @returns {number} The total amount to pay now.
|
|
751
|
-
*/
|
|
752
681
|
getTotalPayNow: () => {
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
const totalDepositFees = getTotalQuoteDepositFees();
|
|
757
|
-
totalDeposit += totalDepositFees;
|
|
682
|
+
if (hotel === null || hotel === void 0 ? void 0 : hotel.requireDeposit) {
|
|
683
|
+
const depositFees = returnAggregationAndTranslation((row) => { var _a; return (row.quoteDetails ? (_a = row.quoteDetails) === null || _a === void 0 ? void 0 : _a.totalFees : 0); });
|
|
684
|
+
return workingContext.getTotalDeposit() + depositFees;
|
|
758
685
|
}
|
|
759
|
-
|
|
760
|
-
basketAddonRows.forEach((row) => {
|
|
761
|
-
totalDeposit += row.getTotalPrice();
|
|
762
|
-
});
|
|
763
|
-
return totalDeposit;
|
|
686
|
+
return workingContext.getTotalPrice();
|
|
764
687
|
},
|
|
765
688
|
/**
|
|
766
689
|
* Pops the provided row from the current basket array
|
|
@@ -809,12 +732,12 @@ function BasketContextWrapper(props) {
|
|
|
809
732
|
setStartDate,
|
|
810
733
|
setEndDate,
|
|
811
734
|
booked: (data, requestData) => __awaiter(this, void 0, void 0, function* () {
|
|
812
|
-
var
|
|
735
|
+
var _d;
|
|
813
736
|
const updateObject = { reservation: data };
|
|
814
737
|
if (requestData) {
|
|
815
738
|
updateObject.reservationRequest = requestData;
|
|
816
739
|
}
|
|
817
|
-
yield ((
|
|
740
|
+
yield ((_d = beContext.sessionProvider) === null || _d === void 0 ? void 0 : _d.updateSessionAsync(updateObject));
|
|
818
741
|
setReservationData(data);
|
|
819
742
|
}),
|
|
820
743
|
rollback: () => {
|
|
@@ -873,14 +796,14 @@ function BasketContextWrapper(props) {
|
|
|
873
796
|
addonRow.setSelectedDate(selectedDate);
|
|
874
797
|
addonRow.setSelectedTime(addon.availability[selectedDate].selectorTimes ? selectedTime : undefined);
|
|
875
798
|
// TODO: Quick hack to fix Synxis Basic Addon quantities.
|
|
876
|
-
if (addon.pricingType ===
|
|
799
|
+
if (addon.pricingType === Addon_1.AddonPricingType.PER_ADULT_OCCUPANCY_PER_NIGHT) {
|
|
877
800
|
// TODO: Because all addons only apply to first room, we can select the 0th from the list.
|
|
878
801
|
const basketRow = currentBasketRows === null || currentBasketRows === void 0 ? void 0 : currentBasketRows[0];
|
|
879
802
|
if (basketRow) {
|
|
880
803
|
addonRow.setAdultQuantity(basketRow.getAdults());
|
|
881
804
|
}
|
|
882
805
|
}
|
|
883
|
-
if (addon.pricingType ===
|
|
806
|
+
if (addon.pricingType === Addon_1.AddonPricingType.PER_CHILD_OCCUPANCY_PER_NIGHT) {
|
|
884
807
|
// TODO: Because all addons only apply to first room, we can select the 0th from the list.
|
|
885
808
|
const basketRow = currentBasketRows === null || currentBasketRows === void 0 ? void 0 : currentBasketRows[0];
|
|
886
809
|
if (basketRow) {
|
|
@@ -888,7 +811,7 @@ function BasketContextWrapper(props) {
|
|
|
888
811
|
}
|
|
889
812
|
}
|
|
890
813
|
// TODO: More hackyness to handle RMS Per Person Fee requirements
|
|
891
|
-
if (addon.pricingType ===
|
|
814
|
+
if (addon.pricingType === Addon_1.AddonPricingType.PER_ALL_PERSONS || addon.pricingType === Addon_1.AddonPricingType.PER_ALL_PERSONS_PER_NIGHT) {
|
|
892
815
|
const basketRow = currentBasketRows === null || currentBasketRows === void 0 ? void 0 : currentBasketRows[0];
|
|
893
816
|
if (basketRow) {
|
|
894
817
|
addonRow.setAdultQuantity(basketRow.getAdults());
|