@pisell/pisellos 0.10.90 → 0.10.93
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/model/strategy/adapter/itemRule/adapter.d.ts +3 -1
- package/dist/model/strategy/adapter/itemRule/adapter.js +74 -7
- package/dist/model/strategy/adapter/itemRule/evaluator.d.ts +3 -1
- package/dist/model/strategy/adapter/itemRule/evaluator.js +13 -0
- package/dist/model/strategy/adapter/itemRule/type.d.ts +40 -1
- package/dist/model/strategy/adapter/itemRule/type.js +10 -0
- package/dist/model/strategy/adapter/promotion/evaluator.d.ts +2 -1
- package/dist/model/strategy/adapter/promotion/evaluator.js +103 -112
- package/dist/modules/BookingContext/utils/calendarBooking.d.ts +15 -0
- package/dist/modules/BookingContext/utils/calendarBooking.js +207 -0
- package/dist/modules/BookingContext/utils/index.d.ts +1 -0
- package/dist/modules/BookingContext/utils/index.js +1 -0
- package/dist/modules/BookingContext/utils/productExtend.d.ts +21 -0
- package/dist/modules/BookingContext/utils/productExtend.js +132 -33
- package/dist/modules/BookingContext/utils/resources.js +1 -1
- package/dist/modules/Cart/index.js +4 -3
- package/dist/modules/Cart/types.d.ts +2 -0
- package/dist/modules/Cart/utils/cartProduct.d.ts +3 -1
- package/dist/modules/Cart/utils/cartProduct.js +59 -32
- package/dist/modules/Date/index.d.ts +1 -1
- package/dist/modules/Date/index.js +60 -14
- package/dist/modules/Date/types.d.ts +5 -0
- package/dist/modules/OpenData/salesSettings.js +1 -1
- package/dist/modules/OpenData/types.d.ts +9 -0
- package/dist/modules/OpenData/utils.d.ts +1 -1
- package/dist/modules/OpenData/utils.js +3 -2
- package/dist/modules/Order/index.d.ts +22 -7
- package/dist/modules/Order/index.js +1565 -1161
- package/dist/modules/Order/localEftposState.d.ts +13 -0
- package/dist/modules/Order/localEftposState.js +39 -0
- package/dist/modules/Order/types.d.ts +33 -11
- package/dist/modules/Order/types.js +2 -2
- package/dist/modules/Order/unpaidAmountGap.d.ts +6 -0
- package/dist/modules/Order/unpaidAmountGap.js +72 -0
- package/dist/modules/Order/utils.d.ts +4 -1
- package/dist/modules/Order/utils.js +75 -52
- package/dist/modules/Payment/walletpass.js +32 -6
- package/dist/modules/Product/index.d.ts +1 -1
- package/dist/modules/Product/types.d.ts +16 -0
- package/dist/modules/ProductList/index.js +1 -1
- package/dist/modules/ResourcePlanner/planner.d.ts +2 -0
- package/dist/modules/ResourcePlanner/planner.js +383 -24
- package/dist/modules/ResourcePlanner/types.d.ts +42 -0
- package/dist/modules/Rules/index.js +86 -54
- package/dist/modules/Schedule/index.d.ts +7 -1
- package/dist/modules/Schedule/index.js +155 -39
- package/dist/modules/Schedule/types.d.ts +2 -0
- package/dist/modules/bookingReadValidation.d.ts +6 -0
- package/dist/modules/bookingReadValidation.js +72 -0
- package/dist/plugins/request.d.ts +2 -0
- package/dist/server/index.d.ts +9 -0
- package/dist/server/index.js +1928 -1462
- package/dist/server/modules/form/index.d.ts +19 -0
- package/dist/server/modules/form/index.js +205 -0
- package/dist/server/modules/form/types.d.ts +13 -0
- package/dist/server/modules/form/types.js +3 -0
- package/dist/server/modules/index.d.ts +3 -0
- package/dist/server/modules/index.js +4 -0
- package/dist/server/modules/order/index.d.ts +21 -0
- package/dist/server/modules/order/index.js +1399 -831
- package/dist/server/modules/order/types.d.ts +3 -0
- package/dist/server/modules/order/utils/filterOrders.js +20 -0
- package/dist/server/modules/products/index.d.ts +28 -7
- package/dist/server/modules/products/index.js +1295 -769
- package/dist/server/modules/products/replication.d.ts +8 -0
- package/dist/server/modules/products/replication.js +69 -0
- package/dist/server/modules/products/types.d.ts +12 -1
- package/dist/server/modules/products/types.js +4 -0
- package/dist/shared/receipt/customerInvoiceLanguages.d.ts +1 -1
- package/dist/shared/receipt/customerInvoiceLanguages.js +5 -3
- package/dist/shared/receipt/small-ticket.d.ts +1 -0
- package/dist/shared/receipt/small-ticket.js +58 -26
- package/dist/shared/receipt/templateVisibility.d.ts +3 -0
- package/dist/shared/receipt/templateVisibility.js +6 -2
- package/dist/solution/BaseSales/fulfillmentItemRules.d.ts +27 -0
- package/dist/solution/BaseSales/fulfillmentItemRules.js +750 -0
- package/dist/solution/BaseSales/index.d.ts +22 -6
- package/dist/solution/BaseSales/index.js +1881 -1347
- package/dist/solution/BaseSales/pickupTiming.d.ts +4 -0
- package/dist/solution/BaseSales/pickupTiming.js +35 -8
- package/dist/solution/BaseSales/types.d.ts +4 -0
- package/dist/solution/BaseSales/types.js +1 -0
- package/dist/solution/BaseSales/utils/posDurationPricing.d.ts +21 -0
- package/dist/solution/BaseSales/utils/posDurationPricing.js +174 -0
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +2 -0
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +8 -8
- package/dist/solution/BookingByStep/index.d.ts +20 -4
- package/dist/solution/BookingByStep/index.js +681 -361
- package/dist/solution/BookingByStep/utils/resources.d.ts +10 -0
- package/dist/solution/BookingByStep/utils/resources.js +117 -76
- package/dist/solution/BookingTicket/index.d.ts +10 -0
- package/dist/solution/BookingTicket/index.js +686 -598
- package/dist/solution/BookingTicket/types.d.ts +1 -1
- package/dist/solution/BookingTicket/utils/addProductDecision.d.ts +2 -1
- package/dist/solution/BookingTicket/utils/addProductDecision.js +35 -8
- package/dist/solution/BookingTicket/utils/redeemArrival.d.ts +8 -8
- package/dist/solution/BookingTicket/utils/resolveUniqueCartDetail.d.ts +8 -0
- package/dist/solution/BookingTicket/utils/resolveUniqueCartDetail.js +188 -0
- package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +58 -94
- package/dist/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.d.ts +1 -3
- package/dist/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.js +33 -62
- package/dist/solution/OrderInvoicePreview/index.js +4 -3
- package/dist/solution/Sales/index.js +1 -1
- package/dist/solution/ScanOrder/index.d.ts +2 -0
- package/dist/solution/ScanOrder/index.js +230 -97
- package/dist/solution/ScanOrder/menuAvailability.d.ts +24 -0
- package/dist/solution/ScanOrder/menuAvailability.js +363 -0
- package/dist/solution/ScanOrder/types.d.ts +3 -0
- package/dist/solution/UnifiedBookingSales/index.d.ts +42 -10
- package/dist/solution/UnifiedBookingSales/index.js +2493 -1496
- package/dist/solution/UnifiedBookingSales/salesSettings.js +1 -1
- package/dist/solution/UnifiedBookingSales/types.d.ts +20 -5
- package/dist/utils/pos-receipt-auto-print.d.ts +4 -0
- package/dist/utils/pos-receipt-auto-print.js +14 -0
- package/lib/model/strategy/adapter/itemRule/adapter.d.ts +3 -1
- package/lib/model/strategy/adapter/itemRule/adapter.js +54 -4
- package/lib/model/strategy/adapter/itemRule/evaluator.d.ts +3 -1
- package/lib/model/strategy/adapter/itemRule/evaluator.js +9 -0
- package/lib/model/strategy/adapter/itemRule/type.d.ts +40 -1
- package/lib/model/strategy/adapter/itemRule/type.js +10 -0
- package/lib/model/strategy/adapter/promotion/evaluator.d.ts +2 -1
- package/lib/model/strategy/adapter/promotion/evaluator.js +22 -21
- package/lib/modules/BookingContext/utils/calendarBooking.d.ts +15 -0
- package/lib/modules/BookingContext/utils/calendarBooking.js +156 -0
- package/lib/modules/BookingContext/utils/index.d.ts +1 -0
- package/lib/modules/BookingContext/utils/index.js +11 -0
- package/lib/modules/BookingContext/utils/productExtend.d.ts +21 -0
- package/lib/modules/BookingContext/utils/productExtend.js +104 -5
- package/lib/modules/BookingContext/utils/resources.js +1 -1
- package/lib/modules/Cart/index.js +4 -2
- package/lib/modules/Cart/types.d.ts +2 -0
- package/lib/modules/Cart/utils/cartProduct.d.ts +3 -1
- package/lib/modules/Cart/utils/cartProduct.js +39 -20
- package/lib/modules/Date/index.d.ts +1 -1
- package/lib/modules/Date/index.js +28 -5
- package/lib/modules/Date/types.d.ts +5 -0
- package/lib/modules/OpenData/salesSettings.js +1 -1
- package/lib/modules/OpenData/types.d.ts +9 -0
- package/lib/modules/OpenData/utils.d.ts +1 -1
- package/lib/modules/OpenData/utils.js +3 -2
- package/lib/modules/Order/index.d.ts +22 -7
- package/lib/modules/Order/index.js +457 -174
- package/lib/modules/Order/localEftposState.d.ts +13 -0
- package/lib/modules/Order/localEftposState.js +44 -0
- package/lib/modules/Order/types.d.ts +33 -11
- package/lib/modules/Order/types.js +2 -2
- package/lib/modules/Order/unpaidAmountGap.d.ts +6 -0
- package/lib/modules/Order/unpaidAmountGap.js +60 -0
- package/lib/modules/Order/utils.d.ts +4 -1
- package/lib/modules/Order/utils.js +29 -3
- package/lib/modules/Payment/walletpass.js +23 -1
- package/lib/modules/Product/index.d.ts +1 -1
- package/lib/modules/Product/types.d.ts +16 -0
- package/lib/modules/ProductList/index.js +1 -1
- package/lib/modules/ResourcePlanner/planner.d.ts +2 -0
- package/lib/modules/ResourcePlanner/planner.js +299 -9
- package/lib/modules/ResourcePlanner/types.d.ts +42 -0
- package/lib/modules/Rules/index.js +32 -3
- package/lib/modules/Schedule/index.d.ts +7 -1
- package/lib/modules/Schedule/index.js +68 -4
- package/lib/modules/Schedule/types.d.ts +2 -0
- package/lib/modules/bookingReadValidation.d.ts +6 -0
- package/lib/modules/bookingReadValidation.js +56 -0
- package/lib/plugins/request.d.ts +2 -0
- package/lib/server/index.d.ts +9 -0
- package/lib/server/index.js +279 -30
- package/lib/server/modules/form/index.d.ts +19 -0
- package/lib/server/modules/form/index.js +73 -0
- package/lib/server/modules/form/types.d.ts +13 -0
- package/lib/server/modules/form/types.js +9 -0
- package/lib/server/modules/index.d.ts +3 -0
- package/lib/server/modules/index.js +15 -1
- package/lib/server/modules/order/index.d.ts +21 -0
- package/lib/server/modules/order/index.js +344 -35
- package/lib/server/modules/order/types.d.ts +3 -0
- package/lib/server/modules/order/utils/filterOrders.js +18 -0
- package/lib/server/modules/products/index.d.ts +28 -7
- package/lib/server/modules/products/index.js +224 -62
- package/lib/server/modules/products/replication.d.ts +8 -0
- package/lib/server/modules/products/replication.js +30 -0
- package/lib/server/modules/products/types.d.ts +12 -1
- package/lib/server/modules/products/types.js +3 -0
- package/lib/shared/receipt/customerInvoiceLanguages.d.ts +1 -1
- package/lib/shared/receipt/customerInvoiceLanguages.js +5 -3
- package/lib/shared/receipt/small-ticket.d.ts +1 -0
- package/lib/shared/receipt/small-ticket.js +53 -25
- package/lib/shared/receipt/templateVisibility.d.ts +3 -0
- package/lib/shared/receipt/templateVisibility.js +6 -2
- package/lib/solution/BaseSales/fulfillmentItemRules.d.ts +27 -0
- package/lib/solution/BaseSales/fulfillmentItemRules.js +259 -0
- package/lib/solution/BaseSales/index.d.ts +22 -6
- package/lib/solution/BaseSales/index.js +347 -59
- package/lib/solution/BaseSales/pickupTiming.d.ts +4 -0
- package/lib/solution/BaseSales/pickupTiming.js +24 -3
- package/lib/solution/BaseSales/types.d.ts +4 -0
- package/lib/solution/BaseSales/types.js +1 -0
- package/lib/solution/BaseSales/utils/posDurationPricing.d.ts +21 -0
- package/lib/solution/BaseSales/utils/posDurationPricing.js +133 -0
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +2 -0
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +1 -1
- package/lib/solution/BookingByStep/index.d.ts +20 -4
- package/lib/solution/BookingByStep/index.js +229 -17
- package/lib/solution/BookingByStep/utils/resources.d.ts +10 -0
- package/lib/solution/BookingByStep/utils/resources.js +25 -15
- package/lib/solution/BookingTicket/index.d.ts +10 -0
- package/lib/solution/BookingTicket/index.js +57 -6
- package/lib/solution/BookingTicket/types.d.ts +1 -1
- package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +2 -1
- package/lib/solution/BookingTicket/utils/addProductDecision.js +34 -4
- package/lib/solution/BookingTicket/utils/redeemArrival.d.ts +8 -8
- package/lib/solution/BookingTicket/utils/resolveUniqueCartDetail.d.ts +8 -0
- package/lib/solution/BookingTicket/utils/resolveUniqueCartDetail.js +136 -0
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +2 -14
- package/lib/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.d.ts +1 -3
- package/lib/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.js +17 -34
- package/lib/solution/OrderInvoicePreview/index.js +1 -0
- package/lib/solution/Sales/index.js +1 -1
- package/lib/solution/ScanOrder/index.d.ts +2 -0
- package/lib/solution/ScanOrder/index.js +131 -22
- package/lib/solution/ScanOrder/menuAvailability.d.ts +24 -0
- package/lib/solution/ScanOrder/menuAvailability.js +203 -0
- package/lib/solution/ScanOrder/types.d.ts +3 -0
- package/lib/solution/UnifiedBookingSales/index.d.ts +42 -10
- package/lib/solution/UnifiedBookingSales/index.js +717 -144
- package/lib/solution/UnifiedBookingSales/salesSettings.js +1 -1
- package/lib/solution/UnifiedBookingSales/types.d.ts +20 -5
- package/lib/utils/pos-receipt-auto-print.d.ts +4 -0
- package/lib/utils/pos-receipt-auto-print.js +13 -0
- package/package.json +1 -1
|
@@ -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
|
}
|
|
@@ -2,9 +2,7 @@ import type { GlobalScanHandleResult, GlobalScanHostBridge } from '../../types';
|
|
|
2
2
|
import { type GlobalScanApplyHost } from './applyGlobalScan';
|
|
3
3
|
import type { GlobalScanFormattedResult } from './formatGlobalScan';
|
|
4
4
|
export interface ProductVoucherCollectionScanHost extends GlobalScanApplyHost {
|
|
5
|
-
waitForCustomerDiscounts(): Promise<void>;
|
|
6
5
|
loadCustomerDiscounts(): Promise<Record<string, any>[]>;
|
|
7
6
|
}
|
|
8
|
-
/**
|
|
9
|
-
* Never expand a wristband's result to other orders of the same customer. */
|
|
7
|
+
/** Resolve the scanned account, then collect all of that customer's vouchers. */
|
|
10
8
|
export declare function applyProductVoucherCollectionScan(host: ProductVoucherCollectionScanHost, formatted: GlobalScanFormattedResult, bridge: GlobalScanHostBridge): Promise<GlobalScanHandleResult>;
|
|
@@ -8,14 +8,14 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
8
8
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
9
9
|
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); }); }; }
|
|
10
10
|
import { applyGlobalScan } from "./applyGlobalScan";
|
|
11
|
-
/**
|
|
12
|
-
* Never expand a wristband's result to other orders of the same customer. */
|
|
11
|
+
/** Resolve the scanned account, then collect all of that customer's vouchers. */
|
|
13
12
|
export function applyProductVoucherCollectionScan(_x, _x2, _x3) {
|
|
14
13
|
return _applyProductVoucherCollectionScan.apply(this, arguments);
|
|
15
14
|
}
|
|
16
15
|
function _applyProductVoucherCollectionScan() {
|
|
17
16
|
_applyProductVoucherCollectionScan = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(host, formatted, bridge) {
|
|
18
|
-
var
|
|
17
|
+
var _ref, _formatted$customerId, _formatted$data, _formatted$data2, _bridge$requestCustom;
|
|
18
|
+
var assertCurrent, isPass, customerScan, result, vouchers;
|
|
19
19
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
20
20
|
while (1) switch (_context2.prev = _context2.next) {
|
|
21
21
|
case 0:
|
|
@@ -25,9 +25,16 @@ function _applyProductVoucherCollectionScan() {
|
|
|
25
25
|
throw new DOMException('Scan session ended', 'AbortError');
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
|
-
|
|
28
|
+
isPass = formatted.searchType === 'walletPass'; // Order numbers and wristbands resolve through batch-search. Their returned
|
|
29
|
+
// passes identify the customer; they are not the collection's voucher list.
|
|
30
|
+
// Resolve source-shop IDs before reusing the wallet customer-binding flow.
|
|
31
|
+
customerScan = isPass ? _objectSpread(_objectSpread({}, formatted), {}, {
|
|
32
|
+
searchType: 'wallet',
|
|
33
|
+
customerId: (_ref = (_formatted$customerId = formatted.customerId) !== null && _formatted$customerId !== void 0 ? _formatted$customerId : (_formatted$data = formatted.data) === null || _formatted$data === void 0 ? void 0 : _formatted$data.id) !== null && _ref !== void 0 ? _ref : (_formatted$data2 = formatted.data) === null || _formatted$data2 === void 0 ? void 0 : _formatted$data2.customer_id,
|
|
34
|
+
isCrossShopWallet: true
|
|
35
|
+
}) : formatted;
|
|
29
36
|
assertCurrent();
|
|
30
|
-
_context2.next =
|
|
37
|
+
_context2.next = 6;
|
|
31
38
|
return applyGlobalScan(_objectSpread(_objectSpread({}, host), {}, {
|
|
32
39
|
setOrderCustomer: function setOrderCustomer(customer) {
|
|
33
40
|
assertCurrent();
|
|
@@ -37,77 +44,41 @@ function _applyProductVoucherCollectionScan() {
|
|
|
37
44
|
assertCurrent();
|
|
38
45
|
return host.addProductToOrder(product, booking);
|
|
39
46
|
}
|
|
40
|
-
}),
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
productVouchersOnly: true,
|
|
54
|
-
suppressFailureNotification: true
|
|
55
|
-
}));
|
|
56
|
-
case 5:
|
|
57
|
-
promotion = _context.sent;
|
|
58
|
-
assertCurrent();
|
|
59
|
-
// An empty successful search is different from a swallowed request error.
|
|
60
|
-
if (Array.isArray(promotion.scannedDiscountList)) {
|
|
61
|
-
_context.next = 9;
|
|
62
|
-
break;
|
|
63
|
-
}
|
|
64
|
-
throw new Error('Could not resolve scanned vouchers');
|
|
65
|
-
case 9:
|
|
66
|
-
vouchers = promotion.scannedDiscountList;
|
|
67
|
-
return _context.abrupt("return", promotion);
|
|
68
|
-
case 11:
|
|
69
|
-
case "end":
|
|
70
|
-
return _context.stop();
|
|
71
|
-
}
|
|
72
|
-
}, _callee);
|
|
73
|
-
}));
|
|
74
|
-
return function (_x4, _x5, _x6) {
|
|
75
|
-
return _ref.apply(this, arguments);
|
|
76
|
-
};
|
|
77
|
-
}())
|
|
47
|
+
}), customerScan, _objectSpread(_objectSpread({}, bridge), {}, {
|
|
48
|
+
// Without a switch bridge, do not return the previous customer's vouchers.
|
|
49
|
+
requestCustomerSwitch: (_bridge$requestCustom = bridge.requestCustomerSwitch) !== null && _bridge$requestCustom !== void 0 ? _bridge$requestCustom : /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
50
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
51
|
+
while (1) switch (_context.prev = _context.next) {
|
|
52
|
+
case 0:
|
|
53
|
+
return _context.abrupt("return", false);
|
|
54
|
+
case 1:
|
|
55
|
+
case "end":
|
|
56
|
+
return _context.stop();
|
|
57
|
+
}
|
|
58
|
+
}, _callee);
|
|
59
|
+
}))
|
|
78
60
|
}));
|
|
79
|
-
case
|
|
61
|
+
case 6:
|
|
80
62
|
result = _context2.sent;
|
|
81
63
|
assertCurrent();
|
|
82
|
-
if (!(
|
|
83
|
-
_context2.next =
|
|
64
|
+
if (!(customerScan.searchType === 'wallet' && result.status === 'success')) {
|
|
65
|
+
_context2.next = 14;
|
|
84
66
|
break;
|
|
85
67
|
}
|
|
86
|
-
_context2.next =
|
|
68
|
+
_context2.next = 11;
|
|
87
69
|
return host.loadCustomerDiscounts();
|
|
88
|
-
case
|
|
70
|
+
case 11:
|
|
89
71
|
vouchers = _context2.sent;
|
|
90
72
|
assertCurrent();
|
|
91
73
|
return _context2.abrupt("return", _objectSpread(_objectSpread({}, result), {}, {
|
|
92
74
|
redemption: {
|
|
93
|
-
source: 'wallet',
|
|
75
|
+
source: isPass ? 'scan' : 'wallet',
|
|
94
76
|
vouchers: vouchers
|
|
95
77
|
}
|
|
96
78
|
}));
|
|
97
|
-
case
|
|
98
|
-
if (!(formatted.searchType === 'walletPass')) {
|
|
99
|
-
_context2.next = 15;
|
|
100
|
-
break;
|
|
101
|
-
}
|
|
102
|
-
return _context2.abrupt("return", _objectSpread(_objectSpread({}, result), {}, {
|
|
103
|
-
redemption: {
|
|
104
|
-
source: 'scan',
|
|
105
|
-
vouchers: vouchers
|
|
106
|
-
}
|
|
107
|
-
}));
|
|
108
|
-
case 15:
|
|
79
|
+
case 14:
|
|
109
80
|
return _context2.abrupt("return", result);
|
|
110
|
-
case
|
|
81
|
+
case 15:
|
|
111
82
|
case "end":
|
|
112
83
|
return _context2.stop();
|
|
113
84
|
}
|
|
@@ -216,13 +216,14 @@ export var OrderInvoicePreviewImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
216
216
|
tax_country_code: getData('tax_country_code')
|
|
217
217
|
} : {});
|
|
218
218
|
shop.default_domain || (shop.default_domain = shopCore.default_domain);
|
|
219
|
+
shop.private_domain || (shop.private_domain = shopCore.private_domain);
|
|
219
220
|
shop.private_domain_protocol || (shop.private_domain_protocol = shopCore.private_domain_protocol);
|
|
220
221
|
if (!(generation !== _this3.generation || _this3.disposed)) {
|
|
221
|
-
_context.next =
|
|
222
|
+
_context.next = 21;
|
|
222
223
|
break;
|
|
223
224
|
}
|
|
224
225
|
throw new Error('Invoice request superseded');
|
|
225
|
-
case
|
|
226
|
+
case 21:
|
|
226
227
|
languageOptions = resolveCustomerInvoiceLanguages(template.language, input.locale);
|
|
227
228
|
remembered = (_this3$languageSelect = _this3.languageSelection) === null || _this3$languageSelect === void 0 ? void 0 : _this3$languageSelect.code;
|
|
228
229
|
selected = languageOptions.find(function (option) {
|
|
@@ -259,7 +260,7 @@ export var OrderInvoicePreviewImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
259
260
|
error: null
|
|
260
261
|
});
|
|
261
262
|
return _context.abrupt("return", result);
|
|
262
|
-
case
|
|
263
|
+
case 28:
|
|
263
264
|
case "end":
|
|
264
265
|
return _context.stop();
|
|
265
266
|
}
|
|
@@ -442,7 +442,7 @@ export var SalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
442
442
|
} : {
|
|
443
443
|
external_sale_number: normalizedLookup
|
|
444
444
|
};
|
|
445
|
-
return _context6.abrupt("return", this.request.post('/local/print-order', _objectSpread(_objectSpread({}, lookupPayload), {}, {
|
|
445
|
+
return _context6.abrupt("return", this.request.post('/shop/local/print-order', _objectSpread(_objectSpread({}, lookupPayload), {}, {
|
|
446
446
|
lookup_order_from_db: 1,
|
|
447
447
|
small_ticket_data_flag: 1,
|
|
448
448
|
business_code: businessCode,
|
|
@@ -100,6 +100,8 @@ export declare class ScanOrderImpl extends BaseSalesImpl implements Module {
|
|
|
100
100
|
private buildSubmitPayloadEnhancer;
|
|
101
101
|
private isScanOrderMoreMode;
|
|
102
102
|
private submitScanOrderMore;
|
|
103
|
+
/** Read both current and legacy cart snapshots without changing the product catalog. */
|
|
104
|
+
private getMenuAvailabilityProductSources;
|
|
103
105
|
submitScanOrder<T = any>(): Promise<T>;
|
|
104
106
|
addProductToOrder(product: Partial<ScanOrderOrderProduct> & ScanOrderOrderProductIdentity): Promise<import("../../modules/Order/types").OrderProduct[]>;
|
|
105
107
|
updateOrderProduct(params: UpdateOrderProductParams): Promise<import("../../modules/Order/types").OrderProduct[]>;
|