@pisell/pisellos 2.3.185 → 2.3.187

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 (297) hide show
  1. package/dist/modules/Order/utils.d.ts +3 -1
  2. package/dist/modules/Order/utils.js +17 -3
  3. package/dist/modules/Product/index.d.ts +1 -1
  4. package/dist/modules/Product/types.d.ts +5 -0
  5. package/dist/modules/Rules/index.js +30 -19
  6. package/dist/solution/BaseSales/index.d.ts +1 -0
  7. package/dist/solution/BaseSales/index.js +298 -209
  8. package/dist/solution/BaseSales/types.d.ts +3 -0
  9. package/dist/solution/BaseSales/utils/posDurationPricing.d.ts +21 -0
  10. package/dist/solution/BaseSales/utils/posDurationPricing.js +174 -0
  11. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +2 -0
  12. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +8 -8
  13. package/dist/solution/BookingByStep/index.d.ts +2 -2
  14. package/dist/solution/UnifiedBookingSales/index.js +34 -16
  15. package/lib/modules/Order/utils.d.ts +3 -1
  16. package/lib/modules/Order/utils.js +18 -2
  17. package/lib/modules/Product/index.d.ts +1 -1
  18. package/lib/modules/Product/types.d.ts +5 -0
  19. package/lib/modules/Rules/index.js +19 -9
  20. package/lib/solution/BaseSales/index.d.ts +1 -0
  21. package/lib/solution/BaseSales/index.js +95 -36
  22. package/lib/solution/BaseSales/types.d.ts +3 -0
  23. package/lib/solution/BaseSales/utils/posDurationPricing.d.ts +21 -0
  24. package/lib/solution/BaseSales/utils/posDurationPricing.js +133 -0
  25. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +2 -0
  26. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +1 -1
  27. package/lib/solution/BookingByStep/index.d.ts +2 -2
  28. package/lib/solution/UnifiedBookingSales/index.js +23 -1
  29. package/package.json +1 -1
  30. package/dist/apis/picoding.d.ts.map +0 -1
  31. package/dist/core/index.d.ts.map +0 -1
  32. package/dist/effects/index.d.ts.map +0 -1
  33. package/dist/index.d.ts.map +0 -1
  34. package/dist/inventory/index.d.ts.map +0 -1
  35. package/dist/model/index.d.ts.map +0 -1
  36. package/dist/model/strategy/adapter/dataVariant/adapter.d.ts.map +0 -1
  37. package/dist/model/strategy/adapter/dataVariant/evaluator.d.ts.map +0 -1
  38. package/dist/model/strategy/adapter/dataVariant/examples.d.ts.map +0 -1
  39. package/dist/model/strategy/adapter/dataVariant/index.d.ts.map +0 -1
  40. package/dist/model/strategy/adapter/dataVariant/type.d.ts.map +0 -1
  41. package/dist/model/strategy/adapter/index.d.ts.map +0 -1
  42. package/dist/model/strategy/adapter/itemRule/adapter.d.ts.map +0 -1
  43. package/dist/model/strategy/adapter/itemRule/evaluator.d.ts.map +0 -1
  44. package/dist/model/strategy/adapter/itemRule/examples.d.ts.map +0 -1
  45. package/dist/model/strategy/adapter/itemRule/index.d.ts.map +0 -1
  46. package/dist/model/strategy/adapter/itemRule/type.d.ts.map +0 -1
  47. package/dist/model/strategy/adapter/promotion/adapter.d.ts.map +0 -1
  48. package/dist/model/strategy/adapter/promotion/evaluator.d.ts.map +0 -1
  49. package/dist/model/strategy/adapter/promotion/examples.d.ts.map +0 -1
  50. package/dist/model/strategy/adapter/promotion/index.d.ts.map +0 -1
  51. package/dist/model/strategy/adapter/promotion/type.d.ts.map +0 -1
  52. package/dist/model/strategy/adapter/type.d.ts.map +0 -1
  53. package/dist/model/strategy/adapter/walletPass/evaluator.d.ts.map +0 -1
  54. package/dist/model/strategy/adapter/walletPass/example.d.ts.map +0 -1
  55. package/dist/model/strategy/adapter/walletPass/index.d.ts.map +0 -1
  56. package/dist/model/strategy/adapter/walletPass/locales.d.ts.map +0 -1
  57. package/dist/model/strategy/adapter/walletPass/type.d.ts.map +0 -1
  58. package/dist/model/strategy/adapter/walletPass/utils.d.ts.map +0 -1
  59. package/dist/model/strategy/engine.d.ts.map +0 -1
  60. package/dist/model/strategy/index.d.ts.map +0 -1
  61. package/dist/model/strategy/strategy-example.d.ts.map +0 -1
  62. package/dist/model/strategy/type.d.ts.map +0 -1
  63. package/dist/modules/Account/index.d.ts.map +0 -1
  64. package/dist/modules/Account/types.d.ts.map +0 -1
  65. package/dist/modules/AccountList/index.d.ts.map +0 -1
  66. package/dist/modules/AccountList/types.d.ts.map +0 -1
  67. package/dist/modules/AccountList/utils.d.ts.map +0 -1
  68. package/dist/modules/BaseModule.d.ts.map +0 -1
  69. package/dist/modules/BookingContext/index.d.ts.map +0 -1
  70. package/dist/modules/BookingContext/types.d.ts.map +0 -1
  71. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts.map +0 -1
  72. package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts.map +0 -1
  73. package/dist/modules/BookingContext/utils/cacheItemToBookingInput.d.ts.map +0 -1
  74. package/dist/modules/BookingContext/utils/flexible.d.ts.map +0 -1
  75. package/dist/modules/BookingContext/utils/formatResourceList.d.ts.map +0 -1
  76. package/dist/modules/BookingContext/utils/index.d.ts.map +0 -1
  77. package/dist/modules/BookingContext/utils/noResource.d.ts.map +0 -1
  78. package/dist/modules/BookingContext/utils/orderLineDisplay.d.ts.map +0 -1
  79. package/dist/modules/BookingContext/utils/productExtend.d.ts.map +0 -1
  80. package/dist/modules/BookingContext/utils/resourceErrors.d.ts.map +0 -1
  81. package/dist/modules/BookingContext/utils/resourceSelection.d.ts.map +0 -1
  82. package/dist/modules/BookingContext/utils/resources.d.ts.map +0 -1
  83. package/dist/modules/BookingContext/utils/serviceTimes.d.ts.map +0 -1
  84. package/dist/modules/BookingContext/utils/timeSlices.d.ts.map +0 -1
  85. package/dist/modules/BusinessAvailability/index.d.ts.map +0 -1
  86. package/dist/modules/Cart/index.d.ts.map +0 -1
  87. package/dist/modules/Cart/types.d.ts.map +0 -1
  88. package/dist/modules/Cart/utils/cartAccount.d.ts.map +0 -1
  89. package/dist/modules/Cart/utils/cartDate.d.ts.map +0 -1
  90. package/dist/modules/Cart/utils/cartDiscount.d.ts.map +0 -1
  91. package/dist/modules/Cart/utils/cartNote.d.ts.map +0 -1
  92. package/dist/modules/Cart/utils/cartProduct.d.ts.map +0 -1
  93. package/dist/modules/Cart/utils/cartRelationForms.d.ts.map +0 -1
  94. package/dist/modules/Cart/utils/cartResource.d.ts.map +0 -1
  95. package/dist/modules/Cart/utils/changePrice.d.ts.map +0 -1
  96. package/dist/modules/Cart/utils/index.d.ts.map +0 -1
  97. package/dist/modules/Customer/constants.d.ts.map +0 -1
  98. package/dist/modules/Customer/index.d.ts.map +0 -1
  99. package/dist/modules/Customer/types.d.ts.map +0 -1
  100. package/dist/modules/Date/index.d.ts.map +0 -1
  101. package/dist/modules/Date/types.d.ts.map +0 -1
  102. package/dist/modules/Date/utils.d.ts.map +0 -1
  103. package/dist/modules/Discount/availability.d.ts.map +0 -1
  104. package/dist/modules/Discount/entitlementPass.d.ts.map +0 -1
  105. package/dist/modules/Discount/index.d.ts.map +0 -1
  106. package/dist/modules/Discount/types.d.ts.map +0 -1
  107. package/dist/modules/FulfillmentTiming/index.d.ts.map +0 -1
  108. package/dist/modules/FulfillmentTiming/types.d.ts.map +0 -1
  109. package/dist/modules/Guests/index.d.ts.map +0 -1
  110. package/dist/modules/Guests/types.d.ts.map +0 -1
  111. package/dist/modules/Holder/index.d.ts.map +0 -1
  112. package/dist/modules/Holder/types.d.ts.map +0 -1
  113. package/dist/modules/Holder/utils.d.ts.map +0 -1
  114. package/dist/modules/OpenData/contactInfo.d.ts.map +0 -1
  115. package/dist/modules/OpenData/index.d.ts.map +0 -1
  116. package/dist/modules/OpenData/salesSettings.d.ts.map +0 -1
  117. package/dist/modules/OpenData/types.d.ts.map +0 -1
  118. package/dist/modules/OpenData/utils.d.ts.map +0 -1
  119. package/dist/modules/Order/holderRelations.d.ts.map +0 -1
  120. package/dist/modules/Order/index.d.ts.map +0 -1
  121. package/dist/modules/Order/localEftposState.d.ts.map +0 -1
  122. package/dist/modules/Order/payment-utils.d.ts.map +0 -1
  123. package/dist/modules/Order/pickupTiming.d.ts.map +0 -1
  124. package/dist/modules/Order/salesNotes.d.ts.map +0 -1
  125. package/dist/modules/Order/types.d.ts.map +0 -1
  126. package/dist/modules/Order/utils/bundleDiscountHydration.d.ts.map +0 -1
  127. package/dist/modules/Order/utils/discountProductLineIdentity.d.ts.map +0 -1
  128. package/dist/modules/Order/utils/manualProductDiscount.d.ts.map +0 -1
  129. package/dist/modules/Order/utils/orderCollectionIdentity.d.ts.map +0 -1
  130. package/dist/modules/Order/utils/productVoucherGroups.d.ts.map +0 -1
  131. package/dist/modules/Order/utils/virtualSettlement.d.ts.map +0 -1
  132. package/dist/modules/Order/utils/weighedProduct.d.ts.map +0 -1
  133. package/dist/modules/Order/utils.d.ts.map +0 -1
  134. package/dist/modules/Payment/cash.d.ts.map +0 -1
  135. package/dist/modules/Payment/cashRecommendationAlgorithm.d.ts.map +0 -1
  136. package/dist/modules/Payment/eftpos.d.ts.map +0 -1
  137. package/dist/modules/Payment/index.d.ts.map +0 -1
  138. package/dist/modules/Payment/mx51.d.ts.map +0 -1
  139. package/dist/modules/Payment/types.d.ts.map +0 -1
  140. package/dist/modules/Payment/utils.d.ts.map +0 -1
  141. package/dist/modules/Payment/walletpass.d.ts.map +0 -1
  142. package/dist/modules/Product/index.d.ts.map +0 -1
  143. package/dist/modules/Product/types.d.ts.map +0 -1
  144. package/dist/modules/Product/utils.d.ts.map +0 -1
  145. package/dist/modules/ProductList/clientDataVariants.d.ts.map +0 -1
  146. package/dist/modules/ProductList/index.d.ts.map +0 -1
  147. package/dist/modules/ProductList/types.d.ts.map +0 -1
  148. package/dist/modules/Quotation/index.d.ts.map +0 -1
  149. package/dist/modules/Quotation/types.d.ts.map +0 -1
  150. package/dist/modules/Resource/index.d.ts.map +0 -1
  151. package/dist/modules/Resource/types.d.ts.map +0 -1
  152. package/dist/modules/Resource/utils.d.ts.map +0 -1
  153. package/dist/modules/ResourcePlanner/index.d.ts.map +0 -1
  154. package/dist/modules/ResourcePlanner/localClock.d.ts.map +0 -1
  155. package/dist/modules/ResourcePlanner/planner.d.ts.map +0 -1
  156. package/dist/modules/ResourcePlanner/types.d.ts.map +0 -1
  157. package/dist/modules/Rules/index.d.ts.map +0 -1
  158. package/dist/modules/Rules/promotionSelection.d.ts.map +0 -1
  159. package/dist/modules/Rules/types.d.ts.map +0 -1
  160. package/dist/modules/SalesSummary/index.d.ts.map +0 -1
  161. package/dist/modules/SalesSummary/types.d.ts.map +0 -1
  162. package/dist/modules/SalesSummary/utils.d.ts.map +0 -1
  163. package/dist/modules/ScanOrderLogger/index.d.ts.map +0 -1
  164. package/dist/modules/ScanOrderLogger/providers/feishu.d.ts.map +0 -1
  165. package/dist/modules/ScanOrderLogger/providers/grafana.d.ts.map +0 -1
  166. package/dist/modules/ScanOrderLogger/types.d.ts.map +0 -1
  167. package/dist/modules/Schedule/getDateIsInSchedule.d.ts.map +0 -1
  168. package/dist/modules/Schedule/index.d.ts.map +0 -1
  169. package/dist/modules/Schedule/type.d.ts.map +0 -1
  170. package/dist/modules/Schedule/types.d.ts.map +0 -1
  171. package/dist/modules/Schedule/utils.d.ts.map +0 -1
  172. package/dist/modules/Step/index.d.ts.map +0 -1
  173. package/dist/modules/Step/tyeps.d.ts.map +0 -1
  174. package/dist/modules/Summary/index.d.ts.map +0 -1
  175. package/dist/modules/Summary/types.d.ts.map +0 -1
  176. package/dist/modules/Summary/utils.d.ts.map +0 -1
  177. package/dist/modules/SurchargeList/index.d.ts.map +0 -1
  178. package/dist/modules/SurchargeList/types.d.ts.map +0 -1
  179. package/dist/modules/index.d.ts.map +0 -1
  180. package/dist/plugins/app.d.ts.map +0 -1
  181. package/dist/plugins/index.d.ts.map +0 -1
  182. package/dist/plugins/request.d.ts.map +0 -1
  183. package/dist/plugins/shopStore.d.ts.map +0 -1
  184. package/dist/plugins/user.d.ts.map +0 -1
  185. package/dist/plugins/window.d.ts.map +0 -1
  186. package/dist/server/index.d.ts.map +0 -1
  187. package/dist/server/modules/floor-plan/index.d.ts.map +0 -1
  188. package/dist/server/modules/floor-plan/types.d.ts.map +0 -1
  189. package/dist/server/modules/form/index.d.ts.map +0 -1
  190. package/dist/server/modules/form/types.d.ts.map +0 -1
  191. package/dist/server/modules/index.d.ts.map +0 -1
  192. package/dist/server/modules/menu/index.d.ts.map +0 -1
  193. package/dist/server/modules/menu/types.d.ts.map +0 -1
  194. package/dist/server/modules/order/index.d.ts.map +0 -1
  195. package/dist/server/modules/order/types.d.ts.map +0 -1
  196. package/dist/server/modules/order/utils/filterBookings.d.ts.map +0 -1
  197. package/dist/server/modules/order/utils/filterOrders.d.ts.map +0 -1
  198. package/dist/server/modules/payment/index.d.ts.map +0 -1
  199. package/dist/server/modules/payment/types.d.ts.map +0 -1
  200. package/dist/server/modules/products/index.d.ts.map +0 -1
  201. package/dist/server/modules/products/replication.d.ts.map +0 -1
  202. package/dist/server/modules/products/types.d.ts.map +0 -1
  203. package/dist/server/modules/quotation/index.d.ts.map +0 -1
  204. package/dist/server/modules/quotation/types.d.ts.map +0 -1
  205. package/dist/server/modules/resource/index.d.ts.map +0 -1
  206. package/dist/server/modules/resource/types.d.ts.map +0 -1
  207. package/dist/server/modules/schedule/index.d.ts.map +0 -1
  208. package/dist/server/modules/schedule/types.d.ts.map +0 -1
  209. package/dist/server/modules/schedule/utils.d.ts.map +0 -1
  210. package/dist/server/types.d.ts.map +0 -1
  211. package/dist/server/utils/index.d.ts.map +0 -1
  212. package/dist/server/utils/product.d.ts.map +0 -1
  213. package/dist/server/utils/schedule.d.ts.map +0 -1
  214. package/dist/server/utils/small-ticket.d.ts.map +0 -1
  215. package/dist/server/utils/time.d.ts.map +0 -1
  216. package/dist/shared/payment/loadPaymentMethods.d.ts.map +0 -1
  217. package/dist/shared/receipt/customerInvoiceLanguages.d.ts.map +0 -1
  218. package/dist/shared/receipt/loadCustomerInvoiceLayout.d.ts.map +0 -1
  219. package/dist/shared/receipt/small-ticket.d.ts.map +0 -1
  220. package/dist/shared/receipt/templateVisibility.d.ts.map +0 -1
  221. package/dist/shared/sales/loadSalesOrderSnapshot.d.ts.map +0 -1
  222. package/dist/solution/BaseSales/fulfillmentItemRules.d.ts.map +0 -1
  223. package/dist/solution/BaseSales/index.d.ts.map +0 -1
  224. package/dist/solution/BaseSales/pickupTiming.d.ts.map +0 -1
  225. package/dist/solution/BaseSales/types.d.ts.map +0 -1
  226. package/dist/solution/BaseSales/utils/cartPromotion.d.ts.map +0 -1
  227. package/dist/solution/BaseSales/utils/parseSalesResponse.d.ts.map +0 -1
  228. package/dist/solution/BaseSales/utils/quotationPrice.d.ts.map +0 -1
  229. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts.map +0 -1
  230. package/dist/solution/BaseSales/utils.d.ts.map +0 -1
  231. package/dist/solution/BookingByStep/index.d.ts.map +0 -1
  232. package/dist/solution/BookingByStep/types.d.ts.map +0 -1
  233. package/dist/solution/BookingByStep/utils/capacity.d.ts.map +0 -1
  234. package/dist/solution/BookingByStep/utils/products.d.ts.map +0 -1
  235. package/dist/solution/BookingByStep/utils/resources.d.ts.map +0 -1
  236. package/dist/solution/BookingByStep/utils/stock.d.ts.map +0 -1
  237. package/dist/solution/BookingByStep/utils/timeslots.d.ts.map +0 -1
  238. package/dist/solution/BookingTicket/index.d.ts.map +0 -1
  239. package/dist/solution/BookingTicket/types.d.ts.map +0 -1
  240. package/dist/solution/BookingTicket/utils/addProductDecision.d.ts.map +0 -1
  241. package/dist/solution/BookingTicket/utils/addTimeAvailability.d.ts.map +0 -1
  242. package/dist/solution/BookingTicket/utils/bookingStatus.d.ts.map +0 -1
  243. package/dist/solution/BookingTicket/utils/cartView.d.ts.map +0 -1
  244. package/dist/solution/BookingTicket/utils/exampleData.d.ts.map +0 -1
  245. package/dist/solution/BookingTicket/utils/orderCustomer.d.ts.map +0 -1
  246. package/dist/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts.map +0 -1
  247. package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts.map +0 -1
  248. package/dist/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.d.ts.map +0 -1
  249. package/dist/solution/BookingTicket/utils/scan/cloudSearch.d.ts.map +0 -1
  250. package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts.map +0 -1
  251. package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts.map +0 -1
  252. package/dist/solution/BookingTicket/utils/scan/index.d.ts.map +0 -1
  253. package/dist/solution/BookingTicket/utils/scan/scanCache.d.ts.map +0 -1
  254. package/dist/solution/BookingTicket/utils/scan/scanProductValues.d.ts.map +0 -1
  255. package/dist/solution/BookingTicket/utils/sessionCatalogStale.d.ts.map +0 -1
  256. package/dist/solution/BookingTicket/utils/weighingProductSku.d.ts.map +0 -1
  257. package/dist/solution/BuyTickets/index.d.ts.map +0 -1
  258. package/dist/solution/BuyTickets/types.d.ts.map +0 -1
  259. package/dist/solution/Checkout/index.d.ts.map +0 -1
  260. package/dist/solution/Checkout/types.d.ts.map +0 -1
  261. package/dist/solution/Checkout/utils/index.d.ts.map +0 -1
  262. package/dist/solution/OrderInvoicePreview/index.d.ts.map +0 -1
  263. package/dist/solution/PlaceOrder/index.d.ts.map +0 -1
  264. package/dist/solution/RegisterAndLogin/config.d.ts.map +0 -1
  265. package/dist/solution/RegisterAndLogin/index.d.ts.map +0 -1
  266. package/dist/solution/RegisterAndLogin/types.d.ts.map +0 -1
  267. package/dist/solution/RegisterAndLogin/utils.d.ts.map +0 -1
  268. package/dist/solution/Sales/index.d.ts.map +0 -1
  269. package/dist/solution/Sales/types.d.ts.map +0 -1
  270. package/dist/solution/ScanOrder/index.d.ts.map +0 -1
  271. package/dist/solution/ScanOrder/menuAvailability.d.ts.map +0 -1
  272. package/dist/solution/ScanOrder/types.d.ts.map +0 -1
  273. package/dist/solution/ScanOrder/utils.d.ts.map +0 -1
  274. package/dist/solution/ShopDiscount/index.d.ts.map +0 -1
  275. package/dist/solution/ShopDiscount/types.d.ts.map +0 -1
  276. package/dist/solution/ShopDiscount/utils.d.ts.map +0 -1
  277. package/dist/solution/UnifiedBookingSales/businessAvailability.d.ts.map +0 -1
  278. package/dist/solution/UnifiedBookingSales/index.d.ts.map +0 -1
  279. package/dist/solution/UnifiedBookingSales/remoteOccupancyCache.d.ts.map +0 -1
  280. package/dist/solution/UnifiedBookingSales/salesSettings.d.ts.map +0 -1
  281. package/dist/solution/UnifiedBookingSales/types.d.ts.map +0 -1
  282. package/dist/solution/VenueBooking/index.d.ts.map +0 -1
  283. package/dist/solution/VenueBooking/types.d.ts.map +0 -1
  284. package/dist/solution/VenueBooking/utils/dateSummary.d.ts.map +0 -1
  285. package/dist/solution/VenueBooking/utils/resource.d.ts.map +0 -1
  286. package/dist/solution/VenueBooking/utils/slotMerge.d.ts.map +0 -1
  287. package/dist/solution/VenueBooking/utils/smartPricing.d.ts.map +0 -1
  288. package/dist/solution/VenueBooking/utils/timeSlot.d.ts.map +0 -1
  289. package/dist/solution/VenueBooking/utils.d.ts.map +0 -1
  290. package/dist/solution/index.d.ts.map +0 -1
  291. package/dist/store/createStore.d.ts.map +0 -1
  292. package/dist/types/index.d.ts.map +0 -1
  293. package/dist/utils/os-private-payload.d.ts.map +0 -1
  294. package/dist/utils/payment-number.d.ts.map +0 -1
  295. package/dist/utils/platform.d.ts.map +0 -1
  296. package/dist/utils/task.d.ts.map +0 -1
  297. package/dist/utils/watch.d.ts.map +0 -1
