@pisell/pisellos 3.0.76 → 3.0.78

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 (314) 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/Date/types.d.ts +3 -1
  14. package/dist/modules/Discount/index.d.ts +0 -1
  15. package/dist/modules/Discount/index.js +1 -1
  16. package/dist/modules/Guests/index.js +9 -9
  17. package/dist/modules/Order/index.d.ts +1 -25
  18. package/dist/modules/Order/index.js +3 -224
  19. package/dist/modules/Order/types.d.ts +0 -45
  20. package/dist/modules/Order/types.js +0 -8
  21. package/dist/modules/Order/utils.js +1 -1
  22. package/dist/modules/Payment/index.d.ts +9 -184
  23. package/dist/modules/Payment/index.js +109 -2084
  24. package/dist/modules/Payment/types.d.ts +30 -772
  25. package/dist/modules/Payment/types.js +12 -236
  26. package/dist/modules/ProductList/index.d.ts +1 -12
  27. package/dist/modules/ProductList/index.js +6 -29
  28. package/dist/modules/Resource/index.js +1 -1
  29. package/dist/modules/Rules/index.d.ts +4 -3
  30. package/dist/modules/Rules/index.js +121 -78
  31. package/dist/modules/Rules/types.d.ts +6 -1
  32. package/dist/modules/Rules/types.js +8 -0
  33. package/dist/modules/Schedule/index.d.ts +0 -9
  34. package/dist/modules/Schedule/index.js +0 -77
  35. package/dist/modules/index.d.ts +0 -1
  36. package/dist/modules/index.js +0 -1
  37. package/dist/plugins/window.d.ts +0 -1
  38. package/dist/solution/BookingByStep/index.d.ts +17 -0
  39. package/dist/solution/BookingByStep/index.js +525 -190
  40. package/dist/solution/BookingByStep/utils/products.d.ts +0 -6
  41. package/dist/solution/BookingByStep/utils/products.js +0 -10
  42. package/dist/solution/BookingByStep/utils/resources.js +4 -0
  43. package/dist/solution/BuyTickets/index.js +8 -7
  44. package/dist/solution/ShopDiscount/index.d.ts +12 -10
  45. package/dist/solution/ShopDiscount/index.js +64 -110
  46. package/dist/solution/ShopDiscount/types.d.ts +0 -8
  47. package/dist/solution/ShopDiscount/utils.js +1 -0
  48. package/dist/solution/index.d.ts +0 -2
  49. package/dist/solution/index.js +1 -3
  50. package/dist/types/index.d.ts +1 -4
  51. package/lib/core/index.js +1 -1
  52. package/lib/effects/index.d.ts +3 -5
  53. package/lib/effects/index.js +1 -17
  54. package/lib/modules/Account/index.js +3 -2
  55. package/lib/modules/AccountList/index.d.ts +1 -7
  56. package/lib/modules/AccountList/index.js +0 -27
  57. package/lib/modules/AccountList/types.d.ts +0 -28
  58. package/lib/modules/BaseModule.d.ts +0 -3
  59. package/lib/modules/BaseModule.js +0 -9
  60. package/lib/modules/Cart/index.d.ts +0 -1
  61. package/lib/modules/Cart/index.js +2 -5
  62. package/lib/modules/Date/types.d.ts +3 -1
  63. package/lib/modules/Discount/index.d.ts +0 -1
  64. package/lib/modules/Discount/index.js +1 -1
  65. package/lib/modules/Guests/index.js +9 -9
  66. package/lib/modules/Order/index.d.ts +1 -25
  67. package/lib/modules/Order/index.js +1 -186
  68. package/lib/modules/Order/types.d.ts +0 -45
  69. package/lib/modules/Order/utils.js +1 -1
  70. package/lib/modules/Payment/index.d.ts +9 -184
  71. package/lib/modules/Payment/index.js +51 -1084
  72. package/lib/modules/Payment/types.d.ts +30 -772
  73. package/lib/modules/Payment/types.js +6 -79
  74. package/lib/modules/ProductList/index.d.ts +1 -12
  75. package/lib/modules/ProductList/index.js +5 -31
  76. package/lib/modules/Resource/index.js +1 -1
  77. package/lib/modules/Rules/index.d.ts +4 -3
  78. package/lib/modules/Rules/index.js +64 -43
  79. package/lib/modules/Rules/types.d.ts +6 -1
  80. package/lib/modules/Rules/types.js +11 -2
  81. package/lib/modules/Schedule/index.d.ts +0 -9
  82. package/lib/modules/Schedule/index.js +0 -60
  83. package/lib/modules/index.d.ts +0 -1
  84. package/lib/modules/index.js +0 -2
  85. package/lib/plugins/window.d.ts +0 -1
  86. package/lib/solution/BookingByStep/index.d.ts +17 -0
  87. package/lib/solution/BookingByStep/index.js +325 -60
  88. package/lib/solution/BookingByStep/utils/products.d.ts +0 -6
  89. package/lib/solution/BookingByStep/utils/products.js +2 -8
  90. package/lib/solution/BookingByStep/utils/resources.js +4 -1
  91. package/lib/solution/BuyTickets/index.js +8 -7
  92. package/lib/solution/ShopDiscount/index.d.ts +12 -10
  93. package/lib/solution/ShopDiscount/index.js +30 -51
  94. package/lib/solution/ShopDiscount/types.d.ts +0 -8
  95. package/lib/solution/index.d.ts +0 -2
  96. package/lib/solution/index.js +1 -5
  97. package/lib/types/index.d.ts +1 -4
  98. package/package.json +1 -3
  99. package/dist/modules/Customer/constants.d.ts +0 -7
  100. package/dist/modules/Customer/constants.js +0 -12
  101. package/dist/modules/Customer/index.d.ts +0 -122
  102. package/dist/modules/Customer/index.js +0 -696
  103. package/dist/modules/Customer/types.d.ts +0 -146
  104. package/dist/modules/Customer/types.js +0 -41
  105. package/dist/modules/Payment/cash.d.ts +0 -19
  106. package/dist/modules/Payment/cash.js +0 -97
  107. package/dist/modules/Payment/cashRecommendationAlgorithm.d.ts +0 -22
  108. package/dist/modules/Payment/cashRecommendationAlgorithm.js +0 -423
  109. package/dist/modules/Payment/eftpos.d.ts +0 -11
  110. package/dist/modules/Payment/eftpos.js +0 -80
  111. package/dist/modules/Payment/mx51.d.ts +0 -0
  112. package/dist/modules/Payment/mx51.js +0 -0
  113. package/dist/modules/Payment/utils.d.ts +0 -17
  114. package/dist/modules/Payment/utils.js +0 -62
  115. package/dist/modules/Payment/walletpass.d.ts +0 -99
  116. package/dist/modules/Payment/walletpass.js +0 -711
  117. package/dist/plugins/app-types/app/app.d.ts +0 -83
  118. package/dist/plugins/app-types/app/const.d.ts +0 -4
  119. package/dist/plugins/app-types/app/index.d.ts +0 -14
  120. package/dist/plugins/app-types/applicationManager/application.d.ts +0 -50
  121. package/dist/plugins/app-types/applicationManager/index.d.ts +0 -13
  122. package/dist/plugins/app-types/config.d.ts +0 -3
  123. package/dist/plugins/app-types/cookie/index.d.ts +0 -13
  124. package/dist/plugins/app-types/data/index.d.ts +0 -8
  125. package/dist/plugins/app-types/history/config.d.ts +0 -24
  126. package/dist/plugins/app-types/history/index.d.ts +0 -20
  127. package/dist/plugins/app-types/history/type.d.ts +0 -2
  128. package/dist/plugins/app-types/hooks/index.d.ts +0 -12
  129. package/dist/plugins/app-types/hooks/useDelayedValue/index.d.ts +0 -2
  130. package/dist/plugins/app-types/hooks/useDispatch/index.d.ts +0 -2
  131. package/dist/plugins/app-types/hooks/useLowCode/index.d.ts +0 -13
  132. package/dist/plugins/app-types/hooks/useStore/index.d.ts +0 -6
  133. package/dist/plugins/app-types/index.d.ts +0 -6
  134. package/dist/plugins/app-types/indexDB/index.d.ts +0 -178
  135. package/dist/plugins/app-types/locales/en.d.ts +0 -3
  136. package/dist/plugins/app-types/locales/index.d.ts +0 -37
  137. package/dist/plugins/app-types/locales/original.d.ts +0 -3
  138. package/dist/plugins/app-types/locales/type.d.ts +0 -19
  139. package/dist/plugins/app-types/locales/zh-CN.d.ts +0 -3
  140. package/dist/plugins/app-types/locales/zh-HK.d.ts +0 -3
  141. package/dist/plugins/app-types/logger/feishu.d.ts +0 -11
  142. package/dist/plugins/app-types/logger/index.d.ts +0 -122
  143. package/dist/plugins/app-types/menuManager/hooks.d.ts +0 -17
  144. package/dist/plugins/app-types/menuManager/index.d.ts +0 -28
  145. package/dist/plugins/app-types/models/global.d.ts +0 -32
  146. package/dist/plugins/app-types/models/index.d.ts +0 -45
  147. package/dist/plugins/app-types/models/type.d.ts +0 -2
  148. package/dist/plugins/app-types/package.json +0 -15
  149. package/dist/plugins/app-types/plugin/index.d.ts +0 -0
  150. package/dist/plugins/app-types/pubsub/example.d.ts +0 -5
  151. package/dist/plugins/app-types/pubsub/index.d.ts +0 -63
  152. package/dist/plugins/app-types/request/cache.d.ts +0 -46
  153. package/dist/plugins/app-types/request/cancelToken.d.ts +0 -38
  154. package/dist/plugins/app-types/request/config.d.ts +0 -3
  155. package/dist/plugins/app-types/request/constants.d.ts +0 -2
  156. package/dist/plugins/app-types/request/index.d.ts +0 -24
  157. package/dist/plugins/app-types/request/pisell2Request.d.ts +0 -6
  158. package/dist/plugins/app-types/request/type.d.ts +0 -41
  159. package/dist/plugins/app-types/request/utils.d.ts +0 -46
  160. package/dist/plugins/app-types/routes/config.d.ts +0 -7
  161. package/dist/plugins/app-types/routes/index.d.ts +0 -28
  162. package/dist/plugins/app-types/socket/components/SocketMonitorPage.d.ts +0 -6
  163. package/dist/plugins/app-types/socket/components/index.d.ts +0 -2
  164. package/dist/plugins/app-types/socket/constants.d.ts +0 -33
  165. package/dist/plugins/app-types/socket/events.d.ts +0 -31
  166. package/dist/plugins/app-types/socket/heartbeat.d.ts +0 -66
  167. package/dist/plugins/app-types/socket/index.d.ts +0 -61
  168. package/dist/plugins/app-types/socket/monitor.d.ts +0 -169
  169. package/dist/plugins/app-types/socket/reconnect.d.ts +0 -61
  170. package/dist/plugins/app-types/socket/socket.d.ts +0 -129
  171. package/dist/plugins/app-types/socket/types.d.ts +0 -85
  172. package/dist/plugins/app-types/storage/index.d.ts +0 -17
  173. package/dist/plugins/app-types/tasks/index.d.ts +0 -77
  174. package/dist/plugins/app-types/tasks/type.d.ts +0 -62
  175. package/dist/plugins/app-types/tasks/useTasks.d.ts +0 -5
  176. package/dist/plugins/app-types/type.d.ts +0 -2
  177. package/dist/plugins/app-types/variables/VariablesProvider.d.ts +0 -7
  178. package/dist/plugins/app-types/variables/config.d.ts +0 -3
  179. package/dist/plugins/app-types/variables/index.d.ts +0 -6
  180. package/dist/plugins/app-types/variables/type.d.ts +0 -2
  181. package/dist/plugins/app-types/website/index.d.ts +0 -6
  182. package/dist/plugins/app.d.ts +0 -8
  183. package/dist/plugins/app.js +0 -1
  184. package/dist/solution/BookingTicket/index.d.ts +0 -184
  185. package/dist/solution/BookingTicket/index.js +0 -698
  186. package/dist/solution/BookingTicket/types.d.ts +0 -68
  187. package/dist/solution/BookingTicket/types.js +0 -43
  188. package/dist/solution/BookingTicket/utils/scan/cloudSearch.d.ts +0 -22
  189. package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +0 -159
  190. package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +0 -22
  191. package/dist/solution/BookingTicket/utils/scan/handleScan.js +0 -189
  192. package/dist/solution/BookingTicket/utils/scan/index.d.ts +0 -85
  193. package/dist/solution/BookingTicket/utils/scan/index.js +0 -294
  194. package/dist/solution/BookingTicket/utils/scan/scanCache.d.ts +0 -78
  195. package/dist/solution/BookingTicket/utils/scan/scanCache.js +0 -305
  196. package/dist/solution/Checkout/appointmentDemo.json +0 -1
  197. package/dist/solution/Checkout/index.d.ts +0 -432
  198. package/dist/solution/Checkout/index.js +0 -4452
  199. package/dist/solution/Checkout/types.d.ts +0 -727
  200. package/dist/solution/Checkout/types.js +0 -104
  201. package/dist/solution/Checkout/utils/index.d.ts +0 -121
  202. package/dist/solution/Checkout/utils/index.js +0 -511
  203. package/dist/utils/task.d.ts +0 -40
  204. package/dist/utils/task.js +0 -171
  205. package/dist/utils/watch.d.ts +0 -102
  206. package/dist/utils/watch.js +0 -294
  207. package/lib/modules/Customer/constants.d.ts +0 -7
  208. package/lib/modules/Customer/constants.js +0 -39
  209. package/lib/modules/Customer/index.d.ts +0 -122
  210. package/lib/modules/Customer/index.js +0 -439
  211. package/lib/modules/Customer/types.d.ts +0 -146
  212. package/lib/modules/Customer/types.js +0 -37
  213. package/lib/modules/Payment/cash.d.ts +0 -19
  214. package/lib/modules/Payment/cash.js +0 -64
  215. package/lib/modules/Payment/cashRecommendationAlgorithm.d.ts +0 -22
  216. package/lib/modules/Payment/cashRecommendationAlgorithm.js +0 -342
  217. package/lib/modules/Payment/eftpos.d.ts +0 -11
  218. package/lib/modules/Payment/eftpos.js +0 -51
  219. package/lib/modules/Payment/mx51.d.ts +0 -0
  220. package/lib/modules/Payment/mx51.js +0 -0
  221. package/lib/modules/Payment/utils.d.ts +0 -17
  222. package/lib/modules/Payment/utils.js +0 -67
  223. package/lib/modules/Payment/walletpass.d.ts +0 -99
  224. package/lib/modules/Payment/walletpass.js +0 -484
  225. package/lib/plugins/app-types/app/app.d.ts +0 -83
  226. package/lib/plugins/app-types/app/const.d.ts +0 -4
  227. package/lib/plugins/app-types/app/index.d.ts +0 -14
  228. package/lib/plugins/app-types/applicationManager/application.d.ts +0 -50
  229. package/lib/plugins/app-types/applicationManager/index.d.ts +0 -13
  230. package/lib/plugins/app-types/config.d.ts +0 -3
  231. package/lib/plugins/app-types/cookie/index.d.ts +0 -13
  232. package/lib/plugins/app-types/data/index.d.ts +0 -8
  233. package/lib/plugins/app-types/history/config.d.ts +0 -24
  234. package/lib/plugins/app-types/history/index.d.ts +0 -20
  235. package/lib/plugins/app-types/history/type.d.ts +0 -2
  236. package/lib/plugins/app-types/hooks/index.d.ts +0 -12
  237. package/lib/plugins/app-types/hooks/useDelayedValue/index.d.ts +0 -2
  238. package/lib/plugins/app-types/hooks/useDispatch/index.d.ts +0 -2
  239. package/lib/plugins/app-types/hooks/useLowCode/index.d.ts +0 -13
  240. package/lib/plugins/app-types/hooks/useStore/index.d.ts +0 -6
  241. package/lib/plugins/app-types/index.d.ts +0 -6
  242. package/lib/plugins/app-types/indexDB/index.d.ts +0 -178
  243. package/lib/plugins/app-types/locales/en.d.ts +0 -3
  244. package/lib/plugins/app-types/locales/index.d.ts +0 -37
  245. package/lib/plugins/app-types/locales/original.d.ts +0 -3
  246. package/lib/plugins/app-types/locales/type.d.ts +0 -19
  247. package/lib/plugins/app-types/locales/zh-CN.d.ts +0 -3
  248. package/lib/plugins/app-types/locales/zh-HK.d.ts +0 -3
  249. package/lib/plugins/app-types/logger/feishu.d.ts +0 -11
  250. package/lib/plugins/app-types/logger/index.d.ts +0 -122
  251. package/lib/plugins/app-types/menuManager/hooks.d.ts +0 -17
  252. package/lib/plugins/app-types/menuManager/index.d.ts +0 -28
  253. package/lib/plugins/app-types/models/global.d.ts +0 -32
  254. package/lib/plugins/app-types/models/index.d.ts +0 -45
  255. package/lib/plugins/app-types/models/type.d.ts +0 -2
  256. package/lib/plugins/app-types/package.json +0 -15
  257. package/lib/plugins/app-types/plugin/index.d.ts +0 -0
  258. package/lib/plugins/app-types/pubsub/example.d.ts +0 -5
  259. package/lib/plugins/app-types/pubsub/index.d.ts +0 -63
  260. package/lib/plugins/app-types/request/cache.d.ts +0 -46
  261. package/lib/plugins/app-types/request/cancelToken.d.ts +0 -38
  262. package/lib/plugins/app-types/request/config.d.ts +0 -3
  263. package/lib/plugins/app-types/request/constants.d.ts +0 -2
  264. package/lib/plugins/app-types/request/index.d.ts +0 -24
  265. package/lib/plugins/app-types/request/pisell2Request.d.ts +0 -6
  266. package/lib/plugins/app-types/request/type.d.ts +0 -41
  267. package/lib/plugins/app-types/request/utils.d.ts +0 -46
  268. package/lib/plugins/app-types/routes/config.d.ts +0 -7
  269. package/lib/plugins/app-types/routes/index.d.ts +0 -28
  270. package/lib/plugins/app-types/socket/components/SocketMonitorPage.d.ts +0 -6
  271. package/lib/plugins/app-types/socket/components/index.d.ts +0 -2
  272. package/lib/plugins/app-types/socket/constants.d.ts +0 -33
  273. package/lib/plugins/app-types/socket/events.d.ts +0 -31
  274. package/lib/plugins/app-types/socket/heartbeat.d.ts +0 -66
  275. package/lib/plugins/app-types/socket/index.d.ts +0 -61
  276. package/lib/plugins/app-types/socket/monitor.d.ts +0 -169
  277. package/lib/plugins/app-types/socket/reconnect.d.ts +0 -61
  278. package/lib/plugins/app-types/socket/socket.d.ts +0 -129
  279. package/lib/plugins/app-types/socket/types.d.ts +0 -85
  280. package/lib/plugins/app-types/storage/index.d.ts +0 -17
  281. package/lib/plugins/app-types/tasks/index.d.ts +0 -77
  282. package/lib/plugins/app-types/tasks/type.d.ts +0 -62
  283. package/lib/plugins/app-types/tasks/useTasks.d.ts +0 -5
  284. package/lib/plugins/app-types/type.d.ts +0 -2
  285. package/lib/plugins/app-types/variables/VariablesProvider.d.ts +0 -7
  286. package/lib/plugins/app-types/variables/config.d.ts +0 -3
  287. package/lib/plugins/app-types/variables/index.d.ts +0 -6
  288. package/lib/plugins/app-types/variables/type.d.ts +0 -2
  289. package/lib/plugins/app-types/website/index.d.ts +0 -6
  290. package/lib/plugins/app.d.ts +0 -8
  291. package/lib/plugins/app.js +0 -17
  292. package/lib/solution/BookingTicket/index.d.ts +0 -184
  293. package/lib/solution/BookingTicket/index.js +0 -426
  294. package/lib/solution/BookingTicket/types.d.ts +0 -68
  295. package/lib/solution/BookingTicket/types.js +0 -72
  296. package/lib/solution/BookingTicket/utils/scan/cloudSearch.d.ts +0 -22
  297. package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +0 -117
  298. package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +0 -22
  299. package/lib/solution/BookingTicket/utils/scan/handleScan.js +0 -132
  300. package/lib/solution/BookingTicket/utils/scan/index.d.ts +0 -85
  301. package/lib/solution/BookingTicket/utils/scan/index.js +0 -216
  302. package/lib/solution/BookingTicket/utils/scan/scanCache.d.ts +0 -78
  303. package/lib/solution/BookingTicket/utils/scan/scanCache.js +0 -231
  304. package/lib/solution/Checkout/appointmentDemo.json +0 -1
  305. package/lib/solution/Checkout/index.d.ts +0 -432
  306. package/lib/solution/Checkout/index.js +0 -2776
  307. package/lib/solution/Checkout/types.d.ts +0 -727
  308. package/lib/solution/Checkout/types.js +0 -63
  309. package/lib/solution/Checkout/utils/index.d.ts +0 -121
  310. package/lib/solution/Checkout/utils/index.js +0 -362
  311. package/lib/utils/task.d.ts +0 -40
  312. package/lib/utils/task.js +0 -109
  313. package/lib/utils/watch.d.ts +0 -102
  314. package/lib/utils/watch.js +0 -217
