@pisell/pisellos 2.2.147 → 2.2.149

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 (247) hide show
  1. package/dist/apis/picoding.d.ts +0 -0
  2. package/dist/apis/picoding.js +1 -0
  3. package/dist/model/strategy/adapter/index.d.ts +2 -0
  4. package/dist/model/strategy/adapter/index.js +3 -1
  5. package/dist/model/strategy/adapter/itemRule/adapter.d.ts +67 -0
  6. package/dist/model/strategy/adapter/itemRule/adapter.js +483 -0
  7. package/dist/model/strategy/adapter/itemRule/evaluator.d.ts +43 -0
  8. package/dist/model/strategy/adapter/itemRule/evaluator.js +169 -0
  9. package/dist/model/strategy/adapter/itemRule/examples.d.ts +79 -0
  10. package/dist/model/strategy/adapter/itemRule/examples.js +382 -0
  11. package/dist/model/strategy/adapter/itemRule/index.d.ts +5 -0
  12. package/dist/model/strategy/adapter/itemRule/index.js +5 -0
  13. package/dist/model/strategy/adapter/itemRule/type.d.ts +225 -0
  14. package/dist/model/strategy/adapter/itemRule/type.js +101 -0
  15. package/dist/modules/Cart/types.d.ts +2 -0
  16. package/dist/modules/Cart/utils/cartProduct.js +22 -1
  17. package/dist/modules/Cart/utils/changePrice.js +6 -0
  18. package/dist/modules/Date/index.d.ts +1 -1
  19. package/dist/modules/Date/index.js +16 -8
  20. package/dist/modules/Date/types.d.ts +3 -1
  21. package/dist/modules/OpenData/index.d.ts +24 -0
  22. package/dist/modules/OpenData/index.js +173 -0
  23. package/dist/modules/OpenData/types.d.ts +73 -0
  24. package/dist/modules/OpenData/types.js +1 -0
  25. package/dist/modules/OpenData/utils.d.ts +2 -0
  26. package/dist/modules/OpenData/utils.js +75 -0
  27. package/dist/modules/Order/index.d.ts +171 -1
  28. package/dist/modules/Order/index.js +2052 -112
  29. package/dist/modules/Order/types.d.ts +441 -20
  30. package/dist/modules/Order/types.js +23 -0
  31. package/dist/modules/Order/utils.d.ts +120 -0
  32. package/dist/modules/Order/utils.js +653 -2
  33. package/dist/modules/Product/utils.js +2 -2
  34. package/dist/modules/ProductList/index.js +2 -1
  35. package/dist/modules/Quotation/index.d.ts +8 -1
  36. package/dist/modules/Quotation/index.js +40 -10
  37. package/dist/modules/Quotation/types.d.ts +5 -0
  38. package/dist/modules/Rules/index.d.ts +3 -1
  39. package/dist/modules/Rules/index.js +136 -50
  40. package/dist/modules/Rules/types.d.ts +6 -0
  41. package/dist/modules/Rules/types.js +8 -0
  42. package/dist/modules/SalesSummary/index.d.ts +70 -0
  43. package/dist/modules/SalesSummary/index.js +175 -0
  44. package/dist/modules/SalesSummary/types.d.ts +64 -0
  45. package/dist/modules/SalesSummary/types.js +1 -0
  46. package/dist/modules/SalesSummary/utils.d.ts +34 -0
  47. package/dist/modules/SalesSummary/utils.js +488 -0
  48. package/dist/modules/ScanOrderLogger/index.d.ts +21 -0
  49. package/dist/modules/ScanOrderLogger/index.js +161 -0
  50. package/dist/modules/ScanOrderLogger/providers/feishu.d.ts +2 -0
  51. package/dist/modules/ScanOrderLogger/providers/feishu.js +203 -0
  52. package/dist/modules/ScanOrderLogger/providers/grafana.d.ts +2 -0
  53. package/dist/modules/ScanOrderLogger/providers/grafana.js +50 -0
  54. package/dist/modules/ScanOrderLogger/types.d.ts +52 -0
  55. package/dist/modules/ScanOrderLogger/types.js +1 -0
  56. package/dist/modules/Schedule/getDateIsInSchedule.js +7 -7
  57. package/dist/modules/Schedule/index.d.ts +4 -13
  58. package/dist/modules/Schedule/index.js +6 -23
  59. package/dist/modules/Schedule/utils.d.ts +1 -1
  60. package/dist/modules/Summary/index.d.ts +3 -0
  61. package/dist/modules/Summary/index.js +134 -15
  62. package/dist/modules/Summary/types.d.ts +7 -0
  63. package/dist/modules/Summary/utils.d.ts +104 -1
  64. package/dist/modules/Summary/utils.js +1116 -13
  65. package/dist/modules/index.d.ts +4 -0
  66. package/dist/modules/index.js +5 -1
  67. package/dist/server/index.d.ts +41 -4
  68. package/dist/server/index.js +900 -405
  69. package/dist/server/modules/order/index.d.ts +10 -2
  70. package/dist/server/modules/order/index.js +251 -196
  71. package/dist/server/modules/products/index.d.ts +26 -0
  72. package/dist/server/modules/products/index.js +618 -338
  73. package/dist/server/modules/products/types.d.ts +5 -1
  74. package/dist/solution/BaseSales/index.d.ts +175 -0
  75. package/dist/solution/BaseSales/index.js +1293 -0
  76. package/dist/solution/BaseSales/types.d.ts +305 -0
  77. package/dist/solution/BaseSales/types.js +38 -0
  78. package/dist/solution/BaseSales/utils/parseSalesResponse.d.ts +143 -0
  79. package/dist/solution/BaseSales/utils/parseSalesResponse.js +159 -0
  80. package/dist/solution/BaseSales/utils.d.ts +40 -0
  81. package/dist/solution/BaseSales/utils.js +222 -0
  82. package/dist/solution/BookingByStep/index.d.ts +14 -0
  83. package/dist/solution/BookingByStep/index.js +699 -212
  84. package/dist/solution/BookingByStep/types.d.ts +3 -1
  85. package/dist/solution/BookingByStep/types.js +5 -1
  86. package/dist/solution/BookingByStep/utils/capacity.js +1 -1
  87. package/dist/solution/BookingByStep/utils/resources.js +6 -1
  88. package/dist/solution/BookingTicket/index.d.ts +113 -15
  89. package/dist/solution/BookingTicket/index.js +534 -196
  90. package/dist/solution/BookingTicket/types.d.ts +69 -6
  91. package/dist/solution/BookingTicket/types.js +40 -9
  92. package/dist/solution/BookingTicket/utils/bookingStatus.d.ts +37 -0
  93. package/dist/solution/BookingTicket/utils/bookingStatus.js +66 -0
  94. package/dist/solution/BookingTicket/utils/cartView.d.ts +26 -0
  95. package/dist/solution/BookingTicket/utils/cartView.js +84 -0
  96. package/dist/solution/Sales/index.d.ts +1 -0
  97. package/dist/solution/Sales/index.js +1 -0
  98. package/dist/solution/ScanOrder/index.d.ts +146 -0
  99. package/dist/solution/ScanOrder/index.js +3029 -0
  100. package/dist/solution/ScanOrder/types.d.ts +305 -0
  101. package/dist/solution/ScanOrder/types.js +35 -0
  102. package/dist/solution/ScanOrder/utils.d.ts +167 -0
  103. package/dist/solution/ScanOrder/utils.js +768 -0
  104. package/dist/solution/ShopDiscount/index.d.ts +2 -0
  105. package/dist/solution/ShopDiscount/index.js +9 -5
  106. package/dist/solution/ShopDiscount/types.d.ts +4 -0
  107. package/dist/solution/VenueBooking/index.d.ts +197 -0
  108. package/dist/solution/VenueBooking/index.js +3411 -0
  109. package/dist/solution/VenueBooking/sales-section-4-annotated.json +343 -0
  110. package/dist/solution/VenueBooking/types.d.ts +153 -0
  111. package/dist/solution/VenueBooking/types.js +21 -0
  112. package/dist/solution/VenueBooking/utils/dateSummary.d.ts +11 -0
  113. package/dist/solution/VenueBooking/utils/dateSummary.js +104 -0
  114. package/dist/solution/VenueBooking/utils/resource.d.ts +14 -0
  115. package/dist/solution/VenueBooking/utils/resource.js +130 -0
  116. package/dist/solution/VenueBooking/utils/slotMerge.d.ts +34 -0
  117. package/dist/solution/VenueBooking/utils/slotMerge.js +224 -0
  118. package/dist/solution/VenueBooking/utils/timeSlot.d.ts +32 -0
  119. package/dist/solution/VenueBooking/utils/timeSlot.js +453 -0
  120. package/dist/solution/VenueBooking/utils.d.ts +1 -0
  121. package/dist/solution/VenueBooking/utils.js +1 -0
  122. package/dist/solution/index.d.ts +3 -0
  123. package/dist/solution/index.js +4 -1
  124. package/lib/apis/picoding.d.ts +0 -0
  125. package/lib/apis/picoding.js +0 -0
  126. package/lib/model/strategy/adapter/index.d.ts +2 -0
  127. package/lib/model/strategy/adapter/index.js +6 -0
  128. package/lib/model/strategy/adapter/itemRule/adapter.d.ts +67 -0
  129. package/lib/model/strategy/adapter/itemRule/adapter.js +377 -0
  130. package/lib/model/strategy/adapter/itemRule/evaluator.d.ts +43 -0
  131. package/lib/model/strategy/adapter/itemRule/evaluator.js +124 -0
  132. package/lib/model/strategy/adapter/itemRule/examples.d.ts +79 -0
  133. package/lib/model/strategy/adapter/itemRule/examples.js +316 -0
  134. package/lib/model/strategy/adapter/itemRule/index.d.ts +5 -0
  135. package/lib/model/strategy/adapter/itemRule/index.js +60 -0
  136. package/lib/model/strategy/adapter/itemRule/type.d.ts +225 -0
  137. package/lib/model/strategy/adapter/itemRule/type.js +46 -0
  138. package/lib/model/strategy/adapter/promotion/index.js +49 -0
  139. package/lib/modules/Cart/types.d.ts +2 -0
  140. package/lib/modules/Cart/utils/cartProduct.js +17 -1
  141. package/lib/modules/Cart/utils/changePrice.js +5 -0
  142. package/lib/modules/Date/index.d.ts +1 -1
  143. package/lib/modules/Date/index.js +7 -1
  144. package/lib/modules/Date/types.d.ts +3 -1
  145. package/lib/modules/OpenData/index.d.ts +24 -0
  146. package/lib/modules/OpenData/index.js +119 -0
  147. package/lib/modules/OpenData/types.d.ts +73 -0
  148. package/lib/modules/OpenData/types.js +17 -0
  149. package/lib/modules/OpenData/utils.d.ts +2 -0
  150. package/lib/modules/OpenData/utils.js +111 -0
  151. package/lib/modules/Order/index.d.ts +171 -1
  152. package/lib/modules/Order/index.js +1396 -5
  153. package/lib/modules/Order/types.d.ts +441 -20
  154. package/lib/modules/Order/types.js +1 -0
  155. package/lib/modules/Order/utils.d.ts +120 -0
  156. package/lib/modules/Order/utils.js +562 -2
  157. package/lib/modules/Product/utils.js +2 -2
  158. package/lib/modules/ProductList/index.js +2 -1
  159. package/lib/modules/Quotation/index.d.ts +8 -1
  160. package/lib/modules/Quotation/index.js +33 -4
  161. package/lib/modules/Quotation/types.d.ts +5 -0
  162. package/lib/modules/Rules/index.d.ts +3 -1
  163. package/lib/modules/Rules/index.js +46 -6
  164. package/lib/modules/Rules/types.d.ts +6 -0
  165. package/lib/modules/Rules/types.js +11 -2
  166. package/lib/modules/SalesSummary/index.d.ts +70 -0
  167. package/lib/modules/SalesSummary/index.js +106 -0
  168. package/lib/modules/SalesSummary/types.d.ts +64 -0
  169. package/lib/modules/SalesSummary/types.js +17 -0
  170. package/lib/modules/SalesSummary/utils.d.ts +34 -0
  171. package/lib/modules/SalesSummary/utils.js +430 -0
  172. package/lib/modules/ScanOrderLogger/index.d.ts +21 -0
  173. package/lib/modules/ScanOrderLogger/index.js +135 -0
  174. package/lib/modules/ScanOrderLogger/providers/feishu.d.ts +2 -0
  175. package/lib/modules/ScanOrderLogger/providers/feishu.js +148 -0
  176. package/lib/modules/ScanOrderLogger/providers/grafana.d.ts +2 -0
  177. package/lib/modules/ScanOrderLogger/providers/grafana.js +52 -0
  178. package/lib/modules/ScanOrderLogger/types.d.ts +52 -0
  179. package/lib/modules/ScanOrderLogger/types.js +17 -0
  180. package/lib/modules/Schedule/getDateIsInSchedule.js +5 -5
  181. package/lib/modules/Schedule/index.d.ts +4 -13
  182. package/lib/modules/Schedule/index.js +4 -15
  183. package/lib/modules/Schedule/utils.d.ts +1 -1
  184. package/lib/modules/Summary/index.d.ts +3 -0
  185. package/lib/modules/Summary/index.js +61 -2
  186. package/lib/modules/Summary/types.d.ts +7 -0
  187. package/lib/modules/Summary/utils.d.ts +104 -1
  188. package/lib/modules/Summary/utils.js +659 -8
  189. package/lib/modules/index.d.ts +4 -0
  190. package/lib/modules/index.js +9 -1
  191. package/lib/server/index.d.ts +41 -4
  192. package/lib/server/index.js +272 -10
  193. package/lib/server/modules/order/index.d.ts +10 -2
  194. package/lib/server/modules/order/index.js +31 -4
  195. package/lib/server/modules/products/index.d.ts +26 -0
  196. package/lib/server/modules/products/index.js +174 -22
  197. package/lib/server/modules/products/types.d.ts +5 -1
  198. package/lib/solution/BaseSales/index.d.ts +175 -0
  199. package/lib/solution/BaseSales/index.js +655 -0
  200. package/lib/solution/BaseSales/types.d.ts +305 -0
  201. package/lib/solution/BaseSales/types.js +40 -0
  202. package/lib/solution/BaseSales/utils/parseSalesResponse.d.ts +143 -0
  203. package/lib/solution/BaseSales/utils/parseSalesResponse.js +160 -0
  204. package/lib/solution/BaseSales/utils.d.ts +40 -0
  205. package/lib/solution/BaseSales/utils.js +200 -0
  206. package/lib/solution/BookingByStep/index.d.ts +14 -0
  207. package/lib/solution/BookingByStep/index.js +469 -91
  208. package/lib/solution/BookingByStep/types.d.ts +3 -1
  209. package/lib/solution/BookingByStep/types.js +10 -0
  210. package/lib/solution/BookingByStep/utils/capacity.js +1 -1
  211. package/lib/solution/BookingByStep/utils/resources.js +5 -2
  212. package/lib/solution/BookingTicket/index.d.ts +113 -15
  213. package/lib/solution/BookingTicket/index.js +253 -61
  214. package/lib/solution/BookingTicket/types.d.ts +69 -6
  215. package/lib/solution/BookingTicket/types.js +16 -14
  216. package/lib/solution/BookingTicket/utils/bookingStatus.d.ts +37 -0
  217. package/lib/solution/BookingTicket/utils/bookingStatus.js +65 -0
  218. package/lib/solution/BookingTicket/utils/cartView.d.ts +26 -0
  219. package/lib/solution/BookingTicket/utils/cartView.js +103 -0
  220. package/lib/solution/Sales/index.d.ts +1 -0
  221. package/lib/solution/ScanOrder/index.d.ts +146 -0
  222. package/lib/solution/ScanOrder/index.js +1820 -0
  223. package/lib/solution/ScanOrder/types.d.ts +305 -0
  224. package/lib/solution/ScanOrder/types.js +36 -0
  225. package/lib/solution/ScanOrder/utils.d.ts +167 -0
  226. package/lib/solution/ScanOrder/utils.js +639 -0
  227. package/lib/solution/ShopDiscount/index.d.ts +2 -0
  228. package/lib/solution/ShopDiscount/index.js +9 -4
  229. package/lib/solution/ShopDiscount/types.d.ts +4 -0
  230. package/lib/solution/VenueBooking/index.d.ts +197 -0
  231. package/lib/solution/VenueBooking/index.js +1892 -0
  232. package/lib/solution/VenueBooking/sales-section-4-annotated.json +343 -0
  233. package/lib/solution/VenueBooking/types.d.ts +153 -0
  234. package/lib/solution/VenueBooking/types.js +44 -0
  235. package/lib/solution/VenueBooking/utils/dateSummary.d.ts +11 -0
  236. package/lib/solution/VenueBooking/utils/dateSummary.js +110 -0
  237. package/lib/solution/VenueBooking/utils/resource.d.ts +14 -0
  238. package/lib/solution/VenueBooking/utils/resource.js +91 -0
  239. package/lib/solution/VenueBooking/utils/slotMerge.d.ts +34 -0
  240. package/lib/solution/VenueBooking/utils/slotMerge.js +225 -0
  241. package/lib/solution/VenueBooking/utils/timeSlot.d.ts +32 -0
  242. package/lib/solution/VenueBooking/utils/timeSlot.js +339 -0
  243. package/lib/solution/VenueBooking/utils.d.ts +1 -0
  244. package/lib/solution/VenueBooking/utils.js +69 -0
  245. package/lib/solution/index.d.ts +3 -0
  246. package/lib/solution/index.js +7 -1
  247. package/package.json +1 -1
