@pisell/pisellos 2.2.243 → 2.2.244

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 (315) hide show
  1. package/dist/model/strategy/adapter/promotion/evaluator.js +2 -3
  2. package/dist/model/strategy/adapter/promotion/index.js +9 -0
  3. package/dist/model/strategy/adapter/walletPass/utils.js +4 -7
  4. package/dist/modules/Cart/utils/cartProduct.js +3 -24
  5. package/dist/modules/Cart/utils/changePrice.js +11 -11
  6. package/dist/modules/Customer/index.d.ts +0 -20
  7. package/dist/modules/Customer/index.js +83 -172
  8. package/dist/modules/Customer/types.d.ts +0 -2
  9. package/dist/modules/Discount/index.js +3 -4
  10. package/dist/modules/Discount/types.d.ts +0 -1
  11. package/dist/modules/OpenData/index.d.ts +0 -8
  12. package/dist/modules/OpenData/index.js +17 -37
  13. package/dist/modules/Order/index.d.ts +18 -268
  14. package/dist/modules/Order/index.js +757 -3306
  15. package/dist/modules/Order/types.d.ts +31 -279
  16. package/dist/modules/Order/types.js +0 -38
  17. package/dist/modules/Order/utils.d.ts +5 -147
  18. package/dist/modules/Order/utils.js +103 -746
  19. package/dist/modules/Payment/index.d.ts +13 -10
  20. package/dist/modules/Payment/index.js +837 -467
  21. package/dist/modules/Payment/types.d.ts +0 -2
  22. package/dist/modules/Payment/utils.js +1 -2
  23. package/dist/modules/Payment/walletpass.js +7 -14
  24. package/dist/modules/ProductList/index.d.ts +12 -16
  25. package/dist/modules/ProductList/index.js +59 -133
  26. package/dist/modules/ProductList/types.d.ts +0 -14
  27. package/dist/modules/Quotation/index.d.ts +1 -0
  28. package/dist/modules/Quotation/index.js +22 -25
  29. package/dist/modules/Rules/index.d.ts +0 -4
  30. package/dist/modules/Rules/index.js +69 -93
  31. package/dist/modules/Rules/types.d.ts +0 -1
  32. package/dist/modules/SalesSummary/index.d.ts +25 -8
  33. package/dist/modules/SalesSummary/index.js +35 -86
  34. package/dist/modules/SalesSummary/types.d.ts +1 -4
  35. package/dist/modules/SalesSummary/utils.d.ts +25 -2
  36. package/dist/modules/SalesSummary/utils.js +162 -794
  37. package/dist/modules/Schedule/index.d.ts +0 -7
  38. package/dist/modules/Schedule/index.js +2 -24
  39. package/dist/modules/Summary/index.js +3 -4
  40. package/dist/modules/index.d.ts +0 -2
  41. package/dist/modules/index.js +1 -3
  42. package/dist/plugins/request.d.ts +0 -1
  43. package/dist/server/index.d.ts +1 -204
  44. package/dist/server/index.js +928 -3658
  45. package/dist/server/modules/index.d.ts +0 -2
  46. package/dist/server/modules/index.js +0 -2
  47. package/dist/server/modules/order/index.d.ts +4 -120
  48. package/dist/server/modules/order/index.js +483 -1779
  49. package/dist/server/modules/order/types.d.ts +3 -32
  50. package/dist/server/modules/order/types.js +0 -8
  51. package/dist/server/modules/order/utils/filterBookings.js +3 -26
  52. package/dist/server/modules/order/utils/filterOrders.js +8 -23
  53. package/dist/server/modules/products/index.d.ts +7 -34
  54. package/dist/server/modules/products/index.js +317 -631
  55. package/dist/server/modules/resource/index.d.ts +0 -2
  56. package/dist/server/modules/resource/index.js +3 -29
  57. package/dist/server/modules/schedule/index.d.ts +4 -4
  58. package/dist/server/modules/schedule/index.js +88 -111
  59. package/dist/solution/BaseSales/index.d.ts +9 -131
  60. package/dist/solution/BaseSales/index.js +447 -1944
  61. package/dist/solution/BaseSales/types.d.ts +6 -76
  62. package/dist/solution/BaseSales/types.js +4 -5
  63. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +0 -1
  64. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +24 -105
  65. package/dist/solution/BaseSales/utils.d.ts +1 -1
  66. package/dist/solution/BaseSales/utils.js +21 -62
  67. package/dist/solution/BookingByStep/index.d.ts +1 -1
  68. package/dist/solution/BookingTicket/index.d.ts +10 -270
  69. package/dist/solution/BookingTicket/index.js +237 -1772
  70. package/dist/solution/BookingTicket/types.d.ts +1 -118
  71. package/dist/solution/BookingTicket/types.js +2 -41
  72. package/dist/solution/BookingTicket/utils/bookingStatus.d.ts +0 -40
  73. package/dist/solution/BookingTicket/utils/bookingStatus.js +0 -70
  74. package/dist/solution/BookingTicket/utils/cartView.d.ts +1 -9
  75. package/dist/solution/BookingTicket/utils/cartView.js +7 -94
  76. package/dist/solution/BookingTicket/utils/scan/index.d.ts +0 -5
  77. package/dist/solution/BookingTicket/utils/scan/index.js +8 -20
  78. package/dist/solution/Checkout/appointmentDemo.json +1 -0
  79. package/dist/solution/Checkout/index.d.ts +0 -1
  80. package/dist/solution/Checkout/index.js +9 -10
  81. package/dist/solution/RegisterAndLogin/config.js +10 -2
  82. package/dist/solution/ScanOrder/index.d.ts +3 -9
  83. package/dist/solution/ScanOrder/index.js +134 -241
  84. package/dist/solution/ScanOrder/types.d.ts +5 -9
  85. package/dist/solution/ScanOrder/types.js +3 -2
  86. package/dist/solution/ScanOrder/utils.d.ts +1 -1
  87. package/dist/solution/ScanOrder/utils.js +22 -84
  88. package/dist/solution/VenueBooking/index.d.ts +2 -5
  89. package/dist/solution/VenueBooking/index.js +59 -110
  90. package/dist/solution/VenueBooking/sales-section-4-annotated.json +2 -0
  91. package/dist/solution/VenueBooking/utils/slotMerge.d.ts +0 -4
  92. package/dist/solution/VenueBooking/utils/slotMerge.js +0 -10
  93. package/dist/types/index.d.ts +0 -10
  94. package/lib/model/strategy/adapter/promotion/evaluator.js +1 -2
  95. package/lib/model/strategy/adapter/promotion/index.js +0 -49
  96. package/lib/model/strategy/adapter/walletPass/utils.js +2 -3
  97. package/lib/modules/Cart/utils/cartProduct.js +3 -20
  98. package/lib/modules/Cart/utils/changePrice.js +20 -12
  99. package/lib/modules/Customer/index.d.ts +0 -20
  100. package/lib/modules/Customer/index.js +11 -64
  101. package/lib/modules/Customer/types.d.ts +0 -2
  102. package/lib/modules/Discount/index.js +1 -5
  103. package/lib/modules/Discount/types.d.ts +0 -1
  104. package/lib/modules/OpenData/index.d.ts +0 -8
  105. package/lib/modules/OpenData/index.js +5 -19
  106. package/lib/modules/Order/index.d.ts +18 -268
  107. package/lib/modules/Order/index.js +344 -2149
  108. package/lib/modules/Order/types.d.ts +31 -279
  109. package/lib/modules/Order/types.js +0 -1
  110. package/lib/modules/Order/utils.d.ts +5 -147
  111. package/lib/modules/Order/utils.js +46 -614
  112. package/lib/modules/Payment/index.d.ts +13 -10
  113. package/lib/modules/Payment/index.js +150 -18
  114. package/lib/modules/Payment/types.d.ts +0 -2
  115. package/lib/modules/Payment/utils.js +1 -2
  116. package/lib/modules/Payment/walletpass.js +3 -7
  117. package/lib/modules/ProductList/index.d.ts +12 -16
  118. package/lib/modules/ProductList/index.js +4 -41
  119. package/lib/modules/ProductList/types.d.ts +0 -14
  120. package/lib/modules/Quotation/index.d.ts +1 -0
  121. package/lib/modules/Quotation/index.js +16 -19
  122. package/lib/modules/Rules/index.d.ts +0 -4
  123. package/lib/modules/Rules/index.js +120 -136
  124. package/lib/modules/Rules/types.d.ts +0 -1
  125. package/lib/modules/SalesSummary/index.d.ts +25 -8
  126. package/lib/modules/SalesSummary/index.js +4 -30
  127. package/lib/modules/SalesSummary/types.d.ts +1 -4
  128. package/lib/modules/SalesSummary/utils.d.ts +25 -2
  129. package/lib/modules/SalesSummary/utils.js +91 -645
  130. package/lib/modules/Schedule/index.d.ts +0 -7
  131. package/lib/modules/Schedule/index.js +1 -17
  132. package/lib/modules/Summary/index.js +4 -5
  133. package/lib/modules/index.d.ts +0 -2
  134. package/lib/modules/index.js +1 -5
  135. package/lib/plugins/request.d.ts +0 -1
  136. package/lib/server/index.d.ts +1 -204
  137. package/lib/server/index.js +57 -1888
  138. package/lib/server/modules/index.d.ts +0 -2
  139. package/lib/server/modules/index.js +0 -3
  140. package/lib/server/modules/order/index.d.ts +4 -120
  141. package/lib/server/modules/order/index.js +142 -919
  142. package/lib/server/modules/order/types.d.ts +3 -32
  143. package/lib/server/modules/order/utils/filterBookings.js +5 -24
  144. package/lib/server/modules/order/utils/filterOrders.js +6 -15
  145. package/lib/server/modules/products/index.d.ts +7 -34
  146. package/lib/server/modules/products/index.js +54 -189
  147. package/lib/server/modules/resource/index.d.ts +0 -2
  148. package/lib/server/modules/resource/index.js +3 -27
  149. package/lib/server/modules/schedule/index.d.ts +4 -4
  150. package/lib/server/modules/schedule/index.js +40 -47
  151. package/lib/solution/BaseSales/index.d.ts +9 -131
  152. package/lib/solution/BaseSales/index.js +63 -1106
  153. package/lib/solution/BaseSales/types.d.ts +6 -76
  154. package/lib/solution/BaseSales/types.js +1 -3
  155. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +0 -1
  156. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +18 -106
  157. package/lib/solution/BaseSales/utils.d.ts +1 -1
  158. package/lib/solution/BaseSales/utils.js +10 -54
  159. package/lib/solution/BookingByStep/index.d.ts +1 -1
  160. package/lib/solution/BookingTicket/index.d.ts +10 -270
  161. package/lib/solution/BookingTicket/index.js +29 -922
  162. package/lib/solution/BookingTicket/types.d.ts +1 -118
  163. package/lib/solution/BookingTicket/types.js +0 -11
  164. package/lib/solution/BookingTicket/utils/bookingStatus.d.ts +0 -40
  165. package/lib/solution/BookingTicket/utils/bookingStatus.js +2 -44
  166. package/lib/solution/BookingTicket/utils/cartView.d.ts +1 -9
  167. package/lib/solution/BookingTicket/utils/cartView.js +6 -61
  168. package/lib/solution/BookingTicket/utils/scan/index.d.ts +0 -5
  169. package/lib/solution/BookingTicket/utils/scan/index.js +3 -17
  170. package/lib/solution/Checkout/appointmentDemo.json +1 -0
  171. package/lib/solution/Checkout/index.d.ts +0 -1
  172. package/lib/solution/Checkout/index.js +2 -1
  173. package/lib/solution/RegisterAndLogin/config.js +10 -2
  174. package/lib/solution/ScanOrder/index.d.ts +3 -9
  175. package/lib/solution/ScanOrder/index.js +70 -153
  176. package/lib/solution/ScanOrder/types.d.ts +5 -9
  177. package/lib/solution/ScanOrder/utils.d.ts +1 -1
  178. package/lib/solution/ScanOrder/utils.js +17 -83
  179. package/lib/solution/VenueBooking/index.d.ts +2 -5
  180. package/lib/solution/VenueBooking/index.js +17 -54
  181. package/lib/solution/VenueBooking/sales-section-4-annotated.json +2 -0
  182. package/lib/solution/VenueBooking/utils/slotMerge.d.ts +0 -4
  183. package/lib/solution/VenueBooking/utils/slotMerge.js +0 -10
  184. package/lib/types/index.d.ts +0 -10
  185. package/package.json +1 -1
  186. package/dist/modules/BookingContext/index.d.ts +0 -48
  187. package/dist/modules/BookingContext/index.js +0 -566
  188. package/dist/modules/BookingContext/types.d.ts +0 -102
  189. package/dist/modules/BookingContext/types.js +0 -51
  190. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts +0 -16
  191. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +0 -284
  192. package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +0 -8
  193. package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +0 -145
  194. package/dist/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +0 -76
  195. package/dist/modules/BookingContext/utils/cacheItemToBookingInput.js +0 -218
  196. package/dist/modules/BookingContext/utils/flexible.d.ts +0 -28
  197. package/dist/modules/BookingContext/utils/flexible.js +0 -56
  198. package/dist/modules/BookingContext/utils/formatResourceList.d.ts +0 -8
  199. package/dist/modules/BookingContext/utils/formatResourceList.js +0 -38
  200. package/dist/modules/BookingContext/utils/index.d.ts +0 -11
  201. package/dist/modules/BookingContext/utils/index.js +0 -11
  202. package/dist/modules/BookingContext/utils/noResource.d.ts +0 -13
  203. package/dist/modules/BookingContext/utils/noResource.js +0 -77
  204. package/dist/modules/BookingContext/utils/orderLineDisplay.d.ts +0 -1
  205. package/dist/modules/BookingContext/utils/orderLineDisplay.js +0 -36
  206. package/dist/modules/BookingContext/utils/productExtend.d.ts +0 -72
  207. package/dist/modules/BookingContext/utils/productExtend.js +0 -339
  208. package/dist/modules/BookingContext/utils/resourceErrors.d.ts +0 -41
  209. package/dist/modules/BookingContext/utils/resourceErrors.js +0 -74
  210. package/dist/modules/BookingContext/utils/resourceSelection.d.ts +0 -7
  211. package/dist/modules/BookingContext/utils/resourceSelection.js +0 -24
  212. package/dist/modules/BookingContext/utils/resources.d.ts +0 -80
  213. package/dist/modules/BookingContext/utils/resources.js +0 -486
  214. package/dist/modules/BookingContext/utils/serviceTimes.d.ts +0 -55
  215. package/dist/modules/BookingContext/utils/serviceTimes.js +0 -151
  216. package/dist/modules/BookingContext/utils/timeSlices.d.ts +0 -42
  217. package/dist/modules/BookingContext/utils/timeSlices.js +0 -100
  218. package/dist/modules/Order/utils/manualProductDiscount.d.ts +0 -106
  219. package/dist/modules/Order/utils/manualProductDiscount.js +0 -210
  220. package/dist/modules/SurchargeList/index.d.ts +0 -16
  221. package/dist/modules/SurchargeList/index.js +0 -162
  222. package/dist/modules/SurchargeList/types.d.ts +0 -11
  223. package/dist/modules/SurchargeList/types.js +0 -1
  224. package/dist/server/modules/payment/index.d.ts +0 -28
  225. package/dist/server/modules/payment/index.js +0 -305
  226. package/dist/server/modules/payment/types.d.ts +0 -9
  227. package/dist/server/modules/payment/types.js +0 -1
  228. package/dist/server/test.json +0 -713
  229. package/dist/server/utils/small-ticket.d.ts +0 -71
  230. package/dist/server/utils/small-ticket.js +0 -830
  231. package/dist/solution/BaseSales/utils/cartPromotion.d.ts +0 -287
  232. package/dist/solution/BaseSales/utils/cartPromotion.js +0 -1438
  233. package/dist/solution/BaseSales/utils/quotationPrice.d.ts +0 -7
  234. package/dist/solution/BaseSales/utils/quotationPrice.js +0 -237
  235. package/dist/solution/BookingTicket/utils/addProductDecision.d.ts +0 -117
  236. package/dist/solution/BookingTicket/utils/addProductDecision.js +0 -346
  237. package/dist/solution/BookingTicket/utils/addTimeAvailability.d.ts +0 -35
  238. package/dist/solution/BookingTicket/utils/addTimeAvailability.js +0 -95
  239. package/dist/solution/BookingTicket/utils/exampleData.d.ts +0 -123
  240. package/dist/solution/BookingTicket/utils/exampleData.js +0 -183
  241. package/dist/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +0 -185
  242. package/dist/solution/BookingTicket/utils/resolveBestAddTimePlan.js +0 -438
  243. package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +0 -36
  244. package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +0 -399
  245. package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +0 -32
  246. package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.js +0 -56
  247. package/dist/solution/BookingTicket/utils/scan/scanProductValues.d.ts +0 -21
  248. package/dist/solution/BookingTicket/utils/scan/scanProductValues.js +0 -150
  249. package/dist/solution/BookingTicket/utils/sessionCatalogStale.d.ts +0 -23
  250. package/dist/solution/BookingTicket/utils/sessionCatalogStale.js +0 -78
  251. package/lib/modules/BookingContext/index.d.ts +0 -48
  252. package/lib/modules/BookingContext/index.js +0 -368
  253. package/lib/modules/BookingContext/types.d.ts +0 -102
  254. package/lib/modules/BookingContext/types.js +0 -34
  255. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts +0 -16
  256. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +0 -276
  257. package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +0 -8
  258. package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +0 -151
  259. package/lib/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +0 -76
  260. package/lib/modules/BookingContext/utils/cacheItemToBookingInput.js +0 -201
  261. package/lib/modules/BookingContext/utils/flexible.d.ts +0 -28
  262. package/lib/modules/BookingContext/utils/flexible.js +0 -80
  263. package/lib/modules/BookingContext/utils/formatResourceList.d.ts +0 -8
  264. package/lib/modules/BookingContext/utils/formatResourceList.js +0 -50
  265. package/lib/modules/BookingContext/utils/index.d.ts +0 -11
  266. package/lib/modules/BookingContext/utils/index.js +0 -43
  267. package/lib/modules/BookingContext/utils/noResource.d.ts +0 -13
  268. package/lib/modules/BookingContext/utils/noResource.js +0 -90
  269. package/lib/modules/BookingContext/utils/orderLineDisplay.d.ts +0 -1
  270. package/lib/modules/BookingContext/utils/orderLineDisplay.js +0 -56
  271. package/lib/modules/BookingContext/utils/productExtend.d.ts +0 -72
  272. package/lib/modules/BookingContext/utils/productExtend.js +0 -283
  273. package/lib/modules/BookingContext/utils/resourceErrors.d.ts +0 -41
  274. package/lib/modules/BookingContext/utils/resourceErrors.js +0 -80
  275. package/lib/modules/BookingContext/utils/resourceSelection.d.ts +0 -7
  276. package/lib/modules/BookingContext/utils/resourceSelection.js +0 -46
  277. package/lib/modules/BookingContext/utils/resources.d.ts +0 -80
  278. package/lib/modules/BookingContext/utils/resources.js +0 -377
  279. package/lib/modules/BookingContext/utils/serviceTimes.d.ts +0 -55
  280. package/lib/modules/BookingContext/utils/serviceTimes.js +0 -162
  281. package/lib/modules/BookingContext/utils/timeSlices.d.ts +0 -42
  282. package/lib/modules/BookingContext/utils/timeSlices.js +0 -124
  283. package/lib/modules/Order/utils/manualProductDiscount.d.ts +0 -106
  284. package/lib/modules/Order/utils/manualProductDiscount.js +0 -206
  285. package/lib/modules/SurchargeList/index.d.ts +0 -16
  286. package/lib/modules/SurchargeList/index.js +0 -89
  287. package/lib/modules/SurchargeList/types.d.ts +0 -11
  288. package/lib/modules/SurchargeList/types.js +0 -17
  289. package/lib/server/modules/payment/index.d.ts +0 -28
  290. package/lib/server/modules/payment/index.js +0 -192
  291. package/lib/server/modules/payment/types.d.ts +0 -9
  292. package/lib/server/modules/payment/types.js +0 -17
  293. package/lib/server/test.json +0 -713
  294. package/lib/server/utils/small-ticket.d.ts +0 -71
  295. package/lib/server/utils/small-ticket.js +0 -781
  296. package/lib/solution/BaseSales/utils/cartPromotion.d.ts +0 -287
  297. package/lib/solution/BaseSales/utils/cartPromotion.js +0 -992
  298. package/lib/solution/BaseSales/utils/quotationPrice.d.ts +0 -7
  299. package/lib/solution/BaseSales/utils/quotationPrice.js +0 -277
  300. package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +0 -117
  301. package/lib/solution/BookingTicket/utils/addProductDecision.js +0 -318
  302. package/lib/solution/BookingTicket/utils/addTimeAvailability.d.ts +0 -35
  303. package/lib/solution/BookingTicket/utils/addTimeAvailability.js +0 -125
  304. package/lib/solution/BookingTicket/utils/exampleData.d.ts +0 -123
  305. package/lib/solution/BookingTicket/utils/exampleData.js +0 -0
  306. package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +0 -185
  307. package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.js +0 -254
  308. package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +0 -36
  309. package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +0 -168
  310. package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +0 -32
  311. package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.js +0 -51
  312. package/lib/solution/BookingTicket/utils/scan/scanProductValues.d.ts +0 -21
  313. package/lib/solution/BookingTicket/utils/scan/scanProductValues.js +0 -127
  314. package/lib/solution/BookingTicket/utils/sessionCatalogStale.d.ts +0 -23
  315. package/lib/solution/BookingTicket/utils/sessionCatalogStale.js +0 -85
