@pisell/pisellos 2.2.244 → 2.2.246
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/model/strategy/adapter/promotion/evaluator.js +3 -2
- package/dist/model/strategy/adapter/walletPass/utils.js +7 -4
- package/dist/modules/BookingContext/index.d.ts +48 -0
- package/dist/modules/BookingContext/index.js +566 -0
- package/dist/modules/BookingContext/types.d.ts +102 -0
- package/dist/modules/BookingContext/types.js +51 -0
- package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts +16 -0
- package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +284 -0
- package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +8 -0
- package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +148 -0
- package/dist/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +76 -0
- package/dist/modules/BookingContext/utils/cacheItemToBookingInput.js +218 -0
- package/dist/modules/BookingContext/utils/flexible.d.ts +28 -0
- package/dist/modules/BookingContext/utils/flexible.js +56 -0
- package/dist/modules/BookingContext/utils/formatResourceList.d.ts +8 -0
- package/dist/modules/BookingContext/utils/formatResourceList.js +38 -0
- package/dist/modules/BookingContext/utils/index.d.ts +11 -0
- package/dist/modules/BookingContext/utils/index.js +11 -0
- package/dist/modules/BookingContext/utils/noResource.d.ts +13 -0
- package/dist/modules/BookingContext/utils/noResource.js +77 -0
- package/dist/modules/BookingContext/utils/orderLineDisplay.d.ts +1 -0
- package/dist/modules/BookingContext/utils/orderLineDisplay.js +36 -0
- package/dist/modules/BookingContext/utils/productExtend.d.ts +72 -0
- package/dist/modules/BookingContext/utils/productExtend.js +339 -0
- package/dist/modules/BookingContext/utils/resourceErrors.d.ts +41 -0
- package/dist/modules/BookingContext/utils/resourceErrors.js +74 -0
- package/dist/modules/BookingContext/utils/resourceSelection.d.ts +7 -0
- package/dist/modules/BookingContext/utils/resourceSelection.js +24 -0
- package/dist/modules/BookingContext/utils/resources.d.ts +80 -0
- package/dist/modules/BookingContext/utils/resources.js +486 -0
- package/dist/modules/BookingContext/utils/serviceTimes.d.ts +55 -0
- package/dist/modules/BookingContext/utils/serviceTimes.js +151 -0
- package/dist/modules/BookingContext/utils/timeSlices.d.ts +42 -0
- package/dist/modules/BookingContext/utils/timeSlices.js +100 -0
- package/dist/modules/Cart/utils/cartProduct.js +24 -3
- package/dist/modules/Cart/utils/changePrice.js +11 -11
- package/dist/modules/Customer/index.d.ts +20 -0
- package/dist/modules/Customer/index.js +172 -83
- package/dist/modules/Customer/types.d.ts +2 -0
- package/dist/modules/Discount/index.d.ts +1 -1
- package/dist/modules/Discount/index.js +13 -6
- package/dist/modules/Discount/types.d.ts +1 -0
- package/dist/modules/OpenData/index.d.ts +8 -0
- package/dist/modules/OpenData/index.js +37 -17
- package/dist/modules/Order/index.d.ts +277 -18
- package/dist/modules/Order/index.js +3581 -779
- package/dist/modules/Order/types.d.ts +286 -31
- package/dist/modules/Order/types.js +38 -0
- package/dist/modules/Order/utils/manualProductDiscount.d.ts +106 -0
- package/dist/modules/Order/utils/manualProductDiscount.js +210 -0
- package/dist/modules/Order/utils.d.ts +147 -5
- package/dist/modules/Order/utils.js +750 -104
- package/dist/modules/Payment/index.d.ts +10 -13
- package/dist/modules/Payment/index.js +467 -837
- package/dist/modules/Payment/types.d.ts +2 -0
- package/dist/modules/Payment/utils.js +2 -1
- package/dist/modules/Payment/walletpass.js +41 -25
- package/dist/modules/ProductList/index.d.ts +16 -12
- package/dist/modules/ProductList/index.js +133 -59
- package/dist/modules/ProductList/types.d.ts +14 -0
- package/dist/modules/Quotation/index.d.ts +0 -1
- package/dist/modules/Quotation/index.js +25 -22
- package/dist/modules/Rules/index.d.ts +4 -0
- package/dist/modules/Rules/index.js +97 -70
- package/dist/modules/Rules/types.d.ts +1 -0
- package/dist/modules/SalesSummary/index.d.ts +8 -25
- package/dist/modules/SalesSummary/index.js +86 -35
- package/dist/modules/SalesSummary/types.d.ts +4 -1
- package/dist/modules/SalesSummary/utils.d.ts +2 -25
- package/dist/modules/SalesSummary/utils.js +794 -162
- package/dist/modules/Schedule/index.d.ts +7 -0
- package/dist/modules/Schedule/index.js +24 -2
- package/dist/modules/Summary/index.js +4 -3
- package/dist/modules/SurchargeList/index.d.ts +16 -0
- package/dist/modules/SurchargeList/index.js +162 -0
- package/dist/modules/SurchargeList/types.d.ts +11 -0
- package/dist/modules/SurchargeList/types.js +1 -0
- package/dist/modules/index.d.ts +2 -0
- package/dist/modules/index.js +3 -1
- package/dist/plugins/request.d.ts +1 -0
- package/dist/server/index.d.ts +204 -1
- package/dist/server/index.js +3654 -922
- package/dist/server/modules/index.d.ts +2 -0
- package/dist/server/modules/index.js +2 -0
- package/dist/server/modules/order/index.d.ts +120 -3
- package/dist/server/modules/order/index.js +1762 -448
- package/dist/server/modules/order/types.d.ts +32 -3
- package/dist/server/modules/order/types.js +8 -0
- package/dist/server/modules/order/utils/filterBookings.js +26 -3
- package/dist/server/modules/order/utils/filterOrders.js +23 -8
- package/dist/server/modules/payment/index.d.ts +28 -0
- package/dist/server/modules/payment/index.js +305 -0
- package/dist/server/modules/payment/types.d.ts +9 -0
- package/dist/server/modules/payment/types.js +1 -0
- package/dist/server/modules/products/index.d.ts +34 -7
- package/dist/server/modules/products/index.js +631 -317
- package/dist/server/modules/resource/index.d.ts +2 -0
- package/dist/server/modules/resource/index.js +29 -3
- package/dist/server/modules/schedule/index.d.ts +4 -4
- package/dist/server/modules/schedule/index.js +111 -88
- package/dist/server/test.json +713 -0
- package/dist/server/utils/small-ticket.d.ts +71 -0
- package/dist/server/utils/small-ticket.js +840 -0
- package/dist/solution/BaseSales/index.d.ts +133 -10
- package/dist/solution/BaseSales/index.js +1950 -447
- package/dist/solution/BaseSales/types.d.ts +82 -6
- package/dist/solution/BaseSales/types.js +5 -4
- package/dist/solution/BaseSales/utils/cartPromotion.d.ts +287 -0
- package/dist/solution/BaseSales/utils/cartPromotion.js +1438 -0
- package/dist/solution/BaseSales/utils/quotationPrice.d.ts +7 -0
- package/dist/solution/BaseSales/utils/quotationPrice.js +237 -0
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +1 -0
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +105 -24
- package/dist/solution/BaseSales/utils.d.ts +1 -1
- package/dist/solution/BaseSales/utils.js +62 -21
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.d.ts +271 -11
- package/dist/solution/BookingTicket/index.js +1777 -242
- package/dist/solution/BookingTicket/types.d.ts +118 -1
- package/dist/solution/BookingTicket/types.js +41 -2
- package/dist/solution/BookingTicket/utils/addProductDecision.d.ts +117 -0
- package/dist/solution/BookingTicket/utils/addProductDecision.js +346 -0
- package/dist/solution/BookingTicket/utils/addTimeAvailability.d.ts +35 -0
- package/dist/solution/BookingTicket/utils/addTimeAvailability.js +95 -0
- package/dist/solution/BookingTicket/utils/bookingStatus.d.ts +40 -0
- package/dist/solution/BookingTicket/utils/bookingStatus.js +70 -0
- package/dist/solution/BookingTicket/utils/cartView.d.ts +9 -1
- package/dist/solution/BookingTicket/utils/cartView.js +94 -7
- package/dist/solution/BookingTicket/utils/exampleData.d.ts +123 -0
- package/dist/solution/BookingTicket/utils/exampleData.js +183 -0
- package/dist/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +185 -0
- package/dist/solution/BookingTicket/utils/resolveBestAddTimePlan.js +438 -0
- package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +36 -0
- package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +400 -0
- package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +32 -0
- package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.js +56 -0
- package/dist/solution/BookingTicket/utils/scan/index.d.ts +5 -0
- package/dist/solution/BookingTicket/utils/scan/index.js +20 -8
- package/dist/solution/BookingTicket/utils/scan/scanProductValues.d.ts +21 -0
- package/dist/solution/BookingTicket/utils/scan/scanProductValues.js +150 -0
- package/dist/solution/BookingTicket/utils/sessionCatalogStale.d.ts +23 -0
- package/dist/solution/BookingTicket/utils/sessionCatalogStale.js +78 -0
- package/dist/solution/Checkout/index.d.ts +1 -0
- package/dist/solution/Checkout/index.js +10 -9
- package/dist/solution/RegisterAndLogin/config.js +2 -10
- package/dist/solution/ScanOrder/index.d.ts +9 -3
- package/dist/solution/ScanOrder/index.js +241 -134
- package/dist/solution/ScanOrder/types.d.ts +9 -5
- package/dist/solution/ScanOrder/types.js +2 -3
- package/dist/solution/ScanOrder/utils.d.ts +1 -1
- package/dist/solution/ScanOrder/utils.js +84 -22
- package/dist/solution/VenueBooking/index.d.ts +5 -2
- package/dist/solution/VenueBooking/index.js +110 -59
- package/dist/solution/VenueBooking/sales-section-4-annotated.json +0 -2
- package/dist/solution/VenueBooking/utils/slotMerge.d.ts +4 -0
- package/dist/solution/VenueBooking/utils/slotMerge.js +10 -0
- package/dist/types/index.d.ts +10 -0
- package/lib/model/strategy/adapter/promotion/evaluator.js +2 -1
- package/lib/model/strategy/adapter/promotion/index.js +49 -0
- package/lib/model/strategy/adapter/walletPass/utils.js +3 -2
- package/lib/modules/BookingContext/index.d.ts +48 -0
- package/lib/modules/BookingContext/index.js +368 -0
- package/lib/modules/BookingContext/types.d.ts +102 -0
- package/lib/modules/BookingContext/types.js +34 -0
- package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts +16 -0
- package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +276 -0
- package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +8 -0
- package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +154 -0
- package/lib/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +76 -0
- package/lib/modules/BookingContext/utils/cacheItemToBookingInput.js +201 -0
- package/lib/modules/BookingContext/utils/flexible.d.ts +28 -0
- package/lib/modules/BookingContext/utils/flexible.js +80 -0
- package/lib/modules/BookingContext/utils/formatResourceList.d.ts +8 -0
- package/lib/modules/BookingContext/utils/formatResourceList.js +50 -0
- package/lib/modules/BookingContext/utils/index.d.ts +11 -0
- package/lib/modules/BookingContext/utils/index.js +43 -0
- package/lib/modules/BookingContext/utils/noResource.d.ts +13 -0
- package/lib/modules/BookingContext/utils/noResource.js +90 -0
- package/lib/modules/BookingContext/utils/orderLineDisplay.d.ts +1 -0
- package/lib/modules/BookingContext/utils/orderLineDisplay.js +56 -0
- package/lib/modules/BookingContext/utils/productExtend.d.ts +72 -0
- package/lib/modules/BookingContext/utils/productExtend.js +283 -0
- package/lib/modules/BookingContext/utils/resourceErrors.d.ts +41 -0
- package/lib/modules/BookingContext/utils/resourceErrors.js +80 -0
- package/lib/modules/BookingContext/utils/resourceSelection.d.ts +7 -0
- package/lib/modules/BookingContext/utils/resourceSelection.js +46 -0
- package/lib/modules/BookingContext/utils/resources.d.ts +80 -0
- package/lib/modules/BookingContext/utils/resources.js +377 -0
- package/lib/modules/BookingContext/utils/serviceTimes.d.ts +55 -0
- package/lib/modules/BookingContext/utils/serviceTimes.js +162 -0
- package/lib/modules/BookingContext/utils/timeSlices.d.ts +42 -0
- package/lib/modules/BookingContext/utils/timeSlices.js +124 -0
- package/lib/modules/Cart/utils/cartProduct.js +20 -3
- package/lib/modules/Cart/utils/changePrice.js +12 -20
- package/lib/modules/Customer/index.d.ts +20 -0
- package/lib/modules/Customer/index.js +64 -11
- package/lib/modules/Customer/types.d.ts +2 -0
- package/lib/modules/Discount/index.d.ts +1 -1
- package/lib/modules/Discount/index.js +9 -1
- package/lib/modules/Discount/types.d.ts +1 -0
- package/lib/modules/OpenData/index.d.ts +8 -0
- package/lib/modules/OpenData/index.js +19 -5
- package/lib/modules/Order/index.d.ts +277 -18
- package/lib/modules/Order/index.js +2317 -337
- package/lib/modules/Order/types.d.ts +286 -31
- package/lib/modules/Order/types.js +1 -0
- package/lib/modules/Order/utils/manualProductDiscount.d.ts +106 -0
- package/lib/modules/Order/utils/manualProductDiscount.js +206 -0
- package/lib/modules/Order/utils.d.ts +147 -5
- package/lib/modules/Order/utils.js +615 -46
- package/lib/modules/Payment/index.d.ts +10 -13
- package/lib/modules/Payment/index.js +18 -150
- package/lib/modules/Payment/types.d.ts +2 -0
- package/lib/modules/Payment/utils.js +2 -1
- package/lib/modules/Payment/walletpass.js +16 -3
- package/lib/modules/ProductList/index.d.ts +16 -12
- package/lib/modules/ProductList/index.js +41 -4
- package/lib/modules/ProductList/types.d.ts +14 -0
- package/lib/modules/Quotation/index.d.ts +0 -1
- package/lib/modules/Quotation/index.js +19 -16
- package/lib/modules/Rules/index.d.ts +4 -0
- package/lib/modules/Rules/index.js +137 -120
- package/lib/modules/Rules/types.d.ts +1 -0
- package/lib/modules/SalesSummary/index.d.ts +8 -25
- package/lib/modules/SalesSummary/index.js +30 -4
- package/lib/modules/SalesSummary/types.d.ts +4 -1
- package/lib/modules/SalesSummary/utils.d.ts +2 -25
- package/lib/modules/SalesSummary/utils.js +645 -91
- package/lib/modules/Schedule/index.d.ts +7 -0
- package/lib/modules/Schedule/index.js +17 -1
- package/lib/modules/Summary/index.js +5 -4
- package/lib/modules/SurchargeList/index.d.ts +16 -0
- package/lib/modules/SurchargeList/index.js +89 -0
- package/lib/modules/SurchargeList/types.d.ts +11 -0
- package/lib/modules/SurchargeList/types.js +17 -0
- package/lib/modules/index.d.ts +2 -0
- package/lib/modules/index.js +5 -1
- package/lib/plugins/request.d.ts +1 -0
- package/lib/server/index.d.ts +204 -1
- package/lib/server/index.js +1891 -59
- package/lib/server/modules/index.d.ts +2 -0
- package/lib/server/modules/index.js +3 -0
- package/lib/server/modules/order/index.d.ts +120 -3
- package/lib/server/modules/order/index.js +887 -94
- package/lib/server/modules/order/types.d.ts +32 -3
- package/lib/server/modules/order/utils/filterBookings.js +24 -5
- package/lib/server/modules/order/utils/filterOrders.js +15 -6
- package/lib/server/modules/payment/index.d.ts +28 -0
- package/lib/server/modules/payment/index.js +192 -0
- package/lib/server/modules/payment/types.d.ts +9 -0
- package/lib/server/modules/payment/types.js +17 -0
- package/lib/server/modules/products/index.d.ts +34 -7
- package/lib/server/modules/products/index.js +189 -54
- package/lib/server/modules/resource/index.d.ts +2 -0
- package/lib/server/modules/resource/index.js +27 -3
- package/lib/server/modules/schedule/index.d.ts +4 -4
- package/lib/server/modules/schedule/index.js +47 -40
- package/lib/server/test.json +713 -0
- package/lib/server/utils/small-ticket.d.ts +71 -0
- package/lib/server/utils/small-ticket.js +800 -0
- package/lib/solution/BaseSales/index.d.ts +133 -10
- package/lib/solution/BaseSales/index.js +1111 -63
- package/lib/solution/BaseSales/types.d.ts +82 -6
- package/lib/solution/BaseSales/types.js +3 -1
- package/lib/solution/BaseSales/utils/cartPromotion.d.ts +287 -0
- package/lib/solution/BaseSales/utils/cartPromotion.js +992 -0
- package/lib/solution/BaseSales/utils/quotationPrice.d.ts +7 -0
- package/lib/solution/BaseSales/utils/quotationPrice.js +277 -0
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +1 -0
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +106 -18
- package/lib/solution/BaseSales/utils.d.ts +1 -1
- package/lib/solution/BaseSales/utils.js +54 -10
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.d.ts +271 -11
- package/lib/solution/BookingTicket/index.js +922 -29
- package/lib/solution/BookingTicket/types.d.ts +118 -1
- package/lib/solution/BookingTicket/types.js +11 -0
- package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +117 -0
- package/lib/solution/BookingTicket/utils/addProductDecision.js +318 -0
- package/lib/solution/BookingTicket/utils/addTimeAvailability.d.ts +35 -0
- package/lib/solution/BookingTicket/utils/addTimeAvailability.js +125 -0
- package/lib/solution/BookingTicket/utils/bookingStatus.d.ts +40 -0
- package/lib/solution/BookingTicket/utils/bookingStatus.js +44 -2
- package/lib/solution/BookingTicket/utils/cartView.d.ts +9 -1
- package/lib/solution/BookingTicket/utils/cartView.js +61 -6
- package/lib/solution/BookingTicket/utils/exampleData.d.ts +123 -0
- package/lib/solution/BookingTicket/utils/exampleData.js +0 -0
- package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +185 -0
- package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.js +254 -0
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +36 -0
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +169 -0
- package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +32 -0
- package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.js +51 -0
- package/lib/solution/BookingTicket/utils/scan/index.d.ts +5 -0
- package/lib/solution/BookingTicket/utils/scan/index.js +17 -3
- package/lib/solution/BookingTicket/utils/scan/scanProductValues.d.ts +21 -0
- package/lib/solution/BookingTicket/utils/scan/scanProductValues.js +127 -0
- package/lib/solution/BookingTicket/utils/sessionCatalogStale.d.ts +23 -0
- package/lib/solution/BookingTicket/utils/sessionCatalogStale.js +85 -0
- package/lib/solution/Checkout/index.d.ts +1 -0
- package/lib/solution/Checkout/index.js +1 -2
- package/lib/solution/RegisterAndLogin/config.js +2 -10
- package/lib/solution/ScanOrder/index.d.ts +9 -3
- package/lib/solution/ScanOrder/index.js +153 -70
- package/lib/solution/ScanOrder/types.d.ts +9 -5
- package/lib/solution/ScanOrder/utils.d.ts +1 -1
- package/lib/solution/ScanOrder/utils.js +83 -17
- package/lib/solution/VenueBooking/index.d.ts +5 -2
- package/lib/solution/VenueBooking/index.js +54 -17
- package/lib/solution/VenueBooking/sales-section-4-annotated.json +0 -2
- package/lib/solution/VenueBooking/utils/slotMerge.d.ts +4 -0
- package/lib/solution/VenueBooking/utils/slotMerge.js +10 -0
- package/lib/types/index.d.ts +10 -0
- package/package.json +1 -1
- package/dist/solution/Checkout/appointmentDemo.json +0 -1
- package/lib/solution/Checkout/appointmentDemo.json +0 -1
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/solution/BookingTicket/utils/scan/scanProductValues.ts
|
|
20
|
+
var scanProductValues_exports = {};
|
|
21
|
+
__export(scanProductValues_exports, {
|
|
22
|
+
countScanVariantMatches: () => countScanVariantMatches,
|
|
23
|
+
genScanProductValues: () => genScanProductValues,
|
|
24
|
+
isScanProductBundle: () => isScanProductBundle,
|
|
25
|
+
isScanProductOption: () => isScanProductOption
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(scanProductValues_exports);
|
|
28
|
+
function isScanProductBundle(item) {
|
|
29
|
+
return ((item == null ? void 0 : item.bundle_group_count) || 0) > 0;
|
|
30
|
+
}
|
|
31
|
+
function isScanProductOption(item) {
|
|
32
|
+
var _a;
|
|
33
|
+
return ((item == null ? void 0 : item.option_group_count) || 0) > 0 || (((_a = item == null ? void 0 : item.option_group) == null ? void 0 : _a.length) || 0) > 0;
|
|
34
|
+
}
|
|
35
|
+
function formatVariantGroupTitle(title, variantGroup = []) {
|
|
36
|
+
try {
|
|
37
|
+
return variantGroup.map((group) => {
|
|
38
|
+
const value = title == null ? void 0 : title[group == null ? void 0 : group.position_id];
|
|
39
|
+
return value ? `${(group == null ? void 0 : group.name) || "-"}: ${value}` : "";
|
|
40
|
+
}).filter(Boolean).join(", ");
|
|
41
|
+
} catch {
|
|
42
|
+
return "";
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function formatDataKey(data) {
|
|
46
|
+
var _a, _b, _c, _d;
|
|
47
|
+
const next = { ...data };
|
|
48
|
+
let key = `${next.product_id}`;
|
|
49
|
+
let rowKey = key;
|
|
50
|
+
if (next.product_variant_id) {
|
|
51
|
+
const str = `_${next.product_variant_id}`;
|
|
52
|
+
key += str;
|
|
53
|
+
rowKey += str;
|
|
54
|
+
}
|
|
55
|
+
if ((_a = next == null ? void 0 : next.option) == null ? void 0 : _a.length) {
|
|
56
|
+
for (const item of next.option) {
|
|
57
|
+
const str = `_${item.option_group_id}_${item.product_option_item_id}`;
|
|
58
|
+
key += str;
|
|
59
|
+
rowKey += `${str}_${item.quantity || item.num}`;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
if ((_b = next == null ? void 0 : next.bundle) == null ? void 0 : _b.length) {
|
|
63
|
+
for (const item of next.bundle) {
|
|
64
|
+
let str = `_${item.group_id}_${item.bundle_product_id}`;
|
|
65
|
+
key += str;
|
|
66
|
+
rowKey += `${str}_${item.quantity || item.num}`;
|
|
67
|
+
if (item == null ? void 0 : item.option) {
|
|
68
|
+
for (const opt of item.option) {
|
|
69
|
+
const optStr = `_${opt.option_group_id}_${opt.product_option_item_id}`;
|
|
70
|
+
key += optStr;
|
|
71
|
+
rowKey += `${optStr}_${opt.quantity || opt.num}`;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
if (next == null ? void 0 : next.session) {
|
|
77
|
+
const str = `_${(_c = next.session) == null ? void 0 : _c.key}`;
|
|
78
|
+
key += str;
|
|
79
|
+
rowKey += str;
|
|
80
|
+
}
|
|
81
|
+
if (next == null ? void 0 : next.schedule) {
|
|
82
|
+
const str = `_${(_d = next.schedule) == null ? void 0 : _d.key}`;
|
|
83
|
+
key += str;
|
|
84
|
+
rowKey += str;
|
|
85
|
+
}
|
|
86
|
+
next.key = key;
|
|
87
|
+
next.rowKey = rowKey;
|
|
88
|
+
return next;
|
|
89
|
+
}
|
|
90
|
+
function genScanProductValues(item, code) {
|
|
91
|
+
var _a, _b;
|
|
92
|
+
const params = {
|
|
93
|
+
bundle: [],
|
|
94
|
+
option: [],
|
|
95
|
+
product_id: item.id,
|
|
96
|
+
product_variant_id: 0,
|
|
97
|
+
quantity: 1,
|
|
98
|
+
rowKey: "",
|
|
99
|
+
session: null
|
|
100
|
+
};
|
|
101
|
+
if (((_a = item == null ? void 0 : item.variant_group) == null ? void 0 : _a.length) || ((_b = item == null ? void 0 : item.option_group) == null ? void 0 : _b.length)) {
|
|
102
|
+
const variantItem = (item.variant || []).find(
|
|
103
|
+
(v) => (v == null ? void 0 : v.code) === code || (v == null ? void 0 : v.barcode) === code
|
|
104
|
+
);
|
|
105
|
+
if (variantItem) {
|
|
106
|
+
params.price = Number((variantItem == null ? void 0 : variantItem.price) || 0);
|
|
107
|
+
params.product_variant_id = variantItem.id;
|
|
108
|
+
params.product_option_string = formatVariantGroupTitle(
|
|
109
|
+
variantItem == null ? void 0 : variantItem.title,
|
|
110
|
+
(item == null ? void 0 : item.variant_group) || []
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return formatDataKey(params);
|
|
115
|
+
}
|
|
116
|
+
function countScanVariantMatches(item, code) {
|
|
117
|
+
return ((item == null ? void 0 : item.variant) || []).filter(
|
|
118
|
+
(v) => (v == null ? void 0 : v.code) === code || (v == null ? void 0 : v.barcode) === code
|
|
119
|
+
).length;
|
|
120
|
+
}
|
|
121
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
122
|
+
0 && (module.exports = {
|
|
123
|
+
countScanVariantMatches,
|
|
124
|
+
genScanProductValues,
|
|
125
|
+
isScanProductBundle,
|
|
126
|
+
isScanProductOption
|
|
127
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ProductData } from '../../../modules/Product/types';
|
|
2
|
+
export interface SessionCatalogStaleInfo {
|
|
3
|
+
productId: number | string | null;
|
|
4
|
+
productTitle: string | null;
|
|
5
|
+
sessionDay: string | null;
|
|
6
|
+
timeBarDay: string | null;
|
|
7
|
+
bookingDate: unknown;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* 判断 session 商品 catalog 中的 session 日历日是否与当前 TimeBar / bookingDate 不一致。
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* isSessionCatalogDateStale(product, '2026-06-05 19:01:18');
|
|
14
|
+
* // session 为 2026-06-04 → true;一致或无 session 快照 → false
|
|
15
|
+
*/
|
|
16
|
+
export declare function isSessionCatalogDateStale(product: ProductData & Record<string, any>, bookingDate: unknown): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* 组装 session catalog 日期不一致时的日志 metadata。
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* buildSessionCatalogStaleInfo(product, '2026-06-05 19:01:18');
|
|
22
|
+
*/
|
|
23
|
+
export declare function buildSessionCatalogStaleInfo(product: ProductData & Record<string, any>, bookingDate: unknown): SessionCatalogStaleInfo;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/solution/BookingTicket/utils/sessionCatalogStale.ts
|
|
30
|
+
var sessionCatalogStale_exports = {};
|
|
31
|
+
__export(sessionCatalogStale_exports, {
|
|
32
|
+
buildSessionCatalogStaleInfo: () => buildSessionCatalogStaleInfo,
|
|
33
|
+
isSessionCatalogDateStale: () => isSessionCatalogDateStale
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(sessionCatalogStale_exports);
|
|
36
|
+
var import_dayjs = __toESM(require("dayjs"));
|
|
37
|
+
var SESSION_EXTENSION_TYPES = ["session_product", "session_ticket"];
|
|
38
|
+
function getIsSessionProduct(product) {
|
|
39
|
+
return SESSION_EXTENSION_TYPES.includes(product == null ? void 0 : product.extension_type);
|
|
40
|
+
}
|
|
41
|
+
function resolveSessionCalendarDay(session) {
|
|
42
|
+
if (!session)
|
|
43
|
+
return null;
|
|
44
|
+
const raw = session.start_at ?? session.end_at;
|
|
45
|
+
if (!raw)
|
|
46
|
+
return null;
|
|
47
|
+
const parsed = (0, import_dayjs.default)(raw);
|
|
48
|
+
return parsed.isValid() ? parsed.format("YYYY-MM-DD") : null;
|
|
49
|
+
}
|
|
50
|
+
function formatScheduleCalendarDay(date) {
|
|
51
|
+
if (date == null || date === "")
|
|
52
|
+
return null;
|
|
53
|
+
const parsed = (0, import_dayjs.default)(date);
|
|
54
|
+
return parsed.isValid() ? parsed.format("YYYY-MM-DD") : null;
|
|
55
|
+
}
|
|
56
|
+
function isSessionCatalogDateStale(product, bookingDate) {
|
|
57
|
+
var _a;
|
|
58
|
+
if (!getIsSessionProduct(product)) {
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
const timeBarDay = formatScheduleCalendarDay(bookingDate);
|
|
62
|
+
if (!timeBarDay) {
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
const sessionDay = resolveSessionCalendarDay((_a = product.cartDetailValue) == null ? void 0 : _a.session);
|
|
66
|
+
if (!sessionDay) {
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
return sessionDay !== timeBarDay;
|
|
70
|
+
}
|
|
71
|
+
function buildSessionCatalogStaleInfo(product, bookingDate) {
|
|
72
|
+
var _a;
|
|
73
|
+
return {
|
|
74
|
+
productId: (product == null ? void 0 : product.id) ?? null,
|
|
75
|
+
productTitle: (product == null ? void 0 : product.title) ?? (product == null ? void 0 : product.name) ?? null,
|
|
76
|
+
sessionDay: resolveSessionCalendarDay((_a = product.cartDetailValue) == null ? void 0 : _a.session),
|
|
77
|
+
timeBarDay: formatScheduleCalendarDay(bookingDate),
|
|
78
|
+
bookingDate
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
82
|
+
0 && (module.exports = {
|
|
83
|
+
buildSessionCatalogStaleInfo,
|
|
84
|
+
isSessionCatalogDateStale
|
|
85
|
+
});
|
|
@@ -80,8 +80,6 @@ var CheckoutImpl = class extends import_BaseModule.BaseModule {
|
|
|
80
80
|
currentCustomer: void 0
|
|
81
81
|
};
|
|
82
82
|
await this.initializeSubModules(core, options);
|
|
83
|
-
await this.preloadPaymentMethods();
|
|
84
|
-
await this.cleanupExpiredOrdersAsync();
|
|
85
83
|
console.log("[Checkout] 初始化完成");
|
|
86
84
|
await this.core.effects.emit(`${this.name}:onCheckoutInitialized`, {
|
|
87
85
|
timestamp: Date.now()
|
|
@@ -1900,6 +1898,7 @@ var CheckoutImpl = class extends import_BaseModule.BaseModule {
|
|
|
1900
1898
|
*
|
|
1901
1899
|
* 删除本地 IndexDB 中超过指定天数且已同步到后端的订单数据
|
|
1902
1900
|
*/
|
|
1901
|
+
/** @deprecated */
|
|
1903
1902
|
async cleanupExpiredOrdersAsync() {
|
|
1904
1903
|
var _a, _b, _c;
|
|
1905
1904
|
try {
|
|
@@ -584,11 +584,7 @@ var webposConfig = {
|
|
|
584
584
|
// withCredentials: true,
|
|
585
585
|
prefix: false,
|
|
586
586
|
isDefaultSaasDomain: true,
|
|
587
|
-
cache:
|
|
588
|
-
mode: "remote_local",
|
|
589
|
-
type: "indexDB",
|
|
590
|
-
cacheKeyData: values
|
|
591
|
-
}
|
|
587
|
+
cache: false
|
|
592
588
|
})
|
|
593
589
|
},
|
|
594
590
|
emailCodeRegister: {
|
|
@@ -847,11 +843,7 @@ var shopWebposConfig = {
|
|
|
847
843
|
options: (values) => ({
|
|
848
844
|
// withCredentials: true,
|
|
849
845
|
prefix: false,
|
|
850
|
-
cache:
|
|
851
|
-
mode: "remote_local",
|
|
852
|
-
type: "indexDB",
|
|
853
|
-
cacheKeyData: values
|
|
854
|
-
}
|
|
846
|
+
cache: false
|
|
855
847
|
})
|
|
856
848
|
},
|
|
857
849
|
emailCodeRegister: {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { Module, ModuleOptions, PisellCore } from '../../types';
|
|
2
2
|
import { BaseModule } from '../../modules/BaseModule';
|
|
3
3
|
import { ScanOrderAddLogParams, ScanOrderAvailabilityInfo, ScanOrderOrderProduct, ScanOrderOrderProductIdentity, ScanOrderScanCodeResult } from './types';
|
|
4
|
-
import type {
|
|
4
|
+
import type { UpdateOrderProductParams } from '../../modules/Order/types';
|
|
5
5
|
import type { Discount } from '../../modules/Discount/types';
|
|
6
6
|
import { type CartItemSummary, type PaxInfo, type QuantityCheckResult, type QuantityLimitResult } from '../../model/strategy/adapter/itemRule';
|
|
7
7
|
import type { StrategyConfig } from '../../model/strategy/type';
|
|
8
|
+
import type { ProductData } from '../../modules/Product/types';
|
|
8
9
|
export * from './types';
|
|
9
10
|
interface ScanOrderItemRuleRuntimeConfig {
|
|
10
11
|
strategyConfigs?: StrategyConfig[];
|
|
@@ -36,11 +37,14 @@ export declare class ScanOrderImpl extends BaseModule implements Module {
|
|
|
36
37
|
private customerLoginRefreshIdInFlight;
|
|
37
38
|
private static readonly PISELL1_LOGIN_SUCCESS;
|
|
38
39
|
private getScanOrderLoggerContext;
|
|
40
|
+
private safeStringify;
|
|
41
|
+
private pickErrorMessage;
|
|
39
42
|
private serializeError;
|
|
40
43
|
private addScanOrderLog;
|
|
41
44
|
private logMethodStart;
|
|
42
45
|
private logMethodSuccess;
|
|
43
46
|
private logMethodError;
|
|
47
|
+
private assertProductListLoaded;
|
|
44
48
|
addLog(params: ScanOrderAddLogParams): Promise<void>;
|
|
45
49
|
private normalizeCustomerId;
|
|
46
50
|
private resolveCustomerIdFromLoginPayload;
|
|
@@ -86,10 +90,12 @@ export declare class ScanOrderImpl extends BaseModule implements Module {
|
|
|
86
90
|
onCustomerLogin(params: {
|
|
87
91
|
customerId: number;
|
|
88
92
|
}): Promise<void>;
|
|
93
|
+
private findReservationRuleResource;
|
|
94
|
+
private buildScanOrderResourceMetadata;
|
|
89
95
|
private buildSubmitPayloadEnhancer;
|
|
90
96
|
submitScanOrder<T = any>(): Promise<T>;
|
|
91
97
|
addProductToOrder(product: Partial<ScanOrderOrderProduct> & ScanOrderOrderProductIdentity): Promise<import("../../modules/Order/types").OrderProduct[]>;
|
|
92
|
-
|
|
98
|
+
updateOrderProduct(params: UpdateOrderProductParams): Promise<import("../../modules/Order/types").OrderProduct[]>;
|
|
93
99
|
/**
|
|
94
100
|
* 设置单行商品备注(与整单 `updateTempOrderNote` 区分)。
|
|
95
101
|
* 多行同 SKU 时必须传入与删除/更新一致的 identity(如 `identity_key`)。
|
|
@@ -120,7 +126,7 @@ export declare class ScanOrderImpl extends BaseModule implements Module {
|
|
|
120
126
|
orderAmount: number;
|
|
121
127
|
orderItems: any[];
|
|
122
128
|
}>;
|
|
123
|
-
getProductList(): Promise<
|
|
129
|
+
getProductList(): Promise<ProductData[]>;
|
|
124
130
|
getOtherParams(): Record<string, any>;
|
|
125
131
|
setOtherParams(params: Record<string, any>, { cover }?: {
|
|
126
132
|
cover?: boolean;
|