@pisell/pisellos 0.0.567 → 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 (557) hide show
  1. package/dist/core/index.js +6 -9
  2. package/dist/model/strategy/adapter/promotion/evaluator.js +3 -2
  3. package/dist/model/strategy/adapter/walletPass/evaluator.js +0 -2
  4. package/dist/model/strategy/adapter/walletPass/example.js +3 -26
  5. package/dist/model/strategy/adapter/walletPass/utils.js +7 -7
  6. package/dist/model/strategy/strategy-example.js +5 -19
  7. package/dist/modules/BaseModule.d.ts +2 -2
  8. package/dist/modules/BaseModule.js +4 -4
  9. package/dist/modules/BookingContext/index.d.ts +48 -0
  10. package/dist/modules/BookingContext/index.js +566 -0
  11. package/dist/modules/BookingContext/types.d.ts +102 -0
  12. package/dist/modules/BookingContext/types.js +51 -0
  13. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts +16 -0
  14. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +302 -0
  15. package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +8 -0
  16. package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +149 -0
  17. package/dist/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +76 -0
  18. package/dist/modules/BookingContext/utils/cacheItemToBookingInput.js +249 -0
  19. package/dist/modules/BookingContext/utils/flexible.d.ts +28 -0
  20. package/dist/modules/BookingContext/utils/flexible.js +56 -0
  21. package/dist/modules/BookingContext/utils/formatResourceList.d.ts +8 -0
  22. package/dist/modules/BookingContext/utils/formatResourceList.js +38 -0
  23. package/dist/modules/BookingContext/utils/index.d.ts +11 -0
  24. package/dist/modules/BookingContext/utils/index.js +11 -0
  25. package/dist/modules/BookingContext/utils/noResource.d.ts +13 -0
  26. package/dist/modules/BookingContext/utils/noResource.js +77 -0
  27. package/dist/modules/BookingContext/utils/orderLineDisplay.d.ts +1 -0
  28. package/dist/modules/BookingContext/utils/orderLineDisplay.js +36 -0
  29. package/dist/modules/BookingContext/utils/productExtend.d.ts +72 -0
  30. package/dist/modules/BookingContext/utils/productExtend.js +339 -0
  31. package/dist/modules/BookingContext/utils/resourceErrors.d.ts +41 -0
  32. package/dist/modules/BookingContext/utils/resourceErrors.js +74 -0
  33. package/dist/modules/BookingContext/utils/resourceSelection.d.ts +7 -0
  34. package/dist/modules/BookingContext/utils/resourceSelection.js +24 -0
  35. package/dist/modules/BookingContext/utils/resources.d.ts +80 -0
  36. package/dist/modules/BookingContext/utils/resources.js +486 -0
  37. package/dist/modules/BookingContext/utils/serviceTimes.d.ts +55 -0
  38. package/dist/modules/BookingContext/utils/serviceTimes.js +151 -0
  39. package/dist/modules/BookingContext/utils/timeSlices.d.ts +42 -0
  40. package/dist/modules/BookingContext/utils/timeSlices.js +100 -0
  41. package/dist/modules/Cart/index.js +0 -3
  42. package/dist/modules/Cart/utils/cartProduct.js +26 -6
  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 +2 -0
  47. package/dist/modules/Date/index.js +1 -5
  48. package/dist/modules/Discount/index.d.ts +2 -1
  49. package/dist/modules/Discount/index.js +37 -12
  50. package/dist/modules/Discount/types.d.ts +1 -0
  51. package/dist/modules/OpenData/index.d.ts +8 -0
  52. package/dist/modules/OpenData/index.js +35 -17
  53. package/dist/modules/Order/index.d.ts +449 -24
  54. package/dist/modules/Order/index.js +5437 -608
  55. package/dist/modules/Order/types.d.ts +693 -88
  56. package/dist/modules/Order/types.js +68 -1
  57. package/dist/modules/Order/utils/bundleDiscountHydration.d.ts +5 -0
  58. package/dist/modules/Order/utils/bundleDiscountHydration.js +144 -0
  59. package/dist/modules/Order/utils/manualProductDiscount.d.ts +106 -0
  60. package/dist/modules/Order/utils/manualProductDiscount.js +210 -0
  61. package/dist/modules/Order/utils/orderCollectionIdentity.d.ts +53 -0
  62. package/dist/modules/Order/utils/orderCollectionIdentity.js +405 -0
  63. package/dist/modules/Order/utils.d.ts +167 -18
  64. package/dist/modules/Order/utils.js +960 -165
  65. package/dist/modules/Payment/index.d.ts +10 -9
  66. package/dist/modules/Payment/index.js +508 -874
  67. package/dist/modules/Payment/types.d.ts +40 -16
  68. package/dist/modules/Payment/utils.d.ts +1 -1
  69. package/dist/modules/Payment/utils.js +4 -3
  70. package/dist/modules/Payment/walletpass.js +48 -34
  71. package/dist/modules/Product/types.d.ts +29 -7
  72. package/dist/modules/ProductList/index.d.ts +17 -13
  73. package/dist/modules/ProductList/index.js +184 -74
  74. package/dist/modules/ProductList/types.d.ts +17 -0
  75. package/dist/modules/Quotation/index.d.ts +22 -2
  76. package/dist/modules/Quotation/index.js +108 -42
  77. package/dist/modules/Quotation/types.d.ts +19 -0
  78. package/dist/modules/ResourcePlanner/index.d.ts +24 -0
  79. package/dist/modules/ResourcePlanner/index.js +181 -0
  80. package/dist/modules/ResourcePlanner/planner.d.ts +14 -0
  81. package/dist/modules/ResourcePlanner/planner.js +1069 -0
  82. package/dist/modules/ResourcePlanner/types.d.ts +227 -0
  83. package/dist/modules/ResourcePlanner/types.js +1 -0
  84. package/dist/modules/Rules/index.d.ts +8 -10
  85. package/dist/modules/Rules/index.js +219 -114
  86. package/dist/modules/Rules/types.d.ts +14 -3
  87. package/dist/modules/SalesSummary/index.d.ts +23 -26
  88. package/dist/modules/SalesSummary/index.js +152 -46
  89. package/dist/modules/SalesSummary/types.d.ts +9 -1
  90. package/dist/modules/SalesSummary/utils.d.ts +3 -22
  91. package/dist/modules/SalesSummary/utils.js +803 -163
  92. package/dist/modules/Schedule/getDateIsInSchedule.js +14 -7
  93. package/dist/modules/Schedule/index.d.ts +18 -5
  94. package/dist/modules/Schedule/index.js +78 -24
  95. package/dist/modules/Schedule/types.d.ts +2 -0
  96. package/dist/modules/Schedule/utils.js +0 -1
  97. package/dist/modules/Step/index.js +0 -1
  98. package/dist/modules/Summary/index.js +4 -3
  99. package/dist/modules/SurchargeList/index.d.ts +18 -0
  100. package/dist/modules/SurchargeList/index.js +185 -0
  101. package/dist/modules/SurchargeList/types.d.ts +15 -0
  102. package/dist/modules/SurchargeList/types.js +1 -0
  103. package/dist/modules/index.d.ts +3 -0
  104. package/dist/modules/index.js +4 -1
  105. package/dist/plugins/app.d.ts +2 -0
  106. package/dist/plugins/request.d.ts +1 -0
  107. package/dist/plugins/request.js +1 -4
  108. package/dist/plugins/window.js +2 -6
  109. package/dist/server/index.d.ts +462 -8
  110. package/dist/server/index.js +6137 -714
  111. package/dist/server/modules/floor-plan/index.d.ts +39 -0
  112. package/dist/server/modules/floor-plan/index.js +595 -0
  113. package/dist/server/modules/floor-plan/types.d.ts +43 -0
  114. package/dist/server/modules/floor-plan/types.js +13 -0
  115. package/dist/server/modules/index.d.ts +7 -2
  116. package/dist/server/modules/index.js +6 -0
  117. package/dist/server/modules/menu/index.js +32 -41
  118. package/dist/server/modules/order/index.d.ts +207 -14
  119. package/dist/server/modules/order/index.js +2326 -379
  120. package/dist/server/modules/order/types.d.ts +76 -5
  121. package/dist/server/modules/order/types.js +14 -1
  122. package/dist/server/modules/order/utils/filterBookings.d.ts +7 -1
  123. package/dist/server/modules/order/utils/filterBookings.js +118 -11
  124. package/dist/server/modules/order/utils/filterOrders.js +242 -14
  125. package/dist/server/modules/payment/index.d.ts +28 -0
  126. package/dist/server/modules/payment/index.js +305 -0
  127. package/dist/server/modules/payment/types.d.ts +9 -0
  128. package/dist/server/modules/payment/types.js +1 -0
  129. package/dist/server/modules/products/index.d.ts +105 -14
  130. package/dist/server/modules/products/index.js +1397 -540
  131. package/dist/server/modules/products/types.d.ts +34 -1
  132. package/dist/server/modules/products/types.js +4 -0
  133. package/dist/server/modules/quotation/index.d.ts +39 -0
  134. package/dist/server/modules/quotation/index.js +289 -86
  135. package/dist/server/modules/resource/index.d.ts +2 -3
  136. package/dist/server/modules/resource/index.js +105 -84
  137. package/dist/server/modules/schedule/index.d.ts +6 -4
  138. package/dist/server/modules/schedule/index.js +137 -114
  139. package/dist/server/test.json +713 -0
  140. package/dist/server/types.d.ts +2 -0
  141. package/dist/server/utils/product.js +2 -3
  142. package/dist/server/utils/small-ticket.d.ts +71 -0
  143. package/dist/server/utils/small-ticket.js +963 -0
  144. package/dist/solution/BaseSales/index.d.ts +378 -0
  145. package/dist/solution/BaseSales/index.js +4006 -0
  146. package/dist/solution/BaseSales/types.d.ts +394 -0
  147. package/dist/solution/BaseSales/types.js +40 -0
  148. package/dist/solution/BaseSales/utils/cartPromotion.d.ts +287 -0
  149. package/dist/solution/BaseSales/utils/cartPromotion.js +1450 -0
  150. package/dist/solution/BaseSales/utils/parseSalesResponse.d.ts +144 -0
  151. package/dist/solution/BaseSales/utils/parseSalesResponse.js +157 -0
  152. package/dist/solution/BaseSales/utils/quotationPrice.d.ts +18 -0
  153. package/dist/solution/BaseSales/utils/quotationPrice.js +250 -0
  154. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +63 -0
  155. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +218 -0
  156. package/dist/solution/BaseSales/utils.d.ts +40 -0
  157. package/dist/solution/BaseSales/utils.js +263 -0
  158. package/dist/solution/BookingByStep/index.js +7 -59
  159. package/dist/solution/BookingByStep/utils/capacity.js +1 -11
  160. package/dist/solution/BookingByStep/utils/resources.js +1 -3
  161. package/dist/solution/BookingByStep/utils/timeslots.js +2 -43
  162. package/dist/solution/BookingTicket/index.d.ts +393 -24
  163. package/dist/solution/BookingTicket/index.js +2506 -445
  164. package/dist/solution/BookingTicket/types.d.ts +191 -6
  165. package/dist/solution/BookingTicket/types.js +83 -10
  166. package/dist/solution/BookingTicket/utils/addProductDecision.d.ts +117 -0
  167. package/dist/solution/BookingTicket/utils/addProductDecision.js +346 -0
  168. package/dist/solution/BookingTicket/utils/addTimeAvailability.d.ts +35 -0
  169. package/dist/solution/BookingTicket/utils/addTimeAvailability.js +95 -0
  170. package/dist/solution/BookingTicket/utils/bookingStatus.d.ts +77 -0
  171. package/dist/solution/BookingTicket/utils/bookingStatus.js +136 -0
  172. package/dist/solution/BookingTicket/utils/cartView.d.ts +29 -0
  173. package/dist/solution/BookingTicket/utils/cartView.js +209 -0
  174. package/dist/solution/BookingTicket/utils/exampleData.d.ts +123 -0
  175. package/dist/solution/BookingTicket/utils/exampleData.js +183 -0
  176. package/dist/solution/BookingTicket/utils/orderCustomer.d.ts +4 -0
  177. package/dist/solution/BookingTicket/utils/orderCustomer.js +31 -0
  178. package/dist/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +185 -0
  179. package/dist/solution/BookingTicket/utils/resolveBestAddTimePlan.js +438 -0
  180. package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +36 -0
  181. package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +400 -0
  182. package/dist/solution/BookingTicket/utils/scan/cloudSearch.d.ts +4 -0
  183. package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +41 -1
  184. package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +32 -0
  185. package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.js +56 -0
  186. package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +3 -1
  187. package/dist/solution/BookingTicket/utils/scan/handleScan.js +36 -34
  188. package/dist/solution/BookingTicket/utils/scan/index.d.ts +5 -0
  189. package/dist/solution/BookingTicket/utils/scan/index.js +26 -18
  190. package/dist/solution/BookingTicket/utils/scan/scanProductValues.d.ts +21 -0
  191. package/dist/solution/BookingTicket/utils/scan/scanProductValues.js +150 -0
  192. package/dist/solution/BookingTicket/utils/sessionCatalogStale.d.ts +23 -0
  193. package/dist/solution/BookingTicket/utils/sessionCatalogStale.js +78 -0
  194. package/dist/solution/BuyTickets/index.js +9 -12
  195. package/dist/solution/Checkout/index.d.ts +1 -0
  196. package/dist/solution/Checkout/index.js +199 -277
  197. package/dist/solution/Checkout/utils/index.js +8 -20
  198. package/dist/solution/RegisterAndLogin/config.js +2 -10
  199. package/dist/solution/RegisterAndLogin/index.js +30 -76
  200. package/dist/solution/Sales/index.d.ts +50 -5
  201. package/dist/solution/Sales/index.js +484 -92
  202. package/dist/solution/Sales/types.d.ts +26 -2
  203. package/dist/solution/ScanOrder/index.d.ts +27 -21
  204. package/dist/solution/ScanOrder/index.js +509 -454
  205. package/dist/solution/ScanOrder/types.d.ts +33 -11
  206. package/dist/solution/ScanOrder/types.js +4 -5
  207. package/dist/solution/ScanOrder/utils.d.ts +4 -1
  208. package/dist/solution/ScanOrder/utils.js +109 -34
  209. package/dist/solution/ShopDiscount/index.js +6 -11
  210. package/dist/solution/UnifiedBookingSales/index.d.ts +183 -0
  211. package/dist/solution/UnifiedBookingSales/index.js +1871 -0
  212. package/dist/solution/UnifiedBookingSales/types.d.ts +143 -0
  213. package/dist/solution/UnifiedBookingSales/types.js +11 -0
  214. package/dist/solution/VenueBooking/index.d.ts +34 -20
  215. package/dist/solution/VenueBooking/index.js +630 -505
  216. package/dist/solution/VenueBooking/sales-section-4-annotated.json +0 -2
  217. package/dist/solution/VenueBooking/utils/slotMerge.d.ts +6 -0
  218. package/dist/solution/VenueBooking/utils/slotMerge.js +9 -3
  219. package/dist/solution/index.d.ts +2 -0
  220. package/dist/solution/index.js +3 -1
  221. package/dist/types/index.d.ts +11 -1
  222. package/dist/utils/task.js +15 -18
  223. package/dist/utils/watch.js +0 -1
  224. package/lib/apis/picoding.js +2 -0
  225. package/lib/core/index.js +130 -131
  226. package/lib/effects/index.js +46 -57
  227. package/lib/index.js +92 -53
  228. package/lib/model/index.js +14 -21
  229. package/lib/model/strategy/adapter/dataVariant/adapter.js +38 -50
  230. package/lib/model/strategy/adapter/dataVariant/evaluator.js +162 -236
  231. package/lib/model/strategy/adapter/dataVariant/examples.js +229 -237
  232. package/lib/model/strategy/adapter/dataVariant/index.js +39 -34
  233. package/lib/model/strategy/adapter/dataVariant/type.js +57 -28
  234. package/lib/model/strategy/adapter/index.js +100 -64
  235. package/lib/model/strategy/adapter/itemRule/adapter.js +156 -144
  236. package/lib/model/strategy/adapter/itemRule/evaluator.js +36 -48
  237. package/lib/model/strategy/adapter/itemRule/examples.js +295 -225
  238. package/lib/model/strategy/adapter/itemRule/index.js +83 -57
  239. package/lib/model/strategy/adapter/itemRule/type.js +97 -36
  240. package/lib/model/strategy/adapter/promotion/adapter.js +84 -63
  241. package/lib/model/strategy/adapter/promotion/evaluator.js +383 -232
  242. package/lib/model/strategy/adapter/promotion/examples.js +139 -159
  243. package/lib/model/strategy/adapter/promotion/index.js +1 -49
  244. package/lib/model/strategy/adapter/promotion/type.js +199 -35
  245. package/lib/model/strategy/adapter/type.js +4 -16
  246. package/lib/model/strategy/adapter/walletPass/evaluator.js +180 -152
  247. package/lib/model/strategy/adapter/walletPass/example.js +217 -190
  248. package/lib/model/strategy/adapter/walletPass/index.js +75 -51
  249. package/lib/model/strategy/adapter/walletPass/locales.js +36 -58
  250. package/lib/model/strategy/adapter/walletPass/type.js +4 -16
  251. package/lib/model/strategy/adapter/walletPass/utils.js +654 -402
  252. package/lib/model/strategy/engine.js +270 -168
  253. package/lib/model/strategy/index.js +49 -34
  254. package/lib/model/strategy/strategy-example.js +243 -239
  255. package/lib/model/strategy/type.js +100 -40
  256. package/lib/modules/Account/index.js +39 -53
  257. package/lib/modules/Account/types.js +20 -33
  258. package/lib/modules/AccountList/index.js +116 -154
  259. package/lib/modules/AccountList/types.js +30 -31
  260. package/lib/modules/AccountList/utils.js +18 -30
  261. package/lib/modules/BaseModule.d.ts +2 -2
  262. package/lib/modules/BaseModule.js +26 -49
  263. package/lib/modules/BookingContext/index.d.ts +48 -0
  264. package/lib/modules/BookingContext/index.js +390 -0
  265. package/lib/modules/BookingContext/types.d.ts +102 -0
  266. package/lib/modules/BookingContext/types.js +48 -0
  267. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts +16 -0
  268. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +286 -0
  269. package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +8 -0
  270. package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +148 -0
  271. package/lib/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +76 -0
  272. package/lib/modules/BookingContext/utils/cacheItemToBookingInput.js +242 -0
  273. package/lib/modules/BookingContext/utils/flexible.d.ts +28 -0
  274. package/lib/modules/BookingContext/utils/flexible.js +63 -0
  275. package/lib/modules/BookingContext/utils/formatResourceList.d.ts +8 -0
  276. package/lib/modules/BookingContext/utils/formatResourceList.js +35 -0
  277. package/lib/modules/BookingContext/utils/index.d.ts +11 -0
  278. package/lib/modules/BookingContext/utils/index.js +126 -0
  279. package/lib/modules/BookingContext/utils/noResource.d.ts +13 -0
  280. package/lib/modules/BookingContext/utils/noResource.js +78 -0
  281. package/lib/modules/BookingContext/utils/orderLineDisplay.d.ts +1 -0
  282. package/lib/modules/BookingContext/utils/orderLineDisplay.js +29 -0
  283. package/lib/modules/BookingContext/utils/productExtend.d.ts +72 -0
  284. package/lib/modules/BookingContext/utils/productExtend.js +330 -0
  285. package/lib/modules/BookingContext/utils/resourceErrors.d.ts +41 -0
  286. package/lib/modules/BookingContext/utils/resourceErrors.js +80 -0
  287. package/lib/modules/BookingContext/utils/resourceSelection.d.ts +7 -0
  288. package/lib/modules/BookingContext/utils/resourceSelection.js +24 -0
  289. package/lib/modules/BookingContext/utils/resources.d.ts +80 -0
  290. package/lib/modules/BookingContext/utils/resources.js +419 -0
  291. package/lib/modules/BookingContext/utils/serviceTimes.d.ts +55 -0
  292. package/lib/modules/BookingContext/utils/serviceTimes.js +161 -0
  293. package/lib/modules/BookingContext/utils/timeSlices.d.ts +42 -0
  294. package/lib/modules/BookingContext/utils/timeSlices.js +114 -0
  295. package/lib/modules/Cart/index.js +170 -124
  296. package/lib/modules/Cart/types.js +46 -51
  297. package/lib/modules/Cart/utils/cartAccount.js +40 -39
  298. package/lib/modules/Cart/utils/cartDate.js +56 -61
  299. package/lib/modules/Cart/utils/cartDiscount.js +28 -33
  300. package/lib/modules/Cart/utils/cartNote.js +27 -32
  301. package/lib/modules/Cart/utils/cartProduct.js +331 -244
  302. package/lib/modules/Cart/utils/cartRelationForms.js +29 -35
  303. package/lib/modules/Cart/utils/cartResource.js +72 -78
  304. package/lib/modules/Cart/utils/changePrice.js +37 -67
  305. package/lib/modules/Cart/utils/index.js +106 -48
  306. package/lib/modules/Customer/constants.js +13 -34
  307. package/lib/modules/Customer/index.d.ts +20 -0
  308. package/lib/modules/Customer/index.js +270 -154
  309. package/lib/modules/Customer/types.d.ts +2 -0
  310. package/lib/modules/Customer/types.js +38 -35
  311. package/lib/modules/Date/index.js +116 -115
  312. package/lib/modules/Date/types.js +16 -28
  313. package/lib/modules/Date/utils.js +174 -123
  314. package/lib/modules/Discount/index.d.ts +2 -1
  315. package/lib/modules/Discount/index.js +133 -113
  316. package/lib/modules/Discount/types.d.ts +1 -0
  317. package/lib/modules/Discount/types.js +9 -31
  318. package/lib/modules/Guests/index.js +30 -56
  319. package/lib/modules/Guests/types.js +23 -33
  320. package/lib/modules/Holder/index.js +209 -189
  321. package/lib/modules/Holder/types.js +4 -16
  322. package/lib/modules/Holder/utils.js +20 -49
  323. package/lib/modules/OpenData/index.d.ts +8 -0
  324. package/lib/modules/OpenData/index.js +81 -74
  325. package/lib/modules/OpenData/types.js +4 -16
  326. package/lib/modules/OpenData/utils.js +44 -78
  327. package/lib/modules/Order/index.d.ts +449 -24
  328. package/lib/modules/Order/index.js +3834 -489
  329. package/lib/modules/Order/types.d.ts +693 -88
  330. package/lib/modules/Order/types.js +78 -33
  331. package/lib/modules/Order/utils/bundleDiscountHydration.d.ts +5 -0
  332. package/lib/modules/Order/utils/bundleDiscountHydration.js +106 -0
  333. package/lib/modules/Order/utils/manualProductDiscount.d.ts +106 -0
  334. package/lib/modules/Order/utils/manualProductDiscount.js +207 -0
  335. package/lib/modules/Order/utils/orderCollectionIdentity.d.ts +53 -0
  336. package/lib/modules/Order/utils/orderCollectionIdentity.js +353 -0
  337. package/lib/modules/Order/utils.d.ts +167 -18
  338. package/lib/modules/Order/utils.js +1247 -345
  339. package/lib/modules/Payment/cash.js +20 -33
  340. package/lib/modules/Payment/cashRecommendationAlgorithm.js +145 -76
  341. package/lib/modules/Payment/eftpos.js +16 -30
  342. package/lib/modules/Payment/index.d.ts +10 -9
  343. package/lib/modules/Payment/index.js +542 -502
  344. package/lib/modules/Payment/mx51.js +1 -0
  345. package/lib/modules/Payment/types.d.ts +40 -16
  346. package/lib/modules/Payment/types.js +216 -107
  347. package/lib/modules/Payment/utils.d.ts +1 -1
  348. package/lib/modules/Payment/utils.js +53 -49
  349. package/lib/modules/Payment/walletpass.js +231 -203
  350. package/lib/modules/Product/index.js +51 -46
  351. package/lib/modules/Product/types.d.ts +29 -7
  352. package/lib/modules/Product/types.js +4 -16
  353. package/lib/modules/Product/utils.js +32 -33
  354. package/lib/modules/ProductList/index.d.ts +17 -13
  355. package/lib/modules/ProductList/index.js +160 -118
  356. package/lib/modules/ProductList/types.d.ts +17 -0
  357. package/lib/modules/ProductList/types.js +9 -31
  358. package/lib/modules/Quotation/index.d.ts +22 -2
  359. package/lib/modules/Quotation/index.js +123 -89
  360. package/lib/modules/Quotation/types.d.ts +19 -0
  361. package/lib/modules/Quotation/types.js +4 -16
  362. package/lib/modules/Resource/index.js +27 -59
  363. package/lib/modules/Resource/types.js +22 -32
  364. package/lib/modules/Resource/utils.js +30 -38
  365. package/lib/modules/ResourcePlanner/index.d.ts +24 -0
  366. package/lib/modules/ResourcePlanner/index.js +147 -0
  367. package/lib/modules/ResourcePlanner/planner.d.ts +14 -0
  368. package/lib/modules/ResourcePlanner/planner.js +895 -0
  369. package/lib/modules/ResourcePlanner/types.d.ts +227 -0
  370. package/lib/modules/ResourcePlanner/types.js +5 -0
  371. package/lib/modules/Rules/index.d.ts +8 -10
  372. package/lib/modules/Rules/index.js +1286 -894
  373. package/lib/modules/Rules/types.d.ts +14 -3
  374. package/lib/modules/Rules/types.js +17 -40
  375. package/lib/modules/SalesSummary/index.d.ts +23 -26
  376. package/lib/modules/SalesSummary/index.js +130 -71
  377. package/lib/modules/SalesSummary/types.d.ts +9 -1
  378. package/lib/modules/SalesSummary/types.js +4 -16
  379. package/lib/modules/SalesSummary/utils.d.ts +3 -22
  380. package/lib/modules/SalesSummary/utils.js +738 -250
  381. package/lib/modules/ScanOrderLogger/index.js +59 -79
  382. package/lib/modules/ScanOrderLogger/providers/feishu.js +54 -78
  383. package/lib/modules/ScanOrderLogger/providers/grafana.js +13 -36
  384. package/lib/modules/ScanOrderLogger/types.js +4 -16
  385. package/lib/modules/Schedule/getDateIsInSchedule.js +345 -171
  386. package/lib/modules/Schedule/index.d.ts +18 -5
  387. package/lib/modules/Schedule/index.js +139 -114
  388. package/lib/modules/Schedule/type.js +4 -16
  389. package/lib/modules/Schedule/types.d.ts +2 -0
  390. package/lib/modules/Schedule/types.js +4 -16
  391. package/lib/modules/Schedule/utils.js +433 -291
  392. package/lib/modules/Step/index.js +40 -52
  393. package/lib/modules/Step/tyeps.js +4 -16
  394. package/lib/modules/Summary/index.js +66 -70
  395. package/lib/modules/Summary/types.js +4 -16
  396. package/lib/modules/Summary/utils.js +782 -429
  397. package/lib/modules/SurchargeList/index.d.ts +18 -0
  398. package/lib/modules/SurchargeList/index.js +95 -0
  399. package/lib/modules/SurchargeList/types.d.ts +15 -0
  400. package/lib/modules/SurchargeList/types.js +5 -0
  401. package/lib/modules/index.d.ts +3 -0
  402. package/lib/modules/index.js +245 -57
  403. package/lib/plugins/app.d.ts +2 -0
  404. package/lib/plugins/app.js +4 -16
  405. package/lib/plugins/index.js +36 -25
  406. package/lib/plugins/request.d.ts +1 -0
  407. package/lib/plugins/request.js +137 -126
  408. package/lib/plugins/shopStore.js +4 -16
  409. package/lib/plugins/user.js +4 -16
  410. package/lib/plugins/window.js +171 -179
  411. package/lib/server/index.d.ts +462 -8
  412. package/lib/server/index.js +4668 -713
  413. package/lib/server/modules/floor-plan/index.d.ts +39 -0
  414. package/lib/server/modules/floor-plan/index.js +306 -0
  415. package/lib/server/modules/floor-plan/types.d.ts +43 -0
  416. package/lib/server/modules/floor-plan/types.js +19 -0
  417. package/lib/server/modules/index.d.ts +7 -2
  418. package/lib/server/modules/index.js +106 -59
  419. package/lib/server/modules/menu/index.js +146 -122
  420. package/lib/server/modules/menu/types.js +18 -31
  421. package/lib/server/modules/order/index.d.ts +207 -14
  422. package/lib/server/modules/order/index.js +1463 -316
  423. package/lib/server/modules/order/types.d.ts +76 -5
  424. package/lib/server/modules/order/types.js +117 -32
  425. package/lib/server/modules/order/utils/filterBookings.d.ts +7 -1
  426. package/lib/server/modules/order/utils/filterBookings.js +288 -146
  427. package/lib/server/modules/order/utils/filterOrders.js +318 -64
  428. package/lib/server/modules/payment/index.d.ts +28 -0
  429. package/lib/server/modules/payment/index.js +168 -0
  430. package/lib/server/modules/payment/types.d.ts +9 -0
  431. package/lib/server/modules/payment/types.js +5 -0
  432. package/lib/server/modules/products/index.d.ts +105 -14
  433. package/lib/server/modules/products/index.js +969 -383
  434. package/lib/server/modules/products/types.d.ts +34 -1
  435. package/lib/server/modules/products/types.js +44 -34
  436. package/lib/server/modules/quotation/index.d.ts +39 -0
  437. package/lib/server/modules/quotation/index.js +220 -77
  438. package/lib/server/modules/quotation/types.js +21 -31
  439. package/lib/server/modules/resource/index.d.ts +2 -3
  440. package/lib/server/modules/resource/index.js +269 -214
  441. package/lib/server/modules/resource/types.js +42 -33
  442. package/lib/server/modules/schedule/index.d.ts +6 -4
  443. package/lib/server/modules/schedule/index.js +158 -132
  444. package/lib/server/modules/schedule/types.js +14 -21
  445. package/lib/server/modules/schedule/utils.js +334 -163
  446. package/lib/server/test.json +713 -0
  447. package/lib/server/types.d.ts +2 -0
  448. package/lib/server/types.js +4 -16
  449. package/lib/server/utils/index.js +25 -23
  450. package/lib/server/utils/product.js +197 -140
  451. package/lib/server/utils/schedule.js +34 -41
  452. package/lib/server/utils/small-ticket.d.ts +71 -0
  453. package/lib/server/utils/small-ticket.js +926 -0
  454. package/lib/server/utils/time.js +40 -49
  455. package/lib/solution/BaseSales/index.d.ts +378 -0
  456. package/lib/solution/BaseSales/index.js +2367 -0
  457. package/lib/solution/BaseSales/types.d.ts +394 -0
  458. package/lib/solution/BaseSales/types.js +47 -0
  459. package/lib/solution/BaseSales/utils/cartPromotion.d.ts +287 -0
  460. package/lib/solution/BaseSales/utils/cartPromotion.js +1155 -0
  461. package/lib/solution/BaseSales/utils/parseSalesResponse.d.ts +144 -0
  462. package/lib/solution/BaseSales/utils/parseSalesResponse.js +140 -0
  463. package/lib/solution/BaseSales/utils/quotationPrice.d.ts +18 -0
  464. package/lib/solution/BaseSales/utils/quotationPrice.js +231 -0
  465. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +63 -0
  466. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +215 -0
  467. package/lib/solution/BaseSales/utils.d.ts +40 -0
  468. package/lib/solution/BaseSales/utils.js +259 -0
  469. package/lib/solution/BookingByStep/index.js +1530 -1343
  470. package/lib/solution/BookingByStep/types.js +40 -99
  471. package/lib/solution/BookingByStep/utils/capacity.js +192 -160
  472. package/lib/solution/BookingByStep/utils/products.js +42 -52
  473. package/lib/solution/BookingByStep/utils/resources.js +527 -330
  474. package/lib/solution/BookingByStep/utils/stock.js +65 -44
  475. package/lib/solution/BookingByStep/utils/timeslots.js +129 -131
  476. package/lib/solution/BookingTicket/index.d.ts +393 -24
  477. package/lib/solution/BookingTicket/index.js +1459 -160
  478. package/lib/solution/BookingTicket/types.d.ts +191 -6
  479. package/lib/solution/BookingTicket/types.js +101 -66
  480. package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +117 -0
  481. package/lib/solution/BookingTicket/utils/addProductDecision.js +353 -0
  482. package/lib/solution/BookingTicket/utils/addTimeAvailability.d.ts +35 -0
  483. package/lib/solution/BookingTicket/utils/addTimeAvailability.js +94 -0
  484. package/lib/solution/BookingTicket/utils/bookingStatus.d.ts +77 -0
  485. package/lib/solution/BookingTicket/utils/bookingStatus.js +136 -0
  486. package/lib/solution/BookingTicket/utils/cartView.d.ts +29 -0
  487. package/lib/solution/BookingTicket/utils/cartView.js +200 -0
  488. package/lib/solution/BookingTicket/utils/exampleData.d.ts +123 -0
  489. package/lib/solution/BookingTicket/utils/exampleData.js +185 -0
  490. package/lib/solution/BookingTicket/utils/orderCustomer.d.ts +4 -0
  491. package/lib/solution/BookingTicket/utils/orderCustomer.js +35 -0
  492. package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +185 -0
  493. package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.js +387 -0
  494. package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +36 -0
  495. package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +220 -0
  496. package/lib/solution/BookingTicket/utils/scan/cloudSearch.d.ts +4 -0
  497. package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +85 -80
  498. package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +32 -0
  499. package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.js +64 -0
  500. package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +3 -1
  501. package/lib/solution/BookingTicket/utils/scan/handleScan.js +84 -80
  502. package/lib/solution/BookingTicket/utils/scan/index.d.ts +5 -0
  503. package/lib/solution/BookingTicket/utils/scan/index.js +103 -95
  504. package/lib/solution/BookingTicket/utils/scan/scanCache.js +90 -43
  505. package/lib/solution/BookingTicket/utils/scan/scanProductValues.d.ts +21 -0
  506. package/lib/solution/BookingTicket/utils/scan/scanProductValues.js +115 -0
  507. package/lib/solution/BookingTicket/utils/sessionCatalogStale.d.ts +23 -0
  508. package/lib/solution/BookingTicket/utils/sessionCatalogStale.js +83 -0
  509. package/lib/solution/BuyTickets/index.js +67 -70
  510. package/lib/solution/BuyTickets/types.js +22 -38
  511. package/lib/solution/Checkout/index.d.ts +1 -0
  512. package/lib/solution/Checkout/index.js +1461 -1169
  513. package/lib/solution/Checkout/types.js +91 -61
  514. package/lib/solution/Checkout/utils/index.js +228 -159
  515. package/lib/solution/PlaceOrder/index.js +55 -0
  516. package/lib/solution/RegisterAndLogin/config.js +495 -470
  517. package/lib/solution/RegisterAndLogin/index.js +633 -630
  518. package/lib/solution/RegisterAndLogin/types.js +189 -76
  519. package/lib/solution/RegisterAndLogin/utils.js +183 -125
  520. package/lib/solution/Sales/index.d.ts +50 -5
  521. package/lib/solution/Sales/index.js +495 -220
  522. package/lib/solution/Sales/types.d.ts +26 -2
  523. package/lib/solution/Sales/types.js +27 -33
  524. package/lib/solution/ScanOrder/index.d.ts +27 -21
  525. package/lib/solution/ScanOrder/index.js +908 -904
  526. package/lib/solution/ScanOrder/types.d.ts +33 -11
  527. package/lib/solution/ScanOrder/types.js +33 -34
  528. package/lib/solution/ScanOrder/utils.d.ts +4 -1
  529. package/lib/solution/ScanOrder/utils.js +457 -344
  530. package/lib/solution/ShopDiscount/index.js +230 -236
  531. package/lib/solution/ShopDiscount/types.js +15 -37
  532. package/lib/solution/ShopDiscount/utils.js +309 -172
  533. package/lib/solution/UnifiedBookingSales/index.d.ts +183 -0
  534. package/lib/solution/UnifiedBookingSales/index.js +1050 -0
  535. package/lib/solution/UnifiedBookingSales/types.d.ts +143 -0
  536. package/lib/solution/UnifiedBookingSales/types.js +14 -0
  537. package/lib/solution/VenueBooking/index.d.ts +34 -20
  538. package/lib/solution/VenueBooking/index.js +982 -950
  539. package/lib/solution/VenueBooking/sales-section-4-annotated.json +0 -2
  540. package/lib/solution/VenueBooking/types.js +20 -40
  541. package/lib/solution/VenueBooking/utils/dateSummary.js +22 -54
  542. package/lib/solution/VenueBooking/utils/resource.js +31 -54
  543. package/lib/solution/VenueBooking/utils/slotMerge.d.ts +6 -0
  544. package/lib/solution/VenueBooking/utils/slotMerge.js +96 -108
  545. package/lib/solution/VenueBooking/utils/smartPricing.js +112 -100
  546. package/lib/solution/VenueBooking/utils/timeSlot.js +133 -132
  547. package/lib/solution/VenueBooking/utils.js +130 -67
  548. package/lib/solution/index.d.ts +2 -0
  549. package/lib/solution/index.js +124 -37
  550. package/lib/store/createStore.js +32 -29
  551. package/lib/types/index.d.ts +11 -1
  552. package/lib/types/index.js +4 -16
  553. package/lib/utils/task.js +36 -36
  554. package/lib/utils/watch.js +81 -47
  555. package/package.json +2 -1
  556. package/dist/solution/Checkout/appointmentDemo.json +0 -1
  557. package/lib/solution/Checkout/appointmentDemo.json +0 -1
