@pisell/pisellos 3.0.76 → 3.0.77

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 (308) hide show
  1. package/dist/core/index.js +1 -2
  2. package/dist/effects/index.d.ts +3 -5
  3. package/dist/effects/index.js +8 -40
  4. package/dist/modules/Account/index.js +3 -2
  5. package/dist/modules/AccountList/index.d.ts +1 -7
  6. package/dist/modules/AccountList/index.js +14 -81
  7. package/dist/modules/AccountList/types.d.ts +0 -28
  8. package/dist/modules/AccountList/types.js +0 -8
  9. package/dist/modules/BaseModule.d.ts +0 -3
  10. package/dist/modules/BaseModule.js +0 -15
  11. package/dist/modules/Cart/index.d.ts +0 -1
  12. package/dist/modules/Cart/index.js +1 -2
  13. package/dist/modules/Discount/index.d.ts +0 -1
  14. package/dist/modules/Discount/index.js +1 -1
  15. package/dist/modules/Guests/index.js +9 -9
  16. package/dist/modules/Order/index.d.ts +1 -25
  17. package/dist/modules/Order/index.js +3 -224
  18. package/dist/modules/Order/types.d.ts +0 -45
  19. package/dist/modules/Order/types.js +0 -8
  20. package/dist/modules/Order/utils.js +1 -1
  21. package/dist/modules/Payment/index.d.ts +9 -184
  22. package/dist/modules/Payment/index.js +109 -2084
  23. package/dist/modules/Payment/types.d.ts +30 -772
  24. package/dist/modules/Payment/types.js +12 -236
  25. package/dist/modules/ProductList/index.d.ts +1 -12
  26. package/dist/modules/ProductList/index.js +15 -37
  27. package/dist/modules/Resource/index.js +1 -1
  28. package/dist/modules/Rules/index.d.ts +1 -2
  29. package/dist/modules/Rules/index.js +26 -66
  30. package/dist/modules/Rules/types.d.ts +0 -1
  31. package/dist/modules/Schedule/index.d.ts +0 -9
  32. package/dist/modules/Schedule/index.js +0 -77
  33. package/dist/modules/index.d.ts +0 -1
  34. package/dist/modules/index.js +0 -1
  35. package/dist/plugins/window.d.ts +0 -1
  36. package/dist/solution/BookingByStep/index.js +13 -43
  37. package/dist/solution/BookingByStep/utils/capacity.js +1 -1
  38. package/dist/solution/BookingByStep/utils/products.d.ts +0 -6
  39. package/dist/solution/BookingByStep/utils/products.js +0 -10
  40. package/dist/solution/BuyTickets/index.js +8 -7
  41. package/dist/solution/ShopDiscount/index.d.ts +10 -10
  42. package/dist/solution/ShopDiscount/index.js +57 -107
  43. package/dist/solution/ShopDiscount/types.d.ts +0 -8
  44. package/dist/solution/ShopDiscount/utils.js +1 -0
  45. package/dist/solution/index.d.ts +0 -2
  46. package/dist/solution/index.js +1 -3
  47. package/dist/types/index.d.ts +1 -4
  48. package/lib/core/index.js +1 -1
  49. package/lib/effects/index.d.ts +3 -5
  50. package/lib/effects/index.js +1 -17
  51. package/lib/modules/Account/index.js +3 -2
  52. package/lib/modules/AccountList/index.d.ts +1 -7
  53. package/lib/modules/AccountList/index.js +0 -27
  54. package/lib/modules/AccountList/types.d.ts +0 -28
  55. package/lib/modules/BaseModule.d.ts +0 -3
  56. package/lib/modules/BaseModule.js +0 -9
  57. package/lib/modules/Cart/index.d.ts +0 -1
  58. package/lib/modules/Cart/index.js +2 -5
  59. package/lib/modules/Discount/index.d.ts +0 -1
  60. package/lib/modules/Discount/index.js +1 -1
  61. package/lib/modules/Guests/index.js +9 -9
  62. package/lib/modules/Order/index.d.ts +1 -25
  63. package/lib/modules/Order/index.js +1 -186
  64. package/lib/modules/Order/types.d.ts +0 -45
  65. package/lib/modules/Order/utils.js +1 -1
  66. package/lib/modules/Payment/index.d.ts +9 -184
  67. package/lib/modules/Payment/index.js +51 -1084
  68. package/lib/modules/Payment/types.d.ts +30 -772
  69. package/lib/modules/Payment/types.js +6 -79
  70. package/lib/modules/ProductList/index.d.ts +1 -12
  71. package/lib/modules/ProductList/index.js +12 -31
  72. package/lib/modules/Resource/index.js +1 -1
  73. package/lib/modules/Rules/index.d.ts +1 -2
  74. package/lib/modules/Rules/index.js +24 -41
  75. package/lib/modules/Rules/types.d.ts +0 -1
  76. package/lib/modules/Schedule/index.d.ts +0 -9
  77. package/lib/modules/Schedule/index.js +0 -60
  78. package/lib/modules/index.d.ts +0 -1
  79. package/lib/modules/index.js +0 -2
  80. package/lib/plugins/window.d.ts +0 -1
  81. package/lib/solution/BookingByStep/index.js +6 -18
  82. package/lib/solution/BookingByStep/utils/capacity.js +1 -1
  83. package/lib/solution/BookingByStep/utils/products.d.ts +0 -6
  84. package/lib/solution/BookingByStep/utils/products.js +2 -8
  85. package/lib/solution/BuyTickets/index.js +8 -7
  86. package/lib/solution/ShopDiscount/index.d.ts +10 -10
  87. package/lib/solution/ShopDiscount/index.js +21 -47
  88. package/lib/solution/ShopDiscount/types.d.ts +0 -8
  89. package/lib/solution/index.d.ts +0 -2
  90. package/lib/solution/index.js +1 -5
  91. package/lib/types/index.d.ts +1 -4
  92. package/package.json +1 -3
  93. package/dist/modules/Customer/constants.d.ts +0 -7
  94. package/dist/modules/Customer/constants.js +0 -12
  95. package/dist/modules/Customer/index.d.ts +0 -122
  96. package/dist/modules/Customer/index.js +0 -696
  97. package/dist/modules/Customer/types.d.ts +0 -146
  98. package/dist/modules/Customer/types.js +0 -41
  99. package/dist/modules/Payment/cash.d.ts +0 -19
  100. package/dist/modules/Payment/cash.js +0 -97
  101. package/dist/modules/Payment/cashRecommendationAlgorithm.d.ts +0 -22
  102. package/dist/modules/Payment/cashRecommendationAlgorithm.js +0 -423
  103. package/dist/modules/Payment/eftpos.d.ts +0 -11
  104. package/dist/modules/Payment/eftpos.js +0 -80
  105. package/dist/modules/Payment/mx51.d.ts +0 -0
  106. package/dist/modules/Payment/mx51.js +0 -0
  107. package/dist/modules/Payment/utils.d.ts +0 -17
  108. package/dist/modules/Payment/utils.js +0 -62
  109. package/dist/modules/Payment/walletpass.d.ts +0 -99
  110. package/dist/modules/Payment/walletpass.js +0 -711
  111. package/dist/plugins/app-types/app/app.d.ts +0 -83
  112. package/dist/plugins/app-types/app/const.d.ts +0 -4
  113. package/dist/plugins/app-types/app/index.d.ts +0 -14
  114. package/dist/plugins/app-types/applicationManager/application.d.ts +0 -50
  115. package/dist/plugins/app-types/applicationManager/index.d.ts +0 -13
  116. package/dist/plugins/app-types/config.d.ts +0 -3
  117. package/dist/plugins/app-types/cookie/index.d.ts +0 -13
  118. package/dist/plugins/app-types/data/index.d.ts +0 -8
  119. package/dist/plugins/app-types/history/config.d.ts +0 -24
  120. package/dist/plugins/app-types/history/index.d.ts +0 -20
  121. package/dist/plugins/app-types/history/type.d.ts +0 -2
  122. package/dist/plugins/app-types/hooks/index.d.ts +0 -12
  123. package/dist/plugins/app-types/hooks/useDelayedValue/index.d.ts +0 -2
  124. package/dist/plugins/app-types/hooks/useDispatch/index.d.ts +0 -2
  125. package/dist/plugins/app-types/hooks/useLowCode/index.d.ts +0 -13
  126. package/dist/plugins/app-types/hooks/useStore/index.d.ts +0 -6
  127. package/dist/plugins/app-types/index.d.ts +0 -6
  128. package/dist/plugins/app-types/indexDB/index.d.ts +0 -178
  129. package/dist/plugins/app-types/locales/en.d.ts +0 -3
  130. package/dist/plugins/app-types/locales/index.d.ts +0 -37
  131. package/dist/plugins/app-types/locales/original.d.ts +0 -3
  132. package/dist/plugins/app-types/locales/type.d.ts +0 -19
  133. package/dist/plugins/app-types/locales/zh-CN.d.ts +0 -3
  134. package/dist/plugins/app-types/locales/zh-HK.d.ts +0 -3
  135. package/dist/plugins/app-types/logger/feishu.d.ts +0 -11
  136. package/dist/plugins/app-types/logger/index.d.ts +0 -122
  137. package/dist/plugins/app-types/menuManager/hooks.d.ts +0 -17
  138. package/dist/plugins/app-types/menuManager/index.d.ts +0 -28
  139. package/dist/plugins/app-types/models/global.d.ts +0 -32
  140. package/dist/plugins/app-types/models/index.d.ts +0 -45
  141. package/dist/plugins/app-types/models/type.d.ts +0 -2
  142. package/dist/plugins/app-types/package.json +0 -15
  143. package/dist/plugins/app-types/plugin/index.d.ts +0 -0
  144. package/dist/plugins/app-types/pubsub/example.d.ts +0 -5
  145. package/dist/plugins/app-types/pubsub/index.d.ts +0 -63
  146. package/dist/plugins/app-types/request/cache.d.ts +0 -46
  147. package/dist/plugins/app-types/request/cancelToken.d.ts +0 -38
  148. package/dist/plugins/app-types/request/config.d.ts +0 -3
  149. package/dist/plugins/app-types/request/constants.d.ts +0 -2
  150. package/dist/plugins/app-types/request/index.d.ts +0 -24
  151. package/dist/plugins/app-types/request/pisell2Request.d.ts +0 -6
  152. package/dist/plugins/app-types/request/type.d.ts +0 -41
  153. package/dist/plugins/app-types/request/utils.d.ts +0 -46
  154. package/dist/plugins/app-types/routes/config.d.ts +0 -7
  155. package/dist/plugins/app-types/routes/index.d.ts +0 -28
  156. package/dist/plugins/app-types/socket/components/SocketMonitorPage.d.ts +0 -6
  157. package/dist/plugins/app-types/socket/components/index.d.ts +0 -2
  158. package/dist/plugins/app-types/socket/constants.d.ts +0 -33
  159. package/dist/plugins/app-types/socket/events.d.ts +0 -31
  160. package/dist/plugins/app-types/socket/heartbeat.d.ts +0 -66
  161. package/dist/plugins/app-types/socket/index.d.ts +0 -61
  162. package/dist/plugins/app-types/socket/monitor.d.ts +0 -169
  163. package/dist/plugins/app-types/socket/reconnect.d.ts +0 -61
  164. package/dist/plugins/app-types/socket/socket.d.ts +0 -129
  165. package/dist/plugins/app-types/socket/types.d.ts +0 -85
  166. package/dist/plugins/app-types/storage/index.d.ts +0 -17
  167. package/dist/plugins/app-types/tasks/index.d.ts +0 -77
  168. package/dist/plugins/app-types/tasks/type.d.ts +0 -62
  169. package/dist/plugins/app-types/tasks/useTasks.d.ts +0 -5
  170. package/dist/plugins/app-types/type.d.ts +0 -2
  171. package/dist/plugins/app-types/variables/VariablesProvider.d.ts +0 -7
  172. package/dist/plugins/app-types/variables/config.d.ts +0 -3
  173. package/dist/plugins/app-types/variables/index.d.ts +0 -6
  174. package/dist/plugins/app-types/variables/type.d.ts +0 -2
  175. package/dist/plugins/app-types/website/index.d.ts +0 -6
  176. package/dist/plugins/app.d.ts +0 -8
  177. package/dist/plugins/app.js +0 -1
  178. package/dist/solution/BookingTicket/index.d.ts +0 -184
  179. package/dist/solution/BookingTicket/index.js +0 -698
  180. package/dist/solution/BookingTicket/types.d.ts +0 -68
  181. package/dist/solution/BookingTicket/types.js +0 -43
  182. package/dist/solution/BookingTicket/utils/scan/cloudSearch.d.ts +0 -22
  183. package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +0 -159
  184. package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +0 -22
  185. package/dist/solution/BookingTicket/utils/scan/handleScan.js +0 -189
  186. package/dist/solution/BookingTicket/utils/scan/index.d.ts +0 -85
  187. package/dist/solution/BookingTicket/utils/scan/index.js +0 -294
  188. package/dist/solution/BookingTicket/utils/scan/scanCache.d.ts +0 -78
  189. package/dist/solution/BookingTicket/utils/scan/scanCache.js +0 -305
  190. package/dist/solution/Checkout/appointmentDemo.json +0 -1
  191. package/dist/solution/Checkout/index.d.ts +0 -432
  192. package/dist/solution/Checkout/index.js +0 -4452
  193. package/dist/solution/Checkout/types.d.ts +0 -727
  194. package/dist/solution/Checkout/types.js +0 -104
  195. package/dist/solution/Checkout/utils/index.d.ts +0 -121
  196. package/dist/solution/Checkout/utils/index.js +0 -511
  197. package/dist/utils/task.d.ts +0 -40
  198. package/dist/utils/task.js +0 -171
  199. package/dist/utils/watch.d.ts +0 -102
  200. package/dist/utils/watch.js +0 -294
  201. package/lib/modules/Customer/constants.d.ts +0 -7
  202. package/lib/modules/Customer/constants.js +0 -39
  203. package/lib/modules/Customer/index.d.ts +0 -122
  204. package/lib/modules/Customer/index.js +0 -439
  205. package/lib/modules/Customer/types.d.ts +0 -146
  206. package/lib/modules/Customer/types.js +0 -37
  207. package/lib/modules/Payment/cash.d.ts +0 -19
  208. package/lib/modules/Payment/cash.js +0 -64
  209. package/lib/modules/Payment/cashRecommendationAlgorithm.d.ts +0 -22
  210. package/lib/modules/Payment/cashRecommendationAlgorithm.js +0 -342
  211. package/lib/modules/Payment/eftpos.d.ts +0 -11
  212. package/lib/modules/Payment/eftpos.js +0 -51
  213. package/lib/modules/Payment/mx51.d.ts +0 -0
  214. package/lib/modules/Payment/mx51.js +0 -0
  215. package/lib/modules/Payment/utils.d.ts +0 -17
  216. package/lib/modules/Payment/utils.js +0 -67
  217. package/lib/modules/Payment/walletpass.d.ts +0 -99
  218. package/lib/modules/Payment/walletpass.js +0 -484
  219. package/lib/plugins/app-types/app/app.d.ts +0 -83
  220. package/lib/plugins/app-types/app/const.d.ts +0 -4
  221. package/lib/plugins/app-types/app/index.d.ts +0 -14
  222. package/lib/plugins/app-types/applicationManager/application.d.ts +0 -50
  223. package/lib/plugins/app-types/applicationManager/index.d.ts +0 -13
  224. package/lib/plugins/app-types/config.d.ts +0 -3
  225. package/lib/plugins/app-types/cookie/index.d.ts +0 -13
  226. package/lib/plugins/app-types/data/index.d.ts +0 -8
  227. package/lib/plugins/app-types/history/config.d.ts +0 -24
  228. package/lib/plugins/app-types/history/index.d.ts +0 -20
  229. package/lib/plugins/app-types/history/type.d.ts +0 -2
  230. package/lib/plugins/app-types/hooks/index.d.ts +0 -12
  231. package/lib/plugins/app-types/hooks/useDelayedValue/index.d.ts +0 -2
  232. package/lib/plugins/app-types/hooks/useDispatch/index.d.ts +0 -2
  233. package/lib/plugins/app-types/hooks/useLowCode/index.d.ts +0 -13
  234. package/lib/plugins/app-types/hooks/useStore/index.d.ts +0 -6
  235. package/lib/plugins/app-types/index.d.ts +0 -6
  236. package/lib/plugins/app-types/indexDB/index.d.ts +0 -178
  237. package/lib/plugins/app-types/locales/en.d.ts +0 -3
  238. package/lib/plugins/app-types/locales/index.d.ts +0 -37
  239. package/lib/plugins/app-types/locales/original.d.ts +0 -3
  240. package/lib/plugins/app-types/locales/type.d.ts +0 -19
  241. package/lib/plugins/app-types/locales/zh-CN.d.ts +0 -3
  242. package/lib/plugins/app-types/locales/zh-HK.d.ts +0 -3
  243. package/lib/plugins/app-types/logger/feishu.d.ts +0 -11
  244. package/lib/plugins/app-types/logger/index.d.ts +0 -122
  245. package/lib/plugins/app-types/menuManager/hooks.d.ts +0 -17
  246. package/lib/plugins/app-types/menuManager/index.d.ts +0 -28
  247. package/lib/plugins/app-types/models/global.d.ts +0 -32
  248. package/lib/plugins/app-types/models/index.d.ts +0 -45
  249. package/lib/plugins/app-types/models/type.d.ts +0 -2
  250. package/lib/plugins/app-types/package.json +0 -15
  251. package/lib/plugins/app-types/plugin/index.d.ts +0 -0
  252. package/lib/plugins/app-types/pubsub/example.d.ts +0 -5
  253. package/lib/plugins/app-types/pubsub/index.d.ts +0 -63
  254. package/lib/plugins/app-types/request/cache.d.ts +0 -46
  255. package/lib/plugins/app-types/request/cancelToken.d.ts +0 -38
  256. package/lib/plugins/app-types/request/config.d.ts +0 -3
  257. package/lib/plugins/app-types/request/constants.d.ts +0 -2
  258. package/lib/plugins/app-types/request/index.d.ts +0 -24
  259. package/lib/plugins/app-types/request/pisell2Request.d.ts +0 -6
  260. package/lib/plugins/app-types/request/type.d.ts +0 -41
  261. package/lib/plugins/app-types/request/utils.d.ts +0 -46
  262. package/lib/plugins/app-types/routes/config.d.ts +0 -7
  263. package/lib/plugins/app-types/routes/index.d.ts +0 -28
  264. package/lib/plugins/app-types/socket/components/SocketMonitorPage.d.ts +0 -6
  265. package/lib/plugins/app-types/socket/components/index.d.ts +0 -2
  266. package/lib/plugins/app-types/socket/constants.d.ts +0 -33
  267. package/lib/plugins/app-types/socket/events.d.ts +0 -31
  268. package/lib/plugins/app-types/socket/heartbeat.d.ts +0 -66
  269. package/lib/plugins/app-types/socket/index.d.ts +0 -61
  270. package/lib/plugins/app-types/socket/monitor.d.ts +0 -169
  271. package/lib/plugins/app-types/socket/reconnect.d.ts +0 -61
  272. package/lib/plugins/app-types/socket/socket.d.ts +0 -129
  273. package/lib/plugins/app-types/socket/types.d.ts +0 -85
  274. package/lib/plugins/app-types/storage/index.d.ts +0 -17
  275. package/lib/plugins/app-types/tasks/index.d.ts +0 -77
  276. package/lib/plugins/app-types/tasks/type.d.ts +0 -62
  277. package/lib/plugins/app-types/tasks/useTasks.d.ts +0 -5
  278. package/lib/plugins/app-types/type.d.ts +0 -2
  279. package/lib/plugins/app-types/variables/VariablesProvider.d.ts +0 -7
  280. package/lib/plugins/app-types/variables/config.d.ts +0 -3
  281. package/lib/plugins/app-types/variables/index.d.ts +0 -6
  282. package/lib/plugins/app-types/variables/type.d.ts +0 -2
  283. package/lib/plugins/app-types/website/index.d.ts +0 -6
  284. package/lib/plugins/app.d.ts +0 -8
  285. package/lib/plugins/app.js +0 -17
  286. package/lib/solution/BookingTicket/index.d.ts +0 -184
  287. package/lib/solution/BookingTicket/index.js +0 -426
  288. package/lib/solution/BookingTicket/types.d.ts +0 -68
  289. package/lib/solution/BookingTicket/types.js +0 -72
  290. package/lib/solution/BookingTicket/utils/scan/cloudSearch.d.ts +0 -22
  291. package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +0 -117
  292. package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +0 -22
  293. package/lib/solution/BookingTicket/utils/scan/handleScan.js +0 -132
  294. package/lib/solution/BookingTicket/utils/scan/index.d.ts +0 -85
  295. package/lib/solution/BookingTicket/utils/scan/index.js +0 -216
  296. package/lib/solution/BookingTicket/utils/scan/scanCache.d.ts +0 -78
  297. package/lib/solution/BookingTicket/utils/scan/scanCache.js +0 -231
  298. package/lib/solution/Checkout/appointmentDemo.json +0 -1
  299. package/lib/solution/Checkout/index.d.ts +0 -432
  300. package/lib/solution/Checkout/index.js +0 -2776
  301. package/lib/solution/Checkout/types.d.ts +0 -727
  302. package/lib/solution/Checkout/types.js +0 -63
  303. package/lib/solution/Checkout/utils/index.d.ts +0 -121
  304. package/lib/solution/Checkout/utils/index.js +0 -362
  305. package/lib/utils/task.d.ts +0 -40
  306. package/lib/utils/task.js +0 -109
  307. package/lib/utils/watch.d.ts +0 -102
  308. package/lib/utils/watch.js +0 -217
