@pisell/pisellos 2.2.147 → 2.2.149

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.
Files changed (247) hide show
  1. package/dist/apis/picoding.d.ts +0 -0
  2. package/dist/apis/picoding.js +1 -0
  3. package/dist/model/strategy/adapter/index.d.ts +2 -0
  4. package/dist/model/strategy/adapter/index.js +3 -1
  5. package/dist/model/strategy/adapter/itemRule/adapter.d.ts +67 -0
  6. package/dist/model/strategy/adapter/itemRule/adapter.js +483 -0
  7. package/dist/model/strategy/adapter/itemRule/evaluator.d.ts +43 -0
  8. package/dist/model/strategy/adapter/itemRule/evaluator.js +169 -0
  9. package/dist/model/strategy/adapter/itemRule/examples.d.ts +79 -0
  10. package/dist/model/strategy/adapter/itemRule/examples.js +382 -0
  11. package/dist/model/strategy/adapter/itemRule/index.d.ts +5 -0
  12. package/dist/model/strategy/adapter/itemRule/index.js +5 -0
  13. package/dist/model/strategy/adapter/itemRule/type.d.ts +225 -0
  14. package/dist/model/strategy/adapter/itemRule/type.js +101 -0
  15. package/dist/modules/Cart/types.d.ts +2 -0
  16. package/dist/modules/Cart/utils/cartProduct.js +22 -1
  17. package/dist/modules/Cart/utils/changePrice.js +6 -0
  18. package/dist/modules/Date/index.d.ts +1 -1
  19. package/dist/modules/Date/index.js +16 -8
  20. package/dist/modules/Date/types.d.ts +3 -1
  21. package/dist/modules/OpenData/index.d.ts +24 -0
  22. package/dist/modules/OpenData/index.js +173 -0
  23. package/dist/modules/OpenData/types.d.ts +73 -0
  24. package/dist/modules/OpenData/types.js +1 -0
  25. package/dist/modules/OpenData/utils.d.ts +2 -0
  26. package/dist/modules/OpenData/utils.js +75 -0
  27. package/dist/modules/Order/index.d.ts +171 -1
  28. package/dist/modules/Order/index.js +2052 -112
  29. package/dist/modules/Order/types.d.ts +441 -20
  30. package/dist/modules/Order/types.js +23 -0
  31. package/dist/modules/Order/utils.d.ts +120 -0
  32. package/dist/modules/Order/utils.js +653 -2
  33. package/dist/modules/Product/utils.js +2 -2
  34. package/dist/modules/ProductList/index.js +2 -1
  35. package/dist/modules/Quotation/index.d.ts +8 -1
  36. package/dist/modules/Quotation/index.js +40 -10
  37. package/dist/modules/Quotation/types.d.ts +5 -0
  38. package/dist/modules/Rules/index.d.ts +3 -1
  39. package/dist/modules/Rules/index.js +136 -50
  40. package/dist/modules/Rules/types.d.ts +6 -0
  41. package/dist/modules/Rules/types.js +8 -0
  42. package/dist/modules/SalesSummary/index.d.ts +70 -0
  43. package/dist/modules/SalesSummary/index.js +175 -0
  44. package/dist/modules/SalesSummary/types.d.ts +64 -0
  45. package/dist/modules/SalesSummary/types.js +1 -0
  46. package/dist/modules/SalesSummary/utils.d.ts +34 -0
  47. package/dist/modules/SalesSummary/utils.js +488 -0
  48. package/dist/modules/ScanOrderLogger/index.d.ts +21 -0
  49. package/dist/modules/ScanOrderLogger/index.js +161 -0
  50. package/dist/modules/ScanOrderLogger/providers/feishu.d.ts +2 -0
  51. package/dist/modules/ScanOrderLogger/providers/feishu.js +203 -0
  52. package/dist/modules/ScanOrderLogger/providers/grafana.d.ts +2 -0
  53. package/dist/modules/ScanOrderLogger/providers/grafana.js +50 -0
  54. package/dist/modules/ScanOrderLogger/types.d.ts +52 -0
  55. package/dist/modules/ScanOrderLogger/types.js +1 -0
  56. package/dist/modules/Schedule/getDateIsInSchedule.js +7 -7
  57. package/dist/modules/Schedule/index.d.ts +4 -13
  58. package/dist/modules/Schedule/index.js +6 -23
  59. package/dist/modules/Schedule/utils.d.ts +1 -1
  60. package/dist/modules/Summary/index.d.ts +3 -0
  61. package/dist/modules/Summary/index.js +134 -15
  62. package/dist/modules/Summary/types.d.ts +7 -0
  63. package/dist/modules/Summary/utils.d.ts +104 -1
  64. package/dist/modules/Summary/utils.js +1116 -13
  65. package/dist/modules/index.d.ts +4 -0
  66. package/dist/modules/index.js +5 -1
  67. package/dist/server/index.d.ts +41 -4
  68. package/dist/server/index.js +900 -405
  69. package/dist/server/modules/order/index.d.ts +10 -2
  70. package/dist/server/modules/order/index.js +251 -196
  71. package/dist/server/modules/products/index.d.ts +26 -0
  72. package/dist/server/modules/products/index.js +618 -338
  73. package/dist/server/modules/products/types.d.ts +5 -1
  74. package/dist/solution/BaseSales/index.d.ts +175 -0
  75. package/dist/solution/BaseSales/index.js +1293 -0
  76. package/dist/solution/BaseSales/types.d.ts +305 -0
  77. package/dist/solution/BaseSales/types.js +38 -0
  78. package/dist/solution/BaseSales/utils/parseSalesResponse.d.ts +143 -0
  79. package/dist/solution/BaseSales/utils/parseSalesResponse.js +159 -0
  80. package/dist/solution/BaseSales/utils.d.ts +40 -0
  81. package/dist/solution/BaseSales/utils.js +222 -0
  82. package/dist/solution/BookingByStep/index.d.ts +14 -0
  83. package/dist/solution/BookingByStep/index.js +699 -212
  84. package/dist/solution/BookingByStep/types.d.ts +3 -1
  85. package/dist/solution/BookingByStep/types.js +5 -1
  86. package/dist/solution/BookingByStep/utils/capacity.js +1 -1
  87. package/dist/solution/BookingByStep/utils/resources.js +6 -1
  88. package/dist/solution/BookingTicket/index.d.ts +113 -15
  89. package/dist/solution/BookingTicket/index.js +534 -196
  90. package/dist/solution/BookingTicket/types.d.ts +69 -6
  91. package/dist/solution/BookingTicket/types.js +40 -9
  92. package/dist/solution/BookingTicket/utils/bookingStatus.d.ts +37 -0
  93. package/dist/solution/BookingTicket/utils/bookingStatus.js +66 -0
  94. package/dist/solution/BookingTicket/utils/cartView.d.ts +26 -0
  95. package/dist/solution/BookingTicket/utils/cartView.js +84 -0
  96. package/dist/solution/Sales/index.d.ts +1 -0
  97. package/dist/solution/Sales/index.js +1 -0
  98. package/dist/solution/ScanOrder/index.d.ts +146 -0
  99. package/dist/solution/ScanOrder/index.js +3029 -0
  100. package/dist/solution/ScanOrder/types.d.ts +305 -0
  101. package/dist/solution/ScanOrder/types.js +35 -0
  102. package/dist/solution/ScanOrder/utils.d.ts +167 -0
  103. package/dist/solution/ScanOrder/utils.js +768 -0
  104. package/dist/solution/ShopDiscount/index.d.ts +2 -0
  105. package/dist/solution/ShopDiscount/index.js +9 -5
  106. package/dist/solution/ShopDiscount/types.d.ts +4 -0
  107. package/dist/solution/VenueBooking/index.d.ts +197 -0
  108. package/dist/solution/VenueBooking/index.js +3411 -0
  109. package/dist/solution/VenueBooking/sales-section-4-annotated.json +343 -0
  110. package/dist/solution/VenueBooking/types.d.ts +153 -0
  111. package/dist/solution/VenueBooking/types.js +21 -0
  112. package/dist/solution/VenueBooking/utils/dateSummary.d.ts +11 -0
  113. package/dist/solution/VenueBooking/utils/dateSummary.js +104 -0
  114. package/dist/solution/VenueBooking/utils/resource.d.ts +14 -0
  115. package/dist/solution/VenueBooking/utils/resource.js +130 -0
  116. package/dist/solution/VenueBooking/utils/slotMerge.d.ts +34 -0
  117. package/dist/solution/VenueBooking/utils/slotMerge.js +224 -0
  118. package/dist/solution/VenueBooking/utils/timeSlot.d.ts +32 -0
  119. package/dist/solution/VenueBooking/utils/timeSlot.js +453 -0
  120. package/dist/solution/VenueBooking/utils.d.ts +1 -0
  121. package/dist/solution/VenueBooking/utils.js +1 -0
  122. package/dist/solution/index.d.ts +3 -0
  123. package/dist/solution/index.js +4 -1
  124. package/lib/apis/picoding.d.ts +0 -0
  125. package/lib/apis/picoding.js +0 -0
  126. package/lib/model/strategy/adapter/index.d.ts +2 -0
  127. package/lib/model/strategy/adapter/index.js +6 -0
  128. package/lib/model/strategy/adapter/itemRule/adapter.d.ts +67 -0
  129. package/lib/model/strategy/adapter/itemRule/adapter.js +377 -0
  130. package/lib/model/strategy/adapter/itemRule/evaluator.d.ts +43 -0
  131. package/lib/model/strategy/adapter/itemRule/evaluator.js +124 -0
  132. package/lib/model/strategy/adapter/itemRule/examples.d.ts +79 -0
  133. package/lib/model/strategy/adapter/itemRule/examples.js +316 -0
  134. package/lib/model/strategy/adapter/itemRule/index.d.ts +5 -0
  135. package/lib/model/strategy/adapter/itemRule/index.js +60 -0
  136. package/lib/model/strategy/adapter/itemRule/type.d.ts +225 -0
  137. package/lib/model/strategy/adapter/itemRule/type.js +46 -0
  138. package/lib/model/strategy/adapter/promotion/index.js +49 -0
  139. package/lib/modules/Cart/types.d.ts +2 -0
  140. package/lib/modules/Cart/utils/cartProduct.js +17 -1
  141. package/lib/modules/Cart/utils/changePrice.js +5 -0
  142. package/lib/modules/Date/index.d.ts +1 -1
  143. package/lib/modules/Date/index.js +7 -1
  144. package/lib/modules/Date/types.d.ts +3 -1
  145. package/lib/modules/OpenData/index.d.ts +24 -0
  146. package/lib/modules/OpenData/index.js +119 -0
  147. package/lib/modules/OpenData/types.d.ts +73 -0
  148. package/lib/modules/OpenData/types.js +17 -0
  149. package/lib/modules/OpenData/utils.d.ts +2 -0
  150. package/lib/modules/OpenData/utils.js +111 -0
  151. package/lib/modules/Order/index.d.ts +171 -1
  152. package/lib/modules/Order/index.js +1396 -5
  153. package/lib/modules/Order/types.d.ts +441 -20
  154. package/lib/modules/Order/types.js +1 -0
  155. package/lib/modules/Order/utils.d.ts +120 -0
  156. package/lib/modules/Order/utils.js +562 -2
  157. package/lib/modules/Product/utils.js +2 -2
  158. package/lib/modules/ProductList/index.js +2 -1
  159. package/lib/modules/Quotation/index.d.ts +8 -1
  160. package/lib/modules/Quotation/index.js +33 -4
  161. package/lib/modules/Quotation/types.d.ts +5 -0
  162. package/lib/modules/Rules/index.d.ts +3 -1
  163. package/lib/modules/Rules/index.js +46 -6
  164. package/lib/modules/Rules/types.d.ts +6 -0
  165. package/lib/modules/Rules/types.js +11 -2
  166. package/lib/modules/SalesSummary/index.d.ts +70 -0
  167. package/lib/modules/SalesSummary/index.js +106 -0
  168. package/lib/modules/SalesSummary/types.d.ts +64 -0
  169. package/lib/modules/SalesSummary/types.js +17 -0
  170. package/lib/modules/SalesSummary/utils.d.ts +34 -0
  171. package/lib/modules/SalesSummary/utils.js +430 -0
  172. package/lib/modules/ScanOrderLogger/index.d.ts +21 -0
  173. package/lib/modules/ScanOrderLogger/index.js +135 -0
  174. package/lib/modules/ScanOrderLogger/providers/feishu.d.ts +2 -0
  175. package/lib/modules/ScanOrderLogger/providers/feishu.js +148 -0
  176. package/lib/modules/ScanOrderLogger/providers/grafana.d.ts +2 -0
  177. package/lib/modules/ScanOrderLogger/providers/grafana.js +52 -0
  178. package/lib/modules/ScanOrderLogger/types.d.ts +52 -0
  179. package/lib/modules/ScanOrderLogger/types.js +17 -0
  180. package/lib/modules/Schedule/getDateIsInSchedule.js +5 -5
  181. package/lib/modules/Schedule/index.d.ts +4 -13
  182. package/lib/modules/Schedule/index.js +4 -15
  183. package/lib/modules/Schedule/utils.d.ts +1 -1
  184. package/lib/modules/Summary/index.d.ts +3 -0
  185. package/lib/modules/Summary/index.js +61 -2
  186. package/lib/modules/Summary/types.d.ts +7 -0
  187. package/lib/modules/Summary/utils.d.ts +104 -1
  188. package/lib/modules/Summary/utils.js +659 -8
  189. package/lib/modules/index.d.ts +4 -0
  190. package/lib/modules/index.js +9 -1
  191. package/lib/server/index.d.ts +41 -4
  192. package/lib/server/index.js +272 -10
  193. package/lib/server/modules/order/index.d.ts +10 -2
  194. package/lib/server/modules/order/index.js +31 -4
  195. package/lib/server/modules/products/index.d.ts +26 -0
  196. package/lib/server/modules/products/index.js +174 -22
  197. package/lib/server/modules/products/types.d.ts +5 -1
  198. package/lib/solution/BaseSales/index.d.ts +175 -0
  199. package/lib/solution/BaseSales/index.js +655 -0
  200. package/lib/solution/BaseSales/types.d.ts +305 -0
  201. package/lib/solution/BaseSales/types.js +40 -0
  202. package/lib/solution/BaseSales/utils/parseSalesResponse.d.ts +143 -0
  203. package/lib/solution/BaseSales/utils/parseSalesResponse.js +160 -0
  204. package/lib/solution/BaseSales/utils.d.ts +40 -0
  205. package/lib/solution/BaseSales/utils.js +200 -0
  206. package/lib/solution/BookingByStep/index.d.ts +14 -0
  207. package/lib/solution/BookingByStep/index.js +469 -91
  208. package/lib/solution/BookingByStep/types.d.ts +3 -1
  209. package/lib/solution/BookingByStep/types.js +10 -0
  210. package/lib/solution/BookingByStep/utils/capacity.js +1 -1
  211. package/lib/solution/BookingByStep/utils/resources.js +5 -2
  212. package/lib/solution/BookingTicket/index.d.ts +113 -15
  213. package/lib/solution/BookingTicket/index.js +253 -61
  214. package/lib/solution/BookingTicket/types.d.ts +69 -6
  215. package/lib/solution/BookingTicket/types.js +16 -14
  216. package/lib/solution/BookingTicket/utils/bookingStatus.d.ts +37 -0
  217. package/lib/solution/BookingTicket/utils/bookingStatus.js +65 -0
  218. package/lib/solution/BookingTicket/utils/cartView.d.ts +26 -0
  219. package/lib/solution/BookingTicket/utils/cartView.js +103 -0
  220. package/lib/solution/Sales/index.d.ts +1 -0
  221. package/lib/solution/ScanOrder/index.d.ts +146 -0
  222. package/lib/solution/ScanOrder/index.js +1820 -0
  223. package/lib/solution/ScanOrder/types.d.ts +305 -0
  224. package/lib/solution/ScanOrder/types.js +36 -0
  225. package/lib/solution/ScanOrder/utils.d.ts +167 -0
  226. package/lib/solution/ScanOrder/utils.js +639 -0
  227. package/lib/solution/ShopDiscount/index.d.ts +2 -0
  228. package/lib/solution/ShopDiscount/index.js +9 -4
  229. package/lib/solution/ShopDiscount/types.d.ts +4 -0
  230. package/lib/solution/VenueBooking/index.d.ts +197 -0
  231. package/lib/solution/VenueBooking/index.js +1892 -0
  232. package/lib/solution/VenueBooking/sales-section-4-annotated.json +343 -0
  233. package/lib/solution/VenueBooking/types.d.ts +153 -0
  234. package/lib/solution/VenueBooking/types.js +44 -0
  235. package/lib/solution/VenueBooking/utils/dateSummary.d.ts +11 -0
  236. package/lib/solution/VenueBooking/utils/dateSummary.js +110 -0
  237. package/lib/solution/VenueBooking/utils/resource.d.ts +14 -0
  238. package/lib/solution/VenueBooking/utils/resource.js +91 -0
  239. package/lib/solution/VenueBooking/utils/slotMerge.d.ts +34 -0
  240. package/lib/solution/VenueBooking/utils/slotMerge.js +225 -0
  241. package/lib/solution/VenueBooking/utils/timeSlot.d.ts +32 -0
  242. package/lib/solution/VenueBooking/utils/timeSlot.js +339 -0
  243. package/lib/solution/VenueBooking/utils.d.ts +1 -0
  244. package/lib/solution/VenueBooking/utils.js +69 -0
  245. package/lib/solution/index.d.ts +3 -0
  246. package/lib/solution/index.js +7 -1
  247. package/package.json +1 -1
