@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
@@ -31,15 +31,20 @@ export interface ScanOrderOrderProductIdentity {
31
31
  product_id: number | null;
32
32
  product_variant_id: number;
33
33
  identity_key?: string;
34
+ unique_identification_number?: string;
34
35
  /** 参与合并/匹配;与 remove 通配语义见 isSkuOnlyDeleteIdentity */
35
- product_option_item?: any[];
36
+ product_sku?: ScanOrderProductSku;
36
37
  product_bundle?: any[];
37
38
  shop_id?: number | string;
38
39
  }
40
+ export interface ScanOrderProductSku {
41
+ option: any[];
42
+ [key: string]: any;
43
+ }
39
44
  export interface ScanOrderOrderProduct extends ScanOrderOrderProductIdentity {
40
45
  order_detail_id: number | null;
41
46
  num: number;
42
- product_option_item: any[];
47
+ product_sku: ScanOrderProductSku;
43
48
  /**
44
49
  * 券后 **行 composite 单价** = `metadata.main_product_selling_price`
45
50
  * + Σ((bundle.bundle_selling_price ?? bundle.price) × (bundle.num ?? 1))
@@ -61,6 +66,8 @@ export interface ScanOrderOrderProduct extends ScanOrderOrderProductIdentity {
61
66
  is_charge_tax: number;
62
67
  discount_list: any[];
63
68
  product_bundle: any[];
69
+ /** 关联 booking.metadata.unique_identification_number */
70
+ booking_uid?: string;
64
71
  /**
65
72
  * 行级扩展 metadata。价格相关的权威字段:
66
73
  *
@@ -76,19 +83,19 @@ export interface ScanOrderOrderProduct extends ScanOrderOrderProductIdentity {
76
83
  metadata: Record<string, any>;
77
84
  /** 商品行备注(如顾客对单品的特殊要求) */
78
85
  note?: string;
86
+ /** @deprecated UI/SDK 运行态数据迁移到 tempOrder._extend */
79
87
  _origin?: Record<string, any>;
80
88
  }
81
89
  /**
82
90
  * 出站 payload 版本的商品行。
83
91
  *
84
92
  * 与 tempOrder 内部 `ScanOrderOrderProduct` 的字段差异:
85
- * - `product_option_item[*]`:内部为 `{ product_option_item_id, option_group_id, num, price, ... }`,
86
- * 出站由 `normalizeSubmitProduct` 重命名为 `{ option_group_item_id, option_group_id, num }`
87
- * (后端 checkout 协议;丢弃 `price` 等运行时辅助字段)。
93
+ * - `product_sku.option[*]`:内部直接维护统一 Sales 协议字段;
94
+ * 提交时仅规范 `add_price`,保留传入/恢复得到的展示字段。
88
95
  * - `product_bundle[*].option[*]`:同上重命名规则。
89
96
  *
90
- * 运行时(UI 显示、加购合并、指纹、持久化)全部消费内部字段名 `product_option_item_id`,
91
- * 仅在 SDK 提交边界做一次出站映射,不影响 opaque identity 契约。
97
+ * 运行时(UI 显示、加购合并、指纹、持久化)与提交边界统一消费字段名
98
+ * `option_group_item_id`,保持 tempOrder 与后端协议一致。
92
99
  */
