@pisell/pisellos 2.1.118 → 2.1.120

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 (232) hide show
  1. package/dist/apis/picoding.d.ts +0 -0
  2. package/dist/apis/picoding.js +1 -0
  3. package/dist/index.d.ts +0 -1
  4. package/dist/index.js +0 -1
  5. package/dist/model/strategy/adapter/index.d.ts +4 -0
  6. package/dist/model/strategy/adapter/index.js +4 -1
  7. package/dist/model/strategy/adapter/itemRule/adapter.d.ts +59 -0
  8. package/dist/model/strategy/adapter/itemRule/adapter.js +439 -0
  9. package/dist/model/strategy/adapter/itemRule/evaluator.d.ts +43 -0
  10. package/dist/model/strategy/adapter/itemRule/evaluator.js +169 -0
  11. package/dist/model/strategy/adapter/itemRule/examples.d.ts +64 -0
  12. package/dist/model/strategy/adapter/itemRule/examples.js +315 -0
  13. package/dist/model/strategy/adapter/itemRule/index.d.ts +5 -0
  14. package/dist/model/strategy/adapter/itemRule/index.js +5 -0
  15. package/dist/model/strategy/adapter/itemRule/type.d.ts +206 -0
  16. package/dist/model/strategy/adapter/itemRule/type.js +101 -0
  17. package/dist/model/strategy/adapter/promotion/adapter.d.ts +66 -0
  18. package/dist/model/strategy/adapter/promotion/adapter.js +271 -0
  19. package/dist/model/strategy/adapter/promotion/evaluator.d.ts +213 -0
  20. package/dist/model/strategy/adapter/promotion/evaluator.js +1206 -0
  21. package/dist/model/strategy/adapter/promotion/examples.d.ts +138 -0
  22. package/dist/model/strategy/adapter/promotion/examples.js +166 -0
  23. package/dist/model/strategy/adapter/promotion/index.d.ts +4 -0
  24. package/dist/model/strategy/adapter/promotion/index.js +0 -0
  25. package/dist/model/strategy/adapter/promotion/type.d.ts +447 -0
  26. package/dist/model/strategy/adapter/promotion/type.js +209 -0
  27. package/dist/model/strategy/adapter/walletPass/evaluator.js +4 -1
  28. package/dist/model/strategy/engine.d.ts +106 -0
  29. package/dist/model/strategy/engine.js +611 -0
  30. package/dist/model/strategy/index.d.ts +2 -93
  31. package/dist/model/strategy/index.js +6 -549
  32. package/dist/modules/Cart/types.d.ts +0 -2
  33. package/dist/modules/Cart/utils/cartProduct.js +25 -56
  34. package/dist/modules/Discount/types.d.ts +0 -18
  35. package/dist/modules/OpenData/index.d.ts +23 -0
  36. package/dist/modules/OpenData/index.js +167 -0
  37. package/dist/modules/OpenData/types.d.ts +73 -0
  38. package/dist/modules/OpenData/types.js +1 -0
  39. package/dist/modules/OpenData/utils.d.ts +2 -0
  40. package/dist/modules/OpenData/utils.js +75 -0
  41. package/dist/modules/Order/index.d.ts +58 -1
  42. package/dist/modules/Order/index.js +780 -29
  43. package/dist/modules/Order/types.d.ts +144 -12
  44. package/dist/modules/Order/utils.d.ts +25 -0
  45. package/dist/modules/Order/utils.js +225 -1
  46. package/dist/modules/Payment/index.d.ts +1 -2
  47. package/dist/modules/Payment/index.js +7 -10
  48. package/dist/modules/Payment/utils.js +0 -3
  49. package/dist/modules/Payment/walletpass.d.ts +0 -23
  50. package/dist/modules/Payment/walletpass.js +95 -191
  51. package/dist/modules/Product/utils.js +2 -2
  52. package/dist/modules/ProductList/index.d.ts +1 -1
  53. package/dist/modules/ProductList/index.js +2 -1
  54. package/dist/modules/Quotation/index.d.ts +48 -0
  55. package/dist/modules/Quotation/index.js +245 -0
  56. package/dist/modules/Quotation/types.d.ts +42 -0
  57. package/dist/modules/Quotation/types.js +1 -0
  58. package/dist/modules/Rules/index.d.ts +5 -9
  59. package/dist/modules/Rules/index.js +164 -673
  60. package/dist/modules/Rules/types.d.ts +0 -2
  61. package/dist/modules/SalesSummary/index.d.ts +63 -0
  62. package/dist/modules/SalesSummary/index.js +174 -0
  63. package/dist/modules/SalesSummary/types.d.ts +59 -0
  64. package/dist/modules/SalesSummary/types.js +1 -0
  65. package/dist/modules/SalesSummary/utils.d.ts +30 -0
  66. package/dist/modules/SalesSummary/utils.js +513 -0
  67. package/dist/modules/ScanOrderLogger/index.d.ts +21 -0
  68. package/dist/modules/ScanOrderLogger/index.js +161 -0
  69. package/dist/modules/ScanOrderLogger/providers/feishu.d.ts +2 -0
  70. package/dist/modules/ScanOrderLogger/providers/feishu.js +95 -0
  71. package/dist/modules/ScanOrderLogger/providers/grafana.d.ts +2 -0
  72. package/dist/modules/ScanOrderLogger/providers/grafana.js +50 -0
  73. package/dist/modules/ScanOrderLogger/types.d.ts +46 -0
  74. package/dist/modules/ScanOrderLogger/types.js +1 -0
  75. package/dist/modules/Schedule/getDateIsInSchedule.js +11 -18
  76. package/dist/modules/Summary/types.d.ts +0 -2
  77. package/dist/modules/Summary/utils.d.ts +3 -9
  78. package/dist/modules/Summary/utils.js +4 -25
  79. package/dist/modules/index.d.ts +4 -0
  80. package/dist/modules/index.js +5 -1
  81. package/dist/plugins/window.d.ts +0 -2
  82. package/dist/solution/BookingByStep/index.d.ts +1 -2
  83. package/dist/solution/BookingByStep/index.js +44 -42
  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/timeslots.d.ts +3 -1
  87. package/dist/solution/BookingByStep/utils/timeslots.js +19 -12
  88. package/dist/solution/Checkout/index.js +0 -2
  89. package/dist/solution/ScanOrder/index.d.ts +90 -0
  90. package/dist/solution/ScanOrder/index.js +1853 -0
  91. package/dist/solution/ScanOrder/types.d.ts +210 -0
  92. package/dist/solution/ScanOrder/types.js +16 -0
  93. package/dist/solution/ScanOrder/utils.d.ts +93 -0
  94. package/dist/solution/ScanOrder/utils.js +397 -0
  95. package/dist/solution/ShopDiscount/index.d.ts +0 -1
  96. package/dist/solution/ShopDiscount/index.js +7 -23
  97. package/dist/solution/ShopDiscount/types.d.ts +0 -1
  98. package/dist/solution/ShopDiscount/types.js +1 -2
  99. package/dist/solution/ShopDiscount/utils.js +12 -26
  100. package/dist/solution/VenueBooking/index.d.ts +158 -0
  101. package/dist/solution/VenueBooking/index.js +2873 -0
  102. package/dist/solution/VenueBooking/sales-section-4-annotated.json +343 -0
  103. package/dist/solution/VenueBooking/types.d.ts +130 -0
  104. package/dist/solution/VenueBooking/types.js +21 -0
  105. package/dist/solution/VenueBooking/utils/dateSummary.d.ts +10 -0
  106. package/dist/solution/VenueBooking/utils/dateSummary.js +102 -0
  107. package/dist/solution/VenueBooking/utils/resource.d.ts +4 -0
  108. package/dist/solution/VenueBooking/utils/resource.js +94 -0
  109. package/dist/solution/VenueBooking/utils/slotMerge.d.ts +29 -0
  110. package/dist/solution/VenueBooking/utils/slotMerge.js +204 -0
  111. package/dist/solution/VenueBooking/utils/timeSlot.d.ts +32 -0
  112. package/dist/solution/VenueBooking/utils/timeSlot.js +256 -0
  113. package/dist/solution/VenueBooking/utils.d.ts +1 -0
  114. package/dist/solution/VenueBooking/utils.js +1 -0
  115. package/dist/solution/index.d.ts +2 -0
  116. package/dist/solution/index.js +3 -1
  117. package/lib/apis/picoding.d.ts +0 -0
  118. package/lib/apis/picoding.js +0 -0
  119. package/lib/index.d.ts +0 -1
  120. package/lib/index.js +1 -3
  121. package/lib/model/strategy/adapter/index.d.ts +4 -0
  122. package/lib/model/strategy/adapter/index.js +12 -0
  123. package/lib/model/strategy/adapter/itemRule/adapter.d.ts +59 -0
  124. package/lib/model/strategy/adapter/itemRule/adapter.js +338 -0
  125. package/lib/model/strategy/adapter/itemRule/evaluator.d.ts +43 -0
  126. package/lib/model/strategy/adapter/itemRule/evaluator.js +124 -0
  127. package/lib/model/strategy/adapter/itemRule/examples.d.ts +64 -0
  128. package/lib/model/strategy/adapter/itemRule/examples.js +269 -0
  129. package/lib/model/strategy/adapter/itemRule/index.d.ts +5 -0
  130. package/lib/model/strategy/adapter/itemRule/index.js +58 -0
  131. package/lib/model/strategy/adapter/itemRule/type.d.ts +206 -0
  132. package/lib/model/strategy/adapter/itemRule/type.js +46 -0
  133. package/lib/model/strategy/adapter/promotion/adapter.d.ts +66 -0
  134. package/lib/model/strategy/adapter/promotion/adapter.js +217 -0
  135. package/lib/model/strategy/adapter/promotion/evaluator.d.ts +213 -0
  136. package/lib/model/strategy/adapter/promotion/evaluator.js +844 -0
  137. package/lib/model/strategy/adapter/promotion/examples.d.ts +138 -0
  138. package/lib/model/strategy/adapter/promotion/examples.js +192 -0
  139. package/lib/model/strategy/adapter/promotion/index.d.ts +4 -0
  140. package/lib/model/strategy/adapter/promotion/index.js +0 -0
  141. package/lib/model/strategy/adapter/promotion/type.d.ts +447 -0
  142. package/lib/model/strategy/adapter/promotion/type.js +51 -0
  143. package/lib/model/strategy/adapter/walletPass/evaluator.js +2 -1
  144. package/lib/model/strategy/engine.d.ts +106 -0
  145. package/lib/model/strategy/engine.js +450 -0
  146. package/lib/model/strategy/index.d.ts +2 -93
  147. package/lib/model/strategy/index.js +6 -381
  148. package/lib/modules/Cart/types.d.ts +0 -2
  149. package/lib/modules/Cart/utils/cartProduct.js +12 -39
  150. package/lib/modules/Discount/types.d.ts +0 -18
  151. package/lib/modules/OpenData/index.d.ts +23 -0
  152. package/lib/modules/OpenData/index.js +116 -0
  153. package/lib/modules/OpenData/types.d.ts +73 -0
  154. package/lib/modules/OpenData/types.js +17 -0
  155. package/lib/modules/OpenData/utils.d.ts +2 -0
  156. package/lib/modules/OpenData/utils.js +111 -0
  157. package/lib/modules/Order/index.d.ts +58 -1
  158. package/lib/modules/Order/index.js +423 -1
  159. package/lib/modules/Order/types.d.ts +144 -12
  160. package/lib/modules/Order/utils.d.ts +25 -0
  161. package/lib/modules/Order/utils.js +229 -0
  162. package/lib/modules/Payment/index.d.ts +1 -2
  163. package/lib/modules/Payment/index.js +0 -1
  164. package/lib/modules/Payment/utils.js +0 -3
  165. package/lib/modules/Payment/walletpass.d.ts +0 -23
  166. package/lib/modules/Payment/walletpass.js +17 -94
  167. package/lib/modules/Product/utils.js +2 -2
  168. package/lib/modules/ProductList/index.d.ts +1 -1
  169. package/lib/modules/ProductList/index.js +2 -1
  170. package/lib/modules/Quotation/index.d.ts +48 -0
  171. package/lib/modules/Quotation/index.js +149 -0
  172. package/lib/modules/Quotation/types.d.ts +42 -0
  173. package/lib/modules/Quotation/types.js +17 -0
  174. package/lib/modules/Rules/index.d.ts +5 -9
  175. package/lib/modules/Rules/index.js +286 -778
  176. package/lib/modules/Rules/types.d.ts +0 -2
  177. package/lib/modules/SalesSummary/index.d.ts +63 -0
  178. package/lib/modules/SalesSummary/index.js +105 -0
  179. package/lib/modules/SalesSummary/types.d.ts +59 -0
  180. package/lib/modules/SalesSummary/types.js +17 -0
  181. package/lib/modules/SalesSummary/utils.d.ts +30 -0
  182. package/lib/modules/SalesSummary/utils.js +452 -0
  183. package/lib/modules/ScanOrderLogger/index.d.ts +21 -0
  184. package/lib/modules/ScanOrderLogger/index.js +135 -0
  185. package/lib/modules/ScanOrderLogger/providers/feishu.d.ts +2 -0
  186. package/lib/modules/ScanOrderLogger/providers/feishu.js +82 -0
  187. package/lib/modules/ScanOrderLogger/providers/grafana.d.ts +2 -0
  188. package/lib/modules/ScanOrderLogger/providers/grafana.js +52 -0
  189. package/lib/modules/ScanOrderLogger/types.d.ts +46 -0
  190. package/lib/modules/ScanOrderLogger/types.js +17 -0
  191. package/lib/modules/Schedule/getDateIsInSchedule.js +9 -11
  192. package/lib/modules/Summary/types.d.ts +0 -2
  193. package/lib/modules/Summary/utils.d.ts +3 -9
  194. package/lib/modules/Summary/utils.js +4 -19
  195. package/lib/modules/index.d.ts +4 -0
  196. package/lib/modules/index.js +9 -1
  197. package/lib/plugins/window.d.ts +0 -2
  198. package/lib/solution/BookingByStep/index.d.ts +1 -2
  199. package/lib/solution/BookingByStep/index.js +4 -2
  200. package/lib/solution/BookingByStep/types.d.ts +3 -1
  201. package/lib/solution/BookingByStep/types.js +10 -0
  202. package/lib/solution/BookingByStep/utils/timeslots.d.ts +3 -1
  203. package/lib/solution/BookingByStep/utils/timeslots.js +19 -11
  204. package/lib/solution/Checkout/index.js +0 -2
  205. package/lib/solution/ScanOrder/index.d.ts +90 -0
  206. package/lib/solution/ScanOrder/index.js +1071 -0
  207. package/lib/solution/ScanOrder/types.d.ts +210 -0
  208. package/lib/solution/ScanOrder/types.js +36 -0
  209. package/lib/solution/ScanOrder/utils.d.ts +93 -0
  210. package/lib/solution/ScanOrder/utils.js +359 -0
  211. package/lib/solution/ShopDiscount/index.d.ts +0 -1
  212. package/lib/solution/ShopDiscount/index.js +8 -22
  213. package/lib/solution/ShopDiscount/types.d.ts +0 -1
  214. package/lib/solution/ShopDiscount/utils.js +6 -10
  215. package/lib/solution/VenueBooking/index.d.ts +158 -0
  216. package/lib/solution/VenueBooking/index.js +1545 -0
  217. package/lib/solution/VenueBooking/sales-section-4-annotated.json +343 -0
  218. package/lib/solution/VenueBooking/types.d.ts +130 -0
  219. package/lib/solution/VenueBooking/types.js +44 -0
  220. package/lib/solution/VenueBooking/utils/dateSummary.d.ts +10 -0
  221. package/lib/solution/VenueBooking/utils/dateSummary.js +101 -0
  222. package/lib/solution/VenueBooking/utils/resource.d.ts +4 -0
  223. package/lib/solution/VenueBooking/utils/resource.js +80 -0
  224. package/lib/solution/VenueBooking/utils/slotMerge.d.ts +29 -0
  225. package/lib/solution/VenueBooking/utils/slotMerge.js +209 -0
  226. package/lib/solution/VenueBooking/utils/timeSlot.d.ts +32 -0
  227. package/lib/solution/VenueBooking/utils/timeSlot.js +200 -0
  228. package/lib/solution/VenueBooking/utils.d.ts +1 -0
  229. package/lib/solution/VenueBooking/utils.js +69 -0
  230. package/lib/solution/index.d.ts +2 -0
  231. package/lib/solution/index.js +5 -1
  232. package/package.json +1 -1
