@pisell/pisellos 0.10.76 → 0.10.78

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 (212) hide show
  1. package/dist/apis/picoding.d.ts +0 -0
  2. package/dist/effects/index.d.ts +19 -0
  3. package/dist/model/strategy/adapter/dataVariant/adapter.d.ts +50 -0
  4. package/dist/model/strategy/adapter/dataVariant/evaluator.d.ts +105 -0
  5. package/dist/model/strategy/adapter/dataVariant/examples.d.ts +39 -0
  6. package/dist/model/strategy/adapter/dataVariant/index.d.ts +4 -0
  7. package/dist/model/strategy/adapter/dataVariant/type.d.ts +173 -0
  8. package/dist/model/strategy/adapter/promotion/adapter.d.ts +70 -0
  9. package/dist/model/strategy/adapter/promotion/examples.d.ts +224 -0
  10. package/dist/model/strategy/adapter/promotion/index.js +0 -9
  11. package/dist/model/strategy/adapter/promotion/type.d.ts +535 -0
  12. package/dist/model/strategy/adapter/type.d.ts +28 -0
  13. package/dist/model/strategy/adapter/walletPass/index.d.ts +32 -0
  14. package/dist/model/strategy/adapter/walletPass/locales.d.ts +1 -0
  15. package/dist/model/strategy/adapter/walletPass/type.d.ts +192 -0
  16. package/dist/model/strategy/adapter/walletPass/utils.d.ts +50 -0
  17. package/dist/model/strategy/engine.d.ts +119 -0
  18. package/dist/model/strategy/type.d.ts +245 -0
  19. package/dist/modules/Account/types.d.ts +56 -0
  20. package/dist/modules/BookingContext/types.d.ts +104 -0
  21. package/dist/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +76 -0
  22. package/dist/modules/BookingContext/utils/flexible.d.ts +28 -0
  23. package/dist/modules/BookingContext/utils/formatResourceList.d.ts +8 -0
  24. package/dist/modules/BookingContext/utils/noResource.d.ts +13 -0
  25. package/dist/modules/BookingContext/utils/orderLineDisplay.d.ts +1 -0
  26. package/dist/modules/BookingContext/utils/resourceErrors.d.ts +41 -0
  27. package/dist/modules/BookingContext/utils/resourceSelection.d.ts +7 -0
  28. package/dist/modules/BookingContext/utils/serviceTimes.d.ts +55 -0
  29. package/dist/modules/BookingContext/utils/timeSlices.d.ts +42 -0
  30. package/dist/modules/Customer/constants.d.ts +7 -0
  31. package/dist/modules/Date/types.d.ts +84 -0
  32. package/dist/modules/Date/utils.d.ts +36 -0
  33. package/dist/modules/FulfillmentTiming/index.d.ts +11 -0
  34. package/dist/modules/FulfillmentTiming/types.d.ts +67 -0
  35. package/dist/modules/Order/payment-utils.d.ts +26 -0
  36. package/dist/modules/Order/pickupTiming.d.ts +46 -0
  37. package/dist/modules/Order/utils/manualProductDiscount.d.ts +106 -0
  38. package/dist/modules/Order/utils/orderCollectionIdentity.d.ts +68 -0
  39. package/dist/modules/Order/utils/weighedProduct.d.ts +12 -0
  40. package/dist/modules/Payment/cashRecommendationAlgorithm.d.ts +21 -0
  41. package/dist/modules/Payment/mx51.d.ts +0 -0
  42. package/dist/modules/Payment/types.d.ts +943 -0
  43. package/dist/modules/Payment/utils.d.ts +19 -0
  44. package/dist/modules/Product/index.d.ts +1 -1
  45. package/dist/modules/ProductList/index.d.ts +2 -0
  46. package/dist/modules/ProductList/index.js +125 -39
  47. package/dist/modules/Quotation/types.d.ts +61 -0
  48. package/dist/modules/Resource/types.d.ts +50 -0
  49. package/dist/modules/Resource/utils.d.ts +23 -0
  50. package/dist/modules/ResourcePlanner/localClock.d.ts +33 -0
  51. package/dist/modules/ResourcePlanner/planner.js +5 -0
  52. package/dist/modules/SalesSummary/types.d.ts +69 -0
  53. package/dist/modules/ScanOrderLogger/providers/feishu.d.ts +2 -0
  54. package/dist/modules/ScanOrderLogger/providers/grafana.d.ts +2 -0
  55. package/dist/modules/ScanOrderLogger/types.d.ts +53 -0
  56. package/dist/modules/Schedule/getDateIsInSchedule.d.ts +32 -0
  57. package/dist/modules/Schedule/type.d.ts +157 -0
  58. package/dist/modules/Schedule/types.d.ts +201 -0
  59. package/dist/modules/Schedule/utils.d.ts +67 -0
  60. package/dist/modules/Step/tyeps.d.ts +20 -0
  61. package/dist/modules/SurchargeList/types.d.ts +15 -0
  62. package/dist/plugins/app.d.ts +10 -0
  63. package/dist/plugins/shopStore.d.ts +4 -0
  64. package/dist/plugins/user.d.ts +7 -0
  65. package/dist/server/modules/floor-plan/types.d.ts +43 -0
  66. package/dist/server/modules/menu/types.d.ts +68 -0
  67. package/dist/server/modules/payment/types.d.ts +9 -0
  68. package/dist/server/modules/quotation/types.d.ts +50 -0
  69. package/dist/server/modules/resource/types.d.ts +121 -0
  70. package/dist/server/modules/schedule/types.d.ts +1 -0
  71. package/dist/server/modules/schedule/utils.d.ts +32 -0
  72. package/dist/server/types.d.ts +66 -0
  73. package/dist/server/utils/index.d.ts +5 -0
  74. package/dist/server/utils/schedule.d.ts +14 -0
  75. package/dist/server/utils/time.d.ts +18 -0
  76. package/dist/solution/BaseSales/index.d.ts +12 -1
  77. package/dist/solution/BaseSales/index.js +275 -185
  78. package/dist/solution/BookingByStep/index.d.ts +2 -2
  79. package/dist/solution/BookingTicket/index.d.ts +1 -13
  80. package/dist/solution/BookingTicket/utils/bookingStatus.d.ts +77 -0
  81. package/dist/solution/BookingTicket/utils/exampleData.d.ts +123 -0
  82. package/dist/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +185 -0
  83. package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +38 -0
  84. package/dist/solution/BookingTicket/utils/scan/scanCache.d.ts +78 -0
  85. package/dist/solution/BookingTicket/utils/scan/scanProductValues.d.ts +21 -0
  86. package/dist/solution/BookingTicket/utils/weighingProductSku.d.ts +5 -0
  87. package/dist/solution/PlaceOrder/index.d.ts +0 -0
  88. package/dist/solution/RegisterAndLogin/config.d.ts +93 -0
  89. package/dist/solution/RegisterAndLogin/types.d.ts +445 -0
  90. package/dist/solution/RegisterAndLogin/utils.d.ts +103 -0
  91. package/dist/solution/UnifiedBookingSales/index.d.ts +23 -1
  92. package/dist/solution/UnifiedBookingSales/index.js +1367 -646
  93. package/dist/solution/UnifiedBookingSales/remoteOccupancyCache.d.ts +2 -0
  94. package/dist/solution/UnifiedBookingSales/remoteOccupancyCache.js +4 -0
  95. package/dist/solution/UnifiedBookingSales/sessionResourceCache.d.ts +27 -0
  96. package/dist/solution/UnifiedBookingSales/sessionResourceCache.js +271 -0
  97. package/dist/solution/UnifiedBookingSales/types.d.ts +25 -0
  98. package/dist/solution/UnifiedBookingSales/types.js +2 -0
  99. package/dist/solution/UnifiedBookingSales/venueCatalogSession.d.ts +32 -0
  100. package/dist/solution/UnifiedBookingSales/venueCatalogSession.js +277 -0
  101. package/dist/store/createStore.d.ts +3 -0
  102. package/dist/types/index.d.ts +132 -0
  103. package/dist/utils/os-private-payload.d.ts +5 -0
  104. package/dist/utils/payment-number.d.ts +9 -0
  105. package/dist/utils/task.d.ts +40 -0
  106. package/dist/utils/watch.d.ts +102 -0
  107. package/lib/apis/picoding.d.ts +0 -0
  108. package/lib/effects/index.d.ts +19 -0
  109. package/lib/model/strategy/adapter/dataVariant/adapter.d.ts +50 -0
  110. package/lib/model/strategy/adapter/dataVariant/evaluator.d.ts +105 -0
  111. package/lib/model/strategy/adapter/dataVariant/examples.d.ts +39 -0
  112. package/lib/model/strategy/adapter/dataVariant/index.d.ts +4 -0
  113. package/lib/model/strategy/adapter/dataVariant/type.d.ts +173 -0
  114. package/lib/model/strategy/adapter/promotion/adapter.d.ts +70 -0
  115. package/lib/model/strategy/adapter/promotion/examples.d.ts +224 -0
  116. package/lib/model/strategy/adapter/promotion/type.d.ts +535 -0
  117. package/lib/model/strategy/adapter/type.d.ts +28 -0
  118. package/lib/model/strategy/adapter/walletPass/index.d.ts +32 -0
  119. package/lib/model/strategy/adapter/walletPass/locales.d.ts +1 -0
  120. package/lib/model/strategy/adapter/walletPass/type.d.ts +192 -0
  121. package/lib/model/strategy/adapter/walletPass/utils.d.ts +50 -0
  122. package/lib/model/strategy/engine.d.ts +119 -0
  123. package/lib/model/strategy/type.d.ts +245 -0
  124. package/lib/modules/Account/types.d.ts +56 -0
  125. package/lib/modules/BookingContext/types.d.ts +104 -0
  126. package/lib/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +76 -0
  127. package/lib/modules/BookingContext/utils/flexible.d.ts +28 -0
  128. package/lib/modules/BookingContext/utils/formatResourceList.d.ts +8 -0
  129. package/lib/modules/BookingContext/utils/noResource.d.ts +13 -0
  130. package/lib/modules/BookingContext/utils/orderLineDisplay.d.ts +1 -0
  131. package/lib/modules/BookingContext/utils/resourceErrors.d.ts +41 -0
  132. package/lib/modules/BookingContext/utils/resourceSelection.d.ts +7 -0
  133. package/lib/modules/BookingContext/utils/serviceTimes.d.ts +55 -0
  134. package/lib/modules/BookingContext/utils/timeSlices.d.ts +42 -0
  135. package/lib/modules/Customer/constants.d.ts +7 -0
  136. package/lib/modules/Date/types.d.ts +84 -0
  137. package/lib/modules/Date/utils.d.ts +36 -0
  138. package/lib/modules/FulfillmentTiming/index.d.ts +11 -0
  139. package/lib/modules/FulfillmentTiming/types.d.ts +67 -0
  140. package/lib/modules/Order/payment-utils.d.ts +26 -0
  141. package/lib/modules/Order/pickupTiming.d.ts +46 -0
  142. package/lib/modules/Order/utils/manualProductDiscount.d.ts +106 -0
  143. package/lib/modules/Order/utils/orderCollectionIdentity.d.ts +68 -0
  144. package/lib/modules/Order/utils/weighedProduct.d.ts +12 -0
  145. package/lib/modules/Payment/cashRecommendationAlgorithm.d.ts +21 -0
  146. package/lib/modules/Payment/mx51.d.ts +0 -0
  147. package/lib/modules/Payment/types.d.ts +943 -0
  148. package/lib/modules/Payment/utils.d.ts +19 -0
  149. package/lib/modules/Product/index.d.ts +1 -1
  150. package/lib/modules/ProductList/index.d.ts +2 -0
  151. package/lib/modules/ProductList/index.js +56 -0
  152. package/lib/modules/Quotation/types.d.ts +61 -0
  153. package/lib/modules/Resource/types.d.ts +50 -0
  154. package/lib/modules/Resource/utils.d.ts +23 -0
  155. package/lib/modules/ResourcePlanner/localClock.d.ts +33 -0
  156. package/lib/modules/ResourcePlanner/planner.js +4 -0
  157. package/lib/modules/SalesSummary/types.d.ts +69 -0
  158. package/lib/modules/ScanOrderLogger/providers/feishu.d.ts +2 -0
  159. package/lib/modules/ScanOrderLogger/providers/grafana.d.ts +2 -0
  160. package/lib/modules/ScanOrderLogger/types.d.ts +53 -0
  161. package/lib/modules/Schedule/getDateIsInSchedule.d.ts +32 -0
  162. package/lib/modules/Schedule/type.d.ts +157 -0
  163. package/lib/modules/Schedule/types.d.ts +201 -0
  164. package/lib/modules/Schedule/utils.d.ts +67 -0
  165. package/lib/modules/Step/tyeps.d.ts +20 -0
  166. package/lib/modules/SurchargeList/types.d.ts +15 -0
  167. package/lib/plugins/app.d.ts +10 -0
  168. package/lib/plugins/shopStore.d.ts +4 -0
  169. package/lib/plugins/user.d.ts +7 -0
  170. package/lib/server/modules/floor-plan/types.d.ts +43 -0
  171. package/lib/server/modules/menu/types.d.ts +68 -0
  172. package/lib/server/modules/payment/types.d.ts +9 -0
  173. package/lib/server/modules/quotation/types.d.ts +50 -0
  174. package/lib/server/modules/resource/types.d.ts +121 -0
  175. package/lib/server/modules/schedule/types.d.ts +1 -0
  176. package/lib/server/modules/schedule/utils.d.ts +32 -0
  177. package/lib/server/types.d.ts +66 -0
  178. package/lib/server/utils/index.d.ts +5 -0
  179. package/lib/server/utils/schedule.d.ts +14 -0
  180. package/lib/server/utils/time.d.ts +18 -0
  181. package/lib/solution/BaseSales/index.d.ts +12 -1
  182. package/lib/solution/BaseSales/index.js +65 -0
  183. package/lib/solution/BookingByStep/index.d.ts +2 -2
  184. package/lib/solution/BookingTicket/index.d.ts +1 -13
  185. package/lib/solution/BookingTicket/utils/bookingStatus.d.ts +77 -0
  186. package/lib/solution/BookingTicket/utils/exampleData.d.ts +123 -0
  187. package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +185 -0
  188. package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +38 -0
  189. package/lib/solution/BookingTicket/utils/scan/scanCache.d.ts +78 -0
  190. package/lib/solution/BookingTicket/utils/scan/scanProductValues.d.ts +21 -0
  191. package/lib/solution/BookingTicket/utils/weighingProductSku.d.ts +5 -0
  192. package/lib/solution/PlaceOrder/index.d.ts +0 -0
  193. package/lib/solution/RegisterAndLogin/config.d.ts +93 -0
  194. package/lib/solution/RegisterAndLogin/types.d.ts +445 -0
  195. package/lib/solution/RegisterAndLogin/utils.d.ts +103 -0
  196. package/lib/solution/UnifiedBookingSales/index.d.ts +23 -1
  197. package/lib/solution/UnifiedBookingSales/index.js +399 -14
  198. package/lib/solution/UnifiedBookingSales/remoteOccupancyCache.d.ts +2 -0
  199. package/lib/solution/UnifiedBookingSales/remoteOccupancyCache.js +2 -0
  200. package/lib/solution/UnifiedBookingSales/sessionResourceCache.d.ts +27 -0
  201. package/lib/solution/UnifiedBookingSales/sessionResourceCache.js +199 -0
  202. package/lib/solution/UnifiedBookingSales/types.d.ts +25 -0
  203. package/lib/solution/UnifiedBookingSales/types.js +1 -0
  204. package/lib/solution/UnifiedBookingSales/venueCatalogSession.d.ts +32 -0
  205. package/lib/solution/UnifiedBookingSales/venueCatalogSession.js +151 -0
  206. package/lib/store/createStore.d.ts +3 -0
  207. package/lib/types/index.d.ts +132 -0
  208. package/lib/utils/os-private-payload.d.ts +5 -0
  209. package/lib/utils/payment-number.d.ts +9 -0
  210. package/lib/utils/task.d.ts +40 -0
  211. package/lib/utils/watch.d.ts +102 -0
  212. package/package.json +1 -1
