@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
@@ -185,7 +185,7 @@ var DiscountModule = class extends import_BaseModule.BaseModule {
185
185
  async destroy() {
186
186
  this.store.discountList = [];
187
187
  this.core.effects.offByModuleDestroy(this.name);
188
- await this.core.effects.emit(`${this.name}:onDestroy`, {});
188
+ await this.core.effects.emit(import_types.DiscountHooks.OnDestroy, {});
189
189
  console.log("[Discount] 已销毁");
190
190
  }
191
191
  async clear() {
@@ -41,8 +41,8 @@ var GuestListModule = class extends import_BaseModule.BaseModule {
41
41
  }
42
42
  async addGuest(guest) {
43
43
  this.state.list.push(guest);
44
- await this.core.effects.emit(`${this.name}:onGuestAdd`, guest);
45
- await this.core.effects.emit(`${this.name}:onGuestChange`, this.state.list);
44
+ await this.core.effects.emit(import_types.GuestHooks.OnGuestAdd, guest);
45
+ await this.core.effects.emit(import_types.GuestHooks.OnGuestChange, this.state.list);
46
46
  }
47
47
  async updateGuest(id, updates) {
48
48
  const index = this.state.list.findIndex((g) => g.id === id);
@@ -56,15 +56,15 @@ var GuestListModule = class extends import_BaseModule.BaseModule {
56
56
  import_types.GuestHooks.OnGuestUpdate,
57
57
  this.state.list[index]
58
58
  );
59
- await this.core.effects.emit(`${this.name}:onGuestChange`, this.state.list);
59
+ await this.core.effects.emit(import_types.GuestHooks.OnGuestChange, this.state.list);
60
60
  }
61
61
  async removeGuest(id) {
62
62
  const index = this.state.list.findIndex((g) => g.id === id);
63
63
  if (index === -1)
64
64
  return;
65
65
  const [removed] = this.state.list.splice(index, 1);
66
- await this.core.effects.emit(`${this.name}:onGuestRemove`, removed);
67
- await this.core.effects.emit(`${this.name}:onGuestChange`, this.state.list);
66
+ await this.core.effects.emit(import_types.GuestHooks.OnGuestRemove, removed);
67
+ await this.core.effects.emit(import_types.GuestHooks.OnGuestChange, this.state.list);
68
68
  }
69
69
  async getGuests() {
70
70
  return this.state.list;
@@ -77,8 +77,8 @@ var GuestListModule = class extends import_BaseModule.BaseModule {
77
77
  if (!guest)
78
78
  return;
79
79
  guest.items.push(item);
80
- await this.core.effects.emit(`${this.name}:onGuestUpdate`, guest);
81
- await this.core.effects.emit(`${this.name}:onGuestChange`, this.state.list);
80
+ await this.core.effects.emit(import_types.GuestHooks.OnGuestUpdate, guest);
81
+ await this.core.effects.emit(import_types.GuestHooks.OnGuestChange, this.state.list);
82
82
  }
83
83
  async removeItemFromGuest(guestId, itemId) {
84
84
  const guest = this.state.list.find((g) => g.id === guestId);
@@ -88,8 +88,8 @@ var GuestListModule = class extends import_BaseModule.BaseModule {
88
88
  if (index === -1)
89
89
  return;
90
90
  guest.items.splice(index, 1);
91
- await this.core.effects.emit(`${this.name}:onGuestUpdate`, guest);
92
- await this.core.effects.emit(`${this.name}:onGuestChange`, this.state.list);
91
+ await this.core.effects.emit(import_types.GuestHooks.OnGuestUpdate, guest);
92
+ await this.core.effects.emit(import_types.GuestHooks.OnGuestChange, this.state.list);
93
93
  }
94
94
  };
95
95
  // Annotate the CommonJS export names for ESM import in node:
@@ -1,27 +1,14 @@
1
1
  import { Module, PisellCore, ModuleOptions } from '../../types';
2
2
  import { BaseModule } from '../BaseModule';
3
- import { OrderModuleAPI, CommitOrderParams, CheckoutOrderParams } from './types';
3
+ import { OrderModuleAPI, CommitOrderParams } from './types';
4
4
  import { CartItem } from '../Cart/types';
5
5
  export declare class OrderModule extends BaseModule implements Module, OrderModuleAPI {
6
6
  protected defaultName: string;
7
7
  protected defaultVersion: string;
8
8
  private store;
9
9
  private request;
10
- private logger;
11
10
  constructor(name?: string, version?: string);
12
11
  initialize(core: PisellCore, options: ModuleOptions): Promise<void>;
13
- /**
14
- * 记录信息日志
15
- */
16
- private logInfo;
17
- /**
18
- * 记录警告日志
19
- */
20
- private logWarning;
21
- /**
22
- * 记录错误日志
23
- */
24
- private logError;
25
12
  createOrder(params: CommitOrderParams['query']): {
26
13
  type: "virtual" | "appointment_booking";
27
14
  platform: string;
@@ -39,15 +26,4 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
39
26
  type: 'holder' | 'account';
40
27
  }): boolean;
41
28
  submitOrder(order: CommitOrderParams): Promise<void>;
42
- /**
43
- * Checkout 专用:创建订单到后端
44
- *
45
- * 专门为 Checkout 模块设计的订单创建方法,
46
- * 直接调用 /order/checkout 接口创建订单
47
- * 接收已经处理好的订单数据,无需再处理购物车
48
- *
49
- * @param params Checkout 订单参数(已处理的订单数据)
50
- * @returns 后端返回的订单数据(包含订单ID等)
51
- */
52
- createOrderByCheckout(params: CheckoutOrderParams): Promise<any>;
53
29
  }
@@ -1,8 +1,6 @@
1
- var __create = Object.create;
2
1
  var __defProp = Object.defineProperty;
3
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
5
  var __export = (target, all) => {
8
6
  for (var name in all)
@@ -16,14 +14,6 @@ var __copyProps = (to, from, except, desc) => {
16
14
  }
17
15
  return to;
18
16
  };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
18
 
29
19
  // src/modules/Order/index.ts
@@ -35,11 +25,9 @@ module.exports = __toCommonJS(Order_exports);
35
25
  var import_BaseModule = require("../BaseModule");
36
26
  var import_utils = require("./utils");
37
27
  var import_utils2 = require("../Product/utils");
38
- var import_dayjs = __toESM(require("dayjs"));
39
28
  var OrderModule = class extends import_BaseModule.BaseModule {
40
- // LoggerManager 实例
41
29
  constructor(name, version) {
42
- super(name || "order", version);
30
+ super(name, version);
43
31
  this.defaultName = "order";
44
32
  this.defaultVersion = "1.0.0";
45
33
  }
@@ -47,49 +35,6 @@ var OrderModule = class extends import_BaseModule.BaseModule {
47
35
  this.core = core;
48
36
  this.store = options.store;
49
37
  this.request = this.core.getPlugin("request");
50
- const appPlugin = this.core.getPlugin("app");
51
- if (!appPlugin) {
52
- throw new Error("Order 模块需要 app 插件支持");
53
- }
54
- const app = appPlugin.getApp();
55
- this.logger = app.logger;
56
- this.logInfo("OrderModule initialized successfully");
57
- }
58
- /**
59
- * 记录信息日志
60
- */
61
- logInfo(title, metadata) {
62
- if (this.logger) {
63
- this.logger.addLog({
64
- type: "info",
65
- title: `[OrderModule] ${title}`,
66
- metadata: metadata || {}
67
- });
68
- }
69
- }
70
- /**
71
- * 记录警告日志
72
- */
73
- logWarning(title, metadata) {
74
- if (this.logger) {
75
- this.logger.addLog({
76
- type: "warning",
77
- title: `[OrderModule] ${title}`,
78
- metadata: metadata || {}
79
- });
80
- }
81
- }
82
- /**
83
- * 记录错误日志
84
- */
85
- logError(title, metadata) {
86
- if (this.logger) {
87
- this.logger.addLog({
88
- type: "error",
89
- title: `[OrderModule] ${title}`,
90
- metadata: metadata || {}
91
- });
92
- }
93
38
  }
94
39
  createOrder(params) {
95
40
  var _a;
@@ -146,11 +91,6 @@ var OrderModule = class extends import_BaseModule.BaseModule {
146
91
  return order;
147
92
  }
148
93
  checkBeforeSubmitOrder(params) {
149
- var _a;
150
- this.logInfo("checkBeforeSubmitOrder called", {
151
- cartItemsCount: ((_a = params.cartItems) == null ? void 0 : _a.length) || 0,
152
- type: params.type
153
- });
154
94
  const { cartItems, type } = params;
155
95
  if (type === "holder") {
156
96
  const hasNoHolderId = cartItems.some((item) => !item.holder_id);
@@ -161,136 +101,11 @@ var OrderModule = class extends import_BaseModule.BaseModule {
161
101
  return true;
162
102
  }
163
103
  async submitOrder(order) {
164
- var _a, _b, _c;
165
- this.logInfo("submitOrder called", {
166
- url: order.url,
167
- orderType: order.query.type,
168
- platform: order.query.platform,
169
- cartItemsCount: ((_a = order.query.cartItems) == null ? void 0 : _a.length) || 0
170
- });
171
104
  const { url, query } = order;
172
105
  const fetchUrl = url || "/order/appointment";
173
106
  const params = this.createOrder(query);
174
- this.logInfo("Calling backend order API", {
175
- url: fetchUrl,
176
- orderType: params.type,
177
- platform: params.platform,
178
- isDeposit: params.is_deposit,
179
- bookingsCount: ((_b = params.bookings) == null ? void 0 : _b.length) || 0,
180
- relationProductsCount: ((_c = params.relation_products) == null ? void 0 : _c.length) || 0,
181
- scheduleDate: params.schedule_date
182
- });
183
107
  return this.request.post(fetchUrl, params);
184
108
  }
185
- /**
186
- * Checkout 专用:创建订单到后端
187
- *
188
- * 专门为 Checkout 模块设计的订单创建方法,
189
- * 直接调用 /order/checkout 接口创建订单
190
- * 接收已经处理好的订单数据,无需再处理购物车
191
- *
192
- * @param params Checkout 订单参数(已处理的订单数据)
193
- * @returns 后端返回的订单数据(包含订单ID等)
194
- */
195
- async createOrderByCheckout(params) {
196
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
197
- this.logInfo("createOrderByCheckout called", {
198
- type: params.type,
199
- platform: params.platform,
200
- is_deposit: params.is_deposit,
201
- customer_id: params.customer_id,
202
- bookingsCount: ((_a = params.bookings) == null ? void 0 : _a.length) || 0,
203
- relationProductsCount: ((_b = params.relation_products) == null ? void 0 : _b.length) || 0,
204
- paymentsCount: ((_c = params.payments) == null ? void 0 : _c.length) || 0,
205
- depositAmount: params.deposit_amount,
206
- productTaxFee: params.product_tax_fee,
207
- note: params.note,
208
- scheduleDate: params.schedule_date,
209
- hasOrderId: !!params.order_id,
210
- orderIdIncluded: params.order_id,
211
- paymentMethods: ((_d = params.payments) == null ? void 0 : _d.map((p) => p.code)) || []
212
- });
213
- console.log("[Order] createOrderByCheckout 开始创建订单:", {
214
- type: params.type,
215
- platform: params.platform,
216
- is_deposit: params.is_deposit,
217
- customer_id: params.customer_id,
218
- bookingsCount: ((_e = params.bookings) == null ? void 0 : _e.length) || 0,
219
- relationProductsCount: ((_f = params.relation_products) == null ? void 0 : _f.length) || 0,
220
- paymentsCount: ((_g = params.payments) == null ? void 0 : _g.length) || 0
221
- });
222
- try {
223
- const orderData = {
224
- sales_channel: "my_pisel",
225
- order_sales_channel: "online_store",
226
- shop_note: "",
227
- schedule_date: "",
228
- is_deposit: 0,
229
- bookings: [],
230
- relation_products: [],
231
- relation_forms: [],
232
- payments: [],
233
- is_full_overwrite_flag: 1,
234
- ...params
235
- // 使用传入的参数覆盖默认值
236
- };
237
- if ((_h = orderData.payments) == null ? void 0 : _h.length) {
238
- orderData.small_ticket_data_flag = 1;
239
- }
240
- if (!params.order_id && !orderData.schedule_date) {
241
- orderData.schedule_date = (0, import_dayjs.default)().format("YYYY-MM-DD HH:mm:ss");
242
- }
243
- console.log("[Order] 调用后端接口创建订单:", {
244
- url: "/order/checkout",
245
- orderType: orderData.type,
246
- platform: orderData.platform,
247
- isDeposit: orderData.is_deposit,
248
- customerId: orderData.customer_id,
249
- bookingsCount: ((_i = orderData.bookings) == null ? void 0 : _i.length) || 0,
250
- relationProductsCount: ((_j = orderData.relation_products) == null ? void 0 : _j.length) || 0,
251
- paymentsCount: ((_k = orderData.payments) == null ? void 0 : _k.length) || 0,
252
- paymentsMethods: ((_l = orderData.payments) == null ? void 0 : _l.map((p) => p.code)) || []
253
- });
254
- this.logInfo("Calling backend checkout API", {
255
- url: "/order/checkout",
256
- orderType: orderData.type,
257
- platform: orderData.platform,
258
- isDeposit: orderData.is_deposit,
259
- customerId: orderData.customer_id,
260
- depositAmount: orderData.deposit_amount,
261
- bookingsCount: ((_m = orderData.bookings) == null ? void 0 : _m.length) || 0,
262
- relationProductsCount: ((_n = orderData.relation_products) == null ? void 0 : _n.length) || 0,
263
- paymentsCount: ((_o = orderData.payments) == null ? void 0 : _o.length) || 0,
264
- paymentMethods: ((_p = orderData.payments) == null ? void 0 : _p.map((p) => ({
265
- code: p.code,
266
- amount: p.amount,
267
- type: p.type,
268
- hasVoucherId: !!p.voucher_id,
269
- orderPaymentType: p.order_payment_type
270
- }))) || [],
271
- productTaxFee: orderData.product_tax_fee,
272
- note: orderData.note,
273
- scheduleDate: orderData.schedule_date,
274
- hasOrderId: !!orderData.order_id,
275
- smallTicketDataFlag: orderData.small_ticket_data_flag
276
- });
277
- const response = await this.request.post("/order/checkout", orderData);
278
- this.logInfo("Order API called successfully", {
279
- response
280
- });
281
- console.log("[Order] 订单创建成功,后端响应:", {
282
- success: !!response,
283
- hasOrderId: !!(((_q = response == null ? void 0 : response.data) == null ? void 0 : _q.order_id) || (response == null ? void 0 : response.order_id))
284
- });
285
- return response;
286
- } catch (error) {
287
- console.error("[Order] createOrderByCheckout 创建订单失败:", error);
288
- this.logInfo("Order API called failed", {
289
- error: error instanceof Error ? error.message : String(error)
290
- });
291
- throw error;
292
- }
293
- }
294
109
  };
295
110
  // Annotate the CommonJS export names for ESM import in node:
296
111
  0 && (module.exports = {
@@ -19,45 +19,6 @@ export interface CommitOrderParams {
19
19
  extraData?: Record<string, any>;
20
20
  };
21
21
  }
22
- /**
23
- * 支付项数据
24
- */
25
- export interface PaymentItemData {
26
- /** 当前支付项的唯一 ID */
27
- uuid: string;
28
- /** 当前支付方式付出去多少钱 */
29
- amount: string;
30
- /** 支付类型代码 */
31
- code: string;
32
- /** 支付类型id */
33
- id: number;
34
- /** 支付类型名称 */
35
- name: string;
36
- /** 支付类型 */
37
- type: string;
38
- /** 是否已同步到后端 */
39
- isSynced?: boolean;
40
- }
41
- /**
42
- * Checkout 专用订单创建参数
43
- */
44
- export interface CheckoutOrderParams {
45
- type: 'virtual' | 'appointment_booking';
46
- platform: 'PC' | 'H5';
47
- sales_channel?: string;
48
- order_sales_channel?: string;
49
- bookings?: any[];
50
- shop_note?: string;
51
- schedule_date?: string;
52
- is_deposit?: number;
53
- relation_products?: any[];
54
- relation_forms?: any[];
55
- payments?: PaymentItemData[];
56
- customer_id?: string;
57
- /** 小票数据标记,当有支付项时设置为1 */
58
- small_ticket_data_flag?: number;
59
- [key: string]: any;
60
- }
61
22
  /**
62
23
  * 订单模块 API
63
24
  */
@@ -80,10 +41,4 @@ export interface OrderModuleAPI {
80
41
  * @param params 订单信息
81
42
  */
82
43
  submitOrder: (params: CommitOrderParams) => Promise<void>;
83
- /**
84
- * Checkout 专用:创建订单到后端
85
- * @param params 订单参数
86
- * @returns 后端返回的订单数据
87
- */
88
- createOrderByCheckout: (params: CheckoutOrderParams) => Promise<any>;
89
44
  }
@@ -60,7 +60,7 @@ var getAllDiscountList = (cartItem) => {
60
60
  var _a, _b, _c, _d;
61
61
  let discountList = ((_b = (_a = cartItem == null ? void 0 : cartItem._origin) == null ? void 0 : _a.product) == null ? void 0 : _b.discount_list) || [];
62
62
  (((_d = (_c = cartItem == null ? void 0 : cartItem._origin) == null ? void 0 : _c.product) == null ? void 0 : _d.product_bundle) || []).forEach((item) => {
63
- discountList = [...discountList, ...(item == null ? void 0 : item.discount_list) || []];
63
+ discountList = [...discountList, ...item.discount_list || []];
64
64
  item.discount_list = void 0;
65
65
  });
66
66
  return discountList;
@@ -1,191 +1,16 @@
1
1
  import { Module, PisellCore, ModuleOptions } from '../../types';
2
- import { RequestPlugin } from '../../plugins';
3
2
  import { BaseModule } from '../BaseModule';
4
- import { PaymentModuleAPI, PaymentMethod, PaymentOrder, PaymentItem, PaymentItemInput, PaymentUpdateFields, PushOrderParams, CashPayment, EftposPayment, WalletPassPayment, RoundingRule, RoundingInterval, RoundingResult } from './types';
5
- export * from './types';
6
- export { generateRequestUniqueId };
7
- /**
8
- * 生成请求唯一ID
9
- * 格式: 年月日时分秒毫秒+4位随机数
10
- * 示例: 20241201143025123456
11
- */
12
- declare function generateRequestUniqueId(): string;
13
- /**
14
- * 支付模块实现
15
- *
16
- * 负责处理支付相关的数据管理和本地存储
17
- */
3
+ import { Payment, PaymentModuleAPI, PaymentMethod, PaymentStatus } from './types';
18
4
  export declare class PaymentModule extends BaseModule implements Module, PaymentModuleAPI {
19
5
  protected defaultName: string;
20
6
  protected defaultVersion: string;
21
- request: RequestPlugin;
22
- private app;
23
- private store;
24
- private dbManager;
25
- private logger;
26
- protected otherParams: any;
27
- cash: CashPayment;
28
- eftpos: EftposPayment;
29
- wallet: WalletPassPayment;
7
+ private state;
30
8
  constructor(name?: string, version?: string);
31
- initialize(core: PisellCore, options: ModuleOptions): Promise<void>;
32
- /**
33
- * 记录信息日志
34
- */
35
- logInfo(title: string, metadata?: any): void;
36
- /**
37
- * 记录警告日志
38
- */
39
- logWarning(title: string, metadata?: any): void;
40
- /**
41
- * 记录错误日志
42
- */
43
- logError(title: string, error?: any, metadata?: any): void;
44
- /**
45
- * 记录调试日志
46
- */
47
- logDebug(title: string, metadata?: any): void;
48
- /**
49
- * 网络恢复以后,尝试执行队列
50
- *
51
- */
52
- private registerNetworkHandlers;
53
- /**
54
- * 获取支付方式列表
55
- */
56
- getPayMethodListAsync(): Promise<PaymentMethod[]>;
57
- /**
58
- * 后台刷新支付方式列表
59
- */
60
- private refreshPaymentMethodsInBackground;
61
- /**
62
- * 检查支付方式列表是否有变化
63
- */
64
- private hasPaymentMethodsChanged;
65
- /**
66
- * 获取订单列表
67
- */
68
- getOrderListAsync(): Promise<PaymentOrder[]>;
69
- /**
70
- * 根据订单UUID获取支付订单(新方法)
71
- */
72
- getPaymentOrderByUuidAsync(orderUuid: string): Promise<PaymentOrder | null>;
73
- /**
74
- * 创建支付订单(新方法,专注支付数据)
75
- */
76
- createPaymentOrderAsync(params: PushOrderParams): Promise<PaymentOrder>;
77
- /**
78
- * 删除支付订单(新方法)
79
- */
80
- deletePaymentOrderAsync(orderUuid: string): Promise<void>;
81
- /**
82
- * 更新订单
83
- */
84
- updateOrderAsync(orderUuid: string, params: Partial<PaymentOrder>): Promise<void>;
85
- /**
86
- * 基于UUID替换订单ID
87
- *
88
- * 此方法用于将本地虚拟订单ID替换为真实的订单ID。
89
- * 当前端模拟下单流程完成后,后端返回真实订单ID时调用此方法。
90
- *
91
- * @param orderUuid 订单的UUID
92
- * @param newOrderId 新的订单ID (来自后端)
93
- * @returns 更新后的订单对象,如果订单不存在则返回null
94
- */
95
- replaceOrderIdByUuidAsync(orderUuid: string, newOrderId: string): Promise<PaymentOrder | null>;
96
- /**
97
- * 获取支付项(新方法)
98
- *
99
- * @param orderUuid 订单UUID
100
- * @param includeVoided 是否包含已撤销的支付项,默认为false
101
- * @returns 支付项数组
102
- */
103
- getPaymentItemsAsync(orderUuid: string, includeVoided?: boolean): Promise<PaymentItem[]>;
104
- /**
105
- * 获取所有支付项(包括已撤销的)
106
- *
107
- * @param orderUuid 订单UUID
108
- * @returns 所有支付项数组(包括撤销的)
109
- */
110
- getAllPaymentItemsAsync(orderUuid: string): Promise<PaymentItem[]>;
111
- /**
112
- * 为某个订单添加支付项(新方法)
113
- */
114
- addPaymentItemAsync(orderUuid: string, paymentItem: PaymentItemInput): Promise<void>;
115
- /**
116
- * 删除一个支付项 - 标记删除而非物理删除
117
- */
118
- deletePaymentAsync(orderUuid: string, paymentUuid: string): Promise<void>;
119
- /**
120
- * 批量更新代金券类支付项(覆盖更新)
121
- *
122
- * 删除所有现有的带 voucher_id 的支付项,然后添加新的代金券支付项
123
- * 这是一个覆盖式更新,确保代金券支付项的一致性
124
- */
125
- updateVoucherPaymentItemsAsync(orderUuid: string, voucherPaymentItems: PaymentItemInput[]): Promise<void>;
126
- /**
127
- * 更新一个支付项
128
- */
129
- updatePaymentAsync(orderUuid: string, paymentUuid: string, params: PaymentUpdateFields): Promise<void>;
130
- /**
131
- * 提交支付
132
- */
133
- submitPayAsync(orderUuid?: string): Promise<{
134
- status: 'success' | 'failed';
135
- }>;
136
- /**
137
- * 提交单个订单的支付(推送到任务队列)
138
- */
139
- private submitSingleOrderPayment;
140
- /**
141
- * 获取订单剩余待付金额
142
- */
143
- getRemainingOrderAmountAsync(orderUuid: string): Promise<number>;
144
- /**
145
- * 在比如现金支付界面的地方,用户输入了一个金额,在下方显示剩余多少金额,通过此方法获取
146
- */
147
- getRemainingOrderAmountWithInputAsync(inputAmount: string | number, orderUuid: string): Promise<number>;
148
- /**
149
- * 重新计算订单金额
150
- */
151
- private recalculateOrderAmount;
152
- /**
153
- * 获取现金支付方式
154
- */
155
- getCashPaymentMethod(): Promise<PaymentMethod | null>;
156
- /**
157
- * 获取Eftpos支付方式
158
- */
159
- getEftposPaymentMethod(): Promise<PaymentMethod | null>;
160
- /**
161
- * 获取钱包支付方式
162
- */
163
- getWalletPaymentMethod(): Promise<PaymentMethod | null>;
164
- /**
165
- * 确保支付模块所需的数据库表已创建
166
- */
167
- private ensurePaymentTables;
168
- /**
169
- * 获取部分支付的订单
170
- */
171
- getPartiallyPaidOrdersAsync(): Promise<PaymentOrder[]>;
172
- /**
173
- * 智能金额舍入
174
- *
175
- * 根据指定的舍入间隔和规则对金额进行舍入处理
176
- *
177
- * @param originalAmount 原始金额
178
- * @param interval 舍入间隔 (0.05, 0.1, 0.5, 1)
179
- * @param rule 舍入规则 (standard, standard_down, always_up, always_down)
180
- * @returns 舍入结果详情(包含原始金额、舍入后金额和舍入差额)
181
- */
182
- roundAmountAsync(originalAmount: number | string, interval: RoundingInterval | number, rule: RoundingRule | string): Promise<RoundingResult>;
183
- /**
184
- * 标准舍入处理(处理中点情况)
185
- *
186
- * @param value 要舍入的值
187
- * @param midpointUp 中点是否向上舍入
188
- * @returns 舍入后的值
189
- */
190
- private standardRound;
9
+ initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
10
+ processPayment(paymentId: string): Promise<void>;
11
+ getPayment(paymentId: string): Promise<Payment>;
12
+ getPaymentHistory(): Promise<Payment[]>;
13
+ refund(paymentId: string): Promise<void>;
14
+ getAvailablePaymentMethods(): PaymentMethod[];
15
+ checkPaymentStatus(paymentId: string): Promise<PaymentStatus>;
191
16
  }