@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
@@ -1,9 +1,10 @@
1
1
  import { Module, PisellCore, ModuleOptions } from '../../types';
2
2
  import { BaseModule } from '../BaseModule';
3
- import { OrderModuleAPI, CommitOrderParams, SubmitScanOrderParams, ScanOrderMoreParams, CheckoutOrderParams, UpdateProductInOrderParams } from './types';
3
+ import { OrderModuleAPI, CommitOrderParams, UpdateOrderBookingParams, UpdateOrderProductParams, UpdateOrderProductQuantityParams, CancelOrderParams, ChangeBookingStatusParams, CheckoutOrderParams } from './types';
4
4
  import { CartItem } from '../Cart/types';
5
5
  import { type SubmitPayloadEnhancer } from './utils';
6
- import type { ScanOrderOrderProduct, ScanOrderOrderProductIdentity, ScanOrderSummary, ScanOrderTempOrder } from '../../solution/ScanOrder/types';
6
+ import type { OrderAmountSnapshot, AddProductBookingInput, OrderIdentitySnapshot, OrderPaymentSource, OrderSnapshot, OrderSyncState, SyncPaymentsToOrderParams, SyncPaymentsToOrderResult, SubmitSalesOrderParams, OrderProduct, OrderProductIdentity, OrderSummary, OrderTempOrder, OrderPaymentData, SendCustomerPayLinkParams, UpdateTempOrderCustomerInput, OrderCustomerPatch, OrderCustomerView, ReplaceTempOrderOptions, OrderPromotionEvaluator, OrderGiftSelectResolver, OrderUnfulfilledPromotion, OrderLastGiftActions } from './types';
7
+ import type { ICustomer } from '../AccountList/types';
7
8
  import type { Discount } from '../Discount/types';
8
9
  import { UnavailableReason } from '../Rules/types';
9
10
  export declare class OrderModule extends BaseModule implements Module, OrderModuleAPI {
@@ -16,13 +17,43 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
16
17
  private cacheId;
17
18
  private salesSummaryModuleName;
18
19
  private rulesHooksOverride?;
20
+ private moduleHooksOverride?;
21
+ private orderHooks?;
22
+ private otherParams?;
23
+ /** 评估器引用;由 SalesSdkProvider 注入,未注入时 applyPromotion 静默跳过 */
24
+ private promotionEvaluator;
25
+ /** 赠品选择 resolver;由 SDK host bridge 注入 */
26
+ private giftSelectResolver;
27
+ /** applyPromotion 递归保护 flag(写路径同步调 applyPromotion,禁止重入) */
28
+ private isApplyingPromotion;
29
+ /** 商品曾应用过客户券卡,客户变更剥离后需强制跑一次 calcDiscount 复位价格 */
30
+ private hasActiveCustomerBoundDiscount;
31
+ /** 最近一次 applyPromotion 的未满足促销提示 */
32
+ private lastUnfulfilledPromotions;
33
+ /** 最近一次 applyPromotion 的赠品操作 diff(debug / SDK 读取使用) */
34
+ private lastGiftActions;
35
+ /**
36
+ * 是否将 tempOrder 写入 IndexedDB 草稿(orders store)。
37
+ * BigSale 弹窗等短生命周期场景通过 setEnableTempOrderPersist(false) 关闭。
38
+ */
39
+ private draftPersistEnabled;
40
+ private collectHydratedEditDiscounts;
19
41
  /**
20
42
  * Populate `savedAmount` on each discount based on product-level discount details.
21
43
  * Only selected discounts get a non-zero value.
22
44
  */
23
45
  static populateSavedAmounts(productList: Array<Record<string, any>>, discountList: Array<Record<string, any>>): void;
46
+ private applyProductDiscountPrices;
24
47
  constructor(name?: string, version?: string);
25
48
  initialize(core: PisellCore, options: ModuleOptions): Promise<void>;
49
+ destroy(): Promise<void>;
50
+ /**
51
+ * 更新父级解决方案透传的运行态参数,并同步 Order 内部依赖的派生字段。
52
+ *
53
+ * @example
54
+ * orderModule.updateOtherParams({ cacheId: 'cache-2', channel: 'pos' });
55
+ */
56
+ updateOtherParams(params: Record<string, any>): void;
26
57
  /**
27
58
  * 记录信息日志
28
59
  */
@@ -39,51 +70,404 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
39
70
  private createDefaultRulesHooks;
40
71
  loadDiscountConfig(params: {
41
72
  customerId: number;
42
- action?: 'create';
43
- }): Promise<void>;
73
+ action?: 'create' | 'edit';
74
+ orderId?: number;
75
+ apply?: boolean;
76
+ }): Promise<Discount[]>;
44
77
  getDiscountList(): Discount[];
