@pisell/pisellos 2.3.172 → 2.3.174
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/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/model/strategy/adapter/promotion/evaluator.d.ts +2 -1
- package/dist/model/strategy/adapter/promotion/evaluator.js +14 -8
- package/dist/modules/BookingContext/utils/productExtend.d.ts +5 -0
- package/dist/modules/BookingContext/utils/productExtend.js +61 -23
- package/dist/modules/Discount/index.js +0 -1
- package/dist/modules/OpenData/index.d.ts +1 -0
- package/dist/modules/OpenData/index.js +1 -0
- package/dist/modules/OpenData/salesSettings.d.ts +32 -0
- package/dist/modules/OpenData/salesSettings.js +80 -0
- package/dist/modules/OpenData/types.d.ts +13 -0
- package/dist/modules/Order/index.d.ts +3 -25
- package/dist/modules/Order/index.js +1313 -1772
- package/dist/modules/Order/types.d.ts +0 -7
- package/dist/modules/Order/utils/discountProductLineIdentity.js +2 -2
- package/dist/modules/ProductList/index.js +12 -33
- package/dist/modules/Rules/index.d.ts +0 -2
- package/dist/modules/Rules/index.js +21 -29
- package/dist/solution/BaseSales/index.d.ts +1 -16
- package/dist/solution/BaseSales/index.js +1325 -1511
- package/dist/solution/BookingTicket/index.d.ts +2 -2
- package/dist/solution/BookingTicket/index.js +108 -200
- package/dist/solution/BookingTicket/types.d.ts +2 -14
- package/dist/solution/BookingTicket/utils/addProductDecision.d.ts +1 -1
- package/dist/solution/BookingTicket/utils/addProductDecision.js +3 -4
- package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +58 -94
- package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +0 -1
- package/dist/solution/BookingTicket/utils/scan/handleScan.js +1 -2
- package/dist/solution/UnifiedBookingSales/index.d.ts +23 -2
- package/dist/solution/UnifiedBookingSales/index.js +923 -683
- package/dist/solution/UnifiedBookingSales/salesSettings.d.ts +16 -0
- package/dist/solution/UnifiedBookingSales/salesSettings.js +81 -0
- package/dist/utils/platform.d.ts +0 -2
- package/dist/utils/platform.js +0 -6
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -12
- package/lib/model/strategy/adapter/promotion/evaluator.d.ts +2 -1
- package/lib/model/strategy/adapter/promotion/evaluator.js +13 -7
- package/lib/modules/BookingContext/utils/productExtend.d.ts +5 -0
- package/lib/modules/BookingContext/utils/productExtend.js +36 -3
- package/lib/modules/Discount/index.js +0 -1
- package/lib/modules/OpenData/index.d.ts +1 -0
- package/lib/modules/OpenData/index.js +12 -0
- package/lib/modules/OpenData/salesSettings.d.ts +32 -0
- package/lib/modules/OpenData/salesSettings.js +70 -0
- package/lib/modules/OpenData/types.d.ts +13 -0
- package/lib/modules/Order/index.d.ts +3 -25
- package/lib/modules/Order/index.js +38 -192
- package/lib/modules/Order/types.d.ts +0 -7
- package/lib/modules/Order/utils/discountProductLineIdentity.js +1 -1
- package/lib/modules/ProductList/index.js +0 -15
- package/lib/modules/Rules/index.d.ts +0 -2
- package/lib/modules/Rules/index.js +0 -6
- package/lib/solution/BaseSales/index.d.ts +1 -16
- package/lib/solution/BaseSales/index.js +9 -89
- package/lib/solution/BookingTicket/index.d.ts +2 -2
- package/lib/solution/BookingTicket/index.js +2 -38
- package/lib/solution/BookingTicket/types.d.ts +2 -14
- package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +1 -1
- package/lib/solution/BookingTicket/utils/addProductDecision.js +3 -4
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +2 -14
- package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +0 -1
- package/lib/solution/BookingTicket/utils/scan/handleScan.js +1 -2
- package/lib/solution/UnifiedBookingSales/index.d.ts +23 -2
- package/lib/solution/UnifiedBookingSales/index.js +131 -15
- package/lib/solution/UnifiedBookingSales/salesSettings.d.ts +16 -0
- package/lib/solution/UnifiedBookingSales/salesSettings.js +72 -0
- package/lib/utils/platform.d.ts +0 -2
- package/lib/utils/platform.js +0 -7
- package/package.json +1 -1
- package/dist/inventory/index.d.ts +0 -92
- package/dist/inventory/index.js +0 -509
- package/dist/modules/Order/utils/productVoucherGroups.d.ts +0 -15
- package/dist/modules/Order/utils/productVoucherGroups.js +0 -115
- package/dist/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.d.ts +0 -10
- package/dist/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.js +0 -117
- package/lib/inventory/index.d.ts +0 -92
- package/lib/inventory/index.js +0 -287
- package/lib/modules/Order/utils/productVoucherGroups.d.ts +0 -15
- package/lib/modules/Order/utils/productVoucherGroups.js +0 -64
- package/lib/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.d.ts +0 -10
- package/lib/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.js +0 -71
|
@@ -208,10 +208,6 @@ export interface AddAddTimeProductsToBookingInput {
|
|
|
208
208
|
}
|
|
209
209
|
/** 扫码宿主桥接:SalesSdk 在 pubsub 订阅回调里注入,OS 需要 UI 时直接调用 */
|
|
210
210
|
export interface GlobalScanHostBridge {
|
|
211
|
-
/** product-voucher handles voucher codes only; product-voucher-collection also resolves wallet customer vouchers. */
|
|
212
|
-
scanScope?: 'all' | 'product-voucher' | 'product-voucher-collection';
|
|
213
|
-
/** A one-shot entry may outlive its page while requests are in flight. */
|
|
214
|
-
isCurrent?: () => boolean;
|
|
215
211
|
openProductDetail?: (payload: Record<string, any>) => Promise<any | null>;
|
|
216
212
|
openBookingEdit?: (payload: Record<string, any>) => Promise<any | null>;
|
|
217
213
|
confirmDetail?: (input: {
|
|
@@ -236,13 +232,11 @@ export interface GlobalScanHostBridge {
|
|
|
236
232
|
*/
|
|
237
233
|
applyPromotionCode?: (code: string, customerId?: number, options?: {
|
|
238
234
|
suppressFailureNotification?: boolean;
|
|
239
|
-
productVouchersOnly?: boolean;
|
|
240
235
|
}) => Promise<{
|
|
241
236
|
isAvailable?: boolean;
|
|
242
237
|
isAccepted?: boolean;
|
|
243
238
|
type?: string;
|
|
244
239
|
unavailableReason?: string;
|
|
245
|
-
scannedDiscountList?: Record<string, any>[];
|
|
246
240
|
}>;
|
|
247
241
|
/** 当前订单已有其他客户时,由宿主复用客户组件完成确认及切换。 */
|
|
248
242
|
requestCustomerSwitch?: (customer: ICustomer) => Promise<boolean | null>;
|
|
@@ -250,7 +244,7 @@ export interface GlobalScanHostBridge {
|
|
|
250
244
|
refresh?: () => void;
|
|
251
245
|
}
|
|
252
246
|
/** handleGlobalScanCode 结构化返回 */
|
|
253
|
-
export type GlobalScanHandleResult =
|
|
247
|
+
export type GlobalScanHandleResult = {
|
|
254
248
|
status: 'success';
|
|
255
249
|
kind: 'customer' | 'products' | 'promotion';
|
|
256
250
|
meta?: {
|
|
@@ -263,11 +257,5 @@ export type GlobalScanHandleResult = ({
|
|
|
263
257
|
status: 'cancelled';
|
|
264
258
|
} | {
|
|
265
259
|
status: 'failed';
|
|
266
|
-
reason: 'empty_code' | 'not_found' | 'invalid_data' | 'no_bridge'
|
|
267
|
-
}) & {
|
|
268
|
-
/** product-voucher-collection returns voucher candidates; the caller decides how to use them. */
|
|
269
|
-
redemption?: {
|
|
270
|
-
source: 'wallet' | 'scan';
|
|
271
|
-
vouchers: Record<string, any>[];
|
|
272
|
-
};
|
|
260
|
+
reason: 'empty_code' | 'not_found' | 'invalid_data' | 'no_bridge';
|
|
273
261
|
};
|
|
@@ -5,7 +5,7 @@ import type { OrderProduct, OrderProductIdentity, AddProductBookingInput } from
|
|
|
5
5
|
* cart.addProduct 两阶段决策(与 ticketBooking `handleSelectProduct` 对齐):
|
|
6
6
|
*
|
|
7
7
|
* 1. `requiresDetail`:规格 / SKU / 套餐 / Session / 称重弹窗(门禁:`isOpenDetailModal` / `cartDetailValue` / `open_sold_weight`)
|
|
8
|
-
* 2. `requiresBookingEdit`:资源 /
|
|
8
|
+
* 2. `requiresBookingEdit`:资源 / 时间编辑抽屉(kiosk 强制进入;其他渠道由 `getIsAutoClose` 决定)
|
|
9
9
|
* 3. `add`:两关均通过,直接 transform + 加车
|
|
10
10
|
*/
|
|
11
11
|
export type AddProductDecision = {
|
|
@@ -8,13 +8,12 @@ import dayjs from 'dayjs';
|
|
|
8
8
|
import { cacheItemToBookingInput, derivePresetStartTimeFromDate, getProductExtend, getIsAutoClose, isSessionProduct, isBookingProduct, applySessionTimesToExtend, hasActualResourceSelection, productNeedsResourceExtend } from "../../../modules/BookingContext";
|
|
9
9
|
import { transformBaseProductToOrderProduct } from "../../BaseSales/utils/transformBaseProductToOrderProduct";
|
|
10
10
|
import { buildProductSkuFromCacheItem } from "./weighingProductSku";
|
|
11
|
-
import { isSelfServicePlatform } from "../../../utils/platform";
|
|
12
11
|
|
|
13
12
|
/**
|
|
14
13
|
* cart.addProduct 两阶段决策(与 ticketBooking `handleSelectProduct` 对齐):
|
|
15
14
|
*
|
|
16
15
|
* 1. `requiresDetail`:规格 / SKU / 套餐 / Session / 称重弹窗(门禁:`isOpenDetailModal` / `cartDetailValue` / `open_sold_weight`)
|
|
17
|
-
* 2. `requiresBookingEdit`:资源 /
|
|
16
|
+
* 2. `requiresBookingEdit`:资源 / 时间编辑抽屉(kiosk 强制进入;其他渠道由 `getIsAutoClose` 决定)
|
|
18
17
|
* 3. `add`:两关均通过,直接 transform + 加车
|
|
19
18
|
*/
|
|
20
19
|
|
|
@@ -31,11 +30,11 @@ function needsSpecDetailModal(item) {
|
|
|
31
30
|
}
|
|
32
31
|
|
|
33
32
|
/**
|
|
34
|
-
* 第二段:预约商品是否仍需打开资源 /
|
|
33
|
+
* 第二段:预约商品是否仍需打开资源 / 时间编辑(kiosk 强制打开,其他渠道与 info2 `cacheItem.autoClose` 等价)。
|
|
35
34
|
*/
|
|
36
35
|
function needsBookingEdit(cacheItem, ctx) {
|
|
37
36
|
if (isNormalBookingProduct(cacheItem)) return false;
|
|
38
|
-
if (
|
|
37
|
+
if ((ctx === null || ctx === void 0 ? void 0 : ctx.channel) === 'kiosk') return true;
|
|
39
38
|
var isAutoAllocationOn = (ctx === null || ctx === void 0 ? void 0 : ctx.isAutoAllocationOn) || function () {
|
|
40
39
|
return true;
|
|
41
40
|
};
|
|
@@ -210,7 +210,7 @@ export function applyGlobalScan(_x14, _x15, _x16) {
|
|
|
210
210
|
}
|
|
211
211
|
function _applyGlobalScan() {
|
|
212
212
|
_applyGlobalScan = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(host, formatted, bridge) {
|
|
213
|
-
var searchType, data, scanCode, formattedCustomerId, isCrossShopWallet, isWalletPassUnavailableAtStore, _getRealCustomerId, _bridge$onNotify5, currentCustomer, currentCustomerId, _customer, sourceCustomerId, _bridge$onNotify, _bridge$onNotify2, _customerId, _bridge$onNotify3, orderCustomer, switched, _bridge$onNotify4,
|
|
213
|
+
var searchType, data, scanCode, formattedCustomerId, isCrossShopWallet, isWalletPassUnavailableAtStore, _getRealCustomerId, _bridge$onNotify5, currentCustomer, currentCustomerId, _customer, sourceCustomerId, _bridge$onNotify, _bridge$onNotify2, _customerId, _bridge$onNotify3, orderCustomer, switched, _bridge$onNotify4, _promotionResult$isAc, _bridge$onNotify6, snapshot, activeCustomer, bindWalletPassCustomer, trySelectWalletAsset, bindResult, walletSelection, promotionCustomerId, promotionResult, list, _bridge$onNotify12, addedCount, _iterator, _step, _item, outcome, _bridge$onNotify13, _data$order_id, _data$business_code, orderId, _bridge$onNotify14;
|
|
214
214
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
215
215
|
while (1) switch (_context6.prev = _context6.next) {
|
|
216
216
|
case 0:
|
|
@@ -321,7 +321,7 @@ function _applyGlobalScan() {
|
|
|
321
321
|
});
|
|
322
322
|
case 44:
|
|
323
323
|
if (!(searchType === 'walletPass')) {
|
|
324
|
-
_context6.next =
|
|
324
|
+
_context6.next = 78;
|
|
325
325
|
break;
|
|
326
326
|
}
|
|
327
327
|
if (!isWalletPassUnavailableAtStore) {
|
|
@@ -495,111 +495,75 @@ function _applyGlobalScan() {
|
|
|
495
495
|
return bindWalletPassCustomer();
|
|
496
496
|
case 54:
|
|
497
497
|
bindResult = _context6.sent;
|
|
498
|
-
|
|
499
|
-
_context6.next = 61;
|
|
500
|
-
break;
|
|
501
|
-
}
|
|
502
|
-
_context6.next = 58;
|
|
503
|
-
return bridge.applyPromotionCode(scanCode, getRealCustomerId(activeCustomer), {
|
|
504
|
-
suppressFailureNotification: true,
|
|
505
|
-
productVouchersOnly: true
|
|
506
|
-
});
|
|
507
|
-
case 58:
|
|
508
|
-
_context6.t2 = _context6.sent;
|
|
509
|
-
_context6.next = 62;
|
|
510
|
-
break;
|
|
511
|
-
case 61:
|
|
512
|
-
_context6.t2 = undefined;
|
|
513
|
-
case 62:
|
|
514
|
-
collectionPromotion = _context6.t2;
|
|
515
|
-
if (!((_collectionPromotion$ = collectionPromotion === null || collectionPromotion === void 0 ? void 0 : collectionPromotion.isAccepted) !== null && _collectionPromotion$ !== void 0 ? _collectionPromotion$ : collectionPromotion === null || collectionPromotion === void 0 ? void 0 : collectionPromotion.isAvailable)) {
|
|
516
|
-
_context6.next = 65;
|
|
517
|
-
break;
|
|
518
|
-
}
|
|
519
|
-
return _context6.abrupt("return", {
|
|
520
|
-
status: 'success',
|
|
521
|
-
kind: 'promotion'
|
|
522
|
-
});
|
|
523
|
-
case 65:
|
|
524
|
-
_context6.next = 67;
|
|
498
|
+
_context6.next = 57;
|
|
525
499
|
return trySelectWalletAsset();
|
|
526
|
-
case
|
|
500
|
+
case 57:
|
|
527
501
|
walletSelection = _context6.sent;
|
|
528
502
|
if (!walletSelection) {
|
|
529
|
-
_context6.next =
|
|
503
|
+
_context6.next = 60;
|
|
530
504
|
break;
|
|
531
505
|
}
|
|
532
506
|
return _context6.abrupt("return", walletSelection);
|
|
533
|
-
case
|
|
507
|
+
case 60:
|
|
534
508
|
if (bridge !== null && bridge !== void 0 && bridge.applyPromotionCode) {
|
|
535
|
-
_context6.next =
|
|
509
|
+
_context6.next = 62;
|
|
536
510
|
break;
|
|
537
511
|
}
|
|
538
512
|
return _context6.abrupt("return", {
|
|
539
513
|
status: 'failed',
|
|
540
514
|
reason: 'no_bridge'
|
|
541
515
|
});
|
|
542
|
-
case
|
|
516
|
+
case 62:
|
|
543
517
|
promotionCustomerId = getRealCustomerId(activeCustomer);
|
|
544
|
-
if (!(collectionPromotion !== null && collectionPromotion !== void 0)) {
|
|
545
|
-
_context6.next = 77;
|
|
546
|
-
break;
|
|
547
|
-
}
|
|
548
|
-
_context6.t3 = collectionPromotion;
|
|
549
|
-
_context6.next = 87;
|
|
550
|
-
break;
|
|
551
|
-
case 77:
|
|
552
518
|
if (!bindResult.customerBound) {
|
|
553
|
-
_context6.next =
|
|
519
|
+
_context6.next = 69;
|
|
554
520
|
break;
|
|
555
521
|
}
|
|
556
|
-
_context6.next =
|
|
522
|
+
_context6.next = 66;
|
|
557
523
|
return bridge.applyPromotionCode(scanCode, promotionCustomerId, {
|
|
558
524
|
suppressFailureNotification: true
|
|
559
525
|
});
|
|
560
|
-
case
|
|
561
|
-
_context6.
|
|
562
|
-
_context6.next =
|
|
526
|
+
case 66:
|
|
527
|
+
_context6.t2 = _context6.sent;
|
|
528
|
+
_context6.next = 72;
|
|
563
529
|
break;
|
|
564
|
-
case
|
|
565
|
-
_context6.next =
|
|
530
|
+
case 69:
|
|
531
|
+
_context6.next = 71;
|
|
566
532
|
return bridge.applyPromotionCode(scanCode, promotionCustomerId);
|
|
567
|
-
case
|
|
568
|
-
_context6.
|
|
569
|
-
case
|
|
570
|
-
|
|
571
|
-
case 87:
|
|
572
|
-
promotionResult = _context6.t3;
|
|
533
|
+
case 71:
|
|
534
|
+
_context6.t2 = _context6.sent;
|
|
535
|
+
case 72:
|
|
536
|
+
promotionResult = _context6.t2;
|
|
573
537
|
if (!((_promotionResult$isAc = promotionResult === null || promotionResult === void 0 ? void 0 : promotionResult.isAccepted) !== null && _promotionResult$isAc !== void 0 ? _promotionResult$isAc : promotionResult === null || promotionResult === void 0 ? void 0 : promotionResult.isAvailable)) {
|
|
574
|
-
_context6.next =
|
|
538
|
+
_context6.next = 75;
|
|
575
539
|
break;
|
|
576
540
|
}
|
|
577
541
|
return _context6.abrupt("return", {
|
|
578
542
|
status: 'success',
|
|
579
543
|
kind: 'promotion'
|
|
580
544
|
});
|
|
581
|
-
case
|
|
545
|
+
case 75:
|
|
582
546
|
if (!bindResult.customerBound) {
|
|
583
|
-
_context6.next =
|
|
547
|
+
_context6.next = 77;
|
|
584
548
|
break;
|
|
585
549
|
}
|
|
586
550
|
return _context6.abrupt("return", {
|
|
587
551
|
status: 'success',
|
|
588
552
|
kind: 'customer'
|
|
589
553
|
});
|
|
590
|
-
case
|
|
554
|
+
case 77:
|
|
591
555
|
return _context6.abrupt("return", {
|
|
592
556
|
status: 'failed',
|
|
593
557
|
reason: 'invalid_data'
|
|
594
558
|
});
|
|
595
|
-
case
|
|
559
|
+
case 78:
|
|
596
560
|
if (!(searchType === 'product' || searchType === 'local_product')) {
|
|
597
|
-
_context6.next =
|
|
561
|
+
_context6.next = 111;
|
|
598
562
|
break;
|
|
599
563
|
}
|
|
600
564
|
list = data === null || data === void 0 ? void 0 : data.list;
|
|
601
565
|
if (!(!Array.isArray(list) || list.length === 0)) {
|
|
602
|
-
_context6.next =
|
|
566
|
+
_context6.next = 83;
|
|
603
567
|
break;
|
|
604
568
|
}
|
|
605
569
|
bridge === null || bridge === void 0 || (_bridge$onNotify12 = bridge.onNotify) === null || _bridge$onNotify12 === void 0 || _bridge$onNotify12.call(bridge, 'fail', 'pisell2.text.scan-global-failed');
|
|
@@ -607,57 +571,57 @@ function _applyGlobalScan() {
|
|
|
607
571
|
status: 'failed',
|
|
608
572
|
reason: 'invalid_data'
|
|
609
573
|
});
|
|
610
|
-
case
|
|
574
|
+
case 83:
|
|
611
575
|
addedCount = 0;
|
|
612
576
|
_iterator = _createForOfIteratorHelper(list);
|
|
613
|
-
_context6.prev =
|
|
577
|
+
_context6.prev = 85;
|
|
614
578
|
_iterator.s();
|
|
615
|
-
case
|
|
579
|
+
case 87:
|
|
616
580
|
if ((_step = _iterator.n()).done) {
|
|
617
|
-
_context6.next =
|
|
581
|
+
_context6.next = 99;
|
|
618
582
|
break;
|
|
619
583
|
}
|
|
620
584
|
_item = _step.value;
|
|
621
|
-
_context6.next =
|
|
585
|
+
_context6.next = 91;
|
|
622
586
|
return processScannedProductItem(host, _item, scanCode, bridge);
|
|
623
|
-
case
|
|
587
|
+
case 91:
|
|
624
588
|
outcome = _context6.sent;
|
|
625
589
|
if (outcome === 'added') {
|
|
626
590
|
addedCount += 1;
|
|
627
591
|
}
|
|
628
592
|
if (!(outcome === 'cancelled')) {
|
|
629
|
-
_context6.next =
|
|
593
|
+
_context6.next = 95;
|
|
630
594
|
break;
|
|
631
595
|
}
|
|
632
596
|
return _context6.abrupt("return", {
|
|
633
597
|
status: 'cancelled'
|
|
634
598
|
});
|
|
635
|
-
case
|
|
599
|
+
case 95:
|
|
636
600
|
if (!(outcome === 'pending')) {
|
|
637
|
-
_context6.next =
|
|
601
|
+
_context6.next = 97;
|
|
638
602
|
break;
|
|
639
603
|
}
|
|
640
604
|
return _context6.abrupt("return", {
|
|
641
605
|
status: 'pending',
|
|
642
606
|
kind: 'requiresDetail'
|
|
643
607
|
});
|
|
644
|
-
case
|
|
645
|
-
_context6.next =
|
|
608
|
+
case 97:
|
|
609
|
+
_context6.next = 87;
|
|
646
610
|
break;
|
|
647
|
-
case
|
|
648
|
-
_context6.next =
|
|
611
|
+
case 99:
|
|
612
|
+
_context6.next = 104;
|
|
649
613
|
break;
|
|
650
|
-
case
|
|
651
|
-
_context6.prev =
|
|
652
|
-
_context6.
|
|
653
|
-
_iterator.e(_context6.
|
|
654
|
-
case
|
|
655
|
-
_context6.prev =
|
|
614
|
+
case 101:
|
|
615
|
+
_context6.prev = 101;
|
|
616
|
+
_context6.t3 = _context6["catch"](85);
|
|
617
|
+
_iterator.e(_context6.t3);
|
|
618
|
+
case 104:
|
|
619
|
+
_context6.prev = 104;
|
|
656
620
|
_iterator.f();
|
|
657
|
-
return _context6.finish(
|
|
658
|
-
case
|
|
621
|
+
return _context6.finish(104);
|
|
622
|
+
case 107:
|
|
659
623
|
if (!(addedCount > 0)) {
|
|
660
|
-
_context6.next =
|
|
624
|
+
_context6.next = 110;
|
|
661
625
|
break;
|
|
662
626
|
}
|
|
663
627
|
bridge === null || bridge === void 0 || (_bridge$onNotify13 = bridge.onNotify) === null || _bridge$onNotify13 === void 0 || _bridge$onNotify13.call(bridge, 'success');
|
|
@@ -668,19 +632,19 @@ function _applyGlobalScan() {
|
|
|
668
632
|
count: addedCount
|
|
669
633
|
}
|
|
670
634
|
});
|
|
671
|
-
case
|
|
635
|
+
case 110:
|
|
672
636
|
return _context6.abrupt("return", {
|
|
673
637
|
status: 'failed',
|
|
674
638
|
reason: 'no_bridge'
|
|
675
639
|
});
|
|
676
|
-
case
|
|
640
|
+
case 111:
|
|
677
641
|
if (!(searchType === 'order')) {
|
|
678
|
-
_context6.next =
|
|
642
|
+
_context6.next = 120;
|
|
679
643
|
break;
|
|
680
644
|
}
|
|
681
645
|
orderId = (_data$order_id = data === null || data === void 0 ? void 0 : data.order_id) !== null && _data$order_id !== void 0 ? _data$order_id : data === null || data === void 0 ? void 0 : data.id;
|
|
682
646
|
if (orderId) {
|
|
683
|
-
_context6.next =
|
|
647
|
+
_context6.next = 116;
|
|
684
648
|
break;
|
|
685
649
|
}
|
|
686
650
|
bridge === null || bridge === void 0 || (_bridge$onNotify14 = bridge.onNotify) === null || _bridge$onNotify14 === void 0 || _bridge$onNotify14.call(bridge, 'fail', 'pisell2.text.scan-global-failed');
|
|
@@ -688,16 +652,16 @@ function _applyGlobalScan() {
|
|
|
688
652
|
status: 'failed',
|
|
689
653
|
reason: 'invalid_data'
|
|
690
654
|
});
|
|
691
|
-
case
|
|
655
|
+
case 116:
|
|
692
656
|
if (bridge !== null && bridge !== void 0 && bridge.openOrder) {
|
|
693
|
-
_context6.next =
|
|
657
|
+
_context6.next = 118;
|
|
694
658
|
break;
|
|
695
659
|
}
|
|
696
660
|
return _context6.abrupt("return", {
|
|
697
661
|
status: 'pending',
|
|
698
662
|
kind: 'openOrder'
|
|
699
663
|
});
|
|
700
|
-
case
|
|
664
|
+
case 118:
|
|
701
665
|
bridge.openOrder({
|
|
702
666
|
order_id: Number(orderId),
|
|
703
667
|
business_code: (_data$business_code = data === null || data === void 0 ? void 0 : data.business_code) !== null && _data$business_code !== void 0 ? _data$business_code : host.getBusinessCode()
|
|
@@ -706,16 +670,16 @@ function _applyGlobalScan() {
|
|
|
706
670
|
status: 'pending',
|
|
707
671
|
kind: 'openOrder'
|
|
708
672
|
});
|
|
709
|
-
case
|
|
673
|
+
case 120:
|
|
710
674
|
return _context6.abrupt("return", {
|
|
711
675
|
status: 'failed',
|
|
712
676
|
reason: 'invalid_data'
|
|
713
677
|
});
|
|
714
|
-
case
|
|
678
|
+
case 121:
|
|
715
679
|
case "end":
|
|
716
680
|
return _context6.stop();
|
|
717
681
|
}
|
|
718
|
-
}, _callee6, null, [[10, 16], [30, 37], [
|
|
682
|
+
}, _callee6, null, [[10, 16], [30, 37], [85, 101, 104, 107]]);
|
|
719
683
|
}));
|
|
720
684
|
return _applyGlobalScan.apply(this, arguments);
|
|
721
685
|
}
|
|
@@ -10,7 +10,6 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
|
|
|
10
10
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
11
11
|
import { searchWalletPass, searchWallet, searchProduct, searchOrder } from "./cloudSearch";
|
|
12
12
|
import scanCache from "./scanCache";
|
|
13
|
-
import { isSelfServicePlatform } from "../../../../utils/platform";
|
|
14
13
|
|
|
15
14
|
/**
|
|
16
15
|
* Promise.any 的替代实现
|
|
@@ -162,7 +161,7 @@ export var handleGlobalScan = function handleGlobalScan(request, localSearch, ch
|
|
|
162
161
|
if (value.startsWith('WL')) {
|
|
163
162
|
requestList = [searchWallet(request, value)];
|
|
164
163
|
} else {
|
|
165
|
-
requestList = [].concat(_toConsumableArray(
|
|
164
|
+
requestList = [].concat(_toConsumableArray(channel === 'kiosk' ? [] : [searchOrder(request, value)]), [searchWalletPass(request, value), searchWallet(request, value), searchProduct(request, value)]);
|
|
166
165
|
}
|
|
167
166
|
return requestList;
|
|
168
167
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { Module, ModuleOptions, PisellCore } from '../../types';
|
|
2
2
|
import type { ProductData } from '../../modules';
|
|
3
|
-
import
|
|
3
|
+
import type { BookingCalcContext } from '../../modules/BookingContext';
|
|
4
|
+
import type { AddProductDecideContext } from '../BookingTicket/utils/addProductDecision';
|
|
5
|
+
import { type InvoiceLayoutConfig, type InvoiceTemplateSettings, type OpenDataConfig, type ResolvedSalesSettings } from '../../modules/OpenData';
|
|
4
6
|
import type { LoadScheduleAvailableDateParams, ScheduleItem } from '../../modules/Schedule/types';
|
|
5
7
|
import type { ProductListLoadProductsParams, ProductListStoreQueryParams } from '../../modules/ProductList';
|
|
6
8
|
import type { AvailabilityDateRange, AvailabilityOccupancy, AvailabilityProduct, AvailabilityResource, GetProductTimeRangesRequest } from '../../modules/ResourcePlanner';
|
|
@@ -9,6 +11,7 @@ import type { BusinessAvailability } from '../../modules/BusinessAvailability';
|
|
|
9
11
|
import { BookingTicket } from '../BookingTicket';
|
|
10
12
|
import type { AllergyRequirement } from '../../model/strategy/adapter/itemRule';
|
|
11
13
|
export * from './types';
|
|
14
|
+
export * from './salesSettings';
|
|
12
15
|
export type { BusinessAvailability, BusinessClosedBehavior } from '../../modules/BusinessAvailability';
|
|
13
16
|
export { AvailabilityError } from '../../modules/ResourcePlanner';
|
|
14
17
|
/**
|
|
@@ -156,7 +159,7 @@ export declare class UnifiedBookingSalesImpl extends BookingTicket {
|
|
|
156
159
|
/** 在 Kiosk 拉起支付设备前补齐订单号,同一订单重试复用已分配的号码。 */
|
|
157
160
|
ensureLocalOrderNumbersForCheckout(): Promise<void>;
|
|
158
161
|
/**
|
|
159
|
-
* PC/H5
|
|
162
|
+
* PC/H5/Kiosk 结账默认直接等待云端 checkout;POS/WebPOS 仍保持本地待同步。
|
|
160
163
|
* 显式传 checkoutSyncTaskEnabled: true 时仍可回退到本地同步模式。
|
|
161
164
|
*/
|
|
162
165
|
protected shouldUseCheckoutSyncTask(): boolean;
|
|
@@ -178,6 +181,24 @@ export declare class UnifiedBookingSalesImpl extends BookingTicket {
|
|
|
178
181
|
/** A successful configuration belongs to this business runtime until an explicit refresh. */
|
|
179
182
|
loadOpenData(params: UnifiedBookingSalesLoadOpenDataParams): Promise<OpenDataConfig>;
|
|
180
183
|
getOpenData(): Promise<OpenDataConfig | null>;
|
|
184
|
+
/** One policy snapshot for all Sales 2.0 consumers. Network errors must reach the caller. */
|
|
185
|
+
getSalesSettings(): Promise<ResolvedSalesSettings>;
|
|
186
|
+
private getLoadedSalesSettings;
|
|
187
|
+
private getProductBookingsForScheduling;
|
|
188
|
+
private shouldApplyMultipleBookingScheduling;
|
|
189
|
+
private resolveLoadedDefaultBookingStart;
|
|
190
|
+
/** Used by the SKU flow after Holder changes, without changing an explicit user-selected time. */
|
|
191
|
+
resolveDefaultBookingStart(params: {
|
|
192
|
+
holderIds?: unknown;
|
|
193
|
+
fallback?: string;
|
|
194
|
+
}): Promise<string | undefined>;
|
|
195
|
+
protected buildBookingCalcContext(extra?: Partial<BookingCalcContext>): BookingCalcContext;
|
|
196
|
+
protected buildAddProductCtx(extra?: Partial<AddProductDecideContext>): AddProductDecideContext;
|
|
197
|
+
/** Re-evaluate an automatic default after Holder enrichment, or restore a known explicit TimeBar start. */
|
|
198
|
+
applyDefaultBookingStart(cacheItem: any, options?: {
|
|
199
|
+
holderIds?: unknown;
|
|
200
|
+
explicitStart?: string;
|
|
201
|
+
}): Promise<any>;
|
|
181
202
|
protected loadPickupTimingOpenData(_force: boolean): Promise<Record<string, unknown>>;
|
|
182
203
|
private resetAllergyItemRuleState;
|
|
183
204
|
private fetchAllergyItemRuleConfigs;
|