@@ -1,120 +1,120 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
1
+ "use strict";
28
2
 
29
- // src/solution/ScanOrder/utils.ts
30
- var utils_exports = {};
31
- __export(utils_exports, {
32
- aggregateItemRuleLimit: () => aggregateItemRuleLimit,
33
- attachItemRuleLimitsToTopLevelProducts: () => attachItemRuleLimitsToTopLevelProducts,
34
- buildItemRuleBusinessData: () => buildItemRuleBusinessData,
35
- buildProductKey: () => buildProductKey,
36
- buildProductLineFingerprint: () => buildProductLineFingerprint,
37
- buildQuantityLimitIndex: () => buildQuantityLimitIndex,
38
- collectLinkProductIdsFromReservationRules: () => collectLinkProductIdsFromReservationRules,
39
- computeResourceIsFull: () => computeResourceIsFull,
40
- createEmptySummary: () => createEmptySummary,
41
- extractStrategyModelIdsFromTableConfig: () => extractStrategyModelIdsFromTableConfig,
42
- findReservationRuleProductByResourceId: () => findReservationRuleProductByResourceId,
43
- getProductIdentityIndex: () => getProductIdentityIndex,
44
- getSafeProductNum: () => getSafeProductNum,
45
- getTopLevelProductId: () => getTopLevelProductId,
46
- getTopLevelVariantId: () => getTopLevelVariantId,
47
- hasCustomCapacityProduct: () => hasCustomCapacityProduct,
48
- isIdentityMatch: () => isIdentityMatch,
49
- isSkuOnlyDeleteIdentity: () => isSkuOnlyDeleteIdentity,
50
- normalizeEnabledItemRuleIds: () => normalizeEnabledItemRuleIds,
51
- normalizeItemRuleStrategies: () => normalizeItemRuleStrategies,
52
- normalizeOrderProduct: () => normalizeOrderProduct,
53
- pickFirstCustomCapacityDimensionId: () => pickFirstCustomCapacityDimensionId,
54
- pickFirstCustomCapacityPaxBounds: () => pickFirstCustomCapacityPaxBounds,
55
- pickFirstDurationMinutesFromProducts: () => pickFirstDurationMinutesFromProducts,
56
- resolveSkuMatchedQuantityLimits: () => resolveSkuMatchedQuantityLimits,
57
- toBoolean: () => toBoolean,
58
- toNonNegativeInt: () => toNonNegativeInt,
59
- toNonNegativeNumber: () => toNonNegativeNumber,
60
- toPositiveString: () => toPositiveString,
61
- toPriceString: () => toPriceString
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
62
5
  });