@@ -0,0 +1,148 @@
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;
116
+ cachedProviderConfig = payload.providerConfig;
117
+ const webhook = (_b = (_a = payload.providerConfig) == null ? void 0 : _a.feishu) == null ? void 0 : _b.webhook;
118
+ if (!webhook) {
119
+ console.warn("[ScanOrderLogger] Feishu webhook 未配置,跳过日志上报");
120
+ return;
121
+ }
122
+ if (!isWebhookUsable(webhook))
123
+ return;
124
+ if (typeof fetch !== "function") {
125
+ console.warn("[ScanOrderLogger] 当前环境不支持 fetch,跳过 Feishu 日志上报");
126
+ return;
127
+ }
128
+ const throttleMs = ((_d = (_c = payload.providerConfig) == null ? void 0 : _c.feishu) == null ? void 0 : _d.throttleMs) ?? DEFAULT_THROTTLE_MS;
129
+ if (throttleMs <= 0) {
130
+ try {
131
+ await postToFeishu(webhook, buildFeishuBody([payload.record]));
132
+ } catch (error) {
133
+ console.warn("[ScanOrderLogger] Feishu 日志上报失败", error);
134
+ }
135
+ return;
136
+ }
137
+ pendingQueue.push(payload.record);
138
+ if (!flushTimer) {
139
+ flushTimer = setTimeout(() => {
140
+ void flushQueue();
141
+ }, throttleMs);
142
+ }
143
+ }
144
+ };
145
+ // Annotate the CommonJS export names for ESM import in node:
146
+ 0 && (module.exports = {
147
+ feishuLoggerProvider
148
+ });
@@ -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,52 @@
1
+ export type ScanOrderLogLevel = 'info' | 'warning' | 'error' | 'debug';
2
+ export type ScanOrderLoggerProviderType = 'feishu' | 'grafana';
3
+ export interface ScanOrderLoggerProviderFeishuConfig {
4
+ webhook?: string;
5
+ /**
6
+ * 节流窗口毫秒数,默认 3000ms
7
+ * - >0:首条日志进入队列并启动定时器,窗口结束后合并成一条 Feishu post 统一发送
8
+ * - <=0:关闭节流,保持每条日志立即单独发送
9
+ */
10
+ throttleMs?: number;
11
+ }
12
+ export interface ScanOrderLoggerProviderGrafanaConfig {
13
+ endpoint?: string;
14
+ headers?: Record<string, string>;
15
+ }
16
+ export interface ScanOrderLoggerProviderConfig {
17
+ feishu?: ScanOrderLoggerProviderFeishuConfig;
18
+ grafana?: ScanOrderLoggerProviderGrafanaConfig;
19
+ }
20
+ export interface ScanOrderLoggerContext {
21
+ cacheId?: string;
22
+ solutionName?: string;
23
+ moduleName?: string;
24
+ [key: string]: any;
25
+ }
26
+ export interface ScanOrderLogInput {
27
+ level?: ScanOrderLogLevel;
28
+ title: string;
29
+ payload?: Record<string, any>;
30
+ extra?: Record<string, any>;
31
+ timestamp?: string;
32
+ }
33
+ export interface ScanOrderLogRecord {
34
+ level: ScanOrderLogLevel;
35
+ title: string;
36
+ timestamp: string;
37
+ payload: Record<string, any>;
38
+ extra: Record<string, any>;
39
+ context: ScanOrderLoggerContext;
40
+ }
41
+ export interface ScanOrderLoggerDispatchPayload {
42
+ record: ScanOrderLogRecord;
43
+ providerConfig?: ScanOrderLoggerProviderConfig;
44
+ }
45
+ export interface ScanOrderLoggerProvider {
46
+ send: (payload: ScanOrderLoggerDispatchPayload) => Promise<void>;
47
+ }
48
+ export interface ScanOrderLoggerState {
49
+ provider: ScanOrderLoggerProviderType;
50
+ providerConfig: ScanOrderLoggerProviderConfig;
51
+ context: ScanOrderLoggerContext;
52
+ }
@@ -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,13 +80,13 @@ 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`;
88
+ const slotStart = `${targetDateString} ${timeSlot.start_time}:00`;
89
+ const slotEnd = `${targetDateString} ${timeSlot.end_time}:00`;
90
90
  const slotStartDate = (0, import_dayjs.default)(slotStart);
91
91
  const slotEndDate = (0, import_dayjs.default)(slotEnd);
92
92
  if (targetDate.isSameOrAfter(slotStartDate) && targetDate.isSameOrBefore(slotEndDate)) {
@@ -26,19 +26,10 @@ export declare class ScheduleModule extends BaseModule implements Module, Schedu
26
26
  getOtherProductsIds(): number[];
27
27
  storeChange(): void;
28
28
  /**
29
- * 传入一个时间, 判断改时间是否在schedule 内
30
- * @param param0 { date: string, schedule: any } date: 日期, schedule: schedule
31
- * @returns
32
- */
33
- isInScheduleByDate({ date, schedule, }: {
34
- date: string;
35
- schedule: any;
36
- }): boolean;
37
- /**
38
- * 传入一个时间, 判断改时间是否在schedule 内
39
- * @param param0 { date: string, schedule: any } date: 日期, schedule: schedule
40
- * @returns
41
- */
29
+ * 传入一个时间, 判断改时间是否在schedule 内
30
+ * @param param0 { date: string, schedule: any } date: 日期, schedule: schedule
31
+ * @returns
32
+ */
42
33
  static isInScheduleByDate({ date, schedule, }: {
43
34
  date: string;
44
35
  schedule: any;
@@ -161,21 +161,10 @@ var ScheduleModule = class extends import_BaseModule.BaseModule {
161
161
  }
162
162
  }
163
163
  /**
164
- * 传入一个时间, 判断改时间是否在schedule 内
165
- * @param param0 { date: string, schedule: any } date: 日期, schedule: schedule
166
- * @returns
167
- */
168
- isInScheduleByDate({
169
- date,
170
- schedule
171
- }) {
172
- return ScheduleModule.isInScheduleByDate({ date, schedule });
173
- }
174
- /**
175
- * 传入一个时间, 判断改时间是否在schedule 内
176
- * @param param0 { date: string, schedule: any } date: 日期, schedule: schedule
177
- * @returns
178
- */
164
+ * 传入一个时间, 判断改时间是否在schedule 内
165
+ * @param param0 { date: string, schedule: any } date: 日期, schedule: schedule
166
+ * @returns
167
+ */
179
168
  static isInScheduleByDate({
180
169
  date,
181
170
  schedule
@@ -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:
@@ -13,6 +13,7 @@ export declare class SummaryModule extends BaseModule implements Module, ISummar
13
13
  private fatherModule;
14
14
  constructor(name?: string, version?: string);
15
15
  initialize(core: PisellCore, options: ModuleOptions): Promise<void>;
16
+ getSurchargeList(): Promise<void>;
16
17
  getSummary(cartItems: CartItem[]): Promise<ISummaryState['summary']>;
17
18
  /**
18
19
  * 获取协议
@@ -21,4 +22,6 @@ export declare class SummaryModule extends BaseModule implements Module, ISummar
21
22
  */
22
23
  getProtocol(protocolId: string): Promise<any>;
23
24
  storeChange(): void;
25
+ private getTaxforUtils;
26
+ private getSurchargeforUtils;
24
27
  }
@@ -1,6 +1,8 @@
1
+ var __create = Object.create;
1
2
  var __defProp = Object.defineProperty;
2
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
4
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
7
  var __export = (target, all) => {
6
8
  for (var name in all)
@@ -14,6 +16,14 @@ var __copyProps = (to, from, except, desc) => {
14
16
  }
15
17
  return to;
16
18
  };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
17
27
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
28
 
19
29
  // src/modules/Summary/index.ts
@@ -22,7 +32,9 @@ __export(Summary_exports, {
22
32
  SummaryModule: () => SummaryModule
23
33
  });
24
34
  module.exports = __toCommonJS(Summary_exports);
35
+ var import_decimal = __toESM(require("decimal.js"));
25
36
  var import_BaseModule = require("../BaseModule");
37
+ var import_Schedule = require("../Schedule");
26
38
  var import_utils = require("./utils");
27
39
  var SummaryModule = class extends import_BaseModule.BaseModule {
28
40
  constructor(name, version) {
@@ -50,11 +62,30 @@ var SummaryModule = class extends import_BaseModule.BaseModule {
50
62
  if (!this.shopStore) {
51
63
  throw new Error("SummaryModule 需要 shopStore 插件支持");
52
64
  }
65
+ this.getSurchargeList();
66
+ }
67
+ async getSurchargeList() {
68
+ const surchargeList = await this.request.get("/order/custom-surcharge/available/v2", {
69
+ channel: "online-store",
70
+ is_assemble_product_data: 1,
71
+ is_assemble_schedule_data: 1,
72
+ with: ["relationSchedule"]
73
+ });
74
+ this.store.surchargeList = (surchargeList == null ? void 0 : surchargeList.data) || [];
53
75
  }
54
76
  async getSummary(cartItems) {
55
- var _a, _b;
77
+ var _a, _b, _c;
56
78
  const shopInfo = ((_b = (_a = this.shopStore.get("core")) == null ? void 0 : _a.core) == null ? void 0 : _b.shop) || {};
57
- const summary = (0, import_utils.calculatePriceDetails)(shopInfo, cartItems);
79
+ const scheduleModule = this.core.getModule("appointmentBooking_schedule");
80
+ const needScheduleIds = this.store.surchargeList.map((item) => item.available_schedule_ids).flat();
81
+ const scheduleList = scheduleModule == null ? void 0 : scheduleModule.getScheduleListByIds(needScheduleIds);
82
+ const scheduleById = {};
83
+ if (Array.isArray(scheduleList)) {
84
+ for (let item of scheduleList) {
85
+ scheduleById[item.id] = item;
86
+ }
87
+ }
88
+ const summary = (0, import_utils.calculatePriceDetails)(shopInfo, cartItems, (_c = import_Schedule.ScheduleModule) == null ? void 0 : _c.isInScheduleByDate, this.store.surchargeList, scheduleById);
58
89
  this.store.summary = summary;
59
90
  return this.store.summary;
60
91
  }
@@ -76,6 +107,34 @@ var SummaryModule = class extends import_BaseModule.BaseModule {
76
107
  });
77
108
  }
78
109
  }
110
+ getTaxforUtils(items, shopInfo, subtotal) {
111
+ return (0, import_utils.getTax)({ service: items, bookingDetail: null, bookingId: void 0 }, {
112
+ computed: {
113
+ productExpectAmount: subtotal,
114
+ shopDiscount: 0
115
+ },
116
+ isEdit: false,
117
+ tax_rate: shopInfo == null ? void 0 : shopInfo.tax_rate,
118
+ is_price_include_tax: shopInfo == null ? void 0 : shopInfo.is_price_include_tax
119
+ });
120
+ }
121
+ getSurchargeforUtils(items) {
122
+ const scheduleModule = this.core.getModule("appointmentBooking_schedule");
123
+ const needScheduleIds = this.store.surchargeList.map((item) => item.available_schedule_ids).flat();
124
+ const scheduleList = scheduleModule == null ? void 0 : scheduleModule.getScheduleListByIds(needScheduleIds);
125
+ const scheduleById = {};
126
+ if (Array.isArray(scheduleList)) {
127
+ for (let item of scheduleList) {
128
+ scheduleById[item.id] = item;
129
+ }
130
+ }
131
+ const surchargeList = (0, import_utils.getSurcharge)({ service: items, addons: [], bookingDetail: null, bookingId: void 0 }, { isEdit: false, isInScheduleByDate: import_Schedule.ScheduleModule.isInScheduleByDate, surcharge_list: this.store.surchargeList, scheduleById });
132
+ const surchargeAmount = new import_decimal.default((0, import_utils.getSurchargeAmount)({ bookingDetail: null, bookingId: void 0 }, surchargeList, { isEdit: false }));
133
+ return {
134
+ surchargeList,
135
+ surchargeAmount: surchargeAmount.toFixed(2)
136
+ };
137
+ }
79
138
  };
80
139
  // Annotate the CommonJS export names for ESM import in node:
81
140
  0 && (module.exports = {
@@ -1,5 +1,6 @@
1
1
  import { CartItem } from '../Cart/types';
2
2
  export interface ISummaryState {
3
+ surchargeList: any[];
3
4
  summary: {
4
5
  /** 商品总价 */
5
6
  subtotal: string | number;
@@ -13,6 +14,12 @@ export interface ISummaryState {
13
14
  totalTaxFee?: string | number;
14
15
  /** 商品价格是否包含费率 */
15
16
  isPriceIncludeTax?: 0 | 1;
17
+ /** 附加费金额 */
18
+ surchargeAmount?: string | number;
19
+ /** 附加费列表 */
20
+ surcharge?: any[];
21
+ /** 税率 */
22
+ taxRate?: string | number;
16
23
  /** 定金 */
17
24
  deposit?: {
18
25
  /** 定金总价 */
@@ -1,12 +1,57 @@
1
1
  import Decimal from 'decimal.js';
2
2
  import { CartItem } from '../Cart/types';
3
3
  import { ISummaryState } from './types';
4
- export declare const calculatePriceDetails: (shopInfo: any, items: CartItem[]) => ISummaryState['summary'];
4
+ export declare const calculatePriceDetails: (shopInfo: any, items: CartItem[], isInScheduleByDate: any, surchargeList: any[], scheduleById: Record<string, any>) => ISummaryState['summary'];
5
5
  /**
6
6
  * 获取子商品折扣信息
7
7
  * @param item
8
8
  */
9
9
  export declare const getBundleDiscountList: (bundle: any[]) => any[];
10
+ export declare const calcDiscountListDifference: (discountList: any[]) => number;
11
+ export declare const getProductDiscountProductDiscountDifference: (item: CartItem) => number;
12
+ /**
13
+ * 计算订单税费(折扣前/折扣后),并把单品税费信息回写到商品数据上(用于明细展示/后续计算)。
14
+ *
15
+ * - **折扣前税费**:`originTax`
16
+ * - **折扣后税费**:`tax`(会考虑 `computed.shopDiscount` 对每个商品的分摊影响)
17
+ * - **税率/是否含税**:优先取 `bookingDetail.tax_rate` / `bookingDetail.is_price_include_tax`,取不到再回退到 `options.tax_rate` / `options.is_price_include_tax`
18
+ *
19
+ * **副作用(会修改入参商品对象)**:
20
+ * - 主商品:写入 `item.original_tax_fee` / `item.tax_fee`(四舍五入保留两位)
21
+ * - bundle 原价子商品:写入 `bundleItem.original_tax_fee` / `bundleItem.tax_fee`
22
+ * - 加时商品(`relation_details`):写入 `atItem.tax_fee`
23
+ * - 税费舍入差值:追加到最后一个“含税商品”的 `tax_fee_rounding_remainder` / `original_tax_fee_rounding_remainder`
24
+ *
25
+ * @param params 入参集合(RORO)
26
+ * @param params.service 服务商品数组(主商品)。通常是购物车商品结构(可能包含 `bundle` / `relation_details`)
27
+ * @param params.addons 附加商品数组(可选)。结构同商品数组
28
+ * @param params.bookingDetail 订单详情(编辑/详情场景用于读取后端税率配置),可选
29
+ * @param params.bookingId 订单/预约 ID(编辑/详情场景识别用),可选
30
+ * @param options 计算选项
31
+ * @param options.isEdit 是否处于“编辑中”。当前实现不强依赖该值(历史逻辑保留),但建议按真实状态传入
32
+ * @param options.computed 预计算结果(用于折扣分摊)
33
+ * @param options.computed.productExpectAmount 商品期望总金额(用于按比例分摊折扣)
34
+ * @param options.computed.shopDiscount 店铺折扣总额(用于按比例分摊到商品)
35
+ * @param options.tax_rate 管理端税率(百分比,如 5 表示 5%)。仅当 `bookingDetail.tax_rate` 不存在时生效
36
+ * @param options.is_price_include_tax 是否含税:`0` 不含税、`1` 含税。仅当 `bookingDetail.is_price_include_tax` 不存在时生效
37
+ * @returns 税费汇总(number,金额单位与商品价格一致,四舍五入保留两位)
38
+ * @returns.originTax 折扣前税费合计
39
+ * @returns.tax 折扣后税费合计
40
+ */
41
+ export declare const getTax: ({ service, addons, bookingDetail, bookingId }: {
42
+ service?: any;
43
+ addons?: any;
44
+ bookingDetail?: any;
45
+ bookingId?: number | undefined;
46
+ }, options: {
47
+ isEdit: boolean;
48
+ computed: Record<string, number | string>;
49
+ tax_rate?: number;
50
+ is_price_include_tax?: number;
51
+ } & Record<string, any>) => {
52
+ originTax: number;
53
+ tax: number;
54
+ };
10
55
  /**
11
56
  * 计算商品小计(不含其他费用)
12
57
  * @param items - 购物车商品数组
@@ -38,3 +83,61 @@ export declare const calculateDeposit: (items: CartItem[]) => {
38
83
  protocols: any[];
39
84
  hasDeposit: never;
40
85
  } | undefined;
86
+ /**
87
+ * 计算订单附加费金额(订单级别合计)。
88
+ *
89
+ * - **详情未编辑**(`!options.isEdit && bookingId`)且存在后端详情时:直接返回 `bookingDetail.surcharge_fee`
90
+ * - **新增/编辑**时:对 `surcharge`(通常为 `getSurcharge` 的返回值)按 `item.value` 求和
91
+ *
92
+ * @param params 入参集合(RORO)
93
+ * @param params.bookingDetail 订单详情(详情未编辑时用于读取后端的 `surcharge_fee`),可选
94
+ * @param params.bookingId 订单/预约 ID(详情未编辑时生效),可选
95
+ * @param surcharge 附加费列表(通常来自 `getSurcharge`),元素结构至少包含 `value: number`
96
+ * @param options 计算选项
97
+ * @param options.isEdit 是否处于“编辑中”。`false` 时会优先走后端金额直取逻辑(若存在)
98
+ * @returns 订单附加费金额(number,金额单位与商品价格一致)
99
+ */
100
+ export declare const getSurchargeAmount: ({ bookingDetail, bookingId }: {
101
+ bookingDetail?: any;
102
+ bookingId?: number | undefined;
103
+ }, surcharge: any[], options: any) => number;
104
+ /**
105
+ * 订单附加费各项信息
106
+ *
107
+ * - **详情未编辑**(`!options.isEdit && bookingId`)时:直接返回 `bookingDetail.surcharge`(后端计算结果)
108
+ * - **新增/编辑**时:按 `options.surcharge_list` 逐条配置计算本次订单的附加费
109
+ *
110
+ * 规则要点:
111
+ * - 匹配范围包含:主商品(`service`)、原价 bundle 子商品(`item.bundle`)、加时商品(`item.relation_details`)、以及 addons(`addons.value`)
112
+ * - 固定附加费 `fixed`:只加一次,再按商品数量分摊(向下取整保留两位),剩余小数会以 `surcharge_rounding_remainder` 形式抹平到最后一个商品
113
+ * - 百分比附加费 `percentage`:按每个商品(价格 * 数量)分别计算再累加
114
+ * - 当 `open_product === 0`:不回写到商品,只在订单级别累加;否则会把单品附加费回写到商品
115
+ *
116
+ * **副作用(可能修改入参商品对象)**:
117
+ * - 当 `open_product !== 0` 时:写入 `item.surcharge_fee`(单品单数量附加费,保留两位、向下取整)
118
+ * - 写入 `item.relation_surcharge_ids`(关联到的 surcharge 配置 id 列表)
119
+ * - 写入 `item.surcharge_rounding_remainder`(用于抹平固定附加费/总额舍入差)
120
+ *
121
+ * @param params 入参集合(RORO)
122
+ * @param params.service 服务商品数组(主商品)。元素可能包含 `bundle` / `relation_details`
123
+ * @param params.addons 附加商品容器。当前实现读取 `addons.value` 作为商品数组(所以通常传 `{ value: CartItem[] }`)
124
+ * @param params.bookingDetail 订单详情(详情未编辑时用于直接取后端的 surcharge 列表),可选
125
+ * @param params.bookingId 订单/预约 ID(详情未编辑时生效),可选
126
+ * @param options 计算选项
127
+ * @param options.isEdit 是否处于“编辑中”。`false` 且存在 `bookingId` 时会走详情直取逻辑
128
+ * @param options.surcharge_list 附加费配置列表(后端下发)。缺失/为空则返回空数组
129
+ * @param options.isInScheduleByDate 判断日期是否落在某个 schedule 内的方法(通常来自 ScheduleModule)
130
+ * @param options.scheduleById schedule 映射表:`{ [scheduleId]: schedule }`(用于根据配置的 `available_schedule_ids` 做日程匹配)
131
+ * @returns 附加费列表(仅返回金额 > 0 的项)
132
+ */
133
+ export declare const getSurcharge: ({ service, addons, bookingDetail, bookingId }: {
134
+ service: any;
135
+ addons: any;
136
+ bookingDetail?: any;
137
+ bookingId?: number | undefined;
138
+ }, options: {
139
+ isEdit: boolean;
140
+ isInScheduleByDate: any;
141
+ surcharge_list?: any[];
142
+ scheduleById?: Record<string, any>;
143
+ } & Record<string, any>) => any;