45
78
  getAvailableWalletIds(): number[];
79
+ private syncScannedDiscountsToOriginalDiscountList;
80
+ private ensureEditDiscountConfigForProductChange;
46
81
  scanCode(code: string, customerId?: number): Promise<{
47
82
  isAvailable: boolean;
48
83
  discountList: Discount[];
49
84
  type: 'server' | 'clientCalc';
50
85
  unavailableReason?: UnavailableReason;
51
86
  unavailableReasonKey?: string | null;
87
+ scannedDiscountList?: Discount[];
52
88
  }>;
53
- applyDiscount(): void;
89
+ applyDiscount(options?: {
90
+ reapplyBookingDiscountProductUids?: string[];
91
+ }): void;
92
+ /**
93
+ * 注入促销评估器。
94
+ *
95
+ * @example
96
+ * order.setPromotionEvaluator(appHelper.utils.promotionEvaluator);
97
+ */
98
+ setPromotionEvaluator(evaluator: OrderPromotionEvaluator | null): void;
99
+ /**
100
+ * 注入赠品选择 resolver。OS 需要补赠品时会 await 调用 resolver;缺省时跳过新增并 console.warn。
101
+ *
102
+ * @example
103
+ * order.setGiftSelectResolver(async (ctx) => {
104
+ * // SDK 内部决定弹窗 or 自动选第一项,返回完整 OrderProduct[]
105
+ * return giftSelectBridge.request(ctx);
106
+ * });
107
+ */
108
+ setGiftSelectResolver(resolver: OrderGiftSelectResolver | null): void;
109
+ /**
110
+ * 为商品目录追加促销标签,供上层 Sales 门面复用。
111
+ *
112
+ * @example
113
+ * const products = order.appendPromotionTags(catalogProducts);
114
+ */
115
+ appendPromotionTags<T extends Record<string, any>>(products: T[]): T[];
116
+ /**
117
+ * 应用购物车促销:计算 → 差异化赠品 → 写回 tempOrder.products → emit onPromotionApplied。
118
+ *
119
+ * 调用时机:写路径(add/update/remove/clear/setCustomer)末尾自动触发;外部一般无需手动调。
120
+ *
121
+ * 关键约束:
122
+ * - 不调用任何公开 CRUD API(如 removeProductFromOrder),全部内部 mutate tempOrder.products,避免事件风暴;
123
+ * - 用 `isApplyingPromotion` 防递归;
124
+ * - 多选项赠品依赖 giftSelectResolver,未注入则跳过且 console.warn;
125
+ * - 不主动调用 applyDiscount / recalculateSummary,调用方负责跟进。
126
+ */
127
+ applyPromotion(): Promise<void>;
128
+ /** 最近一次 applyPromotion 输出的未满足促销列表 */
129
+ getUnfulfilledPromotions(): OrderUnfulfilledPromotion[];
130
+ /** 最近一次 applyPromotion 输出的赠品操作 diff */
131
+ getLastGiftActions(): OrderLastGiftActions | null;
54
132
  initTempOrder(params: {
55
133
  cacheId?: string;
56
134
  salesSummaryModuleName?: string;
57
135
  }): void;