@@ -24,6 +24,7 @@ __export(Account_exports, {
24
24
  });
25
25
  module.exports = __toCommonJS(Account_exports);
26
26
  var import_BaseModule = require("../BaseModule");
27
+ var import_types = require("./types");
27
28
  __reExport(Account_exports, require("./types"), module.exports);
28
29
  var AccountModule = class extends import_BaseModule.BaseModule {
29
30
  constructor(name, version) {
@@ -58,7 +59,7 @@ var AccountModule = class extends import_BaseModule.BaseModule {
58
59
  };
59
60
  this.store.accountInfo = account;
60
61
  this.store.isLoggedIn = true;
61
- await this.core.effects.emit(`${this.name}:onLogin`, account);
62
+ await this.core.effects.emit(import_types.AccountHooks.OnLogin, account);
62
63
  }
63
64
  getCurrentAccount() {
64
65
  return this.store.accountInfo;
@@ -71,7 +72,7 @@ var AccountModule = class extends import_BaseModule.BaseModule {
71
72
  ...updates
72
73
  };
73
74
  await this.core.effects.emit(
74
- `${this.name}:onProfileUpdate`,
75
+ import_types.AccountHooks.OnProfileUpdate,
75
76
  this.store.accountInfo
76
77
  );
77
78
  }
@@ -1,7 +1,7 @@
1
1
  import { Module, PisellCore, ModuleOptions } from '../../types';
2
2
  import { AccountModule, Account } from '../Account';
3
3
  import { BaseModule } from '../BaseModule';
4
- import { IFetchHolderAccountsParams, IHolder, IGetCustomerListParams } from './types';
4
+ import { IFetchHolderAccountsParams, IHolder } from './types';
5
5
  export declare class AccountListModule extends BaseModule implements Module {
6
6
  protected defaultName: string;
7
7
  protected defaultVersion: string;
@@ -37,12 +37,6 @@ export declare class AccountListModule extends BaseModule implements Module {
37
37
  customerId: number;
38
38
  type?: 'unshift' | 'push';
39
39
  }): Promise<AccountModule[]>;
40
- /**
41
- * 获取客户列表
42
- * @param params 查询参数
43
- * @returns 客户列表
44
- */
45
- getCustomerList(params?: IGetCustomerListParams): Promise<any>;
46
40
  /**
47
41
  * 获取holder类型账户列表
48
42
  * @param params
@@ -288,33 +288,6 @@ var AccountListModule = class extends import_BaseModule.BaseModule {
288
288
  );
289
289
  return accountModules;
290
290
  }
291
- /**
292
- * 获取客户列表
293
- * @param params 查询参数
294
- * @returns 客户列表
295
- */
296
- async getCustomerList(params = {}) {
297
- const url = "/customer/es/data";
298
- const { page = 1, pageSize = 20, keyword, ...otherParams } = params;
299
- try {
300
- this.store.isLoading = true;
301
- this.store.error = null;
302
- const queryParams = {
303
- page,
304
- pageSize,
305
- ...keyword && { keyword },
306
- ...otherParams
307
- };
308
- const res = await this.request.get(url, queryParams);
309
- return (res == null ? void 0 : res.data) || [];
310
- } catch (error) {
311
- console.error("Failed to fetch customer list:", error);
312
- this.store.error = error instanceof Error ? error.message : "Failed to fetch customer list";
313
- throw error;
314
- } finally {
315
- this.store.isLoading = false;
316
- }
317
- }
318
291
  /**
319
292
  * 获取holder类型账户列表
320
293
  * @param params
@@ -67,31 +67,3 @@ export interface IHolder {
67
67
  main_field: string;
68
68
  customer_cover?: string;
69
69
  }
70
- /**
71
- * 获取客户列表参数
72
- */
73
- export interface IGetCustomerListParams {
74
- /** 页码 */
75
- page?: number;
76
- /** 每页数量 */
77
- pageSize?: number;
78
- /** 搜索关键词 */
79
- keyword?: string;
80
- /** 其他筛选参数 */
81
- [key: string]: any;
82
- }
83
- /**
84
- * 客户数据
85
- */
86
- export interface ICustomer {
87
- /** 客户ID */
88
- id: string | number;
89
- /** 客户姓名 */
90
- name: string;
91
- /** 客户电话 */
92
- phone?: string;
93
- /** 客户邮箱 */
94
- email?: string;
95
- /** 其他客户信息 */
96
- [key: string]: any;
97
- }
@@ -14,7 +14,4 @@ export declare class BaseModule {
14
14
  store: any;
15
15
  cacheKey: string[];
16
16
  }): void;
