@pisell/pisellos 2.2.244 → 2.2.246

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 (316) hide show
  1. package/dist/model/strategy/adapter/promotion/evaluator.js +3 -2
  2. package/dist/model/strategy/adapter/walletPass/utils.js +7 -4
  3. package/dist/modules/BookingContext/index.d.ts +48 -0
  4. package/dist/modules/BookingContext/index.js +566 -0
  5. package/dist/modules/BookingContext/types.d.ts +102 -0
  6. package/dist/modules/BookingContext/types.js +51 -0
  7. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts +16 -0
  8. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +284 -0
  9. package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +8 -0
  10. package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +148 -0
  11. package/dist/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +76 -0
  12. package/dist/modules/BookingContext/utils/cacheItemToBookingInput.js +218 -0
  13. package/dist/modules/BookingContext/utils/flexible.d.ts +28 -0
  14. package/dist/modules/BookingContext/utils/flexible.js +56 -0
  15. package/dist/modules/BookingContext/utils/formatResourceList.d.ts +8 -0
  16. package/dist/modules/BookingContext/utils/formatResourceList.js +38 -0
  17. package/dist/modules/BookingContext/utils/index.d.ts +11 -0
  18. package/dist/modules/BookingContext/utils/index.js +11 -0
  19. package/dist/modules/BookingContext/utils/noResource.d.ts +13 -0
  20. package/dist/modules/BookingContext/utils/noResource.js +77 -0
  21. package/dist/modules/BookingContext/utils/orderLineDisplay.d.ts +1 -0
  22. package/dist/modules/BookingContext/utils/orderLineDisplay.js +36 -0
  23. package/dist/modules/BookingContext/utils/productExtend.d.ts +72 -0
  24. package/dist/modules/BookingContext/utils/productExtend.js +339 -0
  25. package/dist/modules/BookingContext/utils/resourceErrors.d.ts +41 -0
  26. package/dist/modules/BookingContext/utils/resourceErrors.js +74 -0
  27. package/dist/modules/BookingContext/utils/resourceSelection.d.ts +7 -0
  28. package/dist/modules/BookingContext/utils/resourceSelection.js +24 -0
  29. package/dist/modules/BookingContext/utils/resources.d.ts +80 -0
  30. package/dist/modules/BookingContext/utils/resources.js +486 -0
  31. package/dist/modules/BookingContext/utils/serviceTimes.d.ts +55 -0
  32. package/dist/modules/BookingContext/utils/serviceTimes.js +151 -0
  33. package/dist/modules/BookingContext/utils/timeSlices.d.ts +42 -0
  34. package/dist/modules/BookingContext/utils/timeSlices.js +100 -0
  35. package/dist/modules/Cart/utils/cartProduct.js +24 -3
  36. package/dist/modules/Cart/utils/changePrice.js +11 -11
  37. package/dist/modules/Customer/index.d.ts +20 -0
  38. package/dist/modules/Customer/index.js +172 -83
  39. package/dist/modules/Customer/types.d.ts +2 -0
  40. package/dist/modules/Discount/index.d.ts +1 -1
  41. package/dist/modules/Discount/index.js +13 -6
  42. package/dist/modules/Discount/types.d.ts +1 -0
  43. package/dist/modules/OpenData/index.d.ts +8 -0
  44. package/dist/modules/OpenData/index.js +37 -17
  45. package/dist/modules/Order/index.d.ts +277 -18
  46. package/dist/modules/Order/index.js +3581 -779
  47. package/dist/modules/Order/types.d.ts +286 -31
  48. package/dist/modules/Order/types.js +38 -0
  49. package/dist/modules/Order/utils/manualProductDiscount.d.ts +106 -0
  50. package/dist/modules/Order/utils/manualProductDiscount.js +210 -0
  51. package/dist/modules/Order/utils.d.ts +147 -5
  52. package/dist/modules/Order/utils.js +750 -104
  53. package/dist/modules/Payment/index.d.ts +10 -13
  54. package/dist/modules/Payment/index.js +467 -837
  55. package/dist/modules/Payment/types.d.ts +2 -0
  56. package/dist/modules/Payment/utils.js +2 -1
  57. package/dist/modules/Payment/walletpass.js +41 -25
  58. package/dist/modules/ProductList/index.d.ts +16 -12
  59. package/dist/modules/ProductList/index.js +133 -59
  60. package/dist/modules/ProductList/types.d.ts +14 -0
  61. package/dist/modules/Quotation/index.d.ts +0 -1
  62. package/dist/modules/Quotation/index.js +25 -22
  63. package/dist/modules/Rules/index.d.ts +4 -0
  64. package/dist/modules/Rules/index.js +97 -70
  65. package/dist/modules/Rules/types.d.ts +1 -0
  66. package/dist/modules/SalesSummary/index.d.ts +8 -25
  67. package/dist/modules/SalesSummary/index.js +86 -35
  68. package/dist/modules/SalesSummary/types.d.ts +4 -1
  69. package/dist/modules/SalesSummary/utils.d.ts +2 -25
  70. package/dist/modules/SalesSummary/utils.js +794 -162
  71. package/dist/modules/Schedule/index.d.ts +7 -0
  72. package/dist/modules/Schedule/index.js +24 -2
  73. package/dist/modules/Summary/index.js +4 -3
  74. package/dist/modules/SurchargeList/index.d.ts +16 -0
  75. package/dist/modules/SurchargeList/index.js +162 -0
  76. package/dist/modules/SurchargeList/types.d.ts +11 -0
  77. package/dist/modules/SurchargeList/types.js +1 -0
  78. package/dist/modules/index.d.ts +2 -0
  79. package/dist/modules/index.js +3 -1
  80. package/dist/plugins/request.d.ts +1 -0
  81. package/dist/server/index.d.ts +204 -1
  82. package/dist/server/index.js +3654 -922
  83. package/dist/server/modules/index.d.ts +2 -0
  84. package/dist/server/modules/index.js +2 -0
  85. package/dist/server/modules/order/index.d.ts +120 -3
  86. package/dist/server/modules/order/index.js +1762 -448
  87. package/dist/server/modules/order/types.d.ts +32 -3
  88. package/dist/server/modules/order/types.js +8 -0
  89. package/dist/server/modules/order/utils/filterBookings.js +26 -3
  90. package/dist/server/modules/order/utils/filterOrders.js +23 -8
  91. package/dist/server/modules/payment/index.d.ts +28 -0
  92. package/dist/server/modules/payment/index.js +305 -0
  93. package/dist/server/modules/payment/types.d.ts +9 -0
  94. package/dist/server/modules/payment/types.js +1 -0
  95. package/dist/server/modules/products/index.d.ts +34 -7
  96. package/dist/server/modules/products/index.js +631 -317
  97. package/dist/server/modules/resource/index.d.ts +2 -0
  98. package/dist/server/modules/resource/index.js +29 -3
  99. package/dist/server/modules/schedule/index.d.ts +4 -4
  100. package/dist/server/modules/schedule/index.js +111 -88
  101. package/dist/server/test.json +713 -0
  102. package/dist/server/utils/small-ticket.d.ts +71 -0
  103. package/dist/server/utils/small-ticket.js +840 -0
  104. package/dist/solution/BaseSales/index.d.ts +133 -10
  105. package/dist/solution/BaseSales/index.js +1950 -447
  106. package/dist/solution/BaseSales/types.d.ts +82 -6
  107. package/dist/solution/BaseSales/types.js +5 -4
  108. package/dist/solution/BaseSales/utils/cartPromotion.d.ts +287 -0
  109. package/dist/solution/BaseSales/utils/cartPromotion.js +1438 -0
  110. package/dist/solution/BaseSales/utils/quotationPrice.d.ts +7 -0
  111. package/dist/solution/BaseSales/utils/quotationPrice.js +237 -0
  112. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +1 -0
  113. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +105 -24
  114. package/dist/solution/BaseSales/utils.d.ts +1 -1
  115. package/dist/solution/BaseSales/utils.js +62 -21
  116. package/dist/solution/BookingByStep/index.d.ts +1 -1
  117. package/dist/solution/BookingTicket/index.d.ts +271 -11
  118. package/dist/solution/BookingTicket/index.js +1777 -242
  119. package/dist/solution/BookingTicket/types.d.ts +118 -1
  120. package/dist/solution/BookingTicket/types.js +41 -2
  121. package/dist/solution/BookingTicket/utils/addProductDecision.d.ts +117 -0
  122. package/dist/solution/BookingTicket/utils/addProductDecision.js +346 -0
  123. package/dist/solution/BookingTicket/utils/addTimeAvailability.d.ts +35 -0
  124. package/dist/solution/BookingTicket/utils/addTimeAvailability.js +95 -0
  125. package/dist/solution/BookingTicket/utils/bookingStatus.d.ts +40 -0
  126. package/dist/solution/BookingTicket/utils/bookingStatus.js +70 -0
  127. package/dist/solution/BookingTicket/utils/cartView.d.ts +9 -1
  128. package/dist/solution/BookingTicket/utils/cartView.js +94 -7
  129. package/dist/solution/BookingTicket/utils/exampleData.d.ts +123 -0
  130. package/dist/solution/BookingTicket/utils/exampleData.js +183 -0
  131. package/dist/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +185 -0
  132. package/dist/solution/BookingTicket/utils/resolveBestAddTimePlan.js +438 -0
  133. package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +36 -0
  134. package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +400 -0
  135. package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +32 -0
  136. package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.js +56 -0
  137. package/dist/solution/BookingTicket/utils/scan/index.d.ts +5 -0
  138. package/dist/solution/BookingTicket/utils/scan/index.js +20 -8
  139. package/dist/solution/BookingTicket/utils/scan/scanProductValues.d.ts +21 -0
  140. package/dist/solution/BookingTicket/utils/scan/scanProductValues.js +150 -0
  141. package/dist/solution/BookingTicket/utils/sessionCatalogStale.d.ts +23 -0
  142. package/dist/solution/BookingTicket/utils/sessionCatalogStale.js +78 -0
  143. package/dist/solution/Checkout/index.d.ts +1 -0
  144. package/dist/solution/Checkout/index.js +10 -9
  145. package/dist/solution/RegisterAndLogin/config.js +2 -10
  146. package/dist/solution/ScanOrder/index.d.ts +9 -3
  147. package/dist/solution/ScanOrder/index.js +241 -134
  148. package/dist/solution/ScanOrder/types.d.ts +9 -5
  149. package/dist/solution/ScanOrder/types.js +2 -3
  150. package/dist/solution/ScanOrder/utils.d.ts +1 -1
  151. package/dist/solution/ScanOrder/utils.js +84 -22
  152. package/dist/solution/VenueBooking/index.d.ts +5 -2
  153. package/dist/solution/VenueBooking/index.js +110 -59
  154. package/dist/solution/VenueBooking/sales-section-4-annotated.json +0 -2
  155. package/dist/solution/VenueBooking/utils/slotMerge.d.ts +4 -0
  156. package/dist/solution/VenueBooking/utils/slotMerge.js +10 -0
  157. package/dist/types/index.d.ts +10 -0
  158. package/lib/model/strategy/adapter/promotion/evaluator.js +2 -1
  159. package/lib/model/strategy/adapter/promotion/index.js +49 -0
  160. package/lib/model/strategy/adapter/walletPass/utils.js +3 -2
  161. package/lib/modules/BookingContext/index.d.ts +48 -0
  162. package/lib/modules/BookingContext/index.js +368 -0
  163. package/lib/modules/BookingContext/types.d.ts +102 -0
  164. package/lib/modules/BookingContext/types.js +34 -0
  165. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts +16 -0
  166. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +276 -0
  167. package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +8 -0
  168. package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +154 -0
  169. package/lib/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +76 -0
  170. package/lib/modules/BookingContext/utils/cacheItemToBookingInput.js +201 -0
  171. package/lib/modules/BookingContext/utils/flexible.d.ts +28 -0
  172. package/lib/modules/BookingContext/utils/flexible.js +80 -0
  173. package/lib/modules/BookingContext/utils/formatResourceList.d.ts +8 -0
  174. package/lib/modules/BookingContext/utils/formatResourceList.js +50 -0
  175. package/lib/modules/BookingContext/utils/index.d.ts +11 -0
  176. package/lib/modules/BookingContext/utils/index.js +43 -0
  177. package/lib/modules/BookingContext/utils/noResource.d.ts +13 -0
  178. package/lib/modules/BookingContext/utils/noResource.js +90 -0
  179. package/lib/modules/BookingContext/utils/orderLineDisplay.d.ts +1 -0
  180. package/lib/modules/BookingContext/utils/orderLineDisplay.js +56 -0
  181. package/lib/modules/BookingContext/utils/productExtend.d.ts +72 -0
  182. package/lib/modules/BookingContext/utils/productExtend.js +283 -0
  183. package/lib/modules/BookingContext/utils/resourceErrors.d.ts +41 -0
  184. package/lib/modules/BookingContext/utils/resourceErrors.js +80 -0
  185. package/lib/modules/BookingContext/utils/resourceSelection.d.ts +7 -0
  186. package/lib/modules/BookingContext/utils/resourceSelection.js +46 -0
  187. package/lib/modules/BookingContext/utils/resources.d.ts +80 -0
  188. package/lib/modules/BookingContext/utils/resources.js +377 -0
  189. package/lib/modules/BookingContext/utils/serviceTimes.d.ts +55 -0
  190. package/lib/modules/BookingContext/utils/serviceTimes.js +162 -0
  191. package/lib/modules/BookingContext/utils/timeSlices.d.ts +42 -0
  192. package/lib/modules/BookingContext/utils/timeSlices.js +124 -0
  193. package/lib/modules/Cart/utils/cartProduct.js +20 -3
  194. package/lib/modules/Cart/utils/changePrice.js +12 -20
  195. package/lib/modules/Customer/index.d.ts +20 -0
  196. package/lib/modules/Customer/index.js +64 -11
  197. package/lib/modules/Customer/types.d.ts +2 -0
  198. package/lib/modules/Discount/index.d.ts +1 -1
  199. package/lib/modules/Discount/index.js +9 -1
  200. package/lib/modules/Discount/types.d.ts +1 -0
  201. package/lib/modules/OpenData/index.d.ts +8 -0
  202. package/lib/modules/OpenData/index.js +19 -5
  203. package/lib/modules/Order/index.d.ts +277 -18
  204. package/lib/modules/Order/index.js +2317 -337
  205. package/lib/modules/Order/types.d.ts +286 -31
  206. package/lib/modules/Order/types.js +1 -0
  207. package/lib/modules/Order/utils/manualProductDiscount.d.ts +106 -0
  208. package/lib/modules/Order/utils/manualProductDiscount.js +206 -0
  209. package/lib/modules/Order/utils.d.ts +147 -5
  210. package/lib/modules/Order/utils.js +615 -46
  211. package/lib/modules/Payment/index.d.ts +10 -13
  212. package/lib/modules/Payment/index.js +18 -150
  213. package/lib/modules/Payment/types.d.ts +2 -0
  214. package/lib/modules/Payment/utils.js +2 -1
  215. package/lib/modules/Payment/walletpass.js +16 -3
  216. package/lib/modules/ProductList/index.d.ts +16 -12
  217. package/lib/modules/ProductList/index.js +41 -4
  218. package/lib/modules/ProductList/types.d.ts +14 -0
  219. package/lib/modules/Quotation/index.d.ts +0 -1
  220. package/lib/modules/Quotation/index.js +19 -16
  221. package/lib/modules/Rules/index.d.ts +4 -0
  222. package/lib/modules/Rules/index.js +137 -120
  223. package/lib/modules/Rules/types.d.ts +1 -0
  224. package/lib/modules/SalesSummary/index.d.ts +8 -25
  225. package/lib/modules/SalesSummary/index.js +30 -4
  226. package/lib/modules/SalesSummary/types.d.ts +4 -1
  227. package/lib/modules/SalesSummary/utils.d.ts +2 -25
  228. package/lib/modules/SalesSummary/utils.js +645 -91
  229. package/lib/modules/Schedule/index.d.ts +7 -0
  230. package/lib/modules/Schedule/index.js +17 -1
  231. package/lib/modules/Summary/index.js +5 -4
  232. package/lib/modules/SurchargeList/index.d.ts +16 -0
  233. package/lib/modules/SurchargeList/index.js +89 -0
  234. package/lib/modules/SurchargeList/types.d.ts +11 -0
  235. package/lib/modules/SurchargeList/types.js +17 -0
  236. package/lib/modules/index.d.ts +2 -0
  237. package/lib/modules/index.js +5 -1
  238. package/lib/plugins/request.d.ts +1 -0
  239. package/lib/server/index.d.ts +204 -1
  240. package/lib/server/index.js +1891 -59
  241. package/lib/server/modules/index.d.ts +2 -0
  242. package/lib/server/modules/index.js +3 -0
  243. package/lib/server/modules/order/index.d.ts +120 -3
  244. package/lib/server/modules/order/index.js +887 -94
  245. package/lib/server/modules/order/types.d.ts +32 -3
  246. package/lib/server/modules/order/utils/filterBookings.js +24 -5
  247. package/lib/server/modules/order/utils/filterOrders.js +15 -6
  248. package/lib/server/modules/payment/index.d.ts +28 -0
  249. package/lib/server/modules/payment/index.js +192 -0
  250. package/lib/server/modules/payment/types.d.ts +9 -0
  251. package/lib/server/modules/payment/types.js +17 -0
  252. package/lib/server/modules/products/index.d.ts +34 -7
  253. package/lib/server/modules/products/index.js +189 -54
  254. package/lib/server/modules/resource/index.d.ts +2 -0
  255. package/lib/server/modules/resource/index.js +27 -3
  256. package/lib/server/modules/schedule/index.d.ts +4 -4
  257. package/lib/server/modules/schedule/index.js +47 -40
  258. package/lib/server/test.json +713 -0
  259. package/lib/server/utils/small-ticket.d.ts +71 -0
  260. package/lib/server/utils/small-ticket.js +800 -0
  261. package/lib/solution/BaseSales/index.d.ts +133 -10
  262. package/lib/solution/BaseSales/index.js +1111 -63
  263. package/lib/solution/BaseSales/types.d.ts +82 -6
  264. package/lib/solution/BaseSales/types.js +3 -1
  265. package/lib/solution/BaseSales/utils/cartPromotion.d.ts +287 -0
  266. package/lib/solution/BaseSales/utils/cartPromotion.js +992 -0
  267. package/lib/solution/BaseSales/utils/quotationPrice.d.ts +7 -0
  268. package/lib/solution/BaseSales/utils/quotationPrice.js +277 -0
  269. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +1 -0
  270. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +106 -18
  271. package/lib/solution/BaseSales/utils.d.ts +1 -1
  272. package/lib/solution/BaseSales/utils.js +54 -10
  273. package/lib/solution/BookingByStep/index.d.ts +1 -1
  274. package/lib/solution/BookingTicket/index.d.ts +271 -11
  275. package/lib/solution/BookingTicket/index.js +922 -29
  276. package/lib/solution/BookingTicket/types.d.ts +118 -1
  277. package/lib/solution/BookingTicket/types.js +11 -0
  278. package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +117 -0
  279. package/lib/solution/BookingTicket/utils/addProductDecision.js +318 -0
  280. package/lib/solution/BookingTicket/utils/addTimeAvailability.d.ts +35 -0
  281. package/lib/solution/BookingTicket/utils/addTimeAvailability.js +125 -0
  282. package/lib/solution/BookingTicket/utils/bookingStatus.d.ts +40 -0
  283. package/lib/solution/BookingTicket/utils/bookingStatus.js +44 -2
  284. package/lib/solution/BookingTicket/utils/cartView.d.ts +9 -1
  285. package/lib/solution/BookingTicket/utils/cartView.js +61 -6
  286. package/lib/solution/BookingTicket/utils/exampleData.d.ts +123 -0
  287. package/lib/solution/BookingTicket/utils/exampleData.js +0 -0
  288. package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +185 -0
  289. package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.js +254 -0
  290. package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +36 -0
  291. package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +169 -0
  292. package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +32 -0
  293. package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.js +51 -0
  294. package/lib/solution/BookingTicket/utils/scan/index.d.ts +5 -0
  295. package/lib/solution/BookingTicket/utils/scan/index.js +17 -3
  296. package/lib/solution/BookingTicket/utils/scan/scanProductValues.d.ts +21 -0
  297. package/lib/solution/BookingTicket/utils/scan/scanProductValues.js +127 -0
  298. package/lib/solution/BookingTicket/utils/sessionCatalogStale.d.ts +23 -0
  299. package/lib/solution/BookingTicket/utils/sessionCatalogStale.js +85 -0
  300. package/lib/solution/Checkout/index.d.ts +1 -0
  301. package/lib/solution/Checkout/index.js +1 -2
  302. package/lib/solution/RegisterAndLogin/config.js +2 -10
  303. package/lib/solution/ScanOrder/index.d.ts +9 -3
  304. package/lib/solution/ScanOrder/index.js +153 -70
  305. package/lib/solution/ScanOrder/types.d.ts +9 -5
  306. package/lib/solution/ScanOrder/utils.d.ts +1 -1
  307. package/lib/solution/ScanOrder/utils.js +83 -17
  308. package/lib/solution/VenueBooking/index.d.ts +5 -2
  309. package/lib/solution/VenueBooking/index.js +54 -17
  310. package/lib/solution/VenueBooking/sales-section-4-annotated.json +0 -2
  311. package/lib/solution/VenueBooking/utils/slotMerge.d.ts +4 -0
  312. package/lib/solution/VenueBooking/utils/slotMerge.js +10 -0
  313. package/lib/types/index.d.ts +10 -0
  314. package/package.json +1 -1
  315. package/dist/solution/Checkout/appointmentDemo.json +0 -1
  316. package/lib/solution/Checkout/appointmentDemo.json +0 -1
