@pisell/pisellos 2.2.261 → 2.2.263
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/model/strategy/adapter/dataVariant/adapter.d.ts +50 -0
- package/dist/model/strategy/adapter/dataVariant/adapter.js +167 -0
- package/dist/model/strategy/adapter/dataVariant/evaluator.d.ts +89 -0
- package/dist/model/strategy/adapter/dataVariant/evaluator.js +780 -0
- package/dist/model/strategy/adapter/dataVariant/examples.d.ts +39 -0
- package/dist/model/strategy/adapter/dataVariant/examples.js +277 -0
- package/dist/model/strategy/adapter/dataVariant/index.d.ts +4 -0
- package/dist/model/strategy/adapter/dataVariant/index.js +4 -0
- package/dist/model/strategy/adapter/dataVariant/type.d.ts +148 -0
- package/dist/model/strategy/adapter/dataVariant/type.js +54 -0
- package/dist/model/strategy/adapter/index.d.ts +4 -0
- package/dist/model/strategy/adapter/index.js +5 -1
- package/dist/model/strategy/adapter/promotion/adapter.d.ts +0 -4
- package/dist/model/strategy/adapter/promotion/adapter.js +0 -23
- package/dist/model/strategy/adapter/promotion/evaluator.d.ts +0 -17
- package/dist/model/strategy/adapter/promotion/evaluator.js +6 -279
- package/dist/model/strategy/adapter/promotion/examples.d.ts +0 -86
- package/dist/model/strategy/adapter/promotion/examples.js +0 -99
- package/dist/model/strategy/adapter/promotion/index.d.ts +1 -1
- package/dist/model/strategy/adapter/promotion/index.js +1 -1
- package/dist/model/strategy/adapter/promotion/type.d.ts +2 -90
- package/dist/model/strategy/adapter/promotion/type.js +0 -45
- package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +16 -10
- package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +2 -1
- package/dist/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +1 -1
- package/dist/modules/BookingContext/utils/cacheItemToBookingInput.js +32 -1
- package/dist/modules/Discount/index.d.ts +5 -2
- package/dist/modules/Discount/index.js +30 -7
- package/dist/modules/Discount/types.d.ts +4 -0
- package/dist/modules/Order/index.d.ts +14 -2
- package/dist/modules/Order/index.js +1035 -736
- package/dist/modules/Order/types.d.ts +16 -0
- package/dist/modules/Order/utils/orderCollectionIdentity.d.ts +53 -0
- package/dist/modules/Order/utils/orderCollectionIdentity.js +405 -0
- package/dist/modules/Order/utils.d.ts +4 -3
- package/dist/modules/Order/utils.js +54 -61
- package/dist/modules/Product/types.d.ts +22 -0
- package/dist/modules/ProductList/index.d.ts +1 -1
- package/dist/modules/ProductList/index.js +4 -2
- package/dist/modules/ProductList/types.d.ts +2 -0
- package/dist/modules/Rules/index.d.ts +2 -9
- package/dist/modules/Rules/index.js +69 -43
- package/dist/modules/Rules/types.d.ts +10 -1
- package/dist/server/index.d.ts +55 -0
- package/dist/server/index.js +1173 -753
- package/dist/server/modules/order/index.d.ts +10 -4
- package/dist/server/modules/order/index.js +404 -399
- package/dist/server/modules/order/types.d.ts +4 -0
- package/dist/server/modules/products/index.d.ts +31 -8
- package/dist/server/modules/products/index.js +549 -390
- package/dist/server/modules/products/types.d.ts +18 -0
- package/dist/solution/BaseSales/index.d.ts +21 -1
- package/dist/solution/BaseSales/index.js +1136 -789
- package/dist/solution/BaseSales/types.d.ts +6 -1
- package/dist/solution/BaseSales/types.js +1 -1
- package/dist/solution/BaseSales/utils/cartPromotion.d.ts +1 -3
- package/dist/solution/BaseSales/utils/cartPromotion.js +48 -81
- package/dist/solution/BaseSales/utils/parseSalesResponse.d.ts +3 -3
- package/dist/solution/BaseSales/utils/parseSalesResponse.js +6 -8
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +14 -1
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.js +59 -25
- package/dist/solution/BookingTicket/types.d.ts +2 -0
- package/dist/solution/ScanOrder/index.js +20 -31
- package/dist/solution/ShopDiscount/index.js +15 -14
- package/dist/solution/VenueBooking/index.js +19 -30
- package/lib/model/strategy/adapter/dataVariant/adapter.d.ts +50 -0
- package/lib/model/strategy/adapter/dataVariant/adapter.js +149 -0
- package/lib/model/strategy/adapter/dataVariant/evaluator.d.ts +89 -0
- package/lib/model/strategy/adapter/dataVariant/evaluator.js +583 -0
- package/lib/model/strategy/adapter/dataVariant/examples.d.ts +39 -0
- package/lib/model/strategy/adapter/dataVariant/examples.js +293 -0
- package/lib/model/strategy/adapter/dataVariant/index.d.ts +4 -0
- package/lib/model/strategy/adapter/dataVariant/index.js +38 -0
- package/lib/model/strategy/adapter/dataVariant/type.d.ts +148 -0
- package/lib/model/strategy/adapter/dataVariant/type.js +31 -0
- package/lib/model/strategy/adapter/index.d.ts +4 -0
- package/lib/model/strategy/adapter/index.js +13 -2
- package/lib/model/strategy/adapter/promotion/adapter.d.ts +0 -4
- package/lib/model/strategy/adapter/promotion/adapter.js +0 -20
- package/lib/model/strategy/adapter/promotion/evaluator.d.ts +0 -17
- package/lib/model/strategy/adapter/promotion/evaluator.js +0 -235
- package/lib/model/strategy/adapter/promotion/examples.d.ts +0 -86
- package/lib/model/strategy/adapter/promotion/examples.js +0 -91
- package/lib/model/strategy/adapter/promotion/index.d.ts +1 -1
- package/lib/model/strategy/adapter/promotion/index.js +0 -51
- package/lib/model/strategy/adapter/promotion/type.d.ts +2 -90
- package/lib/model/strategy/adapter/promotion/type.js +0 -2
- package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +5 -0
- package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +1 -0
- package/lib/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +1 -1
- package/lib/modules/BookingContext/utils/cacheItemToBookingInput.js +23 -2
- package/lib/modules/Discount/index.d.ts +5 -2
- package/lib/modules/Discount/index.js +23 -3
- package/lib/modules/Discount/types.d.ts +4 -0
- package/lib/modules/Order/index.d.ts +14 -2
- package/lib/modules/Order/index.js +326 -60
- package/lib/modules/Order/types.d.ts +16 -0
- package/lib/modules/Order/utils/orderCollectionIdentity.d.ts +53 -0
- package/lib/modules/Order/utils/orderCollectionIdentity.js +415 -0
- package/lib/modules/Order/utils.d.ts +4 -3
- package/lib/modules/Order/utils.js +22 -23
- package/lib/modules/Product/types.d.ts +22 -0
- package/lib/modules/ProductList/index.d.ts +1 -1
- package/lib/modules/ProductList/index.js +4 -2
- package/lib/modules/ProductList/types.d.ts +2 -0
- package/lib/modules/Rules/index.d.ts +2 -9
- package/lib/modules/Rules/index.js +61 -29
- package/lib/modules/Rules/types.d.ts +10 -1
- package/lib/server/index.d.ts +55 -0
- package/lib/server/index.js +332 -34
- package/lib/server/modules/order/index.d.ts +10 -4
- package/lib/server/modules/order/index.js +198 -139
- package/lib/server/modules/order/types.d.ts +4 -0
- package/lib/server/modules/products/index.d.ts +31 -8
- package/lib/server/modules/products/index.js +134 -35
- package/lib/server/modules/products/types.d.ts +18 -0
- package/lib/solution/BaseSales/index.d.ts +21 -1
- package/lib/solution/BaseSales/index.js +313 -72
- package/lib/solution/BaseSales/types.d.ts +6 -1
- package/lib/solution/BaseSales/utils/cartPromotion.d.ts +1 -3
- package/lib/solution/BaseSales/utils/cartPromotion.js +29 -60
- package/lib/solution/BaseSales/utils/parseSalesResponse.d.ts +3 -3
- package/lib/solution/BaseSales/utils/parseSalesResponse.js +4 -5
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +8 -0
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.js +33 -8
- package/lib/solution/BookingTicket/types.d.ts +2 -0
- package/lib/solution/ScanOrder/index.js +0 -8
- package/lib/solution/ShopDiscount/index.js +2 -1
- package/lib/solution/VenueBooking/index.js +0 -8
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Discount } from '../Discount/types';
|
|
2
|
+
import { SetDiscountSelectedParams } from '../../solution/ShopDiscount/types';
|
|
2
3
|
export declare enum UnavailableReason {
|
|
3
4
|
TimeLimit = "time_limit",
|
|
4
5
|
ProductNotApplicable = "product_not_applicable",
|
|
@@ -23,6 +24,14 @@ export interface DiscountResult {
|
|
|
23
24
|
discountList: any[];
|
|
24
25
|
}
|
|
25
26
|
export type RulesFormSubject = boolean | ((product: any) => boolean);
|
|
27
|
+
export interface RulesCalcDiscountOptions {
|
|
28
|
+
isSelected?: boolean;
|
|
29
|
+
discountId?: number;
|
|
30
|
+
selectedList?: SetDiscountSelectedParams[];
|
|
31
|
+
scan?: boolean;
|
|
32
|
+
/** Change time 重报价目标行:允许已选编辑态折扣卡重新应用到这些 booking 商品。 */
|
|
33
|
+
reapplyBookingDiscountProductUids?: string[];
|
|
34
|
+
}
|
|
26
35
|
export interface RulesModuleAPI {
|
|
27
36
|
setRulesList: (rulesList: Rules[]) => Promise<void>;
|
|
28
37
|
clear: () => Promise<void>;
|
|
@@ -34,7 +43,7 @@ export interface RulesModuleAPI {
|
|
|
34
43
|
}[];
|
|
35
44
|
isFormSubject: RulesFormSubject;
|
|
36
45
|
orderTotalAmount: number;
|
|
37
|
-
}) => DiscountResult;
|
|
46
|
+
}, options?: RulesCalcDiscountOptions) => DiscountResult;
|
|
38
47
|
}
|
|
39
48
|
type ProductDetail = {
|
|
40
49
|
isClient?: boolean;
|
package/dist/server/index.d.ts
CHANGED
|
@@ -47,6 +47,8 @@ declare class Server {
|
|
|
47
47
|
private prefixRouterGet;
|
|
48
48
|
router: Router;
|
|
49
49
|
private productQuerySubscribers;
|
|
50
|
+
/** subscriberId → 智能定价变价时间点定时器句柄(与 subscriber 分离存储,便于 clear) */
|
|
51
|
+
private productQueryScheduleTimers;
|
|
50
52
|
private orderQuerySubscribers;
|
|
51
53
|
private bookingQuerySubscribers;
|
|
52
54
|
private bookingRemoteQuerySubscribers;
|
|
@@ -210,6 +212,48 @@ declare class Server {
|
|
|
210
212
|
* 根据 subscriberId 移除商品查询订阅者
|
|
211
213
|
*/
|
|
212
214
|
removeProductQuerySubscriber(subscriberId?: string): void;
|
|
215
|
+
/**
|
|
216
|
+
* 构建商品 query 响应 data 段,附带智能定价 schedule_time_points 元数据。
|
|
217
|
+
*/
|
|
218
|
+
private buildProductQueryResultPayload;
|
|
219
|
+
/**
|
|
220
|
+
* 是否启用商品 query 订阅的 schedule 时间点定时重算。
|
|
221
|
+
* strategy_context.enable_schedule_reload === false 时关闭。
|
|
222
|
+
*/
|
|
223
|
+
private shouldScheduleProductQueryReload;
|
|
224
|
+
/**
|
|
225
|
+
* 清除指定 subscriber 的全部 schedule 定时器,防止重复 query 或 unsubscribe 后泄漏。
|
|
226
|
+
*/
|
|
227
|
+
private clearSubscriberScheduleTimers;
|
|
228
|
+
/**
|
|
229
|
+
* 从 productQueryScheduleTimers 移除已触发的 timer 引用。
|
|
230
|
+
*/
|
|
231
|
+
private removeScheduleTimerRef;
|
|
232
|
+
/**
|
|
233
|
+
* 计算 schedule 变价时间点到当前时刻的延迟(ms)。已过期返回 -1。
|
|
234
|
+
*/
|
|
235
|
+
private computeScheduleTimePointDelayMs;
|
|
236
|
+
/**
|
|
237
|
+
* 定时重算前刷新 subscriber schedule 上下文:使用执行瞬间时间,禁止沿用首次 query 的 schedule_datetime。
|
|
238
|
+
*/
|
|
239
|
+
private refreshSubscriberScheduleAtExecution;
|
|
240
|
+
/**
|
|
241
|
+
* 为 subscriber 注册智能定价 scheduleTimePoints 定时重算。
|
|
242
|
+
* 必须先 clearSubscriberScheduleTimers,再调用本方法。
|
|
243
|
+
*/
|
|
244
|
+
private scheduleSubscriberTimePointReloads;
|
|
245
|
+
/**
|
|
246
|
+
* schedule 变价时间点定时器触发:刷新 schedule_datetime 后重算并 callback。
|
|
247
|
+
*/
|
|
248
|
+
private onScheduleTimePointTimerFire;
|
|
249
|
+
/**
|
|
250
|
+
* 对单个商品 query 订阅者重算并推送(定时路径;不新建 schedule timer)。
|
|
251
|
+
*/
|
|
252
|
+
private recomputeAndNotifySubscriber;
|
|
253
|
+
/**
|
|
254
|
+
* query 完成后为 subscriber 同步 schedule 定时器(先 clear 再 schedule)。
|
|
255
|
+
*/
|
|
256
|
+
private syncProductQueryScheduleTimers;
|
|
213
257
|
/**
|
|
214
258
|
* 处理商品查询请求
|
|
215
259
|
* 存储订阅者信息,便于数据变更时推送最新结果
|
|
@@ -445,6 +489,11 @@ declare class Server {
|
|
|
445
489
|
private sumPaidOrderPayments;
|
|
446
490
|
private toAmountNumber;
|
|
447
491
|
private buildSmallTicketProductMap;
|
|
492
|
+
private collectSalesDetailProductIds;
|
|
493
|
+
private buildSalesDetailProductSnapshotMap;
|
|
494
|
+
private withProductCatalogSnapshots;
|
|
495
|
+
private withBundleCatalogSnapshots;
|
|
496
|
+
private withSalesDetailProductSnapshots;
|
|
448
497
|
private withPendingSyncProductTitles;
|
|
449
498
|
private buildProductTitleSnapshot;
|
|
450
499
|
private getProductTitleSnapshotCurrentLocale;
|
|
@@ -565,6 +614,12 @@ declare class Server {
|
|
|
565
614
|
* @param options.changedIds 变更的商品 IDs,用于增量更新价格缓存
|
|
566
615
|
*/
|
|
567
616
|
private computeProductQueryResult;
|
|
617
|
+
/**
|
|
618
|
+
* 构建商品格式化上下文。
|
|
619
|
+
*
|
|
620
|
+
* 智能定价条件使用全量 menuList/scheduleList;Product Query 顶层参数只保留筛选商品集合所需字段。
|
|
621
|
+
*/
|
|
622
|
+
private buildProductFormatterContext;
|
|
568
623
|
/**
|
|
569
624
|
* 数据变更后,遍历所有订阅者重新计算查询结果并通过 callback 推送
|
|
570
625
|
* 由 ProductsModule 的 onProductsSyncCompleted 事件触发
|