@pisell/pisellos 2.2.243 → 2.2.244

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 (315) hide show
  1. package/dist/model/strategy/adapter/promotion/evaluator.js +2 -3
  2. package/dist/model/strategy/adapter/promotion/index.js +9 -0
  3. package/dist/model/strategy/adapter/walletPass/utils.js +4 -7
  4. package/dist/modules/Cart/utils/cartProduct.js +3 -24
  5. package/dist/modules/Cart/utils/changePrice.js +11 -11
  6. package/dist/modules/Customer/index.d.ts +0 -20
  7. package/dist/modules/Customer/index.js +83 -172
  8. package/dist/modules/Customer/types.d.ts +0 -2
  9. package/dist/modules/Discount/index.js +3 -4
  10. package/dist/modules/Discount/types.d.ts +0 -1
  11. package/dist/modules/OpenData/index.d.ts +0 -8
  12. package/dist/modules/OpenData/index.js +17 -37
  13. package/dist/modules/Order/index.d.ts +18 -268
  14. package/dist/modules/Order/index.js +757 -3306
  15. package/dist/modules/Order/types.d.ts +31 -279
  16. package/dist/modules/Order/types.js +0 -38
  17. package/dist/modules/Order/utils.d.ts +5 -147
  18. package/dist/modules/Order/utils.js +103 -746
  19. package/dist/modules/Payment/index.d.ts +13 -10
  20. package/dist/modules/Payment/index.js +837 -467
  21. package/dist/modules/Payment/types.d.ts +0 -2
  22. package/dist/modules/Payment/utils.js +1 -2
  23. package/dist/modules/Payment/walletpass.js +7 -14
  24. package/dist/modules/ProductList/index.d.ts +12 -16
  25. package/dist/modules/ProductList/index.js +59 -133
  26. package/dist/modules/ProductList/types.d.ts +0 -14
  27. package/dist/modules/Quotation/index.d.ts +1 -0
  28. package/dist/modules/Quotation/index.js +22 -25
  29. package/dist/modules/Rules/index.d.ts +0 -4
  30. package/dist/modules/Rules/index.js +69 -93
  31. package/dist/modules/Rules/types.d.ts +0 -1
  32. package/dist/modules/SalesSummary/index.d.ts +25 -8
  33. package/dist/modules/SalesSummary/index.js +35 -86
  34. package/dist/modules/SalesSummary/types.d.ts +1 -4
  35. package/dist/modules/SalesSummary/utils.d.ts +25 -2
  36. package/dist/modules/SalesSummary/utils.js +162 -794
  37. package/dist/modules/Schedule/index.d.ts +0 -7
  38. package/dist/modules/Schedule/index.js +2 -24
  39. package/dist/modules/Summary/index.js +3 -4
  40. package/dist/modules/index.d.ts +0 -2
  41. package/dist/modules/index.js +1 -3
  42. package/dist/plugins/request.d.ts +0 -1
  43. package/dist/server/index.d.ts +1 -204
  44. package/dist/server/index.js +928 -3658
  45. package/dist/server/modules/index.d.ts +0 -2
  46. package/dist/server/modules/index.js +0 -2
  47. package/dist/server/modules/order/index.d.ts +4 -120
  48. package/dist/server/modules/order/index.js +483 -1779
  49. package/dist/server/modules/order/types.d.ts +3 -32
  50. package/dist/server/modules/order/types.js +0 -8
  51. package/dist/server/modules/order/utils/filterBookings.js +3 -26
  52. package/dist/server/modules/order/utils/filterOrders.js +8 -23
  53. package/dist/server/modules/products/index.d.ts +7 -34
  54. package/dist/server/modules/products/index.js +317 -631
  55. package/dist/server/modules/resource/index.d.ts +0 -2
  56. package/dist/server/modules/resource/index.js +3 -29
  57. package/dist/server/modules/schedule/index.d.ts +4 -4
  58. package/dist/server/modules/schedule/index.js +88 -111
  59. package/dist/solution/BaseSales/index.d.ts +9 -131
  60. package/dist/solution/BaseSales/index.js +447 -1944
  61. package/dist/solution/BaseSales/types.d.ts +6 -76
  62. package/dist/solution/BaseSales/types.js +4 -5
  63. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +0 -1
  64. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +24 -105
  65. package/dist/solution/BaseSales/utils.d.ts +1 -1
  66. package/dist/solution/BaseSales/utils.js +21 -62
  67. package/dist/solution/BookingByStep/index.d.ts +1 -1
  68. package/dist/solution/BookingTicket/index.d.ts +10 -270
  69. package/dist/solution/BookingTicket/index.js +237 -1772
  70. package/dist/solution/BookingTicket/types.d.ts +1 -118
  71. package/dist/solution/BookingTicket/types.js +2 -41
  72. package/dist/solution/BookingTicket/utils/bookingStatus.d.ts +0 -40
  73. package/dist/solution/BookingTicket/utils/bookingStatus.js +0 -70
  74. package/dist/solution/BookingTicket/utils/cartView.d.ts +1 -9
  75. package/dist/solution/BookingTicket/utils/cartView.js +7 -94
  76. package/dist/solution/BookingTicket/utils/scan/index.d.ts +0 -5
  77. package/dist/solution/BookingTicket/utils/scan/index.js +8 -20
  78. package/dist/solution/Checkout/appointmentDemo.json +1 -0
  79. package/dist/solution/Checkout/index.d.ts +0 -1
  80. package/dist/solution/Checkout/index.js +9 -10
  81. package/dist/solution/RegisterAndLogin/config.js +10 -2
  82. package/dist/solution/ScanOrder/index.d.ts +3 -9
  83. package/dist/solution/ScanOrder/index.js +134 -241
  84. package/dist/solution/ScanOrder/types.d.ts +5 -9
  85. package/dist/solution/ScanOrder/types.js +3 -2
  86. package/dist/solution/ScanOrder/utils.d.ts +1 -1
  87. package/dist/solution/ScanOrder/utils.js +22 -84
  88. package/dist/solution/VenueBooking/index.d.ts +2 -5
  89. package/dist/solution/VenueBooking/index.js +59 -110
  90. package/dist/solution/VenueBooking/sales-section-4-annotated.json +2 -0
  91. package/dist/solution/VenueBooking/utils/slotMerge.d.ts +0 -4
  92. package/dist/solution/VenueBooking/utils/slotMerge.js +0 -10
  93. package/dist/types/index.d.ts +0 -10
  94. package/lib/model/strategy/adapter/promotion/evaluator.js +1 -2
  95. package/lib/model/strategy/adapter/promotion/index.js +0 -49
  96. package/lib/model/strategy/adapter/walletPass/utils.js +2 -3
  97. package/lib/modules/Cart/utils/cartProduct.js +3 -20
  98. package/lib/modules/Cart/utils/changePrice.js +20 -12
  99. package/lib/modules/Customer/index.d.ts +0 -20
  100. package/lib/modules/Customer/index.js +11 -64
  101. package/lib/modules/Customer/types.d.ts +0 -2
  102. package/lib/modules/Discount/index.js +1 -5
  103. package/lib/modules/Discount/types.d.ts +0 -1
  104. package/lib/modules/OpenData/index.d.ts +0 -8
  105. package/lib/modules/OpenData/index.js +5 -19
  106. package/lib/modules/Order/index.d.ts +18 -268
  107. package/lib/modules/Order/index.js +344 -2149
  108. package/lib/modules/Order/types.d.ts +31 -279
  109. package/lib/modules/Order/types.js +0 -1
  110. package/lib/modules/Order/utils.d.ts +5 -147
  111. package/lib/modules/Order/utils.js +46 -614
  112. package/lib/modules/Payment/index.d.ts +13 -10
  113. package/lib/modules/Payment/index.js +150 -18
  114. package/lib/modules/Payment/types.d.ts +0 -2
  115. package/lib/modules/Payment/utils.js +1 -2
  116. package/lib/modules/Payment/walletpass.js +3 -7
  117. package/lib/modules/ProductList/index.d.ts +12 -16
  118. package/lib/modules/ProductList/index.js +4 -41
  119. package/lib/modules/ProductList/types.d.ts +0 -14
  120. package/lib/modules/Quotation/index.d.ts +1 -0
  121. package/lib/modules/Quotation/index.js +16 -19
  122. package/lib/modules/Rules/index.d.ts +0 -4
  123. package/lib/modules/Rules/index.js +120 -136
  124. package/lib/modules/Rules/types.d.ts +0 -1
  125. package/lib/modules/SalesSummary/index.d.ts +25 -8
  126. package/lib/modules/SalesSummary/index.js +4 -30
  127. package/lib/modules/SalesSummary/types.d.ts +1 -4
  128. package/lib/modules/SalesSummary/utils.d.ts +25 -2
  129. package/lib/modules/SalesSummary/utils.js +91 -645
  130. package/lib/modules/Schedule/index.d.ts +0 -7
  131. package/lib/modules/Schedule/index.js +1 -17
  132. package/lib/modules/Summary/index.js +4 -5
  133. package/lib/modules/index.d.ts +0 -2
  134. package/lib/modules/index.js +1 -5
  135. package/lib/plugins/request.d.ts +0 -1
  136. package/lib/server/index.d.ts +1 -204
  137. package/lib/server/index.js +57 -1888
  138. package/lib/server/modules/index.d.ts +0 -2
  139. package/lib/server/modules/index.js +0 -3
  140. package/lib/server/modules/order/index.d.ts +4 -120
  141. package/lib/server/modules/order/index.js +142 -919
  142. package/lib/server/modules/order/types.d.ts +3 -32
  143. package/lib/server/modules/order/utils/filterBookings.js +5 -24
  144. package/lib/server/modules/order/utils/filterOrders.js +6 -15
  145. package/lib/server/modules/products/index.d.ts +7 -34
  146. package/lib/server/modules/products/index.js +54 -189
  147. package/lib/server/modules/resource/index.d.ts +0 -2
  148. package/lib/server/modules/resource/index.js +3 -27
  149. package/lib/server/modules/schedule/index.d.ts +4 -4
  150. package/lib/server/modules/schedule/index.js +40 -47
  151. package/lib/solution/BaseSales/index.d.ts +9 -131
  152. package/lib/solution/BaseSales/index.js +63 -1106
  153. package/lib/solution/BaseSales/types.d.ts +6 -76
  154. package/lib/solution/BaseSales/types.js +1 -3
  155. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +0 -1
  156. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +18 -106
  157. package/lib/solution/BaseSales/utils.d.ts +1 -1
  158. package/lib/solution/BaseSales/utils.js +10 -54
  159. package/lib/solution/BookingByStep/index.d.ts +1 -1
  160. package/lib/solution/BookingTicket/index.d.ts +10 -270
  161. package/lib/solution/BookingTicket/index.js +29 -922
  162. package/lib/solution/BookingTicket/types.d.ts +1 -118
  163. package/lib/solution/BookingTicket/types.js +0 -11
  164. package/lib/solution/BookingTicket/utils/bookingStatus.d.ts +0 -40
  165. package/lib/solution/BookingTicket/utils/bookingStatus.js +2 -44
  166. package/lib/solution/BookingTicket/utils/cartView.d.ts +1 -9
  167. package/lib/solution/BookingTicket/utils/cartView.js +6 -61
  168. package/lib/solution/BookingTicket/utils/scan/index.d.ts +0 -5
  169. package/lib/solution/BookingTicket/utils/scan/index.js +3 -17
  170. package/lib/solution/Checkout/appointmentDemo.json +1 -0
  171. package/lib/solution/Checkout/index.d.ts +0 -1
  172. package/lib/solution/Checkout/index.js +2 -1
  173. package/lib/solution/RegisterAndLogin/config.js +10 -2
  174. package/lib/solution/ScanOrder/index.d.ts +3 -9
  175. package/lib/solution/ScanOrder/index.js +70 -153
  176. package/lib/solution/ScanOrder/types.d.ts +5 -9
  177. package/lib/solution/ScanOrder/utils.d.ts +1 -1
  178. package/lib/solution/ScanOrder/utils.js +17 -83
  179. package/lib/solution/VenueBooking/index.d.ts +2 -5
  180. package/lib/solution/VenueBooking/index.js +17 -54
  181. package/lib/solution/VenueBooking/sales-section-4-annotated.json +2 -0
  182. package/lib/solution/VenueBooking/utils/slotMerge.d.ts +0 -4
  183. package/lib/solution/VenueBooking/utils/slotMerge.js +0 -10
  184. package/lib/types/index.d.ts +0 -10
  185. package/package.json +1 -1
  186. package/dist/modules/BookingContext/index.d.ts +0 -48
  187. package/dist/modules/BookingContext/index.js +0 -566
  188. package/dist/modules/BookingContext/types.d.ts +0 -102
  189. package/dist/modules/BookingContext/types.js +0 -51
  190. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts +0 -16
  191. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +0 -284
  192. package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +0 -8
  193. package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +0 -145
  194. package/dist/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +0 -76
  195. package/dist/modules/BookingContext/utils/cacheItemToBookingInput.js +0 -218
  196. package/dist/modules/BookingContext/utils/flexible.d.ts +0 -28
  197. package/dist/modules/BookingContext/utils/flexible.js +0 -56
  198. package/dist/modules/BookingContext/utils/formatResourceList.d.ts +0 -8
  199. package/dist/modules/BookingContext/utils/formatResourceList.js +0 -38
  200. package/dist/modules/BookingContext/utils/index.d.ts +0 -11
  201. package/dist/modules/BookingContext/utils/index.js +0 -11
  202. package/dist/modules/BookingContext/utils/noResource.d.ts +0 -13
  203. package/dist/modules/BookingContext/utils/noResource.js +0 -77
  204. package/dist/modules/BookingContext/utils/orderLineDisplay.d.ts +0 -1
  205. package/dist/modules/BookingContext/utils/orderLineDisplay.js +0 -36
  206. package/dist/modules/BookingContext/utils/productExtend.d.ts +0 -72
  207. package/dist/modules/BookingContext/utils/productExtend.js +0 -339
  208. package/dist/modules/BookingContext/utils/resourceErrors.d.ts +0 -41
  209. package/dist/modules/BookingContext/utils/resourceErrors.js +0 -74
  210. package/dist/modules/BookingContext/utils/resourceSelection.d.ts +0 -7
  211. package/dist/modules/BookingContext/utils/resourceSelection.js +0 -24
  212. package/dist/modules/BookingContext/utils/resources.d.ts +0 -80
  213. package/dist/modules/BookingContext/utils/resources.js +0 -486
  214. package/dist/modules/BookingContext/utils/serviceTimes.d.ts +0 -55
  215. package/dist/modules/BookingContext/utils/serviceTimes.js +0 -151
  216. package/dist/modules/BookingContext/utils/timeSlices.d.ts +0 -42
  217. package/dist/modules/BookingContext/utils/timeSlices.js +0 -100
  218. package/dist/modules/Order/utils/manualProductDiscount.d.ts +0 -106
  219. package/dist/modules/Order/utils/manualProductDiscount.js +0 -210
  220. package/dist/modules/SurchargeList/index.d.ts +0 -16
  221. package/dist/modules/SurchargeList/index.js +0 -162
  222. package/dist/modules/SurchargeList/types.d.ts +0 -11
  223. package/dist/modules/SurchargeList/types.js +0 -1
  224. package/dist/server/modules/payment/index.d.ts +0 -28
  225. package/dist/server/modules/payment/index.js +0 -305
  226. package/dist/server/modules/payment/types.d.ts +0 -9
  227. package/dist/server/modules/payment/types.js +0 -1
  228. package/dist/server/test.json +0 -713
  229. package/dist/server/utils/small-ticket.d.ts +0 -71
  230. package/dist/server/utils/small-ticket.js +0 -830
  231. package/dist/solution/BaseSales/utils/cartPromotion.d.ts +0 -287
  232. package/dist/solution/BaseSales/utils/cartPromotion.js +0 -1438
  233. package/dist/solution/BaseSales/utils/quotationPrice.d.ts +0 -7
  234. package/dist/solution/BaseSales/utils/quotationPrice.js +0 -237
  235. package/dist/solution/BookingTicket/utils/addProductDecision.d.ts +0 -117
  236. package/dist/solution/BookingTicket/utils/addProductDecision.js +0 -346
  237. package/dist/solution/BookingTicket/utils/addTimeAvailability.d.ts +0 -35
  238. package/dist/solution/BookingTicket/utils/addTimeAvailability.js +0 -95
  239. package/dist/solution/BookingTicket/utils/exampleData.d.ts +0 -123
  240. package/dist/solution/BookingTicket/utils/exampleData.js +0 -183
  241. package/dist/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +0 -185
  242. package/dist/solution/BookingTicket/utils/resolveBestAddTimePlan.js +0 -438
  243. package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +0 -36
  244. package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +0 -399
  245. package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +0 -32
  246. package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.js +0 -56
  247. package/dist/solution/BookingTicket/utils/scan/scanProductValues.d.ts +0 -21
  248. package/dist/solution/BookingTicket/utils/scan/scanProductValues.js +0 -150
  249. package/dist/solution/BookingTicket/utils/sessionCatalogStale.d.ts +0 -23
  250. package/dist/solution/BookingTicket/utils/sessionCatalogStale.js +0 -78
  251. package/lib/modules/BookingContext/index.d.ts +0 -48
  252. package/lib/modules/BookingContext/index.js +0 -368
  253. package/lib/modules/BookingContext/types.d.ts +0 -102
  254. package/lib/modules/BookingContext/types.js +0 -34
  255. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts +0 -16
  256. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +0 -276
  257. package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +0 -8
  258. package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +0 -151
  259. package/lib/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +0 -76
  260. package/lib/modules/BookingContext/utils/cacheItemToBookingInput.js +0 -201
  261. package/lib/modules/BookingContext/utils/flexible.d.ts +0 -28
  262. package/lib/modules/BookingContext/utils/flexible.js +0 -80
  263. package/lib/modules/BookingContext/utils/formatResourceList.d.ts +0 -8
  264. package/lib/modules/BookingContext/utils/formatResourceList.js +0 -50
  265. package/lib/modules/BookingContext/utils/index.d.ts +0 -11
  266. package/lib/modules/BookingContext/utils/index.js +0 -43
  267. package/lib/modules/BookingContext/utils/noResource.d.ts +0 -13
  268. package/lib/modules/BookingContext/utils/noResource.js +0 -90
  269. package/lib/modules/BookingContext/utils/orderLineDisplay.d.ts +0 -1
  270. package/lib/modules/BookingContext/utils/orderLineDisplay.js +0 -56
  271. package/lib/modules/BookingContext/utils/productExtend.d.ts +0 -72
  272. package/lib/modules/BookingContext/utils/productExtend.js +0 -283
  273. package/lib/modules/BookingContext/utils/resourceErrors.d.ts +0 -41
  274. package/lib/modules/BookingContext/utils/resourceErrors.js +0 -80
  275. package/lib/modules/BookingContext/utils/resourceSelection.d.ts +0 -7
  276. package/lib/modules/BookingContext/utils/resourceSelection.js +0 -46
  277. package/lib/modules/BookingContext/utils/resources.d.ts +0 -80
  278. package/lib/modules/BookingContext/utils/resources.js +0 -377
  279. package/lib/modules/BookingContext/utils/serviceTimes.d.ts +0 -55
  280. package/lib/modules/BookingContext/utils/serviceTimes.js +0 -162
  281. package/lib/modules/BookingContext/utils/timeSlices.d.ts +0 -42
  282. package/lib/modules/BookingContext/utils/timeSlices.js +0 -124
  283. package/lib/modules/Order/utils/manualProductDiscount.d.ts +0 -106
  284. package/lib/modules/Order/utils/manualProductDiscount.js +0 -206
  285. package/lib/modules/SurchargeList/index.d.ts +0 -16
  286. package/lib/modules/SurchargeList/index.js +0 -89
  287. package/lib/modules/SurchargeList/types.d.ts +0 -11
  288. package/lib/modules/SurchargeList/types.js +0 -17
  289. package/lib/server/modules/payment/index.d.ts +0 -28
  290. package/lib/server/modules/payment/index.js +0 -192
  291. package/lib/server/modules/payment/types.d.ts +0 -9
  292. package/lib/server/modules/payment/types.js +0 -17
  293. package/lib/server/test.json +0 -713
  294. package/lib/server/utils/small-ticket.d.ts +0 -71
  295. package/lib/server/utils/small-ticket.js +0 -781
  296. package/lib/solution/BaseSales/utils/cartPromotion.d.ts +0 -287
  297. package/lib/solution/BaseSales/utils/cartPromotion.js +0 -992
  298. package/lib/solution/BaseSales/utils/quotationPrice.d.ts +0 -7
  299. package/lib/solution/BaseSales/utils/quotationPrice.js +0 -277
  300. package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +0 -117
  301. package/lib/solution/BookingTicket/utils/addProductDecision.js +0 -318
  302. package/lib/solution/BookingTicket/utils/addTimeAvailability.d.ts +0 -35
  303. package/lib/solution/BookingTicket/utils/addTimeAvailability.js +0 -125
  304. package/lib/solution/BookingTicket/utils/exampleData.d.ts +0 -123
  305. package/lib/solution/BookingTicket/utils/exampleData.js +0 -0
  306. package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +0 -185
  307. package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.js +0 -254
  308. package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +0 -36
  309. package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +0 -168
  310. package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +0 -32
  311. package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.js +0 -51
  312. package/lib/solution/BookingTicket/utils/scan/scanProductValues.d.ts +0 -21
  313. package/lib/solution/BookingTicket/utils/scan/scanProductValues.js +0 -127
  314. package/lib/solution/BookingTicket/utils/sessionCatalogStale.d.ts +0 -23
  315. package/lib/solution/BookingTicket/utils/sessionCatalogStale.js +0 -85
