@pisell/pisellos 2.3.218 → 2.3.220
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/modules/OpenData/types.d.ts +3 -0
- package/dist/modules/Order/index.d.ts +1 -1
- package/dist/modules/Order/index.js +6 -3
- package/dist/modules/Order/types.d.ts +1 -1
- package/dist/modules/Order/utils.d.ts +4 -0
- package/dist/modules/Order/utils.js +105 -53
- package/dist/modules/Product/index.d.ts +1 -1
- package/dist/solution/BaseSales/index.d.ts +2 -0
- package/dist/solution/BaseSales/index.js +65 -37
- package/dist/solution/BaseSales/types.d.ts +2 -0
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.d.ts +16 -0
- package/dist/solution/BookingTicket/index.js +679 -332
- package/dist/solution/BookingTicket/utils/redeemArrival.d.ts +78 -0
- package/dist/solution/BookingTicket/utils/redeemArrival.js +175 -0
- package/lib/model/strategy/adapter/promotion/index.js +46 -1
- package/lib/modules/OpenData/types.d.ts +3 -0
- package/lib/modules/Order/index.d.ts +1 -1
- package/lib/modules/Order/index.js +4 -1
- package/lib/modules/Order/types.d.ts +1 -1
- package/lib/modules/Order/utils.d.ts +4 -0
- package/lib/modules/Order/utils.js +45 -1
- package/lib/modules/Product/index.d.ts +1 -1
- package/lib/solution/BaseSales/index.d.ts +2 -0
- package/lib/solution/BaseSales/index.js +27 -6
- package/lib/solution/BaseSales/types.d.ts +2 -0
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.d.ts +16 -0
- package/lib/solution/BookingTicket/index.js +171 -5
- package/lib/solution/BookingTicket/utils/redeemArrival.d.ts +78 -0
- package/lib/solution/BookingTicket/utils/redeemArrival.js +156 -0
- package/package.json +1 -1
|
@@ -106,6 +106,9 @@ export interface OpenDataConfig {
|
|
|
106
106
|
'sale.short_number_prefix'?: string | null;
|
|
107
107
|
'sale.sale_number_prefix'?: string | null;
|
|
108
108
|
'sale.enabled_item_rules'?: number[];
|
|
109
|
+
'fulfillment.enable_adjust_session_on_arrival'?: boolean | 0 | 1;
|
|
110
|
+
'fulfillment.max_earlier_shift_minutes'?: number | string;
|
|
111
|
+
'fulfillment.max_later_shift_minutes'?: number | string;
|
|
109
112
|
'fulfillment.enable_pickup'?: boolean;
|
|
110
113
|
'fulfillment.handover_mode'?: string[];
|
|
111
114
|
'fulfillment.takeaway_fees_rules'?: number[];
|
|
@@ -642,7 +642,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
642
642
|
generateIdempotencyToken(): string;
|
|
643
643
|
syncPaymentsToOrder<T = any>(params: SyncPaymentsToOrderParams): Promise<SyncPaymentsToOrderResult<T>>;
|
|
644
644
|
createOrder(params: CommitOrderParams['query']): {
|
|
645
|
-
type: "
|
|
645
|
+
type: "virtual" | "appointment_booking";
|
|
646
646
|
platform: string;
|
|
647
647
|
sales_channel: string;
|
|
648
648
|
order_sales_channel: string;
|
|
@@ -34,7 +34,7 @@ import { loadSalesOrderSnapshot } from "../../shared/sales/loadSalesOrderSnapsho
|
|
|
34
34
|
import { PAYMENT_REFRESH_MESSAGE, requiresLocalPaymentRefresh, stripLocalEftposState } from "./localEftposState";
|
|
35
35
|
import { BaseModule } from "../BaseModule";
|
|
36
36
|
import { OrderHooks } from "./types";
|
|
37
|
-
import { composeLinePrice, generateDuration, getAllDiscountList, mergeRelationForms, ensureCartItemOriginHolder, buildSubmitPayload, createDefaultTempOrder, createDefaultOrderRulesHooks, createEmptySummary, createUuidV4, formatDateTime, isTempOrder, normalizeOrderMetaList, normalizeBookingIsAll, normalizeBookingSubType, mapPaymentItemsToOrderPayments, normalizeOrderProductDiscountList, resolveEffectivePerUnitDiscount, ensureProductSku, getProductSkuOptions, normalizeProductSkuOptions, sumOptionUnitPrice, clearTempOrderHolderAssignments, hasAssignedHolderId, getOrderProductLineUid, indexOrderProductsByUid, calculateOrderProductsDeposit, collectPointCardSnapshotCodeCandidates, mergePointCardSnapshotCodes as _mergePointCardSnapshotCodes, buildVirtualCurrencySnapshotFromList, mergeOrderProductDisplayFields, resolveIsFormSubject, isMarkdownBundle } from "./utils";
|
|
37
|
+
import { composeLinePrice, generateDuration, getAllDiscountList, mergeRelationForms, ensureCartItemOriginHolder, buildSubmitPayload, restoreRedeemVoucherTimes, createDefaultTempOrder, createDefaultOrderRulesHooks, createEmptySummary, createUuidV4, formatDateTime, isTempOrder, normalizeOrderMetaList, normalizeBookingIsAll, normalizeBookingSubType, mapPaymentItemsToOrderPayments, normalizeOrderProductDiscountList, resolveEffectivePerUnitDiscount, ensureProductSku, getProductSkuOptions, normalizeProductSkuOptions, sumOptionUnitPrice, clearTempOrderHolderAssignments, hasAssignedHolderId, getOrderProductLineUid, indexOrderProductsByUid, calculateOrderProductsDeposit, collectPointCardSnapshotCodeCandidates, mergePointCardSnapshotCodes as _mergePointCardSnapshotCodes, buildVirtualCurrencySnapshotFromList, mergeOrderProductDisplayFields, resolveIsFormSubject, isMarkdownBundle } from "./utils";
|
|
38
38
|
import { isNormalProduct } from "../Product/utils";
|
|
39
39
|
import { ensureHolderRelationUuids, getProductHolderRelations, hasProductBooking, removeProductHolderRelations, replaceProductHolderRelations, restoreLegacyHolderRelations } from "./holderRelations";
|
|
40
40
|
import { getWeighedProductPriceFingerprint, resolveWeighedSourcePrice, withOriginalBundleOptionPrices } from "./utils/weighedProduct";
|
|
@@ -7383,6 +7383,7 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
7383
7383
|
}, {
|
|
7384
7384
|
key: "updateOrderBooking",
|
|
7385
7385
|
value: function updateOrderBooking(params) {
|
|
7386
|
+
var _targetBooking$metada;
|
|
7386
7387
|
var unique_identification_number = params.unique_identification_number,
|
|
7387
7388
|
updates = params.updates;
|
|
7388
7389
|
var tempOrder = this.ensureTempOrder();
|
|
@@ -7393,7 +7394,9 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
7393
7394
|
}
|
|
7394
7395
|
var targetBooking = tempOrder.bookings[bookingIndex] || {};
|
|
7395
7396
|
var nextBooking = _objectSpread(_objectSpread(_objectSpread({}, targetBooking), updates), {}, {
|
|
7396
|
-
metadata: _objectSpread(_objectSpread(_objectSpread({}, targetBooking.metadata || {}), updates.metadata || {}),
|
|
7397
|
+
metadata: _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, targetBooking.metadata || {}), updates.metadata || {}), Number((_targetBooking$metada = targetBooking.metadata) === null || _targetBooking$metada === void 0 ? void 0 : _targetBooking$metada.is_change_by_redeem) === 1 ? {
|
|
7398
|
+
is_change_by_redeem: 1
|
|
7399
|
+
} : {}), {}, {
|
|
7397
7400
|
unique_identification_number: bookingUid
|
|
7398
7401
|
})
|
|
7399
7402
|
});
|
|
@@ -9358,7 +9361,7 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
9358
9361
|
if ((options === null || options === void 0 ? void 0 : options.ensureIdentity) !== false) {
|
|
9359
9362
|
this.ensureExternalSaleNumber(nextTempOrder);
|
|
9360
9363
|
}
|
|
9361
|
-
nextTempOrder.vouchers = raw.vouchers || [];
|
|
9364
|
+
nextTempOrder.vouchers = restoreRedeemVoucherTimes(nextTempOrder, raw.vouchers || []);
|
|
9362
9365
|
return nextTempOrder;
|
|
9363
9366
|
}
|
|
9364
9367
|
}, {
|
|
@@ -668,7 +668,7 @@ export interface SubmitSalesOrderParams {
|
|
|
668
668
|
holder_relations?: OrderHolderRelation[];
|
|
669
669
|
bookings: OrderSubmitBooking[];
|
|
670
670
|
payments: any[];
|
|
671
|
-
vouchers
|
|
671
|
+
vouchers?: any[];
|
|
672
672
|
surcharges?: any[];
|
|
673
673
|
relation_forms: any[];
|
|
674
674
|
form_record_ids?: OrderSubmitFormRecord[];
|
|
@@ -210,6 +210,10 @@ export declare const getAllDiscountList: (cartItem: CartItem) => any;
|
|
|
210
210
|
export { createUuidV4 };
|
|
211
211
|
export declare function isTempOrder(data: any): data is OrderTempOrder;
|
|
212
212
|
export declare function formatDateTime(date: Date): string;
|
|
213
|
+
/** 旧票券可能没有事件 ID;缺失或占位值不能用于关联预约。 */
|
|
214
|
+
export declare function redeemEventKey(value: unknown): string | undefined;
|
|
215
|
+
/** checkout 提交子预约的标记;重新加载订单时,从已调时的子预约恢复关联票券的票面时段。 */
|
|
216
|
+
export declare function restoreRedeemVoucherTimes(order: Pick<OrderTempOrder, 'bookings'>, vouchers: any[]): any[];
|
|
213
217
|
export declare function normalizeBookingIsAll(booking: Record<string, any>): 0 | 1;
|
|
214
218
|
export declare function normalizeBookingSubType(booking: Record<string, any>): string;
|
|
215
219
|
export declare function normalizeSubmitBooking<T extends {
|
|
@@ -1353,7 +1353,59 @@ function normalizeSubmitProduct(product) {
|
|
|
1353
1353
|
payment_price: formatOptions.virtualSettlementMode ? virtualPrice : (_submitProduct$paymen = submitProduct.payment_price) !== null && _submitProduct$paymen !== void 0 ? _submitProduct$paymen : submitProduct.selling_price
|
|
1354
1354
|
});
|
|
1355
1355
|
}
|
|
1356
|
-
|
|
1356
|
+
|
|
1357
|
+
/** 旧票券可能没有事件 ID;缺失或占位值不能用于关联预约。 */
|
|
1358
|
+
export function redeemEventKey(value) {
|
|
1359
|
+
if (typeof value !== 'number' && typeof value !== 'string') return;
|
|
1360
|
+
var key = String(value).trim();
|
|
1361
|
+
return /^[1-9]\d*$/.test(key) ? key : undefined;
|
|
1362
|
+
}
|
|
1363
|
+
|
|
1364
|
+
/** checkout 提交子预约的标记;重新加载订单时,从已调时的子预约恢复关联票券的票面时段。 */
|
|
1365
|
+
export function restoreRedeemVoucherTimes(order, vouchers) {
|
|
1366
|
+
if (!Array.isArray(vouchers) || !vouchers.length) return vouchers;
|
|
1367
|
+
var markedBookings = new Map();
|
|
1368
|
+
var _iterator8 = _createForOfIteratorHelper(order.bookings || []),
|
|
1369
|
+
_step8;
|
|
1370
|
+
try {
|
|
1371
|
+
for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
|
|
1372
|
+
var _booking$metadata;
|
|
1373
|
+
var booking = _step8.value;
|
|
1374
|
+
var event = redeemEventKey(booking === null || booking === void 0 ? void 0 : booking.schedule_event_id);
|
|
1375
|
+
if (event && Number((_booking$metadata = booking.metadata) === null || _booking$metadata === void 0 ? void 0 : _booking$metadata.is_change_by_redeem) === 1) markedBookings.set(event, booking);
|
|
1376
|
+
}
|
|
1377
|
+
} catch (err) {
|
|
1378
|
+
_iterator8.e(err);
|
|
1379
|
+
} finally {
|
|
1380
|
+
_iterator8.f();
|
|
1381
|
+
}
|
|
1382
|
+
if (!markedBookings.size) return vouchers;
|
|
1383
|
+
var restored = vouchers;
|
|
1384
|
+
vouchers.forEach(function (voucher, index) {
|
|
1385
|
+
var event = redeemEventKey(voucher === null || voucher === void 0 ? void 0 : voucher.schedule_event_id);
|
|
1386
|
+
var booking = event && markedBookings.get(event);
|
|
1387
|
+
if (!booking || !booking.start_time || !booking.end_time) return;
|
|
1388
|
+
var times = _objectSpread(_objectSpread({
|
|
1389
|
+
start_time: booking.start_time,
|
|
1390
|
+
end_time: booking.end_time
|
|
1391
|
+
}, booking.start_date && {
|
|
1392
|
+
start_date: booking.start_date
|
|
1393
|
+
}), booking.end_date && {
|
|
1394
|
+
expire_date: booking.end_date
|
|
1395
|
+
});
|
|
1396
|
+
var timeChanged = Object.entries(times).some(function (_ref41) {
|
|
1397
|
+
var _ref42 = _slicedToArray(_ref41, 2),
|
|
1398
|
+
key = _ref42[0],
|
|
1399
|
+
value = _ref42[1];
|
|
1400
|
+
return voucher[key] !== value;
|
|
1401
|
+
});
|
|
1402
|
+
if (!timeChanged) return;
|
|
1403
|
+
if (restored === vouchers) restored = vouchers.slice();
|
|
1404
|
+
restored[index] = _objectSpread(_objectSpread({}, voucher), times);
|
|
1405
|
+
});
|
|
1406
|
+
return restored;
|
|
1407
|
+
}
|
|
1408
|
+
var SUBMIT_BOOKING_METADATA_WHITELIST = ['is_change_by_redeem', 'unique_identification_number', 'collect_pax', 'capacity', 'holder_id', 'resource_select_type', 'holder', 'is_fulfillment_timing', 'fulfillment_timing'];
|
|
1357
1409
|
export function normalizeBookingIsAll(booking) {
|
|
1358
1410
|
return booking.is_all === true || booking.is_all === 1 || booking.is_all === '1' || booking.is_all === 'true' ? 1 : 0;
|
|
1359
1411
|
}
|
|
@@ -1367,19 +1419,19 @@ export function normalizeBookingSubType(booking) {
|
|
|
1367
1419
|
export function normalizeSubmitBooking(booking) {
|
|
1368
1420
|
var rawMetadata = booking.metadata || {};
|
|
1369
1421
|
var cleanMetadata = {};
|
|
1370
|
-
var
|
|
1371
|
-
|
|
1422
|
+
var _iterator9 = _createForOfIteratorHelper(SUBMIT_BOOKING_METADATA_WHITELIST),
|
|
1423
|
+
_step9;
|
|
1372
1424
|
try {
|
|
1373
|
-
for (
|
|
1374
|
-
var key =
|
|
1425
|
+
for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
|
|
1426
|
+
var key = _step9.value;
|
|
1375
1427
|
if (rawMetadata[key] !== undefined) {
|
|
1376
1428
|
cleanMetadata[key] = rawMetadata[key];
|
|
1377
1429
|
}
|
|
1378
1430
|
}
|
|
1379
1431
|
} catch (err) {
|
|
1380
|
-
|
|
1432
|
+
_iterator9.e(err);
|
|
1381
1433
|
} finally {
|
|
1382
|
-
|
|
1434
|
+
_iterator9.f();
|
|
1383
1435
|
}
|
|
1384
1436
|
if (cleanMetadata.holder_id === undefined && !isFulfillmentTimingBooking(booking)) {
|
|
1385
1437
|
cleanMetadata.holder_id = null;
|
|
@@ -1529,7 +1581,7 @@ export function resolveSubmitOrderType(params) {
|
|
|
1529
1581
|
return 'virtual';
|
|
1530
1582
|
}
|
|
1531
1583
|
export function buildSubmitPayload(params) {
|
|
1532
|
-
var _tempOrder$metadata2, _tempOrder$customer_i, _tempOrder$country_ca, _tempOrder$phone, _tempOrder$email, _tempOrder$order_numb, _tempOrder$shop_order, _tempOrder$shop_full_,
|
|
1584
|
+
var _tempOrder$metadata2, _tempOrder$customer_i, _tempOrder$country_ca, _tempOrder$phone, _tempOrder$email, _tempOrder$order_numb, _tempOrder$shop_order, _tempOrder$shop_full_, _ref44, _tempOrder$is_price_i, _tempOrder$is_deposit, _tempOrder$_extend, _enhancedPayload$summ;
|
|
1533
1585
|
var tempOrder = params.tempOrder,
|
|
1534
1586
|
cacheId = params.cacheId,
|
|
1535
1587
|
_params$now = params.now,
|
|
@@ -1544,29 +1596,29 @@ export function buildSubmitPayload(params) {
|
|
|
1544
1596
|
var scheduleDate = tempOrder.schedule_date || tempOrder.created_at || formatDateTime(now);
|
|
1545
1597
|
var bookingUuid = createUuidV4();
|
|
1546
1598
|
var virtualSettlementMode = ((_tempOrder$metadata2 = tempOrder.metadata) === null || _tempOrder$metadata2 === void 0 || (_tempOrder$metadata2 = _tempOrder$metadata2.currency_settlement_config) === null || _tempOrder$metadata2 === void 0 ? void 0 : _tempOrder$metadata2.settlement_type) === 'virtual_currency';
|
|
1547
|
-
var
|
|
1548
|
-
_extend =
|
|
1549
|
-
_relationId =
|
|
1550
|
-
_tableFormId =
|
|
1551
|
-
_resourceId =
|
|
1552
|
-
_summary =
|
|
1553
|
-
_lastOrderInfo =
|
|
1554
|
-
_paidAmount =
|
|
1555
|
-
_shopId =
|
|
1556
|
-
_shopNote =
|
|
1557
|
-
_shopServiceType =
|
|
1558
|
-
_startTime =
|
|
1559
|
-
_customer =
|
|
1560
|
-
_discountList =
|
|
1561
|
-
_orderMetaList =
|
|
1562
|
-
_rootTaxFee =
|
|
1563
|
-
_totalAmount =
|
|
1564
|
-
_totalRefundAmount =
|
|
1565
|
-
_createDate =
|
|
1566
|
-
_holderId =
|
|
1567
|
-
_paymentStatus =
|
|
1568
|
-
_notes =
|
|
1569
|
-
tempOrderRest = _objectWithoutProperties(
|
|
1599
|
+
var _ref43 = tempOrder,
|
|
1600
|
+
_extend = _ref43._extend,
|
|
1601
|
+
_relationId = _ref43.relation_id,
|
|
1602
|
+
_tableFormId = _ref43.table_form_id,
|
|
1603
|
+
_resourceId = _ref43.resource_id,
|
|
1604
|
+
_summary = _ref43.summary,
|
|
1605
|
+
_lastOrderInfo = _ref43.lastOrderInfo,
|
|
1606
|
+
_paidAmount = _ref43.paid_amount,
|
|
1607
|
+
_shopId = _ref43.shop_id,
|
|
1608
|
+
_shopNote = _ref43.shop_note,
|
|
1609
|
+
_shopServiceType = _ref43.shop_service_type,
|
|
1610
|
+
_startTime = _ref43.start_time,
|
|
1611
|
+
_customer = _ref43.customer,
|
|
1612
|
+
_discountList = _ref43.discount_list,
|
|
1613
|
+
_orderMetaList = _ref43.order_meta_list,
|
|
1614
|
+
_rootTaxFee = _ref43.tax_fee,
|
|
1615
|
+
_totalAmount = _ref43.total_amount,
|
|
1616
|
+
_totalRefundAmount = _ref43.total_refund_amount,
|
|
1617
|
+
_createDate = _ref43.create_date,
|
|
1618
|
+
_holderId = _ref43.holder_id,
|
|
1619
|
+
_paymentStatus = _ref43.payment_status,
|
|
1620
|
+
_notes = _ref43.notes,
|
|
1621
|
+
tempOrderRest = _objectWithoutProperties(_ref43, _excluded4);
|
|
1570
1622
|
var resolvedBusinessCode = businessCode !== null && businessCode !== void 0 ? businessCode : tempOrder.business_code;
|
|
1571
1623
|
var normalizedOrderMetaList = normalizeOrderMetaList(tempOrder.order_meta_list);
|
|
1572
1624
|
var submitType = resolveSubmitOrderType({
|
|
@@ -1593,7 +1645,7 @@ export function buildSubmitPayload(params) {
|
|
|
1593
1645
|
type: submitType,
|
|
1594
1646
|
business_code: resolvedBusinessCode,
|
|
1595
1647
|
sales_channel: tempOrder.sales_channel || 'my_pisel',
|
|
1596
|
-
order_sales_channel: (
|
|
1648
|
+
order_sales_channel: (_ref44 = channel !== null && channel !== void 0 ? channel : tempOrder.order_sales_channel) !== null && _ref44 !== void 0 ? _ref44 : 'online_store',
|
|
1597
1649
|
status: tempOrder.status || 'normal'
|
|
1598
1650
|
}, params.includePaymentStatus !== false ? {
|
|
1599
1651
|
payment_status: tempOrder.payment_status || 'payment_processing'
|
|
@@ -1621,13 +1673,13 @@ export function buildSubmitPayload(params) {
|
|
|
1621
1673
|
// holder: tempOrder.holder || null,
|
|
1622
1674
|
summary: summary || tempOrder.summary || createEmptySummary(),
|
|
1623
1675
|
metadata: function () {
|
|
1624
|
-
var
|
|
1625
|
-
_collectPax =
|
|
1626
|
-
_tableOccupancyDuration =
|
|
1627
|
-
_cartSettlementKey =
|
|
1628
|
-
_cartSettlementSnapshot =
|
|
1629
|
-
_legalCurrencySnapshot =
|
|
1630
|
-
rest = _objectWithoutProperties(
|
|
1676
|
+
var _ref45 = tempOrder.metadata || {},
|
|
1677
|
+
_collectPax = _ref45.collect_pax,
|
|
1678
|
+
_tableOccupancyDuration = _ref45.table_occupancy_duration,
|
|
1679
|
+
_cartSettlementKey = _ref45.cart_settlement_key,
|
|
1680
|
+
_cartSettlementSnapshot = _ref45.cart_settlement_snapshot,
|
|
1681
|
+
_legalCurrencySnapshot = _ref45.legal_currency_snapshot,
|
|
1682
|
+
rest = _objectWithoutProperties(_ref45, _excluded5);
|
|
1631
1683
|
return _objectSpread({}, rest);
|
|
1632
1684
|
}()
|
|
1633
1685
|
}, (_tempOrder$_extend = tempOrder._extend) !== null && _tempOrder$_extend !== void 0 && (_tempOrder$_extend = _tempOrder$_extend.salesNotesState) !== null && _tempOrder$_extend !== void 0 && _tempOrder$_extend.dirty ? {
|
|
@@ -1785,25 +1837,25 @@ export function clearTempOrderHolderAssignments(tempOrder) {
|
|
|
1785
1837
|
changed = true;
|
|
1786
1838
|
}
|
|
1787
1839
|
};
|
|
1788
|
-
var
|
|
1789
|
-
|
|
1840
|
+
var _iterator10 = _createForOfIteratorHelper(tempOrder.products || []),
|
|
1841
|
+
_step10;
|
|
1790
1842
|
try {
|
|
1791
|
-
for (
|
|
1792
|
-
var product =
|
|
1843
|
+
for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
|
|
1844
|
+
var product = _step10.value;
|
|
1793
1845
|
if (product.metadata && _typeof(product.metadata) === 'object') {
|
|
1794
1846
|
clearHolder(product.metadata);
|
|
1795
1847
|
}
|
|
1796
1848
|
}
|
|
1797
1849
|
} catch (err) {
|
|
1798
|
-
|
|
1850
|
+
_iterator10.e(err);
|
|
1799
1851
|
} finally {
|
|
1800
|
-
|
|
1852
|
+
_iterator10.f();
|
|
1801
1853
|
}
|
|
1802
|
-
var
|
|
1803
|
-
|
|
1854
|
+
var _iterator11 = _createForOfIteratorHelper(tempOrder.bookings || []),
|
|
1855
|
+
_step11;
|
|
1804
1856
|
try {
|
|
1805
|
-
for (
|
|
1806
|
-
var booking =
|
|
1857
|
+
for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
|
|
1858
|
+
var booking = _step11.value;
|
|
1807
1859
|
var bookingRecord = booking;
|
|
1808
1860
|
if (booking.metadata && _typeof(booking.metadata) === 'object') {
|
|
1809
1861
|
resetHolderField(booking.metadata);
|
|
@@ -1814,9 +1866,9 @@ export function clearTempOrderHolderAssignments(tempOrder) {
|
|
|
1814
1866
|
}
|
|
1815
1867
|
}
|
|
1816
1868
|
} catch (err) {
|
|
1817
|
-
|
|
1869
|
+
_iterator11.e(err);
|
|
1818
1870
|
} finally {
|
|
1819
|
-
|
|
1871
|
+
_iterator11.f();
|
|
1820
1872
|
}
|
|
1821
1873
|
var productsByUid = (_tempOrder$_extend2 = tempOrder._extend) === null || _tempOrder$_extend2 === void 0 ? void 0 : _tempOrder$_extend2.productsByUid;
|
|
1822
1874
|
if (productsByUid && _typeof(productsByUid) === 'object') {
|
|
@@ -1857,8 +1909,8 @@ export function getRuntimeProductOrigin(tempOrder, product) {
|
|
|
1857
1909
|
return tempOrder._extend.productsByUid[uid].origin;
|
|
1858
1910
|
}
|
|
1859
1911
|
var matchedProduct = ((tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.products) || []).find(function (item) {
|
|
1860
|
-
var
|
|
1861
|
-
return item === product || getOrderProductLineUid(item) === uid || String((
|
|
1912
|
+
var _ref46, _item$product_id, _ref47, _product$product_id;
|
|
1913
|
+
return item === product || getOrderProductLineUid(item) === uid || String((_ref46 = (_item$product_id = item === null || item === void 0 ? void 0 : item.product_id) !== null && _item$product_id !== void 0 ? _item$product_id : item === null || item === void 0 ? void 0 : item.id) !== null && _ref46 !== void 0 ? _ref46 : '') === String((_ref47 = (_product$product_id = product === null || product === void 0 ? void 0 : product.product_id) !== null && _product$product_id !== void 0 ? _product$product_id : product === null || product === void 0 ? void 0 : product.id) !== null && _ref47 !== void 0 ? _ref47 : '');
|
|
1862
1914
|
});
|
|
1863
1915
|
var matchedUid = matchedProduct ? getOrderProductLineUid(matchedProduct) : '';
|
|
1864
1916
|
return matchedUid ? (tempOrder === null || tempOrder === void 0 || (_tempOrder$_extend4 = tempOrder._extend) === null || _tempOrder$_extend4 === void 0 || (_tempOrder$_extend4 = _tempOrder$_extend4.productsByUid) === null || _tempOrder$_extend4 === void 0 || (_tempOrder$_extend4 = _tempOrder$_extend4[matchedUid]) === null || _tempOrder$_extend4 === void 0 ? void 0 : _tempOrder$_extend4.origin) || null : null;
|
|
@@ -49,5 +49,5 @@ export declare class Product extends BaseModule implements Module {
|
|
|
49
49
|
getCategories(): ProductCategory[];
|
|
50
50
|
setOtherParams(key: string, value: any): void;
|
|
51
51
|
getOtherParams(): any;
|
|
52
|
-
getProductType(): "normal" | "
|
|
52
|
+
getProductType(): "normal" | "session" | "duration";
|
|
53
53
|
}
|
|
@@ -55,6 +55,8 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
55
55
|
protected store: BaseSalesState;
|
|
56
56
|
protected otherParams: Record<string, any>;
|
|
57
57
|
getInventory(): InventoryController | undefined;
|
|
58
|
+
/** Retail and standard POS opt in per sales instance; other hosts retain their member flow. */
|
|
59
|
+
isMemberCartConsistencyEnabled(): boolean;
|
|
58
60
|
prepareCheckout(signal?: AbortSignal): Promise<CheckoutRuntimeSnapshot | undefined>;
|
|
59
61
|
protected cacheId: string | undefined;
|
|
60
62
|
/**
|
|
@@ -38,6 +38,7 @@ import { BaseModule } from "../../modules/BaseModule";
|
|
|
38
38
|
import { isLocalFinalizedPayment, PAYMENT_REFRESH_MESSAGE, requiresLocalPaymentRefresh } from "../../modules/Order/localEftposState";
|
|
39
39
|
import { BaseSalesHookNames } from "./types";
|
|
40
40
|
import { OrderModule } from "../../modules/Order";
|
|
41
|
+
import { ensureUniqueProductLineUids, consolidateDiscountFreeProductLines } from "../../modules/Order/utils/discountProductLineIdentity";
|
|
41
42
|
import { isFulfillmentTimingBooking } from "../../modules/Order/pickupTiming";
|
|
42
43
|
import { PickupTimingController } from "./pickupTiming";
|
|
43
44
|
import { FulfillmentItemRulesController } from "./fulfillmentItemRules";
|
|
@@ -176,6 +177,14 @@ function preserveManualProductDiscountProducts(previousProducts, nextProducts) {
|
|
|
176
177
|
return previous && isBaseSalesManualProductDiscountProduct(previous) ? previous : product;
|
|
177
178
|
});
|
|
178
179
|
}
|
|
180
|
+
|
|
181
|
+
/** Rules may split a coupon quantity into rows that still share the original UID. */
|
|
182
|
+
function applyDiscountProductLines(tempOrder, products, discounts, enableMemberCartConsistency) {
|
|
183
|
+
tempOrder.products = preserveManualProductDiscountProducts(tempOrder.products, products);
|
|
184
|
+
if (!enableMemberCartConsistency) return;
|
|
185
|
+
ensureUniqueProductLineUids(tempOrder, discounts);
|
|
186
|
+
consolidateDiscountFreeProductLines(tempOrder);
|
|
187
|
+
}
|
|
179
188
|
function isBaseSalesHistoricalDiscountEntry(discount) {
|
|
180
189
|
return Boolean((discount === null || discount === void 0 ? void 0 : discount.isEditMode) || (discount === null || discount === void 0 ? void 0 : discount.isDisabled) || (discount === null || discount === void 0 ? void 0 : discount.order_discount_id) != null);
|
|
181
190
|
}
|
|
@@ -652,6 +661,13 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
652
661
|
value: function getInventory() {
|
|
653
662
|
return this.otherParams.inventory;
|
|
654
663
|
}
|
|
664
|
+
|
|
665
|
+
/** Retail and standard POS opt in per sales instance; other hosts retain their member flow. */
|
|
666
|
+
}, {
|
|
667
|
+
key: "isMemberCartConsistencyEnabled",
|
|
668
|
+
value: function isMemberCartConsistencyEnabled() {
|
|
669
|
+
return this.otherParams.enableMemberCartConsistency === true;
|
|
670
|
+
}
|
|
655
671
|
}, {
|
|
656
672
|
key: "prepareCheckout",
|
|
657
673
|
value: function () {
|
|
@@ -3707,7 +3723,11 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3707
3723
|
isCurrentRequest = function isCurrentRequest() {
|
|
3708
3724
|
var _this20$store$order, _this20$store$order$g, _this20$store$order2, _this20$store$order2$;
|
|
3709
3725
|
var currentTempOrder = (_this20$store$order = _this20.store.order) === null || _this20$store$order === void 0 || (_this20$store$order$g = _this20$store$order.getTempOrder) === null || _this20$store$order$g === void 0 ? void 0 : _this20$store$order$g.call(_this20$store$order);
|
|
3710
|
-
|
|
3726
|
+
var current = Boolean(currentTempOrder && (requestEpoch === undefined || ((_this20$store$order2 = _this20.store.order) === null || _this20$store$order2 === void 0 || (_this20$store$order2$ = _this20$store$order2.getCustomerWalletPrepareConfigEpoch) === null || _this20$store$order2$ === void 0 ? void 0 : _this20$store$order2$.call(_this20$store$order2)) === requestEpoch) && _this20.resolveDiscountConfigCustomerId(currentTempOrder) === customerId && _this20.getDiscountConfigOrderIdentityKey(currentTempOrder) === requestOrderIdentityKey);
|
|
3727
|
+
// Cart edits can replace the object while member configuration is pending.
|
|
3728
|
+
// Keep the logical-order guard, but apply coupons to its latest rows.
|
|
3729
|
+
if (current && _this20.isMemberCartConsistencyEnabled()) tempOrder = currentTempOrder;
|
|
3730
|
+
return current;
|
|
3711
3731
|
};
|
|
3712
3732
|
getCurrentResult = function getCurrentResult() {
|
|
3713
3733
|
var _this20$store$order3, _this20$store$order3$, _discountModule$getDi2;
|
|
@@ -3959,7 +3979,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3959
3979
|
discountList: nextDiscountList
|
|
3960
3980
|
};
|
|
3961
3981
|
if (result.productList) {
|
|
3962
|
-
tempOrder
|
|
3982
|
+
applyDiscountProductLines(tempOrder, result.productList, result.discountList || nextDiscountList, this.isMemberCartConsistencyEnabled());
|
|
3963
3983
|
}
|
|
3964
3984
|
_iterator5 = _createForOfIteratorHelper(tempOrder.products || []);
|
|
3965
3985
|
_context36.prev = 93;
|
|
@@ -4160,7 +4180,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4160
4180
|
preserveEntitlementSelection: false
|
|
4161
4181
|
}) || result;
|
|
4162
4182
|
if (result.productList) {
|
|
4163
|
-
tempOrder
|
|
4183
|
+
applyDiscountProductLines(tempOrder, result.productList, result.discountList || nextDiscountList, this.isMemberCartConsistencyEnabled());
|
|
4164
4184
|
}
|
|
4165
4185
|
if (!result.discountList) {
|
|
4166
4186
|
_context37.next = 28;
|
|
@@ -4273,7 +4293,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4273
4293
|
key: "scanPromotionCode",
|
|
4274
4294
|
value: function () {
|
|
4275
4295
|
var _scanPromotionCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee39(code, customerId, options) {
|
|
4276
|
-
var raw,
|
|
4296
|
+
var raw, _tempOrder;
|
|
4277
4297
|
return _regeneratorRuntime().wrap(function _callee39$(_context39) {
|
|
4278
4298
|
while (1) switch (_context39.prev = _context39.next) {
|
|
4279
4299
|
case 0:
|
|
@@ -4298,13 +4318,13 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4298
4318
|
});
|
|
4299
4319
|
case 9:
|
|
4300
4320
|
this.store.order.persistTempOrder();
|
|
4301
|
-
|
|
4321
|
+
_tempOrder = this.store.order.ensureTempOrder();
|
|
4302
4322
|
_context39.next = 13;
|
|
4303
4323
|
return this.effectsEmit('onDiscountApplied', {
|
|
4304
|
-
productList:
|
|
4324
|
+
productList: _tempOrder.products || [],
|
|
4305
4325
|
discountList: this.store.order.getDiscountList(),
|
|
4306
|
-
selectedDiscountList:
|
|
4307
|
-
tempOrder:
|
|
4326
|
+
selectedDiscountList: _tempOrder.discount_list || [],
|
|
4327
|
+
tempOrder: _tempOrder
|
|
4308
4328
|
});
|
|
4309
4329
|
case 13:
|
|
4310
4330
|
return _context39.abrupt("return", _objectSpread(_objectSpread({
|
|
@@ -4336,7 +4356,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4336
4356
|
key: "setDiscountSelected",
|
|
4337
4357
|
value: function () {
|
|
4338
4358
|
var _setDiscountSelected = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee40(params) {
|
|
4339
|
-
var currentOrder, _store3, _store3$setDiscountLi, list, updated,
|
|
4359
|
+
var currentOrder, _store3, _store3$setDiscountLi, list, updated, _tempOrder2, orderStore, _discountModule, rulesModule, nextDiscountList, _orderStore$summary3, orderTotalAmount, result, beforeSelectedIds, promotionCardIds, _iterator6, _step6, d, selectedResourceIds, filterSelectedDiscountDetails, _iterator7, _step7, _product$metadata8, _tempOrder2$_extend, _product$metadata$sou2, _product$metadata9, _product$metadata10, _product$original_pri2, product, productUid, runtimeOrigin, totalPerUnitDiscount, optionSum, sourcePrice, newSourceSellingPrice, newMainSellingPrice;
|
|
4340
4360
|
return _regeneratorRuntime().wrap(function _callee40$(_context40) {
|
|
4341
4361
|
while (1) switch (_context40.prev = _context40.next) {
|
|
4342
4362
|
case 0:
|
|
@@ -4373,7 +4393,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4373
4393
|
}) : d;
|
|
4374
4394
|
});
|
|
4375
4395
|
this.hasManualDiscountSelection = true;
|
|
4376
|
-
|
|
4396
|
+
_tempOrder2 = this.store.order.ensureTempOrder();
|
|
4377
4397
|
orderStore = this.store.order.store || {};
|
|
4378
4398
|
_discountModule = orderStore.discount;
|
|
4379
4399
|
rulesModule = orderStore.rules;
|
|
@@ -4384,22 +4404,22 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4384
4404
|
if (rulesModule) {
|
|
4385
4405
|
orderTotalAmount = Number(((_orderStore$summary3 = orderStore.summary) === null || _orderStore$summary3 === void 0 ? void 0 : _orderStore$summary3.total_amount) || 0);
|
|
4386
4406
|
result = rulesModule.calcDiscount({
|
|
4387
|
-
productList:
|
|
4407
|
+
productList: _tempOrder2.products,
|
|
4388
4408
|
discountList: updated,
|
|
4389
4409
|
holders: [],
|
|
4390
4410
|
isFormSubject: function isFormSubject(product) {
|
|
4391
|
-
return resolveIsFormSubject(
|
|
4411
|
+
return resolveIsFormSubject(_tempOrder2, product);
|
|
4392
4412
|
},
|
|
4393
4413
|
orderTotalAmount: orderTotalAmount
|
|
4394
4414
|
}, {
|
|
4395
4415
|
discountId: params.discountId,
|
|
4396
4416
|
isSelected: params.isSelected
|
|
4397
4417
|
}) || {
|
|
4398
|
-
productList:
|
|
4418
|
+
productList: _tempOrder2.products,
|
|
4399
4419
|
discountList: updated
|
|
4400
4420
|
};
|
|
4401
4421
|
if (result !== null && result !== void 0 && result.productList) {
|
|
4402
|
-
|
|
4422
|
+
applyDiscountProductLines(_tempOrder2, result.productList, result.discountList || updated, this.isMemberCartConsistencyEnabled());
|
|
4403
4423
|
}
|
|
4404
4424
|
if (result !== null && result !== void 0 && result.discountList) {
|
|
4405
4425
|
nextDiscountList = result.discountList;
|
|
@@ -4450,7 +4470,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4450
4470
|
return rid != null && selectedResourceIds.has(rid);
|
|
4451
4471
|
});
|
|
4452
4472
|
};
|
|
4453
|
-
_iterator7 = _createForOfIteratorHelper(
|
|
4473
|
+
_iterator7 = _createForOfIteratorHelper(_tempOrder2.products);
|
|
4454
4474
|
_context40.prev = 27;
|
|
4455
4475
|
_iterator7.s();
|
|
4456
4476
|
case 29:
|
|
@@ -4460,7 +4480,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4460
4480
|
}
|
|
4461
4481
|
product = _step7.value;
|
|
4462
4482
|
productUid = (_product$metadata8 = product.metadata) === null || _product$metadata8 === void 0 ? void 0 : _product$metadata8.unique_identification_number;
|
|
4463
|
-
runtimeOrigin = productUid ? (
|
|
4483
|
+
runtimeOrigin = productUid ? (_tempOrder2$_extend = _tempOrder2._extend) === null || _tempOrder2$_extend === void 0 || (_tempOrder2$_extend = _tempOrder2$_extend.productsByUid) === null || _tempOrder2$_extend === void 0 || (_tempOrder2$_extend = _tempOrder2$_extend[productUid]) === null || _tempOrder2$_extend === void 0 ? void 0 : _tempOrder2$_extend.origin : undefined;
|
|
4464
4484
|
if (!(runtimeOrigin !== null && runtimeOrigin !== void 0 && runtimeOrigin.isManualDiscount || isBaseSalesManualProductDiscountProduct(product))) {
|
|
4465
4485
|
_context40.next = 35;
|
|
4466
4486
|
break;
|
|
@@ -4515,11 +4535,11 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4515
4535
|
_iterator7.f();
|
|
4516
4536
|
return _context40.finish(51);
|
|
4517
4537
|
case 54:
|
|
4518
|
-
OrderModule.populateSavedAmounts(
|
|
4538
|
+
OrderModule.populateSavedAmounts(_tempOrder2.products, nextDiscountList);
|
|
4519
4539
|
_context40.next = 57;
|
|
4520
4540
|
return _discountModule === null || _discountModule === void 0 ? void 0 : _discountModule.setDiscountList(nextDiscountList);
|
|
4521
4541
|
case 57:
|
|
4522
|
-
|
|
4542
|
+
_tempOrder2.discount_list = (nextDiscountList || []).filter(function (d) {
|
|
4523
4543
|
return d.isSelected;
|
|
4524
4544
|
});
|
|
4525
4545
|
_context40.next = 60;
|
|
@@ -4529,10 +4549,10 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4529
4549
|
case 60:
|
|
4530
4550
|
this.store.order.persistTempOrder();
|
|
4531
4551
|
this.effectsEmit('onDiscountApplied', {
|
|
4532
|
-
productList:
|
|
4552
|
+
productList: _tempOrder2.products,
|
|
4533
4553
|
discountList: nextDiscountList,
|
|
4534
|
-
selectedDiscountList:
|
|
4535
|
-
tempOrder:
|
|
4554
|
+
selectedDiscountList: _tempOrder2.discount_list,
|
|
4555
|
+
tempOrder: _tempOrder2
|
|
4536
4556
|
});
|
|
4537
4557
|
_context40.next = 67;
|
|
4538
4558
|
break;
|
|
@@ -4555,7 +4575,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4555
4575
|
key: "applyDiscountCalculationResult",
|
|
4556
4576
|
value: function () {
|
|
4557
4577
|
var _applyDiscountCalculationResult = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee41(result) {
|
|
4558
|
-
var
|
|
4578
|
+
var _tempOrder3, orderStore, _discountModule2;
|
|
4559
4579
|
return _regeneratorRuntime().wrap(function _callee41$(_context41) {
|
|
4560
4580
|
while (1) switch (_context41.prev = _context41.next) {
|
|
4561
4581
|
case 0:
|
|
@@ -4572,21 +4592,21 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4572
4592
|
}
|
|
4573
4593
|
return _context41.abrupt("return");
|
|
4574
4594
|
case 5:
|
|
4575
|
-
|
|
4595
|
+
_tempOrder3 = this.store.order.ensureTempOrder();
|
|
4576
4596
|
orderStore = this.store.order.store || {};
|
|
4577
4597
|
_discountModule2 = orderStore.discount;
|
|
4578
4598
|
if (result.productList) {
|
|
4579
|
-
|
|
4599
|
+
applyDiscountProductLines(_tempOrder3, result.productList, result.discountList || this.getDiscountList(), this.isMemberCartConsistencyEnabled());
|
|
4580
4600
|
}
|
|
4581
4601
|
if (!result.discountList) {
|
|
4582
4602
|
_context41.next = 14;
|
|
4583
4603
|
break;
|
|
4584
4604
|
}
|
|
4585
|
-
OrderModule.populateSavedAmounts(
|
|
4605
|
+
OrderModule.populateSavedAmounts(_tempOrder3.products, result.discountList);
|
|
4586
4606
|
_context41.next = 13;
|
|
4587
4607
|
return _discountModule2 === null || _discountModule2 === void 0 ? void 0 : _discountModule2.setDiscountList(result.discountList);
|
|
4588
4608
|
case 13:
|
|
4589
|
-
|
|
4609
|
+
_tempOrder3.discount_list = result.discountList.filter(function (discount) {
|
|
4590
4610
|
return discount.isSelected;
|
|
4591
4611
|
});
|
|
4592
4612
|
case 14:
|
|
@@ -4598,10 +4618,10 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4598
4618
|
this.store.order.persistTempOrder();
|
|
4599
4619
|
_context41.next = 19;
|
|
4600
4620
|
return this.effectsEmit('onDiscountApplied', {
|
|
4601
|
-
productList:
|
|
4621
|
+
productList: _tempOrder3.products || [],
|
|
4602
4622
|
discountList: result.discountList || [],
|
|
4603
|
-
selectedDiscountList:
|
|
4604
|
-
tempOrder:
|
|
4623
|
+
selectedDiscountList: _tempOrder3.discount_list || [],
|
|
4624
|
+
tempOrder: _tempOrder3
|
|
4605
4625
|
});
|
|
4606
4626
|
case 19:
|
|
4607
4627
|
_context41.next = 24;
|
|
@@ -7481,6 +7501,14 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
7481
7501
|
return this.resolveProductBookingPriceGroups(paramsList, currentOrderCustomerId);
|
|
7482
7502
|
case 9:
|
|
7483
7503
|
authoritativeProducts = _context75.sent;
|
|
7504
|
+
if (!paramsList.some(function (params, index) {
|
|
7505
|
+
return params.requireAuthoritativePrice && !authoritativeProducts[index];
|
|
7506
|
+
})) {
|
|
7507
|
+
_context75.next = 12;
|
|
7508
|
+
break;
|
|
7509
|
+
}
|
|
7510
|
+
throw new Error('The current customer product price is unavailable. Please retry before paying.');
|
|
7511
|
+
case 12:
|
|
7484
7512
|
plans = paramsList.map(function (params, index) {
|
|
7485
7513
|
if (!isPos) return null;
|
|
7486
7514
|
var product = authoritativeProducts[index];
|
|
@@ -7510,20 +7538,20 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
7510
7538
|
return queryIndex;
|
|
7511
7539
|
})) || [];
|
|
7512
7540
|
});
|
|
7513
|
-
_context75.next =
|
|
7541
|
+
_context75.next = 17;
|
|
7514
7542
|
return this.resolveProductBookingPriceGroups(segmentQueries, currentOrderCustomerId, true);
|
|
7515
|
-
case
|
|
7543
|
+
case 17:
|
|
7516
7544
|
segmentProducts = _context75.sent;
|
|
7517
7545
|
if (!segmentProducts.some(function (product) {
|
|
7518
7546
|
return !product;
|
|
7519
7547
|
})) {
|
|
7520
|
-
_context75.next =
|
|
7548
|
+
_context75.next = 20;
|
|
7521
7549
|
break;
|
|
7522
7550
|
}
|
|
7523
7551
|
throw durationPricingUnavailable('An authoritative product is missing for a billing unit.');
|
|
7524
|
-
case
|
|
7552
|
+
case 20:
|
|
7525
7553
|
if (useCustomerUserPricing) {
|
|
7526
|
-
_context75.next =
|
|
7554
|
+
_context75.next = 25;
|
|
7527
7555
|
break;
|
|
7528
7556
|
}
|
|
7529
7557
|
quotationContexts = new Map();
|
|
@@ -7538,13 +7566,13 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
7538
7566
|
customer_id: (_params$customer_id3 = params.customer_id) !== null && _params$customer_id3 !== void 0 ? _params$customer_id3 : currentOrderCustomerId
|
|
7539
7567
|
});
|
|
7540
7568
|
});
|
|
7541
|
-
_context75.next =
|
|
7569
|
+
_context75.next = 25;
|
|
7542
7570
|
return Promise.all(Array.from(quotationContexts.values()).map(function (context) {
|
|
7543
7571
|
return _this25.loadQuotationForPriceQuery(_objectSpread({
|
|
7544
7572
|
quotation: quotation
|
|
7545
7573
|
}, context));
|
|
7546
7574
|
}));
|
|
7547
|
-
case
|
|
7575
|
+
case 25:
|
|
7548
7576
|
return _context75.abrupt("return", paramsList.map(function (params, index) {
|
|
7549
7577
|
var _params$customer_id4, _authoritativeProduct2, _params$duration;
|
|
7550
7578
|
var productInput = params.product || {};
|
|
@@ -7595,7 +7623,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
7595
7623
|
duration: undefined
|
|
7596
7624
|
}) : result;
|
|
7597
7625
|
}));
|
|
7598
|
-
case
|
|
7626
|
+
case 26:
|
|
7599
7627
|
case "end":
|
|
7600
7628
|
return _context75.stop();
|
|
7601
7629
|
}
|