@@ -0,0 +1,149 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/modules/Quotation/index.ts
20
+ var Quotation_exports = {};
21
+ __export(Quotation_exports, {
22
+ QuotationModule: () => QuotationModule
23
+ });
24
+ module.exports = __toCommonJS(Quotation_exports);
25
+ var import_BaseModule = require("../BaseModule");
26
+ var import_getDateIsInSchedule = require("../Schedule/getDateIsInSchedule");
27
+ var QuotationModule = class extends import_BaseModule.BaseModule {
28
+ constructor(name, version) {
29
+ super(name, version);
30
+ this.defaultName = "quotation";
31
+ this.defaultVersion = "1.0.0";
32
+ this.store = { list: [] };
33
+ }
34
+ async initialize(core, options) {
35
+ this.core = core;
36
+ this.request = core.getPlugin("request");
37
+ if (!this.request)
38
+ throw new Error("QuotationModule 需要 request 插件支持");
39
+ this.store = { list: [] };
40
+ }
41
+ async loadQuotations(params) {
42
+ var _a;
43
+ const query = {};
44
+ if (params == null ? void 0 : params.channel)
45
+ query.channel = params.channel;
46
+ const res = await this.request.get(
47
+ "/quotation/available",
48
+ query,
49
+ { useCache: false }
50
+ );
51
+ const list = ((_a = res == null ? void 0 : res.data) == null ? void 0 : _a.list) || (res == null ? void 0 : res.list) || [];
52
+ list.sort((a, b) => a.sort - b.sort);
53
+ this.store.list = list;
54
+ }
55
+ getQuotationList() {
56
+ return this.store.list;
57
+ }
58
+ /**
59
+ * Look up the quotation price for a specific product (+ optional variant) at a given datetime.
60
+ * Returns the price as a string (e.g. "300.00"), or null if no quotation applies.
61
+ *
62
+ * Priority: iterates quotations already sorted by `sort` ascending (lowest = highest priority).
63
+ * First matching quotation whose schedule covers `datetime` and whose product_data contains
64
+ * the requested productId wins.
65
+ */
66
+ getPriceForProduct(params) {
67
+ const { productId, variantId, datetime } = params;
68
+ for (const quotation of this.store.list) {
69
+ if (!this.isQuotationActiveAt(quotation, datetime))
70
+ continue;
71
+ const match = this.findProductData(quotation.product_data, productId, variantId);
72
+ if (!match)
73
+ continue;
74
+ if (match.value === 0)
75
+ continue;
76
+ return String(match.value);
77
+ }
78
+ return null;
79
+ }
80
+ getQuotationShelfId(params) {
81
+ const { productId, variantId, datetime } = params;
82
+ for (const quotation of this.store.list) {
83
+ if (!this.isQuotationActiveAt(quotation, datetime))
84
+ continue;
85
+ const match = this.findProductData(quotation.product_data, productId, variantId);
86
+ if (!match || match.value === 0)
87
+ continue;
88
+ return quotation.id;
89
+ }
90
+ return 0;
91
+ }
92
+ /**
93
+ * Batch pre-compute quotation prices for a set of products across multiple time points.
94
+ * Key format: `${productId}:${timePoint}`
95
+ * This avoids repeated schedule matching when the same product appears in multiple resource rows.
96
+ */
97
+ buildProductPriceMap(params) {
98
+ const map = /* @__PURE__ */ new Map();
99
+ if (!this.store.list.length)
100
+ return map;
101
+ for (const productId of params.productIds) {
102
+ for (const timePoint of params.timePoints) {
103
+ const key = `${productId}:${timePoint}`;
104
+ const price = this.getPriceForProduct({ productId, datetime: timePoint });
105
+ if (price !== null) {
106
+ map.set(key, price);
107
+ }
108
+ }
109
+ }
110
+ return map;
111
+ }
112
+ setScheduleResolver(resolver) {
113
+ this.scheduleResolver = resolver;
114
+ }
115
+ isQuotationActiveAt(quotation, datetime) {
116
+ var _a;
117
+ if (!((_a = quotation.schedule) == null ? void 0 : _a.length))
118
+ return false;
119
+ const scheduleItems = quotation.schedule.map((s) => {
120
+ var _a2;
121
+ const full = (_a2 = this.scheduleResolver) == null ? void 0 : _a2.call(this, s.id);
122
+ if (full)
123
+ return full;
124
+ return {
125
+ ...s,
126
+ repeat_type: s.repeat_type || "none",
127
+ repeat_rule: s.repeat_rule || null,
128
+ time_slot: s.time_slot || []
129
+ };
130
+ });
131
+ return (0, import_getDateIsInSchedule.getDateIsInSchedule)(datetime, scheduleItems);
132
+ }
133
+ findProductData(productData, productId, variantId) {
134
+ if (variantId && variantId !== 0) {
135
+ const variantMatch = productData.find(
136
+ (p) => p.product_id === productId && p.variant_id === variantId
137
+ );
138
+ if (variantMatch)
139
+ return variantMatch;
140
+ }
141
+ return productData.find(
142
+ (p) => p.product_id === productId && p.variant_id === 0
143
+ );
144
+ }
145
+ };
146
+ // Annotate the CommonJS export names for ESM import in node:
147
+ 0 && (module.exports = {
148
+ QuotationModule
149
+ });
@@ -0,0 +1,42 @@
1
+ export interface QuotationProductData {
2
+ id: number;
3
+ shelf_id: number;
4
+ product_id: number;
5
+ variant_id: number;
6
+ type: string;
7
+ value: number;
8
+ }
9
+ export interface QuotationSchedule {
10
+ id: number;
11
+ name: string;
12
+ type: 'standard' | 'time-slots' | 'designation';
13
+ start_time: string;
14
+ end_time: string;
15
+ is_all: number;
16
+ repeat_type?: string;
17
+ repeat_rule?: any;
18
+ designation?: any;
19
+ time_slot?: Array<{
20
+ start_time: string;
21
+ end_time: string;
22
+ }>;
23
+ pivot?: Record<string, any>;
24
+ }
25
+ export interface QuotationItem {
26
+ id: number;
27
+ shop_id: number;
28
+ shelf_type_id?: number;
29
+ name: string;
30
+ description?: string;
31
+ status: string;
32
+ sort: number;
33
+ channel: string[];
34
+ created_at?: string;
35
+ updated_at?: string;
36
+ deleted_at?: string | null;
37
+ schedule: QuotationSchedule[];
38
+ product_data: QuotationProductData[];
39
+ }
40
+ export interface QuotationState {
41
+ list: QuotationItem[];
42
+ }
@@ -0,0 +1,17 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from))
8
+ if (!__hasOwnProp.call(to, key) && key !== except)
9
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ }
11
+ return to;
12
+ };
13
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
+
15
+ // src/modules/Quotation/types.ts
16
+ var types_exports = {};
17
+ module.exports = __toCommonJS(types_exports);
@@ -1,28 +1,25 @@
1
1
  import { Module, PisellCore, ModuleOptions } from '../../types';
