@pisell/pisellos 3.0.90 → 3.0.92
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/apis/picoding.d.ts +0 -0
- package/dist/apis/picoding.js +1 -0
- package/dist/model/index.d.ts +1 -0
- package/dist/model/index.js +1 -0
- package/dist/model/strategy/adapter/index.d.ts +7 -0
- package/dist/model/strategy/adapter/index.js +7 -0
- package/dist/model/strategy/adapter/itemRule/adapter.d.ts +67 -0
- package/dist/model/strategy/adapter/itemRule/adapter.js +483 -0
- package/dist/model/strategy/adapter/itemRule/evaluator.d.ts +43 -0
- package/dist/model/strategy/adapter/itemRule/evaluator.js +169 -0
- package/dist/model/strategy/adapter/itemRule/examples.d.ts +79 -0
- package/dist/model/strategy/adapter/itemRule/examples.js +382 -0
- package/dist/model/strategy/adapter/itemRule/index.d.ts +5 -0
- package/dist/model/strategy/adapter/itemRule/index.js +5 -0
- package/dist/model/strategy/adapter/itemRule/type.d.ts +225 -0
- package/dist/model/strategy/adapter/itemRule/type.js +101 -0
- package/dist/model/strategy/adapter/promotion/adapter.d.ts +66 -0
- package/dist/model/strategy/adapter/promotion/adapter.js +271 -0
- package/dist/model/strategy/adapter/promotion/evaluator.d.ts +213 -0
- package/dist/model/strategy/adapter/promotion/evaluator.js +1206 -0
- package/dist/model/strategy/adapter/promotion/examples.d.ts +138 -0
- package/dist/model/strategy/adapter/promotion/examples.js +166 -0
- package/dist/model/strategy/adapter/promotion/index.d.ts +4 -0
- package/dist/model/strategy/adapter/promotion/index.js +9 -0
- package/dist/model/strategy/adapter/promotion/type.d.ts +447 -0
- package/dist/model/strategy/adapter/promotion/type.js +209 -0
- package/dist/model/strategy/adapter/type.d.ts +28 -0
- package/dist/model/strategy/adapter/type.js +1 -0
- package/dist/model/strategy/adapter/walletPass/evaluator.d.ts +84 -0
- package/dist/model/strategy/adapter/walletPass/evaluator.js +502 -0
- package/dist/model/strategy/adapter/walletPass/example.d.ts +4 -0
- package/dist/model/strategy/adapter/walletPass/example.js +258 -0
- package/dist/model/strategy/adapter/walletPass/index.d.ts +32 -0
- package/dist/model/strategy/adapter/walletPass/index.js +182 -0
- package/dist/model/strategy/adapter/walletPass/locales.d.ts +1 -0
- package/dist/model/strategy/adapter/walletPass/locales.js +26 -0
- package/dist/model/strategy/adapter/walletPass/type.d.ts +187 -0
- package/dist/model/strategy/adapter/walletPass/type.js +1 -0
- package/dist/model/strategy/adapter/walletPass/utils.d.ts +50 -0
- package/dist/model/strategy/adapter/walletPass/utils.js +1104 -0
- package/dist/model/strategy/engine.d.ts +106 -0
- package/dist/model/strategy/engine.js +611 -0
- package/dist/model/strategy/index.d.ts +3 -0
- package/dist/model/strategy/index.js +8 -0
- package/dist/model/strategy/strategy-example.d.ts +5 -0
- package/dist/model/strategy/strategy-example.js +331 -0
- package/dist/model/strategy/type.d.ts +228 -0
- package/dist/model/strategy/type.js +94 -0
- package/dist/modules/Cart/utils/cartProduct.js +1 -0
- package/dist/modules/Discount/index.d.ts +4 -2
- package/dist/modules/Discount/index.js +90 -3
- package/dist/modules/Discount/types.d.ts +6 -0
- package/dist/modules/OpenData/index.d.ts +24 -0
- package/dist/modules/OpenData/index.js +173 -0
- package/dist/modules/OpenData/types.d.ts +73 -0
- package/dist/modules/OpenData/types.js +1 -0
- package/dist/modules/OpenData/utils.d.ts +2 -0
- package/dist/modules/OpenData/utils.js +75 -0
- package/dist/modules/Order/index.d.ts +66 -1
- package/dist/modules/Order/index.js +884 -10
- package/dist/modules/Order/types.d.ts +174 -12
- package/dist/modules/Order/types.js +2 -0
- package/dist/modules/Order/utils.d.ts +118 -0
- package/dist/modules/Order/utils.js +586 -2
- package/dist/modules/Product/utils.js +2 -2
- package/dist/modules/ProductList/index.d.ts +3 -1
- package/dist/modules/ProductList/index.js +26 -11
- package/dist/modules/Quotation/index.d.ts +48 -0
- package/dist/modules/Quotation/index.js +248 -0
- package/dist/modules/Quotation/types.d.ts +42 -0
- package/dist/modules/Quotation/types.js +1 -0
- package/dist/modules/Rules/index.js +17 -18
- package/dist/modules/SalesSummary/index.d.ts +63 -0
- package/dist/modules/SalesSummary/index.js +174 -0
- package/dist/modules/SalesSummary/types.d.ts +60 -0
- package/dist/modules/SalesSummary/types.js +1 -0
- package/dist/modules/SalesSummary/utils.d.ts +30 -0
- package/dist/modules/SalesSummary/utils.js +480 -0
- package/dist/modules/ScanOrderLogger/index.d.ts +23 -0
- package/dist/modules/ScanOrderLogger/index.js +174 -0
- package/dist/modules/ScanOrderLogger/providers/feishu.d.ts +2 -0
- package/dist/modules/ScanOrderLogger/providers/feishu.js +221 -0
- package/dist/modules/ScanOrderLogger/providers/grafana.d.ts +2 -0
- package/dist/modules/ScanOrderLogger/providers/grafana.js +50 -0
- package/dist/modules/ScanOrderLogger/types.d.ts +53 -0
- package/dist/modules/ScanOrderLogger/types.js +1 -0
- package/dist/modules/Schedule/getDateIsInSchedule.js +11 -18
- package/dist/modules/Schedule/utils.d.ts +1 -1
- package/dist/modules/Summary/utils.d.ts +3 -3
- package/dist/modules/Summary/utils.js +41 -31
- package/dist/modules/index.d.ts +4 -0
- package/dist/modules/index.js +5 -1
- package/dist/solution/BookingByStep/index.d.ts +2 -2
- package/dist/solution/BookingByStep/types.d.ts +3 -1
- package/dist/solution/BookingByStep/types.js +5 -1
- package/dist/solution/ScanOrder/index.d.ts +158 -0
- package/dist/solution/ScanOrder/index.js +3474 -0
- package/dist/solution/ScanOrder/types.d.ts +306 -0
- package/dist/solution/ScanOrder/types.js +35 -0
- package/dist/solution/ScanOrder/utils.d.ts +172 -0
- package/dist/solution/ScanOrder/utils.js +796 -0
- package/dist/solution/ShopDiscount/index.d.ts +1 -0
- package/dist/solution/ShopDiscount/index.js +23 -18
- package/dist/solution/VenueBooking/index.d.ts +201 -0
- package/dist/solution/VenueBooking/index.js +3472 -0
- package/dist/solution/VenueBooking/sales-section-4-annotated.json +343 -0
- package/dist/solution/VenueBooking/types.d.ts +154 -0
- package/dist/solution/VenueBooking/types.js +21 -0
- package/dist/solution/VenueBooking/utils/dateSummary.d.ts +11 -0
- package/dist/solution/VenueBooking/utils/dateSummary.js +104 -0
- package/dist/solution/VenueBooking/utils/resource.d.ts +14 -0
- package/dist/solution/VenueBooking/utils/resource.js +131 -0
- package/dist/solution/VenueBooking/utils/slotMerge.d.ts +38 -0
- package/dist/solution/VenueBooking/utils/slotMerge.js +239 -0
- package/dist/solution/VenueBooking/utils/timeSlot.d.ts +32 -0
- package/dist/solution/VenueBooking/utils/timeSlot.js +453 -0
- package/dist/solution/VenueBooking/utils.d.ts +1 -0
- package/dist/solution/VenueBooking/utils.js +1 -0
- package/dist/solution/index.d.ts +2 -0
- package/dist/solution/index.js +3 -1
- package/lib/apis/picoding.d.ts +0 -0
- package/lib/apis/picoding.js +0 -0
- package/lib/model/index.d.ts +1 -0
- package/lib/model/index.js +23 -0
- package/lib/model/strategy/adapter/index.d.ts +7 -0
- package/lib/model/strategy/adapter/index.js +57 -0
- package/lib/model/strategy/adapter/itemRule/adapter.d.ts +67 -0
- package/lib/model/strategy/adapter/itemRule/adapter.js +377 -0
- package/lib/model/strategy/adapter/itemRule/evaluator.d.ts +43 -0
- package/lib/model/strategy/adapter/itemRule/evaluator.js +124 -0
- package/lib/model/strategy/adapter/itemRule/examples.d.ts +79 -0
- package/lib/model/strategy/adapter/itemRule/examples.js +316 -0
- package/lib/model/strategy/adapter/itemRule/index.d.ts +5 -0
- package/lib/model/strategy/adapter/itemRule/index.js +60 -0
- package/lib/model/strategy/adapter/itemRule/type.d.ts +225 -0
- package/lib/model/strategy/adapter/itemRule/type.js +46 -0
- package/lib/model/strategy/adapter/promotion/adapter.d.ts +66 -0
- package/lib/model/strategy/adapter/promotion/adapter.js +217 -0
- package/lib/model/strategy/adapter/promotion/evaluator.d.ts +213 -0
- package/lib/model/strategy/adapter/promotion/evaluator.js +844 -0
- package/lib/model/strategy/adapter/promotion/examples.d.ts +138 -0
- package/lib/model/strategy/adapter/promotion/examples.js +192 -0
- package/lib/model/strategy/adapter/promotion/index.d.ts +4 -0
- package/lib/model/strategy/adapter/promotion/index.js +0 -0
- package/lib/model/strategy/adapter/promotion/type.d.ts +447 -0
- package/lib/model/strategy/adapter/promotion/type.js +51 -0
- package/lib/model/strategy/adapter/type.d.ts +28 -0
- package/lib/model/strategy/adapter/type.js +17 -0
- package/lib/model/strategy/adapter/walletPass/evaluator.d.ts +84 -0
- package/lib/model/strategy/adapter/walletPass/evaluator.js +424 -0
- package/lib/model/strategy/adapter/walletPass/example.d.ts +4 -0
- package/lib/model/strategy/adapter/walletPass/example.js +207 -0
- package/lib/model/strategy/adapter/walletPass/index.d.ts +32 -0
- package/lib/model/strategy/adapter/walletPass/index.js +142 -0
- package/lib/model/strategy/adapter/walletPass/locales.d.ts +1 -0
- package/lib/model/strategy/adapter/walletPass/locales.js +54 -0
- package/lib/model/strategy/adapter/walletPass/type.d.ts +187 -0
- package/lib/model/strategy/adapter/walletPass/type.js +17 -0
- package/lib/model/strategy/adapter/walletPass/utils.d.ts +50 -0
- package/lib/model/strategy/adapter/walletPass/utils.js +791 -0
- package/lib/model/strategy/engine.d.ts +106 -0
- package/lib/model/strategy/engine.js +450 -0
- package/lib/model/strategy/index.d.ts +3 -0
- package/lib/model/strategy/index.js +38 -0
- package/lib/model/strategy/strategy-example.d.ts +5 -0
- package/lib/model/strategy/strategy-example.js +318 -0
- package/lib/model/strategy/type.d.ts +228 -0
- package/lib/model/strategy/type.js +44 -0
- package/lib/modules/Cart/utils/cartProduct.js +1 -0
- package/lib/modules/Discount/index.d.ts +4 -2
- package/lib/modules/Discount/index.js +60 -2
- package/lib/modules/Discount/types.d.ts +6 -0
- package/lib/modules/OpenData/index.d.ts +24 -0
- package/lib/modules/OpenData/index.js +119 -0
- package/lib/modules/OpenData/types.d.ts +73 -0
- package/lib/modules/OpenData/types.js +17 -0
- package/lib/modules/OpenData/utils.d.ts +2 -0
- package/lib/modules/OpenData/utils.js +111 -0
- package/lib/modules/Order/index.d.ts +66 -1
- package/lib/modules/Order/index.js +525 -0
- package/lib/modules/Order/types.d.ts +174 -12
- package/lib/modules/Order/utils.d.ts +118 -0
- package/lib/modules/Order/utils.js +483 -2
- package/lib/modules/Product/utils.js +2 -2
- package/lib/modules/ProductList/index.d.ts +3 -1
- package/lib/modules/ProductList/index.js +51 -34
- package/lib/modules/Quotation/index.d.ts +48 -0
- package/lib/modules/Quotation/index.js +152 -0
- package/lib/modules/Quotation/types.d.ts +42 -0
- package/lib/modules/Quotation/types.js +17 -0
- package/lib/modules/Rules/index.js +17 -18
- package/lib/modules/SalesSummary/index.d.ts +63 -0
- package/lib/modules/SalesSummary/index.js +105 -0
- package/lib/modules/SalesSummary/types.d.ts +60 -0
- package/lib/modules/SalesSummary/types.js +17 -0
- package/lib/modules/SalesSummary/utils.d.ts +30 -0
- package/lib/modules/SalesSummary/utils.js +420 -0
- package/lib/modules/ScanOrderLogger/index.d.ts +23 -0
- package/lib/modules/ScanOrderLogger/index.js +147 -0
- package/lib/modules/ScanOrderLogger/providers/feishu.d.ts +2 -0
- package/lib/modules/ScanOrderLogger/providers/feishu.js +157 -0
- package/lib/modules/ScanOrderLogger/providers/grafana.d.ts +2 -0
- package/lib/modules/ScanOrderLogger/providers/grafana.js +52 -0
- package/lib/modules/ScanOrderLogger/types.d.ts +53 -0
- package/lib/modules/ScanOrderLogger/types.js +17 -0
- package/lib/modules/Schedule/getDateIsInSchedule.js +9 -11
- package/lib/modules/Schedule/utils.d.ts +1 -1
- package/lib/modules/Summary/utils.d.ts +3 -3
- package/lib/modules/Summary/utils.js +22 -16
- package/lib/modules/index.d.ts +4 -0
- package/lib/modules/index.js +9 -1
- package/lib/solution/BookingByStep/index.d.ts +2 -2
- package/lib/solution/BookingByStep/types.d.ts +3 -1
- package/lib/solution/BookingByStep/types.js +10 -0
- package/lib/solution/ScanOrder/index.d.ts +158 -0
- package/lib/solution/ScanOrder/index.js +2135 -0
- package/lib/solution/ScanOrder/types.d.ts +306 -0
- package/lib/solution/ScanOrder/types.js +36 -0
- package/lib/solution/ScanOrder/utils.d.ts +172 -0
- package/lib/solution/ScanOrder/utils.js +658 -0
- package/lib/solution/ShopDiscount/index.d.ts +1 -0
- package/lib/solution/ShopDiscount/index.js +4 -2
- package/lib/solution/VenueBooking/index.d.ts +201 -0
- package/lib/solution/VenueBooking/index.js +1937 -0
- package/lib/solution/VenueBooking/sales-section-4-annotated.json +343 -0
- package/lib/solution/VenueBooking/types.d.ts +154 -0
- package/lib/solution/VenueBooking/types.js +44 -0
- package/lib/solution/VenueBooking/utils/dateSummary.d.ts +11 -0
- package/lib/solution/VenueBooking/utils/dateSummary.js +110 -0
- package/lib/solution/VenueBooking/utils/resource.d.ts +14 -0
- package/lib/solution/VenueBooking/utils/resource.js +92 -0
- package/lib/solution/VenueBooking/utils/slotMerge.d.ts +38 -0
- package/lib/solution/VenueBooking/utils/slotMerge.js +237 -0
- package/lib/solution/VenueBooking/utils/timeSlot.d.ts +32 -0
- package/lib/solution/VenueBooking/utils/timeSlot.js +339 -0
- package/lib/solution/VenueBooking/utils.d.ts +1 -0
- package/lib/solution/VenueBooking/utils.js +69 -0
- package/lib/solution/index.d.ts +2 -0
- package/lib/solution/index.js +5 -1
- package/package.json +1 -1
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/modules/ScanOrderLogger/providers/feishu.ts
|
|
20
|
+
var feishu_exports = {};
|
|
21
|
+
__export(feishu_exports, {
|
|
22
|
+
feishuLoggerProvider: () => feishuLoggerProvider
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(feishu_exports);
|
|
25
|
+
var DEFAULT_THROTTLE_MS = 3e3;
|
|
26
|
+
var pendingQueue = [];
|
|
27
|
+
var flushTimer = null;
|
|
28
|
+
var cachedProviderConfig;
|
|
29
|
+
function safeStringify(value) {
|
|
30
|
+
if (value === void 0 || value === null)
|
|
31
|
+
return "";
|
|
32
|
+
if (typeof value === "string")
|
|
33
|
+
return value;
|
|
34
|
+
if (typeof value === "number" || typeof value === "boolean" || typeof value === "bigint") {
|
|
35
|
+
return String(value);
|
|
36
|
+
}
|
|
37
|
+
try {
|
|
38
|
+
return JSON.stringify(value);
|
|
39
|
+
} catch (error) {
|
|
40
|
+
return `[unserializable: ${String(error)}]`;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function isWebhookUsable(webhook) {
|
|
44
|
+
if (!webhook)
|
|
45
|
+
return false;
|
|
46
|
+
if (webhook.includes("REPLACE_ME"))
|
|
47
|
+
return false;
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
50
|
+
function buildRecordSegments(record) {
|
|
51
|
+
const context = record.context || {};
|
|
52
|
+
return [
|
|
53
|
+
[{ tag: "text", text: `[${record.level}] ${record.timestamp} ${record.title}
|
|
54
|
+
` }],
|
|
55
|
+
[{ tag: "text", text: `缓存标识: ${safeStringify(context.cacheId)}
|
|
56
|
+
` }],
|
|
57
|
+
[{ tag: "text", text: `日志来源: ${safeStringify(context)}
|
|
58
|
+
` }],
|
|
59
|
+
[{ tag: "text", text: `日志内容: ${safeStringify(record.payload)}
|
|
60
|
+
` }],
|
|
61
|
+
[{ tag: "text", text: `扩展信息: ${safeStringify(record.extra)}
|
|
62
|
+
` }],
|
|
63
|
+
[{ tag: "text", text: "------\n" }]
|
|
64
|
+
];
|
|
65
|
+
}
|
|
66
|
+
function buildFeishuBody(records) {
|
|
67
|
+
const title = records.length === 1 ? records[0].title : `ScanOrder 日志批量 (${records.length} 条)`;
|
|
68
|
+
const content = [];
|
|
69
|
+
records.forEach((record) => {
|
|
70
|
+
buildRecordSegments(record).forEach((segment) => content.push(segment));
|
|
71
|
+
});
|
|
72
|
+
return JSON.stringify({
|
|
73
|
+
msg_type: "post",
|
|
74
|
+
content: JSON.stringify({
|
|
75
|
+
post: {
|
|
76
|
+
zh_cn: {
|
|
77
|
+
title,
|
|
78
|
+
content
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
})
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
async function postToFeishu(webhook, body) {
|
|
85
|
+
await fetch(webhook, {
|
|
86
|
+
method: "POST",
|
|
87
|
+
headers: {
|
|
88
|
+
"Content-Type": "application/json"
|
|
89
|
+
},
|
|
90
|
+
body
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
async function flushQueue() {
|
|
94
|
+
var _a;
|
|
95
|
+
flushTimer = null;
|
|
96
|
+
if (!pendingQueue.length)
|
|
97
|
+
return;
|
|
98
|
+
const records = pendingQueue.splice(0, pendingQueue.length);
|
|
99
|
+
const webhook = (_a = cachedProviderConfig == null ? void 0 : cachedProviderConfig.feishu) == null ? void 0 : _a.webhook;
|
|
100
|
+
if (!isWebhookUsable(webhook)) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
if (typeof fetch !== "function") {
|
|
104
|
+
console.warn("[ScanOrderLogger] 当前环境不支持 fetch,跳过 Feishu 日志批量上报");
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
try {
|
|
108
|
+
await postToFeishu(webhook, buildFeishuBody(records));
|
|
109
|
+
} catch (error) {
|
|
110
|
+
console.warn("[ScanOrderLogger] Feishu 批量上报失败", error);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
var feishuLoggerProvider = {
|
|
114
|
+
async send(payload) {
|
|
115
|
+
var _a, _b, _c, _d, _e, _f;
|
|
116
|
+
cachedProviderConfig = payload.providerConfig;
|
|
117
|
+
const webhook = (_b = (_a = payload.providerConfig) == null ? void 0 : _a.feishu) == null ? void 0 : _b.webhook;
|
|
118
|
+
const errorHook = (_d = (_c = payload.providerConfig) == null ? void 0 : _c.feishu) == null ? void 0 : _d.errorHook;
|
|
119
|
+
if (typeof fetch !== "function") {
|
|
120
|
+
console.warn("[ScanOrderLogger] 当前环境不支持 fetch,跳过 Feishu 日志上报");
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
if (payload.record.level === "error" && isWebhookUsable(errorHook)) {
|
|
124
|
+
try {
|
|
125
|
+
await postToFeishu(errorHook, buildFeishuBody([payload.record]));
|
|
126
|
+
} catch (error) {
|
|
127
|
+
console.warn("[ScanOrderLogger] Feishu errorHook 上报失败", error);
|
|
128
|
+
}
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
if (!webhook) {
|
|
132
|
+
console.warn("[ScanOrderLogger] Feishu webhook 未配置,跳过日志上报");
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
if (!isWebhookUsable(webhook))
|
|
136
|
+
return;
|
|
137
|
+
const throttleMs = ((_f = (_e = payload.providerConfig) == null ? void 0 : _e.feishu) == null ? void 0 : _f.throttleMs) ?? DEFAULT_THROTTLE_MS;
|
|
138
|
+
if (throttleMs <= 0) {
|
|
139
|
+
try {
|
|
140
|
+
await postToFeishu(webhook, buildFeishuBody([payload.record]));
|
|
141
|
+
} catch (error) {
|
|
142
|
+
console.warn("[ScanOrderLogger] Feishu 日志上报失败", error);
|
|
143
|
+
}
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
pendingQueue.push(payload.record);
|
|
147
|
+
if (!flushTimer) {
|
|
148
|
+
flushTimer = setTimeout(() => {
|
|
149
|
+
void flushQueue();
|
|
150
|
+
}, throttleMs);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
155
|
+
0 && (module.exports = {
|
|
156
|
+
feishuLoggerProvider
|
|
157
|
+
});
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/modules/ScanOrderLogger/providers/grafana.ts
|
|
20
|
+
var grafana_exports = {};
|
|
21
|
+
__export(grafana_exports, {
|
|
22
|
+
grafanaLoggerProvider: () => grafanaLoggerProvider
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(grafana_exports);
|
|
25
|
+
var grafanaLoggerProvider = {
|
|
26
|
+
async send(payload) {
|
|
27
|
+
var _a, _b, _c, _d;
|
|
28
|
+
const endpoint = (_b = (_a = payload.providerConfig) == null ? void 0 : _a.grafana) == null ? void 0 : _b.endpoint;
|
|
29
|
+
if (!endpoint) {
|
|
30
|
+
console.warn("[ScanOrderLogger] Grafana endpoint 未配置,跳过日志上报");
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
if (typeof fetch !== "function") {
|
|
34
|
+
console.warn("[ScanOrderLogger] 当前环境不支持 fetch,跳过 Grafana 日志上报");
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
await fetch(endpoint, {
|
|
38
|
+
method: "POST",
|
|
39
|
+
headers: {
|
|
40
|
+
"Content-Type": "application/json",
|
|
41
|
+
...((_d = (_c = payload.providerConfig) == null ? void 0 : _c.grafana) == null ? void 0 : _d.headers) || {}
|
|
42
|
+
},
|
|
43
|
+
body: JSON.stringify({
|
|
44
|
+
record: payload.record
|
|
45
|
+
})
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
50
|
+
0 && (module.exports = {
|
|
51
|
+
grafanaLoggerProvider
|
|
52
|
+
});
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export type ScanOrderLogLevel = 'info' | 'warning' | 'error' | 'debug';
|
|
2
|
+
export type ScanOrderLoggerProviderType = 'feishu' | 'grafana';
|
|
3
|
+
export interface ScanOrderLoggerProviderFeishuConfig {
|
|
4
|
+
webhook?: string;
|
|
5
|
+
errorHook?: string;
|
|
6
|
+
/**
|
|
7
|
+
* 节流窗口毫秒数,默认 3000ms
|
|
8
|
+
* - >0:首条日志进入队列并启动定时器,窗口结束后合并成一条 Feishu post 统一发送
|
|
9
|
+
* - <=0:关闭节流,保持每条日志立即单独发送
|
|
10
|
+
*/
|
|
11
|
+
throttleMs?: number;
|
|
12
|
+
}
|
|
13
|
+
export interface ScanOrderLoggerProviderGrafanaConfig {
|
|
14
|
+
endpoint?: string;
|
|
15
|
+
headers?: Record<string, string>;
|
|
16
|
+
}
|
|
17
|
+
export interface ScanOrderLoggerProviderConfig {
|
|
18
|
+
feishu?: ScanOrderLoggerProviderFeishuConfig;
|
|
19
|
+
grafana?: ScanOrderLoggerProviderGrafanaConfig;
|
|
20
|
+
}
|
|
21
|
+
export interface ScanOrderLoggerContext {
|
|
22
|
+
cacheId?: string;
|
|
23
|
+
solutionName?: string;
|
|
24
|
+
moduleName?: string;
|
|
25
|
+
[key: string]: any;
|
|
26
|
+
}
|
|
27
|
+
export interface ScanOrderLogInput {
|
|
28
|
+
level?: ScanOrderLogLevel;
|
|
29
|
+
title: string;
|
|
30
|
+
payload?: Record<string, any>;
|
|
31
|
+
extra?: Record<string, any>;
|
|
32
|
+
timestamp?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface ScanOrderLogRecord {
|
|
35
|
+
level: ScanOrderLogLevel;
|
|
36
|
+
title: string;
|
|
37
|
+
timestamp: string;
|
|
38
|
+
payload: Record<string, any>;
|
|
39
|
+
extra: Record<string, any>;
|
|
40
|
+
context: ScanOrderLoggerContext;
|
|
41
|
+
}
|
|
42
|
+
export interface ScanOrderLoggerDispatchPayload {
|
|
43
|
+
record: ScanOrderLogRecord;
|
|
44
|
+
providerConfig?: ScanOrderLoggerProviderConfig;
|
|
45
|
+
}
|
|
46
|
+
export interface ScanOrderLoggerProvider {
|
|
47
|
+
send: (payload: ScanOrderLoggerDispatchPayload) => Promise<void>;
|
|
48
|
+
}
|
|
49
|
+
export interface ScanOrderLoggerState {
|
|
50
|
+
provider: ScanOrderLoggerProviderType;
|
|
51
|
+
providerConfig: ScanOrderLoggerProviderConfig;
|
|
52
|
+
context: ScanOrderLoggerContext;
|
|
53
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
|
+
|
|
15
|
+
// src/modules/ScanOrderLogger/types.ts
|
|
16
|
+
var types_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(types_exports);
|
|
@@ -70,7 +70,7 @@ var isInStandardSchedule = (targetDate, targetDateString, targetTimeString, sche
|
|
|
70
70
|
}
|
|
71
71
|
const startDate = (0, import_dayjs.default)(schedule.start_time);
|
|
72
72
|
const endDate = (0, import_dayjs.default)(schedule.end_time);
|
|
73
|
-
const isInBasicRange = targetDate.isSameOrAfter(startDate) && targetDate.
|
|
73
|
+
const isInBasicRange = targetDate.isSameOrAfter(startDate) && targetDate.isBefore(endDate);
|
|
74
74
|
if (schedule.repeat_type === "none") {
|
|
75
75
|
return isInBasicRange;
|
|
76
76
|
}
|
|
@@ -80,16 +80,14 @@ var isInTimeSlotsSchedule = (targetDate, targetDateString, targetTimeString, sch
|
|
|
80
80
|
if (!schedule.start_time) {
|
|
81
81
|
return false;
|
|
82
82
|
}
|
|
83
|
-
const
|
|
84
|
-
if (
|
|
83
|
+
const scheduleStartDate = (0, import_dayjs.default)(schedule.start_time.split(" ")[0]);
|
|
84
|
+
if (!isDateInTimeSlotsSchedule(targetDate, schedule, scheduleStartDate)) {
|
|
85
85
|
return false;
|
|
86
86
|
}
|
|
87
87
|
for (const timeSlot of schedule.time_slot) {
|
|
88
|
-
const slotStart = `${
|
|
89
|
-
const slotEnd = `${
|
|
90
|
-
|
|
91
|
-
const slotEndDate = (0, import_dayjs.default)(slotEnd);
|
|
92
|
-
if (targetDate.isSameOrAfter(slotStartDate) && targetDate.isSameOrBefore(slotEndDate)) {
|
|
88
|
+
const slotStart = (0, import_dayjs.default)(`${targetDateString} ${timeSlot.start_time}:00`);
|
|
89
|
+
const slotEnd = (0, import_dayjs.default)(`${targetDateString} ${timeSlot.end_time}:00`);
|
|
90
|
+
if (targetDate.isSameOrAfter(slotStart) && targetDate.isBefore(slotEnd)) {
|
|
93
91
|
return true;
|
|
94
92
|
}
|
|
95
93
|
}
|
|
@@ -104,7 +102,7 @@ var isInDesignationSchedule = (targetDate, targetDateString, targetTimeString, s
|
|
|
104
102
|
const endDateTime = `${designation.end_date} ${designation.end_time}:00`;
|
|
105
103
|
const startDate = (0, import_dayjs.default)(startDateTime);
|
|
106
104
|
const endDate = (0, import_dayjs.default)(endDateTime);
|
|
107
|
-
if (targetDate.isSameOrAfter(startDate) && targetDate.
|
|
105
|
+
if (targetDate.isSameOrAfter(startDate) && targetDate.isBefore(endDate)) {
|
|
108
106
|
return true;
|
|
109
107
|
}
|
|
110
108
|
}
|
|
@@ -158,7 +156,7 @@ var isInDailyRepeat = (targetDate, startDate, endDate, repeatRule) => {
|
|
|
158
156
|
const targetTimeOfDay = targetDate.hour() * 3600 + targetDate.minute() * 60 + targetDate.second();
|
|
159
157
|
const startTimeOfDay = startDate.hour() * 3600 + startDate.minute() * 60 + startDate.second();
|
|
160
158
|
const endTimeOfDay = endDate.hour() * 3600 + endDate.minute() * 60 + endDate.second();
|
|
161
|
-
return targetTimeOfDay >= startTimeOfDay && targetTimeOfDay
|
|
159
|
+
return targetTimeOfDay >= startTimeOfDay && targetTimeOfDay < endTimeOfDay;
|
|
162
160
|
};
|
|
163
161
|
var isInWeeklyRepeat = (targetDate, startDate, endDate, repeatRule) => {
|
|
164
162
|
const targetDayOfWeek = targetDate.day();
|
|
@@ -175,7 +173,7 @@ var isInWeeklyRepeat = (targetDate, startDate, endDate, repeatRule) => {
|
|
|
175
173
|
const targetTimeOfDay = targetDate.hour() * 3600 + targetDate.minute() * 60 + targetDate.second();
|
|
176
174
|
const startTimeOfDay = startDate.hour() * 3600 + startDate.minute() * 60 + startDate.second();
|
|
177
175
|
const endTimeOfDay = endDate.hour() * 3600 + endDate.minute() * 60 + endDate.second();
|
|
178
|
-
return targetTimeOfDay >= startTimeOfDay && targetTimeOfDay
|
|
176
|
+
return targetTimeOfDay >= startTimeOfDay && targetTimeOfDay < endTimeOfDay;
|
|
179
177
|
};
|
|
180
178
|
var getScheduleStartEndTimePoints = (date, scheduleList) => {
|
|
181
179
|
if (!date || !scheduleList || scheduleList.length === 0) {
|
|
@@ -46,7 +46,7 @@ export declare const formatScheduleResult: (schedule: ScheduleItem) => {
|
|
|
46
46
|
};
|
|
47
47
|
export declare const calcScheduleDateRange: (schedule: ScheduleItem) => any[];
|
|
48
48
|
export declare const calcCalendarDataBySchedules: (schedules: ScheduleItem[]) => unknown[];
|
|
49
|
-
export declare const calcMinTimeMaxTimeBySchedules: (schedules: ScheduleItem[], scheduleAllMap?: ScheduleAllMap, selectDate?: string) =>
|
|
49
|
+
export declare const calcMinTimeMaxTimeBySchedules: (schedules: ScheduleItem[], scheduleAllMap?: ScheduleAllMap, selectDate?: string) => ScheduleAllMap;
|
|
50
50
|
/**
|
|
51
51
|
* @title: 格式化日程数据
|
|
52
52
|
* @description:
|
|
@@ -7,8 +7,8 @@ export declare const calculatePriceDetails: (shopInfo: any, items: CartItem[], i
|
|
|
7
7
|
* @param item
|
|
8
8
|
*/
|
|
9
9
|
export declare const getBundleDiscountList: (bundle: any[]) => any[];
|
|
10
|
-
export declare const calcDiscountListDifference: (discountList: any[]) =>
|
|
11
|
-
export declare const getProductDiscountProductDiscountDifference: (item: CartItem) =>
|
|
10
|
+
export declare const calcDiscountListDifference: (discountList: any[]) => number;
|
|
11
|
+
export declare const getProductDiscountProductDiscountDifference: (item: CartItem) => number;
|
|
12
12
|
/**
|
|
13
13
|
* 计算订单税费(折扣前/折扣后),并把单品税费信息回写到商品数据上(用于明细展示/后续计算)。
|
|
14
14
|
*
|
|
@@ -94,7 +94,7 @@ export declare const calculateDeposit: (items: CartItem[]) => {
|
|
|
94
94
|
export declare const getSurchargeAmount: ({ bookingDetail, bookingId }: {
|
|
95
95
|
bookingDetail?: any;
|
|
96
96
|
bookingId?: number | undefined;
|
|
97
|
-
}, surcharge: any[], options: any) =>
|
|
97
|
+
}, surcharge: any[], options: any) => number;
|
|
98
98
|
/**
|
|
99
99
|
* 订单附加费各项信息
|
|
100
100
|
*
|
|
@@ -87,8 +87,8 @@ var getBundleDiscountList = (bundle) => {
|
|
|
87
87
|
var calcDiscountListDifference = (discountList) => {
|
|
88
88
|
return discountList.reduce((pre, cur) => {
|
|
89
89
|
var _a;
|
|
90
|
-
return pre
|
|
91
|
-
}, 0);
|
|
90
|
+
return pre.plus(((_a = cur == null ? void 0 : cur.metadata) == null ? void 0 : _a.product_discount_difference) || 0);
|
|
91
|
+
}, new import_decimal.default(0)).toNumber();
|
|
92
92
|
};
|
|
93
93
|
var getProductDiscountProductDiscountDifference = (item) => {
|
|
94
94
|
var _a, _b, _c, _d;
|
|
@@ -408,8 +408,8 @@ var getSurchargeAmount = ({ bookingDetail, bookingId }, surcharge, options) => {
|
|
|
408
408
|
if (!Array.isArray(surcharge))
|
|
409
409
|
return 0;
|
|
410
410
|
return surcharge.reduce((total, item) => {
|
|
411
|
-
return total
|
|
412
|
-
}, 0);
|
|
411
|
+
return total.plus(item.value || 0);
|
|
412
|
+
}, new import_decimal.default(0)).toNumber();
|
|
413
413
|
};
|
|
414
414
|
var getBundleItemIsOriginalPrice = (item) => {
|
|
415
415
|
return (item == null ? void 0 : item.price_type) === "markup" && (item == null ? void 0 : item.price_type_ext) === "product_price";
|
|
@@ -429,18 +429,24 @@ var getDiscountAmount = (discounts) => {
|
|
|
429
429
|
}, new import_decimal.default(0)).toNumber();
|
|
430
430
|
};
|
|
431
431
|
var getMainProductTotal = (item) => {
|
|
432
|
-
var _a, _b, _c, _d, _e, _f;
|
|
433
|
-
let total = new import_decimal.default(
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
432
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
433
|
+
let total = new import_decimal.default(
|
|
434
|
+
(item == null ? void 0 : item.main_product_selling_price) ?? ((_a = item == null ? void 0 : item.metadata) == null ? void 0 : _a.main_product_selling_price) ?? ((_b = item == null ? void 0 : item.metadata) == null ? void 0 : _b.main_product_original_price) ?? 0
|
|
435
|
+
);
|
|
436
|
+
const hasMainProductPrice = (item == null ? void 0 : item.main_product_selling_price) != null || ((_c = item == null ? void 0 : item.metadata) == null ? void 0 : _c.main_product_selling_price) != null || ((_d = item == null ? void 0 : item.metadata) == null ? void 0 : _d.main_product_original_price) != null;
|
|
437
|
+
if (!hasMainProductPrice) {
|
|
438
|
+
total = new import_decimal.default((item == null ? void 0 : item.main_product_selling_price) ?? ((_e = item == null ? void 0 : item.metadata) == null ? void 0 : _e.main_product_selling_price) ?? item.price ?? 0);
|
|
439
|
+
const discount = ((_g = (_f = item == null ? void 0 : item._origin) == null ? void 0 : _f.product) == null ? void 0 : _g.discount_list) || ((_j = (_i = (_h = item == null ? void 0 : item._originData) == null ? void 0 : _h.product) == null ? void 0 : _i.discount_list) == null ? void 0 : _j.filter((item2) => {
|
|
440
|
+
var _a2;
|
|
441
|
+
return !((_a2 = item2 == null ? void 0 : item2.metadata) == null ? void 0 : _a2.custom_product_bundle_map_id);
|
|
442
|
+
})) || [];
|
|
443
|
+
const mainProductDiscountAmount = getDiscountAmount(discount);
|
|
444
|
+
total = total.minus(mainProductDiscountAmount);
|
|
445
|
+
if ((item == null ? void 0 : item.option) && Array.isArray(item == null ? void 0 : item.option)) {
|
|
446
|
+
total = total.add(item == null ? void 0 : item.option.reduce((t, option) => {
|
|
447
|
+
return t.add(new import_decimal.default(option.price || 0).mul(option.num || 1));
|
|
448
|
+
}, new import_decimal.default(0)));
|
|
449
|
+
}
|
|
444
450
|
}
|
|
445
451
|
for (let bundleItem of (item == null ? void 0 : item.bundle) || []) {
|
|
446
452
|
if (getBundleItemIsMarkupOrDiscountPrice(bundleItem)) {
|
package/lib/modules/index.d.ts
CHANGED
|
@@ -10,4 +10,8 @@ export * from './Payment';
|
|
|
10
10
|
export * from './Resource';
|
|
11
11
|
export * from './Step';
|
|
12
12
|
export * from './Summary';
|
|
13
|
+
export * from './SalesSummary';
|
|
13
14
|
export * from './Schedule';
|
|
15
|
+
export * from './Quotation';
|
|
16
|
+
export * from './ScanOrderLogger';
|
|
17
|
+
export * from './OpenData';
|
package/lib/modules/index.js
CHANGED
|
@@ -28,7 +28,11 @@ __reExport(modules_exports, require("./Payment"), module.exports);
|
|
|
28
28
|
__reExport(modules_exports, require("./Resource"), module.exports);
|
|
29
29
|
__reExport(modules_exports, require("./Step"), module.exports);
|
|
30
30
|
__reExport(modules_exports, require("./Summary"), module.exports);
|
|
31
|
+
__reExport(modules_exports, require("./SalesSummary"), module.exports);
|
|
31
32
|
__reExport(modules_exports, require("./Schedule"), module.exports);
|
|
33
|
+
__reExport(modules_exports, require("./Quotation"), module.exports);
|
|
34
|
+
__reExport(modules_exports, require("./ScanOrderLogger"), module.exports);
|
|
35
|
+
__reExport(modules_exports, require("./OpenData"), module.exports);
|
|
32
36
|
// Annotate the CommonJS export names for ESM import in node:
|
|
33
37
|
0 && (module.exports = {
|
|
34
38
|
...require("./Product"),
|
|
@@ -43,5 +47,9 @@ __reExport(modules_exports, require("./Schedule"), module.exports);
|
|
|
43
47
|
...require("./Resource"),
|
|
44
48
|
...require("./Step"),
|
|
45
49
|
...require("./Summary"),
|
|
46
|
-
...require("./
|
|
50
|
+
...require("./SalesSummary"),
|
|
51
|
+
...require("./Schedule"),
|
|
52
|
+
...require("./Quotation"),
|
|
53
|
+
...require("./ScanOrderLogger"),
|
|
54
|
+
...require("./OpenData")
|
|
47
55
|
});
|
|
@@ -310,7 +310,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
310
310
|
date: string;
|
|
311
311
|
status: string;
|
|
312
312
|
week: string;
|
|
313
|
-
weekNum: 0 |
|
|
313
|
+
weekNum: 0 | 1 | 3 | 2 | 4 | 5 | 6;
|
|
314
314
|
}[]>;
|
|
315
315
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
316
316
|
private getScheduleDataByIds;
|
|
@@ -357,7 +357,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
357
357
|
};
|
|
358
358
|
setOtherData(key: string, value: any): void;
|
|
359
359
|
getOtherData(key: string): any;
|
|
360
|
-
getProductTypeById(id: number): Promise<"
|
|
360
|
+
getProductTypeById(id: number): Promise<"normal" | "duration" | "session">;
|
|
361
361
|
/**
|
|
362
362
|
* 提供给 UI 的方法,减轻 UI 层的计算压力,UI 层只需要传递 cartItemId 和 resourceCode 即返回对应的 renderList
|
|
363
363
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ProductList, CartModule, ProductData, AccountModule, AccountListModule, DateModule, GuestListModule, OrderModule, PaymentModule, ResourceListModule, StepModule, SummaryModule, ScheduleModule } from '../../modules';
|
|
1
|
+
import { ProductList, CartModule, ProductData, AccountModule, AccountListModule, DateModule, GuestListModule, OrderModule, PaymentModule, ResourceListModule, StepModule, SummaryModule, SalesSummaryModule, ScheduleModule, ScanOrderLoggerModule } from '../../modules';
|
|
2
2
|
export interface BookingByStepState {
|
|
3
3
|
cart: CartModule;
|
|
4
4
|
summary: SummaryModule;
|
|
@@ -14,6 +14,8 @@ export interface BookingByStepState {
|
|
|
14
14
|
currentProduct?: ProductData;
|
|
15
15
|
currentProductMeta?: Record<string, any>;
|
|
16
16
|
schedule: ScheduleModule;
|
|
17
|
+
salesSummary?: SalesSummaryModule;
|
|
18
|
+
scanOrderLogger?: ScanOrderLoggerModule;
|
|
17
19
|
}
|
|
18
20
|
export declare function createModule<T extends keyof BookingByStepState>(moduleName: T, solutionName: string, name?: string, version?: string): BookingByStepState[T];
|
|
19
21
|
export declare enum BookingByStepHooks {
|
|
@@ -36,6 +36,11 @@ function createModule(moduleName, solutionName, name, version) {
|
|
|
36
36
|
`${solutionName}_${name || moduleName}`,
|
|
37
37
|
version
|
|
38
38
|
);
|
|
39
|
+
case "salesSummary":
|
|
40
|
+
return new import_modules.SalesSummaryModule(
|
|
41
|
+
`${solutionName}_${name || moduleName}`,
|
|
42
|
+
version
|
|
43
|
+
);
|
|
39
44
|
case "step":
|
|
40
45
|
return new import_modules.StepModule(
|
|
41
46
|
`${solutionName}_${name || moduleName}`,
|
|
@@ -71,6 +76,11 @@ function createModule(moduleName, solutionName, name, version) {
|
|
|
71
76
|
`${solutionName}_${name || moduleName}`,
|
|
72
77
|
version
|
|
73
78
|
);
|
|
79
|
+
case "scanOrderLogger":
|
|
80
|
+
return new import_modules.ScanOrderLoggerModule(
|
|
81
|
+
`${solutionName}_${name || moduleName}`,
|
|
82
|
+
version
|
|
83
|
+
);
|
|
74
84
|
default:
|
|
75
85
|
throw new Error(`Unknown module type: ${moduleName}`);
|
|
76
86
|
}
|