@pisell/pisellos 0.0.567 → 0.0.568

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 (228) hide show
  1. package/dist/core/index.js +6 -9
  2. package/dist/model/strategy/adapter/walletPass/evaluator.js +0 -2
  3. package/dist/model/strategy/adapter/walletPass/example.js +3 -26
  4. package/dist/model/strategy/adapter/walletPass/utils.js +0 -3
  5. package/dist/model/strategy/strategy-example.js +5 -19
  6. package/dist/modules/Cart/index.js +0 -3
  7. package/dist/modules/Cart/utils/cartProduct.js +0 -1
  8. package/dist/modules/Date/index.js +1 -5
  9. package/dist/modules/Discount/index.js +1 -4
  10. package/dist/modules/OpenData/index.js +0 -2
  11. package/dist/modules/Order/index.d.ts +1 -1
  12. package/dist/modules/Order/index.js +14 -41
  13. package/dist/modules/Payment/index.js +142 -270
  14. package/dist/modules/Payment/walletpass.js +4 -5
  15. package/dist/modules/Rules/index.js +0 -7
  16. package/dist/modules/Schedule/utils.js +0 -1
  17. package/dist/modules/Step/index.js +0 -1
  18. package/dist/plugins/request.js +1 -4
  19. package/dist/plugins/window.js +2 -6
  20. package/dist/server/index.js +88 -121
  21. package/dist/server/modules/menu/index.js +32 -41
  22. package/dist/server/modules/products/index.js +29 -49
  23. package/dist/server/modules/quotation/index.js +29 -38
  24. package/dist/server/modules/resource/index.js +3 -4
  25. package/dist/server/modules/schedule/index.js +32 -40
  26. package/dist/server/utils/product.js +0 -1
  27. package/dist/solution/BookingByStep/index.d.ts +1 -1
  28. package/dist/solution/BookingByStep/index.js +7 -59
  29. package/dist/solution/BookingByStep/utils/capacity.js +1 -11
  30. package/dist/solution/BookingByStep/utils/resources.js +1 -3
  31. package/dist/solution/BookingByStep/utils/timeslots.js +2 -43
  32. package/dist/solution/BookingTicket/index.d.ts +1 -1
  33. package/dist/solution/BookingTicket/index.js +5 -7
  34. package/dist/solution/BookingTicket/utils/scan/handleScan.js +25 -31
  35. package/dist/solution/BookingTicket/utils/scan/index.js +6 -10
  36. package/dist/solution/BuyTickets/index.js +9 -12
  37. package/dist/solution/Checkout/index.js +177 -246
  38. package/dist/solution/Checkout/utils/index.js +4 -16
  39. package/dist/solution/RegisterAndLogin/index.js +30 -76
  40. package/dist/solution/ScanOrder/index.js +50 -60
  41. package/dist/solution/ShopDiscount/index.js +2 -7
  42. package/dist/solution/VenueBooking/index.d.ts +5 -0
  43. package/dist/solution/VenueBooking/index.js +364 -327
  44. package/dist/utils/task.js +15 -18
  45. package/dist/utils/watch.js +0 -1
  46. package/lib/apis/picoding.js +2 -0
  47. package/lib/core/index.js +130 -131
  48. package/lib/effects/index.js +46 -57
  49. package/lib/index.js +92 -53
  50. package/lib/model/index.js +14 -21
  51. package/lib/model/strategy/adapter/dataVariant/adapter.js +38 -50
  52. package/lib/model/strategy/adapter/dataVariant/evaluator.js +162 -236
  53. package/lib/model/strategy/adapter/dataVariant/examples.js +229 -237
  54. package/lib/model/strategy/adapter/dataVariant/index.js +39 -34
  55. package/lib/model/strategy/adapter/dataVariant/type.js +57 -28
  56. package/lib/model/strategy/adapter/index.js +100 -64
  57. package/lib/model/strategy/adapter/itemRule/adapter.js +156 -144
  58. package/lib/model/strategy/adapter/itemRule/evaluator.js +36 -48
  59. package/lib/model/strategy/adapter/itemRule/examples.js +295 -225
  60. package/lib/model/strategy/adapter/itemRule/index.js +83 -57
  61. package/lib/model/strategy/adapter/itemRule/type.js +97 -36
  62. package/lib/model/strategy/adapter/promotion/adapter.js +84 -63
  63. package/lib/model/strategy/adapter/promotion/evaluator.js +381 -231
  64. package/lib/model/strategy/adapter/promotion/examples.js +139 -159
  65. package/lib/model/strategy/adapter/promotion/index.js +1 -49
  66. package/lib/model/strategy/adapter/promotion/type.js +199 -35
  67. package/lib/model/strategy/adapter/type.js +4 -16
  68. package/lib/model/strategy/adapter/walletPass/evaluator.js +180 -152
  69. package/lib/model/strategy/adapter/walletPass/example.js +217 -190
  70. package/lib/model/strategy/adapter/walletPass/index.js +75 -51
  71. package/lib/model/strategy/adapter/walletPass/locales.js +36 -58
  72. package/lib/model/strategy/adapter/walletPass/type.js +4 -16
  73. package/lib/model/strategy/adapter/walletPass/utils.js +652 -402
  74. package/lib/model/strategy/engine.js +270 -168
  75. package/lib/model/strategy/index.js +49 -34
  76. package/lib/model/strategy/strategy-example.js +243 -239
  77. package/lib/model/strategy/type.js +100 -40
  78. package/lib/modules/Account/index.js +39 -53
  79. package/lib/modules/Account/types.js +20 -33
  80. package/lib/modules/AccountList/index.js +116 -154
  81. package/lib/modules/AccountList/types.js +30 -31
  82. package/lib/modules/AccountList/utils.js +18 -30
  83. package/lib/modules/BaseModule.js +22 -45
  84. package/lib/modules/Cart/index.js +170 -124
  85. package/lib/modules/Cart/types.js +46 -51
  86. package/lib/modules/Cart/utils/cartAccount.js +40 -39
  87. package/lib/modules/Cart/utils/cartDate.js +56 -61
  88. package/lib/modules/Cart/utils/cartDiscount.js +28 -33
  89. package/lib/modules/Cart/utils/cartNote.js +27 -32
  90. package/lib/modules/Cart/utils/cartProduct.js +306 -241
  91. package/lib/modules/Cart/utils/cartRelationForms.js +29 -35
  92. package/lib/modules/Cart/utils/cartResource.js +72 -78
  93. package/lib/modules/Cart/utils/changePrice.js +26 -62
  94. package/lib/modules/Cart/utils/index.js +106 -48
  95. package/lib/modules/Customer/constants.js +13 -34
  96. package/lib/modules/Customer/index.js +216 -153
  97. package/lib/modules/Customer/types.js +38 -35
  98. package/lib/modules/Date/index.js +116 -115
  99. package/lib/modules/Date/types.js +16 -28
  100. package/lib/modules/Date/utils.js +174 -123
  101. package/lib/modules/Discount/index.js +117 -113
  102. package/lib/modules/Discount/types.js +9 -31
  103. package/lib/modules/Guests/index.js +30 -56
  104. package/lib/modules/Guests/types.js +23 -33
  105. package/lib/modules/Holder/index.js +209 -189
  106. package/lib/modules/Holder/types.js +4 -16
  107. package/lib/modules/Holder/utils.js +20 -49
  108. package/lib/modules/OpenData/index.js +63 -74
  109. package/lib/modules/OpenData/types.js +4 -16
  110. package/lib/modules/OpenData/utils.js +44 -78
  111. package/lib/modules/Order/index.d.ts +1 -1
  112. package/lib/modules/Order/index.js +332 -320
  113. package/lib/modules/Order/types.js +24 -33
  114. package/lib/modules/Order/utils.js +350 -284
  115. package/lib/modules/Payment/cash.js +20 -33
  116. package/lib/modules/Payment/cashRecommendationAlgorithm.js +145 -76
  117. package/lib/modules/Payment/eftpos.js +16 -30
  118. package/lib/modules/Payment/index.js +566 -432
  119. package/lib/modules/Payment/mx51.js +1 -0
  120. package/lib/modules/Payment/types.js +216 -107
  121. package/lib/modules/Payment/utils.js +50 -47
  122. package/lib/modules/Payment/walletpass.js +221 -203
  123. package/lib/modules/Product/index.js +51 -46
  124. package/lib/modules/Product/types.js +4 -16
  125. package/lib/modules/Product/utils.js +32 -33
  126. package/lib/modules/ProductList/index.js +111 -110
  127. package/lib/modules/ProductList/types.js +9 -31
  128. package/lib/modules/Quotation/index.js +60 -82
  129. package/lib/modules/Quotation/types.js +4 -16
  130. package/lib/modules/Resource/index.js +27 -59
  131. package/lib/modules/Resource/types.js +22 -32
  132. package/lib/modules/Resource/utils.js +30 -38
  133. package/lib/modules/Rules/index.js +1172 -872
  134. package/lib/modules/Rules/types.js +17 -40
  135. package/lib/modules/SalesSummary/index.js +59 -68
  136. package/lib/modules/SalesSummary/types.js +4 -16
  137. package/lib/modules/SalesSummary/utils.js +176 -193
  138. package/lib/modules/ScanOrderLogger/index.js +59 -79
  139. package/lib/modules/ScanOrderLogger/providers/feishu.js +54 -78
  140. package/lib/modules/ScanOrderLogger/providers/grafana.js +13 -36
  141. package/lib/modules/ScanOrderLogger/types.js +4 -16
  142. package/lib/modules/Schedule/getDateIsInSchedule.js +334 -167
  143. package/lib/modules/Schedule/index.js +97 -107
  144. package/lib/modules/Schedule/type.js +4 -16
  145. package/lib/modules/Schedule/types.js +4 -16
  146. package/lib/modules/Schedule/utils.js +433 -291
  147. package/lib/modules/Step/index.js +40 -52
  148. package/lib/modules/Step/tyeps.js +4 -16
  149. package/lib/modules/Summary/index.js +66 -70
  150. package/lib/modules/Summary/types.js +4 -16
  151. package/lib/modules/Summary/utils.js +782 -429
  152. package/lib/modules/index.js +212 -57
  153. package/lib/plugins/app.js +4 -16
  154. package/lib/plugins/index.js +36 -25
  155. package/lib/plugins/request.js +137 -126
  156. package/lib/plugins/shopStore.js +4 -16
  157. package/lib/plugins/user.js +4 -16
  158. package/lib/plugins/window.js +171 -179
  159. package/lib/server/index.js +882 -623
  160. package/lib/server/modules/index.js +85 -59
  161. package/lib/server/modules/menu/index.js +146 -122
  162. package/lib/server/modules/menu/types.js +18 -31
  163. package/lib/server/modules/order/index.js +195 -231
  164. package/lib/server/modules/order/types.js +107 -32
  165. package/lib/server/modules/order/utils/filterBookings.js +174 -140
  166. package/lib/server/modules/order/utils/filterOrders.js +89 -60
  167. package/lib/server/modules/products/index.js +430 -335
  168. package/lib/server/modules/products/types.js +41 -34
  169. package/lib/server/modules/quotation/index.js +76 -77
  170. package/lib/server/modules/quotation/types.js +21 -31
  171. package/lib/server/modules/resource/index.js +216 -187
  172. package/lib/server/modules/resource/types.js +42 -33
  173. package/lib/server/modules/schedule/index.js +134 -119
  174. package/lib/server/modules/schedule/types.js +14 -21
  175. package/lib/server/modules/schedule/utils.js +334 -163
  176. package/lib/server/types.js +4 -16
  177. package/lib/server/utils/index.js +25 -23
  178. package/lib/server/utils/product.js +196 -139
  179. package/lib/server/utils/schedule.js +34 -41
  180. package/lib/server/utils/time.js +40 -49
  181. package/lib/solution/BookingByStep/index.d.ts +1 -1
  182. package/lib/solution/BookingByStep/index.js +1530 -1343
  183. package/lib/solution/BookingByStep/types.js +40 -99
  184. package/lib/solution/BookingByStep/utils/capacity.js +192 -160
  185. package/lib/solution/BookingByStep/utils/products.js +42 -52
  186. package/lib/solution/BookingByStep/utils/resources.js +527 -330
  187. package/lib/solution/BookingByStep/utils/stock.js +65 -44
  188. package/lib/solution/BookingByStep/utils/timeslots.js +129 -131
  189. package/lib/solution/BookingTicket/index.d.ts +1 -1
  190. package/lib/solution/BookingTicket/index.js +147 -122
  191. package/lib/solution/BookingTicket/types.js +38 -64
  192. package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +64 -80
  193. package/lib/solution/BookingTicket/utils/scan/handleScan.js +82 -80
  194. package/lib/solution/BookingTicket/utils/scan/index.js +90 -94
  195. package/lib/solution/BookingTicket/utils/scan/scanCache.js +90 -43
  196. package/lib/solution/BuyTickets/index.js +67 -70
  197. package/lib/solution/BuyTickets/types.js +22 -38
  198. package/lib/solution/Checkout/index.js +1451 -1158
  199. package/lib/solution/Checkout/types.js +91 -61
  200. package/lib/solution/Checkout/utils/index.js +227 -158
  201. package/lib/solution/PlaceOrder/index.js +55 -0
  202. package/lib/solution/RegisterAndLogin/config.js +493 -460
  203. package/lib/solution/RegisterAndLogin/index.js +633 -630
  204. package/lib/solution/RegisterAndLogin/types.js +189 -76
  205. package/lib/solution/RegisterAndLogin/utils.js +183 -125
  206. package/lib/solution/Sales/index.js +218 -200
  207. package/lib/solution/Sales/types.js +27 -33
  208. package/lib/solution/ScanOrder/index.js +803 -840
  209. package/lib/solution/ScanOrder/types.js +34 -34
  210. package/lib/solution/ScanOrder/utils.js +372 -331
  211. package/lib/solution/ShopDiscount/index.js +230 -236
  212. package/lib/solution/ShopDiscount/types.js +15 -37
  213. package/lib/solution/ShopDiscount/utils.js +309 -172
  214. package/lib/solution/VenueBooking/index.d.ts +5 -0
  215. package/lib/solution/VenueBooking/index.js +886 -929
  216. package/lib/solution/VenueBooking/types.js +20 -40
  217. package/lib/solution/VenueBooking/utils/dateSummary.js +22 -54
  218. package/lib/solution/VenueBooking/utils/resource.js +31 -54
  219. package/lib/solution/VenueBooking/utils/slotMerge.js +88 -106
  220. package/lib/solution/VenueBooking/utils/smartPricing.js +112 -100
  221. package/lib/solution/VenueBooking/utils/timeSlot.js +133 -132
  222. package/lib/solution/VenueBooking/utils.js +130 -67
  223. package/lib/solution/index.js +102 -37
  224. package/lib/store/createStore.js +32 -29
  225. package/lib/types/index.js +4 -16
  226. package/lib/utils/task.js +36 -36
  227. package/lib/utils/watch.js +81 -47
  228. package/package.json +2 -1
