@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
@@ -19,90 +19,17 @@ 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,
23
- PaymentMethodType: () => PaymentMethodType,
24
- PaymentStatus: () => PaymentStatus,
25
- RoundingInterval: () => RoundingInterval,
26
- RoundingRule: () => RoundingRule,
27
- TaskRunStatus: () => TaskRunStatus,
28
- WalletPassHooks: () => WalletPassHooks
22
+ PaymentHooks: () => PaymentHooks
29
23
  });
30
24
  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 || {});
77
25
  var PaymentHooks = /* @__PURE__ */ ((PaymentHooks2) => {
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 */;
26
+ PaymentHooks2["OnPaymentInit"] = "payment:onPaymentInit";
27
+ PaymentHooks2["OnPaymentSuccess"] = "payment:onPaymentSuccess";
28
+ PaymentHooks2["OnPaymentFailure"] = "payment:onPaymentFailure";
29
+ PaymentHooks2["OnPaymentRefund"] = "payment:onPaymentRefund";
97
30
  return PaymentHooks2;
98
31
  })(PaymentHooks || {});
99
32
  // Annotate the CommonJS export names for ESM import in node:
100
33
  0 && (module.exports = {
101
- PaymentHooks,
102
- PaymentMethodType,
103
- PaymentStatus,
104
- RoundingInterval,
105
- RoundingRule,
106
- TaskRunStatus,
107
- WalletPassHooks
34
+ PaymentHooks
108
35
  });
@@ -11,17 +11,12 @@ 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, menu_list_ids, customer_id: paramsCustomerId, with_count, schedule_datetime, schedule_date, cacheId, with_schedule, }: {
14
+ loadProducts({ category_ids, product_ids, collection, schedule_date, cacheId }: {
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;
25
20
  }): Promise<any>;
26
21
  loadProductsPrice({ ids, customer_id, schedule_date, channel, }: {
27
22
  ids?: number[];
@@ -33,10 +28,4 @@ export declare class ProductList extends BaseModule implements Module {
33
28
  getProduct(id: number): Promise<ProductData | undefined>;
34
29
  addProduct(products: ProductData[]): Promise<void>;
35
30
  selectProducts(products: ProductData[]): Promise<void>;
36
- /**
37
- * 根据商品编码或条码搜索商品
38
- * @param code 商品编码或条码
39
- * @returns 匹配的商品列表,如果没有匹配则返回空数组
40
- */
41
- findProductsByCodeOrBarcode(code: string): ProductData[];
42
31
  }
@@ -24,6 +24,7 @@ __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");
27
28
  var import_lodash_es = require("lodash-es");
28
29
  __reExport(ProductList_exports, require("./types"), module.exports);
29
30
  var ProductList = class extends import_BaseModule.BaseModule {
@@ -53,19 +54,14 @@ var ProductList = class extends import_BaseModule.BaseModule {
53
54
  category_ids = [],
54
55
  product_ids = [],
55
56
  collection = [],
56
- menu_list_ids = [],
57
- customer_id: paramsCustomerId,
58
- with_count = [],
59
- schedule_datetime,
60
57
  schedule_date,
61
- cacheId,
62
- with_schedule
58
+ cacheId
63
59
  }) {
64
60
  var _a, _b;
65
61
  let userPlugin = this.core.getPlugin("user");
66
62
  let customer_id = void 0;
67
63
  try {
68
- customer_id = paramsCustomerId || ((_a = userPlugin == null ? void 0 : userPlugin.get()) == null ? void 0 : _a.id);
64
+ customer_id = (_a = userPlugin == null ? void 0 : userPlugin.get()) == null ? void 0 : _a.id;
69
65
  } catch (error) {
70
66
  console.error(error);
71
67
  }
@@ -91,18 +87,21 @@ var ProductList = class extends import_BaseModule.BaseModule {
91
87
  ids: product_ids,
92
88
  collection,
93
89
  front_end_cache_id: cacheId,
94
- menu_list_ids,
95
- with_count,
96
90
  // client_schedule_ids: schedule_ids,
97
91
  schedule_date,
98
92
  application_code: (_b = this.otherParams) == null ? void 0 : _b.channel,
99
- with_schedule,
100
- schedule_datetime,
101
93
  is_eject: 1
102
94
  },
103
95
  { useCache: true }
104
96
  );
105
97
  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
+ }
106
105
  this.addProduct(sortedList);
107
106
  return sortedList;
108
107
  }
@@ -126,14 +125,14 @@ var ProductList = class extends import_BaseModule.BaseModule {
126
125
  }
127
126
  async getProducts() {
128
127
  await this.core.effects.emit(
129
- `${this.name}:onGetProducts`,
128
+ import_types.ProductListHooks.onGetProducts,
130
129
  this.store.list
131
130
  );
132
131
  return (0, import_lodash_es.cloneDeep)(this.store.list);
133
132
  }
134
133
  async getProduct(id) {
135
134
  await this.core.effects.emit(
136
- `${this.name}:onGetProduct`,
135
+ import_types.ProductListHooks.onGetProduct,
137
136
  this.store.list
138
137
  );
139
138
  const product = this.store.list.find((product2) => product2.id === id);
@@ -157,24 +156,6 @@ var ProductList = class extends import_BaseModule.BaseModule {
157
156
  async selectProducts(products) {
158
157
  this.store.selectProducts = products;
159
158
  }
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
- }
178
159
  };
179
160
  // Annotate the CommonJS export names for ESM import in node:
180
161
  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(`${this.name}:onResourceSelect`, resource);
45
+ await this.core.effects.emit(import_types.ResourceHooks.OnResourceSelect, resource);
46
46
  }
