@pisell/pisellos 2.2.244 → 2.2.245

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 (317) hide show
  1. package/dist/model/strategy/adapter/promotion/evaluator.js +3 -2
  2. package/dist/model/strategy/adapter/promotion/index.js +0 -9
  3. package/dist/model/strategy/adapter/walletPass/utils.js +7 -4
  4. package/dist/modules/BookingContext/index.d.ts +48 -0
  5. package/dist/modules/BookingContext/index.js +566 -0
  6. package/dist/modules/BookingContext/types.d.ts +102 -0
  7. package/dist/modules/BookingContext/types.js +51 -0
  8. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts +16 -0
  9. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +284 -0
  10. package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +8 -0
  11. package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +145 -0
  12. package/dist/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +76 -0
  13. package/dist/modules/BookingContext/utils/cacheItemToBookingInput.js +218 -0
  14. package/dist/modules/BookingContext/utils/flexible.d.ts +28 -0
  15. package/dist/modules/BookingContext/utils/flexible.js +56 -0
  16. package/dist/modules/BookingContext/utils/formatResourceList.d.ts +8 -0
  17. package/dist/modules/BookingContext/utils/formatResourceList.js +38 -0
  18. package/dist/modules/BookingContext/utils/index.d.ts +11 -0
  19. package/dist/modules/BookingContext/utils/index.js +11 -0
  20. package/dist/modules/BookingContext/utils/noResource.d.ts +13 -0
  21. package/dist/modules/BookingContext/utils/noResource.js +77 -0
  22. package/dist/modules/BookingContext/utils/orderLineDisplay.d.ts +1 -0
  23. package/dist/modules/BookingContext/utils/orderLineDisplay.js +36 -0
  24. package/dist/modules/BookingContext/utils/productExtend.d.ts +72 -0
  25. package/dist/modules/BookingContext/utils/productExtend.js +339 -0
  26. package/dist/modules/BookingContext/utils/resourceErrors.d.ts +41 -0
  27. package/dist/modules/BookingContext/utils/resourceErrors.js +74 -0
  28. package/dist/modules/BookingContext/utils/resourceSelection.d.ts +7 -0
  29. package/dist/modules/BookingContext/utils/resourceSelection.js +24 -0
  30. package/dist/modules/BookingContext/utils/resources.d.ts +80 -0
  31. package/dist/modules/BookingContext/utils/resources.js +486 -0
  32. package/dist/modules/BookingContext/utils/serviceTimes.d.ts +55 -0
  33. package/dist/modules/BookingContext/utils/serviceTimes.js +151 -0
  34. package/dist/modules/BookingContext/utils/timeSlices.d.ts +42 -0
  35. package/dist/modules/BookingContext/utils/timeSlices.js +100 -0
  36. package/dist/modules/Cart/utils/cartProduct.js +24 -3
  37. package/dist/modules/Cart/utils/changePrice.js +11 -11
  38. package/dist/modules/Customer/index.d.ts +20 -0
  39. package/dist/modules/Customer/index.js +172 -83
  40. package/dist/modules/Customer/types.d.ts +2 -0
  41. package/dist/modules/Discount/index.d.ts +1 -1
  42. package/dist/modules/Discount/index.js +13 -6
  43. package/dist/modules/Discount/types.d.ts +1 -0
  44. package/dist/modules/OpenData/index.d.ts +8 -0
  45. package/dist/modules/OpenData/index.js +37 -17
  46. package/dist/modules/Order/index.d.ts +275 -19
  47. package/dist/modules/Order/index.js +3493 -809
  48. package/dist/modules/Order/types.d.ts +286 -31
  49. package/dist/modules/Order/types.js +38 -0
  50. package/dist/modules/Order/utils/manualProductDiscount.d.ts +106 -0
  51. package/dist/modules/Order/utils/manualProductDiscount.js +210 -0
  52. package/dist/modules/Order/utils.d.ts +147 -5
  53. package/dist/modules/Order/utils.js +750 -104
  54. package/dist/modules/Payment/index.d.ts +10 -13
  55. package/dist/modules/Payment/index.js +467 -837
  56. package/dist/modules/Payment/types.d.ts +2 -0
  57. package/dist/modules/Payment/utils.js +2 -1
  58. package/dist/modules/Payment/walletpass.js +41 -25
  59. package/dist/modules/ProductList/index.d.ts +16 -12
  60. package/dist/modules/ProductList/index.js +133 -59
  61. package/dist/modules/ProductList/types.d.ts +14 -0
  62. package/dist/modules/Quotation/index.d.ts +0 -1
  63. package/dist/modules/Quotation/index.js +25 -22
  64. package/dist/modules/Rules/index.d.ts +4 -0
  65. package/dist/modules/Rules/index.js +97 -70
  66. package/dist/modules/Rules/types.d.ts +1 -0
  67. package/dist/modules/SalesSummary/index.d.ts +8 -25
  68. package/dist/modules/SalesSummary/index.js +86 -35
  69. package/dist/modules/SalesSummary/types.d.ts +4 -1
  70. package/dist/modules/SalesSummary/utils.d.ts +2 -25
  71. package/dist/modules/SalesSummary/utils.js +794 -162
  72. package/dist/modules/Schedule/index.d.ts +7 -0
  73. package/dist/modules/Schedule/index.js +24 -2
  74. package/dist/modules/Summary/index.js +4 -3
  75. package/dist/modules/SurchargeList/index.d.ts +16 -0
  76. package/dist/modules/SurchargeList/index.js +162 -0
  77. package/dist/modules/SurchargeList/types.d.ts +11 -0
  78. package/dist/modules/SurchargeList/types.js +1 -0
  79. package/dist/modules/index.d.ts +2 -0
  80. package/dist/modules/index.js +3 -1
  81. package/dist/plugins/request.d.ts +1 -0
  82. package/dist/server/index.d.ts +204 -1
  83. package/dist/server/index.js +3654 -922
  84. package/dist/server/modules/index.d.ts +2 -0
  85. package/dist/server/modules/index.js +2 -0
  86. package/dist/server/modules/order/index.d.ts +120 -3
  87. package/dist/server/modules/order/index.js +1758 -448
  88. package/dist/server/modules/order/types.d.ts +32 -3
  89. package/dist/server/modules/order/types.js +8 -0
  90. package/dist/server/modules/order/utils/filterBookings.js +26 -3
  91. package/dist/server/modules/order/utils/filterOrders.js +23 -8
  92. package/dist/server/modules/payment/index.d.ts +28 -0
  93. package/dist/server/modules/payment/index.js +305 -0
  94. package/dist/server/modules/payment/types.d.ts +9 -0
  95. package/dist/server/modules/payment/types.js +1 -0
  96. package/dist/server/modules/products/index.d.ts +34 -7
  97. package/dist/server/modules/products/index.js +631 -317
  98. package/dist/server/modules/resource/index.d.ts +2 -0
  99. package/dist/server/modules/resource/index.js +29 -3
  100. package/dist/server/modules/schedule/index.d.ts +4 -4
  101. package/dist/server/modules/schedule/index.js +111 -88
  102. package/dist/server/test.json +713 -0
  103. package/dist/server/utils/small-ticket.d.ts +71 -0
  104. package/dist/server/utils/small-ticket.js +840 -0
  105. package/dist/solution/BaseSales/index.d.ts +133 -10
  106. package/dist/solution/BaseSales/index.js +1950 -447
  107. package/dist/solution/BaseSales/types.d.ts +82 -6
  108. package/dist/solution/BaseSales/types.js +5 -4
  109. package/dist/solution/BaseSales/utils/cartPromotion.d.ts +287 -0
  110. package/dist/solution/BaseSales/utils/cartPromotion.js +1438 -0
  111. package/dist/solution/BaseSales/utils/quotationPrice.d.ts +7 -0
  112. package/dist/solution/BaseSales/utils/quotationPrice.js +237 -0
  113. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +1 -0
  114. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +105 -24
  115. package/dist/solution/BaseSales/utils.d.ts +1 -1
  116. package/dist/solution/BaseSales/utils.js +62 -21
  117. package/dist/solution/BookingByStep/index.d.ts +1 -1
  118. package/dist/solution/BookingTicket/index.d.ts +271 -11
  119. package/dist/solution/BookingTicket/index.js +1777 -242
  120. package/dist/solution/BookingTicket/types.d.ts +118 -1
  121. package/dist/solution/BookingTicket/types.js +41 -2
  122. package/dist/solution/BookingTicket/utils/addProductDecision.d.ts +117 -0
  123. package/dist/solution/BookingTicket/utils/addProductDecision.js +346 -0
  124. package/dist/solution/BookingTicket/utils/addTimeAvailability.d.ts +35 -0
  125. package/dist/solution/BookingTicket/utils/addTimeAvailability.js +95 -0
  126. package/dist/solution/BookingTicket/utils/bookingStatus.d.ts +40 -0
  127. package/dist/solution/BookingTicket/utils/bookingStatus.js +70 -0
  128. package/dist/solution/BookingTicket/utils/cartView.d.ts +9 -1
  129. package/dist/solution/BookingTicket/utils/cartView.js +94 -7
  130. package/dist/solution/BookingTicket/utils/exampleData.d.ts +123 -0
  131. package/dist/solution/BookingTicket/utils/exampleData.js +183 -0
  132. package/dist/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +185 -0
  133. package/dist/solution/BookingTicket/utils/resolveBestAddTimePlan.js +438 -0
  134. package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +36 -0
  135. package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +400 -0
  136. package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +32 -0
  137. package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.js +56 -0
  138. package/dist/solution/BookingTicket/utils/scan/index.d.ts +5 -0
  139. package/dist/solution/BookingTicket/utils/scan/index.js +20 -8
  140. package/dist/solution/BookingTicket/utils/scan/scanProductValues.d.ts +21 -0
  141. package/dist/solution/BookingTicket/utils/scan/scanProductValues.js +150 -0
  142. package/dist/solution/BookingTicket/utils/sessionCatalogStale.d.ts +23 -0
  143. package/dist/solution/BookingTicket/utils/sessionCatalogStale.js +78 -0
  144. package/dist/solution/Checkout/index.d.ts +1 -0
  145. package/dist/solution/Checkout/index.js +10 -9
  146. package/dist/solution/RegisterAndLogin/config.js +2 -10
  147. package/dist/solution/ScanOrder/index.d.ts +9 -3
  148. package/dist/solution/ScanOrder/index.js +241 -134
  149. package/dist/solution/ScanOrder/types.d.ts +9 -5
  150. package/dist/solution/ScanOrder/types.js +2 -3
  151. package/dist/solution/ScanOrder/utils.d.ts +1 -1
  152. package/dist/solution/ScanOrder/utils.js +84 -22
  153. package/dist/solution/VenueBooking/index.d.ts +5 -2
  154. package/dist/solution/VenueBooking/index.js +110 -59
  155. package/dist/solution/VenueBooking/sales-section-4-annotated.json +0 -2
  156. package/dist/solution/VenueBooking/utils/slotMerge.d.ts +4 -0
  157. package/dist/solution/VenueBooking/utils/slotMerge.js +10 -0
  158. package/dist/types/index.d.ts +10 -0
  159. package/lib/model/strategy/adapter/promotion/evaluator.js +2 -1
  160. package/lib/model/strategy/adapter/promotion/index.js +49 -0
  161. package/lib/model/strategy/adapter/walletPass/utils.js +3 -2
  162. package/lib/modules/BookingContext/index.d.ts +48 -0
  163. package/lib/modules/BookingContext/index.js +368 -0
  164. package/lib/modules/BookingContext/types.d.ts +102 -0
  165. package/lib/modules/BookingContext/types.js +34 -0
  166. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts +16 -0
  167. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +276 -0
  168. package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +8 -0
  169. package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +151 -0
  170. package/lib/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +76 -0
  171. package/lib/modules/BookingContext/utils/cacheItemToBookingInput.js +201 -0
  172. package/lib/modules/BookingContext/utils/flexible.d.ts +28 -0
  173. package/lib/modules/BookingContext/utils/flexible.js +80 -0
  174. package/lib/modules/BookingContext/utils/formatResourceList.d.ts +8 -0
  175. package/lib/modules/BookingContext/utils/formatResourceList.js +50 -0
  176. package/lib/modules/BookingContext/utils/index.d.ts +11 -0
  177. package/lib/modules/BookingContext/utils/index.js +43 -0
  178. package/lib/modules/BookingContext/utils/noResource.d.ts +13 -0
  179. package/lib/modules/BookingContext/utils/noResource.js +90 -0
  180. package/lib/modules/BookingContext/utils/orderLineDisplay.d.ts +1 -0
  181. package/lib/modules/BookingContext/utils/orderLineDisplay.js +56 -0
  182. package/lib/modules/BookingContext/utils/productExtend.d.ts +72 -0
  183. package/lib/modules/BookingContext/utils/productExtend.js +283 -0
  184. package/lib/modules/BookingContext/utils/resourceErrors.d.ts +41 -0
  185. package/lib/modules/BookingContext/utils/resourceErrors.js +80 -0
  186. package/lib/modules/BookingContext/utils/resourceSelection.d.ts +7 -0
  187. package/lib/modules/BookingContext/utils/resourceSelection.js +46 -0
  188. package/lib/modules/BookingContext/utils/resources.d.ts +80 -0
  189. package/lib/modules/BookingContext/utils/resources.js +377 -0
  190. package/lib/modules/BookingContext/utils/serviceTimes.d.ts +55 -0
  191. package/lib/modules/BookingContext/utils/serviceTimes.js +162 -0
  192. package/lib/modules/BookingContext/utils/timeSlices.d.ts +42 -0
  193. package/lib/modules/BookingContext/utils/timeSlices.js +124 -0
  194. package/lib/modules/Cart/utils/cartProduct.js +20 -3
  195. package/lib/modules/Cart/utils/changePrice.js +12 -20
  196. package/lib/modules/Customer/index.d.ts +20 -0
  197. package/lib/modules/Customer/index.js +64 -11
  198. package/lib/modules/Customer/types.d.ts +2 -0
  199. package/lib/modules/Discount/index.d.ts +1 -1
  200. package/lib/modules/Discount/index.js +9 -1
  201. package/lib/modules/Discount/types.d.ts +1 -0
  202. package/lib/modules/OpenData/index.d.ts +8 -0
  203. package/lib/modules/OpenData/index.js +19 -5
  204. package/lib/modules/Order/index.d.ts +275 -19
  205. package/lib/modules/Order/index.js +2245 -336
  206. package/lib/modules/Order/types.d.ts +286 -31
  207. package/lib/modules/Order/types.js +1 -0
  208. package/lib/modules/Order/utils/manualProductDiscount.d.ts +106 -0
  209. package/lib/modules/Order/utils/manualProductDiscount.js +206 -0
  210. package/lib/modules/Order/utils.d.ts +147 -5
  211. package/lib/modules/Order/utils.js +615 -46
  212. package/lib/modules/Payment/index.d.ts +10 -13
  213. package/lib/modules/Payment/index.js +18 -150
  214. package/lib/modules/Payment/types.d.ts +2 -0
  215. package/lib/modules/Payment/utils.js +2 -1
  216. package/lib/modules/Payment/walletpass.js +16 -3
  217. package/lib/modules/ProductList/index.d.ts +16 -12
  218. package/lib/modules/ProductList/index.js +41 -4
  219. package/lib/modules/ProductList/types.d.ts +14 -0
  220. package/lib/modules/Quotation/index.d.ts +0 -1
  221. package/lib/modules/Quotation/index.js +19 -16
  222. package/lib/modules/Rules/index.d.ts +4 -0
  223. package/lib/modules/Rules/index.js +137 -120
  224. package/lib/modules/Rules/types.d.ts +1 -0
  225. package/lib/modules/SalesSummary/index.d.ts +8 -25
  226. package/lib/modules/SalesSummary/index.js +30 -4
  227. package/lib/modules/SalesSummary/types.d.ts +4 -1
  228. package/lib/modules/SalesSummary/utils.d.ts +2 -25
  229. package/lib/modules/SalesSummary/utils.js +645 -91
  230. package/lib/modules/Schedule/index.d.ts +7 -0
  231. package/lib/modules/Schedule/index.js +17 -1
  232. package/lib/modules/Summary/index.js +5 -4
  233. package/lib/modules/SurchargeList/index.d.ts +16 -0
  234. package/lib/modules/SurchargeList/index.js +89 -0
  235. package/lib/modules/SurchargeList/types.d.ts +11 -0
  236. package/lib/modules/SurchargeList/types.js +17 -0
  237. package/lib/modules/index.d.ts +2 -0
  238. package/lib/modules/index.js +5 -1
  239. package/lib/plugins/request.d.ts +1 -0
  240. package/lib/server/index.d.ts +204 -1
  241. package/lib/server/index.js +1891 -59
  242. package/lib/server/modules/index.d.ts +2 -0
  243. package/lib/server/modules/index.js +3 -0
  244. package/lib/server/modules/order/index.d.ts +120 -3
  245. package/lib/server/modules/order/index.js +883 -94
  246. package/lib/server/modules/order/types.d.ts +32 -3
  247. package/lib/server/modules/order/utils/filterBookings.js +24 -5
  248. package/lib/server/modules/order/utils/filterOrders.js +15 -6
  249. package/lib/server/modules/payment/index.d.ts +28 -0
  250. package/lib/server/modules/payment/index.js +192 -0
  251. package/lib/server/modules/payment/types.d.ts +9 -0
  252. package/lib/server/modules/payment/types.js +17 -0
  253. package/lib/server/modules/products/index.d.ts +34 -7
  254. package/lib/server/modules/products/index.js +189 -54
  255. package/lib/server/modules/resource/index.d.ts +2 -0
  256. package/lib/server/modules/resource/index.js +27 -3
  257. package/lib/server/modules/schedule/index.d.ts +4 -4
  258. package/lib/server/modules/schedule/index.js +47 -40
  259. package/lib/server/test.json +713 -0
  260. package/lib/server/utils/small-ticket.d.ts +71 -0
  261. package/lib/server/utils/small-ticket.js +800 -0
  262. package/lib/solution/BaseSales/index.d.ts +133 -10
  263. package/lib/solution/BaseSales/index.js +1111 -63
  264. package/lib/solution/BaseSales/types.d.ts +82 -6
  265. package/lib/solution/BaseSales/types.js +3 -1
  266. package/lib/solution/BaseSales/utils/cartPromotion.d.ts +287 -0
  267. package/lib/solution/BaseSales/utils/cartPromotion.js +992 -0
  268. package/lib/solution/BaseSales/utils/quotationPrice.d.ts +7 -0
  269. package/lib/solution/BaseSales/utils/quotationPrice.js +277 -0
  270. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +1 -0
  271. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +106 -18
  272. package/lib/solution/BaseSales/utils.d.ts +1 -1
  273. package/lib/solution/BaseSales/utils.js +54 -10
  274. package/lib/solution/BookingByStep/index.d.ts +1 -1
  275. package/lib/solution/BookingTicket/index.d.ts +271 -11
  276. package/lib/solution/BookingTicket/index.js +922 -29
  277. package/lib/solution/BookingTicket/types.d.ts +118 -1
  278. package/lib/solution/BookingTicket/types.js +11 -0
  279. package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +117 -0
  280. package/lib/solution/BookingTicket/utils/addProductDecision.js +318 -0
  281. package/lib/solution/BookingTicket/utils/addTimeAvailability.d.ts +35 -0
  282. package/lib/solution/BookingTicket/utils/addTimeAvailability.js +125 -0
  283. package/lib/solution/BookingTicket/utils/bookingStatus.d.ts +40 -0
  284. package/lib/solution/BookingTicket/utils/bookingStatus.js +44 -2
  285. package/lib/solution/BookingTicket/utils/cartView.d.ts +9 -1
  286. package/lib/solution/BookingTicket/utils/cartView.js +61 -6
  287. package/lib/solution/BookingTicket/utils/exampleData.d.ts +123 -0
  288. package/lib/solution/BookingTicket/utils/exampleData.js +0 -0
  289. package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +185 -0
  290. package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.js +254 -0
  291. package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +36 -0
  292. package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +169 -0
  293. package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +32 -0
  294. package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.js +51 -0
  295. package/lib/solution/BookingTicket/utils/scan/index.d.ts +5 -0
  296. package/lib/solution/BookingTicket/utils/scan/index.js +17 -3
  297. package/lib/solution/BookingTicket/utils/scan/scanProductValues.d.ts +21 -0
  298. package/lib/solution/BookingTicket/utils/scan/scanProductValues.js +127 -0
  299. package/lib/solution/BookingTicket/utils/sessionCatalogStale.d.ts +23 -0
  300. package/lib/solution/BookingTicket/utils/sessionCatalogStale.js +85 -0
  301. package/lib/solution/Checkout/index.d.ts +1 -0
  302. package/lib/solution/Checkout/index.js +1 -2
  303. package/lib/solution/RegisterAndLogin/config.js +2 -10
  304. package/lib/solution/ScanOrder/index.d.ts +9 -3
  305. package/lib/solution/ScanOrder/index.js +153 -70
  306. package/lib/solution/ScanOrder/types.d.ts +9 -5
  307. package/lib/solution/ScanOrder/utils.d.ts +1 -1
  308. package/lib/solution/ScanOrder/utils.js +83 -17
  309. package/lib/solution/VenueBooking/index.d.ts +5 -2
  310. package/lib/solution/VenueBooking/index.js +54 -17
  311. package/lib/solution/VenueBooking/sales-section-4-annotated.json +0 -2
  312. package/lib/solution/VenueBooking/utils/slotMerge.d.ts +4 -0
  313. package/lib/solution/VenueBooking/utils/slotMerge.js +10 -0
  314. package/lib/types/index.d.ts +10 -0
  315. package/package.json +1 -1
  316. package/dist/solution/Checkout/appointmentDemo.json +0 -1
  317. package/lib/solution/Checkout/appointmentDemo.json +0 -1