@@ -1,120 +1,98 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
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
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
1
+ "use strict";
28
2
 
29
- // src/server/modules/order/index.ts
30
- var order_exports = {};
31
- __export(order_exports, {
32
- OrderModule: () => OrderModule
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
33
5
  });
34
- module.exports = __toCommonJS(order_exports);
35
- var import_lodash_es = require("lodash-es");
36
- var import_dayjs = __toESM(require("dayjs"));
37
- var import_BaseModule = require("../../../modules/BaseModule");
38
- var import_types = require("./types");
39
- var INDEXDB_STORE_NAME = "orders";
40
- var ORDER_LAST_FULL_FETCH_AT_STORAGE_KEY = "server_order_last_full_fetch_at";
41
- var OrderModule = class extends import_BaseModule.BaseModule {
6
+ exports.OrderModule = void 0;
7
+ var _lodashEs = require("lodash-es");
8
+ var _dayjs = _interopRequireDefault(require("dayjs"));
9
+ var _BaseModule = require("../../../modules/BaseModule");
10
+ var _types = require("./types");
11
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
+ /**
13
+ * SQLite 存储名称
14
+ */
15
+ const INDEXDB_STORE_NAME = 'orders';
16
+ const ORDER_LAST_FULL_FETCH_AT_STORAGE_KEY = 'server_order_last_full_fetch_at';
17
+
18
+ /**
19
+ * Order 模块 - 基础框架
20
+ */
21
+ class OrderModule extends _BaseModule.BaseModule {
22
+ defaultName = 'order';
23
+ defaultVersion = '1.0.0';
24
+ store;
25
+ dbManager;
26
+ orderDataSource;
27
+ pendingSyncMessages = [];
28
+ syncTimer;
29
+ ORDER_SYNC_DEBOUNCE_MS = 5_000;
30
+ // Map<resource_id, OrderId[]> 资源到订单的倒排索引
31
+ resourceIdIndex = new Map();
32
+ logger; // LoggerManager 实例
33
+ storage;
42
34
  constructor(name, version) {
43
35
  super(name, version);
44
- this.defaultName = "order";
45
- this.defaultVersion = "1.0.0";
46
- this.pendingSyncMessages = [];
47
- this.ORDER_SYNC_DEBOUNCE_MS = 5e3;
48
- // Map<resource_id, OrderId[]> 资源到订单的倒排索引
49
- this.resourceIdIndex = /* @__PURE__ */ new Map();
50
36
  }
51
37
  async initialize(core, options) {
52
- var _a, _b;
53
38
  this.core = core;
54
- this.store = options == null ? void 0 : options.store;
55
- if (!this.store.map)
56
- this.store.map = /* @__PURE__ */ new Map();
57
- const appPlugin = core.getPlugin("app");
58
- const app = appPlugin == null ? void 0 : appPlugin.getApp();
39
+ this.store = options?.store;
40
+ if (!this.store.map) this.store.map = new Map();
41
+ const appPlugin = core.getPlugin('app');
42
+ const app = appPlugin?.getApp();
59
43
  if (app) {
60
44
  this.dbManager = app.sqlite;
61
45
  this.logger = app.logger;
62
46
  this.storage = app.storage;
63
- const coreData = app.data.store.getStore().getDataByModel("core");
64
- if (!((_a = this.store.createdAtQuery) == null ? void 0 : _a.sales_time_between) && (coreData == null ? void 0 : coreData.core)) {
65
- const today = (0, import_dayjs.default)();
66
- if (coreData == null ? void 0 : coreData.core.operating_day_boundary) {
47
+ const coreData = app.data.store.getStore().getDataByModel('core');
48
+ if (!this.store.createdAtQuery?.sales_time_between && coreData?.core) {
49
+ const today = (0, _dayjs.default)();
50
+ if (coreData?.core.operating_day_boundary) {
67
51
  const operatingDayBoundary = coreData.core.operating_day_boundary;
68
- if (operatingDayBoundary.type === "start_time") {
69
- const boundaryTime = String(operatingDayBoundary.time || "").trim();
70
- const boundaryStart = (0, import_dayjs.default)(`${today.format("YYYY-MM-DD")} ${boundaryTime}`);
71
- const boundaryEnd = boundaryStart.add(1, "day");
52
+ if (operatingDayBoundary.type === 'start_time') {
53
+ const boundaryTime = String(operatingDayBoundary.time || '').trim();
54
+ const boundaryStart = (0, _dayjs.default)(`${today.format('YYYY-MM-DD')} ${boundaryTime}`);
55
+ const boundaryEnd = boundaryStart.add(1, 'day');
72
56
  if (boundaryStart.isValid()) {
73
57
  this.store.createdAtQuery = {
74
- sales_time_between: [
75
- boundaryStart.format("YYYY-MM-DD HH:mm:ss"),
76
- boundaryEnd.format("YYYY-MM-DD HH:mm:ss")
77
- ]
58
+ sales_time_between: [boundaryStart.format('YYYY-MM-DD HH:mm:ss'), boundaryEnd.format('YYYY-MM-DD HH:mm:ss')]
78
59
  };
79
60
  } else {
61
+ // 边界时间异常时回退到自然日,避免 createdAtQuery 为空导致后续查询异常
80
62
  this.store.createdAtQuery = {
81
- sales_time_between: [
82
- today.startOf("day").format("YYYY-MM-DD HH:mm:ss"),
83
- today.endOf("day").format("YYYY-MM-DD HH:mm:ss")
84
- ]
63
+ sales_time_between: [today.startOf('day').format('YYYY-MM-DD HH:mm:ss'), today.endOf('day').format('YYYY-MM-DD HH:mm:ss')]
85
64
  };
86
65
  }
87
66
  } else {
88
67
  this.store.createdAtQuery = {
89
- sales_time_between: [
90
- today.startOf("day").format("YYYY-MM-DD HH:mm:ss"),
91
- today.endOf("day").format("YYYY-MM-DD HH:mm:ss")
92
- ]
68
+ sales_time_between: [today.startOf('day').format('YYYY-MM-DD HH:mm:ss'), today.endOf('day').format('YYYY-MM-DD HH:mm:ss')]
93
69
  };
94
70
  }
95
71
  } else {
72
+ // TODO: 这里后续可能需要使用店铺营业时间查询
96
73
  this.store.createdAtQuery = {
97
- sales_time_between: [today.startOf("day").format("YYYY-MM-DD HH:mm:ss"), today.endOf("day").format("YYYY-MM-DD HH:mm:ss")]
74
+ sales_time_between: [today.startOf('day').format('YYYY-MM-DD HH:mm:ss'), today.endOf('day').format('YYYY-MM-DD HH:mm:ss')]
98
75
  };
99
76
  }
100
77
  }
101
78
  }
102
- if (Array.isArray((_b = options == null ? void 0 : options.initialState) == null ? void 0 : _b.list)) {
79
+ if (Array.isArray(options?.initialState?.list)) {
103
80
  this.store.list = options.initialState.list;
104
81
  this.syncOrdersMap();
105
- this.core.effects.emit(import_types.OrderHooks.onOrdersChanged, this.store.list);
82
+ this.core.effects.emit(_types.OrderHooks.onOrdersChanged, this.store.list);
106
83
  } else {
107
84
  this.store.list = [];
108
- this.store.map = /* @__PURE__ */ new Map();
85
+ this.store.map = new Map();
109
86
  }
110
87
  this.initOrderDataSource();
111
88
  this.setupOrderSync();
112
- this.logInfo("OrderServer模块初始化完成", {
89
+ this.logInfo('OrderServer模块初始化完成', {
113
90
  hasDbManager: !!this.dbManager,
114
91
  hasLogger: !!this.logger,
115
92
  initialOrderCount: this.store.list.length
116
93
  });
117
94
  }
95
+
118
96
  /**
119
97
  * 记录信息日志
120
98
  * @param title 日志标题
@@ -124,14 +102,16 @@ var OrderModule = class extends import_BaseModule.BaseModule {
124
102
  try {
125
103
  if (this.logger) {
126
104
  this.logger.addLog({
127
- type: "info",
105
+ type: 'info',
128
106
  title: `[OrderServerModule] ${title}`,
129
107
  metadata: metadata || {}
130
108
  });
131
109
  }
132
110
  } catch {
111
+ // 日志记录失败不影响主流程
133
112
  }
134
113
  }
114
+
135
115
  /**
136
116
  * 记录错误日志
137
117
  * @param title 日志标题
@@ -141,21 +121,38 @@ var OrderModule = class extends import_BaseModule.BaseModule {
141
121
  try {
142
122
  if (this.logger) {
143
123
  this.logger.addLog({
144
- type: "error",
124
+ type: 'error',
145
125
  title: `[OrderServerModule] ${title}`,
146
126
  metadata: metadata || {}
147
127
  });
148
128
  }
149
129
  } catch {
130
+ // 日志记录失败不影响主流程
150
131
  }
151
132
  }
152
133
  async preload() {
134
+ // const cachedOrders = await this.loadOrdersFromSQLite()
135
+ // const hasPulledInCurrentWindow = this.hasPulledOrdersToday()
136
+ // // 仅当缓存属于当前统计窗口时才直接复用,避免跨天/跨营业日窗口继续使用旧数据
137
+ // if (cachedOrders.length > 0 && hasPulledInCurrentWindow) {
138
+ // this.store.list = cloneDeep(cachedOrders)
139
+ // this.syncOrdersMap()
140
+ // this.core.effects.emit(OrderHooks.onOrdersChanged, this.store.list)
141
+ // return
142
+ // }
143
+
144
+ // if (hasPulledInCurrentWindow) {
145
+ // this.logInfo('当天已完成全量订单拉取,跳过本次全量拉取', {
146
+ // lastFullFetchAt: this.getStorageItem(ORDER_LAST_FULL_FETCH_AT_STORAGE_KEY),
147
+ // })
148
+ // return
149
+ // }
150
+
153
151
  const orders = await this.loadOrdersByServer();
154
- if (orders.length === 0)
155
- return;
156
- this.store.list = (0, import_lodash_es.cloneDeep)(orders);
152
+ if (orders.length === 0) return;
153
+ this.store.list = (0, _lodashEs.cloneDeep)(orders);
157
154
  this.syncOrdersMap();
158
- this.core.effects.emit(import_types.OrderHooks.onOrdersChanged, this.store.list);
155
+ this.core.effects.emit(_types.OrderHooks.onOrdersChanged, this.store.list);
159
156
  }
160
157
  getOrders() {
161
158
  return this.store.list;
@@ -163,6 +160,7 @@ var OrderModule = class extends import_BaseModule.BaseModule {
163
160
  getOrderById(id) {
164
161
  return this.store.map.get(this.getIdKey(id));
165
162
  }
163
+
166
164
  /** 按 order_id 查询(推荐) */
167
165
  getOrderByOrderId(orderId) {
168
166
  return this.store.map.get(this.getIdKey(orderId));
@@ -183,25 +181,23 @@ var OrderModule = class extends import_BaseModule.BaseModule {
183
181
  }
184
182
  }
185
183
  await this.saveOrdersToSQLite(orderList);
186
- await this.core.effects.emit(import_types.OrderHooks.onOrdersLoaded, orderList);
184
+ await this.core.effects.emit(_types.OrderHooks.onOrdersLoaded, orderList);
187
185
  return orderList;
188
186
  }
189
187
  getOrdersByResourceId(resourceId) {
190
188
  const ids = this.resourceIdIndex.get(String(resourceId)) || [];
191
- return ids.map((id) => this.store.map.get(id)).filter((order) => !!order);
189
+ return ids.map(id => this.store.map.get(id)).filter(order => !!order);
192
190
  }
193
191
  getRoutes() {
194
192
  return [];
195
193
  }
196
194
  destroy() {
197
- var _a;
198
195
  if (this.syncTimer) {
199
196
  clearTimeout(this.syncTimer);
200
- this.syncTimer = void 0;
197
+ this.syncTimer = undefined;
201
198
  }
202
199
  this.pendingSyncMessages = [];
203
- if ((_a = this.orderDataSource) == null ? void 0 : _a.destroy)
204
- this.orderDataSource.destroy();
200
+ if (this.orderDataSource?.destroy) this.orderDataSource.destroy();
205
201
  super.destroy();
206
202
  }
207
203
  syncOrdersMap() {
@@ -209,83 +205,66 @@ var OrderModule = class extends import_BaseModule.BaseModule {
209
205
  this.resourceIdIndex.clear();
210
206
  for (const order of this.store.list) {
211
207
  const id = order.order_id;
212
- if (id === void 0 || id === null)
213
- continue;
208
+ if (id === undefined || id === null) continue;
214
209
  this.store.map.set(this.getIdKey(id), order);
215
210
  const resourceIds = this.extractResourceIds(order);
216
211
  for (const resourceId of resourceIds) {
217
212
  const key = String(resourceId);
218
213
  const existing = this.resourceIdIndex.get(key) || [];
219
- if (existing.some((eid) => this.getIdKey(eid) === this.getIdKey(id)))
220
- continue;
214
+ if (existing.some(eid => this.getIdKey(eid) === this.getIdKey(id))) continue;
221
215
  existing.push(id);
222
216
  this.resourceIdIndex.set(key, existing);
223
217
  }
224
218
  }
225
219
  }
226
220
  extractResourceIds(order) {
227
- const ids = /* @__PURE__ */ new Set();
228
- const visitResources = (resources) => {
229
- if (!Array.isArray(resources))
230
- return;
231
- resources.forEach((resource) => {
232
- const rid = resource == null ? void 0 : resource.relation_id;
233
- if (rid !== void 0 && rid !== null && rid !== "")
234
- ids.add(String(rid));
235
- if (Array.isArray(resource == null ? void 0 : resource.children))
236
- visitResources(resource.children);
221
+ const ids = new Set();
222
+ const visitResources = resources => {
223
+ if (!Array.isArray(resources)) return;
224
+ resources.forEach(resource => {
225
+ const rid = resource?.relation_id;
226
+ if (rid !== undefined && rid !== null && rid !== '') ids.add(String(rid));
227
+ if (Array.isArray(resource?.children)) visitResources(resource.children);
237
228
  });
238
229
  };
239
- if (Array.isArray(order == null ? void 0 : order.bookings)) {
240
- order.bookings.forEach((booking) => visitResources((booking == null ? void 0 : booking.resources) || []));
230
+ if (Array.isArray(order?.bookings)) {
231
+ order.bookings.forEach(booking => visitResources(booking?.resources || []));
241
232
  }
242
233
  return [...ids];
243
234
  }
244
235
  getOrderDateKey(order) {
245
- var _a, _b, _c, _d;
246
- const candidates = [
247
- order == null ? void 0 : order.schedule_date,
248
- order == null ? void 0 : order.create_date,
249
- order == null ? void 0 : order.created_at,
250
- (_b = (_a = order == null ? void 0 : order.bookings) == null ? void 0 : _a[0]) == null ? void 0 : _b.start_date,
251
- (_d = (_c = order == null ? void 0 : order.bookings) == null ? void 0 : _c[0]) == null ? void 0 : _d.select_date
252
- ];
236
+ const candidates = [order?.schedule_date, order?.create_date, order?.created_at, order?.bookings?.[0]?.start_date, order?.bookings?.[0]?.select_date];
253
237
  for (const v of candidates) {
254
- if (!v)
255
- continue;
238
+ if (!v) continue;
256
239
  const text = String(v);
257
- if (!text)
258
- continue;
259
- return text.split("T")[0].split(" ")[0];
240
+ if (!text) continue;
241
+ return text.split('T')[0].split(' ')[0];
260
242
  }
261
- return void 0;
243
+ return undefined;
262
244
  }
245
+
263
246
  /**
264
247
  * 初始化 OrderDataSource 实例
265
248
  */
266
249
  initOrderDataSource() {
267
- var _a, _b;
268
- const OrderDataSourceClass = (_b = (_a = this.core.serverOptions) == null ? void 0 : _a.All_DATA_SOURCES) == null ? void 0 : _b.OrderDataSource;
269
- if (!OrderDataSourceClass)
270
- return;
250
+ const OrderDataSourceClass = this.core.serverOptions?.All_DATA_SOURCES?.OrderDataSource;
251
+ if (!OrderDataSourceClass) return;
271
252
  this.orderDataSource = new OrderDataSourceClass();
272
253
  }
254
+
273
255
  /**
274
256
  * 初始化 pubsub 订阅,监听订单变更
275
257
  */
276
258
  setupOrderSync() {
277
- if (!this.orderDataSource)
278
- return;
259
+ if (!this.orderDataSource) return;
279
260
  const shouldSkipHttpPull = this.hasPulledOrdersToday();
280
261
  const syncPayload = {
281
262
  pubsub: {
282
- callback: (res) => {
263
+ callback: res => {
283
264
  const message = this.normalizeOrderSyncMessage(res);
284
- if (!message)
285
- return;
265
+ if (!message) return;
286
266
  this.pendingSyncMessages.push(message);
287
- if (this.syncTimer)
288
- clearTimeout(this.syncTimer);
267
+ if (this.syncTimer) clearTimeout(this.syncTimer);
289
268
  this.syncTimer = setTimeout(() => {
290
269
  this.processOrderSyncMessages();
291
270
  }, this.ORDER_SYNC_DEBOUNCE_MS);
@@ -297,11 +276,12 @@ var OrderModule = class extends import_BaseModule.BaseModule {
297
276
  skipHttp: shouldSkipHttpPull
298
277
  };
299
278
  this.orderDataSource.run(syncPayload).then(() => {
300
- if (!shouldSkipHttpPull)
301
- this.markOrderPulledAtNow();
279
+ if (!shouldSkipHttpPull) this.markOrderPulledAtNow();
302
280
  }).catch(() => {
281
+ // 忽略同步初始化异常,避免影响主流程
303
282
  });
304
283
  }
284
+
305
285
  /**
306
286
  * 处理防抖后的同步消息批次
307
287
  *
@@ -310,57 +290,49 @@ var OrderModule = class extends import_BaseModule.BaseModule {
310
290
  * - 批量(ids):通过 HTTP 按 ids 增量拉取,再 merge 到本地
311
291
  */
312
292
  async processOrderSyncMessages() {
313
- var _a;
314
293
  const messages = [...this.pendingSyncMessages];
315
294
  this.pendingSyncMessages = [];
316
- if (messages.length === 0)
317
- return;
318
- const upsertOrders = /* @__PURE__ */ new Map();
295
+ if (messages.length === 0) return;
296
+ const upsertOrders = new Map();
319
297
  const refreshIds = [];
320
298
  for (const msg of messages) {
321
299
  const hasBatchIds = Array.isArray(msg.ids) && msg.ids.length > 0;
322
300
  const singleId = msg.id ?? msg.order_id;
323
- const hasSingleId = !hasBatchIds && singleId !== void 0 && singleId !== null;
301
+ const hasSingleId = !hasBatchIds && singleId !== undefined && singleId !== null;
324
302
  const rawBody = msg.body || msg.data;
325
303
  const normalizedBody = this.normalizeOrderSyncPayload(rawBody);
326
304
  if (hasSingleId && normalizedBody) {
327
305
  upsertOrders.set(this.getIdKey(normalizedBody.order_id), normalizedBody);
328
306
  continue;
329
307
  }
330
- if (hasBatchIds)
331
- refreshIds.push(...msg.ids);
332
- else if (hasSingleId)
333
- refreshIds.push(singleId);
334
- else if ((_a = msg.relation_order_ids) == null ? void 0 : _a.length)
335
- refreshIds.push(...msg.relation_order_ids);
308
+ if (hasBatchIds) refreshIds.push(...msg.ids);else if (hasSingleId) refreshIds.push(singleId);else if (msg.relation_order_ids?.length) refreshIds.push(...msg.relation_order_ids);
336
309
  }
337
310
  const uniqueRefreshIds = this.uniqueOrderIds(refreshIds);
338
311
  const upsertList = [...upsertOrders.values()];
339
- if (upsertList.length > 0)
340
- await this.mergeOrdersToStore(upsertList);
312
+ if (upsertList.length > 0) await this.mergeOrdersToStore(upsertList);
341
313
  if (uniqueRefreshIds.length > 0) {
342
314
  const freshOrders = await this.fetchOrdersByHttp(uniqueRefreshIds);
343
- if (freshOrders.length > 0)
344
- await this.mergeOrdersToStore(freshOrders);
315
+ if (freshOrders.length > 0) await this.mergeOrdersToStore(freshOrders);
345
316
  }
346
- if (upsertList.length === 0 && uniqueRefreshIds.length === 0)
347
- return;
348
- await this.core.effects.emit(import_types.OrderHooks.onOrdersSyncCompleted, null);
317
+ if (upsertList.length === 0 && uniqueRefreshIds.length === 0) return;
318
+ await this.core.effects.emit(_types.OrderHooks.onOrdersSyncCompleted, null);
349
319
  }
320
+
350
321
  /**
351
322
  * 通过 HTTP 按 ids 增量拉取订单
352
323
  */
353
324
  async fetchOrdersByHttp(ids) {
354
- if (!this.orderDataSource || ids.length === 0)
355
- return [];
325
+ if (!this.orderDataSource || ids.length === 0) return [];
356
326
  try {
357
- if (typeof this.orderDataSource.fetchOrdersByIds === "function") {
358
- const orderList2 = await this.orderDataSource.fetchOrdersByIds(ids);
359
- return orderList2 || [];
327
+ if (typeof this.orderDataSource.fetchOrdersByIds === 'function') {
328
+ const orderList = await this.orderDataSource.fetchOrdersByIds(ids);
329
+ return orderList || [];
360
330
  }
361
331
  const orderList = await this.orderDataSource.run({
362
332
  http: {
363
- query: { ids }
333
+ query: {
334
+ ids
335
+ }
364
336
  }
365
337
  });
366
338
  return orderList || [];
@@ -368,24 +340,22 @@ var OrderModule = class extends import_BaseModule.BaseModule {
368
340
  return [];
369
341
  }
370
342
  }
343
+
371
344
  /**
372
345
  * 将增量订单合并到 store
373
346
  */
374
347
  async mergeOrdersToStore(freshOrders) {
375
- const freshMap = /* @__PURE__ */ new Map();
348
+ const freshMap = new Map();
376
349
  for (const order of freshOrders) {
377
- const id = order == null ? void 0 : order.order_id;
378
- if (id === void 0 || id === null)
379
- continue;
350
+ const id = order?.order_id;
351
+ if (id === undefined || id === null) continue;
380
352
  freshMap.set(this.getIdKey(id), order);
381
353
  }
382
- const updatedList = this.store.list.map((order) => {
354
+ const updatedList = this.store.list.map(order => {
383
355
  const id = order.order_id;
384
- if (id === void 0 || id === null)
385
- return order;
356
+ if (id === undefined || id === null) return order;
386
357
  const key = this.getIdKey(id);
387
- if (!freshMap.has(key))
388
- return order;
358
+ if (!freshMap.has(key)) return order;
389
359
  const fresh = freshMap.get(key);
390
360
  freshMap.delete(key);
391
361
  return fresh;
@@ -396,43 +366,36 @@ var OrderModule = class extends import_BaseModule.BaseModule {
396
366
  this.store.list = updatedList;
397
367
  this.syncOrdersMap();
398
368
  await this.saveOrdersToSQLite(this.store.list);
399
- this.core.effects.emit(import_types.OrderHooks.onOrdersChanged, this.store.list);
369
+ this.core.effects.emit(_types.OrderHooks.onOrdersChanged, this.store.list);
400
370
  }
401
371
  normalizeOrderSyncMessage(res) {
402
- const data = (res == null ? void 0 : res.data) || res;
403
- if (!data)
404
- return null;
405
- const payload = (data == null ? void 0 : data.data) && typeof data.data === "object" ? data.data : void 0;
372
+ const data = res?.data || res;
373
+ if (!data) return null;
374
+ const payload = data?.data && typeof data.data === 'object' ? data.data : undefined;
406
375
  const normalized = {
407
376
  ...data,
408
- _channelKey: data.module || "sales_sync"
377
+ _channelKey: data.module || 'sales_sync'
409
378
  };
410
- if (!normalized.type && typeof data.event === "string")
411
- normalized.type = data.event;
412
- if (!normalized.id && data.id !== void 0)
413
- normalized.id = data.id;
414
- if (!normalized.id && data.order_id !== void 0)
415
- normalized.id = data.order_id;
416
- if (!normalized.order_id && data.order_id !== void 0)
417
- normalized.order_id = data.order_id;
418
- if (!normalized.order_id && (payload == null ? void 0 : payload.order_id) !== void 0)
419
- normalized.order_id = payload.order_id;
420
- if (!normalized.body && (payload == null ? void 0 : payload.order_id) !== void 0)
421
- normalized.body = payload;
422
- if (!normalized.data && (payload == null ? void 0 : payload.order_id) !== void 0)
423
- normalized.data = payload;
379
+ if (!normalized.type && typeof data.event === 'string') normalized.type = data.event;
380
+ if (!normalized.id && data.id !== undefined) normalized.id = data.id;
381
+ if (!normalized.id && data.order_id !== undefined) normalized.id = data.order_id;
382
+ if (!normalized.order_id && data.order_id !== undefined) normalized.order_id = data.order_id;
383
+ if (!normalized.order_id && payload?.order_id !== undefined) normalized.order_id = payload.order_id;
384
+ if (!normalized.body && payload?.order_id !== undefined) normalized.body = payload;
385
+ if (!normalized.data && payload?.order_id !== undefined) normalized.data = payload;
424
386
  return normalized;
425
387
  }
426
388
  normalizeOrderSyncPayload(payload) {
427
- if (!payload)
428
- return null;
389
+ if (!payload) return null;
429
390
  const orderId = payload.order_id;
430
- if (orderId === void 0 || orderId === null)
431
- return null;
432
- return { ...payload, order_id: orderId };
391
+ if (orderId === undefined || orderId === null) return null;
392
+ return {
393
+ ...payload,
394
+ order_id: orderId
395
+ };
433
396
  }
434
397
  uniqueOrderIds(ids) {
435
- const idMap = /* @__PURE__ */ new Map();
398
+ const idMap = new Map();
436
399
  for (const id of ids) {
437
400
  idMap.set(this.getIdKey(id), id);
438
401
  }
@@ -441,69 +404,74 @@ var OrderModule = class extends import_BaseModule.BaseModule {
441
404
  getIdKey(id) {
442
405
  return String(id);
443
406
  }
407
+
444
408
  /**
445
409
  * 当前订单拉取窗口:
446
410
  * - 优先使用 createdAtQuery.sales_time_between(已按营业日边界初始化)
447
411
  * - 无法解析时退化为自然日窗口
448
412
  */
449
413
  getCurrentPullWindow() {
450
- var _a, _b;
451
- const now = (0, import_dayjs.default)();
452
- const range = (_b = (_a = this.store) == null ? void 0 : _a.createdAtQuery) == null ? void 0 : _b.sales_time_between;
414
+ const now = (0, _dayjs.default)();
415
+ const range = this.store?.createdAtQuery?.sales_time_between;
453
416
  if (Array.isArray(range) && range.length >= 2) {
454
- const startAt2 = (0, import_dayjs.default)(range[0]);
455
- const endExclusiveAt = (0, import_dayjs.default)(range[1]);
456
- if (startAt2.isValid() && endExclusiveAt.isValid() && endExclusiveAt.isAfter(startAt2)) {
457
- return { startAt: startAt2, endExclusiveAt };
417
+ const startAt = (0, _dayjs.default)(range[0]);
418
+ const endExclusiveAt = (0, _dayjs.default)(range[1]);
419
+ if (startAt.isValid() && endExclusiveAt.isValid() && endExclusiveAt.isAfter(startAt)) {
420
+ return {
421
+ startAt,
422
+ endExclusiveAt
423
+ };
458
424
  }
459
425
  }
460
- const startAt = now.startOf("day");
461
- return { startAt, endExclusiveAt: startAt.add(1, "day") };
426
+ const startAt = now.startOf('day');
427
+ return {
428
+ startAt,
429
+ endExclusiveAt: startAt.add(1, 'day')
430
+ };
462
431
  }
463
432
  hasPulledOrdersToday() {
464
433
  const lastFullFetchAt = this.getStorageItem(ORDER_LAST_FULL_FETCH_AT_STORAGE_KEY);
465
- if (!lastFullFetchAt)
466
- return false;
467
- const parsed = (0, import_dayjs.default)(lastFullFetchAt);
468
- if (!parsed.isValid())
469
- return false;
470
- const { startAt, endExclusiveAt } = this.getCurrentPullWindow();
434
+ if (!lastFullFetchAt) return false;
435
+ const parsed = (0, _dayjs.default)(lastFullFetchAt);
436
+ if (!parsed.isValid()) return false;
437
+
438
+ // 按当前拉取窗口判断,而不是自然日判断。
439
+ // 这样在营业日跨日边界(start_time)场景下也能正确判定是否需要重新拉取。
440
+ const {
441
+ startAt,
442
+ endExclusiveAt
443
+ } = this.getCurrentPullWindow();
471
444
  return (parsed.isAfter(startAt) || parsed.isSame(startAt)) && parsed.isBefore(endExclusiveAt);
472
445
  }
473
446
  markOrderPulledAtNow() {
474
- this.setStorageItem(
475
- ORDER_LAST_FULL_FETCH_AT_STORAGE_KEY,
476
- (0, import_dayjs.default)().format("YYYY-MM-DD HH:mm:ss")
477
- );
447
+ this.setStorageItem(ORDER_LAST_FULL_FETCH_AT_STORAGE_KEY, (0, _dayjs.default)().format('YYYY-MM-DD HH:mm:ss'));
478
448
  }
479
449
  getStorageItem(key) {
480
- var _a;
481
450
  try {
482
- if ((_a = this.storage) == null ? void 0 : _a.getStorage)
483
- return this.storage.getStorage(key);
484
- if (typeof globalThis !== "undefined" && (globalThis == null ? void 0 : globalThis.localStorage)) {
451
+ if (this.storage?.getStorage) return this.storage.getStorage(key);
452
+ if (typeof globalThis !== 'undefined' && globalThis?.localStorage) {
485
453
  return globalThis.localStorage.getItem(key);
486
454
  }
487
455
  } catch {
456
+ // 忽略存储异常,避免影响主流程
488
457
  }
489
458
  return null;
490
459
  }
491
460
  setStorageItem(key, value) {
492
- var _a;
493
461
  try {
494
- if ((_a = this.storage) == null ? void 0 : _a.setStorage) {
462
+ if (this.storage?.setStorage) {
495
463
  this.storage.setStorage(key, value);
496
464
  return;
497
465
  }
498
- if (typeof globalThis !== "undefined" && (globalThis == null ? void 0 : globalThis.localStorage)) {
466
+ if (typeof globalThis !== 'undefined' && globalThis?.localStorage) {
499
467
  globalThis.localStorage.setItem(key, value);
500
468
  }
501
469
  } catch {
470
+ // 忽略存储异常,避免影响主流程
502
471
  }
503
472
  }
504
473
  async loadOrdersFromSQLite() {
505
- if (!this.dbManager)
506
- return [];
474
+ if (!this.dbManager) return [];
507
475
  try {
508
476
  const orders = await this.dbManager.getAll(INDEXDB_STORE_NAME);
509
477
  return orders || [];
@@ -512,15 +480,14 @@ var OrderModule = class extends import_BaseModule.BaseModule {
512
480
  }
513
481
  }
514
482
  async saveOrdersToSQLite(orderList) {
515
- if (!this.dbManager)
516
- return;
483
+ if (!this.dbManager) return;
517
484
  try {
518
485
  await this.dbManager.clear(INDEXDB_STORE_NAME);
519
- if (orderList.length === 0)
520
- return;
486
+ if (orderList.length === 0) return;
521
487
  await this.dbManager.bulkAdd(INDEXDB_STORE_NAME, orderList);
522
488
  } catch (error) {
523
- this.logError("保存订单到 SQLite 失败", {
489
+ // SQLite 异常,避免影响主流程
490
+ this.logError('保存订单到 SQLite 失败', {
524
491
  error: error instanceof Error ? error.message : String(error),
525
492
  orderList: orderList.length
526
493
  });
@@ -528,16 +495,13 @@ var OrderModule = class extends import_BaseModule.BaseModule {
528
495
  }
529
496
  async clear() {
530
497
  this.store.list = [];
531
- this.store.map = /* @__PURE__ */ new Map();
498
+ this.store.map = new Map();
532
499
  this.resourceIdIndex.clear();
533
500
  if (this.dbManager) {
534
501
  await this.dbManager.clear(INDEXDB_STORE_NAME);
535
502
  }
536
- this.setStorageItem(ORDER_LAST_FULL_FETCH_AT_STORAGE_KEY, "");
537
- this.core.effects.emit(import_types.OrderHooks.onOrdersChanged, this.store.list);
503
+ this.setStorageItem(ORDER_LAST_FULL_FETCH_AT_STORAGE_KEY, '');
504
+ this.core.effects.emit(_types.OrderHooks.onOrdersChanged, this.store.list);
538
505
  }
539
- };
540
- // Annotate the CommonJS export names for ESM import in node:
541
- 0 && (module.exports = {
542
- OrderModule
543
- });
506
+ }
507
+ exports.OrderModule = OrderModule;