@pisell/pisellos 0.0.568 → 0.0.569

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 (413) 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/BaseModule.d.ts +2 -2
  4. package/dist/modules/BaseModule.js +4 -4
  5. package/dist/modules/BookingContext/index.d.ts +48 -0
  6. package/dist/modules/BookingContext/index.js +566 -0
  7. package/dist/modules/BookingContext/types.d.ts +102 -0
  8. package/dist/modules/BookingContext/types.js +51 -0
  9. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts +16 -0
  10. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +302 -0
  11. package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +8 -0
  12. package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +149 -0
  13. package/dist/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +76 -0
  14. package/dist/modules/BookingContext/utils/cacheItemToBookingInput.js +249 -0
  15. package/dist/modules/BookingContext/utils/flexible.d.ts +28 -0
  16. package/dist/modules/BookingContext/utils/flexible.js +56 -0
  17. package/dist/modules/BookingContext/utils/formatResourceList.d.ts +8 -0
  18. package/dist/modules/BookingContext/utils/formatResourceList.js +38 -0
  19. package/dist/modules/BookingContext/utils/index.d.ts +11 -0
  20. package/dist/modules/BookingContext/utils/index.js +11 -0
  21. package/dist/modules/BookingContext/utils/noResource.d.ts +13 -0
  22. package/dist/modules/BookingContext/utils/noResource.js +77 -0
  23. package/dist/modules/BookingContext/utils/orderLineDisplay.d.ts +1 -0
  24. package/dist/modules/BookingContext/utils/orderLineDisplay.js +36 -0
  25. package/dist/modules/BookingContext/utils/productExtend.d.ts +72 -0
  26. package/dist/modules/BookingContext/utils/productExtend.js +339 -0
  27. package/dist/modules/BookingContext/utils/resourceErrors.d.ts +41 -0
  28. package/dist/modules/BookingContext/utils/resourceErrors.js +74 -0
  29. package/dist/modules/BookingContext/utils/resourceSelection.d.ts +7 -0
  30. package/dist/modules/BookingContext/utils/resourceSelection.js +24 -0
  31. package/dist/modules/BookingContext/utils/resources.d.ts +80 -0
  32. package/dist/modules/BookingContext/utils/resources.js +486 -0
  33. package/dist/modules/BookingContext/utils/serviceTimes.d.ts +55 -0
  34. package/dist/modules/BookingContext/utils/serviceTimes.js +151 -0
  35. package/dist/modules/BookingContext/utils/timeSlices.d.ts +42 -0
  36. package/dist/modules/BookingContext/utils/timeSlices.js +100 -0
  37. package/dist/modules/Cart/utils/cartProduct.js +26 -5
  38. package/dist/modules/Cart/utils/changePrice.js +27 -20
  39. package/dist/modules/Customer/index.d.ts +20 -0
  40. package/dist/modules/Customer/index.js +172 -83
  41. package/dist/modules/Customer/types.d.ts +2 -0
  42. package/dist/modules/Discount/index.d.ts +2 -1
  43. package/dist/modules/Discount/index.js +37 -9
  44. package/dist/modules/Discount/types.d.ts +1 -0
  45. package/dist/modules/OpenData/index.d.ts +8 -0
  46. package/dist/modules/OpenData/index.js +36 -16
  47. package/dist/modules/Order/index.d.ts +448 -23
  48. package/dist/modules/Order/index.js +5417 -561
  49. package/dist/modules/Order/types.d.ts +693 -88
  50. package/dist/modules/Order/types.js +68 -1
  51. package/dist/modules/Order/utils/bundleDiscountHydration.d.ts +5 -0
  52. package/dist/modules/Order/utils/bundleDiscountHydration.js +144 -0
  53. package/dist/modules/Order/utils/manualProductDiscount.d.ts +106 -0
  54. package/dist/modules/Order/utils/manualProductDiscount.js +210 -0
  55. package/dist/modules/Order/utils/orderCollectionIdentity.d.ts +53 -0
  56. package/dist/modules/Order/utils/orderCollectionIdentity.js +405 -0
  57. package/dist/modules/Order/utils.d.ts +167 -18
  58. package/dist/modules/Order/utils.js +960 -165
  59. package/dist/modules/Payment/index.d.ts +10 -9
  60. package/dist/modules/Payment/index.js +465 -703
  61. package/dist/modules/Payment/types.d.ts +40 -16
  62. package/dist/modules/Payment/utils.d.ts +1 -1
  63. package/dist/modules/Payment/utils.js +4 -3
  64. package/dist/modules/Payment/walletpass.js +44 -29
  65. package/dist/modules/Product/types.d.ts +29 -7
  66. package/dist/modules/ProductList/index.d.ts +17 -13
  67. package/dist/modules/ProductList/index.js +184 -74
  68. package/dist/modules/ProductList/types.d.ts +17 -0
  69. package/dist/modules/Quotation/index.d.ts +22 -2
  70. package/dist/modules/Quotation/index.js +108 -42
  71. package/dist/modules/Quotation/types.d.ts +19 -0
  72. package/dist/modules/ResourcePlanner/index.d.ts +24 -0
  73. package/dist/modules/ResourcePlanner/index.js +181 -0
  74. package/dist/modules/ResourcePlanner/planner.d.ts +14 -0
  75. package/dist/modules/ResourcePlanner/planner.js +1069 -0
  76. package/dist/modules/ResourcePlanner/types.d.ts +227 -0
  77. package/dist/modules/ResourcePlanner/types.js +1 -0
  78. package/dist/modules/Rules/index.d.ts +8 -10
  79. package/dist/modules/Rules/index.js +221 -109
  80. package/dist/modules/Rules/types.d.ts +14 -3
  81. package/dist/modules/SalesSummary/index.d.ts +23 -26
  82. package/dist/modules/SalesSummary/index.js +152 -46
  83. package/dist/modules/SalesSummary/types.d.ts +9 -1
  84. package/dist/modules/SalesSummary/utils.d.ts +3 -22
  85. package/dist/modules/SalesSummary/utils.js +803 -163
  86. package/dist/modules/Schedule/getDateIsInSchedule.js +14 -7
  87. package/dist/modules/Schedule/index.d.ts +18 -5
  88. package/dist/modules/Schedule/index.js +78 -24
  89. package/dist/modules/Schedule/types.d.ts +2 -0
  90. package/dist/modules/Summary/index.js +4 -3
  91. package/dist/modules/SurchargeList/index.d.ts +18 -0
  92. package/dist/modules/SurchargeList/index.js +185 -0
  93. package/dist/modules/SurchargeList/types.d.ts +15 -0
  94. package/dist/modules/SurchargeList/types.js +1 -0
  95. package/dist/modules/index.d.ts +3 -0
  96. package/dist/modules/index.js +4 -1
  97. package/dist/plugins/app.d.ts +2 -0
  98. package/dist/plugins/request.d.ts +1 -0
  99. package/dist/server/index.d.ts +462 -8
  100. package/dist/server/index.js +6112 -656
  101. package/dist/server/modules/floor-plan/index.d.ts +39 -0
  102. package/dist/server/modules/floor-plan/index.js +595 -0
  103. package/dist/server/modules/floor-plan/types.d.ts +43 -0
  104. package/dist/server/modules/floor-plan/types.js +13 -0
  105. package/dist/server/modules/index.d.ts +7 -2
  106. package/dist/server/modules/index.js +6 -0
  107. package/dist/server/modules/order/index.d.ts +207 -14
  108. package/dist/server/modules/order/index.js +2326 -379
  109. package/dist/server/modules/order/types.d.ts +76 -5
  110. package/dist/server/modules/order/types.js +14 -1
  111. package/dist/server/modules/order/utils/filterBookings.d.ts +7 -1
  112. package/dist/server/modules/order/utils/filterBookings.js +118 -11
  113. package/dist/server/modules/order/utils/filterOrders.js +242 -14
  114. package/dist/server/modules/payment/index.d.ts +28 -0
  115. package/dist/server/modules/payment/index.js +305 -0
  116. package/dist/server/modules/payment/types.d.ts +9 -0
  117. package/dist/server/modules/payment/types.js +1 -0
  118. package/dist/server/modules/products/index.d.ts +105 -14
  119. package/dist/server/modules/products/index.js +1393 -516
  120. package/dist/server/modules/products/types.d.ts +34 -1
  121. package/dist/server/modules/products/types.js +4 -0
  122. package/dist/server/modules/quotation/index.d.ts +39 -0
  123. package/dist/server/modules/quotation/index.js +278 -66
  124. package/dist/server/modules/resource/index.d.ts +2 -3
  125. package/dist/server/modules/resource/index.js +108 -86
  126. package/dist/server/modules/schedule/index.d.ts +6 -4
  127. package/dist/server/modules/schedule/index.js +116 -85
  128. package/dist/server/test.json +713 -0
  129. package/dist/server/types.d.ts +2 -0
  130. package/dist/server/utils/product.js +2 -2
  131. package/dist/server/utils/small-ticket.d.ts +71 -0
  132. package/dist/server/utils/small-ticket.js +963 -0
  133. package/dist/solution/BaseSales/index.d.ts +378 -0
  134. package/dist/solution/BaseSales/index.js +4006 -0
  135. package/dist/solution/BaseSales/types.d.ts +394 -0
  136. package/dist/solution/BaseSales/types.js +40 -0
  137. package/dist/solution/BaseSales/utils/cartPromotion.d.ts +287 -0
  138. package/dist/solution/BaseSales/utils/cartPromotion.js +1450 -0
  139. package/dist/solution/BaseSales/utils/parseSalesResponse.d.ts +144 -0
  140. package/dist/solution/BaseSales/utils/parseSalesResponse.js +157 -0
  141. package/dist/solution/BaseSales/utils/quotationPrice.d.ts +18 -0
  142. package/dist/solution/BaseSales/utils/quotationPrice.js +250 -0
  143. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +63 -0
  144. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +218 -0
  145. package/dist/solution/BaseSales/utils.d.ts +40 -0
  146. package/dist/solution/BaseSales/utils.js +263 -0
  147. package/dist/solution/BookingByStep/index.d.ts +1 -1
  148. package/dist/solution/BookingTicket/index.d.ts +394 -25
  149. package/dist/solution/BookingTicket/index.js +2506 -443
  150. package/dist/solution/BookingTicket/types.d.ts +191 -6
  151. package/dist/solution/BookingTicket/types.js +83 -10
  152. package/dist/solution/BookingTicket/utils/addProductDecision.d.ts +117 -0
  153. package/dist/solution/BookingTicket/utils/addProductDecision.js +346 -0
  154. package/dist/solution/BookingTicket/utils/addTimeAvailability.d.ts +35 -0
  155. package/dist/solution/BookingTicket/utils/addTimeAvailability.js +95 -0
  156. package/dist/solution/BookingTicket/utils/bookingStatus.d.ts +77 -0
  157. package/dist/solution/BookingTicket/utils/bookingStatus.js +136 -0
  158. package/dist/solution/BookingTicket/utils/cartView.d.ts +29 -0
  159. package/dist/solution/BookingTicket/utils/cartView.js +209 -0
  160. package/dist/solution/BookingTicket/utils/exampleData.d.ts +123 -0
  161. package/dist/solution/BookingTicket/utils/exampleData.js +183 -0
  162. package/dist/solution/BookingTicket/utils/orderCustomer.d.ts +4 -0
  163. package/dist/solution/BookingTicket/utils/orderCustomer.js +31 -0
  164. package/dist/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +185 -0
  165. package/dist/solution/BookingTicket/utils/resolveBestAddTimePlan.js +438 -0
  166. package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +36 -0
  167. package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +400 -0
  168. package/dist/solution/BookingTicket/utils/scan/cloudSearch.d.ts +4 -0
  169. package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +41 -1
  170. package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +32 -0
  171. package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.js +56 -0
  172. package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +3 -1
  173. package/dist/solution/BookingTicket/utils/scan/handleScan.js +11 -3
  174. package/dist/solution/BookingTicket/utils/scan/index.d.ts +5 -0
  175. package/dist/solution/BookingTicket/utils/scan/index.js +20 -8
  176. package/dist/solution/BookingTicket/utils/scan/scanProductValues.d.ts +21 -0
  177. package/dist/solution/BookingTicket/utils/scan/scanProductValues.js +150 -0
  178. package/dist/solution/BookingTicket/utils/sessionCatalogStale.d.ts +23 -0
  179. package/dist/solution/BookingTicket/utils/sessionCatalogStale.js +78 -0
  180. package/dist/solution/Checkout/index.d.ts +1 -0
  181. package/dist/solution/Checkout/index.js +25 -34
  182. package/dist/solution/Checkout/utils/index.js +4 -4
  183. package/dist/solution/RegisterAndLogin/config.js +2 -10
  184. package/dist/solution/Sales/index.d.ts +50 -5
  185. package/dist/solution/Sales/index.js +484 -92
  186. package/dist/solution/Sales/types.d.ts +26 -2
  187. package/dist/solution/ScanOrder/index.d.ts +27 -21
  188. package/dist/solution/ScanOrder/index.js +499 -434
  189. package/dist/solution/ScanOrder/types.d.ts +33 -11
  190. package/dist/solution/ScanOrder/types.js +4 -5
  191. package/dist/solution/ScanOrder/utils.d.ts +4 -1
  192. package/dist/solution/ScanOrder/utils.js +109 -34
  193. package/dist/solution/ShopDiscount/index.js +4 -4
  194. package/dist/solution/UnifiedBookingSales/index.d.ts +183 -0
  195. package/dist/solution/UnifiedBookingSales/index.js +1871 -0
  196. package/dist/solution/UnifiedBookingSales/types.d.ts +143 -0
  197. package/dist/solution/UnifiedBookingSales/types.js +11 -0
  198. package/dist/solution/VenueBooking/index.d.ts +29 -20
  199. package/dist/solution/VenueBooking/index.js +301 -213
  200. package/dist/solution/VenueBooking/sales-section-4-annotated.json +0 -2
  201. package/dist/solution/VenueBooking/utils/slotMerge.d.ts +6 -0
  202. package/dist/solution/VenueBooking/utils/slotMerge.js +9 -3
  203. package/dist/solution/index.d.ts +2 -0
  204. package/dist/solution/index.js +3 -1
  205. package/dist/types/index.d.ts +11 -1
  206. package/lib/model/strategy/adapter/promotion/evaluator.js +3 -2
  207. package/lib/model/strategy/adapter/walletPass/utils.js +6 -4
  208. package/lib/modules/BaseModule.d.ts +2 -2
  209. package/lib/modules/BaseModule.js +4 -4
  210. package/lib/modules/BookingContext/index.d.ts +48 -0
  211. package/lib/modules/BookingContext/index.js +390 -0
  212. package/lib/modules/BookingContext/types.d.ts +102 -0
  213. package/lib/modules/BookingContext/types.js +48 -0
  214. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts +16 -0
  215. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +286 -0
  216. package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +8 -0
  217. package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +148 -0
  218. package/lib/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +76 -0
  219. package/lib/modules/BookingContext/utils/cacheItemToBookingInput.js +242 -0
  220. package/lib/modules/BookingContext/utils/flexible.d.ts +28 -0
  221. package/lib/modules/BookingContext/utils/flexible.js +63 -0
  222. package/lib/modules/BookingContext/utils/formatResourceList.d.ts +8 -0
  223. package/lib/modules/BookingContext/utils/formatResourceList.js +35 -0
  224. package/lib/modules/BookingContext/utils/index.d.ts +11 -0
  225. package/lib/modules/BookingContext/utils/index.js +126 -0
  226. package/lib/modules/BookingContext/utils/noResource.d.ts +13 -0
  227. package/lib/modules/BookingContext/utils/noResource.js +78 -0
  228. package/lib/modules/BookingContext/utils/orderLineDisplay.d.ts +1 -0
  229. package/lib/modules/BookingContext/utils/orderLineDisplay.js +29 -0
  230. package/lib/modules/BookingContext/utils/productExtend.d.ts +72 -0
  231. package/lib/modules/BookingContext/utils/productExtend.js +330 -0
  232. package/lib/modules/BookingContext/utils/resourceErrors.d.ts +41 -0
  233. package/lib/modules/BookingContext/utils/resourceErrors.js +80 -0
  234. package/lib/modules/BookingContext/utils/resourceSelection.d.ts +7 -0
  235. package/lib/modules/BookingContext/utils/resourceSelection.js +24 -0
  236. package/lib/modules/BookingContext/utils/resources.d.ts +80 -0
  237. package/lib/modules/BookingContext/utils/resources.js +419 -0
  238. package/lib/modules/BookingContext/utils/serviceTimes.d.ts +55 -0
  239. package/lib/modules/BookingContext/utils/serviceTimes.js +161 -0
  240. package/lib/modules/BookingContext/utils/timeSlices.d.ts +42 -0
  241. package/lib/modules/BookingContext/utils/timeSlices.js +114 -0
  242. package/lib/modules/Cart/utils/cartProduct.js +27 -5
  243. package/lib/modules/Cart/utils/changePrice.js +20 -14
  244. package/lib/modules/Customer/index.d.ts +20 -0
  245. package/lib/modules/Customer/index.js +63 -10
  246. package/lib/modules/Customer/types.d.ts +2 -0
  247. package/lib/modules/Discount/index.d.ts +2 -1
  248. package/lib/modules/Discount/index.js +18 -2
  249. package/lib/modules/Discount/types.d.ts +1 -0
  250. package/lib/modules/OpenData/index.d.ts +8 -0
  251. package/lib/modules/OpenData/index.js +21 -3
  252. package/lib/modules/Order/index.d.ts +448 -23
  253. package/lib/modules/Order/index.js +3641 -308
  254. package/lib/modules/Order/types.d.ts +693 -88
  255. package/lib/modules/Order/types.js +55 -1
  256. package/lib/modules/Order/utils/bundleDiscountHydration.d.ts +5 -0
  257. package/lib/modules/Order/utils/bundleDiscountHydration.js +106 -0
  258. package/lib/modules/Order/utils/manualProductDiscount.d.ts +106 -0
  259. package/lib/modules/Order/utils/manualProductDiscount.js +207 -0
  260. package/lib/modules/Order/utils/orderCollectionIdentity.d.ts +53 -0
  261. package/lib/modules/Order/utils/orderCollectionIdentity.js +353 -0
  262. package/lib/modules/Order/utils.d.ts +167 -18
  263. package/lib/modules/Order/utils.js +974 -138
  264. package/lib/modules/Payment/index.d.ts +10 -9
  265. package/lib/modules/Payment/index.js +30 -124
  266. package/lib/modules/Payment/types.d.ts +40 -16
  267. package/lib/modules/Payment/utils.d.ts +1 -1
  268. package/lib/modules/Payment/utils.js +4 -3
  269. package/lib/modules/Payment/walletpass.js +16 -6
  270. package/lib/modules/Product/types.d.ts +29 -7
  271. package/lib/modules/ProductList/index.d.ts +17 -13
  272. package/lib/modules/ProductList/index.js +92 -51
  273. package/lib/modules/ProductList/types.d.ts +17 -0
  274. package/lib/modules/Quotation/index.d.ts +22 -2
  275. package/lib/modules/Quotation/index.js +76 -20
  276. package/lib/modules/Quotation/types.d.ts +19 -0
  277. package/lib/modules/ResourcePlanner/index.d.ts +24 -0
  278. package/lib/modules/ResourcePlanner/index.js +147 -0
  279. package/lib/modules/ResourcePlanner/planner.d.ts +14 -0
  280. package/lib/modules/ResourcePlanner/planner.js +895 -0
  281. package/lib/modules/ResourcePlanner/types.d.ts +227 -0
  282. package/lib/modules/ResourcePlanner/types.js +5 -0
  283. package/lib/modules/Rules/index.d.ts +8 -10
  284. package/lib/modules/Rules/index.js +152 -60
  285. package/lib/modules/Rules/types.d.ts +14 -3
  286. package/lib/modules/SalesSummary/index.d.ts +23 -26
  287. package/lib/modules/SalesSummary/index.js +84 -16
  288. package/lib/modules/SalesSummary/types.d.ts +9 -1
  289. package/lib/modules/SalesSummary/utils.d.ts +3 -22
  290. package/lib/modules/SalesSummary/utils.js +616 -111
  291. package/lib/modules/Schedule/getDateIsInSchedule.js +14 -7
  292. package/lib/modules/Schedule/index.d.ts +18 -5
  293. package/lib/modules/Schedule/index.js +49 -14
  294. package/lib/modules/Schedule/types.d.ts +2 -0
  295. package/lib/modules/Summary/index.js +2 -2
  296. package/lib/modules/SurchargeList/index.d.ts +18 -0
  297. package/lib/modules/SurchargeList/index.js +95 -0
  298. package/lib/modules/SurchargeList/types.d.ts +15 -0
  299. package/lib/modules/SurchargeList/types.js +5 -0
  300. package/lib/modules/index.d.ts +3 -0
  301. package/lib/modules/index.js +33 -0
  302. package/lib/plugins/app.d.ts +2 -0
  303. package/lib/plugins/request.d.ts +1 -0
  304. package/lib/server/index.d.ts +462 -8
  305. package/lib/server/index.js +3901 -205
  306. package/lib/server/modules/floor-plan/index.d.ts +39 -0
  307. package/lib/server/modules/floor-plan/index.js +306 -0
  308. package/lib/server/modules/floor-plan/types.d.ts +43 -0
  309. package/lib/server/modules/floor-plan/types.js +19 -0
  310. package/lib/server/modules/index.d.ts +7 -2
  311. package/lib/server/modules/index.js +21 -0
  312. package/lib/server/modules/order/index.d.ts +207 -14
  313. package/lib/server/modules/order/index.js +1324 -141
  314. package/lib/server/modules/order/types.d.ts +76 -5
  315. package/lib/server/modules/order/types.js +11 -1
  316. package/lib/server/modules/order/utils/filterBookings.d.ts +7 -1
  317. package/lib/server/modules/order/utils/filterBookings.js +119 -11
  318. package/lib/server/modules/order/utils/filterOrders.js +238 -13
  319. package/lib/server/modules/payment/index.d.ts +28 -0
  320. package/lib/server/modules/payment/index.js +168 -0
  321. package/lib/server/modules/payment/types.d.ts +9 -0
  322. package/lib/server/modules/payment/types.js +5 -0
  323. package/lib/server/modules/products/index.d.ts +105 -14
  324. package/lib/server/modules/products/index.js +588 -97
  325. package/lib/server/modules/products/types.d.ts +34 -1
  326. package/lib/server/modules/products/types.js +3 -0
  327. package/lib/server/modules/quotation/index.d.ts +39 -0
  328. package/lib/server/modules/quotation/index.js +145 -1
  329. package/lib/server/modules/resource/index.d.ts +2 -3
  330. package/lib/server/modules/resource/index.js +71 -45
  331. package/lib/server/modules/schedule/index.d.ts +6 -4
  332. package/lib/server/modules/schedule/index.js +55 -44
  333. package/lib/server/test.json +713 -0
  334. package/lib/server/types.d.ts +2 -0
  335. package/lib/server/utils/product.js +2 -2
  336. package/lib/server/utils/small-ticket.d.ts +71 -0
  337. package/lib/server/utils/small-ticket.js +926 -0
  338. package/lib/solution/BaseSales/index.d.ts +378 -0
  339. package/lib/solution/BaseSales/index.js +2367 -0
  340. package/lib/solution/BaseSales/types.d.ts +394 -0
  341. package/lib/solution/BaseSales/types.js +47 -0
  342. package/lib/solution/BaseSales/utils/cartPromotion.d.ts +287 -0
  343. package/lib/solution/BaseSales/utils/cartPromotion.js +1155 -0
  344. package/lib/solution/BaseSales/utils/parseSalesResponse.d.ts +144 -0
  345. package/lib/solution/BaseSales/utils/parseSalesResponse.js +140 -0
  346. package/lib/solution/BaseSales/utils/quotationPrice.d.ts +18 -0
  347. package/lib/solution/BaseSales/utils/quotationPrice.js +231 -0
  348. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +63 -0
  349. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +215 -0
  350. package/lib/solution/BaseSales/utils.d.ts +40 -0
  351. package/lib/solution/BaseSales/utils.js +259 -0
  352. package/lib/solution/BookingByStep/index.d.ts +1 -1
  353. package/lib/solution/BookingTicket/index.d.ts +394 -25
  354. package/lib/solution/BookingTicket/index.js +1350 -76
  355. package/lib/solution/BookingTicket/types.d.ts +191 -6
  356. package/lib/solution/BookingTicket/types.js +71 -10
  357. package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +117 -0
  358. package/lib/solution/BookingTicket/utils/addProductDecision.js +353 -0
  359. package/lib/solution/BookingTicket/utils/addTimeAvailability.d.ts +35 -0
  360. package/lib/solution/BookingTicket/utils/addTimeAvailability.js +94 -0
  361. package/lib/solution/BookingTicket/utils/bookingStatus.d.ts +77 -0
  362. package/lib/solution/BookingTicket/utils/bookingStatus.js +136 -0
  363. package/lib/solution/BookingTicket/utils/cartView.d.ts +29 -0
  364. package/lib/solution/BookingTicket/utils/cartView.js +200 -0
  365. package/lib/solution/BookingTicket/utils/exampleData.d.ts +123 -0
  366. package/lib/solution/BookingTicket/utils/exampleData.js +185 -0
  367. package/lib/solution/BookingTicket/utils/orderCustomer.d.ts +4 -0
  368. package/lib/solution/BookingTicket/utils/orderCustomer.js +35 -0
  369. package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +185 -0
  370. package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.js +387 -0
  371. package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +36 -0
  372. package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +220 -0
  373. package/lib/solution/BookingTicket/utils/scan/cloudSearch.d.ts +4 -0
  374. package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +24 -3
  375. package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +32 -0
  376. package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.js +64 -0
  377. package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +3 -1
  378. package/lib/solution/BookingTicket/utils/scan/handleScan.js +4 -2
  379. package/lib/solution/BookingTicket/utils/scan/index.d.ts +5 -0
  380. package/lib/solution/BookingTicket/utils/scan/index.js +14 -2
  381. package/lib/solution/BookingTicket/utils/scan/scanProductValues.d.ts +21 -0
  382. package/lib/solution/BookingTicket/utils/scan/scanProductValues.js +115 -0
  383. package/lib/solution/BookingTicket/utils/sessionCatalogStale.d.ts +23 -0
  384. package/lib/solution/BookingTicket/utils/sessionCatalogStale.js +83 -0
  385. package/lib/solution/Checkout/index.d.ts +1 -0
  386. package/lib/solution/Checkout/index.js +18 -19
  387. package/lib/solution/Checkout/utils/index.js +4 -4
  388. package/lib/solution/RegisterAndLogin/config.js +2 -10
  389. package/lib/solution/Sales/index.d.ts +50 -5
  390. package/lib/solution/Sales/index.js +296 -39
  391. package/lib/solution/Sales/types.d.ts +26 -2
  392. package/lib/solution/ScanOrder/index.d.ts +27 -21
  393. package/lib/solution/ScanOrder/index.js +144 -103
  394. package/lib/solution/ScanOrder/types.d.ts +33 -11
  395. package/lib/solution/ScanOrder/types.js +4 -5
  396. package/lib/solution/ScanOrder/utils.d.ts +4 -1
  397. package/lib/solution/ScanOrder/utils.js +98 -26
  398. package/lib/solution/ShopDiscount/index.js +3 -3
  399. package/lib/solution/UnifiedBookingSales/index.d.ts +183 -0
  400. package/lib/solution/UnifiedBookingSales/index.js +1050 -0
  401. package/lib/solution/UnifiedBookingSales/types.d.ts +143 -0
  402. package/lib/solution/UnifiedBookingSales/types.js +14 -0
  403. package/lib/solution/VenueBooking/index.d.ts +29 -20
  404. package/lib/solution/VenueBooking/index.js +169 -94
  405. package/lib/solution/VenueBooking/sales-section-4-annotated.json +0 -2
  406. package/lib/solution/VenueBooking/utils/slotMerge.d.ts +6 -0
  407. package/lib/solution/VenueBooking/utils/slotMerge.js +9 -3
  408. package/lib/solution/index.d.ts +2 -0
  409. package/lib/solution/index.js +22 -0
  410. package/lib/types/index.d.ts +11 -1
  411. package/package.json +1 -1
  412. package/dist/solution/Checkout/appointmentDemo.json +0 -1
  413. package/lib/solution/Checkout/appointmentDemo.json +0 -1