@@ -0,0 +1,639 @@
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/ScanOrder/utils.ts
30
+ var utils_exports = {};
31
+ __export(utils_exports, {
32
+ aggregateItemRuleLimit: () => aggregateItemRuleLimit,
33
+ attachItemRuleLimitsToTopLevelProducts: () => attachItemRuleLimitsToTopLevelProducts,
34
+ buildItemRuleBusinessData: () => buildItemRuleBusinessData,
35
+ buildProductKey: () => buildProductKey,
36
+ buildProductLineFingerprint: () => buildProductLineFingerprint,
37
+ buildQuantityLimitIndex: () => buildQuantityLimitIndex,
38
+ collectLinkProductIdsFromReservationRules: () => collectLinkProductIdsFromReservationRules,
39
+ computeResourceIsFull: () => computeResourceIsFull,
40
+ createEmptySummary: () => createEmptySummary,
41
+ extractStrategyModelIdsFromTableConfig: () => extractStrategyModelIdsFromTableConfig,
42
+ getProductIdentityIndex: () => getProductIdentityIndex,
43
+ getSafeProductNum: () => getSafeProductNum,
44
+ getTopLevelProductId: () => getTopLevelProductId,
45
+ getTopLevelVariantId: () => getTopLevelVariantId,
46
+ hasCustomCapacityProduct: () => hasCustomCapacityProduct,
47
+ isIdentityMatch: () => isIdentityMatch,
48
+ isSkuOnlyDeleteIdentity: () => isSkuOnlyDeleteIdentity,
49
+ normalizeEnabledItemRuleIds: () => normalizeEnabledItemRuleIds,
50
+ normalizeItemRuleStrategies: () => normalizeItemRuleStrategies,
51
+ normalizeOrderProduct: () => normalizeOrderProduct,
52
+ pickFirstCustomCapacityDimensionId: () => pickFirstCustomCapacityDimensionId,
53
+ pickFirstCustomCapacityPaxBounds: () => pickFirstCustomCapacityPaxBounds,
54
+ pickFirstDurationMinutesFromProducts: () => pickFirstDurationMinutesFromProducts,
55
+ resolveSkuMatchedQuantityLimits: () => resolveSkuMatchedQuantityLimits,
56
+ toBoolean: () => toBoolean,
57
+ toNonNegativeInt: () => toNonNegativeInt,
58
+ toNonNegativeNumber: () => toNonNegativeNumber,
59
+ toPositiveString: () => toPositiveString,
60
+ toPriceString: () => toPriceString
61
+ });
62
+ module.exports = __toCommonJS(utils_exports);
63
+ var import_dayjs = __toESM(require("dayjs"));
64
+ var import_decimal = __toESM(require("decimal.js"));
65
+ var import_utils = require("../../modules/Order/utils");
66
+ function createEmptySummary() {
67
+ return {
68
+ product_quantity: 0,
69
+ product_original_amount: "0.00",
70
+ product_amount: "0.00",
71
+ product_expect_amount: "0.00",
72
+ product_tax_fee: "0.00",
73
+ shipping_fee: "0.00",
74
+ shipping_tax_fee: "0.00",
75
+ tax_fee: "0.00",
76
+ surcharge_fee: "0.00",
77
+ discount_amount: "0.00",
78
+ deposit_amount: "0.00",
79
+ expect_amount: "0.00",
80
+ total_amount: "0.00",
81
+ total_refund_amount: "0.00",
82
+ customer_paid_amount: "0.00",
83
+ order_paid_amount: "0.00",
84
+ amount_gap: "0.00",
85
+ rounding_amount: "0.00",
86
+ pay_service_charge_amount: "0.00"
87
+ };
88
+ }
89
+ function getSafeProductNum(num) {
90
+ if (!num || Number.isNaN(num))
91
+ return 1;
92
+ if (num < 1)
93
+ return 1;
94
+ return Math.floor(num);
95
+ }
96
+ function toBoolean(value) {
97
+ if (typeof value === "boolean")
98
+ return value;
99
+ if (typeof value === "number")
100
+ return value !== 0;
101
+ if (typeof value === "string") {
102
+ const normalized = value.trim().toLowerCase();
103
+ return ["1", "true", "yes", "y", "on"].includes(normalized);
104
+ }
105
+ return false;
106
+ }
107
+ function toPositiveString(value) {
108
+ if (value === null || value === void 0 || value === "")
109
+ return void 0;
110
+ const normalized = String(value).trim();
111
+ if (!normalized || normalized === "0" || normalized.toLowerCase() === "null") {
112
+ return void 0;
113
+ }
114
+ return normalized;
115
+ }
116
+ function normalizeEnabledItemRuleIds(rawIds) {
117
+ if (!Array.isArray(rawIds))
118
+ return [];
119
+ const uniqueIds = /* @__PURE__ */ new Set();
120
+ for (const item of rawIds) {
121
+ const strategyId = Number(item);
122
+ if (Number.isFinite(strategyId) && strategyId > 0) {
123
+ uniqueIds.add(strategyId);
124
+ }
125
+ }
126
+ return Array.from(uniqueIds);
127
+ }
128
+ function extractStrategyModelIdsFromTableConfig(tableConfig) {
129
+ const rawIds = Array.isArray(tableConfig == null ? void 0 : tableConfig.strategy_model_ids) ? tableConfig.strategy_model_ids : [];
130
+ return rawIds.map((id) => Number(id)).filter((id) => Number.isFinite(id) && id > 0);
131
+ }
132
+ function normalizeItemRuleStrategies(configs) {
133
+ if (!Array.isArray(configs))
134
+ return [];
135
+ return configs.filter(
136
+ (config) => {
137
+ var _a;
138
+ return Boolean(
139
+ config && typeof config === "object" && ((_a = config == null ? void 0 : config.metadata) == null ? void 0 : _a.type) === "item_rule"
140
+ );
141
+ }
142
+ );
143
+ }
144
+ function toNonNegativeNumber(value) {
145
+ if (typeof value === "number") {
146
+ return Number.isFinite(value) && value >= 0 ? value : 0;
147
+ }
148
+ if (typeof value === "string") {
149
+ const parsed = Number(value);
150
+ return Number.isFinite(parsed) && parsed >= 0 ? parsed : 0;
151
+ }
152
+ return 0;
153
+ }
154
+ function toNonNegativeInt(value) {
155
+ return Math.floor(toNonNegativeNumber(value));
156
+ }
157
+ function toPriceString(value, fallback = "0.00") {
158
+ const parsedValue = Number(value);
159
+ if (Number.isNaN(parsedValue))
160
+ return fallback;
161
+ return parsedValue.toFixed(2);
162
+ }
163
+ function buildProductKey(productId, productVariantId) {
164
+ return `${productId}_${productVariantId}`;
165
+ }
166
+ function getTopLevelProductId(product) {
167
+ const rawProductId = product.product_id ?? product.id;
168
+ const productId = Number(rawProductId);
169
+ if (!Number.isFinite(productId) || productId <= 0)
170
+ return null;
171
+ return productId;
172
+ }
173
+ function getTopLevelVariantId(product) {
174
+ const rawVariantId = product.product_variant_id ?? product.variant_id;
175
+ if (rawVariantId === void 0 || rawVariantId === null || rawVariantId === "") {
176
+ return null;
177
+ }
178
+ const variantId = Number(rawVariantId);
179
+ if (!Number.isFinite(variantId) || variantId <= 0)
180
+ return null;
181
+ return variantId;
182
+ }
183
+ function buildQuantityLimitIndex(limits) {
184
+ const exactLimitMap = /* @__PURE__ */ new Map();
185
+ const productLimitMap = /* @__PURE__ */ new Map();
186
+ for (const limit of limits) {
187
+ const targets = limit.targets || [];
188
+ if (targets.length !== 1)
189
+ continue;
190
+ const target = targets[0];
191
+ const productId = Number(target.product_id);
192
+ if (!Number.isFinite(productId) || productId <= 0)
193
+ continue;
194
+ const variantId = Number(target.product_variant_id);
195
+ const hasVariant = Number.isFinite(variantId) && variantId > 0;
196
+ if (hasVariant) {
197
+ const exactKey = buildProductKey(productId, variantId);
198
+ const existed = exactLimitMap.get(exactKey) || [];
199
+ exactLimitMap.set(exactKey, [...existed, limit]);
200
+ } else {
201
+ const existed = productLimitMap.get(productId) || [];
202
+ productLimitMap.set(productId, [...existed, limit]);
203
+ }
204
+ }
205
+ return {
206
+ exactLimitMap,
207
+ productLimitMap
208
+ };
209
+ }
210
+ function resolveSkuMatchedQuantityLimits(params) {
211
+ const { productId, variantId, limitIndex } = params;
212
+ const exactMatched = variantId && variantId > 0 ? limitIndex.exactLimitMap.get(buildProductKey(productId, variantId)) || [] : [];
213
+ const productMatched = limitIndex.productLimitMap.get(productId) || [];
214
+ return [...exactMatched, ...productMatched];
215
+ }
216
+ function aggregateItemRuleLimit(matchedLimits) {
217
+ if (!matchedLimits.length)
218
+ return null;
219
+ let min;
220
+ let max;
221
+ let remainingMax;
222
+ let exact;
223
+ let mustInclude = false;
224
+ let maxSourceLimit;
225
+ let remainingMaxSourceLimit;
226
+ let exactSourceLimit;
227
+ let minSourceLimit;
228
+ let firstMessagedLimit;
229
+ for (const limit of matchedLimits) {
230
+ if (typeof limit.requiredMin === "number" && Number.isFinite(limit.requiredMin)) {
231
+ if (min === void 0 || limit.requiredMin > min) {
232
+ min = limit.requiredMin;
233
+ minSourceLimit = limit;
234
+ }
235
+ }
236
+ if (typeof limit.requiredMax === "number" && Number.isFinite(limit.requiredMax)) {
237
+ if (max === void 0 || limit.requiredMax < max) {
238
+ max = limit.requiredMax;
239
+ maxSourceLimit = limit;
240
+ }
241
+ }
242
+ if (typeof limit.remainingMax === "number" && Number.isFinite(limit.remainingMax)) {
243
+ if (remainingMax === void 0 || limit.remainingMax < remainingMax) {
244
+ remainingMax = limit.remainingMax;
245
+ remainingMaxSourceLimit = limit;
246
+ }
247
+ }
248
+ if (typeof limit.requiredExact === "number" && Number.isFinite(limit.requiredExact)) {
249
+ exact = limit.requiredExact;
250
+ exactSourceLimit = limit;
251
+ }
252
+ mustInclude = mustInclude || Boolean(limit.mustInclude);
253
+ if (!firstMessagedLimit && limit.validationMessage) {
254
+ firstMessagedLimit = limit;
255
+ }
256
+ }
257
+ if (typeof exact === "number" && Number.isFinite(exact)) {
258
+ min = exact;
259
+ max = exact;
260
+ }
261
+ const maxMessageSource = maxSourceLimit || remainingMaxSourceLimit || exactSourceLimit || firstMessagedLimit;
262
+ const minMessageSource = minSourceLimit || exactSourceLimit || firstMessagedLimit;
263
+ const maxValidationMessage = maxMessageSource == null ? void 0 : maxMessageSource.validationMessage;
264
+ const rawMaxValidationMessage = maxMessageSource == null ? void 0 : maxMessageSource.rawValidationMessage;
265
+ const minValidationMessage = minMessageSource == null ? void 0 : minMessageSource.validationMessage;
266
+ const rawMinValidationMessage = minMessageSource == null ? void 0 : minMessageSource.rawValidationMessage;
267
+ const validationMessage = maxValidationMessage ?? minValidationMessage;
268
+ const rawValidationMessage = rawMaxValidationMessage ?? rawMinValidationMessage;
269
+ return {
270
+ min,
271
+ max,
272
+ remainingMax,
273
+ exact,
274
+ mustInclude,
275
+ validationMessage,
276
+ rawValidationMessage,
277
+ maxValidationMessage,
278
+ rawMaxValidationMessage,
279
+ minValidationMessage,
280
+ rawMinValidationMessage
281
+ };
282
+ }
283
+ function buildItemRuleBusinessData(params) {
284
+ const { tempOrder, runtimeConfig, itemRuleConfigs } = params;
285
+ const rawPax = runtimeConfig.pax || {};
286
+ const adultPax = toNonNegativeInt(rawPax.adult);
287
+ const childPax = toNonNegativeInt(rawPax.child);
288
+ const totalPax = toNonNegativeInt(rawPax.total) || adultPax + childPax || 1;
289
+ const cartItems = tempOrder.products.reduce((result, product) => {
290
+ if (typeof product.product_id !== "number")
291
+ return result;
292
+ result.push({
293
+ product_id: product.product_id,
294
+ quantity: toNonNegativeInt(product.num),
295
+ ...typeof product.product_variant_id === "number" ? { product_variant_id: product.product_variant_id } : {}
296
+ });
297
+ return result;
298
+ }, []);
299
+ const historicalItems = Array.isArray(runtimeConfig.historicalItems) ? runtimeConfig.historicalItems.reduce((result, item) => {
300
+ if (typeof (item == null ? void 0 : item.product_id) !== "number")
301
+ return result;
302
+ result.push({
303
+ product_id: item.product_id,
304
+ quantity: toNonNegativeInt(item.quantity),
305
+ ...typeof item.product_variant_id === "number" ? { product_variant_id: item.product_variant_id } : {}
306
+ });
307
+ return result;
308
+ }, []) : [];
309
+ return {
310
+ pax: {
311
+ total: totalPax,
312
+ adult: adultPax,
313
+ child: childPax
314
+ },
315
+ cartItems,
316
+ historicalItems,
317
+ serviceType: runtimeConfig.serviceType || "dine-in",
318
+ submissionIndex: typeof runtimeConfig.submissionIndex === "number" ? toNonNegativeInt(runtimeConfig.submissionIndex) : tempOrder.order_id ? 1 : 0,
319
+ custom: runtimeConfig.custom || {},
320
+ strategyConfigs: itemRuleConfigs
321
+ };
322
+ }
323
+ function attachItemRuleLimitsToTopLevelProducts(productList, limits) {
324
+ if (!Array.isArray(productList))
325
+ return productList;
326
+ const limitIndex = buildQuantityLimitIndex(limits || []);
327
+ for (const item of productList) {
328
+ if (!item || typeof item !== "object")
329
+ continue;
330
+ const productItem = item;
331
+ const productId = getTopLevelProductId(productItem);
332
+ if (productId === null)
333
+ continue;
334
+ const variantId = getTopLevelVariantId(productItem);
335
+ const matchedLimits = limits.length ? resolveSkuMatchedQuantityLimits({
336
+ productId,
337
+ variantId,
338
+ limitIndex
339
+ }) : [];
340
+ const aggregatedLimit = aggregateItemRuleLimit(matchedLimits);
341
+ if (aggregatedLimit) {
342
+ productItem.item_rule_limit = aggregatedLimit;
343
+ } else if ("item_rule_limit" in productItem) {
344
+ delete productItem.item_rule_limit;
345
+ }
346
+ }
347
+ return productList;
348
+ }
349
+ function buildProductLineFingerprint(productOptionItem, productBundle) {
350
+ const optArr = Array.isArray(productOptionItem) ? productOptionItem : [];
351
+ const normalizedOpts = optArr.map((item) => ({
352
+ product_option_item_id: Number(item == null ? void 0 : item.product_option_item_id) || 0,
353
+ option_group_id: Number(item == null ? void 0 : item.option_group_id) || 0,
354
+ num: typeof (item == null ? void 0 : item.num) === "number" && !Number.isNaN(item.num) ? Math.max(1, Math.floor(item.num)) : 1,
355
+ price: String((item == null ? void 0 : item.price) ?? "")
356
+ })).sort((p, q) => {
357
+ if (p.product_option_item_id !== q.product_option_item_id) {
358
+ return p.product_option_item_id - q.product_option_item_id;
359
+ }
360
+ if (p.option_group_id !== q.option_group_id)
361
+ return p.option_group_id - q.option_group_id;
362
+ if (p.num !== q.num)
363
+ return p.num - q.num;
364
+ return p.price.localeCompare(q.price);
365
+ });
366
+ const bundleArr = Array.isArray(productBundle) ? productBundle : [];
367
+ const normalizedBundles = bundleArr.map((item) => ({
368
+ bundle_id: Number((item == null ? void 0 : item.bundle_id) ?? (item == null ? void 0 : item.id) ?? 0) || 0,
369
+ product_id: Number(item == null ? void 0 : item.product_id) || 0,
370
+ num: typeof (item == null ? void 0 : item.num) === "number" && !Number.isNaN(item.num) ? Math.max(1, Math.floor(item.num)) : 1
371
+ })).sort((p, q) => {
372
+ if (p.bundle_id !== q.bundle_id)
373
+ return p.bundle_id - q.bundle_id;
374
+ if (p.product_id !== q.product_id)
375
+ return p.product_id - q.product_id;
376
+ return p.num - q.num;
377
+ });
378
+ return JSON.stringify([normalizedOpts, normalizedBundles]);
379
+ }
380
+ function isSkuOnlyDeleteIdentity(x) {
381
+ if (x.unique_identification_number || x.identity_key)
382
+ return false;
383
+ return !("product_option_item" in x) && !("product_bundle" in x);
384
+ }
385
+ function fingerprintForIdentityWithOptionKeys(x) {
386
+ const row = x;
387
+ const opts = "product_option_item" in row ? Array.isArray(row.product_option_item) ? row.product_option_item : [] : [];
388
+ const buds = "product_bundle" in row ? Array.isArray(row.product_bundle) ? row.product_bundle : [] : [];
389
+ return buildProductLineFingerprint(opts, buds);
390
+ }
391
+ function isIdentityMatch(a, b) {
392
+ var _a, _b;
393
+ if (a.product_id !== b.product_id || a.product_variant_id !== b.product_variant_id)
394
+ return false;
395
+ const aUid = ((_a = a.metadata) == null ? void 0 : _a.unique_identification_number) ?? a.unique_identification_number ?? a.identity_key;
396
+ const bUid = ((_b = b.metadata) == null ? void 0 : _b.unique_identification_number) ?? b.unique_identification_number ?? b.identity_key;
397
+ const aHasKey = typeof aUid === "string" && aUid.length > 0;
398
+ const bHasKey = typeof bUid === "string" && bUid.length > 0;
399
+ if (aHasKey && bHasKey)
400
+ return aUid === bUid;
401
+ if (isSkuOnlyDeleteIdentity(a) || isSkuOnlyDeleteIdentity(b))
402
+ return true;
403
+ return fingerprintForIdentityWithOptionKeys(a) === fingerprintForIdentityWithOptionKeys(b);
404
+ }
405
+ function getProductIdentityIndex(products, identity) {
406
+ return products.findIndex((item) => isIdentityMatch(item, identity));
407
+ }
408
+ function normalizeOrderProduct(product) {
409
+ var _a, _b, _c;
410
+ const metadata = { ...product.metadata || {} };
411
+ const resolvedIdentityKey = ((_a = product.metadata) == null ? void 0 : _a.unique_identification_number) ? String(product.metadata.unique_identification_number) : product.unique_identification_number && String(product.unique_identification_number).length > 0 ? String(product.unique_identification_number) : product.identity_key && String(product.identity_key).length > 0 ? String(product.identity_key) : (0, import_utils.createUuidV4)();
412
+ metadata.unique_identification_number = resolvedIdentityKey;
413
+ const normalizedBundle = (product.product_bundle || []).map((item) => ({
414
+ ...item,
415
+ bundle_selling_price: item.bundle_selling_price ?? item.price ?? "0.00",
416
+ price: item.price ?? item.custom_price ?? item.bundle_selling_price ?? "0.00",
417
+ price_type: item.price_type ?? item.custom_price_type ?? "",
418
+ price_type_ext: item.price_type_ext ?? item.custom_price_type_ext ?? ""
419
+ }));
420
+ const normalizedOptions = product.product_option_item || [];
421
+ const optionSum = (0, import_utils.sumOptionUnitPrice)(normalizedOptions);
422
+ const isV2 = metadata.price_schema_version === 2 || metadata.price_schema_version === "2";
423
+ const variantId = Number(product.product_variant_id || 0);
424
+ const variantList = variantId ? (_b = metadata == null ? void 0 : metadata.origin) == null ? void 0 : _b.variant : null;
425
+ const variantPrice = Array.isArray(variantList) ? (_c = variantList.find((v) => Number(v == null ? void 0 : v.id) === variantId)) == null ? void 0 : _c.price : void 0;
426
+ const resolvedSource = (() => {
427
+ var _a2, _b2;
428
+ if (metadata.source_product_price !== void 0) {
429
+ return String(metadata.source_product_price);
430
+ }
431
+ if (variantPrice !== void 0 && variantPrice !== null) {
432
+ return String(variantPrice);
433
+ }
434
+ const originPrice = (_a2 = product._origin) == null ? void 0 : _a2.price;
435
+ if (originPrice !== void 0 && originPrice !== null) {
436
+ return String(originPrice);
437
+ }
438
+ const originBasePrice = (_b2 = product._origin) == null ? void 0 : _b2.base_price;
439
+ if (originBasePrice !== void 0 && originBasePrice !== null) {
440
+ return String(originBasePrice);
441
+ }
442
+ if (!isV2 && metadata.main_product_original_price !== void 0) {
443
+ return String(metadata.main_product_original_price);
444
+ }
445
+ return product.original_price ?? product.selling_price ?? "0.00";
446
+ })();
447
+ const mainOriginalDec = new import_decimal.default(Number(resolvedSource) || 0).plus(optionSum);
448
+ const mainOriginalStr = mainOriginalDec.toDecimalPlaces(2).toFixed(2);
449
+ let mainSellingDec;
450
+ if (isV2 && metadata.main_product_selling_price != null) {
451
+ mainSellingDec = new import_decimal.default(Number(metadata.main_product_selling_price) || 0);
452
+ } else if (metadata.main_product_selling_price != null && metadata.main_product_original_price != null) {
453
+ const legacyOriginal = new import_decimal.default(Number(metadata.main_product_original_price) || 0);
454
+ const legacySelling = new import_decimal.default(Number(metadata.main_product_selling_price) || 0);
455
+ const legacyDiscount = legacyOriginal.minus(legacySelling);
456
+ mainSellingDec = mainOriginalDec.minus(legacyDiscount);
457
+ } else if (product.original_price != null && product.selling_price != null && new import_decimal.default(Number(product.original_price) || 0).greaterThan(
458
+ new import_decimal.default(Number(product.selling_price) || 0)
459
+ )) {
460
+ const topOriginal = new import_decimal.default(Number(product.original_price) || 0);
461
+ const topSelling = new import_decimal.default(Number(product.selling_price) || 0);
462
+ const legacyDiscount = topOriginal.minus(topSelling);
463
+ mainSellingDec = mainOriginalDec.minus(legacyDiscount);
464
+ } else {
465
+ mainSellingDec = mainOriginalDec;
466
+ }
467
+ const mainSellingStr = mainSellingDec.toDecimalPlaces(2).toFixed(2);
468
+ metadata.source_product_price = resolvedSource;
469
+ metadata.main_product_original_price = mainOriginalStr;
470
+ metadata.main_product_selling_price = mainSellingStr;
471
+ metadata.price_schema_version = 2;
472
+ const composedSellingPrice = (0, import_utils.composeLinePrice)({
473
+ mainPrice: mainSellingStr,
474
+ bundle: normalizedBundle
475
+ });
476
+ const composedOriginalPrice = (0, import_utils.composeLinePrice)({
477
+ mainPrice: mainOriginalStr,
478
+ bundle: normalizedBundle,
479
+ useOriginalBundle: true
480
+ });
481
+ return {
482
+ order_detail_id: product.order_detail_id || null,
483
+ product_id: product.product_id,
484
+ num: getSafeProductNum(product.num),
485
+ product_variant_id: product.product_variant_id,
486
+ product_option_item: normalizedOptions,
487
+ selling_price: composedSellingPrice,
488
+ original_price: composedOriginalPrice,
489
+ tax_fee: product.tax_fee || "0.00",
490
+ is_charge_tax: product.is_charge_tax ?? 0,
491
+ discount_list: product.discount_list || [],
492
+ product_bundle: normalizedBundle,
493
+ metadata,
494
+ note: product.note != null ? String(product.note) : ""
495
+ };
496
+ }
497
+ function collectLinkProductIdsFromReservationRules(rules) {
498
+ if (!Array.isArray(rules))
499
+ return [];
500
+ const ids = [];
501
+ for (const entry of rules) {
502
+ if (!entry || typeof entry !== "object")
503
+ continue;
504
+ const rec = entry;
505
+ if (rec.type !== "link")
506
+ continue;
507
+ if (!Array.isArray(rec.value))
508
+ continue;
509
+ for (const v of rec.value) {
510
+ const n = Number(v);
511
+ if (Number.isFinite(n) && n > 0)
512
+ ids.push(Math.floor(n));
513
+ }
514
+ }
515
+ return [...new Set(ids)];
516
+ }
517
+ function pickFirstDurationMinutesFromProducts(products) {
518
+ var _a;
519
+ for (const product of products) {
520
+ const value = (_a = product == null ? void 0 : product.duration) == null ? void 0 : _a.value;
521
+ const n = Number(value);
522
+ if (Number.isFinite(n) && n > 0)
523
+ return Math.floor(n);
524
+ }
525
+ return void 0;
526
+ }
527
+ function hasCustomCapacityProduct(products) {
528
+ return products.some((p) => {
529
+ var _a;
530
+ return ((_a = p == null ? void 0 : p.capacity) == null ? void 0 : _a.type) === "custom";
531
+ });
532
+ }
533
+ function computeResourceIsFull(params) {
534
+ const { resourceSelectType, lastOrderId, capacityList, capacity } = params;
535
+ if (resourceSelectType === "single")
536
+ return Boolean(lastOrderId);
537
+ if (resourceSelectType !== "multiple")
538
+ return false;
539
+ const totalCapacity = Number(capacity);
540
+ if (!Number.isFinite(totalCapacity) || totalCapacity <= 0)
541
+ return false;
542
+ const now = (0, import_dayjs.default)();
543
+ let occupied = 0;
544
+ for (const slot of capacityList || []) {
545
+ const start = (0, import_dayjs.default)(slot == null ? void 0 : slot.start_at);
546
+ const end = (0, import_dayjs.default)(slot == null ? void 0 : slot.end_at);
547
+ if (!start.isValid() || !end.isValid())
548
+ continue;
549
+ if ((now.isAfter(start) || now.isSame(start)) && (now.isBefore(end) || now.isSame(end))) {
550
+ const pax = Number(slot == null ? void 0 : slot.pax);
551
+ if (Number.isFinite(pax) && pax > 0)
552
+ occupied += pax;
553
+ }
554
+ }
555
+ return occupied >= totalCapacity;
556
+ }
557
+ function pickFirstCustomCapacityPaxBounds(products) {
558
+ for (const p of products) {
559
+ const cap = p == null ? void 0 : p.capacity;
560
+ if (!cap || cap.type !== "custom")
561
+ continue;
562
+ if (!Array.isArray(cap.custom) || cap.custom.length === 0)
563
+ continue;
564
+ const row = cap.custom[0];
565
+ if (!row || typeof row !== "object")
566
+ continue;
567
+ const raw = row;
568
+ const out = {};
569
+ if (raw.min !== null && raw.min !== void 0 && raw.min !== "") {
570
+ const min = Number(raw.min);
571
+ if (Number.isFinite(min))
572
+ out.min = min;
573
+ }
574
+ if (raw.max !== null && raw.max !== void 0 && raw.max !== "") {
575
+ const max = Number(raw.max);
576
+ if (Number.isFinite(max))
577
+ out.max = max;
578
+ }
579
+ if (out.min !== void 0 || out.max !== void 0)
580
+ return out;
581
+ }
582
+ return void 0;
583
+ }
584
+ function pickFirstCustomCapacityDimensionId(products) {
585
+ for (const p of products) {
586
+ const cap = p == null ? void 0 : p.capacity;
587
+ if (!cap || cap.type !== "custom")
588
+ continue;
589
+ if (!Array.isArray(cap.custom) || cap.custom.length === 0)
590
+ continue;
591
+ const row = cap.custom[0];
592
+ if (!row || typeof row !== "object")
593
+ continue;
594
+ const id = row.id;
595
+ if (id === null || id === void 0 || id === "")
596
+ continue;
597
+ if (typeof id === "number" && Number.isFinite(id))
598
+ return id;
599
+ if (typeof id === "string") {
600
+ const trimmed = id.trim();
601
+ if (!trimmed)
602
+ continue;
603
+ return trimmed;
604
+ }
605
+ }
606
+ return void 0;
607
+ }
608
+ // Annotate the CommonJS export names for ESM import in node:
609
+ 0 && (module.exports = {
610
+ aggregateItemRuleLimit,
611
+ attachItemRuleLimitsToTopLevelProducts,
612
+ buildItemRuleBusinessData,
613
+ buildProductKey,
614
+ buildProductLineFingerprint,
615
+ buildQuantityLimitIndex,
616
+ collectLinkProductIdsFromReservationRules,
617
+ computeResourceIsFull,
618
+ createEmptySummary,
619
+ extractStrategyModelIdsFromTableConfig,
620
+ getProductIdentityIndex,
621
+ getSafeProductNum,
622
+ getTopLevelProductId,
623
+ getTopLevelVariantId,
624
+ hasCustomCapacityProduct,
625
+ isIdentityMatch,
626
+ isSkuOnlyDeleteIdentity,
627
+ normalizeEnabledItemRuleIds,
628
+ normalizeItemRuleStrategies,
629
+ normalizeOrderProduct,
630
+ pickFirstCustomCapacityDimensionId,
631
+ pickFirstCustomCapacityPaxBounds,
632
+ pickFirstDurationMinutesFromProducts,
633
+ resolveSkuMatchedQuantityLimits,
634
+ toBoolean,
635
+ toNonNegativeInt,
636
+ toNonNegativeNumber,
637
+ toPositiveString,
638
+ toPriceString
639
+ });
@@ -2,6 +2,7 @@ import { Module, PisellCore } from '../../types';
2
2
  import { BaseModule } from '../../modules/BaseModule';
3
3
  import { Customer, SetDiscountSelectedParams } from './types';
4
4
  import { Discount } from '../../modules/Discount/types';
5
+ import { UnavailableReason } from '../../modules/Rules/types';
5
6
  export declare class ShopDiscountImpl extends BaseModule implements Module {
6
7
  protected defaultName: string;
7
8
  protected defaultVersion: string;
@@ -43,6 +44,7 @@ export declare class ShopDiscountImpl extends BaseModule implements Module {
43
44
  productList: Record<string, any>[];
44
45
  discountList: Discount[];
45
46
  type: "server" | "clientCalc";
47
+ unavailableReason?: UnavailableReason;
46
48
  }>;
47
49
  calcDiscountApplicableProductTotalPrice(discount: Discount): number | undefined;
48
50
  private getCustomer;