@roomstay/frontend 2.1.17 → 2.1.18
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/760.bundle.js +1 -1
- package/dist/main.bundle.js +1 -1
- package/dist/src/api/AvailabilityAPI.d.ts +9 -0
- package/dist/src/api/AvailabilityAPI.js +12 -0
- package/dist/src/api/AvailabilityAPI.js.map +1 -1
- package/dist/src/components/generic/BookingWizard/BookingWizard.js.map +1 -1
- package/dist/src/components/generic/BookingWizard/BookingWizardContent.js +37 -0
- package/dist/src/components/generic/BookingWizard/BookingWizardContent.js.map +1 -1
- package/dist/src/components/generic/BookingWizard/BookingWizardContext.d.ts +1 -0
- package/dist/src/components/generic/BookingWizard/BookingWizardContext.js.map +1 -1
- package/dist/src/components/generic/BookingWizard/BookingWizardGuestSelector/BookingWizardGuestSelector.js +1 -1
- package/dist/src/components/generic/BookingWizard/BookingWizardGuestSelector/BookingWizardGuestSelector.js.map +1 -1
- package/dist/src/components/generic/BookingWizard/BookingWizardHotelSelector/BookingWizardHotelSelector.js +1 -0
- package/dist/src/components/generic/BookingWizard/BookingWizardHotelSelector/BookingWizardHotelSelector.js.map +1 -1
- package/dist/src/components/generic/BookingWizard/BookingWizardPromoCode/BookingWizardPromoCode.d.ts +8 -0
- package/dist/src/components/generic/BookingWizard/BookingWizardPromoCode/BookingWizardPromoCode.js +64 -0
- package/dist/src/components/generic/BookingWizard/BookingWizardPromoCode/BookingWizardPromoCode.js.map +1 -0
- package/dist/src/components/generic/PromoCodeInput.d.ts +1 -0
- package/dist/src/components/generic/PromoCodeInput.js +1 -1
- package/dist/src/components/generic/PromoCodeInput.js.map +1 -1
- package/dist/src/components/generic/Select/Select.js +1 -1
- package/dist/src/components/generic/Select/Select.js.map +1 -1
- package/dist/src/components/generic/TextBox.d.ts +1 -0
- package/dist/src/components/generic/TextBox.js +1 -1
- package/dist/src/components/generic/TextBox.js.map +1 -1
- package/dist/src/components/steps/confirmation/StepConfirmationAcknowledgement.d.ts +6 -3
- package/dist/src/components/steps/confirmation/StepConfirmationAcknowledgement.js +9 -19
- package/dist/src/components/steps/confirmation/StepConfirmationAcknowledgement.js.map +1 -1
- package/dist/src/components/steps/confirmation/StepConfirmationForm.js +28 -15
- package/dist/src/components/steps/confirmation/StepConfirmationForm.js.map +1 -1
- package/dist/src/contexts/ConfirmationStepContext/ConfirmationStepContextTypes.d.ts +1 -1
- package/dist/src/contexts/ConfirmationStepContext/ConfirmationStepContextTypes.js.map +1 -1
- package/dist/src/contexts/ConfirmationStepContext/ConfirmationStepContextWrapper.js +8 -9
- package/dist/src/contexts/ConfirmationStepContext/ConfirmationStepContextWrapper.js.map +1 -1
- package/dist/src/contexts/index.d.ts +22 -22
- package/dist/src/contexts/index.js +22 -22
- package/dist/src/contexts/index.js.map +1 -1
- package/dist/src/models/Confirmation.d.ts +0 -2
- package/dist/src/models/Confirmation.js.map +1 -1
- package/dist/src/pages/steps/StepConfirmation/StepConfirmationComponent.js +2 -1
- package/dist/src/pages/steps/StepConfirmation/StepConfirmationComponent.js.map +1 -1
- package/dist/test.bundle.js +1 -1
- package/package.json +1 -1
|
@@ -36,8 +36,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
36
36
|
};
|
|
37
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
38
|
exports.ConfirmationStepContextWrapper = void 0;
|
|
39
|
-
const react_1 =
|
|
40
|
-
const react_2 = require("react");
|
|
39
|
+
const react_1 = __importStar(require("react"));
|
|
41
40
|
const BookingAPI_1 = __importDefault(require("../../api/BookingAPI"));
|
|
42
41
|
const contexts_1 = require("../index.js");
|
|
43
42
|
const hooks_1 = require("../../hooks/index.js");
|
|
@@ -50,12 +49,12 @@ const ConfirmationStepContext_1 = require("./ConfirmationStepContext");
|
|
|
50
49
|
const ConfirmationStepContextProvider = ConfirmationStepContext_1.ConfirmationStepContext.Provider;
|
|
51
50
|
const ConfirmationStepContextWrapper = ({ children }) => {
|
|
52
51
|
const { queryPaymentMethod, queryRoomstayId: queryReservationId, queryPlanpayCheckoutId } = (0, ConfirmationQuery_1.useConfirmationQuery)();
|
|
53
|
-
const [isLoading, setIsLoading] = (0,
|
|
54
|
-
const [apiErrors, setApiErrors] = (0,
|
|
52
|
+
const [isLoading, setIsLoading] = (0, react_1.useState)(false);
|
|
53
|
+
const [apiErrors, setApiErrors] = (0, react_1.useState)('');
|
|
55
54
|
const methods = (0, react_hook_form_1.useForm)({
|
|
56
55
|
mode: 'onChange',
|
|
57
56
|
});
|
|
58
|
-
const basketContext = (0,
|
|
57
|
+
const basketContext = (0, react_1.useContext)(contexts_1.BasketContext);
|
|
59
58
|
const basketRows = basketContext.getAllValidRows();
|
|
60
59
|
const basketAddonRows = basketContext.basketAddonRows;
|
|
61
60
|
const { hotel } = (0, hooks_1.useCurrentHotel)();
|
|
@@ -99,7 +98,7 @@ const ConfirmationStepContextWrapper = ({ children }) => {
|
|
|
99
98
|
};
|
|
100
99
|
}
|
|
101
100
|
});
|
|
102
|
-
const onSubmit = (getPaymentDetails, preValidate, onPostValidationError, onSuccess) => (formValues) => __awaiter(void 0, void 0, void 0, function* () {
|
|
101
|
+
const onSubmit = (getPaymentDetails, comments, preValidate, onPostValidationError, onSuccess) => (formValues) => __awaiter(void 0, void 0, void 0, function* () {
|
|
103
102
|
var _a;
|
|
104
103
|
DataLayer_1.default.instance.sendInteraction('Complete Booking', DataLayer_1.InteractionType.BUTTON, DataLayer_1.InteractionStep.GUEST_DETAILS);
|
|
105
104
|
setIsLoading(true);
|
|
@@ -111,7 +110,7 @@ const ConfirmationStepContextWrapper = ({ children }) => {
|
|
|
111
110
|
}
|
|
112
111
|
const payment = yield getPaymentDetails();
|
|
113
112
|
try {
|
|
114
|
-
data = yield BookingAPI_1.default.Reservation.bookNow(basketRows, toUserProfiles(formValues), payment, basketAddonRows,
|
|
113
|
+
data = yield BookingAPI_1.default.Reservation.bookNow(basketRows, toUserProfiles(formValues), payment, basketAddonRows, comments || '', hotel === null || hotel === void 0 ? void 0 : hotel.hotelID);
|
|
115
114
|
basketContext.booked(data);
|
|
116
115
|
const validationResult = yield validateReservation(data);
|
|
117
116
|
if (validationResult) {
|
|
@@ -200,8 +199,8 @@ const ConfirmationStepContextWrapper = ({ children }) => {
|
|
|
200
199
|
}
|
|
201
200
|
});
|
|
202
201
|
const clearApiErrors = () => setApiErrors('');
|
|
203
|
-
const book = (getPaymentDetails, preValidate, onPostValidationError, onSuccess) => __awaiter(void 0, void 0, void 0, function* () {
|
|
204
|
-
yield methods.handleSubmit(onSubmit(getPaymentDetails, preValidate, onPostValidationError, onSuccess))();
|
|
202
|
+
const book = (getPaymentDetails, comments, preValidate, onPostValidationError, onSuccess) => __awaiter(void 0, void 0, void 0, function* () {
|
|
203
|
+
yield methods.handleSubmit(onSubmit(getPaymentDetails, comments, preValidate, onPostValidationError, onSuccess))();
|
|
205
204
|
});
|
|
206
205
|
return (react_1.default.createElement(react_hook_form_1.FormProvider, Object.assign({}, methods),
|
|
207
206
|
react_1.default.createElement(ConfirmationStepContextProvider, { value: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfirmationStepContextWrapper.js","sourceRoot":"/","sources":["src/contexts/ConfirmationStepContext/ConfirmationStepContextWrapper.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,iCAAoE;AAGpE,sEAAuC;AAEvC,iDAAiE;AACjE,2CAAkD;AAElD,wDAA0C;AAC1C,yCAAyC;AAEzC,qDAAwD;AACxD,kEAAmF;AACnF,iEAAiE;AACjE,uEAAoE;AAEpE,MAAM,+BAA+B,GAAG,iDAAuB,CAAC,QAAQ,CAAC;AAClE,MAAM,8BAA8B,GAA+B,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IACvF,MAAM,EAAE,kBAAkB,EAAE,eAAe,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,GAAG,IAAA,wCAA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gC,EAClC,EAAE;QACA,MAAM,OAAO,CAAC,YAAY,CAAC,QAAQ,CAAC,iBAAiB,EAAE,WAAW,EAAE,qBAAqB,EAAE,SAAS,CAAC,CAAC,EAAE,CAAC;IAC7G,CAAC,CAAA,CAAC;IAEF,OAAO,CACH,8BAAC,8BAAY,oBAAK,OAAO;QACrB,8BAAC,+BAA+B,IAC5B,KAAK,EAAE;gBACH,IAAI;gBACJ,iBAAiB;gBACjB,mBAAmB;gBAEnB,SAAS;gBACT,SAAS;gBACT,cAAc;gBACd,iBAAiB;aACpB,IAEA,QAAQ,CACqB,CACvB,CAClB,CAAC;AACN,CAAC,CAAC;AApLW,QAAA,8BAA8B,kCAoLzC","sourcesContent":["import React from 'react';\nimport { FC, PropsWithChildren, useContext, useState } from 'react';\nimport ReservationsDTO from '../../models/Api/ReservationsDTO';\nimport reservationsDTO, { ReservationDTO } from '../../models/Api/ReservationsDTO';\nimport API from '../../api/BookingAPI';\nimport UserProfile from '../../models/UserProfile';\nimport { BasketContext, ErrorHandler } from '@frontend/contexts';\nimport { useCurrentHotel } from '@frontend/hooks';\nimport BasketRowDifferences from '../../models/BasketRowDifferences';\nimport * as Sentry from '@sentry/browser';\nimport { Severity } from '@sentry/types';\nimport { ConfirmationFormValues, FBookGetPaymentDetails, FBookSuccessCallback, FBookValidateFunction, FBookValidationCallback, IBookValidationResult } from '@/models/Confirmation';\nimport { FormProvider, useForm } from 'react-hook-form';\nimport DataLayer, { InteractionStep, InteractionType } from '../../util/DataLayer';\nimport { useConfirmationQuery } from '@/hooks/ConfirmationQuery';\nimport { ConfirmationStepContext } from './ConfirmationStepContext';\n\nconst ConfirmationStepContextProvider = ConfirmationStepContext.Provider;\nexport const ConfirmationStepContextWrapper: FC<PropsWithChildren<any>> = ({ children }) => {\n const { queryPaymentMethod, queryRoomstayId: queryReservationId, queryPlanpayCheckoutId } = useConfirmationQuery();\n\n const [isLoading, setIsLoading] = useState<boolean>(false);\n const [apiErrors, setApiErrors] = useState<string>('');\n const methods = useForm<ConfirmationFormValues>({\n mode: 'onChange',\n });\n const basketContext = useContext(BasketContext);\n const basketRows = basketContext.getAllValidRows();\n const basketAddonRows = basketContext.basketAddonRows;\n const { hotel } = useCurrentHotel();\n\n const toUserProfiles = (formValues: ConfirmationFormValues): UserProfile[] => {\n return formValues.userProfiles.map((values) => ({\n FirstName: values.Forename,\n LastName: values.Surname,\n Phone: values.Phone.replace(' ', ''),\n Email: values.Email,\n Address: {\n Line1: values.Address,\n City: values.City,\n PostalCode: values.PostCode,\n Country: values.Country,\n },\n MarketingOptIn: false,\n }));\n };\n\n const validateReservation = async (data: reservationsDTO): Promise<IBookValidationResult | undefined> => {\n const apiDifferences: BasketRowDifferences[] = [];\n if (data.reservations) {\n data.reservations.forEach((reservation: ReservationDTO, index) => {\n const diff = basketContext.currentBasketRows[index].checkDiffFromReservation(reservation);\n\n if (diff) {\n apiDifferences.push(diff);\n }\n });\n } else {\n Sentry.addBreadcrumb({\n level: Severity.Error,\n message: 'No reservation data: ' + JSON.stringify(data),\n });\n throw new Error('The reservation could not be completed due to an unexpected issue, please try again');\n }\n\n // If there are differences, we want to display them to make sure the booking still needs to proceed\n if (apiDifferences.length || (data.warnings && data.warnings.length)) {\n return {\n differences: apiDifferences,\n warnings: data.warnings as string[],\n };\n }\n };\n\n const onSubmit =\n (getPaymentDetails: FBookGetPaymentDetails, preValidate?: FBookValidateFunction, onPostValidationError?: FBookValidationCallback, onSuccess?: FBookSuccessCallback) =>\n async (formValues: ConfirmationFormValues): Promise<void> => {\n DataLayer.instance.sendInteraction('Complete Booking', InteractionType.BUTTON, InteractionStep.GUEST_DETAILS);\n setIsLoading(true);\n let data: ReservationsDTO | undefined;\n const validateResult = !preValidate || (await preValidate());\n if (!validateResult) {\n setIsLoading(false);\n return;\n }\n\n const payment = await getPaymentDetails();\n\n try {\n data = await API.Reservation.bookNow(basketRows, toUserProfiles(formValues), payment, basketAddonRows, formValues.comment || '', hotel?.hotelID as string);\n basketContext.booked(data);\n const validationResult = await validateReservation(data);\n if (validationResult) {\n setIsLoading(false);\n onPostValidationError?.(validationResult);\n } else onSuccess?.(data);\n } catch (error: any) {\n console.log(error);\n setApiErrors(error?.Message ?? 'Unexpected error returned from the booking database.');\n // We don't want to stop the isLoading on a succesful flow to avoid clicking checkout twice\n setIsLoading(false);\n }\n };\n\n const isBackFromPlanpay = !!queryPlanpayCheckoutId && !!queryReservationId && !!queryPaymentMethod;\n\n const parseReservationIdsFromData = (data: ReservationsDTO) => {\n return data?.reservations?.map((reservation) => reservation.reservationNumber);\n };\n\n const commitReservation = async (resData: ReservationsDTO) => {\n try {\n setIsLoading(true);\n if (resData) {\n const reservationIds = parseReservationIdsFromData(resData);\n if (reservationIds.length) {\n try {\n API.Reservation.commit(reservationIds, resData.itineraryNumber, hotel?.hotelID as string, queryPlanpayCheckoutId || undefined)\n .then((response: ReservationsDTO) => {\n try {\n DataLayer.instance.sendReservationConfirmed(basketContext.getAllValidRows(), basketContext.basketAddonRows, response);\n } catch (ex) {\n Sentry.captureException('Failed to read reservations from GTM code: ' + JSON.stringify(ex));\n }\n basketContext.checkedOut(response);\n })\n .catch((ex: any) => {\n console.log(ex);\n setApiErrors('Unexpected error');\n })\n .finally(() => {\n setIsLoading(false);\n });\n } catch (error: any) {\n setApiErrors(error?.Message ?? 'Unexpected error returned from the booking database.');\n }\n } else {\n setApiErrors('Committing reservation failed due to an unexpected error');\n ErrorHandler.add({ message: 'Committing reservation failed due to an unexpected error' });\n Sentry.captureException('No reservation IDs found when attempting to commit: ' + JSON.stringify(resData));\n }\n }\n } catch (ex) {\n setApiErrors('Failed to commit reservation');\n console.log('Failed to commit reservation ');\n console.error(ex);\n Sentry.captureException(ex);\n }\n };\n\n const rollbackReservation = async () => {\n if (!basketContext.reservationData) return;\n try {\n const reservationIds = parseReservationIdsFromData(basketContext.reservationData);\n if (reservationIds.length) {\n setIsLoading(true);\n await API.Reservation.rollback(reservationIds, basketContext.reservationData.itineraryNumber, hotel?.hotelID as string);\n } else {\n Sentry.captureException('No reservation IDs found when attempting to rollback: ' + JSON.stringify(basketContext.reservationData));\n }\n } catch (ex) {\n console.log('Failed to rollback reservations');\n Sentry.captureException(ex);\n } finally {\n basketContext.rollback();\n setIsLoading(false);\n }\n };\n\n const clearApiErrors = () => setApiErrors('');\n\n const book = async (\n getPaymentDetails: FBookGetPaymentDetails,\n preValidate?: FBookValidateFunction,\n onPostValidationError?: FBookValidationCallback,\n onSuccess?: FBookSuccessCallback\n ) => {\n await methods.handleSubmit(onSubmit(getPaymentDetails, preValidate, onPostValidationError, onSuccess))();\n };\n\n return (\n <FormProvider {...methods}>\n <ConfirmationStepContextProvider\n value={{\n book,\n commitReservation,\n rollbackReservation,\n\n isLoading,\n apiErrors,\n clearApiErrors,\n isBackFromPlanpay,\n }}\n >\n {children}\n </ConfirmationStepContextProvider>\n </FormProvider>\n );\n};\n"]}
|
|
1
|
+
{"version":3,"file":"ConfirmationStepContextWrapper.js","sourceRoot":"/","sources":["src/contexts/ConfirmationStepContext/ConfirmationStepContextWrapper.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA2E;AAG3E,sEAAuC;AAEvC,iDAAiE;AACjE,2CAAkD;AAElD,wDAA0C;AAC1C,yCAAyC;AAEzC,qDAAwD;AACxD,kEAAmF;AACnF,iEAAiE;AACjE,uEAAoE;AAEpE,MAAM,+BAA+B,GAAG,iDAAuB,CAAC,QAAQ,CAAC;AAClE,MAAM,8BAA8B,GAA+B,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IACvF,MAAM,EAAE,kBAAkB,EAAE,eAAe,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,GAAG,IAAA,wCAAoB,GAAE,CAAC;IAEnH,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,IAAA,gBAAQ,EAAU,KAAK,CAAC,CAAC;IAC3D,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,IAAA,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AAC;IACvH,CAAC,CAAA,CAAC;IAEF,OAAO,CACH,8BAAC,8BAAY,oBAAK,OAAO;QACrB,8BAAC,+BAA+B,IAC5B,KAAK,EAAE;gBACH,IAAI;gBACJ,iBAAiB;gBACjB,mBAAmB;gBAEnB,SAAS;gBACT,SAAS;gBACT,cAAc;gBACd,iBAAiB;aACpB,IAEA,QAAQ,CACqB,CACvB,CAClB,CAAC;AACN,CAAC,CAAC;AA3LW,QAAA,8BAA8B,kCA2LzC","sourcesContent":["import React, { FC, PropsWithChildren, useContext, useState } from 'react';\nimport ReservationsDTO from '../../models/Api/ReservationsDTO';\nimport reservationsDTO, { ReservationDTO } from '../../models/Api/ReservationsDTO';\nimport API from '../../api/BookingAPI';\nimport UserProfile from '../../models/UserProfile';\nimport { BasketContext, ErrorHandler } from '@frontend/contexts';\nimport { useCurrentHotel } from '@frontend/hooks';\nimport BasketRowDifferences from '../../models/BasketRowDifferences';\nimport * as Sentry from '@sentry/browser';\nimport { Severity } from '@sentry/types';\nimport { ConfirmationFormValues, FBookGetPaymentDetails, FBookSuccessCallback, FBookValidateFunction, FBookValidationCallback, IBookValidationResult } from '@/models/Confirmation';\nimport { FormProvider, useForm } from 'react-hook-form';\nimport DataLayer, { InteractionStep, InteractionType } from '../../util/DataLayer';\nimport { useConfirmationQuery } from '@/hooks/ConfirmationQuery';\nimport { ConfirmationStepContext } from './ConfirmationStepContext';\n\nconst ConfirmationStepContextProvider = ConfirmationStepContext.Provider;\nexport const ConfirmationStepContextWrapper: FC<PropsWithChildren<any>> = ({ children }) => {\n const { queryPaymentMethod, queryRoomstayId: queryReservationId, queryPlanpayCheckoutId } = useConfirmationQuery();\n\n const [isLoading, setIsLoading] = useState<boolean>(false);\n const [apiErrors, setApiErrors] = useState<string>('');\n const methods = useForm<ConfirmationFormValues>({\n mode: 'onChange',\n });\n const basketContext = useContext(BasketContext);\n const basketRows = basketContext.getAllValidRows();\n const basketAddonRows = basketContext.basketAddonRows;\n const { hotel } = useCurrentHotel();\n\n const toUserProfiles = (formValues: ConfirmationFormValues): UserProfile[] => {\n return formValues.userProfiles.map((values) => ({\n FirstName: values.Forename,\n LastName: values.Surname,\n Phone: values.Phone.replace(' ', ''),\n Email: values.Email,\n Address: {\n Line1: values.Address,\n City: values.City,\n PostalCode: values.PostCode,\n Country: values.Country,\n },\n MarketingOptIn: false,\n }));\n };\n\n const validateReservation = async (data: reservationsDTO): Promise<IBookValidationResult | undefined> => {\n const apiDifferences: BasketRowDifferences[] = [];\n if (data.reservations) {\n data.reservations.forEach((reservation: ReservationDTO, index) => {\n const diff = basketContext.currentBasketRows[index].checkDiffFromReservation(reservation);\n\n if (diff) {\n apiDifferences.push(diff);\n }\n });\n } else {\n Sentry.addBreadcrumb({\n level: Severity.Error,\n message: 'No reservation data: ' + JSON.stringify(data),\n });\n throw new Error('The reservation could not be completed due to an unexpected issue, please try again');\n }\n\n // If there are differences, we want to display them to make sure the booking still needs to proceed\n if (apiDifferences.length || (data.warnings && data.warnings.length)) {\n return {\n differences: apiDifferences,\n warnings: data.warnings as string[],\n };\n }\n };\n\n const onSubmit =\n (\n getPaymentDetails: FBookGetPaymentDetails,\n comments?: string,\n preValidate?: FBookValidateFunction,\n onPostValidationError?: FBookValidationCallback,\n onSuccess?: FBookSuccessCallback\n ) =>\n async (formValues: ConfirmationFormValues): Promise<void> => {\n DataLayer.instance.sendInteraction('Complete Booking', InteractionType.BUTTON, InteractionStep.GUEST_DETAILS);\n setIsLoading(true);\n let data: ReservationsDTO | undefined;\n const validateResult = !preValidate || (await preValidate());\n if (!validateResult) {\n setIsLoading(false);\n return;\n }\n\n const payment = await getPaymentDetails();\n\n try {\n data = await API.Reservation.bookNow(basketRows, toUserProfiles(formValues), payment, basketAddonRows, comments || '', hotel?.hotelID as string);\n basketContext.booked(data);\n const validationResult = await validateReservation(data);\n if (validationResult) {\n setIsLoading(false);\n onPostValidationError?.(validationResult);\n } else onSuccess?.(data);\n } catch (error: any) {\n console.log(error);\n setApiErrors(error?.Message ?? 'Unexpected error returned from the booking database.');\n // We don't want to stop the isLoading on a succesful flow to avoid clicking checkout twice\n setIsLoading(false);\n }\n };\n\n const isBackFromPlanpay = !!queryPlanpayCheckoutId && !!queryReservationId && !!queryPaymentMethod;\n\n const parseReservationIdsFromData = (data: ReservationsDTO) => {\n return data?.reservations?.map((reservation) => reservation.reservationNumber);\n };\n\n const commitReservation = async (resData: ReservationsDTO) => {\n try {\n setIsLoading(true);\n if (resData) {\n const reservationIds = parseReservationIdsFromData(resData);\n if (reservationIds.length) {\n try {\n API.Reservation.commit(reservationIds, resData.itineraryNumber, hotel?.hotelID as string, queryPlanpayCheckoutId || undefined)\n .then((response: ReservationsDTO) => {\n try {\n DataLayer.instance.sendReservationConfirmed(basketContext.getAllValidRows(), basketContext.basketAddonRows, response);\n } catch (ex) {\n Sentry.captureException('Failed to read reservations from GTM code: ' + JSON.stringify(ex));\n }\n basketContext.checkedOut(response);\n })\n .catch((ex: any) => {\n console.log(ex);\n setApiErrors('Unexpected error');\n })\n .finally(() => {\n setIsLoading(false);\n });\n } catch (error: any) {\n setApiErrors(error?.Message ?? 'Unexpected error returned from the booking database.');\n }\n } else {\n setApiErrors('Committing reservation failed due to an unexpected error');\n ErrorHandler.add({ message: 'Committing reservation failed due to an unexpected error' });\n Sentry.captureException('No reservation IDs found when attempting to commit: ' + JSON.stringify(resData));\n }\n }\n } catch (ex) {\n setApiErrors('Failed to commit reservation');\n console.log('Failed to commit reservation ');\n console.error(ex);\n Sentry.captureException(ex);\n }\n };\n\n const rollbackReservation = async () => {\n if (!basketContext.reservationData) return;\n try {\n const reservationIds = parseReservationIdsFromData(basketContext.reservationData);\n if (reservationIds.length) {\n setIsLoading(true);\n await API.Reservation.rollback(reservationIds, basketContext.reservationData.itineraryNumber, hotel?.hotelID as string);\n } else {\n Sentry.captureException('No reservation IDs found when attempting to rollback: ' + JSON.stringify(basketContext.reservationData));\n }\n } catch (ex) {\n console.log('Failed to rollback reservations');\n Sentry.captureException(ex);\n } finally {\n basketContext.rollback();\n setIsLoading(false);\n }\n };\n\n const clearApiErrors = () => setApiErrors('');\n\n const book = async (\n getPaymentDetails: FBookGetPaymentDetails,\n comments?: string,\n preValidate?: FBookValidateFunction,\n onPostValidationError?: FBookValidationCallback,\n onSuccess?: FBookSuccessCallback\n ) => {\n await methods.handleSubmit(onSubmit(getPaymentDetails, comments, preValidate, onPostValidationError, onSuccess))();\n };\n\n return (\n <FormProvider {...methods}>\n <ConfirmationStepContextProvider\n value={{\n book,\n commitReservation,\n rollbackReservation,\n\n isLoading,\n apiErrors,\n clearApiErrors,\n isBackFromPlanpay,\n }}\n >\n {children}\n </ConfirmationStepContextProvider>\n </FormProvider>\n );\n};\n"]}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
export * from '
|
|
2
|
-
export * from '
|
|
3
|
-
export * from '
|
|
4
|
-
export * from '
|
|
5
|
-
export * from '
|
|
6
|
-
export * from '
|
|
7
|
-
export * from '
|
|
8
|
-
export * from '
|
|
9
|
-
export * from '
|
|
10
|
-
export * from '
|
|
11
|
-
export * from '
|
|
12
|
-
export * from '
|
|
13
|
-
export * from '
|
|
14
|
-
export * from '
|
|
15
|
-
export * from '
|
|
16
|
-
export * from '
|
|
17
|
-
export * from '
|
|
18
|
-
export * from '
|
|
19
|
-
export * from '
|
|
20
|
-
export * from '
|
|
21
|
-
export * from '
|
|
22
|
-
export * from '
|
|
1
|
+
export * from './BasketContext/BasketContext';
|
|
2
|
+
export * from './BasketContext/BasketContextWrapper';
|
|
3
|
+
export * from './BasketContext/BasketContextType';
|
|
4
|
+
export * from './BookingEngineContext/BookingEngineContextType.types';
|
|
5
|
+
export * from './BookingEngineContext/BookingEngineContextWrapper';
|
|
6
|
+
export * from './BookingEngineContext/BookingEngineContext';
|
|
7
|
+
export * from './CompanyContext/CompanyContextType.type';
|
|
8
|
+
export * from './CompanyContext/CompanyContextWrapper';
|
|
9
|
+
export * from './CompanyContext/CompanyContext';
|
|
10
|
+
export * from './Members/AuthenticationContext/AuthenticationContext';
|
|
11
|
+
export * from './Members/AuthenticationContext/AuthenticationContextProvider';
|
|
12
|
+
export * from './Members/RoomstayMemberContext/RoomstayMemberContext';
|
|
13
|
+
export * from './Members/RoomstayMemberContext/RoomstayMemberContextProvider';
|
|
14
|
+
export * from './ConfirmationFormContext';
|
|
15
|
+
export * from './DatePickerContext';
|
|
16
|
+
export * from './ErrorContext';
|
|
17
|
+
export * from './FullPageEngineContext/FullPageEngineContext';
|
|
18
|
+
export * from './FullPageEngineContext/FullPageEngineContextTypes';
|
|
19
|
+
export * from './FullPageEngineContext/FullPageEngineContextWrapper';
|
|
20
|
+
export * from './HotelOverridesContext';
|
|
21
|
+
export * from './ModalContext';
|
|
22
|
+
export * from './NotificationContext';
|
|
@@ -14,26 +14,26 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("
|
|
18
|
-
__exportStar(require("
|
|
19
|
-
__exportStar(require("
|
|
20
|
-
__exportStar(require("
|
|
21
|
-
__exportStar(require("
|
|
22
|
-
__exportStar(require("
|
|
23
|
-
__exportStar(require("
|
|
24
|
-
__exportStar(require("
|
|
25
|
-
__exportStar(require("
|
|
26
|
-
__exportStar(require("
|
|
27
|
-
__exportStar(require("
|
|
28
|
-
__exportStar(require("
|
|
29
|
-
__exportStar(require("
|
|
30
|
-
__exportStar(require("
|
|
31
|
-
__exportStar(require("
|
|
32
|
-
__exportStar(require("
|
|
33
|
-
__exportStar(require("
|
|
34
|
-
__exportStar(require("
|
|
35
|
-
__exportStar(require("
|
|
36
|
-
__exportStar(require("
|
|
37
|
-
__exportStar(require("
|
|
38
|
-
__exportStar(require("
|
|
17
|
+
__exportStar(require("./BasketContext/BasketContext"), exports);
|
|
18
|
+
__exportStar(require("./BasketContext/BasketContextWrapper"), exports);
|
|
19
|
+
__exportStar(require("./BasketContext/BasketContextType"), exports);
|
|
20
|
+
__exportStar(require("./BookingEngineContext/BookingEngineContextType.types"), exports);
|
|
21
|
+
__exportStar(require("./BookingEngineContext/BookingEngineContextWrapper"), exports);
|
|
22
|
+
__exportStar(require("./BookingEngineContext/BookingEngineContext"), exports);
|
|
23
|
+
__exportStar(require("./CompanyContext/CompanyContextType.type"), exports);
|
|
24
|
+
__exportStar(require("./CompanyContext/CompanyContextWrapper"), exports);
|
|
25
|
+
__exportStar(require("./CompanyContext/CompanyContext"), exports);
|
|
26
|
+
__exportStar(require("./Members/AuthenticationContext/AuthenticationContext"), exports);
|
|
27
|
+
__exportStar(require("./Members/AuthenticationContext/AuthenticationContextProvider"), exports);
|
|
28
|
+
__exportStar(require("./Members/RoomstayMemberContext/RoomstayMemberContext"), exports);
|
|
29
|
+
__exportStar(require("./Members/RoomstayMemberContext/RoomstayMemberContextProvider"), exports);
|
|
30
|
+
__exportStar(require("./ConfirmationFormContext"), exports);
|
|
31
|
+
__exportStar(require("./DatePickerContext"), exports);
|
|
32
|
+
__exportStar(require("./ErrorContext"), exports);
|
|
33
|
+
__exportStar(require("./FullPageEngineContext/FullPageEngineContext"), exports);
|
|
34
|
+
__exportStar(require("./FullPageEngineContext/FullPageEngineContextTypes"), exports);
|
|
35
|
+
__exportStar(require("./FullPageEngineContext/FullPageEngineContextWrapper"), exports);
|
|
36
|
+
__exportStar(require("./HotelOverridesContext"), exports);
|
|
37
|
+
__exportStar(require("./ModalContext"), exports);
|
|
38
|
+
__exportStar(require("./NotificationContext"), exports);
|
|
39
39
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"/","sources":["src/contexts/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["src/contexts/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yEAAuD;AACvD,gFAA8D;AAC9D,6EAA2D;AAE3D,iGAA+E;AAC/E,8FAA4E;AAC5E,uFAAqE;AAErE,oFAAkE;AAClE,kFAAgE;AAChE,2EAAyD;AAEzD,iGAA+E;AAC/E,yGAAuF;AACvF,iGAA+E;AAC/E,yGAAuF;AAEvF,qEAAmD;AACnD,+DAA6C;AAC7C,0DAAwC;AAExC,yFAAuE;AACvE,8FAA4E;AAC5E,gGAA8E;AAE9E,mEAAiD;AACjD,0DAAwC;AACxC,iEAA+C","sourcesContent":["export * from '@/contexts/BasketContext/BasketContext';\nexport * from '@/contexts/BasketContext/BasketContextWrapper';\nexport * from '@/contexts/BasketContext/BasketContextType';\n\nexport * from '@/contexts/BookingEngineContext/BookingEngineContextType.types';\nexport * from '@/contexts/BookingEngineContext/BookingEngineContextWrapper';\nexport * from '@/contexts/BookingEngineContext/BookingEngineContext';\n\nexport * from '@/contexts/CompanyContext/CompanyContextType.type';\nexport * from '@/contexts/CompanyContext/CompanyContextWrapper';\nexport * from '@/contexts/CompanyContext/CompanyContext';\n\nexport * from '@/contexts/Members/AuthenticationContext/AuthenticationContext';\nexport * from '@/contexts/Members/AuthenticationContext/AuthenticationContextProvider';\nexport * from '@/contexts/Members/RoomstayMemberContext/RoomstayMemberContext';\nexport * from '@/contexts/Members/RoomstayMemberContext/RoomstayMemberContextProvider';\n\nexport * from '@/contexts/ConfirmationFormContext';\nexport * from '@/contexts/DatePickerContext';\nexport * from '@/contexts/ErrorContext';\n\nexport * from '@/contexts/FullPageEngineContext/FullPageEngineContext';\nexport * from '@/contexts/FullPageEngineContext/FullPageEngineContextTypes';\nexport * from '@/contexts/FullPageEngineContext/FullPageEngineContextWrapper';\n\nexport * from '@/contexts/HotelOverridesContext';\nexport * from '@/contexts/ModalContext';\nexport * from '@/contexts/NotificationContext';\n"]}
|
|
@@ -15,8 +15,6 @@ export type TUserProfileFormValues = {
|
|
|
15
15
|
[userProfileKey in EUserProfileFormKey]: string;
|
|
16
16
|
};
|
|
17
17
|
export interface ConfirmationFormValues {
|
|
18
|
-
isPolicyConfirmed?: boolean;
|
|
19
|
-
comment?: string;
|
|
20
18
|
IATANumber?: string;
|
|
21
19
|
userProfiles: TUserProfileFormValues[];
|
|
22
20
|
copyCheckBox?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Confirmation.js","sourceRoot":"/","sources":["src/models/Confirmation.ts"],"names":[],"mappings":";;;AAIA,IAAY,mBASX;AATD,WAAY,mBAAmB;IAC3B,4CAAqB,CAAA;IACrB,0CAAmB,CAAA;IACnB,sCAAe,CAAA;IACf,sCAAe,CAAA;IACf,0CAAmB,CAAA;IACnB,oCAAa,CAAA;IACb,4CAAqB,CAAA;IACrB,0CAAmB,CAAA;AACvB,CAAC,EATW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAS9B","sourcesContent":["import BasketRowDifferences from './BasketRowDifferences';\nimport ReservationsDTO from './Api/ReservationsDTO';\nimport { EBookingPaymentMethod, IBookingPayment } from '@roomstay/core';\n\nexport enum EUserProfileFormKey {\n Forename = 'Forename',\n Surname = 'Surname',\n Email = 'Email',\n Phone = 'Phone',\n Address = 'Address',\n City = 'City',\n PostCode = 'PostCode',\n Country = 'Country',\n}\n\nexport type TUserProfileFormValues = {\n [userProfileKey in EUserProfileFormKey]: string;\n};\n\nexport interface ConfirmationFormValues {\n
|
|
1
|
+
{"version":3,"file":"Confirmation.js","sourceRoot":"/","sources":["src/models/Confirmation.ts"],"names":[],"mappings":";;;AAIA,IAAY,mBASX;AATD,WAAY,mBAAmB;IAC3B,4CAAqB,CAAA;IACrB,0CAAmB,CAAA;IACnB,sCAAe,CAAA;IACf,sCAAe,CAAA;IACf,0CAAmB,CAAA;IACnB,oCAAa,CAAA;IACb,4CAAqB,CAAA;IACrB,0CAAmB,CAAA;AACvB,CAAC,EATW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAS9B","sourcesContent":["import BasketRowDifferences from './BasketRowDifferences';\nimport ReservationsDTO from './Api/ReservationsDTO';\nimport { EBookingPaymentMethod, IBookingPayment } from '@roomstay/core';\n\nexport enum EUserProfileFormKey {\n Forename = 'Forename',\n Surname = 'Surname',\n Email = 'Email',\n Phone = 'Phone',\n Address = 'Address',\n City = 'City',\n PostCode = 'PostCode',\n Country = 'Country',\n}\n\nexport type TUserProfileFormValues = {\n [userProfileKey in EUserProfileFormKey]: string;\n};\n\nexport interface ConfirmationFormValues {\n IATANumber?: string;\n userProfiles: TUserProfileFormValues[];\n copyCheckBox?: boolean;\n paymentMethod: EBookingPaymentMethod;\n}\n\nexport interface IBookValidationResult {\n differences: BasketRowDifferences[];\n warnings: string[];\n}\n\nexport type FBookValidationCallback = (validationResult?: IBookValidationResult) => void;\nexport type FBookSuccessCallback = (data: ReservationsDTO) => void;\nexport type FBookValidateFunction = () => Promise<boolean>;\nexport type FBookGetPaymentDetails = () => Promise<IBookingPayment>;\n"]}
|
|
@@ -76,7 +76,8 @@ function StepConfirmationComponent() {
|
|
|
76
76
|
react_1.default.createElement(StepLayout_1.StepLayoutLeftContent, null,
|
|
77
77
|
react_1.default.createElement("div", { className: "block-container" },
|
|
78
78
|
!InlineAddonStepFeature_1.default.isActive() && react_1.default.createElement(AdditionalOffers_1.default, null),
|
|
79
|
-
react_1.default.createElement(
|
|
79
|
+
react_1.default.createElement(contexts_1.ConfirmationFormContextWrapper, null,
|
|
80
|
+
react_1.default.createElement(StepConfirmationFormProvider_1.default, null)))),
|
|
80
81
|
context.screenSize > ScreenSize_1.default.Medium && (react_1.default.createElement(StepLayout_1.StepLayoutRightContent, null,
|
|
81
82
|
react_1.default.createElement(StepConfirmationLimitedOffer_1.default, { endDate: (0, dayjs_1.default)().add(10, 'minute') }),
|
|
82
83
|
react_1.default.createElement(BESummary_1.BESummary, { showImages: true }))))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepConfirmationComponent.js","sourceRoot":"/","sources":["src/pages/steps/StepConfirmation/StepConfirmationComponent.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAqD;AACrD,6EAAqD;AACrD,qEAA6C;AAC7C,8DAA2D;AAC3D,uDAAwC;AACxC,+EAAuD;AACvD,iFAAyD;AACzD,0DAAuD;AACvD,2FAAmE;AAEnE,mEAA2C;AAE3C,wGAAgF;AAChF,iDAA+C;AAC/C,yHAAiG;AACjG,gIAAwG;AACxG,kDAA0B;AAC1B,0GAAkF;AAClF,wGAAgF;AAChF,iDAA6C;AAC7C,6CAAyD;AACzD,
|
|
1
|
+
{"version":3,"file":"StepConfirmationComponent.js","sourceRoot":"/","sources":["src/pages/steps/StepConfirmation/StepConfirmationComponent.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAqD;AACrD,6EAAqD;AACrD,qEAA6C;AAC7C,8DAA2D;AAC3D,uDAAwC;AACxC,+EAAuD;AACvD,iFAAyD;AACzD,0DAAuD;AACvD,2FAAmE;AAEnE,mEAA2C;AAE3C,wGAAgF;AAChF,iDAA+C;AAC/C,yHAAiG;AACjG,gIAAwG;AACxG,kDAA0B;AAC1B,0GAAkF;AAClF,wGAAgF;AAChF,iDAA6C;AAC7C,6CAAyD;AACzD,iDAAgI;AAChI,uIAA+G;AAC/G,uEAA4H;AAE5H,SAAS,yBAAyB;IAC9B,MAAM,OAAO,GAAG,IAAA,kBAAU,EAAC,+BAAoB,CAAC,CAAC;IACjD,MAAM,EAAE,WAAW,EAAE,GAAG,IAAA,kBAAU,EAAC,gCAAqB,CAAC,CAAC;IAC1D,MAAM,EAAE,iBAAiB,EAAE,GAAG,IAAA,kBAAU,EAAC,wBAAa,CAAC,CAAC;IAExD,MAAM,EAAE,CAAC,EAAE,GAAG,IAAA,8BAAc,GAAE,CAAC;IAE/B,MAAM,EAAE,KAAK,EAAE,GAAG,IAAA,oBAAQ,GAAE,CAAC;IAE7B,IAAA,iBAAS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,8BAAC,qBAAS,IAAC,UAAU,SAAG,CACH,CAC5B,CACiB,CACpB,CACT,CAAC;AACN,CAAC;AAED,kBAAe,yBAAyB,CAAC","sourcesContent":["import React, { useContext, useEffect } from 'react';\nimport Headline from '@/components/generic/Headline';\nimport StepManager from '@/util/StepManager';\nimport { BESummary } from '@/components/summary/BESummary';\nimport { Link } from 'react-router-dom';\nimport LineBreak from '@/components/generic/LineBreak';\nimport BackButton from '@/components/generic/BackButton';\nimport { Translation } from 'translations/Translation';\nimport BEMobileSummary from '@/components/summary/BEMobileSummary';\n\nimport ScreenSize from '@/util/ScreenSize';\n\nimport StepRoomHotelDetails from '@/components/steps/room/StepRoomHotelDetails';\nimport { useTranslation } from 'react-i18next';\nimport AdditionalOffers from '@/components/steps/confirmation/additionalOffers/AdditionalOffers';\nimport StepConfirmationLimitedOffer from '@/components/steps/confirmation/StepConfirmationLimitedOffer';\nimport dayjs from 'dayjs';\nimport StepRoomBestRateAlert from '@/components/steps/room/StepRoomBestRateAlert';\nimport InlineAddonStepFeature from '@/providers/feature/InlineAddonStepFeature';\nimport { useEvent } from '@/hooks/EventHook';\nimport { StepCheckoutViewEvent } from '@frontend/events';\nimport { BasketContext, BookingEngineContext, ConfirmationFormContextWrapper, FullPageEngineContext } from '@frontend/contexts';\nimport StepConfirmationFormProvider from '../../../components/steps/confirmation/StepConfirmationFormProvider';\nimport { StepLayoutContainer, StepLayoutLeftContent, StepLayoutRightContent } from '@/components/generic/Layout/StepLayout';\n\nfunction StepConfirmationComponent() {\n const context = useContext(BookingEngineContext);\n const { currentStep } = useContext(FullPageEngineContext);\n const { currentBasketRows } = useContext(BasketContext);\n\n const { t } = useTranslation();\n\n const { raise } = useEvent();\n\n useEffect(() => {\n const event = new StepCheckoutViewEvent(currentBasketRows);\n raise(event);\n }, []);\n\n return (\n <div className=\"container\">\n <BEMobileSummary />\n <StepLayoutContainer>\n <StepLayoutLeftContent>\n {context.screenSize > ScreenSize.Medium && (\n <>\n <Link to={StepManager.getPreviousStepUrl(currentStep)}>\n <BackButton />\n </Link>\n <div className=\"u-marg-top--light u-marg-bottom--heavy\">\n <Headline bold>{t(Translation.Navigation.Steps.Confirmation)}</Headline>\n </div>\n </>\n )}\n\n <div className=\"u-marg-top@m-\">\n <StepRoomBestRateAlert />\n </div>\n </StepLayoutLeftContent>\n {context.screenSize > ScreenSize.Medium && (\n <StepLayoutRightContent>\n <StepRoomHotelDetails />\n </StepLayoutRightContent>\n )}\n </StepLayoutContainer>\n <LineBreak />\n <StepLayoutContainer>\n <StepLayoutLeftContent>\n <div className=\"block-container\">\n {!InlineAddonStepFeature.isActive() && <AdditionalOffers />}\n <ConfirmationFormContextWrapper>\n <StepConfirmationFormProvider />\n </ConfirmationFormContextWrapper>\n </div>\n </StepLayoutLeftContent>\n\n {context.screenSize > ScreenSize.Medium && (\n <StepLayoutRightContent>\n <StepConfirmationLimitedOffer endDate={dayjs().add(10, 'minute')} />\n <BESummary showImages />\n </StepLayoutRightContent>\n )}\n </StepLayoutContainer>\n </div>\n );\n}\n\nexport default StepConfirmationComponent;\n"]}
|