@pisell/pisellos 2.2.243 → 2.2.244
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 +2 -3
- package/dist/model/strategy/adapter/promotion/index.js +9 -0
- package/dist/model/strategy/adapter/walletPass/utils.js +4 -7
- package/dist/modules/Cart/utils/cartProduct.js +3 -24
- package/dist/modules/Cart/utils/changePrice.js +11 -11
- package/dist/modules/Customer/index.d.ts +0 -20
- package/dist/modules/Customer/index.js +83 -172
- package/dist/modules/Customer/types.d.ts +0 -2
- package/dist/modules/Discount/index.js +3 -4
- package/dist/modules/Discount/types.d.ts +0 -1
- package/dist/modules/OpenData/index.d.ts +0 -8
- package/dist/modules/OpenData/index.js +17 -37
- package/dist/modules/Order/index.d.ts +18 -268
- package/dist/modules/Order/index.js +757 -3306
- package/dist/modules/Order/types.d.ts +31 -279
- package/dist/modules/Order/types.js +0 -38
- package/dist/modules/Order/utils.d.ts +5 -147
- package/dist/modules/Order/utils.js +103 -746
- package/dist/modules/Payment/index.d.ts +13 -10
- package/dist/modules/Payment/index.js +837 -467
- package/dist/modules/Payment/types.d.ts +0 -2
- package/dist/modules/Payment/utils.js +1 -2
- package/dist/modules/Payment/walletpass.js +7 -14
- package/dist/modules/ProductList/index.d.ts +12 -16
- package/dist/modules/ProductList/index.js +59 -133
- package/dist/modules/ProductList/types.d.ts +0 -14
- package/dist/modules/Quotation/index.d.ts +1 -0
- package/dist/modules/Quotation/index.js +22 -25
- package/dist/modules/Rules/index.d.ts +0 -4
- package/dist/modules/Rules/index.js +69 -93
- package/dist/modules/Rules/types.d.ts +0 -1
- package/dist/modules/SalesSummary/index.d.ts +25 -8
- package/dist/modules/SalesSummary/index.js +35 -86
- package/dist/modules/SalesSummary/types.d.ts +1 -4
- package/dist/modules/SalesSummary/utils.d.ts +25 -2
- package/dist/modules/SalesSummary/utils.js +162 -794
- package/dist/modules/Schedule/index.d.ts +0 -7
- package/dist/modules/Schedule/index.js +2 -24
- package/dist/modules/Summary/index.js +3 -4
- package/dist/modules/index.d.ts +0 -2
- package/dist/modules/index.js +1 -3
- package/dist/plugins/request.d.ts +0 -1
- package/dist/server/index.d.ts +1 -204
- package/dist/server/index.js +928 -3658
- package/dist/server/modules/index.d.ts +0 -2
- package/dist/server/modules/index.js +0 -2
- package/dist/server/modules/order/index.d.ts +4 -120
- package/dist/server/modules/order/index.js +483 -1779
- package/dist/server/modules/order/types.d.ts +3 -32
- package/dist/server/modules/order/types.js +0 -8
- package/dist/server/modules/order/utils/filterBookings.js +3 -26
- package/dist/server/modules/order/utils/filterOrders.js +8 -23
- package/dist/server/modules/products/index.d.ts +7 -34
- package/dist/server/modules/products/index.js +317 -631
- package/dist/server/modules/resource/index.d.ts +0 -2
- package/dist/server/modules/resource/index.js +3 -29
- package/dist/server/modules/schedule/index.d.ts +4 -4
- package/dist/server/modules/schedule/index.js +88 -111
- package/dist/solution/BaseSales/index.d.ts +9 -131
- package/dist/solution/BaseSales/index.js +447 -1944
- package/dist/solution/BaseSales/types.d.ts +6 -76
- package/dist/solution/BaseSales/types.js +4 -5
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +0 -1
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +24 -105
- package/dist/solution/BaseSales/utils.d.ts +1 -1
- package/dist/solution/BaseSales/utils.js +21 -62
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.d.ts +10 -270
- package/dist/solution/BookingTicket/index.js +237 -1772
- package/dist/solution/BookingTicket/types.d.ts +1 -118
- package/dist/solution/BookingTicket/types.js +2 -41
- package/dist/solution/BookingTicket/utils/bookingStatus.d.ts +0 -40
- package/dist/solution/BookingTicket/utils/bookingStatus.js +0 -70
- package/dist/solution/BookingTicket/utils/cartView.d.ts +1 -9
- package/dist/solution/BookingTicket/utils/cartView.js +7 -94
- package/dist/solution/BookingTicket/utils/scan/index.d.ts +0 -5
- package/dist/solution/BookingTicket/utils/scan/index.js +8 -20
- package/dist/solution/Checkout/appointmentDemo.json +1 -0
- package/dist/solution/Checkout/index.d.ts +0 -1
- package/dist/solution/Checkout/index.js +9 -10
- package/dist/solution/RegisterAndLogin/config.js +10 -2
- package/dist/solution/ScanOrder/index.d.ts +3 -9
- package/dist/solution/ScanOrder/index.js +134 -241
- package/dist/solution/ScanOrder/types.d.ts +5 -9
- package/dist/solution/ScanOrder/types.js +3 -2
- package/dist/solution/ScanOrder/utils.d.ts +1 -1
- package/dist/solution/ScanOrder/utils.js +22 -84
- package/dist/solution/VenueBooking/index.d.ts +2 -5
- package/dist/solution/VenueBooking/index.js +59 -110
- package/dist/solution/VenueBooking/sales-section-4-annotated.json +2 -0
- package/dist/solution/VenueBooking/utils/slotMerge.d.ts +0 -4
- package/dist/solution/VenueBooking/utils/slotMerge.js +0 -10
- package/dist/types/index.d.ts +0 -10
- package/lib/model/strategy/adapter/promotion/evaluator.js +1 -2
- package/lib/model/strategy/adapter/promotion/index.js +0 -49
- package/lib/model/strategy/adapter/walletPass/utils.js +2 -3
- package/lib/modules/Cart/utils/cartProduct.js +3 -20
- package/lib/modules/Cart/utils/changePrice.js +20 -12
- package/lib/modules/Customer/index.d.ts +0 -20
- package/lib/modules/Customer/index.js +11 -64
- package/lib/modules/Customer/types.d.ts +0 -2
- package/lib/modules/Discount/index.js +1 -5
- package/lib/modules/Discount/types.d.ts +0 -1
- package/lib/modules/OpenData/index.d.ts +0 -8
- package/lib/modules/OpenData/index.js +5 -19
- package/lib/modules/Order/index.d.ts +18 -268
- package/lib/modules/Order/index.js +344 -2149
- package/lib/modules/Order/types.d.ts +31 -279
- package/lib/modules/Order/types.js +0 -1
- package/lib/modules/Order/utils.d.ts +5 -147
- package/lib/modules/Order/utils.js +46 -614
- package/lib/modules/Payment/index.d.ts +13 -10
- package/lib/modules/Payment/index.js +150 -18
- package/lib/modules/Payment/types.d.ts +0 -2
- package/lib/modules/Payment/utils.js +1 -2
- package/lib/modules/Payment/walletpass.js +3 -7
- package/lib/modules/ProductList/index.d.ts +12 -16
- package/lib/modules/ProductList/index.js +4 -41
- package/lib/modules/ProductList/types.d.ts +0 -14
- package/lib/modules/Quotation/index.d.ts +1 -0
- package/lib/modules/Quotation/index.js +16 -19
- package/lib/modules/Rules/index.d.ts +0 -4
- package/lib/modules/Rules/index.js +120 -136
- package/lib/modules/Rules/types.d.ts +0 -1
- package/lib/modules/SalesSummary/index.d.ts +25 -8
- package/lib/modules/SalesSummary/index.js +4 -30
- package/lib/modules/SalesSummary/types.d.ts +1 -4
- package/lib/modules/SalesSummary/utils.d.ts +25 -2
- package/lib/modules/SalesSummary/utils.js +91 -645
- package/lib/modules/Schedule/index.d.ts +0 -7
- package/lib/modules/Schedule/index.js +1 -17
- package/lib/modules/Summary/index.js +4 -5
- package/lib/modules/index.d.ts +0 -2
- package/lib/modules/index.js +1 -5
- package/lib/plugins/request.d.ts +0 -1
- package/lib/server/index.d.ts +1 -204
- package/lib/server/index.js +57 -1888
- package/lib/server/modules/index.d.ts +0 -2
- package/lib/server/modules/index.js +0 -3
- package/lib/server/modules/order/index.d.ts +4 -120
- package/lib/server/modules/order/index.js +142 -919
- package/lib/server/modules/order/types.d.ts +3 -32
- package/lib/server/modules/order/utils/filterBookings.js +5 -24
- package/lib/server/modules/order/utils/filterOrders.js +6 -15
- package/lib/server/modules/products/index.d.ts +7 -34
- package/lib/server/modules/products/index.js +54 -189
- package/lib/server/modules/resource/index.d.ts +0 -2
- package/lib/server/modules/resource/index.js +3 -27
- package/lib/server/modules/schedule/index.d.ts +4 -4
- package/lib/server/modules/schedule/index.js +40 -47
- package/lib/solution/BaseSales/index.d.ts +9 -131
- package/lib/solution/BaseSales/index.js +63 -1106
- package/lib/solution/BaseSales/types.d.ts +6 -76
- package/lib/solution/BaseSales/types.js +1 -3
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +0 -1
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +18 -106
- package/lib/solution/BaseSales/utils.d.ts +1 -1
- package/lib/solution/BaseSales/utils.js +10 -54
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.d.ts +10 -270
- package/lib/solution/BookingTicket/index.js +29 -922
- package/lib/solution/BookingTicket/types.d.ts +1 -118
- package/lib/solution/BookingTicket/types.js +0 -11
- package/lib/solution/BookingTicket/utils/bookingStatus.d.ts +0 -40
- package/lib/solution/BookingTicket/utils/bookingStatus.js +2 -44
- package/lib/solution/BookingTicket/utils/cartView.d.ts +1 -9
- package/lib/solution/BookingTicket/utils/cartView.js +6 -61
- package/lib/solution/BookingTicket/utils/scan/index.d.ts +0 -5
- package/lib/solution/BookingTicket/utils/scan/index.js +3 -17
- package/lib/solution/Checkout/appointmentDemo.json +1 -0
- package/lib/solution/Checkout/index.d.ts +0 -1
- package/lib/solution/Checkout/index.js +2 -1
- package/lib/solution/RegisterAndLogin/config.js +10 -2
- package/lib/solution/ScanOrder/index.d.ts +3 -9
- package/lib/solution/ScanOrder/index.js +70 -153
- package/lib/solution/ScanOrder/types.d.ts +5 -9
- package/lib/solution/ScanOrder/utils.d.ts +1 -1
- package/lib/solution/ScanOrder/utils.js +17 -83
- package/lib/solution/VenueBooking/index.d.ts +2 -5
- package/lib/solution/VenueBooking/index.js +17 -54
- package/lib/solution/VenueBooking/sales-section-4-annotated.json +2 -0
- package/lib/solution/VenueBooking/utils/slotMerge.d.ts +0 -4
- package/lib/solution/VenueBooking/utils/slotMerge.js +0 -10
- package/lib/types/index.d.ts +0 -10
- package/package.json +1 -1
- package/dist/modules/BookingContext/index.d.ts +0 -48
- package/dist/modules/BookingContext/index.js +0 -566
- package/dist/modules/BookingContext/types.d.ts +0 -102
- package/dist/modules/BookingContext/types.js +0 -51
- package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts +0 -16
- package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +0 -284
- package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +0 -8
- package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +0 -145
- package/dist/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +0 -76
- package/dist/modules/BookingContext/utils/cacheItemToBookingInput.js +0 -218
- package/dist/modules/BookingContext/utils/flexible.d.ts +0 -28
- package/dist/modules/BookingContext/utils/flexible.js +0 -56
- package/dist/modules/BookingContext/utils/formatResourceList.d.ts +0 -8
- package/dist/modules/BookingContext/utils/formatResourceList.js +0 -38
- package/dist/modules/BookingContext/utils/index.d.ts +0 -11
- package/dist/modules/BookingContext/utils/index.js +0 -11
- package/dist/modules/BookingContext/utils/noResource.d.ts +0 -13
- package/dist/modules/BookingContext/utils/noResource.js +0 -77
- package/dist/modules/BookingContext/utils/orderLineDisplay.d.ts +0 -1
- package/dist/modules/BookingContext/utils/orderLineDisplay.js +0 -36
- package/dist/modules/BookingContext/utils/productExtend.d.ts +0 -72
- package/dist/modules/BookingContext/utils/productExtend.js +0 -339
- package/dist/modules/BookingContext/utils/resourceErrors.d.ts +0 -41
- package/dist/modules/BookingContext/utils/resourceErrors.js +0 -74
- package/dist/modules/BookingContext/utils/resourceSelection.d.ts +0 -7
- package/dist/modules/BookingContext/utils/resourceSelection.js +0 -24
- package/dist/modules/BookingContext/utils/resources.d.ts +0 -80
- package/dist/modules/BookingContext/utils/resources.js +0 -486
- package/dist/modules/BookingContext/utils/serviceTimes.d.ts +0 -55
- package/dist/modules/BookingContext/utils/serviceTimes.js +0 -151
- package/dist/modules/BookingContext/utils/timeSlices.d.ts +0 -42
- package/dist/modules/BookingContext/utils/timeSlices.js +0 -100
- package/dist/modules/Order/utils/manualProductDiscount.d.ts +0 -106
- package/dist/modules/Order/utils/manualProductDiscount.js +0 -210
- package/dist/modules/SurchargeList/index.d.ts +0 -16
- package/dist/modules/SurchargeList/index.js +0 -162
- package/dist/modules/SurchargeList/types.d.ts +0 -11
- package/dist/modules/SurchargeList/types.js +0 -1
- package/dist/server/modules/payment/index.d.ts +0 -28
- package/dist/server/modules/payment/index.js +0 -305
- package/dist/server/modules/payment/types.d.ts +0 -9
- package/dist/server/modules/payment/types.js +0 -1
- package/dist/server/test.json +0 -713
- package/dist/server/utils/small-ticket.d.ts +0 -71
- package/dist/server/utils/small-ticket.js +0 -830
- package/dist/solution/BaseSales/utils/cartPromotion.d.ts +0 -287
- package/dist/solution/BaseSales/utils/cartPromotion.js +0 -1438
- package/dist/solution/BaseSales/utils/quotationPrice.d.ts +0 -7
- package/dist/solution/BaseSales/utils/quotationPrice.js +0 -237
- package/dist/solution/BookingTicket/utils/addProductDecision.d.ts +0 -117
- package/dist/solution/BookingTicket/utils/addProductDecision.js +0 -346
- package/dist/solution/BookingTicket/utils/addTimeAvailability.d.ts +0 -35
- package/dist/solution/BookingTicket/utils/addTimeAvailability.js +0 -95
- package/dist/solution/BookingTicket/utils/exampleData.d.ts +0 -123
- package/dist/solution/BookingTicket/utils/exampleData.js +0 -183
- package/dist/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +0 -185
- package/dist/solution/BookingTicket/utils/resolveBestAddTimePlan.js +0 -438
- package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +0 -36
- package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +0 -399
- package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +0 -32
- package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.js +0 -56
- package/dist/solution/BookingTicket/utils/scan/scanProductValues.d.ts +0 -21
- package/dist/solution/BookingTicket/utils/scan/scanProductValues.js +0 -150
- package/dist/solution/BookingTicket/utils/sessionCatalogStale.d.ts +0 -23
- package/dist/solution/BookingTicket/utils/sessionCatalogStale.js +0 -78
- package/lib/modules/BookingContext/index.d.ts +0 -48
- package/lib/modules/BookingContext/index.js +0 -368
- package/lib/modules/BookingContext/types.d.ts +0 -102
- package/lib/modules/BookingContext/types.js +0 -34
- package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts +0 -16
- package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +0 -276
- package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +0 -8
- package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +0 -151
- package/lib/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +0 -76
- package/lib/modules/BookingContext/utils/cacheItemToBookingInput.js +0 -201
- package/lib/modules/BookingContext/utils/flexible.d.ts +0 -28
- package/lib/modules/BookingContext/utils/flexible.js +0 -80
- package/lib/modules/BookingContext/utils/formatResourceList.d.ts +0 -8
- package/lib/modules/BookingContext/utils/formatResourceList.js +0 -50
- package/lib/modules/BookingContext/utils/index.d.ts +0 -11
- package/lib/modules/BookingContext/utils/index.js +0 -43
- package/lib/modules/BookingContext/utils/noResource.d.ts +0 -13
- package/lib/modules/BookingContext/utils/noResource.js +0 -90
- package/lib/modules/BookingContext/utils/orderLineDisplay.d.ts +0 -1
- package/lib/modules/BookingContext/utils/orderLineDisplay.js +0 -56
- package/lib/modules/BookingContext/utils/productExtend.d.ts +0 -72
- package/lib/modules/BookingContext/utils/productExtend.js +0 -283
- package/lib/modules/BookingContext/utils/resourceErrors.d.ts +0 -41
- package/lib/modules/BookingContext/utils/resourceErrors.js +0 -80
- package/lib/modules/BookingContext/utils/resourceSelection.d.ts +0 -7
- package/lib/modules/BookingContext/utils/resourceSelection.js +0 -46
- package/lib/modules/BookingContext/utils/resources.d.ts +0 -80
- package/lib/modules/BookingContext/utils/resources.js +0 -377
- package/lib/modules/BookingContext/utils/serviceTimes.d.ts +0 -55
- package/lib/modules/BookingContext/utils/serviceTimes.js +0 -162
- package/lib/modules/BookingContext/utils/timeSlices.d.ts +0 -42
- package/lib/modules/BookingContext/utils/timeSlices.js +0 -124
- package/lib/modules/Order/utils/manualProductDiscount.d.ts +0 -106
- package/lib/modules/Order/utils/manualProductDiscount.js +0 -206
- package/lib/modules/SurchargeList/index.d.ts +0 -16
- package/lib/modules/SurchargeList/index.js +0 -89
- package/lib/modules/SurchargeList/types.d.ts +0 -11
- package/lib/modules/SurchargeList/types.js +0 -17
- package/lib/server/modules/payment/index.d.ts +0 -28
- package/lib/server/modules/payment/index.js +0 -192
- package/lib/server/modules/payment/types.d.ts +0 -9
- package/lib/server/modules/payment/types.js +0 -17
- package/lib/server/test.json +0 -713
- package/lib/server/utils/small-ticket.d.ts +0 -71
- package/lib/server/utils/small-ticket.js +0 -781
- package/lib/solution/BaseSales/utils/cartPromotion.d.ts +0 -287
- package/lib/solution/BaseSales/utils/cartPromotion.js +0 -992
- package/lib/solution/BaseSales/utils/quotationPrice.d.ts +0 -7
- package/lib/solution/BaseSales/utils/quotationPrice.js +0 -277
- package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +0 -117
- package/lib/solution/BookingTicket/utils/addProductDecision.js +0 -318
- package/lib/solution/BookingTicket/utils/addTimeAvailability.d.ts +0 -35
- package/lib/solution/BookingTicket/utils/addTimeAvailability.js +0 -125
- package/lib/solution/BookingTicket/utils/exampleData.d.ts +0 -123
- package/lib/solution/BookingTicket/utils/exampleData.js +0 -0
- package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +0 -185
- package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.js +0 -254
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +0 -36
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +0 -168
- package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +0 -32
- package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.js +0 -51
- package/lib/solution/BookingTicket/utils/scan/scanProductValues.d.ts +0 -21
- package/lib/solution/BookingTicket/utils/scan/scanProductValues.js +0 -127
- package/lib/solution/BookingTicket/utils/sessionCatalogStale.d.ts +0 -23
- package/lib/solution/BookingTicket/utils/sessionCatalogStale.js +0 -85
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
4
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
7
|
var __export = (target, all) => {
|
|
6
8
|
for (var name in all)
|
|
@@ -14,6 +16,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
14
16
|
}
|
|
15
17
|
return to;
|
|
16
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
|
+
));
|
|
17
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
28
|
|
|
19
29
|
// src/modules/Cart/utils/changePrice.ts
|
|
@@ -22,7 +32,7 @@ __export(changePrice_exports, {
|
|
|
22
32
|
updateAllCartItemPrice: () => updateAllCartItemPrice
|
|
23
33
|
});
|
|
24
34
|
module.exports = __toCommonJS(changePrice_exports);
|
|
25
|
-
var
|
|
35
|
+
var import_decimal = __toESM(require("decimal.js"));
|
|
26
36
|
async function updateAllCartItemPrice(cartItems, priceData, getProduct, updateCart, updateItemInitInfo) {
|
|
27
37
|
var _a, _b;
|
|
28
38
|
for (const item of cartItems) {
|
|
@@ -47,20 +57,18 @@ async function updateAllCartItemPrice(cartItems, priceData, getProduct, updateCa
|
|
|
47
57
|
const targetBundleItem = targetBundle.bundle_item.find(
|
|
48
58
|
(m) => m.id === n.id
|
|
49
59
|
);
|
|
60
|
+
if (targetBundleItem.price_type === "markdown") {
|
|
61
|
+
targetBundleItem.price = new import_decimal.default(targetBundleItem.price || 0).mul(-1).toNumber();
|
|
62
|
+
}
|
|
63
|
+
if (n.option) {
|
|
64
|
+
targetBundleItem.price = new import_decimal.default(targetBundleItem.price || 0).add(n.option.reduce((pre, cur) => {
|
|
65
|
+
return pre + new import_decimal.default(cur.price || 0).mul(cur.num || 1).toNumber();
|
|
66
|
+
}, 0)).toNumber();
|
|
67
|
+
}
|
|
50
68
|
if (targetBundleItem) {
|
|
51
|
-
const normalizedBundle = {
|
|
52
|
-
...n,
|
|
53
|
-
price: targetBundleItem.price,
|
|
54
|
-
custom_price: targetBundleItem.price,
|
|
55
|
-
price_type: targetBundleItem.price_type,
|
|
56
|
-
price_type_ext: targetBundleItem.price_type_ext
|
|
57
|
-
};
|
|
58
|
-
const bundleSellingPrice = (0, import_utils.getBundleSellingMagnitude)(normalizedBundle).toFixed(2);
|
|
59
69
|
return {
|
|
60
70
|
...n,
|
|
61
|
-
|
|
62
|
-
price: targetBundleItem.price_type === "markdown" ? bundleSellingPrice : targetBundleItem.price,
|
|
63
|
-
bundle_selling_price: bundleSellingPrice,
|
|
71
|
+
price: targetBundleItem.price,
|
|
64
72
|
base_price: targetBundleItem.base_price
|
|
65
73
|
};
|
|
66
74
|
}
|
|
@@ -7,25 +7,11 @@ export declare class CustomerModule extends BaseModule implements Module, Custom
|
|
|
7
7
|
private store;
|
|
8
8
|
private request;
|
|
9
9
|
private cacheId;
|
|
10
|
-
/**
|
|
11
|
-
* 判断两份选中客户的核心展示字段是否一致,用于避免重复 clone / emit。
|
|
12
|
-
*
|
|
13
|
-
* @example
|
|
14
|
-
* this.isSameSelectedCustomer(currentCustomer, nextCustomer);
|
|
15
|
-
*/
|
|
16
|
-
private isSameSelectedCustomer;
|
|
17
10
|
private openCache;
|
|
18
11
|
private fatherModule;
|
|
19
12
|
private otherParams;
|
|
20
13
|
constructor(name?: string, version?: string);
|
|
21
14
|
initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
|
|
22
|
-
/**
|
|
23
|
-
* 更新父级解决方案透传的运行态参数,并刷新客户模块缓存配置。
|
|
24
|
-
*
|
|
25
|
-
* @example
|
|
26
|
-
* customerModule.updateOtherParams({ isFranchisee: true, cacheId: 'cache-2' });
|
|
27
|
-
*/
|
|
28
|
-
updateOtherParams(params: Record<string, any>): void;
|
|
29
15
|
/**
|
|
30
16
|
* 获取客户列表数据(内部方法)
|
|
31
17
|
* @param params 查询参数
|
|
@@ -38,12 +24,6 @@ export declare class CustomerModule extends BaseModule implements Module, Custom
|
|
|
38
24
|
* @param operation 操作名称
|
|
39
25
|
*/
|
|
40
26
|
private handleCustomerListError;
|
|
41
|
-
/**
|
|
42
|
-
* 查询客户列表但不写入 customerList / pagination 状态。
|
|
43
|
-
*
|
|
44
|
-
* 用于按 ID 补齐客户等内部查询,避免把临时的 num/searchParams 污染到滚动列表。
|
|
45
|
-
*/
|
|
46
|
-
queryCustomerList(params?: ShopGetCustomerListParams): Promise<ICustomerListResponse>;
|
|
47
27
|
/**
|
|
48
28
|
* 获取客户列表
|
|
49
29
|
* @param params 查询参数
|
|
@@ -48,29 +48,6 @@ var CustomerModule = class extends import_BaseModule.BaseModule {
|
|
|
48
48
|
this.openCache = false;
|
|
49
49
|
this.otherParams = {};
|
|
50
50
|
}
|
|
51
|
-
/**
|
|
52
|
-
* 判断两份选中客户的核心展示字段是否一致,用于避免重复 clone / emit。
|
|
53
|
-
*
|
|
54
|
-
* @example
|
|
55
|
-
* this.isSameSelectedCustomer(currentCustomer, nextCustomer);
|
|
56
|
-
*/
|
|
57
|
-
isSameSelectedCustomer(current, next) {
|
|
58
|
-
const normalizedNext = !next ? import_constants.DEFAULT_CUSTOMER : next;
|
|
59
|
-
const normalizedCurrent = current || null;
|
|
60
|
-
if (!normalizedCurrent)
|
|
61
|
-
return false;
|
|
62
|
-
if (String((normalizedCurrent == null ? void 0 : normalizedCurrent.id) ?? "") === "1" && String((normalizedNext == null ? void 0 : normalizedNext.id) ?? "") === "1") {
|
|
63
|
-
return true;
|
|
64
|
-
}
|
|
65
|
-
const keys = [
|
|
66
|
-
"id",
|
|
67
|
-
"name",
|
|
68
|
-
"phone",
|
|
69
|
-
"email",
|
|
70
|
-
"country_calling_code"
|
|
71
|
-
];
|
|
72
|
-
return keys.every((key) => String((normalizedCurrent == null ? void 0 : normalizedCurrent[key]) ?? "") === String((normalizedNext == null ? void 0 : normalizedNext[key]) ?? ""));
|
|
73
|
-
}
|
|
74
51
|
async initialize(core, options) {
|
|
75
52
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
76
53
|
this.core = core;
|
|
@@ -98,7 +75,7 @@ var CustomerModule = class extends import_BaseModule.BaseModule {
|
|
|
98
75
|
} else {
|
|
99
76
|
this.store.currentPage = 1;
|
|
100
77
|
}
|
|
101
|
-
if (typeof ((_e = options == null ? void 0 : options.initialState) == null ? void 0 : _e.pageSize) === "number"
|
|
78
|
+
if (typeof ((_e = options == null ? void 0 : options.initialState) == null ? void 0 : _e.pageSize) === "number") {
|
|
102
79
|
this.store.pageSize = options.initialState.pageSize;
|
|
103
80
|
} else {
|
|
104
81
|
this.store.pageSize = import_constants.DEFAULT_PAGE_SIZE;
|
|
@@ -114,18 +91,6 @@ var CustomerModule = class extends import_BaseModule.BaseModule {
|
|
|
114
91
|
this.fatherModule = options.otherParams.fatherModule;
|
|
115
92
|
}
|
|
116
93
|
}
|
|
117
|
-
/**
|
|
118
|
-
* 更新父级解决方案透传的运行态参数,并刷新客户模块缓存配置。
|
|
119
|
-
*
|
|
120
|
-
* @example
|
|
121
|
-
* customerModule.updateOtherParams({ isFranchisee: true, cacheId: 'cache-2' });
|
|
122
|
-
*/
|
|
123
|
-
updateOtherParams(params) {
|
|
124
|
-
this.otherParams = params || {};
|
|
125
|
-
this.openCache = this.otherParams.openCache ?? false;
|
|
126
|
-
this.cacheId = this.otherParams.cacheId;
|
|
127
|
-
this.fatherModule = this.otherParams.fatherModule;
|
|
128
|
-
}
|
|
129
94
|
/**
|
|
130
95
|
* 获取客户列表数据(内部方法)
|
|
131
96
|
* @param params 查询参数
|
|
@@ -187,20 +152,6 @@ var CustomerModule = class extends import_BaseModule.BaseModule {
|
|
|
187
152
|
this.store.error
|
|
188
153
|
);
|
|
189
154
|
}
|
|
190
|
-
/**
|
|
191
|
-
* 查询客户列表但不写入 customerList / pagination 状态。
|
|
192
|
-
*
|
|
193
|
-
* 用于按 ID 补齐客户等内部查询,避免把临时的 num/searchParams 污染到滚动列表。
|
|
194
|
-
*/
|
|
195
|
-
async queryCustomerList(params = {}) {
|
|
196
|
-
const { customerList, total, page, pageSize } = await this.fetchCustomerListData(params);
|
|
197
|
-
return {
|
|
198
|
-
list: customerList,
|
|
199
|
-
total,
|
|
200
|
-
page,
|
|
201
|
-
pageSize
|
|
202
|
-
};
|
|
203
|
-
}
|
|
204
155
|
/**
|
|
205
156
|
* 获取客户列表
|
|
206
157
|
* @param params 查询参数
|
|
@@ -218,6 +169,10 @@ var CustomerModule = class extends import_BaseModule.BaseModule {
|
|
|
218
169
|
this.store.total = total;
|
|
219
170
|
this.store.hasMore = page * pageSize < total;
|
|
220
171
|
this.store.customerList = (0, import_lodash_es.cloneDeep)(customerList);
|
|
172
|
+
await this.core.effects.emit(
|
|
173
|
+
`${this.name}:onCustomerListUpdate`,
|
|
174
|
+
this.store
|
|
175
|
+
);
|
|
221
176
|
this.triggerPaginationChange({
|
|
222
177
|
page,
|
|
223
178
|
pageSize,
|
|
@@ -237,10 +192,6 @@ var CustomerModule = class extends import_BaseModule.BaseModule {
|
|
|
237
192
|
} finally {
|
|
238
193
|
this.store.loading = false;
|
|
239
194
|
this.storeChange();
|
|
240
|
-
await this.core.effects.emit(
|
|
241
|
-
`${this.name}:onCustomerListUpdate`,
|
|
242
|
-
this.store
|
|
243
|
-
);
|
|
244
195
|
}
|
|
245
196
|
}
|
|
246
197
|
/**
|
|
@@ -260,9 +211,6 @@ var CustomerModule = class extends import_BaseModule.BaseModule {
|
|
|
260
211
|
* @param customer 选择的客户
|
|
261
212
|
*/
|
|
262
213
|
setSelectedCustomer(customer) {
|
|
263
|
-
if (this.isSameSelectedCustomer(this.store.selectedCustomer, customer)) {
|
|
264
|
-
return;
|
|
265
|
-
}
|
|
266
214
|
this.store.selectedCustomer = !customer ? import_constants.DEFAULT_CUSTOMER : (0, import_lodash_es.cloneDeep)(customer);
|
|
267
215
|
this.core.effects.emit(
|
|
268
216
|
`${this.name}:onCustomerSelected`,
|
|
@@ -404,13 +352,12 @@ var CustomerModule = class extends import_BaseModule.BaseModule {
|
|
|
404
352
|
try {
|
|
405
353
|
this.store.loadingMore = true;
|
|
406
354
|
this.store.error = null;
|
|
407
|
-
const
|
|
355
|
+
const { customerList: newCustomers, total, page, pageSize } = await this.fetchCustomerListData({
|
|
408
356
|
skip: nextPage,
|
|
409
357
|
num: this.store.pageSize,
|
|
410
358
|
...this.store.searchParams
|
|
411
359
|
// 使用存储的搜索条件
|
|
412
|
-
};
|
|
413
|
-
const { customerList: newCustomers, total, page, pageSize } = await this.fetchCustomerListData(loadMoreParams);
|
|
360
|
+
});
|
|
414
361
|
const updatedCustomerList = [...this.store.customerList, ...(0, import_lodash_es.cloneDeep)(newCustomers)];
|
|
415
362
|
this.store.customerList = updatedCustomerList;
|
|
416
363
|
this.store.currentPage = page;
|
|
@@ -425,6 +372,10 @@ var CustomerModule = class extends import_BaseModule.BaseModule {
|
|
|
425
372
|
hasMore: this.store.hasMore
|
|
426
373
|
}
|
|
427
374
|
);
|
|
375
|
+
await this.core.effects.emit(
|
|
376
|
+
`${this.name}:onCustomerListUpdate`,
|
|
377
|
+
this.store
|
|
378
|
+
);
|
|
428
379
|
this.triggerPaginationChange({
|
|
429
380
|
page,
|
|
430
381
|
pageSize,
|
|
@@ -445,10 +396,6 @@ var CustomerModule = class extends import_BaseModule.BaseModule {
|
|
|
445
396
|
} finally {
|
|
446
397
|
this.store.loadingMore = false;
|
|
447
398
|
this.storeChange();
|
|
448
|
-
await this.core.effects.emit(
|
|
449
|
-
`${this.name}:onCustomerListUpdate`,
|
|
450
|
-
this.store
|
|
451
|
-
);
|
|
452
399
|
}
|
|
453
400
|
}
|
|
454
401
|
/**
|
|
@@ -110,8 +110,6 @@ export interface CustomerState {
|
|
|
110
110
|
export interface CustomerModuleAPI {
|
|
111
111
|
/** 获取客户列表 */
|
|
112
112
|
getCustomerList: (params?: ShopGetCustomerListParams) => Promise<ICustomerListResponse>;
|
|
113
|
-
/** 查询客户列表但不更新列表分页状态 */
|
|
114
|
-
queryCustomerList: (params?: ShopGetCustomerListParams) => Promise<ICustomerListResponse>;
|
|
115
113
|
/** 设置客户列表 */
|
|
116
114
|
setCustomerList: (customers: ShopCustomer[], total?: number) => void;
|
|
117
115
|
/** 设置当前选择的客户 */
|
|
@@ -97,12 +97,8 @@ var DiscountModule = class extends import_BaseModule.BaseModule {
|
|
|
97
97
|
`/order/prepare/config`,
|
|
98
98
|
params
|
|
99
99
|
);
|
|
100
|
-
const rawDiscountList = [
|
|
101
|
-
...((_a = prepareConfig == null ? void 0 : prepareConfig.data) == null ? void 0 : _a.good_pass_list) || [],
|
|
102
|
-
...((_b = prepareConfig == null ? void 0 : prepareConfig.data) == null ? void 0 : _b.discount_card_list) || []
|
|
103
|
-
];
|
|
104
100
|
const goodPassList = this.filterEnabledDiscountList(
|
|
105
|
-
|
|
101
|
+
[...((_a = prepareConfig == null ? void 0 : prepareConfig.data) == null ? void 0 : _a.good_pass_list) || [], ...((_b = prepareConfig == null ? void 0 : prepareConfig.data) == null ? void 0 : _b.discount_card_list) || []]
|
|
106
102
|
) || [];
|
|
107
103
|
return goodPassList;
|
|
108
104
|
}
|
|
@@ -140,7 +140,6 @@ export interface Discount {
|
|
|
140
140
|
appliedProductDetails: ApplicableProductDetails[];
|
|
141
141
|
isDisabledForProductUsed?: boolean;
|
|
142
142
|
amount?: number;
|
|
143
|
-
customer_id?: number | string | null;
|
|
144
143
|
extension_data?: ExtensionData[];
|
|
145
144
|
total_order_behavior_count?: number;
|
|
146
145
|
today_order_behavior_count?: number;
|
|
@@ -9,7 +9,6 @@ export declare class OpenDataModule extends BaseModule implements Module {
|
|
|
9
9
|
protected defaultVersion: string;
|
|
10
10
|
private request;
|
|
11
11
|
private window;
|
|
12
|
-
private appPlugin;
|
|
13
12
|
private store;
|
|
14
13
|
private cacheId;
|
|
15
14
|
private openCache;
|
|
@@ -17,13 +16,6 @@ export declare class OpenDataModule extends BaseModule implements Module {
|
|
|
17
16
|
private otherParams;
|
|
18
17
|
constructor(name?: string, version?: string);
|
|
19
18
|
initialize(core: PisellCore, options: ModuleOptions): Promise<void>;
|
|
20
|
-
/**
|
|
21
|
-
* 更新父级解决方案透传的运行态参数,并刷新 OpenData 缓存配置。
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* openDataModule.updateOtherParams({ openCache: true, cacheId: 'cache-2' })
|
|
25
|
-
*/
|
|
26
|
-
updateOtherParams(params: Record<string, any>): void;
|
|
27
19
|
fetchOpenData(params: OpenDataFetchParams): Promise<OpenDataConfig>;
|
|
28
20
|
getOpenData(): OpenDataConfig | null;
|
|
29
21
|
getLastFetchedAt(): number | null;
|
|
@@ -52,32 +52,18 @@ var OpenDataModule = class extends import_BaseModule.BaseModule {
|
|
|
52
52
|
}
|
|
53
53
|
this.request = core.getPlugin("request");
|
|
54
54
|
this.window = core.getPlugin("window");
|
|
55
|
-
this.appPlugin = core.getPlugin("app");
|
|
56
55
|
if (!this.request)
|
|
57
56
|
throw new Error("OpenDataModule 需要 request 插件支持");
|
|
58
57
|
if (!this.window)
|
|
59
58
|
throw new Error("OpenDataModule 需要 window 插件支持");
|
|
60
59
|
console.log("[OpenDataModule] 初始化完成");
|
|
61
60
|
}
|
|
62
|
-
/**
|
|
63
|
-
* 更新父级解决方案透传的运行态参数,并刷新 OpenData 缓存配置。
|
|
64
|
-
*
|
|
65
|
-
* @example
|
|
66
|
-
* openDataModule.updateOtherParams({ openCache: true, cacheId: 'cache-2' })
|
|
67
|
-
*/
|
|
68
|
-
updateOtherParams(params) {
|
|
69
|
-
this.otherParams = params || {};
|
|
70
|
-
this.openCache = this.otherParams.openCache ?? false;
|
|
71
|
-
this.cacheId = this.otherParams.cacheId;
|
|
72
|
-
this.fatherModule = this.otherParams.fatherModule;
|
|
73
|
-
}
|
|
74
61
|
async fetchOpenData(params) {
|
|
75
|
-
var _a, _b;
|
|
76
|
-
const
|
|
77
|
-
const shopId = getData == null ? void 0 : getData("shop_id");
|
|
62
|
+
var _a, _b, _c, _d;
|
|
63
|
+
const shopId = (_b = (_a = this.otherParams) == null ? void 0 : _a.getStateData) == null ? void 0 : _b.call(_a, "shop_id");
|
|
78
64
|
if (!shopId)
|
|
79
65
|
throw new Error("[OpenDataModule] 无法获取 shop_id");
|
|
80
|
-
const tenantId =
|
|
66
|
+
const tenantId = (_d = (_c = this.otherParams) == null ? void 0 : _c.getStateData) == null ? void 0 : _d.call(_c, "tenant_id");
|
|
81
67
|
const headers = {};
|
|
82
68
|
if (tenantId)
|
|
83
69
|
headers["Tenant-Id"] = String(tenantId);
|
|
@@ -88,7 +74,7 @@ var OpenDataModule = class extends import_BaseModule.BaseModule {
|
|
|
88
74
|
target: params.target,
|
|
89
75
|
section_code: params.section_code
|
|
90
76
|
},
|
|
91
|
-
{ pisell2: true,
|
|
77
|
+
{ pisell2: true, headers }
|
|
92
78
|
);
|
|
93
79
|
if ((response == null ? void 0 : response.status) === false) {
|
|
94
80
|
throw new Error((response == null ? void 0 : response.message) || "获取 OpenData 配置失败");
|
|
@@ -106,7 +92,7 @@ var OpenDataModule = class extends import_BaseModule.BaseModule {
|
|
|
106
92
|
}
|
|
107
93
|
checkAvailability(scheduleModule) {
|
|
108
94
|
var _a;
|
|
109
|
-
const scheduleList = scheduleModule ? scheduleModule
|
|
95
|
+
const scheduleList = scheduleModule ? scheduleModule.getScheduleListByIds(
|
|
110
96
|
((_a = this.store.data) == null ? void 0 : _a["availability.operating_hours"]) || []
|
|
111
97
|
) : void 0;
|
|
112
98
|
return (0, import_utils.computeAvailability)({
|