@pisell/pisellos 0.10.69 → 0.10.70

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.
@@ -1,9 +0,0 @@
1
- // 导出评估器
2
- export { PromotionEvaluator } from "./evaluator";
3
-
4
- // 导出适配器
5
- export { PromotionAdapter } from "./adapter";
6
- export { default } from "./adapter";
7
-
8
- // 导出策略配置示例常量
9
- export { X_ITEMS_FOR_Y_PRICE_STRATEGY, BUY_X_GET_Y_FREE_STRATEGY, ITEM_REWARD_STRATEGY } from "./examples";
@@ -479,7 +479,19 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
479
479
  * 加车两阶段主决策(规格弹窗 / 资源编辑 / 直接加车)。
480
480
  * 与 ticketBooking `handleSelectProduct` + `handleBooking4Service` 等价。
481
481
  */
482
- decideAddProduct(item: any, options?: Partial<AddProductDecideContext>): import("./utils/addProductDecision").AddProductDecision;
482
+ decideAddProduct(item: any, options?: Partial<AddProductDecideContext>): {
483
+ action: "reloadCatalog";
484
+ } | {
485
+ action: "add";
486
+ cacheItem: any;
487
+ } | {
488
+ action: "requiresDetail";
489
+ payload: AddProductRequiresDetailPayload;
490
+ } | {
491
+ action: "requiresBookingEdit";
492
+ cacheItem: any;
493
+ payload: import("./utils/addProductDecision").AddProductRequiresBookingEditPayload;
494
+ };
483
495
  /** 规格弹窗 callback 后的第二段决策。 */
484
496
  decideAfterDetail(cacheItem: any, options?: Partial<AddProductDecideContext>): import("./utils/addProductDecision").AddProductDecision;
