@pisell/pisellos 2.1.172 → 2.1.174

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.
Files changed (238) hide show
  1. package/dist/apis/picoding.d.ts +0 -0
  2. package/dist/apis/picoding.js +1 -0
  3. package/dist/index.d.ts +0 -1
  4. package/dist/index.js +0 -1
  5. package/dist/model/strategy/adapter/promotion/evaluator.js +26 -99
  6. package/dist/model/strategy/adapter/promotion/index.js +9 -0
  7. package/dist/model/strategy/adapter/walletPass/evaluator.d.ts +2 -2
  8. package/dist/model/strategy/adapter/walletPass/evaluator.js +12 -63
  9. package/dist/model/strategy/adapter/walletPass/locales.js +3 -12
  10. package/dist/model/strategy/engine.d.ts +5 -18
  11. package/dist/model/strategy/engine.js +45 -145
  12. package/dist/model/strategy/type.d.ts +0 -17
  13. package/dist/model/strategy/type.js +0 -4
  14. package/dist/modules/Cart/types.d.ts +0 -2
  15. package/dist/modules/Cart/utils/cartProduct.js +25 -56
  16. package/dist/modules/Cart/utils/changePrice.js +16 -9
  17. package/dist/modules/Discount/availability.d.ts +7 -0
  18. package/dist/modules/Discount/availability.js +52 -0
  19. package/dist/modules/Discount/entitlementPass.d.ts +34 -0
  20. package/dist/modules/Discount/entitlementPass.js +147 -0
  21. package/dist/modules/Discount/entitlementState.d.ts +8 -0
  22. package/dist/modules/Discount/entitlementState.js +205 -0
  23. package/dist/modules/Discount/index.d.ts +12 -3
  24. package/dist/modules/Discount/index.js +211 -17
  25. package/dist/modules/Discount/types.d.ts +42 -22
  26. package/dist/modules/Holder/index.d.ts +48 -0
  27. package/dist/modules/Holder/index.js +640 -0
  28. package/dist/modules/Holder/types.d.ts +123 -0
  29. package/dist/modules/Holder/types.js +1 -0
  30. package/dist/modules/Holder/utils.d.ts +13 -0
  31. package/dist/modules/Holder/utils.js +34 -0
  32. package/dist/modules/OpenData/index.d.ts +24 -0
  33. package/dist/modules/OpenData/index.js +173 -0
  34. package/dist/modules/OpenData/types.d.ts +73 -0
  35. package/dist/modules/OpenData/types.js +1 -0
  36. package/dist/modules/OpenData/utils.d.ts +2 -0
  37. package/dist/modules/OpenData/utils.js +75 -0
  38. package/dist/modules/Order/index.d.ts +67 -1
  39. package/dist/modules/Order/index.js +923 -30
  40. package/dist/modules/Order/types.d.ts +176 -12
  41. package/dist/modules/Order/types.js +2 -0
  42. package/dist/modules/Order/utils.d.ts +128 -0
  43. package/dist/modules/Order/utils.js +621 -5
  44. package/dist/modules/Payment/index.d.ts +1 -2
  45. package/dist/modules/Payment/index.js +7 -10
  46. package/dist/modules/Payment/utils.js +0 -3
  47. package/dist/modules/Payment/walletpass.d.ts +0 -23
  48. package/dist/modules/Payment/walletpass.js +95 -191
  49. package/dist/modules/Product/types.d.ts +7 -0
  50. package/dist/modules/Product/utils.js +2 -2
  51. package/dist/modules/ProductList/index.d.ts +1 -1
  52. package/dist/modules/ProductList/index.js +4 -3
  53. package/dist/modules/Quotation/index.d.ts +48 -0
  54. package/dist/modules/Quotation/index.js +248 -0
  55. package/dist/modules/Quotation/types.d.ts +42 -0
  56. package/dist/modules/Quotation/types.js +1 -0
  57. package/dist/modules/Rules/entitlementLines.d.ts +8 -0
  58. package/dist/modules/Rules/entitlementLines.js +157 -0
  59. package/dist/modules/Rules/index.d.ts +17 -11
  60. package/dist/modules/Rules/index.js +495 -726
  61. package/dist/modules/Rules/types.d.ts +2 -4
  62. package/dist/modules/SalesSummary/index.d.ts +63 -0
  63. package/dist/modules/SalesSummary/index.js +174 -0
  64. package/dist/modules/SalesSummary/types.d.ts +60 -0
  65. package/dist/modules/SalesSummary/types.js +1 -0
  66. package/dist/modules/SalesSummary/utils.d.ts +30 -0
  67. package/dist/modules/SalesSummary/utils.js +480 -0
  68. package/dist/modules/ScanOrderLogger/index.d.ts +23 -0
  69. package/dist/modules/ScanOrderLogger/index.js +174 -0
  70. package/dist/modules/ScanOrderLogger/providers/feishu.d.ts +2 -0
  71. package/dist/modules/ScanOrderLogger/providers/feishu.js +221 -0
  72. package/dist/modules/ScanOrderLogger/providers/grafana.d.ts +2 -0
  73. package/dist/modules/ScanOrderLogger/providers/grafana.js +50 -0
  74. package/dist/modules/ScanOrderLogger/types.d.ts +53 -0
  75. package/dist/modules/ScanOrderLogger/types.js +1 -0
  76. package/dist/modules/Schedule/getDateIsInSchedule.js +11 -18
  77. package/dist/modules/Schedule/utils.d.ts +1 -1
  78. package/dist/modules/Summary/types.d.ts +0 -2
  79. package/dist/modules/Summary/utils.d.ts +3 -9
  80. package/dist/modules/Summary/utils.js +67 -57
  81. package/dist/modules/index.d.ts +5 -0
  82. package/dist/modules/index.js +6 -1
  83. package/dist/plugins/window.d.ts +3 -2
  84. package/dist/solution/BookingByStep/index.d.ts +17 -3
  85. package/dist/solution/BookingByStep/index.js +322 -247
  86. package/dist/solution/BookingByStep/types.d.ts +4 -1
  87. package/dist/solution/BookingByStep/types.js +7 -1
  88. package/dist/solution/BookingByStep/utils/timeslots.d.ts +3 -1
  89. package/dist/solution/BookingByStep/utils/timeslots.js +19 -12
  90. package/dist/solution/Checkout/index.js +0 -2
  91. package/dist/solution/ScanOrder/index.d.ts +158 -0
  92. package/dist/solution/ScanOrder/index.js +3474 -0
  93. package/dist/solution/ScanOrder/types.d.ts +307 -0
  94. package/dist/solution/ScanOrder/types.js +35 -0
  95. package/dist/solution/ScanOrder/utils.d.ts +172 -0
  96. package/dist/solution/ScanOrder/utils.js +796 -0
  97. package/dist/solution/ShopDiscount/index.d.ts +6 -2
  98. package/dist/solution/ShopDiscount/index.js +194 -110
  99. package/dist/solution/ShopDiscount/types.d.ts +1 -1
  100. package/dist/solution/ShopDiscount/types.js +1 -2
  101. package/dist/solution/ShopDiscount/utils.d.ts +1 -0
  102. package/dist/solution/ShopDiscount/utils.js +52 -27
  103. package/dist/solution/VenueBooking/index.d.ts +225 -0
  104. package/dist/solution/VenueBooking/index.js +3749 -0
  105. package/dist/solution/VenueBooking/sales-section-4-annotated.json +343 -0
  106. package/dist/solution/VenueBooking/types.d.ts +156 -0
  107. package/dist/solution/VenueBooking/types.js +21 -0
  108. package/dist/solution/VenueBooking/utils/dateSummary.d.ts +11 -0
  109. package/dist/solution/VenueBooking/utils/dateSummary.js +104 -0
  110. package/dist/solution/VenueBooking/utils/resource.d.ts +14 -0
  111. package/dist/solution/VenueBooking/utils/resource.js +131 -0
  112. package/dist/solution/VenueBooking/utils/slotMerge.d.ts +38 -0
  113. package/dist/solution/VenueBooking/utils/slotMerge.js +239 -0
  114. package/dist/solution/VenueBooking/utils/timeSlot.d.ts +32 -0
  115. package/dist/solution/VenueBooking/utils/timeSlot.js +453 -0
  116. package/dist/solution/VenueBooking/utils.d.ts +1 -0
  117. package/dist/solution/VenueBooking/utils.js +1 -0
  118. package/dist/solution/index.d.ts +2 -0
  119. package/dist/solution/index.js +3 -1
  120. package/dist/types/index.d.ts +1 -0
  121. package/lib/apis/picoding.d.ts +0 -0
  122. package/lib/apis/picoding.js +0 -0
  123. package/lib/index.d.ts +0 -1
  124. package/lib/index.js +1 -3
  125. package/lib/model/strategy/adapter/promotion/evaluator.js +8 -57
  126. package/lib/model/strategy/adapter/promotion/index.js +49 -0
  127. package/lib/model/strategy/adapter/walletPass/evaluator.d.ts +2 -2
  128. package/lib/model/strategy/adapter/walletPass/evaluator.js +7 -36
  129. package/lib/model/strategy/adapter/walletPass/locales.js +3 -12
  130. package/lib/model/strategy/engine.d.ts +5 -18
  131. package/lib/model/strategy/engine.js +21 -85
  132. package/lib/model/strategy/type.d.ts +0 -17
  133. package/lib/modules/Cart/types.d.ts +0 -2
  134. package/lib/modules/Cart/utils/cartProduct.js +12 -39
  135. package/lib/modules/Cart/utils/changePrice.js +13 -9
  136. package/lib/modules/Discount/availability.d.ts +7 -0
  137. package/lib/modules/Discount/availability.js +91 -0
  138. package/lib/modules/Discount/entitlementPass.d.ts +34 -0
  139. package/lib/modules/Discount/entitlementPass.js +184 -0
  140. package/lib/modules/Discount/entitlementState.d.ts +8 -0
  141. package/lib/modules/Discount/entitlementState.js +206 -0
  142. package/lib/modules/Discount/index.d.ts +12 -3
  143. package/lib/modules/Discount/index.js +123 -12
  144. package/lib/modules/Discount/types.d.ts +42 -22
  145. package/lib/modules/Holder/index.d.ts +48 -0
  146. package/lib/modules/Holder/index.js +402 -0
  147. package/lib/modules/Holder/types.d.ts +123 -0
  148. package/lib/modules/Holder/types.js +17 -0
  149. package/lib/modules/Holder/utils.d.ts +13 -0
  150. package/lib/modules/Holder/utils.js +71 -0
  151. package/lib/modules/OpenData/index.d.ts +24 -0
  152. package/lib/modules/OpenData/index.js +119 -0
  153. package/lib/modules/OpenData/types.d.ts +73 -0
  154. package/lib/modules/OpenData/types.js +17 -0
  155. package/lib/modules/OpenData/utils.d.ts +2 -0
  156. package/lib/modules/OpenData/utils.js +111 -0
  157. package/lib/modules/Order/index.d.ts +67 -1
  158. package/lib/modules/Order/index.js +529 -1
  159. package/lib/modules/Order/types.d.ts +176 -12
  160. package/lib/modules/Order/utils.d.ts +128 -0
  161. package/lib/modules/Order/utils.js +514 -2
  162. package/lib/modules/Payment/index.d.ts +1 -2
  163. package/lib/modules/Payment/index.js +0 -1
  164. package/lib/modules/Payment/utils.js +0 -3
  165. package/lib/modules/Payment/walletpass.d.ts +0 -23
  166. package/lib/modules/Payment/walletpass.js +17 -94
  167. package/lib/modules/Product/types.d.ts +7 -0
  168. package/lib/modules/Product/utils.js +2 -2
  169. package/lib/modules/ProductList/index.d.ts +1 -1
  170. package/lib/modules/ProductList/index.js +5 -4
  171. package/lib/modules/Quotation/index.d.ts +48 -0
  172. package/lib/modules/Quotation/index.js +152 -0
  173. package/lib/modules/Quotation/types.d.ts +42 -0
  174. package/lib/modules/Quotation/types.js +17 -0
  175. package/lib/modules/Rules/entitlementLines.d.ts +8 -0
  176. package/lib/modules/Rules/entitlementLines.js +158 -0
  177. package/lib/modules/Rules/index.d.ts +17 -11
  178. package/lib/modules/Rules/index.js +548 -798
  179. package/lib/modules/Rules/types.d.ts +2 -4
  180. package/lib/modules/SalesSummary/index.d.ts +63 -0
  181. package/lib/modules/SalesSummary/index.js +105 -0
  182. package/lib/modules/SalesSummary/types.d.ts +60 -0
  183. package/lib/modules/SalesSummary/types.js +17 -0
  184. package/lib/modules/SalesSummary/utils.d.ts +30 -0
  185. package/lib/modules/SalesSummary/utils.js +420 -0
  186. package/lib/modules/ScanOrderLogger/index.d.ts +23 -0
  187. package/lib/modules/ScanOrderLogger/index.js +147 -0
  188. package/lib/modules/ScanOrderLogger/providers/feishu.d.ts +2 -0
  189. package/lib/modules/ScanOrderLogger/providers/feishu.js +157 -0
  190. package/lib/modules/ScanOrderLogger/providers/grafana.d.ts +2 -0
  191. package/lib/modules/ScanOrderLogger/providers/grafana.js +52 -0
  192. package/lib/modules/ScanOrderLogger/types.d.ts +53 -0
  193. package/lib/modules/ScanOrderLogger/types.js +17 -0
  194. package/lib/modules/Schedule/getDateIsInSchedule.js +9 -11
  195. package/lib/modules/Schedule/utils.d.ts +1 -1
  196. package/lib/modules/Summary/types.d.ts +0 -2
  197. package/lib/modules/Summary/utils.d.ts +3 -9
  198. package/lib/modules/Summary/utils.js +45 -34
  199. package/lib/modules/index.d.ts +5 -0
  200. package/lib/modules/index.js +11 -1
  201. package/lib/plugins/window.d.ts +3 -2
  202. package/lib/solution/BookingByStep/index.d.ts +17 -3
  203. package/lib/solution/BookingByStep/index.js +45 -4
  204. package/lib/solution/BookingByStep/types.d.ts +4 -1
  205. package/lib/solution/BookingByStep/types.js +15 -0
  206. package/lib/solution/BookingByStep/utils/timeslots.d.ts +3 -1
  207. package/lib/solution/BookingByStep/utils/timeslots.js +19 -11
  208. package/lib/solution/Checkout/index.js +0 -2
  209. package/lib/solution/ScanOrder/index.d.ts +158 -0
  210. package/lib/solution/ScanOrder/index.js +2135 -0
  211. package/lib/solution/ScanOrder/types.d.ts +307 -0
  212. package/lib/solution/ScanOrder/types.js +36 -0
  213. package/lib/solution/ScanOrder/utils.d.ts +172 -0
  214. package/lib/solution/ScanOrder/utils.js +658 -0
  215. package/lib/solution/ShopDiscount/index.d.ts +6 -2
  216. package/lib/solution/ShopDiscount/index.js +94 -50
  217. package/lib/solution/ShopDiscount/types.d.ts +1 -1
  218. package/lib/solution/ShopDiscount/utils.d.ts +1 -0
  219. package/lib/solution/ShopDiscount/utils.js +48 -11
  220. package/lib/solution/VenueBooking/index.d.ts +225 -0
  221. package/lib/solution/VenueBooking/index.js +2073 -0
  222. package/lib/solution/VenueBooking/sales-section-4-annotated.json +343 -0
  223. package/lib/solution/VenueBooking/types.d.ts +156 -0
  224. package/lib/solution/VenueBooking/types.js +44 -0
  225. package/lib/solution/VenueBooking/utils/dateSummary.d.ts +11 -0
  226. package/lib/solution/VenueBooking/utils/dateSummary.js +110 -0
  227. package/lib/solution/VenueBooking/utils/resource.d.ts +14 -0
  228. package/lib/solution/VenueBooking/utils/resource.js +92 -0
  229. package/lib/solution/VenueBooking/utils/slotMerge.d.ts +38 -0
  230. package/lib/solution/VenueBooking/utils/slotMerge.js +237 -0
  231. package/lib/solution/VenueBooking/utils/timeSlot.d.ts +32 -0
  232. package/lib/solution/VenueBooking/utils/timeSlot.js +339 -0
  233. package/lib/solution/VenueBooking/utils.d.ts +1 -0
  234. package/lib/solution/VenueBooking/utils.js +69 -0
  235. package/lib/solution/index.d.ts +2 -0
  236. package/lib/solution/index.js +5 -1
  237. package/lib/types/index.d.ts +1 -0
  238. 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,2 @@