63
- module.exports = __toCommonJS(utils_exports);
64
- var import_dayjs = __toESM(require("dayjs"));
65
- var import_decimal = __toESM(require("decimal.js"));
66
- var import_utils = require("../../modules/Order/utils");
6
+ exports.aggregateItemRuleLimit = aggregateItemRuleLimit;
7
+ exports.attachItemRuleLimitsToTopLevelProducts = attachItemRuleLimitsToTopLevelProducts;
8
+ exports.buildItemRuleBusinessData = buildItemRuleBusinessData;
9
+ exports.buildProductKey = buildProductKey;
10
+ exports.buildProductLineFingerprint = buildProductLineFingerprint;
11
+ exports.buildQuantityLimitIndex = buildQuantityLimitIndex;
12
+ exports.collectLinkProductIdsFromReservationRules = collectLinkProductIdsFromReservationRules;
13
+ exports.computeResourceIsFull = computeResourceIsFull;
14
+ exports.createEmptySummary = createEmptySummary;
15
+ exports.extractStrategyModelIdsFromTableConfig = extractStrategyModelIdsFromTableConfig;
16
+ exports.filterProductsForScanOrderMore = filterProductsForScanOrderMore;
17
+ exports.findReservationRuleProductByResourceId = findReservationRuleProductByResourceId;
18
+ exports.getProductIdentityIndex = getProductIdentityIndex;
19
+ exports.getSafeProductNum = getSafeProductNum;
20
+ exports.getTopLevelProductId = getTopLevelProductId;
21
+ exports.getTopLevelVariantId = getTopLevelVariantId;
22
+ exports.hasCustomCapacityProduct = hasCustomCapacityProduct;
23
+ exports.isIdentityMatch = isIdentityMatch;
24
+ exports.isSkuOnlyDeleteIdentity = isSkuOnlyDeleteIdentity;
25
+ exports.normalizeEnabledItemRuleIds = normalizeEnabledItemRuleIds;
26
+ exports.normalizeItemRuleStrategies = normalizeItemRuleStrategies;
27
+ exports.normalizeOrderProduct = normalizeOrderProduct;
28
+ exports.pickFirstCustomCapacityDimensionId = pickFirstCustomCapacityDimensionId;
29
+ exports.pickFirstCustomCapacityPaxBounds = pickFirstCustomCapacityPaxBounds;
30
+ exports.pickFirstDurationMinutesFromProducts = pickFirstDurationMinutesFromProducts;
31
+ exports.resolveSkuMatchedQuantityLimits = resolveSkuMatchedQuantityLimits;
32
+ exports.toBoolean = toBoolean;
33
+ exports.toNonNegativeInt = toNonNegativeInt;
34
+ exports.toNonNegativeNumber = toNonNegativeNumber;
35
+ exports.toPositiveString = toPositiveString;
36
+ exports.toPriceString = toPriceString;
37
+ var _dayjs = _interopRequireDefault(require("dayjs"));
38
+ var _decimal = _interopRequireDefault(require("decimal.js"));
39
+ var _utils = require("../../modules/Order/utils");
40
+ var _manualProductDiscount = require("../../modules/Order/utils/manualProductDiscount");
41
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
42
+ /**
43
+ * 构建金额全为 0 的空 summary。
44
+ * 作为尚未计算金额时的兜底默认值,避免下游因 undefined 报错。
45
+ */
67
46
  function createEmptySummary() {
68
47
  return {
69
48
  product_quantity: 0,
70
- product_original_amount: "0.00",
71
- product_amount: "0.00",
72
- product_expect_amount: "0.00",
73
- product_tax_fee: "0.00",
74
- shipping_fee: "0.00",
75
- shipping_tax_fee: "0.00",
76
- tax_fee: "0.00",
77
- surcharge_fee: "0.00",
78
- discount_amount: "0.00",
79
- deposit_amount: "0.00",
80
- expect_amount: "0.00",
81
- total_amount: "0.00",
82
- amount_gap: "0.00",
83
- rounding_amount: "0.00",
84
- pay_service_charge_amount: "0.00"
49
+ product_original_amount: '0.00',
50
+ product_amount: '0.00',
51
+ product_expect_amount: '0.00',
52
+ product_tax_fee: '0.00',
53
+ shipping_fee: '0.00',
54
+ shipping_tax_fee: '0.00',
55
+ tax_fee: '0.00',
56
+ surcharge_fee: '0.00',
57
+ surcharges: [],
58
+ discount_amount: '0.00',
59
+ deposit_amount: '0.00',
60
+ expect_amount: '0.00',
61
+ total_amount: '0.00',
62
+ total_refund_amount: '0.00',
63
+ customer_paid_amount: '0.00',
64
+ order_paid_amount: '0.00',
65
+ amount_gap: '0.00',
66
+ rounding_amount: '0.00',
67
+ pay_service_charge_amount: '0.00'
85
68
  };
86
69
  }
