@pisell/pisellos 2.2.292 → 2.2.294
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/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 +19 -4
- 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 +136 -41
- 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 +130 -76
- package/dist/solution/UnifiedBookingSales/index.js +3882 -966
- 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/model/strategy/adapter/promotion/index.js +46 -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 +19 -4
- 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 +126 -33
- 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 +130 -76
- package/lib/solution/UnifiedBookingSales/index.js +2597 -427
- 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
|
@@ -1,91 +1,189 @@
|
|
|
1
|
-
import type { ResourcePlannerModule } from '../../modules';
|
|
2
1
|
import type { OpenDataConfig } from '../../modules/OpenData';
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
2
|
+
import type { ProductListLoadProductsParams, ProductListStoreQueryParams } from '../../modules/ProductList';
|
|
3
|
+
import type { ProductData } from '../../modules/Product/types';
|
|
5
4
|
import type { LoadScheduleAvailableDateParams } from '../../modules/Schedule/types';
|
|
5
|
+
import type { AvailabilityDateRange, AvailabilityErrorCode, AvailabilityId, AvailabilityOccupancy, AvailabilityProduct, AvailabilityProjection, AvailabilityQuery, AvailabilityRequirementSelection, AvailabilityResource, AvailabilitySelectionValidationResult, DateAvailabilityQueryResult, GetProductTimeRangesRequest, ProductAvailabilityQueryResult, ProductTimeRange, ProductTimeRangeGroup, ResourceAvailabilityGroup, ResourceAvailabilityRangeGroup, TimeAvailabilityGroup, TimeAvailabilityItem } from '../../modules/ResourcePlanner';
|
|
6
6
|
import type { BookingTicketState } from '../BookingTicket/types';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
7
|
+
import type { AllergyRequirement } from '../../model/strategy/adapter/itemRule';
|
|
8
|
+
import type { SalesNoteDraftInput } from '../../modules/Order/types';
|
|
9
|
+
export type { ProductListStoreQueryParams } from '../../modules/ProductList';
|
|
10
|
+
export type { AvailabilityAbsoluteRange, AvailabilityAssignment, AvailabilityCell, AvailabilityDateRange, AvailabilityDisplayRange, AvailabilityErrorCode, AvailabilityId, AvailabilityMode, AvailabilityOccupancy, AvailabilityProduct, AvailabilityProductKind, AvailabilityProjection, AvailabilityProjectionInput, AvailabilityProjectionMeta, AvailabilityQuery, AvailabilityQueryResult, AvailabilityRequirementGroup, AvailabilityRequirementGroupResult, AvailabilityRequirementSelection, AvailabilityResource, AvailabilityResourceOption, AvailabilityResourceType, AvailabilityResourceWindow, AvailabilityScheduleMode, AvailabilityScheduleRef, AvailabilityScheduleRule, AvailabilitySelectionValidationParams, AvailabilitySelectionValidationResult, AvailabilitySessionRange, AvailabilityStatus, DateAvailabilityGroup, DateAvailabilityItem, DateAvailabilityQuery, DateAvailabilityQueryResult, GetProductTimeRangesRequest, ProductAvailabilityGroup, ProductAvailabilityItem, ProductAvailabilityQuery, ProductAvailabilityQueryResult, ProductTimeRange, ProductTimeRangeGroup, QueryAvailabilityBaseRequest, ResourceAvailabilityGroup, ResourceAvailabilityQuery, ResourceAvailabilityQueryResult, ResourceAvailabilityRangeGroup, TimeAvailabilityGroup, TimeAvailabilityItem, TimeAvailabilityQuery, TimeAvailabilityQueryResult, } from '../../modules/ResourcePlanner';
|
|
11
11
|
export interface UnifiedBookingSalesState extends BookingTicketState {
|
|
12
|
-
|
|
12
|
+
}
|
|
13
|
+
export interface UnifiedBookingSalesPolicy {
|
|
14
|
+
id?: AvailabilityId;
|
|
15
|
+
title?: unknown;
|
|
16
|
+
content?: string;
|
|
17
|
+
[key: string]: unknown;
|
|
18
|
+
}
|
|
19
|
+
export interface UnifiedBookingSalesPolicyResponse {
|
|
20
|
+
data?: UnifiedBookingSalesPolicy;
|
|
21
|
+
[key: string]: unknown;
|
|
22
|
+
}
|
|
23
|
+
export declare enum UnifiedBookingSalesHooks {
|
|
24
|
+
onAvailabilityProjectionPrepared = "unifiedBookingSales:onAvailabilityProjectionPrepared",
|
|
25
|
+
onAvailabilitySelectionCommitted = "unifiedBookingSales:onAvailabilitySelectionCommitted",
|
|
26
|
+
onAvailabilityProjectionDiagnostic = "unifiedBookingSales:onAvailabilityProjectionDiagnostic"
|
|
13
27
|
}
|
|
14
28
|
export interface UnifiedBookingSalesOtherParams extends Record<string, any> {
|
|
15
|
-
/**
|
|
16
|
-
* Persist the active order workspace in sessionStorage, partitioned by cacheId.
|
|
17
|
-
* Disabled by default and ignored when cacheId is missing.
|
|
18
|
-
*/
|
|
19
29
|
enableSessionStoragePersist?: boolean;
|
|
20
30
|
}
|
|
21
|
-
|
|
31
|
+
export type UnifiedBookingSalesAllergyRequirement = AllergyRequirement;
|
|
32
|
+
export interface UnifiedBookingSalesResolveProductAllergyRequirementParams {
|
|
33
|
+
productId: number | string;
|
|
34
|
+
productVariantId?: number | string;
|
|
35
|
+
channel?: string;
|
|
36
|
+
}
|
|
22
37
|
export interface UnifiedBookingSalesLoadOpenDataParams {
|
|
23
38
|
businessCode: string;
|
|
24
39
|
channel: string;
|
|
25
|
-
/** Bypasses the target-scoped in-memory cache. */
|
|
26
40
|
force?: boolean;
|
|
27
41
|
}
|
|
28
|
-
export interface UnifiedBookingSalesLoadPlannerContextParams extends ResourcePlannerQuery {
|
|
29
|
-
/** ProductList request options used only when products are not supplied as raw/context data. */
|
|
30
|
-
productLoadParams?: ProductListLoadProductsParams;
|
|
31
|
-
/** Escape hatch for tests or callers that already own raw ProductList records. */
|
|
32
|
-
rawProducts?: Record<string, any>[];
|
|
33
|
-
/** Escape hatch for tests or callers that already own raw resource records. */
|
|
34
|
-
rawResources?: Record<string, any>[];
|
|
35
|
-
/** Fully normalized Planner context; takes precedence over API loading for supplied fields. */
|
|
36
|
-
context?: ResourcePlannerContextInput;
|
|
37
|
-
/** Enables the v2 resource API + schedule materialization path. */
|
|
38
|
-
useResourceDateApi?: boolean;
|
|
39
|
-
}
|
|
40
|
-
export interface UnifiedBookingSalesCommitPlannerSelectionParams {
|
|
41
|
-
/** Optional selection patch applied before validation and order mutation. */
|
|
42
|
-
selection?: ResourcePlannerSelectionPatch;
|
|
43
|
-
/** Directly supplies selected resource/time facts, usually from resolveAssignableSlots(). */
|
|
44
|
-
assignments?: ResourcePlannerAssignment[];
|
|
45
|
-
/** Defaults to false. True performs the real BaseSales / OrderModule submit after tempOrder is written. */
|
|
46
|
-
submitAfterCommit?: boolean;
|
|
47
|
-
}
|
|
48
42
|
export interface UnifiedBookingSalesLoadProductsByScheduleDateParams extends Omit<ProductListLoadProductsParams, 'schedule_date' | 'product_ids'> {
|
|
49
|
-
/** The chosen calendar date, used for both availability lookup and ProductList schedule_date. */
|
|
50
43
|
date: string;
|
|
51
|
-
/** Optional caller-side filter applied after the availability result produces its product pool. */
|
|
52
44
|
product_ids?: number[];
|
|
53
|
-
/** Required by the availability API; this is not the low-code page id. */
|
|
54
45
|
custom_page_id?: number;
|
|
55
|
-
/** Availability API channel, commonly pc. ProductList keeps its own sales application channel. */
|
|
56
46
|
channel?: string;
|
|
57
47
|
}
|
|
58
|
-
export
|
|
59
|
-
|
|
48
|
+
export type UnifiedBookingSalesCatalogScope = {
|
|
49
|
+
type: 'schedule';
|
|
50
|
+
customPageId: number;
|
|
51
|
+
channel: string;
|
|
52
|
+
} | {
|
|
53
|
+
type: 'productList';
|
|
54
|
+
params: ProductListLoadProductsParams;
|
|
55
|
+
};
|
|
56
|
+
export interface UnifiedBookingSalesPrepareAvailabilityProjectionParams {
|
|
57
|
+
productIds?: number[];
|
|
58
|
+
resourceIds?: AvailabilityId[];
|
|
59
|
+
dateRange?: Partial<AvailabilityDateRange>;
|
|
60
|
+
catalogScope?: UnifiedBookingSalesCatalogScope;
|
|
61
|
+
rawProducts?: Record<string, any>[];
|
|
62
|
+
rawResources?: Record<string, any>[];
|
|
63
|
+
rawOccupancies?: AvailabilityOccupancy[];
|
|
64
|
+
editingProductLineUids?: string[];
|
|
65
|
+
timezone?: string;
|
|
66
|
+
slotStepMinutes?: number;
|
|
67
|
+
businessHours?: {
|
|
68
|
+
startTime: string;
|
|
69
|
+
endTime: string;
|
|
70
|
+
};
|
|
71
|
+
mode?: 'appointment' | 'scan_order' | 'venue_grid';
|
|
72
|
+
}
|
|
73
|
+
export interface AvailabilityContextRef {
|
|
74
|
+
contextId: string;
|
|
75
|
+
}
|
|
76
|
+
export interface ContextualProductTimeRange extends ProductTimeRange {
|
|
77
|
+
availabilityContextId: string;
|
|
78
|
+
availabilityContextVersion: number;
|
|
79
|
+
}
|
|
80
|
+
export interface ContextualProductTimeRangeGroup extends Omit<ProductTimeRangeGroup, 'ranges'> {
|
|
81
|
+
ranges: ContextualProductTimeRange[];
|
|
82
|
+
}
|
|
83
|
+
export type ContextualAvailabilityQuery = Omit<Extract<AvailabilityQuery, {
|
|
84
|
+
target: 'product';
|
|
85
|
+
}>, never> | Omit<Extract<AvailabilityQuery, {
|
|
86
|
+
target: 'date';
|
|
87
|
+
}>, never> | (Omit<Extract<AvailabilityQuery, {
|
|
88
|
+
target: 'time';
|
|
89
|
+
}>, 'candidates'> & {
|
|
90
|
+
candidates: ContextualProductTimeRange[];
|
|
91
|
+
}) | (Omit<Extract<AvailabilityQuery, {
|
|
92
|
+
target: 'resource';
|
|
93
|
+
}>, 'selectedRanges'> & {
|
|
94
|
+
selectedRanges: ContextualProductTimeRange[];
|
|
95
|
+
});
|
|
96
|
+
export type ContextualTimeAvailabilityItem = Omit<TimeAvailabilityItem, keyof ProductTimeRange> & ContextualProductTimeRange;
|
|
97
|
+
export interface ContextualTimeAvailabilityGroup extends Omit<TimeAvailabilityGroup, 'times'> {
|
|
98
|
+
times: ContextualTimeAvailabilityItem[];
|
|
99
|
+
}
|
|
100
|
+
export interface ContextualResourceAvailabilityRangeGroup extends Omit<ResourceAvailabilityRangeGroup, 'range'> {
|
|
101
|
+
range: ContextualProductTimeRange;
|
|
102
|
+
}
|
|
103
|
+
export interface ContextualResourceAvailabilityGroup extends Omit<ResourceAvailabilityGroup, 'ranges'> {
|
|
104
|
+
ranges: ContextualResourceAvailabilityRangeGroup[];
|
|
105
|
+
}
|
|
106
|
+
type ContextualAvailabilityQueryResultMeta = {
|
|
107
|
+
contextId: string;
|
|
108
|
+
contextVersion: number;
|
|
109
|
+
refreshed: boolean;
|
|
110
|
+
};
|
|
111
|
+
export type ContextualAvailabilityQueryResult = (ProductAvailabilityQueryResult & ContextualAvailabilityQueryResultMeta) | (DateAvailabilityQueryResult & ContextualAvailabilityQueryResultMeta) | ({
|
|
112
|
+
target: 'time';
|
|
113
|
+
evaluatedAt: string;
|
|
114
|
+
snapshotId: string;
|
|
115
|
+
data: ContextualTimeAvailabilityGroup[];
|
|
116
|
+
} & ContextualAvailabilityQueryResultMeta) | ({
|
|
117
|
+
target: 'resource';
|
|
118
|
+
evaluatedAt: string;
|
|
119
|
+
snapshotId: string;
|
|
120
|
+
data: ContextualResourceAvailabilityGroup[];
|
|
121
|
+
} & ContextualAvailabilityQueryResultMeta);
|
|
122
|
+
export type UnifiedBookingSalesAvailabilityCandidate = ContextualProductTimeRange;
|
|
123
|
+
export type UnifiedBookingSalesProductTimeRangeGroup = ContextualProductTimeRangeGroup;
|
|
124
|
+
export type UnifiedBookingSalesAvailabilityQueryResult = ContextualAvailabilityQueryResult;
|
|
125
|
+
export interface UnifiedBookingSalesAvailabilityPreparedPayload {
|
|
126
|
+
context: AvailabilityContextRef;
|
|
127
|
+
contextVersion: number;
|
|
128
|
+
projection: AvailabilityProjection;
|
|
129
|
+
refreshed: boolean;
|
|
130
|
+
reason?: string;
|
|
131
|
+
previousOrderRevision?: AvailabilityId;
|
|
132
|
+
}
|
|
133
|
+
export interface UnifiedBookingSalesAvailabilityDiagnosticPayload {
|
|
134
|
+
contextId: string | null;
|
|
135
|
+
contextVersion: number | null;
|
|
136
|
+
reason: string;
|
|
137
|
+
projection: AvailabilityProjection | null;
|
|
138
|
+
action: 'prepare' | 'refresh' | 'release' | 'destroy' | 'set_other_params_reset' | 'commit_lock_wait' | 'commit_lock_acquired' | 'commit_lock_released';
|
|
139
|
+
snapshotId?: string;
|
|
140
|
+
orderRevision?: AvailabilityId;
|
|
141
|
+
previousOrderRevision?: AvailabilityId;
|
|
142
|
+
registrySize: number;
|
|
143
|
+
projectionPoolSize: number;
|
|
144
|
+
}
|
|
145
|
+
export interface UnifiedBookingSalesStageRetailProductsParams {
|
|
60
146
|
productIds: Array<number | string>;
|
|
61
147
|
productLoadParams?: ProductListLoadProductsParams;
|
|
62
148
|
rawProducts?: Record<string, any>[];
|
|
63
149
|
}
|
|
64
|
-
/** Ordinary retail product staging. No resource, time, or booking facts are required. */
|
|
65
|
-
export type UnifiedBookingSalesStageRetailProductsParams = UnifiedBookingSalesStagePlannerProductsParams;
|
|
66
|
-
/** Adds one ordinary retail product without replacing other retail lines already in the cart. */
|
|
67
150
|
export interface UnifiedBookingSalesAddRetailProductParams {
|
|
68
|
-
/** Prefer a supplied catalog record when the UI has already loaded it. */
|
|
69
151
|
product?: Record<string, any>;
|
|
70
|
-
/** Used to resolve a product from the current catalog or load it on demand. */
|
|
71
152
|
productId?: number | string;
|
|
72
|
-
/** Defaults to one. */
|
|
73
153
|
quantity?: number;
|
|
74
|
-
/** Only used when the product is not already present in the solution catalog. */
|
|
75
154
|
productLoadParams?: ProductListLoadProductsParams;
|
|
76
155
|
}
|
|
77
|
-
export interface
|
|
156
|
+
export interface ContextualCommitAvailabilitySelectionParams {
|
|
157
|
+
mode: 'add' | 'edit';
|
|
158
|
+
productLineUid?: string;
|
|
159
|
+
orderProduct: Record<string, any>;
|
|
160
|
+
candidate: ContextualProductTimeRange;
|
|
161
|
+
requirementSelections: AvailabilityRequirementSelection[];
|
|
162
|
+
partySize: number;
|
|
163
|
+
bookingCount?: number;
|
|
164
|
+
/** 新增商品行时与商品、预约在同一次 Order mutation 内写入的 Sales Notes。 */
|
|
165
|
+
salesNotes?: SalesNoteDraftInput[];
|
|
166
|
+
/** 编辑预约时,允许本次显式报价覆盖已落库订单行的历史价格。 */
|
|
167
|
+
allowBookingReprice?: boolean;
|
|
168
|
+
/** 编辑预约重报价后,允许订单模块重新应用已选编辑态折扣。 */
|
|
169
|
+
allowBookingDiscountReapply?: boolean;
|
|
170
|
+
}
|
|
171
|
+
export type UnifiedBookingSalesCommitAvailabilitySelectionParams = ContextualCommitAvailabilitySelectionParams;
|
|
172
|
+
export interface UnifiedBookingSalesCommitAvailabilitySelectionResult {
|
|
173
|
+
contextId: string;
|
|
174
|
+
contextVersion: number;
|
|
78
175
|
tempOrder: Record<string, any> | null;
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
176
|
+
validation: AvailabilitySelectionValidationResult;
|
|
177
|
+
candidate: ContextualProductTimeRange;
|
|
178
|
+
productLineUid?: string;
|
|
179
|
+
bookingUid?: string;
|
|
180
|
+
productLineUids?: string[];
|
|
181
|
+
bookingUids?: string[];
|
|
82
182
|
}
|
|
183
|
+
export type UnifiedBookingSalesAvailabilityErrorCode = AvailabilityErrorCode;
|
|
83
184
|
export interface UnifiedBookingSalesApplyPlannerDiscountsParams {
|
|
84
|
-
/** Customer whose cards/coupons should be loaded. Defaults to tempOrder.customer_id. */
|
|
85
185
|
customerId?: number | string;
|
|
86
|
-
/** Optional explicit card/coupon id. When provided, Rules applies this card instead of auto-picking another card. */
|
|
87
186
|
preferredDiscountId?: number | string;
|
|
88
|
-
/** Defaults to true: after loading eligible cards, let Rules choose the best valid combination. */
|
|
89
187
|
applyBestDiscount?: boolean;
|
|
90
188
|
}
|
|
91
189
|
export interface UnifiedBookingSalesDiscountItem {
|
|
@@ -110,7 +208,6 @@ export interface UnifiedBookingSalesDiscountResult {
|
|
|
110
208
|
status: 'applied' | 'loaded' | 'no_customer';
|
|
111
209
|
customerId: number | null;
|
|
112
210
|
preferredDiscountFound?: boolean;
|
|
113
|
-
/** True only when the requested card is both selected and written into a planner product line. */
|
|
114
211
|
preferredDiscountApplied?: boolean;
|
|
115
212
|
availableDiscounts: UnifiedBookingSalesDiscountItem[];
|
|
116
213
|
selectedDiscounts: UnifiedBookingSalesDiscountItem[];
|
|
@@ -119,32 +216,19 @@ export interface UnifiedBookingSalesDiscountResult {
|
|
|
119
216
|
summaryAfter?: unknown;
|
|
120
217
|
}
|
|
121
218
|
export interface UnifiedBookingSalesApi {
|
|
122
|
-
/** Loads board OpenData for a concrete business + channel target. */
|
|
123
219
|
loadOpenData: (params: UnifiedBookingSalesLoadOpenDataParams) => Promise<OpenDataConfig>;
|
|
124
|
-
|
|
125
|
-
getOpenData: () => OpenDataConfig | null;
|
|
126
|
-
/** Date-first calendar availability backed by ScheduleModule. */
|
|
220
|
+
getOpenData: () => Promise<OpenDataConfig | null>;
|
|
127
221
|
loadScheduleAvailableDate: (params: LoadScheduleAvailableDateParams) => Promise<unknown>;
|
|
128
|
-
/** Date-first product pool derived from schedule date ids and globally sellable products. */
|
|
129
222
|
loadProductsByScheduleDate: (params: UnifiedBookingSalesLoadProductsByScheduleDateParams) => Promise<unknown[]>;
|
|
130
|
-
|
|
131
|
-
stagePlannerProducts: (params: UnifiedBookingSalesStagePlannerProductsParams) => Promise<Record<string, any> | null>;
|
|
132
|
-
/** Adds ordinary product lines only. It never creates bookings or invokes ResourcePlanner. */
|
|
223
|
+
queryProducts: (params?: ProductListStoreQueryParams) => Promise<ProductData[]>;
|
|
133
224
|
stageRetailProducts: (params: UnifiedBookingSalesStageRetailProductsParams) => Promise<Record<string, any> | null>;
|
|
134
|
-
/** Adds one ordinary retail line while preserving all existing cart lines. */
|
|
135
225
|
addRetailProduct: (params: UnifiedBookingSalesAddRetailProductParams) => Promise<Record<string, any>[]>;
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
resolveAssignableSlots: (query?: ResourcePlannerQuery) => ResourcePlannerAssignableSlotResult;
|
|
142
|
-
setPlannerSelection: (patch: ResourcePlannerSelectionPatch) => ResourcePlannerSnapshot;
|
|
143
|
-
autoAssignPlanner: (query?: ResourcePlannerQuery) => Promise<ResourcePlannerSnapshot>;
|
|
144
|
-
validatePlannerSelection: () => ResourcePlannerValidationResult;
|
|
145
|
-
/** Validates, writes to tempOrder, and only optionally makes a real submit request. */
|
|
146
|
-
commitPlannerSelection: (params?: UnifiedBookingSalesCommitPlannerSelectionParams) => Promise<UnifiedBookingSalesCommitResult>;
|
|
147
|
-
/** Loads the current customer's cards/coupons, optionally applies the best one, and reports line applications. */
|
|
226
|
+
prepareAvailabilityProjection: (params: UnifiedBookingSalesPrepareAvailabilityProjectionParams) => Promise<AvailabilityContextRef>;
|
|
227
|
+
getProductTimeRanges: (contextId: string, request?: GetProductTimeRangesRequest) => Promise<ContextualProductTimeRangeGroup[]>;
|
|
228
|
+
queryBookingAvailability: (contextId: string, request: ContextualAvailabilityQuery) => Promise<ContextualAvailabilityQueryResult>;
|
|
229
|
+
commitAvailabilitySelection: (contextId: string, params: ContextualCommitAvailabilitySelectionParams) => Promise<UnifiedBookingSalesCommitAvailabilitySelectionResult>;
|
|
230
|
+
releaseAvailabilityContext: (contextId: string) => void;
|
|
148
231
|
applyPlannerDiscounts: (params?: UnifiedBookingSalesApplyPlannerDiscountsParams) => Promise<UnifiedBookingSalesDiscountResult>;
|
|
149
|
-
getPlannerSnapshot: () => ResourcePlannerSnapshot;
|
|
150
232
|
}
|
|
233
|
+
export type UnifiedBookingSalesNormalizedProduct = AvailabilityProduct;
|
|
234
|
+
export type UnifiedBookingSalesNormalizedResource = AvailabilityResource;
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
export var UnifiedBookingSalesHooks = /*#__PURE__*/function (UnifiedBookingSalesHooks) {
|
|
2
|
-
UnifiedBookingSalesHooks["
|
|
3
|
-
UnifiedBookingSalesHooks["
|
|
2
|
+
UnifiedBookingSalesHooks["onAvailabilityProjectionPrepared"] = "unifiedBookingSales:onAvailabilityProjectionPrepared";
|
|
3
|
+
UnifiedBookingSalesHooks["onAvailabilitySelectionCommitted"] = "unifiedBookingSales:onAvailabilitySelectionCommitted";
|
|
4
|
+
UnifiedBookingSalesHooks["onAvailabilityProjectionDiagnostic"] = "unifiedBookingSales:onAvailabilityProjectionDiagnostic";
|
|
4
5
|
return UnifiedBookingSalesHooks;
|
|
5
|
-
}({});
|
|
6
|
-
|
|
7
|
-
/** Explicit OpenData target used by page-level UnifiedBookingSales skins. */
|
|
8
|
-
|
|
9
|
-
/** Ordinary retail product staging. No resource, time, or booking facts are required. */
|
|
10
|
-
|
|
11
|
-
/** Adds one ordinary retail product without replacing other retail lines already in the cart. */
|
|
6
|
+
}({});
|
|
@@ -15,6 +15,7 @@ interface VenueBookingItemRuleRuntimeConfig {
|
|
|
15
15
|
pax?: Partial<PaxInfo>;
|
|
16
16
|
historicalItems?: CartItemSummary[];
|
|
17
17
|
serviceType?: string;
|
|
18
|
+
channel?: string;
|
|
18
19
|
submissionIndex?: number;
|
|
19
20
|
custom?: Record<string, any>;
|
|
20
21
|
}
|
|
@@ -90,6 +91,8 @@ export declare class VenueBookingImpl extends BaseSalesImpl implements Module {
|
|
|
90
91
|
loadAddonProducts(): Promise<ProductData[]>;
|
|
91
92
|
getVenueProducts(): ProductData[];
|
|
92
93
|
getAddonProductsList(): ProductData[];
|
|
94
|
+
private ensureQuotationsLoaded;
|
|
95
|
+
private preloadQuotations;
|
|
93
96
|
loadQuotations(params?: {
|
|
94
97
|
channel?: string;
|
|
95
98
|
}): Promise<void>;
|