58
- private getTempOrderStorageKey;
59
- private restoreTempOrderFromStorage;
136
+ /**
137
+ * 控制 IndexedDB 草稿(saveDraft)是否写入。
138
+ * localStorage 版 tempOrder 持久化已废弃,此方法仅影响 saveDraft。
139
+ *
140
+ * @example
141
+ * order.setEnableTempOrderPersist(false); // BigSale 弹窗:跳过 ~1s 的 dbUpdate
142
+ */
143
+ setEnableTempOrderPersist(enabled: boolean): void;
144
+ /** 是否允许 saveDraft 写入 IndexedDB 草稿。 */
145
+ isTempOrderPersistEnabled(): boolean;
146
+ /** @deprecated OrderModule 不再负责 tempOrder localStorage 持久化;草稿保存请使用 IndexedDB saveDraft。 */
60
147
  persistTempOrder(): void;
61
148
  notifyTempOrderChanged(): void;
62
149
  private createDefaultTempOrderInstance;
63
- ensureTempOrder(): ScanOrderTempOrder;
64
- restoreOrder(): ScanOrderTempOrder;
65
- getTempOrder(): ScanOrderTempOrder | null;
66
- addNewOrder(): Promise<ScanOrderTempOrder>;
67
- getOrderProducts(): ScanOrderOrderProduct[];
150
+ private createExternalSaleNumber;
151
+ private ensureExternalSaleNumber;
152
+ private ensureRequestUniqueIdempotencyToken;
153
+ private buildPaymentSyncIdempotencyToken;
154
+ saveDraft(): Promise<void>;
155
+ private saveDraftInBackground;
156
+ private hydrateTempOrderFromLocalRecord;
157
+ private extractOrderIdFromSubmitResult;
158
+ private calculatePaymentEffectiveAmount;
159
+ private calculatePaymentTotal;
160
+ private calculateOrderPaidPaymentTotal;
161
+ private getDepositAmount;
162
+ private normalizeDepositAmount;
163
+ private getLastOrderDepositSnapshot;
164
+ private getLastOrderSubmitSnapshot;
165
+ private applyDepositAmountToSummary;
166
+ private applyLastOrderDepositSnapshot;
167
+ private isDepositOrder;
168
+ private getOrderExpectedAmount;
169
+ private isDepositCovered;
170
+ getPaymentCompletion(payments?: OrderPaymentSource[]): {
171
+ isFullyPaid: boolean;
172
+ isOrderFullyPaid: boolean;
173
+ isDepositFullyPaid: boolean;
174
+ paymentStage: 'deposit' | 'normal';
175
+ depositAmount: string;
176
+ orderExpectedAmount: string;
177
+ };
178
+ private calculateDepositPaidAmount;
179
+ private resolveNextOrderPaymentType;
180
+ private normalizePaymentSource;
181
+ private updateTempOrderPaymentStatus;
182
+ private shouldKeepPaymentStatusAfterAmountRecalc;
183
+ private resolveWalletPassUseValue;
184
+ private adjustVoucherFundRecord;
185
+ private capVoucherPaymentsByRemainingAmount;
186
+ private calculatePaidPaymentSummary;
187
+ private calculatePaymentServiceFee;
188
+ private calculatePaymentGapAmount;
189
+ private calculatePaymentOrderAmount;
190
+ private calculatePaymentRoundingAmount;
191
+ private formatSummaryMetadataMoney;
192
+ private syncSummaryProductMetadata;
193
+ private calculateSummaryAmountGap;
194
+ private getSummaryRefundAmount;
195
+ private calculatePaymentTargetAmount;
196
+ private normalizeFingerprintMoney;
197
+ private normalizeFingerprintValue;
198
+ private buildProductFingerprintItem;
199
+ private buildOrderProductsFingerprint;
200
+ private buildProductStructuralFingerprintItem;
201
+ private buildOrderProductsStructuralFingerprint;
202
+ private getManualDepositOverride;
203
+ private setManualDepositOverride;
204
+ private clearManualDepositOverride;
205
+ private getOriginalSalesSnapshot;
206
+ private isSnapshotPayableAmountUnchanged;
207
+ private hasShopDiscountChangedFromSnapshot;
208
+ private restoreOriginalSnapshotIfProductsUnchanged;
209
+ private clearPersistedAmountFieldsForFullRecalc;
210
+ private getPaymentTargetAmount;
211
+ ensureTempOrder(): OrderTempOrder;
212
+ restoreOrder(): OrderTempOrder;
213
+ getTempOrder(): OrderTempOrder | null;
214
+ replaceTempOrder(tempOrder: OrderTempOrder, options?: ReplaceTempOrderOptions): Promise<OrderTempOrder>;
215
+ getOrderIdentity(): OrderIdentitySnapshot | null;
216
+ getOrderSyncState(): OrderSyncState;
217
+ getOrderAmountSnapshot(): OrderAmountSnapshot | null;
218
+ getOrderSnapshot(): OrderSnapshot | null;
219
+ addNewOrder(): Promise<OrderTempOrder>;
220
+ getOrderProducts(): OrderProduct[];
221
+ private getProductUid;
222
+ private sanitizeOrderProductForTempOrder;
223
+ private sanitizeTempOrderProducts;
224
+ private ensureExtend;
225
+ private captureProductRuntime;
226
+ private createLinkedProductAndBooking;
227
+ /**
228
+ * booking.holder 是提交真源;metadata.holder 作为详情/回显冗余字段同步保存。
229
+ *
230
+ * @example
231
+ * this.syncBookingMetadataHolder(booking, metadata);
232
+ */
233
+ private syncBookingMetadataHolder;
234
+ /**
235
+ * 从单条 booking 的 holder / metadata 中收集 holder form_record。
236
+ *
237
+ * @example
238
+ * const ids = this.collectBookingHolderRecords(booking);
239
+ */
240
+ private collectBookingHolderRecords;
241
+ private setProductHolderFromBooking;
242
+ private syncLinkedBookingHoldersToProducts;
243
+ /**
244
+ * 按 form_record 顺序读取 booking holder 的主字段名称。
245
+ *
246
+ * @example
247
+ * const names = this.collectBookingHolderNames(booking);
248
+ */
249
+ private collectBookingHolderNames;
250
+ /**
251
+ * 按老 ticketBooking `formatHolder` 语义汇总订单顶层 holder。
252
+ *
253
+ * @example
254
+ * const holder = this.buildTempOrderHolderFromBookings(tempOrder);
255
+ */
256
+ private buildTempOrderHolderFromBookings;
257
+ /**
258
+ * 将 booking 级 holder 汇总到 tempOrder 顶层 holder。
259
+ *
260
+ * @example
261
+ * this.syncTempOrderHolderFromBookings(tempOrder);
262
+ */
263
+ private syncTempOrderHolderFromBookings;
264
+ private getBookingUniqueIdentificationNumber;
265
+ private findBookingIndexByUniqueIdentificationNumber;
266
+ private removeLinkedBookingsForProduct;
68
267
  private getSalesSummary;
