@pisell/pisellos 2.3.44 → 2.3.46
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/Discount/index.d.ts +0 -1
- package/dist/modules/Discount/index.js +11 -40
- package/dist/modules/Discount/types.d.ts +0 -1
- package/dist/modules/OpenData/index.js +2 -2
- package/dist/modules/Order/index.d.ts +2 -4
- package/dist/modules/Order/index.js +25 -54
- package/dist/modules/Order/types.d.ts +0 -9
- package/dist/modules/Order/utils.d.ts +0 -10
- package/dist/modules/Order/utils.js +3 -35
- package/dist/modules/Product/types.d.ts +0 -1
- package/dist/modules/ProductList/index.js +14 -33
- package/dist/modules/Quotation/index.d.ts +1 -1
- package/dist/modules/Quotation/index.js +2 -2
- package/dist/modules/Rules/index.js +13 -47
- package/dist/modules/SalesSummary/index.js +13 -12
- package/dist/modules/ScanOrderLogger/index.d.ts +0 -2
- package/dist/modules/ScanOrderLogger/index.js +2 -15
- package/dist/modules/ScanOrderLogger/providers/feishu.js +27 -45
- package/dist/modules/ScanOrderLogger/types.d.ts +0 -1
- package/dist/modules/Schedule/index.d.ts +1 -3
- package/dist/modules/Schedule/index.js +16 -21
- package/dist/modules/Summary/utils.js +13 -38
- package/dist/modules/index.d.ts +0 -2
- package/dist/modules/index.js +1 -3
- package/dist/plugins/window.d.ts +0 -1
- package/dist/server/index.d.ts +0 -14
- package/dist/server/index.js +657 -772
- package/dist/solution/BaseSales/index.d.ts +0 -7
- package/dist/solution/BaseSales/index.js +42 -64
- package/dist/solution/BookingByStep/index.d.ts +1 -16
- package/dist/solution/BookingByStep/index.js +215 -294
- package/dist/solution/BookingByStep/types.d.ts +1 -2
- package/dist/solution/BookingByStep/types.js +1 -3
- package/dist/solution/BookingByStep/utils/capacity.js +1 -17
- package/dist/solution/BookingByStep/utils/timeslots.d.ts +1 -3
- package/dist/solution/BookingByStep/utils/timeslots.js +12 -19
- package/dist/solution/BookingTicket/index.d.ts +2 -14
- package/dist/solution/BookingTicket/index.js +2 -2
- package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +1 -3
- package/dist/solution/BookingTicket/utils/scan/handleScan.js +2 -10
- package/dist/solution/ScanOrder/index.d.ts +14 -26
- package/dist/solution/ScanOrder/index.js +739 -1142
- package/dist/solution/ScanOrder/types.d.ts +1 -21
- package/dist/solution/ScanOrder/utils.d.ts +0 -8
- package/dist/solution/ScanOrder/utils.js +25 -66
- package/dist/solution/ShopDiscount/index.d.ts +0 -1
- package/dist/solution/ShopDiscount/index.js +87 -125
- package/dist/solution/VenueBooking/index.d.ts +11 -39
- package/dist/solution/VenueBooking/index.js +841 -1167
- package/dist/solution/VenueBooking/types.d.ts +0 -3
- package/dist/solution/VenueBooking/utils/resource.js +0 -1
- package/dist/solution/VenueBooking/utils/slotMerge.d.ts +4 -4
- package/dist/solution/VenueBooking/utils/slotMerge.js +5 -10
- package/dist/solution/index.d.ts +0 -1
- package/dist/solution/index.js +1 -2
- package/dist/types/index.d.ts +0 -1
- package/lib/model/strategy/adapter/promotion/index.js +0 -51
- package/lib/modules/Discount/index.d.ts +0 -1
- package/lib/modules/Discount/index.js +0 -9
- package/lib/modules/Discount/types.d.ts +0 -1
- package/lib/modules/OpenData/index.js +1 -1
- package/lib/modules/Order/index.d.ts +2 -4
- package/lib/modules/Order/index.js +10 -26
- package/lib/modules/Order/types.d.ts +0 -9
- package/lib/modules/Order/utils.d.ts +0 -10
- package/lib/modules/Order/utils.js +5 -36
- package/lib/modules/Product/types.d.ts +0 -1
- package/lib/modules/ProductList/index.js +31 -40
- package/lib/modules/Quotation/index.d.ts +1 -1
- package/lib/modules/Quotation/index.js +2 -2
- package/lib/modules/Rules/index.js +16 -33
- package/lib/modules/SalesSummary/index.js +7 -6
- package/lib/modules/ScanOrderLogger/index.d.ts +0 -2
- package/lib/modules/ScanOrderLogger/index.js +1 -13
- package/lib/modules/ScanOrderLogger/providers/feishu.js +6 -15
- package/lib/modules/ScanOrderLogger/types.d.ts +0 -1
- package/lib/modules/Schedule/index.d.ts +1 -3
- package/lib/modules/Schedule/index.js +8 -10
- package/lib/modules/Summary/utils.js +1 -21
- package/lib/modules/index.d.ts +0 -2
- package/lib/modules/index.js +1 -5
- package/lib/plugins/window.d.ts +0 -1
- package/lib/server/index.d.ts +0 -14
- package/lib/server/index.js +5 -65
- package/lib/solution/BaseSales/index.d.ts +0 -7
- package/lib/solution/BaseSales/index.js +8 -24
- package/lib/solution/BookingByStep/index.d.ts +1 -16
- package/lib/solution/BookingByStep/index.js +18 -60
- package/lib/solution/BookingByStep/types.d.ts +1 -2
- package/lib/solution/BookingByStep/types.js +0 -5
- package/lib/solution/BookingByStep/utils/capacity.js +1 -20
- package/lib/solution/BookingByStep/utils/timeslots.d.ts +1 -3
- package/lib/solution/BookingByStep/utils/timeslots.js +11 -19
- package/lib/solution/BookingTicket/index.d.ts +2 -14
- package/lib/solution/BookingTicket/index.js +2 -10
- package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +1 -3
- package/lib/solution/BookingTicket/utils/scan/handleScan.js +2 -2
- package/lib/solution/ScanOrder/index.d.ts +14 -26
- package/lib/solution/ScanOrder/index.js +182 -449
- package/lib/solution/ScanOrder/types.d.ts +1 -21
- package/lib/solution/ScanOrder/utils.d.ts +0 -8
- package/lib/solution/ScanOrder/utils.js +0 -31
- package/lib/solution/ShopDiscount/index.d.ts +0 -1
- package/lib/solution/ShopDiscount/index.js +0 -14
- package/lib/solution/VenueBooking/index.d.ts +11 -39
- package/lib/solution/VenueBooking/index.js +110 -322
- package/lib/solution/VenueBooking/types.d.ts +0 -3
- package/lib/solution/VenueBooking/utils/resource.js +0 -1
- package/lib/solution/VenueBooking/utils/slotMerge.d.ts +4 -4
- package/lib/solution/VenueBooking/utils/slotMerge.js +4 -6
- package/lib/solution/index.d.ts +0 -1
- package/lib/solution/index.js +1 -3
- package/lib/types/index.d.ts +0 -1
- package/package.json +1 -1
- package/dist/modules/Holder/index.d.ts +0 -48
- package/dist/modules/Holder/index.js +0 -640
- package/dist/modules/Holder/types.d.ts +0 -123
- package/dist/modules/Holder/types.js +0 -1
- package/dist/modules/Holder/utils.d.ts +0 -13
- package/dist/modules/Holder/utils.js +0 -34
- package/dist/modules/ResourcePlanner/index.d.ts +0 -24
- package/dist/modules/ResourcePlanner/index.js +0 -181
- package/dist/modules/ResourcePlanner/planner.d.ts +0 -14
- package/dist/modules/ResourcePlanner/planner.js +0 -1069
- package/dist/modules/ResourcePlanner/types.d.ts +0 -227
- package/dist/modules/ResourcePlanner/types.js +0 -1
- package/dist/solution/UnifiedBookingSales/index.d.ts +0 -183
- package/dist/solution/UnifiedBookingSales/index.js +0 -1891
- package/dist/solution/UnifiedBookingSales/types.d.ts +0 -143
- package/dist/solution/UnifiedBookingSales/types.js +0 -11
- package/lib/modules/Holder/index.d.ts +0 -48
- package/lib/modules/Holder/index.js +0 -402
- package/lib/modules/Holder/types.d.ts +0 -123
- package/lib/modules/Holder/types.js +0 -17
- package/lib/modules/Holder/utils.d.ts +0 -13
- package/lib/modules/Holder/utils.js +0 -71
- package/lib/modules/ResourcePlanner/index.d.ts +0 -24
- package/lib/modules/ResourcePlanner/index.js +0 -148
- package/lib/modules/ResourcePlanner/planner.d.ts +0 -14
- package/lib/modules/ResourcePlanner/planner.js +0 -933
- package/lib/modules/ResourcePlanner/types.d.ts +0 -227
- package/lib/modules/ResourcePlanner/types.js +0 -17
- package/lib/solution/UnifiedBookingSales/index.d.ts +0 -183
- package/lib/solution/UnifiedBookingSales/index.js +0 -1084
- package/lib/solution/UnifiedBookingSales/types.d.ts +0 -143
- package/lib/solution/UnifiedBookingSales/types.js +0 -33
|
@@ -280,13 +280,6 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
280
280
|
confirmPendingVoucherPayments?: boolean;
|
|
281
281
|
enhancePayload?: SubmitPayloadEnhancer;
|
|
282
282
|
}): Promise<T>;
|
|
283
|
-
/**
|
|
284
|
-
* 默认保持 WebPOS 的本地待同步订单模式;需要云端确认后才算成功的渠道可覆盖此策略。
|
|
285
|
-
* otherParams.checkoutSyncTaskEnabled 优先,便于同一 solution 按入口恢复旧行为。
|
|
286
|
-
*/
|
|
287
|
-
protected shouldUseCheckoutSyncTask(): boolean;
|
|
288
|
-
/** 可由特定 solution 为真实 checkout 补充默认收据数据请求。 */
|
|
289
|
-
protected getDefaultCheckoutSmallTicketDataFlag(): number | undefined;
|
|
290
283
|
printLocalOrderReceipt<T = any>(lookup?: BaseSalesPrintLocalOrderReceiptParams): Promise<T>;
|
|
291
284
|
private getSubmitPaymentStatus;
|
|
292
285
|
syncPaymentsToOrder<T = any>(params: SyncPaymentsToOrderParams): Promise<SyncPaymentsToOrderResult<T>>;
|
|
@@ -1312,8 +1312,6 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1312
1312
|
value: function () {
|
|
1313
1313
|
var _initialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(core) {
|
|
1314
1314
|
var _this$otherParams4,
|
|
1315
|
-
_this$appPlugin2,
|
|
1316
|
-
_this$appPlugin2$getA,
|
|
1317
1315
|
_this9 = this,
|
|
1318
1316
|
_this$otherParams5;
|
|
1319
1317
|
var options,
|
|
@@ -1337,11 +1335,14 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1337
1335
|
|
|
1338
1336
|
// 获取 logger 实例
|
|
1339
1337
|
this.appPlugin = core.getPlugin('app');
|
|
1340
|
-
if (
|
|
1341
|
-
|
|
1338
|
+
if (this.appPlugin) {
|
|
1339
|
+
_context11.next = 12;
|
|
1340
|
+
break;
|
|
1342
1341
|
}
|
|
1343
|
-
|
|
1344
|
-
|
|
1342
|
+
throw new Error('Checkout 解决方案需要 app 插件支持');
|
|
1343
|
+
case 12:
|
|
1344
|
+
app = this.appPlugin.getApp();
|
|
1345
|
+
this.logger = app.logger;
|
|
1345
1346
|
targetCacheData = this.readSessionCacheData();
|
|
1346
1347
|
moduleNames = this.getRegisteredModuleNames();
|
|
1347
1348
|
moduleNames.forEach(function (step) {
|
|
@@ -1366,21 +1367,21 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1366
1367
|
}));
|
|
1367
1368
|
});
|
|
1368
1369
|
if (!(this.store.schedule && !this.isScheduleListLoaded(this.store.schedule))) {
|
|
1369
|
-
_context11.next =
|
|
1370
|
+
_context11.next = 20;
|
|
1370
1371
|
break;
|
|
1371
1372
|
}
|
|
1372
|
-
_context11.next =
|
|
1373
|
+
_context11.next = 20;
|
|
1373
1374
|
return this.store.schedule.loadAllSchedule();
|
|
1374
|
-
case
|
|
1375
|
+
case 20:
|
|
1375
1376
|
if (this.store.order && typeof ((_this$otherParams5 = this.otherParams) === null || _this$otherParams5 === void 0 ? void 0 : _this$otherParams5.enableTempOrderPersist) === 'boolean') {
|
|
1376
1377
|
this.store.order.setEnableTempOrderPersist(this.otherParams.enableTempOrderPersist);
|
|
1377
1378
|
}
|
|
1378
|
-
_context11.next =
|
|
1379
|
+
_context11.next = 23;
|
|
1379
1380
|
return this.getPaymentMethodsAsync();
|
|
1380
|
-
case
|
|
1381
|
+
case 23:
|
|
1381
1382
|
this.registerServerOrderChangeSync();
|
|
1382
1383
|
this.core.effects.emit("".concat(this.name, ":onInited"), {});
|
|
1383
|
-
case
|
|
1384
|
+
case 25:
|
|
1384
1385
|
case "end":
|
|
1385
1386
|
return _context11.stop();
|
|
1386
1387
|
}
|
|
@@ -2793,8 +2794,8 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2793
2794
|
key: "submitSalesOrder",
|
|
2794
2795
|
value: (function () {
|
|
2795
2796
|
var _submitSalesOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(params) {
|
|
2796
|
-
var
|
|
2797
|
-
var inferredPaymentStatus,
|
|
2797
|
+
var _this$otherParams6, _this$otherParams7, _this$otherParams8, _this$otherParams9;
|
|
2798
|
+
var inferredPaymentStatus, submitParams;
|
|
2798
2799
|
return _regeneratorRuntime().wrap(function _callee27$(_context27) {
|
|
2799
2800
|
while (1) switch (_context27.prev = _context27.next) {
|
|
2800
2801
|
case 0:
|
|
@@ -2806,7 +2807,6 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2806
2807
|
case 2:
|
|
2807
2808
|
// this.store.order.persistTempOrder();
|
|
2808
2809
|
inferredPaymentStatus = this.getSubmitPaymentStatus(params === null || params === void 0 ? void 0 : params.paymentStatus);
|
|
2809
|
-
smallTicketDataFlag = (_params$smallTicketDa = params === null || params === void 0 ? void 0 : params.smallTicketDataFlag) !== null && _params$smallTicketDa !== void 0 ? _params$smallTicketDa : this.getDefaultCheckoutSmallTicketDataFlag();
|
|
2810
2810
|
submitParams = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
2811
2811
|
cacheId: this.cacheId,
|
|
2812
2812
|
platform: (_this$otherParams6 = this.otherParams) === null || _this$otherParams6 === void 0 ? void 0 : _this$otherParams6.platform,
|
|
@@ -2818,15 +2818,15 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2818
2818
|
payments: params.payments
|
|
2819
2819
|
} : {}), inferredPaymentStatus !== undefined ? {
|
|
2820
2820
|
paymentStatus: inferredPaymentStatus
|
|
2821
|
-
} : {}), smallTicketDataFlag !== undefined ? {
|
|
2822
|
-
smallTicketDataFlag: smallTicketDataFlag
|
|
2821
|
+
} : {}), (params === null || params === void 0 ? void 0 : params.smallTicketDataFlag) !== undefined ? {
|
|
2822
|
+
smallTicketDataFlag: params.smallTicketDataFlag
|
|
2823
2823
|
} : {}), (params === null || params === void 0 ? void 0 : params.confirmPendingVoucherPayments) !== undefined ? {
|
|
2824
2824
|
confirmPendingVoucherPayments: params.confirmPendingVoucherPayments
|
|
2825
2825
|
} : {}), (params === null || params === void 0 ? void 0 : params.enhancePayload) !== undefined ? {
|
|
2826
2826
|
enhancePayload: params.enhancePayload
|
|
2827
2827
|
} : {});
|
|
2828
|
-
return _context27.abrupt("return", this.
|
|
2829
|
-
case
|
|
2828
|
+
return _context27.abrupt("return", this.store.order.submitTempOrder(submitParams));
|
|
2829
|
+
case 5:
|
|
2830
2830
|
case "end":
|
|
2831
2831
|
return _context27.stop();
|
|
2832
2832
|
}
|
|
@@ -2875,8 +2875,8 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2875
2875
|
key: "submitTempOrderAsync",
|
|
2876
2876
|
value: function () {
|
|
2877
2877
|
var _submitTempOrderAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29(params) {
|
|
2878
|
-
var
|
|
2879
|
-
var inferredPaymentStatus,
|
|
2878
|
+
var _this$otherParams14, _this$otherParams15, _this$otherParams16, _this$otherParams17;
|
|
2879
|
+
var inferredPaymentStatus, submitParams;
|
|
2880
2880
|
return _regeneratorRuntime().wrap(function _callee29$(_context29) {
|
|
2881
2881
|
while (1) switch (_context29.prev = _context29.next) {
|
|
2882
2882
|
case 0:
|
|
@@ -2887,27 +2887,25 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2887
2887
|
throw new Error('BaseSales 解决方案需要 order 模块支持');
|
|
2888
2888
|
case 2:
|
|
2889
2889
|
inferredPaymentStatus = this.getSubmitPaymentStatus(params === null || params === void 0 ? void 0 : params.paymentStatus);
|
|
2890
|
-
smallTicketDataFlag = (_params$smallTicketDa2 = params === null || params === void 0 ? void 0 : params.smallTicketDataFlag) !== null && _params$smallTicketDa2 !== void 0 ? _params$smallTicketDa2 : this.getDefaultCheckoutSmallTicketDataFlag();
|
|
2891
2890
|
submitParams = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
2892
2891
|
cacheId: this.cacheId,
|
|
2893
2892
|
platform: (_this$otherParams14 = this.otherParams) === null || _this$otherParams14 === void 0 ? void 0 : _this$otherParams14.platform,
|
|
2894
2893
|
businessCode: ((_this$otherParams15 = this.otherParams) === null || _this$otherParams15 === void 0 ? void 0 : _this$otherParams15.businessCode) || ((_this$otherParams16 = this.otherParams) === null || _this$otherParams16 === void 0 ? void 0 : _this$otherParams16.business_code),
|
|
2895
2894
|
channel: this.getSubmitOrderSalesChannel(),
|
|
2896
|
-
type: (_this$otherParams17 = this.otherParams) === null || _this$otherParams17 === void 0 ? void 0 : _this$otherParams17.type
|
|
2897
|
-
request_unique_idempotency_token: this.store.order.generateIdempotencyToken()
|
|
2895
|
+
type: (_this$otherParams17 = this.otherParams) === null || _this$otherParams17 === void 0 ? void 0 : _this$otherParams17.type
|
|
2898
2896
|
}, (params === null || params === void 0 ? void 0 : params.payments) !== undefined ? {
|
|
2899
2897
|
payments: params.payments
|
|
2900
2898
|
} : {}), inferredPaymentStatus !== undefined ? {
|
|
2901
2899
|
paymentStatus: inferredPaymentStatus
|
|
2902
|
-
} : {}), smallTicketDataFlag !== undefined ? {
|
|
2903
|
-
smallTicketDataFlag: smallTicketDataFlag
|
|
2900
|
+
} : {}), (params === null || params === void 0 ? void 0 : params.smallTicketDataFlag) !== undefined ? {
|
|
2901
|
+
smallTicketDataFlag: params.smallTicketDataFlag
|
|
2904
2902
|
} : {}), (params === null || params === void 0 ? void 0 : params.confirmPendingVoucherPayments) !== undefined ? {
|
|
2905
2903
|
confirmPendingVoucherPayments: params.confirmPendingVoucherPayments
|
|
2906
2904
|
} : {}), (params === null || params === void 0 ? void 0 : params.enhancePayload) !== undefined ? {
|
|
2907
2905
|
enhancePayload: params.enhancePayload
|
|
2908
2906
|
} : {});
|
|
2909
2907
|
return _context29.abrupt("return", this.store.order.submitTempOrderAsync(submitParams));
|
|
2910
|
-
case
|
|
2908
|
+
case 5:
|
|
2911
2909
|
case "end":
|
|
2912
2910
|
return _context29.stop();
|
|
2913
2911
|
}
|
|
@@ -2918,29 +2916,11 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2918
2916
|
}
|
|
2919
2917
|
return submitTempOrderAsync;
|
|
2920
2918
|
}()
|
|
2921
|
-
/**
|
|
2922
|
-
* 默认保持 WebPOS 的本地待同步订单模式;需要云端确认后才算成功的渠道可覆盖此策略。
|
|
2923
|
-
* otherParams.checkoutSyncTaskEnabled 优先,便于同一 solution 按入口恢复旧行为。
|
|
2924
|
-
*/
|
|
2925
|
-
}, {
|
|
2926
|
-
key: "shouldUseCheckoutSyncTask",
|
|
2927
|
-
value: function shouldUseCheckoutSyncTask() {
|
|
2928
|
-
var _this$otherParams18;
|
|
2929
|
-
var configured = (_this$otherParams18 = this.otherParams) === null || _this$otherParams18 === void 0 ? void 0 : _this$otherParams18.checkoutSyncTaskEnabled;
|
|
2930
|
-
return typeof configured === 'boolean' ? configured : true;
|
|
2931
|
-
}
|
|
2932
|
-
|
|
2933
|
-
/** 可由特定 solution 为真实 checkout 补充默认收据数据请求。 */
|
|
2934
|
-
}, {
|
|
2935
|
-
key: "getDefaultCheckoutSmallTicketDataFlag",
|
|
2936
|
-
value: function getDefaultCheckoutSmallTicketDataFlag() {
|
|
2937
|
-
return undefined;
|
|
2938
|
-
}
|
|
2939
2919
|
}, {
|
|
2940
2920
|
key: "printLocalOrderReceipt",
|
|
2941
2921
|
value: function () {
|
|
2942
2922
|
var _printLocalOrderReceipt = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30(lookup) {
|
|
2943
|
-
var _this$
|
|
2923
|
+
var _this$otherParams18, _this$otherParams19, _this$otherParams20, _this$otherParams21;
|
|
2944
2924
|
var hasLookup, lookupPayload, context, payload, response, _this$store$order$app, _this$store$order5, _data;
|
|
2945
2925
|
return _regeneratorRuntime().wrap(function _callee30$(_context30) {
|
|
2946
2926
|
while (1) switch (_context30.prev = _context30.next) {
|
|
@@ -2958,10 +2938,10 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2958
2938
|
external_sale_number: lookup
|
|
2959
2939
|
};
|
|
2960
2940
|
context = {
|
|
2961
|
-
platform: (_this$
|
|
2962
|
-
businessCode: ((_this$
|
|
2941
|
+
platform: (_this$otherParams18 = this.otherParams) === null || _this$otherParams18 === void 0 ? void 0 : _this$otherParams18.platform,
|
|
2942
|
+
businessCode: ((_this$otherParams19 = this.otherParams) === null || _this$otherParams19 === void 0 ? void 0 : _this$otherParams19.businessCode) || ((_this$otherParams20 = this.otherParams) === null || _this$otherParams20 === void 0 ? void 0 : _this$otherParams20.business_code),
|
|
2963
2943
|
channel: this.getSubmitOrderSalesChannel(),
|
|
2964
|
-
type: (_this$
|
|
2944
|
+
type: (_this$otherParams21 = this.otherParams) === null || _this$otherParams21 === void 0 ? void 0 : _this$otherParams21.type
|
|
2965
2945
|
};
|
|
2966
2946
|
payload = hasLookup ? _objectSpread(_objectSpread({}, lookupPayload), {}, {
|
|
2967
2947
|
lookup_order_from_db: 1,
|
|
@@ -3020,7 +3000,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3020
3000
|
key: "syncPaymentsToOrder",
|
|
3021
3001
|
value: function () {
|
|
3022
3002
|
var _syncPaymentsToOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31(params) {
|
|
3023
|
-
var _ref29, _params$businessCode, _this$
|
|
3003
|
+
var _ref29, _params$businessCode, _this$otherParams22, _this$otherParams23, _params$channel2;
|
|
3024
3004
|
var businessCode, channel, syncParams, syncState, payments, syncResult, latestPayments, amountSnapshot, orderSnapshot, syncPayload;
|
|
3025
3005
|
return _regeneratorRuntime().wrap(function _callee31$(_context31) {
|
|
3026
3006
|
while (1) switch (_context31.prev = _context31.next) {
|
|
@@ -3031,11 +3011,9 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3031
3011
|
}
|
|
3032
3012
|
throw new Error('order 模块未初始化');
|
|
3033
3013
|
case 2:
|
|
3034
|
-
businessCode = (_ref29 = (_params$businessCode = params.businessCode) !== null && _params$businessCode !== void 0 ? _params$businessCode : (_this$
|
|
3014
|
+
businessCode = (_ref29 = (_params$businessCode = params.businessCode) !== null && _params$businessCode !== void 0 ? _params$businessCode : (_this$otherParams22 = this.otherParams) === null || _this$otherParams22 === void 0 ? void 0 : _this$otherParams22.businessCode) !== null && _ref29 !== void 0 ? _ref29 : (_this$otherParams23 = this.otherParams) === null || _this$otherParams23 === void 0 ? void 0 : _this$otherParams23.business_code;
|
|
3035
3015
|
channel = (_params$channel2 = params.channel) !== null && _params$channel2 !== void 0 ? _params$channel2 : this.getSubmitOrderSalesChannel();
|
|
3036
|
-
syncParams = _objectSpread(_objectSpread(_objectSpread({}, params),
|
|
3037
|
-
checkoutSyncTaskEnabled: this.shouldUseCheckoutSyncTask()
|
|
3038
|
-
}, businessCode !== undefined ? {
|
|
3016
|
+
syncParams = _objectSpread(_objectSpread(_objectSpread({}, params), businessCode !== undefined ? {
|
|
3039
3017
|
businessCode: businessCode
|
|
3040
3018
|
} : {}), channel !== undefined ? {
|
|
3041
3019
|
channel: channel
|
|
@@ -3290,7 +3268,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3290
3268
|
}, {
|
|
3291
3269
|
key: "addOrderPaymentWithDevicePrefix",
|
|
3292
3270
|
value: function addOrderPaymentWithDevicePrefix(payment, devicePrefix) {
|
|
3293
|
-
var _this$
|
|
3271
|
+
var _this$otherParams24,
|
|
3294
3272
|
_paymentRecord$paymen,
|
|
3295
3273
|
_paymentRecord$create,
|
|
3296
3274
|
_ref30,
|
|
@@ -3306,7 +3284,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3306
3284
|
return this.store.order.getOrderPayments();
|
|
3307
3285
|
}
|
|
3308
3286
|
var metadata = paymentRecord.metadata && _typeof(paymentRecord.metadata) === 'object' ? _objectSpread({}, paymentRecord.metadata) : {};
|
|
3309
|
-
var shopWalletPassId = (_this$
|
|
3287
|
+
var shopWalletPassId = (_this$otherParams24 = this.otherParams) === null || _this$otherParams24 === void 0 ? void 0 : _this$otherParams24.shop_wallet_pass_id;
|
|
3310
3288
|
if (shopWalletPassId !== undefined && shopWalletPassId !== null) {
|
|
3311
3289
|
metadata.shop_wallet_pass_id = shopWalletPassId;
|
|
3312
3290
|
}
|
|
@@ -4162,7 +4140,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4162
4140
|
key: "getCashPaymentConfig",
|
|
4163
4141
|
value: (function () {
|
|
4164
4142
|
var _getCashPaymentConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee45() {
|
|
4165
|
-
var _this$store$order11, _this$store$order11$g, _this$store$order12, _this$store$order12$g, _this$
|
|
4143
|
+
var _this$store$order11, _this$store$order11$g, _this$store$order12, _this$store$order12$g, _this$otherParams25;
|
|
4166
4144
|
var paymentMethods, paymentMethod, amountSnapshot, pendingWalletAmount, amountDue, currency, recommendedAmounts;
|
|
4167
4145
|
return _regeneratorRuntime().wrap(function _callee45$(_context45) {
|
|
4168
4146
|
while (1) switch (_context45.prev = _context45.next) {
|
|
@@ -4188,7 +4166,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4188
4166
|
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);
|
|
4189
4167
|
pendingWalletAmount = this.getPendingWalletPaymentAmount();
|
|
4190
4168
|
amountDue = Decimal.max(new Decimal((amountSnapshot === null || amountSnapshot === void 0 ? void 0 : amountSnapshot.amountGap) || 0).minus(pendingWalletAmount), 0).toDecimalPlaces(2).toNumber();
|
|
4191
|
-
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$
|
|
4169
|
+
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$otherParams25 = this.otherParams) === null || _this$otherParams25 === void 0 ? void 0 : _this$otherParams25.currency) || 'USD';
|
|
4192
4170
|
recommendedAmounts = amountDue > 0 ? this.store.payment.cash.getRecommendedAmount(amountDue, currency) : [];
|
|
4193
4171
|
return _context45.abrupt("return", {
|
|
4194
4172
|
available: Boolean(paymentMethod && amountDue > 0),
|
|
@@ -4323,7 +4301,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4323
4301
|
key: "payCash",
|
|
4324
4302
|
value: (function () {
|
|
4325
4303
|
var _payCash = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee47(params) {
|
|
4326
|
-
var _this$store$order$get6, _params$actualPaidAmo, _this$
|
|
4304
|
+
var _this$store$order$get6, _params$actualPaidAmo, _this$otherParams26, _this$window, _this$window$postMess;
|
|
4327
4305
|
var amount, config, paymentMethod, roundingAmount, effectivePaymentAmount, beforePayments, beforePaymentStatus, uniquePaymentNumber, paymentTimestamp, actualPaidAmount, changeAmount, shopWalletPassId, payments, payment, syncResult, committed, walletState, restoredTempOrder;
|
|
4328
4306
|
return _regeneratorRuntime().wrap(function _callee47$(_context47) {
|
|
4329
4307
|
while (1) switch (_context47.prev = _context47.next) {
|
|
@@ -4372,7 +4350,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4372
4350
|
paymentTimestamp = dayjs().format('YYYY-MM-DD HH:mm:ss');
|
|
4373
4351
|
actualPaidAmount = Number((_params$actualPaidAmo = params.actualPaidAmount) !== null && _params$actualPaidAmo !== void 0 ? _params$actualPaidAmo : amount);
|
|
4374
4352
|
changeAmount = Number(params.changeAmount || 0);
|
|
4375
|
-
shopWalletPassId = (_this$
|
|
4353
|
+
shopWalletPassId = (_this$otherParams26 = this.otherParams) === null || _this$otherParams26 === void 0 ? void 0 : _this$otherParams26.shop_wallet_pass_id;
|
|
4376
4354
|
if (!(!Number.isFinite(actualPaidAmount) || actualPaidAmount + 0.01 < amount)) {
|
|
4377
4355
|
_context47.next = 26;
|
|
4378
4356
|
break;
|
|
@@ -5275,13 +5253,13 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5275
5253
|
key: "getProductList",
|
|
5276
5254
|
value: function () {
|
|
5277
5255
|
var _getProductList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee62() {
|
|
5278
|
-
var _this$
|
|
5256
|
+
var _this$otherParams27;
|
|
5279
5257
|
var menu_list_ids, _this$store$products, res;
|
|
5280
5258
|
return _regeneratorRuntime().wrap(function _callee62$(_context62) {
|
|
5281
5259
|
while (1) switch (_context62.prev = _context62.next) {
|
|
5282
5260
|
case 0:
|
|
5283
5261
|
// 可以直接通过配置里的 menu 读取
|
|
5284
|
-
menu_list_ids = ((_this$
|
|
5262
|
+
menu_list_ids = ((_this$otherParams27 = this.otherParams) === null || _this$otherParams27 === void 0 || (_this$otherParams27 = _this$otherParams27.dineInConfig) === null || _this$otherParams27 === void 0 ? void 0 : _this$otherParams27['menu.associated_menus'].map(function (n) {
|
|
5285
5263
|
return Number(n.value);
|
|
5286
5264
|
})) || [];
|
|
5287
5265
|
_context62.prev = 1;
|
|
@@ -5319,7 +5297,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5319
5297
|
key: "setOtherParams",
|
|
5320
5298
|
value: function () {
|
|
5321
5299
|
var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee63(params) {
|
|
5322
|
-
var _this$
|
|
5300
|
+
var _this$otherParams28;
|
|
5323
5301
|
var _ref39,
|
|
5324
5302
|
_ref39$cover,
|
|
5325
5303
|
cover,
|
|
@@ -5333,7 +5311,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5333
5311
|
} else {
|
|
5334
5312
|
this.otherParams = _objectSpread(_objectSpread({}, this.otherParams), params);
|
|
5335
5313
|
}
|
|
5336
|
-
this.cacheId = (_this$
|
|
5314
|
+
this.cacheId = (_this$otherParams28 = this.otherParams) === null || _this$otherParams28 === void 0 ? void 0 : _this$otherParams28.cacheId;
|
|
5337
5315
|
_context63.next = 5;
|
|
5338
5316
|
return this.syncOtherParamsToSubModules(params, {
|
|
5339
5317
|
cover: cover
|
|
@@ -10,7 +10,6 @@ import { ITime } from '../../modules/Date/types';
|
|
|
10
10
|
import dayjs from 'dayjs';
|
|
11
11
|
import { LoadScheduleAvailableDateParams } from '../../modules/Schedule/types';
|
|
12
12
|
import { IHolder, IFetchHolderAccountsParams } from '../../modules/AccountList/types';
|
|
13
|
-
import { IAppendFormRecordParams } from '../../modules/Holder/types';
|
|
14
13
|
export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
15
14
|
protected defaultName: string;
|
|
16
15
|
protected defaultVersion: string;
|
|
@@ -127,20 +126,6 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
127
126
|
* @param params
|
|
128
127
|
*/
|
|
129
128
|
fetchHolderAccountsAsync(params: IFetchHolderAccountsParams): Promise<void>;
|
|
130
|
-
/**
|
|
131
|
-
* 获取 holder 表单 map
|
|
132
|
-
*/
|
|
133
|
-
getHolderFormMap(): import("../../modules").HolderFormMap;
|
|
134
|
-
/**
|
|
135
|
-
* 登录后或外部触发时,按当前 holderMap 批量刷新所有表单的 records
|
|
136
|
-
*/
|
|
137
|
-
refreshAllHolderFormRecords(params?: {
|
|
138
|
-
customer_id?: number;
|
|
139
|
-
}): Promise<import("../../modules").HolderFormMap>;
|
|
140
|
-
/**
|
|
141
|
-
* 添加表单记录
|
|
142
|
-
*/
|
|
143
|
-
appendFormRecord(params: IAppendFormRecordParams): import("../../modules").IFormRecord;
|
|
144
129
|
setDateRange(dateRange: ITime[]): Promise<void>;
|
|
145
130
|
clearDateRange(): void;
|
|
146
131
|
getDateRange(): Promise<ITime[]>;
|
|
@@ -317,7 +302,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
317
302
|
autoSelectAllProductResources(resources_code: string, timeSlots?: TimeSliceItem): {
|
|
318
303
|
errorList: any[];
|
|
319
304
|
};
|
|
320
|
-
getTimeSlotByAllResources(resources_code: string
|
|
305
|
+
getTimeSlotByAllResources(resources_code: string): any[];
|
|
321
306
|
getTimeSlotByAllResourcesForDate({ resources_code, startDate, endDate }: {
|
|
322
307
|
resources_code: string;
|
|
323
308
|
startDate: string;
|