@@ -25,9 +25,6 @@ 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;
31
28
  protected otherParams: any;
32
29
  cash: CashPayment;
33
30
  eftpos: EftposPayment;
@@ -36,6 +33,13 @@ export declare class PaymentModule extends BaseModule implements Module, Payment
36
33
  private runVoucherUpdateLocked;
37
34
  private normalizeVoucherPaymentItems;
38
35
  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;
39
43
  /**
40
44
  * 记录信息日志
41
45
  */
@@ -57,23 +61,14 @@ export declare class PaymentModule extends BaseModule implements Module, Payment
57
61
  *
58
62
  */
59
63
  private registerNetworkHandlers;
60
- private filterPayMethods;
61
64
  /**
62
65
  * 获取支付方式列表
63
66
  */
64
67
  getPayMethodListAsync(): Promise<PaymentMethod[]>;
65
- private loadPayMethodListAsync;
66
- /**
67
- * 后台刷新支付方式列表
68
- */
69
- private refreshPaymentMethodsInBackground;
70
- /**
71
- * 检查支付方式列表是否有变化
72
- */
73
- private hasPaymentMethodsChanged;
74
68
  /**
75
69
  * 获取订单列表
76
70
  */
71
+ /** @deprecated */
77
72
  getOrderListAsync(): Promise<PaymentOrder[]>;
