@pisell/pisellos 2.1.4 → 2.1.6

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 (287) hide show
  1. package/dist/core/index.js +2 -1
  2. package/dist/effects/index.d.ts +4 -3
  3. package/dist/effects/index.js +15 -6
  4. package/dist/modules/AccountList/index.d.ts +7 -1
  5. package/dist/modules/AccountList/index.js +81 -14
  6. package/dist/modules/AccountList/types.d.ts +28 -0
  7. package/dist/modules/AccountList/types.js +8 -0
  8. package/dist/modules/Cart/index.js +1 -1
  9. package/dist/modules/Customer/constants.d.ts +7 -0
  10. package/dist/modules/Customer/constants.js +12 -0
  11. package/dist/modules/Customer/index.d.ts +122 -0
  12. package/dist/modules/Customer/index.js +697 -0
  13. package/dist/modules/Customer/types.d.ts +146 -0
  14. package/dist/modules/Customer/types.js +41 -0
  15. package/dist/modules/Discount/index.d.ts +1 -0
  16. package/dist/modules/Order/index.d.ts +25 -1
  17. package/dist/modules/Order/index.js +224 -2
  18. package/dist/modules/Order/types.d.ts +45 -0
  19. package/dist/modules/Order/types.js +8 -0
  20. package/dist/modules/Payment/cash.d.ts +19 -0
  21. package/dist/modules/Payment/cash.js +97 -0
  22. package/dist/modules/Payment/cashRecommendationAlgorithm.d.ts +22 -0
  23. package/dist/modules/Payment/cashRecommendationAlgorithm.js +423 -0
  24. package/dist/modules/Payment/eftpos.d.ts +11 -0
  25. package/dist/modules/Payment/eftpos.js +80 -0
  26. package/dist/modules/Payment/index.d.ts +184 -9
  27. package/dist/modules/Payment/index.js +2012 -108
  28. package/dist/modules/Payment/mx51.d.ts +0 -0
  29. package/dist/modules/Payment/mx51.js +0 -0
  30. package/dist/modules/Payment/types.d.ts +750 -30
  31. package/dist/modules/Payment/types.js +236 -12
  32. package/dist/modules/Payment/utils.d.ts +17 -0
  33. package/dist/modules/Payment/utils.js +62 -0
  34. package/dist/modules/Payment/walletpass.d.ts +99 -0
  35. package/dist/modules/Payment/walletpass.js +701 -0
  36. package/dist/modules/Product/index.d.ts +1 -1
  37. package/dist/modules/ProductList/index.d.ts +12 -1
  38. package/dist/modules/ProductList/index.js +27 -3
  39. package/dist/modules/Rules/index.d.ts +2 -0
  40. package/dist/modules/Rules/index.js +39 -17
  41. package/dist/modules/Rules/types.d.ts +1 -0
  42. package/dist/modules/Schedule/index.d.ts +9 -0
  43. package/dist/modules/Schedule/index.js +77 -0
  44. package/dist/modules/index.d.ts +1 -0
  45. package/dist/modules/index.js +1 -0
  46. package/dist/plugins/app-types/app/app.d.ts +83 -0
  47. package/dist/plugins/app-types/app/const.d.ts +4 -0
  48. package/dist/plugins/app-types/app/index.d.ts +14 -0
  49. package/dist/plugins/app-types/applicationManager/application.d.ts +50 -0
  50. package/dist/plugins/app-types/applicationManager/index.d.ts +13 -0
  51. package/dist/plugins/app-types/config.d.ts +3 -0
  52. package/dist/plugins/app-types/cookie/index.d.ts +13 -0
  53. package/dist/plugins/app-types/data/index.d.ts +8 -0
  54. package/dist/plugins/app-types/history/config.d.ts +24 -0
  55. package/dist/plugins/app-types/history/index.d.ts +20 -0
  56. package/dist/plugins/app-types/history/type.d.ts +2 -0
  57. package/dist/plugins/app-types/hooks/index.d.ts +12 -0
  58. package/dist/plugins/app-types/hooks/useDelayedValue/index.d.ts +2 -0
  59. package/dist/plugins/app-types/hooks/useDispatch/index.d.ts +2 -0
  60. package/dist/plugins/app-types/hooks/useLowCode/index.d.ts +13 -0
  61. package/dist/plugins/app-types/hooks/useStore/index.d.ts +6 -0
  62. package/dist/plugins/app-types/index.d.ts +6 -0
  63. package/dist/plugins/app-types/indexDB/index.d.ts +178 -0
  64. package/dist/plugins/app-types/locales/en.d.ts +3 -0
  65. package/dist/plugins/app-types/locales/index.d.ts +37 -0
  66. package/dist/plugins/app-types/locales/original.d.ts +3 -0
  67. package/dist/plugins/app-types/locales/type.d.ts +19 -0
  68. package/dist/plugins/app-types/locales/zh-CN.d.ts +3 -0
  69. package/dist/plugins/app-types/locales/zh-HK.d.ts +3 -0
  70. package/dist/plugins/app-types/logger/feishu.d.ts +11 -0
  71. package/dist/plugins/app-types/logger/index.d.ts +122 -0
  72. package/dist/plugins/app-types/menuManager/hooks.d.ts +17 -0
  73. package/dist/plugins/app-types/menuManager/index.d.ts +28 -0
  74. package/dist/plugins/app-types/models/global.d.ts +32 -0
  75. package/dist/plugins/app-types/models/index.d.ts +45 -0
  76. package/dist/plugins/app-types/models/type.d.ts +2 -0
  77. package/dist/plugins/app-types/package.json +15 -0
  78. package/dist/plugins/app-types/plugin/index.d.ts +0 -0
  79. package/dist/plugins/app-types/pubsub/example.d.ts +5 -0
  80. package/dist/plugins/app-types/pubsub/index.d.ts +63 -0
  81. package/dist/plugins/app-types/request/cache.d.ts +46 -0
  82. package/dist/plugins/app-types/request/cancelToken.d.ts +38 -0
  83. package/dist/plugins/app-types/request/config.d.ts +3 -0
  84. package/dist/plugins/app-types/request/constants.d.ts +2 -0
  85. package/dist/plugins/app-types/request/index.d.ts +24 -0
  86. package/dist/plugins/app-types/request/pisell2Request.d.ts +6 -0
  87. package/dist/plugins/app-types/request/type.d.ts +41 -0
  88. package/dist/plugins/app-types/request/utils.d.ts +46 -0
  89. package/dist/plugins/app-types/routes/config.d.ts +7 -0
  90. package/dist/plugins/app-types/routes/index.d.ts +28 -0
  91. package/dist/plugins/app-types/socket/components/SocketMonitorPage.d.ts +6 -0
  92. package/dist/plugins/app-types/socket/components/index.d.ts +2 -0
  93. package/dist/plugins/app-types/socket/constants.d.ts +33 -0
  94. package/dist/plugins/app-types/socket/events.d.ts +31 -0
  95. package/dist/plugins/app-types/socket/heartbeat.d.ts +66 -0
  96. package/dist/plugins/app-types/socket/index.d.ts +61 -0
  97. package/dist/plugins/app-types/socket/monitor.d.ts +169 -0
  98. package/dist/plugins/app-types/socket/reconnect.d.ts +61 -0
  99. package/dist/plugins/app-types/socket/socket.d.ts +129 -0
  100. package/dist/plugins/app-types/socket/types.d.ts +85 -0
  101. package/dist/plugins/app-types/storage/index.d.ts +17 -0
  102. package/dist/plugins/app-types/tasks/index.d.ts +77 -0
  103. package/dist/plugins/app-types/tasks/type.d.ts +62 -0
  104. package/dist/plugins/app-types/tasks/useTasks.d.ts +5 -0
  105. package/dist/plugins/app-types/type.d.ts +2 -0
  106. package/dist/plugins/app-types/variables/VariablesProvider.d.ts +7 -0
  107. package/dist/plugins/app-types/variables/config.d.ts +3 -0
  108. package/dist/plugins/app-types/variables/index.d.ts +6 -0
  109. package/dist/plugins/app-types/variables/type.d.ts +2 -0
  110. package/dist/plugins/app-types/website/index.d.ts +6 -0
  111. package/dist/plugins/app.d.ts +8 -0
  112. package/dist/plugins/app.js +1 -0
  113. package/dist/plugins/window.d.ts +1 -0
  114. package/dist/solution/BookingByStep/index.d.ts +1 -1
  115. package/dist/solution/BookingByStep/index.js +1 -1
  116. package/dist/solution/BookingTicket/index.d.ts +180 -0
  117. package/dist/solution/BookingTicket/index.js +689 -0
  118. package/dist/solution/BookingTicket/types.d.ts +68 -0
  119. package/dist/solution/BookingTicket/types.js +43 -0
  120. package/dist/solution/BookingTicket/utils/scan/cloudSearch.d.ts +22 -0
  121. package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +159 -0
  122. package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +22 -0
  123. package/dist/solution/BookingTicket/utils/scan/handleScan.js +189 -0
  124. package/dist/solution/BookingTicket/utils/scan/index.d.ts +81 -0
  125. package/dist/solution/BookingTicket/utils/scan/index.js +285 -0
  126. package/dist/solution/BookingTicket/utils/scan/scanCache.d.ts +78 -0
  127. package/dist/solution/BookingTicket/utils/scan/scanCache.js +305 -0
  128. package/dist/solution/Checkout/appointmentDemo.json +1 -0
  129. package/dist/solution/Checkout/index.d.ts +509 -0
  130. package/dist/solution/Checkout/index.js +4874 -0
  131. package/dist/solution/Checkout/types.d.ts +923 -0
  132. package/dist/solution/Checkout/types.js +148 -0
  133. package/dist/solution/Checkout/utils/index.d.ts +117 -0
  134. package/dist/solution/Checkout/utils/index.js +549 -0
  135. package/dist/solution/ShopDiscount/index.d.ts +4 -9
  136. package/dist/solution/ShopDiscount/index.js +106 -54
  137. package/dist/solution/ShopDiscount/types.d.ts +10 -1
  138. package/dist/solution/index.d.ts +2 -0
  139. package/dist/solution/index.js +3 -1
  140. package/dist/types/index.d.ts +3 -1
  141. package/dist/utils/task.d.ts +40 -0
  142. package/dist/utils/task.js +171 -0
  143. package/dist/utils/watch.d.ts +102 -0
  144. package/dist/utils/watch.js +294 -0
  145. package/lib/core/index.js +1 -1
  146. package/lib/effects/index.d.ts +4 -3
  147. package/lib/effects/index.js +4 -1
  148. package/lib/modules/AccountList/index.d.ts +7 -1
  149. package/lib/modules/AccountList/index.js +27 -0
  150. package/lib/modules/AccountList/types.d.ts +28 -0
  151. package/lib/modules/Cart/index.js +1 -1
  152. package/lib/modules/Customer/constants.d.ts +7 -0
  153. package/lib/modules/Customer/constants.js +39 -0
  154. package/lib/modules/Customer/index.d.ts +122 -0
  155. package/lib/modules/Customer/index.js +440 -0
  156. package/lib/modules/Customer/types.d.ts +146 -0
  157. package/lib/modules/Customer/types.js +37 -0
  158. package/lib/modules/Discount/index.d.ts +1 -0
  159. package/lib/modules/Order/index.d.ts +25 -1
  160. package/lib/modules/Order/index.js +182 -0
  161. package/lib/modules/Order/types.d.ts +45 -0
  162. package/lib/modules/Payment/cash.d.ts +19 -0
  163. package/lib/modules/Payment/cash.js +64 -0
  164. package/lib/modules/Payment/cashRecommendationAlgorithm.d.ts +22 -0
  165. package/lib/modules/Payment/cashRecommendationAlgorithm.js +342 -0
  166. package/lib/modules/Payment/eftpos.d.ts +11 -0
  167. package/lib/modules/Payment/eftpos.js +51 -0
  168. package/lib/modules/Payment/index.d.ts +184 -9
  169. package/lib/modules/Payment/index.js +1044 -50
  170. package/lib/modules/Payment/mx51.d.ts +0 -0
  171. package/lib/modules/Payment/mx51.js +0 -0
  172. package/lib/modules/Payment/types.d.ts +750 -30
  173. package/lib/modules/Payment/types.js +79 -6
  174. package/lib/modules/Payment/utils.d.ts +17 -0
  175. package/lib/modules/Payment/utils.js +67 -0
  176. package/lib/modules/Payment/walletpass.d.ts +99 -0
  177. package/lib/modules/Payment/walletpass.js +468 -0
  178. package/lib/modules/Product/index.d.ts +1 -1
  179. package/lib/modules/ProductList/index.d.ts +12 -1
  180. package/lib/modules/ProductList/index.js +29 -2
  181. package/lib/modules/Rules/index.d.ts +2 -0
  182. package/lib/modules/Rules/index.js +32 -15
  183. package/lib/modules/Rules/types.d.ts +1 -0
  184. package/lib/modules/Schedule/index.d.ts +9 -0
  185. package/lib/modules/Schedule/index.js +60 -0
  186. package/lib/modules/index.d.ts +1 -0
  187. package/lib/modules/index.js +2 -0
  188. package/lib/plugins/app-types/app/app.d.ts +83 -0
  189. package/lib/plugins/app-types/app/const.d.ts +4 -0
  190. package/lib/plugins/app-types/app/index.d.ts +14 -0
  191. package/lib/plugins/app-types/applicationManager/application.d.ts +50 -0
  192. package/lib/plugins/app-types/applicationManager/index.d.ts +13 -0
  193. package/lib/plugins/app-types/config.d.ts +3 -0
  194. package/lib/plugins/app-types/cookie/index.d.ts +13 -0
  195. package/lib/plugins/app-types/data/index.d.ts +8 -0
  196. package/lib/plugins/app-types/history/config.d.ts +24 -0
  197. package/lib/plugins/app-types/history/index.d.ts +20 -0
  198. package/lib/plugins/app-types/history/type.d.ts +2 -0
  199. package/lib/plugins/app-types/hooks/index.d.ts +12 -0
  200. package/lib/plugins/app-types/hooks/useDelayedValue/index.d.ts +2 -0
  201. package/lib/plugins/app-types/hooks/useDispatch/index.d.ts +2 -0
  202. package/lib/plugins/app-types/hooks/useLowCode/index.d.ts +13 -0
  203. package/lib/plugins/app-types/hooks/useStore/index.d.ts +6 -0
  204. package/lib/plugins/app-types/index.d.ts +6 -0
  205. package/lib/plugins/app-types/indexDB/index.d.ts +178 -0
  206. package/lib/plugins/app-types/locales/en.d.ts +3 -0
  207. package/lib/plugins/app-types/locales/index.d.ts +37 -0
  208. package/lib/plugins/app-types/locales/original.d.ts +3 -0
  209. package/lib/plugins/app-types/locales/type.d.ts +19 -0
  210. package/lib/plugins/app-types/locales/zh-CN.d.ts +3 -0
  211. package/lib/plugins/app-types/locales/zh-HK.d.ts +3 -0
  212. package/lib/plugins/app-types/logger/feishu.d.ts +11 -0
  213. package/lib/plugins/app-types/logger/index.d.ts +122 -0
  214. package/lib/plugins/app-types/menuManager/hooks.d.ts +17 -0
  215. package/lib/plugins/app-types/menuManager/index.d.ts +28 -0
  216. package/lib/plugins/app-types/models/global.d.ts +32 -0
  217. package/lib/plugins/app-types/models/index.d.ts +45 -0
  218. package/lib/plugins/app-types/models/type.d.ts +2 -0
  219. package/lib/plugins/app-types/package.json +15 -0
  220. package/lib/plugins/app-types/plugin/index.d.ts +0 -0
  221. package/lib/plugins/app-types/pubsub/example.d.ts +5 -0
  222. package/lib/plugins/app-types/pubsub/index.d.ts +63 -0
  223. package/lib/plugins/app-types/request/cache.d.ts +46 -0
  224. package/lib/plugins/app-types/request/cancelToken.d.ts +38 -0
  225. package/lib/plugins/app-types/request/config.d.ts +3 -0
  226. package/lib/plugins/app-types/request/constants.d.ts +2 -0
  227. package/lib/plugins/app-types/request/index.d.ts +24 -0
  228. package/lib/plugins/app-types/request/pisell2Request.d.ts +6 -0
  229. package/lib/plugins/app-types/request/type.d.ts +41 -0
  230. package/lib/plugins/app-types/request/utils.d.ts +46 -0
  231. package/lib/plugins/app-types/routes/config.d.ts +7 -0
  232. package/lib/plugins/app-types/routes/index.d.ts +28 -0
  233. package/lib/plugins/app-types/socket/components/SocketMonitorPage.d.ts +6 -0
  234. package/lib/plugins/app-types/socket/components/index.d.ts +2 -0
  235. package/lib/plugins/app-types/socket/constants.d.ts +33 -0
  236. package/lib/plugins/app-types/socket/events.d.ts +31 -0
  237. package/lib/plugins/app-types/socket/heartbeat.d.ts +66 -0
  238. package/lib/plugins/app-types/socket/index.d.ts +61 -0
  239. package/lib/plugins/app-types/socket/monitor.d.ts +169 -0
  240. package/lib/plugins/app-types/socket/reconnect.d.ts +61 -0
  241. package/lib/plugins/app-types/socket/socket.d.ts +129 -0
  242. package/lib/plugins/app-types/socket/types.d.ts +85 -0
  243. package/lib/plugins/app-types/storage/index.d.ts +17 -0
  244. package/lib/plugins/app-types/tasks/index.d.ts +77 -0
  245. package/lib/plugins/app-types/tasks/type.d.ts +62 -0
  246. package/lib/plugins/app-types/tasks/useTasks.d.ts +5 -0
  247. package/lib/plugins/app-types/type.d.ts +2 -0
  248. package/lib/plugins/app-types/variables/VariablesProvider.d.ts +7 -0
  249. package/lib/plugins/app-types/variables/config.d.ts +3 -0
  250. package/lib/plugins/app-types/variables/index.d.ts +6 -0
  251. package/lib/plugins/app-types/variables/type.d.ts +2 -0
  252. package/lib/plugins/app-types/website/index.d.ts +6 -0
  253. package/lib/plugins/app.d.ts +8 -0
  254. package/lib/plugins/app.js +17 -0
  255. package/lib/plugins/window.d.ts +1 -0
  256. package/lib/solution/BookingByStep/index.d.ts +1 -1
  257. package/lib/solution/BookingByStep/index.js +1 -2
  258. package/lib/solution/BookingTicket/index.d.ts +180 -0
  259. package/lib/solution/BookingTicket/index.js +420 -0
  260. package/lib/solution/BookingTicket/types.d.ts +68 -0
  261. package/lib/solution/BookingTicket/types.js +72 -0
  262. package/lib/solution/BookingTicket/utils/scan/cloudSearch.d.ts +22 -0
  263. package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +117 -0
  264. package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +22 -0
  265. package/lib/solution/BookingTicket/utils/scan/handleScan.js +132 -0
  266. package/lib/solution/BookingTicket/utils/scan/index.d.ts +81 -0
  267. package/lib/solution/BookingTicket/utils/scan/index.js +210 -0
  268. package/lib/solution/BookingTicket/utils/scan/scanCache.d.ts +78 -0
  269. package/lib/solution/BookingTicket/utils/scan/scanCache.js +231 -0
  270. package/lib/solution/Checkout/appointmentDemo.json +1 -0
  271. package/lib/solution/Checkout/index.d.ts +509 -0
  272. package/lib/solution/Checkout/index.js +3002 -0
  273. package/lib/solution/Checkout/types.d.ts +923 -0
  274. package/lib/solution/Checkout/types.js +87 -0
  275. package/lib/solution/Checkout/utils/index.d.ts +117 -0
  276. package/lib/solution/Checkout/utils/index.js +403 -0
  277. package/lib/solution/ShopDiscount/index.d.ts +4 -9
  278. package/lib/solution/ShopDiscount/index.js +41 -13
  279. package/lib/solution/ShopDiscount/types.d.ts +10 -1
  280. package/lib/solution/index.d.ts +2 -0
  281. package/lib/solution/index.js +5 -1
  282. package/lib/types/index.d.ts +3 -1
  283. package/lib/utils/task.d.ts +40 -0
  284. package/lib/utils/task.js +109 -0
  285. package/lib/utils/watch.d.ts +102 -0
  286. package/lib/utils/watch.js +217 -0
  287. package/package.json +4 -2
