@pisell/pisellos 2.3.53 → 2.3.55
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 +9 -0
- 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 +66 -34
- 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 +34 -15
- 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/BaseSales/utils/cartPromotion.js +4 -1
- 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.d.ts +14 -2
- 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 +179 -0
- package/dist/solution/UnifiedBookingSales/index.js +1892 -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 +30 -13
- 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 +48 -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/BaseSales/utils/cartPromotion.js +3 -0
- 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.d.ts +14 -2
- 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 +179 -0
- package/lib/solution/UnifiedBookingSales/index.js +1085 -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
|
@@ -290,6 +290,13 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
290
290
|
confirmPendingVoucherPayments?: boolean;
|
|
291
291
|
enhancePayload?: SubmitPayloadEnhancer;
|
|
292
292
|
}): Promise<T>;
|
|
293
|
+
/**
|
|
294
|
+
* 默认保持 WebPOS 的本地待同步订单模式;需要云端确认后才算成功的渠道可覆盖此策略。
|
|
295
|
+
* otherParams.checkoutSyncTaskEnabled 优先,便于同一 solution 按入口恢复旧行为。
|
|
296
|
+
*/
|
|
297
|
+
protected shouldUseCheckoutSyncTask(): boolean;
|
|
298
|
+
/** 可由特定 solution 为真实 checkout 补充默认收据数据请求。 */
|
|
299
|
+
protected getDefaultCheckoutSmallTicketDataFlag(): number | undefined;
|
|
293
300
|
printLocalOrderReceipt<T = any>(lookup?: BaseSalesPrintLocalOrderReceiptParams): Promise<T>;
|
|
294
301
|
private getSubmitPaymentStatus;
|
|
295
302
|
syncPaymentsToOrder<T = any>(params: SyncPaymentsToOrderParams): Promise<SyncPaymentsToOrderResult<T>>;
|
|
@@ -1350,6 +1350,8 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1350
1350
|
value: function () {
|
|
1351
1351
|
var _initialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(core) {
|
|
1352
1352
|
var _this$otherParams9,
|
|
1353
|
+
_this$appPlugin2,
|
|
1354
|
+
_this$appPlugin2$getA,
|
|
1353
1355
|
_this9 = this,
|
|
1354
1356
|
_this$otherParams10;
|
|
1355
1357
|
var options,
|
|
@@ -1373,14 +1375,11 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1373
1375
|
|
|
1374
1376
|
// 获取 logger 实例
|
|
1375
1377
|
this.appPlugin = core.getPlugin('app');
|
|
1376
|
-
if (this.appPlugin) {
|
|
1377
|
-
|
|
1378
|
-
break;
|
|
1378
|
+
if (!this.appPlugin) {
|
|
1379
|
+
// throw new Error('Checkout 解决方案需要 app 插件支持');
|
|
1379
1380
|
}
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
app = this.appPlugin.getApp();
|
|
1383
|
-
this.logger = app.logger;
|
|
1381
|
+
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);
|
|
1382
|
+
this.logger = app === null || app === void 0 ? void 0 : app.logger;
|
|
1384
1383
|
targetCacheData = this.readSessionCacheData();
|
|
1385
1384
|
moduleNames = this.getRegisteredModuleNames();
|
|
1386
1385
|
moduleNames.forEach(function (step) {
|
|
@@ -1405,21 +1404,21 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1405
1404
|
}));
|
|
1406
1405
|
});
|
|
1407
1406
|
if (!(this.store.schedule && !this.isScheduleListLoaded(this.store.schedule))) {
|
|
1408
|
-
_context11.next =
|
|
1407
|
+
_context11.next = 19;
|
|
1409
1408
|
break;
|
|
1410
1409
|
}
|
|
1411
|
-
_context11.next =
|
|
1410
|
+
_context11.next = 19;
|
|
1412
1411
|
return this.store.schedule.loadAllSchedule();
|
|
1413
|
-
case
|
|
1412
|
+
case 19:
|
|
1414
1413
|
if (this.store.order && typeof ((_this$otherParams10 = this.otherParams) === null || _this$otherParams10 === void 0 ? void 0 : _this$otherParams10.enableTempOrderPersist) === 'boolean') {
|
|
1415
1414
|
this.store.order.setEnableTempOrderPersist(this.otherParams.enableTempOrderPersist);
|
|
1416
1415
|
}
|
|
1417
|
-
_context11.next =
|
|
1416
|
+
_context11.next = 22;
|
|
1418
1417
|
return this.getPaymentMethodsAsync();
|
|
1419
|
-
case
|
|
1418
|
+
case 22:
|
|
1420
1419
|
this.registerServerOrderChangeSync();
|
|
1421
1420
|
this.core.effects.emit("".concat(this.name, ":onInited"), {});
|
|
1422
|
-
case
|
|
1421
|
+
case 24:
|
|
1423
1422
|
case "end":
|
|
1424
1423
|
return _context11.stop();
|
|
1425
1424
|
}
|
|
@@ -2832,8 +2831,8 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2832
2831
|
key: "submitSalesOrder",
|
|
2833
2832
|
value: (function () {
|
|
2834
2833
|
var _submitSalesOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(params) {
|
|
2835
|
-
var _this$otherParams11, _this$otherParams12, _this$otherParams13, _this$otherParams14;
|
|
2836
|
-
var inferredPaymentStatus, submitParams;
|
|
2834
|
+
var _params$smallTicketDa, _this$otherParams11, _this$otherParams12, _this$otherParams13, _this$otherParams14;
|
|
2835
|
+
var inferredPaymentStatus, smallTicketDataFlag, submitParams;
|
|
2837
2836
|
return _regeneratorRuntime().wrap(function _callee27$(_context27) {
|
|
2838
2837
|
while (1) switch (_context27.prev = _context27.next) {
|
|
2839
2838
|
case 0:
|
|
@@ -2845,6 +2844,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2845
2844
|
case 2:
|
|
2846
2845
|
// this.store.order.persistTempOrder();
|
|
2847
2846
|
inferredPaymentStatus = this.getSubmitPaymentStatus(params === null || params === void 0 ? void 0 : params.paymentStatus);
|
|
2847
|
+
smallTicketDataFlag = (_params$smallTicketDa = params === null || params === void 0 ? void 0 : params.smallTicketDataFlag) !== null && _params$smallTicketDa !== void 0 ? _params$smallTicketDa : this.getDefaultCheckoutSmallTicketDataFlag();
|
|
2848
2848
|
submitParams = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
2849
2849
|
cacheId: this.cacheId,
|
|
2850
2850
|
platform: (_this$otherParams11 = this.otherParams) === null || _this$otherParams11 === void 0 ? void 0 : _this$otherParams11.platform,
|
|
@@ -2856,15 +2856,15 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2856
2856
|
payments: params.payments
|
|
2857
2857
|
} : {}), inferredPaymentStatus !== undefined ? {
|
|
2858
2858
|
paymentStatus: inferredPaymentStatus
|
|
2859
|
-
} : {}),
|
|
2860
|
-
smallTicketDataFlag:
|
|
2859
|
+
} : {}), smallTicketDataFlag !== undefined ? {
|
|
2860
|
+
smallTicketDataFlag: smallTicketDataFlag
|
|
2861
2861
|
} : {}), (params === null || params === void 0 ? void 0 : params.confirmPendingVoucherPayments) !== undefined ? {
|
|
2862
2862
|
confirmPendingVoucherPayments: params.confirmPendingVoucherPayments
|
|
2863
2863
|
} : {}), (params === null || params === void 0 ? void 0 : params.enhancePayload) !== undefined ? {
|
|
2864
2864
|
enhancePayload: params.enhancePayload
|
|
2865
2865
|
} : {});
|
|
2866
|
-
return _context27.abrupt("return", this.store.order.submitTempOrder(submitParams));
|
|
2867
|
-
case
|
|
2866
|
+
return _context27.abrupt("return", this.shouldUseCheckoutSyncTask() ? this.store.order.submitTempOrder(submitParams) : this.store.order.submitTempOrderAsync(submitParams));
|
|
2867
|
+
case 6:
|
|
2868
2868
|
case "end":
|
|
2869
2869
|
return _context27.stop();
|
|
2870
2870
|
}
|
|
@@ -2913,8 +2913,8 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2913
2913
|
key: "submitTempOrderAsync",
|
|
2914
2914
|
value: function () {
|
|
2915
2915
|
var _submitTempOrderAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29(params) {
|
|
2916
|
-
var _this$otherParams19, _this$otherParams20, _this$otherParams21, _this$otherParams22;
|
|
2917
|
-
var inferredPaymentStatus, submitParams;
|
|
2916
|
+
var _params$smallTicketDa2, _this$otherParams19, _this$otherParams20, _this$otherParams21, _this$otherParams22;
|
|
2917
|
+
var inferredPaymentStatus, smallTicketDataFlag, submitParams;
|
|
2918
2918
|
return _regeneratorRuntime().wrap(function _callee29$(_context29) {
|
|
2919
2919
|
while (1) switch (_context29.prev = _context29.next) {
|
|
2920
2920
|
case 0:
|
|
@@ -2925,25 +2925,27 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2925
2925
|
throw new Error('BaseSales 解决方案需要 order 模块支持');
|
|
2926
2926
|
case 2:
|
|
2927
2927
|
inferredPaymentStatus = this.getSubmitPaymentStatus(params === null || params === void 0 ? void 0 : params.paymentStatus);
|
|
2928
|
+
smallTicketDataFlag = (_params$smallTicketDa2 = params === null || params === void 0 ? void 0 : params.smallTicketDataFlag) !== null && _params$smallTicketDa2 !== void 0 ? _params$smallTicketDa2 : this.getDefaultCheckoutSmallTicketDataFlag();
|
|
2928
2929
|
submitParams = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
2929
2930
|
cacheId: this.cacheId,
|
|
2930
2931
|
platform: (_this$otherParams19 = this.otherParams) === null || _this$otherParams19 === void 0 ? void 0 : _this$otherParams19.platform,
|
|
2931
2932
|
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),
|
|
2932
2933
|
channel: this.getSubmitOrderSalesChannel(),
|
|
2933
|
-
type: (_this$otherParams22 = this.otherParams) === null || _this$otherParams22 === void 0 ? void 0 : _this$otherParams22.type
|
|
2934
|
+
type: (_this$otherParams22 = this.otherParams) === null || _this$otherParams22 === void 0 ? void 0 : _this$otherParams22.type,
|
|
2935
|
+
request_unique_idempotency_token: this.store.order.generateIdempotencyToken()
|
|
2934
2936
|
}, (params === null || params === void 0 ? void 0 : params.payments) !== undefined ? {
|
|
2935
2937
|
payments: params.payments
|
|
2936
2938
|
} : {}), inferredPaymentStatus !== undefined ? {
|
|
2937
2939
|
paymentStatus: inferredPaymentStatus
|
|
2938
|
-
} : {}),
|
|
2939
|
-
smallTicketDataFlag:
|
|
2940
|
+
} : {}), smallTicketDataFlag !== undefined ? {
|
|
2941
|
+
smallTicketDataFlag: smallTicketDataFlag
|
|
2940
2942
|
} : {}), (params === null || params === void 0 ? void 0 : params.confirmPendingVoucherPayments) !== undefined ? {
|
|
2941
2943
|
confirmPendingVoucherPayments: params.confirmPendingVoucherPayments
|
|
2942
2944
|
} : {}), (params === null || params === void 0 ? void 0 : params.enhancePayload) !== undefined ? {
|
|
2943
2945
|
enhancePayload: params.enhancePayload
|
|
2944
2946
|
} : {});
|
|
2945
2947
|
return _context29.abrupt("return", this.store.order.submitTempOrderAsync(submitParams));
|
|
2946
|
-
case
|
|
2948
|
+
case 6:
|
|
2947
2949
|
case "end":
|
|
2948
2950
|
return _context29.stop();
|
|
2949
2951
|
}
|
|
@@ -2954,11 +2956,29 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2954
2956
|
}
|
|
2955
2957
|
return submitTempOrderAsync;
|
|
2956
2958
|
}()
|
|
2959
|
+
/**
|
|
2960
|
+
* 默认保持 WebPOS 的本地待同步订单模式;需要云端确认后才算成功的渠道可覆盖此策略。
|
|
2961
|
+
* otherParams.checkoutSyncTaskEnabled 优先,便于同一 solution 按入口恢复旧行为。
|
|
2962
|
+
*/
|
|
2963
|
+
}, {
|
|
2964
|
+
key: "shouldUseCheckoutSyncTask",
|
|
2965
|
+
value: function shouldUseCheckoutSyncTask() {
|
|
2966
|
+
var _this$otherParams23;
|
|
2967
|
+
var configured = (_this$otherParams23 = this.otherParams) === null || _this$otherParams23 === void 0 ? void 0 : _this$otherParams23.checkoutSyncTaskEnabled;
|
|
2968
|
+
return typeof configured === 'boolean' ? configured : true;
|
|
2969
|
+
}
|
|
2970
|
+
|
|
2971
|
+
/** 可由特定 solution 为真实 checkout 补充默认收据数据请求。 */
|
|
2972
|
+
}, {
|
|
2973
|
+
key: "getDefaultCheckoutSmallTicketDataFlag",
|
|
2974
|
+
value: function getDefaultCheckoutSmallTicketDataFlag() {
|
|
2975
|
+
return undefined;
|
|
2976
|
+
}
|
|
2957
2977
|
}, {
|
|
2958
2978
|
key: "printLocalOrderReceipt",
|
|
2959
2979
|
value: function () {
|
|
2960
2980
|
var _printLocalOrderReceipt = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30(lookup) {
|
|
2961
|
-
var _this$
|
|
2981
|
+
var _this$otherParams24, _this$otherParams25, _this$otherParams26, _this$otherParams27;
|
|
2962
2982
|
var hasLookup, lookupPayload, context, payload, response, _this$store$order$app, _this$store$order5, _data;
|
|
2963
2983
|
return _regeneratorRuntime().wrap(function _callee30$(_context30) {
|
|
2964
2984
|
while (1) switch (_context30.prev = _context30.next) {
|
|
@@ -2976,10 +2996,10 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2976
2996
|
external_sale_number: lookup
|
|
2977
2997
|
};
|
|
2978
2998
|
context = {
|
|
2979
|
-
platform: (_this$
|
|
2980
|
-
businessCode: ((_this$
|
|
2999
|
+
platform: (_this$otherParams24 = this.otherParams) === null || _this$otherParams24 === void 0 ? void 0 : _this$otherParams24.platform,
|
|
3000
|
+
businessCode: ((_this$otherParams25 = this.otherParams) === null || _this$otherParams25 === void 0 ? void 0 : _this$otherParams25.businessCode) || ((_this$otherParams26 = this.otherParams) === null || _this$otherParams26 === void 0 ? void 0 : _this$otherParams26.business_code),
|
|
2981
3001
|
channel: this.getSubmitOrderSalesChannel(),
|
|
2982
|
-
type: (_this$
|
|
3002
|
+
type: (_this$otherParams27 = this.otherParams) === null || _this$otherParams27 === void 0 ? void 0 : _this$otherParams27.type
|
|
2983
3003
|
};
|
|
2984
3004
|
payload = hasLookup ? _objectSpread(_objectSpread({}, lookupPayload), {}, {
|
|
2985
3005
|
lookup_order_from_db: 1,
|
|
@@ -3038,7 +3058,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3038
3058
|
key: "syncPaymentsToOrder",
|
|
3039
3059
|
value: function () {
|
|
3040
3060
|
var _syncPaymentsToOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31(params) {
|
|
3041
|
-
var _ref32, _params$businessCode, _this$
|
|
3061
|
+
var _ref32, _params$businessCode, _this$otherParams28, _this$otherParams29, _params$channel2;
|
|
3042
3062
|
var businessCode, channel, syncParams, syncState, payments, syncResult, latestPayments, amountSnapshot, orderSnapshot, syncPayload;
|
|
3043
3063
|
return _regeneratorRuntime().wrap(function _callee31$(_context31) {
|
|
3044
3064
|
while (1) switch (_context31.prev = _context31.next) {
|
|
@@ -3049,9 +3069,11 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3049
3069
|
}
|
|
3050
3070
|
throw new Error('order 模块未初始化');
|
|
3051
3071
|
case 2:
|
|
3052
|
-
businessCode = (_ref32 = (_params$businessCode = params.businessCode) !== null && _params$businessCode !== void 0 ? _params$businessCode : (_this$
|
|
3072
|
+
businessCode = (_ref32 = (_params$businessCode = params.businessCode) !== null && _params$businessCode !== void 0 ? _params$businessCode : (_this$otherParams28 = this.otherParams) === null || _this$otherParams28 === void 0 ? void 0 : _this$otherParams28.businessCode) !== null && _ref32 !== void 0 ? _ref32 : (_this$otherParams29 = this.otherParams) === null || _this$otherParams29 === void 0 ? void 0 : _this$otherParams29.business_code;
|
|
3053
3073
|
channel = (_params$channel2 = params.channel) !== null && _params$channel2 !== void 0 ? _params$channel2 : this.getSubmitOrderSalesChannel();
|
|
3054
|
-
syncParams = _objectSpread(_objectSpread(_objectSpread({}, params),
|
|
3074
|
+
syncParams = _objectSpread(_objectSpread(_objectSpread({}, params), {}, {
|
|
3075
|
+
checkoutSyncTaskEnabled: this.shouldUseCheckoutSyncTask()
|
|
3076
|
+
}, businessCode !== undefined ? {
|
|
3055
3077
|
businessCode: businessCode
|
|
3056
3078
|
} : {}), channel !== undefined ? {
|
|
3057
3079
|
channel: channel
|
|
@@ -3306,7 +3328,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3306
3328
|
}, {
|
|
3307
3329
|
key: "addOrderPaymentWithDevicePrefix",
|
|
3308
3330
|
value: function addOrderPaymentWithDevicePrefix(payment, devicePrefix) {
|
|
3309
|
-
var _this$
|
|
3331
|
+
var _this$otherParams30,
|
|
3310
3332
|
_paymentRecord$paymen,
|
|
3311
3333
|
_paymentRecord$create,
|
|
3312
3334
|
_ref33,
|
|
@@ -3322,7 +3344,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3322
3344
|
return this.store.order.getOrderPayments();
|
|
3323
3345
|
}
|
|
3324
3346
|
var metadata = paymentRecord.metadata && _typeof(paymentRecord.metadata) === 'object' ? _objectSpread({}, paymentRecord.metadata) : {};
|
|
3325
|
-
var shopWalletPassId = (_this$
|
|
3347
|
+
var shopWalletPassId = (_this$otherParams30 = this.otherParams) === null || _this$otherParams30 === void 0 ? void 0 : _this$otherParams30.shop_wallet_pass_id;
|
|
3326
3348
|
if (shopWalletPassId !== undefined && shopWalletPassId !== null) {
|
|
3327
3349
|
metadata.shop_wallet_pass_id = shopWalletPassId;
|
|
3328
3350
|
}
|
|
@@ -4186,7 +4208,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4186
4208
|
key: "getCashPaymentConfig",
|
|
4187
4209
|
value: (function () {
|
|
4188
4210
|
var _getCashPaymentConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee45() {
|
|
4189
|
-
var _this$store$order11, _this$store$order11$g, _this$store$order12, _this$store$order12$g, _this$
|
|
4211
|
+
var _this$store$order11, _this$store$order11$g, _this$store$order12, _this$store$order12$g, _this$otherParams31;
|
|
4190
4212
|
var paymentMethods, paymentMethod, amountSnapshot, pendingWalletAmount, amountDue, currency, recommendedAmounts;
|
|
4191
4213
|
return _regeneratorRuntime().wrap(function _callee45$(_context45) {
|
|
4192
4214
|
while (1) switch (_context45.prev = _context45.next) {
|
|
@@ -4212,7 +4234,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4212
4234
|
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);
|
|
4213
4235
|
pendingWalletAmount = this.getPendingWalletPaymentAmount();
|
|
4214
4236
|
amountDue = Decimal.max(new Decimal((amountSnapshot === null || amountSnapshot === void 0 ? void 0 : amountSnapshot.amountGap) || 0).minus(pendingWalletAmount), 0).toDecimalPlaces(2).toNumber();
|
|
4215
|
-
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$
|
|
4237
|
+
currency = ((_this$store$order12 = this.store.order) === null || _this$store$order12 === void 0 || (_this$store$order12$g = _this$store$order12.getTempOrder) === null || _this$store$order12$g === void 0 || (_this$store$order12$g = _this$store$order12$g.call(_this$store$order12)) === null || _this$store$order12$g === void 0 ? void 0 : _this$store$order12$g.currency_code) || ((_this$otherParams31 = this.otherParams) === null || _this$otherParams31 === void 0 ? void 0 : _this$otherParams31.currency) || 'USD';
|
|
4216
4238
|
recommendedAmounts = amountDue > 0 ? this.store.payment.cash.getRecommendedAmount(amountDue, currency) : [];
|
|
4217
4239
|
return _context45.abrupt("return", {
|
|
4218
4240
|
available: Boolean(paymentMethod && amountDue > 0),
|
|
@@ -4347,7 +4369,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4347
4369
|
key: "payCash",
|
|
4348
4370
|
value: (function () {
|
|
4349
4371
|
var _payCash = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee47(params) {
|
|
4350
|
-
var _this$store$order$get6, _params$actualPaidAmo, _this$
|
|
4372
|
+
var _this$store$order$get6, _params$actualPaidAmo, _this$otherParams32, _this$window, _this$window$postMess;
|
|
4351
4373
|
var amount, config, paymentMethod, roundingAmount, effectivePaymentAmount, beforePayments, beforePaymentStatus, uniquePaymentNumber, paymentTimestamp, actualPaidAmount, changeAmount, shopWalletPassId, payments, payment, syncResult, committed, walletState, restoredTempOrder;
|
|
4352
4374
|
return _regeneratorRuntime().wrap(function _callee47$(_context47) {
|
|
4353
4375
|
while (1) switch (_context47.prev = _context47.next) {
|
|
@@ -4396,7 +4418,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4396
4418
|
paymentTimestamp = dayjs().format('YYYY-MM-DD HH:mm:ss');
|
|
4397
4419
|
actualPaidAmount = Number((_params$actualPaidAmo = params.actualPaidAmount) !== null && _params$actualPaidAmo !== void 0 ? _params$actualPaidAmo : amount);
|
|
4398
4420
|
changeAmount = Number(params.changeAmount || 0);
|
|
4399
|
-
shopWalletPassId = (_this$
|
|
4421
|
+
shopWalletPassId = (_this$otherParams32 = this.otherParams) === null || _this$otherParams32 === void 0 ? void 0 : _this$otherParams32.shop_wallet_pass_id;
|
|
4400
4422
|
if (!(!Number.isFinite(actualPaidAmount) || actualPaidAmount + 0.01 < amount)) {
|
|
4401
4423
|
_context47.next = 26;
|
|
4402
4424
|
break;
|
|
@@ -5299,13 +5321,13 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5299
5321
|
key: "getProductList",
|
|
5300
5322
|
value: function () {
|
|
5301
5323
|
var _getProductList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee62() {
|
|
5302
|
-
var _this$
|
|
5324
|
+
var _this$otherParams33;
|
|
5303
5325
|
var menu_list_ids, _this$store$products, res;
|
|
5304
5326
|
return _regeneratorRuntime().wrap(function _callee62$(_context62) {
|
|
5305
5327
|
while (1) switch (_context62.prev = _context62.next) {
|
|
5306
5328
|
case 0:
|
|
5307
5329
|
// 可以直接通过配置里的 menu 读取
|
|
5308
|
-
menu_list_ids = ((_this$
|
|
5330
|
+
menu_list_ids = ((_this$otherParams33 = this.otherParams) === null || _this$otherParams33 === void 0 || (_this$otherParams33 = _this$otherParams33.dineInConfig) === null || _this$otherParams33 === void 0 ? void 0 : _this$otherParams33['menu.associated_menus'].map(function (n) {
|
|
5309
5331
|
return Number(n.value);
|
|
5310
5332
|
})) || [];
|
|
5311
5333
|
_context62.prev = 1;
|
|
@@ -5343,7 +5365,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5343
5365
|
key: "setOtherParams",
|
|
5344
5366
|
value: function () {
|
|
5345
5367
|
var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee63(params) {
|
|
5346
|
-
var _this$
|
|
5368
|
+
var _this$otherParams34;
|
|
5347
5369
|
var _ref42,
|
|
5348
5370
|
_ref42$cover,
|
|
5349
5371
|
cover,
|
|
@@ -5357,7 +5379,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5357
5379
|
} else {
|
|
5358
5380
|
this.otherParams = _objectSpread(_objectSpread({}, this.otherParams), params);
|
|
5359
5381
|
}
|
|
5360
|
-
this.cacheId = (_this$
|
|
5382
|
+
this.cacheId = (_this$otherParams34 = this.otherParams) === null || _this$otherParams34 === void 0 ? void 0 : _this$otherParams34.cacheId;
|
|
5361
5383
|
_context63.next = 5;
|
|
5362
5384
|
return this.syncOtherParamsToSubModules(params, {
|
|
5363
5385
|
cover: cover
|
|
@@ -468,10 +468,13 @@ function getProductLineNoteSignature(product) {
|
|
|
468
468
|
}
|
|
469
469
|
|
|
470
470
|
/**
|
|
471
|
-
*
|
|
471
|
+
* 自定义商品、称重行以及编辑订单历史行都有各自的促销合并边界。
|
|
472
472
|
*/
|
|
473
473
|
function getPromotionLineMergeBoundary(product) {
|
|
474
474
|
var _product$product_sku, _product$metadata3;
|
|
475
|
+
if ((product === null || product === void 0 ? void 0 : product.product_id) === undefined || (product === null || product === void 0 ? void 0 : product.product_id) === null) {
|
|
476
|
+
return "custom:".concat(getOrderProductUid(product));
|
|
477
|
+
}
|
|
475
478
|
if (Number((product === null || product === void 0 || (_product$product_sku = product.product_sku) === null || _product$product_sku === void 0 ? void 0 : _product$product_sku.open_sold_weight) || 0) === 1) {
|
|
476
479
|
return "weighing:".concat(getOrderProductUid(product));
|
|
477
480
|
}
|
|
@@ -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 | 2 | 1 | 6 | 4 | 5 | 3;
|
|
315
330
|
}[]>;
|
|
316
331
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
317
332
|
private getScheduleDataByIds;
|