@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
@@ -0,0 +1,136 @@
1
+ /**
2
+ * BookingTicket - 预约状态相关纯函数。
3
+ *
4
+ * 该文件不持有任何运行时引用(无 request / store / effects),
5
+ * 只做字段解析与本地数组的原地写入/回滚,便于独立单测与未来其他
6
+ * booking 写操作(editBooking / cancelBooking 等)复用。
7
+ *
8
+ * 设计依据:参考 .cursor/rules/data-field-semantics.mdc,
9
+ * 字段含义严格对齐既有协议(OrderTempOrder / parseSalesResponse),
10
+ * 不发明等价关系。
11
+ */
12
+
13
+ /**
14
+ * 子预约状态机转移动作(POST /schedule/booking-transition/{schedule_event_id})。
15
+ *
16
+ * @example
17
+ * await bookingTicket.transitionChildBooking({
18
+ * schedule_event_id: 301,
19
+ * action: 'confirm',
20
+ * });
21
+ */
22
+
23
+ /** 子预约状态转移入参 */
24
+
25
+ /**
26
+ * 从 tempOrder 解析用于调用 appointment-status 接口的 schedule id。
27
+ *
28
+ * 优先级:
29
+ * 1. `tempOrder.metadata.appointment_booking_parent_schedule_id`
30
+ * 2. `tempOrder.bookings` 中 `parent_id === 0` 的 `schedule_event_id`
31
+ *
32
+ * 都缺失时返回 null,由调用方决定如何抛错。
33
+ */
34
+ export function resolveScheduleId(tempOrder) {
35
+ var _tempOrder$metadata;
36
+ if (!tempOrder) return null;
37
+ var metaScheduleId = (_tempOrder$metadata = tempOrder.metadata) === null || _tempOrder$metadata === void 0 ? void 0 : _tempOrder$metadata.appointment_booking_parent_schedule_id;
38
+ if (metaScheduleId !== undefined && metaScheduleId !== null) {
39
+ return metaScheduleId;
40
+ }
41
+ var bookings = Array.isArray(tempOrder.bookings) ? tempOrder.bookings : [];
42
+ var rootBooking = bookings.find(function (b) {
43
+ return (b === null || b === void 0 ? void 0 : b.parent_id) === 0;
44
+ });
45
+ var fallback = rootBooking === null || rootBooking === void 0 ? void 0 : rootBooking.schedule_event_id;
46
+ return fallback !== undefined && fallback !== null ? fallback : null;
47
+ }
48
+
49
+ /**
50
+ * 原地把所有 bookings 的 `appointment_status` 覆盖为新值,
51
+ * 返回原 status 数组用于回滚(顺序与 bookings 一一对应)。
52
+ *
53
+ * - 元素为 null/undefined 时跳过写入(但占位仍保留以保证回滚下标对齐)
54
+ * - 不会克隆 booking 对象,保持与 OrderModule.tempOrder 引用一致
55
+ */
56
+ export function applyBookingsStatus(bookings, status) {
57
+ if (!Array.isArray(bookings)) return [];
58
+ var previous = bookings.map(function (b) {
59
+ return b === null || b === void 0 ? void 0 : b.appointment_status;
60
+ });
61
+ bookings.forEach(function (b) {
62
+ if (b) b.appointment_status = status;
63
+ });
64
+ return previous;
65
+ }
66
+
67
+ /**
68
+ * 把 applyBookingsStatus 的返回值原地写回,撤销乐观更新。
69
+ * 长度不一致时按较短一方对齐(防御式编程,正常路径不会发生)。
70
+ */
71
+ export function restoreBookingsStatus(bookings, previous) {
72
+ if (!Array.isArray(bookings)) return;
73
+ var len = Math.min(bookings.length, previous.length);
74
+ for (var i = 0; i < len; i += 1) {
75
+ var b = bookings[i];
76
+ if (b) b.appointment_status = previous[i];
77
+ }
78
+ }
79
+
80
+ /**
81
+ * 将状态机 action 解析为转移后的 `appointment_status`。
82
+ *
83
+ * `reschedule` 暂未在状态矩阵启用,返回 null 表示跳过乐观更新。
84
+ *
85
+ * @example
86
+ * resolveStatusAfterTransition('confirm'); // 'confirmed'
87
+ */
88
+ export function resolveStatusAfterTransition(action) {
89
+ var _map$action;
90
+ var map = {
91
+ confirm: 'confirmed',
92
+ reject: 'rejected',
93
+ arrive: 'arrived',
94
+ start: 'started',
95
+ complete: 'completed',
96
+ cancel: 'cancelled',
97
+ no_show: 'no_show',
98
+ reschedule: null
99
+ };
100
+ return (_map$action = map[action]) !== null && _map$action !== void 0 ? _map$action : null;
101
+ }
102
+
103
+ /**
104
+ * 在 bookings 中按 `schedule_event_id` 定位子预约并乐观写入 `appointment_status`。
105
+ *
106
+ * @returns 写入前的 status;未命中时返回 undefined(调用方跳过回滚)
107
+ *
108
+ * @example
109
+ * const prev = applyChildBookingStatus(tempOrder.bookings, 301, 'confirmed');
110
+ */
111
+ export function applyChildBookingStatus(bookings, scheduleEventId, status) {
112
+ var _bookings$idx;
113
+ if (!Array.isArray(bookings)) return undefined;
114
+ var idx = bookings.findIndex(function (b) {
115
+ return b && String(b.schedule_event_id) === String(scheduleEventId);
116
+ });
117
+ if (idx === -1) return undefined;
118
+ var previous = (_bookings$idx = bookings[idx]) === null || _bookings$idx === void 0 ? void 0 : _bookings$idx.appointment_status;
119
+ bookings[idx].appointment_status = status;
120
+ return previous;
121
+ }
122
+
123
+ /**
124
+ * 撤销 applyChildBookingStatus 对单条子预约的乐观写入。
125
+ *
126
+ * @example
127
+ * restoreChildBookingStatus(tempOrder.bookings, 301, prev);
128
+ */
129
+ export function restoreChildBookingStatus(bookings, scheduleEventId, previous) {
130
+ if (!Array.isArray(bookings) || previous === undefined) return;
131
+ var idx = bookings.findIndex(function (b) {
132
+ return b && String(b.schedule_event_id) === String(scheduleEventId);
133
+ });
134
+ if (idx === -1) return;
135
+ bookings[idx].appointment_status = previous;
136
+ }
@@ -0,0 +1,29 @@
1
+ import type { BaseSalesOrderProduct } from '../../BaseSales';
2
+ import type { ISalesBooking } from '../../BaseSales/utils/parseSalesResponse';
3
+ import type { BookingTicketCartView, BookingTicketCustomerView, ICustomer } from '../types';
4
+ import type { ScanOrderTempOrder } from '../../ScanOrder/types';
5
+ export interface BuildCartViewOptions {
6
+ addTimeProducts?: any[];
7
+ bookingConfig?: Record<string, any> | null;
8
+ productsByUid?: Record<string, {
9
+ origin?: Record<string, any>;
10
+ }>;
11
+ shopOpeningHours?: string;
12
+ }
13
+ /**
14
+ * 仅按 booking.product_uid 建索引,避免发明 booking 与商品行之间的其它等价关系。
15
+ */
16
+ export declare function indexBookingsByProductUid(bookings: ISalesBooking[] | undefined | null): Record<string, ISalesBooking[]>;
17
+ /**
18
+ * 构建购物车 UI 视图:bookings 平铺附带关联商品;items 仅含未关联 booking 的商品行。
19
+ *
20
+ * 商品行直接透传 tempOrder.products,不做 enrichment。
21
+ * 关联规则(1:1):booking.product_uid ↔ line.metadata.unique_identification_number;
22
+ * 同一 uid 已被更早的 booking 占用时,后续 booking 的 product 为 null。
23
+ */
24
+ export declare function buildCartView(lines: BaseSalesOrderProduct[] | undefined | null, bookings: ISalesBooking[] | undefined | null, options?: BuildCartViewOptions): BookingTicketCartView;
25
+ export declare function isWalkInCustomer(customer: Pick<ICustomer, 'id'> | null | undefined): boolean;
26
+ /**
27
+ * selected 优先,缺失时回退 tempOrder.customer_*,统一输出 UI 客户视图。
28
+ */
29
+ export declare function buildCustomerView(selected: ICustomer | null | undefined, tempOrder: ScanOrderTempOrder | null | undefined): BookingTicketCustomerView | null;
@@ -0,0 +1,209 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
+ import { resolveBookingCanAddTime } from "./addTimeAvailability";
8
+ /**
9
+ * 仅按 booking.product_uid 建索引,避免发明 booking 与商品行之间的其它等价关系。
10
+ */
11
+ export function indexBookingsByProductUid(bookings) {
12
+ if (!Array.isArray(bookings) || bookings.length === 0) return {};
13
+ return bookings.reduce(function (acc, booking) {
14
+ var uid = booking === null || booking === void 0 ? void 0 : booking.product_uid;
15
+ if (uid === undefined || uid === null || uid === '') return acc;
16
+ var key = String(uid);
17
+ if (!acc[key]) acc[key] = [];
18
+ acc[key].push(booking);
19
+ return acc;
20
+ }, {});
21
+ }
22
+
23
+ /**
24
+ * 商品行按 unique_identification_number 建 1:1 索引(同 uid 多行时保留首行)。
25
+ */
26
+ function indexProductsByUid(lines) {
27
+ return lines.reduce(function (acc, line) {
28
+ var _line$metadata;
29
+ var uid = (_line$metadata = line.metadata) === null || _line$metadata === void 0 ? void 0 : _line$metadata.unique_identification_number;
30
+ if (uid === undefined || uid === null || uid === '') return acc;
31
+ var key = String(uid);
32
+ if (!acc[key]) acc[key] = line;
33
+ return acc;
34
+ }, {});
35
+ }
36
+
37
+ /**
38
+ * 读取 booking 的协议唯一值。
39
+ *
40
+ * @example
41
+ * const uid = getBookingUid(booking);
42
+ */
43
+ function getBookingUid(booking) {
44
+ var _booking$metadata;
45
+ var uid = booking === null || booking === void 0 || (_booking$metadata = booking.metadata) === null || _booking$metadata === void 0 ? void 0 : _booking$metadata.unique_identification_number;
46
+ return uid === undefined || uid === null ? '' : String(uid);
47
+ }
48
+
49
+ /**
50
+ * 读取商品行绑定的 booking 唯一值。
51
+ *
52
+ * @example
53
+ * const bookingUid = getProductBookingUid(product);
54
+ */
55
+ function getProductBookingUid(line) {
56
+ var _booking_uid, _line$metadata2;
57
+ var uid = (_booking_uid = line === null || line === void 0 ? void 0 : line.booking_uid) !== null && _booking_uid !== void 0 ? _booking_uid : line === null || line === void 0 || (_line$metadata2 = line.metadata) === null || _line$metadata2 === void 0 ? void 0 : _line$metadata2.booking_uid;
58
+ return uid === undefined || uid === null ? '' : String(uid);
59
+ }
60
+
61
+ /**
62
+ * 判断商品行是否为加时商品行。
63
+ *
64
+ * @example
65
+ * isAddTimeProductLine({ metadata: { product_add_schedule_time: 30 } } as any);
66
+ */
67
+ function isAddTimeProductLine(line) {
68
+ var _line$metadata3, _line$metadata4;
69
+ return (line === null || line === void 0 || (_line$metadata3 = line.metadata) === null || _line$metadata3 === void 0 ? void 0 : _line$metadata3.product_add_schedule_time) !== undefined && (line === null || line === void 0 || (_line$metadata4 = line.metadata) === null || _line$metadata4 === void 0 ? void 0 : _line$metadata4.product_add_schedule_time) !== null;
70
+ }
71
+
72
+ /**
73
+ * 将加时商品按 booking_uid 建索引。
74
+ *
75
+ * @example
76
+ * const map = indexAddTimeProductsByBookingUid(products);
77
+ */
78
+ function indexAddTimeProductsByBookingUid(lines) {
79
+ return lines.reduce(function (acc, line) {
80
+ if (!isAddTimeProductLine(line)) return acc;
81
+ var bookingUid = getProductBookingUid(line);
82
+ if (!bookingUid) return acc;
83
+ if (!acc[bookingUid]) acc[bookingUid] = [];
84
+ acc[bookingUid].push(line);
85
+ return acc;
86
+ }, {});
87
+ }
88
+
89
+ /**
90
+ * 判断商品行是否是促销赠品行。
91
+ *
92
+ * @example
93
+ * isGiftProductLine({ metadata: { _giftInfo: {} } } as any); // true
94
+ */
95
+ function isGiftProductLine(line) {
96
+ var _line$metadata5;
97
+ return Boolean(line === null || line === void 0 || (_line$metadata5 = line.metadata) === null || _line$metadata5 === void 0 ? void 0 : _line$metadata5._giftInfo);
98
+ }
99
+
100
+ /**
101
+ * 构建购物车 UI 视图:bookings 平铺附带关联商品;items 仅含未关联 booking 的商品行。
102
+ *
103
+ * 商品行直接透传 tempOrder.products,不做 enrichment。
104
+ * 关联规则(1:1):booking.product_uid ↔ line.metadata.unique_identification_number;
105
+ * 同一 uid 已被更早的 booking 占用时,后续 booking 的 product 为 null。
106
+ */
107
+ export function buildCartView(lines, bookings) {
108
+ var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
109
+ var productLines = Array.isArray(lines) ? lines : [];
110
+ var bookingList = Array.isArray(bookings) ? bookings : [];
111
+ var linesByUid = indexProductsByUid(productLines);
112
+ var addTimeLinesByBookingUid = indexAddTimeProductsByBookingUid(productLines);
113
+ var claimedUids = new Set();
114
+ var claimedAddTimeLines = new Set();
115
+ var cartBookings = bookingList.filter(function (booking) {
116
+ return booking.parent_id !== 0;
117
+ }).reduce(function (acc, booking) {
118
+ var uid = booking === null || booking === void 0 ? void 0 : booking.product_uid;
119
+ var bookingUid = getBookingUid(booking);
120
+ var product = null;
121
+ if (uid !== undefined && uid !== null && uid !== '') {
122
+ var key = String(uid);
123
+ if (!claimedUids.has(key)) {
124
+ var line = linesByUid[key];
125
+ // 赠品预约只作为提交数据保留,不在购物车顶部预约卡片区展示。
126
+ if (isGiftProductLine(line)) return acc;
127
+ if (line) {
128
+ claimedUids.add(key);
129
+ product = line;
130
+ }
131
+ }
132
+ }
133
+ var addTimeProduct = bookingUid ? addTimeLinesByBookingUid[bookingUid] || [] : [];
134
+ addTimeProduct.forEach(function (line) {
135
+ return claimedAddTimeLines.add(line);
136
+ });
137
+ acc.push(_objectSpread(_objectSpread({}, booking), {}, {
138
+ _extend: {
139
+ product: product,
140
+ addTimeProduct: addTimeProduct,
141
+ canAddTime: resolveBookingCanAddTime({
142
+ booking: booking,
143
+ product: product,
144
+ addTimeProducts: options.addTimeProducts,
145
+ bookingConfig: options.bookingConfig,
146
+ productsByUid: options.productsByUid,
147
+ shopOpeningHours: options.shopOpeningHours
148
+ })
149
+ }
150
+ }));
151
+ return acc;
152
+ }, []);
153
+ var items = productLines.filter(function (line) {
154
+ var _line$metadata6;
155
+ // 促销赠品行仅通过主商品 Gift 行展示,不在 items 单独占一行(对齐 legacy `isGift: !!_giftInfo`)
156
+ if (isGiftProductLine(line)) return false;
157
+ if (claimedAddTimeLines.has(line)) return false;
158
+ var uid = (_line$metadata6 = line.metadata) === null || _line$metadata6 === void 0 ? void 0 : _line$metadata6.unique_identification_number;
159
+ if (uid === undefined || uid === null || uid === '') return true;
160
+ return !claimedUids.has(String(uid));
161
+ });
162
+ return {
163
+ bookings: cartBookings,
164
+ items: items
165
+ };
166
+ }
167
+ export function isWalkInCustomer(customer) {
168
+ if (!customer) return true;
169
+ var id = customer.id;
170
+ if (id === undefined || id === null) return true;
171
+ if (typeof id === 'string') {
172
+ return ['', '0', '1'].includes(id);
173
+ }
174
+ return [0, 1].includes(id);
175
+ }
176
+
177
+ /**
178
+ * selected 优先,缺失时回退 tempOrder.customer_*,统一输出 UI 客户视图。
179
+ */
180
+ export function buildCustomerView(selected, tempOrder) {
181
+ if (selected && selected.id !== undefined && selected.id !== null && selected.id !== '' && selected.id !== 0) {
182
+ var _selected$name;
183
+ return {
184
+ id: selected.id,
185
+ name: (_selected$name = selected.name) !== null && _selected$name !== void 0 ? _selected$name : '',
186
+ phone: selected.phone,
187
+ email: selected.email,
188
+ country_calling_code: selected.country_calling_code,
189
+ cover: selected.cover,
190
+ isWalkIn: isWalkInCustomer(selected)
191
+ };
192
+ }
193
+ if (tempOrder && (tempOrder.customer_id != null || tempOrder.customer_name)) {
194
+ var _tempOrder$customer_i, _tempOrder$customer_n;
195
+ var id = (_tempOrder$customer_i = tempOrder.customer_id) !== null && _tempOrder$customer_i !== void 0 ? _tempOrder$customer_i : '';
196
+ return {
197
+ id: id,
198
+ name: (_tempOrder$customer_n = tempOrder.customer_name) !== null && _tempOrder$customer_n !== void 0 ? _tempOrder$customer_n : '',
199
+ phone: tempOrder.phone,
200
+ email: tempOrder.email,
201
+ country_calling_code: tempOrder.country_calling_code,
202
+ cover: undefined,
203
+ isWalkIn: isWalkInCustomer({
204
+ id: id
205
+ })
206
+ };
207
+ }
208
+ return null;
209
+ }
@@ -0,0 +1,123 @@
1
+ declare let data: ({
2
+ id: number;
3
+ title: string;
4
+ price: number;
5
+ minMinutes: number;
6
+ maxMinutes: number;
7
+ unitMinutes: number;
8
+ unlimited: boolean;
9
+ _originalProduct: {
10
+ id: number;
11
+ extension_id: number;
12
+ extension_type: string;
13
+ shop_id: number;
14
+ title: string;
15
+ slug: string;
16
+ status: string;
17
+ stock_quantity: number;
18
+ sales_quantity: number;
19
+ sum_stock: number;
20
+ price: string;
21
+ original_price: string;
22
+ cost_price: string;
23
+ cover: string;
24
+ channel_application: string[];
25
+ is_track: number;
26
+ over_sold: number;
27
+ is_gst: number;
28
+ code: string;
29
+ barcode: string;
30
+ is_delivery: number;
31
+ weight_unit: string;
32
+ weight_value: string;
33
+ type: string;
34
+ unit: string;
35
+ sort: number;
36
+ subtitle: string;
37
+ minimum_markup_price: string;
38
+ is_bundle: number;
39
+ description: string;
40
+ open_sold_weight: number;
41
+ unit_value: number;
42
+ is_variant: number;
43
+ variant_count: number;
44
+ add_time: {
45
+ unit_duration: number;
46
+ min_add_time: number;
47
+ max_add_time: number;
48
+ calculate_type: string;
49
+ relation_product: {
50
+ type: string;
51
+ products: never[];
52
+ };
53
+ additional_time_options?: undefined;
54
+ };
55
+ shelf_product_datas: never[];
56
+ step_value: number;
57
+ min_num_unit: number;
58
+ is_charge_tax: number;
59
+ base_price: string;
60
+ variant: never[];
61
+ };
62
+ } | {
63
+ id: number;
64
+ title: string;
65
+ price: number;
66
+ minMinutes: number;
67
+ maxMinutes: number;
68
+ unitMinutes: number;
69
+ unlimited: boolean;
70
+ _originalProduct: {
71
+ id: number;
72
+ extension_id: number;
73
+ extension_type: string;
74
+ shop_id: number;
75
+ title: string;
76
+ slug: string;
77
+ status: string;
78
+ stock_quantity: number;
79
+ sales_quantity: number;
80
+ sum_stock: number;
81
+ price: string;
82
+ original_price: string;
83
+ cost_price: string;
84
+ cover: string;
85
+ channel_application: string[];
86
+ is_track: number;
87
+ over_sold: number;
88
+ is_gst: number;
89
+ code: string;
90
+ barcode: string;
91
+ is_delivery: number;
92
+ weight_unit: string;
93
+ weight_value: string;
94
+ type: string;
95
+ unit: string;
96
+ sort: number;
97
+ subtitle: string;
98
+ minimum_markup_price: string;
99
+ is_bundle: number;
100
+ description: string;
101
+ open_sold_weight: number;
102
+ unit_value: number;
103
+ is_variant: number;
104
+ variant_count: number;
105
+ add_time: {
106
+ additional_time_options: string;
107
+ unit_duration: number;
108
+ min_add_time: number;
109
+ max_add_time: number;
110
+ calculate_type: string;
111
+ relation_product: {
112
+ type: string;
113
+ products: never[];
114
+ };
115
+ };
116
+ shelf_product_datas: never[];
117
+ step_value: number;
118
+ min_num_unit: number;
119
+ is_charge_tax: number;
120
+ base_price: string;
121
+ variant: never[];
122
+ };
123
+ })[];
@@ -0,0 +1,183 @@
1
+ var data = [{
2
+ "id": 58299,
3
+ "title": "玄-加时商品-与数量无关-不指定商品",
4
+ "price": 1,
5
+ "minMinutes": 30,
6
+ "maxMinutes": 30,
7
+ "unitMinutes": 30,
8
+ "unlimited": false,
9
+ "_originalProduct": {
10
+ "id": 58299,
11
+ "extension_id": 384,
12
+ "extension_type": "product_add_time",
13
+ "shop_id": 9,
14
+ "title": "玄-加时商品-与数量无关-不指定商品",
15
+ "slug": "玄-加时商品-与数量无关-指定商品",
16
+ "status": "published",
17
+ "stock_quantity": -119,
18
+ "sales_quantity": 113,
19
+ "sum_stock": -119,
20
+ "price": "1.00",
21
+ "original_price": "4.00",
22
+ "cost_price": "0.00",
23
+ "cover": "",
24
+ "channel_application": ["online-store", "pos", "bbc-module:mebook"],
25
+ "is_track": 0,
26
+ "over_sold": 0,
27
+ "is_gst": 1,
28
+ "code": "",
29
+ "barcode": "",
30
+ "is_delivery": 0,
31
+ "weight_unit": "KILOGRAMS",
32
+ "weight_value": "0.00",
33
+ "type": "physical",
34
+ "unit": "",
35
+ "sort": 9999999,
36
+ "subtitle": "",
37
+ "minimum_markup_price": "0.00",
38
+ "is_bundle": 0,
39
+ "description": "",
40
+ "open_sold_weight": 0,
41
+ "unit_value": 0,
42
+ "is_variant": 0,
43
+ "variant_count": 0,
44
+ "add_time": {
45
+ "unit_duration": 30,
46
+ "min_add_time": 30,
47
+ "max_add_time": 30,
48
+ "calculate_type": "not_related_to_quantity",
49
+ "relation_product": {
50
+ "type": "product_all",
51
+ "products": []
52
+ }
53
+ },
54
+ "shelf_product_datas": [],
55
+ "step_value": 1,
56
+ "min_num_unit": 1,
57
+ "is_charge_tax": 1,
58
+ "base_price": "1.00",
59
+ "variant": []
60
+ }
61
+ }, {
62
+ "id": 58279,
63
+ "title": "加时商品2",
64
+ "price": 10,
65
+ "minMinutes": 30,
66
+ "maxMinutes": 120,
67
+ "unitMinutes": 10,
68
+ "unlimited": false,
69
+ "_originalProduct": {
70
+ "id": 58279,
71
+ "extension_id": 384,
72
+ "extension_type": "product_add_time",
73
+ "shop_id": 9,
74
+ "title": "加时商品2",
75
+ "slug": "加时商品2",
76
+ "status": "published",
77
+ "stock_quantity": -275,
78
+ "sales_quantity": 261,
79
+ "sum_stock": -275,
80
+ "price": "10.00",
81
+ "original_price": "10.00",
82
+ "cost_price": "0.00",
83
+ "cover": "",
84
+ "channel_application": ["online-store", "pos", "bbc-module:mebook"],
85
+ "is_track": 0,
86
+ "over_sold": 0,
87
+ "is_gst": 1,
88
+ "code": "",
89
+ "barcode": "",
90
+ "is_delivery": 0,
91
+ "weight_unit": "KILOGRAMS",
92
+ "weight_value": "0.00",
93
+ "type": "physical",
94
+ "unit": "",
95
+ "sort": 9999999,
96
+ "subtitle": "",
97
+ "minimum_markup_price": "0.00",
98
+ "is_bundle": 0,
99
+ "description": "",
100
+ "open_sold_weight": 0,
101
+ "unit_value": 0,
102
+ "is_variant": 0,
103
+ "variant_count": 0,
104
+ "add_time": {
105
+ "additional_time_options": "explicit_durations",
106
+ "unit_duration": 10,
107
+ "min_add_time": 30,
108
+ "max_add_time": 120,
109
+ "calculate_type": "not_related_to_quantity",
110
+ "relation_product": {
111
+ "type": "product_all",
112
+ "products": []
113
+ }
114
+ },
115
+ "shelf_product_datas": [],
116
+ "step_value": 1,
117
+ "min_num_unit": 1,
118
+ "is_charge_tax": 1,
119
+ "base_price": "10.00",
120
+ "variant": []
121
+ }
122
+ }, {
123
+ "id": 58277,
124
+ "title": "测试加时商品",
125
+ "price": 2,
126
+ "minMinutes": 30,
127
+ "maxMinutes": 780,
128
+ "unitMinutes": 30,
129
+ "unlimited": true,
130
+ "_originalProduct": {
131
+ "id": 58277,
132
+ "extension_id": 384,
133
+ "extension_type": "product_add_time",
134
+ "shop_id": 9,
135
+ "title": "测试加时商品",
136
+ "slug": "测试加时商品",
137
+ "status": "published",
138
+ "stock_quantity": -7,
139
+ "sales_quantity": 8,
140
+ "sum_stock": -7,
141
+ "price": "2.00",
142
+ "original_price": "0.00",
143
+ "cost_price": "0.00",
144
+ "cover": "",
145
+ "channel_application": ["online-store", "pos", "bbc-module:mebook"],
146
+ "is_track": 0,
147
+ "over_sold": 0,
148
+ "is_gst": 1,
149
+ "code": "",
150
+ "barcode": "",
151
+ "is_delivery": 0,
152
+ "weight_unit": "KILOGRAMS",
153
+ "weight_value": "0.00",
154
+ "type": "physical",
155
+ "unit": "",
156
+ "sort": 9999999,
157
+ "subtitle": "",
158
+ "minimum_markup_price": "0.00",
159
+ "is_bundle": 0,
160
+ "description": "",
161
+ "open_sold_weight": 0,
162
+ "unit_value": 0,
163
+ "is_variant": 0,
164
+ "variant_count": 0,
165
+ "add_time": {
166
+ "additional_time_options": "unlimited",
167
+ "unit_duration": 30,
168
+ "min_add_time": 30,
169
+ "max_add_time": 780,
170
+ "calculate_type": "select_quantity",
171
+ "relation_product": {
172
+ "type": "product_all",
173
+ "products": []
174
+ }
175
+ },
176
+ "shelf_product_datas": [],
177
+ "step_value": 1,
178
+ "min_num_unit": 1,
179
+ "is_charge_tax": 1,
180
+ "base_price": "2.00",
181
+ "variant": []
182
+ }
183
+ }];
@@ -0,0 +1,4 @@
1
+ import type { ICustomer } from '../types';
2
+ import type { OrderCustomerPatch } from '../../../modules/Order/types';
3
+ /** 将 ICustomer 格式化为写入 tempOrder 的协议字段。 */
4
+ export declare function formatOrderCustomerPatch(customer: ICustomer): OrderCustomerPatch;