@pisell/pisellos 2.2.244 → 2.2.245

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 (317) hide show
  1. package/dist/model/strategy/adapter/promotion/evaluator.js +3 -2
  2. package/dist/model/strategy/adapter/promotion/index.js +0 -9
  3. package/dist/model/strategy/adapter/walletPass/utils.js +7 -4
  4. package/dist/modules/BookingContext/index.d.ts +48 -0
  5. package/dist/modules/BookingContext/index.js +566 -0
  6. package/dist/modules/BookingContext/types.d.ts +102 -0
  7. package/dist/modules/BookingContext/types.js +51 -0
  8. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts +16 -0
  9. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +284 -0
  10. package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +8 -0
  11. package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +145 -0
  12. package/dist/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +76 -0
  13. package/dist/modules/BookingContext/utils/cacheItemToBookingInput.js +218 -0
  14. package/dist/modules/BookingContext/utils/flexible.d.ts +28 -0
  15. package/dist/modules/BookingContext/utils/flexible.js +56 -0
  16. package/dist/modules/BookingContext/utils/formatResourceList.d.ts +8 -0
  17. package/dist/modules/BookingContext/utils/formatResourceList.js +38 -0
  18. package/dist/modules/BookingContext/utils/index.d.ts +11 -0
  19. package/dist/modules/BookingContext/utils/index.js +11 -0
  20. package/dist/modules/BookingContext/utils/noResource.d.ts +13 -0
  21. package/dist/modules/BookingContext/utils/noResource.js +77 -0
  22. package/dist/modules/BookingContext/utils/orderLineDisplay.d.ts +1 -0
  23. package/dist/modules/BookingContext/utils/orderLineDisplay.js +36 -0
  24. package/dist/modules/BookingContext/utils/productExtend.d.ts +72 -0
  25. package/dist/modules/BookingContext/utils/productExtend.js +339 -0
  26. package/dist/modules/BookingContext/utils/resourceErrors.d.ts +41 -0
  27. package/dist/modules/BookingContext/utils/resourceErrors.js +74 -0
  28. package/dist/modules/BookingContext/utils/resourceSelection.d.ts +7 -0
  29. package/dist/modules/BookingContext/utils/resourceSelection.js +24 -0
  30. package/dist/modules/BookingContext/utils/resources.d.ts +80 -0
  31. package/dist/modules/BookingContext/utils/resources.js +486 -0
  32. package/dist/modules/BookingContext/utils/serviceTimes.d.ts +55 -0
  33. package/dist/modules/BookingContext/utils/serviceTimes.js +151 -0
  34. package/dist/modules/BookingContext/utils/timeSlices.d.ts +42 -0
  35. package/dist/modules/BookingContext/utils/timeSlices.js +100 -0
  36. package/dist/modules/Cart/utils/cartProduct.js +24 -3
  37. package/dist/modules/Cart/utils/changePrice.js +11 -11
  38. package/dist/modules/Customer/index.d.ts +20 -0
  39. package/dist/modules/Customer/index.js +172 -83
  40. package/dist/modules/Customer/types.d.ts +2 -0
  41. package/dist/modules/Discount/index.d.ts +1 -1
  42. package/dist/modules/Discount/index.js +13 -6
  43. package/dist/modules/Discount/types.d.ts +1 -0
  44. package/dist/modules/OpenData/index.d.ts +8 -0
  45. package/dist/modules/OpenData/index.js +37 -17
  46. package/dist/modules/Order/index.d.ts +275 -19
  47. package/dist/modules/Order/index.js +3493 -809
  48. package/dist/modules/Order/types.d.ts +286 -31
  49. package/dist/modules/Order/types.js +38 -0
  50. package/dist/modules/Order/utils/manualProductDiscount.d.ts +106 -0
  51. package/dist/modules/Order/utils/manualProductDiscount.js +210 -0
  52. package/dist/modules/Order/utils.d.ts +147 -5
  53. package/dist/modules/Order/utils.js +750 -104
  54. package/dist/modules/Payment/index.d.ts +10 -13
  55. package/dist/modules/Payment/index.js +467 -837
  56. package/dist/modules/Payment/types.d.ts +2 -0
  57. package/dist/modules/Payment/utils.js +2 -1
  58. package/dist/modules/Payment/walletpass.js +41 -25
  59. package/dist/modules/ProductList/index.d.ts +16 -12
  60. package/dist/modules/ProductList/index.js +133 -59
  61. package/dist/modules/ProductList/types.d.ts +14 -0
  62. package/dist/modules/Quotation/index.d.ts +0 -1
  63. package/dist/modules/Quotation/index.js +25 -22
  64. package/dist/modules/Rules/index.d.ts +4 -0
  65. package/dist/modules/Rules/index.js +97 -70
  66. package/dist/modules/Rules/types.d.ts +1 -0
  67. package/dist/modules/SalesSummary/index.d.ts +8 -25
  68. package/dist/modules/SalesSummary/index.js +86 -35
  69. package/dist/modules/SalesSummary/types.d.ts +4 -1
  70. package/dist/modules/SalesSummary/utils.d.ts +2 -25
  71. package/dist/modules/SalesSummary/utils.js +794 -162
  72. package/dist/modules/Schedule/index.d.ts +7 -0
  73. package/dist/modules/Schedule/index.js +24 -2
  74. package/dist/modules/Summary/index.js +4 -3
  75. package/dist/modules/SurchargeList/index.d.ts +16 -0
  76. package/dist/modules/SurchargeList/index.js +162 -0
  77. package/dist/modules/SurchargeList/types.d.ts +11 -0
  78. package/dist/modules/SurchargeList/types.js +1 -0
  79. package/dist/modules/index.d.ts +2 -0
  80. package/dist/modules/index.js +3 -1
  81. package/dist/plugins/request.d.ts +1 -0
  82. package/dist/server/index.d.ts +204 -1
  83. package/dist/server/index.js +3654 -922
  84. package/dist/server/modules/index.d.ts +2 -0
  85. package/dist/server/modules/index.js +2 -0
  86. package/dist/server/modules/order/index.d.ts +120 -3
  87. package/dist/server/modules/order/index.js +1758 -448
  88. package/dist/server/modules/order/types.d.ts +32 -3
  89. package/dist/server/modules/order/types.js +8 -0
  90. package/dist/server/modules/order/utils/filterBookings.js +26 -3
  91. package/dist/server/modules/order/utils/filterOrders.js +23 -8
  92. package/dist/server/modules/payment/index.d.ts +28 -0
  93. package/dist/server/modules/payment/index.js +305 -0
  94. package/dist/server/modules/payment/types.d.ts +9 -0
  95. package/dist/server/modules/payment/types.js +1 -0
  96. package/dist/server/modules/products/index.d.ts +34 -7
  97. package/dist/server/modules/products/index.js +631 -317
  98. package/dist/server/modules/resource/index.d.ts +2 -0
  99. package/dist/server/modules/resource/index.js +29 -3
  100. package/dist/server/modules/schedule/index.d.ts +4 -4
  101. package/dist/server/modules/schedule/index.js +111 -88
  102. package/dist/server/test.json +713 -0
  103. package/dist/server/utils/small-ticket.d.ts +71 -0
  104. package/dist/server/utils/small-ticket.js +840 -0
  105. package/dist/solution/BaseSales/index.d.ts +133 -10
  106. package/dist/solution/BaseSales/index.js +1950 -447
  107. package/dist/solution/BaseSales/types.d.ts +82 -6
  108. package/dist/solution/BaseSales/types.js +5 -4
  109. package/dist/solution/BaseSales/utils/cartPromotion.d.ts +287 -0
  110. package/dist/solution/BaseSales/utils/cartPromotion.js +1438 -0
  111. package/dist/solution/BaseSales/utils/quotationPrice.d.ts +7 -0
  112. package/dist/solution/BaseSales/utils/quotationPrice.js +237 -0
  113. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +1 -0
  114. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +105 -24
  115. package/dist/solution/BaseSales/utils.d.ts +1 -1
  116. package/dist/solution/BaseSales/utils.js +62 -21
  117. package/dist/solution/BookingByStep/index.d.ts +1 -1
  118. package/dist/solution/BookingTicket/index.d.ts +271 -11
  119. package/dist/solution/BookingTicket/index.js +1777 -242
  120. package/dist/solution/BookingTicket/types.d.ts +118 -1
  121. package/dist/solution/BookingTicket/types.js +41 -2
  122. package/dist/solution/BookingTicket/utils/addProductDecision.d.ts +117 -0
  123. package/dist/solution/BookingTicket/utils/addProductDecision.js +346 -0
  124. package/dist/solution/BookingTicket/utils/addTimeAvailability.d.ts +35 -0
  125. package/dist/solution/BookingTicket/utils/addTimeAvailability.js +95 -0
  126. package/dist/solution/BookingTicket/utils/bookingStatus.d.ts +40 -0
  127. package/dist/solution/BookingTicket/utils/bookingStatus.js +70 -0
  128. package/dist/solution/BookingTicket/utils/cartView.d.ts +9 -1
  129. package/dist/solution/BookingTicket/utils/cartView.js +94 -7
  130. package/dist/solution/BookingTicket/utils/exampleData.d.ts +123 -0
  131. package/dist/solution/BookingTicket/utils/exampleData.js +183 -0
  132. package/dist/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +185 -0
  133. package/dist/solution/BookingTicket/utils/resolveBestAddTimePlan.js +438 -0
  134. package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +36 -0
  135. package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +400 -0
  136. package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +32 -0
  137. package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.js +56 -0
  138. package/dist/solution/BookingTicket/utils/scan/index.d.ts +5 -0
  139. package/dist/solution/BookingTicket/utils/scan/index.js +20 -8
  140. package/dist/solution/BookingTicket/utils/scan/scanProductValues.d.ts +21 -0
  141. package/dist/solution/BookingTicket/utils/scan/scanProductValues.js +150 -0
  142. package/dist/solution/BookingTicket/utils/sessionCatalogStale.d.ts +23 -0
  143. package/dist/solution/BookingTicket/utils/sessionCatalogStale.js +78 -0
  144. package/dist/solution/Checkout/index.d.ts +1 -0
  145. package/dist/solution/Checkout/index.js +10 -9
  146. package/dist/solution/RegisterAndLogin/config.js +2 -10
  147. package/dist/solution/ScanOrder/index.d.ts +9 -3
  148. package/dist/solution/ScanOrder/index.js +241 -134
  149. package/dist/solution/ScanOrder/types.d.ts +9 -5
  150. package/dist/solution/ScanOrder/types.js +2 -3
  151. package/dist/solution/ScanOrder/utils.d.ts +1 -1
  152. package/dist/solution/ScanOrder/utils.js +84 -22
  153. package/dist/solution/VenueBooking/index.d.ts +5 -2
  154. package/dist/solution/VenueBooking/index.js +110 -59
  155. package/dist/solution/VenueBooking/sales-section-4-annotated.json +0 -2
  156. package/dist/solution/VenueBooking/utils/slotMerge.d.ts +4 -0
  157. package/dist/solution/VenueBooking/utils/slotMerge.js +10 -0
  158. package/dist/types/index.d.ts +10 -0
  159. package/lib/model/strategy/adapter/promotion/evaluator.js +2 -1
  160. package/lib/model/strategy/adapter/promotion/index.js +49 -0
  161. package/lib/model/strategy/adapter/walletPass/utils.js +3 -2
  162. package/lib/modules/BookingContext/index.d.ts +48 -0
  163. package/lib/modules/BookingContext/index.js +368 -0
  164. package/lib/modules/BookingContext/types.d.ts +102 -0
  165. package/lib/modules/BookingContext/types.js +34 -0
  166. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts +16 -0
  167. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +276 -0
  168. package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +8 -0
  169. package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +151 -0
  170. package/lib/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +76 -0
  171. package/lib/modules/BookingContext/utils/cacheItemToBookingInput.js +201 -0
  172. package/lib/modules/BookingContext/utils/flexible.d.ts +28 -0
  173. package/lib/modules/BookingContext/utils/flexible.js +80 -0
  174. package/lib/modules/BookingContext/utils/formatResourceList.d.ts +8 -0
  175. package/lib/modules/BookingContext/utils/formatResourceList.js +50 -0
  176. package/lib/modules/BookingContext/utils/index.d.ts +11 -0
  177. package/lib/modules/BookingContext/utils/index.js +43 -0
  178. package/lib/modules/BookingContext/utils/noResource.d.ts +13 -0
  179. package/lib/modules/BookingContext/utils/noResource.js +90 -0
  180. package/lib/modules/BookingContext/utils/orderLineDisplay.d.ts +1 -0
  181. package/lib/modules/BookingContext/utils/orderLineDisplay.js +56 -0
  182. package/lib/modules/BookingContext/utils/productExtend.d.ts +72 -0
  183. package/lib/modules/BookingContext/utils/productExtend.js +283 -0
  184. package/lib/modules/BookingContext/utils/resourceErrors.d.ts +41 -0
  185. package/lib/modules/BookingContext/utils/resourceErrors.js +80 -0
  186. package/lib/modules/BookingContext/utils/resourceSelection.d.ts +7 -0
  187. package/lib/modules/BookingContext/utils/resourceSelection.js +46 -0
  188. package/lib/modules/BookingContext/utils/resources.d.ts +80 -0
  189. package/lib/modules/BookingContext/utils/resources.js +377 -0
  190. package/lib/modules/BookingContext/utils/serviceTimes.d.ts +55 -0
  191. package/lib/modules/BookingContext/utils/serviceTimes.js +162 -0
  192. package/lib/modules/BookingContext/utils/timeSlices.d.ts +42 -0
  193. package/lib/modules/BookingContext/utils/timeSlices.js +124 -0
  194. package/lib/modules/Cart/utils/cartProduct.js +20 -3
  195. package/lib/modules/Cart/utils/changePrice.js +12 -20
  196. package/lib/modules/Customer/index.d.ts +20 -0
  197. package/lib/modules/Customer/index.js +64 -11
  198. package/lib/modules/Customer/types.d.ts +2 -0
  199. package/lib/modules/Discount/index.d.ts +1 -1
  200. package/lib/modules/Discount/index.js +9 -1
  201. package/lib/modules/Discount/types.d.ts +1 -0
  202. package/lib/modules/OpenData/index.d.ts +8 -0
  203. package/lib/modules/OpenData/index.js +19 -5
  204. package/lib/modules/Order/index.d.ts +275 -19
  205. package/lib/modules/Order/index.js +2245 -336
  206. package/lib/modules/Order/types.d.ts +286 -31
  207. package/lib/modules/Order/types.js +1 -0
  208. package/lib/modules/Order/utils/manualProductDiscount.d.ts +106 -0
  209. package/lib/modules/Order/utils/manualProductDiscount.js +206 -0
  210. package/lib/modules/Order/utils.d.ts +147 -5
  211. package/lib/modules/Order/utils.js +615 -46
  212. package/lib/modules/Payment/index.d.ts +10 -13
  213. package/lib/modules/Payment/index.js +18 -150
  214. package/lib/modules/Payment/types.d.ts +2 -0
  215. package/lib/modules/Payment/utils.js +2 -1
  216. package/lib/modules/Payment/walletpass.js +16 -3
  217. package/lib/modules/ProductList/index.d.ts +16 -12
  218. package/lib/modules/ProductList/index.js +41 -4
  219. package/lib/modules/ProductList/types.d.ts +14 -0
  220. package/lib/modules/Quotation/index.d.ts +0 -1
  221. package/lib/modules/Quotation/index.js +19 -16
  222. package/lib/modules/Rules/index.d.ts +4 -0
  223. package/lib/modules/Rules/index.js +137 -120
  224. package/lib/modules/Rules/types.d.ts +1 -0
  225. package/lib/modules/SalesSummary/index.d.ts +8 -25
  226. package/lib/modules/SalesSummary/index.js +30 -4
  227. package/lib/modules/SalesSummary/types.d.ts +4 -1
  228. package/lib/modules/SalesSummary/utils.d.ts +2 -25
  229. package/lib/modules/SalesSummary/utils.js +645 -91
  230. package/lib/modules/Schedule/index.d.ts +7 -0
  231. package/lib/modules/Schedule/index.js +17 -1
  232. package/lib/modules/Summary/index.js +5 -4
  233. package/lib/modules/SurchargeList/index.d.ts +16 -0
  234. package/lib/modules/SurchargeList/index.js +89 -0
  235. package/lib/modules/SurchargeList/types.d.ts +11 -0
  236. package/lib/modules/SurchargeList/types.js +17 -0
  237. package/lib/modules/index.d.ts +2 -0
  238. package/lib/modules/index.js +5 -1
  239. package/lib/plugins/request.d.ts +1 -0
  240. package/lib/server/index.d.ts +204 -1
  241. package/lib/server/index.js +1891 -59
  242. package/lib/server/modules/index.d.ts +2 -0
  243. package/lib/server/modules/index.js +3 -0
  244. package/lib/server/modules/order/index.d.ts +120 -3
  245. package/lib/server/modules/order/index.js +883 -94
  246. package/lib/server/modules/order/types.d.ts +32 -3
  247. package/lib/server/modules/order/utils/filterBookings.js +24 -5
  248. package/lib/server/modules/order/utils/filterOrders.js +15 -6
  249. package/lib/server/modules/payment/index.d.ts +28 -0
  250. package/lib/server/modules/payment/index.js +192 -0
  251. package/lib/server/modules/payment/types.d.ts +9 -0
  252. package/lib/server/modules/payment/types.js +17 -0
  253. package/lib/server/modules/products/index.d.ts +34 -7
  254. package/lib/server/modules/products/index.js +189 -54
  255. package/lib/server/modules/resource/index.d.ts +2 -0
  256. package/lib/server/modules/resource/index.js +27 -3
  257. package/lib/server/modules/schedule/index.d.ts +4 -4
  258. package/lib/server/modules/schedule/index.js +47 -40
  259. package/lib/server/test.json +713 -0
  260. package/lib/server/utils/small-ticket.d.ts +71 -0
  261. package/lib/server/utils/small-ticket.js +800 -0
  262. package/lib/solution/BaseSales/index.d.ts +133 -10
  263. package/lib/solution/BaseSales/index.js +1111 -63
  264. package/lib/solution/BaseSales/types.d.ts +82 -6
  265. package/lib/solution/BaseSales/types.js +3 -1
  266. package/lib/solution/BaseSales/utils/cartPromotion.d.ts +287 -0
  267. package/lib/solution/BaseSales/utils/cartPromotion.js +992 -0
  268. package/lib/solution/BaseSales/utils/quotationPrice.d.ts +7 -0
  269. package/lib/solution/BaseSales/utils/quotationPrice.js +277 -0
  270. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +1 -0
  271. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +106 -18
  272. package/lib/solution/BaseSales/utils.d.ts +1 -1
  273. package/lib/solution/BaseSales/utils.js +54 -10
  274. package/lib/solution/BookingByStep/index.d.ts +1 -1
  275. package/lib/solution/BookingTicket/index.d.ts +271 -11
  276. package/lib/solution/BookingTicket/index.js +922 -29
  277. package/lib/solution/BookingTicket/types.d.ts +118 -1
  278. package/lib/solution/BookingTicket/types.js +11 -0
  279. package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +117 -0
  280. package/lib/solution/BookingTicket/utils/addProductDecision.js +318 -0
  281. package/lib/solution/BookingTicket/utils/addTimeAvailability.d.ts +35 -0
  282. package/lib/solution/BookingTicket/utils/addTimeAvailability.js +125 -0
  283. package/lib/solution/BookingTicket/utils/bookingStatus.d.ts +40 -0
  284. package/lib/solution/BookingTicket/utils/bookingStatus.js +44 -2
  285. package/lib/solution/BookingTicket/utils/cartView.d.ts +9 -1
  286. package/lib/solution/BookingTicket/utils/cartView.js +61 -6
  287. package/lib/solution/BookingTicket/utils/exampleData.d.ts +123 -0
  288. package/lib/solution/BookingTicket/utils/exampleData.js +0 -0
  289. package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +185 -0
  290. package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.js +254 -0
  291. package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +36 -0
  292. package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +169 -0
  293. package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +32 -0
  294. package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.js +51 -0
  295. package/lib/solution/BookingTicket/utils/scan/index.d.ts +5 -0
  296. package/lib/solution/BookingTicket/utils/scan/index.js +17 -3
  297. package/lib/solution/BookingTicket/utils/scan/scanProductValues.d.ts +21 -0
  298. package/lib/solution/BookingTicket/utils/scan/scanProductValues.js +127 -0
  299. package/lib/solution/BookingTicket/utils/sessionCatalogStale.d.ts +23 -0
  300. package/lib/solution/BookingTicket/utils/sessionCatalogStale.js +85 -0
  301. package/lib/solution/Checkout/index.d.ts +1 -0
  302. package/lib/solution/Checkout/index.js +1 -2
  303. package/lib/solution/RegisterAndLogin/config.js +2 -10
  304. package/lib/solution/ScanOrder/index.d.ts +9 -3
  305. package/lib/solution/ScanOrder/index.js +153 -70
  306. package/lib/solution/ScanOrder/types.d.ts +9 -5
  307. package/lib/solution/ScanOrder/utils.d.ts +1 -1
  308. package/lib/solution/ScanOrder/utils.js +83 -17
  309. package/lib/solution/VenueBooking/index.d.ts +5 -2
  310. package/lib/solution/VenueBooking/index.js +54 -17
  311. package/lib/solution/VenueBooking/sales-section-4-annotated.json +0 -2
  312. package/lib/solution/VenueBooking/utils/slotMerge.d.ts +4 -0
  313. package/lib/solution/VenueBooking/utils/slotMerge.js +10 -0
  314. package/lib/types/index.d.ts +10 -0
  315. package/package.json +1 -1
  316. package/dist/solution/Checkout/appointmentDemo.json +0 -1
  317. package/lib/solution/Checkout/appointmentDemo.json +0 -1