@@ -33,6 +33,13 @@ export declare class PaymentModule extends BaseModule implements Module, Payment
33
33
  private runVoucherUpdateLocked;
34
34
  private normalizeVoucherPaymentItems;
35
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;
36
43
  /**
37
44
  * 记录信息日志
38
45
  */
@@ -54,22 +61,14 @@ export declare class PaymentModule extends BaseModule implements Module, Payment
54
61
  *
55
62
  */
56
63
  private registerNetworkHandlers;
57
- private filterPayMethods;
58
64
  /**
59
65
  * 获取支付方式列表
60
66
  */
61
67
  getPayMethodListAsync(): Promise<PaymentMethod[]>;
62
- /**
63
- * 后台刷新支付方式列表
64
- */
65
- private refreshPaymentMethodsInBackground;
66
- /**
67
- * 检查支付方式列表是否有变化
68
- */
69
- private hasPaymentMethodsChanged;
70
68
  /**
71
69
  * 获取订单列表
72
70
  */
71
+ /** @deprecated */
73
72
  getOrderListAsync(): Promise<PaymentOrder[]>;
74
73
  /**
75
74
  * 根据订单UUID获取支付订单(新方法)
@@ -169,10 +168,12 @@ export declare class PaymentModule extends BaseModule implements Module, Payment
169
168
  /**
170
169
  * 确保支付模块所需的数据库表已创建
171
170
  */
