@pisell/pisellos 3.0.74 → 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,484 @@
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/Payment/walletpass.ts
20
+ var walletpass_exports = {};
21
+ __export(walletpass_exports, {
22
+ WalletPassPaymentImpl: () => WalletPassPaymentImpl
23
+ });
24
+ module.exports = __toCommonJS(walletpass_exports);
25
+ var import_types = require("./types");
26
+ var import_utils = require("./utils");
27
+ var WalletPassPaymentImpl = class {
28
+ constructor(paymentModule) {
29
+ this.paymentModule = paymentModule;
30
+ this.walletRecommendList = [];
31
+ this.userIdentificationCodes = [];
32
+ this.searchResults = [];
33
+ this.walletParams = null;
34
+ }
35
+ /**
36
+ * 发送事件的辅助方法
37
+ * 支持使用WalletPassHooks或PaymentHooks
38
+ */
39
+ emitEvent(hook, data) {
40
+ try {
41
+ const eventName = hook.split(":")[1] || hook.replace(/^[A-Z][a-z]+/, "").replace(/^On/, "").toLowerCase();
42
+ const fullEventName = `${this.paymentModule.name}:${eventName}`;
43
+ this.paymentModule.core.effects.emit(fullEventName, data);
44
+ } catch (error) {
45
+ this.paymentModule.logError("[WalletPass] 发送事件失败", error, { hook });
46
+ }
47
+ }
48
+ /**
49
+ * 生成钱包API默认参数
50
+ * 根据业务数据生成标准的钱包API参数,并存储在模块中
51
+ */
52
+ generateWalletParams(businessData) {
53
+ var _a;
54
+ const {
55
+ customer_id,
56
+ amountInfo,
57
+ products,
58
+ order_wait_pay_amount,
59
+ payment_order_id,
60
+ is_price_include_tax
61
+ } = businessData;
62
+ const totalAmount = Number(amountInfo.totalAmount);
63
+ const subTotal = Number(amountInfo.subTotal);
64
+ const walletParams = {
65
+ is_price_include_tax,
66
+ sale_channel: "pos",
67
+ customer_id: customer_id || 0,
68
+ // 提供默认值,确保类型为 number
69
+ order_expect_amount: totalAmount,
70
+ // 订单小计金额
71
+ order_product_amount: subTotal,
72
+ // 订单待支付金额
73
+ order_wait_pay_amount: order_wait_pay_amount || ((amountInfo == null ? void 0 : amountInfo.isDeposit) ? Number(amountInfo == null ? void 0 : amountInfo.depositAmount) : totalAmount),
74
+ // order_behavior_count_customer_id: 1,
75
+ products,
76
+ prepare_payments: [],
77
+ payment_order_id
78
+ };
79
+ this.walletParams = walletParams;
80
+ this.paymentModule.logInfo("[WalletPass] 钱包默认参数已生成并存储", {
81
+ customer_id: walletParams.customer_id,
82
+ order_expect_amount: walletParams.order_expect_amount,
83
+ order_product_amount: walletParams.order_product_amount,
84
+ order_wait_pay_amount: walletParams.order_wait_pay_amount,
85
+ products_count: ((_a = walletParams.products) == null ? void 0 : _a.length) || 0
86
+ });
87
+ return walletParams;
88
+ }
89
+ /**
90
+ * 获取已存储的钱包参数
91
+ * 返回之前生成并存储的钱包参数
92
+ */
93
+ getStoredWalletParams() {
94
+ return this.walletParams;
95
+ }
96
+ /**
97
+ * 清理已存储的钱包参数
98
+ * 清除之前存储的钱包参数
99
+ */
100
+ clearStoredWalletParams() {
101
+ this.walletParams = null;
102
+ this.paymentModule.logInfo("[WalletPass] 已存储的钱包参数已清理");
103
+ }
104
+ /**
105
+ * 从业务数据初始化钱包数据
106
+ * 内部生成参数,然后调用标准的初始化流程
107
+ */
108
+ async initializeWalletDataFromBusinessAsync(businessData) {
109
+ var _a, _b, _c, _d, _e, _f, _g, _h;
110
+ const startTime = Date.now();
111
+ const walletParams = this.generateWalletParams(businessData);
112
+ if (Number(((_a = businessData == null ? void 0 : businessData.amountInfo) == null ? void 0 : _a.totalAmount) || 0) < 0 || Number(((_b = businessData == null ? void 0 : businessData.amountInfo) == null ? void 0 : _b.subTotal) || 0) < 0) {
113
+ return {
114
+ walletRecommendList: [],
115
+ userIdentificationCodes: []
116
+ };
117
+ }
118
+ this.emitEvent(import_types.WalletPassHooks.OnWalletInitializationStarted, {
119
+ businessData,
120
+ startTime
121
+ });
122
+ this.paymentModule.logInfo("[WalletPass] 开始从业务数据初始化钱包数据", {
123
+ customer_id: businessData.customer_id,
124
+ totalAmount: (_c = businessData.amountInfo) == null ? void 0 : _c.totalAmount,
125
+ subTotal: (_d = businessData.amountInfo) == null ? void 0 : _d.subTotal,
126
+ order_wait_pay_amount: businessData.order_wait_pay_amount,
127
+ products_count: ((_e = businessData.products) == null ? void 0 : _e.length) || 0
128
+ });
129
+ try {
130
+ const result = await this.initializeWalletDataAsync(walletParams);
131
+ const endTime = Date.now();
132
+ const duration = endTime - startTime;
133
+ this.emitEvent(import_types.WalletPassHooks.OnWalletInitializationCompleted, {
134
+ businessData,
135
+ result,
136
+ startTime,
137
+ endTime,
138
+ duration
139
+ });
140
+ this.paymentModule.logInfo(`[WalletPass] 从业务数据初始化钱包数据成功`, {
141
+ duration: `${duration}ms`,
142
+ walletRecommendList_count: ((_f = result.walletRecommendList) == null ? void 0 : _f.length) || 0,
143
+ userIdentificationCodes_count: ((_g = result.userIdentificationCodes) == null ? void 0 : _g.length) || 0
144
+ });
145
+ return result;
146
+ } catch (error) {
147
+ const endTime = Date.now();
148
+ const duration = endTime - startTime;
149
+ this.emitEvent(import_types.WalletPassHooks.OnWalletInitializationFailed, {
150
+ businessData,
151
+ error,
152
+ startTime,
153
+ endTime,
154
+ duration
155
+ });
156
+ this.paymentModule.logError(`[WalletPass] 从业务数据初始化钱包数据失败`, error, {
157
+ duration: `${duration}ms`,
158
+ customer_id: businessData.customer_id,
159
+ totalAmount: (_h = businessData.amountInfo) == null ? void 0 : _h.totalAmount
160
+ });
161
+ throw error;
162
+ }
163
+ }
164
+ /**
165
+ * 初始化钱包数据
166
+ * 先获取推荐列表,再获取用户识别码列表(顺序执行)
167
+ */
168
+ async initializeWalletDataAsync(baseParams) {
169
+ try {
170
+ const walletRecommendList = await this.getWalletPassRecommendListAsync(baseParams);
171
+ const identificationParams = {
172
+ ...baseParams,
173
+ available: 2,
174
+ prepare_payments: this.formatWalletPassList2PreparePayments(walletRecommendList),
175
+ other_exact_codes: [],
176
+ filter_prepare_wallet_pass: 1
177
+ };
178
+ const userIdentificationCodes = await this.getUserIdentificationCodeListAsync(identificationParams);
179
+ return {
180
+ walletRecommendList,
181
+ userIdentificationCodes
182
+ };
183
+ } catch (error) {
184
+ this.paymentModule.logError("[WalletPass] 初始化钱包数据失败", error, {
185
+ customer_id: baseParams.customer_id,
186
+ order_expect_amount: baseParams.order_expect_amount
187
+ });
188
+ throw error;
189
+ }
190
+ }
191
+ async getWalletPassRecommendListAsync(params) {
192
+ var _a;
193
+ try {
194
+ this.paymentModule.logInfo("[WalletPass] 开始获取钱包推荐列表", {
195
+ customer_id: params.customer_id,
196
+ order_expect_amount: params.order_expect_amount,
197
+ sale_channel: params.sale_channel,
198
+ payment_order_id: (_a = this.walletParams) == null ? void 0 : _a.payment_order_id
199
+ });
200
+ const response = await this.paymentModule.request.post(
201
+ "/machinecode/prepare/deduction/recommend",
202
+ params
203
+ // 将 params 作为请求体数据
204
+ );
205
+ this.walletRecommendList = (response == null ? void 0 : response.data) || [];
206
+ this.emitEvent(import_types.WalletPassHooks.OnWalletRecommendListUpdated, {
207
+ walletRecommendList: this.walletRecommendList
208
+ });
209
+ this.paymentModule.logInfo("[WalletPass] 钱包推荐列表已更新", {
210
+ count: this.walletRecommendList.length,
211
+ items: this.walletRecommendList.map((item) => ({
212
+ voucher_id: item.voucher_id,
213
+ name: item.name,
214
+ amount: item.amount,
215
+ tag: item.tag
216
+ }))
217
+ });
218
+ return this.walletRecommendList;
219
+ } catch (error) {
220
+ this.paymentModule.logError("[WalletPass] 获取钱包推荐列表失败", error, {
221
+ customer_id: params.customer_id,
222
+ order_expect_amount: params.order_expect_amount,
223
+ sale_channel: params.sale_channel
224
+ });
225
+ return [];
226
+ }
227
+ }
228
+ formatWalletPassList2PreparePayments(list) {
229
+ return (0, import_utils.formatWalletPassList2PreparePayments)(list);
230
+ }
231
+ async getUserIdentificationCodeListAsync(params) {
232
+ var _a, _b;
233
+ try {
234
+ const newParams = {
235
+ ...this.walletParams,
236
+ ...params
237
+ };
238
+ this.paymentModule.logInfo("[WalletPass] 开始获取用户识别码列表", {
239
+ customer_id: newParams.customer_id,
240
+ available: newParams.available,
241
+ prepare_payments_count: ((_a = newParams.prepare_payments) == null ? void 0 : _a.length) || 0,
242
+ filter_prepare_wallet_pass: newParams.filter_prepare_wallet_pass,
243
+ payment_order_id: (_b = this.walletParams) == null ? void 0 : _b.payment_order_id
244
+ });
245
+ const response = await this.paymentModule.request.post(
246
+ "/machinecode/prepare/deduction",
247
+ newParams
248
+ );
249
+ const sortedData = (0, import_utils.sortUserIdentificationCodeList)((response == null ? void 0 : response.data) || []);
250
+ this.userIdentificationCodes = sortedData;
251
+ this.emitEvent(import_types.WalletPassHooks.OnUserIdentificationCodesUpdated, {
252
+ userIdentificationCodes: this.userIdentificationCodes
253
+ });
254
+ this.paymentModule.logInfo("[WalletPass] 用户识别码列表已更新", {
255
+ count: this.userIdentificationCodes.length,
256
+ sorted_items: this.userIdentificationCodes.slice(0, 5).map((item) => ({
257
+ code: item.code,
258
+ error_code: item.error_code,
259
+ error_msg: item.error_msg
260
+ }))
261
+ });
262
+ return this.userIdentificationCodes;
263
+ } catch (error) {
264
+ this.paymentModule.logError("[WalletPass] 获取用户识别码列表失败", error, {
265
+ customer_id: params.customer_id,
266
+ available: params.available
267
+ });
268
+ return [];
269
+ }
270
+ }
271
+ /**
272
+ * 搜索识别码信息
273
+ * 通过识别码搜索相关的钱包通行证信息
274
+ * 基于 WalletDeductionRecommendParams 参数结构
275
+ * 特殊逻辑:当识别码长度为9位且前3位为"000"时,调用 /wallet/detail/search 接口
276
+ */
277
+ async searchIdentificationCodeAsync(params, config = {}) {
278
+ try {
279
+ const { code } = params;
280
+ this.paymentModule.logInfo("[WalletPass] 开始搜索识别码", {
281
+ code,
282
+ code_length: code.length,
283
+ noCache: config.noCache || false
284
+ });
285
+ const isWalletCode = code.length === 9 && code.startsWith("000");
286
+ if (isWalletCode) {
287
+ const walletDetailParams = {
288
+ code,
289
+ with_customer: 1,
290
+ with: ["wallet"]
291
+ };
292
+ this.paymentModule.logInfo("[WalletPass] 搜索钱包识别码", {
293
+ code,
294
+ with_customer: walletDetailParams.with_customer,
295
+ with: walletDetailParams.with
296
+ });
297
+ const response2 = await this.paymentModule.request.post(
298
+ "/wallet/detail/search",
299
+ walletDetailParams
300
+ );
301
+ const searchResults2 = (response2 == null ? void 0 : response2.data) || [];
302
+ this.paymentModule.logInfo("[WalletPass] 钱包识别码搜索完成", {
303
+ code,
304
+ results_count: searchResults2.length,
305
+ type: "walletCode"
306
+ });
307
+ return {
308
+ type: "walletCode",
309
+ data: searchResults2
310
+ };
311
+ }
312
+ const baseWalletParams = this.walletParams;
313
+ const searchParams = {
314
+ // 基础钱包参数
315
+ sale_channel: params.sale_channel || (baseWalletParams == null ? void 0 : baseWalletParams.sale_channel) || "pos",
316
+ customer_id: params.customer_id || (baseWalletParams == null ? void 0 : baseWalletParams.customer_id),
317
+ order_expect_amount: params.order_expect_amount || (baseWalletParams == null ? void 0 : baseWalletParams.order_expect_amount),
318
+ order_product_amount: params.order_product_amount || (baseWalletParams == null ? void 0 : baseWalletParams.order_product_amount),
319
+ order_wait_pay_amount: params.order_wait_pay_amount || (baseWalletParams == null ? void 0 : baseWalletParams.order_wait_pay_amount),
320
+ order_behavior_count_customer_id: params.order_behavior_count_customer_id || (baseWalletParams == null ? void 0 : baseWalletParams.order_behavior_count_customer_id),
321
+ products: params.products || (baseWalletParams == null ? void 0 : baseWalletParams.products),
322
+ prepare_payments: params.prepare_payments || (baseWalletParams == null ? void 0 : baseWalletParams.prepare_payments),
323
+ multiple: 1,
324
+ // 搜索特有参数
325
+ code: params.code,
326
+ payment_order_id: baseWalletParams == null ? void 0 : baseWalletParams.payment_order_id
327
+ };
328
+ this.paymentModule.logInfo("[WalletPass] 搜索普通识别码", {
329
+ code: searchParams.code,
330
+ customer_id: searchParams.customer_id,
331
+ order_expect_amount: searchParams.order_expect_amount,
332
+ multiple: searchParams.multiple,
333
+ payment_order_id: baseWalletParams == null ? void 0 : baseWalletParams.payment_order_id
334
+ });
335
+ const response = await this.paymentModule.request.post(
336
+ "/machinecode/prepare/deduction/search",
337
+ searchParams
338
+ );
339
+ const searchResults = (response == null ? void 0 : response.data) || [];
340
+ if (config.noCache) {
341
+ return {
342
+ type: "normalCode",
343
+ data: searchResults
344
+ };
345
+ }
346
+ if (searchResults.length > 0) {
347
+ const existingCodes = new Set(
348
+ this.searchResults.map((item) => item.code)
349
+ );
350
+ const newResults = searchResults.filter(
351
+ (item) => !existingCodes.has(item.code)
352
+ );
353
+ this.searchResults.push(...newResults);
354
+ }
355
+ this.emitEvent(import_types.WalletPassHooks.OnSearchIdentificationCodeCompleted, {
356
+ searchCode: params.code,
357
+ currentSearchResults: searchResults,
358
+ cachedSearchResults: [...this.searchResults],
359
+ searchParams: params
360
+ });
361
+ this.paymentModule.logInfo("[WalletPass] 普通识别码搜索完成", {
362
+ code: params.code,
363
+ results_count: searchResults.length,
364
+ cached_results_count: this.searchResults.length,
365
+ type: "normalCode"
366
+ });
367
+ return {
368
+ type: "normalCode",
369
+ data: searchResults
370
+ };
371
+ } catch (error) {
372
+ this.paymentModule.logError("[WalletPass] 搜索识别码信息失败", error, {
373
+ code: params.code,
374
+ customer_id: params.customer_id,
375
+ order_expect_amount: params.order_expect_amount
376
+ });
377
+ throw error;
378
+ }
379
+ }
380
+ async processWalletPayment(amount, orderUuid, voucherId) {
381
+ this.paymentModule.logInfo("[WalletPass] 开始处理钱包支付", {
382
+ amount,
383
+ orderUuid,
384
+ voucherId: voucherId || "none"
385
+ });
386
+ const walletMethod = await this.paymentModule.getWalletPaymentMethod();
387
+ if (!walletMethod) {
388
+ this.paymentModule.logError("[WalletPass] 钱包支付方式未找到", null, {
389
+ amount,
390
+ orderUuid,
391
+ voucherId
392
+ });
393
+ throw new Error("钱包支付方式未找到");
394
+ }
395
+ const paymentItem = {
396
+ amount: amount.toString(),
397
+ code: walletMethod.code,
398
+ id: walletMethod.id,
399
+ name: walletMethod.name,
400
+ type: walletMethod.type,
401
+ voucher_id: voucherId || ""
402
+ };
403
+ await this.paymentModule.addPaymentItemAsync(orderUuid, paymentItem);
404
+ this.paymentModule.logInfo("[WalletPass] 钱包支付处理完成", {
405
+ amount,
406
+ orderUuid,
407
+ voucherId: voucherId || "none",
408
+ payment_method: walletMethod.name
409
+ });
410
+ }
411
+ async getWalletBalance(voucherId) {
412
+ return 0;
413
+ }
414
+ /**
415
+ * 获取缓存的钱包推荐列表
416
+ */
417
+ getWalletRecommendList() {
418
+ return this.walletRecommendList;
419
+ }
420
+ /**
421
+ * 获取缓存的用户识别码列表
422
+ */
423
+ getUserIdentificationCodes() {
424
+ return this.userIdentificationCodes;
425
+ }
426
+ /**
427
+ * 清除钱包推荐列表
428
+ */
429
+ clearWalletRecommendList() {
430
+ this.walletRecommendList = [];
431
+ this.emitEvent(import_types.WalletPassHooks.OnWalletRecommendListCleared, {
432
+ clearedTypes: ["walletRecommendList"]
433
+ });
434
+ this.paymentModule.logInfo("[WalletPass] 钱包推荐列表已清除");
435
+ }
436
+ /**
437
+ * 清除用户识别码列表
438
+ */
439
+ clearUserIdentificationCodes() {
440
+ this.userIdentificationCodes = [];
441
+ this.emitEvent(import_types.WalletPassHooks.OnUserIdentificationCodesCleared, {
442
+ clearedTypes: ["userIdentificationCodes"]
443
+ });
444
+ this.paymentModule.logInfo("[WalletPass] 用户识别码列表已清除");
445
+ }
446
+ /**
447
+ * 获取缓存的搜索结果列表
448
+ */
449
+ getSearchResults() {
450
+ return this.searchResults;
451
+ }
452
+ /**
453
+ * 根据识别码查找搜索结果
454
+ */
455
+ findSearchResultByCode(code) {
456
+ return this.searchResults.find((item) => item.code === code);
457
+ }
458
+ /**
459
+ * 清除搜索结果缓存
460
+ */
461
+ clearSearchResults() {
462
+ this.searchResults = [];
463
+ this.paymentModule.logInfo("[WalletPass] 搜索结果缓存已清除");
464
+ }
465
+ /**
466
+ * 清除所有缓存数据
467
+ */
468
+ clearAllCache() {
469
+ this.walletRecommendList = [];
470
+ this.userIdentificationCodes = [];
471
+ this.searchResults = [];
472
+ this.walletParams = null;
473
+ this.emitEvent(import_types.WalletPassHooks.OnWalletCacheCleared, {
474
+ clearedTypes: ["all"]
475
+ });
476
+ this.paymentModule.logInfo("[WalletPass] 所有缓存数据已清除", {
477
+ cleared_types: ["walletRecommendList", "userIdentificationCodes", "searchResults", "walletParams"]
478
+ });
479
+ }
480
+ };
481
+ // Annotate the CommonJS export names for ESM import in node:
482
+ 0 && (module.exports = {
483
+ WalletPassPaymentImpl
484
+ });
@@ -11,12 +11,17 @@ export declare class ProductList extends BaseModule implements Module {
11
11
  constructor(name?: string, version?: string);
12
12
  initialize(core: PisellCore, options: any): Promise<void>;
13
13
  storeChange(path?: string, value?: any): Promise<void>;
14
- loadProducts({ category_ids, product_ids, collection, schedule_date, cacheId }: {
14
+ loadProducts({ category_ids, product_ids, collection, menu_list_ids, customer_id: paramsCustomerId, with_count, schedule_datetime, schedule_date, cacheId, with_schedule, }: {
15
15
  category_ids?: number[];
16
16
  product_ids?: number[];
17
17
  collection?: number | string[];
18
18
  schedule_date?: string;
19
19
  cacheId?: string;
20
+ customer_id?: number;
21
+ menu_list_ids?: number[];
22
+ schedule_datetime?: string;
23
+ with_count?: string[];
24
+ with_schedule?: number;
20
25
  }): Promise<any>;
21
26
  loadProductsPrice({ ids, customer_id, schedule_date, channel, }: {
22
27
  ids?: number[];
@@ -28,4 +33,10 @@ export declare class ProductList extends BaseModule implements Module {
28
33
  getProduct(id: number): Promise<ProductData | undefined>;
29
34
  addProduct(products: ProductData[]): Promise<void>;
30
35
  selectProducts(products: ProductData[]): Promise<void>;
36
+ /**
37
+ * 根据商品编码或条码搜索商品
38
+ * @param code 商品编码或条码
39
+ * @returns 匹配的商品列表,如果没有匹配则返回空数组
40
+ */
41
+ findProductsByCodeOrBarcode(code: string): ProductData[];
31
42
  }
@@ -24,7 +24,6 @@ __export(ProductList_exports, {
24
24
  });
25
25
  module.exports = __toCommonJS(ProductList_exports);
26
26
  var import_BaseModule = require("../BaseModule");
27
- var import_types = require("./types");
28
27
  var import_lodash_es = require("lodash-es");
29
28
  __reExport(ProductList_exports, require("./types"), module.exports);
30
29
  var ProductList = class extends import_BaseModule.BaseModule {
@@ -54,14 +53,19 @@ var ProductList = class extends import_BaseModule.BaseModule {
54
53
  category_ids = [],
55
54
  product_ids = [],
56
55
  collection = [],
56
+ menu_list_ids = [],
57
+ customer_id: paramsCustomerId,
58
+ with_count = [],
59
+ schedule_datetime,
57
60
  schedule_date,
58
- cacheId
61
+ cacheId,
62
+ with_schedule
59
63
  }) {
60
64
  var _a, _b;
61
65
  let userPlugin = this.core.getPlugin("user");
62
66
  let customer_id = void 0;
63
67
  try {
64
- customer_id = (_a = userPlugin == null ? void 0 : userPlugin.get()) == null ? void 0 : _a.id;
68
+ customer_id = paramsCustomerId || ((_a = userPlugin == null ? void 0 : userPlugin.get()) == null ? void 0 : _a.id);
65
69
  } catch (error) {
66
70
  console.error(error);
67
71
  }
@@ -87,21 +91,18 @@ var ProductList = class extends import_BaseModule.BaseModule {
87
91
  ids: product_ids,
88
92
  collection,
89
93
  front_end_cache_id: cacheId,
94
+ menu_list_ids,
95
+ with_count,
90
96
  // client_schedule_ids: schedule_ids,
91
97
  schedule_date,
92
98
  application_code: (_b = this.otherParams) == null ? void 0 : _b.channel,
99
+ with_schedule,
100
+ schedule_datetime,
93
101
  is_eject: 1
94
102
  },
95
103
  { useCache: true }
96
104
  );
97
105
  const sortedList = (productsData.data.list || []).slice().sort((a, b) => Number(b.sort) - Number(a.sort));
98
- if (sortedList.length) {
99
- sortedList.forEach((n) => {
100
- if (n.is_eject !== 1 && n["schedule.ids"] && n["schedule.ids"].length) {
101
- n.is_eject = 1;
102
- }
103
- });
104
- }
105
106
  this.addProduct(sortedList);
106
107
  return sortedList;
107
108
  }
@@ -125,14 +126,14 @@ var ProductList = class extends import_BaseModule.BaseModule {
125
126
  }
126
127
  async getProducts() {
127
128
  await this.core.effects.emit(
128
- import_types.ProductListHooks.onGetProducts,
129
+ `${this.name}:onGetProducts`,
129
130
  this.store.list
130
131
  );
131
132
  return (0, import_lodash_es.cloneDeep)(this.store.list);
132
133
  }
133
134
  async getProduct(id) {
134
135
  await this.core.effects.emit(
135
- import_types.ProductListHooks.onGetProduct,
136
+ `${this.name}:onGetProduct`,
136
137
  this.store.list
137
138
  );
138
139
  const product = this.store.list.find((product2) => product2.id === id);
@@ -156,6 +157,24 @@ var ProductList = class extends import_BaseModule.BaseModule {
156
157
  async selectProducts(products) {
157
158
  this.store.selectProducts = products;
158
159
  }
160
+ /**
161
+ * 根据商品编码或条码搜索商品
162
+ * @param code 商品编码或条码
163
+ * @returns 匹配的商品列表,如果没有匹配则返回空数组
164
+ */
165
+ findProductsByCodeOrBarcode(code) {
166
+ if (!code || typeof code !== "string") {
167
+ return [];
168
+ }
169
+ const trimmedCode = code.trim();
170
+ if (!trimmedCode) {
171
+ return [];
172
+ }
173
+ const matchingProducts = this.store.list.filter((product) => {
174
+ return product.code && product.code.trim() === trimmedCode || product.barcode && product.barcode.trim() === trimmedCode;
175
+ });
176
+ return (0, import_lodash_es.cloneDeep)(matchingProducts);
177
+ }
159
178
  };
160
179
  // Annotate the CommonJS export names for ESM import in node:
161
180
  0 && (module.exports = {
@@ -42,7 +42,7 @@ var ResourceListModule = class extends import_BaseModule.BaseModule {
42
42
  if (!resource)
43
43
  return;
44
44
  this.store.selectedResource = resource;
45
- await this.core.effects.emit(import_types.ResourceHooks.OnResourceSelect, resource);
45
+ await this.core.effects.emit(`${this.name}:onResourceSelect`, resource);
46
46
  }
47
47
  getSelectedResource() {
48
48
  return this.store.selectedResource;
@@ -2,6 +2,7 @@ import { Module, PisellCore, ModuleOptions } from '../../types';
2
2
  import { BaseModule } from '../BaseModule';
3
3
  import { Rules, RulesModuleAPI, DiscountResult } from './types';
4
4
  import { Discount } from "../Discount/types";
5
+ import { SetDiscountSelectedParams } from '../../solution/ShopDiscount/types';
5
6
  export declare class RulesModule extends BaseModule implements Module, RulesModuleAPI {
6
7
  protected defaultName: string;
7
8
  protected defaultVersion: string;
@@ -35,7 +36,7 @@ export declare class RulesModule extends BaseModule implements Module, RulesModu
35
36
  }, options?: {
36
37
  isSelected?: boolean;
37
38
  discountId?: number;
38
- selectedList?: any[];
39
+ selectedList?: SetDiscountSelectedParams[];
39
40
  scan?: boolean;
40
41
  }): DiscountResult;
41
42
  /**