@pisell/pisellos 2.3.86 → 2.3.87

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.
@@ -48,6 +48,7 @@ import { QuotationModule } from "../../modules/Quotation";
48
48
  import { transformBaseProductToOrderProduct as _transformBaseProductToOrderProduct } from "./utils/transformBaseProductToOrderProduct";
49
49
  import { calculateBaseSalesProductBookingPrice } from "./utils/quotationPrice";
50
50
  var SERVER_ORDER_CHANGED_EVENT = 'order:onOrdersChanged';
51
+ var OS_FULFILLMENT_REF_MODE_FIELD = '_os_fulfillment_ref_mode';
51
52
  var WALLET_PAYMENT_CODE_BY_TAG = {
52
53
  product_voucher: 'PRODUCTVOUCHER',
53
54
  gift_card: 'GIFTCARD',
@@ -1456,6 +1457,45 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
1456
1457
  var _this$otherParams8;
1457
1458
  return (_this$otherParams8 = this.otherParams) === null || _this$otherParams8 === void 0 ? void 0 : _this$otherParams8.channel;
1458
1459
  }
1460
+ }, {
1461
+ key: "getFulfillmentRefModeConfigs",
1462
+ value: function getFulfillmentRefModeConfigs() {
1463
+ var _this$otherParams9, _this$otherParams10, _this$store, _this$store$getOpenDa;
1464
+ var candidates = [(_this$otherParams9 = this.otherParams) === null || _this$otherParams9 === void 0 ? void 0 : _this$otherParams9.openData, (_this$otherParams10 = this.otherParams) === null || _this$otherParams10 === void 0 ? void 0 : _this$otherParams10.dineInConfig, (_this$store = this.store) === null || _this$store === void 0 || (_this$store = _this$store.openData) === null || _this$store === void 0 || (_this$store$getOpenDa = _this$store.getOpenData) === null || _this$store$getOpenDa === void 0 ? void 0 : _this$store$getOpenDa.call(_this$store)];
1465
+ return candidates.filter(function (candidate) {
1466
+ return candidate && _typeof(candidate) === 'object' && !Array.isArray(candidate);
1467
+ });
1468
+ }
1469
+ }, {
1470
+ key: "getFulfillmentRefMode",
1471
+ value: function getFulfillmentRefMode() {
1472
+ var _iterator2 = _createForOfIteratorHelper(this.getFulfillmentRefModeConfigs()),
1473
+ _step2;
1474
+ try {
1475
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
1476
+ var config = _step2.value;
1477
+ var mode = config['fulfillment.fulfillment_ref_mode'];
1478
+ if (mode === undefined || mode === null) continue;
1479
+ var normalized = String(mode).trim();
1480
+ if (normalized) return normalized;
1481
+ }
1482
+ } catch (err) {
1483
+ _iterator2.e(err);
1484
+ } finally {
1485
+ _iterator2.f();
1486
+ }
1487
+ return undefined;
1488
+ }
1489
+ }, {
1490
+ key: "buildSubmitPayloadEnhancerWithFulfillmentRefMode",
1491
+ value: function buildSubmitPayloadEnhancerWithFulfillmentRefMode(enhancePayload) {
1492
+ var fulfillmentRefMode = this.getFulfillmentRefMode();
1493
+ if (!fulfillmentRefMode) return enhancePayload;
1494
+ return function (payload, ctx) {
1495
+ var enhancedPayload = enhancePayload ? enhancePayload(payload, ctx) : payload;
1496
+ return _objectSpread(_objectSpread({}, enhancedPayload), {}, _defineProperty({}, OS_FULFILLMENT_REF_MODE_FIELD, fulfillmentRefMode));
1497
+ };
1498
+ }
1459
1499
 
1460
1500
  /**
1461
1501
  * 工厂入口:根据子模块名实例化对应模块。
@@ -1684,11 +1724,11 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
1684
1724
  key: "initialize",
1685
1725
  value: function () {
1686
1726
  var _initialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(core) {
1687
- var _this$otherParams9,
1727
+ var _this$otherParams11,
1688
1728
  _this$appPlugin2,
1689
1729
  _this$appPlugin2$getA,
1690
1730
  _this11 = this,
1691
- _this$otherParams10;
1731
+ _this$otherParams12;
1692
1732
  var options,
1693
1733
  app,
1694
1734
  targetCacheData,
@@ -1703,7 +1743,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
1703
1743
  this.paymentNumberDevicePrefix = null;
1704
1744
  // this.store = { ...this.store, ...(options.store as Partial<BaseSalesState>) };
1705
1745
  this.otherParams = options.otherParams || {};
1706
- this.cacheId = (_this$otherParams9 = this.otherParams) === null || _this$otherParams9 === void 0 ? void 0 : _this$otherParams9.cacheId;
1746
+ this.cacheId = (_this$otherParams11 = this.otherParams) === null || _this$otherParams11 === void 0 ? void 0 : _this$otherParams11.cacheId;
1707
1747
  this.reusedSharedSubModuleNames.clear();
1708
1748
  this.window = core.getPlugin('window');
1709
1749
  this.request = core.getPlugin('request');
@@ -1745,7 +1785,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
1745
1785
  _context12.next = 19;
1746
1786
  return this.store.schedule.loadAllSchedule();
1747
1787
  case 19:
1748
- if (this.store.order && typeof ((_this$otherParams10 = this.otherParams) === null || _this$otherParams10 === void 0 ? void 0 : _this$otherParams10.enableTempOrderPersist) === 'boolean') {
1788
+ if (this.store.order && typeof ((_this$otherParams12 = this.otherParams) === null || _this$otherParams12 === void 0 ? void 0 : _this$otherParams12.enableTempOrderPersist) === 'boolean') {
1749
1789
  this.store.order.setEnableTempOrderPersist(this.otherParams.enableTempOrderPersist);
1750
1790
  }
1751
1791
  _context12.next = 22;
@@ -2463,7 +2503,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
2463
2503
  value: function () {
2464
2504
  var _loadDiscountConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(params) {
2465
2505
  var _this$getOrderIdentit, _tempOrder$customer, _tempOrder$_extend, _tempOrder$_extend2, _discountModule$getDi, _discountModule$getOr, _discountModule$getDi2;
2466
- var tempOrder, orderStore, discountModule, rulesModule, orderId, customerId, currentDiscountList, originalDiscountList, hasManualDiscountSelection, discountAction, discountConfigCacheKey, preparedDiscountList, _discountModule$setOr, nextDiscountList, shouldSkipAutoApplyFetchedDiscounts, _summary, _orderStore$summary, orderTotalAmount, result, _iterator2, _step2, _product$metadata5, _tempOrder$_extend3, _product$metadata$sou, _product$metadata6, _product$metadata7, _product$original_pri, product, productUid, runtimeOrigin, totalPerUnitDiscount, optionSum, sourcePrice, newSourceSellingPrice, newMainSellingPrice, summary;
2506
+ var tempOrder, orderStore, discountModule, rulesModule, orderId, customerId, currentDiscountList, originalDiscountList, hasManualDiscountSelection, discountAction, discountConfigCacheKey, preparedDiscountList, _discountModule$setOr, nextDiscountList, shouldSkipAutoApplyFetchedDiscounts, _summary, _orderStore$summary, orderTotalAmount, result, _iterator3, _step3, _product$metadata5, _tempOrder$_extend3, _product$metadata$sou, _product$metadata6, _product$metadata7, _product$original_pri, product, productUid, runtimeOrigin, totalPerUnitDiscount, optionSum, sourcePrice, newSourceSellingPrice, newMainSellingPrice, summary;
2467
2507
  return _regeneratorRuntime().wrap(function _callee21$(_context21) {
2468
2508
  while (1) switch (_context21.prev = _context21.next) {
2469
2509
  case 0:
@@ -2578,15 +2618,15 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
2578
2618
  if (result.productList) {
2579
2619
  tempOrder.products = preserveManualProductDiscountProducts(tempOrder.products, result.productList);
2580
2620
  }
2581
- _iterator2 = _createForOfIteratorHelper(tempOrder.products || []);
2621
+ _iterator3 = _createForOfIteratorHelper(tempOrder.products || []);
2582
2622
  _context21.prev = 45;
2583
- _iterator2.s();
2623
+ _iterator3.s();
2584
2624
  case 47:
2585
- if ((_step2 = _iterator2.n()).done) {
2625
+ if ((_step3 = _iterator3.n()).done) {
2586
2626
  _context21.next = 62;
2587
2627
  break;
2588
2628
  }
2589
- product = _step2.value;
2629
+ product = _step3.value;
2590
2630
  productUid = (_product$metadata5 = product.metadata) === null || _product$metadata5 === void 0 ? void 0 : _product$metadata5.unique_identification_number;
2591
2631
  runtimeOrigin = productUid ? (_tempOrder$_extend3 = tempOrder._extend) === null || _tempOrder$_extend3 === void 0 || (_tempOrder$_extend3 = _tempOrder$_extend3.productsByUid) === null || _tempOrder$_extend3 === void 0 || (_tempOrder$_extend3 = _tempOrder$_extend3[productUid]) === null || _tempOrder$_extend3 === void 0 ? void 0 : _tempOrder$_extend3.origin : undefined;
2592
2632
  if (!(runtimeOrigin !== null && runtimeOrigin !== void 0 && runtimeOrigin.isManualDiscount || isBaseSalesManualProductDiscountProduct(product))) {
@@ -2619,10 +2659,10 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
2619
2659
  case 64:
2620
2660
  _context21.prev = 64;
2621
2661
  _context21.t0 = _context21["catch"](45);
2622
- _iterator2.e(_context21.t0);
2662
+ _iterator3.e(_context21.t0);
2623
2663
  case 67:
2624
2664
  _context21.prev = 67;
2625
- _iterator2.f();
2665
+ _iterator3.f();
2626
2666
  return _context21.finish(67);
2627
2667
  case 70:
2628
2668
  if (!result.discountList) {
@@ -2895,7 +2935,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
2895
2935
  key: "setDiscountSelected",
2896
2936
  value: function () {
2897
2937
  var _setDiscountSelected = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25(params) {
2898
- var list, updated, tempOrder, orderStore, discountModule, rulesModule, nextDiscountList, _orderStore$summary3, orderTotalAmount, result, beforeSelectedIds, _iterator3, _step3, d, selectedResourceIds, filterSelectedDiscountDetails, _iterator4, _step4, _product$metadata8, _tempOrder$_extend4, _product$metadata$sou2, _product$metadata9, _product$metadata10, _product$original_pri2, product, productUid, runtimeOrigin, totalPerUnitDiscount, optionSum, sourcePrice, newSourceSellingPrice, newMainSellingPrice;
2938
+ var list, updated, tempOrder, orderStore, discountModule, rulesModule, nextDiscountList, _orderStore$summary3, orderTotalAmount, result, beforeSelectedIds, _iterator4, _step4, d, selectedResourceIds, filterSelectedDiscountDetails, _iterator5, _step5, _product$metadata8, _tempOrder$_extend4, _product$metadata$sou2, _product$metadata9, _product$metadata10, _product$original_pri2, product, productUid, runtimeOrigin, totalPerUnitDiscount, optionSum, sourcePrice, newSourceSellingPrice, newMainSellingPrice;
2899
2939
  return _regeneratorRuntime().wrap(function _callee25$(_context25) {
2900
2940
  while (1) switch (_context25.prev = _context25.next) {
2901
2941
  case 0:
@@ -2950,10 +2990,10 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
2950
2990
  }).map(function (d) {
2951
2991
  return d.id;
2952
2992
  }));
2953
- _iterator3 = _createForOfIteratorHelper(nextDiscountList);
2993
+ _iterator4 = _createForOfIteratorHelper(nextDiscountList);
2954
2994
  try {
2955
- for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
2956
- d = _step3.value;
2995
+ for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
2996
+ d = _step4.value;
2957
2997
  if (d.isSelected && !beforeSelectedIds.has(d.id)) {
2958
2998
  d.isSelected = false;
2959
2999
  d.isManualSelect = true;
@@ -2961,9 +3001,9 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
2961
3001
  }
2962
3002
  }
2963
3003
  } catch (err) {
2964
- _iterator3.e(err);
3004
+ _iterator4.e(err);
2965
3005
  } finally {
2966
- _iterator3.f();
3006
+ _iterator4.f();
2967
3007
  }
2968
3008
  }
2969
3009
  }
@@ -2980,15 +3020,15 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
2980
3020
  return rid != null && selectedResourceIds.has(rid);
2981
3021
  });
2982
3022
  };
2983
- _iterator4 = _createForOfIteratorHelper(tempOrder.products);
3023
+ _iterator5 = _createForOfIteratorHelper(tempOrder.products);
2984
3024
  _context25.prev = 17;
2985
- _iterator4.s();
3025
+ _iterator5.s();
2986
3026
  case 19:
2987
- if ((_step4 = _iterator4.n()).done) {
3027
+ if ((_step5 = _iterator5.n()).done) {
2988
3028
  _context25.next = 36;
2989
3029
  break;
2990
3030
  }
2991
- product = _step4.value;
3031
+ product = _step5.value;
2992
3032
  productUid = (_product$metadata8 = product.metadata) === null || _product$metadata8 === void 0 ? void 0 : _product$metadata8.unique_identification_number;
2993
3033
  runtimeOrigin = productUid ? (_tempOrder$_extend4 = tempOrder._extend) === null || _tempOrder$_extend4 === void 0 || (_tempOrder$_extend4 = _tempOrder$_extend4.productsByUid) === null || _tempOrder$_extend4 === void 0 || (_tempOrder$_extend4 = _tempOrder$_extend4[productUid]) === null || _tempOrder$_extend4 === void 0 ? void 0 : _tempOrder$_extend4.origin : undefined;
2994
3034
  if (!(runtimeOrigin !== null && runtimeOrigin !== void 0 && runtimeOrigin.isManualDiscount || isBaseSalesManualProductDiscountProduct(product))) {
@@ -3039,10 +3079,10 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
3039
3079
  case 38:
3040
3080
  _context25.prev = 38;
3041
3081
  _context25.t0 = _context25["catch"](17);
3042
- _iterator4.e(_context25.t0);
3082
+ _iterator5.e(_context25.t0);
3043
3083
  case 41:
3044
3084
  _context25.prev = 41;
3045
- _iterator4.f();
3085
+ _iterator5.f();
3046
3086
  return _context25.finish(41);
3047
3087
  case 44:
3048
3088
  OrderModule.populateSavedAmounts(tempOrder.products, nextDiscountList);
@@ -3180,8 +3220,8 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
3180
3220
  key: "submitSalesOrder",
3181
3221
  value: (function () {
3182
3222
  var _submitSalesOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28(params) {
3183
- var _params$smallTicketDa, _this$otherParams11, _this$otherParams12, _this$otherParams13, _this$otherParams14;
3184
- var inferredPaymentStatus, smallTicketDataFlag, submitParams;
3223
+ var _params$smallTicketDa, _this$otherParams13, _this$otherParams14, _this$otherParams15, _this$otherParams16;
3224
+ var inferredPaymentStatus, smallTicketDataFlag, enhancePayload, submitParams;
3185
3225
  return _regeneratorRuntime().wrap(function _callee28$(_context28) {
3186
3226
  while (1) switch (_context28.prev = _context28.next) {
3187
3227
  case 0:
@@ -3194,12 +3234,13 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
3194
3234
  // this.store.order.persistTempOrder();
3195
3235
  inferredPaymentStatus = this.getSubmitPaymentStatus(params === null || params === void 0 ? void 0 : params.paymentStatus);
3196
3236
  smallTicketDataFlag = (_params$smallTicketDa = params === null || params === void 0 ? void 0 : params.smallTicketDataFlag) !== null && _params$smallTicketDa !== void 0 ? _params$smallTicketDa : this.getDefaultCheckoutSmallTicketDataFlag();
3237
+ enhancePayload = this.buildSubmitPayloadEnhancerWithFulfillmentRefMode(params === null || params === void 0 ? void 0 : params.enhancePayload);
3197
3238
  submitParams = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
3198
3239
  cacheId: this.cacheId,
3199
- platform: (_this$otherParams11 = this.otherParams) === null || _this$otherParams11 === void 0 ? void 0 : _this$otherParams11.platform,
3200
- businessCode: ((_this$otherParams12 = this.otherParams) === null || _this$otherParams12 === void 0 ? void 0 : _this$otherParams12.businessCode) || ((_this$otherParams13 = this.otherParams) === null || _this$otherParams13 === void 0 ? void 0 : _this$otherParams13.business_code),
3240
+ platform: (_this$otherParams13 = this.otherParams) === null || _this$otherParams13 === void 0 ? void 0 : _this$otherParams13.platform,
3241
+ businessCode: ((_this$otherParams14 = this.otherParams) === null || _this$otherParams14 === void 0 ? void 0 : _this$otherParams14.businessCode) || ((_this$otherParams15 = this.otherParams) === null || _this$otherParams15 === void 0 ? void 0 : _this$otherParams15.business_code),
3201
3242
  channel: this.getSubmitOrderSalesChannel(),
3202
- type: (_this$otherParams14 = this.otherParams) === null || _this$otherParams14 === void 0 ? void 0 : _this$otherParams14.type,
3243
+ type: (_this$otherParams16 = this.otherParams) === null || _this$otherParams16 === void 0 ? void 0 : _this$otherParams16.type,
3203
3244
  request_unique_idempotency_token: this.store.order.generateIdempotencyToken()
3204
3245
  }, (params === null || params === void 0 ? void 0 : params.payments) !== undefined ? {
3205
3246
  payments: params.payments
@@ -3209,11 +3250,11 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
3209
3250
  smallTicketDataFlag: smallTicketDataFlag
3210
3251
  } : {}), (params === null || params === void 0 ? void 0 : params.confirmPendingVoucherPayments) !== undefined ? {
3211
3252
  confirmPendingVoucherPayments: params.confirmPendingVoucherPayments
3212
- } : {}), (params === null || params === void 0 ? void 0 : params.enhancePayload) !== undefined ? {
3213
- enhancePayload: params.enhancePayload
3253
+ } : {}), enhancePayload !== undefined ? {
3254
+ enhancePayload: enhancePayload
3214
3255
  } : {});
3215
3256
  return _context28.abrupt("return", this.shouldUseCheckoutSyncTask() ? this.store.order.submitTempOrder(submitParams) : this.store.order.submitTempOrderAsync(submitParams));
3216
- case 6:
3257
+ case 7:
3217
3258
  case "end":
3218
3259
  return _context28.stop();
3219
3260
  }
@@ -3228,7 +3269,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
3228
3269
  key: "saveSalesOrderDraft",
3229
3270
  value: function () {
3230
3271
  var _saveSalesOrderDraft = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29(params) {
3231
- var _params$platform, _this$otherParams15, _this$otherParams16, _this$otherParams17, _params$channel, _params$type, _this$otherParams18;
3272
+ var _params$platform, _this$otherParams17, _this$otherParams18, _this$otherParams19, _params$channel, _params$type, _this$otherParams20;
3232
3273
  return _regeneratorRuntime().wrap(function _callee29$(_context29) {
3233
3274
  while (1) switch (_context29.prev = _context29.next) {
3234
3275
  case 0:
@@ -3240,10 +3281,10 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
3240
3281
  case 2:
3241
3282
  return _context29.abrupt("return", this.store.order.saveTempOrderAsDraft(_objectSpread({
3242
3283
  cacheId: this.cacheId,
3243
- platform: (_params$platform = params === null || params === void 0 ? void 0 : params.platform) !== null && _params$platform !== void 0 ? _params$platform : (_this$otherParams15 = this.otherParams) === null || _this$otherParams15 === void 0 ? void 0 : _this$otherParams15.platform,
3244
- businessCode: (params === null || params === void 0 ? void 0 : params.businessCode) || ((_this$otherParams16 = this.otherParams) === null || _this$otherParams16 === void 0 ? void 0 : _this$otherParams16.businessCode) || ((_this$otherParams17 = this.otherParams) === null || _this$otherParams17 === void 0 ? void 0 : _this$otherParams17.business_code),
3284
+ platform: (_params$platform = params === null || params === void 0 ? void 0 : params.platform) !== null && _params$platform !== void 0 ? _params$platform : (_this$otherParams17 = this.otherParams) === null || _this$otherParams17 === void 0 ? void 0 : _this$otherParams17.platform,
3285
+ businessCode: (params === null || params === void 0 ? void 0 : params.businessCode) || ((_this$otherParams18 = this.otherParams) === null || _this$otherParams18 === void 0 ? void 0 : _this$otherParams18.businessCode) || ((_this$otherParams19 = this.otherParams) === null || _this$otherParams19 === void 0 ? void 0 : _this$otherParams19.business_code),
3245
3286
  channel: (_params$channel = params === null || params === void 0 ? void 0 : params.channel) !== null && _params$channel !== void 0 ? _params$channel : this.getSubmitOrderSalesChannel(),
3246
- type: (_params$type = params === null || params === void 0 ? void 0 : params.type) !== null && _params$type !== void 0 ? _params$type : (_this$otherParams18 = this.otherParams) === null || _this$otherParams18 === void 0 ? void 0 : _this$otherParams18.type
3287
+ type: (_params$type = params === null || params === void 0 ? void 0 : params.type) !== null && _params$type !== void 0 ? _params$type : (_this$otherParams20 = this.otherParams) === null || _this$otherParams20 === void 0 ? void 0 : _this$otherParams20.type
3247
3288
  }, (params === null || params === void 0 ? void 0 : params.enhancePayload) !== undefined ? {
3248
3289
  enhancePayload: params.enhancePayload
3249
3290
  } : {})));
@@ -3262,8 +3303,8 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
3262
3303
  key: "submitTempOrderAsync",
3263
3304
  value: function () {
3264
3305
  var _submitTempOrderAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30(params) {
3265
- var _params$smallTicketDa2, _this$otherParams19, _this$otherParams20, _this$otherParams21, _this$otherParams22;
3266
- var inferredPaymentStatus, smallTicketDataFlag, submitParams;
3306
+ var _params$smallTicketDa2, _this$otherParams21, _this$otherParams22, _this$otherParams23, _this$otherParams24;
3307
+ var inferredPaymentStatus, smallTicketDataFlag, enhancePayload, submitParams;
3267
3308
  return _regeneratorRuntime().wrap(function _callee30$(_context30) {
3268
3309
  while (1) switch (_context30.prev = _context30.next) {
3269
3310
  case 0:
@@ -3275,12 +3316,13 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
3275
3316
  case 2:
3276
3317
  inferredPaymentStatus = this.getSubmitPaymentStatus(params === null || params === void 0 ? void 0 : params.paymentStatus);
3277
3318
  smallTicketDataFlag = (_params$smallTicketDa2 = params === null || params === void 0 ? void 0 : params.smallTicketDataFlag) !== null && _params$smallTicketDa2 !== void 0 ? _params$smallTicketDa2 : this.getDefaultCheckoutSmallTicketDataFlag();
3319
+ enhancePayload = this.buildSubmitPayloadEnhancerWithFulfillmentRefMode(params === null || params === void 0 ? void 0 : params.enhancePayload);
3278
3320
  submitParams = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
3279
3321
  cacheId: this.cacheId,
3280
- platform: (_this$otherParams19 = this.otherParams) === null || _this$otherParams19 === void 0 ? void 0 : _this$otherParams19.platform,
3281
- businessCode: ((_this$otherParams20 = this.otherParams) === null || _this$otherParams20 === void 0 ? void 0 : _this$otherParams20.businessCode) || ((_this$otherParams21 = this.otherParams) === null || _this$otherParams21 === void 0 ? void 0 : _this$otherParams21.business_code),
3322
+ platform: (_this$otherParams21 = this.otherParams) === null || _this$otherParams21 === void 0 ? void 0 : _this$otherParams21.platform,
3323
+ businessCode: ((_this$otherParams22 = this.otherParams) === null || _this$otherParams22 === void 0 ? void 0 : _this$otherParams22.businessCode) || ((_this$otherParams23 = this.otherParams) === null || _this$otherParams23 === void 0 ? void 0 : _this$otherParams23.business_code),
3282
3324
  channel: this.getSubmitOrderSalesChannel(),
3283
- type: (_this$otherParams22 = this.otherParams) === null || _this$otherParams22 === void 0 ? void 0 : _this$otherParams22.type,
3325
+ type: (_this$otherParams24 = this.otherParams) === null || _this$otherParams24 === void 0 ? void 0 : _this$otherParams24.type,
3284
3326
  request_unique_idempotency_token: this.store.order.generateIdempotencyToken()
3285
3327
  }, (params === null || params === void 0 ? void 0 : params.payments) !== undefined ? {
3286
3328
  payments: params.payments
@@ -3290,11 +3332,11 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
3290
3332
  smallTicketDataFlag: smallTicketDataFlag
3291
3333
  } : {}), (params === null || params === void 0 ? void 0 : params.confirmPendingVoucherPayments) !== undefined ? {
3292
3334
  confirmPendingVoucherPayments: params.confirmPendingVoucherPayments
3293
- } : {}), (params === null || params === void 0 ? void 0 : params.enhancePayload) !== undefined ? {
3294
- enhancePayload: params.enhancePayload
3335
+ } : {}), enhancePayload !== undefined ? {
3336
+ enhancePayload: enhancePayload
3295
3337
  } : {});
3296
3338
  return _context30.abrupt("return", this.store.order.submitTempOrderAsync(submitParams));
3297
- case 6:
3339
+ case 7:
3298
3340
  case "end":
3299
3341
  return _context30.stop();
3300
3342
  }
@@ -3312,8 +3354,8 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
3312
3354
  }, {
3313
3355
  key: "shouldUseCheckoutSyncTask",
3314
3356
  value: function shouldUseCheckoutSyncTask() {
3315
- var _this$otherParams23;
3316
- var configured = (_this$otherParams23 = this.otherParams) === null || _this$otherParams23 === void 0 ? void 0 : _this$otherParams23.checkoutSyncTaskEnabled;
3357
+ var _this$otherParams25;
3358
+ var configured = (_this$otherParams25 = this.otherParams) === null || _this$otherParams25 === void 0 ? void 0 : _this$otherParams25.checkoutSyncTaskEnabled;
3317
3359
  return typeof configured === 'boolean' ? configured : true;
3318
3360
  }
3319
3361
 
@@ -3327,7 +3369,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
3327
3369
  key: "printLocalOrderReceipt",
3328
3370
  value: function () {
3329
3371
  var _printLocalOrderReceipt = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31(lookup) {
3330
- var _this$otherParams24, _this$otherParams25, _this$otherParams26, _this$otherParams27;
3372
+ var _this$otherParams26, _this$otherParams27, _this$otherParams28, _this$otherParams29;
3331
3373
  var hasLookup, lookupPayload, context, payload, response, _this$store$order$app, _this$store$order5, _data;
3332
3374
  return _regeneratorRuntime().wrap(function _callee31$(_context31) {
3333
3375
  while (1) switch (_context31.prev = _context31.next) {
@@ -3345,10 +3387,10 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
3345
3387
  external_sale_number: lookup
3346
3388
  };
3347
3389
  context = {
3348
- platform: (_this$otherParams24 = this.otherParams) === null || _this$otherParams24 === void 0 ? void 0 : _this$otherParams24.platform,
3349
- businessCode: ((_this$otherParams25 = this.otherParams) === null || _this$otherParams25 === void 0 ? void 0 : _this$otherParams25.businessCode) || ((_this$otherParams26 = this.otherParams) === null || _this$otherParams26 === void 0 ? void 0 : _this$otherParams26.business_code),
3390
+ platform: (_this$otherParams26 = this.otherParams) === null || _this$otherParams26 === void 0 ? void 0 : _this$otherParams26.platform,
3391
+ businessCode: ((_this$otherParams27 = this.otherParams) === null || _this$otherParams27 === void 0 ? void 0 : _this$otherParams27.businessCode) || ((_this$otherParams28 = this.otherParams) === null || _this$otherParams28 === void 0 ? void 0 : _this$otherParams28.business_code),
3350
3392
  channel: this.getSubmitOrderSalesChannel(),
3351
- type: (_this$otherParams27 = this.otherParams) === null || _this$otherParams27 === void 0 ? void 0 : _this$otherParams27.type
3393
+ type: (_this$otherParams29 = this.otherParams) === null || _this$otherParams29 === void 0 ? void 0 : _this$otherParams29.type
3352
3394
  };
3353
3395
  payload = hasLookup ? _objectSpread(_objectSpread({}, lookupPayload), {}, {
3354
3396
  lookup_order_from_db: 1,
@@ -3407,8 +3449,8 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
3407
3449
  key: "syncPaymentsToOrder",
3408
3450
  value: function () {
3409
3451
  var _syncPaymentsToOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32(params) {
3410
- var _ref36, _params$businessCode, _this$otherParams28, _this$otherParams29, _params$channel2;
3411
- var businessCode, channel, syncParams, syncState, payments, syncResult, latestPayments, amountSnapshot, orderSnapshot, syncPayload;
3452
+ var _ref36, _params$businessCode, _this$otherParams30, _this$otherParams31, _params$channel2;
3453
+ var businessCode, channel, enhancePayload, syncParams, syncState, payments, syncResult, latestPayments, amountSnapshot, orderSnapshot, syncPayload;
3412
3454
  return _regeneratorRuntime().wrap(function _callee32$(_context32) {
3413
3455
  while (1) switch (_context32.prev = _context32.next) {
3414
3456
  case 0:
@@ -3418,36 +3460,39 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
3418
3460
  }
3419
3461
  throw new Error('order 模块未初始化');
3420
3462
  case 2:
3421
- businessCode = (_ref36 = (_params$businessCode = params.businessCode) !== null && _params$businessCode !== void 0 ? _params$businessCode : (_this$otherParams28 = this.otherParams) === null || _this$otherParams28 === void 0 ? void 0 : _this$otherParams28.businessCode) !== null && _ref36 !== void 0 ? _ref36 : (_this$otherParams29 = this.otherParams) === null || _this$otherParams29 === void 0 ? void 0 : _this$otherParams29.business_code;
3463
+ businessCode = (_ref36 = (_params$businessCode = params.businessCode) !== null && _params$businessCode !== void 0 ? _params$businessCode : (_this$otherParams30 = this.otherParams) === null || _this$otherParams30 === void 0 ? void 0 : _this$otherParams30.businessCode) !== null && _ref36 !== void 0 ? _ref36 : (_this$otherParams31 = this.otherParams) === null || _this$otherParams31 === void 0 ? void 0 : _this$otherParams31.business_code;
3422
3464
  channel = (_params$channel2 = params.channel) !== null && _params$channel2 !== void 0 ? _params$channel2 : this.getSubmitOrderSalesChannel();
3423
- syncParams = _objectSpread(_objectSpread(_objectSpread({}, params), {}, {
3465
+ enhancePayload = this.buildSubmitPayloadEnhancerWithFulfillmentRefMode(params.enhancePayload);
3466
+ syncParams = _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, params), {}, {
3424
3467
  checkoutSyncTaskEnabled: this.shouldUseCheckoutSyncTask()
3425
3468
  }, businessCode !== undefined ? {
3426
3469
  businessCode: businessCode
3427
3470
  } : {}), channel !== undefined ? {
3428
3471
  channel: channel
3472
+ } : {}), enhancePayload !== undefined ? {
3473
+ enhancePayload: enhancePayload
3429
3474
  } : {});
3430
3475
  syncState = this.store.order.getOrderSyncState();
3431
3476
  if (!(params.submitWhenPaid && syncState === 'submitting')) {
3432
- _context32.next = 9;
3477
+ _context32.next = 10;
3433
3478
  break;
3434
3479
  }
3435
3480
  this.queueLatestAutoPaymentSync();
3436
3481
  return _context32.abrupt("return", this.store.order.syncPaymentsToOrder(syncParams));
3437
- case 9:
3482
+ case 10:
3438
3483
  payments = params.payments || [];
3439
- _context32.next = 12;
3484
+ _context32.next = 13;
3440
3485
  return this.effectsEmit(BaseSalesHookNames.onPaymentSyncStart, {
3441
3486
  payments: payments,
3442
3487
  params: syncParams,
3443
3488
  amountSnapshot: this.store.order.getOrderAmountSnapshot(),
3444
3489
  orderSnapshot: this.store.order.getOrderSnapshot()
3445
3490
  });
3446
- case 12:
3447
- _context32.prev = 12;
3448
- _context32.next = 15;
3491
+ case 13:
3492
+ _context32.prev = 13;
3493
+ _context32.next = 16;
3449
3494
  return this.store.order.syncPaymentsToOrder(syncParams);
3450
- case 15:
3495
+ case 16:
3451
3496
  syncResult = _context32.sent;
3452
3497
  latestPayments = this.store.order.getOrderPayments();
3453
3498
  amountSnapshot = this.store.order.getOrderAmountSnapshot();
@@ -3466,22 +3511,22 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
3466
3511
  depositAmount: syncResult.depositAmount,
3467
3512
  orderExpectedAmount: syncResult.orderExpectedAmount
3468
3513
  };
3469
- _context32.next = 22;
3514
+ _context32.next = 23;
3470
3515
  return this.effectsEmit(BaseSalesHookNames.onPaymentSyncEnd, syncPayload);
3471
- case 22:
3516
+ case 23:
3472
3517
  if (!(syncResult.isDepositFullyPaid && !syncResult.isOrderFullyPaid)) {
3473
- _context32.next = 25;
3518
+ _context32.next = 26;
3474
3519
  break;
3475
3520
  }
3476
- _context32.next = 25;
3521
+ _context32.next = 26;
3477
3522
  return this.effectsEmit(BaseSalesHookNames.onDepositPaymentSyncEnd, syncPayload);
3478
- case 25:
3523
+ case 26:
3479
3524
  this.scheduleQueuedAutoPaymentSyncFlush(0);
3480
3525
  return _context32.abrupt("return", syncResult);
3481
- case 29:
3482
- _context32.prev = 29;
3483
- _context32.t0 = _context32["catch"](12);
3484
- _context32.next = 33;
3526
+ case 30:
3527
+ _context32.prev = 30;
3528
+ _context32.t0 = _context32["catch"](13);
3529
+ _context32.next = 34;
3485
3530
  return this.effectsEmit(BaseSalesHookNames.onPaymentSyncEnd, {
3486
3531
  ok: false,
3487
3532
  error: _context32.t0,
@@ -3490,14 +3535,14 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
3490
3535
  amountSnapshot: this.store.order.getOrderAmountSnapshot(),
3491
3536
  orderSnapshot: this.store.order.getOrderSnapshot()
3492
3537
  });
3493
- case 33:
3538
+ case 34:
3494
3539
  this.scheduleQueuedAutoPaymentSyncFlush(0);
3495
3540
  throw _context32.t0;
3496
- case 35:
3541
+ case 36:
3497
3542
  case "end":
3498
3543
  return _context32.stop();
3499
3544
  }
3500
- }, _callee32, this, [[12, 29]]);
3545
+ }, _callee32, this, [[13, 30]]);
3501
3546
  }));
3502
3547
  function syncPaymentsToOrder(_x27) {
3503
3548
  return _syncPaymentsToOrder.apply(this, arguments);
@@ -3677,7 +3722,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
3677
3722
  }, {
3678
3723
  key: "addOrderPaymentWithDevicePrefix",
3679
3724
  value: function addOrderPaymentWithDevicePrefix(payment, devicePrefix) {
3680
- var _this$otherParams30,
3725
+ var _this$otherParams32,
3681
3726
  _paymentRecord$paymen,
3682
3727
  _paymentRecord$create,
3683
3728
  _ref37,
@@ -3693,7 +3738,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
3693
3738
  return this.store.order.getOrderPayments();
3694
3739
  }
3695
3740
  var metadata = paymentRecord.metadata && _typeof(paymentRecord.metadata) === 'object' ? _objectSpread({}, paymentRecord.metadata) : {};
3696
- var shopWalletPassId = (_this$otherParams30 = this.otherParams) === null || _this$otherParams30 === void 0 ? void 0 : _this$otherParams30.shop_wallet_pass_id;
3741
+ var shopWalletPassId = (_this$otherParams32 = this.otherParams) === null || _this$otherParams32 === void 0 ? void 0 : _this$otherParams32.shop_wallet_pass_id;
3697
3742
  if (shopWalletPassId !== undefined && shopWalletPassId !== null) {
3698
3743
  metadata.shop_wallet_pass_id = shopWalletPassId;
3699
3744
  }
@@ -4592,7 +4637,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
4592
4637
  key: "getCashPaymentConfig",
4593
4638
  value: (function () {
4594
4639
  var _getCashPaymentConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee47() {
4595
- var _this$store$order11, _this$store$order11$g, _this$store$order12, _this$store$order12$g, _this$otherParams31;
4640
+ var _this$store$order11, _this$store$order11$g, _this$store$order12, _this$store$order12$g, _this$otherParams33;
4596
4641
  var paymentMethods, paymentMethod, amountSnapshot, pendingWalletAmount, amountDue, currency, recommendedAmounts;
4597
4642
  return _regeneratorRuntime().wrap(function _callee47$(_context47) {
4598
4643
  while (1) switch (_context47.prev = _context47.next) {
@@ -4618,7 +4663,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
4618
4663
  amountSnapshot = (_this$store$order11 = this.store.order) === null || _this$store$order11 === void 0 || (_this$store$order11$g = _this$store$order11.getOrderAmountSnapshot) === null || _this$store$order11$g === void 0 ? void 0 : _this$store$order11$g.call(_this$store$order11);
4619
4664
  pendingWalletAmount = this.getPendingWalletPaymentAmount();
4620
4665
  amountDue = Decimal.max(new Decimal((amountSnapshot === null || amountSnapshot === void 0 ? void 0 : amountSnapshot.amountGap) || 0).minus(pendingWalletAmount), 0).toDecimalPlaces(2).toNumber();
4621
- currency = ((_this$store$order12 = this.store.order) === null || _this$store$order12 === void 0 || (_this$store$order12$g = _this$store$order12.getTempOrder) === null || _this$store$order12$g === void 0 || (_this$store$order12$g = _this$store$order12$g.call(_this$store$order12)) === null || _this$store$order12$g === void 0 ? void 0 : _this$store$order12$g.currency_code) || ((_this$otherParams31 = this.otherParams) === null || _this$otherParams31 === void 0 ? void 0 : _this$otherParams31.currency) || 'USD';
4666
+ currency = ((_this$store$order12 = this.store.order) === null || _this$store$order12 === void 0 || (_this$store$order12$g = _this$store$order12.getTempOrder) === null || _this$store$order12$g === void 0 || (_this$store$order12$g = _this$store$order12$g.call(_this$store$order12)) === null || _this$store$order12$g === void 0 ? void 0 : _this$store$order12$g.currency_code) || ((_this$otherParams33 = this.otherParams) === null || _this$otherParams33 === void 0 ? void 0 : _this$otherParams33.currency) || 'USD';
4622
4667
  recommendedAmounts = amountDue > 0 ? this.store.payment.cash.getRecommendedAmount(amountDue, currency) : [];
4623
4668
  return _context47.abrupt("return", {
4624
4669
  available: Boolean(paymentMethod && amountDue > 0),
@@ -4753,7 +4798,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
4753
4798
  key: "payCash",
4754
4799
  value: (function () {
4755
4800
  var _payCash = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee49(params) {
4756
- var _this$store$order$get6, _params$actualPaidAmo, _this$otherParams32, _this$window, _this$window$postMess;
4801
+ var _this$store$order$get6, _params$actualPaidAmo, _this$otherParams34, _this$window, _this$window$postMess;
4757
4802
  var amount, config, paymentMethod, roundingAmount, effectivePaymentAmount, beforePayments, beforePaymentStatus, uniquePaymentNumber, paymentTimestamp, actualPaidAmount, changeAmount, shopWalletPassId, payments, payment, syncResult, committed, walletState, restoredTempOrder;
4758
4803
  return _regeneratorRuntime().wrap(function _callee49$(_context49) {
4759
4804
  while (1) switch (_context49.prev = _context49.next) {
@@ -4802,7 +4847,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
4802
4847
  paymentTimestamp = dayjs().format('YYYY-MM-DD HH:mm:ss');
4803
4848
  actualPaidAmount = Number((_params$actualPaidAmo = params.actualPaidAmount) !== null && _params$actualPaidAmo !== void 0 ? _params$actualPaidAmo : amount);
4804
4849
  changeAmount = Number(params.changeAmount || 0);
4805
- shopWalletPassId = (_this$otherParams32 = this.otherParams) === null || _this$otherParams32 === void 0 ? void 0 : _this$otherParams32.shop_wallet_pass_id;
4850
+ shopWalletPassId = (_this$otherParams34 = this.otherParams) === null || _this$otherParams34 === void 0 ? void 0 : _this$otherParams34.shop_wallet_pass_id;
4806
4851
  if (!(!Number.isFinite(actualPaidAmount) || actualPaidAmount + 0.01 < amount)) {
4807
4852
  _context49.next = 26;
4808
4853
  break;
@@ -5771,13 +5816,13 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
5771
5816
  key: "getProductList",
5772
5817
  value: function () {
5773
5818
  var _getProductList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee64() {
5774
- var _this$otherParams33;
5819
+ var _this$otherParams35;
5775
5820
  var menu_list_ids, _this$store$products, res;
5776
5821
  return _regeneratorRuntime().wrap(function _callee64$(_context64) {
5777
5822
  while (1) switch (_context64.prev = _context64.next) {
5778
5823
  case 0:
5779
5824
  // 可以直接通过配置里的 menu 读取
5780
- menu_list_ids = ((_this$otherParams33 = this.otherParams) === null || _this$otherParams33 === void 0 || (_this$otherParams33 = _this$otherParams33.dineInConfig) === null || _this$otherParams33 === void 0 ? void 0 : _this$otherParams33['menu.associated_menus'].map(function (n) {
5825
+ menu_list_ids = ((_this$otherParams35 = this.otherParams) === null || _this$otherParams35 === void 0 || (_this$otherParams35 = _this$otherParams35.dineInConfig) === null || _this$otherParams35 === void 0 ? void 0 : _this$otherParams35['menu.associated_menus'].map(function (n) {
5781
5826
  return Number(n.value);
5782
5827
  })) || [];
5783
5828
  _context64.prev = 1;
@@ -5815,7 +5860,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
5815
5860
  key: "setOtherParams",
5816
5861
  value: function () {
5817
5862
  var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee65(params) {
5818
- var _this$otherParams34;
5863
+ var _this$otherParams36;
5819
5864
  var _ref44,
5820
5865
  _ref44$cover,
5821
5866
  cover,
@@ -5829,7 +5874,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
5829
5874
  } else {
5830
5875
  this.otherParams = _objectSpread(_objectSpread({}, this.otherParams), params);
5831
5876
  }
5832
- this.cacheId = (_this$otherParams34 = this.otherParams) === null || _this$otherParams34 === void 0 ? void 0 : _this$otherParams34.cacheId;
5877
+ this.cacheId = (_this$otherParams36 = this.otherParams) === null || _this$otherParams36 === void 0 ? void 0 : _this$otherParams36.cacheId;
5833
5878
  _context65.next = 5;
5834
5879
  return this.syncOtherParamsToSubModules(params, {
5835
5880
  cover: cover
@@ -326,7 +326,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
326
326
  date: string;
327
327
  status: string;
328
328
  week: string;
329
- weekNum: 0 | 1 | 5 | 2 | 3 | 4 | 6;
329
+ weekNum: 0 | 1 | 2 | 5 | 3 | 4 | 6;
330
330
  }[]>;
331
331
  submitTimeSlot(timeSlots: TimeSliceItem): void;
332
332
  private getScheduleDataByIds;
@@ -434,7 +434,10 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
434
434
  prefix = this.normalizeIdPrefix((_openDataConfig3 = openDataConfig) === null || _openDataConfig3 === void 0 ? void 0 : _openDataConfig3['sale.short_number_prefix'], '');
435
435
  shopOrderPrefix = this.normalizeIdPrefix((_openDataConfig4 = openDataConfig) === null || _openDataConfig4 === void 0 ? void 0 : _openDataConfig4['sale.sale_number_prefix'], '');
436
436
  resetReceiptSequenceDaily = typeof ((_openDataConfig5 = openDataConfig) === null || _openDataConfig5 === void 0 ? void 0 : _openDataConfig5['sale.short_number_daily_reset']) === 'boolean' ? (_openDataConfig6 = openDataConfig) === null || _openDataConfig6 === void 0 ? void 0 : _openDataConfig6['sale.short_number_daily_reset'] : false;
437
- operatingDayBoundary = this.getAppData('operating_day_boundary');
437
+ operatingDayBoundary = this.getAppData('operating_day_boundary') || {
438
+ "type": "start_time",
439
+ "time": "00:00"
440
+ };
438
441
  _context5.next = 24;
439
442
  return this.getShortNumberOrDeviceId();
440
443
  case 24:
@@ -459,7 +462,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
459
462
  padReceiptSequence: false,
460
463
  receiptSequenceLength: receiptSequenceLength,
461
464
  resetReceiptSequenceDaily: resetReceiptSequenceDaily,
462
- receiptSequenceResetTime: operatingDayBoundary.time,
465
+ receiptSequenceResetTime: operatingDayBoundary === null || operatingDayBoundary === void 0 ? void 0 : operatingDayBoundary.time,
463
466
  receiptSequenceStart: receiptSequenceStart,
464
467
  shopOrderPrefix: shopOrderPrefix
465
468
  }
@@ -3794,6 +3794,13 @@ class OrderModule extends _BaseModule.BaseModule {
3794
3794
  }
3795
3795
  this.store.syncState = 'submitting';
3796
3796
  const paymentSyncIdempotencyToken = this.buildPaymentSyncIdempotencyToken(tempOrder, effectivePayments);
3797
+ const enhancePayload = (payload, ctx) => {
3798
+ const enhancedPayload = params.enhancePayload ? params.enhancePayload(payload, ctx) : payload;
3799
+ return {
3800
+ ...enhancedPayload,
3801
+ request_unique_idempotency_token: paymentSyncIdempotencyToken
3802
+ };
3803
+ };
3797
3804
  const submitParams = {
3798
3805
  payments: effectivePayments,
3799
3806
  paymentStatus,
@@ -3801,13 +3808,7 @@ class OrderModule extends _BaseModule.BaseModule {
3801
3808
  businessCode: params.businessCode,
3802
3809
  channel: params.channel,
3803
3810
  confirmPendingVoucherPayments: true,
3804
- enhancePayload: payload => {
3805
- const nextPayload = {
3806
- ...payload,
3807
- request_unique_idempotency_token: paymentSyncIdempotencyToken
3808
- };
3809
- return nextPayload;
3810
- }
3811
+ enhancePayload
3811
3812
  };
3812
3813
  const submitResult = params.checkoutSyncTaskEnabled === false ? await this.submitTempOrderAsync(submitParams) : await this.submitTempOrder(submitParams);
3813
3814
  return {
@@ -608,6 +608,7 @@ export interface SyncPaymentsToOrderParams {
608
608
  businessCode?: string;
609
609
  channel?: string;
610
610
  confirmPendingVoucherPayments?: boolean;
611
+ enhancePayload?: SubmitPayloadEnhancer;
611
612
  }
612
613
  export interface SyncPaymentsToOrderResult<T = any> {
613
614
  isFullyPaid: boolean;
@@ -511,6 +511,10 @@ declare class Server {
511
511
  private buildCheckoutTaskIdempotencyKey;
512
512
  private isBlankCheckoutValue;
513
513
  private isLocalCheckoutOrderId;
514
+ private applyCheckoutFulfillmentBuzzer;
515
+ private buildCheckoutResourceIdentifierBuzzer;
516
+ private getCheckoutResourceIdentifier;
517
+ private stringifyCheckoutResourceIdentifier;
514
518
  private normalizeCheckoutSubmitData;
515
519
  private ensureCheckoutOrderNumbers;
516
520
  private dispatchCheckoutSyncTask;