@@ -29,450 +29,67 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
29
29
  // src/modules/Order/utils.ts
30
30
  var utils_exports = {};
31
31
  __export(utils_exports, {
32
- buildManualProductDiscountItem: () => import_manualProductDiscount.buildManualProductDiscountItem,
33
32
  buildSubmitPayload: () => buildSubmitPayload,
34
- calculateOrderProductsDeposit: () => calculateOrderProductsDeposit,
35
- clearTempOrderHolderAssignments: () => clearTempOrderHolderAssignments,
36
33
  composeLinePrice: () => composeLinePrice,
37
34
  createDefaultOrderRulesHooks: () => createDefaultOrderRulesHooks,
38
35
  createDefaultTempOrder: () => createDefaultTempOrder,
39
36
  createEmptySummary: () => import_utils2.createEmptySummary,
40
37
  createUuidV4: () => createUuidV4,
41
- ensureManualProductDiscountList: () => import_manualProductDiscount.ensureManualProductDiscountList,
42
- ensureProductSku: () => ensureProductSku,
43
- findManualProductDiscountItem: () => import_manualProductDiscount.findManualProductDiscountItem,
44
38
  formatDateTime: () => formatDateTime,
45
39
  formatV1Product: () => formatV1Product,
46
40
  generateDuration: () => generateDuration,
47
41
  getAllDiscountList: () => getAllDiscountList,
48
- getBundleSellingMagnitude: () => getBundleSellingMagnitude,
49
- getBundleSignedUnit: () => getBundleSignedUnit,
50
- getOrderProductLineUid: () => getOrderProductLineUid,
51
- getProductSkuOptions: () => getProductSkuOptions,
52
- hasAssignedHolderId: () => hasAssignedHolderId,
53
- indexOrderProductsByUid: () => indexOrderProductsByUid,
54
- isEmptyOrderProductDisplayValue: () => isEmptyOrderProductDisplayValue,
55
- isMarkdownBundle: () => isMarkdownBundle,
56
42
  isTempOrder: () => isTempOrder,
57
43
  mapPaymentItemToOrderPayment: () => mapPaymentItemToOrderPayment,
58
44
  mapPaymentItemsToOrderPayments: () => mapPaymentItemsToOrderPayments,
59
- mergeManualProductDiscountIntoList: () => import_manualProductDiscount.mergeManualProductDiscountIntoList,
60
- mergeOrderProductDisplayFields: () => mergeOrderProductDisplayFields,
61
45
  mergeRelationForms: () => mergeRelationForms,
62
46
  normalizeBookingIsAll: () => normalizeBookingIsAll,
63
47
  normalizeBookingSubType: () => normalizeBookingSubType,
64
- normalizeOrderProductDiscountList: () => normalizeOrderProductDiscountList,
65
- normalizeProductSkuOptions: () => normalizeProductSkuOptions,
66
48
  normalizeSubmitBooking: () => normalizeSubmitBooking,
67
49
  normalizeSubmitCollectPaxValue: () => normalizeSubmitCollectPaxValue,
68
- resolveEffectivePerUnitDiscount: () => resolveEffectivePerUnitDiscount,
69
- resolveManualDiscountMessage: () => import_manualProductDiscount.resolveManualDiscountMessage,
70
- resolveManualDiscountOriginTotal: () => import_manualProductDiscount.resolveManualDiscountOriginTotal,
71
- resolveManualDiscountReasonFromSources: () => import_manualProductDiscount.resolveManualDiscountReasonFromSources,
72
- resolveManualOverrideLineOriginalPrice: () => resolveManualOverrideLineOriginalPrice,
73
- resolveRulesManualDiscountFlag: () => resolveRulesManualDiscountFlag,
74
- resolveSafeProductNum: () => import_manualProductDiscount.resolveSafeProductNum,
75
50
  resolveSubmitCollectPax: () => resolveSubmitCollectPax,
76
- shouldBuildManualProductDiscount: () => import_manualProductDiscount.shouldBuildManualProductDiscount,
77
- stripManualProductDiscountItems: () => import_manualProductDiscount.stripManualProductDiscountItems,
78
- sumOptionUnitPrice: () => sumOptionUnitPrice,
79
- syncManualProductDiscountProductNum: () => import_manualProductDiscount.syncManualProductDiscountProductNum
51
+ sumOptionUnitPrice: () => sumOptionUnitPrice
80
52
  });