@@ -25,6 +25,9 @@ export declare class PaymentModule extends BaseModule implements Module, Payment
25
25
  private dbManager;
26
26
  private logger;
27
27
  private voucherUpdateLockByOrderUuid;
28
+ private payMethodMemoryCache;
29
+ private payMethodListInFlight;
30
+ private isRefreshingPaymentMethods;
28
31
  protected otherParams: any;
29
32
  cash: CashPayment;
30
33
  eftpos: EftposPayment;
@@ -33,13 +36,6 @@ export declare class PaymentModule extends BaseModule implements Module, Payment
33
36
  private runVoucherUpdateLocked;
34
37
  private normalizeVoucherPaymentItems;
35
38
  initialize(core: PisellCore, options: ModuleOptions): Promise<void>;
36
- /**
37
- * 更新父级解决方案透传的运行态参数,主要用于日志父模块等上下文。
38
- *
39
- * @example
40
- * paymentModule.updateOtherParams({ fatherModule: 'bookingTicket' });
41
- */
42
- updateOtherParams(params: Record<string, any>): void;
43
39
  /**
44
40
  * 记录信息日志
45
41
  */
@@ -61,14 +57,23 @@ export declare class PaymentModule extends BaseModule implements Module, Payment
61
57
  *
62
58
  */
