@pisell/pisellos 3.0.75 → 3.0.76

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 (319) hide show
  1. package/dist/core/index.js +2 -1
  2. package/dist/effects/index.d.ts +5 -3
  3. package/dist/effects/index.js +40 -8
  4. package/dist/modules/Account/index.js +2 -3
  5. package/dist/modules/AccountList/index.d.ts +7 -1
  6. package/dist/modules/AccountList/index.js +81 -14
  7. package/dist/modules/AccountList/types.d.ts +28 -0
  8. package/dist/modules/AccountList/types.js +8 -0
  9. package/dist/modules/BaseModule.d.ts +3 -0
  10. package/dist/modules/BaseModule.js +15 -0
  11. package/dist/modules/Cart/index.d.ts +1 -0
  12. package/dist/modules/Cart/index.js +2 -1
  13. package/dist/modules/Cart/utils/cartProduct.js +21 -4
  14. package/dist/modules/Customer/constants.d.ts +7 -0
  15. package/dist/modules/Customer/constants.js +12 -0
  16. package/dist/modules/Customer/index.d.ts +122 -0
  17. package/dist/modules/Customer/index.js +696 -0
  18. package/dist/modules/Customer/types.d.ts +146 -0
  19. package/dist/modules/Customer/types.js +41 -0
  20. package/dist/modules/Discount/index.d.ts +1 -0
  21. package/dist/modules/Discount/index.js +3 -3
  22. package/dist/modules/Discount/types.d.ts +9 -0
  23. package/dist/modules/Guests/index.js +9 -9
  24. package/dist/modules/Order/index.d.ts +25 -1
  25. package/dist/modules/Order/index.js +224 -3
  26. package/dist/modules/Order/types.d.ts +45 -0
  27. package/dist/modules/Order/types.js +8 -0
  28. package/dist/modules/Order/utils.js +1 -1
  29. package/dist/modules/Payment/cash.d.ts +19 -0
  30. package/dist/modules/Payment/cash.js +97 -0
  31. package/dist/modules/Payment/cashRecommendationAlgorithm.d.ts +22 -0
  32. package/dist/modules/Payment/cashRecommendationAlgorithm.js +423 -0
  33. package/dist/modules/Payment/eftpos.d.ts +11 -0
  34. package/dist/modules/Payment/eftpos.js +80 -0
  35. package/dist/modules/Payment/index.d.ts +184 -9
  36. package/dist/modules/Payment/index.js +2084 -109
  37. package/dist/modules/Payment/mx51.d.ts +0 -0
  38. package/dist/modules/Payment/mx51.js +0 -0
  39. package/dist/modules/Payment/types.d.ts +772 -30
  40. package/dist/modules/Payment/types.js +236 -12
  41. package/dist/modules/Payment/utils.d.ts +17 -0
  42. package/dist/modules/Payment/utils.js +62 -0
  43. package/dist/modules/Payment/walletpass.d.ts +99 -0
  44. package/dist/modules/Payment/walletpass.js +711 -0
  45. package/dist/modules/ProductList/index.d.ts +12 -1
  46. package/dist/modules/ProductList/index.js +37 -15
  47. package/dist/modules/Resource/index.js +1 -1
  48. package/dist/modules/Rules/index.d.ts +2 -1
  49. package/dist/modules/Rules/index.js +470 -127
  50. package/dist/modules/Rules/types.d.ts +1 -0
  51. package/dist/modules/Schedule/index.d.ts +9 -0
  52. package/dist/modules/Schedule/index.js +77 -0
  53. package/dist/modules/Summary/utils.d.ts +5 -0
  54. package/dist/modules/Summary/utils.js +36 -1
  55. package/dist/modules/index.d.ts +1 -0
  56. package/dist/modules/index.js +1 -0
  57. package/dist/plugins/app-types/app/app.d.ts +83 -0
  58. package/dist/plugins/app-types/app/const.d.ts +4 -0
  59. package/dist/plugins/app-types/app/index.d.ts +14 -0
  60. package/dist/plugins/app-types/applicationManager/application.d.ts +50 -0
  61. package/dist/plugins/app-types/applicationManager/index.d.ts +13 -0
  62. package/dist/plugins/app-types/config.d.ts +3 -0
  63. package/dist/plugins/app-types/cookie/index.d.ts +13 -0
  64. package/dist/plugins/app-types/data/index.d.ts +8 -0
  65. package/dist/plugins/app-types/history/config.d.ts +24 -0
  66. package/dist/plugins/app-types/history/index.d.ts +20 -0
  67. package/dist/plugins/app-types/history/type.d.ts +2 -0
  68. package/dist/plugins/app-types/hooks/index.d.ts +12 -0
  69. package/dist/plugins/app-types/hooks/useDelayedValue/index.d.ts +2 -0
  70. package/dist/plugins/app-types/hooks/useDispatch/index.d.ts +2 -0
  71. package/dist/plugins/app-types/hooks/useLowCode/index.d.ts +13 -0
  72. package/dist/plugins/app-types/hooks/useStore/index.d.ts +6 -0
  73. package/dist/plugins/app-types/index.d.ts +6 -0
  74. package/dist/plugins/app-types/indexDB/index.d.ts +178 -0
  75. package/dist/plugins/app-types/locales/en.d.ts +3 -0
  76. package/dist/plugins/app-types/locales/index.d.ts +37 -0
  77. package/dist/plugins/app-types/locales/original.d.ts +3 -0
  78. package/dist/plugins/app-types/locales/type.d.ts +19 -0
  79. package/dist/plugins/app-types/locales/zh-CN.d.ts +3 -0
  80. package/dist/plugins/app-types/locales/zh-HK.d.ts +3 -0
  81. package/dist/plugins/app-types/logger/feishu.d.ts +11 -0
  82. package/dist/plugins/app-types/logger/index.d.ts +122 -0
  83. package/dist/plugins/app-types/menuManager/hooks.d.ts +17 -0
  84. package/dist/plugins/app-types/menuManager/index.d.ts +28 -0
  85. package/dist/plugins/app-types/models/global.d.ts +32 -0
  86. package/dist/plugins/app-types/models/index.d.ts +45 -0
  87. package/dist/plugins/app-types/models/type.d.ts +2 -0
  88. package/dist/plugins/app-types/package.json +15 -0
  89. package/dist/plugins/app-types/plugin/index.d.ts +0 -0
  90. package/dist/plugins/app-types/pubsub/example.d.ts +5 -0
  91. package/dist/plugins/app-types/pubsub/index.d.ts +63 -0
  92. package/dist/plugins/app-types/request/cache.d.ts +46 -0
  93. package/dist/plugins/app-types/request/cancelToken.d.ts +38 -0
  94. package/dist/plugins/app-types/request/config.d.ts +3 -0
  95. package/dist/plugins/app-types/request/constants.d.ts +2 -0
  96. package/dist/plugins/app-types/request/index.d.ts +24 -0
  97. package/dist/plugins/app-types/request/pisell2Request.d.ts +6 -0
  98. package/dist/plugins/app-types/request/type.d.ts +41 -0
  99. package/dist/plugins/app-types/request/utils.d.ts +46 -0
  100. package/dist/plugins/app-types/routes/config.d.ts +7 -0
  101. package/dist/plugins/app-types/routes/index.d.ts +28 -0
  102. package/dist/plugins/app-types/socket/components/SocketMonitorPage.d.ts +6 -0
  103. package/dist/plugins/app-types/socket/components/index.d.ts +2 -0
  104. package/dist/plugins/app-types/socket/constants.d.ts +33 -0
  105. package/dist/plugins/app-types/socket/events.d.ts +31 -0
  106. package/dist/plugins/app-types/socket/heartbeat.d.ts +66 -0
  107. package/dist/plugins/app-types/socket/index.d.ts +61 -0
  108. package/dist/plugins/app-types/socket/monitor.d.ts +169 -0
  109. package/dist/plugins/app-types/socket/reconnect.d.ts +61 -0
  110. package/dist/plugins/app-types/socket/socket.d.ts +129 -0
  111. package/dist/plugins/app-types/socket/types.d.ts +85 -0
  112. package/dist/plugins/app-types/storage/index.d.ts +17 -0
  113. package/dist/plugins/app-types/tasks/index.d.ts +77 -0
  114. package/dist/plugins/app-types/tasks/type.d.ts +62 -0
  115. package/dist/plugins/app-types/tasks/useTasks.d.ts +5 -0
  116. package/dist/plugins/app-types/type.d.ts +2 -0
  117. package/dist/plugins/app-types/variables/VariablesProvider.d.ts +7 -0
  118. package/dist/plugins/app-types/variables/config.d.ts +3 -0
  119. package/dist/plugins/app-types/variables/index.d.ts +6 -0
  120. package/dist/plugins/app-types/variables/type.d.ts +2 -0
  121. package/dist/plugins/app-types/website/index.d.ts +6 -0
  122. package/dist/plugins/app.d.ts +8 -0
  123. package/dist/plugins/app.js +1 -0
  124. package/dist/plugins/window.d.ts +1 -0
  125. package/dist/solution/BookingByStep/index.js +43 -13
  126. package/dist/solution/BookingByStep/utils/capacity.js +1 -1
  127. package/dist/solution/BookingByStep/utils/products.d.ts +6 -0
  128. package/dist/solution/BookingByStep/utils/products.js +10 -0
  129. package/dist/solution/BookingTicket/index.d.ts +184 -0
  130. package/dist/solution/BookingTicket/index.js +698 -0
  131. package/dist/solution/BookingTicket/types.d.ts +68 -0
  132. package/dist/solution/BookingTicket/types.js +43 -0
  133. package/dist/solution/BookingTicket/utils/scan/cloudSearch.d.ts +22 -0
  134. package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +159 -0
  135. package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +22 -0
  136. package/dist/solution/BookingTicket/utils/scan/handleScan.js +189 -0
  137. package/dist/solution/BookingTicket/utils/scan/index.d.ts +85 -0
  138. package/dist/solution/BookingTicket/utils/scan/index.js +294 -0
  139. package/dist/solution/BookingTicket/utils/scan/scanCache.d.ts +78 -0
  140. package/dist/solution/BookingTicket/utils/scan/scanCache.js +305 -0
  141. package/dist/solution/BuyTickets/index.js +7 -8
  142. package/dist/solution/Checkout/appointmentDemo.json +1 -0
  143. package/dist/solution/Checkout/index.d.ts +432 -0
  144. package/dist/solution/Checkout/index.js +4452 -0
  145. package/dist/solution/Checkout/types.d.ts +727 -0
  146. package/dist/solution/Checkout/types.js +104 -0
  147. package/dist/solution/Checkout/utils/index.d.ts +121 -0
  148. package/dist/solution/Checkout/utils/index.js +511 -0
  149. package/dist/solution/ShopDiscount/index.d.ts +10 -10
  150. package/dist/solution/ShopDiscount/index.js +111 -60
  151. package/dist/solution/ShopDiscount/types.d.ts +8 -0
  152. package/dist/solution/ShopDiscount/utils.d.ts +24 -0
  153. package/dist/solution/ShopDiscount/utils.js +135 -1
  154. package/dist/solution/index.d.ts +2 -0
  155. package/dist/solution/index.js +3 -1
  156. package/dist/types/index.d.ts +4 -1
  157. package/dist/utils/task.d.ts +40 -0
  158. package/dist/utils/task.js +171 -0
  159. package/dist/utils/watch.d.ts +102 -0
  160. package/dist/utils/watch.js +294 -0
  161. package/lib/core/index.js +1 -1
  162. package/lib/effects/index.d.ts +5 -3
  163. package/lib/effects/index.js +17 -1
  164. package/lib/modules/Account/index.js +2 -3
  165. package/lib/modules/AccountList/index.d.ts +7 -1
  166. package/lib/modules/AccountList/index.js +27 -0
  167. package/lib/modules/AccountList/types.d.ts +28 -0
  168. package/lib/modules/BaseModule.d.ts +3 -0
  169. package/lib/modules/BaseModule.js +9 -0
  170. package/lib/modules/Cart/index.d.ts +1 -0
  171. package/lib/modules/Cart/index.js +5 -2
  172. package/lib/modules/Cart/utils/cartProduct.js +22 -6
  173. package/lib/modules/Customer/constants.d.ts +7 -0
  174. package/lib/modules/Customer/constants.js +39 -0
  175. package/lib/modules/Customer/index.d.ts +122 -0
  176. package/lib/modules/Customer/index.js +439 -0
  177. package/lib/modules/Customer/types.d.ts +146 -0
  178. package/lib/modules/Customer/types.js +37 -0
  179. package/lib/modules/Discount/index.d.ts +1 -0
  180. package/lib/modules/Discount/index.js +3 -3
  181. package/lib/modules/Discount/types.d.ts +9 -0
  182. package/lib/modules/Guests/index.js +9 -9
  183. package/lib/modules/Order/index.d.ts +25 -1
  184. package/lib/modules/Order/index.js +186 -1
  185. package/lib/modules/Order/types.d.ts +45 -0
  186. package/lib/modules/Order/utils.js +1 -1
  187. package/lib/modules/Payment/cash.d.ts +19 -0
  188. package/lib/modules/Payment/cash.js +64 -0
  189. package/lib/modules/Payment/cashRecommendationAlgorithm.d.ts +22 -0
  190. package/lib/modules/Payment/cashRecommendationAlgorithm.js +342 -0
  191. package/lib/modules/Payment/eftpos.d.ts +11 -0
  192. package/lib/modules/Payment/eftpos.js +51 -0
  193. package/lib/modules/Payment/index.d.ts +184 -9
  194. package/lib/modules/Payment/index.js +1084 -51
  195. package/lib/modules/Payment/mx51.d.ts +0 -0
  196. package/lib/modules/Payment/mx51.js +0 -0
  197. package/lib/modules/Payment/types.d.ts +772 -30
  198. package/lib/modules/Payment/types.js +79 -6
  199. package/lib/modules/Payment/utils.d.ts +17 -0
  200. package/lib/modules/Payment/utils.js +67 -0
  201. package/lib/modules/Payment/walletpass.d.ts +99 -0
  202. package/lib/modules/Payment/walletpass.js +484 -0
  203. package/lib/modules/ProductList/index.d.ts +12 -1
  204. package/lib/modules/ProductList/index.js +31 -12
  205. package/lib/modules/Resource/index.js +1 -1
  206. package/lib/modules/Rules/index.d.ts +2 -1
  207. package/lib/modules/Rules/index.js +318 -72
  208. package/lib/modules/Rules/types.d.ts +1 -0
  209. package/lib/modules/Schedule/index.d.ts +9 -0
  210. package/lib/modules/Schedule/index.js +60 -0
  211. package/lib/modules/Summary/utils.d.ts +5 -0
  212. package/lib/modules/Summary/utils.js +27 -3
  213. package/lib/modules/index.d.ts +1 -0
  214. package/lib/modules/index.js +2 -0
  215. package/lib/plugins/app-types/app/app.d.ts +83 -0
  216. package/lib/plugins/app-types/app/const.d.ts +4 -0
  217. package/lib/plugins/app-types/app/index.d.ts +14 -0
  218. package/lib/plugins/app-types/applicationManager/application.d.ts +50 -0
  219. package/lib/plugins/app-types/applicationManager/index.d.ts +13 -0
  220. package/lib/plugins/app-types/config.d.ts +3 -0
  221. package/lib/plugins/app-types/cookie/index.d.ts +13 -0
  222. package/lib/plugins/app-types/data/index.d.ts +8 -0
  223. package/lib/plugins/app-types/history/config.d.ts +24 -0
  224. package/lib/plugins/app-types/history/index.d.ts +20 -0
  225. package/lib/plugins/app-types/history/type.d.ts +2 -0
  226. package/lib/plugins/app-types/hooks/index.d.ts +12 -0
  227. package/lib/plugins/app-types/hooks/useDelayedValue/index.d.ts +2 -0
  228. package/lib/plugins/app-types/hooks/useDispatch/index.d.ts +2 -0
  229. package/lib/plugins/app-types/hooks/useLowCode/index.d.ts +13 -0
  230. package/lib/plugins/app-types/hooks/useStore/index.d.ts +6 -0
  231. package/lib/plugins/app-types/index.d.ts +6 -0
  232. package/lib/plugins/app-types/indexDB/index.d.ts +178 -0
  233. package/lib/plugins/app-types/locales/en.d.ts +3 -0
  234. package/lib/plugins/app-types/locales/index.d.ts +37 -0
  235. package/lib/plugins/app-types/locales/original.d.ts +3 -0
  236. package/lib/plugins/app-types/locales/type.d.ts +19 -0
  237. package/lib/plugins/app-types/locales/zh-CN.d.ts +3 -0
  238. package/lib/plugins/app-types/locales/zh-HK.d.ts +3 -0
  239. package/lib/plugins/app-types/logger/feishu.d.ts +11 -0
  240. package/lib/plugins/app-types/logger/index.d.ts +122 -0
  241. package/lib/plugins/app-types/menuManager/hooks.d.ts +17 -0
  242. package/lib/plugins/app-types/menuManager/index.d.ts +28 -0
  243. package/lib/plugins/app-types/models/global.d.ts +32 -0
  244. package/lib/plugins/app-types/models/index.d.ts +45 -0
  245. package/lib/plugins/app-types/models/type.d.ts +2 -0
  246. package/lib/plugins/app-types/package.json +15 -0
  247. package/lib/plugins/app-types/plugin/index.d.ts +0 -0
  248. package/lib/plugins/app-types/pubsub/example.d.ts +5 -0
  249. package/lib/plugins/app-types/pubsub/index.d.ts +63 -0
  250. package/lib/plugins/app-types/request/cache.d.ts +46 -0
  251. package/lib/plugins/app-types/request/cancelToken.d.ts +38 -0
  252. package/lib/plugins/app-types/request/config.d.ts +3 -0
  253. package/lib/plugins/app-types/request/constants.d.ts +2 -0
  254. package/lib/plugins/app-types/request/index.d.ts +24 -0
  255. package/lib/plugins/app-types/request/pisell2Request.d.ts +6 -0
  256. package/lib/plugins/app-types/request/type.d.ts +41 -0
  257. package/lib/plugins/app-types/request/utils.d.ts +46 -0
  258. package/lib/plugins/app-types/routes/config.d.ts +7 -0
  259. package/lib/plugins/app-types/routes/index.d.ts +28 -0
  260. package/lib/plugins/app-types/socket/components/SocketMonitorPage.d.ts +6 -0
  261. package/lib/plugins/app-types/socket/components/index.d.ts +2 -0
  262. package/lib/plugins/app-types/socket/constants.d.ts +33 -0
  263. package/lib/plugins/app-types/socket/events.d.ts +31 -0
  264. package/lib/plugins/app-types/socket/heartbeat.d.ts +66 -0
  265. package/lib/plugins/app-types/socket/index.d.ts +61 -0
  266. package/lib/plugins/app-types/socket/monitor.d.ts +169 -0
  267. package/lib/plugins/app-types/socket/reconnect.d.ts +61 -0
  268. package/lib/plugins/app-types/socket/socket.d.ts +129 -0
  269. package/lib/plugins/app-types/socket/types.d.ts +85 -0
  270. package/lib/plugins/app-types/storage/index.d.ts +17 -0
  271. package/lib/plugins/app-types/tasks/index.d.ts +77 -0
  272. package/lib/plugins/app-types/tasks/type.d.ts +62 -0
  273. package/lib/plugins/app-types/tasks/useTasks.d.ts +5 -0
  274. package/lib/plugins/app-types/type.d.ts +2 -0
  275. package/lib/plugins/app-types/variables/VariablesProvider.d.ts +7 -0
  276. package/lib/plugins/app-types/variables/config.d.ts +3 -0
  277. package/lib/plugins/app-types/variables/index.d.ts +6 -0
  278. package/lib/plugins/app-types/variables/type.d.ts +2 -0
  279. package/lib/plugins/app-types/website/index.d.ts +6 -0
  280. package/lib/plugins/app.d.ts +8 -0
  281. package/lib/plugins/app.js +17 -0
  282. package/lib/plugins/window.d.ts +1 -0
  283. package/lib/solution/BookingByStep/index.js +18 -6
  284. package/lib/solution/BookingByStep/utils/capacity.js +1 -1
  285. package/lib/solution/BookingByStep/utils/products.d.ts +6 -0
  286. package/lib/solution/BookingByStep/utils/products.js +8 -2
  287. package/lib/solution/BookingTicket/index.d.ts +184 -0
  288. package/lib/solution/BookingTicket/index.js +426 -0
  289. package/lib/solution/BookingTicket/types.d.ts +68 -0
  290. package/lib/solution/BookingTicket/types.js +72 -0
  291. package/lib/solution/BookingTicket/utils/scan/cloudSearch.d.ts +22 -0
  292. package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +117 -0
  293. package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +22 -0
  294. package/lib/solution/BookingTicket/utils/scan/handleScan.js +132 -0
  295. package/lib/solution/BookingTicket/utils/scan/index.d.ts +85 -0
  296. package/lib/solution/BookingTicket/utils/scan/index.js +216 -0
  297. package/lib/solution/BookingTicket/utils/scan/scanCache.d.ts +78 -0
  298. package/lib/solution/BookingTicket/utils/scan/scanCache.js +231 -0
  299. package/lib/solution/BuyTickets/index.js +7 -8
  300. package/lib/solution/Checkout/appointmentDemo.json +1 -0
  301. package/lib/solution/Checkout/index.d.ts +432 -0
  302. package/lib/solution/Checkout/index.js +2776 -0
  303. package/lib/solution/Checkout/types.d.ts +727 -0
  304. package/lib/solution/Checkout/types.js +63 -0
  305. package/lib/solution/Checkout/utils/index.d.ts +121 -0
  306. package/lib/solution/Checkout/utils/index.js +362 -0
  307. package/lib/solution/ShopDiscount/index.d.ts +10 -10
  308. package/lib/solution/ShopDiscount/index.js +53 -27
  309. package/lib/solution/ShopDiscount/types.d.ts +8 -0
  310. package/lib/solution/ShopDiscount/utils.d.ts +24 -0
  311. package/lib/solution/ShopDiscount/utils.js +88 -1
  312. package/lib/solution/index.d.ts +2 -0
  313. package/lib/solution/index.js +5 -1
  314. package/lib/types/index.d.ts +4 -1
  315. package/lib/utils/task.d.ts +40 -0
  316. package/lib/utils/task.js +109 -0
  317. package/lib/utils/watch.d.ts +102 -0
  318. package/lib/utils/watch.js +217 -0
  319. package/package.json +3 -1