@@ -19,17 +19,90 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
19
19
  // src/modules/Payment/types.ts
20
20
  var types_exports = {};
21
21
  __export(types_exports, {
22
- PaymentHooks: () => PaymentHooks
22
+ PaymentHooks: () => PaymentHooks,
23
+ PaymentMethodType: () => PaymentMethodType,
24
+ PaymentStatus: () => PaymentStatus,
25
+ RoundingInterval: () => RoundingInterval,
26
+ RoundingRule: () => RoundingRule,
27
+ TaskRunStatus: () => TaskRunStatus,
28
+ WalletPassHooks: () => WalletPassHooks
23
29
  });
24
30
  module.exports = __toCommonJS(types_exports);
31
+ var PaymentMethodType = /* @__PURE__ */ ((PaymentMethodType2) => {
32
+ PaymentMethodType2["Cash"] = "CASHMANUAL";
33
+ PaymentMethodType2["Eftpos"] = "EFTPOS";
34
+ PaymentMethodType2["Wallet"] = "WALLET";
35
+ return PaymentMethodType2;
36
+ })(PaymentMethodType || {});
37
+ var PaymentStatus = /* @__PURE__ */ ((PaymentStatus2) => {
38
+ PaymentStatus2["Processing"] = "payment_processing";
39
+ PaymentStatus2["Sync"] = "sync";
40
+ PaymentStatus2["PartiallyPaid"] = "partially_paid";
41
+ PaymentStatus2["Finished"] = "finish";
42
+ return PaymentStatus2;
43
+ })(PaymentStatus || {});
44
+ var TaskRunStatus = /* @__PURE__ */ ((TaskRunStatus2) => {
45
+ TaskRunStatus2["Pending"] = "pending";
46
+ TaskRunStatus2["Running"] = "running";
47
+ TaskRunStatus2["Success"] = "success";
48
+ TaskRunStatus2["Failed"] = "failed";
49
+ return TaskRunStatus2;
50
+ })(TaskRunStatus || {});
51
+ var RoundingRule = /* @__PURE__ */ ((RoundingRule2) => {
52
+ RoundingRule2["Standard"] = "standard_rounding";
53
+ RoundingRule2["StandardDown"] = "standard_down";
54
+ RoundingRule2["AlwaysUp"] = "always_up";
55
+ RoundingRule2["AlwaysDown"] = "always_down";
56
+ return RoundingRule2;
57
+ })(RoundingRule || {});
58
+ var RoundingInterval = /* @__PURE__ */ ((RoundingInterval2) => {
59
+ RoundingInterval2[RoundingInterval2["Interval005"] = 0.05] = "Interval005";
60
+ RoundingInterval2[RoundingInterval2["Interval01"] = 0.1] = "Interval01";
61
+ RoundingInterval2[RoundingInterval2["Interval05"] = 0.5] = "Interval05";
62
+ RoundingInterval2[RoundingInterval2["Interval1"] = 1] = "Interval1";
63
+ return RoundingInterval2;
64
+ })(RoundingInterval || {});
65
+ var WalletPassHooks = /* @__PURE__ */ ((WalletPassHooks2) => {
66
+ WalletPassHooks2["OnWalletRecommendListUpdated"] = "wallet:onWalletRecommendListUpdated";
67
+ WalletPassHooks2["OnWalletRecommendListCleared"] = "wallet:onWalletRecommendListCleared";
68
+ WalletPassHooks2["OnUserIdentificationCodesUpdated"] = "wallet:onUserIdentificationCodesUpdated";
69
+ WalletPassHooks2["OnUserIdentificationCodesCleared"] = "wallet:onUserIdentificationCodesCleared";
70
+ WalletPassHooks2["OnWalletCacheCleared"] = "wallet:onWalletCacheCleared";
71
+ WalletPassHooks2["OnSearchIdentificationCodeCompleted"] = "wallet:onSearchIdentificationCodeCompleted";
72
+ WalletPassHooks2["OnWalletInitializationStarted"] = "wallet:onWalletInitializationStarted";
73
+ WalletPassHooks2["OnWalletInitializationCompleted"] = "wallet:onWalletInitializationCompleted";
74
+ WalletPassHooks2["OnWalletInitializationFailed"] = "wallet:onWalletInitializationFailed";
75
+ return WalletPassHooks2;
76
+ })(WalletPassHooks || {});
25
77
  var PaymentHooks = /* @__PURE__ */ ((PaymentHooks2) => {
26
- PaymentHooks2["OnPaymentInit"] = "payment:onPaymentInit";
27
- PaymentHooks2["OnPaymentSuccess"] = "payment:onPaymentSuccess";
28
- PaymentHooks2["OnPaymentFailure"] = "payment:onPaymentFailure";
29
- PaymentHooks2["OnPaymentRefund"] = "payment:onPaymentRefund";
78
+ PaymentHooks2["OnPaymentMethodsLoaded"] = "payment:onPaymentMethodsLoaded";
79
+ PaymentHooks2["OnPaymentMethodsChanged"] = "payment:onPaymentMethodsChanged";
80
+ PaymentHooks2["OnOrderChanged"] = "payment:onOrderChanged";
81
+ PaymentHooks2["OnOrderAdded"] = "payment:onOrderAdded";
82
+ PaymentHooks2["OnOrderUpdated"] = "payment:onOrderUpdated";
83
+ PaymentHooks2["OnOrderDeleted"] = "payment:onOrderDeleted";
84
+ PaymentHooks2["OnPaymentAdded"] = "payment:onPaymentAdded";
85
+ PaymentHooks2["OnPaymentUpdated"] = "payment:onPaymentUpdated";
86
+ PaymentHooks2["OnPaymentDeleted"] = "payment:onPaymentDeleted";
87
+ PaymentHooks2["OnPaymentSubmitted"] = "payment:onPaymentSubmitted";
88
+ PaymentHooks2["OnOrderAmountChanged"] = "payment:onOrderAmountChanged";
89
+ PaymentHooks2["OnPaymentSyncError"] = "payment:onPaymentSyncError";
90
+ PaymentHooks2["OnPaymentSyncSuccess"] = "payment:onPaymentSyncSuccess";
91
+ PaymentHooks2["OnWalletRecommendListUpdated"] = "wallet:onWalletRecommendListUpdated" /* OnWalletRecommendListUpdated */;
92
+ PaymentHooks2["OnWalletRecommendListCleared"] = "wallet:onWalletRecommendListCleared" /* OnWalletRecommendListCleared */;
93
+ PaymentHooks2["OnUserIdentificationCodesUpdated"] = "wallet:onUserIdentificationCodesUpdated" /* OnUserIdentificationCodesUpdated */;
94
+ PaymentHooks2["OnUserIdentificationCodesCleared"] = "wallet:onUserIdentificationCodesCleared" /* OnUserIdentificationCodesCleared */;
95
+ PaymentHooks2["OnWalletCacheCleared"] = "wallet:onWalletCacheCleared" /* OnWalletCacheCleared */;
96
+ PaymentHooks2["OnSearchIdentificationCodeCompleted"] = "wallet:onSearchIdentificationCodeCompleted" /* OnSearchIdentificationCodeCompleted */;
30
97
  return PaymentHooks2;
31
98
  })(PaymentHooks || {});
