@pisell/pisellos 2.3.49 → 2.3.51
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/modules/Discount/index.d.ts +1 -0
- package/dist/modules/Discount/index.js +40 -11
- package/dist/modules/Discount/types.d.ts +1 -0
- package/dist/modules/Holder/index.d.ts +48 -0
- package/dist/modules/Holder/index.js +640 -0
- package/dist/modules/Holder/types.d.ts +123 -0
- package/dist/modules/Holder/types.js +1 -0
- package/dist/modules/Holder/utils.d.ts +13 -0
- package/dist/modules/Holder/utils.js +34 -0
- package/dist/modules/OpenData/index.js +2 -2
- package/dist/modules/Order/index.d.ts +4 -2
- package/dist/modules/Order/index.js +54 -25
- package/dist/modules/Order/types.d.ts +9 -0
- package/dist/modules/Order/utils.d.ts +10 -0
- package/dist/modules/Order/utils.js +35 -3
- package/dist/modules/Product/types.d.ts +1 -0
- package/dist/modules/ProductList/index.js +33 -14
- package/dist/modules/Quotation/index.d.ts +1 -1
- package/dist/modules/Quotation/index.js +2 -2
- package/dist/modules/ResourcePlanner/index.d.ts +24 -0
- package/dist/modules/ResourcePlanner/index.js +181 -0
- package/dist/modules/ResourcePlanner/planner.d.ts +14 -0
- package/dist/modules/ResourcePlanner/planner.js +1069 -0
- package/dist/modules/ResourcePlanner/types.d.ts +227 -0
- package/dist/modules/ResourcePlanner/types.js +1 -0
- package/dist/modules/Rules/index.js +47 -13
- package/dist/modules/SalesSummary/index.js +12 -13
- package/dist/modules/ScanOrderLogger/index.d.ts +2 -0
- package/dist/modules/ScanOrderLogger/index.js +15 -2
- package/dist/modules/ScanOrderLogger/providers/feishu.js +45 -27
- package/dist/modules/ScanOrderLogger/types.d.ts +1 -0
- package/dist/modules/Schedule/index.d.ts +3 -1
- package/dist/modules/Schedule/index.js +21 -16
- package/dist/modules/Summary/utils.js +38 -13
- package/dist/modules/index.d.ts +2 -0
- package/dist/modules/index.js +3 -1
- package/dist/plugins/window.d.ts +1 -0
- package/dist/server/index.d.ts +14 -0
- package/dist/server/index.js +907 -793
- package/dist/solution/BaseSales/index.d.ts +7 -0
- package/dist/solution/BaseSales/index.js +64 -42
- package/dist/solution/BookingByStep/index.d.ts +17 -2
- package/dist/solution/BookingByStep/index.js +294 -215
- package/dist/solution/BookingByStep/types.d.ts +2 -1
- package/dist/solution/BookingByStep/types.js +3 -1
- package/dist/solution/BookingByStep/utils/capacity.js +17 -1
- package/dist/solution/BookingByStep/utils/timeslots.d.ts +3 -1
- package/dist/solution/BookingByStep/utils/timeslots.js +19 -12
- package/dist/solution/BookingTicket/index.js +2 -2
- package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +3 -1
- package/dist/solution/BookingTicket/utils/scan/handleScan.js +10 -2
- package/dist/solution/ScanOrder/index.d.ts +26 -14
- package/dist/solution/ScanOrder/index.js +1142 -739
- package/dist/solution/ScanOrder/types.d.ts +21 -1
- package/dist/solution/ScanOrder/utils.d.ts +8 -0
- package/dist/solution/ScanOrder/utils.js +66 -25
- package/dist/solution/ShopDiscount/index.d.ts +1 -0
- package/dist/solution/ShopDiscount/index.js +125 -87
- package/dist/solution/UnifiedBookingSales/index.d.ts +183 -0
- package/dist/solution/UnifiedBookingSales/index.js +1891 -0
- package/dist/solution/UnifiedBookingSales/types.d.ts +143 -0
- package/dist/solution/UnifiedBookingSales/types.js +11 -0
- package/dist/solution/VenueBooking/index.d.ts +39 -11
- package/dist/solution/VenueBooking/index.js +1167 -841
- package/dist/solution/VenueBooking/types.d.ts +3 -0
- package/dist/solution/VenueBooking/utils/resource.js +1 -0
- package/dist/solution/VenueBooking/utils/slotMerge.d.ts +4 -4
- package/dist/solution/VenueBooking/utils/slotMerge.js +10 -5
- package/dist/solution/index.d.ts +1 -0
- package/dist/solution/index.js +2 -1
- package/dist/types/index.d.ts +1 -0
- package/lib/model/strategy/adapter/promotion/index.js +51 -0
- package/lib/modules/Discount/index.d.ts +1 -0
- package/lib/modules/Discount/index.js +9 -0
- package/lib/modules/Discount/types.d.ts +1 -0
- package/lib/modules/Holder/index.d.ts +48 -0
- package/lib/modules/Holder/index.js +402 -0
- package/lib/modules/Holder/types.d.ts +123 -0
- package/lib/modules/Holder/types.js +17 -0
- package/lib/modules/Holder/utils.d.ts +13 -0
- package/lib/modules/Holder/utils.js +71 -0
- package/lib/modules/OpenData/index.js +1 -1
- package/lib/modules/Order/index.d.ts +4 -2
- package/lib/modules/Order/index.js +26 -10
- package/lib/modules/Order/types.d.ts +9 -0
- package/lib/modules/Order/utils.d.ts +10 -0
- package/lib/modules/Order/utils.js +36 -5
- package/lib/modules/Product/types.d.ts +1 -0
- package/lib/modules/ProductList/index.js +40 -31
- package/lib/modules/Quotation/index.d.ts +1 -1
- package/lib/modules/Quotation/index.js +2 -2
- package/lib/modules/ResourcePlanner/index.d.ts +24 -0
- package/lib/modules/ResourcePlanner/index.js +148 -0
- package/lib/modules/ResourcePlanner/planner.d.ts +14 -0
- package/lib/modules/ResourcePlanner/planner.js +933 -0
- package/lib/modules/ResourcePlanner/types.d.ts +227 -0
- package/lib/modules/ResourcePlanner/types.js +17 -0
- package/lib/modules/Rules/index.js +33 -16
- package/lib/modules/SalesSummary/index.js +6 -7
- package/lib/modules/ScanOrderLogger/index.d.ts +2 -0
- package/lib/modules/ScanOrderLogger/index.js +13 -1
- package/lib/modules/ScanOrderLogger/providers/feishu.js +15 -6
- package/lib/modules/ScanOrderLogger/types.d.ts +1 -0
- package/lib/modules/Schedule/index.d.ts +3 -1
- package/lib/modules/Schedule/index.js +10 -8
- package/lib/modules/Summary/utils.js +21 -1
- package/lib/modules/index.d.ts +2 -0
- package/lib/modules/index.js +5 -1
- package/lib/plugins/window.d.ts +1 -0
- package/lib/server/index.d.ts +14 -0
- package/lib/server/index.js +72 -15
- package/lib/solution/BaseSales/index.d.ts +7 -0
- package/lib/solution/BaseSales/index.js +24 -8
- package/lib/solution/BookingByStep/index.d.ts +17 -2
- package/lib/solution/BookingByStep/index.js +60 -18
- package/lib/solution/BookingByStep/types.d.ts +2 -1
- package/lib/solution/BookingByStep/types.js +5 -0
- package/lib/solution/BookingByStep/utils/capacity.js +20 -1
- package/lib/solution/BookingByStep/utils/timeslots.d.ts +3 -1
- package/lib/solution/BookingByStep/utils/timeslots.js +19 -11
- package/lib/solution/BookingTicket/index.js +10 -2
- package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +3 -1
- package/lib/solution/BookingTicket/utils/scan/handleScan.js +2 -2
- package/lib/solution/ScanOrder/index.d.ts +26 -14
- package/lib/solution/ScanOrder/index.js +449 -182
- package/lib/solution/ScanOrder/types.d.ts +21 -1
- package/lib/solution/ScanOrder/utils.d.ts +8 -0
- package/lib/solution/ScanOrder/utils.js +31 -0
- package/lib/solution/ShopDiscount/index.d.ts +1 -0
- package/lib/solution/ShopDiscount/index.js +14 -0
- package/lib/solution/UnifiedBookingSales/index.d.ts +183 -0
- package/lib/solution/UnifiedBookingSales/index.js +1084 -0
- package/lib/solution/UnifiedBookingSales/types.d.ts +143 -0
- package/lib/solution/UnifiedBookingSales/types.js +33 -0
- package/lib/solution/VenueBooking/index.d.ts +39 -11
- package/lib/solution/VenueBooking/index.js +322 -110
- package/lib/solution/VenueBooking/types.d.ts +3 -0
- package/lib/solution/VenueBooking/utils/resource.js +1 -0
- package/lib/solution/VenueBooking/utils/slotMerge.d.ts +4 -4
- package/lib/solution/VenueBooking/utils/slotMerge.js +6 -4
- package/lib/solution/index.d.ts +1 -0
- package/lib/solution/index.js +3 -1
- package/lib/types/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -280,6 +280,13 @@ 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;
|
|
283
290
|
printLocalOrderReceipt<T = any>(lookup?: BaseSalesPrintLocalOrderReceiptParams): Promise<T>;
|
|
284
291
|
private getSubmitPaymentStatus;
|
|
285
292
|
syncPaymentsToOrder<T = any>(params: SyncPaymentsToOrderParams): Promise<SyncPaymentsToOrderResult<T>>;
|
|
@@ -1312,6 +1312,8 @@ 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,
|
|
1315
1317
|
_this9 = this,
|
|
1316
1318
|
_this$otherParams5;
|
|
1317
1319
|
var options,
|
|
@@ -1335,14 +1337,11 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1335
1337
|
|
|
1336
1338
|
// 获取 logger 实例
|
|
1337
1339
|
this.appPlugin = core.getPlugin('app');
|
|
1338
|
-
if (this.appPlugin) {
|
|
1339
|
-
|
|
1340
|
-
break;
|
|
1340
|
+
if (!this.appPlugin) {
|
|
1341
|
+
// throw new Error('Checkout 解决方案需要 app 插件支持');
|
|
1341
1342
|
}
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
app = this.appPlugin.getApp();
|
|
1345
|
-
this.logger = app.logger;
|
|
1343
|
+
app = (_this$appPlugin2 = this.appPlugin) === null || _this$appPlugin2 === void 0 || (_this$appPlugin2$getA = _this$appPlugin2.getApp) === null || _this$appPlugin2$getA === void 0 ? void 0 : _this$appPlugin2$getA.call(_this$appPlugin2);
|
|
1344
|
+
this.logger = app === null || app === void 0 ? void 0 : app.logger;
|
|
1346
1345
|
targetCacheData = this.readSessionCacheData();
|
|
1347
1346
|
moduleNames = this.getRegisteredModuleNames();
|
|
1348
1347
|
moduleNames.forEach(function (step) {
|
|
@@ -1367,21 +1366,21 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1367
1366
|
}));
|
|
1368
1367
|
});
|
|
1369
1368
|
if (!(this.store.schedule && !this.isScheduleListLoaded(this.store.schedule))) {
|
|
1370
|
-
_context11.next =
|
|
1369
|
+
_context11.next = 19;
|
|
1371
1370
|
break;
|
|
1372
1371
|
}
|
|
1373
|
-
_context11.next =
|
|
1372
|
+
_context11.next = 19;
|
|
1374
1373
|
return this.store.schedule.loadAllSchedule();
|
|
1375
|
-
case
|
|
1374
|
+
case 19:
|
|
1376
1375
|
if (this.store.order && typeof ((_this$otherParams5 = this.otherParams) === null || _this$otherParams5 === void 0 ? void 0 : _this$otherParams5.enableTempOrderPersist) === 'boolean') {
|
|
1377
1376
|
this.store.order.setEnableTempOrderPersist(this.otherParams.enableTempOrderPersist);
|
|
1378
1377
|
}
|
|
1379
|
-
_context11.next =
|
|
1378
|
+
_context11.next = 22;
|
|
1380
1379
|
return this.getPaymentMethodsAsync();
|
|
1381
|
-
case
|
|
1380
|
+
case 22:
|
|
1382
1381
|
this.registerServerOrderChangeSync();
|
|
1383
1382
|
this.core.effects.emit("".concat(this.name, ":onInited"), {});
|
|
1384
|
-
case
|
|
1383
|
+
case 24:
|
|
1385
1384
|
case "end":
|
|
1386
1385
|
return _context11.stop();
|
|
1387
1386
|
}
|
|
@@ -2794,8 +2793,8 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2794
2793
|
key: "submitSalesOrder",
|
|
2795
2794
|
value: (function () {
|
|
2796
2795
|
var _submitSalesOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(params) {
|
|
2797
|
-
var _this$otherParams6, _this$otherParams7, _this$otherParams8, _this$otherParams9;
|
|
2798
|
-
var inferredPaymentStatus, submitParams;
|
|
2796
|
+
var _params$smallTicketDa, _this$otherParams6, _this$otherParams7, _this$otherParams8, _this$otherParams9;
|
|
2797
|
+
var inferredPaymentStatus, smallTicketDataFlag, submitParams;
|
|
2799
2798
|
return _regeneratorRuntime().wrap(function _callee27$(_context27) {
|
|
2800
2799
|
while (1) switch (_context27.prev = _context27.next) {
|
|
2801
2800
|
case 0:
|
|
@@ -2807,6 +2806,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2807
2806
|
case 2:
|
|
2808
2807
|
// this.store.order.persistTempOrder();
|
|
2809
2808
|
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
|
-
} : {}),
|
|
2822
|
-
smallTicketDataFlag:
|
|
2821
|
+
} : {}), smallTicketDataFlag !== undefined ? {
|
|
2822
|
+
smallTicketDataFlag: 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.store.order.submitTempOrder(submitParams));
|
|
2829
|
-
case
|
|
2828
|
+
return _context27.abrupt("return", this.shouldUseCheckoutSyncTask() ? this.store.order.submitTempOrder(submitParams) : this.store.order.submitTempOrderAsync(submitParams));
|
|
2829
|
+
case 6:
|
|
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 _this$otherParams14, _this$otherParams15, _this$otherParams16, _this$otherParams17;
|
|
2879
|
-
var inferredPaymentStatus, submitParams;
|
|
2878
|
+
var _params$smallTicketDa2, _this$otherParams14, _this$otherParams15, _this$otherParams16, _this$otherParams17;
|
|
2879
|
+
var inferredPaymentStatus, smallTicketDataFlag, submitParams;
|
|
2880
2880
|
return _regeneratorRuntime().wrap(function _callee29$(_context29) {
|
|
2881
2881
|
while (1) switch (_context29.prev = _context29.next) {
|
|
2882
2882
|
case 0:
|
|
@@ -2887,25 +2887,27 @@ 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();
|
|
2890
2891
|
submitParams = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
2891
2892
|
cacheId: this.cacheId,
|
|
2892
2893
|
platform: (_this$otherParams14 = this.otherParams) === null || _this$otherParams14 === void 0 ? void 0 : _this$otherParams14.platform,
|
|
2893
2894
|
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),
|
|
2894
2895
|
channel: this.getSubmitOrderSalesChannel(),
|
|
2895
|
-
type: (_this$otherParams17 = this.otherParams) === null || _this$otherParams17 === void 0 ? void 0 : _this$otherParams17.type
|
|
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()
|
|
2896
2898
|
}, (params === null || params === void 0 ? void 0 : params.payments) !== undefined ? {
|
|
2897
2899
|
payments: params.payments
|
|
2898
2900
|
} : {}), inferredPaymentStatus !== undefined ? {
|
|
2899
2901
|
paymentStatus: inferredPaymentStatus
|
|
2900
|
-
} : {}),
|
|
2901
|
-
smallTicketDataFlag:
|
|
2902
|
+
} : {}), smallTicketDataFlag !== undefined ? {
|
|
2903
|
+
smallTicketDataFlag: smallTicketDataFlag
|
|
2902
2904
|
} : {}), (params === null || params === void 0 ? void 0 : params.confirmPendingVoucherPayments) !== undefined ? {
|
|
2903
2905
|
confirmPendingVoucherPayments: params.confirmPendingVoucherPayments
|
|
2904
2906
|
} : {}), (params === null || params === void 0 ? void 0 : params.enhancePayload) !== undefined ? {
|
|
2905
2907
|
enhancePayload: params.enhancePayload
|
|
2906
2908
|
} : {});
|
|
2907
2909
|
return _context29.abrupt("return", this.store.order.submitTempOrderAsync(submitParams));
|
|
2908
|
-
case
|
|
2910
|
+
case 6:
|
|
2909
2911
|
case "end":
|
|
2910
2912
|
return _context29.stop();
|
|
2911
2913
|
}
|
|
@@ -2916,11 +2918,29 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2916
2918
|
}
|
|
2917
2919
|
return submitTempOrderAsync;
|
|
2918
2920
|
}()
|
|
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
|
+
}
|
|
2919
2939
|
}, {
|
|
2920
2940
|
key: "printLocalOrderReceipt",
|
|
2921
2941
|
value: function () {
|
|
2922
2942
|
var _printLocalOrderReceipt = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30(lookup) {
|
|
2923
|
-
var _this$
|
|
2943
|
+
var _this$otherParams19, _this$otherParams20, _this$otherParams21, _this$otherParams22;
|
|
2924
2944
|
var hasLookup, lookupPayload, context, payload, response, _this$store$order$app, _this$store$order5, _data;
|
|
2925
2945
|
return _regeneratorRuntime().wrap(function _callee30$(_context30) {
|
|
2926
2946
|
while (1) switch (_context30.prev = _context30.next) {
|
|
@@ -2938,10 +2958,10 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2938
2958
|
external_sale_number: lookup
|
|
2939
2959
|
};
|
|
2940
2960
|
context = {
|
|
2941
|
-
platform: (_this$
|
|
2942
|
-
businessCode: ((_this$
|
|
2961
|
+
platform: (_this$otherParams19 = this.otherParams) === null || _this$otherParams19 === void 0 ? void 0 : _this$otherParams19.platform,
|
|
2962
|
+
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),
|
|
2943
2963
|
channel: this.getSubmitOrderSalesChannel(),
|
|
2944
|
-
type: (_this$
|
|
2964
|
+
type: (_this$otherParams22 = this.otherParams) === null || _this$otherParams22 === void 0 ? void 0 : _this$otherParams22.type
|
|
2945
2965
|
};
|
|
2946
2966
|
payload = hasLookup ? _objectSpread(_objectSpread({}, lookupPayload), {}, {
|
|
2947
2967
|
lookup_order_from_db: 1,
|
|
@@ -3000,7 +3020,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3000
3020
|
key: "syncPaymentsToOrder",
|
|
3001
3021
|
value: function () {
|
|
3002
3022
|
var _syncPaymentsToOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31(params) {
|
|
3003
|
-
var _ref29, _params$businessCode, _this$
|
|
3023
|
+
var _ref29, _params$businessCode, _this$otherParams23, _this$otherParams24, _params$channel2;
|
|
3004
3024
|
var businessCode, channel, syncParams, syncState, payments, syncResult, latestPayments, amountSnapshot, orderSnapshot, syncPayload;
|
|
3005
3025
|
return _regeneratorRuntime().wrap(function _callee31$(_context31) {
|
|
3006
3026
|
while (1) switch (_context31.prev = _context31.next) {
|
|
@@ -3011,9 +3031,11 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3011
3031
|
}
|
|
3012
3032
|
throw new Error('order 模块未初始化');
|
|
3013
3033
|
case 2:
|
|
3014
|
-
businessCode = (_ref29 = (_params$businessCode = params.businessCode) !== null && _params$businessCode !== void 0 ? _params$businessCode : (_this$
|
|
3034
|
+
businessCode = (_ref29 = (_params$businessCode = params.businessCode) !== null && _params$businessCode !== void 0 ? _params$businessCode : (_this$otherParams23 = this.otherParams) === null || _this$otherParams23 === void 0 ? void 0 : _this$otherParams23.businessCode) !== null && _ref29 !== void 0 ? _ref29 : (_this$otherParams24 = this.otherParams) === null || _this$otherParams24 === void 0 ? void 0 : _this$otherParams24.business_code;
|
|
3015
3035
|
channel = (_params$channel2 = params.channel) !== null && _params$channel2 !== void 0 ? _params$channel2 : this.getSubmitOrderSalesChannel();
|
|
3016
|
-
syncParams = _objectSpread(_objectSpread(_objectSpread({}, params),
|
|
3036
|
+
syncParams = _objectSpread(_objectSpread(_objectSpread({}, params), {}, {
|
|
3037
|
+
checkoutSyncTaskEnabled: this.shouldUseCheckoutSyncTask()
|
|
3038
|
+
}, businessCode !== undefined ? {
|
|
3017
3039
|
businessCode: businessCode
|
|
3018
3040
|
} : {}), channel !== undefined ? {
|
|
3019
3041
|
channel: channel
|
|
@@ -3268,7 +3290,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3268
3290
|
}, {
|
|
3269
3291
|
key: "addOrderPaymentWithDevicePrefix",
|
|
3270
3292
|
value: function addOrderPaymentWithDevicePrefix(payment, devicePrefix) {
|
|
3271
|
-
var _this$
|
|
3293
|
+
var _this$otherParams25,
|
|
3272
3294
|
_paymentRecord$paymen,
|
|
3273
3295
|
_paymentRecord$create,
|
|
3274
3296
|
_ref30,
|
|
@@ -3284,7 +3306,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3284
3306
|
return this.store.order.getOrderPayments();
|
|
3285
3307
|
}
|
|
3286
3308
|
var metadata = paymentRecord.metadata && _typeof(paymentRecord.metadata) === 'object' ? _objectSpread({}, paymentRecord.metadata) : {};
|
|
3287
|
-
var shopWalletPassId = (_this$
|
|
3309
|
+
var shopWalletPassId = (_this$otherParams25 = this.otherParams) === null || _this$otherParams25 === void 0 ? void 0 : _this$otherParams25.shop_wallet_pass_id;
|
|
3288
3310
|
if (shopWalletPassId !== undefined && shopWalletPassId !== null) {
|
|
3289
3311
|
metadata.shop_wallet_pass_id = shopWalletPassId;
|
|
3290
3312
|
}
|
|
@@ -4148,7 +4170,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4148
4170
|
key: "getCashPaymentConfig",
|
|
4149
4171
|
value: (function () {
|
|
4150
4172
|
var _getCashPaymentConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee45() {
|
|
4151
|
-
var _this$store$order11, _this$store$order11$g, _this$store$order12, _this$store$order12$g, _this$
|
|
4173
|
+
var _this$store$order11, _this$store$order11$g, _this$store$order12, _this$store$order12$g, _this$otherParams26;
|
|
4152
4174
|
var paymentMethods, paymentMethod, amountSnapshot, pendingWalletAmount, amountDue, currency, recommendedAmounts;
|
|
4153
4175
|
return _regeneratorRuntime().wrap(function _callee45$(_context45) {
|
|
4154
4176
|
while (1) switch (_context45.prev = _context45.next) {
|
|
@@ -4174,7 +4196,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4174
4196
|
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);
|
|
4175
4197
|
pendingWalletAmount = this.getPendingWalletPaymentAmount();
|
|
4176
4198
|
amountDue = Decimal.max(new Decimal((amountSnapshot === null || amountSnapshot === void 0 ? void 0 : amountSnapshot.amountGap) || 0).minus(pendingWalletAmount), 0).toDecimalPlaces(2).toNumber();
|
|
4177
|
-
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$
|
|
4199
|
+
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$otherParams26 = this.otherParams) === null || _this$otherParams26 === void 0 ? void 0 : _this$otherParams26.currency) || 'USD';
|
|
4178
4200
|
recommendedAmounts = amountDue > 0 ? this.store.payment.cash.getRecommendedAmount(amountDue, currency) : [];
|
|
4179
4201
|
return _context45.abrupt("return", {
|
|
4180
4202
|
available: Boolean(paymentMethod && amountDue > 0),
|
|
@@ -4309,7 +4331,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4309
4331
|
key: "payCash",
|
|
4310
4332
|
value: (function () {
|
|
4311
4333
|
var _payCash = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee47(params) {
|
|
4312
|
-
var _this$store$order$get6, _params$actualPaidAmo, _this$
|
|
4334
|
+
var _this$store$order$get6, _params$actualPaidAmo, _this$otherParams27, _this$window, _this$window$postMess;
|
|
4313
4335
|
var amount, config, paymentMethod, roundingAmount, effectivePaymentAmount, beforePayments, beforePaymentStatus, uniquePaymentNumber, paymentTimestamp, actualPaidAmount, changeAmount, shopWalletPassId, payments, payment, syncResult, committed, walletState, restoredTempOrder;
|
|
4314
4336
|
return _regeneratorRuntime().wrap(function _callee47$(_context47) {
|
|
4315
4337
|
while (1) switch (_context47.prev = _context47.next) {
|
|
@@ -4358,7 +4380,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4358
4380
|
paymentTimestamp = dayjs().format('YYYY-MM-DD HH:mm:ss');
|
|
4359
4381
|
actualPaidAmount = Number((_params$actualPaidAmo = params.actualPaidAmount) !== null && _params$actualPaidAmo !== void 0 ? _params$actualPaidAmo : amount);
|
|
4360
4382
|
changeAmount = Number(params.changeAmount || 0);
|
|
4361
|
-
shopWalletPassId = (_this$
|
|
4383
|
+
shopWalletPassId = (_this$otherParams27 = this.otherParams) === null || _this$otherParams27 === void 0 ? void 0 : _this$otherParams27.shop_wallet_pass_id;
|
|
4362
4384
|
if (!(!Number.isFinite(actualPaidAmount) || actualPaidAmount + 0.01 < amount)) {
|
|
4363
4385
|
_context47.next = 26;
|
|
4364
4386
|
break;
|
|
@@ -5261,13 +5283,13 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5261
5283
|
key: "getProductList",
|
|
5262
5284
|
value: function () {
|
|
5263
5285
|
var _getProductList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee62() {
|
|
5264
|
-
var _this$
|
|
5286
|
+
var _this$otherParams28;
|
|
5265
5287
|
var menu_list_ids, _this$store$products, res;
|
|
5266
5288
|
return _regeneratorRuntime().wrap(function _callee62$(_context62) {
|
|
5267
5289
|
while (1) switch (_context62.prev = _context62.next) {
|
|
5268
5290
|
case 0:
|
|
5269
5291
|
// 可以直接通过配置里的 menu 读取
|
|
5270
|
-
menu_list_ids = ((_this$
|
|
5292
|
+
menu_list_ids = ((_this$otherParams28 = this.otherParams) === null || _this$otherParams28 === void 0 || (_this$otherParams28 = _this$otherParams28.dineInConfig) === null || _this$otherParams28 === void 0 ? void 0 : _this$otherParams28['menu.associated_menus'].map(function (n) {
|
|
5271
5293
|
return Number(n.value);
|
|
5272
5294
|
})) || [];
|
|
5273
5295
|
_context62.prev = 1;
|
|
@@ -5305,7 +5327,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5305
5327
|
key: "setOtherParams",
|
|
5306
5328
|
value: function () {
|
|
5307
5329
|
var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee63(params) {
|
|
5308
|
-
var _this$
|
|
5330
|
+
var _this$otherParams29;
|
|
5309
5331
|
var _ref39,
|
|
5310
5332
|
_ref39$cover,
|
|
5311
5333
|
cover,
|
|
@@ -5319,7 +5341,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5319
5341
|
} else {
|
|
5320
5342
|
this.otherParams = _objectSpread(_objectSpread({}, this.otherParams), params);
|
|
5321
5343
|
}
|
|
5322
|
-
this.cacheId = (_this$
|
|
5344
|
+
this.cacheId = (_this$otherParams29 = this.otherParams) === null || _this$otherParams29 === void 0 ? void 0 : _this$otherParams29.cacheId;
|
|
5323
5345
|
_context63.next = 5;
|
|
5324
5346
|
return this.syncOtherParamsToSubModules(params, {
|
|
5325
5347
|
cover: cover
|
|
@@ -10,6 +10,7 @@ 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';
|
|
13
14
|
export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
14
15
|
protected defaultName: string;
|
|
15
16
|
protected defaultVersion: string;
|
|
@@ -126,6 +127,20 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
126
127
|
* @param params
|
|
127
128
|
*/
|
|
128
129
|
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;
|
|
129
144
|
setDateRange(dateRange: ITime[]): Promise<void>;
|
|
130
145
|
clearDateRange(): void;
|
|
131
146
|
getDateRange(): Promise<ITime[]>;
|
|
@@ -302,7 +317,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
302
317
|
autoSelectAllProductResources(resources_code: string, timeSlots?: TimeSliceItem): {
|
|
303
318
|
errorList: any[];
|
|
304
319
|
};
|
|
305
|
-
getTimeSlotByAllResources(resources_code: string): any[];
|
|
320
|
+
getTimeSlotByAllResources(resources_code: string, split?: number): any[];
|
|
306
321
|
getTimeSlotByAllResourcesForDate({ resources_code, startDate, endDate }: {
|
|
307
322
|
resources_code: string;
|
|
308
323
|
startDate: string;
|
|
@@ -311,7 +326,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
311
326
|
date: string;
|
|
312
327
|
status: string;
|
|
313
328
|
week: string;
|
|
314
|
-
weekNum: 0 |
|
|
329
|
+
weekNum: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
315
330
|
}[]>;
|
|
316
331
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
317
332
|
private getScheduleDataByIds;
|