47
47
  getSelectedResource() {
48
48
  return this.store.selectedResource;
@@ -2,7 +2,6 @@ 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';
6
5
  export declare class RulesModule extends BaseModule implements Module, RulesModuleAPI {
7
6
  protected defaultName: string;
8
7
  protected defaultVersion: string;
@@ -36,7 +35,7 @@ export declare class RulesModule extends BaseModule implements Module, RulesModu
36
35
  }, options?: {
37
36
  isSelected?: boolean;
38
37
  discountId?: number;
39
- selectedList?: SetDiscountSelectedParams[];
38
+ selectedList?: any[];
40
39
  scan?: boolean;
41
40
  }): DiscountResult;
42
41
  /**
@@ -33,6 +33,7 @@ __export(Rules_exports, {
33
33
  });
34
34
  module.exports = __toCommonJS(Rules_exports);
35
35
  var import_BaseModule = require("../BaseModule");
36
+ var import_types = require("./types");
36
37
  var import_utils = require("../../solution/ShopDiscount/utils");
37
38
  var import_utils2 = require("../Cart/utils");
38
39
  var import_decimal = __toESM(require("decimal.js"));
@@ -52,7 +53,7 @@ var RulesModule = class extends import_BaseModule.BaseModule {
52
53
  }
53
54
  async setRulesList(rulesList) {
54
55
  this.store.rulesList = rulesList;
55
- await this.core.effects.emit(`${this.name}:onRulesListChange`, rulesList);
56
+ await this.core.effects.emit(import_types.RulesHooks.OnRulesListChange, rulesList);
56
57
  }
57
58
  getRulesList() {
58
59
  return this.store.rulesList;
@@ -495,7 +496,7 @@ var RulesModule = class extends import_BaseModule.BaseModule {
495
496
  ].includes(discount2.tag || discount2.type)
496
497
  ))) : !((flatItem == null ? void 0 : flatItem.booking_id) && !!((_d = (_c = flatItem == null ? void 0 : flatItem.bundleItem) == null ? void 0 : _c.discount_list) == null ? void 0 : _d.length) && ((_f = (_e = flatItem == null ? void 0 : flatItem.bundleItem) == null ? void 0 : _e.discount_list) == null ? void 0 : _f.every((discount2) => discount2.id)));
497
498
  const isBundleAvailable = this.checkPackageSubItemUsageRules(discount, flatItem);
498
- if (isAvailableProduct && isLimitedProduct && timeLimit && isBundleAvailable) {
499
+ if (isAvailableProduct && isLimitedProduct && isBundleAvailable && timeLimit) {
499
500
  (_g = discountApplicability.get(discount.id)) == null ? void 0 : _g.push(product.id);
500
501
  const applicableProducts = discountApplicableProducts.get(discount.id) || [];
501
502
  const discountType = discount.tag || discount.type;
@@ -562,7 +563,7 @@ var RulesModule = class extends import_BaseModule.BaseModule {
562
563
  var _a2, _b2;
563
564
  if ((Number(product.price) <= 0 || !product.price) && !((_a2 = product.discount_list) == null ? void 0 : _a2.length) && (discount.tag || discount.type) === "good_pass")
564
565
  return false;
565
- if ((Number(product.price) <= 0 || !product.price) && !((_b2 = product.discount_list) == null ? void 0 : _b2.find((n) => {
566
+ if ((Number(product.price) === 0 || !product.price) && !((_b2 = product.discount_list) == null ? void 0 : _b2.find((n) => {
566
567
  var _a3;
567
568
  return ((_a3 = n.discount) == null ? void 0 : _a3.resource_id) === discount.id;
568
569
  })) && (discount.tag || discount.type) !== "good_pass")
@@ -664,7 +665,7 @@ var RulesModule = class extends import_BaseModule.BaseModule {
664
665
  }
665
666
  }
666
667
  }
667
- if (applicableDiscounts.length === 0 || isManualDiscount || (0, import_lodash_es.isBoolean)(product.vouchersApplicable) && !product.vouchersApplicable) {
668
+ if (applicableDiscounts.length === 0 || isManualDiscount) {
668
669
  if (flatItem.type === "main") {
669
670
  if (product.isClient) {
670
671
  processedProductsMap.set(
@@ -696,10 +697,7 @@ var RulesModule = class extends import_BaseModule.BaseModule {
696
697
  processedProductsMap.set(
697
698
  product._id,
698
699
  [this.hooks.setProduct(originProduct, {
699
- ...isManualDiscount ? {
700
- price: product.price,
701
- main_product_selling_price: product.price
702
- } : {
700
+ ...isManualDiscount ? {} : {
703
701
  _id: product._id.split("___")[0] + "___" + index,
704
702
  total: product.origin_total || product.total,
705
703
  price: product.price,
@@ -713,7 +711,7 @@ var RulesModule = class extends import_BaseModule.BaseModule {
713
711
  processedFlatItemsMap.set(flatItem._id, [{
714
712
  ...flatItem,
715
713
  discount_list: [],
716
- price: isManualDiscount ? flatItem.bundleItem.price : flatItem.bundleItem.original_price,
714
+ price: flatItem.bundleItem.original_price,
717
715
  processed: true
718
716
  }]);
719
717
  }
@@ -1089,16 +1087,14 @@ var RulesModule = class extends import_BaseModule.BaseModule {
1089
1087
  const allDiscountAmount = (0, import_utils.getDiscountListAmountTotal)(mainDiscountList);
1090
1088
  newTotalWithDiscount = new import_decimal.default(mainProductData.price || 0).minus(allDiscountAmount).toNumber() ?? newTotalWithDiscount;
1091
1089
  newOriginTotalWithDiscount = mainProductData.origin_total ?? newOriginTotalWithDiscount;
1092
- }
1093
- if (newBundleWithDiscount.length > 0) {
1094
- newBundleWithDiscount.forEach((item) => {
1095
- newTotalWithDiscount += Number(item.price) * Number(item.num);
1096
- });
1097
- newBundleWithDiscount.forEach((item) => {
1098
- var _a, _b, _c;
1099
- const originalPrice = ((_c = (_b = (_a = item.discount_list) == null ? void 0 : _a[0]) == null ? void 0 : _b.discount) == null ? void 0 : _c.original_amount) || item.price;
1100
- newOriginTotalWithDiscount += Number(originalPrice) * Number(item.num);
1101
- });
1090
+ if (newBundleWithDiscount.length > 0) {
1091
+ newBundleWithDiscount.forEach((item) => {
1092
+ var _a, _b, _c;
1093
+ newTotalWithDiscount += Number(item.price) * Number(item.num);
1094
+ const originalPrice = ((_c = (_b = (_a = item.discount_list) == null ? void 0 : _a[0]) == null ? void 0 : _b.discount) == null ? void 0 : _c.original_amount) || item.price;
1095
+ newOriginTotalWithDiscount += Number(originalPrice) * Number(item.num);
1096
+ });
1097
+ }
1102
1098
  }
1103
1099
  if (product == null ? void 0 : product.options) {
1104
1100
  newTotalWithDiscount = product.options.reduce((accumulator, currentValue) => {
@@ -1151,12 +1147,12 @@ var RulesModule = class extends import_BaseModule.BaseModule {
1151
1147
  const allDiscountAmount = (0, import_utils.getDiscountListAmount)(mainDiscountListOriginal);
1152
1148
  newTotalOriginal = new import_decimal.default(mainProductData.price || 0).minus(allDiscountAmount).toNumber() ?? newTotalOriginal;
1153
1149
  newOriginTotalOriginal = mainProductData.origin_total ?? newOriginTotalOriginal;
1154
- }
1155
- if (newBundleOriginal.length > 0) {
1156
- newBundleOriginal.forEach((item) => {
1157
- newTotalOriginal += Number(item.price) * Number(item.num);
1158
- newOriginTotalOriginal += Number(item.price) * Number(item.num);
1159
- });
1150
+ if (newBundleOriginal.length > 0) {
1151
+ newBundleOriginal.forEach((item) => {
1152
+ newTotalOriginal += Number(item.price) * Number(item.num);
1153
+ newOriginTotalOriginal += Number(item.price) * Number(item.num);
1154
+ });
1155
+ }
1160
1156
  }
1161
1157
  if (product == null ? void 0 : product.options) {
1162
1158
  newTotalOriginal = product.options.reduce((accumulator, currentValue) => {
@@ -1231,11 +1227,9 @@ var RulesModule = class extends import_BaseModule.BaseModule {
1231
1227
  newOriginTotal = mainProductData.origin_total ?? newOriginTotal;
1232
1228
  }
1233
1229
  if (newBundle.length > 0) {
1234
- newBundle.forEach((item) => {
1235
- newTotal += Number(item.price) * Number(item.num);
1236
- });
1237
1230
  newBundle.forEach((item) => {
1238
1231
  var _a2, _b2, _c2;
1232
+ newTotal += Number(item.price) * Number(item.num);
1239
1233
  const originalPrice = ((_c2 = (_b2 = (_a2 = item.discount_list) == null ? void 0 : _a2[0]) == null ? void 0 : _b2.discount) == null ? void 0 : _c2.original_amount) || item.price;
1240
1234
  newOriginTotal += Number(originalPrice) * Number(item.num);
1241
1235
  });
@@ -1376,18 +1370,7 @@ var RulesModule = class extends import_BaseModule.BaseModule {
1376
1370
  if (isBundleItem) {
1377
1371
  const priceType = (_c = flatItem.bundleItem) == null ? void 0 : _c.price_type;
1378
1372
  const priceTypeExt = (_d = flatItem.bundleItem) == null ? void 0 : _d.price_type_ext;
1379
- const isOriginalPrice = priceType === "markup" && priceTypeExt === "product_price";
1380
- const isMarkupPrice = priceType === "markup" && (priceTypeExt === "" || !priceTypeExt);
1381
- if (rules.length > 0) {
1382
- if (isOriginalPrice && rules.includes("original_price")) {
1383
- return true;
1384
- }
1385
- if (isMarkupPrice && rules.includes("markup_price")) {
1386
- return true;
1387
- }
1388
- return false;
1389
- }
1390
- return isOriginalPrice;
1373
+ return priceType === "markup" && priceTypeExt === "product_price";
1391
1374
  }
1392
1375
  return false;
1393
1376
  }
@@ -1398,7 +1381,7 @@ var RulesModule = class extends import_BaseModule.BaseModule {
1398
1381
  }
1399
1382
  async destroy() {
1400
1383
  this.core.effects.offByModuleDestroy(this.name);
1401
- await this.core.effects.emit(`${this.name}:onDestroy`, {});
1384
+ await this.core.effects.emit(import_types.RulesHooks.OnDestroy, {});
1402
1385
  console.log("[Rules] 已销毁");
1403
1386
  }
1404
1387
  async clear() {
@@ -44,7 +44,6 @@ type ProductDetail = {
44
44
  num?: number;
45
45
  quantity: number;
46
46
  holder_id?: number | string;
47
- vouchersApplicable?: boolean;
48
47
  startDate?: any;
49
48
  };
50
49
  export interface RulesParamsHooks {
@@ -25,13 +25,4 @@ export declare class ScheduleModule extends BaseModule implements Module, Schedu
25
25
  setOtherProductsIds(ids: number[]): void;
26
26
  getOtherProductsIds(): number[];
27
27
  storeChange(): void;
28
- /**
29
- * 传入一个时间, 判断改时间是否在schedule 内
30
- * @param param0 { date: string, schedule: any } date: 日期, schedule: schedule
31
- * @returns
32
- */
33
- static isInScheduleByDate({ date, schedule, }: {
34
- date: string;
35
- schedule: any;
36
- }): boolean | undefined;
37
28
  }