@@ -1458,13 +1458,15 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
1458
1458
  var preparedProduct = this.prepareRawProductForPriceQuery(params.rawProduct, params.selectedProduct);
1459
1459
  if (!preparedProduct) return null;
1460
1460
  var scheduleList = this.getPriceQueryScheduleList();
1461
- var result = tryResolveClientDataVariants(_objectSpread({
1461
+ var result = tryResolveClientDataVariants(_objectSpread(_objectSpread({
1462
1462
  core: this.core,
1463
1463
  otherParams: this.otherParams,
1464
1464
  products: [preparedProduct],
1465
1465
  queryPayload: params.queryPayload,
1466
1466
  handledByOsServer: false
1467
- }, scheduleList ? {
1467
+ }, params.menuList ? {
1468
+ menuList: params.menuList
1469
+ } : {}), scheduleList ? {
1468
1470
  scheduleList: scheduleList
1469
1471
  } : {}));
1470
1472
  if (result.status !== 'resolved') return null;
@@ -1553,13 +1555,23 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
1553
1555
  return _loadProductsForPriceQuery.apply(this, arguments);
1554
1556
  }
1555
1557
  return loadProductsForPriceQuery;
1556
- }()
1558
+ }() /** Opt-in subclasses may supply page-owned raw pools; ordinary sales keep remote fallback. */
1559
+ }, {
1560
+ key: "isVenueCatalogLocalPricingActive",
1561
+ value: function isVenueCatalogLocalPricingActive() {
1562
+ return false;
1563
+ }
1564
+ }, {
1565
+ key: "getVenueCatalogLocalPriceSource",
1566
+ value: function getVenueCatalogLocalPriceSource(_productId, _selectedProduct) {
1567
+ return undefined;
1568
+ }
1557
1569
  }, {
1558
1570
  key: "resolveProductsForPriceQuery",
1559
1571
  value: function () {
1560
1572
  var _resolveProductsForPriceQuery = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(params) {
1561
1573
  var _this8 = this;
1562
- var selectedProducts, productIds, ids, handledByOsServer, canUseLocalFastPath, productsById, queryPayload, cachedRawProducts, authoritativeProducts, missingIds, remoteRawProducts;
1574
+ var selectedProducts, productIds, ids, _queryPayload, handledByOsServer, canUseLocalFastPath, productsById, queryPayload, cachedRawProducts, authoritativeProducts, missingIds, remoteRawProducts;
1563
1575
  return _regeneratorRuntime().wrap(function _callee12$(_context12) {
1564
1576
  while (1) switch (_context12.prev = _context12.next) {
1565
1577
  case 0:
@@ -1580,33 +1592,57 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
1580
1592
  return null;
1581
1593
  }));
1582
1594
  case 5:
1595
+ if (!this.isVenueCatalogLocalPricingActive()) {
1596
+ _context12.next = 8;
1597
+ break;
1598
+ }
1599
+ _queryPayload = this.buildPriceQueryPayload({
1600
+ ids: ids,
1601
+ schedule: params.schedule,
1602
+ customerId: params.customerId,
1603
+ channel: params.channel
1604
+ });
1605
+ return _context12.abrupt("return", selectedProducts.map(function (selectedProduct, index) {
1606
+ var source = productIds[index] == null ? undefined : _this8.getVenueCatalogLocalPriceSource(productIds[index], selectedProduct);
1607
+ var resolved = source && _this8.resolveLocalProductForPriceQuery({
1608
+ selectedProduct: selectedProduct,
1609
+ rawProduct: source.product,
1610
+ menuList: source.menuList,
1611
+ queryPayload: _queryPayload
1612
+ });
1613
+ if (!resolved) throw Object.assign(new Error('The complete venue product or pricing rules are not ready. Reload the catalog before continuing.'), {
1614
+ code: 'VENUE_LOCAL_PRICE_UNAVAILABLE'
1615
+ });
1616
+ return resolved;
1617
+ }));
1618
+ case 8:
1583
1619
  handledByOsServer = this.request ? isProductQueryHandledByOsServer(this.core, this.request) : false;
1584
1620
  canUseLocalFastPath = this.isCustomerUserPriceQuery() && !handledByOsServer;
1585
1621
  if (canUseLocalFastPath) {
1586
- _context12.next = 14;
1622
+ _context12.next = 17;
1587
1623
  break;
1588
1624
  }
1589
1625
  if (this.request) {
1590
- _context12.next = 10;
1626
+ _context12.next = 13;
1591
1627
  break;
1592
1628
  }
1593
1629
  return _context12.abrupt("return", selectedProducts.map(function () {
1594
1630
  return null;
1595
1631
  }));
1596
- case 10:
1597
- _context12.next = 12;
1632
+ case 13:
1633
+ _context12.next = 15;
1598
1634
  return this.loadProductsForPriceQuery({
1599
1635
  ids: ids,
1600
1636
  schedule: params.schedule,
1601
1637
  customerId: params.customerId,
1602
1638
  channel: params.channel
1603
1639
  });
1604
- case 12:
1640
+ case 15:
1605
1641
  productsById = _context12.sent;
1606
1642
  return _context12.abrupt("return", productIds.map(function (productId) {
1607
1643
  return productId === null ? null : productsById.get(productId) || null;
1608
1644
  }));
1609
- case 14:
1645
+ case 17:
1610
1646
  queryPayload = this.buildPriceQueryPayload({
1611
1647
  ids: ids,
1612
1648
  schedule: params.schedule,
@@ -1626,25 +1662,25 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
1626
1662
  return productId !== null && !authoritativeProducts[index];
1627
1663
  })));
1628
1664
  if (missingIds.length) {
1629
- _context12.next = 20;
1665
+ _context12.next = 23;
1630
1666
  break;
1631
1667
  }
1632
1668
  return _context12.abrupt("return", authoritativeProducts);
1633
- case 20:
1669
+ case 23:
1634
1670
  if (this.request) {
1635
- _context12.next = 22;
1671
+ _context12.next = 25;
1636
1672
  break;
1637
1673
  }
1638
1674
  return _context12.abrupt("return", authoritativeProducts);
1639
- case 22:
1640
- _context12.next = 24;
1675
+ case 25:
1676
+ _context12.next = 27;
1641
1677
  return this.loadProductsForPriceQuery({
1642
1678
  ids: missingIds,
1643
1679
  schedule: params.schedule,
1644
1680
  customerId: params.customerId,
1645
1681
  channel: params.channel
1646
1682
  });
1647
- case 24:
1683
+ case 27:
1648
1684
  remoteRawProducts = _context12.sent;
1649
1685
  authoritativeProducts.forEach(function (authoritativeProduct, index) {
1650
1686
  if (authoritativeProduct) return;
@@ -1666,7 +1702,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
1666
1702
  authoritativeProducts[index] = rawProduct ? _this8.prepareRawProductForPriceQuery(rawProduct, selectedProducts[index]) || rawProduct : null;
1667
1703
  });
1668
1704
  return _context12.abrupt("return", authoritativeProducts);
1669
- case 27:
1705
+ case 30:
1670
1706
  case "end":
1671
1707
  return _context12.stop();
1672
1708
  }