17
- effectsOn(eventType: string, callback: (payload: any) => void): () => void;
18
- effectsOff(eventType: string, callback: (payload: any) => void): void;
19
- effectsOnce(eventType: string, callback: (payload: any) => void): () => void;
20
17
  }
@@ -82,15 +82,6 @@ var BaseModule = class {
82
82
  }
83
83
  }
84
84
  }
85
- effectsOn(eventType, callback) {
86
- return this.core.effects.on(`${this.name}:${eventType}`, callback);
87
- }
88
- effectsOff(eventType, callback) {
89
- return this.core.effects.off(`${this.name}:${eventType}`, callback);
90
- }
91
- effectsOnce(eventType, callback) {
92
- return this.core.effects.once(`${this.name}:${eventType}`, callback);
93
- }
94
85
  };
95
86
  // Annotate the CommonJS export names for ESM import in node:
96
87
  0 && (module.exports = {
@@ -3,7 +3,6 @@ import { BaseModule } from '../BaseModule';
3
3
  import { CartItem, CartModuleAPI, ECartItemCheckType, ECartItemInfoType, IAddItemParams, IUpdateItemParams } from './types';
4
4
  import { Account } from '../Account';
5
5
  export * from './types';
6
- export { getProductDeposit } from './utils';
7
6
  /**
8
7
  * 购物车模块实现
9
8
  */
@@ -20,8 +20,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/modules/Cart/index.ts
21
21
  var Cart_exports = {};
22
22
  __export(Cart_exports, {
23
- CartModule: () => CartModule,
24
- getProductDeposit: () => import_utils3.getProductDeposit
23
+ CartModule: () => CartModule
25
24
  });
26
25
  module.exports = __toCommonJS(Cart_exports);
27
26
  var import_BaseModule = require("../BaseModule");
@@ -30,10 +29,9 @@ var import_utils = require("./utils");
30
29
  var import_lodash_es = require("lodash-es");
31
30
  var import_utils2 = require("../Product/utils");
32
31
  __reExport(Cart_exports, require("./types"), module.exports);
33
- var import_utils3 = require("./utils");
34
32
  var CartModule = class extends import_BaseModule.BaseModule {
35
33
  constructor(name, version) {
36
- super(name || "cart", version || "1.0.0");
34
+ super(name, version);
37
35
  // 提供给 baseModule 用的默认名称 和 默认版本
38
36
  this.defaultName = "cart";
39
37
  this.defaultVersion = "1.0.0";
@@ -363,6 +361,5 @@ var CartModule = class extends import_BaseModule.BaseModule {
363
361
  // Annotate the CommonJS export names for ESM import in node:
364
362
  0 && (module.exports = {
365
363
  CartModule,
366
- getProductDeposit,
367
364
  ...require("./types")
368
365
  });
@@ -20,7 +20,9 @@ export interface ITime {
20
20
  date: string;
21
21
  week: string;
22
22
  weekNum: number;
23
- status: 'unavailable' | 'available';
23
+ status: 'unavailable' | 'available' | 'lots_of_space' | 'filling_up_fast' | 'sold_out';
24
+ summaryCount?: number;
25
+ availableCount?: number;
24
26
  resource?: any[];
25
27
  color?: string[];
26
28
  }
@@ -33,4 +33,3 @@ export declare class DiscountModule extends BaseModule implements Module, Discou
33
33
  clear(): Promise<void>;
34
34
  storeChange(): void;
35
35
  }
36
- export type { Discount } from './types';
@@ -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;