@pisell/pisellos 2.2.291 → 2.2.293
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/index.d.ts +7 -0
- package/dist/core/index.js +108 -65
- package/dist/model/strategy/adapter/itemRule/adapter.d.ts +4 -1
- package/dist/model/strategy/adapter/itemRule/adapter.js +135 -35
- package/dist/model/strategy/adapter/itemRule/evaluator.d.ts +8 -1
- package/dist/model/strategy/adapter/itemRule/evaluator.js +25 -1
- package/dist/model/strategy/adapter/itemRule/type.d.ts +44 -0
- package/dist/model/strategy/adapter/itemRule/type.js +19 -1
- package/dist/model/strategy/adapter/promotion/index.js +0 -9
- package/dist/modules/BookingContext/index.d.ts +3 -0
- package/dist/modules/BookingContext/index.js +42 -13
- package/dist/modules/BookingContext/types.d.ts +4 -4
- package/dist/modules/BookingContext/types.js +3 -3
- package/dist/modules/OpenData/types.d.ts +1 -0
- package/dist/modules/Order/index.d.ts +18 -3
- package/dist/modules/Order/index.js +885 -485
- package/dist/modules/Order/salesNotes.d.ts +31 -0
- package/dist/modules/Order/salesNotes.js +492 -0
- package/dist/modules/Order/types.d.ts +93 -5
- package/dist/modules/Order/types.js +5 -0
- package/dist/modules/Order/utils.d.ts +12 -0
- package/dist/modules/Order/utils.js +96 -31
- package/dist/modules/Product/types.d.ts +2 -0
- package/dist/modules/ProductList/clientDataVariants.d.ts +50 -0
- package/dist/modules/ProductList/clientDataVariants.js +216 -0
- package/dist/modules/ProductList/index.d.ts +18 -3
- package/dist/modules/ProductList/index.js +220 -38
- package/dist/modules/ProductList/types.d.ts +10 -0
- package/dist/modules/Quotation/index.d.ts +22 -0
- package/dist/modules/Quotation/index.js +293 -28
- package/dist/modules/ResourcePlanner/index.d.ts +0 -22
- package/dist/modules/ResourcePlanner/index.js +1 -180
- package/dist/modules/ResourcePlanner/localClock.d.ts +33 -0
- package/dist/modules/ResourcePlanner/localClock.js +183 -0
- package/dist/modules/ResourcePlanner/planner.d.ts +5 -14
- package/dist/modules/ResourcePlanner/planner.js +2111 -958
- package/dist/modules/ResourcePlanner/types.d.ts +359 -187
- package/dist/modules/ResourcePlanner/types.js +33 -1
- package/dist/plugins/request.d.ts +1 -0
- package/dist/server/index.d.ts +17 -2
- package/dist/server/index.js +1134 -932
- package/dist/server/modules/floor-plan/index.d.ts +4 -0
- package/dist/server/modules/floor-plan/index.js +240 -98
- package/dist/server/modules/menu/index.js +48 -23
- package/dist/server/modules/order/index.d.ts +17 -7
- package/dist/server/modules/order/index.js +419 -207
- package/dist/server/modules/products/index.d.ts +10 -4
- package/dist/server/modules/products/index.js +177 -84
- package/dist/server/modules/resource/index.js +21 -13
- package/dist/server/utils/product.d.ts +1 -1
- package/dist/server/utils/product.js +186 -22
- package/dist/server/utils/small-ticket.d.ts +9 -1
- package/dist/server/utils/small-ticket.js +131 -84
- package/dist/solution/BaseSales/index.d.ts +26 -3
- package/dist/solution/BaseSales/index.js +1384 -905
- package/dist/solution/BaseSales/types.d.ts +2 -0
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +3 -0
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +10 -3
- package/dist/solution/BaseSales/utils.js +6 -3
- package/dist/solution/BookingByStep/index.d.ts +4 -4
- package/dist/solution/BookingTicket/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.js +4 -2
- package/dist/solution/BookingTicket/utils/addProductDecision.d.ts +2 -1
- package/dist/solution/BookingTicket/utils/addProductDecision.js +6 -3
- package/dist/solution/BookingTicket/utils/orderCustomer.js +3 -2
- package/dist/solution/RegisterAndLogin/config.d.ts +9 -3
- package/dist/solution/RegisterAndLogin/config.js +95 -40
- package/dist/solution/RegisterAndLogin/index.js +4 -1
- package/dist/solution/ScanOrder/index.d.ts +1 -0
- package/dist/solution/ScanOrder/index.js +31 -27
- package/dist/solution/ScanOrder/types.d.ts +2 -0
- package/dist/solution/ScanOrder/utils.d.ts +1 -0
- package/dist/solution/ScanOrder/utils.js +8 -3
- package/dist/solution/UnifiedBookingSales/index.d.ts +128 -74
- package/dist/solution/UnifiedBookingSales/index.js +3877 -963
- package/dist/solution/UnifiedBookingSales/remoteOccupancyCache.d.ts +49 -0
- package/dist/solution/UnifiedBookingSales/remoteOccupancyCache.js +430 -0
- package/dist/solution/UnifiedBookingSales/types.d.ts +161 -77
- package/dist/solution/UnifiedBookingSales/types.js +4 -9
- package/dist/solution/VenueBooking/index.d.ts +3 -0
- package/dist/solution/VenueBooking/index.js +549 -497
- package/dist/solution/VenueBooking/utils/dateSummary.d.ts +1 -0
- package/dist/solution/VenueBooking/utils/dateSummary.js +3 -1
- package/dist/solution/VenueBooking/utils/slotMerge.d.ts +2 -0
- package/dist/solution/VenueBooking/utils/slotMerge.js +3 -1
- package/dist/utils/platform.d.ts +8 -0
- package/dist/utils/platform.js +15 -0
- package/lib/core/index.d.ts +7 -0
- package/lib/core/index.js +20 -2
- package/lib/model/strategy/adapter/itemRule/adapter.d.ts +4 -1
- package/lib/model/strategy/adapter/itemRule/adapter.js +73 -4
- package/lib/model/strategy/adapter/itemRule/evaluator.d.ts +8 -1
- package/lib/model/strategy/adapter/itemRule/evaluator.js +23 -1
- package/lib/model/strategy/adapter/itemRule/type.d.ts +44 -0
- package/lib/model/strategy/adapter/itemRule/type.js +19 -1
- package/lib/modules/BookingContext/index.d.ts +3 -0
- package/lib/modules/BookingContext/index.js +35 -8
- package/lib/modules/BookingContext/types.d.ts +4 -4
- package/lib/modules/BookingContext/types.js +3 -3
- package/lib/modules/OpenData/types.d.ts +1 -0
- package/lib/modules/Order/index.d.ts +18 -3
- package/lib/modules/Order/index.js +325 -28
- package/lib/modules/Order/salesNotes.d.ts +31 -0
- package/lib/modules/Order/salesNotes.js +382 -0
- package/lib/modules/Order/types.d.ts +93 -5
- package/lib/modules/Order/types.js +4 -0
- package/lib/modules/Order/utils.d.ts +12 -0
- package/lib/modules/Order/utils.js +85 -16
- package/lib/modules/Product/types.d.ts +2 -0
- package/lib/modules/ProductList/clientDataVariants.d.ts +50 -0
- package/lib/modules/ProductList/clientDataVariants.js +204 -0
- package/lib/modules/ProductList/index.d.ts +18 -3
- package/lib/modules/ProductList/index.js +137 -8
- package/lib/modules/ProductList/types.d.ts +10 -0
- package/lib/modules/Quotation/index.d.ts +22 -0
- package/lib/modules/Quotation/index.js +158 -11
- package/lib/modules/ResourcePlanner/index.d.ts +0 -22
- package/lib/modules/ResourcePlanner/index.js +9 -129
- package/lib/modules/ResourcePlanner/localClock.d.ts +33 -0
- package/lib/modules/ResourcePlanner/localClock.js +205 -0
- package/lib/modules/ResourcePlanner/planner.d.ts +5 -14
- package/lib/modules/ResourcePlanner/planner.js +1807 -783
- package/lib/modules/ResourcePlanner/types.d.ts +359 -187
- package/lib/modules/ResourcePlanner/types.js +13 -1
- package/lib/plugins/request.d.ts +1 -0
- package/lib/server/index.d.ts +17 -2
- package/lib/server/index.js +149 -21
- package/lib/server/modules/floor-plan/index.d.ts +4 -0
- package/lib/server/modules/floor-plan/index.js +60 -7
- package/lib/server/modules/menu/index.js +26 -4
- package/lib/server/modules/order/index.d.ts +17 -7
- package/lib/server/modules/order/index.js +194 -57
- package/lib/server/modules/products/index.d.ts +10 -4
- package/lib/server/modules/products/index.js +93 -23
- package/lib/server/modules/resource/index.js +12 -2
- package/lib/server/utils/product.d.ts +1 -1
- package/lib/server/utils/product.js +163 -3
- package/lib/server/utils/small-ticket.d.ts +9 -1
- package/lib/server/utils/small-ticket.js +123 -79
- package/lib/solution/BaseSales/index.d.ts +26 -3
- package/lib/solution/BaseSales/index.js +396 -70
- package/lib/solution/BaseSales/types.d.ts +2 -0
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +3 -0
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +9 -2
- package/lib/solution/BaseSales/utils.js +3 -0
- package/lib/solution/BookingByStep/index.d.ts +4 -4
- package/lib/solution/BookingTicket/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.js +2 -1
- package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +2 -1
- package/lib/solution/BookingTicket/utils/addProductDecision.js +5 -2
- package/lib/solution/BookingTicket/utils/orderCustomer.js +2 -1
- package/lib/solution/RegisterAndLogin/config.d.ts +9 -3
- package/lib/solution/RegisterAndLogin/config.js +49 -8
- package/lib/solution/RegisterAndLogin/index.js +4 -1
- package/lib/solution/ScanOrder/index.d.ts +1 -0
- package/lib/solution/ScanOrder/index.js +5 -1
- package/lib/solution/ScanOrder/types.d.ts +2 -0
- package/lib/solution/ScanOrder/utils.d.ts +1 -0
- package/lib/solution/ScanOrder/utils.js +4 -0
- package/lib/solution/UnifiedBookingSales/index.d.ts +128 -74
- package/lib/solution/UnifiedBookingSales/index.js +2592 -424
- package/lib/solution/UnifiedBookingSales/remoteOccupancyCache.d.ts +49 -0
- package/lib/solution/UnifiedBookingSales/remoteOccupancyCache.js +316 -0
- package/lib/solution/UnifiedBookingSales/types.d.ts +161 -77
- package/lib/solution/UnifiedBookingSales/types.js +4 -6
- package/lib/solution/VenueBooking/index.d.ts +3 -0
- package/lib/solution/VenueBooking/index.js +33 -9
- package/lib/solution/VenueBooking/utils/dateSummary.d.ts +1 -0
- package/lib/solution/VenueBooking/utils/dateSummary.js +3 -1
- package/lib/solution/VenueBooking/utils/slotMerge.d.ts +2 -0
- package/lib/solution/VenueBooking/utils/slotMerge.js +3 -1
- package/lib/utils/platform.d.ts +8 -0
- package/lib/utils/platform.js +22 -0
- package/package.json +1 -1
|
@@ -322,7 +322,7 @@ export var MenuModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
322
322
|
key: "loadMenuFromIndexDB",
|
|
323
323
|
value: (function () {
|
|
324
324
|
var _loadMenuFromIndexDB = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
325
|
-
var _menuList$length, menuList, errorMessage;
|
|
325
|
+
var startedAt, _menuList$length, menuList, errorMessage;
|
|
326
326
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
327
327
|
while (1) switch (_context5.prev = _context5.next) {
|
|
328
328
|
case 0:
|
|
@@ -333,29 +333,32 @@ export var MenuModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
333
333
|
this.logWarning('loadMenuFromIndexDB: dbManager 不可用');
|
|
334
334
|
return _context5.abrupt("return", []);
|
|
335
335
|
case 3:
|
|
336
|
-
|
|
337
|
-
_context5.
|
|
336
|
+
startedAt = performance.now();
|
|
337
|
+
_context5.prev = 4;
|
|
338
|
+
_context5.next = 7;
|
|
338
339
|
return this.dbManager.getAll(INDEXDB_STORE_NAME);
|
|
339
|
-
case
|
|
340
|
+
case 7:
|
|
340
341
|
menuList = _context5.sent;
|
|
341
342
|
this.logInfo('从 IndexDB 加载餐牌数据', {
|
|
342
|
-
menuCount: (_menuList$length = menuList === null || menuList === void 0 ? void 0 : menuList.length) !== null && _menuList$length !== void 0 ? _menuList$length : 0
|
|
343
|
+
menuCount: (_menuList$length = menuList === null || menuList === void 0 ? void 0 : menuList.length) !== null && _menuList$length !== void 0 ? _menuList$length : 0,
|
|
344
|
+
durationMs: +(performance.now() - startedAt).toFixed(2)
|
|
343
345
|
});
|
|
344
346
|
return _context5.abrupt("return", menuList || []);
|
|
345
|
-
case
|
|
346
|
-
_context5.prev =
|
|
347
|
-
_context5.t0 = _context5["catch"](
|
|
347
|
+
case 12:
|
|
348
|
+
_context5.prev = 12;
|
|
349
|
+
_context5.t0 = _context5["catch"](4);
|
|
348
350
|
errorMessage = _context5.t0 instanceof Error ? _context5.t0.message : String(_context5.t0);
|
|
349
351
|
console.error('[Menu] 从 IndexDB 读取数据失败:', _context5.t0);
|
|
350
352
|
this.logError('从 IndexDB 读取数据失败', {
|
|
353
|
+
durationMs: +(performance.now() - startedAt).toFixed(2),
|
|
351
354
|
error: errorMessage
|
|
352
355
|
});
|
|
353
356
|
return _context5.abrupt("return", []);
|
|
354
|
-
case
|
|
357
|
+
case 18:
|
|
355
358
|
case "end":
|
|
356
359
|
return _context5.stop();
|
|
357
360
|
}
|
|
358
|
-
}, _callee5, this, [[
|
|
361
|
+
}, _callee5, this, [[4, 12]]);
|
|
359
362
|
}));
|
|
360
363
|
function loadMenuFromIndexDB() {
|
|
361
364
|
return _loadMenuFromIndexDB.apply(this, arguments);
|
|
@@ -372,7 +375,7 @@ export var MenuModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
372
375
|
value: (function () {
|
|
373
376
|
var _saveMenuToIndexDB = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(menuList) {
|
|
374
377
|
var _this2 = this;
|
|
375
|
-
var savePromises, errorMessage;
|
|
378
|
+
var startedAt, clearDurationMs, writeDurationMs, clearStartedAt, writeStartedAt, savePromises, errorMessage;
|
|
376
379
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
377
380
|
while (1) switch (_context6.prev = _context6.next) {
|
|
378
381
|
case 0:
|
|
@@ -383,39 +386,61 @@ export var MenuModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
383
386
|
this.logWarning('saveMenuToIndexDB: dbManager 不可用');
|
|
384
387
|
return _context6.abrupt("return");
|
|
385
388
|
case 3:
|
|
389
|
+
startedAt = performance.now();
|
|
390
|
+
clearDurationMs = 0;
|
|
391
|
+
writeDurationMs = 0;
|
|
386
392
|
this.logInfo('开始保存餐牌数据到 IndexDB', {
|
|
387
393
|
menuCount: menuList.length
|
|
388
394
|
});
|
|
389
|
-
_context6.prev =
|
|
390
|
-
|
|
395
|
+
_context6.prev = 7;
|
|
396
|
+
// 先清空现有的餐牌数据
|
|
397
|
+
clearStartedAt = performance.now();
|
|
398
|
+
_context6.prev = 9;
|
|
399
|
+
_context6.next = 12;
|
|
391
400
|
return this.dbManager.clear(INDEXDB_STORE_NAME);
|
|
392
|
-
case
|
|
401
|
+
case 12:
|
|
402
|
+
_context6.prev = 12;
|
|
403
|
+
clearDurationMs = +(performance.now() - clearStartedAt).toFixed(2);
|
|
404
|
+
return _context6.finish(12);
|
|
405
|
+
case 15:
|
|
393
406
|
// 逐个保存餐牌(每个餐牌是独立的记录)
|
|
407
|
+
writeStartedAt = performance.now();
|
|
394
408
|
savePromises = menuList.map(function (menu) {
|
|
395
409
|
return _this2.dbManager.add(INDEXDB_STORE_NAME, menu);
|
|
396
410
|
});
|
|
397
|
-
_context6.
|
|
411
|
+
_context6.prev = 17;
|
|
412
|
+
_context6.next = 20;
|
|
398
413
|
return Promise.all(savePromises);
|
|
399
|
-
case
|
|
414
|
+
case 20:
|
|
415
|
+
_context6.prev = 20;
|
|
416
|
+
writeDurationMs = +(performance.now() - writeStartedAt).toFixed(2);
|
|
417
|
+
return _context6.finish(20);
|
|
418
|
+
case 23:
|
|
400
419
|
this.logInfo('餐牌数据已保存到 IndexDB', {
|
|
401
|
-
menuCount: menuList.length
|
|
420
|
+
menuCount: menuList.length,
|
|
421
|
+
clearDurationMs: clearDurationMs,
|
|
422
|
+
writeDurationMs: writeDurationMs,
|
|
423
|
+
totalDurationMs: +(performance.now() - startedAt).toFixed(2)
|
|
402
424
|
});
|
|
403
|
-
_context6.next =
|
|
425
|
+
_context6.next = 31;
|
|
404
426
|
break;
|
|
405
|
-
case
|
|
406
|
-
_context6.prev =
|
|
407
|
-
_context6.t0 = _context6["catch"](
|
|
427
|
+
case 26:
|
|
428
|
+
_context6.prev = 26;
|
|
429
|
+
_context6.t0 = _context6["catch"](7);
|
|
408
430
|
errorMessage = _context6.t0 instanceof Error ? _context6.t0.message : String(_context6.t0);
|
|
409
431
|
console.error('[Menu] 保存数据到 IndexDB 失败:', _context6.t0);
|
|
410
432
|
this.logError('保存数据到 IndexDB 失败', {
|
|
411
433
|
menuCount: menuList.length,
|
|
434
|
+
clearDurationMs: clearDurationMs,
|
|
435
|
+
writeDurationMs: writeDurationMs,
|
|
436
|
+
totalDurationMs: +(performance.now() - startedAt).toFixed(2),
|
|
412
437
|
error: errorMessage
|
|
413
438
|
});
|
|
414
|
-
case
|
|
439
|
+
case 31:
|
|
415
440
|
case "end":
|
|
416
441
|
return _context6.stop();
|
|
417
442
|
}
|
|
418
|
-
}, _callee6, this, [[
|
|
443
|
+
}, _callee6, this, [[7, 26], [9,, 12, 15], [17,, 20, 23]]);
|
|
419
444
|
}));
|
|
420
445
|
function saveMenuToIndexDB(_x4) {
|
|
421
446
|
return _saveMenuToIndexDB.apply(this, arguments);
|
|
@@ -127,14 +127,23 @@ export declare class OrderModule extends BaseModule implements Module {
|
|
|
127
127
|
payment: Record<string, any>;
|
|
128
128
|
previousPayment: Record<string, any>;
|
|
129
129
|
} | null>;
|
|
130
|
-
loadOrdersByServer(
|
|
130
|
+
loadOrdersByServer(options?: {
|
|
131
|
+
trigger?: string;
|
|
132
|
+
}): Promise<OrderData[]>;
|
|
131
133
|
/**
|
|
132
134
|
* 静默全量刷新:后台重新拉取全量 SSE 订单数据并更新本地
|
|
133
135
|
* 拿到完整数据后一次性替换 store,触发订单变更与同步完成事件
|
|
134
136
|
* @returns 刷新后的订单列表
|
|
135
137
|
*/
|
|
136
|
-
silentRefresh(
|
|
138
|
+
silentRefresh(options?: {
|
|
139
|
+
trigger?: string;
|
|
140
|
+
}): Promise<OrderData[]>;
|
|
137
141
|
private normalizeOrderForMemoryList;
|
|
142
|
+
/**
|
|
143
|
+
* 将已经完成集合规范化的订单转换为内存身份,不重复扫描 products/bookings/payments。
|
|
144
|
+
*/
|
|
145
|
+
private prepareNormalizedOrderForMemoryList;
|
|
146
|
+
private prepareNormalizedOrdersForMemoryList;
|
|
138
147
|
private normalizeOrdersForMemoryList;
|
|
139
148
|
private hasRealOrderId;
|
|
140
149
|
private shouldKeepOrderInMemory;
|
|
@@ -299,13 +308,14 @@ export declare class OrderModule extends BaseModule implements Module {
|
|
|
299
308
|
private logDuplicateOrders;
|
|
300
309
|
private compactOrderListByIdentity;
|
|
301
310
|
/**
|
|
302
|
-
*
|
|
303
|
-
*
|
|
304
|
-
* - 无法解析时退化为自然日窗口
|
|
311
|
+
* 当前订单缓存可复用窗口。
|
|
312
|
+
* start_time 模式使用精确的营业日起止时间;配置缺失或异常时退化为自然日。
|
|
305
313
|
*/
|
|
306
|
-
private
|
|
314
|
+
private getCurrentOrderCacheWindow;
|
|
307
315
|
private hasPulledOrdersToday;
|
|
308
316
|
private markOrderPulledAtNow;
|
|
317
|
+
private clearOrderSnapshotMarker;
|
|
318
|
+
private getCurrentShopId;
|
|
309
319
|
private getStorageItem;
|
|
310
320
|
private setStorageItem;
|
|
311
321
|
private loadOrdersFromSQLite;
|
|
@@ -343,7 +353,7 @@ export declare class OrderModule extends BaseModule implements Module {
|
|
|
343
353
|
* 用于 SSE 全量拉取与营业日窗口裁剪。
|
|
344
354
|
*
|
|
345
355
|
* @example
|
|
346
|
-
* await this.replaceOrdersSnapshotInSQLite(orderList)
|
|
356
|
+
* const { orders, persisted } = await this.replaceOrdersSnapshotInSQLite(orderList, 'refresh')
|
|
347
357
|
*/
|
|
348
358
|
private replaceOrdersSnapshotInSQLite;
|
|
349
359
|
/**
|