@@ -0,0 +1,439 @@
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 __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/modules/Customer/index.ts
21
+ var Customer_exports = {};
22
+ __export(Customer_exports, {
23
+ CustomerModule: () => CustomerModule
24
+ });
25
+ module.exports = __toCommonJS(Customer_exports);
26
+ var import_lodash_es = require("lodash-es");
27
+ var import_BaseModule = require("../BaseModule");
28
+ var import_constants = require("./constants");
29
+ __reExport(Customer_exports, require("./types"), module.exports);
30
+ var CustomerModule = class extends import_BaseModule.BaseModule {
31
+ constructor(name, version) {
32
+ super(name, version);
33
+ this.defaultName = "customer";
34
+ this.defaultVersion = "1.0.0";
35
+ this.store = {
36
+ customerList: [],
37
+ selectedCustomer: null,
38
+ total: 0,
39
+ currentPage: 1,
40
+ pageSize: import_constants.DEFAULT_PAGE_SIZE,
41
+ loading: false,
42
+ error: null,
43
+ hasMore: true,
44
+ loadingMore: false,
45
+ searchParams: {}
46
+ };
47
+ this.openCache = false;
48
+ }
49
+ async initialize(core, options) {
50
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
51
+ this.core = core;
52
+ this.store = options == null ? void 0 : options.store;
53
+ this.request = this.core.getPlugin("request");
54
+ if (Array.isArray((_a = options == null ? void 0 : options.initialState) == null ? void 0 : _a.customerList)) {
55
+ const customerList = (0, import_lodash_es.cloneDeep)(options.initialState.customerList || []);
56
+ this.store.customerList = customerList;
57
+ } else {
58
+ this.store.customerList = [];
59
+ }
60
+ if ((_b = options == null ? void 0 : options.initialState) == null ? void 0 : _b.selectedCustomer) {
61
+ this.store.selectedCustomer = (0, import_lodash_es.cloneDeep)(options.initialState.selectedCustomer);
62
+ } else {
63
+ this.store.selectedCustomer = null;
64
+ }
65
+ if (typeof ((_c = options == null ? void 0 : options.initialState) == null ? void 0 : _c.total) === "number") {
66
+ this.store.total = options.initialState.total;
67
+ } else {
68
+ this.store.total = 0;
69
+ }
70
+ if (typeof ((_d = options == null ? void 0 : options.initialState) == null ? void 0 : _d.currentPage) === "number") {
71
+ this.store.currentPage = options.initialState.currentPage;
72
+ } else {
73
+ this.store.currentPage = 1;
74
+ }
75
+ if (typeof ((_e = options == null ? void 0 : options.initialState) == null ? void 0 : _e.pageSize) === "number") {
76
+ this.store.pageSize = options.initialState.pageSize;
77
+ } else {
78
+ this.store.pageSize = import_constants.DEFAULT_PAGE_SIZE;
79
+ }
80
+ this.store.hasMore = ((_f = options == null ? void 0 : options.initialState) == null ? void 0 : _f.hasMore) ?? true;
81
+ this.store.loadingMore = ((_g = options == null ? void 0 : options.initialState) == null ? void 0 : _g.loadingMore) ?? false;
82
+ this.store.searchParams = ((_h = options == null ? void 0 : options.initialState) == null ? void 0 : _h.searchParams) ?? {};
83
+ if ((_i = options == null ? void 0 : options.otherParams) == null ? void 0 : _i.cacheId) {
84
+ this.openCache = options.otherParams.openCache;
85
+ this.cacheId = options.otherParams.cacheId;
86
+ }
87
+ if ((_j = options == null ? void 0 : options.otherParams) == null ? void 0 : _j.fatherModule) {
88
+ this.fatherModule = options.otherParams.fatherModule;
89
+ }
90
+ }
91
+ /**
92
+ * 获取客户列表数据(内部方法)
93
+ * @param params 查询参数
94
+ * @returns API响应数据
95
+ */
96
+ async fetchCustomerListData(params = {}) {
97
+ var _a, _b;
98
+ const url = "/customer/select-list";
99
+ const { skip = 1, num = import_constants.DEFAULT_PAGE_SIZE, search, ...otherParams } = params;
100
+ const queryParams = {
101
+ skip,
102
+ num,
103
+ sort_by: import_constants.SORT_BY,
104
+ with: ["latestWalletDetail.wallet", "contactsInfo", "formRecord"],
105
+ search_wallet_flag: 1,
106
+ search_wallet_pass_flag: 1,
107
+ ...search && { search },
108
+ ...otherParams
109
+ };
110
+ const res = await this.request.get(url, queryParams);
111
+ if ((res == null ? void 0 : res.code) !== 200) {
112
+ throw new Error(res == null ? void 0 : res.message);
113
+ }
114
+ return {
115
+ customerList: ((_a = res == null ? void 0 : res.data) == null ? void 0 : _a.list) || [],
116
+ total: ((_b = res == null ? void 0 : res.data) == null ? void 0 : _b.count) || 0,
117
+ page: skip,
118
+ pageSize: num
119
+ };
120
+ }
121
+ /**
122
+ * 处理客户列表操作的错误(内部方法)
123
+ * @param error 错误对象
124
+ * @param operation 操作名称
125
+ */
126
+ async handleCustomerListError(error, operation) {
127
+ console.error(`Failed to ${operation}:`, error);
128
+ this.store.error = error instanceof Error ? error.message : `Failed to ${operation}`;
129
+ await this.core.effects.emit(
130
+ `${this.name}:onCustomerListError`,
131
+ this.store.error
132
+ );
133
+ }
134
+ /**
135
+ * 获取客户列表
136
+ * @param params 查询参数
137
+ * @returns 客户列表响应
138
+ */
139
+ async getCustomerList(params = {}) {
140
+ try {
141
+ this.store.loading = true;
142
+ this.store.error = null;
143
+ const { customerList, total, page, pageSize } = await this.fetchCustomerListData(params);
144
+ const { skip, num, ...searchParams } = params;
145
+ this.store.searchParams = (0, import_lodash_es.cloneDeep)(searchParams);
146
+ this.store.currentPage = page;
147
+ this.store.pageSize = pageSize;
148
+ this.store.total = total;
149
+ this.store.hasMore = page * pageSize < total;
150
+ this.store.customerList = (0, import_lodash_es.cloneDeep)(customerList);
151
+ await this.core.effects.emit(
152
+ `${this.name}:onCustomerListUpdate`,
153
+ this.store
154
+ );
155
+ this.triggerPaginationChange({
156
+ page,
157
+ pageSize,
158
+ total,
159
+ totalPages: Math.ceil(total / pageSize)
160
+ });
161
+ const response = {
162
+ list: customerList,
163
+ total,
164
+ page,
165
+ pageSize
166
+ };
167
+ return response;
168
+ } catch (error) {
169
+ await this.handleCustomerListError(error, "fetch customer list");
170
+ throw error;
171
+ } finally {
172
+ this.store.loading = false;
173
+ this.storeChange();
174
+ }
175
+ }
176
+ /**
177
+ * 设置客户列表
178
+ * @param customers 客户列表
179
+ * @param total 总数
180
+ */
181
+ setCustomerList(customers, total) {
182
+ this.store.customerList = (0, import_lodash_es.cloneDeep)(customers);
183
+ if (typeof total === "number") {
184
+ this.store.total = total;
185
+ }
186
+ this.storeChange();
187
+ }
188
+ /**
189
+ * 设置当前选择的客户
190
+ * @param customer 选择的客户
191
+ */
192
+ setSelectedCustomer(customer) {
193
+ this.store.selectedCustomer = !customer ? import_constants.DEFAULT_CUSTOMER : (0, import_lodash_es.cloneDeep)(customer);
194
+ this.core.effects.emit(
195
+ `${this.name}:onCustomerSelected`,
196
+ this.store.selectedCustomer
197
+ );
198
+ this.storeChange();
199
+ }
200
+ /**
201
+ * 获取当前选择的客户
202
+ * @returns 当前选择的客户
203
+ */
204
+ getSelectedCustomer() {
205
+ return this.store.selectedCustomer;
206
+ }
207
+ /**
208
+ * 获取客户列表
209
+ * @returns 客户列表
210
+ */
211
+ getCustomers() {
212
+ return [...this.store.customerList];
213
+ }
214
+ /**
215
+ * 根据ID查找客户
216
+ * @param id 客户ID
217
+ * @returns 客户信息
218
+ */
219
+ getCustomerById(id) {
220
+ return this.store.customerList.find((customer) => customer.id === id) || null;
221
+ }
222
+ /**
223
+ * 清空客户列表
224
+ */
225
+ clearCustomers() {
226
+ this.store.customerList = [];
227
+ this.store.selectedCustomer = null;
228
+ this.store.total = 0;
229
+ this.store.currentPage = 1;
230
+ this.store.pageSize = import_constants.DEFAULT_PAGE_SIZE;
231
+ this.store.hasMore = true;
232
+ this.store.loadingMore = false;
233
+ this.store.searchParams = {};
234
+ this.core.effects.emit(
235
+ `${this.name}:onCustomerListUpdate`,
236
+ this.store
237
+ );
238
+ this.storeChange();
239
+ }
240
+ /**
241
+ * 添加客户到列表第一位
242
+ * @param customer 要添加的客户信息
243
+ */
244
+ addCustomerToFirst(customer) {
245
+ const newCustomer = (0, import_lodash_es.cloneDeep)(customer);
246
+ this.store.customerList = [newCustomer, ...this.store.customerList];
247
+ this.store.total += 1;
248
+ this.core.effects.emit(
249
+ `${this.name}:onCustomerListUpdate`,
250
+ this.store
251
+ );
252
+ this.storeChange();
253
+ }
254
+ /**
255
+ * 获取当前状态
256
+ * @returns 当前状态
257
+ */
258
+ getState() {
259
+ return (0, import_lodash_es.cloneDeep)(this.store);
260
+ }
261
+ /**
262
+ * 获取分页信息
263
+ * @returns 分页信息
264
+ */
265
+ getPaginationInfo() {
266
+ return {
267
+ page: this.store.currentPage,
268
+ pageSize: this.store.pageSize,
269
+ total: this.store.total,
270
+ totalPages: Math.ceil(this.store.total / this.store.pageSize)
271
+ };
272
+ }
273
+ /**
274
+ * 触发分页变化事件
275
+ * @param pagination 分页信息
276
+ */
277
+ triggerPaginationChange(pagination) {
278
+ this.core.effects.emit(
279
+ `${this.name}:onPaginationChange`,
280
+ pagination
281
+ );
282
+ }
283
+ /**
284
+ * 设置分页信息
285
+ * @param page 页码
286
+ * @param pageSize 每页数量
287
+ */
288
+ setPaginationInfo(page, pageSize) {
289
+ this.store.currentPage = page;
290
+ this.store.pageSize = pageSize;
291
+ this.storeChange();
292
+ this.triggerPaginationChange({
293
+ page,
294
+ pageSize,
295
+ total: this.store.total,
296
+ totalPages: Math.ceil(this.store.total / pageSize)
297
+ });
298
+ }
299
+ /**
300
+ * 便捷方法:切换分页并自动获取数据
301
+ * @param page 页码
302
+ * @param pageSize 每页数量(可选,不传则使用当前pageSize)
303
+ * @returns 客户列表响应
304
+ */
305
+ async changeCustomerPage(page, pageSize) {
306
+ const targetPageSize = pageSize || this.store.pageSize;
307
+ this.setPaginationInfo(page, targetPageSize);
308
+ const skip = page;
309
+ const num = targetPageSize;
310
+ return await this.getCustomerList({
311
+ skip,
312
+ num,
313
+ ...this.store.searchParams
314
+ // 使用存储的搜索条件
315
+ });
316
+ }
317
+ /**
318
+ * 滚动加载更多客户数据 - 数据会追加到现有列表中
319
+ * @returns 客户列表响应
320
+ */
321
+ async loadMoreCustomers() {
322
+ if (!this.store.hasMore || this.store.loadingMore) {
323
+ return {
324
+ list: [],
325
+ total: this.store.total,
326
+ page: this.store.currentPage,
327
+ pageSize: this.store.pageSize
328
+ };
329
+ }
330
+ const nextPage = this.store.currentPage + 1;
331
+ try {
332
+ this.store.loadingMore = true;
333
+ this.store.error = null;
334
+ const { customerList: newCustomers, total, page, pageSize } = await this.fetchCustomerListData({
335
+ skip: nextPage,
336
+ num: this.store.pageSize,
337
+ ...this.store.searchParams
338
+ // 使用存储的搜索条件
339
+ });
340
+ const updatedCustomerList = [...this.store.customerList, ...(0, import_lodash_es.cloneDeep)(newCustomers)];
341
+ this.store.customerList = updatedCustomerList;
342
+ this.store.currentPage = page;
343
+ this.store.total = total;
344
+ this.store.hasMore = page * pageSize < total;
345
+ await this.core.effects.emit(
346
+ `${this.name}:onScrollLoadMore`,
347
+ {
348
+ newCustomers,
349
+ allCustomers: this.store.customerList,
350
+ currentPage: page,
351
+ hasMore: this.store.hasMore
352
+ }
353
+ );
354
+ await this.core.effects.emit(
355
+ `${this.name}:onCustomerListUpdate`,
356
+ this.store
357
+ );
358
+ this.triggerPaginationChange({
359
+ page,
360
+ pageSize,
361
+ total,
362
+ totalPages: Math.ceil(total / pageSize)
363
+ });
364
+ const response = {
365
+ list: newCustomers,
366
+ // 返回新加载的数据
367
+ total,
368
+ page,
369
+ pageSize
370
+ };
371
+ return response;
372
+ } catch (error) {
373
+ await this.handleCustomerListError(error, "load more customers");
374
+ throw error;
375
+ } finally {
376
+ this.store.loadingMore = false;
377
+ this.storeChange();
378
+ }
379
+ }
380
+ /**
381
+ * 重置并重新开始滚动加载
382
+ * @param params 查询参数
383
+ * @returns 客户列表响应
384
+ */
385
+ async resetAndLoadCustomers(params = {}) {
386
+ this.store.customerList = [];
387
+ this.store.currentPage = 1;
388
+ this.store.hasMore = true;
389
+ this.store.loadingMore = false;
390
+ const resetParams = {
391
+ ...params,
392
+ skip: 1,
393
+ num: params.num || this.store.pageSize
394
+ };
395
+ const response = await this.getCustomerList(resetParams);
396
+ await this.core.effects.emit(
397
+ `${this.name}:onScrollLoadComplete`,
398
+ {
399
+ customers: this.store.customerList,
400
+ total: this.store.total,
401
+ hasMore: this.store.hasMore
402
+ }
403
+ );
404
+ return response;
405
+ }
406
+ /**
407
+ * 检查是否还有更多数据可以加载
408
+ * @returns 是否还有更多数据
409
+ */
410
+ hasMoreCustomers() {
411
+ return this.store.hasMore && !this.store.loadingMore;
412
+ }
413
+ /**
414
+ * 获取当前的搜索条件
415
+ * @returns 当前搜索条件
416
+ */
417
+ getCurrentSearchParams() {
418
+ return (0, import_lodash_es.cloneDeep)(this.store.searchParams);
419
+ }
420
+ /**
421
+ * 缓存状态变化
422
+ */
423
+ storeChange() {
424
+ if (this.openCache) {
425
+ const store = (0, import_lodash_es.cloneDeep)(this.store);
426
+ this.checkSaveCache({
427
+ cacheId: this.cacheId,
428
+ fatherModule: this.fatherModule,
429
+ store,
430
+ cacheKey: ["customerList", "selectedCustomer", "total", "currentPage", "pageSize", "hasMore", "loadingMore", "searchParams"]
431
+ });
432
+ }
433
+ }
434
+ };
435
+ // Annotate the CommonJS export names for ESM import in node:
436
+ 0 && (module.exports = {
437
+ CustomerModule,
438
+ ...require("./types")
439
+ });
@@ -0,0 +1,146 @@
1
+ import { ICustomer } from "../AccountList/types";
2
+ export declare enum CustomerHooks {
3
+ OnCustomerListUpdate = "customer:onCustomerListUpdate",
4
+ OnCustomerListError = "customer:onError",
5
+ OnCustomerSelected = "customer:onCustomerSelected",
6
+ OnPaginationChange = "customer:onPaginationChange",
7
+ OnScrollLoadMore = "customer:onScrollLoadMore",
8
+ OnScrollLoadComplete = "customer:onScrollLoadComplete"
9
+ }
10
+ /**
11
+ * 客户数据
12
+ */
13
+ export interface ShopCustomer extends ICustomer {
14
+ /** 客户ID */
15
+ id: string | number;
16
+ /** 客户姓名 */
17
+ name: string;
18
+ /** 客户电话 */
19
+ phone?: string;
20
+ /** 客户邮箱 */
21
+ email?: string;
22
+ /** 客户创建时间 */
23
+ created_at?: string;
24
+ /** 客户更新时间 */
25
+ updated_at?: string;
26
+ /** 其他客户信息 */
27
+ [key: string]: any;
28
+ }
29
+ /**
30
+ * 客户列表关联查询参数
31
+ *
32
+ * formRecord: 用户表单记录
33
+ * walletDetails.wallet: 用户所有wallet
34
+ * latestWalletDetail.wallet: 用户最新wallet
35
+ */
36
+ type CustomerWith = 'formRecord' | 'walletDetails.wallet' | 'latestWalletDetail.wallet';
37
+ /**
38
+ * 获取客户列表参数
39
+ */
40
+ export interface ShopGetCustomerListParams {
41
+ /** 页码 */
42
+ skip?: number;
43
+ /** 每页数量 */
44
+ num?: number;
45
+ /** 搜索关键词 */
46
+ search?: string;
47
+ /** 关联查询参数 */
48
+ with?: CustomerWith[];
49
+ /** wallet搜索标识 */
50
+ search_wallet_flag?: 0 | 1;
51
+ /** wallet pass搜索标识 */
52
+ search_wallet_pass_flag?: 0 | 1;
53
+ /** 其他筛选参数 */
54
+ [key: string]: any;
55
+ }
56
+ /**
57
+ * 分页信息
58
+ */
59
+ export interface IPaginationInfo {
60
+ /** 当前页码 */
61
+ page: number;
62
+ /** 每页数量 */
63
+ pageSize: number;
64
+ /** 总数 */
65
+ total: number;
66
+ /** 总页数 */
67
+ totalPages: number;
68
+ }
69
+ /**
70
+ * 客户列表响应
71
+ */
72
+ export interface ICustomerListResponse {
73
+ /** 客户列表 */
74
+ list: ShopCustomer[];
75
+ /** 总数 */
76
+ total: number;
77
+ /** 当前页 */
78
+ page?: number;
79
+ /** 每页数量 */
80
+ pageSize?: number;
81
+ }
82
+ /**
83
+ * 客户列表状态
84
+ */
85
+ export interface CustomerState {
86
+ /** 客户列表 */
87
+ customerList: ShopCustomer[];
88
+ /** 当前选择的客户 */
89
+ selectedCustomer: ShopCustomer | null;
90
+ /** 列表总数 */
91
+ total: number;
92
+ /** 当前页码 */
93
+ currentPage: number;
94
+ /** 每页数量 */
95
+ pageSize: number;
96
+ /** 加载状态 */
97
+ loading: boolean;
98
+ /** 错误信息 */
99
+ error: string | null;
100
+ /** 是否支持滚动加载更多 */
101
+ hasMore: boolean;
102
+ /** 滚动加载状态 */
103
+ loadingMore: boolean;
104
+ /** 当前搜索条件 */
105
+ searchParams: Omit<ShopGetCustomerListParams, 'skip' | 'num'>;
106
+ }
107
+ /**
108
+ * 客户模块 API
109
+ */
110
+ export interface CustomerModuleAPI {
111
+ /** 获取客户列表 */
112
+ getCustomerList: (params?: ShopGetCustomerListParams) => Promise<ICustomerListResponse>;
113
+ /** 设置客户列表 */
114
+ setCustomerList: (customers: ShopCustomer[], total?: number) => void;
115
+ /** 设置当前选择的客户 */
116
+ setSelectedCustomer: (customer: ShopCustomer | null) => void;
117
+ /** 获取当前选择的客户 */
118
+ getSelectedCustomer: () => ShopCustomer | null;
119
+ /** 获取客户列表 */
120
+ getCustomers: () => ShopCustomer[];
121
+ /** 根据ID查找客户 */
122
+ getCustomerById: (id: string | number) => ShopCustomer | null;
123
+ /** 清空客户列表 */
124
+ clearCustomers: () => void;
125
+ /** 添加客户到列表第一位 */
126
+ addCustomerToFirst: (customer: ShopCustomer) => void;
127
+ /** 获取当前状态 */
128
+ getState: () => CustomerState;
129
+ /** 获取分页信息 */
130
+ getPaginationInfo: () => IPaginationInfo;
131
+ /** 触发分页变化事件 */
132
+ triggerPaginationChange: (pagination: IPaginationInfo) => void;
133
+ /** 设置分页信息 */
134
+ setPaginationInfo: (page: number, pageSize: number) => void;
135
+ /** 便捷方法:切换分页并自动获取数据 */
136
+ changeCustomerPage: (page: number, pageSize?: number) => Promise<ICustomerListResponse>;
137
+ /** 滚动加载更多客户数据 */
138
+ loadMoreCustomers: () => Promise<ICustomerListResponse>;
139
+ /** 重置并重新开始滚动加载 */
140
+ resetAndLoadCustomers: (params?: ShopGetCustomerListParams) => Promise<ICustomerListResponse>;
141
+ /** 检查是否还有更多数据可以加载 */
142
+ hasMoreCustomers: () => boolean;
143
+ /** 获取当前的搜索条件 */
144
+ getCurrentSearchParams: () => Omit<ShopGetCustomerListParams, 'skip' | 'num'>;
145
+ }
146
+ export {};
@@ -0,0 +1,37 @@
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/Customer/types.ts
20
+ var types_exports = {};
21
+ __export(types_exports, {
22
+ CustomerHooks: () => CustomerHooks
23
+ });
24
+ module.exports = __toCommonJS(types_exports);
25
+ var CustomerHooks = /* @__PURE__ */ ((CustomerHooks2) => {
26
+ CustomerHooks2["OnCustomerListUpdate"] = "customer:onCustomerListUpdate";
27
+ CustomerHooks2["OnCustomerListError"] = "customer:onError";
28
+ CustomerHooks2["OnCustomerSelected"] = "customer:onCustomerSelected";
29
+ CustomerHooks2["OnPaginationChange"] = "customer:onPaginationChange";
30
+ CustomerHooks2["OnScrollLoadMore"] = "customer:onScrollLoadMore";
31
+ CustomerHooks2["OnScrollLoadComplete"] = "customer:onScrollLoadComplete";
32
+ return CustomerHooks2;
33
+ })(CustomerHooks || {});
34
+ // Annotate the CommonJS export names for ESM import in node:
35
+ 0 && (module.exports = {
36
+ CustomerHooks
37
+ });
@@ -33,3 +33,4 @@ export declare class DiscountModule extends BaseModule implements Module, Discou
33
33
  clear(): Promise<void>;