63
59
  private registerNetworkHandlers;
60
+ private filterPayMethods;
64
61
  /**
65
62
  * 获取支付方式列表
66
63
  */
67
64
  getPayMethodListAsync(): Promise<PaymentMethod[]>;
65
+ private loadPayMethodListAsync;
66
+ /**
67
+ * 后台刷新支付方式列表
68
+ */
69
+ private refreshPaymentMethodsInBackground;
70
+ /**
71
+ * 检查支付方式列表是否有变化
72
+ */
73
+ private hasPaymentMethodsChanged;
68
74
  /**
69
75
  * 获取订单列表
70
76
  */
71
- /** @deprecated */
72
77
  getOrderListAsync(): Promise<PaymentOrder[]>;
73
78
  /**
74
79
  * 根据订单UUID获取支付订单(新方法)
@@ -168,12 +173,10 @@ export declare class PaymentModule extends BaseModule implements Module, Payment
168
173
  /**
169
174
  * 确保支付模块所需的数据库表已创建
170
175
  */
171
- /** @deprecated */
172
176
  private ensurePaymentTables;
173
177
  /**
174
178
  * 获取部分支付的订单
175
179
  */
176
- /** @deprecated */
177
180
  getPartiallyPaidOrdersAsync(): Promise<PaymentOrder[]>;
