@pisell/pisellos 2.3.172 → 2.3.174

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/dist/index.d.ts +0 -1
  2. package/dist/index.js +0 -1
  3. package/dist/model/strategy/adapter/promotion/evaluator.d.ts +2 -1
  4. package/dist/model/strategy/adapter/promotion/evaluator.js +14 -8
  5. package/dist/modules/BookingContext/utils/productExtend.d.ts +5 -0
  6. package/dist/modules/BookingContext/utils/productExtend.js +61 -23
  7. package/dist/modules/Discount/index.js +0 -1
  8. package/dist/modules/OpenData/index.d.ts +1 -0
  9. package/dist/modules/OpenData/index.js +1 -0
  10. package/dist/modules/OpenData/salesSettings.d.ts +32 -0
  11. package/dist/modules/OpenData/salesSettings.js +80 -0
  12. package/dist/modules/OpenData/types.d.ts +13 -0
  13. package/dist/modules/Order/index.d.ts +3 -25
  14. package/dist/modules/Order/index.js +1313 -1772
  15. package/dist/modules/Order/types.d.ts +0 -7
  16. package/dist/modules/Order/utils/discountProductLineIdentity.js +2 -2
  17. package/dist/modules/ProductList/index.js +12 -33
  18. package/dist/modules/Rules/index.d.ts +0 -2
  19. package/dist/modules/Rules/index.js +21 -29
  20. package/dist/solution/BaseSales/index.d.ts +1 -16
  21. package/dist/solution/BaseSales/index.js +1325 -1511
  22. package/dist/solution/BookingTicket/index.d.ts +2 -2
  23. package/dist/solution/BookingTicket/index.js +108 -200
  24. package/dist/solution/BookingTicket/types.d.ts +2 -14
  25. package/dist/solution/BookingTicket/utils/addProductDecision.d.ts +1 -1
  26. package/dist/solution/BookingTicket/utils/addProductDecision.js +3 -4
  27. package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +58 -94
  28. package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +0 -1
  29. package/dist/solution/BookingTicket/utils/scan/handleScan.js +1 -2
  30. package/dist/solution/UnifiedBookingSales/index.d.ts +23 -2
  31. package/dist/solution/UnifiedBookingSales/index.js +923 -683
  32. package/dist/solution/UnifiedBookingSales/salesSettings.d.ts +16 -0
  33. package/dist/solution/UnifiedBookingSales/salesSettings.js +81 -0
  34. package/dist/utils/platform.d.ts +0 -2
  35. package/dist/utils/platform.js +0 -6
  36. package/lib/index.d.ts +0 -1
  37. package/lib/index.js +0 -12
  38. package/lib/model/strategy/adapter/promotion/evaluator.d.ts +2 -1
  39. package/lib/model/strategy/adapter/promotion/evaluator.js +13 -7
  40. package/lib/modules/BookingContext/utils/productExtend.d.ts +5 -0
  41. package/lib/modules/BookingContext/utils/productExtend.js +36 -3
  42. package/lib/modules/Discount/index.js +0 -1
  43. package/lib/modules/OpenData/index.d.ts +1 -0
  44. package/lib/modules/OpenData/index.js +12 -0
  45. package/lib/modules/OpenData/salesSettings.d.ts +32 -0
  46. package/lib/modules/OpenData/salesSettings.js +70 -0
  47. package/lib/modules/OpenData/types.d.ts +13 -0
  48. package/lib/modules/Order/index.d.ts +3 -25
  49. package/lib/modules/Order/index.js +38 -192
  50. package/lib/modules/Order/types.d.ts +0 -7
  51. package/lib/modules/Order/utils/discountProductLineIdentity.js +1 -1
  52. package/lib/modules/ProductList/index.js +0 -15
  53. package/lib/modules/Rules/index.d.ts +0 -2
  54. package/lib/modules/Rules/index.js +0 -6
  55. package/lib/solution/BaseSales/index.d.ts +1 -16
  56. package/lib/solution/BaseSales/index.js +9 -89
  57. package/lib/solution/BookingTicket/index.d.ts +2 -2
  58. package/lib/solution/BookingTicket/index.js +2 -38
  59. package/lib/solution/BookingTicket/types.d.ts +2 -14
  60. package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +1 -1
  61. package/lib/solution/BookingTicket/utils/addProductDecision.js +3 -4
  62. package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +2 -14
  63. package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +0 -1
  64. package/lib/solution/BookingTicket/utils/scan/handleScan.js +1 -2
  65. package/lib/solution/UnifiedBookingSales/index.d.ts +23 -2
  66. package/lib/solution/UnifiedBookingSales/index.js +131 -15
  67. package/lib/solution/UnifiedBookingSales/salesSettings.d.ts +16 -0
  68. package/lib/solution/UnifiedBookingSales/salesSettings.js +72 -0
  69. package/lib/utils/platform.d.ts +0 -2
  70. package/lib/utils/platform.js +0 -7
  71. package/package.json +1 -1
  72. package/dist/inventory/index.d.ts +0 -92
  73. package/dist/inventory/index.js +0 -509
  74. package/dist/modules/Order/utils/productVoucherGroups.d.ts +0 -15
  75. package/dist/modules/Order/utils/productVoucherGroups.js +0 -115
  76. package/dist/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.d.ts +0 -10
  77. package/dist/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.js +0 -117
  78. package/lib/inventory/index.d.ts +0 -92
  79. package/lib/inventory/index.js +0 -287
  80. package/lib/modules/Order/utils/productVoucherGroups.d.ts +0 -15
  81. package/lib/modules/Order/utils/productVoucherGroups.js +0 -64
  82. package/lib/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.d.ts +0 -10
  83. package/lib/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.js +0 -71