171
+ /** @deprecated */
172
172
  private ensurePaymentTables;
173
173
  /**
174
174
  * 获取部分支付的订单
175
175
  */
176
+ /** @deprecated */
176
177
  getPartiallyPaidOrdersAsync(): Promise<PaymentOrder[]>;
177
178
  /**
178
179
  * 智能金额舍入
@@ -73,6 +73,12 @@ function generateRequestUniqueId() {
73
73
 
74
74
  return `${year}${month}${day}${hour}${minute}${second}${millisecond}${randomDigits}`;
75
75
  }
76
+ function normalizeCustomPaymentId(paymentItem) {
77
+ const rawId = paymentItem.custom_payment_id ?? paymentItem.id ?? 0;
78
+ const parsedId = Number(rawId);
79
+ if (!Number.isFinite(parsedId)) return 0;
80
+ return parsedId;
81
+ }
76
82
 
77
83
  /**
78
84
  * 支付模块实现
@@ -151,7 +157,8 @@ class PaymentModule extends _BaseModule.BaseModule {
151
157
  this.logger = this.app.logger;
152
158
 
153
159
  // 确保支付模块所需的对象存储已创建
154
- await this.ensurePaymentTables();
160
+ // await this.ensurePaymentTables();
161
+
155
162
  this.registerNetworkHandlers();
156
163
 
157
164
  // // 预连接数据库
@@ -160,6 +167,16 @@ class PaymentModule extends _BaseModule.BaseModule {
160
167
  this.logInfo('PaymentModule initialized successfully');
161
168
  }
162
169
 
170
+ /**
171
+ * 更新父级解决方案透传的运行态参数,主要用于日志父模块等上下文。
172
+ *
173
+ * @example
174
+ * paymentModule.updateOtherParams({ fatherModule: 'bookingTicket' });
175
+ */
176
+ updateOtherParams(params) {
177
+ this.otherParams = params || {};
178
+ }
179
+
163
180
  /**
164
181
  * 记录信息日志
165
182
  */
