@pisell/private-materials 6.12.419 → 6.12.420
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/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/render/default/view.js +10 -10
- package/build/lowcode/view.js +10 -10
- package/es/components/bigSale/components/BookingFloatingPanel/useBookingPanelController.js +0 -1
- package/es/components/bigSale/components/ProductList/index.js +0 -1
- package/es/components/bigSale/components/TimeBar/index.js +0 -1
- package/es/components/bigSale/dialog.js +0 -1
- package/es/components/bigSale/hooks/useBigSaleContext.js +0 -1
- package/es/components/bigSale/hooks/useSelectFloorMapResourceForBigSale.js +0 -1
- package/es/components/bigSale/index.js +0 -1
- package/es/components/bigSale/templates/Kiosk/index.js +0 -1
- package/es/components/sharedSecondaryBigSale/SharedSecondaryBigSaleReceiver.js +0 -1
- package/es/components/venueBookingSales/availability/controller.js +27 -15
- package/es/components/venueBookingSales/availability/queries.js +7 -33
- package/es/components/venueBookingSales/checkout/useVenueBookingCheckout.js +0 -1
- package/es/index.js +0 -2
- package/es/plus/multiCurrencySettlement/index.js +1 -1
- package/es/plus/pisellReservation/data/bookingToReservationTables.js +1 -1
- package/es/plus/pisellReservation/floorMap/floorPlanApi.js +1 -1
- package/es/plus/pisellReservation/floorMap/reservationMock.js +1 -1
- package/es/plus/saleDetail/Base.js +0 -1
- package/es/plus/saleDetail/components/Client/hooks/useClientSelectorProps.js +0 -1
- package/es/plus/saleDetail/components/DetailActions/PrintAction.js +0 -1
- package/es/plus/saleDetail/components/DetailActions/index.js +0 -1
- package/es/plus/saleDetail/components/SummaryFinancialSections/index.js +0 -1
- package/es/plus/saleDetail/index.js +0 -1
- package/es/plus/saleDetail/tmpl/B/components/Dish/index.js +0 -1
- package/es/plus/saleDetail/tmpl/B/index.js +0 -1
- package/es/plus/salesSdk/utils/addProductWithFlowDebounced.js +1 -1
- package/es/plus/salesSdk/utils/bookingDate.js +1 -1
- package/es/plus/salesSdk/utils/enrichCartLineHolderDisplay.js +1 -1
- package/es/private-materials/lowcode/authmodal/meta.d.ts +1 -0
- package/es/pro/Login2.0/AuthModal.d.ts +1 -1
- package/es/pro/Login2.0/index.d.ts +2 -2
- package/es/pro/Login2.0/shared/types.d.ts +1 -1
- package/lib/components/venueBookingSales/availability/controller.js +26 -14
- package/lib/components/venueBookingSales/availability/queries.js +6 -33
- package/package.json +3 -3
- package/es/plus/pisellReservation/index.js +0 -17
- package/es/plus/salesSdk/index.js +0 -54
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import useEngineContext from "../../../../hooks/useEngineContext.js";
|
|
2
2
|
import { subscribeBookingDateChange } from "../../../../plus/salesSdk/utils/bookingDate.js";
|
|
3
|
-
import "../../../../plus/salesSdk/index.js";
|
|
4
3
|
import dayjs from "dayjs";
|
|
5
4
|
import { useCallback, useEffect, useState } from "react";
|
|
6
5
|
//#region src/components/bigSale/components/BookingFloatingPanel/useBookingPanelController.ts
|
|
@@ -20,7 +20,6 @@ import { showAddToCartToast } from "../../../../plus/salesSdk/components/showAdd
|
|
|
20
20
|
import { mergeBookingsForDisplay } from "../../../../plus/salesSdk/utils/mergeBookingsForDisplay.js";
|
|
21
21
|
import useSalesSdkGlobalScanHandler from "../../../../plus/salesSdk/hooks/useSalesSdkGlobalScanHandler.js";
|
|
22
22
|
import { useSalesSdkGlobalScanActivity } from "../../../../plus/salesSdk/context/SalesSdkGlobalScanActivityContext.js";
|
|
23
|
-
import "../../../../plus/salesSdk/index.js";
|
|
24
23
|
import { buildBigSaleProductListPreferencesKey, readBigSaleProductListPreferences, readStoredBigSaleProductListPreferences, removeBigSaleProductListPreferences, resolveBigSaleAutoProductListPreferences, writeBigSaleProductListPreferences } from "../../utils/productListPreferences.js";
|
|
25
24
|
import { resolveBigSaleProductDisplayConfig, useBigSaleProductListConfig } from "../../hooks/useBigSaleProductListConfig.js";
|
|
26
25
|
import { showSalesGuardErrorToast } from "../../../../plus/salesSdk/utils/salesGuard.js";
|
|
@@ -5,7 +5,6 @@ import useInitLocalesOnce from "../../../../hooks/useInitLocalesOnce.js";
|
|
|
5
5
|
import { subscribeBookingDateChange } from "../../../../plus/salesSdk/utils/bookingDate.js";
|
|
6
6
|
import { setBookingTimeSelectionIntent } from "../../../../plus/salesSdk/utils/bookingTimeSelection.js";
|
|
7
7
|
import { useSalesSdkBookingContext } from "../../../../plus/salesSdk/context/SalesSdkBookingContext.js";
|
|
8
|
-
import "../../../../plus/salesSdk/index.js";
|
|
9
8
|
import locales_default from "../../locales/index.js";
|
|
10
9
|
import { getPosWeekStartsOn, resolvePosCountryCode } from "../../../../utils/posDateLocale.js";
|
|
11
10
|
import dayjs from "dayjs";
|
|
@@ -6,7 +6,6 @@ import { buildInitBookingContextParams, collectBookingIdsFromTempOrder } from ".
|
|
|
6
6
|
import { useSalesSdk } from "../../plus/salesSdk/hooks/useSalesSdk.js";
|
|
7
7
|
import { useSalesSdkCart } from "../../plus/salesSdk/hooks/useSalesSdkCart.js";
|
|
8
8
|
import { SalesSdkPrepareOrderSwitchContext, SalesSdkRootRefreshContext } from "../../plus/salesSdk/context/SalesSdkProvider.js";
|
|
9
|
-
import "../../plus/salesSdk/index.js";
|
|
10
9
|
import { isPersistedBigSaleOrderId } from "./utils/orderIdentity.js";
|
|
11
10
|
import { seedDineInReservationToCart } from "../../plus/pisellReservation/utils/seedDineInReservationToCart.js";
|
|
12
11
|
import BigSale from "./index.js";
|
|
@@ -4,7 +4,6 @@ import { useSalesSdkCustomer } from "../../../plus/salesSdk/hooks/useSalesSdkCus
|
|
|
4
4
|
import { useSalesSdkBookingContext } from "../../../plus/salesSdk/context/SalesSdkBookingContext.js";
|
|
5
5
|
import { useSalesSdkSummary } from "../../../plus/salesSdk/hooks/useSalesSdkSummary.js";
|
|
6
6
|
import { useSalesSdkProducts } from "../../../plus/salesSdk/hooks/useSalesSdkProducts.js";
|
|
7
|
-
import "../../../plus/salesSdk/index.js";
|
|
8
7
|
import { useMemo } from "react";
|
|
9
8
|
//#region src/components/bigSale/hooks/useBigSaleContext.ts
|
|
10
9
|
/**
|
|
@@ -3,7 +3,6 @@ import { _asyncToGenerator } from "../../../_virtual/_@oxc-project_runtime@0.122
|
|
|
3
3
|
import { buildInitBookingContextParams, collectBookingIdsFromTempOrder } from "../../../plus/salesSdk/utils/buildDefaultLoadProductsParams.js";
|
|
4
4
|
import { useSalesSdkUIHosts } from "../../../plus/salesSdk/context/SalesSdkUIHostsContext.js";
|
|
5
5
|
import { SalesSdkRootRefreshContext } from "../../../plus/salesSdk/context/SalesSdkProvider.js";
|
|
6
|
-
import "../../../plus/salesSdk/index.js";
|
|
7
6
|
import { isPersistedBigSaleOrderId } from "../utils/orderIdentity.js";
|
|
8
7
|
import { resolveOrderIdForHostActions } from "../../../plus/pisellReservation/components/bookingDetailModal/bookingDetailHostActions.js";
|
|
9
8
|
import { usePicoCodingOpenData } from "../../../plus/pisellReservation/hooks/usePicoCodingOpenData.js";
|
|
@@ -8,7 +8,6 @@ import { useSalesSdk } from "../../plus/salesSdk/hooks/useSalesSdk.js";
|
|
|
8
8
|
import { useSalesSdkCustomer } from "../../plus/salesSdk/hooks/useSalesSdkCustomer.js";
|
|
9
9
|
import { SalesSdkProvider } from "../../plus/salesSdk/context/SalesSdkProvider.js";
|
|
10
10
|
import { SalesSdkBookingContextProvider } from "../../plus/salesSdk/context/SalesSdkBookingContext.js";
|
|
11
|
-
import "../../plus/salesSdk/index.js";
|
|
12
11
|
import { resolveKioskPlatformSource, resolveKioskPresentation } from "../kioskSale/resolveKioskPresentation.js";
|
|
13
12
|
import { resolveCustomerDetailAppearance } from "../../pro/skuDetailModal/customerDetailPolicy.js";
|
|
14
13
|
import { ResponsiveBigSaleBase } from "./Base.js";
|
|
@@ -13,7 +13,6 @@ import { useSalesSdkBusinessAvailability } from "../../../../plus/salesSdk/conte
|
|
|
13
13
|
import { collectUnassignedHolderLines } from "../../../../plus/salesSdk/utils/holderSubmitValidation.js";
|
|
14
14
|
import { isFulfillmentTimingBooking } from "../../../../plus/salesSdk/utils/fulfillmentTimingBooking.js";
|
|
15
15
|
import { useSalesSdkGlobalScanActivity } from "../../../../plus/salesSdk/context/SalesSdkGlobalScanActivityContext.js";
|
|
16
|
-
import "../../../../plus/salesSdk/index.js";
|
|
17
16
|
import { usePickSaleDetailContext } from "../../hooks/usePickSaleDetailContext.js";
|
|
18
17
|
import { resolveBigSaleAutoProductListPreferences } from "../../utils/productListPreferences.js";
|
|
19
18
|
import { resolveBigSaleProductDisplayConfig } from "../../hooks/useBigSaleProductListConfig.js";
|
|
@@ -2,7 +2,6 @@ import useEngineContext from "../../hooks/useEngineContext.js";
|
|
|
2
2
|
import { _asyncToGenerator } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/asyncToGenerator.js";
|
|
3
3
|
import { useSalesSdk } from "../../plus/salesSdk/hooks/useSalesSdk.js";
|
|
4
4
|
import { TEMP_ORDER_SYNC_REQUEST_MESSAGE_TYPE, getTempOrderSyncPayload, shouldApplySharedTempOrderPayload } from "../../plus/salesSdk/tempOrderSync.js";
|
|
5
|
-
import "../../plus/salesSdk/index.js";
|
|
6
5
|
import { useEffect, useRef, useState } from "react";
|
|
7
6
|
//#region src/components/sharedSecondaryBigSale/SharedSecondaryBigSaleReceiver.tsx
|
|
8
7
|
function createRequestId() {
|
|
@@ -2,7 +2,7 @@ import { _defineProperty } from "../../../_virtual/_@oxc-project_runtime@0.122.0
|
|
|
2
2
|
import { _objectSpread2 } from "../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
|
|
3
3
|
import { _asyncToGenerator } from "../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/asyncToGenerator.js";
|
|
4
4
|
import { bookingInputKey } from "./prepareProduct.js";
|
|
5
|
-
import { BookingSelectionError, aggregateResourceGroups, aggregateTimeResourceGroups, fillFixedResources, groupBookingTimes, includeUnavailableConfiguredResources, prepareBookingProjection, queryBookingTimeResources, releaseProjection, resourceSelectionReasons, resourcesMatchPartialSelection, sameBookingTime, sameGroup, sameId, selectable, selectedResourceDetails, selectionSignature
|
|
5
|
+
import { BookingSelectionError, aggregateResourceGroups, aggregateTimeResourceGroups, fillFixedResources, groupBookingTimes, includeUnavailableConfiguredResources, prepareBookingProjection, queryBookingTimeResources, releaseProjection, resourceSelectionReasons, resourcesMatchPartialSelection, sameBookingTime, sameGroup, sameId, selectable, selectedResourceDetails, selectionSignature } from "./queries.js";
|
|
6
6
|
//#region src/components/venueBookingSales/availability/controller.ts
|
|
7
7
|
const emptyState = (quantity = 1) => ({
|
|
8
8
|
status: "idle",
|
|
@@ -115,11 +115,12 @@ var BookingAvailabilityController = class {
|
|
|
115
115
|
}());
|
|
116
116
|
_defineProperty(this, "commit", function() {
|
|
117
117
|
var _ref3 = _asyncToGenerator(function* (orderProduct, options = {}) {
|
|
118
|
-
var _orderProduct$product,
|
|
118
|
+
var _orderProduct$product, _orderProduct$num;
|
|
119
119
|
const input = _this.input;
|
|
120
120
|
if (!(input === null || input === void 0 ? void 0 : input.os.commitAvailabilitySelection)) throw new BookingSelectionError(["AVAILABILITY_UNSUPPORTED"]);
|
|
121
|
-
|
|
122
|
-
if (
|
|
121
|
+
const projection = _this.projection;
|
|
122
|
+
if (_this.disposed || _this.committing || !_this.state.ready || !projection || !_this.intent.candidate || _this.state.requiresOrderReconciliation) throw new BookingSelectionError(["BOOKING_SELECTION_NOT_READY"]);
|
|
123
|
+
if (!sameId((_orderProduct$product = orderProduct.product_id) !== null && _orderProduct$product !== void 0 ? _orderProduct$product : orderProduct.id, projection.productId)) throw new BookingSelectionError(["PRODUCT_SELECTION_CHANGED"]);
|
|
123
124
|
if (Number((_orderProduct$num = orderProduct.num) !== null && _orderProduct$num !== void 0 ? _orderProduct$num : orderProduct.quantity) !== input.quantity) throw new BookingSelectionError(["QUANTITY_SELECTION_CHANGED"]);
|
|
124
125
|
const mode = options.mode || (input.editingProductLineUid ? "edit" : "add");
|
|
125
126
|
if (mode !== "add" && !input.editingProductLineUid || mode === "add" && input.editingProductLineUid) throw new BookingSelectionError(["BOOKING_EDIT_IDENTITY_REQUIRED"]);
|
|
@@ -140,22 +141,20 @@ var BookingAvailabilityController = class {
|
|
|
140
141
|
reasonCodes: [],
|
|
141
142
|
error: void 0
|
|
142
143
|
});
|
|
143
|
-
let verified;
|
|
144
144
|
let writeStarted = false;
|
|
145
145
|
try {
|
|
146
146
|
var _result$validation, _result$validation$co;
|
|
147
147
|
guard();
|
|
148
|
-
verified = yield verifyExactBookingSelection(input, intent);
|
|
149
|
-
guard();
|
|
150
148
|
writeStarted = true;
|
|
151
|
-
const result = yield input.os.commitAvailabilitySelection.call(input.os,
|
|
149
|
+
const result = yield input.os.commitAvailabilitySelection.call(input.os, projection.contextId, _objectSpread2(_objectSpread2({}, options), {}, {
|
|
152
150
|
mode,
|
|
151
|
+
customerSelectionSnapshot: true,
|
|
153
152
|
productLineUid: input.editingProductLineUid,
|
|
154
153
|
orderProduct,
|
|
155
|
-
candidate:
|
|
156
|
-
requirementSelections:
|
|
157
|
-
partySize:
|
|
158
|
-
bookingCount:
|
|
154
|
+
candidate: intent.candidate,
|
|
155
|
+
requirementSelections: intent.requirementSelections,
|
|
156
|
+
partySize: projection.partySize,
|
|
157
|
+
bookingCount: projection.bookingCount,
|
|
159
158
|
availabilityCommitGuard: guard
|
|
160
159
|
}));
|
|
161
160
|
if (((_result$validation = result.validation) === null || _result$validation === void 0 ? void 0 : _result$validation.ok) === false) throw new BookingSelectionError(((_result$validation$co = result.validation.conflicts) === null || _result$validation$co === void 0 ? void 0 : _result$validation$co.map((conflict) => conflict.code || "BOOKING_COMMIT_FAILED")) || ["BOOKING_COMMIT_FAILED"]);
|
|
@@ -163,8 +162,8 @@ var BookingAvailabilityController = class {
|
|
|
163
162
|
status: "committed",
|
|
164
163
|
ready: false,
|
|
165
164
|
reasonCodes: [],
|
|
166
|
-
candidate:
|
|
167
|
-
selectedResourceDetails:
|
|
165
|
+
candidate: intent.candidate,
|
|
166
|
+
selectedResourceDetails: selectedResourceDetails(projection, intent.requirementSelections)
|
|
168
167
|
});
|
|
169
168
|
return result;
|
|
170
169
|
} catch (error) {
|
|
@@ -178,7 +177,6 @@ var BookingAvailabilityController = class {
|
|
|
178
177
|
});
|
|
179
178
|
throw error;
|
|
180
179
|
} finally {
|
|
181
|
-
if (verified) releaseProjection(input.os, verified.projection);
|
|
182
180
|
_this.committing = false;
|
|
183
181
|
}
|
|
184
182
|
});
|
|
@@ -207,6 +205,20 @@ var BookingAvailabilityController = class {
|
|
|
207
205
|
return;
|
|
208
206
|
}
|
|
209
207
|
const previous = _this2.input;
|
|
208
|
+
const selected = _this2.intent.candidate;
|
|
209
|
+
if (previous && _this2.projection && selected && input.mode === "ticket" && !input.editingProductLineUid && !_this2.committing && !input.disabled && input.os === previous.os && input.quantity !== previous.quantity && Number.isSafeInteger(input.quantity) && input.quantity > 0 && Number.isSafeInteger(_this2.projection.partySize * input.quantity) && bookingInputKey(_objectSpread2(_objectSpread2({}, input), {}, { quantity: previous.quantity })) === _this2.inputKey) {
|
|
210
|
+
_this2.input = input;
|
|
211
|
+
_this2.inputKey = key;
|
|
212
|
+
_this2.generation++;
|
|
213
|
+
_this2.queryRevision++;
|
|
214
|
+
_this2.projection = _objectSpread2(_objectSpread2({}, _this2.projection), {}, {
|
|
215
|
+
bookingCount: input.quantity,
|
|
216
|
+
queryPartySize: _this2.projection.partySize * input.quantity
|
|
217
|
+
});
|
|
218
|
+
_this2.publish({ bookingCount: input.quantity });
|
|
219
|
+
yield _this2.resolveTime(selected, false);
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
210
222
|
const isDifferentProduct = previous && !sameId((_previous$product$id = previous.product.id) !== null && _previous$product$id !== void 0 ? _previous$product$id : previous.product.product_id, (_input$product$id = input.product.id) !== null && _input$product$id !== void 0 ? _input$product$id : input.product.product_id);
|
|
211
223
|
if (!previous || isDifferentProduct || previous.editingProductLineUid !== input.editingProductLineUid) _this2.intent = copyIntent(input.initialSelection);
|
|
212
224
|
else if (previous.date !== input.date) _this2.intent = { requirementSelections: [] };
|
|
@@ -195,12 +195,14 @@ function queryBookingResources(_x3, _x4, _x5) {
|
|
|
195
195
|
function _queryBookingResources() {
|
|
196
196
|
_queryBookingResources = _asyncToGenerator(function* (os, projection, candidate) {
|
|
197
197
|
var _range$reasonCodes;
|
|
198
|
-
const
|
|
198
|
+
const query = {
|
|
199
199
|
target: "resource",
|
|
200
200
|
productIds: [projection.productId],
|
|
201
201
|
selectedRanges: [candidate],
|
|
202
|
-
partySize: projection.queryPartySize
|
|
203
|
-
|
|
202
|
+
partySize: projection.queryPartySize,
|
|
203
|
+
customerSelectionSnapshot: true
|
|
204
|
+
};
|
|
205
|
+
const range = (yield os.queryBookingAvailability(projection.contextId, query)).data.filter((group) => sameId(group.productId, projection.productId)).flatMap((group) => group.ranges || []).find((entry) => sameContextualTime(entry.range, candidate));
|
|
204
206
|
if (!range || !selectable(range, projection.queryPartySize)) throw new BookingSelectionError((range === null || range === void 0 || (_range$reasonCodes = range.reasonCodes) === null || _range$reasonCodes === void 0 ? void 0 : _range$reasonCodes.length) ? range.reasonCodes : ["SELECTED_TIME_UNAVAILABLE"]);
|
|
205
207
|
return {
|
|
206
208
|
candidate: range.range,
|
|
@@ -234,7 +236,7 @@ function queryBookingTimeResources(_x7, _x8, _x9) {
|
|
|
234
236
|
function _queryBookingTimeResources() {
|
|
235
237
|
_queryBookingTimeResources = _asyncToGenerator(function* (os, projection, candidate) {
|
|
236
238
|
const interval = bookingTimeIntervalKey(candidate);
|
|
237
|
-
const candidates = projection.times.filter((time) => bookingTimeIntervalKey(time) === interval
|
|
239
|
+
const candidates = projection.times.filter((time) => bookingTimeIntervalKey(time) === interval);
|
|
238
240
|
const results = [];
|
|
239
241
|
for (let index = 0; index < candidates.length; index += 2) {
|
|
240
242
|
const batch = yield Promise.all(candidates.slice(index, index + 2).map(function() {
|
|
@@ -303,33 +305,5 @@ function includeUnavailableConfiguredResources(groups, projection) {
|
|
|
303
305
|
function selectedResourceDetails(projection, selections) {
|
|
304
306
|
return projection.resources.filter((resource) => selections.some((selection) => selection.resourceIds.some((id) => sameId(id, resource.id))));
|
|
305
307
|
}
|
|
306
|
-
function verifyExactBookingSelection(_x10, _x11) {
|
|
307
|
-
return _verifyExactBookingSelection.apply(this, arguments);
|
|
308
|
-
}
|
|
309
|
-
function _verifyExactBookingSelection() {
|
|
310
|
-
_verifyExactBookingSelection = _asyncToGenerator(function* (input, selection) {
|
|
311
|
-
if (!selection.candidate) throw new BookingSelectionError(["TIME_REQUIRED"]);
|
|
312
|
-
const projection = yield prepareBookingProjection(_objectSpread2(_objectSpread2({}, input), {}, { initialSelection: selection }));
|
|
313
|
-
try {
|
|
314
|
-
const candidate = projection.times.find((time) => sameBookingTime(time, selection.candidate) && selectable(time, projection.queryPartySize));
|
|
315
|
-
if (!candidate) throw new BookingSelectionError(["SELECTED_TIME_UNAVAILABLE"]);
|
|
316
|
-
const resourceResult = yield queryBookingResources(input.os, projection, candidate);
|
|
317
|
-
const reasons = resourceSelectionReasons(resourceResult.groups, selection.requirementSelections, projection.queryPartySize);
|
|
318
|
-
if (input.mode === "party" && !resourceResult.groups.length) reasons.push("PARTY_ROOM_CONFIGURATION_REQUIRED");
|
|
319
|
-
if (input.mode === "party" && !selection.requirementSelections.some((item) => item.resourceIds.length)) reasons.push("PARTY_ROOM_REQUIRED");
|
|
320
|
-
if (reasons.length) throw new BookingSelectionError(reasons);
|
|
321
|
-
return {
|
|
322
|
-
projection,
|
|
323
|
-
candidate: resourceResult.candidate,
|
|
324
|
-
requirementSelections: selection.requirementSelections,
|
|
325
|
-
selectedResourceDetails: selectedResourceDetails(projection, selection.requirementSelections)
|
|
326
|
-
};
|
|
327
|
-
} catch (error) {
|
|
328
|
-
releaseProjection(input.os, projection);
|
|
329
|
-
throw error;
|
|
330
|
-
}
|
|
331
|
-
});
|
|
332
|
-
return _verifyExactBookingSelection.apply(this, arguments);
|
|
333
|
-
}
|
|
334
308
|
//#endregion
|
|
335
|
-
export { BookingSelectionError, aggregateResourceGroups, aggregateTimeResourceGroups, bookingTimeIntervalKey, fillFixedResources, groupBookingTimes, includeUnavailableConfiguredResources, prepareBookingProjection, queryBookingResources, queryBookingTimeResources, releaseProjection, resolvePreviewProjectionDateRange, resourceSelectionReasons, resourcesMatchPartialSelection, sameBookingTime, sameContextualTime, sameGroup, sameId, selectable, selectedResourceDetails, selectionSignature
|
|
309
|
+
export { BookingSelectionError, aggregateResourceGroups, aggregateTimeResourceGroups, bookingTimeIntervalKey, fillFixedResources, groupBookingTimes, includeUnavailableConfiguredResources, prepareBookingProjection, queryBookingResources, queryBookingTimeResources, releaseProjection, resolvePreviewProjectionDateRange, resourceSelectionReasons, resourcesMatchPartialSelection, sameBookingTime, sameContextualTime, sameGroup, sameId, selectable, selectedResourceDetails, selectionSignature };
|
|
@@ -7,7 +7,6 @@ import { useSalesSdkHostBridges } from "../../../plus/salesSdk/context/SalesSdkH
|
|
|
7
7
|
import { isVirtualSettlementTempOrder } from "../../../plus/multiCurrencySettlement/index.js";
|
|
8
8
|
import { freePayApi } from "../../Sales/Checkout/serve.js";
|
|
9
9
|
import { useSalesSdkBusinessAvailability } from "../../../plus/salesSdk/context/SalesSdkBusinessAvailabilityContext.js";
|
|
10
|
-
import "../../../plus/salesSdk/index.js";
|
|
11
10
|
import { isSalesOrderSubmitSuccess } from "../../../plus/saleDetail/components/DetailActions/utils.js";
|
|
12
11
|
import { isH5ZeroAmountValue, toFiniteKioskAmount } from "../../bigSale/templates/Kiosk/zeroAmountCheckout.js";
|
|
13
12
|
import { resolveKioskDeferredSubmission } from "../../bigSale/templates/Kiosk/deferredCheckout.js";
|
package/es/index.js
CHANGED
|
@@ -90,7 +90,6 @@ import { useSalesSdkProducts } from "./plus/salesSdk/hooks/useSalesSdkProducts.j
|
|
|
90
90
|
import SalesSdkDemo from "./plus/salesSdk/demo/index.js";
|
|
91
91
|
import { useSalesSdkDish } from "./plus/salesSdk/hooks/useSalesSdkDish.js";
|
|
92
92
|
import { useSyncOsModule } from "./plus/salesSdk/hooks/useSyncOsModule.js";
|
|
93
|
-
import "./plus/salesSdk/index.js";
|
|
94
93
|
import BigSaleRightActionPanel from "./components/BigSaleRightActionPanel/index.js";
|
|
95
94
|
import ResponsiveWrapper from "./components/list/ResponsiveWrapper.js";
|
|
96
95
|
import { resolveBigSaleSelectionFlowConfig } from "./components/bigSale/selectionFlowConfig.js";
|
|
@@ -154,7 +153,6 @@ import PisellVenueControlPage from "./plus/pisellReservation/PisellVenueControlP
|
|
|
154
153
|
import PisellVenueWallPage from "./plus/pisellReservation/PisellVenueWallPage.js";
|
|
155
154
|
import PisellReservationTablePage from "./plus/pisellReservation/PisellReservationTablePage.js";
|
|
156
155
|
import SelectFloorMapResourceDialog from "./plus/pisellReservation/components/SelectFloorMapResourceDialog.js";
|
|
157
|
-
import "./plus/pisellReservation/index.js";
|
|
158
156
|
import { PisellTopology, PisellTopologyCore } from "./plus/pisellTopology/PisellTopology.js";
|
|
159
157
|
import cupProject_default from "./components/ecocup/cupProject/index.js";
|
|
160
158
|
import CupList from "./components/ecocup/cupList/index.js";
|
|
@@ -280,4 +280,4 @@ function attachSelectedSettlement(item, selectedSettlement) {
|
|
|
280
280
|
});
|
|
281
281
|
}
|
|
282
282
|
//#endregion
|
|
283
|
-
export { attachSelectedSettlement, buildSettlementPriceRows, createVirtualOnlySkuDisplayProduct,
|
|
283
|
+
export { attachSelectedSettlement, buildSettlementPriceRows, createVirtualOnlySkuDisplayProduct, formatSettlementAmount, formatSettlementSelectionTotal, formatTempOrderSettlementAmount, getSettlementKey, getSettlementOptions, hasSettlementOptions, hasSufficientVirtualCurrencyBalance, isVirtualOnlySettlementProduct, isVirtualSettlementTempOrder, resolveConfiguredUnavailableReason, resolveLegalSettlementAddOnUnitPrice, resolveSettlementOptionEntries, resolveVirtualSettlementErrorMessage, showVirtualSettlementErrorToast };
|
|
@@ -259,4 +259,4 @@ function bookingListToReservationTableRows(bookings) {
|
|
|
259
259
|
return rows;
|
|
260
260
|
}
|
|
261
261
|
//#endregion
|
|
262
|
-
export { applyHostResourceShellToBaseRow, bookingListToReservationTableRows, customerBrief, extractResourceRecordIds, filterBookingsByResourceIds,
|
|
262
|
+
export { applyHostResourceShellToBaseRow, bookingListToReservationTableRows, customerBrief, extractResourceRecordIds, filterBookingsByResourceIds, hostBookingUiPatchFromRecord, mergeBookingsForResourceRecord };
|
|
@@ -78,4 +78,4 @@ function toastFloorPlanLoadError(err) {
|
|
|
78
78
|
PisellToast({ content: err instanceof Error ? err.message : String(err) });
|
|
79
79
|
}
|
|
80
80
|
//#endregion
|
|
81
|
-
export { PISELL_RESERVATION_FLOOR_PLAN_CODE,
|
|
81
|
+
export { PISELL_RESERVATION_FLOOR_PLAN_CODE, ensureShopFloorPlanByCode, saveViewConfigToShopFloorPlan, shopLayoutToSceneElements$1 as shopLayoutToSceneElements, toastFloorPlanLoadError, toastFloorPlanSaveError, unsubscribeShopFloorPlanCodeQuery };
|
|
@@ -927,4 +927,4 @@ function getReservationDataSourceFormColumns() {
|
|
|
927
927
|
];
|
|
928
928
|
}
|
|
929
929
|
//#endregion
|
|
930
|
-
export { RESERVATION_BOUND_ROUND_TABLE_ELEMENT_KIND, RESERVATION_BOUND_TABLE_ELEMENT_KIND, applyReservationFloorMapLiveLabels,
|
|
930
|
+
export { RESERVATION_BOUND_ROUND_TABLE_ELEMENT_KIND, RESERVATION_BOUND_TABLE_ELEMENT_KIND, applyReservationFloorMapLiveLabels, defaultReservationTableRows, getDefaultReservationFloorMapConfig, getReservationDataSourceFormColumns, getReservationFloorMapShellConfig, mergeFloorMapElementKindCategoriesWithDefaults, mergeFloorMapElementKindsWithDefaults };
|
|
@@ -13,7 +13,6 @@ import { useSalesSdkCustomer } from "../salesSdk/hooks/useSalesSdkCustomer.js";
|
|
|
13
13
|
import locales_default from "./locales.js";
|
|
14
14
|
import { useSalesSdkBookingContext } from "../salesSdk/context/SalesSdkBookingContext.js";
|
|
15
15
|
import { useSalesSdkSummary } from "../salesSdk/hooks/useSalesSdkSummary.js";
|
|
16
|
-
import "../salesSdk/index.js";
|
|
17
16
|
import locales_default$1 from "./components/LineItem/locales.js";
|
|
18
17
|
import { SaleOrderActionBoundary } from "./actions/index.js";
|
|
19
18
|
import { SaleDetailTemplateRenderer } from "./tmpl/index.js";
|
|
@@ -2,7 +2,6 @@ import useEngineContext from "../../../../../hooks/useEngineContext.js";
|
|
|
2
2
|
import { _objectSpread2 } from "../../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
|
|
3
3
|
import { resolveContactsInfo } from "../utils.js";
|
|
4
4
|
import { useSalesSdkBookingContext } from "../../../../salesSdk/context/SalesSdkBookingContext.js";
|
|
5
|
-
import "../../../../salesSdk/index.js";
|
|
6
5
|
import { useMemo } from "react";
|
|
7
6
|
import { useMemoizedFn } from "ahooks";
|
|
8
7
|
//#region src/plus/saleDetail/components/Client/hooks/useClientSelectorProps.ts
|
|
@@ -4,7 +4,6 @@ import { _asyncToGenerator } from "../../../../_virtual/_@oxc-project_runtime@0.
|
|
|
4
4
|
import { _objectWithoutProperties } from "../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectWithoutProperties.js";
|
|
5
5
|
import useLogger from "../../../../hooks/useLogger.js";
|
|
6
6
|
import { useSalesSdk } from "../../../salesSdk/hooks/useSalesSdk.js";
|
|
7
|
-
import "../../../salesSdk/index.js";
|
|
8
7
|
import { invokeLocalReceiptPrint, resolveLocalReceiptPrintModule, resolveSaleDetailOrderIdFromSales } from "./utils.js";
|
|
9
8
|
import { getRemotePrintActions, getWristbandList } from "../../serve.js";
|
|
10
9
|
import { EBizPrintType } from "./types.js";
|
|
@@ -10,7 +10,6 @@ import { useSalesSdk } from "../../../salesSdk/hooks/useSalesSdk.js";
|
|
|
10
10
|
import { useSalesSdkCart } from "../../../salesSdk/hooks/useSalesSdkCart.js";
|
|
11
11
|
import { useSalesSdkGlobalScanActivity } from "../../../salesSdk/context/SalesSdkGlobalScanActivityContext.js";
|
|
12
12
|
import { useSalesSdkSummary } from "../../../salesSdk/hooks/useSalesSdkSummary.js";
|
|
13
|
-
import "../../../salesSdk/index.js";
|
|
14
13
|
import { resolveSaleDetailTempOrder } from "../../utils.js";
|
|
15
14
|
import { getNumericAmount, getSalesHostModule, resolveSaleDetailOrderIdFromSales, resolveSaleDetailOrderIdFromSalesResult, shouldCloseDialogAfterCheckout, updateLocalOrder } from "./utils.js";
|
|
16
15
|
import { deriveSaleOrderSubmitState } from "../../actions/state.js";
|
|
@@ -5,7 +5,6 @@ import { isAppliedPaymentRecord } from "../../../salesSdk/utils/paymentStatus.js
|
|
|
5
5
|
import { useSalesSdk } from "../../../salesSdk/hooks/useSalesSdk.js";
|
|
6
6
|
import { useSalesSdkCart } from "../../../salesSdk/hooks/useSalesSdkCart.js";
|
|
7
7
|
import { useSalesSdkSummary } from "../../../salesSdk/hooks/useSalesSdkSummary.js";
|
|
8
|
-
import "../../../salesSdk/index.js";
|
|
9
8
|
import { resolveSaleDetailTempOrder } from "../../utils.js";
|
|
10
9
|
import React, { memo, useMemo } from "react";
|
|
11
10
|
import { formatAmount, locales } from "@pisell/utils";
|
|
@@ -5,7 +5,6 @@ import { useSalesSdk } from "../salesSdk/hooks/useSalesSdk.js";
|
|
|
5
5
|
import { SalesSdkProvider } from "../salesSdk/context/SalesSdkProvider.js";
|
|
6
6
|
import { SalesSdkDishProvider } from "../salesSdk/context/SalesSdkDishContext.js";
|
|
7
7
|
import { SalesSdkBookingContextProvider } from "../salesSdk/context/SalesSdkBookingContext.js";
|
|
8
|
-
import "../salesSdk/index.js";
|
|
9
8
|
import Base_default from "./Base.js";
|
|
10
9
|
import { resolveSaleDetailOsProps } from "./osProps.js";
|
|
11
10
|
import React, { forwardRef, useImperativeHandle } from "react";
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import useStableInstanceId from "../../../../../../hooks/useStableInstanceId.js";
|
|
2
2
|
import { useSalesSdkDish } from "../../../../../salesSdk/hooks/useSalesSdkDish.js";
|
|
3
3
|
import { useCurrentSalesSdkDish } from "../../../../../salesSdk/hooks/useCurrentSalesSdkDish.js";
|
|
4
|
-
import "../../../../../salesSdk/index.js";
|
|
5
4
|
import { SaleDetailStatusOverview } from "../shared/StatusOverview.js";
|
|
6
5
|
import { DishGroupView } from "./DishGroupView.js";
|
|
7
6
|
import dayjs from "dayjs";
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import useEngineContext from "../../../../hooks/useEngineContext.js";
|
|
2
2
|
import { _objectSpread2 } from "../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
|
|
3
3
|
import { useCurrentSalesSdkDish } from "../../../salesSdk/hooks/useCurrentSalesSdkDish.js";
|
|
4
|
-
import "../../../salesSdk/index.js";
|
|
5
4
|
import { getInternalNotesByScheduleEvent } from "../../serve.js";
|
|
6
5
|
import { TEMPLATE_B_PAY_ACTIONS, TEMPLATE_B_SUMMARY_ACTIONS } from "../../components/DetailActions/configs/index.js";
|
|
7
6
|
import { DetailActions } from "../../components/DetailActions/index.js";
|
|
@@ -31,4 +31,4 @@ function subscribeBookingDateChange(bookingTicket, callback) {
|
|
|
31
31
|
return typeof off === "function" ? off : () => {};
|
|
32
32
|
}
|
|
33
33
|
//#endregion
|
|
34
|
-
export {
|
|
34
|
+
export { formatBookingDateTime, subscribeBookingDateChange };
|
|
@@ -102,4 +102,4 @@ function buildHolderListRequestKey(params) {
|
|
|
102
102
|
});
|
|
103
103
|
}
|
|
104
104
|
//#endregion
|
|
105
|
-
export { buildHolderListRequestKey, buildHolderListRequestParams, enrichCartBookingHolderDisplay, enrichCartProductHolderDisplay,
|
|
105
|
+
export { buildHolderListRequestKey, buildHolderListRequestParams, enrichCartBookingHolderDisplay, enrichCartProductHolderDisplay, resolveHolderDisplayConfig };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AuthMethodType,
|
|
1
|
+
import { AuthMethodType, VerificationMethod } from "./shared/types.js";
|
|
2
2
|
import { Login2, Login2Config, Login2Events, Login2Props } from "./Login2.js";
|
|
3
3
|
import { Register2, Register2Config, Register2Events, Register2Props } from "./Register2.js";
|
|
4
|
-
import { AuthModal } from "./AuthModal.js";
|
|
4
|
+
import { AuthModal, AuthModalProps } from "./AuthModal.js";
|
|
@@ -226,4 +226,4 @@ interface RegisterFormData {
|
|
|
226
226
|
verification_token?: string;
|
|
227
227
|
}
|
|
228
228
|
//#endregion
|
|
229
|
-
export { AuthMethodType, EmailAuthConfig,
|
|
229
|
+
export { AuthMethodType, EmailAuthConfig, LegalTermsConfig, LoginFormData, LoginMethodItem, OAuthConfig, PhoneAuthConfig, RegisterFormData, RegistrationMethodItem, UIConfig, VerificationMethod };
|
|
@@ -115,11 +115,12 @@ var BookingAvailabilityController = class {
|
|
|
115
115
|
}());
|
|
116
116
|
require_defineProperty._defineProperty(this, "commit", function() {
|
|
117
117
|
var _ref3 = require_asyncToGenerator._asyncToGenerator(function* (orderProduct, options = {}) {
|
|
118
|
-
var _orderProduct$product,
|
|
118
|
+
var _orderProduct$product, _orderProduct$num;
|
|
119
119
|
const input = _this.input;
|
|
120
120
|
if (!(input === null || input === void 0 ? void 0 : input.os.commitAvailabilitySelection)) throw new require_queries.BookingSelectionError(["AVAILABILITY_UNSUPPORTED"]);
|
|
121
|
-
|
|
122
|
-
if (
|
|
121
|
+
const projection = _this.projection;
|
|
122
|
+
if (_this.disposed || _this.committing || !_this.state.ready || !projection || !_this.intent.candidate || _this.state.requiresOrderReconciliation) throw new require_queries.BookingSelectionError(["BOOKING_SELECTION_NOT_READY"]);
|
|
123
|
+
if (!require_queries.sameId((_orderProduct$product = orderProduct.product_id) !== null && _orderProduct$product !== void 0 ? _orderProduct$product : orderProduct.id, projection.productId)) throw new require_queries.BookingSelectionError(["PRODUCT_SELECTION_CHANGED"]);
|
|
123
124
|
if (Number((_orderProduct$num = orderProduct.num) !== null && _orderProduct$num !== void 0 ? _orderProduct$num : orderProduct.quantity) !== input.quantity) throw new require_queries.BookingSelectionError(["QUANTITY_SELECTION_CHANGED"]);
|
|
124
125
|
const mode = options.mode || (input.editingProductLineUid ? "edit" : "add");
|
|
125
126
|
if (mode !== "add" && !input.editingProductLineUid || mode === "add" && input.editingProductLineUid) throw new require_queries.BookingSelectionError(["BOOKING_EDIT_IDENTITY_REQUIRED"]);
|
|
@@ -140,22 +141,20 @@ var BookingAvailabilityController = class {
|
|
|
140
141
|
reasonCodes: [],
|
|
141
142
|
error: void 0
|
|
142
143
|
});
|
|
143
|
-
let verified;
|
|
144
144
|
let writeStarted = false;
|
|
145
145
|
try {
|
|
146
146
|
var _result$validation, _result$validation$co;
|
|
147
147
|
guard();
|
|
148
|
-
verified = yield require_queries.verifyExactBookingSelection(input, intent);
|
|
149
|
-
guard();
|
|
150
148
|
writeStarted = true;
|
|
151
|
-
const result = yield input.os.commitAvailabilitySelection.call(input.os,
|
|
149
|
+
const result = yield input.os.commitAvailabilitySelection.call(input.os, projection.contextId, require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, options), {}, {
|
|
152
150
|
mode,
|
|
151
|
+
customerSelectionSnapshot: true,
|
|
153
152
|
productLineUid: input.editingProductLineUid,
|
|
154
153
|
orderProduct,
|
|
155
|
-
candidate:
|
|
156
|
-
requirementSelections:
|
|
157
|
-
partySize:
|
|
158
|
-
bookingCount:
|
|
154
|
+
candidate: intent.candidate,
|
|
155
|
+
requirementSelections: intent.requirementSelections,
|
|
156
|
+
partySize: projection.partySize,
|
|
157
|
+
bookingCount: projection.bookingCount,
|
|
159
158
|
availabilityCommitGuard: guard
|
|
160
159
|
}));
|
|
161
160
|
if (((_result$validation = result.validation) === null || _result$validation === void 0 ? void 0 : _result$validation.ok) === false) throw new require_queries.BookingSelectionError(((_result$validation$co = result.validation.conflicts) === null || _result$validation$co === void 0 ? void 0 : _result$validation$co.map((conflict) => conflict.code || "BOOKING_COMMIT_FAILED")) || ["BOOKING_COMMIT_FAILED"]);
|
|
@@ -163,8 +162,8 @@ var BookingAvailabilityController = class {
|
|
|
163
162
|
status: "committed",
|
|
164
163
|
ready: false,
|
|
165
164
|
reasonCodes: [],
|
|
166
|
-
candidate:
|
|
167
|
-
selectedResourceDetails:
|
|
165
|
+
candidate: intent.candidate,
|
|
166
|
+
selectedResourceDetails: require_queries.selectedResourceDetails(projection, intent.requirementSelections)
|
|
168
167
|
});
|
|
169
168
|
return result;
|
|
170
169
|
} catch (error) {
|
|
@@ -178,7 +177,6 @@ var BookingAvailabilityController = class {
|
|
|
178
177
|
});
|
|
179
178
|
throw error;
|
|
180
179
|
} finally {
|
|
181
|
-
if (verified) require_queries.releaseProjection(input.os, verified.projection);
|
|
182
180
|
_this.committing = false;
|
|
183
181
|
}
|
|
184
182
|
});
|
|
@@ -207,6 +205,20 @@ var BookingAvailabilityController = class {
|
|
|
207
205
|
return;
|
|
208
206
|
}
|
|
209
207
|
const previous = _this2.input;
|
|
208
|
+
const selected = _this2.intent.candidate;
|
|
209
|
+
if (previous && _this2.projection && selected && input.mode === "ticket" && !input.editingProductLineUid && !_this2.committing && !input.disabled && input.os === previous.os && input.quantity !== previous.quantity && Number.isSafeInteger(input.quantity) && input.quantity > 0 && Number.isSafeInteger(_this2.projection.partySize * input.quantity) && require_prepareProduct.bookingInputKey(require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, input), {}, { quantity: previous.quantity })) === _this2.inputKey) {
|
|
210
|
+
_this2.input = input;
|
|
211
|
+
_this2.inputKey = key;
|
|
212
|
+
_this2.generation++;
|
|
213
|
+
_this2.queryRevision++;
|
|
214
|
+
_this2.projection = require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, _this2.projection), {}, {
|
|
215
|
+
bookingCount: input.quantity,
|
|
216
|
+
queryPartySize: _this2.projection.partySize * input.quantity
|
|
217
|
+
});
|
|
218
|
+
_this2.publish({ bookingCount: input.quantity });
|
|
219
|
+
yield _this2.resolveTime(selected, false);
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
210
222
|
const isDifferentProduct = previous && !require_queries.sameId((_previous$product$id = previous.product.id) !== null && _previous$product$id !== void 0 ? _previous$product$id : previous.product.product_id, (_input$product$id = input.product.id) !== null && _input$product$id !== void 0 ? _input$product$id : input.product.product_id);
|
|
211
223
|
if (!previous || isDifferentProduct || previous.editingProductLineUid !== input.editingProductLineUid) _this2.intent = copyIntent(input.initialSelection);
|
|
212
224
|
else if (previous.date !== input.date) _this2.intent = { requirementSelections: [] };
|
|
@@ -195,12 +195,14 @@ function queryBookingResources(_x3, _x4, _x5) {
|
|
|
195
195
|
function _queryBookingResources() {
|
|
196
196
|
_queryBookingResources = require_asyncToGenerator._asyncToGenerator(function* (os, projection, candidate) {
|
|
197
197
|
var _range$reasonCodes;
|
|
198
|
-
const
|
|
198
|
+
const query = {
|
|
199
199
|
target: "resource",
|
|
200
200
|
productIds: [projection.productId],
|
|
201
201
|
selectedRanges: [candidate],
|
|
202
|
-
partySize: projection.queryPartySize
|
|
203
|
-
|
|
202
|
+
partySize: projection.queryPartySize,
|
|
203
|
+
customerSelectionSnapshot: true
|
|
204
|
+
};
|
|
205
|
+
const range = (yield os.queryBookingAvailability(projection.contextId, query)).data.filter((group) => sameId(group.productId, projection.productId)).flatMap((group) => group.ranges || []).find((entry) => sameContextualTime(entry.range, candidate));
|
|
204
206
|
if (!range || !selectable(range, projection.queryPartySize)) throw new BookingSelectionError((range === null || range === void 0 || (_range$reasonCodes = range.reasonCodes) === null || _range$reasonCodes === void 0 ? void 0 : _range$reasonCodes.length) ? range.reasonCodes : ["SELECTED_TIME_UNAVAILABLE"]);
|
|
205
207
|
return {
|
|
206
208
|
candidate: range.range,
|
|
@@ -234,7 +236,7 @@ function queryBookingTimeResources(_x7, _x8, _x9) {
|
|
|
234
236
|
function _queryBookingTimeResources() {
|
|
235
237
|
_queryBookingTimeResources = require_asyncToGenerator._asyncToGenerator(function* (os, projection, candidate) {
|
|
236
238
|
const interval = bookingTimeIntervalKey(candidate);
|
|
237
|
-
const candidates = projection.times.filter((time) => bookingTimeIntervalKey(time) === interval
|
|
239
|
+
const candidates = projection.times.filter((time) => bookingTimeIntervalKey(time) === interval);
|
|
238
240
|
const results = [];
|
|
239
241
|
for (let index = 0; index < candidates.length; index += 2) {
|
|
240
242
|
const batch = yield Promise.all(candidates.slice(index, index + 2).map(function() {
|
|
@@ -303,34 +305,6 @@ function includeUnavailableConfiguredResources(groups, projection) {
|
|
|
303
305
|
function selectedResourceDetails(projection, selections) {
|
|
304
306
|
return projection.resources.filter((resource) => selections.some((selection) => selection.resourceIds.some((id) => sameId(id, resource.id))));
|
|
305
307
|
}
|
|
306
|
-
function verifyExactBookingSelection(_x10, _x11) {
|
|
307
|
-
return _verifyExactBookingSelection.apply(this, arguments);
|
|
308
|
-
}
|
|
309
|
-
function _verifyExactBookingSelection() {
|
|
310
|
-
_verifyExactBookingSelection = require_asyncToGenerator._asyncToGenerator(function* (input, selection) {
|
|
311
|
-
if (!selection.candidate) throw new BookingSelectionError(["TIME_REQUIRED"]);
|
|
312
|
-
const projection = yield prepareBookingProjection(require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, input), {}, { initialSelection: selection }));
|
|
313
|
-
try {
|
|
314
|
-
const candidate = projection.times.find((time) => sameBookingTime(time, selection.candidate) && selectable(time, projection.queryPartySize));
|
|
315
|
-
if (!candidate) throw new BookingSelectionError(["SELECTED_TIME_UNAVAILABLE"]);
|
|
316
|
-
const resourceResult = yield queryBookingResources(input.os, projection, candidate);
|
|
317
|
-
const reasons = resourceSelectionReasons(resourceResult.groups, selection.requirementSelections, projection.queryPartySize);
|
|
318
|
-
if (input.mode === "party" && !resourceResult.groups.length) reasons.push("PARTY_ROOM_CONFIGURATION_REQUIRED");
|
|
319
|
-
if (input.mode === "party" && !selection.requirementSelections.some((item) => item.resourceIds.length)) reasons.push("PARTY_ROOM_REQUIRED");
|
|
320
|
-
if (reasons.length) throw new BookingSelectionError(reasons);
|
|
321
|
-
return {
|
|
322
|
-
projection,
|
|
323
|
-
candidate: resourceResult.candidate,
|
|
324
|
-
requirementSelections: selection.requirementSelections,
|
|
325
|
-
selectedResourceDetails: selectedResourceDetails(projection, selection.requirementSelections)
|
|
326
|
-
};
|
|
327
|
-
} catch (error) {
|
|
328
|
-
releaseProjection(input.os, projection);
|
|
329
|
-
throw error;
|
|
330
|
-
}
|
|
331
|
-
});
|
|
332
|
-
return _verifyExactBookingSelection.apply(this, arguments);
|
|
333
|
-
}
|
|
334
308
|
//#endregion
|
|
335
309
|
exports.BookingSelectionError = BookingSelectionError;
|
|
336
310
|
exports.aggregateResourceGroups = aggregateResourceGroups;
|
|
@@ -353,4 +327,3 @@ exports.sameId = sameId;
|
|
|
353
327
|
exports.selectable = selectable;
|
|
354
328
|
exports.selectedResourceDetails = selectedResourceDetails;
|
|
355
329
|
exports.selectionSignature = selectionSignature;
|
|
356
|
-
exports.verifyExactBookingSelection = verifyExactBookingSelection;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/private-materials",
|
|
3
|
-
"version": "6.12.
|
|
3
|
+
"version": "6.12.420",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -76,9 +76,9 @@
|
|
|
76
76
|
"use-sync-external-store": "^1.6.0",
|
|
77
77
|
"@pisell/pi-payment-sdk": "0.0.4",
|
|
78
78
|
"@pisell/utils": "3.0.7",
|
|
79
|
-
"@pisell/icon": "0.0.11",
|
|
80
79
|
"@pisell/materials": "6.12.93",
|
|
81
|
-
"@pisell/date-picker": "3.0.12"
|
|
80
|
+
"@pisell/date-picker": "3.0.12",
|
|
81
|
+
"@pisell/icon": "0.0.11"
|
|
82
82
|
},
|
|
83
83
|
"peerDependencies": {
|
|
84
84
|
"react": "^18.0.0",
|