@@ -447,7 +447,7 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
447
447
  /**
448
448
  * 构造 BookingContext 计算上下文(供 getProductExtend / getResourceByIds 等读 API 复用)。
449
449
  */
450
- private buildBookingCalcContext;
450
+ protected buildBookingCalcContext(extra?: Partial<BookingCalcContext>): BookingCalcContext;
451
451
  /**
452
452
  * 取商品当前可选资源列表(透传 OS BookingContext utils#getResourceByIds)。
453
453
  * `extraResources` 用于把拖入未绑定的资源也展示出来。
@@ -480,7 +480,7 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
480
480
  /**
481
481
  * 拼装 addProductDecision 通用上下文(从 store 自取)。
482
482
  */
483
- private buildAddProductCtx;
483
+ protected buildAddProductCtx(extra?: Partial<AddProductDecideContext>): AddProductDecideContext;
484
484
  /**
485
485
  * 加车两阶段主决策(规格弹窗 / 资源编辑 / 直接加车)。
486
486
  * 与 ticketBooking `handleSelectProduct` + `handleBooking4Service` 等价。
@@ -42,7 +42,6 @@ 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";
46
45
  import { buildCartView, isWalkInCustomer } from "./utils/cartView";
47
46
  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";
48
47
  import { buildCacheItemFromOrderLine as buildCacheItemFromOrderLineUtil } from "../../modules/BookingContext/utils/buildCacheItemFromOrderLine";
@@ -2987,24 +2986,24 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2987
2986
  }, {
2988
2987
  key: "handleGlobalScanCode",
2989
2988
  value: (function () {
2990
- var _handleGlobalScanCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee40(code, bridge) {
2989
+ var _handleGlobalScanCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee39(code, bridge) {
2991
2990
  var _this8 = this;
2992
- 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;
2993
- return _regeneratorRuntime().wrap(function _callee40$(_context40) {
2994
- while (1) switch (_context40.prev = _context40.next) {
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 _callee39$(_context39) {
2993
+ while (1) switch (_context39.prev = _context39.next) {
2995
2994
  case 0:
2996
2995
  trimmed = typeof code === 'string' ? code.trim() : '';
2997
2996
  if (trimmed) {
2998
- _context40.next = 4;
2997
+ _context39.next = 4;
2999
2998
  break;
3000
2999
  }
3001
3000
  bridge === null || bridge === void 0 || (_bridge$onNotify = bridge.onNotify) === null || _bridge$onNotify === void 0 || _bridge$onNotify.call(bridge, 'fail', 'pisell2.text.scan-global-failed');
3002
- return _context40.abrupt("return", {
3001
+ return _context39.abrupt("return", {
3003
3002
  status: 'failed',
3004
3003
  reason: 'empty_code'
3005
3004
  });
3006
3005
  case 4:
3007
- _context40.prev = 4;
3006
+ _context39.prev = 4;
3008
3007
  // Capture before lookup/UI awaits, so a result cannot land in a new cart.
3009
3008
  // Unscoped POS Order modules return a no-op guard.
3010
3009
  beforeScanCommit = this.store.order.createCartIntentCommitGuard('add_product');
@@ -3030,54 +3029,30 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3030
3029
  return bridge.openBookingEdit(payload);
3031
3030
  } : undefined
3032
3031
  }) : undefined;
3033
- if (!((guardedBridge === null || guardedBridge === void 0 ? void 0 : guardedBridge.scanScope) === 'product-voucher')) {
3034
- _context40.next = 16;
3035
- break;
3036
- }
3037
- if (guardedBridge.applyPromotionCode) {
3038
- _context40.next = 12;
3039
- break;
3040
- }
3041
- return _context40.abrupt("return", {
3042
- status: 'failed',
3043
- reason: 'no_bridge'
3044
- });
3045
- case 12:
3046
- _context40.next = 14;
3047
- return guardedBridge.applyPromotionCode(trimmed);
3048
- case 14:
3049
- promotion = _context40.sent;
3050
- return _context40.abrupt("return", ((_promotion$isAccepted = promotion.isAccepted) !== null && _promotion$isAccepted !== void 0 ? _promotion$isAccepted : promotion.isAvailable) ? {
3051
- status: 'success',
3052
- kind: 'promotion'
3053
- } : {
3054
- status: 'failed',
3055
- reason: 'not_found'
3056
- });
3057
- case 16:
3058
3032
  localSearch = function localSearch(v) {
3059
3033
  return _this8.store.products.findProductsByCodeOrBarcode(v);
3060
3034
  };
3061
3035
  scanCallback = handleGlobalScan(this.request, localSearch, this.getSubmitOrderSalesChannel());
3062
- _context40.next = 20;
3036
+ _context39.next = 13;
3063
3037
  return scanCallback({
3064
3038
  type: 'nativeScanner',
3065
3039
  value: trimmed
3066
3040
  });
3067
- case 20:
3068
- raw = _context40.sent;
3041
+ case 13:
3042
+ raw = _context39.sent;
3069
3043
  formatted = formatGlobalScanResult(raw, trimmed);
3070
3044
  if (formatted) {
3071
- _context40.next = 25;
3045
+ _context39.next = 18;
3072
3046
  break;
3073
3047
  }
3074
3048
  bridge === null || bridge === void 0 || (_bridge$onNotify2 = bridge.onNotify) === null || _bridge$onNotify2 === void 0 || _bridge$onNotify2.call(bridge, 'fail', 'pisell2.text.scan-global-failed');
3075
- return _context40.abrupt("return", {
3049
+ return _context39.abrupt("return", {
3076
3050
  status: 'failed',
3077
3051
  reason: 'not_found'
3078
3052
  });
3079
- case 25:
3080
- host = {
3053
+ case 18:
3054
+ _context39.next = 20;
3055
+ return applyGlobalScan({
3081
3056
  setOrderCustomer: function setOrderCustomer(customer) {
3082
3057
  beforeScanCommit();
3083
3058
  _this8.setOrderCustomer(customer);
@@ -3115,92 +3090,25 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3115
3090
  beforeScanCommit();
3116
3091
  return _this8.scanWalletAsset(scanCode);
3117
3092
  }
3118
- };
3119
- if (!((guardedBridge === null || guardedBridge === void 0 ? void 0 : guardedBridge.scanScope) === 'product-voucher-collection')) {
3120
- _context40.next = 32;
3121
- break;
3122
- }
3123
- _context40.next = 29;
3124
- return applyProductVoucherCollectionScan(_objectSpread(_objectSpread({}, host), {}, {
3125
- waitForCustomerDiscounts: function waitForCustomerDiscounts() {
3126
- return _this8.orderCustomerDiscountRefreshInFlight || Promise.resolve();
3127
- },
3128
- loadCustomerDiscounts: function () {
3129
- var _loadCustomerDiscounts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee39() {
3130
- var _this8$getOrderCustom;
3131
- var customerId;
3132
- return _regeneratorRuntime().wrap(function _callee39$(_context39) {
3133
- while (1) switch (_context39.prev = _context39.next) {
3134
- case 0:
3135
- beforeScanCommit();
3136
- customerId = Number(((_this8$getOrderCustom = _this8.getOrderCustomer()) === null || _this8$getOrderCustom === void 0 ? void 0 : _this8$getOrderCustom.customer_id) || 0);
3137
- if (!(customerId <= 1)) {
3138
- _context39.next = 4;
3139
- break;
3140
- }
3141
- return _context39.abrupt("return", []);
3142
- case 4:
3143
- _context39.next = 6;
3144
- return _this8.refreshDiscountConfigAfterOrderCustomerChange(customerId);
3145
- case 6:
3146
- beforeScanCommit();
3147
- return _context39.abrupt("return", _this8.getDiscountList());
3148
- case 8:
3149
- case "end":
3150
- return _context39.stop();
3151
- }
3152
- }, _callee39);
3153
- }));
3154
- function loadCustomerDiscounts() {
3155
- return _loadCustomerDiscounts.apply(this, arguments);
3156
- }
3157
- return loadCustomerDiscounts;
3158
- }()
3159
- }), formatted, guardedBridge);
3160
- case 29:
3161
- _context40.t0 = _context40.sent;
3162
- _context40.next = 35;
3163
- break;
3164
- case 32:
3165
- _context40.next = 34;
3166
- return applyGlobalScan(host, formatted, guardedBridge);
3167
- case 34:
3168
- _context40.t0 = _context40.sent;
3169
- case 35:
3170
- _result8 = _context40.t0;
3093
+ }, formatted, guardedBridge);
3094
+ case 20:
3095
+ _result8 = _context39.sent;
3171
3096
  bridge === null || bridge === void 0 || (_bridge$refresh = bridge.refresh) === null || _bridge$refresh === void 0 || _bridge$refresh.call(bridge);
3172
- return _context40.abrupt("return", _result8);
3173
- case 40:
3174
- _context40.prev = 40;
3175
- _context40.t1 = _context40["catch"](4);
3176
- if (!((bridge === null || bridge === void 0 ? void 0 : bridge.scanScope) === 'product-voucher-collection')) {
3177
- _context40.next = 46;
3178
- break;
3179
- }
3180
- if (!(((_bridge$isCurrent = bridge.isCurrent) === null || _bridge$isCurrent === void 0 ? void 0 : _bridge$isCurrent.call(bridge)) === false)) {
3181
- _context40.next = 45;
3182
- break;
3183
- }
3184
- return _context40.abrupt("return", {
3185
- status: 'cancelled'
3186
- });
3187
- case 45:
3188
- return _context40.abrupt("return", {
3189
- status: 'failed',
3190
- reason: 'entry_resolution_failed'
3191
- });
3192
- case 46:
3193
- console.error('[BookingTicket] handleGlobalScanCode failed', _context40.t1);
3097
+ return _context39.abrupt("return", _result8);
3098
+ case 25:
3099
+ _context39.prev = 25;
3100
+ _context39.t0 = _context39["catch"](4);
3101
+ console.error('[BookingTicket] handleGlobalScanCode failed', _context39.t0);
3194
3102
  bridge === null || bridge === void 0 || (_bridge$onNotify3 = bridge.onNotify) === null || _bridge$onNotify3 === void 0 || _bridge$onNotify3.call(bridge, 'fail', 'pisell2.text.scan-global-failed');
3195
- return _context40.abrupt("return", {
3103
+ return _context39.abrupt("return", {
3196
3104
  status: 'failed',
3197
3105
  reason: 'not_found'
3198
3106
  });
3199
- case 49:
3107
+ case 30:
3200
3108
  case "end":
3201
- return _context40.stop();
3109
+ return _context39.stop();
3202
3110
  }
3203
- }, _callee40, this, [[4, 40]]);
3111
+ }, _callee39, this, [[4, 25]]);
3204
3112
  }));
3205
3113
  function handleGlobalScanCode(_x23, _x24) {
3206
3114
  return _handleGlobalScanCode.apply(this, arguments);
@@ -3210,37 +3118,37 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3210
3118
  }, {
3211
3119
  key: "getGlobalScanCodeType",
3212
3120
  value: (function () {
3213
- var _getGlobalScanCodeType = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee41(code) {
3121
+ var _getGlobalScanCodeType = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee40(code) {
3214
3122
  var _this9 = this,
3215
3123
  _formatGlobalScanResu,
3216
3124
  _formatGlobalScanResu2;
3217
3125
  var trimmed, scan, raw;
3218
- return _regeneratorRuntime().wrap(function _callee41$(_context41) {
3219
- while (1) switch (_context41.prev = _context41.next) {
3126
+ return _regeneratorRuntime().wrap(function _callee40$(_context40) {
3127
+ while (1) switch (_context40.prev = _context40.next) {
3220
3128
  case 0:
3221
3129
  trimmed = typeof code === 'string' ? code.trim() : '';
3222
3130
  if (trimmed) {
3223
- _context41.next = 3;
3131
+ _context40.next = 3;
3224
3132
  break;
3225
3133
  }
3226
- return _context41.abrupt("return", null);
3134
+ return _context40.abrupt("return", null);
3227
3135
  case 3:
3228
3136
  scan = handleGlobalScan(this.request, function (value) {
3229
3137
  return _this9.store.products.findProductsByCodeOrBarcode(value);
3230
3138
  }, this.getSubmitOrderSalesChannel());
3231
- _context41.next = 6;
3139
+ _context40.next = 6;
3232
3140
  return scan({
3233
3141
  type: 'nativeScanner',
3234
3142
  value: trimmed
3235
3143
  });
3236
3144
  case 6:
3237
- raw = _context41.sent;
3238
- return _context41.abrupt("return", (_formatGlobalScanResu = (_formatGlobalScanResu2 = formatGlobalScanResult(raw, trimmed)) === null || _formatGlobalScanResu2 === void 0 ? void 0 : _formatGlobalScanResu2.searchType) !== null && _formatGlobalScanResu !== void 0 ? _formatGlobalScanResu : null);
3145
+ raw = _context40.sent;
3146
+ return _context40.abrupt("return", (_formatGlobalScanResu = (_formatGlobalScanResu2 = formatGlobalScanResult(raw, trimmed)) === null || _formatGlobalScanResu2 === void 0 ? void 0 : _formatGlobalScanResu2.searchType) !== null && _formatGlobalScanResu !== void 0 ? _formatGlobalScanResu : null);
3239
3147
  case 8:
3240
3148
  case "end":
3241
- return _context41.stop();
3149
+ return _context40.stop();
3242
3150
  }
3243
- }, _callee41, this);
3151
+ }, _callee40, this);
3244
3152
  }));
3245
3153
  function getGlobalScanCodeType(_x25) {
3246
3154
  return _getGlobalScanCodeType.apply(this, arguments);
@@ -3324,11 +3232,11 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3324
3232
  }, {
3325
3233
  key: "addAddTimeProductToBooking",
3326
3234
  value: (function () {
3327
- var _addAddTimeProductToBooking = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee42(input) {
3328
- return _regeneratorRuntime().wrap(function _callee42$(_context42) {
3329
- while (1) switch (_context42.prev = _context42.next) {
3235
+ var _addAddTimeProductToBooking = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee41(input) {
3236
+ return _regeneratorRuntime().wrap(function _callee41$(_context41) {
3237
+ while (1) switch (_context41.prev = _context41.next) {
3330
3238
  case 0:
3331
- return _context42.abrupt("return", this.addAddTimeProductsToBooking({
3239
+ return _context41.abrupt("return", this.addAddTimeProductsToBooking({
3332
3240
  booking: input.booking,
3333
3241
  products: [input],
3334
3242
  coveredMinutes: input.coveredMinutes,
@@ -3336,9 +3244,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3336
3244
  }));
3337
3245
  case 1:
3338
3246
  case "end":
3339
- return _context42.stop();
3247
+ return _context41.stop();
3340
3248
  }
3341
- }, _callee42, this);
3249
+ }, _callee41, this);
3342
3250
  }));
3343
3251
  function addAddTimeProductToBooking(_x26) {
3344
3252
  return _addAddTimeProductToBooking.apply(this, arguments);
@@ -3358,16 +3266,16 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3358
3266
  }, {
3359
3267
  key: "addAddTimeProductsToBooking",
3360
3268
  value: (function () {
3361
- var _addAddTimeProductsToBooking = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee43(input) {
3269
+ var _addAddTimeProductsToBooking = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee42(input) {
3362
3270
  var _this10 = this,
3363
3271
  _input$bookingPatch;
3364
3272
  var bookingUid, orderLines, coveredMinutes, bookingTimePatch, result, _iterator2, _step2, line;
3365
- return _regeneratorRuntime().wrap(function _callee43$(_context43) {
3366
- while (1) switch (_context43.prev = _context43.next) {
3273
+ return _regeneratorRuntime().wrap(function _callee42$(_context42) {
3274
+ while (1) switch (_context42.prev = _context42.next) {
3367
3275
  case 0:
3368
3276
  bookingUid = resolveBookingUidForAddTime(input === null || input === void 0 ? void 0 : input.booking);
3369
3277
  if (bookingUid) {
3370
- _context43.next = 3;
3278
+ _context42.next = 3;
3371
3279
  break;
3372
3280
  }
3373
3281
  throw new Error('[BookingTicket] addAddTimeProductToBooking: booking.metadata.unique_identification_number 缺失');
@@ -3378,7 +3286,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3378
3286
  };
3379
3287
  });
3380
3288
  if (this.store.order) {
3381
- _context43.next = 6;
3289
+ _context42.next = 6;
3382
3290
  break;
3383
3291
  }
3384
3292
  throw new Error('order 模块未初始化');
@@ -3392,53 +3300,53 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3392
3300
  });
3393
3301
  }
3394
3302
  if (!(typeof this.store.order.addProductsToOrder === 'function')) {
3395
- _context43.next = 11;
3303
+ _context42.next = 11;
3396
3304
  break;
3397
3305
  }
3398
- return _context43.abrupt("return", this.store.order.addProductsToOrder(orderLines));
3306
+ return _context42.abrupt("return", this.store.order.addProductsToOrder(orderLines));
3399
3307
  case 11:
3400
3308
  result = [];
3401
3309
  _iterator2 = _createForOfIteratorHelper(orderLines);
3402
- _context43.prev = 13;
3310
+ _context42.prev = 13;
3403
3311
  _iterator2.s();
3404
3312
  case 15:
3405
3313
  if ((_step2 = _iterator2.n()).done) {
3406
- _context43.next = 29;
3314
+ _context42.next = 29;
3407
3315
  break;
3408
3316
  }
3409
3317
  line = _step2.value;
3410
- _context43.t0 = result.splice;
3411
- _context43.t1 = result;
3412
- _context43.t2 = [0, result.length];
3413
- _context43.t3 = _toConsumableArray;
3414
- _context43.next = 23;
3318
+ _context42.t0 = result.splice;
3319
+ _context42.t1 = result;
3320
+ _context42.t2 = [0, result.length];
3321
+ _context42.t3 = _toConsumableArray;
3322
+ _context42.next = 23;
3415
3323
  return this.addProductToOrder(line.product);
3416
3324
  case 23:
3417
- _context43.t4 = _context43.sent;
3418
- _context43.t5 = (0, _context43.t3)(_context43.t4);
3419
- _context43.t6 = _context43.t2.concat.call(_context43.t2, _context43.t5);
3420
- _context43.t0.apply.call(_context43.t0, _context43.t1, _context43.t6);
3325
+ _context42.t4 = _context42.sent;
3326
+ _context42.t5 = (0, _context42.t3)(_context42.t4);
3327
+ _context42.t6 = _context42.t2.concat.call(_context42.t2, _context42.t5);
3328
+ _context42.t0.apply.call(_context42.t0, _context42.t1, _context42.t6);
3421
3329
  case 27:
3422
- _context43.next = 15;
3330
+ _context42.next = 15;
3423
3331
  break;
3424
3332
  case 29:
3425
- _context43.next = 34;
3333
+ _context42.next = 34;
3426
3334
  break;
3427
3335
  case 31:
3428
- _context43.prev = 31;
3429
- _context43.t7 = _context43["catch"](13);
3430
- _iterator2.e(_context43.t7);
3336
+ _context42.prev = 31;
3337
+ _context42.t7 = _context42["catch"](13);
3338
+ _iterator2.e(_context42.t7);
3431
3339
  case 34:
3432
- _context43.prev = 34;
3340
+ _context42.prev = 34;
3433
3341
  _iterator2.f();
3434
- return _context43.finish(34);
3342
+ return _context42.finish(34);
3435
3343
  case 37:
3436
- return _context43.abrupt("return", result);
3344
+ return _context42.abrupt("return", result);
3437
3345
  case 38:
3438
3346
  case "end":
3439
- return _context43.stop();
3347
+ return _context42.stop();
3440
3348
  }
3441
- }, _callee43, this, [[13, 31, 34, 37]]);
3349
+ }, _callee42, this, [[13, 31, 34, 37]]);
3442
3350
  }));
3443
3351
  function addAddTimeProductsToBooking(_x27) {
3444
3352
  return _addAddTimeProductsToBooking.apply(this, arguments);
@@ -3448,47 +3356,47 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3448
3356
  }, {
3449
3357
  key: "setOtherParams",
3450
3358
  value: function () {
3451
- var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee44(params) {
3359
+ var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee43(params) {
3452
3360
  var _this11 = this;
3453
3361
  var _ref21,
3454
3362
  _ref21$cover,
3455
3363
  cover,
3456
3364
  nextParams,
3457
3365
  invoiceContextChanged,
3458
- _args44 = arguments;
3459
- return _regeneratorRuntime().wrap(function _callee44$(_context44) {
3460
- while (1) switch (_context44.prev = _context44.next) {
3366
+ _args43 = arguments;
3367
+ return _regeneratorRuntime().wrap(function _callee43$(_context43) {
3368
+ while (1) switch (_context43.prev = _context43.next) {
3461
3369
  case 0:
3462
- _ref21 = _args44.length > 1 && _args44[1] !== undefined ? _args44[1] : {}, _ref21$cover = _ref21.cover, cover = _ref21$cover === void 0 ? false : _ref21$cover;
3370
+ _ref21 = _args43.length > 1 && _args43[1] !== undefined ? _args43[1] : {}, _ref21$cover = _ref21.cover, cover = _ref21$cover === void 0 ? false : _ref21$cover;
3463
3371
  nextParams = cover ? params : _objectSpread(_objectSpread({}, this.otherParams), params);
3464
3372
  if (['businessCode', 'business_code', 'channel', 'platform', 'shop_id', 'tenantId', 'cacheId'].some(function (key) {
3465
3373
  var _this11$otherParams;
3466
3374
  return (nextParams === null || nextParams === void 0 ? void 0 : nextParams[key]) !== ((_this11$otherParams = _this11.otherParams) === null || _this11$otherParams === void 0 ? void 0 : _this11$otherParams[key]);
3467
3375
  })) this.orderCustomerContactRequest = null;
3468
- _context44.next = 5;
3376
+ _context43.next = 5;
3469
3377
  return _get(_getPrototypeOf(BookingTicketImpl.prototype), "setOtherParams", this).call(this, params, {
3470
3378
  cover: cover
3471
3379
  });
3472
3380
  case 5:
3473
3381
  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');
3474
3382
  if (!invoiceContextChanged) {
3475
- _context44.next = 9;
3383
+ _context43.next = 9;
3476
3384
  break;
3477
3385
  }
3478
- _context44.next = 9;
3386
+ _context43.next = 9;
3479
3387
  return this.prepareInvoiceTemplateAtSolutionReady(Object.prototype.hasOwnProperty.call(params, 'openData') ? this.getInjectedOpenDataConfig() : undefined);
3480
3388
  case 9:
3481
3389
  if (!((params === null || params === void 0 ? void 0 : params.businessCode) !== undefined || (params === null || params === void 0 ? void 0 : params.business_code) !== undefined)) {
3482
- _context44.next = 12;
3390
+ _context43.next = 12;
3483
3391
  break;
3484
3392
  }
3485
- _context44.next = 12;
3393
+ _context43.next = 12;
3486
3394
  return this.configureIdGeneratorFromOpenData();
3487
3395
  case 12:
3488
3396
  case "end":
3489
- return _context44.stop();
3397
+ return _context43.stop();
3490
3398
  }
3491
- }, _callee44, this);
3399
+ }, _callee43, this);
3492
3400
  }));
3493
3401
  function setOtherParams(_x28) {
3494
3402
  return _setOtherParams.apply(this, arguments);
@@ -3507,15 +3415,15 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3507
3415
  }, {
3508
3416
  key: "handlePrintWristband",
3509
3417
  value: function () {
3510
- var _handlePrintWristband = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee45(params) {
3418
+ var _handlePrintWristband = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee44(params) {
3511
3419
  var _this$getOrderIdentit2;
3512
3420
  var deviceTask, deviceId, idempotencyKey;
3513
- return _regeneratorRuntime().wrap(function _callee45$(_context45) {
3514
- while (1) switch (_context45.prev = _context45.next) {
3421
+ return _regeneratorRuntime().wrap(function _callee44$(_context44) {
3422
+ while (1) switch (_context44.prev = _context44.next) {
3515
3423
  case 0:
3516
3424
  deviceTask = this.getDeviceTaskPlugin();
3517
3425
  if (deviceTask !== null && deviceTask !== void 0 && deviceTask.dispatch) {
3518
- _context45.next = 4;
3426
+ _context44.next = 4;
3519
3427
  break;
3520
3428
  }
3521
3429
  this.logger.addLog({
@@ -3525,7 +3433,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3525
3433
  voucher_ids: Array.isArray(params.voucher_ids) ? params.voucher_ids : [params.voucher_ids]
3526
3434
  }
3527
3435
  });
3528
- return _context45.abrupt("return");
3436
+ return _context44.abrupt("return");
3529
3437
  case 4:
3530
3438
  this.logger.addLog({
3531
3439
  type: 'info',
@@ -3534,10 +3442,10 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3534
3442
  voucher_ids: Array.isArray(params.voucher_ids) ? params.voucher_ids : [params.voucher_ids]
3535
3443
  }
3536
3444
  });
3537
- _context45.next = 7;
3445
+ _context44.next = 7;
3538
3446
  return this.getShortNumberOrDeviceId();
3539
3447
  case 7:
3540
- deviceId = _context45.sent;
3448
+ deviceId = _context44.sent;
3541
3449
  idempotencyKey = createUuidV4();
3542
3450
  deviceTask.dispatch({
3543
3451
  action: 'print_all',
@@ -3557,9 +3465,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3557
3465
  });
3558
3466
  case 10:
3559
3467
  case "end":
3560
- return _context45.stop();
3468
+ return _context44.stop();
3561
3469
  }
3562
- }, _callee45, this);
3470
+ }, _callee44, this);
3563
3471
  }));
3564
3472
  function handlePrintWristband(_x29) {
3565
3473
  return _handlePrintWristband.apply(this, arguments);
@@ -3569,11 +3477,11 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3569
3477
  }, {
3570
3478
  key: "handleRedeem",
3571
3479
  value: function () {
3572
- var _handleRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee46(params) {
3480
+ var _handleRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee45(params) {
3573
3481
  var _this$store$order8, _this$store$order8$ge, _this$store$order9, _ref22, _tempOrder$order_id2;
3574
3482
  var voucherIds, status, voucherIdSet, tempOrder, vouchers, hasUpdatedVoucher, nextVouchers, identity, externalSaleNumber, orderId, orderLookup;
3575
- return _regeneratorRuntime().wrap(function _callee46$(_context46) {
3576
- while (1) switch (_context46.prev = _context46.next) {
3483
+ return _regeneratorRuntime().wrap(function _callee45$(_context45) {
3484
+ while (1) switch (_context45.prev = _context45.next) {
3577
3485
  case 0:
3578
3486
  voucherIds = Array.isArray(params.voucher_ids) ? params.voucher_ids : [];
3579
3487
  status = params.is_checkin ? 'used' : 'unused';
@@ -3597,20 +3505,20 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3597
3505
  });
3598
3506
  });
3599
3507
  if (!(tempOrder && hasUpdatedVoucher)) {
3600
- _context46.next = 11;
3508
+ _context45.next = 11;
3601
3509
  break;
3602
3510
  }
3603
- _context46.next = 11;
3511
+ _context45.next = 11;
3604
3512
  return this.replaceTempOrder(_objectSpread(_objectSpread({}, tempOrder), {}, {
3605
3513
  vouchers: nextVouchers
3606
3514
  }));
3607
3515
  case 11:
3608
3516
  this.core.effects.emit("".concat(this.name, ":onVouchersChange"), {});
3609
3517
  if (!(voucherIds.length === 0)) {
3610
- _context46.next = 14;
3518
+ _context45.next = 14;
3611
3519
  break;
3612
3520
  }
3613
- return _context46.abrupt("return", {
3521
+ return _context45.abrupt("return", {
3614
3522
  code: 200,
3615
3523
  status: true,
3616
3524
  message: '',
@@ -3621,7 +3529,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3621
3529
  externalSaleNumber = (tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.external_sale_number) || (identity === null || identity === void 0 ? void 0 : identity.externalSaleNumber) || undefined;
3622
3530
  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;
3623
3531
  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;
3624
- return _context46.abrupt("return", this.request.post('/machinecode/batch', {
3532
+ return _context45.abrupt("return", this.request.post('/machinecode/batch', {
3625
3533
  ids: voucherIds,
3626
3534
  status: status,
3627
3535
  order_lookup: orderLookup,
@@ -3632,9 +3540,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3632
3540
  }));
3633
3541
  case 19:
3634
3542
  case "end":
3635
- return _context46.stop();
3543
+ return _context45.stop();
3636
3544
  }
3637
- }, _callee46, this);
3545
+ }, _callee45, this);
3638
3546
  }));
3639
3547
  function handleRedeem(_x30) {
3640
3548
  return _handleRedeem.apply(this, arguments);
@@ -3648,13 +3556,13 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3648
3556
  }, {
3649
3557
  key: "destroy",
3650
3558
  value: (function () {
3651
- var _destroy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee47() {
3559
+ var _destroy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee46() {
3652
3560
  var _this$scan;
3653
- return _regeneratorRuntime().wrap(function _callee47$(_context47) {
3654
- while (1) switch (_context47.prev = _context47.next) {
3561
+ return _regeneratorRuntime().wrap(function _callee46$(_context46) {
3562
+ while (1) switch (_context46.prev = _context46.next) {
3655
3563
  case 0:
3656
3564
  this.orderCustomerContactRequest = null;
3657
- _context47.next = 3;
3565
+ _context46.next = 3;
3658
3566
  return _get(_getPrototypeOf(BookingTicketImpl.prototype), "destroy", this).call(this);
3659
3567
  case 3:
3660
3568
  try {
@@ -3665,9 +3573,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3665
3573
  scanCache.clear();
3666
3574
  case 5:
3667
3575
  case "end":
3668
- return _context47.stop();
3576
+ return _context46.stop();
3669
3577
  }
3670
- }, _callee47, this);
3578
+ }, _callee46, this);
3671
3579
  }));
3672
3580
  function destroy() {
3673
3581
  return _destroy.apply(this, arguments);