70
+
71
+ /**
72
+ * 商品数量安全取值。
73
+ * - NaN / undefined / < 1 均视作 1(最低起订量)
74
+ * - 有值时取整(不支持小数数量)
75
+ */
87
76
  function getSafeProductNum(num) {
88
- if (!num || Number.isNaN(num))
89
- return 1;
90
- if (num < 1)
91
- return 1;
77
+ if (!num || Number.isNaN(num)) return 1;
78
+ if (num < 1) return 1;
92
79
  return Math.floor(num);
93
80
  }
81
+
82
+ /**
83
+ * 宽松布尔值转换。
84
+ * 兼容后端/配置中心常见的 boolean / number / string 表达,统一归一成 true/false。
85
+ */
94
86
  function toBoolean(value) {
95
- if (typeof value === "boolean")
96
- return value;
97
- if (typeof value === "number")
98
- return value !== 0;
99
- if (typeof value === "string") {
87
+ if (typeof value === 'boolean') return value;
88
+ if (typeof value === 'number') return value !== 0;
89
+ if (typeof value === 'string') {
100
90
  const normalized = value.trim().toLowerCase();
101
- return ["1", "true", "yes", "y", "on"].includes(normalized);
91
+ return ['1', 'true', 'yes', 'y', 'on'].includes(normalized);
102
92
  }
103
93
  return false;
104
94
  }
95
+
96
+ /**
97
+ * 将值归一化为有效的正向字符串。
98
+ * null / undefined / 空串 / '0' / 'null' 统一视为无效值并返回 undefined。
99
+ */
105
100
  function toPositiveString(value) {
106
- if (value === null || value === void 0 || value === "")
107
- return void 0;
101
+ if (value === null || value === undefined || value === '') return undefined;
108
102
  const normalized = String(value).trim();
109
- if (!normalized || normalized === "0" || normalized.toLowerCase() === "null") {
110
- return void 0;
103
+ if (!normalized || normalized === '0' || normalized.toLowerCase() === 'null') {
104
+ return undefined;
111
105
  }
112
106
  return normalized;
113
107
  }
108
+
109
+ /**
110
+ * 归一化 item rule 策略模型 ID 列表。
111
+ * - 支持 string / number 混合输入
112
+ * - 仅保留 > 0 的合法数字
113
+ * - 自动去重
114
+ */
114
115
  function normalizeEnabledItemRuleIds(rawIds) {
115
- if (!Array.isArray(rawIds))
116
- return [];
117
- const uniqueIds = /* @__PURE__ */ new Set();
116
+ if (!Array.isArray(rawIds)) return [];
117
+ const uniqueIds = new Set();
118
118
  for (const item of rawIds) {
119
119
  const strategyId = Number(item);
120
120
  if (Number.isFinite(strategyId) && strategyId > 0) {
@@ -123,27 +123,27 @@ function normalizeEnabledItemRuleIds(rawIds) {
123
123
  }
124
124
  return Array.from(uniqueIds);
125
125
  }
126
+
127
+ /**
128
+ * 从 tableConfig 中提取合法策略模型 ID 列表。
129
+ */
126
130
  function extractStrategyModelIdsFromTableConfig(tableConfig) {
127
- const rawIds = Array.isArray(tableConfig == null ? void 0 : tableConfig.strategy_model_ids) ? tableConfig.strategy_model_ids : [];
128
- return rawIds.map((id) => Number(id)).filter((id) => Number.isFinite(id) && id > 0);
131
+ const rawIds = Array.isArray(tableConfig?.strategy_model_ids) ? tableConfig.strategy_model_ids : [];
132
+ return rawIds.map(id => Number(id)).filter(id => Number.isFinite(id) && id > 0);
129
133
  }
134
+
135
+ /**
136
+ * 仅保留 item_rule 类型策略。
137
+ */
130
138
  function normalizeItemRuleStrategies(configs) {
131
- if (!Array.isArray(configs))
132
- return [];
133
- return configs.filter(
134
- (config) => {
135
- var _a;
136
- return Boolean(
137
- config && typeof config === "object" && ((_a = config == null ? void 0 : config.metadata) == null ? void 0 : _a.type) === "item_rule"
138
- );
139
- }
140
- );
139
+ if (!Array.isArray(configs)) return [];
140
+ return configs.filter(config => Boolean(config && typeof config === 'object' && config?.metadata?.type === 'item_rule'));
141
141
  }
142
142
  function toNonNegativeNumber(value) {
143
- if (typeof value === "number") {
143
+ if (typeof value === 'number') {
144
144
  return Number.isFinite(value) && value >= 0 ? value : 0;
145
145
  }
146
- if (typeof value === "string") {
146
+ if (typeof value === 'string') {
147
147
  const parsed = Number(value);
148
148
  return Number.isFinite(parsed) && parsed >= 0 ? parsed : 0;
149
149
  }
@@ -152,43 +152,45 @@ function toNonNegativeNumber(value) {
152
152
  function toNonNegativeInt(value) {
153
153
  return Math.floor(toNonNegativeNumber(value));
154
154
  }
155
- function toPriceString(value, fallback = "0.00") {
155
+ function toPriceString(value, fallback = '0.00') {
156
156
  const parsedValue = Number(value);
157
- if (Number.isNaN(parsedValue))
158
- return fallback;
157
+ if (Number.isNaN(parsedValue)) return fallback;
159
158
  return parsedValue.toFixed(2);
160
159
  }
161
160
  function buildProductKey(productId, productVariantId) {
162
161
  return `${productId}_${productVariantId}`;
163
162
  }
163
+
164
+ /** 加餐接口只提交本次新增商品,过滤掉首单预约占位规则行。 */
165
+ function filterProductsForScanOrderMore(products = []) {
166
+ return products.filter(product => product.metadata?.is_rule !== true);
167
+ }
164
168
  function getTopLevelProductId(product) {
165
169
  const rawProductId = product.product_id ?? product.id;
166
170
  const productId = Number(rawProductId);
167
- if (!Number.isFinite(productId) || productId <= 0)
168
- return null;
171
+ if (!Number.isFinite(productId) || productId <= 0) return null;
169
172
  return productId;
170
173
  }
171
174
  function getTopLevelVariantId(product) {
172
175
  const rawVariantId = product.product_variant_id ?? product.variant_id;
173
- if (rawVariantId === void 0 || rawVariantId === null || rawVariantId === "") {
176
+ if (rawVariantId === undefined || rawVariantId === null || rawVariantId === '') {
174
177
  return null;
175
178
  }
176
179
  const variantId = Number(rawVariantId);
177
- if (!Number.isFinite(variantId) || variantId <= 0)
178
- return null;
180
+ if (!Number.isFinite(variantId) || variantId <= 0) return null;
179
181
  return variantId;
180
182
  }
181
183
  function buildQuantityLimitIndex(limits) {
182
- const exactLimitMap = /* @__PURE__ */ new Map();
183
- const productLimitMap = /* @__PURE__ */ new Map();
184
+ const exactLimitMap = new Map();
185
+ const productLimitMap = new Map();
184
186
  for (const limit of limits) {
185
187
  const targets = limit.targets || [];
186
- if (targets.length !== 1)
187
- continue;
188
+ // 多目标规则(OR 组)只做购物车聚合校验,不下发到单品维度,
189
+ // 避免 UI 把「组内至少 1 份」误当作每款商品各自的 min,锁死减号按钮。
190
+ if (targets.length !== 1) continue;
188
191
  const target = targets[0];
189
192
  const productId = Number(target.product_id);
190
- if (!Number.isFinite(productId) || productId <= 0)
191
- continue;
193
+ if (!Number.isFinite(productId) || productId <= 0) continue;
192
194
  const variantId = Number(target.product_variant_id);
193
195
  const hasVariant = Number.isFinite(variantId) && variantId > 0;
194
196
  if (hasVariant) {
@@ -206,44 +208,53 @@ function buildQuantityLimitIndex(limits) {
206
208
  };
207
209
  }
208
210
  function resolveSkuMatchedQuantityLimits(params) {
209
- const { productId, variantId, limitIndex } = params;
211
+ const {
212
+ productId,
213
+ variantId,
214
+ limitIndex
215
+ } = params;
210
216
  const exactMatched = variantId && variantId > 0 ? limitIndex.exactLimitMap.get(buildProductKey(productId, variantId)) || [] : [];
211
217
  const productMatched = limitIndex.productLimitMap.get(productId) || [];
212
218
  return [...exactMatched, ...productMatched];
213
219
  }
214
220
  function aggregateItemRuleLimit(matchedLimits) {
215
- if (!matchedLimits.length)
216
- return null;
221
+ if (!matchedLimits.length) return null;
217
222
  let min;
218
223
  let max;
219
224
  let remainingMax;
220
225
  let exact;
221
226
  let mustInclude = false;
227
+
228
+ // 聚合 validationMessage 按 min / max 两个方向分别输出:
229
+ // - maxValidationMessage:触发"当前 max / remainingMax / exact"的那条规则的文案
230
+ // - minValidationMessage:触发"当前 min / exact"的那条规则的文案
231
+ // 各自再回退到其他带文案的规则(最后回退到第一条非空 validationMessage)。
232
+ // 前端可根据"加号/减号被拦"的方向取对应文案。
222
233
  let maxSourceLimit;
223
234
  let remainingMaxSourceLimit;
224
235
  let exactSourceLimit;
225
236
  let minSourceLimit;
226
237
  let firstMessagedLimit;
227
238
  for (const limit of matchedLimits) {
228
- if (typeof limit.requiredMin === "number" && Number.isFinite(limit.requiredMin)) {
229
- if (min === void 0 || limit.requiredMin > min) {
239
+ if (typeof limit.requiredMin === 'number' && Number.isFinite(limit.requiredMin)) {
240
+ if (min === undefined || limit.requiredMin > min) {
230
241
  min = limit.requiredMin;
231
242
  minSourceLimit = limit;
232
243
  }
233
244
  }
234
- if (typeof limit.requiredMax === "number" && Number.isFinite(limit.requiredMax)) {
235
- if (max === void 0 || limit.requiredMax < max) {
245
+ if (typeof limit.requiredMax === 'number' && Number.isFinite(limit.requiredMax)) {
246
+ if (max === undefined || limit.requiredMax < max) {
236
247
  max = limit.requiredMax;
237
248
  maxSourceLimit = limit;
238
249
  }
239
250
  }
240
- if (typeof limit.remainingMax === "number" && Number.isFinite(limit.remainingMax)) {
241
- if (remainingMax === void 0 || limit.remainingMax < remainingMax) {
251
+ if (typeof limit.remainingMax === 'number' && Number.isFinite(limit.remainingMax)) {
252
+ if (remainingMax === undefined || limit.remainingMax < remainingMax) {
242
253
  remainingMax = limit.remainingMax;
243
254
  remainingMaxSourceLimit = limit;
244
255
  }
245
256
  }
246
- if (typeof limit.requiredExact === "number" && Number.isFinite(limit.requiredExact)) {
257
+ if (typeof limit.requiredExact === 'number' && Number.isFinite(limit.requiredExact)) {
247
258
  exact = limit.requiredExact;
248
259
  exactSourceLimit = limit;
249
260
  }
@@ -252,16 +263,19 @@ function aggregateItemRuleLimit(matchedLimits) {
252
263
  firstMessagedLimit = limit;
253
264
  }
254
265
  }
255
- if (typeof exact === "number" && Number.isFinite(exact)) {
266
+ if (typeof exact === 'number' && Number.isFinite(exact)) {
256
267
  min = exact;
257
268
  max = exact;
258
269
  }
259
270
  const maxMessageSource = maxSourceLimit || remainingMaxSourceLimit || exactSourceLimit || firstMessagedLimit;
260
271
  const minMessageSource = minSourceLimit || exactSourceLimit || firstMessagedLimit;
261
- const maxValidationMessage = maxMessageSource == null ? void 0 : maxMessageSource.validationMessage;
262
- const rawMaxValidationMessage = maxMessageSource == null ? void 0 : maxMessageSource.rawValidationMessage;
263
- const minValidationMessage = minMessageSource == null ? void 0 : minMessageSource.validationMessage;
264
- const rawMinValidationMessage = minMessageSource == null ? void 0 : minMessageSource.rawValidationMessage;
272
+ const maxValidationMessage = maxMessageSource?.validationMessage;
273
+ const rawMaxValidationMessage = maxMessageSource?.rawValidationMessage;
274
+ const minValidationMessage = minMessageSource?.validationMessage;
275
+ const rawMinValidationMessage = minMessageSource?.rawValidationMessage;
276
+
277
+ // validationMessage / rawValidationMessage 保留为"最严格限制"的聚合文案,
278
+ // 便于旧消费者(只关心 max 侧)不破坏。优先 max → min。
265
279
  const validationMessage = maxValidationMessage ?? minValidationMessage;
266
280
  const rawValidationMessage = rawMaxValidationMessage ?? rawMinValidationMessage;
267
281
  return {
@@ -279,28 +293,34 @@ function aggregateItemRuleLimit(matchedLimits) {
279
293
  };
280
294
  }
281
295
  function buildItemRuleBusinessData(params) {
282
- const { tempOrder, runtimeConfig, itemRuleConfigs } = params;
296
+ const {
297
+ tempOrder,
298
+ runtimeConfig,
299
+ itemRuleConfigs
300
+ } = params;
283
301
  const rawPax = runtimeConfig.pax || {};
284
302
  const adultPax = toNonNegativeInt(rawPax.adult);
285
303
  const childPax = toNonNegativeInt(rawPax.child);
286
304
  const totalPax = toNonNegativeInt(rawPax.total) || adultPax + childPax || 1;
287
305
  const cartItems = tempOrder.products.reduce((result, product) => {
288
- if (typeof product.product_id !== "number")
289
- return result;
306
+ if (typeof product.product_id !== 'number') return result;
290
307
  result.push({
291
308
  product_id: product.product_id,
292
309
  quantity: toNonNegativeInt(product.num),
293
- ...typeof product.product_variant_id === "number" ? { product_variant_id: product.product_variant_id } : {}
310
+ ...(typeof product.product_variant_id === 'number' ? {
311
+ product_variant_id: product.product_variant_id
312
+ } : {})
294
313
  });
295
314
  return result;
296
315
  }, []);
297
316
  const historicalItems = Array.isArray(runtimeConfig.historicalItems) ? runtimeConfig.historicalItems.reduce((result, item) => {
298
- if (typeof (item == null ? void 0 : item.product_id) !== "number")
299
- return result;
317
+ if (typeof item?.product_id !== 'number') return result;
300
318
  result.push({
301
319
  product_id: item.product_id,
302
320
  quantity: toNonNegativeInt(item.quantity),
303
- ...typeof item.product_variant_id === "number" ? { product_variant_id: item.product_variant_id } : {}
321
+ ...(typeof item.product_variant_id === 'number' ? {
322
+ product_variant_id: item.product_variant_id
323
+ } : {})
304
324
  });
305
325
  return result;
306
326
  }, []) : [];
@@ -312,23 +332,20 @@ function buildItemRuleBusinessData(params) {
312
332
  },
313
333
  cartItems,
314
334
  historicalItems,
315
- serviceType: runtimeConfig.serviceType || "dine-in",
316
- submissionIndex: typeof runtimeConfig.submissionIndex === "number" ? toNonNegativeInt(runtimeConfig.submissionIndex) : tempOrder.order_id ? 1 : 0,
335
+ serviceType: runtimeConfig.serviceType || 'dine-in',
336
+ submissionIndex: typeof runtimeConfig.submissionIndex === 'number' ? toNonNegativeInt(runtimeConfig.submissionIndex) : tempOrder.order_id ? 1 : 0,
317
337
  custom: runtimeConfig.custom || {},
318
338
  strategyConfigs: itemRuleConfigs
319
339
  };
320
340
  }
321
341
  function attachItemRuleLimitsToTopLevelProducts(productList, limits) {
322
- if (!Array.isArray(productList))
323
- return productList;
342
+ if (!Array.isArray(productList)) return productList;
324
343
  const limitIndex = buildQuantityLimitIndex(limits || []);
325
344
  for (const item of productList) {
326
- if (!item || typeof item !== "object")
327
- continue;
345
+ if (!item || typeof item !== 'object') continue;
328
346
  const productItem = item;
329
347
  const productId = getTopLevelProductId(productItem);
330
- if (productId === null)
331
- continue;
348
+ if (productId === null) continue;
332
349
  const variantId = getTopLevelVariantId(productItem);
333
350
  const matchedLimits = limits.length ? resolveSkuMatchedQuantityLimits({
334
351
  productId,
@@ -338,321 +355,417 @@ function attachItemRuleLimitsToTopLevelProducts(productList, limits) {
338
355
  const aggregatedLimit = aggregateItemRuleLimit(matchedLimits);
339
356
  if (aggregatedLimit) {
340
357
  productItem.item_rule_limit = aggregatedLimit;
341
- } else if ("item_rule_limit" in productItem) {
358
+ } else if ('item_rule_limit' in productItem) {
342
359
  delete productItem.item_rule_limit;
343
360
  }
344
361
  }
345
362
  return productList;
346
363
  }
364
+
365
+ /**
366
+ * 将选项行 / 套餐行归一成稳定 JSON,用于「同 SKU 是否合并」判断。
367
+ * 数组元素先按主键排序再序列化,避免顺序差异导致误判为不同行。
368
+ */
347
369
  function buildProductLineFingerprint(productOptionItem, productBundle) {
348
370
  const optArr = Array.isArray(productOptionItem) ? productOptionItem : [];
349
- const normalizedOpts = optArr.map((item) => ({
350
- product_option_item_id: Number(item == null ? void 0 : item.product_option_item_id) || 0,
351
- option_group_id: Number(item == null ? void 0 : item.option_group_id) || 0,
352
- num: typeof (item == null ? void 0 : item.num) === "number" && !Number.isNaN(item.num) ? Math.max(1, Math.floor(item.num)) : 1,
353
- price: String((item == null ? void 0 : item.price) ?? "")
371
+ const normalizedOpts = optArr.map(item => ({
372
+ option_group_item_id: Number(item?.option_group_item_id) || 0,
373
+ option_group_id: Number(item?.option_group_id) || 0,
374
+ num: typeof item?.num === 'number' && !Number.isNaN(item.num) ? Math.max(1, Math.floor(item.num)) : 1,
375
+ price: String(item?.add_price ?? item?.price ?? '')
354
376
  })).sort((p, q) => {
355
- if (p.product_option_item_id !== q.product_option_item_id) {
356
- return p.product_option_item_id - q.product_option_item_id;
377
+ if (p.option_group_item_id !== q.option_group_item_id) {
378
+ return p.option_group_item_id - q.option_group_item_id;
357
379
  }
358
- if (p.option_group_id !== q.option_group_id)
359
- return p.option_group_id - q.option_group_id;
360
- if (p.num !== q.num)
361
- return p.num - q.num;
380
+ if (p.option_group_id !== q.option_group_id) return p.option_group_id - q.option_group_id;
381
+ if (p.num !== q.num) return p.num - q.num;
362
382
  return p.price.localeCompare(q.price);
363
383
  });
364
384
  const bundleArr = Array.isArray(productBundle) ? productBundle : [];
365
- const normalizedBundles = bundleArr.map((item) => ({
366
- bundle_id: Number((item == null ? void 0 : item.bundle_id) ?? (item == null ? void 0 : item.id) ?? 0) || 0,
367
- product_id: Number(item == null ? void 0 : item.product_id) || 0,
368
- num: typeof (item == null ? void 0 : item.num) === "number" && !Number.isNaN(item.num) ? Math.max(1, Math.floor(item.num)) : 1
385
+ const normalizedBundles = bundleArr.map(item => ({
386
+ bundle_id: Number(item?.bundle_id ?? item?.id ?? 0) || 0,
387
+ product_id: Number(item?.product_id) || 0,
388
+ num: typeof item?.num === 'number' && !Number.isNaN(item.num) ? Math.max(1, Math.floor(item.num)) : 1
369
389
  })).sort((p, q) => {
370
- if (p.bundle_id !== q.bundle_id)
371
- return p.bundle_id - q.bundle_id;
372
- if (p.product_id !== q.product_id)
373
- return p.product_id - q.product_id;
390
+ if (p.bundle_id !== q.bundle_id) return p.bundle_id - q.bundle_id;
391
+ if (p.product_id !== q.product_id) return p.product_id - q.product_id;
374
392
  return p.num - q.num;
375
393
  });
376
394
  return JSON.stringify([normalizedOpts, normalizedBundles]);
377
395
  }
396
+
397
+ /**
398
+ * removeProductFromOrder 仅传 SKU 时的通配 identity(对象上未声明选项键)。
399
+ * 与显式 `product_sku: { option: [] }` 区分:后者只匹配「无选项」行。
400
+ */
378
401
  function isSkuOnlyDeleteIdentity(x) {
379
- if (x.identity_key)
380
- return false;
381
- return !("product_option_item" in x) && !("product_bundle" in x);
402
+ if (x.unique_identification_number || x.identity_key) return false;
403
+ return !('product_sku' in x) && !('product_bundle' in x);
382
404
  }
383
405
  function fingerprintForIdentityWithOptionKeys(x) {
384
406
  const row = x;
385
- const opts = "product_option_item" in row ? Array.isArray(row.product_option_item) ? row.product_option_item : [] : [];
386
- const buds = "product_bundle" in row ? Array.isArray(row.product_bundle) ? row.product_bundle : [] : [];
407
+ const opts = 'product_sku' in row ? (0, _utils.getProductSkuOptions)(row) : [];
408
+ const buds = 'product_bundle' in row ? Array.isArray(row.product_bundle) ? row.product_bundle : [] : [];
387
409
  return buildProductLineFingerprint(opts, buds);
388
410
  }
411
+
412
+ /**
413
+ * 判断两个商品 identity 是否匹配(不透明 identity 契约)。
414
+ *
415
+ * 调用约定:始终 `isIdentityMatch(line, callerIdentity)`。
416
+ * - 若 SKU(product_id + product_variant_id)不一致 → 不匹配。
417
+ * - **双方都带** `identity_key` → 严格字符串相等比较(不再猜测合成 key / metadata 桥接)。
418
+ * 这是 opaque identity 契约的标准路径:UI 删改时透传 SDK 回灌的 identity_key。
419
+ * - 否则(即至少一侧未声明 identity_key)→ 进入「SKU 通配 / 显式空选项 / 指纹」回退路径,
420
+ * 忽略线侧 identity_key,按内容语义匹配。这给「行已 opaque、调用方却想按 SKU 通配 / 选项指纹删除」留兼容入口。
421
+ */
389
422
  function isIdentityMatch(a, b) {
390
- if (a.product_id !== b.product_id || a.product_variant_id !== b.product_variant_id)
391
- return false;
392
- const aHasKey = typeof a.identity_key === "string" && a.identity_key.length > 0;
393
- const bHasKey = typeof b.identity_key === "string" && b.identity_key.length > 0;
394
- if (aHasKey && bHasKey)
395
- return a.identity_key === b.identity_key;
396
- if (isSkuOnlyDeleteIdentity(a) || isSkuOnlyDeleteIdentity(b))
397
- return true;
423
+ if (a.product_id !== b.product_id || a.product_variant_id !== b.product_variant_id) return false;
424
+ const aUid = a.metadata?.unique_identification_number ?? a.unique_identification_number ?? a.identity_key;
425
+ const bUid = b.metadata?.unique_identification_number ?? b.unique_identification_number ?? b.identity_key;
426
+ const aHasKey = typeof aUid === 'string' && aUid.length > 0;
427
+ const bHasKey = typeof bUid === 'string' && bUid.length > 0;
428
+ if (aHasKey && bHasKey) return aUid === bUid;
429
+ if (isSkuOnlyDeleteIdentity(a) || isSkuOnlyDeleteIdentity(b)) return true;
398
430
  return fingerprintForIdentityWithOptionKeys(a) === fingerprintForIdentityWithOptionKeys(b);
399
431
  }
432
+
433
+ /**
434
+ * 根据 identity 在商品列表中定位下标。
435
+ * 用于判断商品是否已存在(已存在则累加数量,否则新增)。
436
+ */
400
437
  function getProductIdentityIndex(products, identity) {
401
- return products.findIndex((item) => isIdentityMatch(item, identity));
438
+ return products.findIndex(item => isIdentityMatch(item, identity));
402
439
  }
440
+
441
+ /**
442
+ * 对外部传入的商品对象做归一化(v2 composite 语义):
443
+ * - 补全可选字段默认值(未传则使用兜底值,避免后续计算时因 undefined 导致异常)
444
+ * - 对 num 调用 getSafeProductNum 做安全处理
445
+ * - 保留 _origin 供后续业务流程(如促销规则)使用
446
+ *
447
+ * 价格字段语义(metadata 权威源 + composite 派生):
448
+ * - `metadata.source_product_price`:主商品/variant 基础价(已应用报价单),**不含 option**、
449
+ * **不含折扣**。是推导 main_product_* 的起点。variant 分支优先读 `metadata.origin.variant[vid].price`。
450
+ * - `metadata.main_product_original_price`:`source + Σ(option.price × option.num)`,**含 option**、
451
+ * **不含折扣**。
452
+ * - `metadata.main_product_selling_price`:`main_product_original_price - 主商品券 per-unit amount`,
453
+ * **含 option**、**含折扣**。
454
+ * - 行级 `selling_price` = `main_product_selling_price + Σ(bundle_selling_price × num)`。
455
+ * - 行级 `original_price` = `main_product_original_price + Σ(bundle 原价 × num)`。
456
+ *
457
+ * 迁移与幂等:
458
+ * - `metadata.price_schema_version === 2` → 已新语义归一化,保留 main_product_* 原值(保留折扣)。
459
+ * - 其它情况(v1 / 缺字段 / 无 metadata)→ 按"main_product_selling_price 曾是 main-only"的旧约定
460
+ * 反推 legacyDiscount,再以新 source + options 基准重算。最终统一打上 `price_schema_version: 2`。
461
+ * - 因此多次 normalize 不会重复叠加 option/bundle。
462
+ */
403
463
  function normalizeOrderProduct(product) {
404
- var _a, _b;
405
- const metadata = { ...product.metadata || {} };
406
- const resolvedIdentityKey = product.identity_key && String(product.identity_key).length > 0 ? String(product.identity_key) : (0, import_utils.createUuidV4)();
407
- if (!metadata.unique_identification_number) {
408
- metadata.unique_identification_number = resolvedIdentityKey;
464
+ const metadata = {
465
+ ...(product.metadata || {})
466
+ };
467
+ // 不透明 identity 契约:每条订单行必须带 identity_key。
468
+ // 调用方未传时由 SDK 自动生成 UUID,后续 update/remove 只做严格比对,避免猜测合成 key。
469
+ const resolvedIdentityKey = product.metadata?.unique_identification_number ? String(product.metadata.unique_identification_number) : product.unique_identification_number && String(product.unique_identification_number).length > 0 ? String(product.unique_identification_number) : product.identity_key && String(product.identity_key).length > 0 ? String(product.identity_key) : (0, _utils.createUuidV4)();
470
+ metadata.unique_identification_number = resolvedIdentityKey;
471
+ const priceOverride = metadata.price_override;
472
+ const originOtherBundle = metadata.origin?._extend?.other?.bundle;
473
+ let bundleInput = product.product_bundle || [];
474
+ if (priceOverride !== undefined && priceOverride !== null && priceOverride !== '' && Array.isArray(originOtherBundle) && originOtherBundle.length > 0) {
475
+ const priceById = new Map();
476
+ originOtherBundle.forEach(item => {
477
+ if (item?.id == null) return;
478
+ const unit = item.price ?? item.bundle_selling_price;
479
+ if (unit === undefined || unit === null) return;
480
+ priceById.set(String(item.id), String(unit));
481
+ });
482
+ const base = Array.isArray(bundleInput) && bundleInput.length > 0 ? bundleInput : originOtherBundle;
483
+ bundleInput = base.map(item => {
484
+ const unit = priceById.get(String(item?.id));
485
+ if (unit === undefined) return item;
486
+ return {
487
+ ...item,
488
+ price: unit,
489
+ bundle_selling_price: unit
490
+ };
491
+ });
409
492
  }
410
- const normalizedBundle = (product.product_bundle || []).map((item) => ({
411
- ...item,
412
- bundle_selling_price: item.bundle_selling_price ?? item.price ?? "0.00"
413
- // custom_price: item.custom_price ?? item.bundle_selling_price ?? item.price ?? '0.00',
414
- }));
415
- const normalizedOptions = product.product_option_item || [];
416
- const optionSum = (0, import_utils.sumOptionUnitPrice)(normalizedOptions);
417
- const isV2 = metadata.price_schema_version === 2 || metadata.price_schema_version === "2";
493
+ const normalizedBundle = bundleInput.map(item => {
494
+ const magnitudeSource = {
495
+ ...item,
496
+ // 计算 markdown 净额时,只把真实毛价交给 helper;若只有 bundle_selling_price,
497
+ // helper 会按历史净额兜底,避免 option 二次扣减。
498
+ price: item.price ?? item.custom_price
499
+ };
500
+ const normalizedItem = {
501
+ ...item,
502
+ bundle_id: item.bundle_id ?? item.id,
503
+ bundle_product_id: item.bundle_product_id ?? item._bundle_product_id,
504
+ bundle_group_id: item.bundle_group_id ?? item.group_id,
505
+ // price 保留毛价(markdown 仍为 5),由 price_type 决定符号。
506
+ price: item.price ?? item.custom_price ?? item.bundle_selling_price ?? '0.00',
507
+ price_type: item.price_type ?? item.custom_price_type ?? '',
508
+ price_type_ext: item.price_type_ext ?? item.custom_price_type_ext ?? ''
509
+ };
510
+ // bundle_selling_price 落「正净额」:markdown = |price| − Σoptions;markup/原价维持原值。
511
+ normalizedItem.bundle_selling_price = (0, _utils.getBundleSellingMagnitude)(magnitudeSource).toFixed(2);
512
+ if (normalizedItem.price_type === 'markdown' && (normalizedItem.price_type_ext === '' || normalizedItem.price_type_ext === undefined || normalizedItem.price_type_ext === null)) {
513
+ normalizedItem.custom_price = normalizedItem.custom_price ?? normalizedItem.price;
514
+ normalizedItem.price = normalizedItem.bundle_selling_price;
515
+ }
516
+ if ((normalizedItem.price_type === 'markdown' || normalizedItem.price_type === 'markup') && (normalizedItem.price_type_ext === '' || normalizedItem.price_type_ext === undefined || normalizedItem.price_type_ext === null)) {
517
+ delete normalizedItem.original_total;
518
+ }
519
+ return normalizedItem;
520
+ });
521
+ const normalizedOptions = (0, _utils.normalizeProductSkuOptions)(product.product_sku?.option);
522
+ const optionSum = (0, _utils.sumOptionUnitPrice)(normalizedOptions);
523
+ const productSku = {
524
+ ...(0, _utils.ensureProductSku)(product),
525
+ option: normalizedOptions
526
+ };
527
+
528
+ // 1) 解析 source_product_price。
529
+ // 优先级:
530
+ // 1) metadata.source_product_price(v2 权威)
531
+ // 2) variantPrice(命中 variant_id,从 metadata.origin.variant[vid].price 读)
532
+ // 3) _origin.price / _origin.base_price(后端语义的基础价)
533
+ // 4) v1 兼容:无 v2 标记但存在 metadata.main_product_original_price(v1 main-only,即旧 source)
534
+ // 5) 入参 original_price(v1 addProduct 约定:original_price 为 pre-discount 基础价)
535
+ // 6) 入参 selling_price(最末兜底,新添加路径 caller 只给 selling_price)
536
+ const isV2 = metadata.price_schema_version === 2 || metadata.price_schema_version === '2';
418
537
  const variantId = Number(product.product_variant_id || 0);
419
- const variantList = variantId ? (_a = metadata == null ? void 0 : metadata.origin) == null ? void 0 : _a.variant : null;
420
- const variantPrice = Array.isArray(variantList) ? (_b = variantList.find((v) => Number(v == null ? void 0 : v.id) === variantId)) == null ? void 0 : _b.price : void 0;
538
+ const variantList = variantId ? metadata?.origin?.variant : null;
539
+ const variantPrice = Array.isArray(variantList) ? variantList.find(v => Number(v?.id) === variantId)?.price : undefined;
421
540
  const resolvedSource = (() => {
422
- var _a2, _b2;
423
- if (metadata.source_product_price !== void 0) {
541
+ if (metadata.source_product_price !== undefined) {
424
542
  return String(metadata.source_product_price);
425
543
  }
426
- if (variantPrice !== void 0 && variantPrice !== null) {
544
+ if (variantPrice !== undefined && variantPrice !== null) {
427
545
  return String(variantPrice);
428
546
  }
429
- const originPrice = (_a2 = product._origin) == null ? void 0 : _a2.price;
430
- if (originPrice !== void 0 && originPrice !== null) {
547
+ const originPrice = product._origin?.price;
548
+ if (originPrice !== undefined && originPrice !== null) {
431
549
  return String(originPrice);
432
550
  }
433
- const originBasePrice = (_b2 = product._origin) == null ? void 0 : _b2.base_price;
434
- if (originBasePrice !== void 0 && originBasePrice !== null) {
551
+ const originBasePrice = product._origin?.base_price;
552
+ if (originBasePrice !== undefined && originBasePrice !== null) {
435
553
  return String(originBasePrice);
436
554
  }
437
- if (!isV2 && metadata.main_product_original_price !== void 0) {
555
+ if (!isV2 && metadata.main_product_original_price !== undefined) {
438
556
  return String(metadata.main_product_original_price);
439
557
  }
440
- return product.original_price ?? product.selling_price ?? "0.00";
558
+ return product.original_price ?? product.selling_price ?? '0.00';
441
559
  })();
442
- const mainOriginalDec = new import_decimal.default(Number(resolvedSource) || 0).plus(optionSum);
560
+
561
+ // 2) 派生 main_product_original_price(含 option、不含折扣)
562
+ const mainOriginalDec = new _decimal.default(Number(resolvedSource) || 0).plus(optionSum);
443
563
  const mainOriginalStr = mainOriginalDec.toDecimalPlaces(2).toFixed(2);
564
+
565
+ // 3) 派生 main_product_selling_price(含 option、含主商品折扣)
566
+ // - v2 数据:直接沿用 metadata.main_product_selling_price(保留折扣)
567
+ // - v1 metadata:main_product_selling_price 旧语义是 main-only(≈ source-level 折后价),
568
+ // 反推 legacyDiscount = main_original(旧) - main_selling(旧),再用新 main_original - legacyDiscount
569
+ // - v1 addProduct 入参:top-level selling_price < original_price 表示主商品折扣;
570
+ // 用差额作为 legacyDiscount 映射到新 main_selling
571
+ // - 其它:视为无折扣,main_selling = main_original
444
572
  let mainSellingDec;
445
573
  if (isV2 && metadata.main_product_selling_price != null) {
446
- mainSellingDec = new import_decimal.default(Number(metadata.main_product_selling_price) || 0);
574
+ mainSellingDec = new _decimal.default(Number(metadata.main_product_selling_price) || 0);
447
575
  } else if (metadata.main_product_selling_price != null && metadata.main_product_original_price != null) {
448
- const legacyOriginal = new import_decimal.default(Number(metadata.main_product_original_price) || 0);
449
- const legacySelling = new import_decimal.default(Number(metadata.main_product_selling_price) || 0);
576
+ const legacyOriginal = new _decimal.default(Number(metadata.main_product_original_price) || 0);
577
+ const legacySelling = new _decimal.default(Number(metadata.main_product_selling_price) || 0);
450
578
  const legacyDiscount = legacyOriginal.minus(legacySelling);
451
579
  mainSellingDec = mainOriginalDec.minus(legacyDiscount);
452
- } else if (product.original_price != null && product.selling_price != null && new import_decimal.default(Number(product.original_price) || 0).greaterThan(
453
- new import_decimal.default(Number(product.selling_price) || 0)
454
- )) {
455
- const topOriginal = new import_decimal.default(Number(product.original_price) || 0);
456
- const topSelling = new import_decimal.default(Number(product.selling_price) || 0);
580
+ } else if (product.original_price != null && product.selling_price != null && new _decimal.default(Number(product.original_price) || 0).greaterThan(new _decimal.default(Number(product.selling_price) || 0))) {
581
+ const topOriginal = new _decimal.default(Number(product.original_price) || 0);
582
+ const topSelling = new _decimal.default(Number(product.selling_price) || 0);
457
583
  const legacyDiscount = topOriginal.minus(topSelling);
458
584
  mainSellingDec = mainOriginalDec.minus(legacyDiscount);
459
585
  } else {
460
586
  mainSellingDec = mainOriginalDec;
461
587
  }
462
588
  const mainSellingStr = mainSellingDec.toDecimalPlaces(2).toFixed(2);
589
+
590
+ // 4) 落盘 metadata:三字段 + schema 版本 sentinel
463
591
  metadata.source_product_price = resolvedSource;
464
592
  metadata.main_product_original_price = mainOriginalStr;
465
593
  metadata.main_product_selling_price = mainSellingStr;
466
594
  metadata.price_schema_version = 2;
467
- const composedSellingPrice = (0, import_utils.composeLinePrice)({
595
+
596
+ // 5) 合成行级 composite(main 已含 option,本步只叠 bundle)
597
+ const composedSellingPrice = (0, _utils.composeLinePrice)({
468
598
  mainPrice: mainSellingStr,
469
599
  bundle: normalizedBundle
470
600
  });
471
- const composedOriginalPrice = (0, import_utils.composeLinePrice)({
601
+ const composedOriginalPrice = (0, _utils.composeLinePrice)({
472
602
  mainPrice: mainOriginalStr,
473
603
  bundle: normalizedBundle,
474
604
  useOriginalBundle: true
475
605
  });
606
+ const finalOriginalPrice = (0, _utils.resolveManualOverrideLineOriginalPrice)({
607
+ num: product.num,
608
+ metadata,
609
+ lineOriginalPrice: product.original_price
610
+ }, composedOriginalPrice);
611
+ const hasManualProductDiscount = (product.discount_list || []).some(item => item?.type === 'product');
612
+ const manualOriginalPrice = hasManualProductDiscount && product.original_price != null ? String(product.original_price) : finalOriginalPrice;
613
+ const discountList = (0, _manualProductDiscount.ensureManualProductDiscountList)({
614
+ discountList: product.discount_list,
615
+ metadata,
616
+ originalPrice: manualOriginalPrice,
617
+ sellingPrice: composedSellingPrice,
618
+ quantity: getSafeProductNum(product.num)
619
+ });
476
620
  return {
477
621
  order_detail_id: product.order_detail_id || null,
478
622
  product_id: product.product_id,
479
623
  num: getSafeProductNum(product.num),
480
624
  product_variant_id: product.product_variant_id,
481
- identity_key: resolvedIdentityKey,
482
- product_option_item: normalizedOptions,
625
+ product_sku: productSku,
483
626
  selling_price: composedSellingPrice,
484
- original_price: composedOriginalPrice,
485
- tax_fee: product.tax_fee || "0.00",
627
+ original_price: manualOriginalPrice,
628
+ tax_fee: product.tax_fee || '0.00',
486
629
  is_charge_tax: product.is_charge_tax ?? 0,
487
- discount_list: product.discount_list || [],
630
+ discount_list: discountList,
488
631
  product_bundle: normalizedBundle,
489
632
  metadata,
490
- note: product.note != null ? String(product.note) : "",
491
- _origin: product._origin
633
+ note: product.note != null ? String(product.note) : ''
492
634
  };
493
635
  }
636
+
637
+ /**
638
+ * 从 reservation.enabled_reservation_rules 中收集 type=link 的商品 id。
639
+ */
494
640
  function collectLinkProductIdsFromReservationRules(rules) {
495
- if (!Array.isArray(rules))
496
- return [];
641
+ if (!Array.isArray(rules)) return [];
497
642
  const ids = [];
498
643
  for (const entry of rules) {
499
- if (!entry || typeof entry !== "object")
500
- continue;
644
+ if (!entry || typeof entry !== 'object') continue;
501
645
  const rec = entry;
502
- if (rec.type !== "link")
503
- continue;
504
- if (!Array.isArray(rec.value))
505
- continue;
646
+ if (rec.type !== 'link') continue;
647
+ if (!Array.isArray(rec.value)) continue;
506
648
  for (const v of rec.value) {
507
649
  const n = Number(v);
508
- if (Number.isFinite(n) && n > 0)
509
- ids.push(Math.floor(n));
650
+ if (Number.isFinite(n) && n > 0) ids.push(Math.floor(n));
510
651
  }
511
652
  }
512
653
  return [...new Set(ids)];
513
654
  }
655
+
656
+ /**
657
+ * 找到第一个归属指定桌台的预约规则商品。
658
+ * 归属判断基于商品资源中的 default_resource / optional_resource。
659
+ */
514
660
  function findReservationRuleProductByResourceId(products, resourceId) {
515
- var _a;
516
661
  const numericResourceId = Number(resourceId);
517
- if (!Number.isFinite(numericResourceId) || numericResourceId <= 0)
518
- return void 0;
662
+ if (!Number.isFinite(numericResourceId) || numericResourceId <= 0) return undefined;
519
663
  for (const product of products) {
520
- const resources = (_a = product == null ? void 0 : product.product_resource) == null ? void 0 : _a.resources;
521
- if (!Array.isArray(resources))
522
- continue;
523
- const hasMatchedResource = resources.some((resource) => {
524
- const defaultResources = Array.isArray(resource == null ? void 0 : resource.default_resource) ? resource.default_resource : [];
525
- const optionalResources = Array.isArray(resource == null ? void 0 : resource.optional_resource) ? resource.optional_resource : [];
526
- return [...defaultResources, ...optionalResources].some(
527
- (id) => Number(id) === numericResourceId
528
- );
664
+ const resources = product?.product_resource?.resources;
665
+ if (!Array.isArray(resources)) continue;
666
+ const hasMatchedResource = resources.some(resource => {
667
+ const defaultResources = Array.isArray(resource?.default_resource) ? resource.default_resource : [];
668
+ const optionalResources = Array.isArray(resource?.optional_resource) ? resource.optional_resource : [];
669
+ return [...defaultResources, ...optionalResources].some(id => Number(id) === numericResourceId);
529
670
  });
530
- if (hasMatchedResource)
531
- return product;
671
+ if (hasMatchedResource) return product;
532
672
  }
533
- return void 0;
673
+ return undefined;
534
674
  }
675
+
676
+ /**
677
+ * 返回列表中第一个带有效 duration.value(分钟)的商品时长。
678
+ */
535
679
  function pickFirstDurationMinutesFromProducts(products) {
536
- var _a;
537
680
  for (const product of products) {
538
- const value = (_a = product == null ? void 0 : product.duration) == null ? void 0 : _a.value;
681
+ const value = product?.duration?.value;
539
682
  const n = Number(value);
540
- if (Number.isFinite(n) && n > 0)
541
- return Math.floor(n);
683
+ if (Number.isFinite(n) && n > 0) return Math.floor(n);
542
684
  }
543
- return void 0;
685
+ return undefined;
544
686
  }
687
+
688
+ /** 是否存在 capacity.type === 'custom' 的商品 */
545
689
  function hasCustomCapacityProduct(products) {
546
- return products.some((p) => {
547
- var _a;
548
- return ((_a = p == null ? void 0 : p.capacity) == null ? void 0 : _a.type) === "custom";
549
- });
690
+ return products.some(p => p?.capacity?.type === 'custom');
550
691
  }
692
+
693
+ /**
694
+ * 根据预约规则商品的 resource.type 计算桌台是否已被"占满"。
695
+ * - single:只要有 `lastOrderId` 即视为占用
696
+ * - multiple:当前时间落在 `capacity_list[i]` 的 `[start_at, end_at]`(inclusive)内的 pax 之和 >= 总容量
697
+ * - 其他('capacity' / undefined):返回 false,不施加限制
698
+ */
551
699
  function computeResourceIsFull(params) {
552
- const { resourceSelectType, lastOrderId, capacityList, capacity } = params;
553
- if (resourceSelectType === "single")
554
- return Boolean(lastOrderId);
555
- if (resourceSelectType !== "multiple")
556
- return false;
700
+ const {
701
+ resourceSelectType,
702
+ lastOrderId,
703
+ capacityList,
704
+ capacity
705
+ } = params;
706
+ if (resourceSelectType === 'single') return Boolean(lastOrderId);
707
+ if (resourceSelectType !== 'multiple') return false;
557
708
  const totalCapacity = Number(capacity);
558
- if (!Number.isFinite(totalCapacity) || totalCapacity <= 0)
559
- return false;
560
- const now = (0, import_dayjs.default)();
709
+ if (!Number.isFinite(totalCapacity) || totalCapacity <= 0) return false;
710
+ const now = (0, _dayjs.default)();
561
711
  let occupied = 0;
562
712
  for (const slot of capacityList || []) {
563
- const start = (0, import_dayjs.default)(slot == null ? void 0 : slot.start_at);
564
- const end = (0, import_dayjs.default)(slot == null ? void 0 : slot.end_at);
565
- if (!start.isValid() || !end.isValid())
566
- continue;
713
+ const start = (0, _dayjs.default)(slot?.start_at);
714
+ const end = (0, _dayjs.default)(slot?.end_at);
715
+ if (!start.isValid() || !end.isValid()) continue;
567
716
  if ((now.isAfter(start) || now.isSame(start)) && (now.isBefore(end) || now.isSame(end))) {
568
- const pax = Number(slot == null ? void 0 : slot.pax);
569
- if (Number.isFinite(pax) && pax > 0)
570
- occupied += pax;
717
+ const pax = Number(slot?.pax);
718
+ if (Number.isFinite(pax) && pax > 0) occupied += pax;
571
719
  }
572
720
  }
573
721
  return occupied >= totalCapacity;
574
722
  }
723
+
724
+ /**
725
+ * 在商品列表中找到第一个 `capacity.type === 'custom'` 的商品,取其 `custom` 数组第一项的 min/max。
726
+ * 仅返回有限数字字段;若均无法解析则返回 `undefined`。
727
+ */
575
728
  function pickFirstCustomCapacityPaxBounds(products) {
576
729
  for (const p of products) {
577
- const cap = p == null ? void 0 : p.capacity;
578
- if (!cap || cap.type !== "custom")
579
- continue;
580
- if (!Array.isArray(cap.custom) || cap.custom.length === 0)
581
- continue;
730
+ const cap = p?.capacity;
731
+ if (!cap || cap.type !== 'custom') continue;
732
+ if (!Array.isArray(cap.custom) || cap.custom.length === 0) continue;
582
733
  const row = cap.custom[0];
583
- if (!row || typeof row !== "object")
584
- continue;
734
+ if (!row || typeof row !== 'object') continue;
585
735
  const raw = row;
586
736
  const out = {};
587
- if (raw.min !== null && raw.min !== void 0 && raw.min !== "") {
737
+ if (raw.min !== null && raw.min !== undefined && raw.min !== '') {
588
738
  const min = Number(raw.min);
589
- if (Number.isFinite(min))
590
- out.min = min;
739
+ if (Number.isFinite(min)) out.min = min;
591
740
  }
592
- if (raw.max !== null && raw.max !== void 0 && raw.max !== "") {
741
+ if (raw.max !== null && raw.max !== undefined && raw.max !== '') {
593
742
  const max = Number(raw.max);
594
- if (Number.isFinite(max))
595
- out.max = max;
743
+ if (Number.isFinite(max)) out.max = max;
596
744
  }
597
- if (out.min !== void 0 || out.max !== void 0)
598
- return out;
745
+ if (out.min !== undefined || out.max !== undefined) return out;
599
746
  }
600
- return void 0;
747
+ return undefined;
601
748
  }
749
+
750
+ /**
751
+ * 第一个 `capacity.type === 'custom'` 的商品,取其 `custom[0].id`(提交 booking metadata.capacity 维度 id)。
752
+ * 无匹配时返回 `undefined`,调用方应回退为 `0`。
753
+ */
602
754
  function pickFirstCustomCapacityDimensionId(products) {
603
755
  for (const p of products) {
604
- const cap = p == null ? void 0 : p.capacity;
605
- if (!cap || cap.type !== "custom")
606
- continue;
607
- if (!Array.isArray(cap.custom) || cap.custom.length === 0)
608
- continue;
756
+ const cap = p?.capacity;
757
+ if (!cap || cap.type !== 'custom') continue;
758
+ if (!Array.isArray(cap.custom) || cap.custom.length === 0) continue;
609
759
  const row = cap.custom[0];
610
- if (!row || typeof row !== "object")
611
- continue;
760
+ if (!row || typeof row !== 'object') continue;
612
761
  const id = row.id;
613
- if (id === null || id === void 0 || id === "")
614
- continue;
615
- if (typeof id === "number" && Number.isFinite(id))
616
- return id;
617
- if (typeof id === "string") {
762
+ if (id === null || id === undefined || id === '') continue;
763
+ if (typeof id === 'number' && Number.isFinite(id)) return id;
764
+ if (typeof id === 'string') {
618
765
  const trimmed = id.trim();
619
- if (!trimmed)
620
- continue;
766
+ if (!trimmed) continue;
621
767
  return trimmed;
622
768
  }
623
769
  }
624
- return void 0;
625
- }
626
- // Annotate the CommonJS export names for ESM import in node:
627
- 0 && (module.exports = {
628
- aggregateItemRuleLimit,
629
- attachItemRuleLimitsToTopLevelProducts,
630
- buildItemRuleBusinessData,
631
- buildProductKey,
632
- buildProductLineFingerprint,
633
- buildQuantityLimitIndex,
634
- collectLinkProductIdsFromReservationRules,
635
- computeResourceIsFull,
636
- createEmptySummary,
637
- extractStrategyModelIdsFromTableConfig,
638
- findReservationRuleProductByResourceId,
639
- getProductIdentityIndex,
640
- getSafeProductNum,
641
- getTopLevelProductId,
642
- getTopLevelVariantId,
643
- hasCustomCapacityProduct,
644
- isIdentityMatch,
645
- isSkuOnlyDeleteIdentity,
646
- normalizeEnabledItemRuleIds,
647
- normalizeItemRuleStrategies,
648
- normalizeOrderProduct,
649
- pickFirstCustomCapacityDimensionId,
650
- pickFirstCustomCapacityPaxBounds,
651
- pickFirstDurationMinutesFromProducts,
652
- resolveSkuMatchedQuantityLimits,
653
- toBoolean,
654
- toNonNegativeInt,
655
- toNonNegativeNumber,
656
- toPositiveString,
657
- toPriceString
658
- });
770
+ return undefined;
771
+ }