@pisell/pisellos 0.10.64 → 0.10.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/model/strategy/adapter/promotion/index.js +0 -9
- package/dist/modules/Order/index.d.ts +6 -1
- package/dist/modules/Order/index.js +564 -475
- package/dist/modules/Order/types.d.ts +2 -0
- package/dist/modules/Order/utils/discountProductLineIdentity.js +2 -2
- package/dist/modules/Order/utils/productVoucherGroups.d.ts +15 -0
- package/dist/modules/Order/utils/productVoucherGroups.js +115 -0
- package/dist/modules/Product/index.d.ts +1 -1
- package/dist/modules/Rules/index.d.ts +2 -0
- package/dist/modules/Rules/index.js +29 -21
- package/dist/solution/BaseSales/index.d.ts +8 -1
- package/dist/solution/BaseSales/index.js +53 -41
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.d.ts +13 -1
- package/dist/solution/BookingTicket/index.js +36 -11
- package/dist/solution/BookingTicket/types.d.ts +2 -0
- package/lib/modules/Order/index.d.ts +6 -1
- package/lib/modules/Order/index.js +49 -6
- package/lib/modules/Order/types.d.ts +2 -0
- package/lib/modules/Order/utils/discountProductLineIdentity.js +1 -1
- package/lib/modules/Order/utils/productVoucherGroups.d.ts +15 -0
- package/lib/modules/Order/utils/productVoucherGroups.js +64 -0
- package/lib/modules/Product/index.d.ts +1 -1
- package/lib/modules/Rules/index.d.ts +2 -0
- package/lib/modules/Rules/index.js +6 -0
- package/lib/solution/BaseSales/index.d.ts +8 -1
- package/lib/solution/BaseSales/index.js +9 -2
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.d.ts +13 -1
- package/lib/solution/BookingTicket/index.js +14 -0
- package/lib/solution/BookingTicket/types.d.ts +2 -0
- package/package.json +1 -1
|
@@ -3884,7 +3884,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3884
3884
|
}, {
|
|
3885
3885
|
key: "scanPromotionCode",
|
|
3886
3886
|
value: function () {
|
|
3887
|
-
var _scanPromotionCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee33(code, customerId) {
|
|
3887
|
+
var _scanPromotionCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee33(code, customerId, options) {
|
|
3888
3888
|
var raw, tempOrder;
|
|
3889
3889
|
return _regeneratorRuntime().wrap(function _callee33$(_context33) {
|
|
3890
3890
|
while (1) switch (_context33.prev = _context33.next) {
|
|
@@ -3897,7 +3897,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3897
3897
|
throw new Error('order 模块未初始化');
|
|
3898
3898
|
case 3:
|
|
3899
3899
|
_context33.next = 5;
|
|
3900
|
-
return this.store.order.scanCode(code, customerId);
|
|
3900
|
+
return this.store.order.scanCode(code, customerId, options);
|
|
3901
3901
|
case 5:
|
|
3902
3902
|
raw = _context33.sent;
|
|
3903
3903
|
if (!raw.isAvailable) {
|
|
@@ -3938,7 +3938,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3938
3938
|
}
|
|
3939
3939
|
}, _callee33, this, [[0, 16]]);
|
|
3940
3940
|
}));
|
|
3941
|
-
function scanPromotionCode(_x25, _x26) {
|
|
3941
|
+
function scanPromotionCode(_x25, _x26, _x27) {
|
|
3942
3942
|
return _scanPromotionCode.apply(this, arguments);
|
|
3943
3943
|
}
|
|
3944
3944
|
return scanPromotionCode;
|
|
@@ -4146,7 +4146,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4146
4146
|
}
|
|
4147
4147
|
}, _callee34, this, [[0, 64], [27, 48, 51, 54]]);
|
|
4148
4148
|
}));
|
|
4149
|
-
function setDiscountSelected(
|
|
4149
|
+
function setDiscountSelected(_x28) {
|
|
4150
4150
|
return _setDiscountSelected.apply(this, arguments);
|
|
4151
4151
|
}
|
|
4152
4152
|
return setDiscountSelected;
|
|
@@ -4216,7 +4216,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4216
4216
|
}
|
|
4217
4217
|
}, _callee35, this, [[0, 21]]);
|
|
4218
4218
|
}));
|
|
4219
|
-
function applyDiscountCalculationResult(
|
|
4219
|
+
function applyDiscountCalculationResult(_x29) {
|
|
4220
4220
|
return _applyDiscountCalculationResult.apply(this, arguments);
|
|
4221
4221
|
}
|
|
4222
4222
|
return applyDiscountCalculationResult;
|
|
@@ -4235,7 +4235,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4235
4235
|
}
|
|
4236
4236
|
}, _callee36, this);
|
|
4237
4237
|
}));
|
|
4238
|
-
function submitScanOrder(
|
|
4238
|
+
function submitScanOrder(_x30) {
|
|
4239
4239
|
return _submitScanOrder.apply(this, arguments);
|
|
4240
4240
|
}
|
|
4241
4241
|
return submitScanOrder;
|
|
@@ -4496,7 +4496,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4496
4496
|
}
|
|
4497
4497
|
}, _callee38, this);
|
|
4498
4498
|
}));
|
|
4499
|
-
function submitSalesOrder(
|
|
4499
|
+
function submitSalesOrder(_x31) {
|
|
4500
4500
|
return _submitSalesOrder.apply(this, arguments);
|
|
4501
4501
|
}
|
|
4502
4502
|
return submitSalesOrder;
|
|
@@ -4539,7 +4539,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4539
4539
|
}
|
|
4540
4540
|
}, _callee39, this);
|
|
4541
4541
|
}));
|
|
4542
|
-
function saveSalesOrderDraft(
|
|
4542
|
+
function saveSalesOrderDraft(_x32) {
|
|
4543
4543
|
return _saveSalesOrderDraft.apply(this, arguments);
|
|
4544
4544
|
}
|
|
4545
4545
|
return saveSalesOrderDraft;
|
|
@@ -4596,7 +4596,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4596
4596
|
}
|
|
4597
4597
|
}, _callee40, this);
|
|
4598
4598
|
}));
|
|
4599
|
-
function submitTempOrderAsync(
|
|
4599
|
+
function submitTempOrderAsync(_x33) {
|
|
4600
4600
|
return _submitTempOrderAsync.apply(this, arguments);
|
|
4601
4601
|
}
|
|
4602
4602
|
return submitTempOrderAsync;
|
|
@@ -4688,7 +4688,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4688
4688
|
}
|
|
4689
4689
|
}, _callee41, this);
|
|
4690
4690
|
}));
|
|
4691
|
-
function printLocalOrderReceipt(
|
|
4691
|
+
function printLocalOrderReceipt(_x34) {
|
|
4692
4692
|
return _printLocalOrderReceipt.apply(this, arguments);
|
|
4693
4693
|
}
|
|
4694
4694
|
return printLocalOrderReceipt;
|
|
@@ -4805,7 +4805,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4805
4805
|
}
|
|
4806
4806
|
}, _callee42, this, [[13, 30]]);
|
|
4807
4807
|
}));
|
|
4808
|
-
function syncPaymentsToOrder(
|
|
4808
|
+
function syncPaymentsToOrder(_x35) {
|
|
4809
4809
|
return _syncPaymentsToOrder.apply(this, arguments);
|
|
4810
4810
|
}
|
|
4811
4811
|
return syncPaymentsToOrder;
|
|
@@ -4975,7 +4975,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4975
4975
|
}
|
|
4976
4976
|
}, _callee44, this);
|
|
4977
4977
|
}));
|
|
4978
|
-
function addOrderPaymentAsync(
|
|
4978
|
+
function addOrderPaymentAsync(_x36) {
|
|
4979
4979
|
return _addOrderPaymentAsync.apply(this, arguments);
|
|
4980
4980
|
}
|
|
4981
4981
|
return addOrderPaymentAsync;
|
|
@@ -5163,7 +5163,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5163
5163
|
}
|
|
5164
5164
|
}, _callee45, this, [[17, 23]]);
|
|
5165
5165
|
}));
|
|
5166
|
-
function updateOrderPayment(
|
|
5166
|
+
function updateOrderPayment(_x37, _x38) {
|
|
5167
5167
|
return _updateOrderPayment.apply(this, arguments);
|
|
5168
5168
|
}
|
|
5169
5169
|
return updateOrderPayment;
|
|
@@ -5202,7 +5202,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5202
5202
|
}
|
|
5203
5203
|
}, _callee46, this);
|
|
5204
5204
|
}));
|
|
5205
|
-
function updateVoucherOrderPaymentsAsync(
|
|
5205
|
+
function updateVoucherOrderPaymentsAsync(_x39, _x40) {
|
|
5206
5206
|
return _updateVoucherOrderPaymentsAsync.apply(this, arguments);
|
|
5207
5207
|
}
|
|
5208
5208
|
return updateVoucherOrderPaymentsAsync;
|
|
@@ -5376,7 +5376,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5376
5376
|
}
|
|
5377
5377
|
}, _callee47, this);
|
|
5378
5378
|
}));
|
|
5379
|
-
function initWalletData(
|
|
5379
|
+
function initWalletData(_x41) {
|
|
5380
5380
|
return _initWalletData.apply(this, arguments);
|
|
5381
5381
|
}
|
|
5382
5382
|
return initWalletData;
|
|
@@ -5447,7 +5447,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5447
5447
|
}
|
|
5448
5448
|
}, _callee48, this);
|
|
5449
5449
|
}));
|
|
5450
|
-
function publishWalletAssetsState(
|
|
5450
|
+
function publishWalletAssetsState(_x42) {
|
|
5451
5451
|
return _publishWalletAssetsState.apply(this, arguments);
|
|
5452
5452
|
}
|
|
5453
5453
|
return publishWalletAssetsState;
|
|
@@ -5528,7 +5528,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5528
5528
|
}
|
|
5529
5529
|
}, _callee49, this);
|
|
5530
5530
|
}));
|
|
5531
|
-
function syncSelectedWalletAssets(
|
|
5531
|
+
function syncSelectedWalletAssets(_x43) {
|
|
5532
5532
|
return _syncSelectedWalletAssets.apply(this, arguments);
|
|
5533
5533
|
}
|
|
5534
5534
|
return syncSelectedWalletAssets;
|
|
@@ -5586,7 +5586,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5586
5586
|
}
|
|
5587
5587
|
}, _callee50, this);
|
|
5588
5588
|
}));
|
|
5589
|
-
function importWalletAssetsSnapshot(
|
|
5589
|
+
function importWalletAssetsSnapshot(_x44) {
|
|
5590
5590
|
return _importWalletAssetsSnapshot.apply(this, arguments);
|
|
5591
5591
|
}
|
|
5592
5592
|
return importWalletAssetsSnapshot;
|
|
@@ -5680,7 +5680,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5680
5680
|
}
|
|
5681
5681
|
}, _callee51, this);
|
|
5682
5682
|
}));
|
|
5683
|
-
function refreshWalletAssets(
|
|
5683
|
+
function refreshWalletAssets(_x45) {
|
|
5684
5684
|
return _refreshWalletAssets.apply(this, arguments);
|
|
5685
5685
|
}
|
|
5686
5686
|
return refreshWalletAssets;
|
|
@@ -5713,7 +5713,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5713
5713
|
}
|
|
5714
5714
|
}, _callee52, this);
|
|
5715
5715
|
}));
|
|
5716
|
-
function selectWalletAsset(
|
|
5716
|
+
function selectWalletAsset(_x46) {
|
|
5717
5717
|
return _selectWalletAsset.apply(this, arguments);
|
|
5718
5718
|
}
|
|
5719
5719
|
return selectWalletAsset;
|
|
@@ -5743,7 +5743,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5743
5743
|
}
|
|
5744
5744
|
}, _callee53, this);
|
|
5745
5745
|
}));
|
|
5746
|
-
function updateWalletAssetAmount(
|
|
5746
|
+
function updateWalletAssetAmount(_x47) {
|
|
5747
5747
|
return _updateWalletAssetAmount.apply(this, arguments);
|
|
5748
5748
|
}
|
|
5749
5749
|
return updateWalletAssetAmount;
|
|
@@ -5788,7 +5788,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5788
5788
|
}
|
|
5789
5789
|
}, _callee54, this);
|
|
5790
5790
|
}));
|
|
5791
|
-
function scanWalletAsset(
|
|
5791
|
+
function scanWalletAsset(_x48) {
|
|
5792
5792
|
return _scanWalletAsset.apply(this, arguments);
|
|
5793
5793
|
}
|
|
5794
5794
|
return scanWalletAsset;
|
|
@@ -6289,7 +6289,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
6289
6289
|
}
|
|
6290
6290
|
}, _callee59, this, [[39, 53]]);
|
|
6291
6291
|
}));
|
|
6292
|
-
function payCash(
|
|
6292
|
+
function payCash(_x49) {
|
|
6293
6293
|
return _payCash.apply(this, arguments);
|
|
6294
6294
|
}
|
|
6295
6295
|
return payCash;
|
|
@@ -6451,7 +6451,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
6451
6451
|
}
|
|
6452
6452
|
}, _callee60, this, [[30, 44]]);
|
|
6453
6453
|
}));
|
|
6454
|
-
function commitPaymentMethodPayment(
|
|
6454
|
+
function commitPaymentMethodPayment(_x50) {
|
|
6455
6455
|
return _commitPaymentMethodPayment.apply(this, arguments);
|
|
6456
6456
|
}
|
|
6457
6457
|
return commitPaymentMethodPayment;
|
|
@@ -6499,7 +6499,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
6499
6499
|
}
|
|
6500
6500
|
}, _callee61, this);
|
|
6501
6501
|
}));
|
|
6502
|
-
function roundAmount(
|
|
6502
|
+
function roundAmount(_x51) {
|
|
6503
6503
|
return _roundAmount.apply(this, arguments);
|
|
6504
6504
|
}
|
|
6505
6505
|
return roundAmount;
|
|
@@ -6556,7 +6556,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
6556
6556
|
}
|
|
6557
6557
|
}, _callee62, this);
|
|
6558
6558
|
}));
|
|
6559
|
-
function sendCustomerPayLink(
|
|
6559
|
+
function sendCustomerPayLink(_x52) {
|
|
6560
6560
|
return _sendCustomerPayLink.apply(this, arguments);
|
|
6561
6561
|
}
|
|
6562
6562
|
return sendCustomerPayLink;
|
|
@@ -6618,7 +6618,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
6618
6618
|
}
|
|
6619
6619
|
}, _callee63, this);
|
|
6620
6620
|
}));
|
|
6621
|
-
function calculateProductBookingPrice(
|
|
6621
|
+
function calculateProductBookingPrice(_x53) {
|
|
6622
6622
|
return _calculateProductBookingPrice.apply(this, arguments);
|
|
6623
6623
|
}
|
|
6624
6624
|
return calculateProductBookingPrice;
|
|
@@ -6770,7 +6770,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
6770
6770
|
}
|
|
6771
6771
|
}, _callee64);
|
|
6772
6772
|
}));
|
|
6773
|
-
return function (
|
|
6773
|
+
return function (_x55) {
|
|
6774
6774
|
return _ref56.apply(this, arguments);
|
|
6775
6775
|
};
|
|
6776
6776
|
}()));
|
|
@@ -6818,11 +6818,23 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
6818
6818
|
}
|
|
6819
6819
|
}, _callee65, this);
|
|
6820
6820
|
}));
|
|
6821
|
-
function calculateProductBookingPrices(
|
|
6821
|
+
function calculateProductBookingPrices(_x54) {
|
|
6822
6822
|
return _calculateProductBookingPrices.apply(this, arguments);
|
|
6823
6823
|
}
|
|
6824
6824
|
return calculateProductBookingPrices;
|
|
6825
6825
|
}()
|
|
6826
|
+
}, {
|
|
6827
|
+
key: "setProductVoucherGroups",
|
|
6828
|
+
value: function setProductVoucherGroups(groups) {
|
|
6829
|
+
if (!this.store.order) throw new Error('order 模块未初始化');
|
|
6830
|
+
this.store.order.setProductVoucherGroups(groups);
|
|
6831
|
+
}
|
|
6832
|
+
}, {
|
|
6833
|
+
key: "validateProductVoucherSelection",
|
|
6834
|
+
value: function validateProductVoucherSelection() {
|
|
6835
|
+
var _this$store$order30;
|
|
6836
|
+
(_this$store$order30 = this.store.order) === null || _this$store$order30 === void 0 || _this$store$order30.validateProductVoucherSelection();
|
|
6837
|
+
}
|
|
6826
6838
|
}, {
|
|
6827
6839
|
key: "addProductToOrder",
|
|
6828
6840
|
value: function () {
|
|
@@ -6866,7 +6878,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
6866
6878
|
}
|
|
6867
6879
|
}, _callee66, this, [[0, 16]]);
|
|
6868
6880
|
}));
|
|
6869
|
-
function addProductToOrder(
|
|
6881
|
+
function addProductToOrder(_x56, _x57, _x58) {
|
|
6870
6882
|
return _addProductToOrder.apply(this, arguments);
|
|
6871
6883
|
}
|
|
6872
6884
|
return addProductToOrder;
|
|
@@ -6901,7 +6913,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
6901
6913
|
}
|
|
6902
6914
|
}, _callee67, this, [[0, 9]]);
|
|
6903
6915
|
}));
|
|
6904
|
-
function updateOrderProduct(
|
|
6916
|
+
function updateOrderProduct(_x59) {
|
|
6905
6917
|
return _updateOrderProduct.apply(this, arguments);
|
|
6906
6918
|
}
|
|
6907
6919
|
return updateOrderProduct;
|
|
@@ -6936,7 +6948,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
6936
6948
|
}
|
|
6937
6949
|
}, _callee68, this, [[0, 9]]);
|
|
6938
6950
|
}));
|
|
6939
|
-
function updateOrderProducts(
|
|
6951
|
+
function updateOrderProducts(_x60) {
|
|
6940
6952
|
return _updateOrderProducts.apply(this, arguments);
|
|
6941
6953
|
}
|
|
6942
6954
|
return updateOrderProducts;
|
|
@@ -6971,7 +6983,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
6971
6983
|
}
|
|
6972
6984
|
}, _callee69, this, [[0, 9]]);
|
|
6973
6985
|
}));
|
|
6974
|
-
function updateOrderProductQuantity(
|
|
6986
|
+
function updateOrderProductQuantity(_x61) {
|
|
6975
6987
|
return _updateOrderProductQuantity.apply(this, arguments);
|
|
6976
6988
|
}
|
|
6977
6989
|
return updateOrderProductQuantity;
|
|
@@ -7029,7 +7041,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
7029
7041
|
}
|
|
7030
7042
|
}, _callee70, this, [[0, 11]]);
|
|
7031
7043
|
}));
|
|
7032
|
-
function setOrderProductLineNote(
|
|
7044
|
+
function setOrderProductLineNote(_x62, _x63) {
|
|
7033
7045
|
return _setOrderProductLineNote.apply(this, arguments);
|
|
7034
7046
|
}
|
|
7035
7047
|
return setOrderProductLineNote;
|
|
@@ -7082,7 +7094,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
7082
7094
|
}
|
|
7083
7095
|
}, _callee71, this, [[0, 15]]);
|
|
7084
7096
|
}));
|
|
7085
|
-
function removeProductsFromOrder(
|
|
7097
|
+
function removeProductsFromOrder(_x64, _x65) {
|
|
7086
7098
|
return _removeProductsFromOrder.apply(this, arguments);
|
|
7087
7099
|
}
|
|
7088
7100
|
return removeProductsFromOrder;
|
|
@@ -7101,7 +7113,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
7101
7113
|
}
|
|
7102
7114
|
}, _callee72, this);
|
|
7103
7115
|
}));
|
|
7104
|
-
function removeProductFromOrder(
|
|
7116
|
+
function removeProductFromOrder(_x66, _x67) {
|
|
7105
7117
|
return _removeProductFromOrder.apply(this, arguments);
|
|
7106
7118
|
}
|
|
7107
7119
|
return removeProductFromOrder;
|
|
@@ -7177,16 +7189,16 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
7177
7189
|
}, {
|
|
7178
7190
|
key: "getUnfulfilledPromotions",
|
|
7179
7191
|
value: function getUnfulfilledPromotions() {
|
|
7180
|
-
var _this$store$
|
|
7181
|
-
return ((_this$store$
|
|
7192
|
+
var _this$store$order31;
|
|
7193
|
+
return ((_this$store$order31 = this.store.order) === null || _this$store$order31 === void 0 ? void 0 : _this$store$order31.getUnfulfilledPromotions()) || [];
|
|
7182
7194
|
}
|
|
7183
7195
|
|
|
7184
7196
|
/** 最近一次促销计算输出的赠品操作 diff。 */
|
|
7185
7197
|
}, {
|
|
7186
7198
|
key: "getLastGiftActions",
|
|
7187
7199
|
value: function getLastGiftActions() {
|
|
7188
|
-
var _this$store$
|
|
7189
|
-
return ((_this$store$
|
|
7200
|
+
var _this$store$order32;
|
|
7201
|
+
return ((_this$store$order32 = this.store.order) === null || _this$store$order32 === void 0 ? void 0 : _this$store$order32.getLastGiftActions()) || null;
|
|
7190
7202
|
}
|
|
7191
7203
|
|
|
7192
7204
|
// 获取商品列表
|
|
@@ -7267,7 +7279,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
7267
7279
|
}
|
|
7268
7280
|
}, _callee75, this);
|
|
7269
7281
|
}));
|
|
7270
|
-
function setOtherParams(
|
|
7282
|
+
function setOtherParams(_x68) {
|
|
7271
7283
|
return _setOtherParams.apply(this, arguments);
|
|
7272
7284
|
}
|
|
7273
7285
|
return setOtherParams;
|
|
@@ -373,7 +373,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
373
373
|
};
|
|
374
374
|
setOtherData(key: string, value: any): void;
|
|
375
375
|
getOtherData(key: string): any;
|
|
376
|
-
getProductTypeById(id: number): Promise<"
|
|
376
|
+
getProductTypeById(id: number): Promise<"normal" | "duration" | "session">;
|
|
377
377
|
/**
|
|
378
378
|
* 提供给 UI 的方法,减轻 UI 层的计算压力,UI 层只需要传递 cartItemId 和 resourceCode 即返回对应的 renderList
|
|
379
379
|
*
|
|
@@ -465,7 +465,19 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
|
|
|
465
465
|
* 加车两阶段主决策(规格弹窗 / 资源编辑 / 直接加车)。
|
|
466
466
|
* 与 ticketBooking `handleSelectProduct` + `handleBooking4Service` 等价。
|
|
467
467
|
*/
|
|
468
|
-
decideAddProduct(item: any, options?: Partial<AddProductDecideContext>):
|
|
468
|
+
decideAddProduct(item: any, options?: Partial<AddProductDecideContext>): {
|
|
469
|
+
action: "reloadCatalog";
|
|
470
|
+
} | {
|
|
471
|
+
action: "add";
|
|
472
|
+
cacheItem: any;
|
|
473
|
+
} | {
|
|
474
|
+
action: "requiresDetail";
|
|
475
|
+
payload: AddProductRequiresDetailPayload;
|
|
476
|
+
} | {
|
|
477
|
+
action: "requiresBookingEdit";
|
|
478
|
+
cacheItem: any;
|
|
479
|
+
payload: import("./utils/addProductDecision").AddProductRequiresBookingEditPayload;
|
|
480
|
+
};
|
|
469
481
|
/** 规格弹窗 callback 后的第二段决策。 */
|
|
470
482
|
decideAfterDetail(cacheItem: any, options?: Partial<AddProductDecideContext>): import("./utils/addProductDecision").AddProductDecision;
|
|
471
483
|
/**
|
|
@@ -2667,7 +2667,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2667
2667
|
value: (function () {
|
|
2668
2668
|
var _handleGlobalScanCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32(code, bridge) {
|
|
2669
2669
|
var _this7 = this;
|
|
2670
|
-
var trimmed, _bridge$onNotify, _bridge$refresh, beforeScanCommit, beforeScanDialog, guardCallback, guardedBridge, localSearch, scanCallback, raw, formatted, _bridge$onNotify2, _result7, _bridge$onNotify3;
|
|
2670
|
+
var trimmed, _bridge$onNotify, _bridge$refresh, beforeScanCommit, beforeScanDialog, guardCallback, guardedBridge, _promotion$isAccepted, promotion, localSearch, scanCallback, raw, formatted, _bridge$onNotify2, _result7, _bridge$onNotify3;
|
|
2671
2671
|
return _regeneratorRuntime().wrap(function _callee32$(_context32) {
|
|
2672
2672
|
while (1) switch (_context32.prev = _context32.next) {
|
|
2673
2673
|
case 0:
|
|
@@ -2708,20 +2708,45 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2708
2708
|
return bridge.openBookingEdit(payload);
|
|
2709
2709
|
} : undefined
|
|
2710
2710
|
}) : undefined;
|
|
2711
|
+
if (!((guardedBridge === null || guardedBridge === void 0 ? void 0 : guardedBridge.scanScope) === 'product-voucher')) {
|
|
2712
|
+
_context32.next = 16;
|
|
2713
|
+
break;
|
|
2714
|
+
}
|
|
2715
|
+
if (guardedBridge.applyPromotionCode) {
|
|
2716
|
+
_context32.next = 12;
|
|
2717
|
+
break;
|
|
2718
|
+
}
|
|
2719
|
+
return _context32.abrupt("return", {
|
|
2720
|
+
status: 'failed',
|
|
2721
|
+
reason: 'no_bridge'
|
|
2722
|
+
});
|
|
2723
|
+
case 12:
|
|
2724
|
+
_context32.next = 14;
|
|
2725
|
+
return guardedBridge.applyPromotionCode(trimmed);
|
|
2726
|
+
case 14:
|
|
2727
|
+
promotion = _context32.sent;
|
|
2728
|
+
return _context32.abrupt("return", ((_promotion$isAccepted = promotion.isAccepted) !== null && _promotion$isAccepted !== void 0 ? _promotion$isAccepted : promotion.isAvailable) ? {
|
|
2729
|
+
status: 'success',
|
|
2730
|
+
kind: 'promotion'
|
|
2731
|
+
} : {
|
|
2732
|
+
status: 'failed',
|
|
2733
|
+
reason: 'not_found'
|
|
2734
|
+
});
|
|
2735
|
+
case 16:
|
|
2711
2736
|
localSearch = function localSearch(v) {
|
|
2712
2737
|
return _this7.store.products.findProductsByCodeOrBarcode(v);
|
|
2713
2738
|
};
|
|
2714
2739
|
scanCallback = handleGlobalScan(this.request, localSearch, this.getSubmitOrderSalesChannel());
|
|
2715
|
-
_context32.next =
|
|
2740
|
+
_context32.next = 20;
|
|
2716
2741
|
return scanCallback({
|
|
2717
2742
|
type: 'nativeScanner',
|
|
2718
2743
|
value: trimmed
|
|
2719
2744
|
});
|
|
2720
|
-
case
|
|
2745
|
+
case 20:
|
|
2721
2746
|
raw = _context32.sent;
|
|
2722
2747
|
formatted = formatGlobalScanResult(raw, trimmed);
|
|
2723
2748
|
if (formatted) {
|
|
2724
|
-
_context32.next =
|
|
2749
|
+
_context32.next = 25;
|
|
2725
2750
|
break;
|
|
2726
2751
|
}
|
|
2727
2752
|
bridge === null || bridge === void 0 || (_bridge$onNotify2 = bridge.onNotify) === null || _bridge$onNotify2 === void 0 || _bridge$onNotify2.call(bridge, 'fail', 'pisell2.text.scan-global-failed');
|
|
@@ -2729,8 +2754,8 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2729
2754
|
status: 'failed',
|
|
2730
2755
|
reason: 'not_found'
|
|
2731
2756
|
});
|
|
2732
|
-
case
|
|
2733
|
-
_context32.next =
|
|
2757
|
+
case 25:
|
|
2758
|
+
_context32.next = 27;
|
|
2734
2759
|
return applyGlobalScan({
|
|
2735
2760
|
setOrderCustomer: function setOrderCustomer(customer) {
|
|
2736
2761
|
beforeScanCommit();
|
|
@@ -2770,12 +2795,12 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2770
2795
|
return _this7.scanWalletAsset(scanCode);
|
|
2771
2796
|
}
|
|
2772
2797
|
}, formatted, guardedBridge);
|
|
2773
|
-
case
|
|
2798
|
+
case 27:
|
|
2774
2799
|
_result7 = _context32.sent;
|
|
2775
2800
|
bridge === null || bridge === void 0 || (_bridge$refresh = bridge.refresh) === null || _bridge$refresh === void 0 || _bridge$refresh.call(bridge);
|
|
2776
2801
|
return _context32.abrupt("return", _result7);
|
|
2777
|
-
case
|
|
2778
|
-
_context32.prev =
|
|
2802
|
+
case 32:
|
|
2803
|
+
_context32.prev = 32;
|
|
2779
2804
|
_context32.t0 = _context32["catch"](4);
|
|
2780
2805
|
console.error('[BookingTicket] handleGlobalScanCode failed', _context32.t0);
|
|
2781
2806
|
bridge === null || bridge === void 0 || (_bridge$onNotify3 = bridge.onNotify) === null || _bridge$onNotify3 === void 0 || _bridge$onNotify3.call(bridge, 'fail', 'pisell2.text.scan-global-failed');
|
|
@@ -2783,11 +2808,11 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2783
2808
|
status: 'failed',
|
|
2784
2809
|
reason: 'not_found'
|
|
2785
2810
|
});
|
|
2786
|
-
case
|
|
2811
|
+
case 37:
|
|
2787
2812
|
case "end":
|
|
2788
2813
|
return _context32.stop();
|
|
2789
2814
|
}
|
|
2790
|
-
}, _callee32, this, [[4,
|
|
2815
|
+
}, _callee32, this, [[4, 32]]);
|
|
2791
2816
|
}));
|
|
2792
2817
|
function handleGlobalScanCode(_x21, _x22) {
|
|
2793
2818
|
return _handleGlobalScanCode.apply(this, arguments);
|
|
@@ -208,6 +208,8 @@ export interface AddAddTimeProductsToBookingInput {
|
|
|
208
208
|
}
|
|
209
209
|
/** 扫码宿主桥接:SalesSdk 在 pubsub 订阅回调里注入,OS 需要 UI 时直接调用 */
|
|
210
210
|
export interface GlobalScanHostBridge {
|
|
211
|
+
/** Restrict redemption scans before customer/product side effects. */
|
|
212
|
+
scanScope?: 'all' | 'product-voucher';
|
|
211
213
|
openProductDetail?: (payload: Record<string, any>) => Promise<any | null>;
|
|
212
214
|
openBookingEdit?: (payload: Record<string, any>) => Promise<any | null>;
|
|
213
215
|
confirmDetail?: (input: {
|
|
@@ -4,6 +4,7 @@ import { OrderModuleAPI, CommitOrderParams, UpdateOrderBookingParams, UpdateOrde
|
|
|
4
4
|
import { CartItem } from '../Cart/types';
|
|
5
5
|
import { type SubmitPayloadEnhancer } from './utils';
|
|
6
6
|
import { type PickupTimingBooking, type PickupTimingBookingInput } from './pickupTiming';
|
|
7
|
+
import { type ProductVoucherGroup } from './utils/productVoucherGroups';
|
|
7
8
|
import type { OrderAmountSnapshot, AddProductBookingInput, AddProductToOrderOptions, OrderIdentitySnapshot, OrderPaymentSource, OrderSnapshot, OrderSyncState, SyncPaymentsToOrderParams, SyncPaymentsToOrderResult, SubmitSalesOrderParams, OrderProduct, OrderProductIdentity, OrderSummary, OrderTempOrder, OrderPaymentData, OrderPaymentUpdateOptions, OrderPaymentUpdateResult, SendCustomerPayLinkParams, UpdateTempOrderCustomerInput, OrderCustomerPatch, OrderCustomerView, OrderHooksConfig, OrderCartIntentCommitContext, ReplaceTempOrderOptions, OrderPromotionEvaluator, OrderGiftSelectResolver, OrderUnfulfilledPromotion, OrderLastGiftActions, RemoveProductsFromOrderOptions, SalesNote, SalesNotesMutationSnapshot, SetSalesNoteInput, PickupReferenceMode, PointCardSnapshotMergeContext, PointCardSnapshotItem, ShopServiceData, ShopServiceType } from './types';
|
|
8
9
|
import type { ICustomer } from '../AccountList/types';
|
|
9
10
|
import type { Discount } from '../Discount/types';
|
|
@@ -94,6 +95,8 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
94
95
|
*/
|
|
95
96
|
private logError;
|
|
96
97
|
private registerDiscountModules;
|
|
98
|
+
setProductVoucherGroups(groups: ProductVoucherGroup[]): void;
|
|
99
|
+
validateProductVoucherSelection(): void;
|
|
97
100
|
private createDefaultRulesHooks;
|
|
98
101
|
/**
|
|
99
102
|
* Stable across notifyTempOrderChanged's immutable copy, but changes when a
|
|
@@ -112,7 +115,9 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
112
115
|
getCustomerWalletPrepareConfigEpoch(): number;
|
|
113
116
|
private syncScannedDiscountsToOriginalDiscountList;
|
|
114
117
|
private ensureEditDiscountConfigForProductChange;
|
|
115
|
-
scanCode(code: string, customerId?: number
|
|
118
|
+
scanCode(code: string, customerId?: number, options?: {
|
|
119
|
+
productVouchersOnly?: boolean;
|
|
120
|
+
}): Promise<{
|
|
116
121
|
isAvailable: boolean;
|
|
117
122
|
isAccepted?: boolean;
|
|
118
123
|
discountList: Discount[];
|