@pisell/pisellos 2.2.323 → 2.2.325
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 +1 -0
- package/dist/index.js +1 -0
- package/dist/inventory/index.d.ts +92 -0
- package/dist/inventory/index.js +509 -0
- package/dist/model/strategy/adapter/promotion/index.js +9 -0
- package/dist/modules/BookingContext/index.d.ts +2 -2
- package/dist/modules/BookingContext/index.js +55 -25
- package/dist/modules/BookingContext/types.d.ts +2 -0
- 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 +20 -1
- package/dist/modules/BookingContext/utils/productExtend.js +122 -29
- 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/Discount/index.js +1 -0
- 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 +16 -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 +55 -12
- package/dist/modules/Order/index.js +2699 -1411
- package/dist/modules/Order/types.d.ts +43 -5
- package/dist/modules/Order/types.js +4 -0
- package/dist/modules/Order/unpaidAmountGap.d.ts +6 -0
- package/dist/modules/Order/unpaidAmountGap.js +72 -0
- package/dist/modules/Order/utils/discountProductLineIdentity.js +2 -2
- package/dist/modules/Order/utils/productVoucherGroups.d.ts +15 -0
- package/dist/modules/Order/utils/productVoucherGroups.js +115 -0
- package/dist/modules/Order/utils.d.ts +3 -1
- package/dist/modules/Order/utils.js +6 -2
- package/dist/modules/Product/index.d.ts +1 -1
- package/dist/modules/ProductList/clientDataVariants.js +6 -2
- package/dist/modules/ProductList/index.d.ts +2 -0
- package/dist/modules/ProductList/index.js +161 -51
- package/dist/modules/ResourcePlanner/planner.js +58 -2
- package/dist/modules/ResourcePlanner/types.d.ts +13 -0
- package/dist/modules/Rules/index.d.ts +2 -0
- package/dist/modules/Rules/index.js +58 -39
- 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 +8 -0
- package/dist/server/index.js +1458 -1166
- package/dist/server/modules/order/index.js +2 -1
- 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 +4 -0
- package/dist/shared/receipt/small-ticket.js +70 -12
- package/dist/solution/BaseSales/index.d.ts +39 -5
- package/dist/solution/BaseSales/index.js +1828 -1462
- package/dist/solution/BaseSales/types.d.ts +1 -0
- package/dist/solution/BaseSales/types.js +1 -0
- package/dist/solution/BookingByStep/index.d.ts +16 -2
- package/dist/solution/BookingByStep/index.js +676 -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 +15 -3
- package/dist/solution/BookingTicket/index.js +249 -135
- package/dist/solution/BookingTicket/types.d.ts +14 -2
- package/dist/solution/BookingTicket/utils/addProductDecision.d.ts +3 -1
- package/dist/solution/BookingTicket/utils/addProductDecision.js +39 -11
- 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/applyProductVoucherCollectionScan.d.ts +8 -0
- package/dist/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.js +88 -0
- package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +1 -0
- package/dist/solution/BookingTicket/utils/scan/handleScan.js +2 -1
- package/dist/solution/OrderInvoicePreview/index.js +14 -8
- package/dist/solution/ScanOrder/index.d.ts +2 -0
- package/dist/solution/ScanOrder/index.js +166 -67
- package/dist/solution/ScanOrder/menuAvailability.d.ts +24 -0
- package/dist/solution/ScanOrder/menuAvailability.js +363 -0
- package/dist/solution/UnifiedBookingSales/catalogQueryBatch.d.ts +21 -0
- package/dist/solution/UnifiedBookingSales/catalogQueryBatch.js +202 -0
- package/dist/solution/UnifiedBookingSales/index.d.ts +96 -4
- package/dist/solution/UnifiedBookingSales/index.js +3374 -1177
- package/dist/solution/UnifiedBookingSales/remoteOccupancyCache.d.ts +2 -0
- package/dist/solution/UnifiedBookingSales/remoteOccupancyCache.js +4 -0
- package/dist/solution/UnifiedBookingSales/salesSettings.d.ts +16 -0
- package/dist/solution/UnifiedBookingSales/salesSettings.js +81 -0
- package/dist/solution/UnifiedBookingSales/sessionResourceCache.d.ts +27 -0
- package/dist/solution/UnifiedBookingSales/sessionResourceCache.js +271 -0
- package/dist/solution/UnifiedBookingSales/types.d.ts +71 -2
- package/dist/solution/UnifiedBookingSales/types.js +7 -1
- package/dist/solution/UnifiedBookingSales/venueCatalogSession.d.ts +32 -0
- package/dist/solution/UnifiedBookingSales/venueCatalogSession.js +283 -0
- package/dist/utils/platform.d.ts +2 -0
- package/dist/utils/platform.js +6 -0
- package/dist/utils/pos-receipt-auto-print.d.ts +4 -0
- package/dist/utils/pos-receipt-auto-print.js +14 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +12 -0
- package/lib/inventory/index.d.ts +92 -0
- package/lib/inventory/index.js +287 -0
- package/lib/model/strategy/adapter/promotion/index.js +46 -1
- package/lib/modules/BookingContext/index.d.ts +2 -2
- package/lib/modules/BookingContext/index.js +42 -10
- package/lib/modules/BookingContext/types.d.ts +2 -0
- 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 +20 -1
- package/lib/modules/BookingContext/utils/productExtend.js +96 -7
- 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/Discount/index.js +1 -0
- 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 +16 -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 +55 -12
- package/lib/modules/Order/index.js +659 -80
- package/lib/modules/Order/types.d.ts +43 -5
- package/lib/modules/Order/types.js +2 -0
- package/lib/modules/Order/unpaidAmountGap.d.ts +6 -0
- package/lib/modules/Order/unpaidAmountGap.js +60 -0
- package/lib/modules/Order/utils/discountProductLineIdentity.js +1 -1
- package/lib/modules/Order/utils/productVoucherGroups.d.ts +15 -0
- package/lib/modules/Order/utils/productVoucherGroups.js +64 -0
- package/lib/modules/Order/utils.d.ts +3 -1
- package/lib/modules/Order/utils.js +6 -2
- package/lib/modules/Product/index.d.ts +1 -1
- package/lib/modules/ProductList/clientDataVariants.js +6 -2
- package/lib/modules/ProductList/index.d.ts +2 -0
- package/lib/modules/ProductList/index.js +74 -0
- package/lib/modules/ResourcePlanner/planner.js +52 -1
- package/lib/modules/ResourcePlanner/types.d.ts +13 -0
- package/lib/modules/Rules/index.d.ts +2 -0
- package/lib/modules/Rules/index.js +25 -9
- 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 +8 -0
- package/lib/server/index.js +194 -19
- package/lib/server/modules/order/index.js +2 -1
- 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 +4 -0
- package/lib/shared/receipt/small-ticket.js +63 -8
- package/lib/solution/BaseSales/index.d.ts +39 -5
- package/lib/solution/BaseSales/index.js +212 -18
- package/lib/solution/BaseSales/types.d.ts +1 -0
- package/lib/solution/BaseSales/types.js +1 -0
- package/lib/solution/BookingByStep/index.d.ts +16 -2
- package/lib/solution/BookingByStep/index.js +222 -14
- 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 +15 -3
- package/lib/solution/BookingTicket/index.js +47 -4
- package/lib/solution/BookingTicket/types.d.ts +14 -2
- package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +3 -1
- package/lib/solution/BookingTicket/utils/addProductDecision.js +37 -6
- 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/applyProductVoucherCollectionScan.d.ts +8 -0
- package/lib/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.js +54 -0
- package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +1 -0
- package/lib/solution/BookingTicket/utils/scan/handleScan.js +2 -1
- package/lib/solution/OrderInvoicePreview/index.js +7 -1
- package/lib/solution/ScanOrder/index.d.ts +2 -0
- package/lib/solution/ScanOrder/index.js +72 -2
- package/lib/solution/ScanOrder/menuAvailability.d.ts +24 -0
- package/lib/solution/ScanOrder/menuAvailability.js +203 -0
- package/lib/solution/UnifiedBookingSales/catalogQueryBatch.d.ts +21 -0
- package/lib/solution/UnifiedBookingSales/catalogQueryBatch.js +109 -0
- package/lib/solution/UnifiedBookingSales/index.d.ts +96 -4
- package/lib/solution/UnifiedBookingSales/index.js +1316 -73
- package/lib/solution/UnifiedBookingSales/remoteOccupancyCache.d.ts +2 -0
- package/lib/solution/UnifiedBookingSales/remoteOccupancyCache.js +2 -0
- package/lib/solution/UnifiedBookingSales/salesSettings.d.ts +16 -0
- package/lib/solution/UnifiedBookingSales/salesSettings.js +72 -0
- package/lib/solution/UnifiedBookingSales/sessionResourceCache.d.ts +27 -0
- package/lib/solution/UnifiedBookingSales/sessionResourceCache.js +199 -0
- package/lib/solution/UnifiedBookingSales/types.d.ts +71 -2
- package/lib/solution/UnifiedBookingSales/types.js +4 -1
- package/lib/solution/UnifiedBookingSales/venueCatalogSession.d.ts +32 -0
- package/lib/solution/UnifiedBookingSales/venueCatalogSession.js +155 -0
- package/lib/utils/platform.d.ts +2 -0
- package/lib/utils/platform.js +7 -0
- 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
|
@@ -42,6 +42,7 @@ import { handleGlobalScan, handleCustomerScan, handleUniversalScan } from "./uti
|
|
|
42
42
|
import scanCache from "./utils/scan/scanCache";
|
|
43
43
|
import { formatGlobalScanResult } from "./utils/scan/formatGlobalScan";
|
|
44
44
|
import { applyGlobalScan } from "./utils/scan/applyGlobalScan";
|
|
45
|
+
import { applyProductVoucherCollectionScan } from "./utils/scan/applyProductVoucherCollectionScan";
|
|
45
46
|
import { buildCartView, isWalkInCustomer } from "./utils/cartView";
|
|
46
47
|
import { buildCacheItemFromCartDetail, buildCacheItemFromDetail, buildRequiresDetailPayload as _buildRequiresDetailPayload, decideAddProduct as decideAddProductUtil, decideAfterDetail as decideAfterDetailUtil, decideAutoClose as decideAutoCloseUtil, getIsEject as getIsEjectUtil, getIsOnlySession as getIsOnlySessionUtil, transformDetailToProductAndBooking as transformDetailToProductAndBookingUtil } from "./utils/addProductDecision";
|
|
47
48
|
import { buildCacheItemFromOrderLine as buildCacheItemFromOrderLineUtil } from "../../modules/BookingContext/utils/buildCacheItemFromOrderLine";
|
|
@@ -2736,16 +2737,26 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2736
2737
|
}, {
|
|
2737
2738
|
key: "buildBookingCalcContext",
|
|
2738
2739
|
value: function buildBookingCalcContext(extra) {
|
|
2739
|
-
var _extra$date,
|
|
2740
|
+
var _extra$date,
|
|
2741
|
+
_extra$presetStartTim,
|
|
2742
|
+
_this$getOrderSession,
|
|
2743
|
+
_this8 = this,
|
|
2744
|
+
_this$otherParams9;
|
|
2740
2745
|
var state = this.store.bookingContext.getState();
|
|
2741
2746
|
var date = (_extra$date = extra === null || extra === void 0 ? void 0 : extra.date) !== null && _extra$date !== void 0 ? _extra$date : state.date;
|
|
2742
|
-
return _objectSpread({
|
|
2747
|
+
return _objectSpread(_objectSpread({
|
|
2743
2748
|
bookingConfig: state.bookingConfig,
|
|
2744
2749
|
resourcesOrigin: state.resourcesOrigin,
|
|
2745
2750
|
resourcesOriginMap: state.resourcesOriginMap,
|
|
2746
2751
|
date: date,
|
|
2747
2752
|
presetStartTime: (_extra$presetStartTim = extra === null || extra === void 0 ? void 0 : extra.presetStartTime) !== null && _extra$presetStartTim !== void 0 ? _extra$presetStartTim : derivePresetStartTimeFromDate(date)
|
|
2748
|
-
}, extra || {})
|
|
2753
|
+
}, extra || {}), {}, {
|
|
2754
|
+
orderSessionId: (_this$getOrderSession = this.getOrderSessionId()) !== null && _this$getOrderSession !== void 0 ? _this$getOrderSession : undefined,
|
|
2755
|
+
isOrderSessionCurrent: function isOrderSessionCurrent(sessionId) {
|
|
2756
|
+
return _this8.isOrderSessionCurrent(sessionId);
|
|
2757
|
+
},
|
|
2758
|
+
platform: String(((_this$otherParams9 = this.otherParams) === null || _this$otherParams9 === void 0 ? void 0 : _this$otherParams9.platform) || '').trim().toLowerCase()
|
|
2759
|
+
});
|
|
2749
2760
|
}
|
|
2750
2761
|
|
|
2751
2762
|
/**
|
|
@@ -2839,7 +2850,15 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2839
2850
|
}, {
|
|
2840
2851
|
key: "buildAddProductCtx",
|
|
2841
2852
|
value: function buildAddProductCtx(extra) {
|
|
2842
|
-
var _extra$date2,
|
|
2853
|
+
var _extra$date2,
|
|
2854
|
+
_ref14,
|
|
2855
|
+
_this$getOrderCustome4,
|
|
2856
|
+
_this$getOrderCustome5,
|
|
2857
|
+
_this$store$order$get5,
|
|
2858
|
+
_extra$presetStartTim2,
|
|
2859
|
+
_this$getOrderSession2,
|
|
2860
|
+
_this9 = this,
|
|
2861
|
+
_this$otherParams10;
|
|
2843
2862
|
var bookingContextState = this.store.bookingContext.getState();
|
|
2844
2863
|
var date = (_extra$date2 = extra === null || extra === void 0 ? void 0 : extra.date) !== null && _extra$date2 !== void 0 ? _extra$date2 : bookingContextState.date;
|
|
2845
2864
|
var orderCustomerId = (_ref14 = (_this$getOrderCustome4 = (_this$getOrderCustome5 = this.getOrderCustomerSnapshot()) === null || _this$getOrderCustome5 === void 0 ? void 0 : _this$getOrderCustome5.id) !== null && _this$getOrderCustome4 !== void 0 ? _this$getOrderCustome4 : (_this$store$order$get5 = this.store.order.getTempOrder()) === null || _this$store$order$get5 === void 0 ? void 0 : _this$store$order$get5.customer_id) !== null && _ref14 !== void 0 ? _ref14 : undefined;
|
|
@@ -2851,7 +2870,12 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2851
2870
|
presetStartTime: (_extra$presetStartTim2 = extra === null || extra === void 0 ? void 0 : extra.presetStartTime) !== null && _extra$presetStartTim2 !== void 0 ? _extra$presetStartTim2 : derivePresetStartTimeFromDate(date),
|
|
2852
2871
|
customerId: orderCustomerId
|
|
2853
2872
|
}, extra || {}), {}, {
|
|
2854
|
-
channel: this.getSubmitOrderSalesChannel()
|
|
2873
|
+
channel: this.getSubmitOrderSalesChannel(),
|
|
2874
|
+
orderSessionId: (_this$getOrderSession2 = this.getOrderSessionId()) !== null && _this$getOrderSession2 !== void 0 ? _this$getOrderSession2 : undefined,
|
|
2875
|
+
isOrderSessionCurrent: function isOrderSessionCurrent(sessionId) {
|
|
2876
|
+
return _this9.isOrderSessionCurrent(sessionId);
|
|
2877
|
+
},
|
|
2878
|
+
platform: String(((_this$otherParams10 = this.otherParams) === null || _this$otherParams10 === void 0 ? void 0 : _this$otherParams10.platform) || '').trim().toLowerCase()
|
|
2855
2879
|
});
|
|
2856
2880
|
}
|
|
2857
2881
|
|
|
@@ -2986,24 +3010,24 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2986
3010
|
}, {
|
|
2987
3011
|
key: "handleGlobalScanCode",
|
|
2988
3012
|
value: (function () {
|
|
2989
|
-
var _handleGlobalScanCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2990
|
-
var
|
|
2991
|
-
var trimmed, _bridge$onNotify, _bridge$refresh, beforeScanCommit, beforeScanDialog, guardCallback, guardedBridge, localSearch, scanCallback, raw, formatted, _bridge$onNotify2, _result8, _bridge$onNotify3;
|
|
2992
|
-
return _regeneratorRuntime().wrap(function
|
|
2993
|
-
while (1) switch (
|
|
3013
|
+
var _handleGlobalScanCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee40(code, bridge) {
|
|
3014
|
+
var _this10 = this;
|
|
3015
|
+
var trimmed, _bridge$onNotify, _bridge$refresh, beforeScanCommit, beforeScanDialog, guardCallback, guardedBridge, _promotion$isAccepted, promotion, localSearch, scanCallback, raw, formatted, _bridge$onNotify2, host, _result8, _bridge$onNotify3, _bridge$isCurrent;
|
|
3016
|
+
return _regeneratorRuntime().wrap(function _callee40$(_context40) {
|
|
3017
|
+
while (1) switch (_context40.prev = _context40.next) {
|
|
2994
3018
|
case 0:
|
|
2995
3019
|
trimmed = typeof code === 'string' ? code.trim() : '';
|
|
2996
3020
|
if (trimmed) {
|
|
2997
|
-
|
|
3021
|
+
_context40.next = 4;
|
|
2998
3022
|
break;
|
|
2999
3023
|
}
|
|
3000
3024
|
bridge === null || bridge === void 0 || (_bridge$onNotify = bridge.onNotify) === null || _bridge$onNotify === void 0 || _bridge$onNotify.call(bridge, 'fail', 'pisell2.text.scan-global-failed');
|
|
3001
|
-
return
|
|
3025
|
+
return _context40.abrupt("return", {
|
|
3002
3026
|
status: 'failed',
|
|
3003
3027
|
reason: 'empty_code'
|
|
3004
3028
|
});
|
|
3005
3029
|
case 4:
|
|
3006
|
-
|
|
3030
|
+
_context40.prev = 4;
|
|
3007
3031
|
// Capture before lookup/UI awaits, so a result cannot land in a new cart.
|
|
3008
3032
|
// Unscoped POS Order modules return a no-op guard.
|
|
3009
3033
|
beforeScanCommit = this.store.order.createCartIntentCommitGuard('add_product');
|
|
@@ -3029,86 +3053,174 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3029
3053
|
return bridge.openBookingEdit(payload);
|
|
3030
3054
|
} : undefined
|
|
3031
3055
|
}) : undefined;
|
|
3056
|
+
if (!((guardedBridge === null || guardedBridge === void 0 ? void 0 : guardedBridge.scanScope) === 'product-voucher')) {
|
|
3057
|
+
_context40.next = 16;
|
|
3058
|
+
break;
|
|
3059
|
+
}
|
|
3060
|
+
if (guardedBridge.applyPromotionCode) {
|
|
3061
|
+
_context40.next = 12;
|
|
3062
|
+
break;
|
|
3063
|
+
}
|
|
3064
|
+
return _context40.abrupt("return", {
|
|
3065
|
+
status: 'failed',
|
|
3066
|
+
reason: 'no_bridge'
|
|
3067
|
+
});
|
|
3068
|
+
case 12:
|
|
3069
|
+
_context40.next = 14;
|
|
3070
|
+
return guardedBridge.applyPromotionCode(trimmed);
|
|
3071
|
+
case 14:
|
|
3072
|
+
promotion = _context40.sent;
|
|
3073
|
+
return _context40.abrupt("return", ((_promotion$isAccepted = promotion.isAccepted) !== null && _promotion$isAccepted !== void 0 ? _promotion$isAccepted : promotion.isAvailable) ? {
|
|
3074
|
+
status: 'success',
|
|
3075
|
+
kind: 'promotion'
|
|
3076
|
+
} : {
|
|
3077
|
+
status: 'failed',
|
|
3078
|
+
reason: 'not_found'
|
|
3079
|
+
});
|
|
3080
|
+
case 16:
|
|
3032
3081
|
localSearch = function localSearch(v) {
|
|
3033
|
-
return
|
|
3082
|
+
return _this10.store.products.findProductsByCodeOrBarcode(v);
|
|
3034
3083
|
};
|
|
3035
3084
|
scanCallback = handleGlobalScan(this.request, localSearch, this.getSubmitOrderSalesChannel());
|
|
3036
|
-
|
|
3085
|
+
_context40.next = 20;
|
|
3037
3086
|
return scanCallback({
|
|
3038
3087
|
type: 'nativeScanner',
|
|
3039
3088
|
value: trimmed
|
|
3040
3089
|
});
|
|
3041
|
-
case
|
|
3042
|
-
raw =
|
|
3090
|
+
case 20:
|
|
3091
|
+
raw = _context40.sent;
|
|
3043
3092
|
formatted = formatGlobalScanResult(raw, trimmed);
|
|
3044
3093
|
if (formatted) {
|
|
3045
|
-
|
|
3094
|
+
_context40.next = 25;
|
|
3046
3095
|
break;
|
|
3047
3096
|
}
|
|
3048
3097
|
bridge === null || bridge === void 0 || (_bridge$onNotify2 = bridge.onNotify) === null || _bridge$onNotify2 === void 0 || _bridge$onNotify2.call(bridge, 'fail', 'pisell2.text.scan-global-failed');
|
|
3049
|
-
return
|
|
3098
|
+
return _context40.abrupt("return", {
|
|
3050
3099
|
status: 'failed',
|
|
3051
3100
|
reason: 'not_found'
|
|
3052
3101
|
});
|
|
3053
|
-
case
|
|
3054
|
-
|
|
3055
|
-
return applyGlobalScan({
|
|
3102
|
+
case 25:
|
|
3103
|
+
host = {
|
|
3056
3104
|
setOrderCustomer: function setOrderCustomer(customer) {
|
|
3057
3105
|
beforeScanCommit();
|
|
3058
|
-
|
|
3106
|
+
_this10.setOrderCustomer(customer);
|
|
3059
3107
|
},
|
|
3060
3108
|
getOrderCustomerSnapshot: function getOrderCustomerSnapshot() {
|
|
3061
|
-
return
|
|
3109
|
+
return _this10.getOrderCustomerSnapshot();
|
|
3062
3110
|
},
|
|
3063
3111
|
resolveCustomerById: function resolveCustomerById(customerId) {
|
|
3064
|
-
return
|
|
3112
|
+
return _this10.resolveCustomerById(customerId);
|
|
3065
3113
|
},
|
|
3066
3114
|
getBusinessCode: function getBusinessCode() {
|
|
3067
|
-
var
|
|
3068
|
-
return (
|
|
3115
|
+
var _this10$otherParams;
|
|
3116
|
+
return (_this10$otherParams = _this10.otherParams) === null || _this10$otherParams === void 0 ? void 0 : _this10$otherParams.businessCode;
|
|
3069
3117
|
},
|
|
3070
3118
|
buildAddProductCtx: function buildAddProductCtx(extra) {
|
|
3071
|
-
return
|
|
3119
|
+
return _this10.buildAddProductCtx(extra);
|
|
3072
3120
|
},
|
|
3073
3121
|
decideAddProduct: function decideAddProduct(item, options) {
|
|
3074
|
-
return
|
|
3122
|
+
return _this10.decideAddProduct(item, options);
|
|
3075
3123
|
},
|
|
3076
3124
|
decideAfterDetail: function decideAfterDetail(cacheItem, options) {
|
|
3077
|
-
return
|
|
3125
|
+
return _this10.decideAfterDetail(cacheItem, options);
|
|
3078
3126
|
},
|
|
3079
3127
|
transformDetailToProductAndBooking: function transformDetailToProductAndBooking(input) {
|
|
3080
|
-
return
|
|
3128
|
+
return _this10.transformDetailToProductAndBooking(input);
|
|
3081
3129
|
},
|
|
3082
3130
|
addProductToOrder: function addProductToOrder(product, booking) {
|
|
3083
3131
|
beforeScanCommit();
|
|
3084
|
-
return
|
|
3132
|
+
return _this10.addProductToOrder(product, booking);
|
|
3085
3133
|
},
|
|
3086
3134
|
refreshWalletAssets: function refreshWalletAssets(params) {
|
|
3087
|
-
return
|
|
3135
|
+
return _this10.refreshWalletAssets(params);
|
|
3088
3136
|
},
|
|
3089
3137
|
scanWalletAsset: function scanWalletAsset(scanCode) {
|
|
3090
3138
|
beforeScanCommit();
|
|
3091
|
-
return
|
|
3139
|
+
return _this10.scanWalletAsset(scanCode);
|
|
3092
3140
|
}
|
|
3093
|
-
}
|
|
3094
|
-
|
|
3095
|
-
|
|
3141
|
+
};
|
|
3142
|
+
if (!((guardedBridge === null || guardedBridge === void 0 ? void 0 : guardedBridge.scanScope) === 'product-voucher-collection')) {
|
|
3143
|
+
_context40.next = 32;
|
|
3144
|
+
break;
|
|
3145
|
+
}
|
|
3146
|
+
_context40.next = 29;
|
|
3147
|
+
return applyProductVoucherCollectionScan(_objectSpread(_objectSpread({}, host), {}, {
|
|
3148
|
+
loadCustomerDiscounts: function () {
|
|
3149
|
+
var _loadCustomerDiscounts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee39() {
|
|
3150
|
+
var _this10$getOrderCusto;
|
|
3151
|
+
var customerId;
|
|
3152
|
+
return _regeneratorRuntime().wrap(function _callee39$(_context39) {
|
|
3153
|
+
while (1) switch (_context39.prev = _context39.next) {
|
|
3154
|
+
case 0:
|
|
3155
|
+
beforeScanCommit();
|
|
3156
|
+
customerId = Number(((_this10$getOrderCusto = _this10.getOrderCustomer()) === null || _this10$getOrderCusto === void 0 ? void 0 : _this10$getOrderCusto.customer_id) || 0);
|
|
3157
|
+
if (!(customerId <= 1)) {
|
|
3158
|
+
_context39.next = 4;
|
|
3159
|
+
break;
|
|
3160
|
+
}
|
|
3161
|
+
return _context39.abrupt("return", []);
|
|
3162
|
+
case 4:
|
|
3163
|
+
_context39.next = 6;
|
|
3164
|
+
return _this10.refreshDiscountConfigAfterOrderCustomerChange(customerId);
|
|
3165
|
+
case 6:
|
|
3166
|
+
beforeScanCommit();
|
|
3167
|
+
return _context39.abrupt("return", _this10.getDiscountList());
|
|
3168
|
+
case 8:
|
|
3169
|
+
case "end":
|
|
3170
|
+
return _context39.stop();
|
|
3171
|
+
}
|
|
3172
|
+
}, _callee39);
|
|
3173
|
+
}));
|
|
3174
|
+
function loadCustomerDiscounts() {
|
|
3175
|
+
return _loadCustomerDiscounts.apply(this, arguments);
|
|
3176
|
+
}
|
|
3177
|
+
return loadCustomerDiscounts;
|
|
3178
|
+
}()
|
|
3179
|
+
}), formatted, guardedBridge);
|
|
3180
|
+
case 29:
|
|
3181
|
+
_context40.t0 = _context40.sent;
|
|
3182
|
+
_context40.next = 35;
|
|
3183
|
+
break;
|
|
3184
|
+
case 32:
|
|
3185
|
+
_context40.next = 34;
|
|
3186
|
+
return applyGlobalScan(host, formatted, guardedBridge);
|
|
3187
|
+
case 34:
|
|
3188
|
+
_context40.t0 = _context40.sent;
|
|
3189
|
+
case 35:
|
|
3190
|
+
_result8 = _context40.t0;
|
|
3096
3191
|
bridge === null || bridge === void 0 || (_bridge$refresh = bridge.refresh) === null || _bridge$refresh === void 0 || _bridge$refresh.call(bridge);
|
|
3097
|
-
return
|
|
3098
|
-
case
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3192
|
+
return _context40.abrupt("return", _result8);
|
|
3193
|
+
case 40:
|
|
3194
|
+
_context40.prev = 40;
|
|
3195
|
+
_context40.t1 = _context40["catch"](4);
|
|
3196
|
+
if (!((bridge === null || bridge === void 0 ? void 0 : bridge.scanScope) === 'product-voucher-collection')) {
|
|
3197
|
+
_context40.next = 46;
|
|
3198
|
+
break;
|
|
3199
|
+
}
|
|
3200
|
+
if (!(((_bridge$isCurrent = bridge.isCurrent) === null || _bridge$isCurrent === void 0 ? void 0 : _bridge$isCurrent.call(bridge)) === false)) {
|
|
3201
|
+
_context40.next = 45;
|
|
3202
|
+
break;
|
|
3203
|
+
}
|
|
3204
|
+
return _context40.abrupt("return", {
|
|
3205
|
+
status: 'cancelled'
|
|
3206
|
+
});
|
|
3207
|
+
case 45:
|
|
3208
|
+
return _context40.abrupt("return", {
|
|
3209
|
+
status: 'failed',
|
|
3210
|
+
reason: 'entry_resolution_failed'
|
|
3211
|
+
});
|
|
3212
|
+
case 46:
|
|
3213
|
+
console.error('[BookingTicket] handleGlobalScanCode failed', _context40.t1);
|
|
3102
3214
|
bridge === null || bridge === void 0 || (_bridge$onNotify3 = bridge.onNotify) === null || _bridge$onNotify3 === void 0 || _bridge$onNotify3.call(bridge, 'fail', 'pisell2.text.scan-global-failed');
|
|
3103
|
-
return
|
|
3215
|
+
return _context40.abrupt("return", {
|
|
3104
3216
|
status: 'failed',
|
|
3105
3217
|
reason: 'not_found'
|
|
3106
3218
|
});
|
|
3107
|
-
case
|
|
3219
|
+
case 49:
|
|
3108
3220
|
case "end":
|
|
3109
|
-
return
|
|
3221
|
+
return _context40.stop();
|
|
3110
3222
|
}
|
|
3111
|
-
},
|
|
3223
|
+
}, _callee40, this, [[4, 40]]);
|
|
3112
3224
|
}));
|
|
3113
3225
|
function handleGlobalScanCode(_x23, _x24) {
|
|
3114
3226
|
return _handleGlobalScanCode.apply(this, arguments);
|
|
@@ -3118,37 +3230,37 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3118
3230
|
}, {
|
|
3119
3231
|
key: "getGlobalScanCodeType",
|
|
3120
3232
|
value: (function () {
|
|
3121
|
-
var _getGlobalScanCodeType = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3122
|
-
var
|
|
3233
|
+
var _getGlobalScanCodeType = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee41(code) {
|
|
3234
|
+
var _this11 = this,
|
|
3123
3235
|
_formatGlobalScanResu,
|
|
3124
3236
|
_formatGlobalScanResu2;
|
|
3125
3237
|
var trimmed, scan, raw;
|
|
3126
|
-
return _regeneratorRuntime().wrap(function
|
|
3127
|
-
while (1) switch (
|
|
3238
|
+
return _regeneratorRuntime().wrap(function _callee41$(_context41) {
|
|
3239
|
+
while (1) switch (_context41.prev = _context41.next) {
|
|
3128
3240
|
case 0:
|
|
3129
3241
|
trimmed = typeof code === 'string' ? code.trim() : '';
|
|
3130
3242
|
if (trimmed) {
|
|
3131
|
-
|
|
3243
|
+
_context41.next = 3;
|
|
3132
3244
|
break;
|
|
3133
3245
|
}
|
|
3134
|
-
return
|
|
3246
|
+
return _context41.abrupt("return", null);
|
|
3135
3247
|
case 3:
|
|
3136
3248
|
scan = handleGlobalScan(this.request, function (value) {
|
|
3137
|
-
return
|
|
3249
|
+
return _this11.store.products.findProductsByCodeOrBarcode(value);
|
|
3138
3250
|
}, this.getSubmitOrderSalesChannel());
|
|
3139
|
-
|
|
3251
|
+
_context41.next = 6;
|
|
3140
3252
|
return scan({
|
|
3141
3253
|
type: 'nativeScanner',
|
|
3142
3254
|
value: trimmed
|
|
3143
3255
|
});
|
|
3144
3256
|
case 6:
|
|
3145
|
-
raw =
|
|
3146
|
-
return
|
|
3257
|
+
raw = _context41.sent;
|
|
3258
|
+
return _context41.abrupt("return", (_formatGlobalScanResu = (_formatGlobalScanResu2 = formatGlobalScanResult(raw, trimmed)) === null || _formatGlobalScanResu2 === void 0 ? void 0 : _formatGlobalScanResu2.searchType) !== null && _formatGlobalScanResu !== void 0 ? _formatGlobalScanResu : null);
|
|
3147
3259
|
case 8:
|
|
3148
3260
|
case "end":
|
|
3149
|
-
return
|
|
3261
|
+
return _context41.stop();
|
|
3150
3262
|
}
|
|
3151
|
-
},
|
|
3263
|
+
}, _callee41, this);
|
|
3152
3264
|
}));
|
|
3153
3265
|
function getGlobalScanCodeType(_x25) {
|
|
3154
3266
|
return _getGlobalScanCodeType.apply(this, arguments);
|
|
@@ -3232,11 +3344,11 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3232
3344
|
}, {
|
|
3233
3345
|
key: "addAddTimeProductToBooking",
|
|
3234
3346
|
value: (function () {
|
|
3235
|
-
var _addAddTimeProductToBooking = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3236
|
-
return _regeneratorRuntime().wrap(function
|
|
3237
|
-
while (1) switch (
|
|
3347
|
+
var _addAddTimeProductToBooking = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee42(input) {
|
|
3348
|
+
return _regeneratorRuntime().wrap(function _callee42$(_context42) {
|
|
3349
|
+
while (1) switch (_context42.prev = _context42.next) {
|
|
3238
3350
|
case 0:
|
|
3239
|
-
return
|
|
3351
|
+
return _context42.abrupt("return", this.addAddTimeProductsToBooking({
|
|
3240
3352
|
booking: input.booking,
|
|
3241
3353
|
products: [input],
|
|
3242
3354
|
coveredMinutes: input.coveredMinutes,
|
|
@@ -3244,9 +3356,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3244
3356
|
}));
|
|
3245
3357
|
case 1:
|
|
3246
3358
|
case "end":
|
|
3247
|
-
return
|
|
3359
|
+
return _context42.stop();
|
|
3248
3360
|
}
|
|
3249
|
-
},
|
|
3361
|
+
}, _callee42, this);
|
|
3250
3362
|
}));
|
|
3251
3363
|
function addAddTimeProductToBooking(_x26) {
|
|
3252
3364
|
return _addAddTimeProductToBooking.apply(this, arguments);
|
|
@@ -3266,27 +3378,27 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3266
3378
|
}, {
|
|
3267
3379
|
key: "addAddTimeProductsToBooking",
|
|
3268
3380
|
value: (function () {
|
|
3269
|
-
var _addAddTimeProductsToBooking = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3270
|
-
var
|
|
3381
|
+
var _addAddTimeProductsToBooking = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee43(input) {
|
|
3382
|
+
var _this12 = this,
|
|
3271
3383
|
_input$bookingPatch;
|
|
3272
3384
|
var bookingUid, orderLines, coveredMinutes, bookingTimePatch, result, _iterator2, _step2, line;
|
|
3273
|
-
return _regeneratorRuntime().wrap(function
|
|
3274
|
-
while (1) switch (
|
|
3385
|
+
return _regeneratorRuntime().wrap(function _callee43$(_context43) {
|
|
3386
|
+
while (1) switch (_context43.prev = _context43.next) {
|
|
3275
3387
|
case 0:
|
|
3276
3388
|
bookingUid = resolveBookingUidForAddTime(input === null || input === void 0 ? void 0 : input.booking);
|
|
3277
3389
|
if (bookingUid) {
|
|
3278
|
-
|
|
3390
|
+
_context43.next = 3;
|
|
3279
3391
|
break;
|
|
3280
3392
|
}
|
|
3281
3393
|
throw new Error('[BookingTicket] addAddTimeProductToBooking: booking.metadata.unique_identification_number 缺失');
|
|
3282
3394
|
case 3:
|
|
3283
3395
|
orderLines = (input.products || []).map(function (line) {
|
|
3284
3396
|
return {
|
|
3285
|
-
product:
|
|
3397
|
+
product: _this12.buildAddTimeOrderLine(line, bookingUid)
|
|
3286
3398
|
};
|
|
3287
3399
|
});
|
|
3288
3400
|
if (this.store.order) {
|
|
3289
|
-
|
|
3401
|
+
_context43.next = 6;
|
|
3290
3402
|
break;
|
|
3291
3403
|
}
|
|
3292
3404
|
throw new Error('order 模块未初始化');
|
|
@@ -3300,53 +3412,53 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3300
3412
|
});
|
|
3301
3413
|
}
|
|
3302
3414
|
if (!(typeof this.store.order.addProductsToOrder === 'function')) {
|
|
3303
|
-
|
|
3415
|
+
_context43.next = 11;
|
|
3304
3416
|
break;
|
|
3305
3417
|
}
|
|
3306
|
-
return
|
|
3418
|
+
return _context43.abrupt("return", this.store.order.addProductsToOrder(orderLines));
|
|
3307
3419
|
case 11:
|
|
3308
3420
|
result = [];
|
|
3309
3421
|
_iterator2 = _createForOfIteratorHelper(orderLines);
|
|
3310
|
-
|
|
3422
|
+
_context43.prev = 13;
|
|
3311
3423
|
_iterator2.s();
|
|
3312
3424
|
case 15:
|
|
3313
3425
|
if ((_step2 = _iterator2.n()).done) {
|
|
3314
|
-
|
|
3426
|
+
_context43.next = 29;
|
|
3315
3427
|
break;
|
|
3316
3428
|
}
|
|
3317
3429
|
line = _step2.value;
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3430
|
+
_context43.t0 = result.splice;
|
|
3431
|
+
_context43.t1 = result;
|
|
3432
|
+
_context43.t2 = [0, result.length];
|
|
3433
|
+
_context43.t3 = _toConsumableArray;
|
|
3434
|
+
_context43.next = 23;
|
|
3323
3435
|
return this.addProductToOrder(line.product);
|
|
3324
3436
|
case 23:
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3437
|
+
_context43.t4 = _context43.sent;
|
|
3438
|
+
_context43.t5 = (0, _context43.t3)(_context43.t4);
|
|
3439
|
+
_context43.t6 = _context43.t2.concat.call(_context43.t2, _context43.t5);
|
|
3440
|
+
_context43.t0.apply.call(_context43.t0, _context43.t1, _context43.t6);
|
|
3329
3441
|
case 27:
|
|
3330
|
-
|
|
3442
|
+
_context43.next = 15;
|
|
3331
3443
|
break;
|
|
3332
3444
|
case 29:
|
|
3333
|
-
|
|
3445
|
+
_context43.next = 34;
|
|
3334
3446
|
break;
|
|
3335
3447
|
case 31:
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
_iterator2.e(
|
|
3448
|
+
_context43.prev = 31;
|
|
3449
|
+
_context43.t7 = _context43["catch"](13);
|
|
3450
|
+
_iterator2.e(_context43.t7);
|
|
3339
3451
|
case 34:
|
|
3340
|
-
|
|
3452
|
+
_context43.prev = 34;
|
|
3341
3453
|
_iterator2.f();
|
|
3342
|
-
return
|
|
3454
|
+
return _context43.finish(34);
|
|
3343
3455
|
case 37:
|
|
3344
|
-
return
|
|
3456
|
+
return _context43.abrupt("return", result);
|
|
3345
3457
|
case 38:
|
|
3346
3458
|
case "end":
|
|
3347
|
-
return
|
|
3459
|
+
return _context43.stop();
|
|
3348
3460
|
}
|
|
3349
|
-
},
|
|
3461
|
+
}, _callee43, this, [[13, 31, 34, 37]]);
|
|
3350
3462
|
}));
|
|
3351
3463
|
function addAddTimeProductsToBooking(_x27) {
|
|
3352
3464
|
return _addAddTimeProductsToBooking.apply(this, arguments);
|
|
@@ -3356,47 +3468,47 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3356
3468
|
}, {
|
|
3357
3469
|
key: "setOtherParams",
|
|
3358
3470
|
value: function () {
|
|
3359
|
-
var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3360
|
-
var
|
|
3471
|
+
var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee44(params) {
|
|
3472
|
+
var _this13 = this;
|
|
3361
3473
|
var _ref21,
|
|
3362
3474
|
_ref21$cover,
|
|
3363
3475
|
cover,
|
|
3364
3476
|
nextParams,
|
|
3365
3477
|
invoiceContextChanged,
|
|
3366
|
-
|
|
3367
|
-
return _regeneratorRuntime().wrap(function
|
|
3368
|
-
while (1) switch (
|
|
3478
|
+
_args44 = arguments;
|
|
3479
|
+
return _regeneratorRuntime().wrap(function _callee44$(_context44) {
|
|
3480
|
+
while (1) switch (_context44.prev = _context44.next) {
|
|
3369
3481
|
case 0:
|
|
3370
|
-
_ref21 =
|
|
3482
|
+
_ref21 = _args44.length > 1 && _args44[1] !== undefined ? _args44[1] : {}, _ref21$cover = _ref21.cover, cover = _ref21$cover === void 0 ? false : _ref21$cover;
|
|
3371
3483
|
nextParams = cover ? params : _objectSpread(_objectSpread({}, this.otherParams), params);
|
|
3372
3484
|
if (['businessCode', 'business_code', 'channel', 'platform', 'shop_id', 'tenantId', 'cacheId'].some(function (key) {
|
|
3373
|
-
var
|
|
3374
|
-
return (nextParams === null || nextParams === void 0 ? void 0 : nextParams[key]) !== ((
|
|
3485
|
+
var _this13$otherParams;
|
|
3486
|
+
return (nextParams === null || nextParams === void 0 ? void 0 : nextParams[key]) !== ((_this13$otherParams = _this13.otherParams) === null || _this13$otherParams === void 0 ? void 0 : _this13$otherParams[key]);
|
|
3375
3487
|
})) this.orderCustomerContactRequest = null;
|
|
3376
|
-
|
|
3488
|
+
_context44.next = 5;
|
|
3377
3489
|
return _get(_getPrototypeOf(BookingTicketImpl.prototype), "setOtherParams", this).call(this, params, {
|
|
3378
3490
|
cover: cover
|
|
3379
3491
|
});
|
|
3380
3492
|
case 5:
|
|
3381
3493
|
invoiceContextChanged = (params === null || params === void 0 ? void 0 : params.businessCode) !== undefined || (params === null || params === void 0 ? void 0 : params.business_code) !== undefined || (params === null || params === void 0 ? void 0 : params.channel) !== undefined || (params === null || params === void 0 ? void 0 : params.platform) !== undefined || Object.prototype.hasOwnProperty.call(params, 'openData');
|
|
3382
3494
|
if (!invoiceContextChanged) {
|
|
3383
|
-
|
|
3495
|
+
_context44.next = 9;
|
|
3384
3496
|
break;
|
|
3385
3497
|
}
|
|
3386
|
-
|
|
3498
|
+
_context44.next = 9;
|
|
3387
3499
|
return this.prepareInvoiceTemplateAtSolutionReady(Object.prototype.hasOwnProperty.call(params, 'openData') ? this.getInjectedOpenDataConfig() : undefined);
|
|
3388
3500
|
case 9:
|
|
3389
3501
|
if (!((params === null || params === void 0 ? void 0 : params.businessCode) !== undefined || (params === null || params === void 0 ? void 0 : params.business_code) !== undefined)) {
|
|
3390
|
-
|
|
3502
|
+
_context44.next = 12;
|
|
3391
3503
|
break;
|
|
3392
3504
|
}
|
|
3393
|
-
|
|
3505
|
+
_context44.next = 12;
|
|
3394
3506
|
return this.configureIdGeneratorFromOpenData();
|
|
3395
3507
|
case 12:
|
|
3396
3508
|
case "end":
|
|
3397
|
-
return
|
|
3509
|
+
return _context44.stop();
|
|
3398
3510
|
}
|
|
3399
|
-
},
|
|
3511
|
+
}, _callee44, this);
|
|
3400
3512
|
}));
|
|
3401
3513
|
function setOtherParams(_x28) {
|
|
3402
3514
|
return _setOtherParams.apply(this, arguments);
|
|
@@ -3415,15 +3527,15 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3415
3527
|
}, {
|
|
3416
3528
|
key: "handlePrintWristband",
|
|
3417
3529
|
value: function () {
|
|
3418
|
-
var _handlePrintWristband = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3530
|
+
var _handlePrintWristband = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee45(params) {
|
|
3419
3531
|
var _this$getOrderIdentit2;
|
|
3420
3532
|
var deviceTask, deviceId, idempotencyKey;
|
|
3421
|
-
return _regeneratorRuntime().wrap(function
|
|
3422
|
-
while (1) switch (
|
|
3533
|
+
return _regeneratorRuntime().wrap(function _callee45$(_context45) {
|
|
3534
|
+
while (1) switch (_context45.prev = _context45.next) {
|
|
3423
3535
|
case 0:
|
|
3424
3536
|
deviceTask = this.getDeviceTaskPlugin();
|
|
3425
3537
|
if (deviceTask !== null && deviceTask !== void 0 && deviceTask.dispatch) {
|
|
3426
|
-
|
|
3538
|
+
_context45.next = 4;
|
|
3427
3539
|
break;
|
|
3428
3540
|
}
|
|
3429
3541
|
this.logger.addLog({
|
|
@@ -3433,7 +3545,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3433
3545
|
voucher_ids: Array.isArray(params.voucher_ids) ? params.voucher_ids : [params.voucher_ids]
|
|
3434
3546
|
}
|
|
3435
3547
|
});
|
|
3436
|
-
return
|
|
3548
|
+
return _context45.abrupt("return");
|
|
3437
3549
|
case 4:
|
|
3438
3550
|
this.logger.addLog({
|
|
3439
3551
|
type: 'info',
|
|
@@ -3442,10 +3554,10 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3442
3554
|
voucher_ids: Array.isArray(params.voucher_ids) ? params.voucher_ids : [params.voucher_ids]
|
|
3443
3555
|
}
|
|
3444
3556
|
});
|
|
3445
|
-
|
|
3557
|
+
_context45.next = 7;
|
|
3446
3558
|
return this.getShortNumberOrDeviceId();
|
|
3447
3559
|
case 7:
|
|
3448
|
-
deviceId =
|
|
3560
|
+
deviceId = _context45.sent;
|
|
3449
3561
|
idempotencyKey = createUuidV4();
|
|
3450
3562
|
deviceTask.dispatch({
|
|
3451
3563
|
action: 'print_all',
|
|
@@ -3465,9 +3577,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3465
3577
|
});
|
|
3466
3578
|
case 10:
|
|
3467
3579
|
case "end":
|
|
3468
|
-
return
|
|
3580
|
+
return _context45.stop();
|
|
3469
3581
|
}
|
|
3470
|
-
},
|
|
3582
|
+
}, _callee45, this);
|
|
3471
3583
|
}));
|
|
3472
3584
|
function handlePrintWristband(_x29) {
|
|
3473
3585
|
return _handlePrintWristband.apply(this, arguments);
|
|
@@ -3477,11 +3589,11 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3477
3589
|
}, {
|
|
3478
3590
|
key: "handleRedeem",
|
|
3479
3591
|
value: function () {
|
|
3480
|
-
var _handleRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3592
|
+
var _handleRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee46(params) {
|
|
3481
3593
|
var _this$store$order8, _this$store$order8$ge, _this$store$order9, _ref22, _tempOrder$order_id2;
|
|
3482
3594
|
var voucherIds, status, voucherIdSet, tempOrder, vouchers, hasUpdatedVoucher, nextVouchers, identity, externalSaleNumber, orderId, orderLookup;
|
|
3483
|
-
return _regeneratorRuntime().wrap(function
|
|
3484
|
-
while (1) switch (
|
|
3595
|
+
return _regeneratorRuntime().wrap(function _callee46$(_context46) {
|
|
3596
|
+
while (1) switch (_context46.prev = _context46.next) {
|
|
3485
3597
|
case 0:
|
|
3486
3598
|
voucherIds = Array.isArray(params.voucher_ids) ? params.voucher_ids : [];
|
|
3487
3599
|
status = params.is_checkin ? 'used' : 'unused';
|
|
@@ -3505,20 +3617,22 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3505
3617
|
});
|
|
3506
3618
|
});
|
|
3507
3619
|
if (!(tempOrder && hasUpdatedVoucher)) {
|
|
3508
|
-
|
|
3620
|
+
_context46.next = 11;
|
|
3509
3621
|
break;
|
|
3510
3622
|
}
|
|
3511
|
-
|
|
3623
|
+
_context46.next = 11;
|
|
3512
3624
|
return this.replaceTempOrder(_objectSpread(_objectSpread({}, tempOrder), {}, {
|
|
3513
3625
|
vouchers: nextVouchers
|
|
3514
|
-
})
|
|
3626
|
+
}), {
|
|
3627
|
+
preserveOrderSessionId: this.getOrderSessionId() || undefined
|
|
3628
|
+
});
|
|
3515
3629
|
case 11:
|
|
3516
3630
|
this.core.effects.emit("".concat(this.name, ":onVouchersChange"), {});
|
|
3517
3631
|
if (!(voucherIds.length === 0)) {
|
|
3518
|
-
|
|
3632
|
+
_context46.next = 14;
|
|
3519
3633
|
break;
|
|
3520
3634
|
}
|
|
3521
|
-
return
|
|
3635
|
+
return _context46.abrupt("return", {
|
|
3522
3636
|
code: 200,
|
|
3523
3637
|
status: true,
|
|
3524
3638
|
message: '',
|
|
@@ -3529,7 +3643,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3529
3643
|
externalSaleNumber = (tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.external_sale_number) || (identity === null || identity === void 0 ? void 0 : identity.externalSaleNumber) || undefined;
|
|
3530
3644
|
orderId = (_ref22 = (_tempOrder$order_id2 = tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.order_id) !== null && _tempOrder$order_id2 !== void 0 ? _tempOrder$order_id2 : identity === null || identity === void 0 ? void 0 : identity.orderId) !== null && _ref22 !== void 0 ? _ref22 : undefined;
|
|
3531
3645
|
orderLookup = externalSaleNumber || orderId || (identity === null || identity === void 0 ? void 0 : identity.orderNumber) || (identity === null || identity === void 0 ? void 0 : identity.shopOrderNumber) || (identity === null || identity === void 0 ? void 0 : identity.shopFullOrderNumber) || undefined;
|
|
3532
|
-
return
|
|
3646
|
+
return _context46.abrupt("return", this.request.post('/machinecode/batch', {
|
|
3533
3647
|
ids: voucherIds,
|
|
3534
3648
|
status: status,
|
|
3535
3649
|
order_lookup: orderLookup,
|
|
@@ -3540,9 +3654,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3540
3654
|
}));
|
|
3541
3655
|
case 19:
|
|
3542
3656
|
case "end":
|
|
3543
|
-
return
|
|
3657
|
+
return _context46.stop();
|
|
3544
3658
|
}
|
|
3545
|
-
},
|
|
3659
|
+
}, _callee46, this);
|
|
3546
3660
|
}));
|
|
3547
3661
|
function handleRedeem(_x30) {
|
|
3548
3662
|
return _handleRedeem.apply(this, arguments);
|
|
@@ -3556,13 +3670,13 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3556
3670
|
}, {
|
|
3557
3671
|
key: "destroy",
|
|
3558
3672
|
value: (function () {
|
|
3559
|
-
var _destroy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3673
|
+
var _destroy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee47() {
|
|
3560
3674
|
var _this$scan;
|
|
3561
|
-
return _regeneratorRuntime().wrap(function
|
|
3562
|
-
while (1) switch (
|
|
3675
|
+
return _regeneratorRuntime().wrap(function _callee47$(_context47) {
|
|
3676
|
+
while (1) switch (_context47.prev = _context47.next) {
|
|
3563
3677
|
case 0:
|
|
3564
3678
|
this.orderCustomerContactRequest = null;
|
|
3565
|
-
|
|
3679
|
+
_context47.next = 3;
|
|
3566
3680
|
return _get(_getPrototypeOf(BookingTicketImpl.prototype), "destroy", this).call(this);
|
|
3567
3681
|
case 3:
|
|
3568
3682
|
try {
|
|
@@ -3573,9 +3687,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3573
3687
|
scanCache.clear();
|
|
3574
3688
|
case 5:
|
|
3575
3689
|
case "end":
|
|
3576
|
-
return
|
|
3690
|
+
return _context47.stop();
|
|
3577
3691
|
}
|
|
3578
|
-
},
|
|
3692
|
+
}, _callee47, this);
|
|
3579
3693
|
}));
|
|
3580
3694
|
function destroy() {
|
|
3581
3695
|
return _destroy.apply(this, arguments);
|