@@ -1,17 +1,20 @@
1
1
  import { Module, ModuleOptions, PisellCore } from '../../types';
2
2
  import { BaseModule } from '../../modules/BaseModule';
3
- import { BaseSalesOrderProduct, BaseSalesOrderProductIdentity, BaseSalesPaymentStatus, BaseSalesScanCodeResult } from './types';
3
+ import { BaseSalesOrderProduct, BaseSalesOrderProductIdentity, BaseSalesPaymentStatus, BaseSalesUpdateOrderProductQuantityParams, BaseSalesCalculateProductBookingPriceParams, BaseSalesProductBookingPriceResult, BaseSalesScanCodeResult } from './types';
4
4
  import { OrderModule } from '../../modules/Order';
5
- import type { AddProductBookingInput, LoadSalesDetailParams, OrderPaymentData, OrderPaymentSource, SendCustomerPayLinkParams, SyncPaymentsToOrderParams, SyncPaymentsToOrderResult, UpdateTempOrderCustomerInput, UpdateProductInOrderParams } from '../../modules/Order/types';
5
+ import type { AddProductBookingInput, LoadSalesDetailParams, OrderPaymentData, OrderPaymentSource, SendCustomerPayLinkParams, SyncPaymentsToOrderParams, SyncPaymentsToOrderResult, UpdateTempOrderCustomerInput, UpdateOrderBookingParams, UpdateOrderProductParams, OrderTempOrder, OrderSummary, OrderPromotionEvaluator, OrderGiftSelectResolver, OrderUnfulfilledPromotion, OrderLastGiftActions } from '../../modules/Order/types';
6
6
  import type { SubmitPayloadEnhancer } from '../../modules/Order/utils';