@@ -245,23 +262,6 @@ class PaymentModule extends _BaseModule.BaseModule {
245
262
  }
246
263
  });
247
264
  }
248
- async filterPayMethods(payMethods) {
249
- // 1. 筛选 status === 1 && disable === 0的数据
250
- // 2. 检查列表里是否有 code=WALLET_PASS的数据,如果没有,则列表里如果有 PRODUCTVOUCHER 、 GIFTCARD 、 POINTCARD 则删除他们
251
- // 如果有 code = WALLET_PASS的数据,则列表里PRODUCTVOUCHER 、 GIFTCARD 、 POINTCARD 的channel_application 指向 WALLET_PASS 的 channel_application
252
- payMethods = payMethods.filter(method => method.status === 1 && method.disable === 0);
253
- const walletPassMethod = payMethods.find(method => method.code === 'WALLET_PASS');
254
- if (walletPassMethod) {
255
- payMethods.forEach(method => {
256
- if (method.code === 'PRODUCTVOUCHER' || method.code === 'GIFTCARD' || method.code === 'POINTCARD') {
257
- method.channel_application = walletPassMethod.channel_application;
258
- }
259
- });
260
- } else {
261
- payMethods = payMethods.filter(method => method.code !== 'PRODUCTVOUCHER' && method.code !== 'GIFTCARD' && method.code !== 'POINTCARD');
262
- }
263
- return payMethods;
264
- }
265
265
 