32
99
  // Annotate the CommonJS export names for ESM import in node:
33
100
  0 && (module.exports = {
34
- PaymentHooks
101
+ PaymentHooks,
102
+ PaymentMethodType,
103
+ PaymentStatus,
104
+ RoundingInterval,
105
+ RoundingRule,
106
+ TaskRunStatus,
107
+ WalletPassHooks
35
108
  });
@@ -0,0 +1,17 @@
1
+ export declare const getAvailableMaxAmount: (data: Record<string, any>) => any;
2
+ /**
3
+ * 将walletPass列表数据转换为prepare_payments需要的数据格式
4
+ * @param list
5
+ */
6
+ export declare const formatWalletPassList2PreparePayments: (list?: any[]) => {
7
+ voucher_id: any;
8
+ amount: number;
9
+ tag: any;
10
+ }[];
11
+ /**
12
+ * 对用户识别码列表进行排序
13
+ * 排序规则:正常数据 -> unified_available_status===1 -> 500601/500602 -> unified_available_status===0
14
+ * @param list 用户识别码列表
15
+ * @returns 排序后的列表
16
+ */
17
+ export declare const sortUserIdentificationCodeList: (list: any[]) => any[];
@@ -0,0 +1,67 @@
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/utils.ts
20
+ var utils_exports = {};
21
+ __export(utils_exports, {
22
+ formatWalletPassList2PreparePayments: () => formatWalletPassList2PreparePayments,
23
+ getAvailableMaxAmount: () => getAvailableMaxAmount,
24
+ sortUserIdentificationCodeList: () => sortUserIdentificationCodeList
25
+ });
26
+ module.exports = __toCommonJS(utils_exports);
27
+ var getAvailableMaxAmount = (data) => {
28
+ return data.tag !== "point_card" ? data.available_max_amount : data == null ? void 0 : data.recommended_usage_amount;
29
+ };
30
+ var formatWalletPassList2PreparePayments = (list) => {
31
+ return (list || []).map((item) => {
32
+ return {
33
+ voucher_id: item.id || 0,
34
+ amount: Number(item.edit_current_amount || getAvailableMaxAmount(item)) || 0,
35
+ tag: item.tag || ""
36
+ };
37
+ });
38
+ };
39
+ var sortUserIdentificationCodeList = (list) => {
40
+ if (!Array.isArray(list) || list.length === 0) {
41
+ return list;
42
+ }
43
+ const middlePriorityErrorCodes = ["500601", "500602"];
44
+ return list.sort((a, b) => {
45
+ const getPriority = (item) => {
46
+ var _a;
47
+ const errorCode = (_a = item.unified_error_code) == null ? void 0 : _a.toString();
48
+ const availableStatus = item.unified_available_status;
49
+ if (errorCode && middlePriorityErrorCodes.includes(errorCode))
50
+ return 2;
51
+ if (availableStatus === 0)
52
+ return 3;
53
+ if (availableStatus === 1)
54
+ return 1;
55
+ return 0;
56
+ };
57
+ const aPriority = getPriority(a);
58
+ const bPriority = getPriority(b);
59
+ return aPriority - bPriority;
60
+ });
61
+ };
62
+ // Annotate the CommonJS export names for ESM import in node:
63
+ 0 && (module.exports = {
64
+ formatWalletPassList2PreparePayments,
65
+ getAvailableMaxAmount,
66
+ sortUserIdentificationCodeList
67
+ });
@@ -0,0 +1,99 @@
1
+ import { WalletPassPayment, WalletDeductionRecommendParams, WalletRecommendItem, UserIdentificationCodeParams, UserIdentificationCodeItem, SearchIdentificationCodeParams, SearchIdentificationCodeItem, SearchIdentificationCodeResult, WalletInitBusinessData } from './types';
2
+ import type { PaymentModule } from './index';
3
+ /**
4
+ * 钱包支付实现
5
+ */
6
+ export declare class WalletPassPaymentImpl implements WalletPassPayment {
7
+ private paymentModule;
8
+ private walletRecommendList;
9
+ private userIdentificationCodes;
10
+ private searchResults;
11
+ private walletParams;
12
+ constructor(paymentModule: PaymentModule);
13
+ /**
14
+ * 发送事件的辅助方法
15
+ * 支持使用WalletPassHooks或PaymentHooks
16
+ */
17
+ private emitEvent;
18
+ /**
19
+ * 生成钱包API默认参数
20
+ * 根据业务数据生成标准的钱包API参数,并存储在模块中
21
+ */
22
+ generateWalletParams(businessData: WalletInitBusinessData): WalletDeductionRecommendParams;
23
+ /**
24
+ * 获取已存储的钱包参数
25
+ * 返回之前生成并存储的钱包参数
26
+ */
27
+ getStoredWalletParams(): WalletDeductionRecommendParams | null;
28
+ /**
29
+ * 清理已存储的钱包参数
30
+ * 清除之前存储的钱包参数
31
+ */
32
+ clearStoredWalletParams(): void;
33
+ /**
34
+ * 从业务数据初始化钱包数据
35
+ * 内部生成参数,然后调用标准的初始化流程
36
+ */
37
+ initializeWalletDataFromBusinessAsync(businessData: WalletInitBusinessData): Promise<{
38
+ walletRecommendList: WalletRecommendItem[];
39
+ userIdentificationCodes: UserIdentificationCodeItem[];
40
+ }>;
41
+ /**
42
+ * 初始化钱包数据
43
+ * 先获取推荐列表,再获取用户识别码列表(顺序执行)
44
+ */
45
+ initializeWalletDataAsync(baseParams: WalletDeductionRecommendParams): Promise<{
46
+ walletRecommendList: WalletRecommendItem[];
47
+ userIdentificationCodes: UserIdentificationCodeItem[];
48
+ }>;
49
+ getWalletPassRecommendListAsync(params: WalletDeductionRecommendParams): Promise<WalletRecommendItem[]>;
50
+ formatWalletPassList2PreparePayments(list: WalletRecommendItem[]): {
51
+ voucher_id: number;
52
+ amount: number;
53
+ tag: string;
54
+ }[];
55
+ getUserIdentificationCodeListAsync(params: UserIdentificationCodeParams): Promise<UserIdentificationCodeItem[]>;
56
+ /**
57
+ * 搜索识别码信息
58
+ * 通过识别码搜索相关的钱包通行证信息
59
+ * 基于 WalletDeductionRecommendParams 参数结构
60
+ * 特殊逻辑:当识别码长度为9位且前3位为"000"时,调用 /wallet/detail/search 接口
61
+ */
62
+ searchIdentificationCodeAsync(params: SearchIdentificationCodeParams, config?: {
63
+ noCache?: boolean;
64
+ }): Promise<SearchIdentificationCodeResult>;
65
+ processWalletPayment(amount: number, orderUuid: string, voucherId?: string): Promise<void>;
66
+ getWalletBalance(voucherId: string): Promise<number>;
67
+ /**
68
+ * 获取缓存的钱包推荐列表
69
+ */
70
+ getWalletRecommendList(): WalletRecommendItem[];
71
+ /**
72
+ * 获取缓存的用户识别码列表
73
+ */
74
+ getUserIdentificationCodes(): UserIdentificationCodeItem[];
75
+ /**
76
+ * 清除钱包推荐列表
77
+ */
78
+ clearWalletRecommendList(): void;
79
+ /**
80
+ * 清除用户识别码列表
81
+ */
82
+ clearUserIdentificationCodes(): void;
83
+ /**
84
+ * 获取缓存的搜索结果列表
85
+ */
86
+ getSearchResults(): SearchIdentificationCodeItem[];
87
+ /**
88
+ * 根据识别码查找搜索结果
89
+ */
90
+ findSearchResultByCode(code: string): SearchIdentificationCodeItem | undefined;
91
+ /**
92
+ * 清除搜索结果缓存
93
+ */
94
+ clearSearchResults(): void;
95
+ /**
96
+ * 清除所有缓存数据
97
+ */
98
+ clearAllCache(): void;
99
+ }