@@ -1,511 +0,0 @@
1
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
2
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
3
- function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
4
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
5
- import { PaymentMethodType } from "../../../modules/Payment/types";
6
-
7
- /**
8
- * 验证结账数据
9
- */
10
- export function validateCheckoutData(params) {
11
- var errors = [];
12
-
13
- // 验证购物车商品
14
- if (!params.cartItems || params.cartItems.length === 0) {
15
- errors.push('购物车不能为空');
16
- }
17
-
18
- // 验证购物车商品数据完整性
19
- if (params.cartItems) {
20
- params.cartItems.forEach(function (item, index) {
21
- if (!item.id) {
22
- errors.push("\u8D2D\u7269\u8F66\u5546\u54C1 ".concat(index + 1, " \u7F3A\u5C11\u5546\u54C1ID"));
23
- }
24
- if (!item.price || parseFloat(String(item.price)) < 0) {
25
- errors.push("\u8D2D\u7269\u8F66\u5546\u54C1 ".concat(index + 1, " \u4EF7\u683C\u65E0\u6548"));
26
- }
27
- if (!item.num || item.num <= 0) {
28
- errors.push("\u8D2D\u7269\u8F66\u5546\u54C1 ".concat(index + 1, " \u6570\u91CF\u65E0\u6548"));
29
- }
30
- });
31
- }
32
-
33
- // 验证订单类型
34
- if (params.orderType && !['virtual', 'appointment_booking'].includes(params.orderType)) {
35
- errors.push('订单类型无效,必须是 virtual 或 appointment_booking');
36
- }
37
-
38
- // 验证平台类型
39
- if (params.platform && !['pc', 'h5'].includes(params.platform)) {
40
- errors.push('平台类型无效,必须是 pc 或 h5');
41
- }
42
- return {
43
- valid: errors.length === 0,
44
- errors: errors
45
- };
46
- }
47
-
48
- /**
49
- * 创建结账错误对象
50
- */
51
- export function createCheckoutError(type, message, details) {
52
- return {
53
- type: type,
54
- message: message,
55
- details: details,
56
- timestamp: Date.now()
57
- };
58
- }
59
-
60
- /**
61
- * 格式化金额
62
- */
63
- export function formatAmount(amount) {
64
- var numAmount = typeof amount === 'string' ? parseFloat(amount) : amount;
65
- if (isNaN(numAmount)) return '0.00';
66
- return numAmount.toFixed(2);
67
- }
68
-
69
- /**
70
- * 验证金额
71
- */
72
- export function validateAmount(amount) {
73
- var numAmount = typeof amount === 'string' ? parseFloat(amount) : amount;
74
- return !isNaN(numAmount) && numAmount >= 0;
75
- }
76
-
77
- /**
78
- * 生成唯一订单ID
79
- */
80
- export function generateOrderId() {
81
- var prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'order';
82
- var timestamp = Date.now();
83
- var random = Math.floor(Math.random() * 10000).toString().padStart(4, '0');
84
- return "".concat(prefix, "_").concat(timestamp, "_").concat(random);
85
- }
86
-
87
- /**
88
- * 检查是否为有效的支付方式代码
89
- */
90
- export function isValidPaymentMethodCode(code) {
91
- // 基本的支付方式代码验证
92
- return typeof code === 'string' && code.length > 0 && /^[a-zA-Z0-9_-]+$/.test(code);
93
- }
94
-
95
- /**
96
- * 安全地解析JSON
97
- */
98
- export function safeJsonParse(jsonString, defaultValue) {
99
- try {
100
- return JSON.parse(jsonString);
101
- } catch (_unused) {
102
- return defaultValue;
103
- }
104
- }
105
-
106
- /**
107
- * 深度克隆对象
108
- */
109
- export function deepClone(obj) {
110
- if (obj === null || _typeof(obj) !== 'object') {
111
- return obj;
112
- }
113
- if (obj instanceof Date) {
114
- return new Date(obj.getTime());
115
- }
116
- if (obj instanceof Array) {
117
- return obj.map(function (item) {
118
- return deepClone(item);
119
- });
120
- }
121
- if (_typeof(obj) === 'object') {
122
- var clonedObj = {};
123
- for (var key in obj) {
124
- if (obj.hasOwnProperty(key)) {
125
- clonedObj[key] = deepClone(obj[key]);
126
- }
127
- }
128
- return clonedObj;
129
- }
130
- return obj;
131
- }
132
-
133
- /**
134
- * 防抖函数
135
- */
136
- export function debounce(func, wait) {
137
- var timeout = null;
138
- return function () {
139
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
140
- args[_key] = arguments[_key];
141
- }
142
- if (timeout) {
143
- clearTimeout(timeout);
144
- }
145
- timeout = setTimeout(function () {
146
- func.apply(null, args);
147
- }, wait);
148
- };
149
- }
150
-
151
- /**
152
- * 节流函数
153
- */
154
- export function throttle(func, wait) {
155
- var lastTime = 0;
156
- return function () {
157
- var now = Date.now();
158
- if (now - lastTime >= wait) {
159
- lastTime = now;
160
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
161
- args[_key2] = arguments[_key2];
162
- }
163
- func.apply(null, args);
164
- }
165
- };
166
- }
167
-
168
- /**
169
- * 重试函数
170
- */
171
- export function retry(_x) {
172
- return _retry.apply(this, arguments);
173
- }
174
-
175
- /**
176
- * 检查对象是否为空
177
- */
178
- function _retry() {
179
- _retry = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(fn) {
180
- var maxAttempts,
181
- delay,
182
- lastError,
183
- _loop,
184
- _ret,
185
- attempt,
186
- _args2 = arguments;
187
- return _regeneratorRuntime().wrap(function _callee$(_context2) {
188
- while (1) switch (_context2.prev = _context2.next) {
189
- case 0:
190
- maxAttempts = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : 3;
191
- delay = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] : 1000;
192
- _loop = /*#__PURE__*/_regeneratorRuntime().mark(function _loop(attempt) {
193
- return _regeneratorRuntime().wrap(function _loop$(_context) {
194
- while (1) switch (_context.prev = _context.next) {
195
- case 0:
196
- _context.prev = 0;
197
- _context.next = 3;
198
- return fn();
199
- case 3:
200
- _context.t0 = _context.sent;
201
- return _context.abrupt("return", {
202
- v: _context.t0
203
- });
204
- case 7:
205
- _context.prev = 7;
206
- _context.t1 = _context["catch"](0);
207
- lastError = _context.t1;
208
- if (!(attempt === maxAttempts)) {
209
- _context.next = 12;
210
- break;
211
- }
212
- throw lastError;
213
- case 12:
214
- _context.next = 14;
215
- return new Promise(function (resolve) {
216
- return setTimeout(resolve, delay * attempt);
217
- });
218
- case 14:
219
- case "end":
220
- return _context.stop();
221
- }
222
- }, _loop, null, [[0, 7]]);
223
- });
224
- attempt = 1;
225
- case 4:
226
- if (!(attempt <= maxAttempts)) {
227
- _context2.next = 12;
228
- break;
229
- }
230
- return _context2.delegateYield(_loop(attempt), "t0", 6);
231
- case 6:
232
- _ret = _context2.t0;
233
- if (!_ret) {
234
- _context2.next = 9;
235
- break;
236
- }
237
- return _context2.abrupt("return", _ret.v);
238
- case 9:
239
- attempt++;
240
- _context2.next = 4;
241
- break;
242
- case 12:
243
- throw lastError;
244
- case 13:
245
- case "end":
246
- return _context2.stop();
247
- }
248
- }, _callee);
249
- }));
250
- return _retry.apply(this, arguments);
251
- }
252
- export function isEmpty(obj) {
253
- if (obj == null) return true;
254
- if (Array.isArray(obj) || typeof obj === 'string') return obj.length === 0;
255
- if (_typeof(obj) === 'object') return Object.keys(obj).length === 0;
256
- return false;
257
- }
258
-
259
- /**
260
- * 获取错误消息
261
- */
262
- export function getErrorMessage(error) {
263
- if (error instanceof Error) {
264
- return error.message;
265
- }
266
- if (typeof error === 'string') {
267
- return error;
268
- }
269
- if (error && _typeof(error) === 'object' && 'message' in error) {
270
- return String(error.message);
271
- }
272
- return '未知错误';
273
- }
274
-
275
- /**
276
- * 检查是否为生产环境
277
- */
278
- export function isProduction() {
279
- return process.env.NODE_ENV === 'production';
280
- }
281
-
282
- /**
283
- * 日志记录器
284
- */
285
- export var logger = {
286
- info: function info(message) {
287
- var _console;
288
- for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
289
- args[_key3 - 1] = arguments[_key3];
290
- }
291
- (_console = console).log.apply(_console, ["[Checkout] ".concat(message)].concat(args));
292
- },
293
- warn: function warn(message) {
294
- var _console2;
295
- for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
296
- args[_key4 - 1] = arguments[_key4];
297
- }
298
- (_console2 = console).warn.apply(_console2, ["[Checkout] ".concat(message)].concat(args));
299
- },
300
- error: function error(message) {
301
- var _console3;
302
- for (var _len5 = arguments.length, args = new Array(_len5 > 1 ? _len5 - 1 : 0), _key5 = 1; _key5 < _len5; _key5++) {
303
- args[_key5 - 1] = arguments[_key5];
304
- }
305
- (_console3 = console).error.apply(_console3, ["[Checkout] ".concat(message)].concat(args));
306
- },
307
- debug: function debug(message) {
308
- if (!isProduction()) {
309
- var _console4;
310
- for (var _len6 = arguments.length, args = new Array(_len6 > 1 ? _len6 - 1 : 0), _key6 = 1; _key6 < _len6; _key6++) {
311
- args[_key6 - 1] = arguments[_key6];
312
- }
313
- (_console4 = console).debug.apply(_console4, ["[Checkout] ".concat(message)].concat(args));
314
- }
315
- }
316
- };
317
-
318
- // ========== 从 CheckoutImpl 类中移出的纯静态方法 ==========
319
-
320
- /**
321
- * 验证本地订单数据
322
- */
323
- export function validateLocalOrderData(orderData) {
324
- var _orderData$relation_p;
325
- var errors = [];
326
-
327
- // 验证基本字段
328
- if (!orderData.type) {
329
- errors.push('订单类型不能为空');
330
- }
331
- if (!orderData.platform) {
332
- errors.push('平台信息不能为空');
333
- }
334
- if ((!orderData.bookings || orderData.bookings.length === 0) && !(orderData !== null && orderData !== void 0 && (_orderData$relation_p = orderData.relation_products) !== null && _orderData$relation_p !== void 0 && _orderData$relation_p.length)) {
335
- errors.push('预订信息不能为空');
336
- }
337
-
338
- // 验证预订信息
339
- if (orderData.bookings) {
340
- orderData.bookings.forEach(function (booking, index) {
341
- if (!booking.product || !booking.product.product_id) {
342
- errors.push("\u9884\u8BA2\u9879 ".concat(index + 1, " \u7F3A\u5C11\u5546\u54C1\u4FE1\u606F"));
343
- }
344
- if (!booking.start_date) {
345
- errors.push("\u9884\u8BA2\u9879 ".concat(index + 1, " \u7F3A\u5C11\u5F00\u59CB\u65E5\u671F"));
346
- }
347
- if (!booking.start_time) {
348
- errors.push("\u9884\u8BA2\u9879 ".concat(index + 1, " \u7F3A\u5C11\u5F00\u59CB\u65F6\u95F4"));
349
- }
350
- });
351
- }
352
- return {
353
- valid: errors.length === 0,
354
- errors: errors
355
- };
356
- }
357
-
358
- /**
359
- * 生成本地订单ID
360
- */
361
- export function generateLocalOrderId() {
362
- var timestamp = Date.now();
363
- var random = Math.floor(Math.random() * 10000).toString().padStart(4, '0');
364
- return "local_order_".concat(timestamp, "_").concat(random);
365
- }
366
-
367
- /**
368
- * 格式化日期时间为 YYYY-MM-DD hh:mm:ss 格式
369
- *
370
- * @param date 要格式化的日期对象
371
- * @returns 格式化后的日期时间字符串
372
- */
373
- export function formatDateTime(date) {
374
- var year = date.getFullYear();
375
- var month = String(date.getMonth() + 1).padStart(2, '0');
376
- var day = String(date.getDate()).padStart(2, '0');
377
- var hours = String(date.getHours()).padStart(2, '0');
378
- var minutes = String(date.getMinutes()).padStart(2, '0');
379
- var seconds = String(date.getSeconds()).padStart(2, '0');
380
- return "".concat(year, "-").concat(month, "-").concat(day, " ").concat(hours, ":").concat(minutes, ":").concat(seconds);
381
- }
382
-
383
- /**
384
- * 从购物车小计数据中提取金额信息
385
- */
386
- export function extractAmountFromCartSummary(cartSummary) {
387
- var result = {
388
- totalAmount: '0.00',
389
- subTotal: '0.00',
390
- taxAmount: '0.00',
391
- discountAmount: '0.00',
392
- shopDiscountAmount: '0.00',
393
- roundingAmount: '0.00'
394
- };
395
- cartSummary.forEach(function (item) {
396
- var value = Number(item.value).toFixed(2);
397
- switch (item.key) {
398
- case 'expect_amount':
399
- result.totalAmount = value;
400
- break;
401
- case 'sub_total':
402
- result.subTotal = value;
403
- break;
404
- case 'tax':
405
- result.taxAmount = value;
406
- if (item.tax) {
407
- result.taxDetails = item.tax;
408
- }
409
- break;
410
- case 'discount':
411
- result.discountAmount = value;
412
- break;
413
- case 'shop_discount':
414
- result.shopDiscountAmount = value;
415
- break;
416
- case 'custom_roundingAmount':
417
- result.roundingAmount = value;
418
- break;
419
- default:
420
- // 处理其他可能的键,如定金等
421
- if (item.key.includes('deposit')) {
422
- result.depositAmount = value;
423
- }
424
- break;
425
- }
426
- });
427
- console.log('[Checkout] 从购物车小计提取金额信息:', {
428
- totalAmount: result.totalAmount,
429
- subTotal: result.subTotal,
430
- taxAmount: result.taxAmount,
431
- discountAmount: result.discountAmount,
432
- shopDiscountAmount: result.shopDiscountAmount,
433
- roundingAmount: result.roundingAmount
434
- });
435
- return result;
436
- }
437
-
438
- /**
439
- * 计算购物车总金额
440
- */
441
- export function calculateTotalAmount(cartItems) {
442
- var total = cartItems.reduce(function (sum, item) {
443
- var price = parseFloat(String(item.price) || '0');
444
- var quantity = item.quantity || 1;
445
- return sum + price * quantity;
446
- }, 0);
447
- return total.toFixed(2);
448
- }
449
-
450
- /**
451
- * 判断订单ID是否为本地生成的虚拟ID
452
- *
453
- * @param orderId 订单ID
454
- * @returns true 表示是虚拟ID,false 表示是真实的后端ID
455
- */
456
- export function isVirtualOrderId(orderId) {
457
- return orderId.startsWith('local_order_');
458
- }
459
-
460
- /**
461
- * 判断支付方式是否需要同步订单到后端
462
- *
463
- * 现金支付(CASHMANUAL)和自定义支付不需要同步,其他支付方式需要同步
464
- *
465
- * @param paymentCode 支付方式代码
466
- * @param paymentType 支付方式类型
467
- * @returns 是否需要同步订单
468
- */
469
- export function shouldSyncOrderForPayment(paymentCode, paymentType) {
470
- var codeUpper = (paymentCode === null || paymentCode === void 0 ? void 0 : paymentCode.toUpperCase()) || '';
471
- var typeUpper = (paymentType === null || paymentType === void 0 ? void 0 : paymentType.toUpperCase()) || '';
472
-
473
- // 现金支付不需要同步 - 支持多种现金支付识别方式
474
- var cashIdentifiers = ['CASHMANUAL', 'CASH', 'MANUAL'];
475
- if (cashIdentifiers.some(function (id) {
476
- return codeUpper.includes(id) || typeUpper.includes(id);
477
- })) {
478
- return false;
479
- }
480
-
481
- // 标准现金支付代码检查
482
- if (paymentCode === PaymentMethodType.Cash || paymentType === PaymentMethodType.Cash) {
483
- return false;
484
- }
485
-
486
- // 自定义支付不需要同步
487
- if (codeUpper.includes('CUSTOM') || typeUpper.includes('CUSTOM')) {
488
- return false;
489
- }
490
-
491
- // 其他支付方式都需要同步
492
- return true;
493
- }
494
-
495
- /**
496
- * 判断是否为现金支付
497
- *
498
- * @param paymentCode 支付方式代码
499
- * @param paymentType 支付方式类型
500
- * @returns 是否为现金支付
501
- */
502
- export function isCashPayment(paymentCode, paymentType) {
503
- var codeUpper = (paymentCode === null || paymentCode === void 0 ? void 0 : paymentCode.toUpperCase()) || '';
504
- var typeUpper = (paymentType === null || paymentType === void 0 ? void 0 : paymentType.toUpperCase()) || '';
505
-
506
- // 现金支付识别规则
507
- var cashIdentifiers = ['CASH', 'CASHMANUAL', 'MANUAL'];
508
- return cashIdentifiers.some(function (identifier) {
509
- return codeUpper.includes(identifier) || typeUpper.includes(identifier);
510
- });
511
- }
@@ -1,40 +0,0 @@
1
- type Action = (...args: any[]) => Promise<any>;
2
- type Task = {
3
- uuid: string;
4
- type: string;
5
- actionParams?: Record<string, any>;
6
- };
7
- declare class Tasks {
8
- private actions;
9
- private taskQueue;
10
- isRunning: boolean;
11
- constructor(actions?: Map<string, Action>);
12
- /**
13
- * 清空所有任务
14
- */
15
- clear(): void;
16
- /**
17
- * 清空任务执行队列
18
- */
19
- clearTaskQueue(): void;
20
- /**
21
- * 添加action
22
- * @param name action名称
23
- * @param action action函数
24
- */
25
- addAction(name: string, action: Action): void;
26
- /**
27
- * 添加任务
28
- * @param task 任务
29
- */
30
- addTask(task: Task): void;
31
- /**
32
- * 执行任务
33
- */
34
- run(): Promise<void>;
35
- /**
36
- * 判定当前的任务是否依然存在
37
- */
38
- isTaskExist(uuid: string): boolean;
39
- }
40
- export default Tasks;