266
266
  /**
267
267
  * 获取支付方式列表
@@ -269,36 +269,12 @@ class PaymentModule extends _BaseModule.BaseModule {
269
269
  async getPayMethodListAsync() {
270
270
  this.logInfo('Starting getPayMethodListAsync');
271
271
  try {
272
- // 先尝试从 IndexDB 获取缓存
273
- let cachedMethods = [];
274
- try {
275
- cachedMethods = await this.dbManager.getAll('pay_method');
276
- } catch (dbError) {
277
- console.warn('[PaymentModule] pay_method 表不存在,将从服务器获取数据');
278
- }
279
-
280
- // 如果有缓存,先返回缓存数据
281
- const hasCache = cachedMethods.length > 0;
282
- if (hasCache) {
283
- // 后台异步获取最新数据
284
- this.refreshPaymentMethodsInBackground(cachedMethods);
285
- return cachedMethods;
286
- }
287
-
288
- // 没有缓存时,直接从服务器获取
289
- const response = await this.request.get('/pay/custom-payment/all');
290
- response.data = this.filterPayMethods(response.data);
291
- const payMethods = response.data || [];
292
-
293
- // 尝试缓存到 IndexDB
294
- try {
295
- for (const method of payMethods) {
296
- await this.dbManager.update('pay_method', method);
297
- }
298
- } catch (dbError) {
299
- console.warn('[PaymentModule] 无法缓存支付方式,pay_method 表不存在');
300
- }
301
- await this.core.effects.emit(`${this.name}:onPaymentMethodsLoaded`, payMethods);
272
+ const response = await this.request.get('/pay/custom-payment/all', {
273
+ filterPaymentMethods: true
274
+ }, {
275
+ osServer: true
276
+ });
277
+ const payMethods = response?.data || response || [];
302
278
  this.logInfo('getPayMethodListAsync completed successfully', {
303
279
  payMethods
304
280
  });
@@ -311,82 +287,10 @@ class PaymentModule extends _BaseModule.BaseModule {
311
287
  }
312
288
  }
313
289
 
314
- /**
315
- * 后台刷新支付方式列表
316
- */
317
- async refreshPaymentMethodsInBackground(cachedMethods) {
318
- this.logInfo('Starting refreshPaymentMethodsInBackground', {
319
- cachedMethodsCount: cachedMethods.length
320
- });
321
- try {
322
- // 从服务器获取最新数据
323
- const response = await this.request.get('/pay/custom-payment/all');
324
- response.data = this.filterPayMethods(response.data);
325
- const newPayMethods = response.data || [];
326
-
327
- // 检查是否有变化
328
- const hasChanges = this.hasPaymentMethodsChanged(cachedMethods, newPayMethods);
329
- if (hasChanges) {
330
- this.logInfo('Payment methods updated in background', {
331
- oldCount: cachedMethods.length,
332
- newCount: newPayMethods.length
333
- });
334
-
335
- // 更新缓存
336
- try {
337
- // 先清除旧数据
338
- for (const method of cachedMethods) {
339
- await this.dbManager.delete('pay_method', method.id);
340
- }
341
- // 添加新数据
342
- for (const method of newPayMethods) {
343
- await this.dbManager.update('pay_method', method);
344
- }
345
- } catch (dbError) {
346
- console.warn('[PaymentModule] 无法更新支付方式缓存', dbError);
347
- }
348
-
349
- // 通知外部支付方式已变化
350
- const eventData = {
351
- oldMethods: cachedMethods,
352
- newMethods: newPayMethods
353
- };
354
- await this.core.effects.emit(`${this.name}:onPaymentMethodsChanged`, eventData);
355
- } else {}
356
- } catch (error) {
357
- console.error('[PaymentModule] 后台刷新支付方式失败', error);
358
- }
359
- }
360
-
361
- /**
362
- * 检查支付方式列表是否有变化
363
- */
364
- hasPaymentMethodsChanged(oldMethods, newMethods) {
365
- if (oldMethods.length !== newMethods.length) {
366
- return true;
367
- }
368
-
369
- // 创建旧数据的 Map 便于查找
370
- const oldMethodsMap = new Map(oldMethods.map(method => [method.id, method]));
371
-
372
- // 检查每个新方法是否与旧方法相同
373
- for (const newMethod of newMethods) {
374
- const oldMethod = oldMethodsMap.get(newMethod.id);
375
- if (!oldMethod) {
376
- return true; // 新增方法
377
- }
378
-
379
- // 检查关键字段是否有变化
380
- 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 || {})) {
381
- return true; // 方法属性有变化
382
- }
383
- }
384
- return false;
385
- }
386
-
387
290
  /**
388
291
  * 获取订单列表
389
292
  */