@@ -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
  /** 最近一次同步失败信息(存在则代表同步失败过) */
@@ -11,7 +11,7 @@ export var getAvailableMaxAmount = function getAvailableMaxAmount(data) {
11
11
  * @param list
12
12
  */
13
13
  export var formatWalletPassList2PreparePayments = function formatWalletPassList2PreparePayments(list) {
14
- return (list || []).map(function (item) {
14
+ var formatted = (list || []).map(function (item) {
15
15
  return {
16
16
  voucher_id: item.id || 0,
17
17
  amount: Number(item.edit_current_amount || getAvailableMaxAmount(item)) || 0,
@@ -20,6 +20,7 @@ export var formatWalletPassList2PreparePayments = function formatWalletPassList2
20
20
  wallet_pass_use_value: item.wallet_pass_use_value || undefined
21
21
  };
22
22
  });
23
+ return formatted;
23
24
  };
24
25
 
25
26
  /**
@@ -363,10 +363,13 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
363
363
  sale_channel: params.sale_channel,
364
364
  payment_order_id: (_this$walletParams = this.walletParams) === null || _this$walletParams === void 0 ? void 0 : _this$walletParams.payment_order_id
365
365
  });
366
- _context4.next = 4;
366
+ if (typeof params.payment_order_id === 'string' && params.payment_order_id.startsWith('LOCAL_')) {
367
+ params.payment_order_id = undefined;
368
+ }
369
+ _context4.next = 5;
367
370
  return this.paymentModule.request.post('/machinecode/prepare/deduction/recommend', params // 将 params 作为请求体数据
368
371
  );
369
- case 4:
372
+ case 5:
370
373
  response = _context4.sent;
371
374
  this.walletRecommendList = (response === null || response === void 0 ? void 0 : response.data) || [];
372
375
 
@@ -386,8 +389,8 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
386
389
  })
387
390
  });
388
391
  return _context4.abrupt("return", this.walletRecommendList);
389
- case 11:
390
- _context4.prev = 11;
392
+ case 12:
393
+ _context4.prev = 12;
391
394
  _context4.t0 = _context4["catch"](0);
392
395
  this.paymentModule.logError('[WalletPass] 获取钱包推荐列表失败', _context4.t0, {
393
396
  customer_id: params.customer_id,
@@ -396,11 +399,11 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
396
399
  });
397
400
  // throw error;
398
401
  return _context4.abrupt("return", []);
399
- case 15:
402
+ case 16:
400
403
  case "end":
401
404
  return _context4.stop();
402
405
  }
403
- }, _callee4, this, [[0, 11]]);
406
+ }, _callee4, this, [[0, 12]]);
404
407
  }));
405
408
  function getWalletPassRecommendListAsync(_x4) {
406
409
  return _getWalletPassRecommendListAsync.apply(this, arguments);
@@ -416,12 +419,22 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
416
419
  key: "getUserIdentificationCodeListAsync",
417
420
  value: function () {
418
421
  var _getUserIdentificationCodeListAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(params) {
419
- var _newParams$prepare_pa, _this$walletParams2, newParams, response, sortedData;
422
+ var _newParams$products, _newParams$prepare_pa, _this$walletParams2, newParams, response, sortedData;
420
423
  return _regeneratorRuntime().wrap(function _callee5$(_context5) {
421
424
  while (1) switch (_context5.prev = _context5.next) {
422
425
  case 0:
423
426
  _context5.prev = 0;
424
427
  newParams = _objectSpread(_objectSpread({}, this.walletParams), params);
428
+ if ((_newParams$products = newParams.products) !== null && _newParams$products !== void 0 && _newParams$products.length) {
429
+ _context5.next = 5;
430
+ break;
431
+ }
432
+ this.paymentModule.logInfo('[WalletPass] 商品列表为空,跳过获取用户识别码列表');
433
+ return _context5.abrupt("return", []);
434
+ case 5:
435
+ if (typeof newParams.payment_order_id === 'string' && newParams.payment_order_id.startsWith('LOCAL_')) {
436
+ newParams.payment_order_id = undefined;
437
+ }
425
438
  this.paymentModule.logInfo('[WalletPass] 开始获取用户识别码列表', {
426
439
  customer_id: newParams.customer_id,
427
440
  available: newParams.available,
@@ -429,9 +442,9 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
429
442
  filter_prepare_wallet_pass: newParams.filter_prepare_wallet_pass,
430
443
  payment_order_id: (_this$walletParams2 = this.walletParams) === null || _this$walletParams2 === void 0 ? void 0 : _this$walletParams2.payment_order_id
431
444
  });
432
- _context5.next = 5;
445
+ _context5.next = 9;
433
446
  return this.paymentModule.request.post('/machinecode/prepare/deduction', newParams);
434
- case 5:
447
+ case 9:
435
448
  response = _context5.sent;
436
449
  // 对获取到的数据进行排序,将错误码为 500100、500200、500300 的项目排到最后
437
450
  sortedData = sortUserIdentificationCodeList((response === null || response === void 0 ? void 0 : response.data) || []);
@@ -452,19 +465,19 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
452
465
  })
453
466
  });
454
467
  return _context5.abrupt("return", this.userIdentificationCodes);
455
- case 13:
456
- _context5.prev = 13;
468
+ case 17:
469
+ _context5.prev = 17;
457
470
  _context5.t0 = _context5["catch"](0);
458
471
  this.paymentModule.logError('[WalletPass] 获取用户识别码列表失败', _context5.t0, {
459
472
  customer_id: params.customer_id,
460
473
  available: params.available
461
474
  });
462
475
  return _context5.abrupt("return", []);
463
- case 17:
476
+ case 21:
464
477
  case "end":
465
478
  return _context5.stop();
466
479
  }
467
- }, _callee5, this, [[0, 13]]);
480
+ }, _callee5, this, [[0, 17]]);
468
481
  }));
469
482
  function getUserIdentificationCodeListAsync(_x5) {
470
483
  return _getUserIdentificationCodeListAsync.apply(this, arguments);
@@ -565,31 +578,34 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
565
578
  multiple: searchParams.multiple,
566
579
  payment_order_id: baseWalletParams === null || baseWalletParams === void 0 ? void 0 : baseWalletParams.payment_order_id
567
580
  });
581
+ if (typeof searchParams.payment_order_id === 'string' && searchParams.payment_order_id.startsWith('LOCAL_')) {
582
+ searchParams.payment_order_id = undefined;
583
+ }
568
584
  if (!(!searchParams.products || ((_ref = searchParams.products || []) === null || _ref === void 0 ? void 0 : _ref.length) === 0)) {
569
- _context6.next = 21;
585
+ _context6.next = 22;
570
586
  break;
571
587
  }
572
588
  response = {
573
589
  data: []
574
590
  };
575
- _context6.next = 24;
591
+ _context6.next = 25;
576
592
  break;
577
- case 21:
578
- _context6.next = 23;
593
+ case 22:
594
+ _context6.next = 24;
579
595
  return this.paymentModule.request.post('/machinecode/prepare/deduction/search', searchParams);
580
- case 23:
581
- response = _context6.sent;
582
596
  case 24:
597
+ response = _context6.sent;
598
+ case 25:
583
599
  searchResults = ((_response2 = response) === null || _response2 === void 0 ? void 0 : _response2.data) || [];
584
600
  if (!config.noCache) {
585
- _context6.next = 27;
601
+ _context6.next = 28;
586
602
  break;
587
603
  }
588
604
  return _context6.abrupt("return", {
589
605
  type: 'normalCode',
590
606
  data: searchResults
591
607
  });
592
- case 27:
608
+ case 28:
593
609
  // 将搜索结果存储到缓存数组中
594
610
  if (searchResults.length > 0) {
595
611
  // 避免重复存储相同的识别码
@@ -619,8 +635,8 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
619
635
  type: 'normalCode',
620
636
  data: searchResults
621
637
  });
622
- case 33:
623
- _context6.prev = 33;
638
+ case 34:
639
+ _context6.prev = 34;
624
640
  _context6.t0 = _context6["catch"](1);
625
641
  this.paymentModule.logError('[WalletPass] 搜索识别码信息失败', _context6.t0, {
626
642
  code: params.code,
@@ -628,11 +644,11 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
628
644
  order_expect_amount: params.order_expect_amount
629
645
  });
630
646
  throw _context6.t0;
631
- case 37:
647
+ case 38:
632
648
  case "end":
633
649
  return _context6.stop();
634
650
  }
635
- }, _callee6, this, [[1, 33]]);
651
+ }, _callee6, this, [[1, 34]]);
636
652
  }));
637
653
  function searchIdentificationCodeAsync(_x6) {
638
654
  return _searchIdentificationCodeAsync.apply(this, arguments);
@@ -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,4 +1,6 @@
1
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
2
4
  function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
3
5
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
4
6
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
@@ -17,6 +19,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
17
19
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
18
20
  import { BaseModule } from "../BaseModule";
19
21
  import { cloneDeep } from 'lodash-es';
22
+ import dayjs from 'dayjs';
20
23
  export * from "./types";
21
24
  export var ProductList = /*#__PURE__*/function (_BaseModule) {
22
25
  _inherits(ProductList, _BaseModule);
@@ -64,6 +67,17 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
64
67
  }
65
68
  return initialize;
66
69
  }()
70
+ /**
71
+ * 更新运行态参数,供父级解决方案 setOtherParams 后同步查询上下文。
72
+ *
73
+ * @example
74
+ * productList.updateOtherParams({ channel: 'pos' });
75
+ */
76
+ }, {
77
+ key: "updateOtherParams",
78
+ value: function updateOtherParams(params) {
79
+ this.otherParams = params || {};
80
+ }
67
81
  }, {
68
82
  key: "storeChange",
69
83
  value: function () {
@@ -81,16 +95,75 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
81
95
  }
82
96
  return storeChange;
83
97
  }()
98
+ /**
99
+ * 获取加时商品列表。
100
+ *
101
+ * @example
102
+ * const products = await productList.getAddTimeProducts({ schedule_date: '2026-06-16' });
103
+ */
104
+ }, {
105
+ key: "getAddTimeProducts",
106
+ value: (function () {
107
+ var _getAddTimeProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
108
+ var params,
109
+ _args3 = arguments;
110
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
111
+ while (1) switch (_context3.prev = _context3.next) {
112
+ case 0:
113
+ params = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {};
114
+ return _context3.abrupt("return", this.loadProducts(_objectSpread(_objectSpread({
115
+ schedule_date: dayjs().format('YYYY-MM-DD'),
116
+ status: 'published'
117
+ }, params), {}, {
118
+ extension_type: ['product_add_time']
119
+ })));
120
+ case 2:
121
+ case "end":
122
+ return _context3.stop();
123
+ }
124
+ }, _callee3, this);
125
+ }));
126
+ function getAddTimeProducts() {
127
+ return _getAddTimeProducts.apply(this, arguments);
128
+ }
129
+ return getAddTimeProducts;
130
+ }())
84
131
  }, {
85
132
  key: "loadProducts",
86
133
  value: function () {
87
- var _loadProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(_ref, options) {
134
+ var _loadProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
88
135
  var _this$otherParams;
89
- var _ref$category_ids, category_ids, _ref$product_ids, product_ids, _ref$collection, collection, _ref$menu_list_ids, menu_list_ids, paramsCustomerId, _ref$with_count, with_count, schedule_datetime, schedule_date, cacheId, with_schedule, userPlugin, customer_id, _userPlugin$get, productsData, sortedList;
90
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
91
- while (1) switch (_context3.prev = _context3.next) {
136
+ var _ref,
137
+ _ref$category_ids,
138
+ category_ids,
139
+ _ref$product_ids,
140
+ product_ids,
141
+ _ref$collection,
142
+ collection,
143
+ _ref$menu_list_ids,
144
+ menu_list_ids,
145
+ paramsCustomerId,
146
+ _ref$with_count,
147
+ with_count,
148
+ schedule_datetime,
149
+ schedule_date,
150
+ cacheId,
151
+ with_schedule,
152
+ extension_type,
153
+ _ref$status,
154
+ status,
155
+ options,
156
+ userPlugin,
157
+ customer_id,
158
+ _userPlugin$get,
159
+ productsData,
160
+ sortedList,
161
+ _args4 = arguments;
162
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
163
+ while (1) switch (_context4.prev = _context4.next) {
92
164
  case 0:
93
- _ref$category_ids = _ref.category_ids, category_ids = _ref$category_ids === void 0 ? [] : _ref$category_ids, _ref$product_ids = _ref.product_ids, product_ids = _ref$product_ids === void 0 ? [] : _ref$product_ids, _ref$collection = _ref.collection, collection = _ref$collection === void 0 ? [] : _ref$collection, _ref$menu_list_ids = _ref.menu_list_ids, menu_list_ids = _ref$menu_list_ids === void 0 ? [] : _ref$menu_list_ids, paramsCustomerId = _ref.customer_id, _ref$with_count = _ref.with_count, with_count = _ref$with_count === void 0 ? [] : _ref$with_count, schedule_datetime = _ref.schedule_datetime, schedule_date = _ref.schedule_date, cacheId = _ref.cacheId, with_schedule = _ref.with_schedule;
165
+ _ref = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {}, _ref$category_ids = _ref.category_ids, category_ids = _ref$category_ids === void 0 ? [] : _ref$category_ids, _ref$product_ids = _ref.product_ids, product_ids = _ref$product_ids === void 0 ? [] : _ref$product_ids, _ref$collection = _ref.collection, collection = _ref$collection === void 0 ? [] : _ref$collection, _ref$menu_list_ids = _ref.menu_list_ids, menu_list_ids = _ref$menu_list_ids === void 0 ? [] : _ref$menu_list_ids, paramsCustomerId = _ref.customer_id, _ref$with_count = _ref.with_count, with_count = _ref$with_count === void 0 ? [] : _ref$with_count, schedule_datetime = _ref.schedule_datetime, schedule_date = _ref.schedule_date, cacheId = _ref.cacheId, with_schedule = _ref.with_schedule, extension_type = _ref.extension_type, _ref$status = _ref.status, status = _ref$status === void 0 ? 'published' : _ref$status;
166
+ options = _args4.length > 1 ? _args4[1] : undefined;
94
167
  // // 如果 schedule_ids 为空,则需要尝试从 schedule 模块里获取
95
168
  // if (!schedule_ids?.length) {
96
169
  // const schedule_ids_data = this.store.schedule
@@ -111,13 +184,13 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
111
184
  console.error(error);
112
185
  }
113
186
  // 如果没传schedule_date,则从
114
- _context3.next = 6;
187
+ _context4.next = 7;
115
188
  return this.request.post("/product/query", {
116
189
  open_quotation: 1,
117
190
  open_bundle: 0,
118
191
  exclude_extension_type: ['product_party', 'product_event', 'product_series_event', 'product_package_ticket', 'ticket', 'event_item'],
119
192
  with: ['category', 'collection', 'resourceRelation'],
120
- status: 'published',
193
+ status: status,
121
194
  num: 500,
122
195
  skip: 1,
123
196
  customer_id: customer_id,
@@ -132,15 +205,16 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
132
205
  application_code: (_this$otherParams = this.otherParams) === null || _this$otherParams === void 0 ? void 0 : _this$otherParams.channel,
133
206
  is_eject: 1,
134
207
  with_schedule: with_schedule,
135
- schedule_datetime: schedule_datetime
208
+ schedule_datetime: schedule_datetime,
209
+ extension_type: extension_type
136
210
  }, {
137
211
  osServer: true,
138
212
  callback: options === null || options === void 0 ? void 0 : options.callback,
139
213
  subscriberId: options === null || options === void 0 ? void 0 : options.subscriberId,
140
214
  customToast: function customToast() {}
141
215
  });
142
- case 6:
143
- productsData = _context3.sent;
216
+ case 7:
217
+ productsData = _context4.sent;
144
218
  sortedList = (productsData.data.list || []).slice().sort(function (a, b) {
145
219
  return Number(b.sort) - Number(a.sort);
146
220
  }); // if (sortedList.length) {
@@ -151,14 +225,14 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
151
225
  // })
152
226
  // }
153
227
  this.addProduct(sortedList);
154
- return _context3.abrupt("return", sortedList);
155
- case 10:
228
+ return _context4.abrupt("return", sortedList);
229
+ case 11:
156
230
  case "end":
157
- return _context3.stop();
231
+ return _context4.stop();
158
232
  }
159
- }, _callee3, this);
233
+ }, _callee4, this);
160
234
  }));
