@qite/tide-booking-component 0.0.2-preview.8 → 1.0.0-preview
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/README.md +1 -0
- package/build/build-cjs/booking-wizard/components/icon.d.ts +7 -7
- package/build/build-cjs/booking-wizard/components/labeled-input.d.ts +18 -18
- package/build/build-cjs/booking-wizard/components/labeled-select.d.ts +21 -21
- package/build/build-cjs/booking-wizard/components/message.d.ts +9 -8
- package/build/build-cjs/booking-wizard/components/product-card.d.ts +8 -9
- package/build/build-cjs/booking-wizard/components/rating.d.ts +6 -6
- package/build/build-cjs/booking-wizard/components/step-indicator.d.ts +6 -6
- package/build/build-cjs/booking-wizard/components/step-route.d.ts +9 -9
- package/build/build-cjs/booking-wizard/features/booking/api.d.ts +21 -0
- package/build/build-cjs/booking-wizard/features/booking/booking-slice.d.ts +124 -18
- package/build/build-cjs/booking-wizard/features/booking/booking.d.ts +8 -9
- package/build/build-cjs/booking-wizard/features/booking/selectors.d.ts +208 -0
- package/build/build-cjs/booking-wizard/features/confirmation/confirmation.d.ts +4 -5
- package/build/build-cjs/booking-wizard/features/error/error.d.ts +4 -5
- package/build/build-cjs/booking-wizard/features/price-details/price-details-api.d.ts +12 -6
- package/build/build-cjs/booking-wizard/features/price-details/price-details-slice.d.ts +105 -10
- package/build/build-cjs/booking-wizard/features/price-details/util.d.ts +5 -0
- package/build/build-cjs/booking-wizard/features/product-options/no-options.d.ts +2 -0
- package/build/build-cjs/booking-wizard/features/product-options/none-option.d.ts +17 -0
- package/build/build-cjs/booking-wizard/features/product-options/option-booking-group.d.ts +18 -0
- package/build/build-cjs/booking-wizard/features/product-options/option-item.d.ts +11 -0
- package/build/build-cjs/booking-wizard/features/product-options/option-pax-card.d.ts +9 -0
- package/build/build-cjs/booking-wizard/features/product-options/option-pax-group.d.ts +20 -0
- package/build/build-cjs/booking-wizard/features/product-options/option-room.d.ts +16 -0
- package/build/build-cjs/booking-wizard/features/product-options/option-unit-group.d.ts +20 -0
- package/build/build-cjs/booking-wizard/features/product-options/option-units-card.d.ts +9 -0
- package/build/build-cjs/booking-wizard/features/product-options/options-form.d.ts +4 -5
- package/build/build-cjs/booking-wizard/features/product-options/validate-form.d.ts +2 -2
- package/build/build-cjs/booking-wizard/features/sidebar/index.d.ts +7 -3
- package/build/build-cjs/booking-wizard/features/sidebar/sidebar-flight.d.ts +8 -0
- package/build/build-cjs/booking-wizard/features/sidebar/sidebar-util.d.ts +28 -4
- package/build/build-cjs/booking-wizard/features/sidebar/sidebar.d.ts +29 -21
- package/build/build-cjs/booking-wizard/features/summary/summary-booking-option-pax.d.ts +7 -0
- package/build/build-cjs/booking-wizard/features/summary/summary-booking-option-unit.d.ts +7 -0
- package/build/build-cjs/booking-wizard/features/summary/summary-flight.d.ts +8 -0
- package/build/build-cjs/booking-wizard/features/summary/summary-per-booking-option-group.d.ts +10 -0
- package/build/build-cjs/booking-wizard/features/summary/summary-per-pax-option-group.d.ts +10 -0
- package/build/build-cjs/booking-wizard/features/summary/summary-per-unit-option-group.d.ts +10 -0
- package/build/build-cjs/booking-wizard/features/summary/summary-slice.d.ts +14 -17
- package/build/build-cjs/booking-wizard/features/summary/summary.d.ts +4 -5
- package/build/build-cjs/booking-wizard/features/travelers-form/travelers-form-slice.d.ts +95 -45
- package/build/build-cjs/booking-wizard/features/travelers-form/travelers-form.d.ts +4 -5
- package/build/build-cjs/booking-wizard/features/travelers-form/type-ahead-input.d.ts +16 -15
- package/build/build-cjs/booking-wizard/features/travelers-form/validate-form.d.ts +7 -4
- package/build/build-cjs/booking-wizard/index.d.ts +12 -11
- package/build/build-cjs/booking-wizard/settings-context.d.ts +5 -6
- package/build/build-cjs/booking-wizard/store.d.ts +41 -25
- package/build/build-cjs/booking-wizard/types.d.ts +111 -59
- package/build/build-cjs/booking-wizard/utils/class-util.d.ts +1 -1
- package/build/build-cjs/booking-wizard/utils/localization-util.d.ts +1 -1
- package/build/build-cjs/booking-wizard/utils/query-string-util.d.ts +21 -2
- package/build/build-cjs/booking-wizard/utils/tide-api-utils.d.ts +2 -2
- package/build/build-cjs/index.d.ts +2 -2
- package/build/build-cjs/index.js +13642 -1886
- package/build/build-esm/booking-wizard/components/icon.d.ts +7 -7
- package/build/build-esm/booking-wizard/components/labeled-input.d.ts +18 -18
- package/build/build-esm/booking-wizard/components/labeled-select.d.ts +21 -21
- package/build/build-esm/booking-wizard/components/message.d.ts +9 -8
- package/build/build-esm/booking-wizard/components/product-card.d.ts +8 -9
- package/build/build-esm/booking-wizard/components/rating.d.ts +6 -6
- package/build/build-esm/booking-wizard/components/step-indicator.d.ts +6 -6
- package/build/build-esm/booking-wizard/components/step-route.d.ts +9 -9
- package/build/build-esm/booking-wizard/features/booking/api.d.ts +21 -0
- package/build/build-esm/booking-wizard/features/booking/booking-slice.d.ts +124 -18
- package/build/build-esm/booking-wizard/features/booking/booking.d.ts +8 -9
- package/build/build-esm/booking-wizard/features/booking/selectors.d.ts +208 -0
- package/build/build-esm/booking-wizard/features/confirmation/confirmation.d.ts +4 -5
- package/build/build-esm/booking-wizard/features/error/error.d.ts +4 -5
- package/build/build-esm/booking-wizard/features/price-details/price-details-api.d.ts +12 -6
- package/build/build-esm/booking-wizard/features/price-details/price-details-slice.d.ts +105 -10
- package/build/build-esm/booking-wizard/features/price-details/util.d.ts +5 -0
- package/build/build-esm/booking-wizard/features/product-options/no-options.d.ts +2 -0
- package/build/build-esm/booking-wizard/features/product-options/none-option.d.ts +17 -0
- package/build/build-esm/booking-wizard/features/product-options/option-booking-group.d.ts +18 -0
- package/build/build-esm/booking-wizard/features/product-options/option-item.d.ts +11 -0
- package/build/build-esm/booking-wizard/features/product-options/option-pax-card.d.ts +9 -0
- package/build/build-esm/booking-wizard/features/product-options/option-pax-group.d.ts +20 -0
- package/build/build-esm/booking-wizard/features/product-options/option-room.d.ts +16 -0
- package/build/build-esm/booking-wizard/features/product-options/option-unit-group.d.ts +20 -0
- package/build/build-esm/booking-wizard/features/product-options/option-units-card.d.ts +9 -0
- package/build/build-esm/booking-wizard/features/product-options/options-form.d.ts +4 -5
- package/build/build-esm/booking-wizard/features/product-options/validate-form.d.ts +2 -2
- package/build/build-esm/booking-wizard/features/sidebar/index.d.ts +7 -3
- package/build/build-esm/booking-wizard/features/sidebar/sidebar-flight.d.ts +8 -0
- package/build/build-esm/booking-wizard/features/sidebar/sidebar-util.d.ts +28 -4
- package/build/build-esm/booking-wizard/features/sidebar/sidebar.d.ts +29 -21
- package/build/build-esm/booking-wizard/features/summary/summary-booking-option-pax.d.ts +7 -0
- package/build/build-esm/booking-wizard/features/summary/summary-booking-option-unit.d.ts +7 -0
- package/build/build-esm/booking-wizard/features/summary/summary-flight.d.ts +8 -0
- package/build/build-esm/booking-wizard/features/summary/summary-per-booking-option-group.d.ts +10 -0
- package/build/build-esm/booking-wizard/features/summary/summary-per-pax-option-group.d.ts +10 -0
- package/build/build-esm/booking-wizard/features/summary/summary-per-unit-option-group.d.ts +10 -0
- package/build/build-esm/booking-wizard/features/summary/summary-slice.d.ts +14 -17
- package/build/build-esm/booking-wizard/features/summary/summary.d.ts +4 -5
- package/build/build-esm/booking-wizard/features/travelers-form/travelers-form-slice.d.ts +95 -45
- package/build/build-esm/booking-wizard/features/travelers-form/travelers-form.d.ts +4 -5
- package/build/build-esm/booking-wizard/features/travelers-form/type-ahead-input.d.ts +16 -15
- package/build/build-esm/booking-wizard/features/travelers-form/validate-form.d.ts +7 -4
- package/build/build-esm/booking-wizard/index.d.ts +12 -11
- package/build/build-esm/booking-wizard/settings-context.d.ts +5 -6
- package/build/build-esm/booking-wizard/store.d.ts +41 -25
- package/build/build-esm/booking-wizard/types.d.ts +111 -59
- package/build/build-esm/booking-wizard/utils/class-util.d.ts +1 -1
- package/build/build-esm/booking-wizard/utils/localization-util.d.ts +1 -1
- package/build/build-esm/booking-wizard/utils/query-string-util.d.ts +21 -2
- package/build/build-esm/booking-wizard/utils/tide-api-utils.d.ts +2 -2
- package/build/build-esm/index.d.ts +2 -2
- package/build/build-esm/index.js +13478 -1875
- package/package.json +8 -4
- package/rollup.config.js +1 -6
- package/src/booking-wizard/components/message.tsx +14 -8
- package/src/booking-wizard/components/product-card.tsx +10 -39
- package/src/booking-wizard/components/step-indicator.tsx +1 -1
- package/src/booking-wizard/components/step-route.tsx +1 -1
- package/src/booking-wizard/features/booking/api.ts +44 -0
- package/src/booking-wizard/features/booking/booking-slice.ts +274 -40
- package/src/booking-wizard/features/booking/booking.tsx +193 -57
- package/src/booking-wizard/features/booking/selectors.ts +328 -0
- package/src/booking-wizard/features/confirmation/confirmation.tsx +22 -11
- package/src/booking-wizard/features/error/error.tsx +15 -2
- package/src/booking-wizard/features/price-details/price-details-api.ts +12 -6
- package/src/booking-wizard/features/price-details/price-details-slice.ts +80 -50
- package/src/booking-wizard/features/price-details/util.ts +135 -0
- package/src/booking-wizard/features/product-options/no-options.tsx +18 -0
- package/src/booking-wizard/features/product-options/none-option.tsx +118 -0
- package/src/booking-wizard/features/product-options/option-booking-group.tsx +210 -0
- package/src/booking-wizard/features/product-options/option-item.tsx +321 -0
- package/src/booking-wizard/features/product-options/option-pax-card.tsx +102 -0
- package/src/booking-wizard/features/product-options/option-pax-group.tsx +169 -0
- package/src/booking-wizard/features/product-options/option-room.tsx +300 -0
- package/src/booking-wizard/features/product-options/option-unit-group.tsx +192 -0
- package/src/booking-wizard/features/product-options/option-units-card.tsx +100 -0
- package/src/booking-wizard/features/product-options/options-form.tsx +226 -48
- package/src/booking-wizard/features/sidebar/index.tsx +43 -20
- package/src/booking-wizard/features/sidebar/sidebar-flight.tsx +66 -0
- package/src/booking-wizard/features/sidebar/sidebar-util.ts +81 -39
- package/src/booking-wizard/features/sidebar/sidebar.tsx +150 -100
- package/src/booking-wizard/features/summary/summary-booking-option-pax.tsx +25 -0
- package/src/booking-wizard/features/summary/summary-booking-option-unit.tsx +25 -0
- package/src/booking-wizard/features/summary/summary-flight.tsx +35 -0
- package/src/booking-wizard/features/summary/summary-per-booking-option-group.tsx +57 -0
- package/src/booking-wizard/features/summary/summary-per-pax-option-group.tsx +51 -0
- package/src/booking-wizard/features/summary/summary-per-unit-option-group.tsx +54 -0
- package/src/booking-wizard/features/summary/summary-slice.ts +1 -134
- package/src/booking-wizard/features/summary/summary.tsx +521 -134
- package/src/booking-wizard/features/travelers-form/travelers-form-slice.ts +55 -56
- package/src/booking-wizard/features/travelers-form/travelers-form.tsx +202 -94
- package/src/booking-wizard/features/travelers-form/type-ahead-input.tsx +23 -3
- package/src/booking-wizard/features/travelers-form/validate-form.ts +40 -3
- package/src/booking-wizard/index.tsx +5 -6
- package/src/booking-wizard/settings-context.ts +33 -5
- package/src/booking-wizard/store.ts +5 -4
- package/src/booking-wizard/translations/translations.json +95 -61
- package/src/booking-wizard/types.ts +67 -10
- package/src/booking-wizard/utils/query-string-util.ts +42 -0
- package/build/build-cjs/booking-wizard/features/product-options/checkbox.d.ts +0 -11
- package/build/build-cjs/booking-wizard/features/product-options/option-details.d.ts +0 -11
- package/build/build-cjs/booking-wizard/features/product-options/product-options-api.d.ts +0 -26
- package/build/build-cjs/booking-wizard/features/product-options/product-options-slice.d.ts +0 -37
- package/build/build-cjs/booking-wizard/features/product-options/radio-button.d.ts +0 -10
- package/build/build-cjs/booking-wizard/features/product-options/rooms-slice.d.ts +0 -12
- package/build/build-cjs/booking-wizard/features/product-options/tree-level.d.ts +0 -7
- package/build/build-esm/booking-wizard/features/product-options/checkbox.d.ts +0 -11
- package/build/build-esm/booking-wizard/features/product-options/option-details.d.ts +0 -11
- package/build/build-esm/booking-wizard/features/product-options/product-options-api.d.ts +0 -26
- package/build/build-esm/booking-wizard/features/product-options/product-options-slice.d.ts +0 -37
- package/build/build-esm/booking-wizard/features/product-options/radio-button.d.ts +0 -10
- package/build/build-esm/booking-wizard/features/product-options/rooms-slice.d.ts +0 -12
- package/build/build-esm/booking-wizard/features/product-options/tree-level.d.ts +0 -7
- package/src/booking-wizard/features/product-options/checkbox.tsx +0 -38
- package/src/booking-wizard/features/product-options/option-details.tsx +0 -65
- package/src/booking-wizard/features/product-options/product-options-api.ts +0 -148
- package/src/booking-wizard/features/product-options/product-options-slice.ts +0 -149
- package/src/booking-wizard/features/product-options/radio-button.tsx +0 -35
- package/src/booking-wizard/features/product-options/rooms-slice.ts +0 -28
- package/src/booking-wizard/features/product-options/tree-level.tsx +0 -118
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { PackageRoom } from "@qite/tide-client";
|
|
2
|
-
export declare const selectRooms: (state: {
|
|
3
|
-
booking: import("../booking/booking-slice").BookingState;
|
|
4
|
-
travelersForm: import("../travelers-form/travelers-form-slice").TravelersFormState;
|
|
5
|
-
productOptions: import("@reduxjs/toolkit").EntityState<import("./product-options-api").ProductOption>;
|
|
6
|
-
priceDetails: import("@reduxjs/toolkit").EntityState<import("@qite/tide-client").PriceDetail>;
|
|
7
|
-
rooms: import("@reduxjs/toolkit").EntityState<PackageRoom>;
|
|
8
|
-
summary: import("../summary/summary-slice").SummaryState;
|
|
9
|
-
}) => PackageRoom[];
|
|
10
|
-
export declare const setRooms: import("@reduxjs/toolkit").ActionCreatorWithPayload<readonly PackageRoom[] | Record<import("@reduxjs/toolkit").EntityId, PackageRoom>, string>;
|
|
11
|
-
declare const _default: import("redux").Reducer<import("@reduxjs/toolkit").EntityState<PackageRoom>, import("redux").AnyAction>;
|
|
12
|
-
export default _default;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
interface CheckboxProps {
|
|
3
|
-
text: string;
|
|
4
|
-
value: string;
|
|
5
|
-
name: string;
|
|
6
|
-
required: boolean;
|
|
7
|
-
defaultChecked: boolean;
|
|
8
|
-
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
9
|
-
}
|
|
10
|
-
declare const Checkbox: React.FC<CheckboxProps>;
|
|
11
|
-
export default Checkbox;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
interface OptionDetailsProps {
|
|
3
|
-
startDate?: Date;
|
|
4
|
-
endDate?: Date;
|
|
5
|
-
price?: number;
|
|
6
|
-
isCollapsible?: boolean;
|
|
7
|
-
collapsed?: boolean;
|
|
8
|
-
onToggleCollapse?: (collapsed: boolean) => void;
|
|
9
|
-
}
|
|
10
|
-
declare const OptionDetails: React.FC<OptionDetailsProps>;
|
|
11
|
-
export default OptionDetails;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { PackageOption, PackageRoom } from "@qite/tide-client";
|
|
2
|
-
export interface ProductOptionsRequest {
|
|
3
|
-
officeId: number;
|
|
4
|
-
catalogId: number;
|
|
5
|
-
productId: number;
|
|
6
|
-
accommodationCode?: string;
|
|
7
|
-
regimeCode?: string;
|
|
8
|
-
startDate: Date;
|
|
9
|
-
endDate: Date;
|
|
10
|
-
adultCount: number;
|
|
11
|
-
childCount: number;
|
|
12
|
-
}
|
|
13
|
-
export interface ProductOptionsResult {
|
|
14
|
-
productOptions?: ProductOption[];
|
|
15
|
-
rooms?: PackageRoom[];
|
|
16
|
-
cacheKey?: string;
|
|
17
|
-
}
|
|
18
|
-
export interface ProductOption extends Omit<PackageOption, "options" | "fromDate" | "toDate"> {
|
|
19
|
-
parentCode: string;
|
|
20
|
-
fromDate: string;
|
|
21
|
-
toDate: string;
|
|
22
|
-
}
|
|
23
|
-
declare const productOptionsApi: {
|
|
24
|
-
fetchProductOptions: (request: ProductOptionsRequest) => Promise<ProductOptionsResult | undefined>;
|
|
25
|
-
};
|
|
26
|
-
export default productOptionsApi;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { ProductOption } from "./product-options-api";
|
|
2
|
-
export declare const fetchProductOptions: import("@reduxjs/toolkit").AsyncThunk<import("./product-options-api").ProductOptionsResult | undefined, void, {}>;
|
|
3
|
-
export declare const selectOptions: (state: {
|
|
4
|
-
booking: import("../booking/booking-slice").BookingState;
|
|
5
|
-
travelersForm: import("../travelers-form/travelers-form-slice").TravelersFormState;
|
|
6
|
-
productOptions: import("@reduxjs/toolkit").EntityState<ProductOption>;
|
|
7
|
-
priceDetails: import("@reduxjs/toolkit").EntityState<import("@qite/tide-client").PriceDetail>;
|
|
8
|
-
rooms: import("@reduxjs/toolkit").EntityState<import("@qite/tide-client").PackageRoom>;
|
|
9
|
-
summary: import("../summary/summary-slice").SummaryState;
|
|
10
|
-
}) => ProductOption[];
|
|
11
|
-
export declare const selectSelectedOptions: import("reselect").OutputSelector<{
|
|
12
|
-
booking: import("../booking/booking-slice").BookingState;
|
|
13
|
-
travelersForm: import("../travelers-form/travelers-form-slice").TravelersFormState;
|
|
14
|
-
productOptions: import("@reduxjs/toolkit").EntityState<ProductOption>;
|
|
15
|
-
priceDetails: import("@reduxjs/toolkit").EntityState<import("@qite/tide-client").PriceDetail>;
|
|
16
|
-
rooms: import("@reduxjs/toolkit").EntityState<import("@qite/tide-client").PackageRoom>;
|
|
17
|
-
summary: import("../summary/summary-slice").SummaryState;
|
|
18
|
-
}, ProductOption[], (res: ProductOption[]) => ProductOption[]>;
|
|
19
|
-
export declare const selectDepartureFlight: import("reselect").OutputSelector<{
|
|
20
|
-
booking: import("../booking/booking-slice").BookingState;
|
|
21
|
-
travelersForm: import("../travelers-form/travelers-form-slice").TravelersFormState;
|
|
22
|
-
productOptions: import("@reduxjs/toolkit").EntityState<ProductOption>;
|
|
23
|
-
priceDetails: import("@reduxjs/toolkit").EntityState<import("@qite/tide-client").PriceDetail>;
|
|
24
|
-
rooms: import("@reduxjs/toolkit").EntityState<import("@qite/tide-client").PackageRoom>;
|
|
25
|
-
summary: import("../summary/summary-slice").SummaryState;
|
|
26
|
-
}, ProductOption | undefined, (res: ProductOption[]) => ProductOption | undefined>;
|
|
27
|
-
export declare const selectReturnFlight: import("reselect").OutputSelector<{
|
|
28
|
-
booking: import("../booking/booking-slice").BookingState;
|
|
29
|
-
travelersForm: import("../travelers-form/travelers-form-slice").TravelersFormState;
|
|
30
|
-
productOptions: import("@reduxjs/toolkit").EntityState<ProductOption>;
|
|
31
|
-
priceDetails: import("@reduxjs/toolkit").EntityState<import("@qite/tide-client").PriceDetail>;
|
|
32
|
-
rooms: import("@reduxjs/toolkit").EntityState<import("@qite/tide-client").PackageRoom>;
|
|
33
|
-
summary: import("../summary/summary-slice").SummaryState;
|
|
34
|
-
}, ProductOption | undefined, (res: ProductOption[]) => ProductOption | undefined>;
|
|
35
|
-
export declare const updateOption: import("@reduxjs/toolkit").ActionCreatorWithPayload<ProductOption, string>;
|
|
36
|
-
declare const _default: import("redux").Reducer<import("@reduxjs/toolkit").EntityState<ProductOption>, import("redux").AnyAction>;
|
|
37
|
-
export default _default;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
interface RadioButtonProps {
|
|
3
|
-
text: string;
|
|
4
|
-
name: string;
|
|
5
|
-
value: string;
|
|
6
|
-
defaultChecked?: boolean;
|
|
7
|
-
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
8
|
-
}
|
|
9
|
-
declare const RadioButton: React.FC<RadioButtonProps>;
|
|
10
|
-
export default RadioButton;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { PackageRoom } from "@qite/tide-client";
|
|
2
|
-
export declare const selectRooms: (state: {
|
|
3
|
-
booking: import("../booking/booking-slice").BookingState;
|
|
4
|
-
travelersForm: import("../travelers-form/travelers-form-slice").TravelersFormState;
|
|
5
|
-
productOptions: import("@reduxjs/toolkit").EntityState<import("./product-options-api").ProductOption>;
|
|
6
|
-
priceDetails: import("@reduxjs/toolkit").EntityState<import("@qite/tide-client").PriceDetail>;
|
|
7
|
-
rooms: import("@reduxjs/toolkit").EntityState<PackageRoom>;
|
|
8
|
-
summary: import("../summary/summary-slice").SummaryState;
|
|
9
|
-
}) => PackageRoom[];
|
|
10
|
-
export declare const setRooms: import("@reduxjs/toolkit").ActionCreatorWithPayload<readonly PackageRoom[] | Record<import("@reduxjs/toolkit").EntityId, PackageRoom>, string>;
|
|
11
|
-
declare const _default: import("redux").Reducer<import("@reduxjs/toolkit").EntityState<PackageRoom>, import("redux").AnyAction>;
|
|
12
|
-
export default _default;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
|
|
3
|
-
interface CheckboxProps {
|
|
4
|
-
text: string;
|
|
5
|
-
value: string;
|
|
6
|
-
name: string;
|
|
7
|
-
required: boolean;
|
|
8
|
-
defaultChecked: boolean;
|
|
9
|
-
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const Checkbox: React.FC<CheckboxProps> = ({
|
|
13
|
-
text,
|
|
14
|
-
required,
|
|
15
|
-
defaultChecked,
|
|
16
|
-
onChange,
|
|
17
|
-
children,
|
|
18
|
-
}) => (
|
|
19
|
-
<div className="checkbox">
|
|
20
|
-
<label className="checkbox__label">
|
|
21
|
-
{!required && (
|
|
22
|
-
<input
|
|
23
|
-
type="checkbox"
|
|
24
|
-
value="optionA"
|
|
25
|
-
name="excursion"
|
|
26
|
-
className="checkbox__input"
|
|
27
|
-
disabled={required}
|
|
28
|
-
defaultChecked={defaultChecked}
|
|
29
|
-
onChange={onChange}
|
|
30
|
-
/>
|
|
31
|
-
)}
|
|
32
|
-
<span className="checkbox__label-text">{text}</span>
|
|
33
|
-
{children}
|
|
34
|
-
</label>
|
|
35
|
-
</div>
|
|
36
|
-
);
|
|
37
|
-
|
|
38
|
-
export default Checkbox;
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { format } from "date-fns";
|
|
3
|
-
import { formatPrice } from "../../utils/localization-util";
|
|
4
|
-
|
|
5
|
-
interface OptionDetailsProps {
|
|
6
|
-
startDate?: Date;
|
|
7
|
-
endDate?: Date;
|
|
8
|
-
price?: number;
|
|
9
|
-
isCollapsible?: boolean;
|
|
10
|
-
collapsed?: boolean;
|
|
11
|
-
onToggleCollapse?: (collapsed: boolean) => void;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const OptionDetails: React.FC<OptionDetailsProps> = ({
|
|
15
|
-
startDate,
|
|
16
|
-
endDate,
|
|
17
|
-
price,
|
|
18
|
-
isCollapsible,
|
|
19
|
-
collapsed,
|
|
20
|
-
onToggleCollapse,
|
|
21
|
-
}) => {
|
|
22
|
-
const handleToggleCollapse: React.ChangeEventHandler<HTMLInputElement> = (
|
|
23
|
-
e
|
|
24
|
-
) => {
|
|
25
|
-
if (onToggleCollapse) {
|
|
26
|
-
onToggleCollapse(e.target.checked);
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
return (
|
|
31
|
-
<div className="tree__columns-actions">
|
|
32
|
-
<div className="tree__columns">
|
|
33
|
-
<div className="tree__column">
|
|
34
|
-
<div className="date-list">
|
|
35
|
-
{startDate && (
|
|
36
|
-
<span className="date-list__item">
|
|
37
|
-
{format(startDate, "dd/MM/yyyy")}
|
|
38
|
-
</span>
|
|
39
|
-
)}
|
|
40
|
-
{endDate && (
|
|
41
|
-
<span className="date-list__item">
|
|
42
|
-
{format(endDate, "dd/MM/yyyy")}
|
|
43
|
-
</span>
|
|
44
|
-
)}
|
|
45
|
-
</div>
|
|
46
|
-
</div>
|
|
47
|
-
<div className="tree__column tree__column--price">
|
|
48
|
-
{price !== undefined ? formatPrice(price) : ""}
|
|
49
|
-
</div>
|
|
50
|
-
</div>
|
|
51
|
-
{isCollapsible && (
|
|
52
|
-
<div className="tree__actions">
|
|
53
|
-
<input
|
|
54
|
-
type="checkbox"
|
|
55
|
-
className="tree__collapse"
|
|
56
|
-
defaultChecked={collapsed}
|
|
57
|
-
onChange={handleToggleCollapse}
|
|
58
|
-
/>
|
|
59
|
-
</div>
|
|
60
|
-
)}
|
|
61
|
-
</div>
|
|
62
|
-
);
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
export default OptionDetails;
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CachedPackageSearchResult,
|
|
3
|
-
PackageOption,
|
|
4
|
-
PackageRoom,
|
|
5
|
-
PackageSearchRequest,
|
|
6
|
-
PackageSearchRequestDate,
|
|
7
|
-
PackageSearchRequestRoom,
|
|
8
|
-
searchPackages,
|
|
9
|
-
ServiceType,
|
|
10
|
-
} from "@qite/tide-client";
|
|
11
|
-
import { formatISO } from "date-fns";
|
|
12
|
-
import { compact, concat, omit } from "lodash";
|
|
13
|
-
import { buildTideClientConfig } from "../../utils/tide-api-utils";
|
|
14
|
-
|
|
15
|
-
export interface ProductOptionsRequest {
|
|
16
|
-
officeId: number;
|
|
17
|
-
catalogId: number;
|
|
18
|
-
productId: number;
|
|
19
|
-
accommodationCode?: string;
|
|
20
|
-
regimeCode?: string;
|
|
21
|
-
startDate: Date;
|
|
22
|
-
endDate: Date;
|
|
23
|
-
adultCount: number;
|
|
24
|
-
childCount: number;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export interface ProductOptionsResult {
|
|
28
|
-
productOptions?: ProductOption[];
|
|
29
|
-
rooms?: PackageRoom[];
|
|
30
|
-
cacheKey?: string;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export interface ProductOption
|
|
34
|
-
extends Omit<PackageOption, "options" | "fromDate" | "toDate"> {
|
|
35
|
-
parentCode: string;
|
|
36
|
-
fromDate: string;
|
|
37
|
-
toDate: string;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const fetchProductOptions = async (
|
|
41
|
-
request: ProductOptionsRequest
|
|
42
|
-
): Promise<ProductOptionsResult | undefined> => {
|
|
43
|
-
// Fetch Tide productOptions
|
|
44
|
-
const packageSearchResults = await fetchTidePackageOptions(request);
|
|
45
|
-
|
|
46
|
-
// Select product
|
|
47
|
-
if (!packageSearchResults?.length) {
|
|
48
|
-
return undefined;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const cachedPackageSearchResult = packageSearchResults[0];
|
|
52
|
-
|
|
53
|
-
const cacheKey = cachedPackageSearchResult.cacheKey;
|
|
54
|
-
|
|
55
|
-
// Process product and productOptions
|
|
56
|
-
const productOptions = processPackageOptions(cachedPackageSearchResult);
|
|
57
|
-
|
|
58
|
-
return <ProductOptionsResult>{
|
|
59
|
-
cacheKey,
|
|
60
|
-
productOptions,
|
|
61
|
-
rooms: cachedPackageSearchResult.packageSearchResult.rooms,
|
|
62
|
-
};
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
const fetchTidePackageOptions = async (
|
|
66
|
-
productOptionsRequest: ProductOptionsRequest
|
|
67
|
-
) => {
|
|
68
|
-
const tideClientConfig = buildTideClientConfig();
|
|
69
|
-
|
|
70
|
-
const packageSearchRequest: PackageSearchRequest = {
|
|
71
|
-
productIds: [productOptionsRequest.productId],
|
|
72
|
-
accommodationCodes: compact([productOptionsRequest.accommodationCode]),
|
|
73
|
-
regimeCodes: compact([productOptionsRequest.regimeCode]),
|
|
74
|
-
officeId: 1,
|
|
75
|
-
catalogId: 1,
|
|
76
|
-
productType: ServiceType.package,
|
|
77
|
-
onlyPreferredHotels: false,
|
|
78
|
-
includeLuggage: true,
|
|
79
|
-
rooms: [
|
|
80
|
-
<PackageSearchRequestRoom>{
|
|
81
|
-
adultCount: productOptionsRequest.adultCount,
|
|
82
|
-
childCount: productOptionsRequest.childCount,
|
|
83
|
-
},
|
|
84
|
-
],
|
|
85
|
-
departure: <PackageSearchRequestDate>{
|
|
86
|
-
date: productOptionsRequest.startDate,
|
|
87
|
-
timeRange: [0, 24],
|
|
88
|
-
},
|
|
89
|
-
arrival: <PackageSearchRequestDate>{
|
|
90
|
-
date: productOptionsRequest.endDate,
|
|
91
|
-
timeRange: [0, 24],
|
|
92
|
-
},
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
return await searchPackages(tideClientConfig, packageSearchRequest);
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
const processPackageOptions = (
|
|
99
|
-
cachedPackageSearchResult: CachedPackageSearchResult
|
|
100
|
-
): ProductOption[] | undefined => {
|
|
101
|
-
if (!cachedPackageSearchResult?.packageSearchResult?.options?.length) {
|
|
102
|
-
// No options found
|
|
103
|
-
return undefined;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
const processedProductOptions =
|
|
107
|
-
cachedPackageSearchResult.packageSearchResult.options.flatMap(
|
|
108
|
-
(packageOption) => processPackageOption(packageOption)
|
|
109
|
-
);
|
|
110
|
-
|
|
111
|
-
return processedProductOptions;
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
const processPackageOption = (
|
|
115
|
-
packageOption: PackageOption,
|
|
116
|
-
parentCode?: string
|
|
117
|
-
): ProductOption[] => {
|
|
118
|
-
// Process main option
|
|
119
|
-
const fromDate = formatISO(packageOption.fromDate);
|
|
120
|
-
const toDate = formatISO(packageOption.toDate);
|
|
121
|
-
|
|
122
|
-
let processedProductOptions: ProductOption[] = [
|
|
123
|
-
<ProductOption>{
|
|
124
|
-
...omit(packageOption, "options", "fromDate", "toDate"),
|
|
125
|
-
fromDate,
|
|
126
|
-
toDate,
|
|
127
|
-
parentCode,
|
|
128
|
-
},
|
|
129
|
-
];
|
|
130
|
-
|
|
131
|
-
// Process sub options
|
|
132
|
-
if (packageOption.options?.length) {
|
|
133
|
-
packageOption.options.forEach((subProductOption) => {
|
|
134
|
-
processedProductOptions = concat(
|
|
135
|
-
processedProductOptions,
|
|
136
|
-
processPackageOption(subProductOption, packageOption.code)
|
|
137
|
-
);
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
return processedProductOptions;
|
|
142
|
-
};
|
|
143
|
-
|
|
144
|
-
const productOptionsApi = {
|
|
145
|
-
fetchProductOptions,
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
export default productOptionsApi;
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
import { PackagePriceDetailsRequest, ServiceType } from "@qite/tide-client";
|
|
2
|
-
import {
|
|
3
|
-
PayloadAction,
|
|
4
|
-
createAsyncThunk,
|
|
5
|
-
createEntityAdapter,
|
|
6
|
-
createSelector,
|
|
7
|
-
createSlice,
|
|
8
|
-
} from "@reduxjs/toolkit";
|
|
9
|
-
import { find, findLast, isNil } from "lodash";
|
|
10
|
-
import productOptionsApi, {
|
|
11
|
-
ProductOption,
|
|
12
|
-
ProductOptionsRequest,
|
|
13
|
-
} from "./product-options-api";
|
|
14
|
-
import {
|
|
15
|
-
selectAdultCount,
|
|
16
|
-
selectChildCount,
|
|
17
|
-
selectTravelerAges,
|
|
18
|
-
} from "../travelers-form/travelers-form-slice";
|
|
19
|
-
import {
|
|
20
|
-
selectBookingAttributes,
|
|
21
|
-
selectOfficeId,
|
|
22
|
-
selectProductAttributes,
|
|
23
|
-
setCacheKey,
|
|
24
|
-
} from "../booking/booking-slice";
|
|
25
|
-
|
|
26
|
-
import { RootState } from "../../store";
|
|
27
|
-
import { fetchPriceDetails } from "../price-details/price-details-slice";
|
|
28
|
-
import { parseISO } from "date-fns";
|
|
29
|
-
import { setRooms } from "./rooms-slice";
|
|
30
|
-
|
|
31
|
-
export const fetchProductOptions = createAsyncThunk(
|
|
32
|
-
"productOptions/fetchProductOptions",
|
|
33
|
-
async (_, { dispatch, getState }) => {
|
|
34
|
-
const state = getState() as RootState;
|
|
35
|
-
|
|
36
|
-
const officeId = selectOfficeId(state);
|
|
37
|
-
const productAttributes = selectProductAttributes(state);
|
|
38
|
-
const bookingAttributes = selectBookingAttributes(state);
|
|
39
|
-
const adultCount = selectAdultCount(state);
|
|
40
|
-
const childCount = selectChildCount(state);
|
|
41
|
-
const travelerAges = selectTravelerAges(state);
|
|
42
|
-
|
|
43
|
-
if (isNil(productAttributes)) {
|
|
44
|
-
throw Error("productAttributes could not be found");
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
if (isNil(bookingAttributes)) {
|
|
48
|
-
throw Error("bookingAttributes could not be found");
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const request: ProductOptionsRequest = {
|
|
52
|
-
officeId,
|
|
53
|
-
catalogId: bookingAttributes.catalog,
|
|
54
|
-
productId: productAttributes.productId,
|
|
55
|
-
startDate: parseISO(bookingAttributes.startDate),
|
|
56
|
-
endDate: parseISO(bookingAttributes.endDate),
|
|
57
|
-
accommodationCode: bookingAttributes.accommodation,
|
|
58
|
-
regimeCode: bookingAttributes.regime,
|
|
59
|
-
adultCount: adultCount,
|
|
60
|
-
childCount: childCount,
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
const productOptionsResult = await productOptionsApi.fetchProductOptions(
|
|
64
|
-
request
|
|
65
|
-
);
|
|
66
|
-
|
|
67
|
-
const cacheKey = productOptionsResult?.cacheKey;
|
|
68
|
-
const rooms = productOptionsResult?.rooms;
|
|
69
|
-
|
|
70
|
-
if (cacheKey && rooms) {
|
|
71
|
-
dispatch(setCacheKey(cacheKey));
|
|
72
|
-
dispatch(setRooms(rooms));
|
|
73
|
-
|
|
74
|
-
if (rooms.length === 0) {
|
|
75
|
-
throw Error("No rooms present in response.");
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
const priceDetailsRequest: PackagePriceDetailsRequest = {
|
|
79
|
-
packageSearchResultCacheKey: cacheKey,
|
|
80
|
-
officeId: 1,
|
|
81
|
-
language: "nl-BE",
|
|
82
|
-
optionGuids:
|
|
83
|
-
productOptionsResult?.productOptions
|
|
84
|
-
?.filter((option) => option.isSelected)
|
|
85
|
-
?.map((option) => option.guid) ?? [],
|
|
86
|
-
rooms: [
|
|
87
|
-
{
|
|
88
|
-
id: rooms[0].id,
|
|
89
|
-
travelerAges: travelerAges,
|
|
90
|
-
},
|
|
91
|
-
],
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
dispatch(fetchPriceDetails(priceDetailsRequest));
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
return productOptionsResult;
|
|
98
|
-
}
|
|
99
|
-
);
|
|
100
|
-
|
|
101
|
-
const productOptionsAdapter = createEntityAdapter<ProductOption>({
|
|
102
|
-
selectId: (productOption) => productOption.code,
|
|
103
|
-
sortComparer: (a, b) => {
|
|
104
|
-
if (a.fromDate === b.fromDate) {
|
|
105
|
-
return a.code.localeCompare(b.code);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
return a.fromDate.localeCompare(b.fromDate);
|
|
109
|
-
},
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
const productOptionsSlice = createSlice({
|
|
113
|
-
name: "productOptions",
|
|
114
|
-
initialState: productOptionsAdapter.getInitialState(),
|
|
115
|
-
reducers: {
|
|
116
|
-
updateOption: (state, action: PayloadAction<ProductOption>) => {
|
|
117
|
-
productOptionsAdapter.upsertOne(state, action.payload);
|
|
118
|
-
},
|
|
119
|
-
},
|
|
120
|
-
extraReducers: (builder) => {
|
|
121
|
-
builder.addCase(fetchProductOptions.fulfilled, (state, action) => {
|
|
122
|
-
productOptionsAdapter.setAll(state, action.payload?.productOptions ?? []);
|
|
123
|
-
});
|
|
124
|
-
},
|
|
125
|
-
});
|
|
126
|
-
|
|
127
|
-
const productOptionsSelectors = productOptionsAdapter.getSelectors<RootState>(
|
|
128
|
-
(state) => {
|
|
129
|
-
return state.productOptions;
|
|
130
|
-
}
|
|
131
|
-
);
|
|
132
|
-
|
|
133
|
-
export const selectOptions = productOptionsSelectors.selectAll;
|
|
134
|
-
|
|
135
|
-
export const selectSelectedOptions = createSelector(selectOptions, (options) =>
|
|
136
|
-
options.filter((option) => option.isSelected)
|
|
137
|
-
);
|
|
138
|
-
|
|
139
|
-
export const selectDepartureFlight = createSelector(selectOptions, (options) =>
|
|
140
|
-
find(options, (option) => option.productType === ServiceType.flight)
|
|
141
|
-
);
|
|
142
|
-
|
|
143
|
-
export const selectReturnFlight = createSelector(selectOptions, (options) =>
|
|
144
|
-
findLast(options, (option) => option.productType === ServiceType.flight)
|
|
145
|
-
);
|
|
146
|
-
|
|
147
|
-
export const { updateOption } = productOptionsSlice.actions;
|
|
148
|
-
|
|
149
|
-
export default productOptionsSlice.reducer;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
|
|
3
|
-
interface RadioButtonProps {
|
|
4
|
-
text: string;
|
|
5
|
-
name: string;
|
|
6
|
-
value: string;
|
|
7
|
-
defaultChecked?: boolean;
|
|
8
|
-
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const RadioButton: React.FC<RadioButtonProps> = ({
|
|
12
|
-
text,
|
|
13
|
-
name,
|
|
14
|
-
value,
|
|
15
|
-
defaultChecked,
|
|
16
|
-
children,
|
|
17
|
-
onChange,
|
|
18
|
-
}) => (
|
|
19
|
-
<div className="radiobutton">
|
|
20
|
-
<label className="radiobutton__label">
|
|
21
|
-
<input
|
|
22
|
-
type="radio"
|
|
23
|
-
value={value}
|
|
24
|
-
name={name}
|
|
25
|
-
className="radiobutton__input"
|
|
26
|
-
defaultChecked={defaultChecked}
|
|
27
|
-
onChange={onChange}
|
|
28
|
-
/>
|
|
29
|
-
<span className="radiobutton__label-text">{text}</span>
|
|
30
|
-
{children}
|
|
31
|
-
</label>
|
|
32
|
-
</div>
|
|
33
|
-
);
|
|
34
|
-
|
|
35
|
-
export default RadioButton;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { createEntityAdapter, createSlice } from "@reduxjs/toolkit";
|
|
2
|
-
|
|
3
|
-
import { PackageRoom } from "@qite/tide-client";
|
|
4
|
-
import { RootState } from "../../store";
|
|
5
|
-
|
|
6
|
-
const productOptionsAdapter = createEntityAdapter<PackageRoom>({
|
|
7
|
-
selectId: (room) => room.id,
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
const roomsSlice = createSlice({
|
|
11
|
-
name: "rooms",
|
|
12
|
-
initialState: productOptionsAdapter.getInitialState(),
|
|
13
|
-
reducers: {
|
|
14
|
-
setRooms: productOptionsAdapter.setAll,
|
|
15
|
-
},
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
const roomsSelectors = productOptionsAdapter.getSelectors<RootState>(
|
|
19
|
-
(state) => {
|
|
20
|
-
return state.rooms;
|
|
21
|
-
}
|
|
22
|
-
);
|
|
23
|
-
|
|
24
|
-
export const selectRooms = roomsSelectors.selectAll;
|
|
25
|
-
|
|
26
|
-
export const { setRooms } = roomsSlice.actions;
|
|
27
|
-
|
|
28
|
-
export default roomsSlice.reducer;
|