@@ -6694,23 +6730,77 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
6694
6730
  value: function transformBaseProductToOrderProduct(params) {
6695
6731
  return _transformBaseProductToOrderProduct(params);
6696
6732
  }
6733
+
6734
+ /** Explicit pool source avoids races between two simultaneous Venue pricing contexts. */
6697
6735
  }, {
6698
- key: "calculateProductBookingPrice",
6699
- value: function () {
6700
- var _calculateProductBookingPrice = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee67(params) {
6736
+ key: "calculateVenueCatalogProductBookingPrice",
6737
+ value: (function () {
6738
+ var _calculateVenueCatalogProductBookingPrice = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee67(params, source) {
6701
6739
  var _params$customer_id;
6702
- var useCustomerUserPricing, quotation, customerId, channel, _yield$this$resolvePr, _yield$this$resolvePr2, authoritativeProduct, product;
6740
+ var customerId, channel, queryPayload, authoritativeProduct;
6703
6741
  return _regeneratorRuntime().wrap(function _callee67$(_context67) {
6704
6742
  while (1) switch (_context67.prev = _context67.next) {
6743
+ case 0:
6744
+ customerId = (_params$customer_id = params.customer_id) !== null && _params$customer_id !== void 0 ? _params$customer_id : this.getCurrentOrderCustomerId();
6745
+ _context67.next = 3;
6746
+ return this.prepareProductPriceQueryContext(customerId);
6747
+ case 3:
6748
+ channel = this.getPriceQueryChannel(params.channel);
6749
+ queryPayload = this.buildPriceQueryPayload({
6750
+ ids: [Number(source.product.id)],
6751
+ schedule: this.getPriceQuerySchedule(params),
6752
+ customerId: customerId,
6753
+ channel: channel
6754
+ });
6755
+ authoritativeProduct = this.resolveLocalProductForPriceQuery({
6756
+ selectedProduct: params.product,
6757
+ rawProduct: source.product,
6758
+ menuList: source.menuList,
6759
+ queryPayload: queryPayload
6760
+ });
6761
+ if (authoritativeProduct) {
6762
+ _context67.next = 8;
6763
+ break;
6764
+ }
6765
+ throw Object.assign(new Error('Complete product pricing rules are not ready. Please retry.'), {
6766
+ code: 'VENUE_LOCAL_PRICE_UNAVAILABLE'
6767
+ });
6768
+ case 8:
6769
+ return _context67.abrupt("return", calculateBaseSalesProductBookingPrice(_objectSpread(_objectSpread({}, params), {}, {
6770
+ channel: channel,
6771
+ customer_id: customerId,
6772
+ product: this.mergeProductForPriceQuery(params.product, authoritativeProduct),
6773
+ fallback_price: undefined,
6774
+ quotation: undefined
6775
+ })));
6776
+ case 9:
6777
+ case "end":
6778
+ return _context67.stop();
6779
+ }
6780
+ }, _callee67, this);
6781
+ }));
6782
+ function calculateVenueCatalogProductBookingPrice(_x53, _x54) {
6783
+ return _calculateVenueCatalogProductBookingPrice.apply(this, arguments);
6784
+ }
6785
+ return calculateVenueCatalogProductBookingPrice;
6786
+ }())
6787
+ }, {
6788
+ key: "calculateProductBookingPrice",
6789
+ value: function () {
6790
+ var _calculateProductBookingPrice = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee68(params) {
6791
+ var _params$customer_id2;
6792
+ var useCustomerUserPricing, quotation, customerId, channel, _yield$this$resolvePr, _yield$this$resolvePr2, authoritativeProduct, product;
6793
+ return _regeneratorRuntime().wrap(function _callee68$(_context68) {
6794
+ while (1) switch (_context68.prev = _context68.next) {
6705
6795
  case 0:
6706
6796
  useCustomerUserPricing = this.isCustomerUserPriceQuery();
6707
6797
  quotation = useCustomerUserPricing ? undefined : this.store.quotation;
6708
- customerId = (_params$customer_id = params.customer_id) !== null && _params$customer_id !== void 0 ? _params$customer_id : this.getCurrentOrderCustomerId();
6709
- _context67.next = 5;
6798
+ customerId = (_params$customer_id2 = params.customer_id) !== null && _params$customer_id2 !== void 0 ? _params$customer_id2 : this.getCurrentOrderCustomerId();
6799
+ _context68.next = 5;
6710
6800
  return this.prepareProductPriceQueryContext(customerId);
6711
6801
  case 5:
6712
6802
  channel = this.getPriceQueryChannel(params.channel);
6713
- _context67.next = 8;
6803
+ _context68.next = 8;
6714
6804
  return this.resolveProductsForPriceQuery({
6715
6805
  priceQueries: [params],
6716
6806
  schedule: this.getPriceQuerySchedule(params),
@@ -6718,22 +6808,22 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
6718
6808
  channel: channel
6719
6809
  });
6720
6810
  case 8:
6721
- _yield$this$resolvePr = _context67.sent;
6811
+ _yield$this$resolvePr = _context68.sent;
6722
6812
  _yield$this$resolvePr2 = _slicedToArray(_yield$this$resolvePr, 1);
6723
6813
  authoritativeProduct = _yield$this$resolvePr2[0];
6724
6814
  product = this.mergeProductForPriceQuery(params.product, authoritativeProduct);
6725
6815
  if (useCustomerUserPricing) {
6726
- _context67.next = 15;
6816
+ _context68.next = 15;
6727
6817
  break;
6728
6818
  }
6729
- _context67.next = 15;
6819
+ _context68.next = 15;
6730
6820
  return this.loadQuotationForPriceQuery({
6731
6821
  quotation: quotation,
6732
6822
  customer_id: customerId,
6733
6823
  channel: channel
6734
6824
  });
6735
6825
  case 15:
6736
- return _context67.abrupt("return", calculateBaseSalesProductBookingPrice(_objectSpread(_objectSpread({}, params), {}, {
6826
+ return _context68.abrupt("return", calculateBaseSalesProductBookingPrice(_objectSpread(_objectSpread({}, params), {}, {
6737
6827
  channel: channel,
6738
6828
  product: product,
6739
6829
  fallback_price: authoritativeProduct ? undefined : params.fallback_price,
@@ -6742,11 +6832,11 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
6742
6832
  })));
6743
6833
  case 16:
6744
6834
  case "end":
6745
- return _context67.stop();
6835
+ return _context68.stop();
6746
6836
  }
6747
- }, _callee67, this);
6837
+ }, _callee68, this);
6748
6838
  }));
6749
- function calculateProductBookingPrice(_x53) {
6839
+ function calculateProductBookingPrice(_x55) {
6750
6840
  return _calculateProductBookingPrice.apply(this, arguments);
6751
6841
  }
6752
6842
  return calculateProductBookingPrice;
@@ -6830,17 +6920,17 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
6830
6920
  }, {
6831
6921
  key: "calculateProductBookingPrices",
6832
6922
  value: function () {
6833
- var _calculateProductBookingPrices = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee69(paramsList) {
6923
+ var _calculateProductBookingPrices = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee70(paramsList) {
6834
6924
  var _this22 = this;
6835
6925
  var useCustomerUserPricing, quotation, currentOrderCustomerId, resolvedChannels, authoritativeProducts, groups, quotationContexts;
6836
- return _regeneratorRuntime().wrap(function _callee69$(_context69) {
6837
- while (1) switch (_context69.prev = _context69.next) {
6926
+ return _regeneratorRuntime().wrap(function _callee70$(_context70) {
6927
+ while (1) switch (_context70.prev = _context70.next) {
6838
6928
  case 0:
6839
6929
  if (paramsList.length) {
6840
- _context69.next = 2;
6930
+ _context70.next = 2;
6841
6931
  break;
6842
6932
  }
6843
- return _context69.abrupt("return", []);
6933
+ return _context70.abrupt("return", []);
6844
6934
  case 2:
6845
6935
  useCustomerUserPricing = this.isCustomerUserPriceQuery();
6846
6936
  quotation = useCustomerUserPricing ? undefined : this.store.quotation;
@@ -6853,10 +6943,10 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
6853
6943
  });
6854
6944
  groups = new Map();
6855
6945
  paramsList.forEach(function (params, index) {
6856
- var _params$customer_id2;
6946
+ var _params$customer_id3;
6857
6947
  var schedule = _this22.getPriceQuerySchedule(params);
6858
6948
  var channel = resolvedChannels[index];
6859
- var customerId = (_params$customer_id2 = params.customer_id) !== null && _params$customer_id2 !== void 0 ? _params$customer_id2 : currentOrderCustomerId;
6949
+ var customerId = (_params$customer_id3 = params.customer_id) !== null && _params$customer_id3 !== void 0 ? _params$customer_id3 : currentOrderCustomerId;
6860
6950
  var groupKey = [schedule.schedule_date, schedule.schedule_datetime, channel || '', _this22.normalizePriceContextCustomerId(customerId) || ''].join('|');
6861
6951
  var group = groups.get(groupKey) || {
6862
6952
  indices: [],
@@ -6867,20 +6957,20 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
6867
6957
  group.indices.push(index);
6868
6958
  groups.set(groupKey, group);
6869
6959
  });
6870
- _context69.next = 11;
6960
+ _context70.next = 11;
6871
6961
  return Promise.all(Array.from(groups.values()).map( /*#__PURE__*/function () {
6872
- var _ref56 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee68(group) {
6962
+ var _ref56 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee69(group) {
6873
6963
  var priceQueries, resolvedProducts;
6874
- return _regeneratorRuntime().wrap(function _callee68$(_context68) {
6875
- while (1) switch (_context68.prev = _context68.next) {
6964
+ return _regeneratorRuntime().wrap(function _callee69$(_context69) {
6965
+ while (1) switch (_context69.prev = _context69.next) {
6876
6966
  case 0:
6877
- _context68.next = 2;
6967
+ _context69.next = 2;
6878
6968
  return _this22.prepareProductPriceQueryContext(group.customerId);
6879
6969
  case 2:
6880
6970
  priceQueries = group.indices.map(function (index) {
6881
6971
  return paramsList[index];
6882
6972
  });
6883
- _context68.next = 5;
6973
+ _context69.next = 5;
6884
6974
  return _this22.resolveProductsForPriceQuery({
6885
6975
  priceQueries: priceQueries,
6886
6976
  schedule: group.schedule,
@@ -6888,49 +6978,49 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
6888
6978
  channel: group.channel
6889
6979
  });
6890
6980
  case 5:
6891
- resolvedProducts = _context68.sent;
6981
+ resolvedProducts = _context69.sent;
6892
6982
  group.indices.forEach(function (originalIndex, groupIndex) {
6893
6983
  authoritativeProducts[originalIndex] = resolvedProducts[groupIndex] || null;
6894
6984
  });
6895
6985
  case 7:
6896
6986
  case "end":
6897
- return _context68.stop();
6987
+ return _context69.stop();
6898
6988
  }
6899
- }, _callee68);
6989
+ }, _callee69);
6900
6990
  }));
6901
- return function (_x55) {
6991
+ return function (_x57) {
6902
6992
  return _ref56.apply(this, arguments);
6903
6993
  };
6904
6994
  }()));
6905
6995
  case 11:
6906
6996
  if (useCustomerUserPricing) {
6907
- _context69.next = 16;
6997
+ _context70.next = 16;
6908
6998
  break;
6909
6999
  }
6910
7000
  quotationContexts = new Map();
6911
7001
  paramsList.forEach(function (params, index) {
6912
- var _params$customer_id3;
7002
+ var _params$customer_id4;
6913
7003
  var channel = resolvedChannels[index];
6914
7004
  var key = channel || '';
6915
7005
  if (quotationContexts.has(key)) return;
6916
7006
  quotationContexts.set(key, {
6917
7007
  channel: channel,
6918
- customer_id: (_params$customer_id3 = params.customer_id) !== null && _params$customer_id3 !== void 0 ? _params$customer_id3 : currentOrderCustomerId
7008
+ customer_id: (_params$customer_id4 = params.customer_id) !== null && _params$customer_id4 !== void 0 ? _params$customer_id4 : currentOrderCustomerId
6919
7009
  });
6920
7010
  });
6921
- _context69.next = 16;
7011
+ _context70.next = 16;
6922
7012
  return Promise.all(Array.from(quotationContexts.values()).map(function (context) {
6923
7013
  return _this22.loadQuotationForPriceQuery(_objectSpread({
6924
7014
  quotation: quotation
6925
7015
  }, context));
6926
7016
  }));
6927
7017
  case 16:
6928
- return _context69.abrupt("return", paramsList.map(function (params, index) {
6929
- var _params$customer_id4;
7018
+ return _context70.abrupt("return", paramsList.map(function (params, index) {
7019
+ var _params$customer_id5;
6930
7020
  var productInput = params.product || {};
6931
7021
  var authoritativeProduct = authoritativeProducts[index];
6932
7022
  var product = _this22.mergeProductForPriceQuery(productInput, authoritativeProduct);
6933
- var customerId = (_params$customer_id4 = params.customer_id) !== null && _params$customer_id4 !== void 0 ? _params$customer_id4 : currentOrderCustomerId;
7023
+ var customerId = (_params$customer_id5 = params.customer_id) !== null && _params$customer_id5 !== void 0 ? _params$customer_id5 : currentOrderCustomerId;
6934
7024
  var channel = resolvedChannels[index];
6935
7025
  return calculateBaseSalesProductBookingPrice(_objectSpread(_objectSpread({}, params), {}, {
6936
7026
  channel: channel,
@@ -6942,11 +7032,11 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
6942
7032
  }));
6943
7033
  case 17:
6944
7034
  case "end":
6945
- return _context69.stop();
7035
+ return _context70.stop();
6946
7036
  }
6947
- }, _callee69, this);
7037
+ }, _callee70, this);
6948
7038
  }));
6949
- function calculateProductBookingPrices(_x54) {
7039
+ function calculateProductBookingPrices(_x56) {
6950
7040
  return _calculateProductBookingPrices.apply(this, arguments);
6951
7041
  }
6952
7042
  return calculateProductBookingPrices;
@@ -6966,47 +7056,47 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
6966
7056
  }, {
6967
7057
  key: "addProductToOrder",
6968
7058
  value: function () {
6969
- var _addProductToOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee70(product, booking, options) {
7059
+ var _addProductToOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee71(product, booking, options) {
6970
7060
  var products;
6971
- return _regeneratorRuntime().wrap(function _callee70$(_context70) {
6972
- while (1) switch (_context70.prev = _context70.next) {
7061
+ return _regeneratorRuntime().wrap(function _callee71$(_context71) {
7062
+ while (1) switch (_context71.prev = _context71.next) {
6973
7063
  case 0:
6974
- _context70.prev = 0;
7064
+ _context71.prev = 0;
6975
7065
  if (this.store.order) {
6976
- _context70.next = 3;
7066
+ _context71.next = 3;
6977
7067
  break;
6978
7068
  }
6979
7069
  throw new Error('order 模块未初始化');
6980
7070
  case 3:
6981
7071
  if (!(options === undefined)) {
6982
- _context70.next = 9;
7072
+ _context71.next = 9;
6983
7073
  break;
6984
7074
  }
6985
- _context70.next = 6;
7075
+ _context71.next = 6;
6986
7076
  return this.store.order.addProductToOrder(product, booking);
6987
7077
  case 6:
6988
- _context70.t0 = _context70.sent;
6989
- _context70.next = 12;
7078
+ _context71.t0 = _context71.sent;
7079
+ _context71.next = 12;
6990
7080
  break;
6991
7081
  case 9:
6992
- _context70.next = 11;
7082
+ _context71.next = 11;
6993
7083
  return this.store.order.addProductToOrder(product, booking, options);
6994
7084
  case 11:
6995
- _context70.t0 = _context70.sent;
7085
+ _context71.t0 = _context71.sent;
6996
7086
  case 12:
6997
- products = _context70.t0;
6998
- return _context70.abrupt("return", products);
7087
+ products = _context71.t0;
7088
+ return _context71.abrupt("return", products);
6999
7089
  case 16:
7000
- _context70.prev = 16;
7001
- _context70.t1 = _context70["catch"](0);
7002
- throw _context70.t1;
7090
+ _context71.prev = 16;
7091
+ _context71.t1 = _context71["catch"](0);
7092
+ throw _context71.t1;
7003
7093
  case 19:
7004
7094
  case "end":
7005
- return _context70.stop();
7095
+ return _context71.stop();
7006
7096
  }
7007
- }, _callee70, this, [[0, 16]]);
7097
+ }, _callee71, this, [[0, 16]]);
7008
7098
  }));
7009
- function addProductToOrder(_x56, _x57, _x58) {
7099
+ function addProductToOrder(_x58, _x59, _x60) {
7010
7100
  return _addProductToOrder.apply(this, arguments);
7011
7101
  }
7012
7102
  return addProductToOrder;
@@ -7014,34 +7104,34 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
7014
7104
  }, {
7015
7105
  key: "updateOrderProduct",
7016
7106
  value: function () {
7017
- var _updateOrderProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee71(params) {
7107
+ var _updateOrderProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee72(params) {
7018
7108
  var products;
7019
- return _regeneratorRuntime().wrap(function _callee71$(_context71) {
7020
- while (1) switch (_context71.prev = _context71.next) {
7109
+ return _regeneratorRuntime().wrap(function _callee72$(_context72) {
7110
+ while (1) switch (_context72.prev = _context72.next) {
7021
7111
  case 0:
7022
- _context71.prev = 0;
7112
+ _context72.prev = 0;
7023
7113
  if (this.store.order) {
7024
- _context71.next = 3;
7114
+ _context72.next = 3;
7025
7115
  break;
7026
7116
  }
7027
7117
  throw new Error('order 模块未初始化');
7028
7118
  case 3:
7029
- _context71.next = 5;
7119
+ _context72.next = 5;
7030
7120
  return this.store.order.updateOrderProduct(params);
7031
7121
  case 5:
7032
- products = _context71.sent;
7033
- return _context71.abrupt("return", products);
7122
+ products = _context72.sent;
7123
+ return _context72.abrupt("return", products);
7034
7124
  case 9:
7035
- _context71.prev = 9;
7036
- _context71.t0 = _context71["catch"](0);
7037
- throw _context71.t0;
7125
+ _context72.prev = 9;
7126
+ _context72.t0 = _context72["catch"](0);
7127
+ throw _context72.t0;
7038
7128
  case 12:
7039
7129
  case "end":
7040
- return _context71.stop();
7130
+ return _context72.stop();
7041
7131
  }
7042
- }, _callee71, this, [[0, 9]]);
7132
+ }, _callee72, this, [[0, 9]]);
7043
7133
  }));
7044
- function updateOrderProduct(_x59) {
7134
+ function updateOrderProduct(_x61) {
7045
7135
  return _updateOrderProduct.apply(this, arguments);
7046
7136
  }
7047
7137
  return updateOrderProduct;
@@ -7049,34 +7139,34 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
7049
7139
  }, {
7050
7140
  key: "updateOrderProducts",
7051
7141
  value: function () {
7052
- var _updateOrderProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee72(paramsList, options) {
7142
+ var _updateOrderProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee73(paramsList, options) {
7053
7143
  var products;
7054
- return _regeneratorRuntime().wrap(function _callee72$(_context72) {
7055
- while (1) switch (_context72.prev = _context72.next) {
7144
+ return _regeneratorRuntime().wrap(function _callee73$(_context73) {
7145
+ while (1) switch (_context73.prev = _context73.next) {
7056
7146
  case 0:
7057
- _context72.prev = 0;
7147
+ _context73.prev = 0;
7058
7148
  if (this.store.order) {
7059
- _context72.next = 3;
7149
+ _context73.next = 3;
7060
7150
  break;
7061
7151
  }
7062
7152
  throw new Error('order 模块未初始化');
7063
7153
  case 3:
7064
- _context72.next = 5;
7154
+ _context73.next = 5;
7065
7155
  return this.store.order.updateOrderProducts(paramsList, options);
7066
7156
  case 5:
7067
- products = _context72.sent;
7068
- return _context72.abrupt("return", products);
7157
+ products = _context73.sent;
7158
+ return _context73.abrupt("return", products);
7069
7159
  case 9:
7070
- _context72.prev = 9;
7071
- _context72.t0 = _context72["catch"](0);
7072
- throw _context72.t0;
7160
+ _context73.prev = 9;
7161
+ _context73.t0 = _context73["catch"](0);
7162
+ throw _context73.t0;
7073
7163
  case 12:
7074
7164
  case "end":
7075
- return _context72.stop();
7165
+ return _context73.stop();
7076
7166
  }
7077
- }, _callee72, this, [[0, 9]]);
7167
+ }, _callee73, this, [[0, 9]]);
7078
7168
  }));
7079
- function updateOrderProducts(_x60, _x61) {
7169
+ function updateOrderProducts(_x62, _x63) {
7080
7170
  return _updateOrderProducts.apply(this, arguments);
7081
7171
  }
7082
7172
  return updateOrderProducts;
@@ -7084,34 +7174,34 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
7084
7174
  }, {
7085
7175
  key: "updateOrderProductQuantity",
7086
7176
  value: function () {
7087
- var _updateOrderProductQuantity = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee73(params) {
7177
+ var _updateOrderProductQuantity = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee74(params) {
7088
7178
  var products;
7089
- return _regeneratorRuntime().wrap(function _callee73$(_context73) {
7090
- while (1) switch (_context73.prev = _context73.next) {
7179
+ return _regeneratorRuntime().wrap(function _callee74$(_context74) {
7180
+ while (1) switch (_context74.prev = _context74.next) {
7091
7181
  case 0:
7092
- _context73.prev = 0;
7182
+ _context74.prev = 0;
7093
7183
  if (this.store.order) {
7094
- _context73.next = 3;
7184
+ _context74.next = 3;
7095
7185
  break;
7096
7186
  }
7097
7187
  throw new Error('order 模块未初始化');
7098
7188
  case 3:
7099
- _context73.next = 5;
7189
+ _context74.next = 5;
7100
7190
  return this.store.order.updateOrderProductQuantity(params);
7101
7191
  case 5:
7102
- products = _context73.sent;
7103
- return _context73.abrupt("return", products);
7192
+ products = _context74.sent;
7193
+ return _context74.abrupt("return", products);
7104
7194
  case 9:
7105
- _context73.prev = 9;
7106
- _context73.t0 = _context73["catch"](0);
7107
- throw _context73.t0;
7195
+ _context74.prev = 9;
7196
+ _context74.t0 = _context74["catch"](0);
7197
+ throw _context74.t0;
7108
7198
  case 12:
7109
7199
  case "end":
7110
- return _context73.stop();
7200
+ return _context74.stop();
7111
7201
  }
7112
- }, _callee73, this, [[0, 9]]);
7202
+ }, _callee74, this, [[0, 9]]);
7113
7203
  }));
7114
- function updateOrderProductQuantity(_x62) {
7204
+ function updateOrderProductQuantity(_x64) {
7115
7205
  return _updateOrderProductQuantity.apply(this, arguments);
7116
7206
  }
7117
7207
  return updateOrderProductQuantity;
@@ -7134,12 +7224,12 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
7134
7224
  }, {
7135
7225
  key: "setOrderProductLineNote",
7136
7226
  value: (function () {
7137
- var _setOrderProductLineNote = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee74(identity, note) {
7227
+ var _setOrderProductLineNote = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee75(identity, note) {
7138
7228
  var params, products;
7139
- return _regeneratorRuntime().wrap(function _callee74$(_context74) {
7140
- while (1) switch (_context74.prev = _context74.next) {
7229
+ return _regeneratorRuntime().wrap(function _callee75$(_context75) {
7230
+ while (1) switch (_context75.prev = _context75.next) {
7141
7231
  case 0:
7142
- _context74.prev = 0;
7232
+ _context75.prev = 0;
7143
7233
  params = {
7144
7234
  product_id: identity.product_id,
7145
7235
  product_variant_id: identity.product_variant_id,
@@ -7154,22 +7244,22 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
7154
7244
  params.product_sku = identity.product_sku;
7155
7245
  }
7156
7246
  if (identity.product_bundle !== undefined) params.product_bundle = identity.product_bundle;
7157
- _context74.next = 7;
7247
+ _context75.next = 7;
7158
7248
  return this.updateOrderProduct(params);
7159
7249
  case 7:
7160
- products = _context74.sent;
7161
- return _context74.abrupt("return", products);
7250
+ products = _context75.sent;
7251
+ return _context75.abrupt("return", products);
7162
7252
  case 11:
7163
- _context74.prev = 11;
7164
- _context74.t0 = _context74["catch"](0);
7165
- throw _context74.t0;
7253
+ _context75.prev = 11;
7254
+ _context75.t0 = _context75["catch"](0);
7255
+ throw _context75.t0;
7166
7256
  case 14:
7167
7257
  case "end":
7168
- return _context74.stop();
7258
+ return _context75.stop();
7169
7259
  }
7170
- }, _callee74, this, [[0, 11]]);
7260
+ }, _callee75, this, [[0, 11]]);
7171
7261
  }));
7172
- function setOrderProductLineNote(_x63, _x64) {
7262
+ function setOrderProductLineNote(_x65, _x66) {
7173
7263
  return _setOrderProductLineNote.apply(this, arguments);
7174
7264
  }
7175
7265
  return setOrderProductLineNote;
@@ -7184,45 +7274,45 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
7184
7274
  }, {
7185
7275
  key: "removeProductsFromOrder",
7186
7276
  value: (function () {
7187
- var _removeProductsFromOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee75(identities, options) {
7188
- return _regeneratorRuntime().wrap(function _callee75$(_context75) {
7189
- while (1) switch (_context75.prev = _context75.next) {
7277
+ var _removeProductsFromOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee76(identities, options) {
7278
+ return _regeneratorRuntime().wrap(function _callee76$(_context76) {
7279
+ while (1) switch (_context76.prev = _context76.next) {
7190
7280
  case 0:
7191
- _context75.prev = 0;
7281
+ _context76.prev = 0;
7192
7282
  if (this.store.order) {
7193
- _context75.next = 3;
7283
+ _context76.next = 3;
7194
7284
  break;
7195
7285
  }
7196
7286
  throw new Error('order 模块未初始化');
7197
7287
  case 3:
7198
7288
  if (!(options === undefined)) {
7199
- _context75.next = 9;
7289
+ _context76.next = 9;
7200
7290
  break;
7201
7291
  }
7202
- _context75.next = 6;
7292
+ _context76.next = 6;
7203
7293
  return this.store.order.removeProductsFromOrder(identities);
7204
7294
  case 6:
7205
- _context75.t0 = _context75.sent;
7206
- _context75.next = 12;
7295
+ _context76.t0 = _context76.sent;
7296
+ _context76.next = 12;
7207
7297
  break;
7208
7298
  case 9:
7209
- _context75.next = 11;
7299
+ _context76.next = 11;
7210
7300
  return this.store.order.removeProductsFromOrder(identities, options);
7211
7301
  case 11:
7212
- _context75.t0 = _context75.sent;
7302
+ _context76.t0 = _context76.sent;
7213
7303
  case 12:
7214
- return _context75.abrupt("return", _context75.t0);
7304
+ return _context76.abrupt("return", _context76.t0);
7215
7305
  case 15:
7216
- _context75.prev = 15;
7217
- _context75.t1 = _context75["catch"](0);
7218
- throw _context75.t1;
7306
+ _context76.prev = 15;
7307
+ _context76.t1 = _context76["catch"](0);
7308
+ throw _context76.t1;
7219
7309
  case 18:
7220
7310
  case "end":
7221
- return _context75.stop();
7311
+ return _context76.stop();
7222
7312
  }
7223
- }, _callee75, this, [[0, 15]]);
7313
+ }, _callee76, this, [[0, 15]]);
7224
7314
  }));
7225
- function removeProductsFromOrder(_x65, _x66) {
7315
+ function removeProductsFromOrder(_x67, _x68) {
7226
7316
  return _removeProductsFromOrder.apply(this, arguments);
7227
7317
  }
7228
7318
  return removeProductsFromOrder;
@@ -7230,18 +7320,18 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
7230
7320
  }, {
7231
7321
  key: "removeProductFromOrder",
7232
7322
  value: function () {
7233
- var _removeProductFromOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee76(identity, options) {
7234
- return _regeneratorRuntime().wrap(function _callee76$(_context76) {
7235
- while (1) switch (_context76.prev = _context76.next) {
7323
+ var _removeProductFromOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee77(identity, options) {
7324
+ return _regeneratorRuntime().wrap(function _callee77$(_context77) {
7325
+ while (1) switch (_context77.prev = _context77.next) {
7236
7326
  case 0:
7237
- return _context76.abrupt("return", this.removeProductsFromOrder([identity], options));
7327
+ return _context77.abrupt("return", this.removeProductsFromOrder([identity], options));
7238
7328
  case 1:
7239
7329
  case "end":
7240
- return _context76.stop();
7330
+ return _context77.stop();
7241
7331
  }
7242
- }, _callee76, this);
7332
+ }, _callee77, this);
7243
7333
  }));
7244
- function removeProductFromOrder(_x67, _x68) {
7334
+ function removeProductFromOrder(_x69, _x70) {
7245
7335
  return _removeProductFromOrder.apply(this, arguments);
7246
7336
  }
7247
7337
  return removeProductFromOrder;
@@ -7291,23 +7381,23 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
7291
7381
  }, {
7292
7382
  key: "applyPromotion",
7293
7383
  value: (function () {
7294
- var _applyPromotion = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee77() {
7295
- return _regeneratorRuntime().wrap(function _callee77$(_context77) {
7296
- while (1) switch (_context77.prev = _context77.next) {
7384
+ var _applyPromotion = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee78() {
7385
+ return _regeneratorRuntime().wrap(function _callee78$(_context78) {
7386
+ while (1) switch (_context78.prev = _context78.next) {
7297
7387
  case 0:
7298
7388
  if (this.store.order) {
7299
- _context77.next = 2;
7389
+ _context78.next = 2;
7300
7390
  break;
7301
7391
  }
7302
7392
  throw new Error('order 模块未初始化');
7303
7393
  case 2:
7304
- _context77.next = 4;
7394
+ _context78.next = 4;
7305
7395
  return this.store.order.applyPromotion();
7306
7396
  case 4:
7307
7397
  case "end":
7308
- return _context77.stop();
7398
+ return _context78.stop();
7309
7399
  }
7310
- }, _callee77, this);
7400
+ }, _callee78, this);
7311
7401
  }));
7312
7402
  function applyPromotion() {
7313
7403
  return _applyPromotion.apply(this, arguments);
@@ -7334,18 +7424,18 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
7334
7424
  }, {
7335
7425
  key: "getProductList",
7336
7426
  value: function () {
7337
- var _getProductList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee78() {
7427
+ var _getProductList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee79() {
7338
7428
  var _this$otherParams41;
7339
7429
  var menu_list_ids, _this$store$products, res;
7340
- return _regeneratorRuntime().wrap(function _callee78$(_context78) {
7341
- while (1) switch (_context78.prev = _context78.next) {
7430
+ return _regeneratorRuntime().wrap(function _callee79$(_context79) {
7431
+ while (1) switch (_context79.prev = _context79.next) {
7342
7432
  case 0:
7343
7433
  // 可以直接通过配置里的 menu 读取
7344
7434
  menu_list_ids = ((_this$otherParams41 = this.otherParams) === null || _this$otherParams41 === void 0 || (_this$otherParams41 = _this$otherParams41.dineInConfig) === null || _this$otherParams41 === void 0 ? void 0 : _this$otherParams41['menu.associated_menus'].map(function (n) {
7345
7435
  return Number(n.value);
7346
7436
  })) || [];
7347
- _context78.prev = 1;
7348
- _context78.next = 4;
7437
+ _context79.prev = 1;
7438
+ _context79.next = 4;
7349
7439
  return (_this$store$products = this.store.products) === null || _this$store$products === void 0 ? void 0 : _this$store$products.loadProducts({
7350
7440
  menu_list_ids: menu_list_ids,
7351
7441
  cacheId: this.cacheId,
@@ -7353,17 +7443,17 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
7353
7443
  schedule_datetime: dayjs().format('YYYY-MM-DD HH:mm:ss')
7354
7444
  });
7355
7445
  case 4:
7356
- res = _context78.sent;
7357
- return _context78.abrupt("return", res);
7446
+ res = _context79.sent;
7447
+ return _context79.abrupt("return", res);
7358
7448
  case 8:
7359
- _context78.prev = 8;
7360
- _context78.t0 = _context78["catch"](1);
7361
- throw _context78.t0;
7449
+ _context79.prev = 8;
7450
+ _context79.t0 = _context79["catch"](1);
7451
+ throw _context79.t0;
7362
7452
  case 11:
7363
7453
  case "end":
7364
- return _context78.stop();
7454
+ return _context79.stop();
7365
7455
  }
7366
- }, _callee78, this, [[1, 8]]);
7456
+ }, _callee79, this, [[1, 8]]);
7367
7457
  }));
7368
7458
  function getProductList() {
7369
7459
  return _getProductList.apply(this, arguments);
@@ -7378,17 +7468,17 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
7378
7468
  }, {
7379
7469
  key: "setOtherParams",
7380
7470
  value: function () {
7381
- var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee79(params) {
7471
+ var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee80(params) {
7382
7472
  var _this$otherParams42;
7383
7473
  var _ref57,
7384
7474
  _ref57$cover,
7385
7475
  cover,
7386
7476
  previousPickupTimingScope,
7387
- _args79 = arguments;
7388
- return _regeneratorRuntime().wrap(function _callee79$(_context79) {
7389
- while (1) switch (_context79.prev = _context79.next) {
7477
+ _args80 = arguments;
7478
+ return _regeneratorRuntime().wrap(function _callee80$(_context80) {
7479
+ while (1) switch (_context80.prev = _context80.next) {
7390
7480
  case 0:
7391
- _ref57 = _args79.length > 1 && _args79[1] !== undefined ? _args79[1] : {}, _ref57$cover = _ref57.cover, cover = _ref57$cover === void 0 ? false : _ref57$cover;
7481
+ _ref57 = _args80.length > 1 && _args80[1] !== undefined ? _args80[1] : {}, _ref57$cover = _ref57.cover, cover = _ref57$cover === void 0 ? false : _ref57$cover;
7392
7482
  previousPickupTimingScope = this.getPickupTimingScope();
7393
7483
  if (cover) {
7394
7484
  this.otherParams = _objectSpread({}, params);
@@ -7397,17 +7487,17 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
7397
7487
  }
7398
7488
  this.cacheId = (_this$otherParams42 = this.otherParams) === null || _this$otherParams42 === void 0 ? void 0 : _this$otherParams42.cacheId;
7399
7489
  if (previousPickupTimingScope !== this.getPickupTimingScope()) this.resetPickupTimingCache();
7400
- _context79.next = 7;
7490
+ _context80.next = 7;
7401
7491
  return this.syncOtherParamsToSubModules(params, {
7402
7492
  cover: cover
7403
7493
  });
7404
7494
  case 7:
7405
7495
  case "end":
7406
- return _context79.stop();
7496
+ return _context80.stop();
7407
7497
  }
7408
- }, _callee79, this);
7498
+ }, _callee80, this);
7409
7499
  }));
7410
- function setOtherParams(_x69) {
7500
+ function setOtherParams(_x71) {
7411
7501
  return _setOtherParams.apply(this, arguments);
7412
7502
  }
7413
7503
  return setOtherParams;