@pisell/pisellos 0.0.568 → 0.0.570

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 (455) hide show
  1. package/dist/effects/index.d.ts +2 -2
  2. package/dist/model/strategy/adapter/dataVariant/type.d.ts +3 -3
  3. package/dist/model/strategy/adapter/itemRule/type.d.ts +6 -6
  4. package/dist/model/strategy/adapter/promotion/evaluator.js +3 -2
  5. package/dist/model/strategy/adapter/promotion/type.d.ts +5 -5
  6. package/dist/model/strategy/adapter/walletPass/utils.js +7 -4
  7. package/dist/model/strategy/type.d.ts +1 -1
  8. package/dist/modules/BaseModule.d.ts +2 -2
  9. package/dist/modules/BaseModule.js +4 -4
  10. package/dist/modules/BookingContext/index.d.ts +48 -0
  11. package/dist/modules/BookingContext/index.js +566 -0
  12. package/dist/modules/BookingContext/types.d.ts +102 -0
  13. package/dist/modules/BookingContext/types.js +51 -0
  14. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts +16 -0
  15. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +302 -0
  16. package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +8 -0
  17. package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +149 -0
  18. package/dist/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +76 -0
  19. package/dist/modules/BookingContext/utils/cacheItemToBookingInput.js +249 -0
  20. package/dist/modules/BookingContext/utils/flexible.d.ts +28 -0
  21. package/dist/modules/BookingContext/utils/flexible.js +56 -0
  22. package/dist/modules/BookingContext/utils/formatResourceList.d.ts +8 -0
  23. package/dist/modules/BookingContext/utils/formatResourceList.js +38 -0
  24. package/dist/modules/BookingContext/utils/index.d.ts +11 -0
  25. package/dist/modules/BookingContext/utils/index.js +11 -0
  26. package/dist/modules/BookingContext/utils/noResource.d.ts +13 -0
  27. package/dist/modules/BookingContext/utils/noResource.js +77 -0
  28. package/dist/modules/BookingContext/utils/orderLineDisplay.d.ts +1 -0
  29. package/dist/modules/BookingContext/utils/orderLineDisplay.js +36 -0
  30. package/dist/modules/BookingContext/utils/productExtend.d.ts +72 -0
  31. package/dist/modules/BookingContext/utils/productExtend.js +339 -0
  32. package/dist/modules/BookingContext/utils/resourceErrors.d.ts +41 -0
  33. package/dist/modules/BookingContext/utils/resourceErrors.js +74 -0
  34. package/dist/modules/BookingContext/utils/resourceSelection.d.ts +7 -0
  35. package/dist/modules/BookingContext/utils/resourceSelection.js +24 -0
  36. package/dist/modules/BookingContext/utils/resources.d.ts +80 -0
  37. package/dist/modules/BookingContext/utils/resources.js +486 -0
  38. package/dist/modules/BookingContext/utils/serviceTimes.d.ts +55 -0
  39. package/dist/modules/BookingContext/utils/serviceTimes.js +151 -0
  40. package/dist/modules/BookingContext/utils/timeSlices.d.ts +42 -0
  41. package/dist/modules/BookingContext/utils/timeSlices.js +100 -0
  42. package/dist/modules/Cart/utils/cartProduct.js +26 -5
  43. package/dist/modules/Cart/utils/changePrice.js +27 -20
  44. package/dist/modules/Customer/index.d.ts +20 -0
  45. package/dist/modules/Customer/index.js +172 -83
  46. package/dist/modules/Customer/types.d.ts +3 -1
  47. package/dist/modules/Discount/index.d.ts +2 -1
  48. package/dist/modules/Discount/index.js +37 -9
  49. package/dist/modules/Discount/types.d.ts +2 -1
  50. package/dist/modules/Holder/types.d.ts +1 -1
  51. package/dist/modules/OpenData/index.d.ts +8 -0
  52. package/dist/modules/OpenData/index.js +36 -16
  53. package/dist/modules/OpenData/types.d.ts +1 -1
  54. package/dist/modules/Order/index.d.ts +448 -23
  55. package/dist/modules/Order/index.js +5417 -561
  56. package/dist/modules/Order/types.d.ts +693 -88
  57. package/dist/modules/Order/types.js +68 -1
  58. package/dist/modules/Order/utils/bundleDiscountHydration.d.ts +5 -0
  59. package/dist/modules/Order/utils/bundleDiscountHydration.js +144 -0
  60. package/dist/modules/Order/utils/manualProductDiscount.d.ts +106 -0
  61. package/dist/modules/Order/utils/manualProductDiscount.js +210 -0
  62. package/dist/modules/Order/utils/orderCollectionIdentity.d.ts +53 -0
  63. package/dist/modules/Order/utils/orderCollectionIdentity.js +405 -0
  64. package/dist/modules/Order/utils.d.ts +167 -18
  65. package/dist/modules/Order/utils.js +960 -165
  66. package/dist/modules/Payment/index.d.ts +10 -9
  67. package/dist/modules/Payment/index.js +465 -703
  68. package/dist/modules/Payment/types.d.ts +47 -23
  69. package/dist/modules/Payment/utils.d.ts +1 -1
  70. package/dist/modules/Payment/utils.js +4 -3
  71. package/dist/modules/Payment/walletpass.js +44 -29
  72. package/dist/modules/Product/index.d.ts +1 -1
  73. package/dist/modules/Product/types.d.ts +29 -7
  74. package/dist/modules/ProductList/index.d.ts +17 -13
  75. package/dist/modules/ProductList/index.js +184 -74
  76. package/dist/modules/ProductList/types.d.ts +17 -0
  77. package/dist/modules/Quotation/index.d.ts +22 -2
  78. package/dist/modules/Quotation/index.js +108 -42
  79. package/dist/modules/Quotation/types.d.ts +19 -0
  80. package/dist/modules/ResourcePlanner/index.d.ts +24 -0
  81. package/dist/modules/ResourcePlanner/index.js +181 -0
  82. package/dist/modules/ResourcePlanner/planner.d.ts +14 -0
  83. package/dist/modules/ResourcePlanner/planner.js +1069 -0
  84. package/dist/modules/ResourcePlanner/types.d.ts +227 -0
  85. package/dist/modules/ResourcePlanner/types.js +1 -0
  86. package/dist/modules/Rules/index.d.ts +8 -10
  87. package/dist/modules/Rules/index.js +222 -109
  88. package/dist/modules/Rules/types.d.ts +15 -4
  89. package/dist/modules/SalesSummary/index.d.ts +23 -26
  90. package/dist/modules/SalesSummary/index.js +152 -46
  91. package/dist/modules/SalesSummary/types.d.ts +9 -1
  92. package/dist/modules/SalesSummary/utils.d.ts +3 -22
  93. package/dist/modules/SalesSummary/utils.js +803 -163
  94. package/dist/modules/ScanOrderLogger/types.d.ts +2 -2
  95. package/dist/modules/Schedule/getDateIsInSchedule.d.ts +1 -1
  96. package/dist/modules/Schedule/getDateIsInSchedule.js +14 -7
  97. package/dist/modules/Schedule/index.d.ts +18 -5
  98. package/dist/modules/Schedule/index.js +78 -24
  99. package/dist/modules/Schedule/type.d.ts +7 -7
  100. package/dist/modules/Schedule/types.d.ts +11 -9
  101. package/dist/modules/Summary/index.js +4 -3
  102. package/dist/modules/SurchargeList/index.d.ts +18 -0
  103. package/dist/modules/SurchargeList/index.js +185 -0
  104. package/dist/modules/SurchargeList/types.d.ts +15 -0
  105. package/dist/modules/SurchargeList/types.js +1 -0
  106. package/dist/modules/index.d.ts +3 -0
  107. package/dist/modules/index.js +4 -1
  108. package/dist/plugins/app.d.ts +2 -0
  109. package/dist/plugins/request.d.ts +3 -2
  110. package/dist/server/index.d.ts +462 -8
  111. package/dist/server/index.js +6112 -656
  112. package/dist/server/modules/floor-plan/index.d.ts +39 -0
  113. package/dist/server/modules/floor-plan/index.js +595 -0
  114. package/dist/server/modules/floor-plan/types.d.ts +43 -0
  115. package/dist/server/modules/floor-plan/types.js +13 -0
  116. package/dist/server/modules/index.d.ts +7 -2
  117. package/dist/server/modules/index.js +6 -0
  118. package/dist/server/modules/menu/types.d.ts +1 -1
  119. package/dist/server/modules/order/index.d.ts +207 -14
  120. package/dist/server/modules/order/index.js +2326 -379
  121. package/dist/server/modules/order/types.d.ts +91 -20
  122. package/dist/server/modules/order/types.js +14 -1
  123. package/dist/server/modules/order/utils/filterBookings.d.ts +7 -1
  124. package/dist/server/modules/order/utils/filterBookings.js +118 -11
  125. package/dist/server/modules/order/utils/filterOrders.js +242 -14
  126. package/dist/server/modules/payment/index.d.ts +28 -0
  127. package/dist/server/modules/payment/index.js +305 -0
  128. package/dist/server/modules/payment/types.d.ts +9 -0
  129. package/dist/server/modules/payment/types.js +1 -0
  130. package/dist/server/modules/products/index.d.ts +105 -14
  131. package/dist/server/modules/products/index.js +1393 -516
  132. package/dist/server/modules/products/types.d.ts +35 -2
  133. package/dist/server/modules/products/types.js +4 -0
  134. package/dist/server/modules/quotation/index.d.ts +39 -0
  135. package/dist/server/modules/quotation/index.js +278 -66
  136. package/dist/server/modules/resource/index.d.ts +2 -3
  137. package/dist/server/modules/resource/index.js +108 -86
  138. package/dist/server/modules/resource/types.d.ts +1 -1
  139. package/dist/server/modules/schedule/index.d.ts +6 -4
  140. package/dist/server/modules/schedule/index.js +116 -85
  141. package/dist/server/modules/schedule/utils.d.ts +1 -1
  142. package/dist/server/test.json +713 -0
  143. package/dist/server/types.d.ts +6 -4
  144. package/dist/server/utils/product.js +2 -2
  145. package/dist/server/utils/small-ticket.d.ts +71 -0
  146. package/dist/server/utils/small-ticket.js +963 -0
  147. package/dist/solution/BaseSales/index.d.ts +378 -0
  148. package/dist/solution/BaseSales/index.js +4006 -0
  149. package/dist/solution/BaseSales/types.d.ts +394 -0
  150. package/dist/solution/BaseSales/types.js +40 -0
  151. package/dist/solution/BaseSales/utils/cartPromotion.d.ts +287 -0
  152. package/dist/solution/BaseSales/utils/cartPromotion.js +1450 -0
  153. package/dist/solution/BaseSales/utils/parseSalesResponse.d.ts +144 -0
  154. package/dist/solution/BaseSales/utils/parseSalesResponse.js +157 -0
  155. package/dist/solution/BaseSales/utils/quotationPrice.d.ts +18 -0
  156. package/dist/solution/BaseSales/utils/quotationPrice.js +250 -0
  157. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +63 -0
  158. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +218 -0
  159. package/dist/solution/BaseSales/utils.d.ts +40 -0
  160. package/dist/solution/BaseSales/utils.js +263 -0
  161. package/dist/solution/BookingByStep/index.d.ts +2 -2
  162. package/dist/solution/BookingByStep/utils/resources.d.ts +1 -1
  163. package/dist/solution/BookingTicket/index.d.ts +382 -25
  164. package/dist/solution/BookingTicket/index.js +2506 -443
  165. package/dist/solution/BookingTicket/types.d.ts +191 -6
  166. package/dist/solution/BookingTicket/types.js +83 -10
  167. package/dist/solution/BookingTicket/utils/addProductDecision.d.ts +117 -0
  168. package/dist/solution/BookingTicket/utils/addProductDecision.js +346 -0
  169. package/dist/solution/BookingTicket/utils/addTimeAvailability.d.ts +35 -0
  170. package/dist/solution/BookingTicket/utils/addTimeAvailability.js +95 -0
  171. package/dist/solution/BookingTicket/utils/bookingStatus.d.ts +77 -0
  172. package/dist/solution/BookingTicket/utils/bookingStatus.js +136 -0
  173. package/dist/solution/BookingTicket/utils/cartView.d.ts +29 -0
  174. package/dist/solution/BookingTicket/utils/cartView.js +209 -0
  175. package/dist/solution/BookingTicket/utils/exampleData.d.ts +123 -0
  176. package/dist/solution/BookingTicket/utils/exampleData.js +183 -0
  177. package/dist/solution/BookingTicket/utils/orderCustomer.d.ts +4 -0
  178. package/dist/solution/BookingTicket/utils/orderCustomer.js +31 -0
  179. package/dist/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +185 -0
  180. package/dist/solution/BookingTicket/utils/resolveBestAddTimePlan.js +438 -0
  181. package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +36 -0
  182. package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +400 -0
  183. package/dist/solution/BookingTicket/utils/scan/cloudSearch.d.ts +4 -0
  184. package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +41 -1
  185. package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +32 -0
  186. package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.js +56 -0
  187. package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +3 -1
  188. package/dist/solution/BookingTicket/utils/scan/handleScan.js +11 -3
  189. package/dist/solution/BookingTicket/utils/scan/index.d.ts +5 -0
  190. package/dist/solution/BookingTicket/utils/scan/index.js +20 -8
  191. package/dist/solution/BookingTicket/utils/scan/scanProductValues.d.ts +21 -0
  192. package/dist/solution/BookingTicket/utils/scan/scanProductValues.js +150 -0
  193. package/dist/solution/BookingTicket/utils/sessionCatalogStale.d.ts +23 -0
  194. package/dist/solution/BookingTicket/utils/sessionCatalogStale.js +78 -0
  195. package/dist/solution/Checkout/index.d.ts +1 -0
  196. package/dist/solution/Checkout/index.js +25 -34
  197. package/dist/solution/Checkout/utils/index.js +4 -4
  198. package/dist/solution/RegisterAndLogin/config.js +2 -10
  199. package/dist/solution/Sales/index.d.ts +50 -5
  200. package/dist/solution/Sales/index.js +484 -92
  201. package/dist/solution/Sales/types.d.ts +29 -5
  202. package/dist/solution/ScanOrder/index.d.ts +27 -21
  203. package/dist/solution/ScanOrder/index.js +499 -434
  204. package/dist/solution/ScanOrder/types.d.ts +38 -16
  205. package/dist/solution/ScanOrder/types.js +4 -5
  206. package/dist/solution/ScanOrder/utils.d.ts +4 -1
  207. package/dist/solution/ScanOrder/utils.js +109 -34
  208. package/dist/solution/ShopDiscount/index.js +4 -4
  209. package/dist/solution/ShopDiscount/types.d.ts +1 -1
  210. package/dist/solution/ShopDiscount/utils.d.ts +2 -2
  211. package/dist/solution/UnifiedBookingSales/index.d.ts +183 -0
  212. package/dist/solution/UnifiedBookingSales/index.js +1871 -0
  213. package/dist/solution/UnifiedBookingSales/types.d.ts +143 -0
  214. package/dist/solution/UnifiedBookingSales/types.js +11 -0
  215. package/dist/solution/VenueBooking/index.d.ts +29 -20
  216. package/dist/solution/VenueBooking/index.js +301 -213
  217. package/dist/solution/VenueBooking/sales-section-4-annotated.json +0 -2
  218. package/dist/solution/VenueBooking/types.d.ts +1 -1
  219. package/dist/solution/VenueBooking/utils/slotMerge.d.ts +6 -0
  220. package/dist/solution/VenueBooking/utils/slotMerge.js +9 -3
  221. package/dist/solution/index.d.ts +2 -0
  222. package/dist/solution/index.js +3 -1
  223. package/dist/types/index.d.ts +12 -2
  224. package/dist/utils/task.d.ts +2 -2
  225. package/dist/utils/watch.d.ts +2 -2
  226. package/lib/effects/index.d.ts +2 -2
  227. package/lib/model/strategy/adapter/dataVariant/type.d.ts +3 -3
  228. package/lib/model/strategy/adapter/itemRule/type.d.ts +6 -6
  229. package/lib/model/strategy/adapter/promotion/evaluator.js +3 -2
  230. package/lib/model/strategy/adapter/promotion/type.d.ts +5 -5
  231. package/lib/model/strategy/adapter/walletPass/utils.js +6 -4
  232. package/lib/model/strategy/type.d.ts +1 -1
  233. package/lib/modules/BaseModule.d.ts +2 -2
  234. package/lib/modules/BaseModule.js +4 -4
  235. package/lib/modules/BookingContext/index.d.ts +48 -0
  236. package/lib/modules/BookingContext/index.js +390 -0
  237. package/lib/modules/BookingContext/types.d.ts +102 -0
  238. package/lib/modules/BookingContext/types.js +48 -0
  239. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts +16 -0
  240. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +286 -0
  241. package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +8 -0
  242. package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +148 -0
  243. package/lib/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +76 -0
  244. package/lib/modules/BookingContext/utils/cacheItemToBookingInput.js +242 -0
  245. package/lib/modules/BookingContext/utils/flexible.d.ts +28 -0
  246. package/lib/modules/BookingContext/utils/flexible.js +63 -0
  247. package/lib/modules/BookingContext/utils/formatResourceList.d.ts +8 -0
  248. package/lib/modules/BookingContext/utils/formatResourceList.js +35 -0
  249. package/lib/modules/BookingContext/utils/index.d.ts +11 -0
  250. package/lib/modules/BookingContext/utils/index.js +126 -0
  251. package/lib/modules/BookingContext/utils/noResource.d.ts +13 -0
  252. package/lib/modules/BookingContext/utils/noResource.js +78 -0
  253. package/lib/modules/BookingContext/utils/orderLineDisplay.d.ts +1 -0
  254. package/lib/modules/BookingContext/utils/orderLineDisplay.js +29 -0
  255. package/lib/modules/BookingContext/utils/productExtend.d.ts +72 -0
  256. package/lib/modules/BookingContext/utils/productExtend.js +330 -0
  257. package/lib/modules/BookingContext/utils/resourceErrors.d.ts +41 -0
  258. package/lib/modules/BookingContext/utils/resourceErrors.js +80 -0
  259. package/lib/modules/BookingContext/utils/resourceSelection.d.ts +7 -0
  260. package/lib/modules/BookingContext/utils/resourceSelection.js +24 -0
  261. package/lib/modules/BookingContext/utils/resources.d.ts +80 -0
  262. package/lib/modules/BookingContext/utils/resources.js +419 -0
  263. package/lib/modules/BookingContext/utils/serviceTimes.d.ts +55 -0
  264. package/lib/modules/BookingContext/utils/serviceTimes.js +161 -0
  265. package/lib/modules/BookingContext/utils/timeSlices.d.ts +42 -0
  266. package/lib/modules/BookingContext/utils/timeSlices.js +114 -0
  267. package/lib/modules/Cart/utils/cartProduct.js +27 -5
  268. package/lib/modules/Cart/utils/changePrice.js +20 -14
  269. package/lib/modules/Customer/index.d.ts +20 -0
  270. package/lib/modules/Customer/index.js +63 -10
  271. package/lib/modules/Customer/types.d.ts +3 -1
  272. package/lib/modules/Discount/index.d.ts +2 -1
  273. package/lib/modules/Discount/index.js +18 -2
  274. package/lib/modules/Discount/types.d.ts +2 -1
  275. package/lib/modules/Holder/types.d.ts +1 -1
  276. package/lib/modules/OpenData/index.d.ts +8 -0
  277. package/lib/modules/OpenData/index.js +21 -3
  278. package/lib/modules/OpenData/types.d.ts +1 -1
  279. package/lib/modules/Order/index.d.ts +448 -23
  280. package/lib/modules/Order/index.js +3641 -308
  281. package/lib/modules/Order/types.d.ts +693 -88
  282. package/lib/modules/Order/types.js +55 -1
  283. package/lib/modules/Order/utils/bundleDiscountHydration.d.ts +5 -0
  284. package/lib/modules/Order/utils/bundleDiscountHydration.js +106 -0
  285. package/lib/modules/Order/utils/manualProductDiscount.d.ts +106 -0
  286. package/lib/modules/Order/utils/manualProductDiscount.js +207 -0
  287. package/lib/modules/Order/utils/orderCollectionIdentity.d.ts +53 -0
  288. package/lib/modules/Order/utils/orderCollectionIdentity.js +353 -0
  289. package/lib/modules/Order/utils.d.ts +167 -18
  290. package/lib/modules/Order/utils.js +974 -138
  291. package/lib/modules/Payment/index.d.ts +10 -9
  292. package/lib/modules/Payment/index.js +30 -124
  293. package/lib/modules/Payment/types.d.ts +47 -23
  294. package/lib/modules/Payment/utils.d.ts +1 -1
  295. package/lib/modules/Payment/utils.js +4 -3
  296. package/lib/modules/Payment/walletpass.js +16 -6
  297. package/lib/modules/Product/index.d.ts +1 -1
  298. package/lib/modules/Product/types.d.ts +29 -7
  299. package/lib/modules/ProductList/index.d.ts +17 -13
  300. package/lib/modules/ProductList/index.js +92 -51
  301. package/lib/modules/ProductList/types.d.ts +17 -0
  302. package/lib/modules/Quotation/index.d.ts +22 -2
  303. package/lib/modules/Quotation/index.js +76 -20
  304. package/lib/modules/Quotation/types.d.ts +19 -0
  305. package/lib/modules/ResourcePlanner/index.d.ts +24 -0
  306. package/lib/modules/ResourcePlanner/index.js +147 -0
  307. package/lib/modules/ResourcePlanner/planner.d.ts +14 -0
  308. package/lib/modules/ResourcePlanner/planner.js +895 -0
  309. package/lib/modules/ResourcePlanner/types.d.ts +227 -0
  310. package/lib/modules/ResourcePlanner/types.js +5 -0
  311. package/lib/modules/Rules/index.d.ts +8 -10
  312. package/lib/modules/Rules/index.js +153 -61
  313. package/lib/modules/Rules/types.d.ts +15 -4
  314. package/lib/modules/SalesSummary/index.d.ts +23 -26
  315. package/lib/modules/SalesSummary/index.js +84 -16
  316. package/lib/modules/SalesSummary/types.d.ts +9 -1
  317. package/lib/modules/SalesSummary/utils.d.ts +3 -22
  318. package/lib/modules/SalesSummary/utils.js +616 -111
  319. package/lib/modules/ScanOrderLogger/types.d.ts +2 -2
  320. package/lib/modules/Schedule/getDateIsInSchedule.d.ts +1 -1
  321. package/lib/modules/Schedule/getDateIsInSchedule.js +14 -7
  322. package/lib/modules/Schedule/index.d.ts +18 -5
  323. package/lib/modules/Schedule/index.js +49 -14
  324. package/lib/modules/Schedule/type.d.ts +7 -7
  325. package/lib/modules/Schedule/types.d.ts +11 -9
  326. package/lib/modules/Summary/index.js +2 -2
  327. package/lib/modules/SurchargeList/index.d.ts +18 -0
  328. package/lib/modules/SurchargeList/index.js +95 -0
  329. package/lib/modules/SurchargeList/types.d.ts +15 -0
  330. package/lib/modules/SurchargeList/types.js +5 -0
  331. package/lib/modules/index.d.ts +3 -0
  332. package/lib/modules/index.js +33 -0
  333. package/lib/plugins/app.d.ts +2 -0
  334. package/lib/plugins/request.d.ts +3 -2
  335. package/lib/server/index.d.ts +462 -8
  336. package/lib/server/index.js +3901 -205
  337. package/lib/server/modules/floor-plan/index.d.ts +39 -0
  338. package/lib/server/modules/floor-plan/index.js +306 -0
  339. package/lib/server/modules/floor-plan/types.d.ts +43 -0
  340. package/lib/server/modules/floor-plan/types.js +19 -0
  341. package/lib/server/modules/index.d.ts +7 -2
  342. package/lib/server/modules/index.js +21 -0
  343. package/lib/server/modules/menu/types.d.ts +1 -1
  344. package/lib/server/modules/order/index.d.ts +207 -14
  345. package/lib/server/modules/order/index.js +1324 -141
  346. package/lib/server/modules/order/types.d.ts +91 -20
  347. package/lib/server/modules/order/types.js +11 -1
  348. package/lib/server/modules/order/utils/filterBookings.d.ts +7 -1
  349. package/lib/server/modules/order/utils/filterBookings.js +119 -11
  350. package/lib/server/modules/order/utils/filterOrders.js +238 -13
  351. package/lib/server/modules/payment/index.d.ts +28 -0
  352. package/lib/server/modules/payment/index.js +168 -0
  353. package/lib/server/modules/payment/types.d.ts +9 -0
  354. package/lib/server/modules/payment/types.js +5 -0
  355. package/lib/server/modules/products/index.d.ts +105 -14
  356. package/lib/server/modules/products/index.js +588 -97
  357. package/lib/server/modules/products/types.d.ts +35 -2
  358. package/lib/server/modules/products/types.js +3 -0
  359. package/lib/server/modules/quotation/index.d.ts +39 -0
  360. package/lib/server/modules/quotation/index.js +145 -1
  361. package/lib/server/modules/resource/index.d.ts +2 -3
  362. package/lib/server/modules/resource/index.js +71 -45
  363. package/lib/server/modules/resource/types.d.ts +1 -1
  364. package/lib/server/modules/schedule/index.d.ts +6 -4
  365. package/lib/server/modules/schedule/index.js +55 -44
  366. package/lib/server/modules/schedule/utils.d.ts +1 -1
  367. package/lib/server/test.json +713 -0
  368. package/lib/server/types.d.ts +6 -4
  369. package/lib/server/utils/product.js +2 -2
  370. package/lib/server/utils/small-ticket.d.ts +71 -0
  371. package/lib/server/utils/small-ticket.js +926 -0
  372. package/lib/solution/BaseSales/index.d.ts +378 -0
  373. package/lib/solution/BaseSales/index.js +2367 -0
  374. package/lib/solution/BaseSales/types.d.ts +394 -0
  375. package/lib/solution/BaseSales/types.js +47 -0
  376. package/lib/solution/BaseSales/utils/cartPromotion.d.ts +287 -0
  377. package/lib/solution/BaseSales/utils/cartPromotion.js +1155 -0
  378. package/lib/solution/BaseSales/utils/parseSalesResponse.d.ts +144 -0
  379. package/lib/solution/BaseSales/utils/parseSalesResponse.js +140 -0
  380. package/lib/solution/BaseSales/utils/quotationPrice.d.ts +18 -0
  381. package/lib/solution/BaseSales/utils/quotationPrice.js +231 -0
  382. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +63 -0
  383. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +215 -0
  384. package/lib/solution/BaseSales/utils.d.ts +40 -0
  385. package/lib/solution/BaseSales/utils.js +259 -0
  386. package/lib/solution/BookingByStep/index.d.ts +2 -2
  387. package/lib/solution/BookingByStep/utils/resources.d.ts +1 -1
  388. package/lib/solution/BookingTicket/index.d.ts +382 -25
  389. package/lib/solution/BookingTicket/index.js +1350 -76
  390. package/lib/solution/BookingTicket/types.d.ts +191 -6
  391. package/lib/solution/BookingTicket/types.js +71 -10
  392. package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +117 -0
  393. package/lib/solution/BookingTicket/utils/addProductDecision.js +353 -0
  394. package/lib/solution/BookingTicket/utils/addTimeAvailability.d.ts +35 -0
  395. package/lib/solution/BookingTicket/utils/addTimeAvailability.js +94 -0
  396. package/lib/solution/BookingTicket/utils/bookingStatus.d.ts +77 -0
  397. package/lib/solution/BookingTicket/utils/bookingStatus.js +136 -0
  398. package/lib/solution/BookingTicket/utils/cartView.d.ts +29 -0
  399. package/lib/solution/BookingTicket/utils/cartView.js +200 -0
  400. package/lib/solution/BookingTicket/utils/exampleData.d.ts +123 -0
  401. package/lib/solution/BookingTicket/utils/exampleData.js +185 -0
  402. package/lib/solution/BookingTicket/utils/orderCustomer.d.ts +4 -0
  403. package/lib/solution/BookingTicket/utils/orderCustomer.js +35 -0
  404. package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +185 -0
  405. package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.js +387 -0
  406. package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +36 -0
  407. package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +220 -0
  408. package/lib/solution/BookingTicket/utils/scan/cloudSearch.d.ts +4 -0
  409. package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +24 -3
  410. package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +32 -0
  411. package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.js +64 -0
  412. package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +3 -1
  413. package/lib/solution/BookingTicket/utils/scan/handleScan.js +4 -2
  414. package/lib/solution/BookingTicket/utils/scan/index.d.ts +5 -0
  415. package/lib/solution/BookingTicket/utils/scan/index.js +14 -2
  416. package/lib/solution/BookingTicket/utils/scan/scanProductValues.d.ts +21 -0
  417. package/lib/solution/BookingTicket/utils/scan/scanProductValues.js +115 -0
  418. package/lib/solution/BookingTicket/utils/sessionCatalogStale.d.ts +23 -0
  419. package/lib/solution/BookingTicket/utils/sessionCatalogStale.js +83 -0
  420. package/lib/solution/Checkout/index.d.ts +1 -0
  421. package/lib/solution/Checkout/index.js +18 -19
  422. package/lib/solution/Checkout/utils/index.js +4 -4
  423. package/lib/solution/RegisterAndLogin/config.js +2 -10
  424. package/lib/solution/Sales/index.d.ts +50 -5
  425. package/lib/solution/Sales/index.js +296 -39
  426. package/lib/solution/Sales/types.d.ts +29 -5
  427. package/lib/solution/ScanOrder/index.d.ts +27 -21
  428. package/lib/solution/ScanOrder/index.js +144 -103
  429. package/lib/solution/ScanOrder/types.d.ts +38 -16
  430. package/lib/solution/ScanOrder/types.js +4 -5
  431. package/lib/solution/ScanOrder/utils.d.ts +4 -1
  432. package/lib/solution/ScanOrder/utils.js +98 -26
  433. package/lib/solution/ShopDiscount/index.js +3 -3
  434. package/lib/solution/ShopDiscount/types.d.ts +1 -1
  435. package/lib/solution/ShopDiscount/utils.d.ts +2 -2
  436. package/lib/solution/UnifiedBookingSales/index.d.ts +183 -0
  437. package/lib/solution/UnifiedBookingSales/index.js +1050 -0
  438. package/lib/solution/UnifiedBookingSales/types.d.ts +143 -0
  439. package/lib/solution/UnifiedBookingSales/types.js +14 -0
  440. package/lib/solution/VenueBooking/index.d.ts +29 -20
  441. package/lib/solution/VenueBooking/index.js +169 -94
  442. package/lib/solution/VenueBooking/sales-section-4-annotated.json +0 -2
  443. package/lib/solution/VenueBooking/types.d.ts +1 -1
  444. package/lib/solution/VenueBooking/utils/slotMerge.d.ts +6 -0
  445. package/lib/solution/VenueBooking/utils/slotMerge.js +9 -3
  446. package/lib/solution/index.d.ts +2 -0
  447. package/lib/solution/index.js +22 -0
  448. package/lib/types/index.d.ts +12 -2
  449. package/lib/utils/task.d.ts +2 -2
  450. package/lib/utils/watch.d.ts +2 -2
  451. package/package.json +18 -19
  452. package/dist/model/strategy/adapter/promotion/index.d.ts +0 -4
  453. package/dist/solution/Checkout/appointmentDemo.json +0 -1
  454. package/lib/model/strategy/adapter/promotion/index.d.ts +0 -4
  455. package/lib/solution/Checkout/appointmentDemo.json +0 -1