@@ -59,6 +59,7 @@ import { isCustomerUserPlatform, normalizeRuntimePlatform } from "../../utils/pl
59
59
  import { QuotationModule } from "../../modules/Quotation";
60
60
  import { transformBaseProductToOrderProduct as _transformBaseProductToOrderProduct } from "./utils/transformBaseProductToOrderProduct";
61
61
  import { calculateBaseSalesProductBookingPrice } from "./utils/quotationPrice";
62
+ import { buildPosDurationPricingPlan, combinePosDurationPrices, durationPricingUnavailable, forEachPriceQueryGroup, hasAppliedPosDurationPricing, resolveDurationPricingProduct, usesPosDurationPricing } from "./utils/posDurationPricing";
62
63
  var SERVER_ORDER_CHANGED_EVENT = 'order:onOrdersChanged';
63
64
  var PAYMENT_METHODS_CHANGED_EVENT = 'payment:onPaymentMethodsChanged';
64
65
  var OS_FULFILLMENT_REF_MODE_FIELD = '_os_fulfillment_ref_mode';
@@ -1620,8 +1621,11 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
1620
1621
  productsById = _context12.sent;
1621
1622
  shouldAlignSelectedVariantPrice = handledByOsServer && this.preferAuthoritativeProductQueryPrice();