161
- function loadProducts(_x5, _x6) {
235
+ function loadProducts() {
162
236
  return _loadProducts.apply(this, arguments);
163
237
  }
164
238
  return loadProducts;
@@ -166,13 +240,13 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
166
240
  }, {
167
241
  key: "loadProductsPrice",
168
242
  value: function () {
169
- var _loadProductsPrice = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(_ref2) {
243
+ var _loadProductsPrice = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(_ref2) {
170
244
  var _ref2$ids, ids, customer_id, schedule_date, channel, productsData;
171
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
172
- while (1) switch (_context4.prev = _context4.next) {
245
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
246
+ while (1) switch (_context5.prev = _context5.next) {
173
247
  case 0:
174
248
  _ref2$ids = _ref2.ids, ids = _ref2$ids === void 0 ? [] : _ref2$ids, customer_id = _ref2.customer_id, schedule_date = _ref2.schedule_date, channel = _ref2.channel;
175
- _context4.next = 3;
249
+ _context5.next = 3;
176
250
  return this.request.post("/product/query/price", {
177
251
  ids: ids,
178
252
  customer_id: customer_id,
@@ -182,15 +256,15 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
182
256
  useCache: true
183
257
  });
184
258
  case 3:
185
- productsData = _context4.sent;
186
- return _context4.abrupt("return", productsData.data);
259
+ productsData = _context5.sent;
260
+ return _context5.abrupt("return", productsData.data);
187
261
  case 5:
188
262
  case "end":
189
- return _context4.stop();
263
+ return _context5.stop();
190
264
  }
191
- }, _callee4, this);
265
+ }, _callee5, this);
192
266
  }));