@@ -38,7 +38,6 @@ var import_dayjs = __toESM(require("dayjs"));
38
38
  var import_isSameOrBefore = __toESM(require("dayjs/plugin/isSameOrBefore"));
39
39
  var import_isSameOrAfter = __toESM(require("dayjs/plugin/isSameOrAfter"));
40
40
  var import_utils = require("../Date/utils");
41
- var import_utils2 = require("./utils");
42
41
  import_dayjs.default.extend(import_isSameOrBefore.default);
43
42
  import_dayjs.default.extend(import_isSameOrAfter.default);
44
43
  var ScheduleModule = class extends import_BaseModule.BaseModule {
@@ -159,65 +158,6 @@ var ScheduleModule = class extends import_BaseModule.BaseModule {
159
158
  });
160
159
  }
161
160
  }
162
- /**
163
- * 传入一个时间, 判断改时间是否在schedule 内
164
- * @param param0 { date: string, schedule: any } date: 日期, schedule: schedule
165
- * @returns
166
- */
167
- static isInScheduleByDate({
168
- date,
169
- schedule
170
- }) {
171
- var _a, _b, _c, _d;
172
- if (schedule.start_time && schedule.end_time) {
173
- const isBeforeStartTime = (0, import_dayjs.default)(date).isBefore(
174
- (0, import_dayjs.default)(schedule.start_time)
175
- );
176
- const isAfterEndTime = (0, import_dayjs.default)(date).isAfter((0, import_dayjs.default)(schedule.end_time));
177
- if (isBeforeStartTime || isAfterEndTime) {
178
- return false;
179
- }
180
- }
181
- let _schedule = {
182
- ...schedule,
183
- // 开始时间向前推一天
184
- start_time: (0, import_dayjs.default)(date).subtract(1, "day").format("YYYY-MM-DD HH:mm:ss"),
185
- end_time: (0, import_dayjs.default)(date).add(1, "day").format("YYYY-MM-DD HH:mm:ss")
186
- };
187
- if (((_b = (_a = _schedule.repeat_rule) == null ? void 0 : _a.end) == null ? void 0 : _b.type) === "never") {
188
- _schedule = {
189
- ..._schedule,
190
- repeat_rule: {
191
- ..._schedule.repeat_rule,
192
- end: {
193
- type: "date",
194
- end_date: _schedule.end_time,
195
- occurrence: null
196
- }
197
- }
198
- };
199
- }
200
- if (((_d = (_c = _schedule.repeat_rule) == null ? void 0 : _c.end) == null ? void 0 : _d.type) === "date") {
201
- _schedule = {
202
- ..._schedule,
203
- repeat_rule: {
204
- ..._schedule.repeat_rule,
205
- end: {
206
- ..._schedule.repeat_rule.end,
207
- end_date: _schedule.end_time
208
- }
209
- }
210
- };
211
- }
212
- const dateRanges = (0, import_utils2.calcScheduleDateRange)({ ..._schedule });
213
- for (const range of dateRanges) {
214
- const startTime = (0, import_dayjs.default)(range.start);
215
- const endTime = (0, import_dayjs.default)(range.end);
216
- if ((0, import_dayjs.default)(date).isSameOrAfter(startTime) && (0, import_dayjs.default)(date).isSameOrBefore(endTime)) {
217
- return true;
218
- }
219
- }
220
- }
221
161
  };