34
34
  storeChange(): void;
35
35
  }
36
+ export type { Discount } from './types';
@@ -176,16 +176,16 @@ var DiscountModule = class extends import_BaseModule.BaseModule {
176
176
  }
177
177
  if (discount.appliedProductDetails) {
178
178
  return discount.appliedProductDetails.reduce((total, product) => {
179
- var _a;
179
+ var _a, _b;
180
180
  const price = new import_decimal.default(((_a = product == null ? void 0 : product.discount) == null ? void 0 : _a.fixed_amount) || 0).mul((product == null ? void 0 : product._num) || 1);
181
- return new import_decimal.default(total).plus(price).toNumber();
181
+ return new import_decimal.default(total).plus(price).add(((_b = product == null ? void 0 : product.metadata) == null ? void 0 : _b.product_discount_difference) || 0).toNumber();
182
182
  }, 0);
183
183
  }
184
184
  }
185
185
  async destroy() {
186
186
  this.store.discountList = [];
187
187
  this.core.effects.offByModuleDestroy(this.name);
188
- await this.core.effects.emit(import_types.DiscountHooks.OnDestroy, {});
188
+ await this.core.effects.emit(`${this.name}:onDestroy`, {});
189
189
  console.log("[Discount] 已销毁");
190
190
  }