193
- function loadProductsPrice(_x7) {
267
+ function loadProductsPrice(_x5) {
194
268
  return _loadProductsPrice.apply(this, arguments);
195
269
  }
196
270
  return loadProductsPrice;
@@ -198,19 +272,19 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
198
272
  }, {
199
273
  key: "getProducts",
200
274
  value: function () {
201
- var _getProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
202
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
203
- while (1) switch (_context5.prev = _context5.next) {
275
+ var _getProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
276
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
277
+ while (1) switch (_context6.prev = _context6.next) {
204
278
  case 0:
205
- _context5.next = 2;
279
+ _context6.next = 2;
206
280
  return this.core.effects.emit("".concat(this.name, ":onGetProducts"), this.store.list);
207
281
  case 2:
208
- return _context5.abrupt("return", cloneDeep(this.store.list));
282
+ return _context6.abrupt("return", cloneDeep(this.store.list));
209
283
  case 3:
210
284
  case "end":
211
- return _context5.stop();
285
+ return _context6.stop();
212
286
  }
213
- }, _callee5, this);
287
+ }, _callee6, this);
214
288
  }));
215
289
  function getProducts() {
216
290
  return _getProducts.apply(this, arguments);
@@ -220,25 +294,25 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
220
294
  }, {
221
295
  key: "getProduct",
222
296
  value: function () {
223
- var _getProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(id) {
297
+ var _getProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(id) {
224
298
  var product;
225
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
226
- while (1) switch (_context6.prev = _context6.next) {
299
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
300
+ while (1) switch (_context7.prev = _context7.next) {
227
301
  case 0:
228
- _context6.next = 2;
302
+ _context7.next = 2;
229
303
  return this.core.effects.emit("".concat(this.name, ":onGetProduct"), this.store.list);
230
304
  case 2:
231
305
  product = this.store.list.find(function (product) {
232
306
  return product.id === id;
233
307
  });
234
- return _context6.abrupt("return", product ? cloneDeep(product) : undefined);
308
+ return _context7.abrupt("return", product ? cloneDeep(product) : undefined);
235
309
  case 4:
236
310
  case "end":
237
- return _context6.stop();
311
+ return _context7.stop();
238
312
  }
239
- }, _callee6, this);
313
+ }, _callee7, this);
240
314
  }));