222
162
  // Annotate the CommonJS export names for ESM import in node:
223
163
  0 && (module.exports = {
@@ -3,7 +3,6 @@ export * from './ProductList';
3
3
  export * from './Cart';
4
4
  export * from './Account';
5
5
  export * from './AccountList';
6
- export * from './Customer';
7
6
  export * from './Date';
8
7
  export * from './Guests';
9
8
  export * from './Order';
@@ -21,7 +21,6 @@ __reExport(modules_exports, require("./ProductList"), module.exports);
21
21
  __reExport(modules_exports, require("./Cart"), module.exports);
22
22
  __reExport(modules_exports, require("./Account"), module.exports);
23
23
  __reExport(modules_exports, require("./AccountList"), module.exports);
24
- __reExport(modules_exports, require("./Customer"), module.exports);
25
24
  __reExport(modules_exports, require("./Date"), module.exports);
26
25
  __reExport(modules_exports, require("./Guests"), module.exports);
27
26
  __reExport(modules_exports, require("./Order"), module.exports);
@@ -37,7 +36,6 @@ __reExport(modules_exports, require("./Schedule"), module.exports);
37
36
  ...require("./Cart"),
38
37
  ...require("./Account"),
39
38
  ...require("./AccountList"),
40
- ...require("./Customer"),
41
39
  ...require("./Date"),
42
40
  ...require("./Guests"),
43
41
  ...require("./Order"),
@@ -13,7 +13,6 @@ export interface WindowPlugin extends Plugin {
13
13
  navigator: Partial<Navigator>;
14
14
  document: Partial<Document>;
15
15
  history: History;
16
- interaction?: any;
17
16
  }
18
17
  /**
19
18
  * 简单的 Storage 接口实现
@@ -95,7 +95,8 @@ var BookingByStepImpl = class extends import_BaseModule.BaseModule {
95
95
  "step",
96
96
  "products",
97
97
  "date",
98
- "order"
98
+ "order",
99
+ "payment"
99
100
  ];
100
101
  moduleArr.forEach((step) => {
101
102
  var _a2, _b2;
@@ -116,7 +117,7 @@ var BookingByStepImpl = class extends import_BaseModule.BaseModule {
116
117
  }
117
118
  });
118
119
  this.store.schedule.loadAllSchedule();
119
- this.core.effects.emit(`${this.name}:onInited`, {});
120
+ this.core.effects.emit(import_types.BookingByStepHooks.onInited, {});
120
121
  }
121
122
  // 初始化step
122
123
  initStep(stepList) {
@@ -185,19 +186,13 @@ var BookingByStepImpl = class extends import_BaseModule.BaseModule {
185
186
  collection = [],
186
187
  schedule_date
187
188
  }) {
188
- const res = await this.store.products.loadProducts({
189
+ return this.store.products.loadProducts({
189
190
  category_ids,
190
191
  product_ids,
191
192
  collection,
192
193
  schedule_date,
193
194
  cacheId: this.cacheId
194
195
  });
195
- this.getAvailableDate({
196
- startDate: schedule_date || (0, import_dayjs.default)().format("YYYY-MM-DD"),
197
- endDate: schedule_date || (0, import_dayjs.default)().format("YYYY-MM-DD"),
198
- products: [...res]
199
- });
200
- return res;
201
196
  }
202
197
  /**
203
198
  * 通过 schedule 来读取商品,适用于 session 类商品
@@ -234,12 +229,11 @@ var BookingByStepImpl = class extends import_BaseModule.BaseModule {
234
229
  const allProductIds = [...newProductIds, ...otherProductsIds].filter(
235
230
  (n, index, self) => self.indexOf(n) === index
236
231
  );
237
- const res = await this.loadProducts({
232
+ return await this.loadProducts({
238
233
  product_ids: allProductIds,
239
234
  category_ids,
240
235
  schedule_date: date
241
236
  });
242
- return res;
243
237
  }
244
238
  /**
245
239
  * 更新完商品数据、切换日期、或者在较后的流程里登录了,检测当前购物车里是否有商品,如果有,则需要更新购物车里的商品价格
@@ -606,12 +600,6 @@ var BookingByStepImpl = class extends import_BaseModule.BaseModule {
606
600
  quantity = 1
607
601
  } = product || {};
608
602
  const productData = { ...origin, product_variant_id };
609
- debugger;
610
- if ((0, import_products.isSessionProduct)(productData)) {
611
- if (!date || !date.startTime || !date.endTime) {
612
- return { success: false, errorCode: "date_or_time_required" };
613
- }
614
- }
615
603
  const currentCartItems = this.store.cart.getItems();
616
604
  const stockCheckResult = (0, import_stock.checkProductStock)({
617
605
  productData,
@@ -1741,7 +1729,7 @@ var BookingByStepImpl = class extends import_BaseModule.BaseModule {
1741
1729
  let currentResourcesSummaryCount = 0;
1742
1730
  const currentResourcesTimeSlotCanUsedArr = [];
1743
1731
  const mTimes = m.times.filter((n) => {
1744
- return !(0, import_dayjs.default)(n.start_at).isAfter((0, import_dayjs.default)(item.start), "minute") && !(0, import_dayjs.default)(n.end_at).isBefore((0, import_dayjs.default)(item.end), "minute") || m.onlyComputed && (0, import_dayjs.default)(n.start_at).isBefore((0, import_dayjs.default)(item.end), "minute") && (0, import_dayjs.default)(n.end_at).isAfter((0, import_dayjs.default)(item.start), "minute");
1732
+ return !(0, import_dayjs.default)(n.start_at).isAfter((0, import_dayjs.default)(item.start), "minute") && !(0, import_dayjs.default)(n.end_at).isBefore((0, import_dayjs.default)(item.end), "minute") || (0, import_dayjs.default)(n.start_at).isBefore((0, import_dayjs.default)(item.end), "minute") && (0, import_dayjs.default)(n.end_at).isAfter((0, import_dayjs.default)(item.start), "minute");
1745
1733
  });
1746
1734
  if (mTimes.length === 0) {
1747
1735
  return;
@@ -230,7 +230,7 @@ function checkTimeSlotCapacity(timeSlotStart, timeSlotEnd, cartItems, allResourc
230
230
  let totalAvailableCapacity = 0;
231
231
  resourcesInType.forEach((resource) => {
232
232
  const availableTimes = resource.times.filter((time) => {
233
- return !(0, import_dayjs.default)(time.start_at).isAfter((0, import_dayjs.default)(timeSlotStart), "minute") && !(0, import_dayjs.default)(time.end_at).isBefore((0, import_dayjs.default)(timeSlotEnd), "minute") || resource.onlyComputed && (0, import_dayjs.default)(time.start_at).isBefore((0, import_dayjs.default)(timeSlotEnd), "minute") && (0, import_dayjs.default)(time.end_at).isAfter((0, import_dayjs.default)(timeSlotStart), "minute");
233
+ return !(0, import_dayjs.default)(time.start_at).isAfter((0, import_dayjs.default)(timeSlotStart), "minute") && !(0, import_dayjs.default)(time.end_at).isBefore((0, import_dayjs.default)(timeSlotEnd), "minute") || (0, import_dayjs.default)(time.start_at).isBefore((0, import_dayjs.default)(timeSlotEnd), "minute") && (0, import_dayjs.default)(time.end_at).isAfter((0, import_dayjs.default)(timeSlotStart), "minute");
234
234
  });
235
235
  if (availableTimes.length > 0) {
236
236
  totalAvailableCapacity += resource.capacity || 0;
@@ -9,9 +9,3 @@ export declare const getAvailableProductResources: (products: ProductData[]) =>
9
9
  rules: any[];
10
10
  resourcesMap: Record<number, ProductResourceItem>;
11
11
  };
12
- /**
13
- * 判断商品是否是 session 商品
14
- * @param product 商品数据
15
- * @returns 是否是 session 商品
16
- */
17
- export declare const isSessionProduct: (product: ProductData) => boolean;
@@ -19,8 +19,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
19
19
  // src/solution/BookingByStep/utils/products.ts
20
20
  var products_exports = {};
21
21
  __export(products_exports, {
22
- getAvailableProductResources: () => getAvailableProductResources,
23
- isSessionProduct: () => isSessionProduct
22
+ getAvailableProductResources: () => getAvailableProductResources
24
23
  });
25
24
  module.exports = __toCommonJS(products_exports);
26
25
  var getAvailableProductResources = (products) => {
@@ -58,12 +57,7 @@ var getAvailableProductResources = (products) => {
58
57
  });
59
58
  return { resourceIds: [...new Set(resourceIds)], rules, resourcesMap };
60
59
  };
61
- var isSessionProduct = (product) => {
62
- var _a;
63
- return (((_a = product == null ? void 0 : product["schedule.ids"]) == null ? void 0 : _a.length) ?? 0) > 0;
64
- };
65
60
  // Annotate the CommonJS export names for ESM import in node:
66
61
  0 && (module.exports = {
67
- getAvailableProductResources,
68
- isSessionProduct
62
+ getAvailableProductResources
69
63
  });