485
497
  /**
@@ -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";
@@ -2937,24 +2938,24 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2937
2938
  }, {
2938
2939
  key: "handleGlobalScanCode",
2939
2940
  value: (function () {
2940
- var _handleGlobalScanCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee38(code, bridge) {
2941
+ var _handleGlobalScanCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee39(code, bridge) {
2941
2942
  var _this8 = this;
2942
- var trimmed, _bridge$onNotify, _bridge$refresh, beforeScanCommit, beforeScanDialog, guardCallback, guardedBridge, _promotion$isAccepted, promotion, localSearch, scanCallback, raw, formatted, _bridge$onNotify2, _result8, _bridge$onNotify3;
2943
- return _regeneratorRuntime().wrap(function _callee38$(_context38) {
2944
- while (1) switch (_context38.prev = _context38.next) {
2943
+ 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;
2944
+ return _regeneratorRuntime().wrap(function _callee39$(_context39) {
2945
+ while (1) switch (_context39.prev = _context39.next) {
2945
2946
  case 0:
2946
2947
  trimmed = typeof code === 'string' ? code.trim() : '';
2947
2948
  if (trimmed) {
2948
- _context38.next = 4;
2949
+ _context39.next = 4;
2949
2950
  break;
2950
2951
  }
2951
2952
  bridge === null || bridge === void 0 || (_bridge$onNotify = bridge.onNotify) === null || _bridge$onNotify === void 0 || _bridge$onNotify.call(bridge, 'fail', 'pisell2.text.scan-global-failed');
2952
- return _context38.abrupt("return", {
2953
+ return _context39.abrupt("return", {
2953
2954
  status: 'failed',
2954
2955
  reason: 'empty_code'
2955
2956
  });
2956
2957
  case 4:
2957
- _context38.prev = 4;
2958
+ _context39.prev = 4;
2958
2959
  // Capture before lookup/UI awaits, so a result cannot land in a new cart.
2959
2960
  // Unscoped POS Order modules return a no-op guard.
2960
2961
  beforeScanCommit = this.store.order.createCartIntentCommitGuard('add_product');
@@ -2981,23 +2982,23 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2981
2982
  } : undefined
2982
2983
  }) : undefined;
2983
2984
  if (!((guardedBridge === null || guardedBridge === void 0 ? void 0 : guardedBridge.scanScope) === 'product-voucher')) {
2984
- _context38.next = 16;
2985
+ _context39.next = 16;
2985
2986
  break;
2986
2987
  }
2987
2988
  if (guardedBridge.applyPromotionCode) {
2988
- _context38.next = 12;
2989
+ _context39.next = 12;
2989
2990
  break;
2990
2991
  }
2991
- return _context38.abrupt("return", {
2992
+ return _context39.abrupt("return", {
2992
2993
  status: 'failed',
2993
2994
  reason: 'no_bridge'
2994
2995
  });
2995
2996
  case 12:
2996
- _context38.next = 14;
2997
+ _context39.next = 14;
2997
2998
  return guardedBridge.applyPromotionCode(trimmed);
2998
2999
  case 14:
2999
- promotion = _context38.sent;
3000
- return _context38.abrupt("return", ((_promotion$isAccepted = promotion.isAccepted) !== null && _promotion$isAccepted !== void 0 ? _promotion$isAccepted : promotion.isAvailable) ? {
3000
+ promotion = _context39.sent;
3001
+ return _context39.abrupt("return", ((_promotion$isAccepted = promotion.isAccepted) !== null && _promotion$isAccepted !== void 0 ? _promotion$isAccepted : promotion.isAvailable) ? {
3001
3002
  status: 'success',
3002
3003
  kind: 'promotion'
3003
3004
  } : {
@@ -3009,26 +3010,25 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3009
3010
  return _this8.store.products.findProductsByCodeOrBarcode(v);
3010
3011
  };
3011
3012
  scanCallback = handleGlobalScan(this.request, localSearch, this.getSubmitOrderSalesChannel());
3012
- _context38.next = 20;
3013
+ _context39.next = 20;
3013
3014
  return scanCallback({
3014
3015
  type: 'nativeScanner',
3015
3016
  value: trimmed
3016
3017
  });
3017
3018
  case 20:
3018
- raw = _context38.sent;
3019
+ raw = _context39.sent;
3019
3020
  formatted = formatGlobalScanResult(raw, trimmed);
3020
3021
  if (formatted) {
3021
- _context38.next = 25;
3022
+ _context39.next = 25;
3022
3023
  break;
3023
3024
  }
3024
3025
  bridge === null || bridge === void 0 || (_bridge$onNotify2 = bridge.onNotify) === null || _bridge$onNotify2 === void 0 || _bridge$onNotify2.call(bridge, 'fail', 'pisell2.text.scan-global-failed');
3025
- return _context38.abrupt("return", {
3026
+ return _context39.abrupt("return", {
3026
3027
  status: 'failed',
3027
3028
  reason: 'not_found'
3028
3029
  });
3029
3030
  case 25:
3030
- _context38.next = 27;
3031
- return applyGlobalScan({
3031
+ host = {
3032
3032
  setOrderCustomer: function setOrderCustomer(customer) {
3033
3033
  beforeScanCommit();
3034
3034
  _this8.setOrderCustomer(customer);
@@ -3066,25 +3066,90 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3066
3066
  beforeScanCommit();
3067
3067
  return _this8.scanWalletAsset(scanCode);
3068
3068
  }
3069
- }, formatted, guardedBridge);
3070
- case 27:
3071
- _result8 = _context38.sent;
3072
- bridge === null || bridge === void 0 || (_bridge$refresh = bridge.refresh) === null || _bridge$refresh === void 0 || _bridge$refresh.call(bridge);
3073
- return _context38.abrupt("return", _result8);
3069
+ };
3070
+ if (!((guardedBridge === null || guardedBridge === void 0 ? void 0 : guardedBridge.scanScope) === 'product-voucher-collection')) {
3071
+ _context39.next = 32;
3072
+ break;
3073
+ }
3074
+ _context39.next = 29;
3075
+ return applyProductVoucherCollectionScan(_objectSpread(_objectSpread({}, host), {}, {
3076
+ waitForCustomerDiscounts: function waitForCustomerDiscounts() {
3077
+ return _this8.orderCustomerDiscountRefreshInFlight || Promise.resolve();
3078
+ },
3079
+ loadCustomerDiscounts: function () {
3080
+ var _loadCustomerDiscounts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee38() {
3081
+ var _this8$getOrderCustom;
3082
+ var customerId;
3083
+ return _regeneratorRuntime().wrap(function _callee38$(_context38) {
3084
+ while (1) switch (_context38.prev = _context38.next) {
3085
+ case 0:
3086
+ customerId = Number(((_this8$getOrderCustom = _this8.getOrderCustomer()) === null || _this8$getOrderCustom === void 0 ? void 0 : _this8$getOrderCustom.customer_id) || 0);
3087
+ if (!(customerId <= 1)) {
3088
+ _context38.next = 3;
3089
+ break;
3090
+ }
3091
+ return _context38.abrupt("return", []);
3092
+ case 3:
3093
+ _context38.next = 5;
3094
+ return _this8.refreshDiscountConfigAfterOrderCustomerChange(customerId);
3095
+ case 5:
3096
+ return _context38.abrupt("return", _this8.getDiscountList());
3097
+ case 6:
3098
+ case "end":
3099
+ return _context38.stop();
3100
+ }
3101
+ }, _callee38);
3102
+ }));
3103
+ function loadCustomerDiscounts() {
3104
+ return _loadCustomerDiscounts.apply(this, arguments);
3105
+ }
3106
+ return loadCustomerDiscounts;
3107
+ }()
3108
+ }), formatted, guardedBridge);
3109
+ case 29:
3110
+ _context39.t0 = _context39.sent;
3111
+ _context39.next = 35;
3112
+ break;
3074
3113
  case 32:
3075
- _context38.prev = 32;
3076
- _context38.t0 = _context38["catch"](4);
3077
- console.error('[BookingTicket] handleGlobalScanCode failed', _context38.t0);
3114
+ _context39.next = 34;
3115
+ return applyGlobalScan(host, formatted, guardedBridge);
3116
+ case 34:
3117
+ _context39.t0 = _context39.sent;
3118
+ case 35:
3119
+ _result8 = _context39.t0;
3120
+ bridge === null || bridge === void 0 || (_bridge$refresh = bridge.refresh) === null || _bridge$refresh === void 0 || _bridge$refresh.call(bridge);
3121
+ return _context39.abrupt("return", _result8);
3122
+ case 40:
3123
+ _context39.prev = 40;
3124
+ _context39.t1 = _context39["catch"](4);
3125
+ if (!((bridge === null || bridge === void 0 ? void 0 : bridge.scanScope) === 'product-voucher-collection')) {
3126
+ _context39.next = 46;
3127
+ break;
3128
+ }
3129
+ if (!(((_bridge$isCurrent = bridge.isCurrent) === null || _bridge$isCurrent === void 0 ? void 0 : _bridge$isCurrent.call(bridge)) === false)) {
3130
+ _context39.next = 45;
3131
+ break;
3132
+ }
3133
+ return _context39.abrupt("return", {
3134
+ status: 'cancelled'
3135
+ });
3136
+ case 45:
3137
+ return _context39.abrupt("return", {
3138
+ status: 'failed',
3139
+ reason: 'entry_resolution_failed'
3140
+ });
3141
+ case 46:
3142
+ console.error('[BookingTicket] handleGlobalScanCode failed', _context39.t1);
3078
3143
  bridge === null || bridge === void 0 || (_bridge$onNotify3 = bridge.onNotify) === null || _bridge$onNotify3 === void 0 || _bridge$onNotify3.call(bridge, 'fail', 'pisell2.text.scan-global-failed');
3079
- return _context38.abrupt("return", {
3144
+ return _context39.abrupt("return", {
3080
3145
  status: 'failed',
3081
3146
  reason: 'not_found'
3082
3147
  });
3083
- case 37:
3148
+ case 49:
3084
3149
  case "end":
3085
- return _context38.stop();
3150
+ return _context39.stop();
3086
3151
  }
3087
- }, _callee38, this, [[4, 32]]);
3152
+ }, _callee39, this, [[4, 40]]);
3088
3153
  }));
3089
3154
  function handleGlobalScanCode(_x23, _x24) {
3090
3155
  return _handleGlobalScanCode.apply(this, arguments);
@@ -3094,37 +3159,37 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3094
3159
  }, {
3095
3160
  key: "getGlobalScanCodeType",
3096
3161
  value: (function () {
3097
- var _getGlobalScanCodeType = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee39(code) {
3162
+ var _getGlobalScanCodeType = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee40(code) {
3098
3163
  var _this9 = this,
3099
3164
  _formatGlobalScanResu,
3100
3165
  _formatGlobalScanResu2;
3101
3166
  var trimmed, scan, raw;
3102
- return _regeneratorRuntime().wrap(function _callee39$(_context39) {
3103
- while (1) switch (_context39.prev = _context39.next) {
3167
+ return _regeneratorRuntime().wrap(function _callee40$(_context40) {
3168
+ while (1) switch (_context40.prev = _context40.next) {
3104
3169
  case 0:
3105
3170
  trimmed = typeof code === 'string' ? code.trim() : '';
3106
3171
  if (trimmed) {
3107
- _context39.next = 3;
3172
+ _context40.next = 3;
3108
3173
  break;
3109
3174
  }
3110
- return _context39.abrupt("return", null);
3175
+ return _context40.abrupt("return", null);
3111
3176
  case 3:
3112
3177
  scan = handleGlobalScan(this.request, function (value) {
3113
3178
  return _this9.store.products.findProductsByCodeOrBarcode(value);
3114
3179
  }, this.getSubmitOrderSalesChannel());
3115
- _context39.next = 6;
3180
+ _context40.next = 6;
3116
3181
  return scan({
3117
3182
  type: 'nativeScanner',
3118
3183
  value: trimmed
3119
3184
  });
3120
3185
  case 6:
3121
- raw = _context39.sent;
3122
- return _context39.abrupt("return", (_formatGlobalScanResu = (_formatGlobalScanResu2 = formatGlobalScanResult(raw, trimmed)) === null || _formatGlobalScanResu2 === void 0 ? void 0 : _formatGlobalScanResu2.searchType) !== null && _formatGlobalScanResu !== void 0 ? _formatGlobalScanResu : null);
3186
+ raw = _context40.sent;
3187
+ return _context40.abrupt("return", (_formatGlobalScanResu = (_formatGlobalScanResu2 = formatGlobalScanResult(raw, trimmed)) === null || _formatGlobalScanResu2 === void 0 ? void 0 : _formatGlobalScanResu2.searchType) !== null && _formatGlobalScanResu !== void 0 ? _formatGlobalScanResu : null);
3123
3188
  case 8:
3124
3189
  case "end":
3125
- return _context39.stop();
3190
+ return _context40.stop();
3126
3191
  }
3127
- }, _callee39, this);
3192
+ }, _callee40, this);
3128
3193
  }));
3129
3194
  function getGlobalScanCodeType(_x25) {
3130
3195
  return _getGlobalScanCodeType.apply(this, arguments);
@@ -3208,11 +3273,11 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3208
3273
  }, {
3209
3274
  key: "addAddTimeProductToBooking",
3210
3275
  value: (function () {
3211
- var _addAddTimeProductToBooking = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee40(input) {
3212
- return _regeneratorRuntime().wrap(function _callee40$(_context40) {
3213
- while (1) switch (_context40.prev = _context40.next) {
3276
+ var _addAddTimeProductToBooking = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee41(input) {
3277
+ return _regeneratorRuntime().wrap(function _callee41$(_context41) {
3278
+ while (1) switch (_context41.prev = _context41.next) {
3214
3279
  case 0:
3215
- return _context40.abrupt("return", this.addAddTimeProductsToBooking({
3280
+ return _context41.abrupt("return", this.addAddTimeProductsToBooking({
3216
3281
  booking: input.booking,
3217
3282
  products: [input],
3218
3283
  coveredMinutes: input.coveredMinutes,
@@ -3220,9 +3285,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3220
3285
  }));
3221
3286
  case 1:
3222
3287
  case "end":
3223
- return _context40.stop();
3288
+ return _context41.stop();
3224
3289
  }
3225
- }, _callee40, this);
3290
+ }, _callee41, this);
3226
3291
  }));
3227
3292
  function addAddTimeProductToBooking(_x26) {
3228
3293
  return _addAddTimeProductToBooking.apply(this, arguments);
@@ -3242,16 +3307,16 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3242
3307
  }, {
3243
3308
  key: "addAddTimeProductsToBooking",
3244
3309
  value: (function () {
3245
- var _addAddTimeProductsToBooking = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee41(input) {
3310
+ var _addAddTimeProductsToBooking = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee42(input) {
3246
3311
  var _this10 = this,
3247
3312
  _input$bookingPatch;
3248
3313
  var bookingUid, orderLines, coveredMinutes, bookingTimePatch, result, _iterator2, _step2, line;
3249
- return _regeneratorRuntime().wrap(function _callee41$(_context41) {
3250
- while (1) switch (_context41.prev = _context41.next) {
3314
+ return _regeneratorRuntime().wrap(function _callee42$(_context42) {
3315
+ while (1) switch (_context42.prev = _context42.next) {
3251
3316
  case 0:
3252
3317
  bookingUid = resolveBookingUidForAddTime(input === null || input === void 0 ? void 0 : input.booking);
3253
3318
  if (bookingUid) {
3254
- _context41.next = 3;
3319
+ _context42.next = 3;
3255
3320
  break;
3256
3321
  }
3257
3322
  throw new Error('[BookingTicket] addAddTimeProductToBooking: booking.metadata.unique_identification_number 缺失');
@@ -3262,7 +3327,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3262
3327
  };
3263
3328
  });
3264
3329
  if (this.store.order) {
3265
- _context41.next = 6;
3330
+ _context42.next = 6;
3266
3331
  break;
3267
3332
  }
3268
3333
  throw new Error('order 模块未初始化');
@@ -3276,53 +3341,53 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3276
3341
  });
3277
3342
  }
3278
3343
  if (!(typeof this.store.order.addProductsToOrder === 'function')) {
3279
- _context41.next = 11;
3344
+ _context42.next = 11;
3280
3345
  break;
3281
3346
  }
3282
- return _context41.abrupt("return", this.store.order.addProductsToOrder(orderLines));
3347
+ return _context42.abrupt("return", this.store.order.addProductsToOrder(orderLines));
3283
3348
  case 11:
3284
3349
  result = [];
3285
3350
  _iterator2 = _createForOfIteratorHelper(orderLines);
3286
- _context41.prev = 13;
3351
+ _context42.prev = 13;
3287
3352
  _iterator2.s();
3288
3353
  case 15:
3289
3354
  if ((_step2 = _iterator2.n()).done) {
3290
- _context41.next = 29;
3355
+ _context42.next = 29;
3291
3356
  break;
3292
3357
  }
3293
3358
  line = _step2.value;
3294
- _context41.t0 = result.splice;
3295
- _context41.t1 = result;
3296
- _context41.t2 = [0, result.length];
3297
- _context41.t3 = _toConsumableArray;
3298
- _context41.next = 23;
3359
+ _context42.t0 = result.splice;
3360
+ _context42.t1 = result;
3361
+ _context42.t2 = [0, result.length];
3362
+ _context42.t3 = _toConsumableArray;
3363
+ _context42.next = 23;
3299
3364
  return this.addProductToOrder(line.product);
3300
3365
  case 23:
3301
- _context41.t4 = _context41.sent;
3302
- _context41.t5 = (0, _context41.t3)(_context41.t4);
3303
- _context41.t6 = _context41.t2.concat.call(_context41.t2, _context41.t5);
3304
- _context41.t0.apply.call(_context41.t0, _context41.t1, _context41.t6);
3366
+ _context42.t4 = _context42.sent;
3367
+ _context42.t5 = (0, _context42.t3)(_context42.t4);
3368
+ _context42.t6 = _context42.t2.concat.call(_context42.t2, _context42.t5);
3369
+ _context42.t0.apply.call(_context42.t0, _context42.t1, _context42.t6);
3305
3370
  case 27:
3306
- _context41.next = 15;
3371
+ _context42.next = 15;
3307
3372
  break;
3308
3373
  case 29:
3309
- _context41.next = 34;
3374
+ _context42.next = 34;
3310
3375
  break;
3311
3376
  case 31:
3312
- _context41.prev = 31;
3313
- _context41.t7 = _context41["catch"](13);
3314
- _iterator2.e(_context41.t7);
3377
+ _context42.prev = 31;
3378
+ _context42.t7 = _context42["catch"](13);
3379
+ _iterator2.e(_context42.t7);
3315
3380
  case 34:
3316
- _context41.prev = 34;
3381
+ _context42.prev = 34;
3317
3382
  _iterator2.f();
3318
- return _context41.finish(34);
3383
+ return _context42.finish(34);
3319
3384
  case 37:
3320
- return _context41.abrupt("return", result);
3385
+ return _context42.abrupt("return", result);
3321
3386
  case 38:
3322
3387
  case "end":
3323
- return _context41.stop();
3388
+ return _context42.stop();
3324
3389
  }
3325
- }, _callee41, this, [[13, 31, 34, 37]]);
3390
+ }, _callee42, this, [[13, 31, 34, 37]]);
3326
3391
  }));
3327
3392
  function addAddTimeProductsToBooking(_x27) {
3328
3393
  return _addAddTimeProductsToBooking.apply(this, arguments);
@@ -3332,47 +3397,47 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3332
3397
  }, {
3333
3398
  key: "setOtherParams",
3334
3399
  value: function () {
3335
- var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee42(params) {
3400
+ var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee43(params) {
3336
3401
  var _this11 = this;
3337
3402
  var _ref21,
3338
3403
  _ref21$cover,
3339
3404
  cover,
3340
3405
  nextParams,
3341
3406
  invoiceContextChanged,
3342
- _args42 = arguments;
3343
- return _regeneratorRuntime().wrap(function _callee42$(_context42) {
3344
- while (1) switch (_context42.prev = _context42.next) {
3407
+ _args43 = arguments;
3408
+ return _regeneratorRuntime().wrap(function _callee43$(_context43) {
3409
+ while (1) switch (_context43.prev = _context43.next) {
3345
3410
  case 0:
3346
- _ref21 = _args42.length > 1 && _args42[1] !== undefined ? _args42[1] : {}, _ref21$cover = _ref21.cover, cover = _ref21$cover === void 0 ? false : _ref21$cover;
3411
+ _ref21 = _args43.length > 1 && _args43[1] !== undefined ? _args43[1] : {}, _ref21$cover = _ref21.cover, cover = _ref21$cover === void 0 ? false : _ref21$cover;
3347
3412
  nextParams = cover ? params : _objectSpread(_objectSpread({}, this.otherParams), params);
3348
3413
  if (['businessCode', 'business_code', 'channel', 'platform', 'shop_id', 'tenantId', 'cacheId'].some(function (key) {
3349
3414
  var _this11$otherParams;
3350
3415
  return (nextParams === null || nextParams === void 0 ? void 0 : nextParams[key]) !== ((_this11$otherParams = _this11.otherParams) === null || _this11$otherParams === void 0 ? void 0 : _this11$otherParams[key]);
3351
3416
  })) this.orderCustomerContactRequest = null;
3352
- _context42.next = 5;
3417
+ _context43.next = 5;
3353
3418
  return _get(_getPrototypeOf(BookingTicketImpl.prototype), "setOtherParams", this).call(this, params, {
3354
3419
  cover: cover
3355
3420
  });
3356
3421
  case 5:
3357
3422
  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');
3358
3423
  if (!invoiceContextChanged) {
3359
- _context42.next = 9;
3424
+ _context43.next = 9;
3360
3425
  break;
3361
3426
  }
3362
- _context42.next = 9;
3427
+ _context43.next = 9;
3363
3428
  return this.prepareInvoiceTemplateAtSolutionReady(Object.prototype.hasOwnProperty.call(params, 'openData') ? this.getInjectedOpenDataConfig() : undefined);
3364
3429
  case 9:
3365
3430
  if (!((params === null || params === void 0 ? void 0 : params.businessCode) !== undefined || (params === null || params === void 0 ? void 0 : params.business_code) !== undefined)) {
3366
- _context42.next = 12;
3431
+ _context43.next = 12;
3367
3432
  break;
3368
3433
  }
3369
- _context42.next = 12;
3434
+ _context43.next = 12;
3370
3435
  return this.configureIdGeneratorFromOpenData();
3371
3436
  case 12:
3372
3437
  case "end":
3373
- return _context42.stop();
3438
+ return _context43.stop();
3374
3439
  }
3375
- }, _callee42, this);
3440
+ }, _callee43, this);
3376
3441
  }));
3377
3442
  function setOtherParams(_x28) {
3378
3443
  return _setOtherParams.apply(this, arguments);
@@ -3391,15 +3456,15 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3391
3456
  }, {
3392
3457
  key: "handlePrintWristband",
3393
3458
  value: function () {
3394
- var _handlePrintWristband = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee43(params) {
3459
+ var _handlePrintWristband = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee44(params) {
3395
3460
  var _this$getOrderIdentit2;
3396
3461
  var deviceTask, deviceId, idempotencyKey;
3397
- return _regeneratorRuntime().wrap(function _callee43$(_context43) {
3398
- while (1) switch (_context43.prev = _context43.next) {
3462
+ return _regeneratorRuntime().wrap(function _callee44$(_context44) {
3463
+ while (1) switch (_context44.prev = _context44.next) {
3399
3464
  case 0:
3400
3465
  deviceTask = this.getDeviceTaskPlugin();
3401
3466
  if (deviceTask !== null && deviceTask !== void 0 && deviceTask.dispatch) {
3402
- _context43.next = 4;
3467
+ _context44.next = 4;
3403
3468
  break;
3404
3469
  }
3405
3470
  this.logger.addLog({
@@ -3409,7 +3474,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3409
3474
  voucher_ids: Array.isArray(params.voucher_ids) ? params.voucher_ids : [params.voucher_ids]
3410
3475
  }
3411
3476
  });
3412
- return _context43.abrupt("return");
3477
+ return _context44.abrupt("return");
3413
3478
  case 4:
3414
3479
  this.logger.addLog({
3415
3480
  type: 'info',
@@ -3418,10 +3483,10 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3418
3483
  voucher_ids: Array.isArray(params.voucher_ids) ? params.voucher_ids : [params.voucher_ids]
3419
3484
  }
3420
3485
  });
3421
- _context43.next = 7;
3486
+ _context44.next = 7;
3422
3487
  return this.getShortNumberOrDeviceId();
3423
3488
  case 7:
3424
- deviceId = _context43.sent;
3489
+ deviceId = _context44.sent;
3425
3490
  idempotencyKey = createUuidV4();
3426
3491
  deviceTask.dispatch({
3427
3492
  action: 'print_all',
@@ -3441,9 +3506,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3441
3506
  });
3442
3507
  case 10:
3443
3508
  case "end":
3444
- return _context43.stop();
3509
+ return _context44.stop();
3445
3510
  }
3446
- }, _callee43, this);
3511
+ }, _callee44, this);
3447
3512
  }));
3448
3513
  function handlePrintWristband(_x29) {
3449
3514
  return _handlePrintWristband.apply(this, arguments);
@@ -3453,11 +3518,11 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3453
3518
  }, {
3454
3519
  key: "handleRedeem",
3455
3520
  value: function () {
3456
- var _handleRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee44(params) {
3521
+ var _handleRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee45(params) {
3457
3522
  var _this$store$order8, _this$store$order8$ge, _this$store$order9, _ref22, _tempOrder$order_id2;
3458
3523
  var voucherIds, status, voucherIdSet, tempOrder, vouchers, hasUpdatedVoucher, nextVouchers, identity, externalSaleNumber, orderId, orderLookup;
3459
- return _regeneratorRuntime().wrap(function _callee44$(_context44) {
3460
- while (1) switch (_context44.prev = _context44.next) {
3524
+ return _regeneratorRuntime().wrap(function _callee45$(_context45) {
3525
+ while (1) switch (_context45.prev = _context45.next) {
3461
3526
  case 0:
3462
3527
  voucherIds = Array.isArray(params.voucher_ids) ? params.voucher_ids : [];
3463
3528
  status = params.is_checkin ? 'used' : 'unused';
@@ -3481,20 +3546,20 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3481
3546
  });
3482
3547
  });
3483
3548
  if (!(tempOrder && hasUpdatedVoucher)) {
3484
- _context44.next = 11;
3549
+ _context45.next = 11;
3485
3550
  break;
3486
3551
  }
3487
- _context44.next = 11;
3552
+ _context45.next = 11;
3488
3553
  return this.replaceTempOrder(_objectSpread(_objectSpread({}, tempOrder), {}, {
3489
3554
  vouchers: nextVouchers
3490
3555
  }));
3491
3556
  case 11:
3492
3557
  this.core.effects.emit("".concat(this.name, ":onVouchersChange"), {});
3493
3558
  if (!(voucherIds.length === 0)) {
3494
- _context44.next = 14;
3559
+ _context45.next = 14;
3495
3560
  break;
3496
3561
  }
3497
- return _context44.abrupt("return", {
3562
+ return _context45.abrupt("return", {
3498
3563
  code: 200,
3499
3564
  status: true,
3500
3565
  message: '',
@@ -3505,7 +3570,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3505
3570
  externalSaleNumber = (tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.external_sale_number) || (identity === null || identity === void 0 ? void 0 : identity.externalSaleNumber) || undefined;
3506
3571
  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;
3507
3572
  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;
3508
- return _context44.abrupt("return", this.request.post('/machinecode/batch', {
3573
+ return _context45.abrupt("return", this.request.post('/machinecode/batch', {
3509
3574
  ids: voucherIds,
3510
3575
  status: status,
3511
3576
  order_lookup: orderLookup,
@@ -3516,9 +3581,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3516
3581
  }));
3517
3582
  case 19:
3518
3583
  case "end":
3519
- return _context44.stop();
3584
+ return _context45.stop();
3520
3585
  }
3521
- }, _callee44, this);
3586
+ }, _callee45, this);
3522
3587
  }));
3523
3588
  function handleRedeem(_x30) {
3524
3589
  return _handleRedeem.apply(this, arguments);
@@ -3532,13 +3597,13 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3532
3597
  }, {
3533
3598
  key: "destroy",
3534
3599
  value: (function () {
3535
- var _destroy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee45() {
3600
+ var _destroy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee46() {
3536
3601
  var _this$scan;
3537
- return _regeneratorRuntime().wrap(function _callee45$(_context45) {
3538
- while (1) switch (_context45.prev = _context45.next) {
3602
+ return _regeneratorRuntime().wrap(function _callee46$(_context46) {
3603
+ while (1) switch (_context46.prev = _context46.next) {
3539
3604
  case 0:
3540
3605
  this.orderCustomerContactRequest = null;
3541
- _context45.next = 3;
3606
+ _context46.next = 3;
3542
3607
  return _get(_getPrototypeOf(BookingTicketImpl.prototype), "destroy", this).call(this);
3543
3608
  case 3:
3544
3609
  try {
@@ -3549,9 +3614,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3549
3614
  scanCache.clear();
3550
3615
  case 5:
3551
3616
  case "end":
3552
- return _context45.stop();
3617
+ return _context46.stop();
3553
3618
  }
3554
- }, _callee45, this);
3619
+ }, _callee46, this);
3555
3620
  }));
3556
3621
  function destroy() {
3557
3622
  return _destroy.apply(this, arguments);