2
2
  import { BaseModule } from '../BaseModule';
3
3
  import { Rules, RulesModuleAPI, DiscountResult, UnavailableReason } from './types';
4
- import { Discount } from '../Discount/types';
5
- import { WindowPlugin } from '../../plugins';
4
+ import { Discount } from "../Discount/types";
5
+ import { SetDiscountSelectedParams } from '../../solution/ShopDiscount/types';
6
6
  export declare class RulesModule extends BaseModule implements Module, RulesModuleAPI {
7
7
  protected defaultName: string;
8
8
  protected defaultVersion: string;
9
9
  private store;
10
- window: WindowPlugin;
11
10
  private hooks;
12
11
  constructor(name?: string, version?: string);
13
12
  initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
14
13
  setRulesList(rulesList: Rules[]): Promise<void>;
15
14
  getRulesList(): Rules[];
16
15
  private checkHolderMatch;
17
- getWalletPassEvaluator(): import("../..").WalletPassEvaluator | undefined;
18
- isDiscountListAvailable({ oldDiscountList, newDiscountList, productList, orderTotalAmount, holders, isFormSubject, }: {
16
+ isDiscountListAvailable({ oldDiscountList, newDiscountList, productList, holders, isFormSubject, }: {
19
17
  oldDiscountList: Discount[];
20
18
  newDiscountList: Discount[];
21
19
  productList: any[];
22
20
  holders: {
23
21
  form_record_id: number;
24
22
  }[];
25
- orderTotalAmount: number;
26
23
  isFormSubject: boolean;
27
24
  }): {
28
25
  isAvailable: boolean;
@@ -32,18 +29,17 @@ export declare class RulesModule extends BaseModule implements Module, RulesModu
32
29
  };
33
30
  filterDiscountListByType(discountList: Discount[], type: string): Discount[];
34
31
  private getUnavailableReason;
35
- calcDiscount({ discountList, productList, holders, isFormSubject, orderTotalAmount }: {
32
+ calcDiscount({ discountList, productList, holders, isFormSubject, }: {
36
33
  discountList: Discount[];
37
34
  productList: any[];
38
35
  holders: {
39
36
  form_record_id: number;
40
37
  }[];
41
38
  isFormSubject: boolean;
42
- orderTotalAmount: number;
43
39
  }, options?: {
44
40
  isSelected?: boolean;
45
41
  discountId?: number;
46
- selectedList?: any[];
42
+ selectedList?: SetDiscountSelectedParams[];
47
43
  scan?: boolean;
48
44
  }): DiscountResult;
49
45
  /**