293
+ /** @deprecated */
390
294
  async getOrderListAsync() {
391
295
  try {
392
296
  return await this.dbManager.getAll('order');
@@ -748,12 +652,14 @@ class PaymentModule extends _BaseModule.BaseModule {
748
652
  const currentTime = formatDateTime(new Date());
749
653
  const newPaymentItem = {
750
654
  uuid: paymentUuid,
751
- custom_payment_id: paymentItem.custom_payment_id || 0,
655
+ custom_payment_id: normalizeCustomPaymentId(paymentItem),
752
656
  name: paymentItem.name,
753
657
  code: paymentItem.code,
754
658
  type: paymentItem.type,
755
659
  amount: formatAmount(paymentItem.amount),
756
660
  voucher_id: paymentItem.voucher_id || '',
661
+ wallet_pass_usage_unit: paymentItem.wallet_pass_usage_unit,
662
+ wallet_pass_use_value: paymentItem.wallet_pass_use_value,
757
663
  rounding_amount: paymentItem.rounding_amount || '0.00',
758
664
  service_charge: paymentItem.service_charge,
759
665
  status: 'active',
@@ -764,8 +670,6 @@ class PaymentModule extends _BaseModule.BaseModule {
764
670
  // 创建时间
765
671
  updated_at: currentTime,
766
672
  // 更新时间
767
- wallet_pass_usage_unit: paymentItem?.wallet_pass_usage_unit,
768
- wallet_pass_use_value: paymentItem?.wallet_pass_use_value,
769
673
  metadata: {
770
674
  ...paymentItem.metadata,
771
675
  // 保留传入的所有 metadata 字段
@@ -1223,6 +1127,7 @@ class PaymentModule extends _BaseModule.BaseModule {
1223
1127
  /**
1224
1128
  * 确保支付模块所需的数据库表已创建
1225
1129
  */
1130
+ /** @deprecated */
1226
1131
  async ensurePaymentTables() {
1227
1132
  try {
1228
1133
  // 尝试访问 pay_method 表,如果不存在会抛出错误
@@ -1243,6 +1148,7 @@ class PaymentModule extends _BaseModule.BaseModule {
1243
1148
  /**
1244
1149
  * 获取部分支付的订单
1245
1150
  */
1151
+ /** @deprecated */
1246
1152
  async getPartiallyPaidOrdersAsync() {
1247
1153
  try {
1248
1154
  const allOrders = await this.dbManager.getAll('order');
@@ -104,7 +104,7 @@ export interface PaymentItem {
104
104
  /** 支付类型type,跟支付列表上对应的支付方式保持一致 */
105
105
  type: string;
106
106
  /** 代金券、充值卡、积分卡等wallet pass id */
107
- voucher_id?: string;
107
+ voucher_id?: string | number;
108
108
  /** 拓展参数字段 */
109
109
  metadata?: {
110
110
  /** 钱箱 ID */
@@ -131,6 +131,8 @@ export interface PaymentItem {
131
131
  origin_amount?: string;
132
132
  /** 订单支付类型 */
133
133
  order_payment_type?: 'normal' | 'deposit';
134
+ /** 支付时间 (格式: YYYY-MM-DD HH:mm:ss) */
135
+ payment_time?: string;
134
136
  /** 本支付项是否已成功同步到后端 */
135
137
  isSynced?: boolean;
136
138
  /** 最近一次同步失败信息(存在则代表同步失败过) */
@@ -231,13 +233,19 @@ export interface PaymentItemInput {
231
233
  /** 支付类型,跟支付列表上对应的支付方式保持一致 */
232
234
  code: string;
233
235
  /** 支付类型id,跟支付列表上对应的支付方式保持一致 */
234
- custom_payment_id: number;
236
+ custom_payment_id?: string | number;
237
+ /** 兼容旧调用方传入的支付方式 id */
238
+ id?: string | number;
235
239
  /** 支付类型名称,跟支付列表上对应的支付方式保持一致 */
236
240
  name: string;
237
241
  /** 支付类型type,跟支付列表上对应的支付方式保持一致 */
238
242
  type: string;
239
243
  /** 代金券、充值卡、积分卡等wallet pass id */
240
- voucher_id?: string;
244
+ voucher_id?: string | number;
245
+ /** Wallet Pass 使用单位配置 */
246
+ wallet_pass_usage_unit?: unknown;
247
+ /** Wallet Pass 本次使用值 */
248
+ wallet_pass_use_value?: string | number | null;
241
249
  /** 三方支付手续费 */
242
250
  service_charge?: {
243
251
  percentage?: string;
@@ -264,10 +272,6 @@ export interface PaymentItemInput {
264
272
  created_at?: string;
265
273
  /** 支付项更新时间 (格式: YYYY-MM-DD HH:mm:ss, 可选,不传则自动生成) */
266
274
  updated_at?: string;
267
- /** 钱包支付使用金额 */
268
- wallet_pass_use_value?: any;
269
- /** 钱包支付使用单位 */
270
- wallet_pass_usage_unit?: any;
271
275
  }
272
276
  /**
273
277
  * 推送支付项参数
@@ -351,6 +355,18 @@ export interface EftposPayment {
351
355
  /**
352
356
  * 钱包支付接口
353
357
  */
358
+ export interface WalletInitializationResult {
359
+ walletRecommendList: WalletRecommendItem[];
360
+ userIdentificationCodes: UserIdentificationCodeItem[];
361
+ transformList: any[];
362
+ noApplicableVoucher: any[];
363
+ products: any[];
364
+ }
365
+ export interface WalletStoredInitData {
366
+ transformList: any[];
367
+ noApplicableVoucher: any[];
368
+ products: any[];
369
+ }
354
370
  export interface WalletPassPayment {
355
371
  /** 生成钱包API默认参数 */
356
372
  generateWalletParams: (businessData: WalletInitBusinessData) => WalletDeductionRecommendParams;
@@ -359,21 +375,25 @@ export interface WalletPassPayment {
359
375
  /** 清理已存储的钱包参数 */
360
376
  clearStoredWalletParams: () => void;
361
377
  /** 初始化钱包数据(从业务数据开始,内部生成参数) */
362
- initializeWalletDataFromBusinessAsync: (businessData: WalletInitBusinessData) => Promise<{
363
- walletRecommendList: WalletRecommendItem[];
364
- userIdentificationCodes: UserIdentificationCodeItem[];
365
- }>;
378
+ initializeWalletDataFromBusinessAsync: (businessData: WalletInitBusinessData) => Promise<WalletInitializationResult>;
366
379
  /** 初始化钱包数据(先获取推荐列表,再获取用户识别码列表) */
367
- initializeWalletDataAsync: (baseParams: WalletDeductionRecommendParams) => Promise<{
368
- walletRecommendList: WalletRecommendItem[];
369
- userIdentificationCodes: UserIdentificationCodeItem[];
370
- }>;
380
+ initializeWalletDataAsync: (baseParams: WalletDeductionRecommendParams) => Promise<WalletInitializationResult>;
371
381
  /** 获取钱包推荐扣款列表(异步获取并缓存) */
372
382
  getWalletPassRecommendListAsync: (params: WalletDeductionRecommendParams) => Promise<WalletRecommendItem[]>;
373
383
  /** 查询用户识别码列表(异步获取并缓存) */
374
384
  getUserIdentificationCodeListAsync: (params: UserIdentificationCodeParams) => Promise<UserIdentificationCodeItem[]>;
375
385
  /** 搜索识别码信息 */
376
- searchIdentificationCodeAsync: (params: SearchIdentificationCodeParams) => Promise<SearchIdentificationCodeResult>;
386
+ searchIdentificationCodeAsync: (params: SearchIdentificationCodeParams, config?: {
387
+ noCache?: boolean;
388
+ }) => Promise<SearchIdentificationCodeResult>;
389
+ /** 将推荐钱包列表转换为 prepare_payments */
390
+ formatWalletPassList2PreparePayments: (list: WalletRecommendItem[]) => {
391
+ voucher_id: number;
392
+ amount: number;
393
+ tag: string;
394
+ wallet_pass_usage_unit?: unknown;
395
+ wallet_pass_use_value?: string | number | null;
396
+ }[];
377
397
  /** 获取缓存的搜索结果列表 */
378
398
  getSearchResults: () => SearchIdentificationCodeItem[];
379
399
  /** 根据识别码查找搜索结果 */
@@ -386,6 +406,10 @@ export interface WalletPassPayment {
386
406
  clearWalletRecommendList: () => void;
387
407
  /** 清除用户识别码列表 */
388
408
  clearUserIdentificationCodes: () => void;
409
+ /** 获取缓存的钱包初始化数据 */
410
+ getStoredWalletInitData: () => WalletStoredInitData | null;
411
+ /** 清除缓存的钱包初始化数据 */
412
+ clearStoredWalletInitData: () => void;
389
413
  /** 清除搜索结果缓存 */
390
414
  clearSearchResults: () => void;
391
415
  /** 清除所有缓存数据 */
@@ -7,8 +7,8 @@ export declare const formatWalletPassList2PreparePayments: (list?: any[]) => {
7
7
  voucher_id: any;
8
8
  amount: number;
9
9
  tag: any;
10
- wallet_pass_use_value: any;
11
10
  wallet_pass_usage_unit: any;
11
+ wallet_pass_use_value: any;
12
12
  }[];
13
13
  /**
14
14
  * 对用户识别码列表进行排序
@@ -18,15 +18,16 @@ const getAvailableMaxAmount = data => {
18
18
  */
19
19
  exports.getAvailableMaxAmount = getAvailableMaxAmount;
20
20
  const formatWalletPassList2PreparePayments = list => {
21
- return (list || []).map(item => {
21
+ const formatted = (list || []).map(item => {
22
22
  return {
23
23
  voucher_id: item.id || 0,
24
24
  amount: Number(item.edit_current_amount || getAvailableMaxAmount(item)) || 0,
25
25
  tag: item.tag || '',
26
- wallet_pass_use_value: item.recommended_usage_par_value,
27
- wallet_pass_usage_unit: item.wallet_pass_usage_unit
26
+ wallet_pass_usage_unit: item.wallet_pass_usage_unit || {},
27
+ wallet_pass_use_value: item.wallet_pass_use_value || undefined
28
28
  };
29
29
  });
30
+ return formatted;
30
31
  };
31
32
 
32
33
  /**
@@ -213,7 +213,7 @@ class WalletPassPaymentImpl {
213
213
  };
214
214
 
215
215
  // 并行获取用户识别码列表和订单详情
216
- const [allList, orderBasicDetail] = await Promise.all([this.getUserIdentificationCodeListAsync(identificationParams), baseParams.payment_order_id ? this.getOrderBasicDetailAsync(baseParams.payment_order_id) : Promise.resolve(null)]);
216
+ const [allList, orderBasicDetail] = await Promise.all([this.getUserIdentificationCodeListAsync(identificationParams), baseParams.payment_order_id && typeof baseParams.payment_order_id === 'string' && !baseParams.payment_order_id.startsWith('LOCAL_') ? this.getOrderBasicDetailAsync(baseParams.payment_order_id) : Promise.resolve(null)]);
217
217
  const walletPassEvaluator = this.paymentModule.window?.getWalletPassEvaluator?.();
218
218
  if (!walletPassEvaluator) {
219
219
  return {
@@ -272,6 +272,9 @@ class WalletPassPaymentImpl {
272
272
  sale_channel: params.sale_channel,
273
273
  payment_order_id: this.walletParams?.payment_order_id
274
274
  });
275
+ if (typeof params.payment_order_id === 'string' && params.payment_order_id.startsWith('LOCAL_')) {
276
+ params.payment_order_id = undefined;
277
+ }
275
278
  const response = await this.paymentModule.request.post('/machinecode/prepare/deduction/recommend', params // 将 params 作为请求体数据
276
279
  );
277
280
  this.walletRecommendList = response?.data || [];
@@ -309,6 +312,13 @@ class WalletPassPaymentImpl {
309
312
  ...this.walletParams,
310
313
  ...params
311
314
  };
315
+ if (!newParams.products?.length) {
316
+ this.paymentModule.logInfo('[WalletPass] 商品列表为空,跳过获取用户识别码列表');
317
+ return [];
318
+ }
319
+ if (typeof newParams.payment_order_id === 'string' && newParams.payment_order_id.startsWith('LOCAL_')) {
320
+ newParams.payment_order_id = undefined;
321
+ }
312
322
  this.paymentModule.logInfo('[WalletPass] 开始获取用户识别码列表', {
313
323
  customer_id: newParams.customer_id,
314
324
  available: newParams.available,
@@ -360,11 +370,8 @@ class WalletPassPaymentImpl {
360
370
  noCache: config.noCache || false
361
371
  });
362
372
 
363
- // 检查识别码是否为9位且前3位为"000"
364
- const isWalletCode = code.length === 9 && code.startsWith('000');
365
- // 测试环境先使用 WL
366
- // const isWalletCode = code.startsWith('WL');
367
-
373
+ // 新钱包规则
374
+ const isWalletCode = code.startsWith('WL') || code.startsWith('200') && code.length === 10;
368
375
  if (isWalletCode) {
369
376
  // 钱包识别码直接调用专门接口,不缓存,直接返回
370
377
  const walletDetailParams = {
@@ -416,6 +423,9 @@ class WalletPassPaymentImpl {
416
423
  multiple: searchParams.multiple,
417
424
  payment_order_id: baseWalletParams?.payment_order_id
418
425
  });
426
+ if (typeof searchParams.payment_order_id === 'string' && searchParams.payment_order_id.startsWith('LOCAL_')) {
427
+ searchParams.payment_order_id = undefined;
428
+ }
419
429
  let response;
420
430
  if (!searchParams.products || (searchParams.products || [])?.length === 0) {
421
431
  response = {
@@ -9,6 +9,26 @@ export interface ProductCollection {
9
9
  /** 商品集合封面 */
10
10
  cover: string;
11
11
  }
12
+ /**
13
+ * 商品 Data Variant 记录,结构与后端 data_variant 表对齐。
14
+ */
15
+ export interface ProductDataVariant {
16
+ /** 变体记录 id */
17
+ id: number;
18
+ /** 店铺 id */
19
+ shop_id: number;
20
+ /** 所属模块,商品场景固定为 product */
21
+ module: string;
22
+ /** 模块数据 id,商品场景对应 product.id */
23
+ module_data_id: number;
24
+ /** 关联 data_variant_rule.id */
25
+ data_variant_rule_id: number;
26
+ /** 命中策略后覆盖到商品上的字段 */
27
+ data: Record<string, any>;
28
+ created_at: string | null;
29
+ updated_at: string | null;
30
+ deleted_at: string | null;
31
+ }
12
32
  /**
13
33
  * 商品基本信息接口
14
34
  */
@@ -168,6 +188,13 @@ export interface ProductData {
168
188
  product_resource?: {
169
189
  resources?: ProductResourceItem[];
170
190
  };
191
+ /** 商品级持有人配置,resource_id 对应 holder 表单 id */
192
+ holder_config?: {
193
+ status?: string;
194
+ required?: number | string | boolean;
195
+ resource_id?: number | string | null;
196
+ [key: string]: any;
197
+ };
171
198
  /** 组合商品id,动态附加 */
172
199
  product_variant_id?: number;
173
200
  /** 套餐信息 */
@@ -208,15 +235,10 @@ export interface ProductData {
208
235
  bundle_group_count: number;
209
236
  /** 选项组数量 */
210
237
  option_group_count: number;
238
+ /** 智能定价变体列表,/product/query with dataVariants 返回 */
239
+ data_variants?: ProductDataVariant[];
211
240
  /** 服务时长 */
212
241
  service_times?: any;
213
- /** holder 表单配置 */
214
- holder_config?: {
215
- required?: number;
216
- resource_id?: number;
217
- status?: string;
218
- [key: string]: any;
219
- };
220
242
  }
221
243
  /**
222
244
  * 商品媒体信息接口
@@ -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,20 +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, with_extra, }: {
15
- category_ids?: number[];
16
- product_ids?: number[];
17
- collection?: number | string[];
18
- schedule_date?: string;
19
- schedule_datetime?: string;
20
- cacheId?: string;
21
- customer_id?: number;
22
- menu_list_ids?: number[];
23
- with_count?: string[];
24
- with_schedule?: number;
25
- with_extra?: string[];
26
- }, 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, strategy_context, with_extra, }?: ProductListLoadProductsParams, options?: {
27
30
  callback?: (result: any) => void;
28
31
  subscriberId?: string;
29
32
  }): Promise<any>;
@@ -35,6 +38,7 @@ export declare class ProductList extends BaseModule implements Module {
35
38
  }): Promise<any>;
36
39
  getProducts(): Promise<ProductData[]>;
37
40
  getProduct(id: number): Promise<ProductData | undefined>;
41
+ getProductByIds(ids: number[]): Promise<ProductData[] | undefined>;
38
42
  addProduct(products: ProductData[]): Promise<void>;
39
43
  selectProducts(products: ProductData[]): Promise<void>;
40
44
  /**