81
53
  module.exports = __toCommonJS(utils_exports);
82
54
  var import_dayjs = __toESM(require("dayjs"));
83
55
  var import_decimal = __toESM(require("decimal.js"));
84
56
  var import_utils = require("../../solution/ScanOrder/utils");
85
57
  var import_utils2 = require("../../solution/ScanOrder/utils");
86
- var import_manualProductDiscount = require("./utils/manualProductDiscount");
87
58
  function composeLinePrice(params) {
88
59
  const { mainPrice, bundle, useOriginalBundle } = params;
89
60
  let total = new import_decimal.default(Number(mainPrice) || 0);
90
61
  if (Array.isArray(bundle)) {
91
62
  for (const item of bundle) {
92
- const signedUnit = getBundleSignedUnit(item, { useOriginal: useOriginalBundle });
63
+ const rawPrice = useOriginalBundle ? (item == null ? void 0 : item.original_price) ?? (item == null ? void 0 : item.product_price) ?? (item == null ? void 0 : item.price) : (item == null ? void 0 : item.bundle_selling_price) ?? (item == null ? void 0 : item.price);
64
+ const price = new import_decimal.default(Number(rawPrice) || 0);
93
65
  const rawNum = (item == null ? void 0 : item.num) ?? (item == null ? void 0 : item.quantity) ?? 1;
94
66
  const num = new import_decimal.default(Number(rawNum) || 0);
95
- total = total.plus(signedUnit.times(num));
67
+ total = total.plus(price.times(num));
96
68
  }
97
69
  }
98
70
  return total.toDecimalPlaces(2).toFixed(2);
99
71
  }
