@pisell/pisellos 2.1.170 → 2.1.172
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/index.d.ts +1 -1
- package/dist/index.js +1 -3
- package/dist/model/strategy/adapter/index.d.ts +0 -4
- package/dist/model/strategy/adapter/index.js +1 -5
- package/dist/model/strategy/adapter/promotion/evaluator.js +99 -26
- package/dist/model/strategy/adapter/promotion/index.js +0 -9
- package/dist/model/strategy/adapter/walletPass/evaluator.d.ts +2 -0
- package/dist/model/strategy/adapter/walletPass/evaluator.js +61 -8
- package/dist/model/strategy/adapter/walletPass/locales.js +12 -3
- package/dist/model/strategy/engine.d.ts +18 -5
- package/dist/model/strategy/engine.js +145 -45
- package/dist/model/strategy/type.d.ts +17 -0
- package/dist/model/strategy/type.js +4 -0
- package/dist/modules/Cart/types.d.ts +2 -0
- package/dist/modules/Cart/utils/cartProduct.js +56 -25
- package/dist/modules/Cart/utils/changePrice.js +9 -16
- package/dist/modules/Discount/index.d.ts +4 -13
- package/dist/modules/Discount/index.js +12 -124
- package/dist/modules/Discount/types.d.ts +18 -13
- package/dist/modules/Order/index.d.ts +1 -67
- package/dist/modules/Order/index.js +30 -918
- package/dist/modules/Order/types.d.ts +12 -176
- package/dist/modules/Order/types.js +0 -2
- package/dist/modules/Order/utils.d.ts +0 -118
- package/dist/modules/Order/utils.js +2 -586
- package/dist/modules/Payment/index.d.ts +2 -1
- package/dist/modules/Payment/index.js +10 -7
- package/dist/modules/Payment/utils.js +3 -0
- package/dist/modules/Payment/walletpass.d.ts +23 -0
- package/dist/modules/Payment/walletpass.js +191 -95
- package/dist/modules/Product/utils.js +2 -2
- package/dist/modules/ProductList/index.d.ts +2 -4
- package/dist/modules/ProductList/index.js +12 -24
- package/dist/modules/Rules/index.d.ts +9 -5
- package/dist/modules/Rules/index.js +669 -173
- package/dist/modules/Rules/types.d.ts +2 -0
- package/dist/modules/Schedule/getDateIsInSchedule.js +18 -16
- package/dist/modules/Schedule/utils.d.ts +1 -1
- package/dist/modules/Summary/types.d.ts +2 -0
- package/dist/modules/Summary/utils.d.ts +9 -3
- package/dist/modules/Summary/utils.js +57 -67
- package/dist/modules/index.d.ts +0 -4
- package/dist/modules/index.js +1 -5
- package/dist/plugins/window.d.ts +2 -0
- package/dist/solution/BookingByStep/index.d.ts +3 -2
- package/dist/solution/BookingByStep/index.js +43 -46
- package/dist/solution/BookingByStep/types.d.ts +1 -3
- package/dist/solution/BookingByStep/types.js +1 -5
- package/dist/solution/BookingByStep/utils/timeslots.d.ts +1 -3
- package/dist/solution/BookingByStep/utils/timeslots.js +12 -19
- package/dist/solution/Checkout/index.js +2 -0
- package/dist/solution/ShopDiscount/index.d.ts +2 -3
- package/dist/solution/ShopDiscount/index.js +60 -62
- package/dist/solution/ShopDiscount/types.d.ts +1 -1
- package/dist/solution/ShopDiscount/types.js +2 -1
- package/dist/solution/ShopDiscount/utils.js +26 -12
- package/dist/solution/index.d.ts +0 -2
- package/dist/solution/index.js +1 -3
- package/lib/index.d.ts +1 -1
- package/lib/index.js +3 -4
- package/lib/model/strategy/adapter/index.d.ts +0 -4
- package/lib/model/strategy/adapter/index.js +2 -13
- package/lib/model/strategy/adapter/promotion/evaluator.js +57 -8
- package/lib/model/strategy/adapter/walletPass/evaluator.d.ts +2 -0
- package/lib/model/strategy/adapter/walletPass/evaluator.js +34 -3
- package/lib/model/strategy/adapter/walletPass/locales.js +12 -3
- package/lib/model/strategy/engine.d.ts +18 -5
- package/lib/model/strategy/engine.js +85 -21
- package/lib/model/strategy/type.d.ts +17 -0
- package/lib/modules/Cart/types.d.ts +2 -0
- package/lib/modules/Cart/utils/cartProduct.js +39 -12
- package/lib/modules/Cart/utils/changePrice.js +9 -13
- package/lib/modules/Discount/index.d.ts +4 -13
- package/lib/modules/Discount/index.js +5 -76
- package/lib/modules/Discount/types.d.ts +18 -13
- package/lib/modules/Order/index.d.ts +1 -67
- package/lib/modules/Order/index.js +1 -525
- package/lib/modules/Order/types.d.ts +12 -176
- package/lib/modules/Order/utils.d.ts +0 -118
- package/lib/modules/Order/utils.js +2 -483
- package/lib/modules/Payment/index.d.ts +2 -1
- package/lib/modules/Payment/index.js +1 -0
- package/lib/modules/Payment/utils.js +3 -0
- package/lib/modules/Payment/walletpass.d.ts +23 -0
- package/lib/modules/Payment/walletpass.js +94 -17
- package/lib/modules/Product/utils.js +2 -2
- package/lib/modules/ProductList/index.d.ts +2 -4
- package/lib/modules/ProductList/index.js +39 -46
- package/lib/modules/Rules/index.d.ts +9 -5
- package/lib/modules/Rules/index.js +776 -292
- package/lib/modules/Rules/types.d.ts +2 -0
- package/lib/modules/Schedule/getDateIsInSchedule.js +11 -13
- package/lib/modules/Schedule/utils.d.ts +1 -1
- package/lib/modules/Summary/types.d.ts +2 -0
- package/lib/modules/Summary/utils.d.ts +9 -3
- package/lib/modules/Summary/utils.js +34 -45
- package/lib/modules/index.d.ts +0 -4
- package/lib/modules/index.js +1 -9
- package/lib/plugins/window.d.ts +2 -0
- package/lib/solution/BookingByStep/index.d.ts +3 -2
- package/lib/solution/BookingByStep/index.js +4 -6
- package/lib/solution/BookingByStep/types.d.ts +1 -3
- package/lib/solution/BookingByStep/types.js +0 -10
- package/lib/solution/BookingByStep/utils/timeslots.d.ts +1 -3
- package/lib/solution/BookingByStep/utils/timeslots.js +11 -19
- package/lib/solution/Checkout/index.js +2 -0
- package/lib/solution/ShopDiscount/index.d.ts +2 -3
- package/lib/solution/ShopDiscount/index.js +27 -22
- package/lib/solution/ShopDiscount/types.d.ts +1 -1
- package/lib/solution/ShopDiscount/utils.js +10 -6
- package/lib/solution/index.d.ts +0 -2
- package/lib/solution/index.js +1 -5
- package/package.json +2 -2
- package/dist/apis/picoding.d.ts +0 -0
- package/dist/apis/picoding.js +0 -1
- package/dist/model/strategy/adapter/dataVariant/adapter.d.ts +0 -50
- package/dist/model/strategy/adapter/dataVariant/adapter.js +0 -167
- package/dist/model/strategy/adapter/dataVariant/evaluator.d.ts +0 -89
- package/dist/model/strategy/adapter/dataVariant/evaluator.js +0 -867
- package/dist/model/strategy/adapter/dataVariant/examples.d.ts +0 -39
- package/dist/model/strategy/adapter/dataVariant/examples.js +0 -277
- package/dist/model/strategy/adapter/dataVariant/index.d.ts +0 -4
- package/dist/model/strategy/adapter/dataVariant/index.js +0 -4
- package/dist/model/strategy/adapter/dataVariant/type.d.ts +0 -149
- package/dist/model/strategy/adapter/dataVariant/type.js +0 -54
- package/dist/modules/OpenData/index.d.ts +0 -24
- package/dist/modules/OpenData/index.js +0 -173
- package/dist/modules/OpenData/types.d.ts +0 -73
- package/dist/modules/OpenData/types.js +0 -1
- package/dist/modules/OpenData/utils.d.ts +0 -2
- package/dist/modules/OpenData/utils.js +0 -75
- package/dist/modules/Quotation/index.d.ts +0 -48
- package/dist/modules/Quotation/index.js +0 -248
- package/dist/modules/Quotation/types.d.ts +0 -42
- package/dist/modules/Quotation/types.js +0 -1
- package/dist/modules/SalesSummary/index.d.ts +0 -63
- package/dist/modules/SalesSummary/index.js +0 -174
- package/dist/modules/SalesSummary/types.d.ts +0 -60
- package/dist/modules/SalesSummary/types.js +0 -1
- package/dist/modules/SalesSummary/utils.d.ts +0 -30
- package/dist/modules/SalesSummary/utils.js +0 -480
- package/dist/modules/ScanOrderLogger/index.d.ts +0 -23
- package/dist/modules/ScanOrderLogger/index.js +0 -174
- package/dist/modules/ScanOrderLogger/providers/feishu.d.ts +0 -2
- package/dist/modules/ScanOrderLogger/providers/feishu.js +0 -221
- package/dist/modules/ScanOrderLogger/providers/grafana.d.ts +0 -2
- package/dist/modules/ScanOrderLogger/providers/grafana.js +0 -50
- package/dist/modules/ScanOrderLogger/types.d.ts +0 -53
- package/dist/modules/ScanOrderLogger/types.js +0 -1
- package/dist/solution/ScanOrder/index.d.ts +0 -158
- package/dist/solution/ScanOrder/index.js +0 -3474
- package/dist/solution/ScanOrder/types.d.ts +0 -306
- package/dist/solution/ScanOrder/types.js +0 -35
- package/dist/solution/ScanOrder/utils.d.ts +0 -172
- package/dist/solution/ScanOrder/utils.js +0 -796
- package/dist/solution/VenueBooking/index.d.ts +0 -252
- package/dist/solution/VenueBooking/index.js +0 -3769
- package/dist/solution/VenueBooking/sales-section-4-annotated.json +0 -343
- package/dist/solution/VenueBooking/types.d.ts +0 -156
- package/dist/solution/VenueBooking/types.js +0 -22
- package/dist/solution/VenueBooking/utils/dateSummary.d.ts +0 -11
- package/dist/solution/VenueBooking/utils/dateSummary.js +0 -91
- package/dist/solution/VenueBooking/utils/resource.d.ts +0 -14
- package/dist/solution/VenueBooking/utils/resource.js +0 -131
- package/dist/solution/VenueBooking/utils/slotMerge.d.ts +0 -32
- package/dist/solution/VenueBooking/utils/slotMerge.js +0 -233
- package/dist/solution/VenueBooking/utils/smartPricing.d.ts +0 -71
- package/dist/solution/VenueBooking/utils/smartPricing.js +0 -302
- package/dist/solution/VenueBooking/utils/timeSlot.d.ts +0 -34
- package/dist/solution/VenueBooking/utils/timeSlot.js +0 -458
- package/dist/solution/VenueBooking/utils.d.ts +0 -1
- package/dist/solution/VenueBooking/utils.js +0 -1
- package/lib/apis/picoding.d.ts +0 -0
- package/lib/apis/picoding.js +0 -0
- package/lib/model/strategy/adapter/dataVariant/adapter.d.ts +0 -50
- package/lib/model/strategy/adapter/dataVariant/adapter.js +0 -149
- package/lib/model/strategy/adapter/dataVariant/evaluator.d.ts +0 -89
- package/lib/model/strategy/adapter/dataVariant/evaluator.js +0 -666
- package/lib/model/strategy/adapter/dataVariant/examples.d.ts +0 -39
- package/lib/model/strategy/adapter/dataVariant/examples.js +0 -293
- package/lib/model/strategy/adapter/dataVariant/index.d.ts +0 -4
- package/lib/model/strategy/adapter/dataVariant/index.js +0 -38
- package/lib/model/strategy/adapter/dataVariant/type.d.ts +0 -149
- package/lib/model/strategy/adapter/dataVariant/type.js +0 -31
- package/lib/modules/OpenData/index.d.ts +0 -24
- package/lib/modules/OpenData/index.js +0 -119
- package/lib/modules/OpenData/types.d.ts +0 -73
- package/lib/modules/OpenData/types.js +0 -17
- package/lib/modules/OpenData/utils.d.ts +0 -2
- package/lib/modules/OpenData/utils.js +0 -111
- package/lib/modules/Quotation/index.d.ts +0 -48
- package/lib/modules/Quotation/index.js +0 -152
- package/lib/modules/Quotation/types.d.ts +0 -42
- package/lib/modules/Quotation/types.js +0 -17
- package/lib/modules/SalesSummary/index.d.ts +0 -63
- package/lib/modules/SalesSummary/index.js +0 -105
- package/lib/modules/SalesSummary/types.d.ts +0 -60
- package/lib/modules/SalesSummary/types.js +0 -17
- package/lib/modules/SalesSummary/utils.d.ts +0 -30
- package/lib/modules/SalesSummary/utils.js +0 -420
- package/lib/modules/ScanOrderLogger/index.d.ts +0 -23
- package/lib/modules/ScanOrderLogger/index.js +0 -147
- package/lib/modules/ScanOrderLogger/providers/feishu.d.ts +0 -2
- package/lib/modules/ScanOrderLogger/providers/feishu.js +0 -157
- package/lib/modules/ScanOrderLogger/providers/grafana.d.ts +0 -2
- package/lib/modules/ScanOrderLogger/providers/grafana.js +0 -52
- package/lib/modules/ScanOrderLogger/types.d.ts +0 -53
- package/lib/modules/ScanOrderLogger/types.js +0 -17
- package/lib/solution/ScanOrder/index.d.ts +0 -158
- package/lib/solution/ScanOrder/index.js +0 -2135
- package/lib/solution/ScanOrder/types.d.ts +0 -306
- package/lib/solution/ScanOrder/types.js +0 -36
- package/lib/solution/ScanOrder/utils.d.ts +0 -172
- package/lib/solution/ScanOrder/utils.js +0 -658
- package/lib/solution/VenueBooking/index.d.ts +0 -252
- package/lib/solution/VenueBooking/index.js +0 -2204
- package/lib/solution/VenueBooking/sales-section-4-annotated.json +0 -343
- package/lib/solution/VenueBooking/types.d.ts +0 -156
- package/lib/solution/VenueBooking/types.js +0 -45
- package/lib/solution/VenueBooking/utils/dateSummary.d.ts +0 -11
- package/lib/solution/VenueBooking/utils/dateSummary.js +0 -105
- package/lib/solution/VenueBooking/utils/resource.d.ts +0 -14
- package/lib/solution/VenueBooking/utils/resource.js +0 -92
- package/lib/solution/VenueBooking/utils/slotMerge.d.ts +0 -32
- package/lib/solution/VenueBooking/utils/slotMerge.js +0 -236
- package/lib/solution/VenueBooking/utils/smartPricing.d.ts +0 -71
- package/lib/solution/VenueBooking/utils/smartPricing.js +0 -225
- package/lib/solution/VenueBooking/utils/timeSlot.d.ts +0 -34
- package/lib/solution/VenueBooking/utils/timeSlot.js +0 -343
- package/lib/solution/VenueBooking/utils.d.ts +0 -1
- package/lib/solution/VenueBooking/utils.js +0 -69
|
@@ -1,252 +0,0 @@
|
|
|
1
|
-
import { Module, ModuleOptions, PisellCore } from '../../types';
|
|
2
|
-
import { BaseModule } from '../../modules/BaseModule';
|
|
3
|
-
import { VenueBookingAddLogParams, VenueBookingSlotConfig, VenueDateSummaryItem, VenueSlotSelection, VenueTimeSlotGrid } from './types';
|
|
4
|
-
import type { ScanOrderOrderProduct, ScanOrderOrderProductIdentity } from '../ScanOrder/types';
|
|
5
|
-
import type { UpdateProductInOrderParams } from '../../modules/Order/types';
|
|
6
|
-
import type { ScheduleItem } from '../../modules/Schedule/types';
|
|
7
|
-
import type { OpenDataAvailabilityResult } from '../../modules/OpenData';
|
|
8
|
-
import type { ProductData } from '../../modules/Product/types';
|
|
9
|
-
import { type CartItemSummary, type PaxInfo, type QuantityCheckResult, type QuantityLimitResult } from '../../model/strategy/adapter/itemRule';
|
|
10
|
-
import type { StrategyConfig } from '../../model/strategy/type';
|
|
11
|
-
export * from './types';
|
|
12
|
-
interface VenueBookingItemRuleRuntimeConfig {
|
|
13
|
-
strategyConfigs?: StrategyConfig[];
|
|
14
|
-
pax?: Partial<PaxInfo>;
|
|
15
|
-
historicalItems?: CartItemSummary[];
|
|
16
|
-
serviceType?: string;
|
|
17
|
-
submissionIndex?: number;
|
|
18
|
-
custom?: Record<string, any>;
|
|
19
|
-
}
|
|
20
|
-
export declare class VenueBookingImpl extends BaseModule implements Module {
|
|
21
|
-
private static readonly PRICING_DEBUG_CACHE_ID;
|
|
22
|
-
protected defaultName: string;
|
|
23
|
-
protected defaultVersion: string;
|
|
24
|
-
isSolution: boolean;
|
|
25
|
-
private initializeOptions;
|
|
26
|
-
private store;
|
|
27
|
-
private otherParams;
|
|
28
|
-
private cacheId;
|
|
29
|
-
private window;
|
|
30
|
-
private request;
|
|
31
|
-
private baseSlotConfig;
|
|
32
|
-
private itemRuleEvaluator;
|
|
33
|
-
private itemRuleConfigs;
|
|
34
|
-
private itemRuleConfigsPromise;
|
|
35
|
-
private itemRulePrefillApplied;
|
|
36
|
-
private itemRuleRuntimeConfig;
|
|
37
|
-
private resourceProductMap;
|
|
38
|
-
private loginEffectDisposers;
|
|
39
|
-
private customerLoginRefreshInFlight;
|
|
40
|
-
private customerLoginRefreshIdInFlight;
|
|
41
|
-
/** 最近一次确认登录的客户;登录事件与 user 插件更新之间可能存在时序差。 */
|
|
42
|
-
private smartPricingCustomerId;
|
|
43
|
-
private loadAllProductsInFlight;
|
|
44
|
-
private productsLoaded;
|
|
45
|
-
private loadOpenDataConfigInFlight;
|
|
46
|
-
private static readonly OPEN_DATA_CACHE_TTL;
|
|
47
|
-
/** 按日期缓存 slot 智能定价 Map,避免同周重复 resolveProducts */
|
|
48
|
-
private slotPriceMapCache;
|
|
49
|
-
/** loadProducts 后缓存的全量商品(venue + addon),供分段算价复用 */
|
|
50
|
-
private smartPricingProductCatalog;
|
|
51
|
-
private static readonly PISELL1_LOGIN_SUCCESS;
|
|
52
|
-
private getLoggerContext;
|
|
53
|
-
private safeStringify;
|
|
54
|
-
private pickErrorMessage;
|
|
55
|
-
private serializeError;
|
|
56
|
-
private addVenueBookingLog;
|
|
57
|
-
/**
|
|
58
|
-
* 临时线上排查日志:
|
|
59
|
-
* - 仅对指定页面 cacheId 开启,避免影响其他页面
|
|
60
|
-
* - 不 await,且吞掉日志上报异常,保证日志系统不会阻断登录/商品加载主流程
|
|
61
|
-
*/
|
|
62
|
-
private logPricingDiagnostics;
|
|
63
|
-
private isPricingDiagnosticsEnabled;
|
|
64
|
-
private getAvailableWalletIdsForDiagnostics;
|
|
65
|
-
private logMethodStart;
|
|
66
|
-
private logMethodSuccess;
|
|
67
|
-
private logMethodError;
|
|
68
|
-
addLog(params: VenueBookingAddLogParams): Promise<void>;
|
|
69
|
-
constructor(name?: string, version?: string);
|
|
70
|
-
private normalizeCustomerId;
|
|
71
|
-
private resolveCustomerIdFromLoginPayload;
|
|
72
|
-
private clearLoginEffectListeners;
|
|
73
|
-
private registerLoginEffect;
|
|
74
|
-
private registerCustomerLoginListeners;
|
|
75
|
-
private refreshOrderMarketingAfterLogin;
|
|
76
|
-
initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
|
|
77
|
-
destroy(): Promise<void>;
|
|
78
|
-
retryInit(): Promise<void>;
|
|
79
|
-
refresh(): Promise<void>;
|
|
80
|
-
getStatus(): import("./types").VenueBookingStatus;
|
|
81
|
-
getEntryContext(): import("./types").VenueBookingEntryContext | null;
|
|
82
|
-
getItemRuleQuantityLimits(): QuantityLimitResult[];
|
|
83
|
-
getCartValidationPassed(): boolean | null;
|
|
84
|
-
getCartValidation(): {
|
|
85
|
-
passed: boolean | null;
|
|
86
|
-
failures: QuantityCheckResult[];
|
|
87
|
-
};
|
|
88
|
-
/** 清除 slot 价格分段缓存(商品重载 / 登录后 customerId 变化时调用) */
|
|
89
|
-
private clearSlotPriceMapCache;
|
|
90
|
-
/** 读取当前登录 customerId */
|
|
91
|
-
private resolveCustomerIdForSmartPricing;
|
|
92
|
-
private resolveAvailableWalletIdsForSmartPricing;
|
|
93
|
-
/** 读取 schedule 全量列表,供智能定价 schedule_match 使用 */
|
|
94
|
-
private getScheduleListForSmartPricing;
|
|
95
|
-
/** 构建智能定价上下文,对齐 OS Server buildProductFormatterContext */
|
|
96
|
-
private buildSmartPricingContext;
|
|
97
|
-
/** venue + addon 全量商品,供智能定价评估 */
|
|
98
|
-
private getAllProductsForSmartPricing;
|
|
99
|
-
private getSlotPriceMapCacheKey;
|
|
100
|
-
/**
|
|
101
|
-
* 按 schedule 分段构建 slot 价格 Map,带实例级缓存。
|
|
102
|
-
*/
|
|
103
|
-
private buildSlotPriceMapForDate;
|
|
104
|
-
loadAllProducts(): Promise<{
|
|
105
|
-
venueProducts: ProductData[];
|
|
106
|
-
addonProducts: ProductData[];
|
|
107
|
-
}>;
|
|
108
|
-
private _doLoadAllProducts;
|
|
109
|
-
loadVenueProducts(): Promise<ProductData[]>;
|
|
110
|
-
loadAddonProducts(): Promise<ProductData[]>;
|
|
111
|
-
getVenueProducts(): ProductData[];
|
|
112
|
-
getAddonProductsList(): ProductData[];
|
|
113
|
-
loadQuotations(params?: {
|
|
114
|
-
channel?: string;
|
|
115
|
-
}): Promise<void>;
|
|
116
|
-
fetchResourceAvailability(params: {
|
|
117
|
-
startDate: string;
|
|
118
|
-
endDate: string;
|
|
119
|
-
}): Promise<void>;
|
|
120
|
-
private getOperatingHoursScheduleIds;
|
|
121
|
-
private resolveSlotConfigForDate;
|
|
122
|
-
private syncOperatingHoursToSlotConfig;
|
|
123
|
-
getDateRangeSummary(params: {
|
|
124
|
-
startDate: string;
|
|
125
|
-
endDate: string;
|
|
126
|
-
}): VenueDateSummaryItem[];
|
|
127
|
-
getTimeSlotGrid(date: string): VenueTimeSlotGrid;
|
|
128
|
-
/**
|
|
129
|
-
* 切换单个时段的选中状态(选中/取消)。
|
|
130
|
-
* 内部自动处理连续时段的合并与拆分,订单是唯一真相源。
|
|
131
|
-
*
|
|
132
|
-
* slot.productId 指定当前操作针对的是该 resourceId 下的哪一个商品。
|
|
133
|
-
* 同一资源下不同 productId 之间互相隔离,不会相互合并。
|
|
134
|
-
*/
|
|
135
|
-
toggleSlot(slot: VenueSlotSelection): Promise<ScanOrderOrderProduct[]>;
|
|
136
|
-
/**
|
|
137
|
-
* 获取某资源当前选中的所有独立时段(从订单中解析)。
|
|
138
|
-
* 不传 productId 时返回该资源下所有商品的选中时段;传了则精确匹配。
|
|
139
|
-
*/
|
|
140
|
-
getSelectedSlotsForResource(resourceId: number | string, productId?: number): VenueSlotSelection[];
|
|
141
|
-
/** getSelectedSlotsForResource 的 (resourceId, productId) 精确版,内部使用。 */
|
|
142
|
-
private getSelectedSlotsForResourceProduct;
|
|
143
|
-
/**
|
|
144
|
-
* 判断某个时段是否已选中。
|
|
145
|
-
* 不传 productId 时:只要该资源下任一商品在 startTime 被选中即返回 true;传了则精确匹配。
|
|
146
|
-
*/
|
|
147
|
-
isSlotSelected(resourceId: number | string, startTime: string, productId?: number): boolean;
|
|
148
|
-
/**
|
|
149
|
-
* 判断指定 (resourceId, productId, startTime) 格子是否应因其它已选项而被禁用。
|
|
150
|
-
* 规则:
|
|
151
|
-
* 1) 同一 resourceId 下若已选了另一个 productId 的同 startTime → 禁用
|
|
152
|
-
* 2) 当前 resource 是组合资源:若其任一 child resource 在 startTime 被选中 → 禁用
|
|
153
|
-
* 3) 当前 resource 是某些组合资源的 child:若该组合资源在 startTime 被选中 → 禁用
|
|
154
|
-
* 4) 两个组合资源的 child 集合有交集,且对方在该 startTime 被选中 → 禁用
|
|
155
|
-
*/
|
|
156
|
-
isSlotDisabledBySelection(params: {
|
|
157
|
-
resourceId: number | string;
|
|
158
|
-
productId: number;
|
|
159
|
-
startTime: string;
|
|
160
|
-
}): boolean;
|
|
161
|
-
/**
|
|
162
|
-
* 获取所有已选时段(按资源分组)。每个 slot 上带 productId,便于 UI 做 per-product 判定。
|
|
163
|
-
*/
|
|
164
|
-
getAllSelectedSlots(): Map<number | string, VenueSlotSelection[]>;
|
|
165
|
-
/**
|
|
166
|
-
* 对指定 (resourceId, productId) 的订单商品进行 reconcile:
|
|
167
|
-
* 清除旧商品 → 合并连续时段 → 重新写入。
|
|
168
|
-
* 同一场地下不同商品互不干扰,各自单独 reconcile。
|
|
169
|
-
*/
|
|
170
|
-
private reconcileOrderForResourceProduct;
|
|
171
|
-
/** 给定一个父 rawResource,返回其 combined_resource.resource_ids 对应的子 rawResource 列表。 */
|
|
172
|
-
private getCombinedChildRawResources;
|
|
173
|
-
setSlotConfig(config: Partial<VenueBookingSlotConfig>): void;
|
|
174
|
-
getSlotConfig(): VenueBookingSlotConfig;
|
|
175
|
-
loadSchedules(): Promise<void>;
|
|
176
|
-
getScheduleListByIds(ids: number[]): ScheduleItem[];
|
|
177
|
-
getTempOrder(): import("./types").ScanOrderTempOrder | null;
|
|
178
|
-
updateTempOrderNote(note: string): string;
|
|
179
|
-
updateTempOrderContactsInfo(contactsInfo: any[]): any[];
|
|
180
|
-
private ensureTempOrder;
|
|
181
|
-
onCustomerLogin(params: {
|
|
182
|
-
customerId: number;
|
|
183
|
-
}): Promise<void>;
|
|
184
|
-
private recalculateOrderPricesFromSmartPricing;
|
|
185
|
-
/**
|
|
186
|
-
* DataVariant 重算价格后,同步刷新订单展示、Rules 与 Summary 共用的价格口径。
|
|
187
|
-
* Rules 会在本轮结束后根据当前客户的 discountList 重新写入实际折扣。
|
|
188
|
-
*/
|
|
189
|
-
private resetProductPriceForSmartPricing;
|
|
190
|
-
scanCode(code: string, customerId?: number): Promise<{
|
|
191
|
-
isAvailable: boolean;
|
|
192
|
-
discountList: import("../../modules/Discount").Discount[];
|
|
193
|
-
type: "server" | "clientCalc";
|
|
194
|
-
unavailableReason?: import("../../modules/Rules/types").UnavailableReason | undefined;
|
|
195
|
-
unavailableReasonKey?: string | null | undefined;
|
|
196
|
-
}>;
|
|
197
|
-
/** 获取当前折扣列表(包装 order.getDiscountList) */
|
|
198
|
-
getDiscountList(): import("../../modules/Discount").Discount[];
|
|
199
|
-
/** 勾选/取消勾选某张折扣券,重新计算折扣并持久化 */
|
|
200
|
-
setDiscountSelected(params: {
|
|
201
|
-
discountId: number;
|
|
202
|
-
isSelected: boolean;
|
|
203
|
-
}): Promise<import("../../modules/Discount").Discount[]>;
|
|
204
|
-
/**
|
|
205
|
-
* 统一 VenueBooking 折扣后的订单行价。
|
|
206
|
-
*
|
|
207
|
-
* Rules 的 `discount_list.amount` 是已经按适用规则计算出的每件优惠额;它是这里唯一
|
|
208
|
-
* 的折扣金额来源。使用智能定价写入的 source_product_price 减去该金额,再同步
|
|
209
|
-
* selling_price 与 Summary 使用的 main_product_selling_price,避免 UI 的购物车行价、
|
|
210
|
-
* 小计和提交订单各自读取到不同的价格字段。
|
|
211
|
-
*/
|
|
212
|
-
private normalizeDiscountedOrderPrices;
|
|
213
|
-
addNewOrder(): Promise<import("./types").ScanOrderTempOrder>;
|
|
214
|
-
getOrderProducts(): ScanOrderOrderProduct[];
|
|
215
|
-
getSummary(): Promise<import("./types").ScanOrderSummary>;
|
|
216
|
-
submitOrder<T = any>(): Promise<T>;
|
|
217
|
-
/**
|
|
218
|
-
* 0 元订单免费领取(非定金场景)
|
|
219
|
-
* 与 appointment getFreeProduct 同接口:POST /pay/order/free-pay/:id
|
|
220
|
-
*/
|
|
221
|
-
submitFreeOrder(id: string | number): Promise<any>;
|
|
222
|
-
addProductToOrder(product: Partial<ScanOrderOrderProduct> & ScanOrderOrderProductIdentity): Promise<ScanOrderOrderProduct[]>;
|
|
223
|
-
updateProductInOrder(params: UpdateProductInOrderParams): Promise<ScanOrderOrderProduct[]>;
|
|
224
|
-
removeProductFromOrder(identity: ScanOrderOrderProductIdentity): Promise<ScanOrderOrderProduct[]>;
|
|
225
|
-
getProductList(): Promise<ProductData[]>;
|
|
226
|
-
private loadOpenDataConfig;
|
|
227
|
-
private loadRuntimeConfigs;
|
|
228
|
-
private fetchItemRuleConfigsByModelIds;
|
|
229
|
-
private buildPrefillProductSourceMap;
|
|
230
|
-
private getItemRuleRuntimeConfig;
|
|
231
|
-
private ensureItemRuleConfigsLoaded;
|
|
232
|
-
private refreshItemRuleQuantityLimits;
|
|
233
|
-
private applyPrefillByItemRule;
|
|
234
|
-
applyItemRulePrefill(): Promise<void>;
|
|
235
|
-
private evaluateCartValidationByItemRule;
|
|
236
|
-
private validateBeforeSubmitByItemRule;
|
|
237
|
-
private refreshCartValidationPassed;
|
|
238
|
-
setItemRuleRuntimeConfig(config?: VenueBookingItemRuleRuntimeConfig): Promise<void>;
|
|
239
|
-
getOtherParams(): Record<string, any>;
|
|
240
|
-
private static readonly UI_STATE_KEY_PREFIX;
|
|
241
|
-
private getUIStateBucketKey;
|
|
242
|
-
private readUIStateBucket;
|
|
243
|
-
private writeUIStateBucket;
|
|
244
|
-
setUIState(key: string, value: any): void;
|
|
245
|
-
getUIState<T = any>(key: string): T | undefined;
|
|
246
|
-
deleteUIState(key: string): void;
|
|
247
|
-
setBookingHolder(bookingUid: string, holder: any): void;
|
|
248
|
-
checkOpenDataAvailability(): Promise<OpenDataAvailabilityResult>;
|
|
249
|
-
setOtherParams(params: Record<string, any>, { cover }?: {
|
|
250
|
-
cover?: boolean;
|
|
251
|
-
}): Promise<void>;
|
|
252
|
-
}
|