78
73
  /**
79
74
  * 根据订单UUID获取支付订单(新方法)
@@ -173,10 +168,12 @@ export declare class PaymentModule extends BaseModule implements Module, Payment
173
168
  /**
174
169
  * 确保支付模块所需的数据库表已创建
175
170
  */
171
+ /** @deprecated */
176
172
  private ensurePaymentTables;
177
173
  /**
178
174
  * 获取部分支付的订单
179
175
  */
176
+ /** @deprecated */
180
177
  getPartiallyPaidOrdersAsync(): Promise<PaymentOrder[]>;
181
178
  /**
182
179
  * 智能金额舍入
@@ -76,9 +76,6 @@ 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;
82
79
  this.otherParams = {};
83
80
  this.cash = new import_cash.CashPaymentImpl(this);
84
81
  this.eftpos = new import_eftpos.EftposPaymentImpl(this);
@@ -126,11 +123,19 @@ var PaymentModule = class extends import_BaseModule.BaseModule {
126
123
  this.app = appPlugin.getApp();
127
124
  this.dbManager = this.app.dbManager;
128
125
  this.logger = this.app.logger;
129
- await this.ensurePaymentTables();
130
126
  this.registerNetworkHandlers();
131
127
  console.log("[PaymentModule] 初始化完成");
132
128
  this.logInfo("PaymentModule initialized successfully");
133
129
  }
130
+ /**
131
+ * 更新父级解决方案透传的运行态参数,主要用于日志父模块等上下文。
132
+ *
133
+ * @example
134
+ * paymentModule.updateOtherParams({ fatherModule: 'bookingTicket' });
135
+ */
136
+ updateOtherParams(params) {
137
+ this.otherParams = params || {};
138
+ }
134
139
  /**
135
140
  * 记录信息日志
136
141
  */