100
- function normalizeProductSkuOptions(options) {
101
- if (!Array.isArray(options))
102
- return [];
103
- return options.map((option) => {
104
- const normalized = {
105
- ...option && typeof option === "object" ? option : {}
106
- };
107
- const addPrice = normalized.add_price ?? normalized.price;
108
- if (addPrice !== void 0)
109
- normalized.add_price = addPrice;
110
- delete normalized.price;
111
- return normalized;
112
- });
113
- }
114
- function ensureProductSku(product) {
115
- const rawSku = (product == null ? void 0 : product.product_sku) && typeof product.product_sku === "object" ? product.product_sku : {};
116
- return {
117
- ...rawSku,
118
- option: normalizeProductSkuOptions(rawSku.option)
119
- };
120
- }
121
- function getProductSkuOptions(product) {
122
- return ensureProductSku(product).option;
123
- }
124
72
  function sumOptionUnitPrice(options) {
125
73
  let total = new import_decimal.default(0);
126
74
  if (!Array.isArray(options))
127
75
  return total;
128
76
  for (const opt of options) {
129
- const price = new import_decimal.default(Number((opt == null ? void 0 : opt.add_price) ?? (opt == null ? void 0 : opt.price)) || 0);
77
+ const price = new import_decimal.default(Number(opt == null ? void 0 : opt.price) || 0);
130
78
  const num = new import_decimal.default(Number(opt == null ? void 0 : opt.num) || 0);
131
79
  total = total.plus(price.times(num));
132
80
  }
133
81
  return total;
134
82
  }