268
+ private applyOrderProductsDepositSummary;
69
269
  recalculateSummary(options?: {
70
270
  createIfMissing?: boolean;
71
- }): Promise<ScanOrderSummary | null>;
72
- getScanOrderSummary(): Promise<ScanOrderSummary>;
271
+ }): Promise<OrderSummary | null>;
272
+ getOrderSummary(): Promise<OrderSummary>;
73
273
  updateTempOrderNote(note: string): string;
274
+ updateTempOrderNote(note: string, sync: true): Promise<string>;
275
+ updateTempOrderNote(note: string, sync: boolean): string | Promise<string>;
276
+ syncTempOrderNoteToRemote(orderId: number | string, note: string): Promise<string>;
277
+ getTempOrderNote(): string;
278
+ updateTempOrderShopDiscount(amount: string | number): string;
279
+ updateTempOrderDepositAmount(amount: string | number): OrderSummary;
74
280
  updateTempOrderBuzzer(buzzer: string): string;
75
- updateTempOrderContactsInfo(contactsInfo: any[]): any[];
76
- addProductToOrder(product: Partial<ScanOrderOrderProduct> & ScanOrderOrderProductIdentity): Promise<ScanOrderOrderProduct[]>;
77
- updateProductInOrder(params: UpdateProductInOrderParams): Promise<ScanOrderOrderProduct[]>;
78
- removeProductFromOrder(identity: ScanOrderOrderProductIdentity): Promise<ScanOrderOrderProduct[]>;
281
+ updateTempOrderContactsInfo(contactsInfo: Record<string, any> | null): Record<string, any> | null;
282
+ private buildTempOrderCustomer;
283
+ private isCustomerBoundDiscount;
284
+ private shouldKeepCustomerBoundDiscountAfterCustomerChange;
285
+ private productHasCustomerBoundDiscount;
286
+ private shouldSkipDiscountCalculation;
287
+ private clearCustomerBoundDiscounts;
288
+ /**
289
+ * 更新当前 tempOrder 的客户协议字段。
290
+ *
291
+ * PaymentModal 只需要修改订单里的客户事实;如果外部还有客户模块需要同步,
292
+ * 应由调用方通过回调处理,不能把外部 UI 状态写进 tempOrder。
293
+ */
294
+ updateTempOrderCustomer(customer: UpdateTempOrderCustomerInput): OrderSnapshot['customer'];
295
+ setOrderCustomer(patch: OrderCustomerPatch | null, snapshot?: ICustomer | null): void;
296
+ getOrderCustomer(): OrderCustomerView | null;
297
+ getOrderCustomerSnapshot(): ICustomer | null;
298
+ clearOrderCustomer(): void;
299
+ private emitOrderCustomerChange;
300
+ /**
301
+ * 读取当前订单的 Sales 协议支付项。
302
+ *
303
+ * 这里返回的是 tempOrder.payments,而不是旧 PaymentModule 的本地
304
+ * payment order / tender session。Sales checkout 以该数组为提交事实来源。
305
+ */
306
+ getOrderPayments(): OrderPaymentData[];
307
+ /**
308
+ * 用一组支付来源覆盖当前订单支付项。
309
+ *
310
+ * 入参允许来自 PaymentModule 的 PaymentItem,内部统一映射为 Sales 协议:
311
+ * uuid -> metadata.unique_payment_number,id -> custom_payment_id,
312
+ * isSynced 等运行态字段不会进入 tempOrder.payments。
313
+ */
314
+ setOrderPayments(payments: OrderPaymentSource[]): OrderPaymentData[];
315
+ /** 追加单个支付项,并立即持久化当前 tempOrder。 */
316
+ addOrderPayment(payment: OrderPaymentSource): OrderPaymentData[];
317
+ /**
318
+ * 按支付唯一号、后端支付 ID、自定义支付方式 ID 或旧 uuid 更新支付项。
319
+ *
320
+ * 该方法服务 PaymentModal 的 void / 编辑场景;更新 metadata 时会做浅合并,
321
+ * 避免覆盖 unique_payment_number、现金实付/找零等已有元数据。
322
+ */
323
+ updateOrderPayment(paymentIdentity: string | number, updates: Partial<OrderPaymentData> & Record<string, any>): OrderPaymentData[];
324
+ /** 从当前订单支付项中移除指定支付项。 */
325
+ deleteOrderPayment(paymentIdentity: string | number): OrderPaymentData[];
326
+ private confirmPendingVoucherPaymentsInList;
327
+ private discardPendingVoucherPaymentsFromList;
328
+ private prepareVoucherPaymentsForSubmit;
329
+ private applyPaymentLifecycleChange;
330
+ confirmPendingVoucherPayments(options?: {
331
+ persist?: boolean;
332
+ recalculateSummary?: boolean;
333
+ }): OrderPaymentData[];
334
+ discardPendingVoucherPayments(options?: {
335
+ persist?: boolean;
336
+ recalculateSummary?: boolean;
337
+ }): OrderPaymentData[];
338
+ /**
339
+ * 覆盖当前订单中的 wallet pass 支付项。
340
+ *
341
+ * 判断口径与 PaymentModal 保持一致:voucher_id 存在且不为 0 的支付项
342
+ * 视为 wallet pass;其它支付项保持不变。
343
+ */
344
+ updateVoucherOrderPayments(payments: OrderPaymentSource[], options?: {
345
+ status?: 'paid' | 'payment_pending';
346
+ }): OrderPaymentData[];
347
+ private shouldMergeProductToOrder;
348
+ private hasOrderProductLineNote;
349
+ /**
350
+ * 判断商品行是否显式绑定了 booking。
351
+ *
352
+ * @example
353
+ * this.hasLinkedBookingUid({ metadata: { booking_uid: 'booking-1' } });
354
+ */
355
+ private hasLinkedBookingUid;
356
+ /**
357
+ * 预约商品加车后的统一收尾:促销、折扣、summary 重算与持久化(批量拆行时只调用一次)。
358
+ *
359
+ * @example
360
+ * await this.finalizeProductOrderMutation(tempOrder);
361
+ */
362
+ private finalizeProductOrderMutation;
363
+ /**
364
+ * 向 tempOrder 追加一条商品行(及可选 booking),不触发 summary 重算。
365
+ * 带 booking 且 num>1 时由 `addProductToOrder` 拆成多次本方法调用(每次 num=1)。
366
+ *
367
+ * @example
368
+ * await this.appendProductLineToTempOrder(tempOrder, { product_id: 1, num: 1 }, booking);
369
+ */
370
+ private appendProductLineToTempOrder;
371
+ /**
372
+ * 添加商品行。带 booking 时强制独立行;num>1 时拆成多条 num=1 的 product+booking(对齐 BookingByStep / ticketBooking addService)。
373
+ *
374
+ * @example
375
+ * await order.addProductToOrder({ product_id: 1, num: 3 }, { start_time: '10:00' });
376
+ * // → tempOrder.products 新增 3 行,每行 num=1,bookings 3 条
377
+ */
378
+ addProductToOrder(product: Partial<OrderProduct> & OrderProductIdentity, booking?: AddProductBookingInput): Promise<OrderProduct[]>;
379
+ /**
380
+ * 批量添加商品行,所有行追加完成后只触发一次促销、折扣、summary 重算与持久化。
381
+ *
382
+ * @example
383
+ * await order.addProductsToOrder([
384
+ * { product: { product_id: 1, product_variant_id: 0, num: 1 } },
385
+ * { product: { product_id: 2, product_variant_id: 0, num: 1 } },
386
+ * ]);
387
+ */
388
+ addProductsToOrder(items: Array<{
389
+ product: Partial<OrderProduct> & OrderProductIdentity;
390
+ booking?: AddProductBookingInput;
391
+ }>, options?: {
392
+ skipEditDiscountConfigRefresh?: boolean;
393
+ }): Promise<OrderProduct[]>;
394
+ private hasGoodPassDiscount;
395
+ private getBundleRuntimeIdentity;
396
+ private preservePersistedBundlePriceFields;
397
+ private applyOrderProductUpdateToTempOrder;
398
+ updateOrderProduct(params: UpdateOrderProductParams): Promise<OrderProduct[]>;
399
+ updateOrderProducts(paramsList: UpdateOrderProductParams[]): Promise<OrderProduct[]>;
400
+ updateOrderProductQuantity(params: UpdateOrderProductQuantityParams): Promise<OrderProduct[]>;
401
+ updateOrderBooking(params: UpdateOrderBookingParams): any[];
402
+ /**
403
+ * 商品行写路径收尾:促销 → 折扣 → 清洗 → summary → 持久化。
404
+ * 批量删除等多行变更场景只应调用一次,避免 N 次 applyPromotion。
405
+ *
406
+ * @example
407
+ * await this.finalizeAfterProductsMutation(tempOrder);
408
+ */
409
+ private finalizeAfterProductsMutation;
410
+ /**
411
+ * 批量按 identity 删除购物车行,末尾仅一次促销重算。
412
+ *
413
+ * @example
414
+ * await order.removeProductsFromOrder([identityA, identityB]);
415
+ */
416
+ removeProductsFromOrder(identities: OrderProductIdentity[]): Promise<OrderProduct[]>;
417
+ removeProductFromOrder(identity: OrderProductIdentity): Promise<OrderProduct[]>;
418
+ /**
419
+ * 仅清空购物车行(products / bookings),不重置整单。
420
+ * 用于「仅清空商品」;客户、备注、支付等协议字段保持不变。
421
+ */
422
+ clearOrderCartLines(): Promise<OrderTempOrder>;
423
+ buildCurrentSubmitPayloadForLocalPrint(params?: {
424
+ cacheId?: string;
425
+ platform?: string;
426
+ businessCode?: string;
427
+ channel?: string;
428
+ type?: string;
429
+ }): import("./types").OrderSubmitPayload;
430
+ applyLocalPrintOrderNumbers(order?: Record<string, any> | null): Promise<OrderTempOrder>;
431
+ /**
432
+ * 提交当前 Sales tempOrder。
433
+ *
434
+ * smallTicketDataFlag 用于 B 端 checkout 小票数据返回。PaymentModal 在支付提交时
435
+ * 应传 1,确保 /shop/order/sales/checkout 返回打印所需数据。
436
+ */
79
437
  submitTempOrder<T = any>(params?: {
80
438
  cacheId?: string;
81
439
  platform?: string;
82
440
  businessCode?: string;
83
441
  channel?: string;
84
442
  type?: string;
443
+ payments?: OrderPaymentSource[];
444
+ paymentStatus?: SubmitSalesOrderParams['query']['payment_status'];
445
+ smallTicketDataFlag?: number;
446
+ confirmPendingVoucherPayments?: boolean;
85
447
  enhancePayload?: SubmitPayloadEnhancer;
86
448
  }): Promise<T>;
