@pisell/pisellos 0.10.83 → 0.10.88
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.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/modules/ProductList/index.js +5 -2
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.js +789 -705
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.d.ts +18 -1
- package/dist/solution/BookingTicket/index.js +220 -16
- package/dist/solution/BookingTicket/utils/redeemArrival.d.ts +77 -0
- package/dist/solution/BookingTicket/utils/redeemArrival.js +171 -0
- package/lib/model/strategy/adapter/promotion/index.js +1 -46
- package/lib/modules/OpenData/types.d.ts +3 -0
- 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/modules/ProductList/index.js +4 -1
- package/lib/server/index.d.ts +1 -0
- package/lib/server/index.js +39 -0
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.d.ts +18 -1
- package/lib/solution/BookingTicket/index.js +102 -1
- package/lib/solution/BookingTicket/utils/redeemArrival.d.ts +77 -0
- package/lib/solution/BookingTicket/utils/redeemArrival.js +149 -0
- package/package.json +1 -1
|
@@ -100,6 +100,9 @@ export interface OpenDataConfig {
|
|
|
100
100
|
'sale.short_number_prefix'?: string | null;
|
|
101
101
|
'sale.sale_number_prefix'?: string | null;
|
|
102
102
|
'sale.enabled_item_rules'?: number[];
|
|
103
|
+
'fulfillment.enable_adjust_session_on_arrival'?: boolean | 0 | 1;
|
|
104
|
+
'fulfillment.max_earlier_shift_minutes'?: number | string;
|
|
105
|
+
'fulfillment.max_later_shift_minutes'?: number | string;
|
|
103
106
|
'fulfillment.enable_pickup'?: boolean;
|
|
104
107
|
'fulfillment.handover_mode'?: string[];
|
|
105
108
|
'fulfillment.pickup.timing_mode'?: 'asap_only' | 'scheduled_only' | 'asap_and_scheduled';
|
|
@@ -33,7 +33,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
33
33
|
import { loadSalesOrderSnapshot } from "../../shared/sales/loadSalesOrderSnapshot";
|
|
34
34
|
import { BaseModule } from "../BaseModule";
|
|
35
35
|
import { OrderHooks } from "./types";
|
|
36
|
-
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";
|
|
36
|
+
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";
|
|
37
37
|
import { isNormalProduct } from "../Product/utils";
|
|
38
38
|
import { ensureHolderRelationUuids, getProductHolderRelations, hasProductBooking, removeProductHolderRelations, replaceProductHolderRelations, restoreLegacyHolderRelations } from "./holderRelations";
|
|
39
39
|
import { getWeighedProductPriceFingerprint, resolveWeighedSourcePrice, withOriginalBundleOptionPrices } from "./utils/weighedProduct";
|
|
@@ -7049,6 +7049,7 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
7049
7049
|
}, {
|
|
7050
7050
|
key: "updateOrderBooking",
|
|
7051
7051
|
value: function updateOrderBooking(params) {
|
|
7052
|
+
var _targetBooking$metada;
|
|
7052
7053
|
var unique_identification_number = params.unique_identification_number,
|
|
7053
7054
|
updates = params.updates;
|
|
7054
7055
|
var tempOrder = this.ensureTempOrder();
|
|
@@ -7059,7 +7060,9 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
7059
7060
|
}
|
|
7060
7061
|
var targetBooking = tempOrder.bookings[bookingIndex] || {};
|
|
7061
7062
|
var nextBooking = _objectSpread(_objectSpread(_objectSpread({}, targetBooking), updates), {}, {
|
|
7062
|
-
metadata: _objectSpread(_objectSpread(_objectSpread({}, targetBooking.metadata || {}), updates.metadata || {}),
|
|
7063
|
+
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 ? {
|
|
7064
|
+
is_change_by_redeem: 1
|
|
7065
|
+
} : {}), {}, {
|
|
7063
7066
|
unique_identification_number: bookingUid
|
|
7064
7067
|
})
|
|
7065
7068
|
});
|
|
@@ -8938,7 +8941,7 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
8938
8941
|
if ((options === null || options === void 0 ? void 0 : options.ensureIdentity) !== false) {
|
|
8939
8942
|
this.ensureExternalSaleNumber(nextTempOrder);
|
|
8940
8943
|
}
|
|
8941
|
-
nextTempOrder.vouchers = raw.vouchers || [];
|
|
8944
|
+
nextTempOrder.vouchers = restoreRedeemVoucherTimes(nextTempOrder, raw.vouchers || []);
|
|
8942
8945
|
return nextTempOrder;
|
|
8943
8946
|
}
|
|
8944
8947
|
}, {
|
|
@@ -644,7 +644,7 @@ export interface SubmitSalesOrderParams {
|
|
|
644
644
|
holder_relations?: OrderHolderRelation[];
|
|
645
645
|
bookings: OrderSubmitBooking[];
|
|
646
646
|
payments: any[];
|
|
647
|
-
vouchers
|
|
647
|
+
vouchers?: any[];
|
|
648
648
|
surcharges?: any[];
|
|
649
649
|
relation_forms: any[];
|
|
650
650
|
form_record_ids?: OrderSubmitFormRecord[];
|
|
@@ -208,6 +208,10 @@ export declare const getAllDiscountList: (cartItem: CartItem) => any;
|
|
|
208
208
|
export { createUuidV4 };
|
|
209
209
|
export declare function isTempOrder(data: any): data is OrderTempOrder;
|
|
210
210
|
export declare function formatDateTime(date: Date): string;
|
|
211
|
+
/** 旧票券可能没有事件 ID;缺失或占位值不能用于关联预约。 */
|
|
212
|
+
export declare function redeemEventKey(value: unknown): string | undefined;
|
|
213
|
+
/** checkout 提交子预约的标记;重新加载订单时,从已调时的子预约恢复关联票券的票面时段。 */
|
|
214
|
+
export declare function restoreRedeemVoucherTimes(order: Pick<OrderTempOrder, 'bookings'>, vouchers: any[]): any[];
|
|
211
215
|
export declare function normalizeBookingIsAll(booking: Record<string, any>): 0 | 1;
|
|
212
216
|
export declare function normalizeBookingSubType(booking: Record<string, any>): string;
|
|
213
217
|
export declare function normalizeSubmitBooking<T extends {
|
|
@@ -1297,7 +1297,59 @@ function normalizeSubmitProduct(product) {
|
|
|
1297
1297
|
payment_price: formatOptions.virtualSettlementMode ? virtualPrice : (_submitProduct$paymen = submitProduct.payment_price) !== null && _submitProduct$paymen !== void 0 ? _submitProduct$paymen : submitProduct.selling_price
|
|
1298
1298
|
});
|
|
1299
1299
|
}
|
|
1300
|
-
|
|
1300
|
+
|
|
1301
|
+
/** 旧票券可能没有事件 ID;缺失或占位值不能用于关联预约。 */
|
|
1302
|
+
export function redeemEventKey(value) {
|
|
1303
|
+
if (typeof value !== 'number' && typeof value !== 'string') return;
|
|
1304
|
+
var key = String(value).trim();
|
|
1305
|
+
return /^[1-9]\d*$/.test(key) ? key : undefined;
|
|
1306
|
+
}
|
|
1307
|
+
|
|
1308
|
+
/** checkout 提交子预约的标记;重新加载订单时,从已调时的子预约恢复关联票券的票面时段。 */
|
|
1309
|
+
export function restoreRedeemVoucherTimes(order, vouchers) {
|
|
1310
|
+
if (!Array.isArray(vouchers) || !vouchers.length) return vouchers;
|
|
1311
|
+
var markedBookings = new Map();
|
|
1312
|
+
var _iterator7 = _createForOfIteratorHelper(order.bookings || []),
|
|
1313
|
+
_step7;
|
|
1314
|
+
try {
|
|
1315
|
+
for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
|
|
1316
|
+
var _booking$metadata;
|
|
1317
|
+
var booking = _step7.value;
|
|
1318
|
+
var event = redeemEventKey(booking === null || booking === void 0 ? void 0 : booking.schedule_event_id);
|
|
1319
|
+
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);
|
|
1320
|
+
}
|
|
1321
|
+
} catch (err) {
|
|
1322
|
+
_iterator7.e(err);
|
|
1323
|
+
} finally {
|
|
1324
|
+
_iterator7.f();
|
|
1325
|
+
}
|
|
1326
|
+
if (!markedBookings.size) return vouchers;
|
|
1327
|
+
var restored = vouchers;
|
|
1328
|
+
vouchers.forEach(function (voucher, index) {
|
|
1329
|
+
var event = redeemEventKey(voucher === null || voucher === void 0 ? void 0 : voucher.schedule_event_id);
|
|
1330
|
+
var booking = event && markedBookings.get(event);
|
|
1331
|
+
if (!booking || !booking.start_time || !booking.end_time) return;
|
|
1332
|
+
var times = _objectSpread(_objectSpread({
|
|
1333
|
+
start_time: booking.start_time,
|
|
1334
|
+
end_time: booking.end_time
|
|
1335
|
+
}, booking.start_date && {
|
|
1336
|
+
start_date: booking.start_date
|
|
1337
|
+
}), booking.end_date && {
|
|
1338
|
+
expire_date: booking.end_date
|
|
1339
|
+
});
|
|
1340
|
+
var timeChanged = Object.entries(times).some(function (_ref39) {
|
|
1341
|
+
var _ref40 = _slicedToArray(_ref39, 2),
|
|
1342
|
+
key = _ref40[0],
|
|
1343
|
+
value = _ref40[1];
|
|
1344
|
+
return voucher[key] !== value;
|
|
1345
|
+
});
|
|
1346
|
+
if (!timeChanged) return;
|
|
1347
|
+
if (restored === vouchers) restored = vouchers.slice();
|
|
1348
|
+
restored[index] = _objectSpread(_objectSpread({}, voucher), times);
|
|
1349
|
+
});
|
|
1350
|
+
return restored;
|
|
1351
|
+
}
|
|
1352
|
+
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'];
|
|
1301
1353
|
export function normalizeBookingIsAll(booking) {
|
|
1302
1354
|
return booking.is_all === true || booking.is_all === 1 || booking.is_all === '1' || booking.is_all === 'true' ? 1 : 0;
|
|
1303
1355
|
}
|
|
@@ -1311,19 +1363,19 @@ export function normalizeBookingSubType(booking) {
|
|
|
1311
1363
|
export function normalizeSubmitBooking(booking) {
|
|
1312
1364
|
var rawMetadata = booking.metadata || {};
|
|
1313
1365
|
var cleanMetadata = {};
|
|
1314
|
-
var
|
|
1315
|
-
|
|
1366
|
+
var _iterator8 = _createForOfIteratorHelper(SUBMIT_BOOKING_METADATA_WHITELIST),
|
|
1367
|
+
_step8;
|
|
1316
1368
|
try {
|
|
1317
|
-
for (
|
|
1318
|
-
var key =
|
|
1369
|
+
for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
|
|
1370
|
+
var key = _step8.value;
|
|
1319
1371
|
if (rawMetadata[key] !== undefined) {
|
|
1320
1372
|
cleanMetadata[key] = rawMetadata[key];
|
|
1321
1373
|
}
|
|
1322
1374
|
}
|
|
1323
1375
|
} catch (err) {
|
|
1324
|
-
|
|
1376
|
+
_iterator8.e(err);
|
|
1325
1377
|
} finally {
|
|
1326
|
-
|
|
1378
|
+
_iterator8.f();
|
|
1327
1379
|
}
|
|
1328
1380
|
if (cleanMetadata.holder_id === undefined && !isFulfillmentTimingBooking(booking)) {
|
|
1329
1381
|
cleanMetadata.holder_id = null;
|
|
@@ -1473,7 +1525,7 @@ export function resolveSubmitOrderType(params) {
|
|
|
1473
1525
|
return 'virtual';
|
|
1474
1526
|
}
|
|
1475
1527
|
export function buildSubmitPayload(params) {
|
|
1476
|
-
var _tempOrder$metadata2, _tempOrder$customer_i, _tempOrder$country_ca, _tempOrder$phone, _tempOrder$email, _tempOrder$order_numb, _tempOrder$shop_order, _tempOrder$shop_full_,
|
|
1528
|
+
var _tempOrder$metadata2, _tempOrder$customer_i, _tempOrder$country_ca, _tempOrder$phone, _tempOrder$email, _tempOrder$order_numb, _tempOrder$shop_order, _tempOrder$shop_full_, _ref42, _tempOrder$is_price_i, _tempOrder$is_deposit, _tempOrder$_extend, _enhancedPayload$summ;
|
|
1477
1529
|
var tempOrder = params.tempOrder,
|
|
1478
1530
|
cacheId = params.cacheId,
|
|
1479
1531
|
_params$now = params.now,
|
|
@@ -1488,29 +1540,29 @@ export function buildSubmitPayload(params) {
|
|
|
1488
1540
|
var scheduleDate = tempOrder.schedule_date || tempOrder.created_at || formatDateTime(now);
|
|
1489
1541
|
var bookingUuid = createUuidV4();
|
|
1490
1542
|
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';
|
|
1491
|
-
var
|
|
1492
|
-
_extend =
|
|
1493
|
-
_relationId =
|
|
1494
|
-
_tableFormId =
|
|
1495
|
-
_resourceId =
|
|
1496
|
-
_summary =
|
|
1497
|
-
_lastOrderInfo =
|
|
1498
|
-
_paidAmount =
|
|
1499
|
-
_shopId =
|
|
1500
|
-
_shopNote =
|
|
1501
|
-
_shopServiceType =
|
|
1502
|
-
_startTime =
|
|
1503
|
-
_customer =
|
|
1504
|
-
_discountList =
|
|
1505
|
-
_orderMetaList =
|
|
1506
|
-
_rootTaxFee =
|
|
1507
|
-
_totalAmount =
|
|
1508
|
-
_totalRefundAmount =
|
|
1509
|
-
_createDate =
|
|
1510
|
-
_holderId =
|
|
1511
|
-
_paymentStatus =
|
|
1512
|
-
_notes =
|
|
1513
|
-
tempOrderRest = _objectWithoutProperties(
|
|
1543
|
+
var _ref41 = tempOrder,
|
|
1544
|
+
_extend = _ref41._extend,
|
|
1545
|
+
_relationId = _ref41.relation_id,
|
|
1546
|
+
_tableFormId = _ref41.table_form_id,
|
|
1547
|
+
_resourceId = _ref41.resource_id,
|
|
1548
|
+
_summary = _ref41.summary,
|
|
1549
|
+
_lastOrderInfo = _ref41.lastOrderInfo,
|
|
1550
|
+
_paidAmount = _ref41.paid_amount,
|
|
1551
|
+
_shopId = _ref41.shop_id,
|
|
1552
|
+
_shopNote = _ref41.shop_note,
|
|
1553
|
+
_shopServiceType = _ref41.shop_service_type,
|
|
1554
|
+
_startTime = _ref41.start_time,
|
|
1555
|
+
_customer = _ref41.customer,
|
|
1556
|
+
_discountList = _ref41.discount_list,
|
|
1557
|
+
_orderMetaList = _ref41.order_meta_list,
|
|
1558
|
+
_rootTaxFee = _ref41.tax_fee,
|
|
1559
|
+
_totalAmount = _ref41.total_amount,
|
|
1560
|
+
_totalRefundAmount = _ref41.total_refund_amount,
|
|
1561
|
+
_createDate = _ref41.create_date,
|
|
1562
|
+
_holderId = _ref41.holder_id,
|
|
1563
|
+
_paymentStatus = _ref41.payment_status,
|
|
1564
|
+
_notes = _ref41.notes,
|
|
1565
|
+
tempOrderRest = _objectWithoutProperties(_ref41, _excluded4);
|
|
1514
1566
|
var resolvedBusinessCode = businessCode !== null && businessCode !== void 0 ? businessCode : tempOrder.business_code;
|
|
1515
1567
|
var normalizedOrderMetaList = normalizeOrderMetaList(tempOrder.order_meta_list);
|
|
1516
1568
|
var submitType = resolveSubmitOrderType({
|
|
@@ -1537,7 +1589,7 @@ export function buildSubmitPayload(params) {
|
|
|
1537
1589
|
type: submitType,
|
|
1538
1590
|
business_code: resolvedBusinessCode,
|
|
1539
1591
|
sales_channel: tempOrder.sales_channel || 'my_pisel',
|
|
1540
|
-
order_sales_channel: (
|
|
1592
|
+
order_sales_channel: (_ref42 = channel !== null && channel !== void 0 ? channel : tempOrder.order_sales_channel) !== null && _ref42 !== void 0 ? _ref42 : 'online_store',
|
|
1541
1593
|
status: tempOrder.status || 'normal'
|
|
1542
1594
|
}, params.includePaymentStatus !== false ? {
|
|
1543
1595
|
payment_status: tempOrder.payment_status || 'payment_processing'
|
|
@@ -1565,13 +1617,13 @@ export function buildSubmitPayload(params) {
|
|
|
1565
1617
|
// holder: tempOrder.holder || null,
|
|
1566
1618
|
summary: summary || tempOrder.summary || createEmptySummary(),
|
|
1567
1619
|
metadata: function () {
|
|
1568
|
-
var
|
|
1569
|
-
_collectPax =
|
|
1570
|
-
_tableOccupancyDuration =
|
|
1571
|
-
_cartSettlementKey =
|
|
1572
|
-
_cartSettlementSnapshot =
|
|
1573
|
-
_legalCurrencySnapshot =
|
|
1574
|
-
rest = _objectWithoutProperties(
|
|
1620
|
+
var _ref43 = tempOrder.metadata || {},
|
|
1621
|
+
_collectPax = _ref43.collect_pax,
|
|
1622
|
+
_tableOccupancyDuration = _ref43.table_occupancy_duration,
|
|
1623
|
+
_cartSettlementKey = _ref43.cart_settlement_key,
|
|
1624
|
+
_cartSettlementSnapshot = _ref43.cart_settlement_snapshot,
|
|
1625
|
+
_legalCurrencySnapshot = _ref43.legal_currency_snapshot,
|
|
1626
|
+
rest = _objectWithoutProperties(_ref43, _excluded5);
|
|
1575
1627
|
return _objectSpread({}, rest);
|
|
1576
1628
|
}()
|
|
1577
1629
|
}, (_tempOrder$_extend = tempOrder._extend) !== null && _tempOrder$_extend !== void 0 && (_tempOrder$_extend = _tempOrder$_extend.salesNotesState) !== null && _tempOrder$_extend !== void 0 && _tempOrder$_extend.dirty ? {
|
|
@@ -1729,25 +1781,25 @@ export function clearTempOrderHolderAssignments(tempOrder) {
|
|
|
1729
1781
|
changed = true;
|
|
1730
1782
|
}
|
|
1731
1783
|
};
|
|
1732
|
-
var
|
|
1733
|
-
|
|
1784
|
+
var _iterator9 = _createForOfIteratorHelper(tempOrder.products || []),
|
|
1785
|
+
_step9;
|
|
1734
1786
|
try {
|
|
1735
|
-
for (
|
|
1736
|
-
var product =
|
|
1787
|
+
for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
|
|
1788
|
+
var product = _step9.value;
|
|
1737
1789
|
if (product.metadata && _typeof(product.metadata) === 'object') {
|
|
1738
1790
|
clearHolder(product.metadata);
|
|
1739
1791
|
}
|
|
1740
1792
|
}
|
|
1741
1793
|
} catch (err) {
|
|
1742
|
-
|
|
1794
|
+
_iterator9.e(err);
|
|
1743
1795
|
} finally {
|
|
1744
|
-
|
|
1796
|
+
_iterator9.f();
|
|
1745
1797
|
}
|
|
1746
|
-
var
|
|
1747
|
-
|
|
1798
|
+
var _iterator10 = _createForOfIteratorHelper(tempOrder.bookings || []),
|
|
1799
|
+
_step10;
|
|
1748
1800
|
try {
|
|
1749
|
-
for (
|
|
1750
|
-
var booking =
|
|
1801
|
+
for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
|
|
1802
|
+
var booking = _step10.value;
|
|
1751
1803
|
var bookingRecord = booking;
|
|
1752
1804
|
if (booking.metadata && _typeof(booking.metadata) === 'object') {
|
|
1753
1805
|
resetHolderField(booking.metadata);
|
|
@@ -1758,9 +1810,9 @@ export function clearTempOrderHolderAssignments(tempOrder) {
|
|
|
1758
1810
|
}
|
|
1759
1811
|
}
|
|
1760
1812
|
} catch (err) {
|
|
1761
|
-
|
|
1813
|
+
_iterator10.e(err);
|
|
1762
1814
|
} finally {
|
|
1763
|
-
|
|
1815
|
+
_iterator10.f();
|
|
1764
1816
|
}
|
|
1765
1817
|
var productsByUid = (_tempOrder$_extend2 = tempOrder._extend) === null || _tempOrder$_extend2 === void 0 ? void 0 : _tempOrder$_extend2.productsByUid;
|
|
1766
1818
|
if (productsByUid && _typeof(productsByUid) === 'object') {
|
|
@@ -1801,8 +1853,8 @@ export function getRuntimeProductOrigin(tempOrder, product) {
|
|
|
1801
1853
|
return tempOrder._extend.productsByUid[uid].origin;
|
|
1802
1854
|
}
|
|
1803
1855
|
var matchedProduct = ((tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.products) || []).find(function (item) {
|
|
1804
|
-
var
|
|
1805
|
-
return item === product || getOrderProductLineUid(item) === uid || String((
|
|
1856
|
+
var _ref44, _item$product_id, _ref45, _product$product_id;
|
|
1857
|
+
return item === product || getOrderProductLineUid(item) === uid || String((_ref44 = (_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 && _ref44 !== void 0 ? _ref44 : '') === String((_ref45 = (_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 && _ref45 !== void 0 ? _ref45 : '');
|
|
1806
1858
|
});
|
|
1807
1859
|
var matchedUid = matchedProduct ? getOrderProductLineUid(matchedProduct) : '';
|
|
1808
1860
|
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(): "
|
|
52
|
+
getProductType(): "normal" | "duration" | "session";
|
|
53
53
|
}
|
|
@@ -418,7 +418,7 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
|
|
|
418
418
|
key: "loadVenueCatalogPool",
|
|
419
419
|
value: (function () {
|
|
420
420
|
var _loadVenueCatalogPool = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
|
|
421
|
-
var _this$otherParams5, _params$product_ids, _params$category_ids, _params$extension_typ, _ref4, _data$total;
|
|
421
|
+
var _this$otherParams5, _params$product_ids, _params$category_ids, _params$extension_typ, _ref4, _ref5, _data$total;
|
|
422
422
|
var params,
|
|
423
423
|
channelMap,
|
|
424
424
|
channel,
|
|
@@ -469,6 +469,9 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
|
|
|
469
469
|
} : {}), {}, {
|
|
470
470
|
front_end_cache_id: params.cacheId
|
|
471
471
|
}), {
|
|
472
|
+
// Core dispatches Kiosk to its local product query; PC/H5 without that
|
|
473
|
+
// route keep using HTTP. open_quotation: 0 preserves the raw venue pool.
|
|
474
|
+
osServer: true,
|
|
472
475
|
useCache: false,
|
|
473
476
|
customToast: function customToast() {}
|
|
474
477
|
});
|
|
@@ -483,7 +486,7 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
|
|
|
483
486
|
code: 'VENUE_CATALOG_LOAD_FAILED'
|
|
484
487
|
});
|
|
485
488
|
case 9:
|
|
486
|
-
total = (_ref4 = (_data$total = data.total) !== null && _data$total !== void 0 ? _data$total : data.total_count) !== null && _ref4 !== void 0 ? _ref4 : data.
|
|
489
|
+
total = (_ref4 = (_ref5 = (_data$total = data.total) !== null && _data$total !== void 0 ? _data$total : data.total_count) !== null && _ref5 !== void 0 ? _ref5 : data.total_num) !== null && _ref4 !== void 0 ? _ref4 : data.count;
|
|
487
490
|
if (!(total != null && Number.isFinite(Number(total)) && Number(total) > data.list.length || total == null && data.list.length >= 500)) {
|
|
488
491
|
_context7.next = 12;
|
|
489
492
|
break;
|
package/dist/server/index.d.ts
CHANGED
|
@@ -286,6 +286,7 @@ declare class Server {
|
|
|
286
286
|
* 存储订阅者信息,便于数据变更时推送最新结果
|
|
287
287
|
*/
|
|
288
288
|
private handleProductQuery;
|
|
289
|
+
private queryRawKioskProductPool;
|
|
289
290
|
/**
|
|
290
291
|
* ProductList callers such as standalone retail pages do not always have a selected schedule.
|
|
291
292
|
* In that case query against the current local time so menu availability can still be evaluated.
|