241
- function getProduct(_x8) {
315
+ function getProduct(_x6) {
242
316
  return _getProduct.apply(this, arguments);
243
317
  }
244
318
  return getProduct;
@@ -246,25 +320,25 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
246
320
  }, {
247
321
  key: "getProductByIds",
248
322
  value: function () {
249
- var _getProductByIds = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(ids) {
323
+ var _getProductByIds = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(ids) {
250
324
  var products;
251
- return _regeneratorRuntime().wrap(function _callee7$(_context7) {
252
- while (1) switch (_context7.prev = _context7.next) {
325
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
326
+ while (1) switch (_context8.prev = _context8.next) {
253
327
  case 0:
254
- _context7.next = 2;
328
+ _context8.next = 2;
255
329
  return this.core.effects.emit("".concat(this.name, ":onGetProductByIds"), this.store.list);
256
330
  case 2:
257
331
  products = this.store.list.filter(function (product) {
258
332
  return ids.includes(product.id);
259
333
  });
260
- return _context7.abrupt("return", products);
334
+ return _context8.abrupt("return", products);
261
335
  case 4:
262
336
  case "end":
263
- return _context7.stop();
337
+ return _context8.stop();
264
338
  }
265
- }, _callee7, this);
339
+ }, _callee8, this);
266
340
  }));