1622
1623
  return _context12.abrupt("return", productIds.map(function (productId, index) {
1623
- var _authoritativeProduct;
1624
+ var _this8$otherParams, _authoritativeProduct;
1624
1625
  var authoritativeProduct = productId === null ? null : productsById.get(productId) || null;
1626
+ if (authoritativeProduct && normalizeRuntimePlatform((_this8$otherParams = _this8.otherParams) === null || _this8$otherParams === void 0 ? void 0 : _this8$otherParams.platform) === 'pos' && (params.strictDurationPricing || usesPosDurationPricing(authoritativeProduct) || hasAppliedPosDurationPricing(selectedProducts[index]))) {
1627
+ return resolveDurationPricingProduct(authoritativeProduct, selectedProducts[index]);
1628
+ }
1625
1629
  if (!shouldAlignSelectedVariantPrice || !authoritativeProduct) return authoritativeProduct;
1626
1630
  var selectedProduct = selectedProducts[index];
1627
1631
  var selectedVariantId = _this8.getSelectedProductVariantId(selectedProduct);
@@ -1794,6 +1798,8 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
1794
1798
  });
1795
1799
  });
1796
1800
  return _objectSpread(_objectSpread(_objectSpread({}, product), authoritativeProduct), {}, {
1801
+ // An omitted current configuration clears a previous catalog/order snapshot.
1802
+ pricing_method: authoritativeProduct.pricing_method,
1797
1803
  id: (_product$id = product.id) !== null && _product$id !== void 0 ? _product$id : authoritativeProduct.id,
1798
1804
  product_id: (_ref25 = (_product$product_id3 = product.product_id) !== null && _product$product_id3 !== void 0 ? _product$product_id3 : authoritativeProduct.product_id) !== null && _ref25 !== void 0 ? _ref25 : authoritativeProduct.id,
1799
1805
  product_variant_id: (_ref26 = (_product$product_vari2 = product.product_variant_id) !== null && _product$product_vari2 !== void 0 ? _product$product_vari2 : authoritativeProduct.product_variant_id) !== null && _ref26 !== void 0 ? _ref26 : 0,
@@ -7126,49 +7132,18 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
7126
7132
  key: "calculateProductBookingPrice",
7127
7133
  value: function () {
7128
7134
  var _calculateProductBookingPrice = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee71(params) {
7129
- var _params$customer_id;
7130
- var useCustomerUserPricing, quotation, customerId, channel, _yield$this$resolvePr, _yield$this$resolvePr2, authoritativeProduct, product;
7135
+ var _yield$this$calculate, _yield$this$calculate2, result;
7131
7136
  return _regeneratorRuntime().wrap(function _callee71$(_context71) {
7132
7137
  while (1) switch (_context71.prev = _context71.next) {
7133
7138
  case 0:
7134
- useCustomerUserPricing = this.isCustomerUserPriceQuery();
7135
- quotation = useCustomerUserPricing ? undefined : this.store.quotation;
7136
- customerId = (_params$customer_id = params.customer_id) !== null && _params$customer_id !== void 0 ? _params$customer_id : this.getCurrentOrderCustomerId();
7137
- _context71.next = 5;
7138
- return this.prepareProductPriceQueryContext(customerId);
7139
- case 5:
7140
- channel = this.getPriceQueryChannel(params.channel);
7141
- _context71.next = 8;
7142
- return this.resolveProductsForPriceQuery({
7143
- priceQueries: [params],
7144
- schedule: this.getPriceQuerySchedule(params),
7145
- customerId: customerId,
7146
- channel: channel
7147
- });
7148
- case 8:
7149
- _yield$this$resolvePr = _context71.sent;
7150
- _yield$this$resolvePr2 = _slicedToArray(_yield$this$resolvePr, 1);
7151
- authoritativeProduct = _yield$this$resolvePr2[0];
7152
- product = this.mergeProductForPriceQuery(params.product, authoritativeProduct);
7153
- if (useCustomerUserPricing) {
7154
- _context71.next = 15;
7155
- break;
7156
- }
7157
- _context71.next = 15;
7158
- return this.loadQuotationForPriceQuery({
7159
- quotation: quotation,
7160
- customer_id: customerId,
7161
- channel: channel
7162
- });
7163
- case 15:
7164
- return _context71.abrupt("return", calculateBaseSalesProductBookingPrice(_objectSpread(_objectSpread({}, params), {}, {
7165
- channel: channel,
7166
- product: product,
7167
- fallback_price: authoritativeProduct ? undefined : params.fallback_price,
7168
- customer_id: customerId,
7169
- quotation: authoritativeProduct && this.preferAuthoritativeProductQueryPrice() ? undefined : quotation
7170
- })));
7171
- case 16:
7139
+ _context71.next = 2;
7140
+ return this.calculateProductBookingPrices([params]);
7141
+ case 2:
7142
+ _yield$this$calculate = _context71.sent;
7143
+ _yield$this$calculate2 = _slicedToArray(_yield$this$calculate, 1);
7144
+ result = _yield$this$calculate2[0];
7145
+ return _context71.abrupt("return", result);
7146
+ case 6:
7172
7147
  case "end":
7173
7148
  return _context71.stop();
7174
7149
  }
@@ -7256,23 +7231,20 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
7256
7231
  return shouldRecalculate;
7257
7232
  }
7258
7233
  }, {
7259
- key: "calculateProductBookingPrices",
7234
+ key: "resolveProductBookingPriceGroups",
7260
7235
  value: function () {
7261
- var _calculateProductBookingPrices = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee73(paramsList) {
7262
- var _this23 = this;
7263
- var useCustomerUserPricing, quotation, currentOrderCustomerId, resolvedChannels, authoritativeProducts, groups, quotationContexts;
7236
+ var _resolveProductBookingPriceGroups = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee73(paramsList, currentOrderCustomerId) {
7237
+ var _this23 = this,
7238
+ _this$otherParams43;
7239
+ var strictDurationPricing,
7240
+ resolvedChannels,
7241
+ authoritativeProducts,
7242
+ groups,
7243
+ _args73 = arguments;
7264
7244
  return _regeneratorRuntime().wrap(function _callee73$(_context73) {
7265
7245
  while (1) switch (_context73.prev = _context73.next) {
7266
7246
  case 0:
7267
- if (paramsList.length) {
7268
- _context73.next = 2;
7269
- break;
7270
- }
7271
- return _context73.abrupt("return", []);
7272
- case 2:
7273
- useCustomerUserPricing = this.isCustomerUserPriceQuery();
7274
- quotation = useCustomerUserPricing ? undefined : this.store.quotation;
7275
- currentOrderCustomerId = this.getCurrentOrderCustomerId();
7247
+ strictDurationPricing = _args73.length > 2 && _args73[2] !== undefined ? _args73[2] : false;
7276
7248
  resolvedChannels = paramsList.map(function (params) {
7277
7249
  return _this23.getPriceQueryChannel(params.channel);
7278
7250
  });
@@ -7281,10 +7253,10 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
7281
7253
  });
7282
7254
  groups = new Map();
7283
7255
  paramsList.forEach(function (params, index) {
7284
- var _params$customer_id2;
7256
+ var _params$customer_id;
7285
7257
  var schedule = _this23.getPriceQuerySchedule(params);
7286
7258
  var channel = resolvedChannels[index];
7287
- var customerId = (_params$customer_id2 = params.customer_id) !== null && _params$customer_id2 !== void 0 ? _params$customer_id2 : currentOrderCustomerId;
7259
+ var customerId = (_params$customer_id = params.customer_id) !== null && _params$customer_id !== void 0 ? _params$customer_id : currentOrderCustomerId;
7288
7260
  var groupKey = [schedule.schedule_date, schedule.schedule_datetime, channel || '', _this23.normalizePriceContextCustomerId(customerId) || ''].join('|');
7289
7261
  var group = groups.get(groupKey) || {
7290
7262
  indices: [],
@@ -7295,8 +7267,8 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
7295
7267
  group.indices.push(index);
7296
7268
  groups.set(groupKey, group);
7297
7269
  });
7298
- _context73.next = 11;
7299
- return Promise.all(Array.from(groups.values()).map( /*#__PURE__*/function () {
7270
+ _context73.next = 7;
7271
+ return forEachPriceQueryGroup(Array.from(groups.values()), /*#__PURE__*/function () {
7300
7272
  var _ref57 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee72(group) {
7301
7273
  var priceQueries, resolvedProducts;
7302
7274
  return _regeneratorRuntime().wrap(function _callee72$(_context72) {
@@ -7313,7 +7285,8 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
7313
7285
  priceQueries: priceQueries,
7314
7286
  schedule: group.schedule,
7315
7287
  customerId: group.customerId,
7316
- channel: group.channel
7288
+ channel: group.channel,
7289
+ strictDurationPricing: strictDurationPricing
7317
7290
  });
7318
7291
  case 5:
7319
7292
  resolvedProducts = _context72.sent;
@@ -7326,55 +7299,171 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
7326
7299
  }
7327
7300
  }, _callee72);
7328
7301
  }));
7329
- return function (_x58) {
7302
+ return function (_x59) {
7330
7303
  return _ref57.apply(this, arguments);
7331
7304
  };
7332
- }()));
7333
- case 11:
7305
+ }(), normalizeRuntimePlatform((_this$otherParams43 = this.otherParams) === null || _this$otherParams43 === void 0 ? void 0 : _this$otherParams43.platform) === 'pos' ? 4 : groups.size);
7306
+ case 7:
7307
+ return _context73.abrupt("return", authoritativeProducts);
7308
+ case 8:
7309
+ case "end":
7310
+ return _context73.stop();
7311
+ }
7312
+ }, _callee73, this);
7313
+ }));
7314
+ function resolveProductBookingPriceGroups(_x57, _x58) {
7315
+ return _resolveProductBookingPriceGroups.apply(this, arguments);
7316
+ }
7317
+ return resolveProductBookingPriceGroups;
7318
+ }()
7319
+ }, {
7320
+ key: "calculateProductBookingPrices",
7321
+ value: function () {
7322
+ var _calculateProductBookingPrices = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee74(paramsList) {
7323
+ var _this$otherParams44,
7324
+ _this24 = this;
7325
+ var useCustomerUserPricing, isPos, quotation, currentOrderCustomerId, resolvedChannels, authoritativeProducts, plans, segmentQueries, segmentQueryIndices, segmentProducts, quotationContexts;
7326
+ return _regeneratorRuntime().wrap(function _callee74$(_context74) {
7327
+ while (1) switch (_context74.prev = _context74.next) {
7328
+ case 0:
7329
+ if (paramsList.length) {
7330
+ _context74.next = 2;
7331
+ break;
7332
+ }
7333
+ return _context74.abrupt("return", []);
7334
+ case 2:
7335
+ useCustomerUserPricing = this.isCustomerUserPriceQuery();
7336
+ isPos = normalizeRuntimePlatform((_this$otherParams44 = this.otherParams) === null || _this$otherParams44 === void 0 ? void 0 : _this$otherParams44.platform) === 'pos';
7337
+ quotation = useCustomerUserPricing ? undefined : this.store.quotation;
7338
+ currentOrderCustomerId = this.getCurrentOrderCustomerId();
7339
+ resolvedChannels = paramsList.map(function (params) {
7340
+ return _this24.getPriceQueryChannel(params.channel);
7341
+ });
7342
+ _context74.next = 9;
7343
+ return this.resolveProductBookingPriceGroups(paramsList, currentOrderCustomerId);
7344
+ case 9:
7345
+ authoritativeProducts = _context74.sent;
7346
+ plans = paramsList.map(function (params, index) {
7347
+ if (!isPos) return null;
7348
+ var product = authoritativeProducts[index];
7349
+ if (!product && (usesPosDurationPricing(params.product) || hasAppliedPosDurationPricing(params.product))) {
7350
+ throw durationPricingUnavailable('The authoritative product is unavailable for duration pricing.');
7351
+ }
7352
+ // Read configuration from the response itself: an omitted field must not inherit an old snapshot.
7353
+ return product && usesPosDurationPricing(product) ? buildPosDurationPricingPlan(params, product) : null;
7354
+ });
7355
+ segmentQueries = [];
7356
+ segmentQueryIndices = plans.map(function (plan, index) {
7357
+ return (plan === null || plan === void 0 ? void 0 : plan.segments.slice(1).map(function (segment) {
7358
+ var queryIndex = segmentQueries.length;
7359
+ segmentQueries.push(_objectSpread(_objectSpread({}, paramsList[index]), {}, {
7360
+ product: _objectSpread(_objectSpread({}, paramsList[index].product), {}, {
7361
+ product_bundle: undefined
7362
+ }),
7363
+ booking: _objectSpread(_objectSpread({}, paramsList[index].booking), {}, {
7364
+ start_date: segment.start.slice(0, 10),
7365
+ start_time: segment.start.slice(11),
7366
+ end_date: segment.end.slice(0, 10),
7367
+ end_time: segment.end.slice(11)
7368
+ }),
7369
+ duration: undefined,
7370
+ fallback_price: undefined
7371
+ }));
7372
+ return queryIndex;
7373
+ })) || [];
7374
+ });
7375
+ _context74.next = 15;
7376
+ return this.resolveProductBookingPriceGroups(segmentQueries, currentOrderCustomerId, true);
7377
+ case 15:
7378
+ segmentProducts = _context74.sent;
7379
+ if (!segmentProducts.some(function (product) {
7380
+ return !product;
7381
+ })) {
7382
+ _context74.next = 18;
7383
+ break;
7384
+ }
7385
+ throw durationPricingUnavailable('An authoritative product is missing for a billing unit.');
7386
+ case 18:
7334
7387
  if (useCustomerUserPricing) {
7335
- _context73.next = 16;
7388
+ _context74.next = 23;
7336
7389
  break;
7337
7390
  }
7338
7391
  quotationContexts = new Map();
7339
7392
  paramsList.forEach(function (params, index) {
7340
- var _params$customer_id3;
7393
+ var _params$customer_id2;
7394
+ if (plans[index]) return;
7341
7395
  var channel = resolvedChannels[index];
7342
7396
  var key = channel || '';
7343
7397
  if (quotationContexts.has(key)) return;
7344
7398
  quotationContexts.set(key, {
7345
7399
  channel: channel,
7346
- customer_id: (_params$customer_id3 = params.customer_id) !== null && _params$customer_id3 !== void 0 ? _params$customer_id3 : currentOrderCustomerId
7400
+ customer_id: (_params$customer_id2 = params.customer_id) !== null && _params$customer_id2 !== void 0 ? _params$customer_id2 : currentOrderCustomerId
7347
7401
  });
7348
7402
  });
7349
- _context73.next = 16;
7403
+ _context74.next = 23;
7350
7404
  return Promise.all(Array.from(quotationContexts.values()).map(function (context) {
7351
- return _this23.loadQuotationForPriceQuery(_objectSpread({
7405
+ return _this24.loadQuotationForPriceQuery(_objectSpread({
7352
7406
  quotation: quotation
7353
7407
  }, context));
7354
7408
  }));
7355
- case 16:
7356
- return _context73.abrupt("return", paramsList.map(function (params, index) {
7357
- var _params$customer_id4;
7409
+ case 23:
7410
+ return _context74.abrupt("return", paramsList.map(function (params, index) {
7411
+ var _params$customer_id3, _authoritativeProduct2, _params$duration;
7358
7412
  var productInput = params.product || {};
7359
7413
  var authoritativeProduct = authoritativeProducts[index];
7360
- var product = _this23.mergeProductForPriceQuery(productInput, authoritativeProduct);
7361
- var customerId = (_params$customer_id4 = params.customer_id) !== null && _params$customer_id4 !== void 0 ? _params$customer_id4 : currentOrderCustomerId;
7414
+ var product = _this24.mergeProductForPriceQuery(productInput, authoritativeProduct);
7415
+ var customerId = (_params$customer_id3 = params.customer_id) !== null && _params$customer_id3 !== void 0 ? _params$customer_id3 : currentOrderCustomerId;
7362
7416
  var channel = resolvedChannels[index];
7363
- return calculateBaseSalesProductBookingPrice(_objectSpread(_objectSpread({}, params), {}, {
7417
+ var plan = plans[index];
7418
+ if (plan) {
7419
+ var unitProducts = [authoritativeProduct].concat(_toConsumableArray(segmentQueryIndices[index].map(function (queryIndex) {
7420
+ return segmentProducts[queryIndex];
7421
+ })));
7422
+ var prices = unitProducts.map(function (unitProduct, unitIndex) {
7423
+ return calculateBaseSalesProductBookingPrice(_objectSpread(_objectSpread({}, params), {}, {
7424
+ channel: channel,
7425
+ product: _this24.mergeProductForPriceQuery(unitIndex === 0 ? productInput : _objectSpread(_objectSpread({}, productInput), {}, {
7426
+ product_bundle: undefined
7427
+ }), unitProduct),
7428
+ booking: _objectSpread(_objectSpread({}, params.booking), {}, {
7429
+ start_date: plan.segments[unitIndex].start.slice(0, 10),
7430
+ start_time: plan.segments[unitIndex].start.slice(11)
7431
+ }),
7432
+ duration: undefined,
7433
+ fallback_price: undefined,
7434
+ customer_id: customerId,
7435
+ quotation: undefined
7436
+ }));
7437
+ });
7438
+ return combinePosDurationPrices(plan, prices);
7439
+ }
7440
+ var changedToFixed = isPos && (usesPosDurationPricing(productInput) || hasAppliedPosDurationPricing(productInput)) && authoritativeProduct && !usesPosDurationPricing(authoritativeProduct);
7441
+ // A switch to Days can explicitly request the existing per-day quotation path.
7442
+ // Discard the old minute basis, but do not erase that independent legacy input.
7443
+ var keepLegacyDayDuration = changedToFixed && ['day', 'days'].includes(String((authoritativeProduct === null || authoritativeProduct === void 0 || (_authoritativeProduct2 = authoritativeProduct.duration) === null || _authoritativeProduct2 === void 0 ? void 0 : _authoritativeProduct2.type) || '').trim().toLowerCase()) && ['day', 'days'].includes(String(((_params$duration = params.duration) === null || _params$duration === void 0 ? void 0 : _params$duration.type) || '').trim().toLowerCase());
7444
+ var result = calculateBaseSalesProductBookingPrice(_objectSpread(_objectSpread(_objectSpread({}, params), changedToFixed && !keepLegacyDayDuration ? {
7445
+ duration: undefined
7446
+ } : {}), {}, {
7364
7447
  channel: channel,
7365
7448
  product: product,
7366
7449
  fallback_price: authoritativeProduct ? undefined : params.fallback_price,
7367
7450
  customer_id: customerId,
7368
- quotation: authoritativeProduct && _this23.preferAuthoritativeProductQueryPrice() ? undefined : quotation
7451
+ quotation: authoritativeProduct && _this24.preferAuthoritativeProductQueryPrice() ? undefined : quotation
7369
7452
  }));
7453
+ return changedToFixed ? _objectSpread(_objectSpread({}, result), {}, {
7454
+ pricing_method: {
7455
+ type: 'fixed_price'
7456
+ },
7457
+ duration: undefined
7458
+ }) : result;
7370
7459
  }));
7371
- case 17:
7460
+ case 24:
7372
7461
  case "end":
7373
- return _context73.stop();
7462
+ return _context74.stop();
7374
7463
  }
7375
- }, _callee73, this);
7464
+ }, _callee74, this);
7376
7465
  }));
7377
- function calculateProductBookingPrices(_x57) {
7466
+ function calculateProductBookingPrices(_x60) {
7378
7467
  return _calculateProductBookingPrices.apply(this, arguments);
7379
7468
  }
7380
7469
  return calculateProductBookingPrices;
@@ -7394,47 +7483,47 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
7394
7483
  }, {
7395
7484
  key: "addProductToOrder",
7396
7485
  value: function () {
7397
- var _addProductToOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee74(product, booking, options) {
7486
+ var _addProductToOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee75(product, booking, options) {
7398
7487
  var products;
7399
- return _regeneratorRuntime().wrap(function _callee74$(_context74) {
7400
- while (1) switch (_context74.prev = _context74.next) {
7488
+ return _regeneratorRuntime().wrap(function _callee75$(_context75) {
7489
+ while (1) switch (_context75.prev = _context75.next) {
7401
7490
  case 0:
7402
- _context74.prev = 0;
7491
+ _context75.prev = 0;
7403
7492
  if (this.store.order) {
7404
- _context74.next = 3;
7493
+ _context75.next = 3;
7405
7494
  break;
7406
7495
  }
7407
7496
  throw new Error('order 模块未初始化');
7408
7497
  case 3:
7409
7498
  if (!(options === undefined)) {
7410
- _context74.next = 9;
7499
+ _context75.next = 9;
7411
7500
  break;
7412
7501
  }
7413
- _context74.next = 6;
7502
+ _context75.next = 6;
7414
7503
  return this.store.order.addProductToOrder(product, booking);
7415
7504
  case 6:
7416
- _context74.t0 = _context74.sent;
7417
- _context74.next = 12;
7505
+ _context75.t0 = _context75.sent;
7506
+ _context75.next = 12;
7418
7507
  break;
7419
7508
  case 9:
7420
- _context74.next = 11;
7509
+ _context75.next = 11;
7421
7510
  return this.store.order.addProductToOrder(product, booking, options);
7422
7511
  case 11:
7423
- _context74.t0 = _context74.sent;
7512
+ _context75.t0 = _context75.sent;
7424
7513
  case 12:
7425
- products = _context74.t0;
7426
- return _context74.abrupt("return", products);
7514
+ products = _context75.t0;
7515
+ return _context75.abrupt("return", products);
7427
7516
  case 16:
7428
- _context74.prev = 16;
7429
- _context74.t1 = _context74["catch"](0);
7430
- throw _context74.t1;
7517
+ _context75.prev = 16;
7518
+ _context75.t1 = _context75["catch"](0);
7519
+ throw _context75.t1;
7431
7520
  case 19:
7432
7521
  case "end":
7433
- return _context74.stop();
7522
+ return _context75.stop();
7434
7523
  }
7435
- }, _callee74, this, [[0, 16]]);
7524
+ }, _callee75, this, [[0, 16]]);
7436
7525
  }));
7437
- function addProductToOrder(_x59, _x60, _x61) {
7526
+ function addProductToOrder(_x61, _x62, _x63) {
7438
7527
  return _addProductToOrder.apply(this, arguments);
7439
7528
  }
7440
7529
  return addProductToOrder;
@@ -7442,34 +7531,34 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
7442
7531
  }, {
7443
7532
  key: "updateOrderProduct",
7444
7533
  value: function () {
7445
- var _updateOrderProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee75(params) {
7534
+ var _updateOrderProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee76(params) {
7446
7535
  var products;
7447
- return _regeneratorRuntime().wrap(function _callee75$(_context75) {
7448
- while (1) switch (_context75.prev = _context75.next) {
7536
+ return _regeneratorRuntime().wrap(function _callee76$(_context76) {
7537
+ while (1) switch (_context76.prev = _context76.next) {
7449
7538
  case 0:
7450
- _context75.prev = 0;
7539
+ _context76.prev = 0;
7451
7540
  if (this.store.order) {
7452
- _context75.next = 3;
7541
+ _context76.next = 3;
7453
7542
  break;
7454
7543
  }
7455
7544
  throw new Error('order 模块未初始化');
7456
7545
  case 3:
7457
- _context75.next = 5;
7546
+ _context76.next = 5;
7458
7547
  return this.store.order.updateOrderProduct(params);
7459
7548
  case 5:
7460
- products = _context75.sent;
7461
- return _context75.abrupt("return", products);
7549
+ products = _context76.sent;
7550
+ return _context76.abrupt("return", products);
7462
7551
  case 9:
7463
- _context75.prev = 9;
7464
- _context75.t0 = _context75["catch"](0);
7465
- throw _context75.t0;
7552
+ _context76.prev = 9;
7553
+ _context76.t0 = _context76["catch"](0);
7554
+ throw _context76.t0;
7466
7555
  case 12:
7467
7556
  case "end":
7468
- return _context75.stop();
7557
+ return _context76.stop();
7469
7558
  }
7470
- }, _callee75, this, [[0, 9]]);
7559
+ }, _callee76, this, [[0, 9]]);
7471
7560
  }));
7472
- function updateOrderProduct(_x62) {
7561
+ function updateOrderProduct(_x64) {
7473
7562
  return _updateOrderProduct.apply(this, arguments);
7474
7563
  }
7475
7564
  return updateOrderProduct;
@@ -7477,34 +7566,34 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
7477
7566
  }, {
7478
7567
  key: "updateOrderProducts",
7479
7568
  value: function () {
7480
- var _updateOrderProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee76(paramsList) {
7569
+ var _updateOrderProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee77(paramsList) {
7481
7570
  var products;
7482
- return _regeneratorRuntime().wrap(function _callee76$(_context76) {
7483
- while (1) switch (_context76.prev = _context76.next) {
7571
+ return _regeneratorRuntime().wrap(function _callee77$(_context77) {
7572
+ while (1) switch (_context77.prev = _context77.next) {
7484
7573
  case 0:
7485
- _context76.prev = 0;
7574
+ _context77.prev = 0;
7486
7575
  if (this.store.order) {
7487
- _context76.next = 3;
7576
+ _context77.next = 3;
7488
7577
  break;
7489
7578
  }
7490
7579
  throw new Error('order 模块未初始化');
7491
7580
  case 3:
7492
- _context76.next = 5;
7581
+ _context77.next = 5;
7493
7582
  return this.store.order.updateOrderProducts(paramsList);
7494
7583
  case 5:
7495
- products = _context76.sent;
7496
- return _context76.abrupt("return", products);
7584
+ products = _context77.sent;
7585
+ return _context77.abrupt("return", products);
7497
7586
  case 9:
7498
- _context76.prev = 9;
7499
- _context76.t0 = _context76["catch"](0);
7500
- throw _context76.t0;
7587
+ _context77.prev = 9;
7588
+ _context77.t0 = _context77["catch"](0);
7589
+ throw _context77.t0;
7501
7590
  case 12:
7502
7591
  case "end":
7503
- return _context76.stop();
7592
+ return _context77.stop();
7504
7593
  }
7505
- }, _callee76, this, [[0, 9]]);
7594
+ }, _callee77, this, [[0, 9]]);
7506
7595
  }));
7507
- function updateOrderProducts(_x63) {
7596
+ function updateOrderProducts(_x65) {
7508
7597
  return _updateOrderProducts.apply(this, arguments);
7509
7598
  }
7510
7599
  return updateOrderProducts;
@@ -7512,34 +7601,34 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
7512
7601
  }, {
7513
7602
  key: "updateOrderProductQuantity",
7514
7603
  value: function () {
7515
- var _updateOrderProductQuantity = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee77(params) {
7604
+ var _updateOrderProductQuantity = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee78(params) {
7516
7605
  var products;
7517
- return _regeneratorRuntime().wrap(function _callee77$(_context77) {
7518
- while (1) switch (_context77.prev = _context77.next) {
7606
+ return _regeneratorRuntime().wrap(function _callee78$(_context78) {
7607
+ while (1) switch (_context78.prev = _context78.next) {
7519
7608
  case 0:
7520
- _context77.prev = 0;
7609
+ _context78.prev = 0;
7521
7610
  if (this.store.order) {
7522
- _context77.next = 3;
7611
+ _context78.next = 3;
7523
7612
  break;
7524
7613
  }
7525
7614
  throw new Error('order 模块未初始化');
7526
7615
  case 3:
7527
- _context77.next = 5;
7616
+ _context78.next = 5;
7528
7617
  return this.store.order.updateOrderProductQuantity(params);
7529
7618
  case 5:
7530
- products = _context77.sent;
7531
- return _context77.abrupt("return", products);
7619
+ products = _context78.sent;
7620
+ return _context78.abrupt("return", products);
7532
7621
  case 9:
7533
- _context77.prev = 9;
7534
- _context77.t0 = _context77["catch"](0);
7535
- throw _context77.t0;
7622
+ _context78.prev = 9;
7623
+ _context78.t0 = _context78["catch"](0);
7624
+ throw _context78.t0;
7536
7625
  case 12:
7537
7626
  case "end":
7538
- return _context77.stop();
7627
+ return _context78.stop();
7539
7628
  }
7540
- }, _callee77, this, [[0, 9]]);
7629
+ }, _callee78, this, [[0, 9]]);
7541
7630
  }));
7542
- function updateOrderProductQuantity(_x64) {
7631
+ function updateOrderProductQuantity(_x66) {
7543
7632
  return _updateOrderProductQuantity.apply(this, arguments);
7544
7633
  }
7545
7634
  return updateOrderProductQuantity;
@@ -7562,12 +7651,12 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
7562
7651
  }, {
7563
7652
  key: "setOrderProductLineNote",
7564
7653
  value: (function () {
7565
- var _setOrderProductLineNote = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee78(identity, note) {
7654
+ var _setOrderProductLineNote = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee79(identity, note) {
7566
7655
  var params, products;
7567
- return _regeneratorRuntime().wrap(function _callee78$(_context78) {
7568
- while (1) switch (_context78.prev = _context78.next) {
7656
+ return _regeneratorRuntime().wrap(function _callee79$(_context79) {
7657
+ while (1) switch (_context79.prev = _context79.next) {
7569
7658
  case 0:
7570
- _context78.prev = 0;
7659
+ _context79.prev = 0;
7571
7660
  params = {
7572
7661
  product_id: identity.product_id,
7573
7662
  product_variant_id: identity.product_variant_id,
@@ -7582,22 +7671,22 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
7582
7671
  params.product_sku = identity.product_sku;
7583
7672
  }
7584
7673
  if (identity.product_bundle !== undefined) params.product_bundle = identity.product_bundle;
7585
- _context78.next = 7;
7674
+ _context79.next = 7;
7586
7675
  return this.updateOrderProduct(params);
7587
7676
  case 7:
7588
- products = _context78.sent;
7589
- return _context78.abrupt("return", products);
7677
+ products = _context79.sent;
7678
+ return _context79.abrupt("return", products);
7590
7679
  case 11:
7591
- _context78.prev = 11;
7592
- _context78.t0 = _context78["catch"](0);
7593
- throw _context78.t0;
7680
+ _context79.prev = 11;
7681
+ _context79.t0 = _context79["catch"](0);
7682
+ throw _context79.t0;
7594
7683
  case 14:
7595
7684
  case "end":
7596
- return _context78.stop();
7685
+ return _context79.stop();
7597
7686
  }
7598
- }, _callee78, this, [[0, 11]]);
7687
+ }, _callee79, this, [[0, 11]]);
7599
7688
  }));
7600
- function setOrderProductLineNote(_x65, _x66) {
7689
+ function setOrderProductLineNote(_x67, _x68) {
7601
7690
  return _setOrderProductLineNote.apply(this, arguments);
7602
7691
  }
7603
7692
  return setOrderProductLineNote;
@@ -7612,45 +7701,45 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
7612
7701
  }, {
7613
7702
  key: "removeProductsFromOrder",
7614
7703
  value: (function () {
7615
- var _removeProductsFromOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee79(identities, options) {
7616
- return _regeneratorRuntime().wrap(function _callee79$(_context79) {
7617
- while (1) switch (_context79.prev = _context79.next) {
7704
+ var _removeProductsFromOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee80(identities, options) {
7705
+ return _regeneratorRuntime().wrap(function _callee80$(_context80) {
7706
+ while (1) switch (_context80.prev = _context80.next) {
7618
7707
  case 0:
7619
- _context79.prev = 0;
7708
+ _context80.prev = 0;
7620
7709
  if (this.store.order) {
7621
- _context79.next = 3;
7710
+ _context80.next = 3;
7622
7711
  break;
7623
7712
  }
7624
7713
  throw new Error('order 模块未初始化');
7625
7714
  case 3:
7626
7715
  if (!(options === undefined)) {
7627
- _context79.next = 9;
7716
+ _context80.next = 9;
7628
7717
  break;
7629
7718
  }
7630
- _context79.next = 6;
7719
+ _context80.next = 6;
7631
7720
  return this.store.order.removeProductsFromOrder(identities);
7632
7721
  case 6:
7633
- _context79.t0 = _context79.sent;
7634
- _context79.next = 12;
7722
+ _context80.t0 = _context80.sent;
7723
+ _context80.next = 12;
7635
7724
  break;
7636
7725
  case 9:
7637
- _context79.next = 11;
7726
+ _context80.next = 11;
7638
7727
  return this.store.order.removeProductsFromOrder(identities, options);
7639
7728
  case 11:
7640
- _context79.t0 = _context79.sent;
7729
+ _context80.t0 = _context80.sent;
7641
7730
  case 12:
7642
- return _context79.abrupt("return", _context79.t0);
7731
+ return _context80.abrupt("return", _context80.t0);
7643
7732
  case 15:
7644
- _context79.prev = 15;
7645
- _context79.t1 = _context79["catch"](0);
7646
- throw _context79.t1;
7733
+ _context80.prev = 15;
7734
+ _context80.t1 = _context80["catch"](0);
7735
+ throw _context80.t1;
7647
7736
  case 18:
7648
7737
  case "end":
7649
- return _context79.stop();
7738
+ return _context80.stop();
7650
7739
  }
7651
- }, _callee79, this, [[0, 15]]);
7740
+ }, _callee80, this, [[0, 15]]);
7652
7741
  }));
7653
- function removeProductsFromOrder(_x67, _x68) {
7742
+ function removeProductsFromOrder(_x69, _x70) {
7654
7743
  return _removeProductsFromOrder.apply(this, arguments);
7655
7744
  }
7656
7745
  return removeProductsFromOrder;
@@ -7658,18 +7747,18 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
7658
7747
  }, {
7659
7748
  key: "removeProductFromOrder",
7660
7749
  value: function () {
7661
- var _removeProductFromOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee80(identity, options) {
7662
- return _regeneratorRuntime().wrap(function _callee80$(_context80) {
7663
- while (1) switch (_context80.prev = _context80.next) {
7750
+ var _removeProductFromOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee81(identity, options) {
7751
+ return _regeneratorRuntime().wrap(function _callee81$(_context81) {
7752
+ while (1) switch (_context81.prev = _context81.next) {
7664
7753
  case 0:
7665
- return _context80.abrupt("return", this.removeProductsFromOrder([identity], options));
7754
+ return _context81.abrupt("return", this.removeProductsFromOrder([identity], options));
7666
7755
  case 1:
7667
7756
  case "end":
7668
- return _context80.stop();
7757
+ return _context81.stop();
7669
7758
  }
7670
- }, _callee80, this);
7759
+ }, _callee81, this);
7671
7760
  }));
7672
- function removeProductFromOrder(_x69, _x70) {
7761
+ function removeProductFromOrder(_x71, _x72) {
7673
7762
  return _removeProductFromOrder.apply(this, arguments);
7674
7763
  }
7675
7764
  return removeProductFromOrder;
@@ -7719,23 +7808,23 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
7719
7808
  }, {
7720
7809
  key: "applyPromotion",
7721
7810
  value: (function () {
7722
- var _applyPromotion = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee81() {
7723
- return _regeneratorRuntime().wrap(function _callee81$(_context81) {
7724
- while (1) switch (_context81.prev = _context81.next) {
7811
+ var _applyPromotion = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee82() {
7812
+ return _regeneratorRuntime().wrap(function _callee82$(_context82) {
7813
+ while (1) switch (_context82.prev = _context82.next) {
7725
7814
  case 0:
7726
7815
  if (this.store.order) {
7727
- _context81.next = 2;
7816
+ _context82.next = 2;
7728
7817
  break;
7729
7818
  }
7730
7819
  throw new Error('order 模块未初始化');
7731
7820
  case 2:
7732
- _context81.next = 4;
7821
+ _context82.next = 4;
7733
7822
  return this.store.order.applyPromotion();
7734
7823
  case 4:
7735
7824
  case "end":
7736
- return _context81.stop();
7825
+ return _context82.stop();
7737
7826
  }
7738
- }, _callee81, this);
7827
+ }, _callee82, this);
7739
7828
  }));
7740
7829
  function applyPromotion() {
7741
7830
  return _applyPromotion.apply(this, arguments);
@@ -7762,18 +7851,18 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
7762
7851
  }, {
7763
7852
  key: "getProductList",
7764
7853
  value: function () {
7765
- var _getProductList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee82() {
7766
- var _this$otherParams43;
7854
+ var _getProductList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee83() {
7855
+ var _this$otherParams45;
7767
7856
  var menu_list_ids, _this$store$products, res;
7768
- return _regeneratorRuntime().wrap(function _callee82$(_context82) {
7769
- while (1) switch (_context82.prev = _context82.next) {
7857
+ return _regeneratorRuntime().wrap(function _callee83$(_context83) {
7858
+ while (1) switch (_context83.prev = _context83.next) {
7770
7859
  case 0:
7771
7860
  // 可以直接通过配置里的 menu 读取
7772
- menu_list_ids = ((_this$otherParams43 = this.otherParams) === null || _this$otherParams43 === void 0 || (_this$otherParams43 = _this$otherParams43.dineInConfig) === null || _this$otherParams43 === void 0 ? void 0 : _this$otherParams43['menu.associated_menus'].map(function (n) {
7861
+ menu_list_ids = ((_this$otherParams45 = this.otherParams) === null || _this$otherParams45 === void 0 || (_this$otherParams45 = _this$otherParams45.dineInConfig) === null || _this$otherParams45 === void 0 ? void 0 : _this$otherParams45['menu.associated_menus'].map(function (n) {
7773
7862
  return Number(n.value);
7774
7863
  })) || [];
7775
- _context82.prev = 1;
7776
- _context82.next = 4;
7864
+ _context83.prev = 1;
7865
+ _context83.next = 4;
7777
7866
  return (_this$store$products = this.store.products) === null || _this$store$products === void 0 ? void 0 : _this$store$products.loadProducts({
7778
7867
  menu_list_ids: menu_list_ids,
7779
7868
  cacheId: this.cacheId,
@@ -7781,17 +7870,17 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
7781
7870
  schedule_datetime: dayjs().format('YYYY-MM-DD HH:mm:ss')
7782
7871
  });
7783
7872
  case 4:
7784
- res = _context82.sent;
7785
- return _context82.abrupt("return", res);
7873
+ res = _context83.sent;
7874
+ return _context83.abrupt("return", res);
7786
7875
  case 8:
7787
- _context82.prev = 8;
7788
- _context82.t0 = _context82["catch"](1);
7789
- throw _context82.t0;
7876
+ _context83.prev = 8;
7877
+ _context83.t0 = _context83["catch"](1);
7878
+ throw _context83.t0;
7790
7879
  case 11:
7791
7880
  case "end":
7792
- return _context82.stop();
7881
+ return _context83.stop();
7793
7882
  }
7794
- }, _callee82, this, [[1, 8]]);
7883
+ }, _callee83, this, [[1, 8]]);
7795
7884
  }));
7796
7885
  function getProductList() {
7797
7886
  return _getProductList.apply(this, arguments);
@@ -7806,36 +7895,36 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
7806
7895
  }, {
7807
7896
  key: "setOtherParams",
7808
7897
  value: function () {
7809
- var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee83(params) {
7810
- var _this$otherParams44;
7898
+ var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee84(params) {
7899
+ var _this$otherParams46;
7811
7900
  var _ref58,
7812
7901
  _ref58$cover,
7813
7902
  cover,
7814
7903
  previousPickupTimingScope,
7815
- _args83 = arguments;
7816
- return _regeneratorRuntime().wrap(function _callee83$(_context83) {
7817
- while (1) switch (_context83.prev = _context83.next) {
7904
+ _args84 = arguments;
7905
+ return _regeneratorRuntime().wrap(function _callee84$(_context84) {
7906
+ while (1) switch (_context84.prev = _context84.next) {
7818
7907
  case 0:
7819
- _ref58 = _args83.length > 1 && _args83[1] !== undefined ? _args83[1] : {}, _ref58$cover = _ref58.cover, cover = _ref58$cover === void 0 ? false : _ref58$cover;
7908
+ _ref58 = _args84.length > 1 && _args84[1] !== undefined ? _args84[1] : {}, _ref58$cover = _ref58.cover, cover = _ref58$cover === void 0 ? false : _ref58$cover;
7820
7909
  previousPickupTimingScope = this.getPickupTimingScope();
7821
7910
  if (cover) {
7822
7911
  this.otherParams = _objectSpread({}, params);
7823
7912
  } else {
7824
7913
  this.otherParams = _objectSpread(_objectSpread({}, this.otherParams), params);
7825
7914
  }
7826
- this.cacheId = (_this$otherParams44 = this.otherParams) === null || _this$otherParams44 === void 0 ? void 0 : _this$otherParams44.cacheId;
7915
+ this.cacheId = (_this$otherParams46 = this.otherParams) === null || _this$otherParams46 === void 0 ? void 0 : _this$otherParams46.cacheId;
7827
7916
  if (previousPickupTimingScope !== this.getPickupTimingScope()) this.resetPickupTimingCache();
7828
- _context83.next = 7;
7917
+ _context84.next = 7;
7829
7918
  return this.syncOtherParamsToSubModules(params, {
7830
7919
  cover: cover
7831
7920
  });
7832
7921
  case 7:
7833
7922
  case "end":
7834
- return _context83.stop();
7923
+ return _context84.stop();
7835
7924
  }
7836
- }, _callee83, this);
7925
+ }, _callee84, this);
7837
7926
  }));
7838
- function setOtherParams(_x71) {
7927
+ function setOtherParams(_x73) {
7839
7928
  return _setOtherParams.apply(this, arguments);
7840
7929
  }
7841
7930
  return setOtherParams;