1
+ import { ScanOrderLoggerProvider } from '../types';
2
+ export declare const grafanaLoggerProvider: ScanOrderLoggerProvider;
@@ -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.isSameOrBefore(endDate);
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 scheduleDate = schedule.start_time.split(" ")[0];
84
- if (targetDateString !== scheduleDate) {
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 = `${scheduleDate} ${timeSlot.start_time}:00`;
89
- const slotEnd = `${scheduleDate} ${timeSlot.end_time}:00`;
90
- const slotStartDate = (0, import_dayjs.default)(slotStart);
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.isSameOrBefore(endDate)) {
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 <= endTimeOfDay;
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 <= endTimeOfDay;
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:
@@ -6,8 +6,6 @@ export interface ISummaryState {
6
6
  subtotal: string | number;
7
7
  /** 最终总价 */
8
8
  total: string | number;
9
- /** 最终原始价格 不包含折扣卡商品券折扣 */
10
- originTotal: string | number;
11
9
  /** 税率标题 */
12
10
  taxTitle?: string;
13
11
  /** 商品总费率 */
@@ -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[]) => any;
11
- export declare const getProductDiscountProductDiscountDifference: (item: CartItem) => any;
10
+ export declare const calcDiscountListDifference: (discountList: any[]) => number;
11
+ export declare const getProductDiscountProductDiscountDifference: (item: CartItem) => number;
12
12
  /**
13
13
  * 计算订单税费(折扣前/折扣后),并把单品税费信息回写到商品数据上(用于明细展示/后续计算)。
14
14
  *
@@ -58,12 +58,6 @@ export declare const getTax: ({ service, addons, bookingDetail, bookingId }: {
58
58
  * @returns 商品总价字符串,保留2位小数
59
59
  */
60
60
  export declare const calculateSubtotal: (items: CartItem[]) => string;
61
- /**
62
- * 计算商品小计(不含其他费用 不包含折扣卡商品券抵扣金额)
63
- * @param items - 购物车商品数组
64
- * @returns 商品总价字符串,保留2位小数
65
- */
66
- export declare const calculateOriginSubtotal: (items: CartItem[]) => string;
67
61
  /**
68
62
  * @title: 单个商品的税费
69
63
  * @description:
@@ -100,7 +94,7 @@ export declare const calculateDeposit: (items: CartItem[]) => {
100
94
  export declare const getSurchargeAmount: ({ bookingDetail, bookingId }: {
101
95
  bookingDetail?: any;
102
96
  bookingId?: number | undefined;
103
- }, surcharge: any[], options: any) => any;
97
+ }, surcharge: any[], options: any) => number;
104
98
  /**
105
99
  * 订单附加费各项信息
106
100
  *
@@ -31,7 +31,6 @@ var utils_exports = {};
31
31
  __export(utils_exports, {
32
32
  calcDiscountListDifference: () => calcDiscountListDifference,
33
33
  calculateDeposit: () => calculateDeposit,
34
- calculateOriginSubtotal: () => calculateOriginSubtotal,
35
34
  calculatePriceDetails: () => calculatePriceDetails,
36
35
  calculateSubtotal: () => calculateSubtotal,
37
36
  calculateTaxFee: () => calculateTaxFee,
@@ -47,7 +46,6 @@ var import_utils = require("../Product/utils");
47
46
  var import_dayjs = __toESM(require("dayjs"));
48
47
  var calculatePriceDetails = (shopInfo, items, isInScheduleByDate, surchargeList, scheduleById) => {
49
48
  const subtotal = new import_decimal.default(calculateSubtotal(items));
50
- const subOriginTotal = new import_decimal.default(calculateOriginSubtotal(items));
51
49
  const totalTaxFee = new import_decimal.default(calculateTaxFee(shopInfo, items));
52
50
  const surcharge = getSurcharge({ service: items, addons: [], bookingDetail: null, bookingId: void 0 }, { isEdit: false, isInScheduleByDate, surcharge_list: surchargeList, scheduleById });
53
51
  const surchargeAmount = new import_decimal.default(getSurchargeAmount({ bookingDetail: null, bookingId: void 0 }, surcharge, { isEdit: false }));
@@ -61,12 +59,10 @@ var calculatePriceDetails = (shopInfo, items, isInScheduleByDate, surchargeList,
61
59
  is_price_include_tax: shopInfo == null ? void 0 : shopInfo.is_price_include_tax
62
60
  });
63
61
  const total = (shopInfo == null ? void 0 : shopInfo.is_price_include_tax) ? subtotal.plus(surchargeAmount) : subtotal.plus(tax).plus(surchargeAmount);
64
- const originTotal = (shopInfo == null ? void 0 : shopInfo.is_price_include_tax) ? subOriginTotal : subOriginTotal.plus(totalTaxFee);
65
62
  const deposit = calculateDeposit(items);
66
63
  return {
67
64
  subtotal: subtotal.toFixed(2),
68
65
  total: total.toFixed(2),
69
- originTotal: originTotal.toFixed(2),
70
66
  taxTitle: shopInfo == null ? void 0 : shopInfo.tax_title,
71
67
  taxRate: shopInfo == null ? void 0 : shopInfo.tax_rate,
72
68
  totalTaxFee: tax,
@@ -91,8 +87,8 @@ var getBundleDiscountList = (bundle) => {
91
87
  var calcDiscountListDifference = (discountList) => {
92
88
  return discountList.reduce((pre, cur) => {
93
89
  var _a;
94
- return pre + (((_a = cur == null ? void 0 : cur.metadata) == null ? void 0 : _a.product_discount_difference) || 0);
95
- }, 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();
96
92
  };
97
93
  var getProductDiscountProductDiscountDifference = (item) => {
98
94
  var _a, _b, _c, _d;
@@ -364,16 +360,6 @@ var calculateSubtotal = (items) => {
364
360
  }, new import_decimal.default(0));
365
361
  return subtotal.toFixed(2);
366
362
  };
367
- var calculateOriginSubtotal = (items) => {
368
- if (!(items == null ? void 0 : items.length)) {
369
- return "0.00";
370
- }
371
- const subtotal = items.reduce((sum, item) => {
372
- const cartItemTotalPrice = new import_decimal.default(item.summaryOriginTotal || 0);
373
- return sum.plus(cartItemTotalPrice);
374
- }, new import_decimal.default(0));
375
- return subtotal.toFixed(2);
376
- };
377
363
  var calculateTaxFee = (shopInfo, items) => {
378
364
  if (!(items == null ? void 0 : items.length)) {
379
365
  return "0.00";
@@ -387,6 +373,26 @@ var calculateTaxFee = (shopInfo, items) => {
387
373
  }, new import_decimal.default(0));
388
374
  return totalTaxFee;
389
375
  };
376
+ var getCartItemDepositData = (item) => {
377
+ var _a, _b, _c, _d;
378
+ const target = item;
379
+ return ((_a = target == null ? void 0 : target._productOrigin) == null ? void 0 : _a.custom_deposit_data) || ((_b = target == null ? void 0 : target._origin) == null ? void 0 : _b.custom_deposit_data) || ((_d = (_c = target == null ? void 0 : target._origin) == null ? void 0 : _c.product) == null ? void 0 : _d.custom_deposit_data);
380
+ };
381
+ var getCartItemQuantity = (item) => {
382
+ return new import_decimal.default((item == null ? void 0 : item.num) || 1);
383
+ };
384
+ var calculateCartItemDepositTotal = (item) => {
385
+ var _a;
386
+ const depositData = getCartItemDepositData(item);
387
+ if ((depositData == null ? void 0 : depositData.has_deposit) == 1 && typeof (depositData == null ? void 0 : depositData.deposit_fixed) === "string" && typeof (depositData == null ? void 0 : depositData.deposit_percentage) === "string") {
388
+ const lineTotal = new import_decimal.default(item.summaryTotal ?? item.total ?? 0);
389
+ const quantity = getCartItemQuantity(item);
390
+ const fixedTotal = new import_decimal.default(depositData.deposit_fixed || 0).times(quantity);
391
+ const percentageTotal = new import_decimal.default(depositData.deposit_percentage || 0).times(lineTotal);
392
+ return fixedTotal.plus(percentageTotal);
393
+ }
394
+ return new import_decimal.default(((_a = item == null ? void 0 : item.deposit) == null ? void 0 : _a.total) || 0);
395
+ };
390
396
  var calculateDeposit = (items) => {
391
397
  if (!(items == null ? void 0 : items.length)) {
392
398
  return void 0;
@@ -394,11 +400,11 @@ var calculateDeposit = (items) => {
394
400
  const protocols = [];
395
401
  let hasDeposit = false;
396
402
  const total = items.reduce((sum, item) => {
397
- var _a, _b, _c;
403
+ var _a, _b;
398
404
  if (item == null ? void 0 : item.deposit) {
399
405
  hasDeposit = true;
400
- const cartItemTotalPrice = new import_decimal.default(((_a = item == null ? void 0 : item.deposit) == null ? void 0 : _a.total) || 0);
401
- (_c = (_b = item == null ? void 0 : item.deposit) == null ? void 0 : _b.protocols) == null ? void 0 : _c.forEach((protocol) => {
406
+ const cartItemTotalPrice = calculateCartItemDepositTotal(item);
407
+ (_b = (_a = item == null ? void 0 : item.deposit) == null ? void 0 : _a.protocols) == null ? void 0 : _b.forEach((protocol) => {
402
408
  if (protocols.findIndex((p) => p.id === protocol.id) === -1) {
403
409
  protocols.push(protocol);
404
410
  }
@@ -422,8 +428,8 @@ var getSurchargeAmount = ({ bookingDetail, bookingId }, surcharge, options) => {
422
428
  if (!Array.isArray(surcharge))
423
429
  return 0;
424
430
  return surcharge.reduce((total, item) => {
425
- return total + (item.value || 0);
426
- }, 0);
431
+ return total.plus(item.value || 0);
432
+ }, new import_decimal.default(0)).toNumber();
427
433
  };
428
434
  var getBundleItemIsOriginalPrice = (item) => {
429
435
  return (item == null ? void 0 : item.price_type) === "markup" && (item == null ? void 0 : item.price_type_ext) === "product_price";
@@ -443,18 +449,24 @@ var getDiscountAmount = (discounts) => {
443
449
  }, new import_decimal.default(0)).toNumber();
444
450
  };
445
451
  var getMainProductTotal = (item) => {
446
- var _a, _b, _c, _d, _e, _f;
447
- let total = new import_decimal.default((item == null ? void 0 : item.main_product_selling_price) ?? ((_a = item == null ? void 0 : item.metadata) == null ? void 0 : _a.main_product_selling_price) ?? item.price ?? 0);
448
- const discount = ((_c = (_b = item == null ? void 0 : item._origin) == null ? void 0 : _b.product) == null ? void 0 : _c.discount_list) || ((_f = (_e = (_d = item == null ? void 0 : item._originData) == null ? void 0 : _d.product) == null ? void 0 : _e.discount_list) == null ? void 0 : _f.filter((item2) => {
449
- var _a2;
450
- return !((_a2 = item2 == null ? void 0 : item2.metadata) == null ? void 0 : _a2.custom_product_bundle_map_id);
451
- })) || [];
452
- const mainProductDiscountAmount = getDiscountAmount(discount);
453
- total = total.minus(mainProductDiscountAmount);
454
- if ((item == null ? void 0 : item.option) && Array.isArray(item == null ? void 0 : item.option)) {
455
- total = total.add(item == null ? void 0 : item.option.reduce((t, option) => {
456
- return t.add(new import_decimal.default(option.price || 0).mul(option.num || 1));
457
- }, new import_decimal.default(0)));
452
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
453
+ let total = new import_decimal.default(
454
+ (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
455
+ );
456
+ 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;
457
+ if (!hasMainProductPrice) {
458
+ 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);
459
+ 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) => {
460
+ var _a2;
461
+ return !((_a2 = item2 == null ? void 0 : item2.metadata) == null ? void 0 : _a2.custom_product_bundle_map_id);
462
+ })) || [];
463
+ const mainProductDiscountAmount = getDiscountAmount(discount);
464
+ total = total.minus(mainProductDiscountAmount);
465
+ if ((item == null ? void 0 : item.option) && Array.isArray(item == null ? void 0 : item.option)) {
466
+ total = total.add(item == null ? void 0 : item.option.reduce((t, option) => {
467
+ return t.add(new import_decimal.default(option.price || 0).mul(option.num || 1));
468
+ }, new import_decimal.default(0)));
469
+ }
458
470
  }
459
471
  for (let bundleItem of (item == null ? void 0 : item.bundle) || []) {
460
472
  if (getBundleItemIsMarkupOrDiscountPrice(bundleItem)) {
@@ -799,7 +811,6 @@ function resetItemsSurchargeSideEffects({ service, addons }) {
799
811
  0 && (module.exports = {
800
812
  calcDiscountListDifference,
801
813
  calculateDeposit,
802
- calculateOriginSubtotal,
803
814
  calculatePriceDetails,
804
815
  calculateSubtotal,
805
816
  calculateTaxFee,
@@ -11,4 +11,9 @@ export * from './Payment';
11
11
  export * from './Resource';
12
12
  export * from './Step';
13
13
  export * from './Summary';
14
+ export * from './SalesSummary';
14
15
  export * from './Schedule';
16
+ export * from './Quotation';
17
+ export * from './ScanOrderLogger';
18
+ export * from './OpenData';
19
+ export * from './Holder';
@@ -29,7 +29,12 @@ __reExport(modules_exports, require("./Payment"), module.exports);
29
29
  __reExport(modules_exports, require("./Resource"), module.exports);
30
30
  __reExport(modules_exports, require("./Step"), module.exports);
31
31
  __reExport(modules_exports, require("./Summary"), module.exports);
32
+ __reExport(modules_exports, require("./SalesSummary"), module.exports);
32
33
  __reExport(modules_exports, require("./Schedule"), module.exports);
34
+ __reExport(modules_exports, require("./Quotation"), module.exports);
35
+ __reExport(modules_exports, require("./ScanOrderLogger"), module.exports);
36
+ __reExport(modules_exports, require("./OpenData"), module.exports);
37
+ __reExport(modules_exports, require("./Holder"), module.exports);
33
38
  // Annotate the CommonJS export names for ESM import in node:
34
39
  0 && (module.exports = {
35
40
  ...require("./Product"),
@@ -45,5 +50,10 @@ __reExport(modules_exports, require("./Schedule"), module.exports);
45
50
  ...require("./Resource"),
46
51
  ...require("./Step"),
47
52
  ...require("./Summary"),
48
- ...require("./Schedule")
53
+ ...require("./SalesSummary"),
54
+ ...require("./Schedule"),
55
+ ...require("./Quotation"),
56
+ ...require("./ScanOrderLogger"),
57
+ ...require("./OpenData"),
58
+ ...require("./Holder")
49
59
  });
@@ -1,5 +1,5 @@
1
- import { WalletPassEvaluator } from '../model';
2
1
  import { Plugin } from '../types';
2
+ import type { WalletPassEvaluator } from '../model/strategy/adapter/walletPass/evaluator';
3
3
  /**
4
4
  * WindowPlugin 接口定义
5
5
  */
@@ -15,7 +15,8 @@ export interface WindowPlugin extends Plugin {
15
15
  document: Partial<Document>;
16
16
  history: History;
17
17
  interaction?: any;
18
- getWalletPassEvaluator?: () => WalletPassEvaluator;
18
+ getWalletPassEvaluator?: () => WalletPassEvaluator | undefined;
19
+ getLocalStorage?: (key: string) => string | null;
19
20
  }
20
21
  /**
21
22
  * 简单的 Storage 接口实现
@@ -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[]>;
@@ -144,7 +159,6 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
144
159
  getSummary(): Promise<{
145
160
  subtotal: string | number;
146
161
  total: string | number;
147
- originTotal: string | number;
148
162
  taxTitle?: string | undefined;
149
163
  totalTaxFee?: string | number | undefined;
150
164
  isPriceIncludeTax?: 0 | 1 | undefined;
@@ -302,7 +316,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
302
316
  autoSelectAllProductResources(resources_code: string, timeSlots?: TimeSliceItem): {
303
317
  errorList: any[];
304
318
  };
305
- getTimeSlotByAllResources(resources_code: string): any[];
319
+ getTimeSlotByAllResources(resources_code: string, split?: number): any[];
306
320
  getTimeSlotByAllResourcesForDate({ resources_code, startDate, endDate }: {
307
321
  resources_code: string;
308
322
  startDate: string;
@@ -311,7 +325,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
311
325
  date: string;
312
326
  status: string;
313
327
  week: string;
314
- weekNum: 0 | 1 | 2 | 5 | 3 | 4 | 6;
328
+ weekNum: 0 | 2 | 1 | 5 | 3 | 4 | 6;
315
329
  }[]>;
316
330
  submitTimeSlot(timeSlots: TimeSliceItem): void;
317
331
  private getScheduleDataByIds;