@roomstay/frontend 2.6.59 → 2.6.61-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/dist/263.bundle.js +1 -0
- package/dist/449.bundle.js +1 -1
- package/dist/458.bundle.js +1 -0
- package/dist/537.bundle.js +1 -1
- package/dist/978.bundle.js +1 -1
- package/dist/main.bundle.js +1 -1
- package/dist/src/api/ReservationAPI.d.ts +18 -3
- package/dist/src/api/ReservationAPI.js +61 -31
- package/dist/src/api/ReservationAPI.js.map +1 -1
- package/dist/src/components/generic/BookingWizard/BookingWizard.d.ts +1 -0
- package/dist/src/components/generic/BookingWizard/BookingWizard.js +7 -1
- package/dist/src/components/generic/BookingWizard/BookingWizard.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/navigation/Header.js +3 -2
- package/dist/src/components/navigation/Header.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 +12 -12
- package/dist/src/components/steps/confirmation/RoomContactDetails.js.map +1 -1
- package/dist/src/components/steps/confirmation/StepConfirmationAcknowledgement.js +11 -10
- package/dist/src/components/steps/confirmation/StepConfirmationAcknowledgement.js.map +1 -1
- package/dist/src/components/steps/confirmation/StepConfirmationForm.js +11 -4
- package/dist/src/components/steps/confirmation/StepConfirmationForm.js.map +1 -1
- package/dist/src/components/steps/confirmation/StepConfirmationImportantInformation.d.ts +7 -0
- package/dist/src/components/steps/confirmation/StepConfirmationImportantInformation.js +54 -0
- package/dist/src/components/steps/confirmation/StepConfirmationImportantInformation.js.map +1 -0
- package/dist/src/components/steps/hotel/HotelCard.js +22 -5
- package/dist/src/components/steps/hotel/HotelCard.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/ImageGallerySlider.js +5 -3
- package/dist/src/components/steps/room/ImageGallerySlider.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/steps/room/roomDetails/roomRates/RoomRateRow.d.ts +3 -1
- package/dist/src/components/steps/room/roomDetails/roomRates/RoomRateRow.js +47 -21
- package/dist/src/components/steps/room/roomDetails/roomRates/RoomRateRow.js.map +1 -1
- package/dist/src/components/steps/room/roomDetails/roomRates/RoomRates.d.ts +3 -1
- package/dist/src/components/steps/room/roomDetails/roomRates/RoomRates.js +7 -6
- package/dist/src/components/steps/room/roomDetails/roomRates/RoomRates.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/contexts/BasketContext/BasketContextType.d.ts +2 -5
- package/dist/src/contexts/BasketContext/BasketContextType.js.map +1 -1
- package/dist/src/contexts/BasketContext/BasketContextWrapper.js +109 -32
- package/dist/src/contexts/BasketContext/BasketContextWrapper.js.map +1 -1
- package/dist/src/contexts/CompanyContext/CompanyContextWrapper.js +1 -0
- package/dist/src/contexts/CompanyContext/CompanyContextWrapper.js.map +1 -1
- package/dist/src/contexts/ConfirmationStepContext/ConfirmationStepContextWrapper.js +18 -18
- package/dist/src/contexts/ConfirmationStepContext/ConfirmationStepContextWrapper.js.map +1 -1
- package/dist/src/contexts/FullPageEngineContext/FullPageEngineContextWrapper.js +10 -1
- package/dist/src/contexts/FullPageEngineContext/FullPageEngineContextWrapper.js.map +1 -1
- package/dist/src/contexts/Members/RoomstayMemberContext/RoomstayMemberContextProvider.js.map +1 -1
- package/dist/src/engines/BookingWizardEngine/BookingWizardEngine.d.ts +1 -0
- package/dist/src/engines/BookingWizardEngine/BookingWizardEngine.js.map +1 -1
- package/dist/src/engines/BookingWizardEngine/BookingWizardEngineElement.js +1 -0
- package/dist/src/engines/BookingWizardEngine/BookingWizardEngineElement.js.map +1 -1
- package/dist/src/engines/InlineRoomMiniEngine/InlineRoomMiniEngine.d.ts +4 -0
- package/dist/src/engines/InlineRoomMiniEngine/InlineRoomMiniEngine.js.map +1 -1
- package/dist/src/engines/InlineRoomMiniEngine/InlineRoomMiniEngineElement.d.ts +28 -0
- package/dist/src/engines/InlineRoomMiniEngine/InlineRoomMiniEngineElement.js +206 -41
- package/dist/src/engines/InlineRoomMiniEngine/InlineRoomMiniEngineElement.js.map +1 -1
- package/dist/src/hooks/RoomRateAvailabilityListFromApi.js +1 -0
- package/dist/src/hooks/RoomRateAvailabilityListFromApi.js.map +1 -1
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.js +6 -2
- package/dist/src/index.js.map +1 -1
- package/dist/src/models/Addon/Addon.d.ts +6 -64
- package/dist/src/models/Addon/Addon.js +14 -28
- package/dist/src/models/Addon/Addon.js.map +1 -1
- package/dist/src/models/Api/HotelDTO.d.ts +1 -0
- package/dist/src/models/Api/HotelDTO.js.map +1 -1
- package/dist/src/models/BasketAddonRow.js +3 -2
- package/dist/src/models/BasketAddonRow.js.map +1 -1
- package/dist/src/models/BasketRow.d.ts +3 -1
- package/dist/src/models/BasketRow.js +32 -2
- package/dist/src/models/BasketRow.js.map +1 -1
- package/dist/src/models/Client/Hotel/Hotel.d.ts +4 -2
- package/dist/src/models/Client/Hotel/Hotel.js.map +1 -1
- package/dist/src/models/RoomstaySession.d.ts +2 -0
- package/dist/src/models/RoomstaySession.js.map +1 -1
- package/dist/src/models/SearchParameters.d.ts +1 -0
- 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/pages/findReservation/FindReservation.js +15 -4
- package/dist/src/pages/findReservation/FindReservation.js.map +1 -1
- package/dist/src/pages/hotel/HotelInfo.js +1 -1
- package/dist/src/pages/hotel/HotelInfo.js.map +1 -1
- package/dist/src/providers/FeatureProvider.js +4 -0
- package/dist/src/providers/FeatureProvider.js.map +1 -1
- package/dist/src/providers/feature/ConfirmationImportantInformationFeature.d.ts +10 -0
- package/dist/src/providers/feature/ConfirmationImportantInformationFeature.js +13 -0
- package/dist/src/providers/feature/ConfirmationImportantInformationFeature.js.map +1 -0
- package/dist/src/providers/feature/Feature.d.ts +2 -0
- package/dist/src/providers/feature/Feature.js +4 -0
- package/dist/src/providers/feature/Feature.js.map +1 -1
- package/dist/src/providers/feature/HotelGroupFeature.d.ts +6 -0
- package/dist/src/providers/feature/HotelGroupFeature.js +10 -0
- package/dist/src/providers/feature/HotelGroupFeature.js.map +1 -0
- package/dist/src/providers/storage/SessionProvider.js +2 -0
- package/dist/src/providers/storage/SessionProvider.js.map +1 -1
- package/dist/src/translations/Translation.d.ts +4 -0
- package/dist/src/translations/Translation.js +4 -0
- package/dist/src/translations/Translation.js.map +1 -1
- package/dist/src/translations/languages/en-gb.js +4 -0
- package/dist/src/translations/languages/en-gb.js.map +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 -1
- 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/493.bundle.js +0 -1
- package/dist/984.bundle.js +0 -1
|
@@ -58,7 +58,6 @@ 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");
|
|
62
61
|
const BasketAddonRow_1 = __importDefault(require("../../models/BasketAddonRow"));
|
|
63
62
|
const BasketRow_1 = __importDefault(require("../../models/BasketRow"));
|
|
64
63
|
const Fee_1 = require("../../models/Fee");
|
|
@@ -72,7 +71,7 @@ const GetStepRoom_1 = __importDefault(require("../../util/GetStepRoom"));
|
|
|
72
71
|
const StepManager_1 = __importDefault(require("../../util/StepManager"));
|
|
73
72
|
const StringHelper_1 = __importDefault(require("../../util/StringHelper"));
|
|
74
73
|
function BasketContextWrapper(props) {
|
|
75
|
-
var _a, _b, _c;
|
|
74
|
+
var _a, _b, _c, _d;
|
|
76
75
|
const { t } = (0, react_i18next_1.useTranslation)();
|
|
77
76
|
const { hotel } = (0, hooks_1.useCurrentHotel)();
|
|
78
77
|
const updateQueryParams = (0, UpdateQueryParameters_1.useUpdateQueryParameters)();
|
|
@@ -84,6 +83,7 @@ function BasketContextWrapper(props) {
|
|
|
84
83
|
const { showPromoCodeAlert } = (0, react_1.useContext)(contexts_1.HotelOverridesContext);
|
|
85
84
|
const initialSession = (_a = beContext === null || beContext === void 0 ? void 0 : beContext.engine) === null || _a === void 0 ? void 0 : _a.getInitialSession();
|
|
86
85
|
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 ((_d = initialSession === null || initialSession === void 0 ? void 0 : initialSession.basketRows) === null || _d === void 0 ? void 0 : _d.length) {
|
|
95
95
|
loadedStartDate = initialSession.basketRows[0].getStartDate();
|
|
96
96
|
loadedEndDate = initialSession.basketRows[0].getEndDate();
|
|
97
97
|
}
|
|
@@ -244,6 +244,8 @@ 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();
|
|
247
249
|
updateQueryParams(queryParameters);
|
|
248
250
|
};
|
|
249
251
|
const updateBasketRow = (row, updateGlobalDates = true) => {
|
|
@@ -280,6 +282,16 @@ function BasketContextWrapper(props) {
|
|
|
280
282
|
return (0, rxjs_1.timer)(scalingDuration);
|
|
281
283
|
}), (0, operators_1.finalize)(() => console.log('We are done!')));
|
|
282
284
|
};
|
|
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
|
+
};
|
|
283
295
|
const updateBasketFeeRows = () => {
|
|
284
296
|
var _a, _b;
|
|
285
297
|
const validBasketRows = currentBasketRows === null || currentBasketRows === void 0 ? void 0 : currentBasketRows.filter((row) => row.isValid());
|
|
@@ -420,6 +432,7 @@ function BasketContextWrapper(props) {
|
|
|
420
432
|
reservationData: reservationData,
|
|
421
433
|
isLoadingPriceQuote,
|
|
422
434
|
loadedPromotion,
|
|
435
|
+
pencilId,
|
|
423
436
|
/**
|
|
424
437
|
* Adds a new basket row and applies relevant updates:
|
|
425
438
|
* - Synchronizes the selected date range.
|
|
@@ -545,9 +558,17 @@ function BasketContextWrapper(props) {
|
|
|
545
558
|
}
|
|
546
559
|
}
|
|
547
560
|
}),
|
|
548
|
-
|
|
549
|
-
const maxRetryAttempts =
|
|
550
|
-
|
|
561
|
+
quoteOrPencilReservation: (applyQuote) => {
|
|
562
|
+
const maxRetryAttempts = 1;
|
|
563
|
+
let callApi;
|
|
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 {
|
|
551
572
|
return false;
|
|
552
573
|
}
|
|
553
574
|
setIsLoadingPriceQuote(true);
|
|
@@ -559,26 +580,43 @@ function BasketContextWrapper(props) {
|
|
|
559
580
|
updateBasketRow(row);
|
|
560
581
|
}
|
|
561
582
|
});
|
|
562
|
-
const
|
|
583
|
+
const retryableGetQuote = () => (0, rxjs_1.defer)(() => callApi(hotel.hotelID, currentBasketRows, isExternalMemberHotel ? memberNumber : undefined, pencilId)).pipe((0, operators_1.retryWhen)(genericRetryStrategy({
|
|
563
584
|
maxRetryAttempts: maxRetryAttempts,
|
|
564
585
|
})));
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
586
|
+
retryableGetQuote().subscribe((response) => {
|
|
587
|
+
var _a, _b, _c;
|
|
588
|
+
let pencilResponse = null;
|
|
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) {
|
|
568
603
|
return;
|
|
569
|
-
|
|
604
|
+
}
|
|
605
|
+
if (!applyQuote()) {
|
|
570
606
|
// User has left the Confirmation step before the quote was ready, we'll stop here instead of updating the basket.
|
|
571
607
|
// If we don't stop here, the user will be redirected back to the Confirmation step.
|
|
572
608
|
setIsLoadingPriceQuote(false);
|
|
573
609
|
return;
|
|
574
610
|
}
|
|
575
|
-
for (const
|
|
576
|
-
const
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
611
|
+
for (const basketRow of currentBasketRows) {
|
|
612
|
+
const quoteRow = (_b = quoteResponse === null || quoteResponse === void 0 ? void 0 : quoteResponse.rows) === null || _b === void 0 ? void 0 : _b.find((row) => row.rowId === basketRow.getID());
|
|
613
|
+
const pencilRow = (_c = pencilResponse === null || pencilResponse === void 0 ? void 0 : pencilResponse.rows) === null || _c === void 0 ? void 0 : _c.find((row) => row.rowId === basketRow.getID());
|
|
614
|
+
if (quoteRow) {
|
|
615
|
+
basketRow.quoteDetails = quoteRow;
|
|
616
|
+
}
|
|
617
|
+
if (pencilRow) {
|
|
618
|
+
basketRow.pencilId = pencilRow.pencilId;
|
|
580
619
|
}
|
|
581
|
-
basketRow.quoteDetails = quoteRow;
|
|
582
620
|
updateBasketRow(basketRow);
|
|
583
621
|
}
|
|
584
622
|
}, (error) => {
|
|
@@ -611,13 +649,33 @@ function BasketContextWrapper(props) {
|
|
|
611
649
|
getNumberOfRooms: (withTranslation = false) => {
|
|
612
650
|
return returnAggregationAndTranslation(currentBasketRows.length, withTranslation ? Translation_1.Translation.Step.Date.Room : undefined);
|
|
613
651
|
},
|
|
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
|
+
*/
|
|
614
660
|
getTotalPrice: () => {
|
|
615
|
-
let totalPrice =
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
661
|
+
let totalPrice = 0;
|
|
662
|
+
if (!!(hotel === null || hotel === void 0 ? void 0 : hotel.requireDeposit)) {
|
|
663
|
+
// If deposit is required, get the total price from quote details
|
|
664
|
+
totalPrice = returnAggregationAndTranslation((row) => { var _a; return (row.quoteDetails ? (_a = row.quoteDetails) === null || _a === void 0 ? void 0 : _a.totalRate : 0); });
|
|
665
|
+
// Add deposit fees if credit card surcharge is disabled
|
|
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); });
|
|
620
677
|
}
|
|
678
|
+
// Add prices from any additional add-ons in the booking basket
|
|
621
679
|
basketAddonRows.forEach((row) => {
|
|
622
680
|
totalPrice += row.getTotalPrice();
|
|
623
681
|
});
|
|
@@ -627,6 +685,11 @@ function BasketContextWrapper(props) {
|
|
|
627
685
|
});
|
|
628
686
|
return totalPrice;
|
|
629
687
|
},
|
|
688
|
+
/**
|
|
689
|
+
* Returns the total quote deposit amount, excluding fees.
|
|
690
|
+
*
|
|
691
|
+
* @returns {number} The sum of the quote deposit.
|
|
692
|
+
*/
|
|
630
693
|
getTotalDeposit: () => {
|
|
631
694
|
const totalDeposit = returnAggregationAndTranslation((row) => { var _a; return (row.quoteDetails ? (_a = row.quoteDetails) === null || _a === void 0 ? void 0 : _a.totalDeposit : 0); });
|
|
632
695
|
return totalDeposit;
|
|
@@ -639,7 +702,7 @@ function BasketContextWrapper(props) {
|
|
|
639
702
|
let totalFees = returnAggregationAndTranslation((row) => { var _a; return (row.isValid() ? (_a = row.getRate()) === null || _a === void 0 ? void 0 : _a.getTotalFees() : 0); });
|
|
640
703
|
if (totalFees == 0 && (hotel === null || hotel === void 0 ? void 0 : hotel.requireDeposit)) {
|
|
641
704
|
// Hotel may have credit card surcharges disabled, but they could still be included as a part of the quote.
|
|
642
|
-
totalFees =
|
|
705
|
+
totalFees = getTotalQuoteFullPaymentFees();
|
|
643
706
|
}
|
|
644
707
|
basketAddonRows.forEach((row) => {
|
|
645
708
|
totalFees += row.getTotalFees();
|
|
@@ -678,12 +741,26 @@ function BasketContextWrapper(props) {
|
|
|
678
741
|
const fees = (0, Fee_1.feeMapToArray)(feeMap);
|
|
679
742
|
return (0, Fee_1.sortFees)(fees, (hotel === null || hotel === void 0 ? void 0 : hotel.fees) || []);
|
|
680
743
|
},
|
|
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
|
+
*/
|
|
681
752
|
getTotalPayNow: () => {
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
753
|
+
let totalDeposit = workingContext.getTotalDeposit();
|
|
754
|
+
if (!!(hotel === null || hotel === void 0 ? void 0 : hotel.requireDeposit) && !(hotel === null || hotel === void 0 ? void 0 : hotel.enableCreditCardSurcharge)) {
|
|
755
|
+
// Add deposit fees if credit card surcharge is disabled
|
|
756
|
+
const totalDepositFees = getTotalQuoteDepositFees();
|
|
757
|
+
totalDeposit += totalDepositFees;
|
|
685
758
|
}
|
|
686
|
-
|
|
759
|
+
// Add prices from any additional add-ons in the booking basket
|
|
760
|
+
basketAddonRows.forEach((row) => {
|
|
761
|
+
totalDeposit += row.getTotalPrice();
|
|
762
|
+
});
|
|
763
|
+
return totalDeposit;
|
|
687
764
|
},
|
|
688
765
|
/**
|
|
689
766
|
* Pops the provided row from the current basket array
|
|
@@ -732,12 +809,12 @@ function BasketContextWrapper(props) {
|
|
|
732
809
|
setStartDate,
|
|
733
810
|
setEndDate,
|
|
734
811
|
booked: (data, requestData) => __awaiter(this, void 0, void 0, function* () {
|
|
735
|
-
var
|
|
812
|
+
var _e;
|
|
736
813
|
const updateObject = { reservation: data };
|
|
737
814
|
if (requestData) {
|
|
738
815
|
updateObject.reservationRequest = requestData;
|
|
739
816
|
}
|
|
740
|
-
yield ((
|
|
817
|
+
yield ((_e = beContext.sessionProvider) === null || _e === void 0 ? void 0 : _e.updateSessionAsync(updateObject));
|
|
741
818
|
setReservationData(data);
|
|
742
819
|
}),
|
|
743
820
|
rollback: () => {
|
|
@@ -796,14 +873,14 @@ function BasketContextWrapper(props) {
|
|
|
796
873
|
addonRow.setSelectedDate(selectedDate);
|
|
797
874
|
addonRow.setSelectedTime(addon.availability[selectedDate].selectorTimes ? selectedTime : undefined);
|
|
798
875
|
// TODO: Quick hack to fix Synxis Basic Addon quantities.
|
|
799
|
-
if (addon.pricingType ===
|
|
876
|
+
if (addon.pricingType === core_1.EAddonPricingType.PER_ADULT_OCCUPANCY_PER_NIGHT) {
|
|
800
877
|
// TODO: Because all addons only apply to first room, we can select the 0th from the list.
|
|
801
878
|
const basketRow = currentBasketRows === null || currentBasketRows === void 0 ? void 0 : currentBasketRows[0];
|
|
802
879
|
if (basketRow) {
|
|
803
880
|
addonRow.setAdultQuantity(basketRow.getAdults());
|
|
804
881
|
}
|
|
805
882
|
}
|
|
806
|
-
if (addon.pricingType ===
|
|
883
|
+
if (addon.pricingType === core_1.EAddonPricingType.PER_CHILD_OCCUPANCY_PER_NIGHT) {
|
|
807
884
|
// TODO: Because all addons only apply to first room, we can select the 0th from the list.
|
|
808
885
|
const basketRow = currentBasketRows === null || currentBasketRows === void 0 ? void 0 : currentBasketRows[0];
|
|
809
886
|
if (basketRow) {
|
|
@@ -811,7 +888,7 @@ function BasketContextWrapper(props) {
|
|
|
811
888
|
}
|
|
812
889
|
}
|
|
813
890
|
// TODO: More hackyness to handle RMS Per Person Fee requirements
|
|
814
|
-
if (addon.pricingType ===
|
|
891
|
+
if (addon.pricingType === core_1.EAddonPricingType.PER_ALL_PERSONS || addon.pricingType === core_1.EAddonPricingType.PER_ALL_PERSONS_PER_NIGHT) {
|
|
815
892
|
const basketRow = currentBasketRows === null || currentBasketRows === void 0 ? void 0 : currentBasketRows[0];
|
|
816
893
|
if (basketRow) {
|
|
817
894
|
addonRow.setAdultQuantity(basketRow.getAdults());
|