449
+ submitTempOrderAsync<T = any>(params?: {
450
+ cacheId?: string;
451
+ platform?: string;
452
+ businessCode?: string;
453
+ channel?: string;
454
+ type?: string;
455
+ payments?: OrderPaymentSource[];
456
+ paymentStatus?: SubmitSalesOrderParams['query']['payment_status'];
457
+ smallTicketDataFlag?: number;
458
+ confirmPendingVoucherPayments?: boolean;
459
+ enhancePayload?: SubmitPayloadEnhancer;
460
+ }): Promise<T>;
461
+ private runSubmitTempOrder;
462
+ private markLocalOrderSynced;
463
+ private applyRemoteOrderNumbersToTempOrder;
464
+ private isSubmitResponseRejected;
465
+ private isLocalPendingSubmitResult;
466
+ private isSubmitErrorResponse;
467
+ private extractSubmitErrorResponse;
468
+ private logSubmitBackendRejected;
469
+ generateIdempotencyToken(): string;
470
+ syncPaymentsToOrder<T = any>(params: SyncPaymentsToOrderParams): Promise<SyncPaymentsToOrderResult<T>>;
87
471
  createOrder(params: CommitOrderParams['query']): {
88
472
  type: "appointment_booking" | "virtual";
89
473
  platform: string;
@@ -102,20 +486,61 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
102
486
  type: 'holder' | 'account';
103
487
  }): boolean;
