@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.
Files changed (125) hide show
  1. package/dist/263.bundle.js +1 -0
  2. package/dist/449.bundle.js +1 -1
  3. package/dist/458.bundle.js +1 -0
  4. package/dist/537.bundle.js +1 -1
  5. package/dist/978.bundle.js +1 -1
  6. package/dist/main.bundle.js +1 -1
  7. package/dist/src/api/ReservationAPI.d.ts +18 -3
  8. package/dist/src/api/ReservationAPI.js +61 -31
  9. package/dist/src/api/ReservationAPI.js.map +1 -1
  10. package/dist/src/components/generic/BookingWizard/BookingWizard.d.ts +1 -0
  11. package/dist/src/components/generic/BookingWizard/BookingWizard.js +7 -1
  12. package/dist/src/components/generic/BookingWizard/BookingWizard.js.map +1 -1
  13. package/dist/src/components/members/SignInModal/ExternalMemberModal.js +4 -4
  14. package/dist/src/components/members/SignInModal/ExternalMemberModal.js.map +1 -1
  15. package/dist/src/components/navigation/Header.js +3 -2
  16. package/dist/src/components/navigation/Header.js.map +1 -1
  17. package/dist/src/components/reservation/ReservationItem.js +1 -1
  18. package/dist/src/components/reservation/ReservationItem.js.map +1 -1
  19. package/dist/src/components/steps/addons/AddonCard.js +14 -14
  20. package/dist/src/components/steps/addons/AddonCard.js.map +1 -1
  21. package/dist/src/components/steps/confirmation/RoomContactDetails.js +12 -12
  22. package/dist/src/components/steps/confirmation/RoomContactDetails.js.map +1 -1
  23. package/dist/src/components/steps/confirmation/StepConfirmationAcknowledgement.js +11 -10
  24. package/dist/src/components/steps/confirmation/StepConfirmationAcknowledgement.js.map +1 -1
  25. package/dist/src/components/steps/confirmation/StepConfirmationForm.js +11 -4
  26. package/dist/src/components/steps/confirmation/StepConfirmationForm.js.map +1 -1
  27. package/dist/src/components/steps/confirmation/StepConfirmationImportantInformation.d.ts +7 -0
  28. package/dist/src/components/steps/confirmation/StepConfirmationImportantInformation.js +54 -0
  29. package/dist/src/components/steps/confirmation/StepConfirmationImportantInformation.js.map +1 -0
  30. package/dist/src/components/steps/hotel/HotelCard.js +22 -5
  31. package/dist/src/components/steps/hotel/HotelCard.js.map +1 -1
  32. package/dist/src/components/steps/room/AvailableUpgradesModal.js +1 -1
  33. package/dist/src/components/steps/room/AvailableUpgradesModal.js.map +1 -1
  34. package/dist/src/components/steps/room/ImageGallerySlider.js +5 -3
  35. package/dist/src/components/steps/room/ImageGallerySlider.js.map +1 -1
  36. package/dist/src/components/steps/room/roomDetails/roomRates/PriceBreakdownBlock.js +2 -2
  37. package/dist/src/components/steps/room/roomDetails/roomRates/PriceBreakdownBlock.js.map +1 -1
  38. package/dist/src/components/steps/room/roomDetails/roomRates/RoomRateRow.d.ts +3 -1
  39. package/dist/src/components/steps/room/roomDetails/roomRates/RoomRateRow.js +47 -21
  40. package/dist/src/components/steps/room/roomDetails/roomRates/RoomRateRow.js.map +1 -1
  41. package/dist/src/components/steps/room/roomDetails/roomRates/RoomRates.d.ts +3 -1
  42. package/dist/src/components/steps/room/roomDetails/roomRates/RoomRates.js +7 -6
  43. package/dist/src/components/steps/room/roomDetails/roomRates/RoomRates.js.map +1 -1
  44. package/dist/src/components/summary/BESummaryAddonRow.js +1 -1
  45. package/dist/src/components/summary/BESummaryAddonRow.js.map +1 -1
  46. package/dist/src/components/summary/BESummaryRoomRow.js +2 -2
  47. package/dist/src/components/summary/BESummaryRoomRow.js.map +1 -1
  48. package/dist/src/contexts/BasketContext/BasketContextType.d.ts +2 -5
  49. package/dist/src/contexts/BasketContext/BasketContextType.js.map +1 -1
  50. package/dist/src/contexts/BasketContext/BasketContextWrapper.js +109 -32
  51. package/dist/src/contexts/BasketContext/BasketContextWrapper.js.map +1 -1
  52. package/dist/src/contexts/CompanyContext/CompanyContextWrapper.js +1 -0
  53. package/dist/src/contexts/CompanyContext/CompanyContextWrapper.js.map +1 -1
  54. package/dist/src/contexts/ConfirmationStepContext/ConfirmationStepContextWrapper.js +18 -18
  55. package/dist/src/contexts/ConfirmationStepContext/ConfirmationStepContextWrapper.js.map +1 -1
  56. package/dist/src/contexts/FullPageEngineContext/FullPageEngineContextWrapper.js +10 -1
  57. package/dist/src/contexts/FullPageEngineContext/FullPageEngineContextWrapper.js.map +1 -1
  58. package/dist/src/contexts/Members/RoomstayMemberContext/RoomstayMemberContextProvider.js.map +1 -1
  59. package/dist/src/engines/BookingWizardEngine/BookingWizardEngine.d.ts +1 -0
  60. package/dist/src/engines/BookingWizardEngine/BookingWizardEngine.js.map +1 -1
  61. package/dist/src/engines/BookingWizardEngine/BookingWizardEngineElement.js +1 -0
  62. package/dist/src/engines/BookingWizardEngine/BookingWizardEngineElement.js.map +1 -1
  63. package/dist/src/engines/InlineRoomMiniEngine/InlineRoomMiniEngine.d.ts +4 -0
  64. package/dist/src/engines/InlineRoomMiniEngine/InlineRoomMiniEngine.js.map +1 -1
  65. package/dist/src/engines/InlineRoomMiniEngine/InlineRoomMiniEngineElement.d.ts +28 -0
  66. package/dist/src/engines/InlineRoomMiniEngine/InlineRoomMiniEngineElement.js +206 -41
  67. package/dist/src/engines/InlineRoomMiniEngine/InlineRoomMiniEngineElement.js.map +1 -1
  68. package/dist/src/hooks/RoomRateAvailabilityListFromApi.js +1 -0
  69. package/dist/src/hooks/RoomRateAvailabilityListFromApi.js.map +1 -1
  70. package/dist/src/index.d.ts +2 -0
  71. package/dist/src/index.js +6 -2
  72. package/dist/src/index.js.map +1 -1
  73. package/dist/src/models/Addon/Addon.d.ts +6 -64
  74. package/dist/src/models/Addon/Addon.js +14 -28
  75. package/dist/src/models/Addon/Addon.js.map +1 -1
  76. package/dist/src/models/Api/HotelDTO.d.ts +1 -0
  77. package/dist/src/models/Api/HotelDTO.js.map +1 -1
  78. package/dist/src/models/BasketAddonRow.js +3 -2
  79. package/dist/src/models/BasketAddonRow.js.map +1 -1
  80. package/dist/src/models/BasketRow.d.ts +3 -1
  81. package/dist/src/models/BasketRow.js +32 -2
  82. package/dist/src/models/BasketRow.js.map +1 -1
  83. package/dist/src/models/Client/Hotel/Hotel.d.ts +4 -2
  84. package/dist/src/models/Client/Hotel/Hotel.js.map +1 -1
  85. package/dist/src/models/RoomstaySession.d.ts +2 -0
  86. package/dist/src/models/RoomstaySession.js.map +1 -1
  87. package/dist/src/models/SearchParameters.d.ts +1 -0
  88. package/dist/src/models/SearchParameters.js.map +1 -1
  89. package/dist/src/models/UserProfile.d.ts +20 -20
  90. package/dist/src/models/UserProfile.js.map +1 -1
  91. package/dist/src/pages/account/Reservations/AccountReservationSinglePage.js +2 -2
  92. package/dist/src/pages/account/Reservations/AccountReservationSinglePage.js.map +1 -1
  93. package/dist/src/pages/findReservation/FindReservation.js +15 -4
  94. package/dist/src/pages/findReservation/FindReservation.js.map +1 -1
  95. package/dist/src/pages/hotel/HotelInfo.js +1 -1
  96. package/dist/src/pages/hotel/HotelInfo.js.map +1 -1
  97. package/dist/src/providers/FeatureProvider.js +4 -0
  98. package/dist/src/providers/FeatureProvider.js.map +1 -1
  99. package/dist/src/providers/feature/ConfirmationImportantInformationFeature.d.ts +10 -0
  100. package/dist/src/providers/feature/ConfirmationImportantInformationFeature.js +13 -0
  101. package/dist/src/providers/feature/ConfirmationImportantInformationFeature.js.map +1 -0
  102. package/dist/src/providers/feature/Feature.d.ts +2 -0
  103. package/dist/src/providers/feature/Feature.js +4 -0
  104. package/dist/src/providers/feature/Feature.js.map +1 -1
  105. package/dist/src/providers/feature/HotelGroupFeature.d.ts +6 -0
  106. package/dist/src/providers/feature/HotelGroupFeature.js +10 -0
  107. package/dist/src/providers/feature/HotelGroupFeature.js.map +1 -0
  108. package/dist/src/providers/storage/SessionProvider.js +2 -0
  109. package/dist/src/providers/storage/SessionProvider.js.map +1 -1
  110. package/dist/src/translations/Translation.d.ts +4 -0
  111. package/dist/src/translations/Translation.js +4 -0
  112. package/dist/src/translations/Translation.js.map +1 -1
  113. package/dist/src/translations/languages/en-gb.js +4 -0
  114. package/dist/src/translations/languages/en-gb.js.map +1 -1
  115. package/dist/src/util/EventsHelper.js +1 -1
  116. package/dist/src/util/EventsHelper.js.map +1 -1
  117. package/dist/src/util/TotalCalculator.js +2 -2
  118. package/dist/src/util/TotalCalculator.js.map +1 -1
  119. package/dist/test.bundle.js +1 -1
  120. package/dist/tests/offline/entry/config/hotelSpecDefault.js +1 -1
  121. package/dist/tests/offline/entry/config/hotelSpecDefault.js.map +1 -1
  122. package/dist/vendors.bundle.js +1 -1
  123. package/package.json +2 -2
  124. package/dist/493.bundle.js +0 -1
  125. 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 ((_c = initialSession === null || initialSession === void 0 ? void 0 : initialSession.basketRows) === null || _c === void 0 ? void 0 : _c.length) {
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
- getBasketQuoteDetails: (preventApplyingOutcome) => {
549
- const maxRetryAttempts = 5;
550
- if (!hotel || !(hotel === null || hotel === void 0 ? void 0 : hotel.requireDeposit)) {
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 getData = () => (0, rxjs_1.defer)(() => BookingAPI_1.default.Reservation.getPriceQuote(hotel.hotelID, currentBasketRows, isExternalMemberHotel ? memberNumber : undefined)).pipe((0, operators_1.retryWhen)(genericRetryStrategy({
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
- const retryableObservable = getData();
566
- retryableObservable.subscribe((quote) => {
567
- if (quote === null)
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
- if (!preventApplyingOutcome()) {
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 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;
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 = 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;
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 = returnAggregationAndTranslation((row) => { var _a; return (row.quoteDetails ? (_a = row.quoteDetails) === null || _a === void 0 ? void 0 : _a.totalFees : 0); });
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
- 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;
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
- return workingContext.getTotalPrice();
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 _d;
812
+ var _e;
736
813
  const updateObject = { reservation: data };
737
814
  if (requestData) {
738
815
  updateObject.reservationRequest = requestData;
739
816
  }
740
- yield ((_d = beContext.sessionProvider) === null || _d === void 0 ? void 0 : _d.updateSessionAsync(updateObject));
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 === Addon_1.AddonPricingType.PER_ADULT_OCCUPANCY_PER_NIGHT) {
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 === Addon_1.AddonPricingType.PER_CHILD_OCCUPANCY_PER_NIGHT) {
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 === Addon_1.AddonPricingType.PER_ALL_PERSONS || addon.pricingType === Addon_1.AddonPricingType.PER_ALL_PERSONS_PER_NIGHT) {
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());