@@ -213,66 +218,18 @@ var PaymentModule = class extends import_BaseModule.BaseModule {
213
218
  }
214
219
  });
215
220
  }
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
- }
230
221
  /**
231
222
  * 获取支付方式列表
232
223
  */
233
224
  async getPayMethodListAsync() {
234
- var _a;
235
225
  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() {
248
226
  try {
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
- );
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 || [];
276
233
  this.logInfo("getPayMethodListAsync completed successfully", {
277
234
  payMethods
278
235
  });
@@ -283,101 +240,10 @@ var PaymentModule = class extends import_BaseModule.BaseModule {
283
240
  return [];
284
241
  }
285
242
  }
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
- }
378
243
  /**
379
244
  * 获取订单列表
380
245
  */
246
+ /** @deprecated */
381
247
  async getOrderListAsync() {
382
248
  try {
383
249
  return await this.dbManager.getAll("order");
@@ -1135,6 +1001,7 @@ var PaymentModule = class extends import_BaseModule.BaseModule {
1135
1001
  /**
1136
1002
  * 确保支付模块所需的数据库表已创建
1137
1003
  */
1004
+ /** @deprecated */
1138
1005
  async ensurePaymentTables() {
1139
1006
  try {
1140
1007
  await this.dbManager.getAll("pay_method");
@@ -1156,6 +1023,7 @@ var PaymentModule = class extends import_BaseModule.BaseModule {
1156
1023
  /**
1157
1024
  * 获取部分支付的订单
1158
1025
  */
1026
+ /** @deprecated */
1159
1027
  async getPartiallyPaidOrdersAsync() {
1160
1028
  try {
1161
1029
  const allOrders = await this.dbManager.getAll("order");
@@ -135,6 +135,8 @@ 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;
138
140
  /** 本支付项是否已成功同步到后端 */
139
141
  isSynced?: boolean;
140
142
  /** 最近一次同步失败信息(存在则代表同步失败过) */
@@ -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
- return (list || []).map((item) => {
34
+ const formatted = (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,6 +40,7 @@ var formatWalletPassList2PreparePayments = (list) => {
40
40
  wallet_pass_use_value: item.wallet_pass_use_value || void 0
41
41
  };
42
42
  });
43
+ return formatted;
43
44
  };
44
45
  var sortUserIdentificationCodeList = (list) => {
45
46
  if (!Array.isArray(list) || list.length === 0) {
@@ -264,6 +264,9 @@ var WalletPassPaymentImpl = class {
264
264
  sale_channel: params.sale_channel,
265
265
  payment_order_id: (_a = this.walletParams) == null ? void 0 : _a.payment_order_id
266
266
  });
267
+ if (typeof params.payment_order_id === "string" && params.payment_order_id.startsWith("LOCAL_")) {
268
+ params.payment_order_id = void 0;
269
+ }
267
270
  const response = await this.paymentModule.request.post(
268
271
  "/machinecode/prepare/deduction/recommend",
269
272
  params
@@ -296,18 +299,25 @@ var WalletPassPaymentImpl = class {
296
299
  return (0, import_utils.formatWalletPassList2PreparePayments)(list);
297
300
  }
298
301
  async getUserIdentificationCodeListAsync(params) {
299
- var _a, _b;
302
+ var _a, _b, _c;
300
303
  try {
301
304
  const newParams = {
302
305
  ...this.walletParams,
303
306
  ...params
304
307
  };
308
+ if (!((_a = newParams.products) == null ? void 0 : _a.length)) {
309
+ this.paymentModule.logInfo("[WalletPass] 商品列表为空,跳过获取用户识别码列表");
310
+ return [];
311
+ }
312
+ if (typeof newParams.payment_order_id === "string" && newParams.payment_order_id.startsWith("LOCAL_")) {
313
+ newParams.payment_order_id = void 0;
314
+ }
305
315
  this.paymentModule.logInfo("[WalletPass] 开始获取用户识别码列表", {
306
316
  customer_id: newParams.customer_id,
307
317
  available: newParams.available,
308
- prepare_payments_count: ((_a = newParams.prepare_payments) == null ? void 0 : _a.length) || 0,
318
+ prepare_payments_count: ((_b = newParams.prepare_payments) == null ? void 0 : _b.length) || 0,
309
319
  filter_prepare_wallet_pass: newParams.filter_prepare_wallet_pass,
310
- payment_order_id: (_b = this.walletParams) == null ? void 0 : _b.payment_order_id
320
+ payment_order_id: (_c = this.walletParams) == null ? void 0 : _c.payment_order_id
311
321
  });
312
322
  const response = await this.paymentModule.request.post(
313
323
  "/machinecode/prepare/deduction",
@@ -404,6 +414,9 @@ var WalletPassPaymentImpl = class {
404
414
  multiple: searchParams.multiple,
405
415
  payment_order_id: baseWalletParams == null ? void 0 : baseWalletParams.payment_order_id
406
416
  });
417
+ if (typeof searchParams.payment_order_id === "string" && searchParams.payment_order_id.startsWith("LOCAL_")) {
418
+ searchParams.payment_order_id = void 0;
419
+ }
407
420
  let response;
408
421
  if (!searchParams.products || ((_a = searchParams.products || []) == null ? void 0 : _a.length) === 0) {
409
422
  response = {
@@ -1,5 +1,6 @@
1
1
  import { Module, PisellCore } from '../../types';
2
2
  import { BaseModule } from '../BaseModule';
3
+ import { ProductListLoadProductsParams } from './types';
3
4
  import { ProductData } from '../Product/types';
4
5
  export * from './types';
5
6
  export declare class ProductList extends BaseModule implements Module {
@@ -10,19 +11,22 @@ export declare class ProductList extends BaseModule implements Module {
10
11
  private otherParams;
11
12
  constructor(name?: string, version?: string);
12
13
  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;
13
21
  storeChange(path?: string, value?: any): Promise<void>;
14
- loadProducts({ category_ids, product_ids, collection, menu_list_ids, customer_id: paramsCustomerId, with_count, schedule_datetime, schedule_date, cacheId, with_schedule, }: {
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?: {
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?: {
26
30
  callback?: (result: any) => void;
27
31
  subscriberId?: string;
28
32
  }): Promise<any>;
@@ -1,6 +1,8 @@
1
+ var __create = Object.create;
1
2
  var __defProp = Object.defineProperty;
2
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
4
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
7
  var __export = (target, all) => {
6
8
  for (var name in all)
@@ -15,6 +17,14 @@ var __copyProps = (to, from, except, desc) => {
15
17
  return to;
16
18
  };
17
19
  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
+ ));
18
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
29
 
20
30
  // src/modules/ProductList/index.ts
@@ -25,6 +35,7 @@ __export(ProductList_exports, {
25
35
  module.exports = __toCommonJS(ProductList_exports);
26
36
  var import_BaseModule = require("../BaseModule");
27
37
  var import_lodash_es = require("lodash-es");
38
+ var import_dayjs = __toESM(require("dayjs"));
28
39
  __reExport(ProductList_exports, require("./types"), module.exports);
29
40
  var ProductList = class extends import_BaseModule.BaseModule {
30
41
  constructor(name, version) {
@@ -47,8 +58,31 @@ var ProductList = class extends import_BaseModule.BaseModule {
47
58
  }
48
59
  this.request = core.getPlugin("request");
49
60
  }
61
+ /**
62
+ * 更新运行态参数,供父级解决方案 setOtherParams 后同步查询上下文。
63
+ *
64
+ * @example
65
+ * productList.updateOtherParams({ channel: 'pos' });
66
+ */
67
+ updateOtherParams(params) {
68
+ this.otherParams = params || {};
69
+ }
50
70
  async storeChange(path, value) {
51
71
  }
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
+ }
52
86
  async loadProducts({
53
87
  category_ids = [],
54
88
  product_ids = [],
@@ -59,8 +93,10 @@ var ProductList = class extends import_BaseModule.BaseModule {
59
93
  schedule_datetime,
60
94
  schedule_date,
61
95
  cacheId,
62
- with_schedule
63
- }, options) {
96
+ with_schedule,
97
+ extension_type,
98
+ status = "published"
99
+ } = {}, options) {
64
100
  var _a, _b;
65
101
  let userPlugin = this.core.getPlugin("user");
66
102
  let customer_id = void 0;
@@ -83,7 +119,7 @@ var ProductList = class extends import_BaseModule.BaseModule {
83
119
  "event_item"
84
120
  ],
85
121
  with: ["category", "collection", "resourceRelation"],
86
- status: "published",
122
+ status,
87
123
  num: 500,
88
124
  skip: 1,
89
125
  customer_id,
@@ -98,7 +134,8 @@ var ProductList = class extends import_BaseModule.BaseModule {
98
134
  application_code: (_b = this.otherParams) == null ? void 0 : _b.channel,
99
135
  is_eject: 1,
100
136
  with_schedule,
101
- schedule_datetime
137
+ schedule_datetime,
138
+ extension_type
102
139
  },
103
140
  { osServer: true, callback: options == null ? void 0 : options.callback, subscriberId: options == null ? void 0 : options.subscriberId, customToast: () => {
104
141
  } }
@@ -1,4 +1,18 @@
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
+ }
2
16
  export interface ProductListData {
3
17
  list: ProductData[];
4
18
  selectProducts: ProductData[];
@@ -47,7 +47,6 @@ 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;
51
50
  private isQuotationVisibleForCustomer;
52
51
  private hasValidCustomerId;
53
52
  private isQuotationActiveAt;
@@ -43,20 +43,15 @@ 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);
48
46
  if ((params == null ? void 0 : params.channel) === "online_store") {
49
47
  query.channel = "online-store";
50
48
  }
51
49
  const res = await this.request.get(
52
50
  "/quotation/available",
53
51
  query,
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
52
+ { useCache: false, osServer: true }
59
53
  );
54
+ const list = ((_a = res == null ? void 0 : res.data) == null ? void 0 : _a.list) || (res == null ? void 0 : res.list) || [];
60
55
  list.sort((a, b) => a.sort - b.sort);
61
56
  this.store.list = list;
62
57
  }
@@ -74,9 +69,11 @@ var QuotationModule = class extends import_BaseModule.BaseModule {
74
69
  getPriceForProduct(params) {
75
70
  const { productId, variantId, datetime, customer_id } = params;
76
71
  for (const quotation of this.store.list) {
77
- if (!this.isQuotationVisibleForCustomer(quotation, customer_id))
72
+ const visible = this.isQuotationVisibleForCustomer(quotation, customer_id);
73
+ if (!visible)
78
74
  continue;
79
- if (!this.isQuotationActiveAt(quotation, datetime))
75
+ const active = this.isQuotationActiveAt(quotation, datetime);
76
+ if (!active)
80
77
  continue;
81
78
  const match = this.findProductData(quotation.product_data, productId, variantId);
82
79
  if (!match)
@@ -128,9 +125,6 @@ var QuotationModule = class extends import_BaseModule.BaseModule {
128
125
  setScheduleResolver(resolver) {
129
126
  this.scheduleResolver = resolver;
130
127
  }
131
- filterQuotationsByCustomer(list, customerId) {
132
- return list.filter((quotation) => this.isQuotationVisibleForCustomer(quotation, customerId));
133
- }
134
128
  isQuotationVisibleForCustomer(quotation, customerId) {
135
129
  const customers = quotation.customer || [];
136
130
  if (customers.length === 0)
@@ -148,18 +142,27 @@ var QuotationModule = class extends import_BaseModule.BaseModule {
148
142
  var _a;
149
143
  if (!((_a = quotation.schedule) == null ? void 0 : _a.length))
150
144
  return false;
151
- const scheduleItems = quotation.schedule.map((s) => {
145
+ const scheduleItems = [];
146
+ quotation.schedule.forEach((s) => {
152
147
  var _a2;
153
148
  const full = (_a2 = this.scheduleResolver) == null ? void 0 : _a2.call(this, s.id);
154
- if (full)
155
- return full;
156
- return {
149
+ if (full) {
150
+ scheduleItems.push(full);
151
+ return;
152
+ }
153
+ if (this.scheduleResolver) {
154
+ return;
155
+ }
156
+ const fallbackSchedule = {
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);
162
163
  });
164
+ if (!scheduleItems.length)
165
+ return false;
163
166
  return (0, import_getDateIsInSchedule.getDateIsInSchedule)(datetime, scheduleItems);
164
167
  }
165
168
  findProductData(productData, productId, variantId) {
@@ -32,6 +32,10 @@ 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[];
35
39
  private getUnavailableReason;
36
40
  calcDiscount({ discountList, productList, holders, isFormSubject, orderTotalAmount }: {
37
41
  discountList: Discount[];