93
100
  export interface ScanOrderSubmitProduct extends Omit<ScanOrderOrderProduct, '_origin' | 'identity_key'> {
94
101
  /**
@@ -109,6 +116,7 @@ export interface ScanOrderSummary {
109
116
  shipping_tax_fee: string;
110
117
  tax_fee: string;
111
118
  surcharge_fee: string;
119
+ surcharges: any[];
112
120
  discount_amount: string;
113
121
  deposit_amount: string;
114
122
  deposit?: {
@@ -118,6 +126,9 @@ export interface ScanOrderSummary {
118
126
  };
119
127
  expect_amount: string;
120
128
  total_amount: string;
129
+ total_refund_amount: string;
130
+ customer_paid_amount: string;
131
+ order_paid_amount: string;
121
132
  amount_gap: string;
122
133
  rounding_amount: string;
123
134
  pay_service_charge_amount: string;
@@ -130,11 +141,15 @@ export interface ScanOrderSummary {
130
141
  */
131
142
  export interface ScanOrderTempOrder {
132
143
  order_id: number | null;
144
+ /** @deprecated 资源运行态迁移到 ScanOrder store;仅旧缓存兼容 */
133
145
  relation_id?: string;
146
+ /** @deprecated 资源运行态迁移到 ScanOrder store;仅旧缓存兼容 */
134
147
  table_form_id?: string;
148
+ /** @deprecated 资源运行态迁移到 ScanOrder store;仅旧缓存兼容 */
135
149
  resource_id?: string;
136
150
  order_number: string;
137
151
  shop_order_number: string;
152
+ shop_full_order_number: string;
138
153
  type: string;
139
154
  business_code: string;
140
155
  platform: string;
@@ -164,6 +179,7 @@ export interface ScanOrderTempOrder {
164
179
  table_number?: Record<string, any>;
165
180
  schedule_date: string;
166
181
  created_at: string;
182
+ request_unique_idempotency_token?: string;
167
183
  products: ScanOrderOrderProduct[];
168
184
  bookings: any[];
169
185
  payments: any[];
@@ -171,14 +187,20 @@ export interface ScanOrderTempOrder {
171
187
  discount_list: any[];
172
188
  relation_forms: any[];
173
189
  contacts: any[];
174
- contacts_info: any[];
190
+ contacts_info: Record<string, any> | null;
175
191
  holder: Record<string, any> | null;
176
- summary: ScanOrderSummary;
177
192
  metadata: Record<string, any>;
193
+ _extend?: {
194
+ productsByUid?: Record<string, Record<string, any>>;
195
+ [key: string]: any;
196
+ };
197
+ /** @deprecated summary 是 OrderState 派生状态,不属于可提交 tempOrder */
198
+ summary?: ScanOrderSummary;
199
+ /** @deprecated lastOrderInfo 迁移到 OrderState 同层级 */
178
200
  lastOrderInfo?: Record<string, any>;
179
201
  }
180
- export interface ScanOrderSubmitPayload extends Omit<ScanOrderTempOrder, 'platform' | 'products' | 'created_at' | 'summary' | 'surcharges'> {
181
- platform: 'H5' | 'PC';
202
+ export interface ScanOrderSubmitPayload extends Omit<ScanOrderTempOrder, 'platform' | 'products' | 'summary' | 'surcharges'> {
203
+ platform: string;
182
204
  request_unique_idempotency_token?: string;
183
205
  form_record_ids?: Array<{
184
206
  form_id: number | string;
@@ -14,13 +14,12 @@ export var ScanOrderHooks = /*#__PURE__*/function (ScanOrderHooks) {
14
14
  * 出站 payload 版本的商品行。
15
15
  *
16
16
  * 与 tempOrder 内部 `ScanOrderOrderProduct` 的字段差异:
17
- * - `product_option_item[*]`:内部为 `{ product_option_item_id, option_group_id, num, price, ... }`,
18
- * 出站由 `normalizeSubmitProduct` 重命名为 `{ option_group_item_id, option_group_id, num }`
19
- * (后端 checkout 协议;丢弃 `price` 等运行时辅助字段)。
17
+ * - `product_sku.option[*]`:内部直接维护统一 Sales 协议字段;
18
+ * 提交时仅规范 `add_price`,保留传入/恢复得到的展示字段。
20
19
  * - `product_bundle[*].option[*]`:同上重命名规则。
21
20
  *
22
- * 运行时(UI 显示、加购合并、指纹、持久化)全部消费内部字段名 `product_option_item_id`,
23
- * 仅在 SDK 提交边界做一次出站映射,不影响 opaque identity 契约。
21
+ * 运行时(UI 显示、加购合并、指纹、持久化)与提交边界统一消费字段名
22
+ * `option_group_item_id`,保持 tempOrder 与后端协议一致。
24
23
  */
25
24
 
26
25
  /**
@@ -2,6 +2,7 @@ import { ScanOrderOrderProduct, ScanOrderOrderProductIdentity, ScanOrderResource
2
2
  import type { CartItemSummary, ItemRuleBusinessData, PaxInfo, QuantityLimitResult } from '../../model/strategy/adapter/itemRule';
3
3
  import type { StrategyConfig } from '../../model/strategy/type';
4
4
  import type { ProductData } from '../../modules/Product/types';
5
+ import type { OrderSubmitProduct } from '../../modules/Order/types';
5
6
  /**
6
7
  * 构建金额全为 0 的空 summary。
7
8
  * 作为尚未计算金额时的兜底默认值,避免下游因 undefined 报错。
@@ -42,6 +43,8 @@ export declare function toNonNegativeNumber(value: unknown): number;
42
43
  export declare function toNonNegativeInt(value: unknown): number;
43
44
  export declare function toPriceString(value: unknown, fallback?: string): string;
44
45
  export declare function buildProductKey(productId: number, productVariantId: number): string;
46
+ /** 加餐接口只提交本次新增商品,过滤掉首单预约占位规则行。 */
47
+ export declare function filterProductsForScanOrderMore<T extends OrderSubmitProduct>(products?: T[]): T[];
45
48
  export declare function getTopLevelProductId(product: Record<string, any>): number | null;
46
49
  export declare function getTopLevelVariantId(product: Record<string, any>): number | null;
47
50
  export declare function buildQuantityLimitIndex(limits: QuantityLimitResult[]): {
@@ -88,7 +91,7 @@ export declare function attachItemRuleLimitsToTopLevelProducts<T>(productList: T
88
91
  export declare function buildProductLineFingerprint(productOptionItem?: unknown, productBundle?: unknown): string;
89
92
  /**
90
93
  * removeProductFromOrder 仅传 SKU 时的通配 identity(对象上未声明选项键)。
91
- * 与显式 `product_option_item: []` 区分:后者只匹配「无选项」行。
94
+ * 与显式 `product_sku: { option: [] }` 区分:后者只匹配「无选项」行。
92
95
  */
93
96
  export declare function isSkuOnlyDeleteIdentity(x: ScanOrderOrderProductIdentity): boolean;
94
97
  /**
@@ -13,7 +13,8 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
13
13
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
14
14
  import dayjs from 'dayjs';
15
15
  import Decimal from 'decimal.js';
16
- import { composeLinePrice, createUuidV4, sumOptionUnitPrice } from "../../modules/Order/utils";
16
+ import { composeLinePrice, createUuidV4, ensureProductSku, getBundleSellingMagnitude, getProductSkuOptions, normalizeProductSkuOptions, resolveManualOverrideLineOriginalPrice, sumOptionUnitPrice } from "../../modules/Order/utils";
17
+ import { ensureManualProductDiscountList } from "../../modules/Order/utils/manualProductDiscount";
17
18
 
18
19
  /**
19
20
  * 构建金额全为 0 的空 summary。
@@ -30,10 +31,14 @@ export function createEmptySummary() {
30
31
  shipping_tax_fee: '0.00',
31
32
  tax_fee: '0.00',
32
33
  surcharge_fee: '0.00',
34
+ surcharges: [],
33
35
  discount_amount: '0.00',
34
36
  deposit_amount: '0.00',
35
37
  expect_amount: '0.00',
36
38
  total_amount: '0.00',
39
+ total_refund_amount: '0.00',
40
+ customer_paid_amount: '0.00',
41
+ order_paid_amount: '0.00',
37
42
  amount_gap: '0.00',
38
43
  rounding_amount: '0.00',
39
44
  pay_service_charge_amount: '0.00'
@@ -149,6 +154,15 @@ export function toPriceString(value) {
149
154
  export function buildProductKey(productId, productVariantId) {
150
155
  return "".concat(productId, "_").concat(productVariantId);
151
156
  }
157
+
158
+ /** 加餐接口只提交本次新增商品,过滤掉首单预约占位规则行。 */
159
+ export function filterProductsForScanOrderMore() {
160
+ var products = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
161
+ return products.filter(function (product) {
162
+ var _product$metadata;
163
+ return ((_product$metadata = product.metadata) === null || _product$metadata === void 0 ? void 0 : _product$metadata.is_rule) !== true;
164
+ });
165
+ }
152
166
  export function getTopLevelProductId(product) {
153
167
  var _product$product_id;
154
168
  var rawProductId = (_product$product_id = product.product_id) !== null && _product$product_id !== void 0 ? _product$product_id : product.id;
@@ -376,16 +390,16 @@ export function attachItemRuleLimitsToTopLevelProducts(productList, limits) {
376
390
  export function buildProductLineFingerprint(productOptionItem, productBundle) {
377
391
  var optArr = Array.isArray(productOptionItem) ? productOptionItem : [];
378
392
  var normalizedOpts = optArr.map(function (item) {
379
- var _item$price;
393
+ var _ref, _item$add_price;
380
394
  return {
381
- product_option_item_id: Number(item === null || item === void 0 ? void 0 : item.product_option_item_id) || 0,
395
+ option_group_item_id: Number(item === null || item === void 0 ? void 0 : item.option_group_item_id) || 0,
382
396
  option_group_id: Number(item === null || item === void 0 ? void 0 : item.option_group_id) || 0,
383
397
  num: typeof (item === null || item === void 0 ? void 0 : item.num) === 'number' && !Number.isNaN(item.num) ? Math.max(1, Math.floor(item.num)) : 1,
384
- price: String((_item$price = item === null || item === void 0 ? void 0 : item.price) !== null && _item$price !== void 0 ? _item$price : '')
398
+ price: String((_ref = (_item$add_price = item === null || item === void 0 ? void 0 : item.add_price) !== null && _item$add_price !== void 0 ? _item$add_price : item === null || item === void 0 ? void 0 : item.price) !== null && _ref !== void 0 ? _ref : '')
385
399
  };
386
400
  }).sort(function (p, q) {
387
- if (p.product_option_item_id !== q.product_option_item_id) {
388
- return p.product_option_item_id - q.product_option_item_id;
401
+ if (p.option_group_item_id !== q.option_group_item_id) {
402
+ return p.option_group_item_id - q.option_group_item_id;
389
403
  }
390
404
  if (p.option_group_id !== q.option_group_id) return p.option_group_id - q.option_group_id;
391
405
  if (p.num !== q.num) return p.num - q.num;
@@ -393,9 +407,9 @@ export function buildProductLineFingerprint(productOptionItem, productBundle) {
393
407
  });
394
408
  var bundleArr = Array.isArray(productBundle) ? productBundle : [];
395
409
  var normalizedBundles = bundleArr.map(function (item) {
396
- var _ref, _item$bundle_id;
410
+ var _ref2, _item$bundle_id;
397
411
  return {
398
- bundle_id: Number((_ref = (_item$bundle_id = item === null || item === void 0 ? void 0 : item.bundle_id) !== null && _item$bundle_id !== void 0 ? _item$bundle_id : item === null || item === void 0 ? void 0 : item.id) !== null && _ref !== void 0 ? _ref : 0) || 0,
412
+ bundle_id: Number((_ref2 = (_item$bundle_id = item === null || item === void 0 ? void 0 : item.bundle_id) !== null && _item$bundle_id !== void 0 ? _item$bundle_id : item === null || item === void 0 ? void 0 : item.id) !== null && _ref2 !== void 0 ? _ref2 : 0) || 0,
399
413
  product_id: Number(item === null || item === void 0 ? void 0 : item.product_id) || 0,
400
414
  num: typeof (item === null || item === void 0 ? void 0 : item.num) === 'number' && !Number.isNaN(item.num) ? Math.max(1, Math.floor(item.num)) : 1
401
415
  };
@@ -409,15 +423,15 @@ export function buildProductLineFingerprint(productOptionItem, productBundle) {
409
423
 
410
424
  /**
411
425
  * removeProductFromOrder 仅传 SKU 时的通配 identity(对象上未声明选项键)。
412
- * 与显式 `product_option_item: []` 区分:后者只匹配「无选项」行。
426
+ * 与显式 `product_sku: { option: [] }` 区分:后者只匹配「无选项」行。
413
427
  */
414
428
  export function isSkuOnlyDeleteIdentity(x) {
415
- if (x.identity_key) return false;
416
- return !('product_option_item' in x) && !('product_bundle' in x);
429
+ if (x.unique_identification_number || x.identity_key) return false;
430
+ return !('product_sku' in x) && !('product_bundle' in x);
417
431
  }
418
432
  function fingerprintForIdentityWithOptionKeys(x) {
419
433
  var row = x;
420
- var opts = 'product_option_item' in row ? Array.isArray(row.product_option_item) ? row.product_option_item : [] : [];
434
+ var opts = 'product_sku' in row ? getProductSkuOptions(row) : [];
421
435
  var buds = 'product_bundle' in row ? Array.isArray(row.product_bundle) ? row.product_bundle : [] : [];
422
436
  return buildProductLineFingerprint(opts, buds);
423
437
  }
@@ -433,10 +447,13 @@ function fingerprintForIdentityWithOptionKeys(x) {
433
447
  * 忽略线侧 identity_key,按内容语义匹配。这给「行已 opaque、调用方却想按 SKU 通配 / 选项指纹删除」留兼容入口。
434
448
  */
435
449
  export function isIdentityMatch(a, b) {
450
+ var _ref3, _metadata$unique_iden, _metadata2, _ref4, _metadata$unique_iden2, _metadata3;
436
451
  if (a.product_id !== b.product_id || a.product_variant_id !== b.product_variant_id) return false;
437
- var aHasKey = typeof a.identity_key === 'string' && a.identity_key.length > 0;
438
- var bHasKey = typeof b.identity_key === 'string' && b.identity_key.length > 0;
439
- if (aHasKey && bHasKey) return a.identity_key === b.identity_key;
452
+ var aUid = (_ref3 = (_metadata$unique_iden = (_metadata2 = a.metadata) === null || _metadata2 === void 0 ? void 0 : _metadata2.unique_identification_number) !== null && _metadata$unique_iden !== void 0 ? _metadata$unique_iden : a.unique_identification_number) !== null && _ref3 !== void 0 ? _ref3 : a.identity_key;
453
+ var bUid = (_ref4 = (_metadata$unique_iden2 = (_metadata3 = b.metadata) === null || _metadata3 === void 0 ? void 0 : _metadata3.unique_identification_number) !== null && _metadata$unique_iden2 !== void 0 ? _metadata$unique_iden2 : b.unique_identification_number) !== null && _ref4 !== void 0 ? _ref4 : b.identity_key;
454
+ var aHasKey = typeof aUid === 'string' && aUid.length > 0;
455
+ var bHasKey = typeof bUid === 'string' && bUid.length > 0;
456
+ if (aHasKey && bHasKey) return aUid === bUid;
440
457
  if (isSkuOnlyDeleteIdentity(a) || isSkuOnlyDeleteIdentity(b)) return true;
441
458
  return fingerprintForIdentityWithOptionKeys(a) === fingerprintForIdentityWithOptionKeys(b);
442
459
  }
@@ -474,23 +491,67 @@ export function getProductIdentityIndex(products, identity) {
474
491
  * - 因此多次 normalize 不会重复叠加 option/bundle。
475
492
  */
476
493
  export function normalizeOrderProduct(product) {
477
- var _metadata$origin, _variantList$find, _product$is_charge_ta;
494
+ var _product$metadata2, _metadata$origin, _product$product_sku, _metadata$origin2, _variantList$find, _product$is_charge_ta;
478
495
  var metadata = _objectSpread({}, product.metadata || {});
479
496
  // 不透明 identity 契约:每条订单行必须带 identity_key。
480
497
  // 调用方未传时由 SDK 自动生成 UUID,后续 update/remove 只做严格比对,避免猜测合成 key。
481
- var resolvedIdentityKey = product.identity_key && String(product.identity_key).length > 0 ? String(product.identity_key) : createUuidV4();
482
- if (!metadata.unique_identification_number) {
483
- metadata.unique_identification_number = resolvedIdentityKey;
498
+ var resolvedIdentityKey = (_product$metadata2 = product.metadata) !== null && _product$metadata2 !== void 0 && _product$metadata2.unique_identification_number ? String(product.metadata.unique_identification_number) : product.unique_identification_number && String(product.unique_identification_number).length > 0 ? String(product.unique_identification_number) : product.identity_key && String(product.identity_key).length > 0 ? String(product.identity_key) : createUuidV4();
499
+ metadata.unique_identification_number = resolvedIdentityKey;
500
+ var priceOverride = metadata.price_override;
501
+ var originOtherBundle = (_metadata$origin = metadata.origin) === null || _metadata$origin === void 0 || (_metadata$origin = _metadata$origin._extend) === null || _metadata$origin === void 0 || (_metadata$origin = _metadata$origin.other) === null || _metadata$origin === void 0 ? void 0 : _metadata$origin.bundle;
502
+ var bundleInput = product.product_bundle || [];
503
+ if (priceOverride !== undefined && priceOverride !== null && priceOverride !== '' && Array.isArray(originOtherBundle) && originOtherBundle.length > 0) {
504
+ var priceById = new Map();
505
+ originOtherBundle.forEach(function (item) {
506
+ var _item$price;
507
+ if ((item === null || item === void 0 ? void 0 : item.id) == null) return;
508
+ var unit = (_item$price = item.price) !== null && _item$price !== void 0 ? _item$price : item.bundle_selling_price;
509
+ if (unit === undefined || unit === null) return;
510
+ priceById.set(String(item.id), String(unit));
511
+ });
512
+ var base = Array.isArray(bundleInput) && bundleInput.length > 0 ? bundleInput : originOtherBundle;
513
+ bundleInput = base.map(function (item) {
514
+ var unit = priceById.get(String(item === null || item === void 0 ? void 0 : item.id));
515
+ if (unit === undefined) return item;
516
+ return _objectSpread(_objectSpread({}, item), {}, {
517
+ price: unit,
518
+ bundle_selling_price: unit
519
+ });
520
+ });
484
521
  }
485
- var normalizedBundle = (product.product_bundle || []).map(function (item) {
486
- var _ref2, _item$bundle_selling_;
487
- return _objectSpread(_objectSpread({}, item), {}, {
488
- bundle_selling_price: (_ref2 = (_item$bundle_selling_ = item.bundle_selling_price) !== null && _item$bundle_selling_ !== void 0 ? _item$bundle_selling_ : item.price) !== null && _ref2 !== void 0 ? _ref2 : '0.00'
489
- // custom_price: item.custom_price ?? item.bundle_selling_price ?? item.price ?? '0.00',
522
+ var normalizedBundle = bundleInput.map(function (item) {
523
+ var _item$price2, _item$bundle_id2, _item$bundle_product_, _item$bundle_group_id, _ref5, _ref6, _item$price3, _ref7, _item$price_type, _ref8, _item$price_type_ext;
524
+ var magnitudeSource = _objectSpread(_objectSpread({}, item), {}, {
525
+ // 计算 markdown 净额时,只把真实毛价交给 helper;若只有 bundle_selling_price,
526
+ // helper 会按历史净额兜底,避免 option 二次扣减。
527
+ price: (_item$price2 = item.price) !== null && _item$price2 !== void 0 ? _item$price2 : item.custom_price
528
+ });
529
+ var normalizedItem = _objectSpread(_objectSpread({}, item), {}, {
530
+ bundle_id: (_item$bundle_id2 = item.bundle_id) !== null && _item$bundle_id2 !== void 0 ? _item$bundle_id2 : item.id,
531
+ bundle_product_id: (_item$bundle_product_ = item.bundle_product_id) !== null && _item$bundle_product_ !== void 0 ? _item$bundle_product_ : item._bundle_product_id,
532
+ bundle_group_id: (_item$bundle_group_id = item.bundle_group_id) !== null && _item$bundle_group_id !== void 0 ? _item$bundle_group_id : item.group_id,
533
+ // price 保留毛价(markdown 仍为 5),由 price_type 决定符号。
534
+ price: (_ref5 = (_ref6 = (_item$price3 = item.price) !== null && _item$price3 !== void 0 ? _item$price3 : item.custom_price) !== null && _ref6 !== void 0 ? _ref6 : item.bundle_selling_price) !== null && _ref5 !== void 0 ? _ref5 : '0.00',
535
+ price_type: (_ref7 = (_item$price_type = item.price_type) !== null && _item$price_type !== void 0 ? _item$price_type : item.custom_price_type) !== null && _ref7 !== void 0 ? _ref7 : '',
536
+ price_type_ext: (_ref8 = (_item$price_type_ext = item.price_type_ext) !== null && _item$price_type_ext !== void 0 ? _item$price_type_ext : item.custom_price_type_ext) !== null && _ref8 !== void 0 ? _ref8 : ''
490
537
  });
538
+ // bundle_selling_price 落「正净额」:markdown = |price| − Σoptions;markup/原价维持原值。
539
+ normalizedItem.bundle_selling_price = getBundleSellingMagnitude(magnitudeSource).toFixed(2);
540
+ if (normalizedItem.price_type === 'markdown' && (normalizedItem.price_type_ext === '' || normalizedItem.price_type_ext === undefined || normalizedItem.price_type_ext === null)) {
541
+ var _normalizedItem$custo;
542
+ normalizedItem.custom_price = (_normalizedItem$custo = normalizedItem.custom_price) !== null && _normalizedItem$custo !== void 0 ? _normalizedItem$custo : normalizedItem.price;
543
+ normalizedItem.price = normalizedItem.bundle_selling_price;
544
+ }
545
+ if ((normalizedItem.price_type === 'markdown' || normalizedItem.price_type === 'markup') && (normalizedItem.price_type_ext === '' || normalizedItem.price_type_ext === undefined || normalizedItem.price_type_ext === null)) {
546
+ delete normalizedItem.original_total;
547
+ }
548
+ return normalizedItem;
491
549
  });
492
- var normalizedOptions = product.product_option_item || [];
550
+ var normalizedOptions = normalizeProductSkuOptions((_product$product_sku = product.product_sku) === null || _product$product_sku === void 0 ? void 0 : _product$product_sku.option);
493
551
  var optionSum = sumOptionUnitPrice(normalizedOptions);
552
+ var productSku = _objectSpread(_objectSpread({}, ensureProductSku(product)), {}, {
553
+ option: normalizedOptions
554
+ });
494
555
 
495
556
  // 1) 解析 source_product_price。
496
557
  // 优先级:
@@ -502,11 +563,11 @@ export function normalizeOrderProduct(product) {
502
563
  // 6) 入参 selling_price(最末兜底,新添加路径 caller 只给 selling_price)
503
564
  var isV2 = metadata.price_schema_version === 2 || metadata.price_schema_version === '2';
504
565
  var variantId = Number(product.product_variant_id || 0);
505
- var variantList = variantId ? metadata === null || metadata === void 0 || (_metadata$origin = metadata.origin) === null || _metadata$origin === void 0 ? void 0 : _metadata$origin.variant : null;
566
+ var variantList = variantId ? metadata === null || metadata === void 0 || (_metadata$origin2 = metadata.origin) === null || _metadata$origin2 === void 0 ? void 0 : _metadata$origin2.variant : null;
506
567
  var variantPrice = Array.isArray(variantList) ? (_variantList$find = variantList.find(function (v) {
507
568
  return Number(v === null || v === void 0 ? void 0 : v.id) === variantId;
508
569
  })) === null || _variantList$find === void 0 ? void 0 : _variantList$find.price : undefined;
509
- var resolvedSource = function (_product$_origin, _product$_origin2, _ref3, _product$original_pri) {
570
+ var resolvedSource = function (_product$_origin, _product$_origin2, _ref9, _product$original_pri) {
510
571
  if (metadata.source_product_price !== undefined) {
511
572
  return String(metadata.source_product_price);
512
573
  }
@@ -524,7 +585,7 @@ export function normalizeOrderProduct(product) {
524
585
  if (!isV2 && metadata.main_product_original_price !== undefined) {
525
586
  return String(metadata.main_product_original_price);
526
587
  }
527
- return (_ref3 = (_product$original_pri = product.original_price) !== null && _product$original_pri !== void 0 ? _product$original_pri : product.selling_price) !== null && _ref3 !== void 0 ? _ref3 : '0.00';
588
+ return (_ref9 = (_product$original_pri = product.original_price) !== null && _product$original_pri !== void 0 ? _product$original_pri : product.selling_price) !== null && _ref9 !== void 0 ? _ref9 : '0.00';
528
589
  }();
529
590
 
530
591
  // 2) 派生 main_product_original_price(含 option、不含折扣)
@@ -572,22 +633,36 @@ export function normalizeOrderProduct(product) {
572
633
  bundle: normalizedBundle,
573
634
  useOriginalBundle: true
574
635
  });
636
+ var finalOriginalPrice = resolveManualOverrideLineOriginalPrice({
637
+ num: product.num,
638
+ metadata: metadata,
639
+ lineOriginalPrice: product.original_price
640
+ }, composedOriginalPrice);
641
+ var hasManualProductDiscount = (product.discount_list || []).some(function (item) {
642
+ return (item === null || item === void 0 ? void 0 : item.type) === 'product';
643
+ });
644
+ var manualOriginalPrice = hasManualProductDiscount && product.original_price != null ? String(product.original_price) : finalOriginalPrice;
645
+ var discountList = ensureManualProductDiscountList({
646
+ discountList: product.discount_list,
647
+ metadata: metadata,
648
+ originalPrice: manualOriginalPrice,
649
+ sellingPrice: composedSellingPrice,
650
+ quantity: getSafeProductNum(product.num)
651
+ });
575
652
  return {
576
653
  order_detail_id: product.order_detail_id || null,
577
654
  product_id: product.product_id,
578
655
  num: getSafeProductNum(product.num),
579
656
  product_variant_id: product.product_variant_id,
580
- identity_key: resolvedIdentityKey,
581
- product_option_item: normalizedOptions,
657
+ product_sku: productSku,
582
658
  selling_price: composedSellingPrice,
583
- original_price: composedOriginalPrice,
659
+ original_price: manualOriginalPrice,
584
660
  tax_fee: product.tax_fee || '0.00',
585
661
  is_charge_tax: (_product$is_charge_ta = product.is_charge_tax) !== null && _product$is_charge_ta !== void 0 ? _product$is_charge_ta : 0,
586
- discount_list: product.discount_list || [],
662
+ discount_list: discountList,
587
663
  product_bundle: normalizedBundle,
588
664
  metadata: metadata,
589
- note: product.note != null ? String(product.note) : '',
590
- _origin: product._origin
665
+ note: product.note != null ? String(product.note) : ''
591
666
  };
592
667
  }
593
668
 
@@ -529,7 +529,7 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
529
529
  this.setDiscountList(newDiscountList || []);
530
530
  this.store.originalDiscountList = newDiscountList || [];
531
531
  this.setProductList(newProductList || []);
532
- if (!(this.isWalkIn() && resultDiscountList.length && ((_this$options$otherPa6 = this.options.otherParams) === null || _this$options$otherPa6 === void 0 ? void 0 : _this$options$otherPa6.platform) === 'shop')) {
532
+ if (!(this.isWalkIn() && resultDiscountList.length && ((_this$options$otherPa6 = this.options.otherParams) === null || _this$options$otherPa6 === void 0 ? void 0 : _this$options$otherPa6.platform) === 'shop' && !((resultDiscountList[0].customer_id || 1) === 1))) {
533
533
  _context6.next = 25;
534
534
  break;
535
535
  }
@@ -795,7 +795,7 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
795
795
  key: "loadPrepareConfig",
796
796
  value: function () {
797
797
  var _loadPrepareConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(params) {
798
- var _this$getCustomer2, _this$store$discount8, _this$getDiscountList, _this$store$discount9, _this$store$productLi2, orderId, customerId, prepareConfig, goodPassList, scanDiscount, scanDiscountIds, newGoodPassList, newDiscountList, filteredDiscountList, _result3;
798
+ var _this$getCustomer2, _this$store$discount8, _this$getDiscountList, _this$store$discount9, _this$store$productLi2, orderId, customerId, prepareConfigResult, goodPassList, scanDiscount, scanDiscountIds, newGoodPassList, newDiscountList, filteredDiscountList, _result3;
799
799
  return _regeneratorRuntime().wrap(function _callee10$(_context10) {
800
800
  while (1) switch (_context10.prev = _context10.next) {
801
801
  case 0:
@@ -816,8 +816,8 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
816
816
  order_id: orderId
817
817
  } : {}));
818
818
  case 5:
819
- prepareConfig = _context10.sent;
820
- goodPassList = (prepareConfig === null || prepareConfig === void 0 ? void 0 : prepareConfig.discountList) || [];
819
+ prepareConfigResult = _context10.sent;
820
+ goodPassList = (prepareConfigResult === null || prepareConfigResult === void 0 ? void 0 : prepareConfigResult.discountList) || [];
821
821
  scanDiscount = (_this$getDiscountList = this.getDiscountList()) === null || _this$getDiscountList === void 0 ? void 0 : _this$getDiscountList.filter(function (item) {
822
822
  return item.isScan;
823
823
  }); // goodPassList 里可能有 scanDiscount 重合的部分,goodPassList 需要剔除
@@ -0,0 +1,183 @@
1
+ import type { Module } from '../../types';
2
+ import type { ProductData } from '../../modules';
3
+ import type { OpenDataConfig } from '../../modules/OpenData';
4
+ import type { LoadScheduleAvailableDateParams, ScheduleItem } from '../../modules/Schedule/types';
5
+ import type { ProductListLoadProductsParams } from '../../modules/ProductList';
6
+ import type { ResourcePlannerAssignment, ResourcePlannerAssignableSlotResult, ResourcePlannerEvent, ResourcePlannerProduct, ResourcePlannerProjection, ResourcePlannerQuery, ResourcePlannerResource, ResourcePlannerSelectionPatch, ResourcePlannerSnapshot, ResourcePlannerValidationResult } from '../../modules/ResourcePlanner';
7
+ import type { UnifiedBookingSalesCommitPlannerSelectionParams, UnifiedBookingSalesCommitResult, UnifiedBookingSalesAddRetailProductParams, UnifiedBookingSalesApplyPlannerDiscountsParams, UnifiedBookingSalesDiscountResult, UnifiedBookingSalesLoadProductsByScheduleDateParams, UnifiedBookingSalesLoadPlannerContextParams, UnifiedBookingSalesLoadOpenDataParams, UnifiedBookingSalesStagePlannerProductsParams, UnifiedBookingSalesStageRetailProductsParams, UnifiedBookingSalesState } from './types';
8
+ import { BookingTicket } from '../BookingTicket';
9
+ export * from './types';
10
+ /**
11
+ * Converts Rules/Order discount internals into a small UI-facing diagnostic. The result keeps
12
+ * candidate-card state separate from line-level applications: a selected card is not proof that
13
+ * it actually discounted a planner product.
14
+ */
15
+ export declare function buildPlannerDiscountResult(params: {
16
+ customerId: number | null;
17
+ discountList: Record<string, any>[];
18
+ products: Record<string, any>[];
19
+ summaryBefore?: unknown;
20
+ summaryAfter?: unknown;
21
+ status: UnifiedBookingSalesDiscountResult['status'];
22
+ preferredDiscountId?: number | string;
23
+ preferredDiscountFound?: boolean;
24
+ }): UnifiedBookingSalesDiscountResult;
25
+ /** Converts a ProductList record into the pure input shape consumed by ResourcePlanner. */
26
+ export declare function normalizeProductForPlanner(product: ProductData | Record<string, any>): ResourcePlannerProduct;
27
+ /**
28
+ * Materializes resource work windows locally from v2's schedule ids, then keeps its flat
29
+ * event_list as planner events. This deliberately avoids the older API's times -> event_list
30
+ * response nesting and lets one resource response serve any requested date range.
31
+ */
32
+ export declare function buildPlannerResourcesFromV2(params: {
33
+ rawResources: Record<string, any>[];
34
+ scheduleList: ScheduleItem[];
35
+ dateRange?: ResourcePlannerQuery['dateRange'];
36
+ }): {
37
+ resources: ResourcePlannerResource[];
38
+ externalEvents: ResourcePlannerEvent[];
39
+ };
40
+ /** Combines URL-locked resources with every resource referenced by the selected products. */
41
+ export declare function collectPlannerResourceIds(products: ResourcePlannerProduct[], explicitResourceIds?: Array<number | string>): Array<number | string>;
42
+ /** Convenience wrapper for the usual one-resource booking case. */
43
+ export declare function buildBookingFromAssignment(params: {
44
+ assignment: ResourcePlannerAssignment;
45
+ product: ResourcePlannerProduct;
46
+ }): Record<string, any>;
47
+ /**
48
+ * Converts all resources needed by one product/time interval into the one booking expected by
49
+ * OrderModule. Callers must group assignments before this function so a multi-form booking does
50
+ * not become several competing bookings.
51
+ */
52
+ export declare function buildBookingFromAssignments(params: {
53
+ assignments: ResourcePlannerAssignment[];
54
+ product: ResourcePlannerProduct;
55
+ }): Record<string, any>;
56
+ /** Builds the exact identity BaseSales needs to remove only this solution's order lines. */
57
+ export declare function buildPlannerLineIdentity(product: Record<string, any>): Record<string, any>;
58
+ export declare class UnifiedBookingSalesImpl extends BookingTicket {
59
+ protected defaultName: string;
60
+ protected defaultVersion: string;
61
+ protected store: UnifiedBookingSalesState;
62
+ private unifiedProductCatalog;
63
+ private openDataTarget;
64
+ private loadOpenDataInFlight;
65
+ private loadOpenDataInFlightTarget;
66
+ /**
67
+ * Kiosk 不能把已收款订单留在本地等待重试:默认直接等待云端 checkout。
68
+ * 兼容仍需要 WebPOS 待同步模式的入口可显式传 checkoutSyncTaskEnabled: true。
69
+ */
70
+ protected shouldUseCheckoutSyncTask(): boolean;
71
+ /** UnifiedBookingSales 的真实结账默认请求收据数据,供云端确认后再本地打印。 */
72
+ protected getDefaultCheckoutSmallTicketDataFlag(): number;
73
+ protected getRegisteredModuleNames(): readonly string[];
74
+ protected createSubModule(moduleName: string): Module | null;
75
+ /**
76
+ * Loads OpenData without borrowing BookingTicket. Cache ownership is tied to the exact
77
+ * business/channel target so a reused solution instance cannot leak another entry's menus.
78
+ */
79
+ loadOpenData(params: UnifiedBookingSalesLoadOpenDataParams): Promise<OpenDataConfig>;
80
+ getOpenData(): Promise<OpenDataConfig | null>;
81
+ /**
82
+ * Loads the product catalog used by both UI and Planner. Schedule data is requested with each
83
+ * product because session products carry their fixed intervals there.
84
+ */
85
+ loadProducts(params?: ProductListLoadProductsParams, options?: {
86
+ callback?: (result: any) => void;
87
+ subscriberId?: string;
88
+ }): Promise<ProductData[]>;
89
+ /** Date-first entry point. It delegates protocol details and cache ownership to ScheduleModule. */
90
+ loadScheduleAvailableDate(params: LoadScheduleAvailableDateParams): Promise<import("../../modules/Date/types").ITime[]>;
91
+ /**
92
+ * Implements the date-first product pool: the chosen date's product ids plus globally sellable
93
+ * other_product_ids. If a batch product query is unexpectedly empty, retry one id at a time so
94
+ * a partial backend incompatibility does not hide the entire date's catalog.
95
+ */
96
+ loadProductsByScheduleDate(params: UnifiedBookingSalesLoadProductsByScheduleDateParams): Promise<ProductData[]>;
97
+ /** Returns a copy so UI consumers cannot accidentally mutate the solution's product cache. */
98
+ getProductCatalog(): {
99
+ products: ProductData[];
100
+ };
101
+ /**
102
+ * Read-only compatibility view for salesSdk skins. It reconnects a booking to its product but
103
+ * must not be used to mutate tempOrder; all writes go through BaseSales / planner APIs.
104
+ */
105
+ getCart(): {
106
+ items: any[];
107
+ bookings: any[];
108
+ };
109
+ /**
110
+ * Loads the current customer's product coupons and discount cards after planner lines exist,
111
+ * then optionally lets the existing Rules engine select the best valid combination. This is a
112
+ * diagnostic boundary for new booking skins: no pricing logic is duplicated in the planner.
113
+ */
114
+ applyPlannerDiscounts(params?: UnifiedBookingSalesApplyPlannerDiscountsParams): Promise<UnifiedBookingSalesDiscountResult>;
115
+ /** ResourcePlanner is a required child module; fail early instead of producing partial availability. */
116
+ private getPlanner;
117
+ private buildUnifiedOrderProduct;
118
+ /** Replacing a staged selection is idempotent and never removes unrelated cart lines. */
119
+ private removeExistingStagedLines;
120
+ private stageProducts;
121
+ /**
122
+ * Adds the current product choice to an otherwise clean planner cart without creating bookings.
123
+ * This separates "what the customer wants" from the later time/resource confirmation step.
124
+ */
125
+ stagePlannerProducts(params: UnifiedBookingSalesStagePlannerProductsParams): Promise<Record<string, any> | null>;
126
+ /**
127
+ * Adds ordinary retail products without asking ResourcePlanner for booking facts.
128
+ * Its staged lines have separate ownership so planner and retail skins can coexist safely.
129
+ */
130
+ stageRetailProducts(params: UnifiedBookingSalesStageRetailProductsParams): Promise<Record<string, any> | null>;
131
+ /**
132
+ * Adds one retail line without replacing the cart's existing retail selection.
133
+ * This is intentionally separate from stageRetailProducts(), whose contract is
134
+ * "replace the staged selection" for demo and wizard-like callers.
135
+ */
136
+ addRetailProduct(params: UnifiedBookingSalesAddRetailProductParams): Promise<Record<string, any>[]>;
137
+ /** Normalizes caller-provided products or loads the catalog before any resource request is made. */
138
+ private loadPlannerProducts;
139
+ /** Loads the reusable store-level schedule catalog on demand. */
140
+ private ensurePlannerSchedulesLoaded;
141
+ /**
142
+ * v2 resources reference schedule ids rather than expanded work times. Refresh once when the
143
+ * cached schedule catalog cannot materialize all referenced ids.
144
+ */
145
+ private ensurePlannerSchedulesForResources;
146
+ /**
147
+ * Fetches resource metadata plus flat occupied events. Work windows are intentionally derived
148
+ * locally in buildPlannerResourcesFromV2 from /schedule, rather than requested from the legacy
149
+ * resource dates endpoint.
150
+ */
151
+ private fetchPlannerResourcesV2;
152
+ /**
153
+ * Resolves the Planner context in precedence order: explicit normalized context, test raw data,
154
+ * then the v2 resource API inferred from selected product requirements and any URL lock.
155
+ */
156
+ private loadPlannerResources;
157
+ /**
158
+ * Boundary between IO and pure planning. Once this returns, all later availability/slot calls
159
+ * operate on the ResourcePlanner snapshot and do not issue resource requests themselves.
160
+ */
161
+ loadPlannerContext(params?: UnifiedBookingSalesLoadPlannerContextParams): Promise<ResourcePlannerSnapshot>;
162
+ /** Returns cells, date summaries and a derived grid; cells are continuous ranges, not UI slots. */
163
+ queryPlannerAvailability(query?: ResourcePlannerQuery): Promise<ResourcePlannerProjection>;
164
+ /** Turns compatible availability ranges into user-selectable intervals and ready-to-commit assignments. */
165
+ resolveAssignableSlots(query?: ResourcePlannerQuery): ResourcePlannerAssignableSlotResult;
166
+ /** Stores a UI choice only. It is deliberately side-effect free with respect to tempOrder. */
167
+ setPlannerSelection(patch: ResourcePlannerSelectionPatch): ResourcePlannerSnapshot;
168
+ /**
169
+ * Legacy-friendly automatic assignment for already fixed intervals. Duration products without a
170
+ * start time intentionally remain unresolved; callers offering a picker should use slots.
171
+ */
172
+ autoAssignPlanner(query?: ResourcePlannerQuery): Promise<ResourcePlannerSnapshot>;
173
+ /** Rechecks remote events, capacity and conflicts among the current selection before committing. */
174
+ validatePlannerSelection(): ResourcePlannerValidationResult;
175
+ /** Read-only snapshot for UI diagnostics and progressive flow steps. */
176
+ getPlannerSnapshot(): ResourcePlannerSnapshot;
177
+ /**
178
+ * Validates then writes assignments to tempOrder. Real order submission is opt-in so UI callers
179
+ * can safely preview the cart; pass submitAfterCommit only after an explicit confirmation.
180
+ */
181
+ commitPlannerSelection(params?: UnifiedBookingSalesCommitPlannerSelectionParams): Promise<UnifiedBookingSalesCommitResult>;
182
+ }
183
+ export declare const UnifiedBookingSales: typeof UnifiedBookingSalesImpl;