7
7
  import type { Discount } from '../../modules/Discount/types';
8
8
  import { RequestPlugin, WindowPlugin } from '../../plugins';
9
9
  export * from './types';
10
10
  import { ProductList } from '../../modules/ProductList';
11
11
  import { PaymentModule } from '../../modules/Payment';
12
+ import type { PaymentMethod } from '../../modules/Payment/types';
12
13
  import type { SalesSummaryModule } from '../../modules/SalesSummary';
13
14
  import type { ScheduleModule } from '../../modules/Schedule';
15
+ import { QuotationModule } from '../../modules/Quotation';
14
16
  import type { ISalesDetail, ISalesDetailHeader, ISalesBooking, ISalesPayment, ISalesSurcharge } from './utils/parseSalesResponse';
17
+ import { AppPlugin } from '../../plugins/app';
15
18
  import { type TransformBaseProductToOrderProductParams } from './utils/transformBaseProductToOrderProduct';
16
19
  export interface BaseSalesState {
17
20
  order?: OrderModule;
@@ -19,13 +22,16 @@ export interface BaseSalesState {
19
22
  payment?: PaymentModule;
20
23
  salesSummary?: SalesSummaryModule;
21
24
  schedule?: ScheduleModule;
25
+ quotation?: QuotationModule;
22
26
  }
27
+ export type BaseSalesPrintLocalOrderReceiptParams = string | number;
23
28
  export declare class BaseSalesImpl extends BaseModule implements Module {
24
29
  protected defaultName: string;
25
30
  protected defaultVersion: string;
26
31
  isSolution: boolean;
27
32
  protected initializeOptions: ModuleOptions;
28
33
  private logger;
34
+ protected appPlugin: AppPlugin;
29
35
  protected store: BaseSalesState;
30
36
  protected otherParams: Record<string, any>;
31
37
  protected cacheId: string | undefined;
@@ -36,10 +42,13 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
36
42
  window: WindowPlugin;
37
43
  request: RequestPlugin;
38
44
  protected currentSalesDetail: ISalesDetail | null;
45
+ protected discountConfigCacheKey: string | null;
46
+ protected hasManualDiscountSelection: boolean;
47
+ private paymentMethodsCache;
39
48
  constructor(name?: string, version?: string);
40
49
  /**
41
50
  * 子类可覆盖此方法以追加/收敛要注册的子模块。
42
- * 默认包含通用销售模块:products / order / salesSummary / schedule / payment。
51
+ * 默认包含通用销售模块:products / order / salesSummary / schedule / payment / quotation
43
52
  */
44
53
  protected getRegisteredModuleNames(): readonly string[];
45
54
  /**
@@ -54,7 +63,19 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
54
63
  * 记录错误日志
55
64
  */
56
65
  private logError;
66
+ private hydrateOrderPaymentNames;
57
67
  get payment(): PaymentModule | undefined;
68
+ private getCurrentOrderCustomerId;
69
+ private applyQuotationScheduleResolver;
70
+ private loadQuotationForPriceQuery;
71
+ private getPriceQueryProductId;
72
+ private getPriceQuerySchedule;
73
+ private loadProductForPriceQuery;
74
+ private getAuthoritativeBundleItems;
75
+ private findAuthoritativeBundleItem;
76
+ private getAuthoritativeBundleUnitPrice;
77
+ private mergeProductForPriceQuery;
78
+ protected getSubmitOrderSalesChannel(): string | undefined;
58
79
  /**
59
80
  * 工厂入口:根据子模块名实例化对应模块。
60
81
  * 默认使用 BookingByStep 公共 `createModule`。子类若需引入额外类型(如 customer),
@@ -62,16 +83,35 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
62
83
  */
63
84
  protected createSubModule(moduleName: string): Module | null;
64
85
  protected getSubModuleHooks(moduleName: string): any;
86
+ /**
87
+ * 构造传给 BaseSales 子模块的完整运行态参数,保证初始化和后续同步语义一致。
88
+ *
89
+ * @example
90
+ * const params = this.buildSubModuleOtherParams();
91
+ * this.core.registerModule(orderModule, { otherParams: params });
92
+ */
93
+ protected buildSubModuleOtherParams(): Record<string, any>;
94
+ /**
95
+ * 将父级 otherParams 的变更显式同步给已注册的子模块。
96
+ *
97
+ * @example
98
+ * await this.syncOtherParamsToSubModules({ channel: 'pos' });
99
+ */
100
+ protected syncOtherParamsToSubModules(changedParams: Record<string, any>, { cover }?: {
101
+ cover?: boolean;
102
+ }): Promise<void>;
65
103
  /**
66
104
  * 读取 sessionStorage[this.name][cacheId],作为子模块 initialState 的来源。
67
105
  * sessionStorage 损坏时静默忽略,按空状态注册。
68
106
  */
69
107
  protected readSessionCacheData(): Record<string, any>;
108
+ protected getAppData<T>(key: string): T | undefined;
109
+ private syncAppDataToTempOrder;
70
110
  initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
71
111
  destroy(): Promise<void>;
72
112
  /**
73
113
  * 加载销售订单到统一 tempOrder 工作区。
74
- * app.sqlite 时优先读取本地记录;本地未命中或 forceRemote=true 时再拉云端。
114
+ * 统一通过 OrderModule sales detail lookup 加载订单详情。
75
115
  *
76
116
  * 子类可在 `super.loadSalesDetail` 之后基于返回的 `sales` 做业务侧装配
77
117
  * (比如把 `sales.customer` 写入 CustomerModule、emit 业务 hook 等)。
@@ -91,27 +131,61 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
91
131
  getPayments(): ISalesPayment[];
92
132
  /** 获取附加费用(运费/服务费/税费等)。 */
93
133
  getSurcharges(): ISalesSurcharge[];
94
- getTempOrder(): import("../../modules/Order/types").OrderTempOrder | null;
134
+ getTempOrder(): OrderTempOrder | null;
135
+ replaceTempOrder(tempOrder: OrderTempOrder): Promise<OrderTempOrder>;
95
136
  getOrderIdentity(): import("../../modules/Order/types").OrderIdentitySnapshot | null;
96
137
  getOrderSnapshot(): import("../../modules/Order/types").OrderSnapshot | null;
97
138
  getOrderSyncState(): import("../../modules/Order/types").OrderSyncState;
98
139
  getOrderAmountSnapshot(): import("../../modules/Order/types").OrderAmountSnapshot | null;
99
140
  getTempOrderNote(): string;
100
141
  updateTempOrderNote(note: string): string;
142
+ updateTempOrderNote(note: string, sync: true): Promise<string>;
143
+ updateTempOrderNote(note: string, sync: boolean): string | Promise<string>;
144
+ updateRemoteOrderNote(orderId: number | string, note: string): void;
101
145
  updateTempOrderShopDiscount(amount: string | number): string;
146
+ updateTempOrderDepositAmount(amount: string | number): OrderSummary;
102
147
  updateTempOrderContactsInfo(contactsInfo: Record<string, any> | null): Record<string, any> | null;
148
+ /** @deprecated OrderModule 不再负责 tempOrder localStorage 持久化。 */
149
+ setEnableTempOrderPersist(enabled: boolean): void;
150
+ /** 是否允许 saveDraft 写入 IndexedDB 草稿。 */
151
+ isTempOrderPersistEnabled(): boolean;
103
152
  private ensureTempOrder;
104
- addNewOrder(): Promise<import("../../modules/Order/types").OrderTempOrder>;
153
+ addNewOrder(): Promise<OrderTempOrder>;
105
154
  saveDraft(): Promise<void>;
106
- restoreOrder(): Promise<import("../../modules/Order/types").OrderTempOrder>;
155
+ restoreOrder(): Promise<OrderTempOrder>;
156
+ /**
157
+ * 仅清空 tempOrder 购物车行(products / bookings / discount_list)。
158
+ * 同步清空内存中的 salesDetail 商品/预约视图,避免编辑态仍读到旧 bookings。
159
+ */
160
+ clearOrderCartLines(): Promise<OrderTempOrder>;
107
161
  getOrderProducts(): import("../../modules/Order/types").OrderProduct[];
108
- getSummary(): Promise<import("../../modules/Order/types").OrderSummary>;
162
+ getSummary(): Promise<OrderSummary>;
163
+ private getHistoricalProductDiscountList;
164
+ private isPersistedOrderProduct;
165
+ private mergeHistoricalDiscountList;
166
+ private shouldSkipAutoApplyFetchedDiscountsInEditMode;
167
+ private mergeCurrentDiscountSelectionState;
168
+ loadDiscountConfig(params?: {
169
+ customerId?: number;
170
+ action?: 'create' | 'edit';
171
+ }): Promise<{
172
+ productList: Record<string, any>[];
173
+ discountList: Discount[];
174
+ }>;
175
+ bestDiscount(cb?: (result: any) => void): Promise<{
176
+ productList: Record<string, any>[];
177
+ discountList: Discount[];
178
+ }>;
109
179
  getDiscountList(): Discount[];
110
180
  scanPromotionCode(code: string, customerId?: number): Promise<BaseSalesScanCodeResult>;
111
181
  setDiscountSelected(params: {
112
182
  discountId: number;
113
183
  isSelected: boolean;
114
184
  }): Promise<void>;
185
+ applyDiscountCalculationResult(result?: {
186
+ productList?: Record<string, any>[];
187
+ discountList?: Discount[];
188
+ }): Promise<void>;
115
189
  submitScanOrder<T = any>(params?: {
116
190
  payments?: OrderPaymentSource[];
117
191
  paymentStatus?: BaseSalesPaymentStatus;
@@ -130,6 +204,14 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
130
204
  smallTicketDataFlag?: number;
131
205
  enhancePayload?: SubmitPayloadEnhancer;
132
206
  }): Promise<T>;
207
+ submitTempOrderAsync<T = any>(params?: {
208
+ payments?: OrderPaymentSource[];
209
+ paymentStatus?: BaseSalesPaymentStatus;
210
+ smallTicketDataFlag?: number;
211
+ enhancePayload?: SubmitPayloadEnhancer;
212
+ }): Promise<T>;
213
+ printLocalOrderReceipt<T = any>(lookup?: BaseSalesPrintLocalOrderReceiptParams): Promise<T>;
214
+ private getSubmitPaymentStatus;
133
215
  syncPaymentsToOrder<T = any>(params: SyncPaymentsToOrderParams): Promise<SyncPaymentsToOrderResult<T>>;
134
216
  /** 读取当前 BaseSales 订单上下文中的 Sales 协议支付项。 */
135
217
  getOrderPayments(): OrderPaymentData[];
@@ -160,7 +242,9 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
160
242
  email: string;
161
243
  };
162
244
  /** 获取可用支付方式列表,供 PaymentModal 渲染支付选项。 */
163
- getPaymentMethodsAsync(): Promise<any[]>;
245
+ getPaymentMethodsAsync(): Promise<PaymentMethod[]>;
246
+ /** 同步读取初始化时缓存的支付方式列表。 */
247
+ getPaymentMethods(): PaymentMethod[];
164
248
  /** 轻量舍入能力,供现金支付 UI 计算 rounding_amount。 */
165
249
  roundAmount(params: {
166
250
  amount: string | number;
@@ -183,14 +267,53 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
183
267
  submitBeforeSend?: boolean;
184
268
  }): Promise<T>;
185
269
  transformBaseProductToOrderProduct(params: TransformBaseProductToOrderProductParams): import("./utils/transformBaseProductToOrderProduct").BaseProductOrderProductInput | null;
270
+ calculateProductBookingPrice(params: BaseSalesCalculateProductBookingPriceParams): Promise<BaseSalesProductBookingPriceResult>;
186
271
  addProductToOrder(product: Partial<BaseSalesOrderProduct> & BaseSalesOrderProductIdentity, booking?: AddProductBookingInput): Promise<import("../../modules/Order/types").OrderProduct[]>;
187
- updateProductInOrder(params: UpdateProductInOrderParams): Promise<import("../../modules/Order/types").OrderProduct[]>;
272
+ updateOrderProduct(params: UpdateOrderProductParams): Promise<import("../../modules/Order/types").OrderProduct[]>;
273
+ updateOrderProductQuantity(params: BaseSalesUpdateOrderProductQuantityParams): Promise<import("../../modules/Order/types").OrderProduct[]>;
274
+ updateOrderBooking(params: UpdateOrderBookingParams): any[];
188
275
  /**
189
276
  * 设置单行商品备注(与整单 `updateTempOrderNote` 区分)。
190
277
  * 多行同 SKU 时必须传入与删除/更新一致的 unique_identification_number。
191
278
  */
192
279
  setOrderProductLineNote(identity: BaseSalesOrderProductIdentity, note: string): Promise<import("../../modules/Order/types").OrderProduct[]>;
280
+ /**
281
+ * 批量删除购物车行,末尾仅一次促销重算。
282
+ *
283
+ * @example
284
+ * await baseSales.removeProductsFromOrder([identityA, identityB]);
285
+ */
286
+ removeProductsFromOrder(identities: BaseSalesOrderProductIdentity[]): Promise<import("../../modules/Order/types").OrderProduct[]>;
193
287
  removeProductFromOrder(identity: BaseSalesOrderProductIdentity): Promise<import("../../modules/Order/types").OrderProduct[]>;
288
+ /**
289
+ * 注入促销评估器到底层 OrderModule。
290
+ *
291
+ * @example
292
+ * solution.setPromotionEvaluator(appHelper.utils.promotionEvaluator);
293
+ */
294
+ setPromotionEvaluator(evaluator: OrderPromotionEvaluator | null): void;
295
+ /**
296
+ * 注入赠品选择 resolver。UI 层(SalesSdk)通过 bridge 提供。
297
+ *
298
+ * @example
299
+ * solution.setGiftSelectResolver(async (ctx) => bridge.request(ctx));
300
+ */
301
+ setGiftSelectResolver(resolver: OrderGiftSelectResolver | null): void;
302
+ /**
303
+ * 为商品目录追加促销标签,供 SalesSdkProductProvider 等商品列表入口复用。
304
+ *
305
+ * @example
306
+ * const products = solution.appendPromotionTags(catalogProducts);
307
+ */
308
+ appendPromotionTags<T extends Record<string, any>>(products: T[]): T[];
309
+ /**
310
+ * 主动触发一次促销应用(一般写路径会自动触发,少数场景如客户切换后可手动调)。
311
+ */
312
+ applyPromotion(): Promise<void>;
313
+ /** 最近一次促销计算输出的未满足提示。 */
314
+ getUnfulfilledPromotions(): OrderUnfulfilledPromotion[];
315
+ /** 最近一次促销计算输出的赠品操作 diff。 */
316
+ getLastGiftActions(): OrderLastGiftActions | null;
194
317
  getProductList(): Promise<any>;
195
318
  getOtherParams(): Record<string, any>;
196
319
  setOtherParams(params: Record<string, any>, { cover }?: {