178
181
  /**
179
182
  * 智能金额舍入
@@ -76,6 +76,9 @@ var PaymentModule = class extends import_BaseModule.BaseModule {
76
76
  this.defaultVersion = "1.0.0";
77
77
  // LoggerManager 实例
78
78
  this.voucherUpdateLockByOrderUuid = /* @__PURE__ */ new Map();
79
+ this.payMethodMemoryCache = null;
80
+ this.payMethodListInFlight = null;
81
+ this.isRefreshingPaymentMethods = false;
79
82
  this.otherParams = {};
80
83
  this.cash = new import_cash.CashPaymentImpl(this);
81
84
  this.eftpos = new import_eftpos.EftposPaymentImpl(this);
@@ -123,19 +126,11 @@ var PaymentModule = class extends import_BaseModule.BaseModule {
123
126
  this.app = appPlugin.getApp();
124
127
  this.dbManager = this.app.dbManager;
125
128
  this.logger = this.app.logger;
129
+ await this.ensurePaymentTables();
126
130
  this.registerNetworkHandlers();
127
131
  console.log("[PaymentModule] 初始化完成");
128
132
  this.logInfo("PaymentModule initialized successfully");
129
133
  }
130
- /**
131
- * 更新父级解决方案透传的运行态参数,主要用于日志父模块等上下文。
132
- *
133
- * @example
134
- * paymentModule.updateOtherParams({ fatherModule: 'bookingTicket' });
135
- */
136
- updateOtherParams(params) {
137
- this.otherParams = params || {};
138
- }
139
134
  /**
140
135
  * 记录信息日志
141
136
  */