191
191
  async clear() {
@@ -33,6 +33,9 @@ interface ApplicableProductDetails {
33
33
  title: string;
34
34
  original_amount: string;
35
35
  num: number;
36
+ metadata?: {
37
+ product_discount_difference?: number;
38
+ };
36
39
  discount?: {
37
40
  fixed_amount?: number;
38
41
  product_id?: number;
@@ -81,6 +84,10 @@ export interface Discount {
81
84
  discount_card_type?: 'fixed_amount' | 'percent';
82
85
  custom_product_bundle_map_id?: string;
83
86
  validity_type?: "custom_schedule_validity" | "fixed_validity";
87
+ discount_calculation_mode: 'item_level' | 'order_level';
88
+ holder: {
89
+ type: "customer" | "custom";
90
+ };
84
91
  };
85
92
  product: Product;
86
93
  type: "product" | 'good_pass';
@@ -89,7 +96,9 @@ export interface Discount {
89
96
  isEditMode?: boolean;
90
97
  isScan?: boolean;
91
98
  discount?: {
99
+ discount_product_id: number;
92
100
  resource_id: number;
101
+ discount_calculation_mode: 'item_level' | 'order_level';
93
102
  };
94
103
  isManualSelect?: boolean;
95
104
  isDisabled?: boolean;