267
- function getProductByIds(_x9) {
341
+ function getProductByIds(_x7) {
268
342
  return _getProductByIds.apply(this, arguments);
269
343
  }
270
344
  return getProductByIds;
@@ -272,10 +346,10 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
272
346
  }, {
273
347
  key: "addProduct",
274
348
  value: function () {
275
- var _addProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(products) {
349
+ var _addProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(products) {
276
350
  var _this2 = this;
277
- return _regeneratorRuntime().wrap(function _callee8$(_context8) {
278
- while (1) switch (_context8.prev = _context8.next) {
351
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
352
+ while (1) switch (_context9.prev = _context9.next) {
279
353
  case 0:
280
354
  // list 需要根据 id 去重
281
355
  if (!this.store.list) {
@@ -298,11 +372,11 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
298
372
  this.core.effects.emit("".concat(this.name, ":changed"), this.store.list);
299
373
  case 4:
300
374
  case "end":
301
- return _context8.stop();
375
+ return _context9.stop();
302
376
  }
303
- }, _callee8, this);
377
+ }, _callee9, this);
304
378
  }));
305
- function addProduct(_x10) {
379
+ function addProduct(_x8) {
306
380
  return _addProduct.apply(this, arguments);
307
381
  }
308
382
  return addProduct;
@@ -310,18 +384,18 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
310
384
  }, {
311
385
  key: "selectProducts",
312
386
  value: function () {
313
- var _selectProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(products) {
314
- return _regeneratorRuntime().wrap(function _callee9$(_context9) {
315
- while (1) switch (_context9.prev = _context9.next) {
387
+ var _selectProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(products) {
388
+ return _regeneratorRuntime().wrap(function _callee10$(_context10) {
389
+ while (1) switch (_context10.prev = _context10.next) {
316
390
  case 0:
317
391
  this.store.selectProducts = products;
318
392
  case 1:
319
393
  case "end":
320
- return _context9.stop();
394
+ return _context10.stop();
321
395
  }
322
- }, _callee9, this);
396
+ }, _callee10, this);
323
397
  }));
324
- function selectProducts(_x11) {
398
+ function selectProducts(_x9) {
325
399
  return _selectProducts.apply(this, arguments);
326
400
  }
327
401
  return selectProducts;
@@ -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;