135
- function getSafeOrderProductNum(num) {
136
- const parsedNum = Number(num ?? 1);
137
- if (!Number.isFinite(parsedNum) || parsedNum < 1)
138
- return 1;
139
- return Math.floor(parsedNum);
140
- }
141
- function getOrderProductDepositUnitTotal(product) {
142
- const metadata = product.metadata || {};
143
- const paymentPrice = metadata.main_product_attached_bundle_payment_price;
144
- const mainSellingPrice = metadata.main_product_selling_price;
145
- const fallbackPrice = product.selling_price;
146
- return new import_decimal.default(Number(paymentPrice ?? mainSellingPrice ?? fallbackPrice) || 0);
147
- }
148
- function normalizeDepositProtocols(protocols) {
149
- if (!Array.isArray(protocols))
150
- return [];
151
- return protocols.reduce((result, protocol) => {
152
- const id = Number(protocol == null ? void 0 : protocol.id);
153
- if (!Number.isFinite(id))
154
- return result;
155
- result.push({
156
- id: Math.floor(id),
157
- title: String((protocol == null ? void 0 : protocol.title) || "")
158
- });
159
- return result;
160
- }, []);
161
- }
162
- function getDepositPolicyIds(depositData) {
163
- const ids = [
164
- ...Array.isArray(depositData == null ? void 0 : depositData.self_deposit_policy_ids) ? depositData.self_deposit_policy_ids : [],
165
- ...Array.isArray(depositData == null ? void 0 : depositData.deposit_policy_ids) ? depositData.deposit_policy_ids : []
166
- ];
167
- return ids.reduce((result, id) => {
168
- const normalizedId = Number(id);
169
- if (!Number.isFinite(normalizedId))
170
- return result;
171
- result.push(Math.floor(normalizedId));
172
- return result;
173
- }, []);
174
- }
175
- function handleOrderProductDeposit(params) {
176
- const { depositData, total, num } = params;
177
- if (!depositData)
178
- return { result: false, depositTotal: new import_decimal.default(0) };
179
- const { deposit_fixed, deposit_percentage } = depositData;
180
- if (typeof deposit_fixed !== "string" || typeof deposit_percentage !== "string") {
181
- return { result: false, depositTotal: new import_decimal.default(0) };
182
- }
183
- const depositFixed = new import_decimal.default(deposit_fixed || 0);
184
- const depositPercent = new import_decimal.default(deposit_percentage || 0);
185
- const productTotalPrice = new import_decimal.default(total || 0);
186
- const deposit = depositFixed.plus(depositPercent.times(productTotalPrice));
187
- return { depositTotal: deposit.times(num), result: true };
188
- }
189
- function resolveOrderProductDepositSource(product, runtimeOrigin) {
190
- const record = product;
191
- const origin = record._origin || runtimeOrigin || {};
192
- const originProduct = origin.product || {};
193
- return {
194
- ...originProduct,
195
- ...origin,
196
- ...record,
197
- custom_deposit_data: record.custom_deposit_data ?? origin.custom_deposit_data ?? originProduct.custom_deposit_data,
198
- variant: record.variant ?? origin.variant ?? originProduct.variant
199
- };
200
- }
201
- function getOrderProductDeposit(product, runtimeOrigin) {
202
- const depositProduct = resolveOrderProductDepositSource(product, runtimeOrigin);
203
- const depositData = depositProduct.custom_deposit_data;
204
- if ((depositData == null ? void 0 : depositData.has_deposit) != 1)
205
- return null;
206
- const num = getSafeOrderProductNum(product.num);
207
- const total = getOrderProductDepositUnitTotal(product).times(num);
208
- const allProtocols = normalizeDepositProtocols(depositData.deposit_policy_data);
209
- const protocolIds = [];
210
- let depositTotal = new import_decimal.default(0);
211
- let hasDeposit = false;
212
- if (typeof depositData.deposit_fixed === "string" && typeof depositData.deposit_percentage === "string") {
213
- const result = handleOrderProductDeposit({
214
- depositData,
215
- total,
216
- num
217
- });
218
- if (result.result) {
219
- depositTotal = result.depositTotal;
220
- protocolIds.push(...getDepositPolicyIds({
221
- self_deposit_policy_ids: depositData.self_deposit_policy_ids
222
- }));
223
- hasDeposit = true;
224
- }
225
- } else {
226
- const productVariantId = depositProduct.product_variant_id ?? product.product_variant_id;
227
- if (productVariantId) {
228
- const variantProduct = (depositProduct.variant || []).find(
229
- (item) => (item == null ? void 0 : item.id) === productVariantId
230
- );
231
- const variantDepositData = variantProduct == null ? void 0 : variantProduct.custom_deposit_data;
232
- const result = handleOrderProductDeposit({
233
- depositData: variantDepositData,
234
- total,
235
- num
236
- });
237
- if (result.result) {
238
- depositTotal = result.depositTotal;
239
- protocolIds.push(...getDepositPolicyIds({
240
- self_deposit_policy_ids: variantDepositData == null ? void 0 : variantDepositData.self_deposit_policy_ids
241
- }));
242
- hasDeposit = true;
243
- }
244
- }
245
- if (Array.isArray(product.product_bundle) && product.product_bundle.length) {
246
- depositTotal = product.product_bundle.reduce((accumulator, bundleProduct) => {
247
- const bundleDepositData = bundleProduct == null ? void 0 : bundleProduct.custom_deposit_data;
248
- const result = handleOrderProductDeposit({
249
- depositData: bundleDepositData,
250
- total: bundleProduct == null ? void 0 : bundleProduct.price,
251
- num: getSafeOrderProductNum((bundleProduct == null ? void 0 : bundleProduct.num) || 1)
252
- });
253
- if (!result.result)
254
- return accumulator;
255
- protocolIds.push(...getDepositPolicyIds({
256
- self_deposit_policy_ids: bundleDepositData == null ? void 0 : bundleDepositData.self_deposit_policy_ids
257
- }));
258
- hasDeposit = true;
259
- return accumulator.plus(result.depositTotal);
260
- }, new import_decimal.default(0));
261
- }
262
- }
263
- if (!hasDeposit)
264
- return null;
265
- const protocolIdSet = new Set(protocolIds);
266
- const protocols = allProtocols.filter((protocol) => protocolIdSet.has(protocol.id));
267
- return {
268
- total: depositTotal.toNumber(),
269
- protocols
270
- };
271
- }
272
- function calculateOrderProductsDeposit(products = [], options) {
273
- var _a, _b, _c;
274
- const protocolMap = /* @__PURE__ */ new Map();
275
- let total = new import_decimal.default(0);
276
- let hasDeposit = false;
277
- for (const product of products || []) {
278
- const productUid = (_a = product.metadata) == null ? void 0 : _a.unique_identification_number;
279
- const runtimeOrigin = productUid ? (_c = (_b = options == null ? void 0 : options.productsByUid) == null ? void 0 : _b[productUid]) == null ? void 0 : _c.origin : void 0;
280
- const deposit = getOrderProductDeposit(product, runtimeOrigin);
281
- product.deposit = deposit;
282
- if (!(deposit == null ? void 0 : deposit.total) || Number(deposit.total) <= 0)
283
- continue;
284
- total = total.plus(deposit.total);
285
- for (const discount of product.discount_list || []) {
286
- total = total.minus((discount == null ? void 0 : discount.amount) || 0);
287
- }
288
- for (const protocol of deposit.protocols || []) {
289
- if (!protocolMap.has(protocol.id))
290
- protocolMap.set(protocol.id, protocol);
291
- }
292
- hasDeposit = true;
293
- }
294
- const roundedTotal = total.toDecimalPlaces(2, import_decimal.default.ROUND_HALF_UP);
295
- const protocols = [...protocolMap.values()];
296
- return {
297
- total: roundedTotal.toNumber(),
298
- totalText: roundedTotal.toFixed(2),
299
- protocols,
300
- deposit_policy_ids: protocols.map((protocol) => protocol.id),
301
- hasDeposit
302
- };
303
- }
304
- function isMarkdownBundle(bundle) {
305
- if (!bundle || typeof bundle !== "object")
306
- return false;
307
- const ext = bundle.price_type_ext ?? bundle.custom_price_type_ext;
308
- const type = bundle.price_type ?? bundle.custom_price_type;
309
- return type === "markdown" && ext !== "product_price";
310
- }
311
- function getBundleSignedUnit(bundle, options) {
312
- if (!bundle || typeof bundle !== "object")
313
- return new import_decimal.default(0);
314
- const useOriginal = (options == null ? void 0 : options.useOriginal) ?? false;
315
- if (isMarkdownBundle(bundle)) {
316
- const catalog = useOriginal ? bundle.original_price ?? bundle.product_price ?? bundle.custom_price ?? bundle.base_price ?? bundle.price : bundle.custom_price ?? bundle.product_price ?? bundle.original_price ?? bundle.base_price ?? bundle.price;
317
- if (catalog !== void 0 && catalog !== null && catalog !== "") {
318
- const raw = new import_decimal.default(Number(catalog) || 0);
319
- if (raw.lt(0))
320
- return raw;
321
- return raw.minus(sumOptionUnitPrice(bundle.option)).negated();
322
- }
323
- return new import_decimal.default(Number(bundle.bundle_selling_price) || 0).abs().negated();
324
- }
325
- const rawPrice = useOriginal ? bundle.original_price ?? bundle.product_price ?? bundle.price : bundle.bundle_selling_price ?? bundle.price;
326
- return new import_decimal.default(Number(rawPrice) || 0);
327
- }
328
- function getBundleSellingMagnitude(bundle) {
329
- return getBundleSignedUnit(bundle).abs();
330
- }
331
- function resolveRulesManualDiscountFlag(metadata) {
332
- if (!metadata)
333
- return void 0;
334
- if (metadata.is_manual_discount === true || metadata.is_manual_discount === 1) {
335
- return true;
336
- }
337
- const priceOverride = metadata.price_override;
338
- if (priceOverride !== void 0 && priceOverride !== null && priceOverride !== "") {
339
- return true;
340
- }
341
- return void 0;
342
- }
343
- function normalizeOrderProductDiscountAmount(amount) {
344
- if (amount === void 0 || amount === null)
345
- return void 0;
346
- return String(amount);
347
- }
348
- function normalizeOrderProductDiscountList(discountList) {
349
- if (!Array.isArray(discountList))
350
- return [];
351
- return discountList.filter((item) => !!item && typeof item === "object").map((item) => {
352
- const normalized = {
353
- discount_id: Number.isFinite(Number(item.discount_id)) ? Number(item.discount_id) : 0
354
- };
355
- if (item.order_discount_id === null) {
356
- normalized.order_discount_id = null;
357
- } else if (item.order_discount_id !== void 0) {
358
- const orderDiscountId = Number(item.order_discount_id);
359
- if (Number.isFinite(orderDiscountId)) {
360
- normalized.order_discount_id = orderDiscountId;
361
- }
362
- }
363
- if (item.type !== void 0)
364
- normalized.type = item.type;
365
- const amount = normalizeOrderProductDiscountAmount(item.amount);
366
- if (amount !== void 0)
367
- normalized.amount = amount;
368
- if (item.discount && typeof item.discount === "object") {
369
- normalized.discount = { ...item.discount };
370
- }
371
- if (item.metadata === null) {
372
- normalized.metadata = null;
373
- } else if (item.metadata && typeof item.metadata === "object") {
374
- normalized.metadata = { ...item.metadata };
375
- }
376
- return normalized;
377
- });
378
- }
379
- function resolveManualOverrideLineOriginalPrice(params, fallbackCompositeOriginal) {
380
- var _a, _b;
381
- const metadata = params.metadata || {};
382
- const priceOverride = metadata.price_override;
383
- if (priceOverride === void 0 || priceOverride === null || priceOverride === "") {
384
- return fallbackCompositeOriginal;
385
- }
386
- const refTotal = (_b = (_a = metadata.origin) == null ? void 0 : _a._extend) == null ? void 0 : _b.origin_total;
387
- if (refTotal !== void 0 && refTotal !== null && refTotal !== "") {
388
- const parsed = Number(refTotal);
389
- if (Number.isFinite(parsed)) {
390
- return new import_decimal.default(parsed).toDecimalPlaces(2).toFixed(2);
391
- }
392
- }
393
- const lineOriginal = params.lineOriginalPrice;
394
- if (lineOriginal !== void 0 && lineOriginal !== null && lineOriginal !== "") {
395
- const parsedLine = Number(lineOriginal);
396
- const parsedFallback = Number(fallbackCompositeOriginal);
397
- if (Number.isFinite(parsedLine) && Number.isFinite(parsedFallback) && parsedLine > parsedFallback) {
398
- return new import_decimal.default(parsedLine).toDecimalPlaces(2).toFixed(2);
399
- }
400
- }
401
- return fallbackCompositeOriginal;
402
- }
403
- function resolveEffectivePerUnitDiscount(product) {
404
- const discountList = Array.isArray(product == null ? void 0 : product.discount_list) ? product.discount_list : [];
405
- const fromList = discountList.reduce(
406
- (sum, discount) => sum + Number((discount == null ? void 0 : discount.amount) || 0),
407
- 0
408
- );
409
- const hasPromoDiscountItem = discountList.some((item) => (item == null ? void 0 : item.type) === "promotion");
410
- if (hasPromoDiscountItem)
411
- return fromList;
412
- const metadata = (product == null ? void 0 : product.metadata) || {};
413
- const promo = metadata._promotion;
414
- if ((promo == null ? void 0 : promo.inPromotion) !== true)
415
- return fromList;
416
- const optionSum = sumOptionUnitPrice(getProductSkuOptions(product)).toNumber();
417
- if (!discountList.length && metadata.source_product_price != null && metadata.main_product_selling_price != null) {
418
- const source = Number(metadata.source_product_price);
419
- const selling = Number(metadata.main_product_selling_price) - optionSum;
420
- if (Number.isFinite(source) && Number.isFinite(selling) && source !== selling) {
421
- return fromList + (source - selling);
422
- }
423
- }
424
- const originalPrice = Number(promo.originalPrice);
425
- const finalPrice = Number(promo.finalPrice);
426
- if (!Number.isFinite(originalPrice) || !Number.isFinite(finalPrice))
427
- return fromList;
428
- return fromList + (originalPrice - finalPrice);
429
- }
430
83
  function createDefaultOrderRulesHooks() {
431
84
  const toUnitPriceString = (totalLike, num) => {
432
85
  const effectiveNum = Number(num) > 0 ? Number(num) : 1;
433
86
  return new import_decimal.default(Number(totalLike) || 0).dividedBy(effectiveNum).toDecimalPlaces(2).toString();
434
87
  };
435
- const getBundleIdentity = (bundle) => {
436
- return [
437
- bundle.bundle_id ?? bundle.id ?? "",
438
- bundle.bundle_product_id ?? bundle._bundle_product_id ?? bundle.product_id ?? "",
439
- bundle.bundle_variant_id ?? bundle.variant_id ?? bundle.product_variant_id ?? 0,
440
- bundle.bundle_group_id ?? bundle.group_id ?? ""
441
- ].join("|");
442
- };
443
- const mergeRulesBundlePrices = (currentBundle, rulesBundle) => {
444
- if (!Array.isArray(rulesBundle))
445
- return rulesBundle;
446
- const currentByIdentity = /* @__PURE__ */ new Map();
447
- (currentBundle || []).forEach((bundle) => {
448
- if (!bundle || typeof bundle !== "object")
449
- return;
450
- currentByIdentity.set(getBundleIdentity(bundle), bundle);
451
- });
452
- return rulesBundle.map((bundle) => {
453
- if (!bundle || typeof bundle !== "object")
454
- return bundle;
455
- const current = currentByIdentity.get(getBundleIdentity(bundle));
456
- if (!current)
457
- return bundle;
458
- const isProductPriceBundle = (bundle.price_type_ext ?? current.price_type_ext) === "product_price";
459
- if (!isProductPriceBundle)
460
- return bundle;
461
- const sourcePrice = current.price ?? current.custom_price ?? current.original_price ?? current.bundle_selling_price;
462
- const originalPrice = current.original_price ?? current.product_price ?? current.price ?? current.custom_price ?? sourcePrice;
463
- return {
464
- ...bundle,
465
- ...sourcePrice !== void 0 ? { price: sourcePrice } : {},
466
- ...originalPrice !== void 0 ? { original_price: originalPrice } : {},
467
- ...current.original_total !== void 0 ? { original_total: current.original_total } : {}
468
- };
469
- });
470
- };
471
88
  return {
472
89
  getProduct: (product) => {
473
90
  var _a, _b, _c, _d, _e, _f;
474
91
  const metadataAny = product.metadata || {};
475
- const optionSum = sumOptionUnitPrice(getProductSkuOptions(product));
92
+ const optionSum = sumOptionUnitPrice(product.product_option_item);
476
93
  let sourcePrice;
477
94
  if (metadataAny.source_product_price !== void 0) {
478
95
  sourcePrice = String(metadataAny.source_product_price);
@@ -497,10 +114,10 @@ function createDefaultOrderRulesHooks() {
497
114
  id: product.product_id,
498
115
  // Rules 引擎用 _id 作为 processedProductsMap 键;必须与购物车行级 identity 一致,
499
116
  // 否则同 SKU 不同小料会在 calcDiscount 重组时互相覆盖。
500
- // 不透明 identity 契约下,normalizeOrderProduct / hydrate 已保证唯一值存在;
117
+ // 不透明 identity 契约下,normalizeOrderProduct / restoreTempOrderFromStorage 已保证唯一值存在;
501
118
  // 留 fingerprint 分支仅作 Rules 单测里直接传裸 product 时的兜底。
502
119
  _id: ((_a = product.metadata) == null ? void 0 : _a.unique_identification_number) ? `${product.product_id}_${product.product_variant_id}_${product.metadata.unique_identification_number}` : `${product.product_id}_${product.product_variant_id}_${(0, import_utils.buildProductLineFingerprint)(
503
- getProductSkuOptions(product),
120
+ product.product_option_item,
504
121
  product.product_bundle
505
122
  )}`,
506
123
  // Rules 内部 getProductTotalPrice / getProductOriginTotalPrice 会各自再叠加 bundle + option,
@@ -518,27 +135,22 @@ function createDefaultOrderRulesHooks() {
518
135
  bundle: product.product_bundle || [],
519
136
  booking_id: ((_b = product.metadata) == null ? void 0 : _b.booking_id) || null,
520
137
  isClient: false,
521
- // 勿写死 false:否则 Rules 不会走 total≠origin_total 的手动价推断,
522
- // 无券时会把 bundle 价还原成 original_price(手动改价套餐会从 20 回到 30)。
523
- isManualDiscount: resolveRulesManualDiscountFlag(metadataAny),
524
- holder_id: (_c = product.metadata) == null ? void 0 : _c.holder_id,
525
- startDate: ((_d = product.metadata) == null ? void 0 : _d.start_date) || ((_e = product.metadata) == null ? void 0 : _e.startDate),
526
- main_product_selling_price: metadataAny.main_product_selling_price !== void 0 ? new import_decimal.default(Number(metadataAny.main_product_selling_price) || 0).minus(optionSum).toDecimalPlaces(2).toString() : void 0,
527
- inPromotion: ((_f = metadataAny._promotion) == null ? void 0 : _f.inPromotion) === true,
528
- _promotion: metadataAny._promotion
138
+ isManualDiscount: ((_c = product.metadata) == null ? void 0 : _c.is_manual_discount) || false,
139
+ holder_id: (_d = product.metadata) == null ? void 0 : _d.holder_id,
140
+ startDate: ((_e = product.metadata) == null ? void 0 : _e.start_date) || ((_f = product.metadata) == null ? void 0 : _f.startDate)
529
141
  };
530
142
  },
531
143
  setProduct: (product, values) => {
532
144
  const nextNum = Number(values.quantity ?? product.num ?? 1) || 1;
533
145
  const metadataAny = product.metadata || {};
534
146
  const existedSource = metadataAny.source_product_price ?? product.selling_price ?? "0";
535
- const nextOptions = getProductSkuOptions(product);
147
+ const nextOptions = product.product_option_item;
536
148
  const optionSum = sumOptionUnitPrice(nextOptions);
537
149
  const nextSourceSellingPrice = values.main_product_selling_price !== void 0 ? String(values.main_product_selling_price) : values.price !== void 0 ? String(values.price) : values.total !== void 0 ? toUnitPriceString(values.total, nextNum) : String(existedSource);
538
150
  const nextSourceOriginalPrice = values.original_price !== void 0 ? String(values.original_price) : String(existedSource);
539
151
  const nextMainSellingPrice = new import_decimal.default(Number(nextSourceSellingPrice) || 0).plus(optionSum).toDecimalPlaces(2).toFixed(2);
540
152
  const nextMainOriginalPrice = new import_decimal.default(Number(nextSourceOriginalPrice) || 0).plus(optionSum).toDecimalPlaces(2).toFixed(2);
541
- const nextBundle = values.bundle !== void 0 ? mergeRulesBundlePrices(product.product_bundle, values.bundle) : product.product_bundle;
153
+ const nextBundle = values.bundle ?? product.product_bundle;
542
154
  const composedSellingPrice = composeLinePrice({
543
155
  mainPrice: nextMainSellingPrice,
544
156
  bundle: nextBundle
@@ -548,14 +160,10 @@ function createDefaultOrderRulesHooks() {
548
160
  bundle: nextBundle,
549
161
  useOriginalBundle: true
550
162
  });
551
- const finalOriginalPrice = resolveManualOverrideLineOriginalPrice(
552
- { num: nextNum, metadata: metadataAny, lineOriginalPrice: product.original_price },
553
- composedOriginalPrice
554
- );
555
163
  return {
556
164
  ...product,
557
165
  selling_price: composedSellingPrice,
558
- original_price: finalOriginalPrice,
166
+ original_price: composedOriginalPrice,
559
167
  discount_list: values.discount_list ?? product.discount_list,
560
168
  num: values.quantity ?? product.num,
561
169
  product_bundle: nextBundle,
@@ -641,7 +249,6 @@ function formatSubmitOptionItems(options) {
641
249
  return [];
642
250
  return options.map((d) => {
643
251
  const option = {
644
- ...d && typeof d === "object" ? d : {},
645
252
  num: d == null ? void 0 : d.num,
646
253
  option_group_item_id: d == null ? void 0 : d.option_group_item_id,
647
254
  option_group_id: d == null ? void 0 : d.option_group_id
@@ -649,7 +256,6 @@ function formatSubmitOptionItems(options) {
649
256
  const addPrice = (d == null ? void 0 : d.add_price) ?? (d == null ? void 0 : d.price);
650
257
  if (addPrice !== void 0)
651
258
  option.add_price = String(addPrice);
652
- delete option.price;
653
259
  return option;
654
260
  });
655
261
  }
@@ -671,8 +277,9 @@ function formatSubmitBundleItems(bundle) {
671
277
  return bundle.map((b) => {
672
278
  const rawBundle = b && typeof b === "object" ? b : {};
673
279
  const existedMetadata = rawBundle.metadata && typeof rawBundle.metadata === "object" ? rawBundle.metadata : {};
674
- const sellingPrice = getBundleSellingMagnitude(rawBundle).toFixed(2);
675
- const paymentPrice = rawBundle.bundle_payment_price !== void 0 && rawBundle.bundle_payment_price !== null && rawBundle.bundle_payment_price !== "" ? toMoneyString(rawBundle.bundle_payment_price) : sellingPrice;
280
+ const sellingPrice = toMoneyString(
281
+ rawBundle.bundle_selling_price ?? rawBundle.price
282
+ );
676
283
  const priceValue = rawBundle.price ?? rawBundle.custom_price ?? rawBundle.bundle_selling_price;
677
284
  const relationSurchargeIds = Array.isArray(rawBundle.relation_surcharge_ids) ? rawBundle.relation_surcharge_ids : Array.isArray(existedMetadata.relation_surcharge_ids) ? existedMetadata.relation_surcharge_ids : [];
678
285
  const surchargeFee = toMoneyString(
@@ -694,7 +301,6 @@ function formatSubmitBundleItems(bundle) {
694
301
  price_type: rawBundle.price_type ?? rawBundle.custom_price_type ?? "",
695
302
  price_type_ext: rawBundle.price_type_ext ?? rawBundle.custom_price_type_ext ?? "",
696
303
  bundle_selling_price: sellingPrice,
697
- bundle_payment_price: paymentPrice,
698
304
  option: formatSubmitOptionItems(rawBundle.option),
699
305
  bundle_group_id: (rawBundle == null ? void 0 : rawBundle.bundle_group_id) ?? (rawBundle == null ? void 0 : rawBundle.group_id),
700
306
  bundle_id: (rawBundle == null ? void 0 : rawBundle.bundle_id) ?? (rawBundle == null ? void 0 : rawBundle.id),
@@ -713,15 +319,10 @@ function normalizeSubmitProduct(product) {
713
319
  const { unique_identification_number: _runtimeUid, ...submitProduct } = product;
714
320
  const {
715
321
  num,
322
+ product_option_item: productOptionItem,
716
323
  surcharge_fee: _productSurchargeFee,
717
- discount_amount: _deprecatedDiscountAmount,
718
- discount_type: _deprecatedDiscountType,
719
- discountway: _deprecatedDiscountway,
720
- product_discount_reason: _deprecatedProductDiscountReason,
721
- discount_per: _deprecatedDiscountPer,
722
324
  ...productRest
723
325
  } = submitProduct;
724
- delete productRest[`product_${"option"}_item`];
725
326
  const rawMetadata = submitProduct.metadata || {};
726
327
  const bookingUid = rawMetadata.booking_uid;
727
328
  const cleanMetadata = {};
@@ -731,9 +332,6 @@ function normalizeSubmitProduct(product) {
731
332
  const priceMetaKeys = [
732
333
  "main_product_original_price",
733
334
  "main_product_selling_price",
734
- "main_product_attached_bundle_selling_price",
735
- "main_product_attached_bundle_payment_price",
736
- "average_discount_amount_rate",
737
335
  "source_product_price",
738
336
  "main_product_attached_bundle_surcharge_fee",
739
337
  "main_product_attached_bundle_tax_fee",
@@ -758,19 +356,21 @@ function normalizeSubmitProduct(product) {
758
356
  }
759
357
  const productSku = {
760
358
  ...submitProduct.product_sku && typeof submitProduct.product_sku === "object" ? submitProduct.product_sku : {},
761
- option: formatSubmitOptionItems((_a = submitProduct.product_sku) == null ? void 0 : _a.option)
359
+ option: formatSubmitOptionItems(
360
+ (productOptionItem == null ? void 0 : productOptionItem.length) ? productOptionItem : (_a = submitProduct.product_sku) == null ? void 0 : _a.option
361
+ )
762
362
  };
763
363
  return {
764
364
  ...productRest,
765
365
  ...bookingUid ? { booking_uid: bookingUid } : {},
766
366
  product_quantity: toBundleNumber(num ?? submitProduct.product_quantity, 1),
767
367
  product_sku: productSku,
768
- discount_list: normalizeOrderProductDiscountList(submitProduct.discount_list),
368
+ discount_list: submitProduct.discount_list || [],
769
369
  product_bundle: formatSubmitBundleItems(submitProduct.product_bundle),
770
370
  metadata: cleanMetadata,
771
- // 出站兼容:后端消费 payment_price 字段(行 composite 已减整单折扣均摊)。
772
- // 由整单折扣均摊层产出;缺省(无折扣)时与 selling_price 同义。
773
- payment_price: submitProduct.payment_price ?? submitProduct.selling_price
371
+ // 出站兼容:后端消费 payment_price 字段,这里从 selling_price 直接派生。
372
+ // 新语义下 selling_price 是 composite(含 option/bundle),payment_price 同语义。
373
+ payment_price: submitProduct.selling_price
774
374
  };
775
375
  }
776
376
  var SUBMIT_BOOKING_METADATA_WHITELIST = [
@@ -778,8 +378,7 @@ var SUBMIT_BOOKING_METADATA_WHITELIST = [
778
378
  "collect_pax",
779
379
  "capacity",
780
380
  "holder_id",
781
- "resource_select_type",
782
- "holder"
381
+ "resource_select_type"
783
382
  ];
784
383
  function normalizeBookingIsAll(booking) {
785
384
  return booking.is_all === true || booking.is_all === 1 || booking.is_all === "1" || booking.is_all === "true" ? 1 : 0;
@@ -826,23 +425,22 @@ function createDefaultTempOrder(params) {
826
425
  return {
827
426
  order_id: null,
828
427
  external_sale_number: "",
829
- order_number: null,
830
- shop_order_number: null,
831
- shop_full_order_number: null,
832
- type: "",
833
- business_code: void 0,
428
+ order_number: "",
429
+ shop_order_number: "",
430
+ shop_full_order_number: "",
431
+ type: "appointment_booking",
432
+ business_code: "appointment_booking",
834
433
  platform: "h5",
835
434
  sales_channel: "my_pisel",
836
435
  order_sales_channel: "online_store",
837
436
  status: "normal",
838
437
  payment_status: "payment_processing",
839
438
  shipping_status: "unfulfilled",
840
- customer_id: 0,
439
+ customer_id: null,
841
440
  customer_name: "",
842
441
  country_calling_code: "",
843
442
  phone: "",
844
443
  email: "",
845
- customer: null,
846
444
  is_price_include_tax: 1,
847
445
  tax_title: "",
848
446
  tax_country_code: "",
@@ -855,13 +453,14 @@ function createDefaultTempOrder(params) {
855
453
  surcharge_fee: "0.00",
856
454
  note: "",
857
455
  schedule_date: params.now,
858
- created_at: void 0,
456
+ created_at: params.now,
859
457
  request_unique_idempotency_token: "",
860
458
  vouchers: [],
861
459
  products: [],
862
460
  bookings: [],
863
461
  payments: [],
864
462
  surcharges: [],
463
+ discount_list: [],
865
464
  relation_forms: [],
866
465
  contacts: [],
867
466
  contacts_info: null,
@@ -873,7 +472,6 @@ function createDefaultTempOrder(params) {
873
472
  };
874
473
  }
875
474
  function buildSubmitPayload(params) {
876
- var _a;
877
475
  const {
878
476
  tempOrder,
879
477
  cacheId,
@@ -882,7 +480,6 @@ function buildSubmitPayload(params) {
882
480
  businessCode,
883
481
  channel,
884
482
  type,
885
- summary,
886
483
  enhance
887
484
  } = params;
888
485
  const scheduleDate = tempOrder.schedule_date || tempOrder.created_at || formatDateTime(now);
@@ -900,7 +497,7 @@ function buildSubmitPayload(params) {
900
497
  shop_service_type: _shopServiceType,
901
498
  start_time: _startTime,
902
499
  customer: _customer,
903
- discount_list: _discountList,
500
+ shop_full_order_number: _shopFullOrderNumber,
904
501
  tax_fee: _rootTaxFee,
905
502
  total_amount: _totalAmount,
906
503
  total_refund_amount: _totalRefundAmount,
@@ -908,25 +505,12 @@ function buildSubmitPayload(params) {
908
505
  holder_id: _holderId,
909
506
  ...tempOrderRest
910
507
  } = tempOrder;
911
- let submitType = type ?? tempOrder.type;
912
- if (!submitType) {
913
- if ((_a = tempOrder == null ? void 0 : tempOrder.bookings) == null ? void 0 : _a.length) {
914
- submitType = "appointment_booking";
915
- } else {
916
- submitType = "virtual";
917
- }
918
- }
919
508
  const payload = {
920
509
  ...tempOrderRest,
921
- customer_id: tempOrder.customer_id ?? 1,
922
- customer_name: tempOrder.customer_name || "Walk-In",
923
- order_number: tempOrder.order_number ?? null,
924
- shop_order_number: tempOrder.shop_order_number ?? null,
925
- shop_full_order_number: tempOrder.shop_full_order_number ?? null,
926
510
  platform: normalizeSubmitPlatform(platform),
927
- request_unique_idempotency_token: (params == null ? void 0 : params.request_unique_idempotency_token) || tempOrder.request_unique_idempotency_token || `${tempOrder.external_sale_number}_${now.getTime()}`,
928
- type: submitType,
929
- business_code: businessCode ?? tempOrder.business_code,
511
+ request_unique_idempotency_token: tempOrder.request_unique_idempotency_token || `${tempOrder.external_sale_number}_${now.getTime()}`,
512
+ type: type ?? tempOrder.type ?? "table-order",
513
+ business_code: businessCode ?? tempOrder.business_code ?? "table-order",
930
514
  sales_channel: tempOrder.sales_channel || "my_pisel",
931
515
  order_sales_channel: channel ?? tempOrder.order_sales_channel ?? "online_store",
932
516
  status: tempOrder.status || "normal",
@@ -941,16 +525,17 @@ function buildSubmitPayload(params) {
941
525
  note: tempOrder.note || "",
942
526
  delivery_type: tempOrder.delivery_type || "nil",
943
527
  schedule_date: scheduleDate,
944
- // created_at: tempOrder.created_at || formatDateTime(now), 和后端协定这个字段先不提交到接口
528
+ created_at: tempOrder.created_at || formatDateTime(now),
945
529
  bookings: (tempOrder.bookings || []).filter(
946
- (booking) => Number(booking.parent_id) !== 0
530
+ (booking) => Number(booking.parent_id ?? 0) !== 0
947
531
  ).map((booking) => normalizeSubmitBooking(booking)),
948
532
  payments: tempOrder.payments || [],
533
+ // discount_list: tempOrder.discount_list || [],
949
534
  relation_forms: tempOrder.relation_forms || [],
950
535
  // contacts: tempOrder.contacts || [],
951
536
  contacts_info: tempOrder.contacts_info && !Array.isArray(tempOrder.contacts_info) ? tempOrder.contacts_info : null,
952
537
  // holder: tempOrder.holder || null,
953
- summary: summary || tempOrder.summary || (0, import_utils.createEmptySummary)(),
538
+ // summary,
954
539
  metadata: (() => {
955
540
  const {
956
541
  collect_pax: _collectPax,
@@ -963,13 +548,7 @@ function buildSubmitPayload(params) {
963
548
  (product) => normalizeSubmitProduct(product)
964
549
  )
965
550
  };
966
- if (!enhance)
967
- return payload;
968
- const enhancedPayload = enhance(payload, { tempOrder, bookingUuid, now });
969
- return {
970
- ...enhancedPayload,
971
- summary: enhancedPayload.summary ?? payload.summary
972
- };
551
+ return enhance ? enhance(payload, { tempOrder, bookingUuid, now }) : payload;
973
552
  }
974
553
  function mapPaymentItemToOrderPayment(paymentItem) {
975
554
  const item = paymentItem;
@@ -989,11 +568,7 @@ function mapPaymentItemToOrderPayment(paymentItem) {
989
568
  metadata[key] = item[key];
990
569
  }
991
570
  }
992
- const timestamp = (0, import_dayjs.default)().format("YYYY-MM-DD HH:mm:ss");
993
- const paymentTime = item.payment_time ?? timestamp;
994
- const createdAt = item.created_at ?? timestamp;
995
571
  return {
996
- ...item.order_payment_id !== void 0 ? { order_payment_id: item.order_payment_id } : {},
997
572
  amount: String(item.amount ?? "0.00"),
998
573
  code: String(item.code || ""),
999
574
  custom_payment_id: Number(customPaymentId ?? 0),
@@ -1003,15 +578,14 @@ function mapPaymentItemToOrderPayment(paymentItem) {
1003
578
  ...item.origin_amount !== void 0 ? { origin_amount: String(item.origin_amount) } : {},
1004
579
  ...item.service_fee !== void 0 ? { service_fee: String(item.service_fee) } : {},
1005
580
  ...item.status !== void 0 ? { status: item.status } : {},
1006
- payment_time: paymentTime,
1007
- created_at: createdAt,
581
+ ...item.payment_time !== void 0 ? { payment_time: item.payment_time } : {},
1008
582
  ...item.wallet_pass_usage_unit !== void 0 ? { wallet_pass_usage_unit: item.wallet_pass_usage_unit } : {},
1009
583
  ...item.wallet_pass_use_value !== void 0 ? { wallet_pass_use_value: item.wallet_pass_use_value } : {},
1010
- ...item.fund_record && typeof item.fund_record === "object" && !Array.isArray(item.fund_record) ? { fund_record: { ...item.fund_record } } : {},
1011
584
  metadata,
1012
585
  ...item.rounding_amount !== void 0 ? { rounding_amount: String(item.rounding_amount) } : {},
1013
586
  ...item.service_charge !== void 0 ? { service_charge: item.service_charge } : {},
1014
587
  ...item.order_payment_type !== void 0 ? { order_payment_type: item.order_payment_type } : {},
588
+ ...item.created_at !== void 0 ? { created_at: item.created_at } : {},
1015
589
  ...item.updated_at !== void 0 ? { updated_at: item.updated_at } : {}
1016
590
  };
1017
591
  }
@@ -1037,168 +611,26 @@ function formatV1Product(products) {
1037
611
  };
1038
612
  });
1039
613
  }
1040
- function hasAssignedHolderId(value) {
1041
- if (value === void 0 || value === null || value === "")
1042
- return false;
1043
- if (Array.isArray(value))
1044
- return value.length > 0;
1045
- return true;
1046
- }
1047
- function clearTempOrderHolderAssignments(tempOrder) {
1048
- var _a;
1049
- let changed = false;
1050
- const resetHolderField = (target, key = "holder_id") => {
1051
- if (!hasAssignedHolderId(target[key]))
1052
- return;
1053
- target[key] = null;
1054
- changed = true;
1055
- };
1056
- for (const product of tempOrder.products || []) {
1057
- if (product.metadata && typeof product.metadata === "object") {
1058
- resetHolderField(product.metadata);
1059
- }
1060
- }
1061
- for (const booking of tempOrder.bookings || []) {
1062
- const bookingRecord = booking;
1063
- if (booking.metadata && typeof booking.metadata === "object") {
1064
- resetHolderField(booking.metadata);
1065
- }
1066
- if (bookingRecord.holder !== void 0 && bookingRecord.holder !== null) {
1067
- delete bookingRecord.holder;
1068
- changed = true;
1069
- }
1070
- }
1071
- const productsByUid = (_a = tempOrder._extend) == null ? void 0 : _a.productsByUid;
1072
- if (productsByUid && typeof productsByUid === "object") {
1073
- for (const entry of Object.values(productsByUid)) {
1074
- const origin = entry == null ? void 0 : entry.origin;
1075
- if (!origin || typeof origin !== "object")
1076
- continue;
1077
- if (origin.metadata && typeof origin.metadata === "object") {
1078
- resetHolderField(origin.metadata);
1079
- }
1080
- if (origin._extend && typeof origin._extend === "object") {
1081
- resetHolderField(origin._extend);
1082
- }
1083
- }
1084
- }
1085
- return changed;
1086
- }
1087
- function getOrderProductLineUid(product) {
1088
- var _a;
1089
- if (!product || typeof product !== "object")
1090
- return null;
1091
- const uid = ((_a = product.metadata) == null ? void 0 : _a.unique_identification_number) ?? product.unique_identification_number;
1092
- if (uid === void 0 || uid === null || uid === "")
1093
- return null;
1094
- return String(uid);
1095
- }
1096
- function isEmptyOrderProductDisplayValue(value) {
1097
- if (value === void 0 || value === null)
1098
- return true;
1099
- if (typeof value === "string")
1100
- return value.trim() === "";
1101
- if (typeof value === "object") {
1102
- const record = value;
1103
- return !Object.values(record).some(
1104
- (item) => typeof item === "string" && item.trim() !== ""
1105
- );
1106
- }
1107
- return false;
1108
- }
1109
- function mergeOrderProductDisplayFields(previous, next) {
1110
- const merged = { ...next };
1111
- const displayFields = [
1112
- "product_title",
1113
- "product_name",
1114
- "product_cover",
1115
- "cover",
1116
- "variant_title",
1117
- "product_sku",
1118
- "payment_price"
1119
- ];
1120
- displayFields.forEach((field) => {
1121
- if (isEmptyOrderProductDisplayValue(merged[field]) && !isEmptyOrderProductDisplayValue(previous[field])) {
1122
- merged[field] = previous[field];
1123
- }
1124
- });
1125
- if (previous.metadata || next.metadata) {
1126
- merged.metadata = {
1127
- ...previous.metadata || {},
1128
- ...next.metadata || {}
1129
- };
1130
- ["product_title", "product_name"].forEach((field) => {
1131
- var _a;
1132
- if (isEmptyOrderProductDisplayValue(merged.metadata[field]) && !isEmptyOrderProductDisplayValue((_a = previous.metadata) == null ? void 0 : _a[field])) {
1133
- merged.metadata[field] = previous.metadata[field];
1134
- }
1135
- });
1136
- }
1137
- if (previous._extend && !merged._extend) {
1138
- merged._extend = previous._extend;
1139
- }
1140
- return merged;
1141
- }
1142
- function indexOrderProductsByUid(products) {
1143
- const map = /* @__PURE__ */ new Map();
1144
- (products || []).forEach((product, index) => {
1145
- const uid = getOrderProductLineUid(product);
1146
- if (uid) {
1147
- map.set(uid, product);
1148
- return;
1149
- }
1150
- map.set(`__index__:${index}`, product);
1151
- });
1152
- return map;
1153
- }
1154
614
  // Annotate the CommonJS export names for ESM import in node:
1155
615
  0 && (module.exports = {
1156
- buildManualProductDiscountItem,
1157
616
  buildSubmitPayload,
1158
- calculateOrderProductsDeposit,
1159
- clearTempOrderHolderAssignments,
1160
617
  composeLinePrice,
1161
618
  createDefaultOrderRulesHooks,
1162
619
  createDefaultTempOrder,
1163
620
  createEmptySummary,
1164
621
  createUuidV4,
1165
- ensureManualProductDiscountList,
1166
- ensureProductSku,
1167
- findManualProductDiscountItem,
1168
622
  formatDateTime,
1169
623
  formatV1Product,
1170
624
  generateDuration,
1171
625
  getAllDiscountList,
1172
- getBundleSellingMagnitude,
1173
- getBundleSignedUnit,
1174
- getOrderProductLineUid,
1175
- getProductSkuOptions,
1176
- hasAssignedHolderId,
1177
- indexOrderProductsByUid,
1178
- isEmptyOrderProductDisplayValue,
1179
- isMarkdownBundle,
1180
626
  isTempOrder,
1181
627
  mapPaymentItemToOrderPayment,
1182
628
  mapPaymentItemsToOrderPayments,
1183
- mergeManualProductDiscountIntoList,
1184
- mergeOrderProductDisplayFields,
1185
629
  mergeRelationForms,
1186
630
  normalizeBookingIsAll,
1187
631
  normalizeBookingSubType,
1188
- normalizeOrderProductDiscountList,
1189
- normalizeProductSkuOptions,
1190
632
  normalizeSubmitBooking,
1191
633
  normalizeSubmitCollectPaxValue,
1192
- resolveEffectivePerUnitDiscount,
1193
- resolveManualDiscountMessage,
1194
- resolveManualDiscountOriginTotal,
1195
- resolveManualDiscountReasonFromSources,
1196
- resolveManualOverrideLineOriginalPrice,
1197
- resolveRulesManualDiscountFlag,
1198
- resolveSafeProductNum,
1199
634
  resolveSubmitCollectPax,
1200
- shouldBuildManualProductDiscount,
1201
- stripManualProductDiscountItems,
1202
- sumOptionUnitPrice,
1203
- syncManualProductDiscountProductNum
635
+ sumOptionUnitPrice
1204
636
  });