@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.
- package/dist/apis/picoding.d.ts +0 -0
- package/dist/effects/index.d.ts +19 -0
- package/dist/model/strategy/adapter/dataVariant/adapter.d.ts +50 -0
- package/dist/model/strategy/adapter/dataVariant/evaluator.d.ts +105 -0
- package/dist/model/strategy/adapter/dataVariant/examples.d.ts +39 -0
- package/dist/model/strategy/adapter/dataVariant/index.d.ts +4 -0
- package/dist/model/strategy/adapter/dataVariant/type.d.ts +173 -0
- package/dist/model/strategy/adapter/promotion/adapter.d.ts +70 -0
- package/dist/model/strategy/adapter/promotion/examples.d.ts +224 -0
- package/dist/model/strategy/adapter/promotion/index.js +0 -9
- package/dist/model/strategy/adapter/promotion/type.d.ts +535 -0
- package/dist/model/strategy/adapter/type.d.ts +28 -0
- package/dist/model/strategy/adapter/walletPass/index.d.ts +32 -0
- package/dist/model/strategy/adapter/walletPass/locales.d.ts +1 -0
- package/dist/model/strategy/adapter/walletPass/type.d.ts +192 -0
- package/dist/model/strategy/adapter/walletPass/utils.d.ts +50 -0
- package/dist/model/strategy/engine.d.ts +119 -0
- package/dist/model/strategy/type.d.ts +245 -0
- package/dist/modules/Account/types.d.ts +56 -0
- package/dist/modules/BookingContext/types.d.ts +104 -0
- package/dist/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +76 -0
- package/dist/modules/BookingContext/utils/flexible.d.ts +28 -0
- package/dist/modules/BookingContext/utils/formatResourceList.d.ts +8 -0
- package/dist/modules/BookingContext/utils/noResource.d.ts +13 -0
- package/dist/modules/BookingContext/utils/orderLineDisplay.d.ts +1 -0
- package/dist/modules/BookingContext/utils/resourceErrors.d.ts +41 -0
- package/dist/modules/BookingContext/utils/resourceSelection.d.ts +7 -0
- package/dist/modules/BookingContext/utils/serviceTimes.d.ts +55 -0
- package/dist/modules/BookingContext/utils/timeSlices.d.ts +42 -0
- package/dist/modules/Customer/constants.d.ts +7 -0
- package/dist/modules/Date/types.d.ts +84 -0
- package/dist/modules/Date/utils.d.ts +36 -0
- package/dist/modules/FulfillmentTiming/index.d.ts +11 -0
- package/dist/modules/FulfillmentTiming/types.d.ts +67 -0
- package/dist/modules/Order/payment-utils.d.ts +26 -0
- package/dist/modules/Order/pickupTiming.d.ts +46 -0
- package/dist/modules/Order/utils/manualProductDiscount.d.ts +106 -0
- package/dist/modules/Order/utils/orderCollectionIdentity.d.ts +68 -0
- package/dist/modules/Order/utils/weighedProduct.d.ts +12 -0
- package/dist/modules/Payment/cashRecommendationAlgorithm.d.ts +21 -0
- package/dist/modules/Payment/mx51.d.ts +0 -0
- package/dist/modules/Payment/types.d.ts +943 -0
- package/dist/modules/Payment/utils.d.ts +19 -0
- package/dist/modules/Product/index.d.ts +1 -1
- package/dist/modules/ProductList/index.d.ts +2 -0
- package/dist/modules/ProductList/index.js +125 -39
- package/dist/modules/Quotation/types.d.ts +61 -0
- package/dist/modules/Resource/types.d.ts +50 -0
- package/dist/modules/Resource/utils.d.ts +23 -0
- package/dist/modules/ResourcePlanner/localClock.d.ts +33 -0
- package/dist/modules/ResourcePlanner/planner.js +5 -0
- package/dist/modules/SalesSummary/types.d.ts +69 -0
- package/dist/modules/ScanOrderLogger/providers/feishu.d.ts +2 -0
- package/dist/modules/ScanOrderLogger/providers/grafana.d.ts +2 -0
- package/dist/modules/ScanOrderLogger/types.d.ts +53 -0
- package/dist/modules/Schedule/getDateIsInSchedule.d.ts +32 -0
- package/dist/modules/Schedule/type.d.ts +157 -0
- package/dist/modules/Schedule/types.d.ts +201 -0
- package/dist/modules/Schedule/utils.d.ts +67 -0
- package/dist/modules/Step/tyeps.d.ts +20 -0
- package/dist/modules/SurchargeList/types.d.ts +15 -0
- package/dist/plugins/app.d.ts +10 -0
- package/dist/plugins/shopStore.d.ts +4 -0
- package/dist/plugins/user.d.ts +7 -0
- package/dist/server/modules/floor-plan/types.d.ts +43 -0
- package/dist/server/modules/menu/types.d.ts +68 -0
- package/dist/server/modules/payment/types.d.ts +9 -0
- package/dist/server/modules/quotation/types.d.ts +50 -0
- package/dist/server/modules/resource/types.d.ts +121 -0
- package/dist/server/modules/schedule/types.d.ts +1 -0
- package/dist/server/modules/schedule/utils.d.ts +32 -0
- package/dist/server/types.d.ts +66 -0
- package/dist/server/utils/index.d.ts +5 -0
- package/dist/server/utils/schedule.d.ts +14 -0
- package/dist/server/utils/time.d.ts +18 -0
- package/dist/solution/BaseSales/index.d.ts +12 -1
- package/dist/solution/BaseSales/index.js +275 -185
- package/dist/solution/BookingByStep/index.d.ts +2 -2
- package/dist/solution/BookingTicket/index.d.ts +1 -13
- package/dist/solution/BookingTicket/utils/bookingStatus.d.ts +77 -0
- package/dist/solution/BookingTicket/utils/exampleData.d.ts +123 -0
- package/dist/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +185 -0
- package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +38 -0
- package/dist/solution/BookingTicket/utils/scan/scanCache.d.ts +78 -0
- package/dist/solution/BookingTicket/utils/scan/scanProductValues.d.ts +21 -0
- package/dist/solution/BookingTicket/utils/weighingProductSku.d.ts +5 -0
- package/dist/solution/PlaceOrder/index.d.ts +0 -0
- package/dist/solution/RegisterAndLogin/config.d.ts +93 -0
- package/dist/solution/RegisterAndLogin/types.d.ts +445 -0
- package/dist/solution/RegisterAndLogin/utils.d.ts +103 -0
- package/dist/solution/UnifiedBookingSales/index.d.ts +23 -1
- package/dist/solution/UnifiedBookingSales/index.js +1367 -646
- package/dist/solution/UnifiedBookingSales/remoteOccupancyCache.d.ts +2 -0
- package/dist/solution/UnifiedBookingSales/remoteOccupancyCache.js +4 -0
- package/dist/solution/UnifiedBookingSales/sessionResourceCache.d.ts +27 -0
- package/dist/solution/UnifiedBookingSales/sessionResourceCache.js +271 -0
- package/dist/solution/UnifiedBookingSales/types.d.ts +25 -0
- package/dist/solution/UnifiedBookingSales/types.js +2 -0
- package/dist/solution/UnifiedBookingSales/venueCatalogSession.d.ts +32 -0
- package/dist/solution/UnifiedBookingSales/venueCatalogSession.js +277 -0
- package/dist/store/createStore.d.ts +3 -0
- package/dist/types/index.d.ts +132 -0
- package/dist/utils/os-private-payload.d.ts +5 -0
- package/dist/utils/payment-number.d.ts +9 -0
- package/dist/utils/task.d.ts +40 -0
- package/dist/utils/watch.d.ts +102 -0
- package/lib/apis/picoding.d.ts +0 -0
- package/lib/effects/index.d.ts +19 -0
- package/lib/model/strategy/adapter/dataVariant/adapter.d.ts +50 -0
- package/lib/model/strategy/adapter/dataVariant/evaluator.d.ts +105 -0
- package/lib/model/strategy/adapter/dataVariant/examples.d.ts +39 -0
- package/lib/model/strategy/adapter/dataVariant/index.d.ts +4 -0
- package/lib/model/strategy/adapter/dataVariant/type.d.ts +173 -0
- package/lib/model/strategy/adapter/promotion/adapter.d.ts +70 -0
- package/lib/model/strategy/adapter/promotion/examples.d.ts +224 -0
- package/lib/model/strategy/adapter/promotion/type.d.ts +535 -0
- package/lib/model/strategy/adapter/type.d.ts +28 -0
- package/lib/model/strategy/adapter/walletPass/index.d.ts +32 -0
- package/lib/model/strategy/adapter/walletPass/locales.d.ts +1 -0
- package/lib/model/strategy/adapter/walletPass/type.d.ts +192 -0
- package/lib/model/strategy/adapter/walletPass/utils.d.ts +50 -0
- package/lib/model/strategy/engine.d.ts +119 -0
- package/lib/model/strategy/type.d.ts +245 -0
- package/lib/modules/Account/types.d.ts +56 -0
- package/lib/modules/BookingContext/types.d.ts +104 -0
- package/lib/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +76 -0
- package/lib/modules/BookingContext/utils/flexible.d.ts +28 -0
- package/lib/modules/BookingContext/utils/formatResourceList.d.ts +8 -0
- package/lib/modules/BookingContext/utils/noResource.d.ts +13 -0
- package/lib/modules/BookingContext/utils/orderLineDisplay.d.ts +1 -0
- package/lib/modules/BookingContext/utils/resourceErrors.d.ts +41 -0
- package/lib/modules/BookingContext/utils/resourceSelection.d.ts +7 -0
- package/lib/modules/BookingContext/utils/serviceTimes.d.ts +55 -0
- package/lib/modules/BookingContext/utils/timeSlices.d.ts +42 -0
- package/lib/modules/Customer/constants.d.ts +7 -0
- package/lib/modules/Date/types.d.ts +84 -0
- package/lib/modules/Date/utils.d.ts +36 -0
- package/lib/modules/FulfillmentTiming/index.d.ts +11 -0
- package/lib/modules/FulfillmentTiming/types.d.ts +67 -0
- package/lib/modules/Order/payment-utils.d.ts +26 -0
- package/lib/modules/Order/pickupTiming.d.ts +46 -0
- package/lib/modules/Order/utils/manualProductDiscount.d.ts +106 -0
- package/lib/modules/Order/utils/orderCollectionIdentity.d.ts +68 -0
- package/lib/modules/Order/utils/weighedProduct.d.ts +12 -0
- package/lib/modules/Payment/cashRecommendationAlgorithm.d.ts +21 -0
- package/lib/modules/Payment/mx51.d.ts +0 -0
- package/lib/modules/Payment/types.d.ts +943 -0
- package/lib/modules/Payment/utils.d.ts +19 -0
- package/lib/modules/Product/index.d.ts +1 -1
- package/lib/modules/ProductList/index.d.ts +2 -0
- package/lib/modules/ProductList/index.js +56 -0
- package/lib/modules/Quotation/types.d.ts +61 -0
- package/lib/modules/Resource/types.d.ts +50 -0
- package/lib/modules/Resource/utils.d.ts +23 -0
- package/lib/modules/ResourcePlanner/localClock.d.ts +33 -0
- package/lib/modules/ResourcePlanner/planner.js +4 -0
- package/lib/modules/SalesSummary/types.d.ts +69 -0
- package/lib/modules/ScanOrderLogger/providers/feishu.d.ts +2 -0
- package/lib/modules/ScanOrderLogger/providers/grafana.d.ts +2 -0
- package/lib/modules/ScanOrderLogger/types.d.ts +53 -0
- package/lib/modules/Schedule/getDateIsInSchedule.d.ts +32 -0
- package/lib/modules/Schedule/type.d.ts +157 -0
- package/lib/modules/Schedule/types.d.ts +201 -0
- package/lib/modules/Schedule/utils.d.ts +67 -0
- package/lib/modules/Step/tyeps.d.ts +20 -0
- package/lib/modules/SurchargeList/types.d.ts +15 -0
- package/lib/plugins/app.d.ts +10 -0
- package/lib/plugins/shopStore.d.ts +4 -0
- package/lib/plugins/user.d.ts +7 -0
- package/lib/server/modules/floor-plan/types.d.ts +43 -0
- package/lib/server/modules/menu/types.d.ts +68 -0
- package/lib/server/modules/payment/types.d.ts +9 -0
- package/lib/server/modules/quotation/types.d.ts +50 -0
- package/lib/server/modules/resource/types.d.ts +121 -0
- package/lib/server/modules/schedule/types.d.ts +1 -0
- package/lib/server/modules/schedule/utils.d.ts +32 -0
- package/lib/server/types.d.ts +66 -0
- package/lib/server/utils/index.d.ts +5 -0
- package/lib/server/utils/schedule.d.ts +14 -0
- package/lib/server/utils/time.d.ts +18 -0
- package/lib/solution/BaseSales/index.d.ts +12 -1
- package/lib/solution/BaseSales/index.js +65 -0
- package/lib/solution/BookingByStep/index.d.ts +2 -2
- package/lib/solution/BookingTicket/index.d.ts +1 -13
- package/lib/solution/BookingTicket/utils/bookingStatus.d.ts +77 -0
- package/lib/solution/BookingTicket/utils/exampleData.d.ts +123 -0
- package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +185 -0
- package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +38 -0
- package/lib/solution/BookingTicket/utils/scan/scanCache.d.ts +78 -0
- package/lib/solution/BookingTicket/utils/scan/scanProductValues.d.ts +21 -0
- package/lib/solution/BookingTicket/utils/weighingProductSku.d.ts +5 -0
- package/lib/solution/PlaceOrder/index.d.ts +0 -0
- package/lib/solution/RegisterAndLogin/config.d.ts +93 -0
- package/lib/solution/RegisterAndLogin/types.d.ts +445 -0
- package/lib/solution/RegisterAndLogin/utils.d.ts +103 -0
- package/lib/solution/UnifiedBookingSales/index.d.ts +23 -1
- package/lib/solution/UnifiedBookingSales/index.js +399 -14
- package/lib/solution/UnifiedBookingSales/remoteOccupancyCache.d.ts +2 -0
- package/lib/solution/UnifiedBookingSales/remoteOccupancyCache.js +2 -0
- package/lib/solution/UnifiedBookingSales/sessionResourceCache.d.ts +27 -0
- package/lib/solution/UnifiedBookingSales/sessionResourceCache.js +199 -0
- package/lib/solution/UnifiedBookingSales/types.d.ts +25 -0
- package/lib/solution/UnifiedBookingSales/types.js +1 -0
- package/lib/solution/UnifiedBookingSales/venueCatalogSession.d.ts +32 -0
- package/lib/solution/UnifiedBookingSales/venueCatalogSession.js +151 -0
- package/lib/store/createStore.d.ts +3 -0
- package/lib/types/index.d.ts +132 -0
- package/lib/utils/os-private-payload.d.ts +5 -0
- package/lib/utils/payment-number.d.ts +9 -0
- package/lib/utils/task.d.ts +40 -0
- package/lib/utils/watch.d.ts +102 -0
- 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
|
-
},
|
|
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 =
|
|
1622
|
+
_context12.next = 17;
|
|
1587
1623
|
break;
|
|
1588
1624
|
}
|
|
1589
1625
|
if (this.request) {
|
|
1590
|
-
_context12.next =
|
|
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
|
|
1597
|
-
_context12.next =
|
|
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
|
|
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
|
|
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 =
|
|
1665
|
+
_context12.next = 23;
|
|
1630
1666
|
break;
|
|
1631
1667
|
}
|
|
1632
1668
|
return _context12.abrupt("return", authoritativeProducts);
|
|
1633
|
-
case
|
|
1669
|
+
case 23:
|
|
1634
1670
|
if (this.request) {
|
|
1635
|
-
_context12.next =
|
|
1671
|
+
_context12.next = 25;
|
|
1636
1672
|
break;
|
|
1637
1673
|
}
|
|
1638
1674
|
return _context12.abrupt("return", authoritativeProducts);
|
|
1639
|
-
case
|
|
1640
|
-
_context12.next =
|
|
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
|
|
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
|
|
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: "
|
|
6699
|
-
value: function () {
|
|
6700
|
-
var
|
|
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
|
|
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$
|
|
6709
|
-
|
|
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
|
-
|
|
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 =
|
|
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
|
-
|
|
6816
|
+
_context68.next = 15;
|
|
6727
6817
|
break;
|
|
6728
6818
|
}
|
|
6729
|
-
|
|
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
|
|
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
|
|
6835
|
+
return _context68.stop();
|
|
6746
6836
|
}
|
|
6747
|
-
},
|
|
6837
|
+
}, _callee68, this);
|
|
6748
6838
|
}));
|
|
6749
|
-
function calculateProductBookingPrice(
|
|
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
|
|
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
|
|
6837
|
-
while (1) switch (
|
|
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
|
-
|
|
6930
|
+
_context70.next = 2;
|
|
6841
6931
|
break;
|
|
6842
6932
|
}
|
|
6843
|
-
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$
|
|
6946
|
+
var _params$customer_id3;
|
|
6857
6947
|
var schedule = _this22.getPriceQuerySchedule(params);
|
|
6858
6948
|
var channel = resolvedChannels[index];
|
|
6859
|
-
var customerId = (_params$
|
|
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
|
-
|
|
6960
|
+
_context70.next = 11;
|
|
6871
6961
|
return Promise.all(Array.from(groups.values()).map( /*#__PURE__*/function () {
|
|
6872
|
-
var _ref56 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
6962
|
+
var _ref56 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee69(group) {
|
|
6873
6963
|
var priceQueries, resolvedProducts;
|
|
6874
|
-
return _regeneratorRuntime().wrap(function
|
|
6875
|
-
while (1) switch (
|
|
6964
|
+
return _regeneratorRuntime().wrap(function _callee69$(_context69) {
|
|
6965
|
+
while (1) switch (_context69.prev = _context69.next) {
|
|
6876
6966
|
case 0:
|
|
6877
|
-
|
|
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
|
-
|
|
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 =
|
|
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
|
|
6987
|
+
return _context69.stop();
|
|
6898
6988
|
}
|
|
6899
|
-
},
|
|
6989
|
+
}, _callee69);
|
|
6900
6990
|
}));
|
|
6901
|
-
return function (
|
|
6991
|
+
return function (_x57) {
|
|
6902
6992
|
return _ref56.apply(this, arguments);
|
|
6903
6993
|
};
|
|
6904
6994
|
}()));
|
|
6905
6995
|
case 11:
|
|
6906
6996
|
if (useCustomerUserPricing) {
|
|
6907
|
-
|
|
6997
|
+
_context70.next = 16;
|
|
6908
6998
|
break;
|
|
6909
6999
|
}
|
|
6910
7000
|
quotationContexts = new Map();
|
|
6911
7001
|
paramsList.forEach(function (params, index) {
|
|
6912
|
-
var _params$
|
|
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$
|
|
7008
|
+
customer_id: (_params$customer_id4 = params.customer_id) !== null && _params$customer_id4 !== void 0 ? _params$customer_id4 : currentOrderCustomerId
|
|
6919
7009
|
});
|
|
6920
7010
|
});
|
|
6921
|
-
|
|
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
|
|
6929
|
-
var _params$
|
|
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$
|
|
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
|
|
7035
|
+
return _context70.stop();
|
|
6946
7036
|
}
|
|
6947
|
-
},
|
|
7037
|
+
}, _callee70, this);
|
|
6948
7038
|
}));
|
|
6949
|
-
function calculateProductBookingPrices(
|
|
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
|
|
7059
|
+
var _addProductToOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee71(product, booking, options) {
|
|
6970
7060
|
var products;
|
|
6971
|
-
return _regeneratorRuntime().wrap(function
|
|
6972
|
-
while (1) switch (
|
|
7061
|
+
return _regeneratorRuntime().wrap(function _callee71$(_context71) {
|
|
7062
|
+
while (1) switch (_context71.prev = _context71.next) {
|
|
6973
7063
|
case 0:
|
|
6974
|
-
|
|
7064
|
+
_context71.prev = 0;
|
|
6975
7065
|
if (this.store.order) {
|
|
6976
|
-
|
|
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
|
-
|
|
7072
|
+
_context71.next = 9;
|
|
6983
7073
|
break;
|
|
6984
7074
|
}
|
|
6985
|
-
|
|
7075
|
+
_context71.next = 6;
|
|
6986
7076
|
return this.store.order.addProductToOrder(product, booking);
|
|
6987
7077
|
case 6:
|
|
6988
|
-
|
|
6989
|
-
|
|
7078
|
+
_context71.t0 = _context71.sent;
|
|
7079
|
+
_context71.next = 12;
|
|
6990
7080
|
break;
|
|
6991
7081
|
case 9:
|
|
6992
|
-
|
|
7082
|
+
_context71.next = 11;
|
|
6993
7083
|
return this.store.order.addProductToOrder(product, booking, options);
|
|
6994
7084
|
case 11:
|
|
6995
|
-
|
|
7085
|
+
_context71.t0 = _context71.sent;
|
|
6996
7086
|
case 12:
|
|
6997
|
-
products =
|
|
6998
|
-
return
|
|
7087
|
+
products = _context71.t0;
|
|
7088
|
+
return _context71.abrupt("return", products);
|
|
6999
7089
|
case 16:
|
|
7000
|
-
|
|
7001
|
-
|
|
7002
|
-
throw
|
|
7090
|
+
_context71.prev = 16;
|
|
7091
|
+
_context71.t1 = _context71["catch"](0);
|
|
7092
|
+
throw _context71.t1;
|
|
7003
7093
|
case 19:
|
|
7004
7094
|
case "end":
|
|
7005
|
-
return
|
|
7095
|
+
return _context71.stop();
|
|
7006
7096
|
}
|
|
7007
|
-
},
|
|
7097
|
+
}, _callee71, this, [[0, 16]]);
|
|
7008
7098
|
}));
|
|
7009
|
-
function addProductToOrder(
|
|
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
|
|
7107
|
+
var _updateOrderProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee72(params) {
|
|
7018
7108
|
var products;
|
|
7019
|
-
return _regeneratorRuntime().wrap(function
|
|
7020
|
-
while (1) switch (
|
|
7109
|
+
return _regeneratorRuntime().wrap(function _callee72$(_context72) {
|
|
7110
|
+
while (1) switch (_context72.prev = _context72.next) {
|
|
7021
7111
|
case 0:
|
|
7022
|
-
|
|
7112
|
+
_context72.prev = 0;
|
|
7023
7113
|
if (this.store.order) {
|
|
7024
|
-
|
|
7114
|
+
_context72.next = 3;
|
|
7025
7115
|
break;
|
|
7026
7116
|
}
|
|
7027
7117
|
throw new Error('order 模块未初始化');
|
|
7028
7118
|
case 3:
|
|
7029
|
-
|
|
7119
|
+
_context72.next = 5;
|
|
7030
7120
|
return this.store.order.updateOrderProduct(params);
|
|
7031
7121
|
case 5:
|
|
7032
|
-
products =
|
|
7033
|
-
return
|
|
7122
|
+
products = _context72.sent;
|
|
7123
|
+
return _context72.abrupt("return", products);
|
|
7034
7124
|
case 9:
|
|
7035
|
-
|
|
7036
|
-
|
|
7037
|
-
throw
|
|
7125
|
+
_context72.prev = 9;
|
|
7126
|
+
_context72.t0 = _context72["catch"](0);
|
|
7127
|
+
throw _context72.t0;
|
|
7038
7128
|
case 12:
|
|
7039
7129
|
case "end":
|
|
7040
|
-
return
|
|
7130
|
+
return _context72.stop();
|
|
7041
7131
|
}
|
|
7042
|
-
},
|
|
7132
|
+
}, _callee72, this, [[0, 9]]);
|
|
7043
7133
|
}));
|
|
7044
|
-
function updateOrderProduct(
|
|
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
|
|
7142
|
+
var _updateOrderProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee73(paramsList, options) {
|
|
7053
7143
|
var products;
|
|
7054
|
-
return _regeneratorRuntime().wrap(function
|
|
7055
|
-
while (1) switch (
|
|
7144
|
+
return _regeneratorRuntime().wrap(function _callee73$(_context73) {
|
|
7145
|
+
while (1) switch (_context73.prev = _context73.next) {
|
|
7056
7146
|
case 0:
|
|
7057
|
-
|
|
7147
|
+
_context73.prev = 0;
|
|
7058
7148
|
if (this.store.order) {
|
|
7059
|
-
|
|
7149
|
+
_context73.next = 3;
|
|
7060
7150
|
break;
|
|
7061
7151
|
}
|
|
7062
7152
|
throw new Error('order 模块未初始化');
|
|
7063
7153
|
case 3:
|
|
7064
|
-
|
|
7154
|
+
_context73.next = 5;
|
|
7065
7155
|
return this.store.order.updateOrderProducts(paramsList, options);
|
|
7066
7156
|
case 5:
|
|
7067
|
-
products =
|
|
7068
|
-
return
|
|
7157
|
+
products = _context73.sent;
|
|
7158
|
+
return _context73.abrupt("return", products);
|
|
7069
7159
|
case 9:
|
|
7070
|
-
|
|
7071
|
-
|
|
7072
|
-
throw
|
|
7160
|
+
_context73.prev = 9;
|
|
7161
|
+
_context73.t0 = _context73["catch"](0);
|
|
7162
|
+
throw _context73.t0;
|
|
7073
7163
|
case 12:
|
|
7074
7164
|
case "end":
|
|
7075
|
-
return
|
|
7165
|
+
return _context73.stop();
|
|
7076
7166
|
}
|
|
7077
|
-
},
|
|
7167
|
+
}, _callee73, this, [[0, 9]]);
|
|
7078
7168
|
}));
|
|
7079
|
-
function updateOrderProducts(
|
|
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
|
|
7177
|
+
var _updateOrderProductQuantity = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee74(params) {
|
|
7088
7178
|
var products;
|
|
7089
|
-
return _regeneratorRuntime().wrap(function
|
|
7090
|
-
while (1) switch (
|
|
7179
|
+
return _regeneratorRuntime().wrap(function _callee74$(_context74) {
|
|
7180
|
+
while (1) switch (_context74.prev = _context74.next) {
|
|
7091
7181
|
case 0:
|
|
7092
|
-
|
|
7182
|
+
_context74.prev = 0;
|
|
7093
7183
|
if (this.store.order) {
|
|
7094
|
-
|
|
7184
|
+
_context74.next = 3;
|
|
7095
7185
|
break;
|
|
7096
7186
|
}
|
|
7097
7187
|
throw new Error('order 模块未初始化');
|
|
7098
7188
|
case 3:
|
|
7099
|
-
|
|
7189
|
+
_context74.next = 5;
|
|
7100
7190
|
return this.store.order.updateOrderProductQuantity(params);
|
|
7101
7191
|
case 5:
|
|
7102
|
-
products =
|
|
7103
|
-
return
|
|
7192
|
+
products = _context74.sent;
|
|
7193
|
+
return _context74.abrupt("return", products);
|
|
7104
7194
|
case 9:
|
|
7105
|
-
|
|
7106
|
-
|
|
7107
|
-
throw
|
|
7195
|
+
_context74.prev = 9;
|
|
7196
|
+
_context74.t0 = _context74["catch"](0);
|
|
7197
|
+
throw _context74.t0;
|
|
7108
7198
|
case 12:
|
|
7109
7199
|
case "end":
|
|
7110
|
-
return
|
|
7200
|
+
return _context74.stop();
|
|
7111
7201
|
}
|
|
7112
|
-
},
|
|
7202
|
+
}, _callee74, this, [[0, 9]]);
|
|
7113
7203
|
}));
|
|
7114
|
-
function updateOrderProductQuantity(
|
|
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
|
|
7227
|
+
var _setOrderProductLineNote = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee75(identity, note) {
|
|
7138
7228
|
var params, products;
|
|
7139
|
-
return _regeneratorRuntime().wrap(function
|
|
7140
|
-
while (1) switch (
|
|
7229
|
+
return _regeneratorRuntime().wrap(function _callee75$(_context75) {
|
|
7230
|
+
while (1) switch (_context75.prev = _context75.next) {
|
|
7141
7231
|
case 0:
|
|
7142
|
-
|
|
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
|
-
|
|
7247
|
+
_context75.next = 7;
|
|
7158
7248
|
return this.updateOrderProduct(params);
|
|
7159
7249
|
case 7:
|
|
7160
|
-
products =
|
|
7161
|
-
return
|
|
7250
|
+
products = _context75.sent;
|
|
7251
|
+
return _context75.abrupt("return", products);
|
|
7162
7252
|
case 11:
|
|
7163
|
-
|
|
7164
|
-
|
|
7165
|
-
throw
|
|
7253
|
+
_context75.prev = 11;
|
|
7254
|
+
_context75.t0 = _context75["catch"](0);
|
|
7255
|
+
throw _context75.t0;
|
|
7166
7256
|
case 14:
|
|
7167
7257
|
case "end":
|
|
7168
|
-
return
|
|
7258
|
+
return _context75.stop();
|
|
7169
7259
|
}
|
|
7170
|
-
},
|
|
7260
|
+
}, _callee75, this, [[0, 11]]);
|
|
7171
7261
|
}));
|
|
7172
|
-
function setOrderProductLineNote(
|
|
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
|
|
7188
|
-
return _regeneratorRuntime().wrap(function
|
|
7189
|
-
while (1) switch (
|
|
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
|
-
|
|
7281
|
+
_context76.prev = 0;
|
|
7192
7282
|
if (this.store.order) {
|
|
7193
|
-
|
|
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
|
-
|
|
7289
|
+
_context76.next = 9;
|
|
7200
7290
|
break;
|
|
7201
7291
|
}
|
|
7202
|
-
|
|
7292
|
+
_context76.next = 6;
|
|
7203
7293
|
return this.store.order.removeProductsFromOrder(identities);
|
|
7204
7294
|
case 6:
|
|
7205
|
-
|
|
7206
|
-
|
|
7295
|
+
_context76.t0 = _context76.sent;
|
|
7296
|
+
_context76.next = 12;
|
|
7207
7297
|
break;
|
|
7208
7298
|
case 9:
|
|
7209
|
-
|
|
7299
|
+
_context76.next = 11;
|
|
7210
7300
|
return this.store.order.removeProductsFromOrder(identities, options);
|
|
7211
7301
|
case 11:
|
|
7212
|
-
|
|
7302
|
+
_context76.t0 = _context76.sent;
|
|
7213
7303
|
case 12:
|
|
7214
|
-
return
|
|
7304
|
+
return _context76.abrupt("return", _context76.t0);
|
|
7215
7305
|
case 15:
|
|
7216
|
-
|
|
7217
|
-
|
|
7218
|
-
throw
|
|
7306
|
+
_context76.prev = 15;
|
|
7307
|
+
_context76.t1 = _context76["catch"](0);
|
|
7308
|
+
throw _context76.t1;
|
|
7219
7309
|
case 18:
|
|
7220
7310
|
case "end":
|
|
7221
|
-
return
|
|
7311
|
+
return _context76.stop();
|
|
7222
7312
|
}
|
|
7223
|
-
},
|
|
7313
|
+
}, _callee76, this, [[0, 15]]);
|
|
7224
7314
|
}));
|
|
7225
|
-
function removeProductsFromOrder(
|
|
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
|
|
7234
|
-
return _regeneratorRuntime().wrap(function
|
|
7235
|
-
while (1) switch (
|
|
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
|
|
7327
|
+
return _context77.abrupt("return", this.removeProductsFromOrder([identity], options));
|
|
7238
7328
|
case 1:
|
|
7239
7329
|
case "end":
|
|
7240
|
-
return
|
|
7330
|
+
return _context77.stop();
|
|
7241
7331
|
}
|
|
7242
|
-
},
|
|
7332
|
+
}, _callee77, this);
|
|
7243
7333
|
}));
|
|
7244
|
-
function removeProductFromOrder(
|
|
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
|
|
7295
|
-
return _regeneratorRuntime().wrap(function
|
|
7296
|
-
while (1) switch (
|
|
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
|
-
|
|
7389
|
+
_context78.next = 2;
|
|
7300
7390
|
break;
|
|
7301
7391
|
}
|
|
7302
7392
|
throw new Error('order 模块未初始化');
|
|
7303
7393
|
case 2:
|
|
7304
|
-
|
|
7394
|
+
_context78.next = 4;
|
|
7305
7395
|
return this.store.order.applyPromotion();
|
|
7306
7396
|
case 4:
|
|
7307
7397
|
case "end":
|
|
7308
|
-
return
|
|
7398
|
+
return _context78.stop();
|
|
7309
7399
|
}
|
|
7310
|
-
},
|
|
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
|
|
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
|
|
7341
|
-
while (1) switch (
|
|
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
|
-
|
|
7348
|
-
|
|
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 =
|
|
7357
|
-
return
|
|
7446
|
+
res = _context79.sent;
|
|
7447
|
+
return _context79.abrupt("return", res);
|
|
7358
7448
|
case 8:
|
|
7359
|
-
|
|
7360
|
-
|
|
7361
|
-
throw
|
|
7449
|
+
_context79.prev = 8;
|
|
7450
|
+
_context79.t0 = _context79["catch"](1);
|
|
7451
|
+
throw _context79.t0;
|
|
7362
7452
|
case 11:
|
|
7363
7453
|
case "end":
|
|
7364
|
-
return
|
|
7454
|
+
return _context79.stop();
|
|
7365
7455
|
}
|
|
7366
|
-
},
|
|
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
|
|
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
|
-
|
|
7388
|
-
return _regeneratorRuntime().wrap(function
|
|
7389
|
-
while (1) switch (
|
|
7477
|
+
_args80 = arguments;
|
|
7478
|
+
return _regeneratorRuntime().wrap(function _callee80$(_context80) {
|
|
7479
|
+
while (1) switch (_context80.prev = _context80.next) {
|
|
7390
7480
|
case 0:
|
|
7391
|
-
_ref57 =
|
|
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
|
-
|
|
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
|
|
7496
|
+
return _context80.stop();
|
|
7407
7497
|
}
|
|
7408
|
-
},
|
|
7498
|
+
}, _callee80, this);
|
|
7409
7499
|
}));
|
|
7410
|
-
function setOtherParams(
|
|
7500
|
+
function setOtherParams(_x71) {
|
|
7411
7501
|
return _setOtherParams.apply(this, arguments);
|
|
7412
7502
|
}
|
|
7413
7503
|
return setOtherParams;
|