104
488
  submitOrder(order: CommitOrderParams): Promise<void>;
489
+ cancelOrder(params: CancelOrderParams): Promise<any>;
490
+ changeBookingStatus(params: ChangeBookingStatusParams): Promise<any>;
105
491
  /**
106
492
  * Checkout 专用:创建订单到后端
107
493
  *
108
494
  * 专门为 Checkout 模块设计的订单创建方法,
109
- * 直接调用 /order/checkout 接口创建订单
495
+ * 通过 OS Server 调用 checkout 接口创建订单
110
496
  * 接收已经处理好的订单数据,无需再处理购物车
111
497
  *
112
498
  * @param params Checkout 订单参数(已处理的订单数据)
113
499
  * @returns 后端返回的订单数据(包含订单ID等)
114
500
  */
115
501
  createOrderByCheckout(params: CheckoutOrderParams): Promise<any>;
116
- submitScanOrder<T = any>(params: SubmitScanOrderParams): Promise<T>;
117
- scanOrderMore<T = any>(params: ScanOrderMoreParams): Promise<T>;
118
- getOrderInfoByRemote(order_id: number): Promise<any>;
502
+ submitSalesOrder<T = any>(params: SubmitSalesOrderParams): Promise<T>;
503
+ /**
504
+ * 发送支付链接邮件。
505
+ *
506
+ * 调用前必须已经有远端 order_id。BaseSales 会在需要时先提交本地订单,
507
+ * OrderModule 只负责校验 order_ids 并调用 /order/batch-email。
508
+ */
509
+ sendCustomerPayLink<T = any>(params: SendCustomerPayLinkParams): Promise<T>;
510
+ getSalesOrderByLookup(params: {
511
+ lookup: number | string;
512
+ forceRemote?: boolean;
513
+ }): Promise<any>;
514
+ /**
515
+ * 把 sqlite / 后端返回的订单记录直接恢复为 tempOrder。
516
+ *
517
+ * 数据源应尽量返回 tempOrder 所需结构;这里仅做 SDK 运行必须字段兜底,
518
+ * 例如数组字段、商品行唯一值、价格 metadata、summary 派生状态和 _extend。
519
+ */
520
+ hydrateTempOrderFromRecord(record: Record<string, any>, options?: {
521
+ recalcOnHydrate?: boolean;
522
+ }): Promise<OrderTempOrder>;
523
+ /**
524
+ * 兼容后端详情将 holder 放在 metadata.holder 的历史形态,统一补到运行时展示路径。
525
+ *
526
+ * @example
527
+ * this.normalizeHydratedBookingHolder({ metadata: { holder: { form_record: [1] } } });
528
+ */
529
+ private normalizeHydratedBookingHolder;
530
+ /**
531
+ * 匿名 booking 没有服务端行 ID 时,商品侧已有的 booking_uid 就是唯一可用的强引用。
532
+ * 在统一规范化生成 UUID 前先复用它;已落库 booking 仍按 schedule_event_id 派生稳定 UID。
533
+ */
534
+ private seedAnonymousBookingUidsFromProducts;
535
+ private normalizeTempOrderForRuntime;
536
+ private hydrateLinkedBookingIdentity;
537
+ private pickHydratedDisplayText;
538
+ private formatHydratedNamePair;
539
+ private buildHydratedProductOptionString;
540
+ private normalizeHydratedProductOptionItem;
541
+ private normalizeHydratedOrderProduct;
119
542
  getLastOrderInfo(): Record<string, any> | undefined;
543
+ getOrderInfo(order_id: number): Promise<any>;
544
+ getVouchers(): any[];
120
545
  }
121
- export type { UpdateProductInOrderParams } from './types';
546
+ export type { UpdateOrderBookingParams, UpdateOrderProductParams, UpdateOrderProductQuantityParams, } from './types';