@@ -7,7 +7,7 @@ var _exportNames = {
7
7
  VenueBookingImpl: true
8
8
  };
9
9
  exports.VenueBookingImpl = void 0;
10
- var _BaseModule = require("../../modules/BaseModule");
10
+ var _BaseSales = require("../BaseSales");
11
11
  var _types = require("./types");
12
12
  Object.keys(_types).forEach(function (key) {
13
13
  if (key === "default" || key === "__esModule") return;
@@ -53,7 +53,7 @@ function cloneCustomDepositData(customDepositData) {
53
53
  deposit_policy_data: Array.isArray(customDepositData.deposit_policy_data) ? [...customDepositData.deposit_policy_data] : []
54
54
  };
55
55
  }
56
- class VenueBookingImpl extends _BaseModule.BaseModule {
56
+ class VenueBookingImpl extends _BaseSales.BaseSalesImpl {
57
57
  defaultName = 'venueBooking';
58
58
  defaultVersion = '1.0.0';
59
59
  isSolution = true;
@@ -220,6 +220,64 @@ class VenueBookingImpl extends _BaseModule.BaseModule {
220
220
  constructor(name, version) {
221
221
  super(name, version);
222
222
  }
223
+ getRegisteredModuleNames() {
224
+ return ['scanOrderLogger', 'products', 'order', 'salesSummary', 'venueProducts', 'addonProducts', 'date', 'schedule', 'quotation', 'openData'];
225
+ }
226
+ createSubModule(moduleName) {
227
+ switch (moduleName) {
228
+ case 'scanOrderLogger':
229
+ return (0, _types2.createModule)('scanOrderLogger', this.name);
230
+ case 'venueProducts':
231
+ return new _ProductList.ProductList(`${this.name}_venueProducts`);
232
+ case 'addonProducts':
233
+ return new _ProductList.ProductList(`${this.name}_addonProducts`);
234
+ case 'date':
235
+ return new _Date.DateModule(`${this.name}_date`);
236
+ case 'openData':
237
+ return new _OpenData.OpenDataModule(`${this.name}_openData`);
238
+ default:
239
+ return super.createSubModule(moduleName);
240
+ }
241
+ }
242
+ attachProductOriginToTempOrder(tempOrder, productUid, origin) {
243
+ if (!productUid || !origin) return;
244
+ tempOrder._extend = {
245
+ ...(tempOrder._extend || {}),
246
+ productsByUid: {
247
+ ...(tempOrder._extend?.productsByUid || {}),
248
+ [productUid]: {
249
+ ...(tempOrder._extend?.productsByUid?.[productUid] || {}),
250
+ origin
251
+ }
252
+ }
253
+ };
254
+ }
255
+ readProductOriginFromTempOrder(tempOrder, product) {
256
+ const uid = product.metadata?.unique_identification_number || product.identity_key;
257
+ if (uid && tempOrder._extend?.productsByUid?.[uid]?.origin) {
258
+ return tempOrder._extend.productsByUid[uid].origin;
259
+ }
260
+ return product._origin;
261
+ }
262
+ normalizeVenueProductTitle(value) {
263
+ if (typeof value === 'string') {
264
+ const text = value.trim();
265
+ return text ? {
266
+ auto: text
267
+ } : undefined;
268
+ }
269
+ if (!value || typeof value !== 'object' || Array.isArray(value)) return undefined;
270
+ const source = value;
271
+ const normalized = {};
272
+ Object.entries(source).forEach(([key, text]) => {
273
+ if (typeof text === 'string') normalized[key] = text;
274
+ });
275
+ if (!normalized.auto) {
276
+ const fallback = normalized.original || normalized.en || normalized['zh-CN'] || normalized['zh-HK'];
277
+ if (fallback) normalized.auto = fallback;
278
+ }
279
+ return Object.values(normalized).some(text => String(text || '').trim()) ? normalized : undefined;
280
+ }
223
281
  normalizeCustomerId(value) {
224
282
  const customerId = Number(value);
225
283
  if (!Number.isFinite(customerId) || customerId <= 0) return null;
@@ -350,8 +408,6 @@ class VenueBookingImpl extends _BaseModule.BaseModule {
350
408
  }
351
409
  async initialize(core, options = {}) {
352
410
  this.logMethodStart('initialize');
353
- this.core = core;
354
- this.initializeOptions = options || {};
355
411
  this.store = {
356
412
  ...this.store,
357
413
  ...options.store
@@ -379,17 +435,17 @@ class VenueBookingImpl extends _BaseModule.BaseModule {
379
435
  passed: null,
380
436
  failures: []
381
437
  };
382
- this.window = core.getPlugin('window');
383
- this.request = core.getPlugin('request');
384
- if (!this.window) {
385
- this.logMethodError('initialize', 'window plugin missing');
386
- throw new Error('venueBooking解决方案需要 window 插件支持');
387
- }
388
- if (!this.request) {
389
- this.logMethodError('initialize', 'request plugin missing');
390
- throw new Error('venueBooking解决方案需要 request 插件支持');
438
+ await super.initialize(core, options);
439
+ if (this.store.scanOrderLogger) {
440
+ this.store.scanOrderLogger.setProvider(this.otherParams?.loggerProvider || 'feishu');
441
+ this.store.scanOrderLogger.setProviderConfig(this.otherParams?.loggerConfig || {
442
+ feishu: {
443
+ webhook: 'https://open.feishu.cn/open-apis/bot/v2/hook/8f069b14-9d39-4728-8f78-b56f393bfde8',
444
+ errorHook: 'https://open.feishu.cn/open-apis/bot/v2/hook/bdefae5e-f233-4705-8688-946887d9543d'
445
+ }
446
+ });
447
+ this.store.scanOrderLogger.setContext(this.getLoggerContext());
391
448
  }
392
-
393
449
  // 注册基础模块(order, salesSummary, products, logger)
394
450
  const baseModules = ['scanOrderLogger', 'products', 'order', 'salesSummary'];
395
451
  baseModules.forEach(step => {
@@ -401,10 +457,10 @@ class VenueBookingImpl extends _BaseModule.BaseModule {
401
457
  } : {};
402
458
  const loggerProvider = this.otherParams?.loggerProvider || 'feishu';
403
459
  const loggerConfig = this.otherParams?.loggerConfig || {
404
- feishu: {
405
- webhook: 'https://open.feishu.cn/open-apis/bot/v2/hook/8f069b14-9d39-4728-8f78-b56f393bfde8',
406
- errorHook: 'https://open.feishu.cn/open-apis/bot/v2/hook/bdefae5e-f233-4705-8688-946887d9543d'
407
- }
460
+ // feishu: {
461
+ // webhook: 'https://open.feishu.cn/open-apis/bot/v2/hook/8f069b14-9d39-4728-8f78-b56f393bfde8',
462
+ // errorHook: 'https://open.feishu.cn/open-apis/bot/v2/hook/bdefae5e-f233-4705-8688-946887d9543d',
463
+ // },
408
464
  };
409
465
  this.core.registerModule(targetModule, {
410
466
  initialState,
@@ -510,9 +566,6 @@ class VenueBookingImpl extends _BaseModule.BaseModule {
510
566
  cacheId: this.otherParams?.cacheId
511
567
  }
512
568
  });
513
- if (this.store.scanOrderLogger) {
514
- this.store.scanOrderLogger.setContext(this.getLoggerContext());
515
- }
516
569
  this.registerCustomerLoginListeners();
517
570
  try {
518
571
  await this.store.order?.recalculateSummary({
@@ -1130,6 +1183,7 @@ class VenueBookingImpl extends _BaseModule.BaseModule {
1130
1183
  const endMoment = (0, _dayjs.default)(group.endTime, 'YYYY-MM-DD HH:mm');
1131
1184
  const duration = endMoment.diff(startMoment, 'minute');
1132
1185
  const customDepositData = cloneCustomDepositData(venueProduct?.custom_deposit_data);
1186
+ const productTitle = this.normalizeVenueProductTitle(venueProduct?.product_title) || this.normalizeVenueProductTitle(venueProduct?.title) || this.normalizeVenueProductTitle(mapping.productTitle);
1133
1187
  const resourceEntry = {
1134
1188
  relation_type: 'form',
1135
1189
  like_status: 'common',
@@ -1155,7 +1209,45 @@ class VenueBookingImpl extends _BaseModule.BaseModule {
1155
1209
  metadata: {}
1156
1210
  }));
1157
1211
  }
1158
- tempOrder.products.push((0, _utils.normalizeOrderProduct)({
1212
+ const venueProductOrigin = {
1213
+ name: mapping.productTitle,
1214
+ product_title: productTitle,
1215
+ cover: venueProduct?.cover || '',
1216
+ custom_deposit_data: customDepositData,
1217
+ id: 0,
1218
+ number: 1,
1219
+ registration_type: 'all',
1220
+ relation_products: [],
1221
+ is_all: false,
1222
+ product: {
1223
+ product_id: mapping.productId,
1224
+ product_variant_id: 0,
1225
+ num: 1,
1226
+ product_bundle: [],
1227
+ product_sku: {
1228
+ option: []
1229
+ },
1230
+ discount_list: [],
1231
+ custom_deposit_data: customDepositData,
1232
+ metadata: {}
1233
+ },
1234
+ sub_type: 'minutes',
1235
+ duration,
1236
+ like_status: 'common',
1237
+ resources: [resourceEntry],
1238
+ schedule_id: 0,
1239
+ select_date: startMoment.format('YYYY-MM-DD'),
1240
+ start_date: startMoment.format('YYYY-MM-DD'),
1241
+ start_time: startMoment.format('HH:mm'),
1242
+ end_date: endMoment.format('YYYY-MM-DD'),
1243
+ end_time: endMoment.format('HH:mm'),
1244
+ metadata: {
1245
+ venue_booking: true,
1246
+ slot_count: group.slotCount
1247
+ },
1248
+ holder: null
1249
+ };
1250
+ const normalizedVenueOrderProduct = (0, _utils.normalizeOrderProduct)({
1159
1251
  product_id: mapping.productId,
1160
1252
  product_variant_id: 0,
1161
1253
  identity_key: identityKey,
@@ -1165,6 +1257,9 @@ class VenueBookingImpl extends _BaseModule.BaseModule {
1165
1257
  is_charge_tax: venueProduct?.is_charge_tax ?? 0,
1166
1258
  metadata: {
1167
1259
  venue_booking: true,
1260
+ ...(productTitle ? {
1261
+ product_title: productTitle
1262
+ } : {}),
1168
1263
  resource_id: resourceId,
1169
1264
  resource_form_id: mapping.formId,
1170
1265
  resource_name: mapping.resourceName,
@@ -1174,48 +1269,18 @@ class VenueBookingImpl extends _BaseModule.BaseModule {
1174
1269
  booking_uid: bookingUuid,
1175
1270
  price_breakdown: (0, _slotMerge.buildPriceBreakdown)({
1176
1271
  group,
1177
- productId: mapping.productId
1272
+ productId: mapping.productId,
1273
+ quotation: this.store.quotation
1178
1274
  })
1179
1275
  },
1180
- _origin: {
1181
- name: mapping.productTitle,
1182
- cover: venueProduct?.cover || '',
1183
- custom_deposit_data: customDepositData,
1184
- id: 0,
1185
- number: 1,
1186
- registration_type: 'all',
1187
- relation_products: [],
1188
- is_all: false,
1189
- product: {
1190
- product_id: mapping.productId,
1191
- product_variant_id: 0,
1192
- num: 1,
1193
- product_bundle: [],
1194
- product_option_item: [],
1195
- discount_list: [],
1196
- custom_deposit_data: customDepositData,
1197
- metadata: {},
1198
- holder_config: venueProduct?.holder_config,
1199
- bookingUuid: bookingUuid,
1200
- shop_id: venueProduct?.shop_id || 0
1201
- },
1202
- sub_type: 'minutes',
1203
- duration,
1204
- like_status: 'common',
1205
- resources: [resourceEntry],
1206
- schedule_id: 0,
1207
- select_date: startMoment.format('YYYY-MM-DD'),
1208
- start_date: startMoment.format('YYYY-MM-DD'),
1209
- start_time: startMoment.format('HH:mm'),
1210
- end_date: endMoment.format('YYYY-MM-DD'),
1211
- end_time: endMoment.format('HH:mm'),
1212
- metadata: {
1213
- venue_booking: true,
1214
- slot_count: group.slotCount
1215
- },
1216
- holder: null
1217
- }
1218
- }));
1276
+ _origin: venueProductOrigin
1277
+ });
1278
+ const venueOrderProduct = productTitle ? {
1279
+ ...normalizedVenueOrderProduct,
1280
+ product_title: productTitle
1281
+ } : normalizedVenueOrderProduct;
1282
+ this.attachProductOriginToTempOrder(tempOrder, identityKey, venueProductOrigin);
1283
+ tempOrder.products.push(venueOrderProduct);
1219
1284
  const booking = (0, _slotMerge.buildVenueBookingEntry)({
1220
1285
  group,
1221
1286
  resourceId,
@@ -1294,15 +1359,15 @@ class VenueBookingImpl extends _BaseModule.BaseModule {
1294
1359
  const result = this.store.order?.getTempOrder() || null;
1295
1360
  return result;
1296
1361
  }
1297
- updateTempOrderNote(note) {
1362
+ updateTempOrderNote(note, sync = false) {
1298
1363
  if (!this.store.order) throw new Error('order 模块未初始化');
1299
- return this.store.order.updateTempOrderNote(note);
1364
+ return this.store.order.updateTempOrderNote(note, sync);
1300
1365
  }
1301
1366
  updateTempOrderContactsInfo(contactsInfo) {
1302
1367
  if (!this.store.order) throw new Error('order 模块未初始化');
1303
1368
  return this.store.order.updateTempOrderContactsInfo(contactsInfo);
1304
1369
  }
1305
- ensureTempOrder() {
1370
+ ensureVenueTempOrder() {
1306
1371
  if (!this.store.order) throw new Error('order 模块未初始化');
1307
1372
  return this.store.order.ensureTempOrder();
1308
1373
  }
@@ -1462,7 +1527,8 @@ class VenueBookingImpl extends _BaseModule.BaseModule {
1462
1527
  // 目的:避免 unselect 后 selling_price 残留、reselect 时把残留价带进下一轮 Rules 造成双折扣。
1463
1528
  // 手动改价商品(_origin.isManualDiscount=true)不参与券流程归一化,保留手工价。
1464
1529
  for (const product of tempOrder.products) {
1465
- if (product._origin?.isManualDiscount) continue;
1530
+ const origin = this.readProductOriginFromTempOrder(tempOrder, product);
1531
+ if (origin?.isManualDiscount) continue;
1466
1532
 
1467
1533
  // 1. 把 product.discount_list 和当前选中的 discount 对齐(剔除已取消的券)
1468
1534
  product.discount_list = (product.discount_list || []).filter(pd => {
@@ -1473,7 +1539,7 @@ class VenueBookingImpl extends _BaseModule.BaseModule {
1473
1539
  // 2. 以 source_product_price 为券作用基准:券作用于 source(不含 option),
1474
1540
  // 再把 option 加回得到含 option 的 main_product_selling_price,最后合成 composite。
1475
1541
  const totalPerUnitDiscount = (product.discount_list || []).reduce((sum, pd) => sum + (pd.amount || 0), 0);
1476
- const optionSum = (0, _utils3.sumOptionUnitPrice)(product.product_option_item);
1542
+ const optionSum = (0, _utils3.sumOptionUnitPrice)((0, _utils3.getProductSkuOptions)(product));
1477
1543
  const sourcePrice = product.metadata?.source_product_price ?? (product.metadata?.main_product_original_price != null ? new _decimal.default(Number(product.metadata.main_product_original_price) || 0).minus(optionSum).toFixed(2) : product.original_price ?? '0');
1478
1544
  const newSourceSellingPrice = new _decimal.default(Number(sourcePrice) || 0).minus(totalPerUnitDiscount).toDecimalPlaces(2).toString();
1479
1545
  const newMainSellingPrice = new _decimal.default(Number(newSourceSellingPrice) || 0).plus(optionSum).toDecimalPlaces(2).toFixed(2);
@@ -1520,13 +1586,14 @@ class VenueBookingImpl extends _BaseModule.BaseModule {
1520
1586
  }
1521
1587
  getOrderProducts() {
1522
1588
  if (!this.store.order) throw new Error('order 模块未初始化');
1523
- return this.store.order.getOrderProducts();
1589
+ const products = this.store.order.getOrderProducts();
1590
+ return products;
1524
1591
  }
1525
1592
  async getSummary() {
1526
1593
  this.logMethodStart('getSummary');
1527
1594
  try {
1528
1595
  if (!this.store.order) throw new Error('order 模块未初始化');
1529
- const summary = await this.store.order.getScanOrderSummary();
1596
+ const summary = await this.store.order.getOrderSummary();
1530
1597
  this.logMethodSuccess('getSummary', {
1531
1598
  totalAmount: summary.total_amount
1532
1599
  });
@@ -1616,22 +1683,22 @@ class VenueBookingImpl extends _BaseModule.BaseModule {
1616
1683
  throw error;
1617
1684
  }
1618
1685
  }
1619
- async updateProductInOrder(params) {
1620
- this.logMethodStart('updateProductInOrder', {
1686
+ async updateOrderProduct(params) {
1687
+ this.logMethodStart('updateOrderProduct', {
1621
1688
  product_id: params.product_id,
1622
1689
  product_variant_id: params.product_variant_id
1623
1690
  });
1624
1691
  try {
1625
1692
  if (!this.store.order) throw new Error('order 模块未初始化');
1626
- const products = await this.store.order.updateProductInOrder(params);
1693
+ const products = await this.store.order.updateOrderProduct(params);
1627
1694
  await this.refreshItemRuleQuantityLimits();
1628
1695
  await this.refreshCartValidationPassed();
1629
- this.logMethodSuccess('updateProductInOrder', {
1696
+ this.logMethodSuccess('updateOrderProduct', {
1630
1697
  productCount: products.length
1631
1698
  });
1632
1699
  return products;
1633
1700
  } catch (error) {
1634
- this.logMethodError('updateProductInOrder', error);
1701
+ this.logMethodError('updateOrderProduct', error);
1635
1702
  throw error;
1636
1703
  }
1637
1704
  }
@@ -1810,7 +1877,7 @@ class VenueBookingImpl extends _BaseModule.BaseModule {
1810
1877
  return [];
1811
1878
  }
1812
1879
  const businessData = (0, _utils.buildItemRuleBusinessData)({
1813
- tempOrder: this.ensureTempOrder(),
1880
+ tempOrder: this.ensureVenueTempOrder(),
1814
1881
  runtimeConfig: this.getItemRuleRuntimeConfig(),
1815
1882
  itemRuleConfigs: this.itemRuleConfigs
1816
1883
  });
@@ -1832,7 +1899,7 @@ class VenueBookingImpl extends _BaseModule.BaseModule {
1832
1899
  const strategyConfigs = await this.ensureItemRuleConfigsLoaded();
1833
1900
  if (!strategyConfigs.length) return;
1834
1901
  const businessData = (0, _utils.buildItemRuleBusinessData)({
1835
- tempOrder: this.ensureTempOrder(),
1902
+ tempOrder: this.ensureVenueTempOrder(),
1836
1903
  runtimeConfig: this.getItemRuleRuntimeConfig(),
1837
1904
  itemRuleConfigs: this.itemRuleConfigs
1838
1905
  });
@@ -1842,7 +1909,7 @@ class VenueBookingImpl extends _BaseModule.BaseModule {
1842
1909
  return;
1843
1910
  }
1844
1911
  const productSourceMap = await this.buildPrefillProductSourceMap();
1845
- const tempOrder = this.ensureTempOrder();
1912
+ const tempOrder = this.ensureVenueTempOrder();
1846
1913
  let hasChanges = false;
1847
1914
  for (const prefillItem of prefillItems) {
1848
1915
  const productId = Number(prefillItem.product_id);
@@ -1857,7 +1924,12 @@ class VenueBookingImpl extends _BaseModule.BaseModule {
1857
1924
  });
1858
1925
  if (productIndex === -1) {
1859
1926
  const sellingPrice = (0, _utils.toPriceString)(sourceItem?.price ?? sourceItem?.selling_price, '0.00');
1860
- tempOrder.products.push((0, _utils.normalizeOrderProduct)({
1927
+ const origin = {
1928
+ ...(sourceItem || {}),
1929
+ item_rule_prefill: true,
1930
+ item_rule_id: prefillItem.ruleId
1931
+ };
1932
+ const product = (0, _utils.normalizeOrderProduct)({
1861
1933
  product_id: productId,
1862
1934
  product_variant_id: productVariantId,
1863
1935
  num: targetQuantity,
@@ -1867,16 +1939,20 @@ class VenueBookingImpl extends _BaseModule.BaseModule {
1867
1939
  item_rule_prefill: true,
1868
1940
  item_rule_id: prefillItem.ruleId
1869
1941
  },
1870
- _origin: {
1871
- ...(sourceItem || {}),
1872
- item_rule_prefill: true,
1873
- item_rule_id: prefillItem.ruleId
1874
- }
1875
- }));
1942
+ _origin: origin
1943
+ });
1944
+ const productUid = String(product.metadata?.unique_identification_number || '');
1945
+ this.attachProductOriginToTempOrder(tempOrder, productUid, origin);
1946
+ tempOrder.products.push(product);
1876
1947
  hasChanges = true;
1877
1948
  continue;
1878
1949
  }
1879
1950
  const targetProduct = tempOrder.products[productIndex];
1951
+ const previousOrigin = this.readProductOriginFromTempOrder(tempOrder, targetProduct);
1952
+ const nextOrigin = sourceItem ? {
1953
+ ...(previousOrigin || {}),
1954
+ ...sourceItem
1955
+ } : previousOrigin;
1880
1956
  const existedQuantity = (0, _utils.toNonNegativeInt)(targetProduct.num);
1881
1957
  const delta = targetQuantity - existedQuantity;
1882
1958
  const nextProduct = {
@@ -1888,13 +1964,11 @@ class VenueBookingImpl extends _BaseModule.BaseModule {
1888
1964
  ...(targetProduct.metadata || {}),
1889
1965
  item_rule_prefill: true,
1890
1966
  item_rule_id: prefillItem.ruleId
1891
- },
1892
- _origin: sourceItem ? {
1893
- ...(targetProduct._origin || {}),
1894
- ...sourceItem
1895
- } : targetProduct._origin
1967
+ }
1896
1968
  };
1897
- if (delta > 0 || Boolean(sourceItem && (!targetProduct._origin || targetProduct._origin?.price !== sourceItem?.price))) {
1969
+ if (delta > 0 || Boolean(sourceItem && (!previousOrigin || previousOrigin?.price !== sourceItem?.price))) {
1970
+ const productUid = String(nextProduct.metadata?.unique_identification_number || '');
1971
+ this.attachProductOriginToTempOrder(tempOrder, productUid, nextOrigin);
1898
1972
  tempOrder.products[productIndex] = nextProduct;
1899
1973
  hasChanges = true;
1900
1974
  }
@@ -1927,7 +2001,7 @@ class VenueBookingImpl extends _BaseModule.BaseModule {
1927
2001
  failures: []
1928
2002
  };
1929
2003
  const businessData = (0, _utils.buildItemRuleBusinessData)({
1930
- tempOrder: this.ensureTempOrder(),
2004
+ tempOrder: this.ensureVenueTempOrder(),
1931
2005
  runtimeConfig: this.getItemRuleRuntimeConfig(),
1932
2006
  itemRuleConfigs: this.itemRuleConfigs
1933
2007
  });
@@ -2057,11 +2131,12 @@ class VenueBookingImpl extends _BaseModule.BaseModule {
2057
2131
  booking.holder = holder;
2058
2132
  }
2059
2133
  for (const product of tempOrder.products) {
2060
- const productBookingUid = product.metadata?.booking_uid ?? product._origin?.product?.bookingUuid;
2134
+ const runtimeProduct = product;
2135
+ const productBookingUid = runtimeProduct.metadata?.booking_uid ?? runtimeProduct._origin?.product?.bookingUuid;
2061
2136
  if (String(productBookingUid) !== String(bookingUid)) continue;
2062
- const origin = product._origin && typeof product._origin === 'object' ? product._origin : {};
2137
+ const origin = runtimeProduct._origin && typeof runtimeProduct._origin === 'object' ? runtimeProduct._origin : {};
2063
2138
  origin.holder = holder;
2064
- product._origin = origin;
2139
+ runtimeProduct._origin = origin;
2065
2140
  }
2066
2141
  this.store.order.notifyTempOrderChanged();
2067
2142
  }
@@ -71,8 +71,6 @@
71
71
  "num__comment": "数量;int;↕;必填。统一使用 num,不再使用 product_quantity。",
72
72
  "product_variant_id": 0,
73
73
  "product_variant_id__comment": "多规格 ID;int;↕;可选。",
74
- "product_option_item": [],
75
- "product_option_item__comment": "选项配置;array;↕;可选。",
76
74
  "selling_price": "50.00",
77
75
  "selling_price__comment": "销售单价(交易快照);string;←;服务端返回,不能依赖基准数据回填。",
78
76
  "original_price": "60.00",
@@ -11,7 +11,7 @@ export declare enum VenueBookingHooks {
11
11
  /** 登录客户的智能定价、营销配置与订单汇总已完成刷新 */
12
12
  onSmartPricingUpdated = "venueBooking:onSmartPricingUpdated"
13
13
  }
14
- export type VenueBookingStatus = 'idle' | 'initializing' | 'ready' | 'error';
14
+ export declare type VenueBookingStatus = 'idle' | 'initializing' | 'ready' | 'error';
15
15
  export interface VenueBookingEntryContext {
16
16
  biz: string;
17
17
  venueId?: string;
@@ -5,6 +5,12 @@ export declare function mergeConsecutiveSlots(slots: VenueSlotSelection[]): Merg
5
5
  export declare function buildPriceBreakdown(params: {
6
6
  group: MergedSlotGroup;
7
7
  productId: number;
8
+ quotation?: {
9
+ getQuotationShelfId: (p: {
10
+ productId: number;
11
+ datetime: string;
12
+ }) => number;
13
+ };
8
14
  }): PriceBreakdownEntry[];
9
15
  export interface BuildVenueBookingParams {
10
16
  group: MergedSlotGroup;
@@ -55,16 +55,22 @@ function mergeConsecutiveSlots(slots) {
55
55
  }
56
56
  function buildPriceBreakdown(params) {
57
57
  const {
58
- group
58
+ group,
59
+ productId,
60
+ quotation
59
61
  } = params;
60
62
  if (!group.slots.length) return [];
61
63
  const entries = [];
62
64
  for (const slot of group.slots) {
63
65
  const unitPrice = Number(slot.price || '0');
66
+ const shelfId = quotation ? quotation.getQuotationShelfId({
67
+ productId,
68
+ datetime: slot.startTime
69
+ }) : 0;
64
70
  const startHm = (0, _dayjs.default)(slot.startTime, 'YYYY-MM-DD HH:mm').format('YYYY-MM-DD HH:mm');
65
71
  const endHm = (0, _dayjs.default)(slot.endTime, 'YYYY-MM-DD HH:mm').format('YYYY-MM-DD HH:mm');
66
72
  const last = entries[entries.length - 1];
67
- if (last && last.unit_price === unitPrice && last.quotation_shelf_id === 0 && last.end_time === startHm) {
73
+ if (last && last.unit_price === unitPrice && last.quotation_shelf_id === shelfId && last.end_time === startHm) {
68
74
  last.end_time = endHm;
69
75
  last.quantity += 1;
70
76
  } else {
@@ -72,7 +78,7 @@ function buildPriceBreakdown(params) {
72
78
  start_time: startHm,
73
79
  end_time: endHm,
74
80
  unit_price: unitPrice,
75
- quotation_shelf_id: 0,
81
+ quotation_shelf_id: shelfId,
76
82
  quantity: 1
77
83
  });
78
84
  }
@@ -6,4 +6,6 @@ export * from './RegisterAndLogin';
6
6
  export * from './Checkout';
7
7
  export * from './Sales';
8
8
  export * from './ScanOrder';
9
+ export * from './BaseSales';
9
10
  export * from './VenueBooking';
11
+ export * from './UnifiedBookingSales';
@@ -91,6 +91,17 @@ Object.keys(_ScanOrder).forEach(function (key) {
91
91
  }
92
92
  });
93
93
  });
94
+ var _BaseSales = require("./BaseSales");
95
+ Object.keys(_BaseSales).forEach(function (key) {
96
+ if (key === "default" || key === "__esModule") return;
97
+ if (key in exports && exports[key] === _BaseSales[key]) return;
98
+ Object.defineProperty(exports, key, {
99
+ enumerable: true,
100
+ get: function () {
101
+ return _BaseSales[key];
102
+ }
103
+ });
104
+ });
94
105
  var _VenueBooking = require("./VenueBooking");
95
106
  Object.keys(_VenueBooking).forEach(function (key) {
96
107
  if (key === "default" || key === "__esModule") return;
@@ -101,4 +112,15 @@ Object.keys(_VenueBooking).forEach(function (key) {
101
112
  return _VenueBooking[key];
102
113
  }
103
114
  });
115
+ });
116
+ var _UnifiedBookingSales = require("./UnifiedBookingSales");
117
+ Object.keys(_UnifiedBookingSales).forEach(function (key) {
118
+ if (key === "default" || key === "__esModule") return;
119
+ if (key in exports && exports[key] === _UnifiedBookingSales[key]) return;
120
+ Object.defineProperty(exports, key, {
121
+ enumerable: true,
122
+ get: function () {
123
+ return _UnifiedBookingSales[key];
124
+ }
125
+ });
104
126
  });
@@ -15,6 +15,16 @@ export interface Module {
15
15
  name: string;
16
16
  version: string;
17
17
  initialize: (core: PisellCore, options: ModuleOptions) => Promise<void> | void;
18
+ /**
19
+ * 父级解决方案运行时更新 otherParams 后,显式通知子模块刷新自己的运行态参数。
20
+ *
21
+ * @example
22
+ * await module.updateOtherParams?.({ channel: 'pos' }, { changedParams: { channel: 'pos' } });
23
+ */
24
+ updateOtherParams?: (params: Record<string, any>, meta?: {
25
+ changedParams?: Record<string, any>;
26
+ cover?: boolean;
27
+ }) => Promise<void> | void;
18
28
  destroy?: () => Promise<void> | void;
19
29
  exports?: Record<string, any>;
20
30
  isSolution?: boolean;
@@ -28,7 +38,7 @@ export interface ModuleOptions {
28
38
  initialState?: Record<string, any>;
29
39
  otherParams?: Record<string, any>;
30
40
  }
31
- export type EventHandler = (data?: any) => void;
41
+ export declare type EventHandler = (data?: any) => void;
32
42
  export interface PisellCore {
33
43
  registerPlugin: (plugin: Plugin, options?: PluginOptions) => void;
34
44
  getPlugin: <T extends Plugin>(name: string) => T | null;
@@ -39,7 +49,7 @@ export interface PisellCore {
39
49
  getModuleExports: <T = any>(name: string) => T | null;
40
50
  hasModule: (name: string) => boolean;
41
51
  effects: {
42
- on: (event: string, callback: (payload: any) => void, force?: boolean) => void;
52
+ on: (event: string, callback: (payload: any) => void) => () => void;
43
53
  once: (event: string, callback: (payload: any) => void, force?: boolean) => void;
44
54
  only: (event: string, callback: (payload: any) => void) => () => void;
45
55
  off: (event: string, callback: (payload: any) => void) => void;
@@ -1,5 +1,5 @@
1
- type Action = (...args: any[]) => Promise<any>;
2
- type Task = {
1
+ declare type Action = (...args: any[]) => Promise<any>;
2
+ declare type Task = {
3
3
  uuid: string;
4
4
  type: string;
5
5
  actionParams?: Record<string, any>;
@@ -2,8 +2,8 @@
2
2
  * 监听模块
3
3
  *
4
4
  */
5
- export type WatchEventCallback = (...args: any[]) => void;
6
- export type WatchEventItem = {
5
+ export declare type WatchEventCallback = (...args: any[]) => void;
6
+ export declare type WatchEventItem = {
7
7
  key: string;
8
8
  callback: WatchEventCallback;
9
9
  };