@@ -218,18 +213,66 @@ var PaymentModule = class extends import_BaseModule.BaseModule {
218
213
  }
219
214
  });
220
215
  }
216
+ async filterPayMethods(payMethods) {
217
+ payMethods = payMethods.filter((method) => method.status === 1 && method.disable === 0);
218
+ const walletPassMethod = payMethods.find((method) => method.code === "WALLET_PASS");
219
+ if (walletPassMethod) {
220
+ payMethods.forEach((method) => {
221
+ if (method.code === "PRODUCTVOUCHER" || method.code === "GIFTCARD" || method.code === "POINTCARD") {
222
+ method.channel_application = walletPassMethod.channel_application;
223
+ }
224
+ });
225
+ } else {
226
+ payMethods = payMethods.filter((method) => method.code !== "PRODUCTVOUCHER" && method.code !== "GIFTCARD" && method.code !== "POINTCARD");
227
+ }
228
+ return payMethods;
229
+ }
221
230
  /**
222
231
  * 获取支付方式列表
223
232
  */
224
233
  async getPayMethodListAsync() {
234
+ var _a;
225
235
  this.logInfo("Starting getPayMethodListAsync");
236
+ if ((_a = this.payMethodMemoryCache) == null ? void 0 : _a.length) {
237
+ return this.payMethodMemoryCache;
238
+ }
239
+ if (this.payMethodListInFlight) {
240
+ return this.payMethodListInFlight;
241
+ }
242
+ this.payMethodListInFlight = this.loadPayMethodListAsync().finally(() => {
243
+ this.payMethodListInFlight = null;
244
+ });
245
+ return this.payMethodListInFlight;
246
+ }
247
+ async loadPayMethodListAsync() {
226
248
  try {
227
- const response = await this.request.get("/pay/custom-payment/all", {
228
- filterPaymentMethods: true
229
- }, {
230
- osServer: true
231
- });
232
- const payMethods = (response == null ? void 0 : response.data) || response || [];
249
+ let cachedMethods = [];
250
+ try {
251
+ cachedMethods = await this.dbManager.getAll("pay_method");
252
+ } catch (dbError) {
253
+ console.warn("[PaymentModule] pay_method 表不存在,将从服务器获取数据");
254
+ }
255
+ const hasCache = cachedMethods.length > 0;
256
+ if (hasCache) {
257
+ this.payMethodMemoryCache = cachedMethods;
258
+ this.refreshPaymentMethodsInBackground(cachedMethods);
259
+ return cachedMethods;
260
+ }
261
+ const response = await this.request.get("/pay/custom-payment/all");
262
+ response.data = await this.filterPayMethods(response.data);
263
+ const payMethods = response.data || [];
264
+ this.payMethodMemoryCache = payMethods;
265
+ try {
266
+ for (const method of payMethods) {
267
+ await this.dbManager.update("pay_method", method);
268
+ }
269
+ } catch (dbError) {
270
+ console.warn("[PaymentModule] 无法缓存支付方式,pay_method 表不存在");
271
+ }
272
+ await this.core.effects.emit(
273
+ `${this.name}:onPaymentMethodsLoaded`,
274
+ payMethods
275
+ );
233
276
  this.logInfo("getPayMethodListAsync completed successfully", {
234
277
  payMethods
235
278
  });
@@ -240,10 +283,101 @@ var PaymentModule = class extends import_BaseModule.BaseModule {
240
283
  return [];
241
284
  }
242
285
  }
286
+ /**
287
+ * 后台刷新支付方式列表
288
+ */
289
+ async refreshPaymentMethodsInBackground(cachedMethods) {
290
+ if (this.isRefreshingPaymentMethods)
291
+ return;
292
+ this.isRefreshingPaymentMethods = true;
293
+ this.logInfo("Starting refreshPaymentMethodsInBackground", {
294
+ cachedMethodsCount: cachedMethods.length
295
+ });
296
+ try {
297
+ console.log("[PaymentModule] 后台刷新支付方式列表...");
298
+ const response = await this.request.get("/pay/custom-payment/all");
299
+ response.data = await this.filterPayMethods(response.data);
300
+ const newPayMethods = response.data || [];
301
+ this.payMethodMemoryCache = newPayMethods;
302
+ const hasChanges = this.hasPaymentMethodsChanged(
303
+ cachedMethods,
304
+ newPayMethods
305
+ );
306
+ if (hasChanges) {
307
+ console.log("[PaymentModule] 支付方式列表已更新");
308
+ this.logInfo("Payment methods updated in background", {
309
+ oldCount: cachedMethods.length,
310
+ newCount: newPayMethods.length
311
+ });
312
+ try {
313
+ for (const method of cachedMethods) {
314
+ await this.dbManager.delete("pay_method", method.id);
315
+ }
316
+ for (const method of newPayMethods) {
317
+ await this.dbManager.update("pay_method", method);
318
+ }
319
+ } catch (dbError) {
320
+ console.warn("[PaymentModule] 无法更新支付方式缓存", dbError);
321
+ }
322
+ const eventData = {
323
+ oldMethods: cachedMethods,
324
+ newMethods: newPayMethods
325
+ };
326
+ await this.core.effects.emit(
327
+ `${this.name}:onPaymentMethodsChanged`,
328
+ eventData
329
+ );
330
+ } else {
331
+ console.log("[PaymentModule] 支付方式列表无变化");
332
+ }
333
+ } catch (error) {
334
+ console.error("[PaymentModule] 后台刷新支付方式失败", error);
335
+ } finally {
336
+ this.isRefreshingPaymentMethods = false;
337
+ }
338
+ }
339
+ /**
340
+ * 检查支付方式列表是否有变化
341
+ */
342
+ hasPaymentMethodsChanged(oldMethods, newMethods) {
343
+ if (oldMethods.length !== newMethods.length) {
344
+ return true;
345
+ }
346
+ const oldMethodsMap = new Map(
347
+ oldMethods.map((method) => [method.id, method])
348
+ );
349
+ for (const newMethod of newMethods) {
350
+ const oldMethod = oldMethodsMap.get(newMethod.id);
351
+ if (!oldMethod) {
352
+ return true;
353
+ }
354
+ if (oldMethod.code !== newMethod.code || oldMethod.name !== newMethod.name || oldMethod.type !== newMethod.type || oldMethod.description !== newMethod.description || oldMethod.status !== newMethod.status || oldMethod.disable !== newMethod.disable || oldMethod.is_surcharge !== newMethod.is_surcharge || oldMethod.fixed !== newMethod.fixed || oldMethod.percentage !== newMethod.percentage || oldMethod.enabled !== newMethod.enabled || JSON.stringify(oldMethod.channel_application || []) !== JSON.stringify(newMethod.channel_application || []) || JSON.stringify(oldMethod.companies || []) !== JSON.stringify(newMethod.companies || []) || JSON.stringify(oldMethod.metadata || {}) !== JSON.stringify(newMethod.metadata || {})) {
355
+ console.log(`[PaymentModule] 支付方式 ${newMethod.id} (${newMethod.code}) 发生变化:`, {
356
+ id: newMethod.id,
357
+ changes: {
358
+ code: oldMethod.code !== newMethod.code ? { old: oldMethod.code, new: newMethod.code } : void 0,
359
+ name: oldMethod.name !== newMethod.name ? { old: oldMethod.name, new: newMethod.name } : void 0,
360
+ type: oldMethod.type !== newMethod.type ? { old: oldMethod.type, new: newMethod.type } : void 0,
361
+ description: oldMethod.description !== newMethod.description ? { old: oldMethod.description, new: newMethod.description } : void 0,
362
+ status: oldMethod.status !== newMethod.status ? { old: oldMethod.status, new: newMethod.status } : void 0,
363
+ disable: oldMethod.disable !== newMethod.disable ? { old: oldMethod.disable, new: newMethod.disable } : void 0,
364
+ is_surcharge: oldMethod.is_surcharge !== newMethod.is_surcharge ? { old: oldMethod.is_surcharge, new: newMethod.is_surcharge } : void 0,
365
+ fixed: oldMethod.fixed !== newMethod.fixed ? { old: oldMethod.fixed, new: newMethod.fixed } : void 0,
366
+ percentage: oldMethod.percentage !== newMethod.percentage ? { old: oldMethod.percentage, new: newMethod.percentage } : void 0,
367
+ enabled: oldMethod.enabled !== newMethod.enabled ? { old: oldMethod.enabled, new: newMethod.enabled } : void 0,
368
+ channel_application: JSON.stringify(oldMethod.channel_application || []) !== JSON.stringify(newMethod.channel_application || []) ? { old: oldMethod.channel_application, new: newMethod.channel_application } : void 0,
369
+ companies: JSON.stringify(oldMethod.companies || []) !== JSON.stringify(newMethod.companies || []) ? { old: oldMethod.companies, new: newMethod.companies } : void 0,
370
+ metadata: JSON.stringify(oldMethod.metadata || {}) !== JSON.stringify(newMethod.metadata || {}) ? { old: oldMethod.metadata, new: newMethod.metadata } : void 0
371
+ }
372
+ });
373
+ return true;
374
+ }
375
+ }
376
+ return false;
377
+ }
243
378
  /**
244
379
  * 获取订单列表
245
380
  */
246
- /** @deprecated */
247
381
  async getOrderListAsync() {
248
382
  try {
249
383
  return await this.dbManager.getAll("order");
@@ -1001,7 +1135,6 @@ var PaymentModule = class extends import_BaseModule.BaseModule {
1001
1135
  /**
1002
1136
  * 确保支付模块所需的数据库表已创建
1003
1137
  */
1004
- /** @deprecated */
1005
1138
  async ensurePaymentTables() {
1006
1139
  try {
1007
1140
  await this.dbManager.getAll("pay_method");
@@ -1023,7 +1156,6 @@ var PaymentModule = class extends import_BaseModule.BaseModule {
1023
1156
  /**
1024
1157
  * 获取部分支付的订单
1025
1158
  */
1026
- /** @deprecated */
1027
1159
  async getPartiallyPaidOrdersAsync() {
1028
1160
  try {
1029
1161
  const allOrders = await this.dbManager.getAll("order");
@@ -135,8 +135,6 @@ export interface PaymentItem {
135
135
  origin_amount?: string;
136
136
  /** 订单支付类型 */
137
137
  order_payment_type?: 'normal' | 'deposit';
138
- /** 支付时间 (格式: YYYY-MM-DD HH:mm:ss) */
139
- payment_time?: string;
140
138
  /** 本支付项是否已成功同步到后端 */
141
139
  isSynced?: boolean;
142
140
  /** 最近一次同步失败信息(存在则代表同步失败过) */
@@ -31,7 +31,7 @@ var getAvailableMaxAmount = (data) => {
31
31
  return data.tag !== "point_card" ? data.available_max_amount : data == null ? void 0 : data.recommended_usage_amount;
32
32
  };
33
33
  var formatWalletPassList2PreparePayments = (list) => {
34
- const formatted = (list || []).map((item) => {
34
+ return (list || []).map((item) => {
35
35
  return {
36
36
  voucher_id: item.id || 0,
37
37
  amount: Number(item.edit_current_amount || getAvailableMaxAmount(item)) || 0,
@@ -40,7 +40,6 @@ var formatWalletPassList2PreparePayments = (list) => {
40
40
  wallet_pass_use_value: item.wallet_pass_use_value || void 0
41
41
  };
42
42
  });
43
- return formatted;
44
43
  };
45
44
  var sortUserIdentificationCodeList = (list) => {
46
45
  if (!Array.isArray(list) || list.length === 0) {
@@ -296,22 +296,18 @@ var WalletPassPaymentImpl = class {
296
296
  return (0, import_utils.formatWalletPassList2PreparePayments)(list);
297
297
  }
298
298
  async getUserIdentificationCodeListAsync(params) {
299
- var _a, _b, _c;
299
+ var _a, _b;
300
300
  try {
301
301
  const newParams = {
302
302
  ...this.walletParams,
303
303
  ...params
304
304
  };
305
- if (!((_a = newParams.products) == null ? void 0 : _a.length)) {
306
- this.paymentModule.logInfo("[WalletPass] 商品列表为空,跳过获取用户识别码列表");
307
- return [];
308
- }
309
305
  this.paymentModule.logInfo("[WalletPass] 开始获取用户识别码列表", {
310
306
  customer_id: newParams.customer_id,
311
307
  available: newParams.available,
312
- prepare_payments_count: ((_b = newParams.prepare_payments) == null ? void 0 : _b.length) || 0,
308
+ prepare_payments_count: ((_a = newParams.prepare_payments) == null ? void 0 : _a.length) || 0,
313
309
  filter_prepare_wallet_pass: newParams.filter_prepare_wallet_pass,
314
- payment_order_id: (_c = this.walletParams) == null ? void 0 : _c.payment_order_id
310
+ payment_order_id: (_b = this.walletParams) == null ? void 0 : _b.payment_order_id
315
311
  });
316
312
  const response = await this.paymentModule.request.post(
317
313
  "/machinecode/prepare/deduction",
@@ -1,6 +1,5 @@
1
1
  import { Module, PisellCore } from '../../types';
2
2
  import { BaseModule } from '../BaseModule';
3
- import { ProductListLoadProductsParams } from './types';
4
3
  import { ProductData } from '../Product/types';
5
4
  export * from './types';
6
5
  export declare class ProductList extends BaseModule implements Module {
@@ -11,22 +10,19 @@ export declare class ProductList extends BaseModule implements Module {
11
10
  private otherParams;
12
11
  constructor(name?: string, version?: string);
13
12
  initialize(core: PisellCore, options: any): Promise<void>;
14
- /**
15
- * 更新运行态参数,供父级解决方案 setOtherParams 后同步查询上下文。
16
- *
17
- * @example
18
- * productList.updateOtherParams({ channel: 'pos' });
19
- */
20
- updateOtherParams(params: Record<string, any>): void;
21
13
  storeChange(path?: string, value?: any): Promise<void>;
22
- /**
23
- * 获取加时商品列表。
24
- *
25
- * @example
26
- * const products = await productList.getAddTimeProducts({ schedule_date: '2026-06-16' });
27
- */
28
- getAddTimeProducts(params?: ProductListLoadProductsParams): Promise<any>;
29
- loadProducts({ category_ids, product_ids, collection, menu_list_ids, customer_id: paramsCustomerId, with_count, schedule_datetime, schedule_date, cacheId, with_schedule, extension_type, status, }?: ProductListLoadProductsParams, options?: {
14
+ loadProducts({ category_ids, product_ids, collection, menu_list_ids, customer_id: paramsCustomerId, with_count, schedule_datetime, schedule_date, cacheId, with_schedule, }: {
15
+ category_ids?: number[];
16
+ product_ids?: number[];
17
+ collection?: number | string[];
18
+ schedule_date?: string;
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
+ }, options?: {
30
26
  callback?: (result: any) => void;
31
27
  subscriberId?: string;
32
28
  }): Promise<any>;
@@ -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)
@@ -17,14 +15,6 @@ var __copyProps = (to, from, except, desc) => {
17
15
  return to;
18
16
  };
19
17
  var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
19
 
30
20
  // src/modules/ProductList/index.ts
@@ -35,7 +25,6 @@ __export(ProductList_exports, {
35
25
  module.exports = __toCommonJS(ProductList_exports);
36
26
  var import_BaseModule = require("../BaseModule");
37
27
  var import_lodash_es = require("lodash-es");
38
- var import_dayjs = __toESM(require("dayjs"));
39
28
  __reExport(ProductList_exports, require("./types"), module.exports);
40
29
  var ProductList = class extends import_BaseModule.BaseModule {
41
30
  constructor(name, version) {
@@ -58,31 +47,8 @@ var ProductList = class extends import_BaseModule.BaseModule {
58
47
  }
59
48
  this.request = core.getPlugin("request");
60
49
  }
61
- /**
62
- * 更新运行态参数,供父级解决方案 setOtherParams 后同步查询上下文。
63
- *
64
- * @example
65
- * productList.updateOtherParams({ channel: 'pos' });
66
- */
67
- updateOtherParams(params) {
68
- this.otherParams = params || {};
69
- }
70
50
  async storeChange(path, value) {
71
51
  }
72
- /**
73
- * 获取加时商品列表。
74
- *
75
- * @example
76
- * const products = await productList.getAddTimeProducts({ schedule_date: '2026-06-16' });
77
- */
78
- async getAddTimeProducts(params = {}) {
79
- return this.loadProducts({
80
- schedule_date: (0, import_dayjs.default)().format("YYYY-MM-DD"),
81
- status: "published",
82
- ...params,
83
- extension_type: ["product_add_time"]
84
- });
85
- }
86
52
  async loadProducts({
87
53
  category_ids = [],
88
54
  product_ids = [],
@@ -93,10 +59,8 @@ var ProductList = class extends import_BaseModule.BaseModule {
93
59
  schedule_datetime,
94
60
  schedule_date,
95
61
  cacheId,
96
- with_schedule,
97
- extension_type,
98
- status = "published"
99
- } = {}, options) {
62
+ with_schedule
63
+ }, options) {
100
64
  var _a, _b;
101
65
  let userPlugin = this.core.getPlugin("user");
102
66
  let customer_id = void 0;
@@ -119,7 +83,7 @@ var ProductList = class extends import_BaseModule.BaseModule {
119
83
  "event_item"
120
84
  ],
121
85
  with: ["category", "collection", "resourceRelation"],
122
- status,
86
+ status: "published",
123
87
  num: 500,
124
88
  skip: 1,
125
89
  customer_id,
@@ -134,8 +98,7 @@ var ProductList = class extends import_BaseModule.BaseModule {
134
98
  application_code: (_b = this.otherParams) == null ? void 0 : _b.channel,
135
99
  is_eject: 1,
136
100
  with_schedule,
137
- schedule_datetime,
138
- extension_type
101
+ schedule_datetime
139
102
  },
140
103
  { osServer: true, callback: options == null ? void 0 : options.callback, subscriberId: options == null ? void 0 : options.subscriberId, customToast: () => {
141
104
  } }
@@ -1,18 +1,4 @@
1
1
  import { ProductData } from '../Product/types';
2
- export interface ProductListLoadProductsParams {
3
- category_ids?: number[];
4
- product_ids?: number[];
5
- collection?: number | string[];
6
- schedule_date?: string;
7
- cacheId?: string;
8
- customer_id?: number;
9
- menu_list_ids?: number[];
10
- schedule_datetime?: string;
11
- with_count?: string[];
12
- with_schedule?: number;
13
- extension_type?: string[];
14
- status?: string;
15
- }
16
2
  export interface ProductListData {
17
3
  list: ProductData[];
18
4
  selectProducts: ProductData[];
@@ -47,6 +47,7 @@ export declare class QuotationModule extends BaseModule implements Module {
47
47
  customer_id?: number | string;
48
48
  }): Map<string, string | null>;
49
49
  setScheduleResolver(resolver: (id: number) => ScheduleItem | undefined): void;
50
+ private filterQuotationsByCustomer;
50
51
  private isQuotationVisibleForCustomer;
51
52
  private hasValidCustomerId;
52
53
  private isQuotationActiveAt;
@@ -43,15 +43,20 @@ var QuotationModule = class extends import_BaseModule.BaseModule {
43
43
  const query = {};
44
44
  if (params == null ? void 0 : params.channel)
45
45
  query.channel = params.channel;
46
+ if (params == null ? void 0 : params.customer_id)
47
+ query.customer_id = String(params.customer_id);
46
48
  if ((params == null ? void 0 : params.channel) === "online_store") {
47
49
  query.channel = "online-store";
48
50
  }
49
51
  const res = await this.request.get(
50
52
  "/quotation/available",
51
53
  query,
52
- { useCache: false, osServer: true }
54
+ { useCache: false }
55
+ );
56
+ const list = this.filterQuotationsByCustomer(
57
+ ((_a = res == null ? void 0 : res.data) == null ? void 0 : _a.list) || (res == null ? void 0 : res.list) || [],
58
+ params == null ? void 0 : params.customer_id
53
59
  );
54
- const list = ((_a = res == null ? void 0 : res.data) == null ? void 0 : _a.list) || (res == null ? void 0 : res.list) || [];
55
60
  list.sort((a, b) => a.sort - b.sort);
56
61
  this.store.list = list;
57
62
  }
@@ -69,11 +74,9 @@ var QuotationModule = class extends import_BaseModule.BaseModule {
69
74
  getPriceForProduct(params) {
70
75
  const { productId, variantId, datetime, customer_id } = params;
71
76
  for (const quotation of this.store.list) {
72
- const visible = this.isQuotationVisibleForCustomer(quotation, customer_id);
73
- if (!visible)
77
+ if (!this.isQuotationVisibleForCustomer(quotation, customer_id))
74
78
  continue;
75
- const active = this.isQuotationActiveAt(quotation, datetime);
76
- if (!active)
79
+ if (!this.isQuotationActiveAt(quotation, datetime))
77
80
  continue;
78
81
  const match = this.findProductData(quotation.product_data, productId, variantId);
79
82
  if (!match)
@@ -125,6 +128,9 @@ var QuotationModule = class extends import_BaseModule.BaseModule {
125
128
  setScheduleResolver(resolver) {
126
129
  this.scheduleResolver = resolver;
127
130
  }
131
+ filterQuotationsByCustomer(list, customerId) {
132
+ return list.filter((quotation) => this.isQuotationVisibleForCustomer(quotation, customerId));
133
+ }
128
134
  isQuotationVisibleForCustomer(quotation, customerId) {
129
135
  const customers = quotation.customer || [];
130
136
  if (customers.length === 0)
@@ -142,27 +148,18 @@ var QuotationModule = class extends import_BaseModule.BaseModule {
142
148
  var _a;
143
149
  if (!((_a = quotation.schedule) == null ? void 0 : _a.length))
144
150
  return false;
145
- const scheduleItems = [];
146
- quotation.schedule.forEach((s) => {
151
+ const scheduleItems = quotation.schedule.map((s) => {
147
152
  var _a2;
148
153
  const full = (_a2 = this.scheduleResolver) == null ? void 0 : _a2.call(this, s.id);
149
- if (full) {
150
- scheduleItems.push(full);
151
- return;
152
- }
153
- if (this.scheduleResolver) {
154
- return;
155
- }
156
- const fallbackSchedule = {
154
+ if (full)
155
+ return full;
156
+ return {
157
157
  ...s,
158
158
  repeat_type: s.repeat_type || "none",
159
159
  repeat_rule: s.repeat_rule || null,
160
160
  time_slot: s.time_slot || []
161
161
  };
162
- scheduleItems.push(fallbackSchedule);
163
162
  });
164
- if (!scheduleItems.length)
165
- return false;
166
163
  return (0, import_getDateIsInSchedule.getDateIsInSchedule)(datetime, scheduleItems);
167
164
  }
168
165
  findProductData(productData, productId, variantId) {
@@ -32,10 +32,6 @@ export declare class RulesModule extends BaseModule implements Module, RulesModu
32
32
  unavailableReason?: UnavailableReason;
33
33
  };
34
34
  filterDiscountListByType(discountList: Discount[], type: string): Discount[];
35
- /** 剔除指定 type/tag 的折扣项,保留手动改价(type=product) / 券等 */
36
- excludeDiscountListByType(discountList: Discount[], type: string): Discount[];
37
- /** 手动改价场景:去掉 promotion,保留 type=product 等行内折扣 */
38
- resolveDiscountListForManualOverride(discountList: Discount[]): Discount[];
39
35
  private getUnavailableReason;
40
36
  calcDiscount({ discountList, productList, holders, isFormSubject, orderTotalAmount }: {
41
37
  discountList: Discount[];