@pisell/pisellos 0.0.516 → 0.0.518
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/Cart/utils/cartProduct.js +1 -1
- package/dist/modules/Order/index.d.ts +1 -1
- package/dist/modules/Order/utils.js +16 -13
- package/dist/modules/ProductList/index.js +2 -1
- package/dist/modules/Quotation/index.d.ts +1 -1
- package/dist/modules/Quotation/index.js +2 -2
- package/dist/modules/Rules/index.js +1 -0
- 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/solution/BookingByStep/index.d.ts +2 -2
- package/dist/solution/BookingByStep/index.js +2 -1
- package/dist/solution/BookingTicket/index.d.ts +1 -1
- package/dist/solution/ScanOrder/index.d.ts +7 -1
- package/dist/solution/ScanOrder/index.js +207 -97
- package/dist/solution/ScanOrder/utils.js +5 -5
- package/dist/solution/VenueBooking/index.d.ts +2 -0
- package/dist/solution/VenueBooking/index.js +94 -42
- package/dist/solution/VenueBooking/types.d.ts +1 -0
- package/dist/solution/VenueBooking/utils/resource.js +1 -0
- package/dist/solution/VenueBooking/utils/slotMerge.d.ts +4 -0
- package/dist/solution/VenueBooking/utils/slotMerge.js +16 -1
- package/lib/modules/Cart/utils/cartProduct.js +1 -1
- package/lib/modules/Order/index.d.ts +1 -1
- package/lib/modules/Order/utils.js +2 -13
- package/lib/modules/ProductList/index.js +2 -1
- package/lib/modules/Quotation/index.d.ts +1 -1
- package/lib/modules/Quotation/index.js +2 -2
- package/lib/modules/Rules/index.js +1 -0
- 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/solution/BookingByStep/index.d.ts +2 -2
- package/lib/solution/BookingByStep/index.js +2 -2
- package/lib/solution/BookingTicket/index.d.ts +1 -1
- package/lib/solution/ScanOrder/index.d.ts +7 -1
- package/lib/solution/ScanOrder/index.js +114 -28
- package/lib/solution/ScanOrder/utils.js +2 -2
- package/lib/solution/VenueBooking/index.d.ts +2 -0
- package/lib/solution/VenueBooking/index.js +45 -7
- package/lib/solution/VenueBooking/types.d.ts +1 -0
- package/lib/solution/VenueBooking/utils/resource.js +1 -0
- package/lib/solution/VenueBooking/utils/slotMerge.d.ts +4 -0
- package/lib/solution/VenueBooking/utils/slotMerge.js +13 -1
- package/package.json +1 -1
|
@@ -382,7 +382,7 @@ export var formatBundleToOrigin = function formatBundleToOrigin(bundle) {
|
|
|
382
382
|
option: formatOptionsToOrigin(getBundleValueByKey('option')),
|
|
383
383
|
discount_list: d.discount_list,
|
|
384
384
|
"bundle_selling_price": d === null || d === void 0 ? void 0 : d.price,
|
|
385
|
-
"custom_price": d
|
|
385
|
+
// "custom_price": d?.price,
|
|
386
386
|
metadata: {
|
|
387
387
|
custom_product_bundle_map_id: d._id,
|
|
388
388
|
product_discount_difference: product_discount_difference
|
|
@@ -82,7 +82,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
82
82
|
enhancePayload?: SubmitPayloadEnhancer;
|
|
83
83
|
}): Promise<T>;
|
|
84
84
|
createOrder(params: CommitOrderParams['query']): {
|
|
85
|
-
type: "
|
|
85
|
+
type: "appointment_booking" | "virtual";
|
|
86
86
|
platform: string;
|
|
87
87
|
sales_channel: string;
|
|
88
88
|
order_sales_channel: string;
|
|
@@ -202,7 +202,7 @@ export function createDefaultOrderRulesHooks() {
|
|
|
202
202
|
num: (_values$quantity2 = values.quantity) !== null && _values$quantity2 !== void 0 ? _values$quantity2 : product.num,
|
|
203
203
|
product_bundle: nextBundle,
|
|
204
204
|
metadata: _objectSpread(_objectSpread({}, metadataAny), {}, {
|
|
205
|
-
source_product_price:
|
|
205
|
+
source_product_price: nextSourceOriginalPrice,
|
|
206
206
|
main_product_selling_price: nextMainSellingPrice,
|
|
207
207
|
main_product_original_price: nextMainOriginalPrice,
|
|
208
208
|
price_schema_version: 2
|
|
@@ -334,13 +334,16 @@ function toBundleCustomPriceString(value) {
|
|
|
334
334
|
function formatSubmitBundleItems(bundle) {
|
|
335
335
|
if (!Array.isArray(bundle)) return [];
|
|
336
336
|
return bundle.map(function (b) {
|
|
337
|
-
var _rawBundle$bundle_sel, _rawBundle$price_type,
|
|
337
|
+
var _rawBundle$bundle_sel, _rawBundle$price_type, _rawBundle$surcharge_, _rawBundle$is_charge_, _rawBundle$bundle_var, _rawBundle$extension_, _rawBundle$extension_2, _rawBundle$price_type2, _ref5, _rawBundle$custom_pri;
|
|
338
338
|
var rawBundle = b && _typeof(b) === 'object' ? b : {};
|
|
339
339
|
var existedMetadata = rawBundle.metadata && _typeof(rawBundle.metadata) === 'object' ? rawBundle.metadata : {};
|
|
340
340
|
var sellingPriceNum = toBundleNumber((_rawBundle$bundle_sel = rawBundle.bundle_selling_price) !== null && _rawBundle$bundle_sel !== void 0 ? _rawBundle$bundle_sel : rawBundle.price, 0);
|
|
341
341
|
var priceNum = toBundleNumber(rawBundle.price, sellingPriceNum);
|
|
342
342
|
var priceType = (_rawBundle$price_type = rawBundle.price_type) !== null && _rawBundle$price_type !== void 0 ? _rawBundle$price_type : '';
|
|
343
|
-
|
|
343
|
+
// const customPriceStr = toBundleCustomPriceString(
|
|
344
|
+
// rawBundle.custom_price ?? rawBundle.bundle_selling_price ?? rawBundle.price,
|
|
345
|
+
// );
|
|
346
|
+
|
|
344
347
|
var relationSurchargeIds = Array.isArray(rawBundle.relation_surcharge_ids) ? rawBundle.relation_surcharge_ids : Array.isArray(existedMetadata.relation_surcharge_ids) ? existedMetadata.relation_surcharge_ids : [];
|
|
345
348
|
var surchargeFee = toBundleNumber((_rawBundle$surcharge_ = rawBundle.surcharge_fee) !== null && _rawBundle$surcharge_ !== void 0 ? _rawBundle$surcharge_ : existedMetadata.surcharge_fee, 0);
|
|
346
349
|
var productDiscountDifference = toBundleNumber(existedMetadata.product_discount_difference, 0);
|
|
@@ -354,8 +357,8 @@ function formatSubmitBundleItems(bundle) {
|
|
|
354
357
|
price: priceNum,
|
|
355
358
|
price_type: priceType,
|
|
356
359
|
price_type_ext: (_rawBundle$price_type2 = rawBundle.price_type_ext) !== null && _rawBundle$price_type2 !== void 0 ? _rawBundle$price_type2 : '',
|
|
357
|
-
custom_price: customPriceStr,
|
|
358
|
-
custom_price_type: (
|
|
360
|
+
// custom_price: customPriceStr,
|
|
361
|
+
custom_price_type: (_ref5 = (_rawBundle$custom_pri = rawBundle.custom_price_type) !== null && _rawBundle$custom_pri !== void 0 ? _rawBundle$custom_pri : priceType) !== null && _ref5 !== void 0 ? _ref5 : '',
|
|
359
362
|
bundle_selling_price: sellingPriceNum,
|
|
360
363
|
option: formatSubmitOptionItems(rawBundle.option),
|
|
361
364
|
bundle_group_id: rawBundle === null || rawBundle === void 0 ? void 0 : rawBundle.group_id,
|
|
@@ -517,7 +520,7 @@ export function createDefaultTempOrder(params) {
|
|
|
517
520
|
};
|
|
518
521
|
}
|
|
519
522
|
export function buildSubmitPayload(params) {
|
|
520
|
-
var _ref7, _ref8,
|
|
523
|
+
var _ref6, _ref7, _ref8, _tempOrder$is_price_i, _tempOrder$is_deposit;
|
|
521
524
|
var tempOrder = params.tempOrder,
|
|
522
525
|
cacheId = params.cacheId,
|
|
523
526
|
_params$now = params.now,
|
|
@@ -565,10 +568,10 @@ export function buildSubmitPayload(params) {
|
|
|
565
568
|
var payload = _objectSpread(_objectSpread({}, tempOrderRest), {}, {
|
|
566
569
|
platform: normalizeSubmitPlatform(platform !== null && platform !== void 0 ? platform : tempOrder.platform),
|
|
567
570
|
request_unique_idempotency_token: cacheId,
|
|
568
|
-
type: (
|
|
569
|
-
business_code: (
|
|
571
|
+
type: (_ref6 = type !== null && type !== void 0 ? type : tempOrder.type) !== null && _ref6 !== void 0 ? _ref6 : 'table-order',
|
|
572
|
+
business_code: (_ref7 = businessCode !== null && businessCode !== void 0 ? businessCode : tempOrder.business_code) !== null && _ref7 !== void 0 ? _ref7 : 'table-order',
|
|
570
573
|
sales_channel: tempOrder.sales_channel || 'my_pisel',
|
|
571
|
-
order_sales_channel: (
|
|
574
|
+
order_sales_channel: (_ref8 = channel !== null && channel !== void 0 ? channel : tempOrder.order_sales_channel) !== null && _ref8 !== void 0 ? _ref8 : 'online_store',
|
|
572
575
|
status: tempOrder.status || 'normal',
|
|
573
576
|
payment_status: tempOrder.payment_status || 'payment_processing',
|
|
574
577
|
// shipping_status: tempOrder.shipping_status || 'unfulfilled',
|
|
@@ -592,10 +595,10 @@ export function buildSubmitPayload(params) {
|
|
|
592
595
|
// holder: tempOrder.holder || null,
|
|
593
596
|
// summary,
|
|
594
597
|
metadata: function () {
|
|
595
|
-
var
|
|
596
|
-
_collectPax =
|
|
597
|
-
_tableOccupancyDuration =
|
|
598
|
-
rest = _objectWithoutProperties(
|
|
598
|
+
var _ref9 = tempOrder.metadata || {},
|
|
599
|
+
_collectPax = _ref9.collect_pax,
|
|
600
|
+
_tableOccupancyDuration = _ref9.table_occupancy_duration,
|
|
601
|
+
rest = _objectWithoutProperties(_ref9, _excluded3);
|
|
599
602
|
return _objectSpread({}, rest);
|
|
600
603
|
}(),
|
|
601
604
|
products: (tempOrder.products || []).map(function (product) {
|
|
@@ -128,10 +128,11 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
|
|
|
128
128
|
with_count: with_count,
|
|
129
129
|
// client_schedule_ids: schedule_ids,
|
|
130
130
|
schedule_date: schedule_date,
|
|
131
|
+
// application_code: this.otherParams?.channel === 'online_store' ? 'online-store' : this.otherParams?.channel,
|
|
132
|
+
application_code: 'online-store',
|
|
131
133
|
with_schedule: with_schedule,
|
|
132
134
|
schedule_datetime: schedule_datetime,
|
|
133
135
|
// application_code: this.otherParams?.channel,
|
|
134
|
-
application_code: 'online-store',
|
|
135
136
|
is_eject: 1
|
|
136
137
|
}, {
|
|
137
138
|
osServer: true,
|
|
@@ -19,7 +19,7 @@ export declare class QuotationModule extends BaseModule implements Module {
|
|
|
19
19
|
* Look up the quotation price for a specific product (+ optional variant) at a given datetime.
|
|
20
20
|
* Returns the price as a string (e.g. "300.00"), or null if no quotation applies.
|
|
21
21
|
*
|
|
22
|
-
* Priority: iterates quotations already sorted by `sort`
|
|
22
|
+
* Priority: iterates quotations already sorted by `sort` descending (highest = highest priority).
|
|
23
23
|
* First matching quotation whose schedule covers `datetime` and whose product_data contains
|
|
24
24
|
* the requested productId wins.
|
|
25
25
|
*/
|
|
@@ -89,7 +89,7 @@ export var QuotationModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
89
89
|
res = _context2.sent;
|
|
90
90
|
list = (res === null || res === void 0 || (_data = res.data) === null || _data === void 0 ? void 0 : _data.list) || (res === null || res === void 0 ? void 0 : res.list) || [];
|
|
91
91
|
list.sort(function (a, b) {
|
|
92
|
-
return
|
|
92
|
+
return b.sort - a.sort;
|
|
93
93
|
});
|
|
94
94
|
this.store.list = list;
|
|
95
95
|
case 9:
|
|
@@ -113,7 +113,7 @@ export var QuotationModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
113
113
|
* Look up the quotation price for a specific product (+ optional variant) at a given datetime.
|
|
114
114
|
* Returns the price as a string (e.g. "300.00"), or null if no quotation applies.
|
|
115
115
|
*
|
|
116
|
-
* Priority: iterates quotations already sorted by `sort`
|
|
116
|
+
* Priority: iterates quotations already sorted by `sort` descending (highest = highest priority).
|
|
117
117
|
* First matching quotation whose schedule covers `datetime` and whose product_data contains
|
|
118
118
|
* the requested productId wins.
|
|
119
119
|
*/
|
|
@@ -1256,6 +1256,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
1256
1256
|
} : {
|
|
1257
1257
|
_id: product._id.split('___')[0] + '___' + index,
|
|
1258
1258
|
total: total,
|
|
1259
|
+
original_price: product.original_price,
|
|
1259
1260
|
price: product.price,
|
|
1260
1261
|
main_product_selling_price: main_product_selling_price,
|
|
1261
1262
|
options: restoredOptions
|
|
@@ -11,10 +11,12 @@ export declare class ScanOrderLoggerModule extends BaseModule implements Module,
|
|
|
11
11
|
protected defaultName: string;
|
|
12
12
|
protected defaultVersion: string;
|
|
13
13
|
private store;
|
|
14
|
+
private window?;
|
|
14
15
|
initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
|
|
15
16
|
setContext(context: ScanOrderLoggerContext): void;
|
|
16
17
|
setProvider(provider: ScanOrderLoggerProviderType): void;
|
|
17
18
|
setProviderConfig(providerConfig: ScanOrderLoggerProviderConfig): void;
|
|
19
|
+
private getCurrentHost;
|
|
18
20
|
private buildRecord;
|
|
19
21
|
addLog(params: ScanOrderLogInput): Promise<void>;
|
|
20
22
|
}
|
|
@@ -46,6 +46,7 @@ export var ScanOrderLoggerModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
46
46
|
_defineProperty(_assertThisInitialized(_this), "defaultName", 'scanOrderLogger');
|
|
47
47
|
_defineProperty(_assertThisInitialized(_this), "defaultVersion", '1.0.0');
|
|
48
48
|
_defineProperty(_assertThisInitialized(_this), "store", void 0);
|
|
49
|
+
_defineProperty(_assertThisInitialized(_this), "window", void 0);
|
|
49
50
|
return _this;
|
|
50
51
|
}
|
|
51
52
|
_createClass(ScanOrderLoggerModule, [{
|
|
@@ -64,6 +65,7 @@ export var ScanOrderLoggerModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
64
65
|
options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
|
|
65
66
|
this.core = core;
|
|
66
67
|
this.store = options.store;
|
|
68
|
+
this.window = core.getPlugin('window') || undefined;
|
|
67
69
|
provider = ((_options$otherParams = options.otherParams) === null || _options$otherParams === void 0 ? void 0 : _options$otherParams.provider) || 'feishu';
|
|
68
70
|
providerConfig = ((_options$otherParams2 = options.otherParams) === null || _options$otherParams2 === void 0 ? void 0 : _options$otherParams2.providerConfig) || {};
|
|
69
71
|
context = ((_options$otherParams3 = options.otherParams) === null || _options$otherParams3 === void 0 ? void 0 : _options$otherParams3.context) || {};
|
|
@@ -73,7 +75,7 @@ export var ScanOrderLoggerModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
73
75
|
grafana: _objectSpread(_objectSpread({}, defaultProviderConfig.grafana), providerConfig.grafana || {})
|
|
74
76
|
});
|
|
75
77
|
this.store.context = context;
|
|
76
|
-
case
|
|
78
|
+
case 10:
|
|
77
79
|
case "end":
|
|
78
80
|
return _context.stop();
|
|
79
81
|
}
|
|
@@ -102,16 +104,27 @@ export var ScanOrderLoggerModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
102
104
|
grafana: _objectSpread(_objectSpread({}, this.store.providerConfig.grafana || {}), providerConfig.grafana || {})
|
|
103
105
|
});
|
|
104
106
|
}
|
|
107
|
+
}, {
|
|
108
|
+
key: "getCurrentHost",
|
|
109
|
+
value: function getCurrentHost() {
|
|
110
|
+
var _this$window;
|
|
111
|
+
var host = (_this$window = this.window) === null || _this$window === void 0 || (_this$window = _this$window.location) === null || _this$window === void 0 ? void 0 : _this$window.host;
|
|
112
|
+
if (typeof host === 'string' && host.length > 0) return host;
|
|
113
|
+
return undefined;
|
|
114
|
+
}
|
|
105
115
|
}, {
|
|
106
116
|
key: "buildRecord",
|
|
107
117
|
value: function buildRecord(params) {
|
|
118
|
+
var host = this.getCurrentHost();
|
|
108
119
|
return {
|
|
109
120
|
level: params.level || 'info',
|
|
110
121
|
title: params.title,
|
|
111
122
|
timestamp: params.timestamp || dayjs().format('YYYY-MM-DD HH:mm:ss'),
|
|
112
123
|
payload: params.payload || {},
|
|
113
124
|
extra: params.extra || {},
|
|
114
|
-
context: this.store.context || {}
|
|
125
|
+
context: _objectSpread(_objectSpread({}, this.store.context || {}), host ? {
|
|
126
|
+
host: host
|
|
127
|
+
} : {})
|
|
115
128
|
};
|
|
116
129
|
}
|
|
117
130
|
}, {
|
|
@@ -142,62 +142,80 @@ function _flushQueue() {
|
|
|
142
142
|
export var feishuLoggerProvider = {
|
|
143
143
|
send: function send(payload) {
|
|
144
144
|
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
145
|
-
var _payload$providerConf, _payload$providerConf2, _payload$providerConf3;
|
|
146
|
-
var webhook, throttleMs;
|
|
145
|
+
var _payload$providerConf, _payload$providerConf2, _payload$providerConf3, _payload$providerConf4;
|
|
146
|
+
var webhook, errorHook, throttleMs;
|
|
147
147
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
148
148
|
while (1) switch (_context.prev = _context.next) {
|
|
149
149
|
case 0:
|
|
150
150
|
cachedProviderConfig = payload.providerConfig;
|
|
151
151
|
webhook = (_payload$providerConf = payload.providerConfig) === null || _payload$providerConf === void 0 || (_payload$providerConf = _payload$providerConf.feishu) === null || _payload$providerConf === void 0 ? void 0 : _payload$providerConf.webhook;
|
|
152
|
-
|
|
153
|
-
|
|
152
|
+
errorHook = (_payload$providerConf2 = payload.providerConfig) === null || _payload$providerConf2 === void 0 || (_payload$providerConf2 = _payload$providerConf2.feishu) === null || _payload$providerConf2 === void 0 ? void 0 : _payload$providerConf2.errorHook;
|
|
153
|
+
if (!(typeof fetch !== 'function')) {
|
|
154
|
+
_context.next = 6;
|
|
154
155
|
break;
|
|
155
156
|
}
|
|
156
|
-
console.warn('[ScanOrderLogger] Feishu
|
|
157
|
+
console.warn('[ScanOrderLogger] 当前环境不支持 fetch,跳过 Feishu 日志上报');
|
|
157
158
|
return _context.abrupt("return");
|
|
158
|
-
case
|
|
159
|
-
if (isWebhookUsable(
|
|
160
|
-
_context.next =
|
|
159
|
+
case 6:
|
|
160
|
+
if (!(payload.record.level === 'error' && isWebhookUsable(errorHook))) {
|
|
161
|
+
_context.next = 16;
|
|
161
162
|
break;
|
|
162
163
|
}
|
|
164
|
+
_context.prev = 7;
|
|
165
|
+
_context.next = 10;
|
|
166
|
+
return postToFeishu(errorHook, buildFeishuBody([payload.record]));
|
|
167
|
+
case 10:
|
|
168
|
+
_context.next = 15;
|
|
169
|
+
break;
|
|
170
|
+
case 12:
|
|
171
|
+
_context.prev = 12;
|
|
172
|
+
_context.t0 = _context["catch"](7);
|
|
173
|
+
console.warn('[ScanOrderLogger] Feishu errorHook 上报失败', _context.t0);
|
|
174
|
+
case 15:
|
|
163
175
|
return _context.abrupt("return");
|
|
164
|
-
case
|
|
165
|
-
if (
|
|
166
|
-
_context.next =
|
|
176
|
+
case 16:
|
|
177
|
+
if (webhook) {
|
|
178
|
+
_context.next = 19;
|
|
167
179
|
break;
|
|
168
180
|
}
|
|
169
|
-
console.warn('[ScanOrderLogger]
|
|
181
|
+
console.warn('[ScanOrderLogger] Feishu webhook 未配置,跳过日志上报');
|
|
170
182
|
return _context.abrupt("return");
|
|
171
|
-
case
|
|
172
|
-
|
|
173
|
-
if (!(throttleMs <= 0)) {
|
|
183
|
+
case 19:
|
|
184
|
+
if (isWebhookUsable(webhook)) {
|
|
174
185
|
_context.next = 21;
|
|
175
186
|
break;
|
|
176
187
|
}
|
|
177
|
-
_context.
|
|
178
|
-
|
|
188
|
+
return _context.abrupt("return");
|
|
189
|
+
case 21:
|
|
190
|
+
throttleMs = (_payload$providerConf3 = (_payload$providerConf4 = payload.providerConfig) === null || _payload$providerConf4 === void 0 || (_payload$providerConf4 = _payload$providerConf4.feishu) === null || _payload$providerConf4 === void 0 ? void 0 : _payload$providerConf4.throttleMs) !== null && _payload$providerConf3 !== void 0 ? _payload$providerConf3 : DEFAULT_THROTTLE_MS;
|
|
191
|
+
if (!(throttleMs <= 0)) {
|
|
192
|
+
_context.next = 32;
|
|
193
|
+
break;
|
|
194
|
+
}
|
|
195
|
+
_context.prev = 23;
|
|
196
|
+
_context.next = 26;
|
|
179
197
|
return postToFeishu(webhook, buildFeishuBody([payload.record]));
|
|
180
|
-
case
|
|
181
|
-
_context.next =
|
|
198
|
+
case 26:
|
|
199
|
+
_context.next = 31;
|
|
182
200
|
break;
|
|
183
|
-
case
|
|
184
|
-
_context.prev =
|
|
185
|
-
_context.
|
|
186
|
-
console.warn('[ScanOrderLogger] Feishu 日志上报失败', _context.
|
|
187
|
-
case
|
|
201
|
+
case 28:
|
|
202
|
+
_context.prev = 28;
|
|
203
|
+
_context.t1 = _context["catch"](23);
|
|
204
|
+
console.warn('[ScanOrderLogger] Feishu 日志上报失败', _context.t1);
|
|
205
|
+
case 31:
|
|
188
206
|
return _context.abrupt("return");
|
|
189
|
-
case
|
|
207
|
+
case 32:
|
|
190
208
|
pendingQueue.push(payload.record);
|
|
191
209
|
if (!flushTimer) {
|
|
192
210
|
flushTimer = setTimeout(function () {
|
|
193
211
|
void flushQueue();
|
|
194
212
|
}, throttleMs);
|
|
195
213
|
}
|
|
196
|
-
case
|
|
214
|
+
case 34:
|
|
197
215
|
case "end":
|
|
198
216
|
return _context.stop();
|
|
199
217
|
}
|
|
200
|
-
}, _callee, null, [[12,
|
|
218
|
+
}, _callee, null, [[7, 12], [23, 28]]);
|
|
201
219
|
}))();
|
|
202
220
|
}
|
|
203
221
|
};
|
|
@@ -2,6 +2,7 @@ export type ScanOrderLogLevel = 'info' | 'warning' | 'error' | 'debug';
|
|
|
2
2
|
export type ScanOrderLoggerProviderType = 'feishu' | 'grafana';
|
|
3
3
|
export interface ScanOrderLoggerProviderFeishuConfig {
|
|
4
4
|
webhook?: string;
|
|
5
|
+
errorHook?: string;
|
|
5
6
|
/**
|
|
6
7
|
* 节流窗口毫秒数,默认 3000ms
|
|
7
8
|
* - >0:首条日志进入队列并启动定时器,窗口结束后合并成一条 Feishu post 统一发送
|
|
@@ -302,7 +302,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
302
302
|
autoSelectAllProductResources(resources_code: string, timeSlots?: TimeSliceItem): {
|
|
303
303
|
errorList: any[];
|
|
304
304
|
};
|
|
305
|
-
getTimeSlotByAllResources(resources_code: string): any[];
|
|
305
|
+
getTimeSlotByAllResources(resources_code: string, split?: number): any[];
|
|
306
306
|
getTimeSlotByAllResourcesForDate({ resources_code, startDate, endDate }: {
|
|
307
307
|
resources_code: string;
|
|
308
308
|
startDate: string;
|
|
@@ -311,7 +311,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
311
311
|
date: string;
|
|
312
312
|
status: string;
|
|
313
313
|
week: string;
|
|
314
|
-
weekNum: 0 |
|
|
314
|
+
weekNum: 0 | 2 | 1 | 3 | 5 | 4 | 6;
|
|
315
315
|
}[]>;
|
|
316
316
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
317
317
|
private getScheduleDataByIds;
|
|
@@ -2073,6 +2073,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2073
2073
|
_cartItems$,
|
|
2074
2074
|
_cartItems$2,
|
|
2075
2075
|
_this$shopStore$get;
|
|
2076
|
+
var split = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 10;
|
|
2076
2077
|
var dateRange = this.store.date.getDateRange();
|
|
2077
2078
|
// 取出购物车中所有一已选择的第一步资源
|
|
2078
2079
|
var resources = [];
|
|
@@ -2256,7 +2257,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2256
2257
|
resourcesMap: resourcesMap,
|
|
2257
2258
|
duration: duration,
|
|
2258
2259
|
currentDate: dateRange[0].date,
|
|
2259
|
-
split:
|
|
2260
|
+
split: split,
|
|
2260
2261
|
resourcesUseableMap: resourcesUseableMap,
|
|
2261
2262
|
capacity: maxCapacity,
|
|
2262
2263
|
cut_off_time: maxCutOffTime,
|
|
@@ -131,7 +131,7 @@ export declare class BookingTicketImpl extends BaseModule implements Module {
|
|
|
131
131
|
* 获取当前的客户搜索条件
|
|
132
132
|
* @returns 当前搜索条件
|
|
133
133
|
*/
|
|
134
|
-
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "
|
|
134
|
+
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "skip" | "num">;
|
|
135
135
|
/**
|
|
136
136
|
* 获取客户列表状态(包含滚动加载相关状态)
|
|
137
137
|
* @returns 客户状态
|
|
@@ -5,6 +5,7 @@ import type { UpdateProductInOrderParams } from '../../modules/Order/types';
|
|
|
5
5
|
import type { Discount } from '../../modules/Discount/types';
|
|
6
6
|
import { type CartItemSummary, type PaxInfo, type QuantityCheckResult, type QuantityLimitResult } from '../../model/strategy/adapter/itemRule';
|
|
7
7
|
import type { StrategyConfig } from '../../model/strategy/type';
|
|
8
|
+
import type { ProductData } from '../../modules/Product/types';
|
|
8
9
|
export * from './types';
|
|
9
10
|
interface ScanOrderItemRuleRuntimeConfig {
|
|
10
11
|
strategyConfigs?: StrategyConfig[];
|
|
@@ -36,11 +37,14 @@ export declare class ScanOrderImpl extends BaseModule implements Module {
|
|
|
36
37
|
private customerLoginRefreshIdInFlight;
|
|
37
38
|
private static readonly PISELL1_LOGIN_SUCCESS;
|
|
38
39
|
private getScanOrderLoggerContext;
|
|
40
|
+
private safeStringify;
|
|
41
|
+
private pickErrorMessage;
|
|
39
42
|
private serializeError;
|
|
40
43
|
private addScanOrderLog;
|
|
41
44
|
private logMethodStart;
|
|
42
45
|
private logMethodSuccess;
|
|
43
46
|
private logMethodError;
|
|
47
|
+
private assertProductListLoaded;
|
|
44
48
|
addLog(params: ScanOrderAddLogParams): Promise<void>;
|
|
45
49
|
private normalizeCustomerId;
|
|
46
50
|
private resolveCustomerIdFromLoginPayload;
|
|
@@ -86,6 +90,8 @@ export declare class ScanOrderImpl extends BaseModule implements Module {
|
|
|
86
90
|
onCustomerLogin(params: {
|
|
87
91
|
customerId: number;
|
|
88
92
|
}): Promise<void>;
|
|
93
|
+
private findReservationRuleResource;
|
|
94
|
+
private buildScanOrderResourceMetadata;
|
|
89
95
|
private buildSubmitPayloadEnhancer;
|
|
90
96
|
submitScanOrder<T = any>(): Promise<T>;
|
|
91
97
|
addProductToOrder(product: Partial<ScanOrderOrderProduct> & ScanOrderOrderProductIdentity): Promise<ScanOrderOrderProduct[]>;
|
|
@@ -120,7 +126,7 @@ export declare class ScanOrderImpl extends BaseModule implements Module {
|
|
|
120
126
|
orderAmount: number;
|
|
121
127
|
orderItems: any[];
|
|
122
128
|
}>;
|
|
123
|
-
getProductList(): Promise<
|
|
129
|
+
getProductList(): Promise<ProductData[]>;
|
|
124
130
|
getOtherParams(): Record<string, any>;
|
|
125
131
|
setOtherParams(params: Record<string, any>, { cover }?: {
|
|
126
132
|
cover?: boolean;
|