@pisell/pisellos 3.0.76 → 3.0.78
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/core/index.js +1 -2
- package/dist/effects/index.d.ts +3 -5
- package/dist/effects/index.js +8 -40
- package/dist/modules/Account/index.js +3 -2
- package/dist/modules/AccountList/index.d.ts +1 -7
- package/dist/modules/AccountList/index.js +14 -81
- package/dist/modules/AccountList/types.d.ts +0 -28
- package/dist/modules/AccountList/types.js +0 -8
- package/dist/modules/BaseModule.d.ts +0 -3
- package/dist/modules/BaseModule.js +0 -15
- package/dist/modules/Cart/index.d.ts +0 -1
- package/dist/modules/Cart/index.js +1 -2
- package/dist/modules/Date/types.d.ts +3 -1
- package/dist/modules/Discount/index.d.ts +0 -1
- package/dist/modules/Discount/index.js +1 -1
- package/dist/modules/Guests/index.js +9 -9
- package/dist/modules/Order/index.d.ts +1 -25
- package/dist/modules/Order/index.js +3 -224
- package/dist/modules/Order/types.d.ts +0 -45
- package/dist/modules/Order/types.js +0 -8
- package/dist/modules/Order/utils.js +1 -1
- package/dist/modules/Payment/index.d.ts +9 -184
- package/dist/modules/Payment/index.js +109 -2084
- package/dist/modules/Payment/types.d.ts +30 -772
- package/dist/modules/Payment/types.js +12 -236
- package/dist/modules/ProductList/index.d.ts +1 -12
- package/dist/modules/ProductList/index.js +6 -29
- package/dist/modules/Resource/index.js +1 -1
- package/dist/modules/Rules/index.d.ts +4 -3
- package/dist/modules/Rules/index.js +121 -78
- package/dist/modules/Rules/types.d.ts +6 -1
- package/dist/modules/Rules/types.js +8 -0
- package/dist/modules/Schedule/index.d.ts +0 -9
- package/dist/modules/Schedule/index.js +0 -77
- package/dist/modules/index.d.ts +0 -1
- package/dist/modules/index.js +0 -1
- package/dist/plugins/window.d.ts +0 -1
- package/dist/solution/BookingByStep/index.d.ts +17 -0
- package/dist/solution/BookingByStep/index.js +525 -190
- package/dist/solution/BookingByStep/utils/products.d.ts +0 -6
- package/dist/solution/BookingByStep/utils/products.js +0 -10
- package/dist/solution/BookingByStep/utils/resources.js +4 -0
- package/dist/solution/BuyTickets/index.js +8 -7
- package/dist/solution/ShopDiscount/index.d.ts +12 -10
- package/dist/solution/ShopDiscount/index.js +64 -110
- package/dist/solution/ShopDiscount/types.d.ts +0 -8
- package/dist/solution/ShopDiscount/utils.js +1 -0
- package/dist/solution/index.d.ts +0 -2
- package/dist/solution/index.js +1 -3
- package/dist/types/index.d.ts +1 -4
- package/lib/core/index.js +1 -1
- package/lib/effects/index.d.ts +3 -5
- package/lib/effects/index.js +1 -17
- package/lib/modules/Account/index.js +3 -2
- package/lib/modules/AccountList/index.d.ts +1 -7
- package/lib/modules/AccountList/index.js +0 -27
- package/lib/modules/AccountList/types.d.ts +0 -28
- package/lib/modules/BaseModule.d.ts +0 -3
- package/lib/modules/BaseModule.js +0 -9
- package/lib/modules/Cart/index.d.ts +0 -1
- package/lib/modules/Cart/index.js +2 -5
- package/lib/modules/Date/types.d.ts +3 -1
- package/lib/modules/Discount/index.d.ts +0 -1
- package/lib/modules/Discount/index.js +1 -1
- package/lib/modules/Guests/index.js +9 -9
- package/lib/modules/Order/index.d.ts +1 -25
- package/lib/modules/Order/index.js +1 -186
- package/lib/modules/Order/types.d.ts +0 -45
- package/lib/modules/Order/utils.js +1 -1
- package/lib/modules/Payment/index.d.ts +9 -184
- package/lib/modules/Payment/index.js +51 -1084
- package/lib/modules/Payment/types.d.ts +30 -772
- package/lib/modules/Payment/types.js +6 -79
- package/lib/modules/ProductList/index.d.ts +1 -12
- package/lib/modules/ProductList/index.js +5 -31
- package/lib/modules/Resource/index.js +1 -1
- package/lib/modules/Rules/index.d.ts +4 -3
- package/lib/modules/Rules/index.js +64 -43
- package/lib/modules/Rules/types.d.ts +6 -1
- package/lib/modules/Rules/types.js +11 -2
- package/lib/modules/Schedule/index.d.ts +0 -9
- package/lib/modules/Schedule/index.js +0 -60
- package/lib/modules/index.d.ts +0 -1
- package/lib/modules/index.js +0 -2
- package/lib/plugins/window.d.ts +0 -1
- package/lib/solution/BookingByStep/index.d.ts +17 -0
- package/lib/solution/BookingByStep/index.js +325 -60
- package/lib/solution/BookingByStep/utils/products.d.ts +0 -6
- package/lib/solution/BookingByStep/utils/products.js +2 -8
- package/lib/solution/BookingByStep/utils/resources.js +4 -1
- package/lib/solution/BuyTickets/index.js +8 -7
- package/lib/solution/ShopDiscount/index.d.ts +12 -10
- package/lib/solution/ShopDiscount/index.js +30 -51
- package/lib/solution/ShopDiscount/types.d.ts +0 -8
- package/lib/solution/index.d.ts +0 -2
- package/lib/solution/index.js +1 -5
- package/lib/types/index.d.ts +1 -4
- package/package.json +1 -3
- package/dist/modules/Customer/constants.d.ts +0 -7
- package/dist/modules/Customer/constants.js +0 -12
- package/dist/modules/Customer/index.d.ts +0 -122
- package/dist/modules/Customer/index.js +0 -696
- package/dist/modules/Customer/types.d.ts +0 -146
- package/dist/modules/Customer/types.js +0 -41
- package/dist/modules/Payment/cash.d.ts +0 -19
- package/dist/modules/Payment/cash.js +0 -97
- package/dist/modules/Payment/cashRecommendationAlgorithm.d.ts +0 -22
- package/dist/modules/Payment/cashRecommendationAlgorithm.js +0 -423
- package/dist/modules/Payment/eftpos.d.ts +0 -11
- package/dist/modules/Payment/eftpos.js +0 -80
- package/dist/modules/Payment/mx51.d.ts +0 -0
- package/dist/modules/Payment/mx51.js +0 -0
- package/dist/modules/Payment/utils.d.ts +0 -17
- package/dist/modules/Payment/utils.js +0 -62
- package/dist/modules/Payment/walletpass.d.ts +0 -99
- package/dist/modules/Payment/walletpass.js +0 -711
- package/dist/plugins/app-types/app/app.d.ts +0 -83
- package/dist/plugins/app-types/app/const.d.ts +0 -4
- package/dist/plugins/app-types/app/index.d.ts +0 -14
- package/dist/plugins/app-types/applicationManager/application.d.ts +0 -50
- package/dist/plugins/app-types/applicationManager/index.d.ts +0 -13
- package/dist/plugins/app-types/config.d.ts +0 -3
- package/dist/plugins/app-types/cookie/index.d.ts +0 -13
- package/dist/plugins/app-types/data/index.d.ts +0 -8
- package/dist/plugins/app-types/history/config.d.ts +0 -24
- package/dist/plugins/app-types/history/index.d.ts +0 -20
- package/dist/plugins/app-types/history/type.d.ts +0 -2
- package/dist/plugins/app-types/hooks/index.d.ts +0 -12
- package/dist/plugins/app-types/hooks/useDelayedValue/index.d.ts +0 -2
- package/dist/plugins/app-types/hooks/useDispatch/index.d.ts +0 -2
- package/dist/plugins/app-types/hooks/useLowCode/index.d.ts +0 -13
- package/dist/plugins/app-types/hooks/useStore/index.d.ts +0 -6
- package/dist/plugins/app-types/index.d.ts +0 -6
- package/dist/plugins/app-types/indexDB/index.d.ts +0 -178
- package/dist/plugins/app-types/locales/en.d.ts +0 -3
- package/dist/plugins/app-types/locales/index.d.ts +0 -37
- package/dist/plugins/app-types/locales/original.d.ts +0 -3
- package/dist/plugins/app-types/locales/type.d.ts +0 -19
- package/dist/plugins/app-types/locales/zh-CN.d.ts +0 -3
- package/dist/plugins/app-types/locales/zh-HK.d.ts +0 -3
- package/dist/plugins/app-types/logger/feishu.d.ts +0 -11
- package/dist/plugins/app-types/logger/index.d.ts +0 -122
- package/dist/plugins/app-types/menuManager/hooks.d.ts +0 -17
- package/dist/plugins/app-types/menuManager/index.d.ts +0 -28
- package/dist/plugins/app-types/models/global.d.ts +0 -32
- package/dist/plugins/app-types/models/index.d.ts +0 -45
- package/dist/plugins/app-types/models/type.d.ts +0 -2
- package/dist/plugins/app-types/package.json +0 -15
- package/dist/plugins/app-types/plugin/index.d.ts +0 -0
- package/dist/plugins/app-types/pubsub/example.d.ts +0 -5
- package/dist/plugins/app-types/pubsub/index.d.ts +0 -63
- package/dist/plugins/app-types/request/cache.d.ts +0 -46
- package/dist/plugins/app-types/request/cancelToken.d.ts +0 -38
- package/dist/plugins/app-types/request/config.d.ts +0 -3
- package/dist/plugins/app-types/request/constants.d.ts +0 -2
- package/dist/plugins/app-types/request/index.d.ts +0 -24
- package/dist/plugins/app-types/request/pisell2Request.d.ts +0 -6
- package/dist/plugins/app-types/request/type.d.ts +0 -41
- package/dist/plugins/app-types/request/utils.d.ts +0 -46
- package/dist/plugins/app-types/routes/config.d.ts +0 -7
- package/dist/plugins/app-types/routes/index.d.ts +0 -28
- package/dist/plugins/app-types/socket/components/SocketMonitorPage.d.ts +0 -6
- package/dist/plugins/app-types/socket/components/index.d.ts +0 -2
- package/dist/plugins/app-types/socket/constants.d.ts +0 -33
- package/dist/plugins/app-types/socket/events.d.ts +0 -31
- package/dist/plugins/app-types/socket/heartbeat.d.ts +0 -66
- package/dist/plugins/app-types/socket/index.d.ts +0 -61
- package/dist/plugins/app-types/socket/monitor.d.ts +0 -169
- package/dist/plugins/app-types/socket/reconnect.d.ts +0 -61
- package/dist/plugins/app-types/socket/socket.d.ts +0 -129
- package/dist/plugins/app-types/socket/types.d.ts +0 -85
- package/dist/plugins/app-types/storage/index.d.ts +0 -17
- package/dist/plugins/app-types/tasks/index.d.ts +0 -77
- package/dist/plugins/app-types/tasks/type.d.ts +0 -62
- package/dist/plugins/app-types/tasks/useTasks.d.ts +0 -5
- package/dist/plugins/app-types/type.d.ts +0 -2
- package/dist/plugins/app-types/variables/VariablesProvider.d.ts +0 -7
- package/dist/plugins/app-types/variables/config.d.ts +0 -3
- package/dist/plugins/app-types/variables/index.d.ts +0 -6
- package/dist/plugins/app-types/variables/type.d.ts +0 -2
- package/dist/plugins/app-types/website/index.d.ts +0 -6
- package/dist/plugins/app.d.ts +0 -8
- package/dist/plugins/app.js +0 -1
- package/dist/solution/BookingTicket/index.d.ts +0 -184
- package/dist/solution/BookingTicket/index.js +0 -698
- package/dist/solution/BookingTicket/types.d.ts +0 -68
- package/dist/solution/BookingTicket/types.js +0 -43
- package/dist/solution/BookingTicket/utils/scan/cloudSearch.d.ts +0 -22
- package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +0 -159
- package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +0 -22
- package/dist/solution/BookingTicket/utils/scan/handleScan.js +0 -189
- package/dist/solution/BookingTicket/utils/scan/index.d.ts +0 -85
- package/dist/solution/BookingTicket/utils/scan/index.js +0 -294
- package/dist/solution/BookingTicket/utils/scan/scanCache.d.ts +0 -78
- package/dist/solution/BookingTicket/utils/scan/scanCache.js +0 -305
- package/dist/solution/Checkout/appointmentDemo.json +0 -1
- package/dist/solution/Checkout/index.d.ts +0 -432
- package/dist/solution/Checkout/index.js +0 -4452
- package/dist/solution/Checkout/types.d.ts +0 -727
- package/dist/solution/Checkout/types.js +0 -104
- package/dist/solution/Checkout/utils/index.d.ts +0 -121
- package/dist/solution/Checkout/utils/index.js +0 -511
- package/dist/utils/task.d.ts +0 -40
- package/dist/utils/task.js +0 -171
- package/dist/utils/watch.d.ts +0 -102
- package/dist/utils/watch.js +0 -294
- package/lib/modules/Customer/constants.d.ts +0 -7
- package/lib/modules/Customer/constants.js +0 -39
- package/lib/modules/Customer/index.d.ts +0 -122
- package/lib/modules/Customer/index.js +0 -439
- package/lib/modules/Customer/types.d.ts +0 -146
- package/lib/modules/Customer/types.js +0 -37
- package/lib/modules/Payment/cash.d.ts +0 -19
- package/lib/modules/Payment/cash.js +0 -64
- package/lib/modules/Payment/cashRecommendationAlgorithm.d.ts +0 -22
- package/lib/modules/Payment/cashRecommendationAlgorithm.js +0 -342
- package/lib/modules/Payment/eftpos.d.ts +0 -11
- package/lib/modules/Payment/eftpos.js +0 -51
- package/lib/modules/Payment/mx51.d.ts +0 -0
- package/lib/modules/Payment/mx51.js +0 -0
- package/lib/modules/Payment/utils.d.ts +0 -17
- package/lib/modules/Payment/utils.js +0 -67
- package/lib/modules/Payment/walletpass.d.ts +0 -99
- package/lib/modules/Payment/walletpass.js +0 -484
- package/lib/plugins/app-types/app/app.d.ts +0 -83
- package/lib/plugins/app-types/app/const.d.ts +0 -4
- package/lib/plugins/app-types/app/index.d.ts +0 -14
- package/lib/plugins/app-types/applicationManager/application.d.ts +0 -50
- package/lib/plugins/app-types/applicationManager/index.d.ts +0 -13
- package/lib/plugins/app-types/config.d.ts +0 -3
- package/lib/plugins/app-types/cookie/index.d.ts +0 -13
- package/lib/plugins/app-types/data/index.d.ts +0 -8
- package/lib/plugins/app-types/history/config.d.ts +0 -24
- package/lib/plugins/app-types/history/index.d.ts +0 -20
- package/lib/plugins/app-types/history/type.d.ts +0 -2
- package/lib/plugins/app-types/hooks/index.d.ts +0 -12
- package/lib/plugins/app-types/hooks/useDelayedValue/index.d.ts +0 -2
- package/lib/plugins/app-types/hooks/useDispatch/index.d.ts +0 -2
- package/lib/plugins/app-types/hooks/useLowCode/index.d.ts +0 -13
- package/lib/plugins/app-types/hooks/useStore/index.d.ts +0 -6
- package/lib/plugins/app-types/index.d.ts +0 -6
- package/lib/plugins/app-types/indexDB/index.d.ts +0 -178
- package/lib/plugins/app-types/locales/en.d.ts +0 -3
- package/lib/plugins/app-types/locales/index.d.ts +0 -37
- package/lib/plugins/app-types/locales/original.d.ts +0 -3
- package/lib/plugins/app-types/locales/type.d.ts +0 -19
- package/lib/plugins/app-types/locales/zh-CN.d.ts +0 -3
- package/lib/plugins/app-types/locales/zh-HK.d.ts +0 -3
- package/lib/plugins/app-types/logger/feishu.d.ts +0 -11
- package/lib/plugins/app-types/logger/index.d.ts +0 -122
- package/lib/plugins/app-types/menuManager/hooks.d.ts +0 -17
- package/lib/plugins/app-types/menuManager/index.d.ts +0 -28
- package/lib/plugins/app-types/models/global.d.ts +0 -32
- package/lib/plugins/app-types/models/index.d.ts +0 -45
- package/lib/plugins/app-types/models/type.d.ts +0 -2
- package/lib/plugins/app-types/package.json +0 -15
- package/lib/plugins/app-types/plugin/index.d.ts +0 -0
- package/lib/plugins/app-types/pubsub/example.d.ts +0 -5
- package/lib/plugins/app-types/pubsub/index.d.ts +0 -63
- package/lib/plugins/app-types/request/cache.d.ts +0 -46
- package/lib/plugins/app-types/request/cancelToken.d.ts +0 -38
- package/lib/plugins/app-types/request/config.d.ts +0 -3
- package/lib/plugins/app-types/request/constants.d.ts +0 -2
- package/lib/plugins/app-types/request/index.d.ts +0 -24
- package/lib/plugins/app-types/request/pisell2Request.d.ts +0 -6
- package/lib/plugins/app-types/request/type.d.ts +0 -41
- package/lib/plugins/app-types/request/utils.d.ts +0 -46
- package/lib/plugins/app-types/routes/config.d.ts +0 -7
- package/lib/plugins/app-types/routes/index.d.ts +0 -28
- package/lib/plugins/app-types/socket/components/SocketMonitorPage.d.ts +0 -6
- package/lib/plugins/app-types/socket/components/index.d.ts +0 -2
- package/lib/plugins/app-types/socket/constants.d.ts +0 -33
- package/lib/plugins/app-types/socket/events.d.ts +0 -31
- package/lib/plugins/app-types/socket/heartbeat.d.ts +0 -66
- package/lib/plugins/app-types/socket/index.d.ts +0 -61
- package/lib/plugins/app-types/socket/monitor.d.ts +0 -169
- package/lib/plugins/app-types/socket/reconnect.d.ts +0 -61
- package/lib/plugins/app-types/socket/socket.d.ts +0 -129
- package/lib/plugins/app-types/socket/types.d.ts +0 -85
- package/lib/plugins/app-types/storage/index.d.ts +0 -17
- package/lib/plugins/app-types/tasks/index.d.ts +0 -77
- package/lib/plugins/app-types/tasks/type.d.ts +0 -62
- package/lib/plugins/app-types/tasks/useTasks.d.ts +0 -5
- package/lib/plugins/app-types/type.d.ts +0 -2
- package/lib/plugins/app-types/variables/VariablesProvider.d.ts +0 -7
- package/lib/plugins/app-types/variables/config.d.ts +0 -3
- package/lib/plugins/app-types/variables/index.d.ts +0 -6
- package/lib/plugins/app-types/variables/type.d.ts +0 -2
- package/lib/plugins/app-types/website/index.d.ts +0 -6
- package/lib/plugins/app.d.ts +0 -8
- package/lib/plugins/app.js +0 -17
- package/lib/solution/BookingTicket/index.d.ts +0 -184
- package/lib/solution/BookingTicket/index.js +0 -426
- package/lib/solution/BookingTicket/types.d.ts +0 -68
- package/lib/solution/BookingTicket/types.js +0 -72
- package/lib/solution/BookingTicket/utils/scan/cloudSearch.d.ts +0 -22
- package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +0 -117
- package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +0 -22
- package/lib/solution/BookingTicket/utils/scan/handleScan.js +0 -132
- package/lib/solution/BookingTicket/utils/scan/index.d.ts +0 -85
- package/lib/solution/BookingTicket/utils/scan/index.js +0 -216
- package/lib/solution/BookingTicket/utils/scan/scanCache.d.ts +0 -78
- package/lib/solution/BookingTicket/utils/scan/scanCache.js +0 -231
- package/lib/solution/Checkout/appointmentDemo.json +0 -1
- package/lib/solution/Checkout/index.d.ts +0 -432
- package/lib/solution/Checkout/index.js +0 -2776
- package/lib/solution/Checkout/types.d.ts +0 -727
- package/lib/solution/Checkout/types.js +0 -63
- package/lib/solution/Checkout/utils/index.d.ts +0 -121
- package/lib/solution/Checkout/utils/index.js +0 -362
- package/lib/utils/task.d.ts +0 -40
- package/lib/utils/task.js +0 -109
- package/lib/utils/watch.d.ts +0 -102
- package/lib/utils/watch.js +0 -217
|
@@ -19,90 +19,17 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
19
19
|
// src/modules/Payment/types.ts
|
|
20
20
|
var types_exports = {};
|
|
21
21
|
__export(types_exports, {
|
|
22
|
-
PaymentHooks: () => PaymentHooks
|
|
23
|
-
PaymentMethodType: () => PaymentMethodType,
|
|
24
|
-
PaymentStatus: () => PaymentStatus,
|
|
25
|
-
RoundingInterval: () => RoundingInterval,
|
|
26
|
-
RoundingRule: () => RoundingRule,
|
|
27
|
-
TaskRunStatus: () => TaskRunStatus,
|
|
28
|
-
WalletPassHooks: () => WalletPassHooks
|
|
22
|
+
PaymentHooks: () => PaymentHooks
|
|
29
23
|
});
|
|
30
24
|
module.exports = __toCommonJS(types_exports);
|
|
31
|
-
var PaymentMethodType = /* @__PURE__ */ ((PaymentMethodType2) => {
|
|
32
|
-
PaymentMethodType2["Cash"] = "CASHMANUAL";
|
|
33
|
-
PaymentMethodType2["Eftpos"] = "EFTPOS";
|
|
34
|
-
PaymentMethodType2["Wallet"] = "WALLET";
|
|
35
|
-
return PaymentMethodType2;
|
|
36
|
-
})(PaymentMethodType || {});
|
|
37
|
-
var PaymentStatus = /* @__PURE__ */ ((PaymentStatus2) => {
|
|
38
|
-
PaymentStatus2["Processing"] = "payment_processing";
|
|
39
|
-
PaymentStatus2["Sync"] = "sync";
|
|
40
|
-
PaymentStatus2["PartiallyPaid"] = "partially_paid";
|
|
41
|
-
PaymentStatus2["Finished"] = "finish";
|
|
42
|
-
return PaymentStatus2;
|
|
43
|
-
})(PaymentStatus || {});
|
|
44
|
-
var TaskRunStatus = /* @__PURE__ */ ((TaskRunStatus2) => {
|
|
45
|
-
TaskRunStatus2["Pending"] = "pending";
|
|
46
|
-
TaskRunStatus2["Running"] = "running";
|
|
47
|
-
TaskRunStatus2["Success"] = "success";
|
|
48
|
-
TaskRunStatus2["Failed"] = "failed";
|
|
49
|
-
return TaskRunStatus2;
|
|
50
|
-
})(TaskRunStatus || {});
|
|
51
|
-
var RoundingRule = /* @__PURE__ */ ((RoundingRule2) => {
|
|
52
|
-
RoundingRule2["Standard"] = "standard_rounding";
|
|
53
|
-
RoundingRule2["StandardDown"] = "standard_down";
|
|
54
|
-
RoundingRule2["AlwaysUp"] = "always_up";
|
|
55
|
-
RoundingRule2["AlwaysDown"] = "always_down";
|
|
56
|
-
return RoundingRule2;
|
|
57
|
-
})(RoundingRule || {});
|
|
58
|
-
var RoundingInterval = /* @__PURE__ */ ((RoundingInterval2) => {
|
|
59
|
-
RoundingInterval2[RoundingInterval2["Interval005"] = 0.05] = "Interval005";
|
|
60
|
-
RoundingInterval2[RoundingInterval2["Interval01"] = 0.1] = "Interval01";
|
|
61
|
-
RoundingInterval2[RoundingInterval2["Interval05"] = 0.5] = "Interval05";
|
|
62
|
-
RoundingInterval2[RoundingInterval2["Interval1"] = 1] = "Interval1";
|
|
63
|
-
return RoundingInterval2;
|
|
64
|
-
})(RoundingInterval || {});
|
|
65
|
-
var WalletPassHooks = /* @__PURE__ */ ((WalletPassHooks2) => {
|
|
66
|
-
WalletPassHooks2["OnWalletRecommendListUpdated"] = "wallet:onWalletRecommendListUpdated";
|
|
67
|
-
WalletPassHooks2["OnWalletRecommendListCleared"] = "wallet:onWalletRecommendListCleared";
|
|
68
|
-
WalletPassHooks2["OnUserIdentificationCodesUpdated"] = "wallet:onUserIdentificationCodesUpdated";
|
|
69
|
-
WalletPassHooks2["OnUserIdentificationCodesCleared"] = "wallet:onUserIdentificationCodesCleared";
|
|
70
|
-
WalletPassHooks2["OnWalletCacheCleared"] = "wallet:onWalletCacheCleared";
|
|
71
|
-
WalletPassHooks2["OnSearchIdentificationCodeCompleted"] = "wallet:onSearchIdentificationCodeCompleted";
|
|
72
|
-
WalletPassHooks2["OnWalletInitializationStarted"] = "wallet:onWalletInitializationStarted";
|
|
73
|
-
WalletPassHooks2["OnWalletInitializationCompleted"] = "wallet:onWalletInitializationCompleted";
|
|
74
|
-
WalletPassHooks2["OnWalletInitializationFailed"] = "wallet:onWalletInitializationFailed";
|
|
75
|
-
return WalletPassHooks2;
|
|
76
|
-
})(WalletPassHooks || {});
|
|
77
25
|
var PaymentHooks = /* @__PURE__ */ ((PaymentHooks2) => {
|
|
78
|
-
PaymentHooks2["
|
|
79
|
-
PaymentHooks2["
|
|
80
|
-
PaymentHooks2["
|
|
81
|
-
PaymentHooks2["
|
|
82
|
-
PaymentHooks2["OnOrderUpdated"] = "payment:onOrderUpdated";
|
|
83
|
-
PaymentHooks2["OnOrderDeleted"] = "payment:onOrderDeleted";
|
|
84
|
-
PaymentHooks2["OnPaymentAdded"] = "payment:onPaymentAdded";
|
|
85
|
-
PaymentHooks2["OnPaymentUpdated"] = "payment:onPaymentUpdated";
|
|
86
|
-
PaymentHooks2["OnPaymentDeleted"] = "payment:onPaymentDeleted";
|
|
87
|
-
PaymentHooks2["OnPaymentSubmitted"] = "payment:onPaymentSubmitted";
|
|
88
|
-
PaymentHooks2["OnOrderAmountChanged"] = "payment:onOrderAmountChanged";
|
|
89
|
-
PaymentHooks2["OnPaymentSyncError"] = "payment:onPaymentSyncError";
|
|
90
|
-
PaymentHooks2["OnPaymentSyncSuccess"] = "payment:onPaymentSyncSuccess";
|
|
91
|
-
PaymentHooks2["OnWalletRecommendListUpdated"] = "wallet:onWalletRecommendListUpdated" /* OnWalletRecommendListUpdated */;
|
|
92
|
-
PaymentHooks2["OnWalletRecommendListCleared"] = "wallet:onWalletRecommendListCleared" /* OnWalletRecommendListCleared */;
|
|
93
|
-
PaymentHooks2["OnUserIdentificationCodesUpdated"] = "wallet:onUserIdentificationCodesUpdated" /* OnUserIdentificationCodesUpdated */;
|
|
94
|
-
PaymentHooks2["OnUserIdentificationCodesCleared"] = "wallet:onUserIdentificationCodesCleared" /* OnUserIdentificationCodesCleared */;
|
|
95
|
-
PaymentHooks2["OnWalletCacheCleared"] = "wallet:onWalletCacheCleared" /* OnWalletCacheCleared */;
|
|
96
|
-
PaymentHooks2["OnSearchIdentificationCodeCompleted"] = "wallet:onSearchIdentificationCodeCompleted" /* OnSearchIdentificationCodeCompleted */;
|
|
26
|
+
PaymentHooks2["OnPaymentInit"] = "payment:onPaymentInit";
|
|
27
|
+
PaymentHooks2["OnPaymentSuccess"] = "payment:onPaymentSuccess";
|
|
28
|
+
PaymentHooks2["OnPaymentFailure"] = "payment:onPaymentFailure";
|
|
29
|
+
PaymentHooks2["OnPaymentRefund"] = "payment:onPaymentRefund";
|
|
97
30
|
return PaymentHooks2;
|
|
98
31
|
})(PaymentHooks || {});
|
|
99
32
|
// Annotate the CommonJS export names for ESM import in node:
|
|
100
33
|
0 && (module.exports = {
|
|
101
|
-
PaymentHooks
|
|
102
|
-
PaymentMethodType,
|
|
103
|
-
PaymentStatus,
|
|
104
|
-
RoundingInterval,
|
|
105
|
-
RoundingRule,
|
|
106
|
-
TaskRunStatus,
|
|
107
|
-
WalletPassHooks
|
|
34
|
+
PaymentHooks
|
|
108
35
|
});
|
|
@@ -11,17 +11,12 @@ export declare class ProductList extends BaseModule implements Module {
|
|
|
11
11
|
constructor(name?: string, version?: string);
|
|
12
12
|
initialize(core: PisellCore, options: any): Promise<void>;
|
|
13
13
|
storeChange(path?: string, value?: any): Promise<void>;
|
|
14
|
-
loadProducts({ category_ids, product_ids, collection,
|
|
14
|
+
loadProducts({ category_ids, product_ids, collection, schedule_date, cacheId }: {
|
|
15
15
|
category_ids?: number[];
|
|
16
16
|
product_ids?: number[];
|
|
17
17
|
collection?: number | string[];
|
|
18
18
|
schedule_date?: string;
|
|
19
19
|
cacheId?: string;
|
|
20
|
-
customer_id?: number;
|
|
21
|
-
menu_list_ids?: number[];
|
|
22
|
-
schedule_datetime?: string;
|
|
23
|
-
with_count?: string[];
|
|
24
|
-
with_schedule?: number;
|
|
25
20
|
}): Promise<any>;
|
|
26
21
|
loadProductsPrice({ ids, customer_id, schedule_date, channel, }: {
|
|
27
22
|
ids?: number[];
|
|
@@ -33,10 +28,4 @@ export declare class ProductList extends BaseModule implements Module {
|
|
|
33
28
|
getProduct(id: number): Promise<ProductData | undefined>;
|
|
34
29
|
addProduct(products: ProductData[]): Promise<void>;
|
|
35
30
|
selectProducts(products: ProductData[]): Promise<void>;
|
|
36
|
-
/**
|
|
37
|
-
* 根据商品编码或条码搜索商品
|
|
38
|
-
* @param code 商品编码或条码
|
|
39
|
-
* @returns 匹配的商品列表,如果没有匹配则返回空数组
|
|
40
|
-
*/
|
|
41
|
-
findProductsByCodeOrBarcode(code: string): ProductData[];
|
|
42
31
|
}
|
|
@@ -24,6 +24,7 @@ __export(ProductList_exports, {
|
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(ProductList_exports);
|
|
26
26
|
var import_BaseModule = require("../BaseModule");
|
|
27
|
+
var import_types = require("./types");
|
|
27
28
|
var import_lodash_es = require("lodash-es");
|
|
28
29
|
__reExport(ProductList_exports, require("./types"), module.exports);
|
|
29
30
|
var ProductList = class extends import_BaseModule.BaseModule {
|
|
@@ -53,19 +54,14 @@ var ProductList = class extends import_BaseModule.BaseModule {
|
|
|
53
54
|
category_ids = [],
|
|
54
55
|
product_ids = [],
|
|
55
56
|
collection = [],
|
|
56
|
-
menu_list_ids = [],
|
|
57
|
-
customer_id: paramsCustomerId,
|
|
58
|
-
with_count = [],
|
|
59
|
-
schedule_datetime,
|
|
60
57
|
schedule_date,
|
|
61
|
-
cacheId
|
|
62
|
-
with_schedule
|
|
58
|
+
cacheId
|
|
63
59
|
}) {
|
|
64
60
|
var _a, _b;
|
|
65
61
|
let userPlugin = this.core.getPlugin("user");
|
|
66
62
|
let customer_id = void 0;
|
|
67
63
|
try {
|
|
68
|
-
customer_id =
|
|
64
|
+
customer_id = (_a = userPlugin == null ? void 0 : userPlugin.get()) == null ? void 0 : _a.id;
|
|
69
65
|
} catch (error) {
|
|
70
66
|
console.error(error);
|
|
71
67
|
}
|
|
@@ -91,13 +87,9 @@ var ProductList = class extends import_BaseModule.BaseModule {
|
|
|
91
87
|
ids: product_ids,
|
|
92
88
|
collection,
|
|
93
89
|
front_end_cache_id: cacheId,
|
|
94
|
-
menu_list_ids,
|
|
95
|
-
with_count,
|
|
96
90
|
// client_schedule_ids: schedule_ids,
|
|
97
91
|
schedule_date,
|
|
98
92
|
application_code: (_b = this.otherParams) == null ? void 0 : _b.channel,
|
|
99
|
-
with_schedule,
|
|
100
|
-
schedule_datetime,
|
|
101
93
|
is_eject: 1
|
|
102
94
|
},
|
|
103
95
|
{ useCache: true }
|
|
@@ -126,14 +118,14 @@ var ProductList = class extends import_BaseModule.BaseModule {
|
|
|
126
118
|
}
|
|
127
119
|
async getProducts() {
|
|
128
120
|
await this.core.effects.emit(
|
|
129
|
-
|
|
121
|
+
import_types.ProductListHooks.onGetProducts,
|
|
130
122
|
this.store.list
|
|
131
123
|
);
|
|
132
124
|
return (0, import_lodash_es.cloneDeep)(this.store.list);
|
|
133
125
|
}
|
|
134
126
|
async getProduct(id) {
|
|
135
127
|
await this.core.effects.emit(
|
|
136
|
-
|
|
128
|
+
import_types.ProductListHooks.onGetProduct,
|
|
137
129
|
this.store.list
|
|
138
130
|
);
|
|
139
131
|
const product = this.store.list.find((product2) => product2.id === id);
|
|
@@ -157,24 +149,6 @@ var ProductList = class extends import_BaseModule.BaseModule {
|
|
|
157
149
|
async selectProducts(products) {
|
|
158
150
|
this.store.selectProducts = products;
|
|
159
151
|
}
|
|
160
|
-
/**
|
|
161
|
-
* 根据商品编码或条码搜索商品
|
|
162
|
-
* @param code 商品编码或条码
|
|
163
|
-
* @returns 匹配的商品列表,如果没有匹配则返回空数组
|
|
164
|
-
*/
|
|
165
|
-
findProductsByCodeOrBarcode(code) {
|
|
166
|
-
if (!code || typeof code !== "string") {
|
|
167
|
-
return [];
|
|
168
|
-
}
|
|
169
|
-
const trimmedCode = code.trim();
|
|
170
|
-
if (!trimmedCode) {
|
|
171
|
-
return [];
|
|
172
|
-
}
|
|
173
|
-
const matchingProducts = this.store.list.filter((product) => {
|
|
174
|
-
return product.code && product.code.trim() === trimmedCode || product.barcode && product.barcode.trim() === trimmedCode;
|
|
175
|
-
});
|
|
176
|
-
return (0, import_lodash_es.cloneDeep)(matchingProducts);
|
|
177
|
-
}
|
|
178
152
|
};
|
|
179
153
|
// Annotate the CommonJS export names for ESM import in node:
|
|
180
154
|
0 && (module.exports = {
|
|
@@ -42,7 +42,7 @@ var ResourceListModule = class extends import_BaseModule.BaseModule {
|
|
|
42
42
|
if (!resource)
|
|
43
43
|
return;
|
|
44
44
|
this.store.selectedResource = resource;
|
|
45
|
-
await this.core.effects.emit(
|
|
45
|
+
await this.core.effects.emit(import_types.ResourceHooks.OnResourceSelect, resource);
|
|
46
46
|
}
|
|
47
47
|
getSelectedResource() {
|
|
48
48
|
return this.store.selectedResource;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Module, PisellCore, ModuleOptions } from '../../types';
|
|
2
2
|
import { BaseModule } from '../BaseModule';
|
|
3
|
-
import { Rules, RulesModuleAPI, DiscountResult } from './types';
|
|
3
|
+
import { Rules, RulesModuleAPI, DiscountResult, UnavailableReason } from './types';
|
|
4
4
|
import { Discount } from "../Discount/types";
|
|
5
|
-
import { SetDiscountSelectedParams } from '../../solution/ShopDiscount/types';
|
|
6
5
|
export declare class RulesModule extends BaseModule implements Module, RulesModuleAPI {
|
|
7
6
|
protected defaultName: string;
|
|
8
7
|
protected defaultVersion: string;
|
|
@@ -25,7 +24,9 @@ export declare class RulesModule extends BaseModule implements Module, RulesModu
|
|
|
25
24
|
isAvailable: boolean;
|
|
26
25
|
discountList: Discount[];
|
|
27
26
|
productList: any[];
|
|
27
|
+
unavailableReason?: UnavailableReason;
|
|
28
28
|
};
|
|
29
|
+
private getUnavailableReason;
|
|
29
30
|
calcDiscount({ discountList, productList, holders, isFormSubject, }: {
|
|
30
31
|
discountList: Discount[];
|
|
31
32
|
productList: any[];
|
|
@@ -36,7 +37,7 @@ export declare class RulesModule extends BaseModule implements Module, RulesModu
|
|
|
36
37
|
}, options?: {
|
|
37
38
|
isSelected?: boolean;
|
|
38
39
|
discountId?: number;
|
|
39
|
-
selectedList?:
|
|
40
|
+
selectedList?: any[];
|
|
40
41
|
scan?: boolean;
|
|
41
42
|
}): DiscountResult;
|
|
42
43
|
/**
|
|
@@ -33,6 +33,7 @@ __export(Rules_exports, {
|
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(Rules_exports);
|
|
35
35
|
var import_BaseModule = require("../BaseModule");
|
|
36
|
+
var import_types = require("./types");
|
|
36
37
|
var import_utils = require("../../solution/ShopDiscount/utils");
|
|
37
38
|
var import_utils2 = require("../Cart/utils");
|
|
38
39
|
var import_decimal = __toESM(require("decimal.js"));
|
|
@@ -52,7 +53,7 @@ var RulesModule = class extends import_BaseModule.BaseModule {
|
|
|
52
53
|
}
|
|
53
54
|
async setRulesList(rulesList) {
|
|
54
55
|
this.store.rulesList = rulesList;
|
|
55
|
-
await this.core.effects.emit(
|
|
56
|
+
await this.core.effects.emit(import_types.RulesHooks.OnRulesListChange, rulesList);
|
|
56
57
|
}
|
|
57
58
|
getRulesList() {
|
|
58
59
|
return this.store.rulesList;
|
|
@@ -93,7 +94,8 @@ var RulesModule = class extends import_BaseModule.BaseModule {
|
|
|
93
94
|
return {
|
|
94
95
|
isAvailable: false,
|
|
95
96
|
discountList: oldDiscountList,
|
|
96
|
-
productList
|
|
97
|
+
productList,
|
|
98
|
+
unavailableReason: import_types.UnavailableReason.AlreadyUsed
|
|
97
99
|
};
|
|
98
100
|
}
|
|
99
101
|
const filteredOldDiscountList = oldDiscountList.filter(
|
|
@@ -131,12 +133,49 @@ var RulesModule = class extends import_BaseModule.BaseModule {
|
|
|
131
133
|
}
|
|
132
134
|
}
|
|
133
135
|
});
|
|
136
|
+
let unavailableReason;
|
|
137
|
+
if (!hasApplicableDiscount) {
|
|
138
|
+
unavailableReason = this.getUnavailableReason(newDiscountList, productList);
|
|
139
|
+
}
|
|
134
140
|
return {
|
|
135
141
|
isAvailable: hasApplicableDiscount,
|
|
136
142
|
discountList: hasApplicableDiscount ? result.discountList : oldDiscountList,
|
|
137
|
-
productList: hasApplicableDiscount ? result.productList : productList
|
|
143
|
+
productList: hasApplicableDiscount ? result.productList : productList,
|
|
144
|
+
unavailableReason
|
|
138
145
|
};
|
|
139
146
|
}
|
|
147
|
+
// 获取券不可用的原因
|
|
148
|
+
getUnavailableReason(discountList, productList) {
|
|
149
|
+
var _a;
|
|
150
|
+
for (const discount of discountList) {
|
|
151
|
+
for (const item of productList) {
|
|
152
|
+
const product = this.hooks.getProduct(item);
|
|
153
|
+
const bookingTime = ((product == null ? void 0 : product.startDate) || (0, import_dayjs.default)()).format("YYYY-MM-DD HH:mm:ss");
|
|
154
|
+
const filteredList = (0, import_utils.filterDiscountListByBookingTime)([discount], bookingTime);
|
|
155
|
+
if (filteredList.length === 0) {
|
|
156
|
+
return import_types.UnavailableReason.TimeLimit;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
for (const discount of discountList) {
|
|
161
|
+
const limitedData = discount.limited_relation_product_data;
|
|
162
|
+
let hasApplicableProduct = false;
|
|
163
|
+
for (const item of productList) {
|
|
164
|
+
const product = this.hooks.getProduct(item);
|
|
165
|
+
if (limitedData.type === "product_all") {
|
|
166
|
+
hasApplicableProduct = true;
|
|
167
|
+
break;
|
|
168
|
+
} else if ((_a = limitedData.product_ids) == null ? void 0 : _a.includes(product.id)) {
|
|
169
|
+
hasApplicableProduct = true;
|
|
170
|
+
break;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
if (!hasApplicableProduct) {
|
|
174
|
+
return import_types.UnavailableReason.ProductNotApplicable;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
return import_types.UnavailableReason.Unknown;
|
|
178
|
+
}
|
|
140
179
|
calcDiscount({
|
|
141
180
|
discountList,
|
|
142
181
|
productList,
|
|
@@ -495,7 +534,7 @@ var RulesModule = class extends import_BaseModule.BaseModule {
|
|
|
495
534
|
].includes(discount2.tag || discount2.type)
|
|
496
535
|
))) : !((flatItem == null ? void 0 : flatItem.booking_id) && !!((_d = (_c = flatItem == null ? void 0 : flatItem.bundleItem) == null ? void 0 : _c.discount_list) == null ? void 0 : _d.length) && ((_f = (_e = flatItem == null ? void 0 : flatItem.bundleItem) == null ? void 0 : _e.discount_list) == null ? void 0 : _f.every((discount2) => discount2.id)));
|
|
497
536
|
const isBundleAvailable = this.checkPackageSubItemUsageRules(discount, flatItem);
|
|
498
|
-
if (isAvailableProduct && isLimitedProduct &&
|
|
537
|
+
if (isAvailableProduct && isLimitedProduct && isBundleAvailable && timeLimit) {
|
|
499
538
|
(_g = discountApplicability.get(discount.id)) == null ? void 0 : _g.push(product.id);
|
|
500
539
|
const applicableProducts = discountApplicableProducts.get(discount.id) || [];
|
|
501
540
|
const discountType = discount.tag || discount.type;
|
|
@@ -562,7 +601,7 @@ var RulesModule = class extends import_BaseModule.BaseModule {
|
|
|
562
601
|
var _a2, _b2;
|
|
563
602
|
if ((Number(product.price) <= 0 || !product.price) && !((_a2 = product.discount_list) == null ? void 0 : _a2.length) && (discount.tag || discount.type) === "good_pass")
|
|
564
603
|
return false;
|
|
565
|
-
if ((Number(product.price)
|
|
604
|
+
if ((Number(product.price) === 0 || !product.price) && !((_b2 = product.discount_list) == null ? void 0 : _b2.find((n) => {
|
|
566
605
|
var _a3;
|
|
567
606
|
return ((_a3 = n.discount) == null ? void 0 : _a3.resource_id) === discount.id;
|
|
568
607
|
})) && (discount.tag || discount.type) !== "good_pass")
|
|
@@ -664,7 +703,7 @@ var RulesModule = class extends import_BaseModule.BaseModule {
|
|
|
664
703
|
}
|
|
665
704
|
}
|
|
666
705
|
}
|
|
667
|
-
if (applicableDiscounts.length === 0 || isManualDiscount
|
|
706
|
+
if (applicableDiscounts.length === 0 || isManualDiscount) {
|
|
668
707
|
if (flatItem.type === "main") {
|
|
669
708
|
if (product.isClient) {
|
|
670
709
|
processedProductsMap.set(
|
|
@@ -696,10 +735,7 @@ var RulesModule = class extends import_BaseModule.BaseModule {
|
|
|
696
735
|
processedProductsMap.set(
|
|
697
736
|
product._id,
|
|
698
737
|
[this.hooks.setProduct(originProduct, {
|
|
699
|
-
...isManualDiscount ? {
|
|
700
|
-
price: product.price,
|
|
701
|
-
main_product_selling_price: product.price
|
|
702
|
-
} : {
|
|
738
|
+
...isManualDiscount ? {} : {
|
|
703
739
|
_id: product._id.split("___")[0] + "___" + index,
|
|
704
740
|
total: product.origin_total || product.total,
|
|
705
741
|
price: product.price,
|
|
@@ -713,7 +749,7 @@ var RulesModule = class extends import_BaseModule.BaseModule {
|
|
|
713
749
|
processedFlatItemsMap.set(flatItem._id, [{
|
|
714
750
|
...flatItem,
|
|
715
751
|
discount_list: [],
|
|
716
|
-
price:
|
|
752
|
+
price: flatItem.bundleItem.original_price,
|
|
717
753
|
processed: true
|
|
718
754
|
}]);
|
|
719
755
|
}
|
|
@@ -1089,16 +1125,14 @@ var RulesModule = class extends import_BaseModule.BaseModule {
|
|
|
1089
1125
|
const allDiscountAmount = (0, import_utils.getDiscountListAmountTotal)(mainDiscountList);
|
|
1090
1126
|
newTotalWithDiscount = new import_decimal.default(mainProductData.price || 0).minus(allDiscountAmount).toNumber() ?? newTotalWithDiscount;
|
|
1091
1127
|
newOriginTotalWithDiscount = mainProductData.origin_total ?? newOriginTotalWithDiscount;
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
newOriginTotalWithDiscount += Number(originalPrice) * Number(item.num);
|
|
1101
|
-
});
|
|
1128
|
+
if (newBundleWithDiscount.length > 0) {
|
|
1129
|
+
newBundleWithDiscount.forEach((item) => {
|
|
1130
|
+
var _a, _b, _c;
|
|
1131
|
+
newTotalWithDiscount += Number(item.price) * Number(item.num);
|
|
1132
|
+
const originalPrice = ((_c = (_b = (_a = item.discount_list) == null ? void 0 : _a[0]) == null ? void 0 : _b.discount) == null ? void 0 : _c.original_amount) || item.price;
|
|
1133
|
+
newOriginTotalWithDiscount += Number(originalPrice) * Number(item.num);
|
|
1134
|
+
});
|
|
1135
|
+
}
|
|
1102
1136
|
}
|
|
1103
1137
|
if (product == null ? void 0 : product.options) {
|
|
1104
1138
|
newTotalWithDiscount = product.options.reduce((accumulator, currentValue) => {
|
|
@@ -1151,12 +1185,12 @@ var RulesModule = class extends import_BaseModule.BaseModule {
|
|
|
1151
1185
|
const allDiscountAmount = (0, import_utils.getDiscountListAmount)(mainDiscountListOriginal);
|
|
1152
1186
|
newTotalOriginal = new import_decimal.default(mainProductData.price || 0).minus(allDiscountAmount).toNumber() ?? newTotalOriginal;
|
|
1153
1187
|
newOriginTotalOriginal = mainProductData.origin_total ?? newOriginTotalOriginal;
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
}
|
|
1188
|
+
if (newBundleOriginal.length > 0) {
|
|
1189
|
+
newBundleOriginal.forEach((item) => {
|
|
1190
|
+
newTotalOriginal += Number(item.price) * Number(item.num);
|
|
1191
|
+
newOriginTotalOriginal += Number(item.price) * Number(item.num);
|
|
1192
|
+
});
|
|
1193
|
+
}
|
|
1160
1194
|
}
|
|
1161
1195
|
if (product == null ? void 0 : product.options) {
|
|
1162
1196
|
newTotalOriginal = product.options.reduce((accumulator, currentValue) => {
|
|
@@ -1231,11 +1265,9 @@ var RulesModule = class extends import_BaseModule.BaseModule {
|
|
|
1231
1265
|
newOriginTotal = mainProductData.origin_total ?? newOriginTotal;
|
|
1232
1266
|
}
|
|
1233
1267
|
if (newBundle.length > 0) {
|
|
1234
|
-
newBundle.forEach((item) => {
|
|
1235
|
-
newTotal += Number(item.price) * Number(item.num);
|
|
1236
|
-
});
|
|
1237
1268
|
newBundle.forEach((item) => {
|
|
1238
1269
|
var _a2, _b2, _c2;
|
|
1270
|
+
newTotal += Number(item.price) * Number(item.num);
|
|
1239
1271
|
const originalPrice = ((_c2 = (_b2 = (_a2 = item.discount_list) == null ? void 0 : _a2[0]) == null ? void 0 : _b2.discount) == null ? void 0 : _c2.original_amount) || item.price;
|
|
1240
1272
|
newOriginTotal += Number(originalPrice) * Number(item.num);
|
|
1241
1273
|
});
|
|
@@ -1376,18 +1408,7 @@ var RulesModule = class extends import_BaseModule.BaseModule {
|
|
|
1376
1408
|
if (isBundleItem) {
|
|
1377
1409
|
const priceType = (_c = flatItem.bundleItem) == null ? void 0 : _c.price_type;
|
|
1378
1410
|
const priceTypeExt = (_d = flatItem.bundleItem) == null ? void 0 : _d.price_type_ext;
|
|
1379
|
-
|
|
1380
|
-
const isMarkupPrice = priceType === "markup" && (priceTypeExt === "" || !priceTypeExt);
|
|
1381
|
-
if (rules.length > 0) {
|
|
1382
|
-
if (isOriginalPrice && rules.includes("original_price")) {
|
|
1383
|
-
return true;
|
|
1384
|
-
}
|
|
1385
|
-
if (isMarkupPrice && rules.includes("markup_price")) {
|
|
1386
|
-
return true;
|
|
1387
|
-
}
|
|
1388
|
-
return false;
|
|
1389
|
-
}
|
|
1390
|
-
return isOriginalPrice;
|
|
1411
|
+
return priceType === "markup" && priceTypeExt === "product_price";
|
|
1391
1412
|
}
|
|
1392
1413
|
return false;
|
|
1393
1414
|
}
|
|
@@ -1398,7 +1419,7 @@ var RulesModule = class extends import_BaseModule.BaseModule {
|
|
|
1398
1419
|
}
|
|
1399
1420
|
async destroy() {
|
|
1400
1421
|
this.core.effects.offByModuleDestroy(this.name);
|
|
1401
|
-
await this.core.effects.emit(
|
|
1422
|
+
await this.core.effects.emit(import_types.RulesHooks.OnDestroy, {});
|
|
1402
1423
|
console.log("[Rules] 已销毁");
|
|
1403
1424
|
}
|
|
1404
1425
|
async clear() {
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { Discount } from '../Discount/types';
|
|
2
|
+
export declare enum UnavailableReason {
|
|
3
|
+
TimeLimit = "time_limit",
|
|
4
|
+
ProductNotApplicable = "product_not_applicable",
|
|
5
|
+
AlreadyUsed = "already_used",
|
|
6
|
+
Unknown = "unknown"
|
|
7
|
+
}
|
|
2
8
|
export declare enum RulesHooks {
|
|
3
9
|
OnRulesListChange = "rules:onRulesListChange",
|
|
4
10
|
OnDestroy = "rules:onDestroy"
|
|
@@ -44,7 +50,6 @@ type ProductDetail = {
|
|
|
44
50
|
num?: number;
|
|
45
51
|
quantity: number;
|
|
46
52
|
holder_id?: number | string;
|
|
47
|
-
vouchersApplicable?: boolean;
|
|
48
53
|
startDate?: any;
|
|
49
54
|
};
|
|
50
55
|
export interface RulesParamsHooks {
|
|
@@ -19,9 +19,17 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
19
19
|
// src/modules/Rules/types.ts
|
|
20
20
|
var types_exports = {};
|
|
21
21
|
__export(types_exports, {
|
|
22
|
-
RulesHooks: () => RulesHooks
|
|
22
|
+
RulesHooks: () => RulesHooks,
|
|
23
|
+
UnavailableReason: () => UnavailableReason
|
|
23
24
|
});
|
|
24
25
|
module.exports = __toCommonJS(types_exports);
|
|
26
|
+
var UnavailableReason = /* @__PURE__ */ ((UnavailableReason2) => {
|
|
27
|
+
UnavailableReason2["TimeLimit"] = "time_limit";
|
|
28
|
+
UnavailableReason2["ProductNotApplicable"] = "product_not_applicable";
|
|
29
|
+
UnavailableReason2["AlreadyUsed"] = "already_used";
|
|
30
|
+
UnavailableReason2["Unknown"] = "unknown";
|
|
31
|
+
return UnavailableReason2;
|
|
32
|
+
})(UnavailableReason || {});
|
|
25
33
|
var RulesHooks = /* @__PURE__ */ ((RulesHooks2) => {
|
|
26
34
|
RulesHooks2["OnRulesListChange"] = "rules:onRulesListChange";
|
|
27
35
|
RulesHooks2["OnDestroy"] = "rules:onDestroy";
|
|
@@ -29,5 +37,6 @@ var RulesHooks = /* @__PURE__ */ ((RulesHooks2) => {
|
|
|
29
37
|
})(RulesHooks || {});
|
|
30
38
|
// Annotate the CommonJS export names for ESM import in node:
|
|
31
39
|
0 && (module.exports = {
|
|
32
|
-
RulesHooks
|
|
40
|
+
RulesHooks,
|
|
41
|
+
UnavailableReason
|
|
33
42
|
});
|
|
@@ -25,13 +25,4 @@ export declare class ScheduleModule extends BaseModule implements Module, Schedu
|
|
|
25
25
|
setOtherProductsIds(ids: number[]): void;
|
|
26
26
|
getOtherProductsIds(): number[];
|
|
27
27
|
storeChange(): void;
|
|
28
|
-
/**
|
|
29
|
-
* 传入一个时间, 判断改时间是否在schedule 内
|
|
30
|
-
* @param param0 { date: string, schedule: any } date: 日期, schedule: schedule
|
|
31
|
-
* @returns
|
|
32
|
-
*/
|
|
33
|
-
static isInScheduleByDate({ date, schedule, }: {
|
|
34
|
-
date: string;
|
|
35
|
-
schedule: any;
|
|
36
|
-
}): boolean | undefined;
|
|
37
28
|
}
|
|
@@ -38,7 +38,6 @@ var import_dayjs = __toESM(require("dayjs"));
|
|
|
38
38
|
var import_isSameOrBefore = __toESM(require("dayjs/plugin/isSameOrBefore"));
|
|
39
39
|
var import_isSameOrAfter = __toESM(require("dayjs/plugin/isSameOrAfter"));
|
|
40
40
|
var import_utils = require("../Date/utils");
|
|
41
|
-
var import_utils2 = require("./utils");
|
|
42
41
|
import_dayjs.default.extend(import_isSameOrBefore.default);
|
|
43
42
|
import_dayjs.default.extend(import_isSameOrAfter.default);
|
|
44
43
|
var ScheduleModule = class extends import_BaseModule.BaseModule {
|
|
@@ -159,65 +158,6 @@ var ScheduleModule = class extends import_BaseModule.BaseModule {
|
|
|
159
158
|
});
|
|
160
159
|
}
|
|
161
160
|
}
|
|
162
|
-
/**
|
|
163
|
-
* 传入一个时间, 判断改时间是否在schedule 内
|
|
164
|
-
* @param param0 { date: string, schedule: any } date: 日期, schedule: schedule
|
|
165
|
-
* @returns
|
|
166
|
-
*/
|
|
167
|
-
static isInScheduleByDate({
|
|
168
|
-
date,
|
|
169
|
-
schedule
|
|
170
|
-
}) {
|
|
171
|
-
var _a, _b, _c, _d;
|
|
172
|
-
if (schedule.start_time && schedule.end_time) {
|
|
173
|
-
const isBeforeStartTime = (0, import_dayjs.default)(date).isBefore(
|
|
174
|
-
(0, import_dayjs.default)(schedule.start_time)
|
|
175
|
-
);
|
|
176
|
-
const isAfterEndTime = (0, import_dayjs.default)(date).isAfter((0, import_dayjs.default)(schedule.end_time));
|
|
177
|
-
if (isBeforeStartTime || isAfterEndTime) {
|
|
178
|
-
return false;
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
let _schedule = {
|
|
182
|
-
...schedule,
|
|
183
|
-
// 开始时间向前推一天
|
|
184
|
-
start_time: (0, import_dayjs.default)(date).subtract(1, "day").format("YYYY-MM-DD HH:mm:ss"),
|
|
185
|
-
end_time: (0, import_dayjs.default)(date).add(1, "day").format("YYYY-MM-DD HH:mm:ss")
|
|
186
|
-
};
|
|
187
|
-
if (((_b = (_a = _schedule.repeat_rule) == null ? void 0 : _a.end) == null ? void 0 : _b.type) === "never") {
|
|
188
|
-
_schedule = {
|
|
189
|
-
..._schedule,
|
|
190
|
-
repeat_rule: {
|
|
191
|
-
..._schedule.repeat_rule,
|
|
192
|
-
end: {
|
|
193
|
-
type: "date",
|
|
194
|
-
end_date: _schedule.end_time,
|
|
195
|
-
occurrence: null
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
};
|
|
199
|
-
}
|
|
200
|
-
if (((_d = (_c = _schedule.repeat_rule) == null ? void 0 : _c.end) == null ? void 0 : _d.type) === "date") {
|
|
201
|
-
_schedule = {
|
|
202
|
-
..._schedule,
|
|
203
|
-
repeat_rule: {
|
|
204
|
-
..._schedule.repeat_rule,
|
|
205
|
-
end: {
|
|
206
|
-
..._schedule.repeat_rule.end,
|
|
207
|
-
end_date: _schedule.end_time
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
};
|
|
211
|
-
}
|
|
212
|
-
const dateRanges = (0, import_utils2.calcScheduleDateRange)({ ..._schedule });
|
|
213
|
-
for (const range of dateRanges) {
|
|
214
|
-
const startTime = (0, import_dayjs.default)(range.start);
|
|
215
|
-
const endTime = (0, import_dayjs.default)(range.end);
|
|
216
|
-
if ((0, import_dayjs.default)(date).isSameOrAfter(startTime) && (0, import_dayjs.default)(date).isSameOrBefore(endTime)) {
|
|
217
|
-
return true;
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
161
|
};
|
|
222
162
|
// Annotate the CommonJS export names for ESM import in node:
|
|
223
163
|
0 && (module.exports = {
|
package/lib/modules/index.d.ts
CHANGED
package/lib/modules/index.js
CHANGED
|
@@ -21,7 +21,6 @@ __reExport(modules_exports, require("./ProductList"), module.exports);
|
|
|
21
21
|
__reExport(modules_exports, require("./Cart"), module.exports);
|
|
22
22
|
__reExport(modules_exports, require("./Account"), module.exports);
|
|
23
23
|
__reExport(modules_exports, require("./AccountList"), module.exports);
|
|
24
|
-
__reExport(modules_exports, require("./Customer"), module.exports);
|
|
25
24
|
__reExport(modules_exports, require("./Date"), module.exports);
|
|
26
25
|
__reExport(modules_exports, require("./Guests"), module.exports);
|
|
27
26
|
__reExport(modules_exports, require("./Order"), module.exports);
|
|
@@ -37,7 +36,6 @@ __reExport(modules_exports, require("./Schedule"), module.exports);
|
|
|
37
36
|
...require("./Cart"),
|
|
38
37
|
...require("./Account"),
|
|
39
38
|
...require("./AccountList"),
|
|
40
|
-
...require("./Customer"),
|
|
41
39
|
...require("./Date"),
|
|
42
40
|
...require("./Guests"),
|
|
43
41
|
...require("./Order"),
|
package/lib/plugins/window.d.ts
CHANGED
|
@@ -299,6 +299,16 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
299
299
|
errorList: any[];
|
|
300
300
|
};
|
|
301
301
|
getTimeSlotByAllResources(resources_code: string): any[];
|
|
302
|
+
getTimeSlotByAllResourcesForDate({ resources_code, startDate, endDate }: {
|
|
303
|
+
resources_code: string;
|
|
304
|
+
startDate: string;
|
|
305
|
+
endDate: string;
|
|
306
|
+
}): Promise<{
|
|
307
|
+
date: string;
|
|
308
|
+
status: string;
|
|
309
|
+
week: string;
|
|
310
|
+
weekNum: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
311
|
+
}[]>;
|
|
302
312
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
303
313
|
private getScheduleDataByIds;
|
|
304
314
|
openProductDetail(productId: number): Promise<void>;
|
|
@@ -316,6 +326,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
316
326
|
count: number;
|
|
317
327
|
left: number;
|
|
318
328
|
summaryCount: number;
|
|
329
|
+
status: keyof TimeStatusMap;
|
|
319
330
|
}[];
|
|
320
331
|
/**
|
|
321
332
|
* 找到多个资源的公共可用时间段
|
|
@@ -380,3 +391,9 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
380
391
|
*/
|
|
381
392
|
getContactInfo(params: any): Promise<any>;
|
|
382
393
|
}
|
|
394
|
+
interface TimeStatusMap {
|
|
395
|
+
lots_of_space: true;
|
|
396
|
+
filling_up_fast: true;
|
|
397
|
+
sold_out: true;
|
|
398
|
+
}
|
|
399
|
+
export {};
|