@pisell/pisellos 2.3.44 → 2.3.45
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/promotion/index.js +0 -9
- package/dist/modules/Discount/index.d.ts +0 -1
- package/dist/modules/Discount/index.js +11 -40
- package/dist/modules/Discount/types.d.ts +0 -1
- package/dist/modules/OpenData/index.js +2 -2
- package/dist/modules/Order/index.d.ts +2 -4
- package/dist/modules/Order/index.js +25 -54
- package/dist/modules/Order/types.d.ts +0 -9
- package/dist/modules/Order/utils.d.ts +0 -10
- package/dist/modules/Order/utils.js +3 -35
- package/dist/modules/Product/types.d.ts +0 -1
- package/dist/modules/ProductList/index.js +14 -33
- package/dist/modules/Quotation/index.d.ts +1 -1
- package/dist/modules/Quotation/index.js +2 -2
- package/dist/modules/Rules/index.js +13 -47
- package/dist/modules/SalesSummary/index.js +13 -12
- package/dist/modules/ScanOrderLogger/index.d.ts +0 -2
- package/dist/modules/ScanOrderLogger/index.js +2 -15
- package/dist/modules/ScanOrderLogger/providers/feishu.js +27 -45
- package/dist/modules/ScanOrderLogger/types.d.ts +0 -1
- package/dist/modules/Schedule/index.d.ts +1 -3
- package/dist/modules/Schedule/index.js +16 -21
- package/dist/modules/Summary/utils.js +13 -38
- package/dist/modules/index.d.ts +0 -2
- package/dist/modules/index.js +1 -3
- package/dist/plugins/window.d.ts +0 -1
- package/dist/server/index.d.ts +0 -14
- package/dist/server/index.js +657 -772
- package/dist/solution/BaseSales/index.d.ts +0 -7
- package/dist/solution/BaseSales/index.js +42 -64
- package/dist/solution/BookingByStep/index.d.ts +1 -16
- package/dist/solution/BookingByStep/index.js +215 -294
- package/dist/solution/BookingByStep/types.d.ts +1 -2
- package/dist/solution/BookingByStep/types.js +1 -3
- package/dist/solution/BookingByStep/utils/capacity.js +1 -17
- package/dist/solution/BookingByStep/utils/timeslots.d.ts +1 -3
- package/dist/solution/BookingByStep/utils/timeslots.js +12 -19
- package/dist/solution/BookingTicket/index.d.ts +2 -14
- package/dist/solution/BookingTicket/index.js +2 -2
- package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +1 -3
- package/dist/solution/BookingTicket/utils/scan/handleScan.js +2 -10
- package/dist/solution/ScanOrder/index.d.ts +14 -26
- package/dist/solution/ScanOrder/index.js +739 -1142
- package/dist/solution/ScanOrder/types.d.ts +1 -21
- package/dist/solution/ScanOrder/utils.d.ts +0 -8
- package/dist/solution/ScanOrder/utils.js +25 -66
- package/dist/solution/ShopDiscount/index.d.ts +0 -1
- package/dist/solution/ShopDiscount/index.js +87 -125
- package/dist/solution/VenueBooking/index.d.ts +11 -39
- package/dist/solution/VenueBooking/index.js +841 -1167
- package/dist/solution/VenueBooking/types.d.ts +0 -3
- package/dist/solution/VenueBooking/utils/resource.js +0 -1
- package/dist/solution/VenueBooking/utils/slotMerge.d.ts +4 -4
- package/dist/solution/VenueBooking/utils/slotMerge.js +5 -10
- package/dist/solution/index.d.ts +0 -1
- package/dist/solution/index.js +1 -2
- package/dist/types/index.d.ts +0 -1
- package/lib/modules/Discount/index.d.ts +0 -1
- package/lib/modules/Discount/index.js +0 -9
- package/lib/modules/Discount/types.d.ts +0 -1
- package/lib/modules/OpenData/index.js +1 -1
- package/lib/modules/Order/index.d.ts +2 -4
- package/lib/modules/Order/index.js +10 -26
- package/lib/modules/Order/types.d.ts +0 -9
- package/lib/modules/Order/utils.d.ts +0 -10
- package/lib/modules/Order/utils.js +5 -36
- package/lib/modules/Product/types.d.ts +0 -1
- package/lib/modules/ProductList/index.js +31 -40
- package/lib/modules/Quotation/index.d.ts +1 -1
- package/lib/modules/Quotation/index.js +2 -2
- package/lib/modules/Rules/index.js +16 -33
- package/lib/modules/SalesSummary/index.js +7 -6
- package/lib/modules/ScanOrderLogger/index.d.ts +0 -2
- package/lib/modules/ScanOrderLogger/index.js +1 -13
- package/lib/modules/ScanOrderLogger/providers/feishu.js +6 -15
- package/lib/modules/ScanOrderLogger/types.d.ts +0 -1
- package/lib/modules/Schedule/index.d.ts +1 -3
- package/lib/modules/Schedule/index.js +8 -10
- package/lib/modules/Summary/utils.js +1 -21
- package/lib/modules/index.d.ts +0 -2
- package/lib/modules/index.js +1 -5
- package/lib/plugins/window.d.ts +0 -1
- package/lib/server/index.d.ts +0 -14
- package/lib/server/index.js +5 -65
- package/lib/solution/BaseSales/index.d.ts +0 -7
- package/lib/solution/BaseSales/index.js +8 -24
- package/lib/solution/BookingByStep/index.d.ts +1 -16
- package/lib/solution/BookingByStep/index.js +18 -60
- package/lib/solution/BookingByStep/types.d.ts +1 -2
- package/lib/solution/BookingByStep/types.js +0 -5
- package/lib/solution/BookingByStep/utils/capacity.js +1 -20
- package/lib/solution/BookingByStep/utils/timeslots.d.ts +1 -3
- package/lib/solution/BookingByStep/utils/timeslots.js +11 -19
- package/lib/solution/BookingTicket/index.d.ts +2 -14
- package/lib/solution/BookingTicket/index.js +2 -10
- package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +1 -3
- package/lib/solution/BookingTicket/utils/scan/handleScan.js +2 -2
- package/lib/solution/ScanOrder/index.d.ts +14 -26
- package/lib/solution/ScanOrder/index.js +182 -449
- package/lib/solution/ScanOrder/types.d.ts +1 -21
- package/lib/solution/ScanOrder/utils.d.ts +0 -8
- package/lib/solution/ScanOrder/utils.js +0 -31
- package/lib/solution/ShopDiscount/index.d.ts +0 -1
- package/lib/solution/ShopDiscount/index.js +0 -14
- package/lib/solution/VenueBooking/index.d.ts +11 -39
- package/lib/solution/VenueBooking/index.js +110 -322
- package/lib/solution/VenueBooking/types.d.ts +0 -3
- package/lib/solution/VenueBooking/utils/resource.js +0 -1
- package/lib/solution/VenueBooking/utils/slotMerge.d.ts +4 -4
- package/lib/solution/VenueBooking/utils/slotMerge.js +4 -6
- package/lib/solution/index.d.ts +0 -1
- package/lib/solution/index.js +1 -3
- package/lib/types/index.d.ts +0 -1
- package/package.json +1 -1
- package/dist/modules/Holder/index.d.ts +0 -48
- package/dist/modules/Holder/index.js +0 -640
- package/dist/modules/Holder/types.d.ts +0 -123
- package/dist/modules/Holder/types.js +0 -1
- package/dist/modules/Holder/utils.d.ts +0 -13
- package/dist/modules/Holder/utils.js +0 -34
- package/dist/modules/ResourcePlanner/index.d.ts +0 -24
- package/dist/modules/ResourcePlanner/index.js +0 -181
- package/dist/modules/ResourcePlanner/planner.d.ts +0 -14
- package/dist/modules/ResourcePlanner/planner.js +0 -1069
- package/dist/modules/ResourcePlanner/types.d.ts +0 -227
- package/dist/modules/ResourcePlanner/types.js +0 -1
- package/dist/solution/UnifiedBookingSales/index.d.ts +0 -183
- package/dist/solution/UnifiedBookingSales/index.js +0 -1891
- package/dist/solution/UnifiedBookingSales/types.d.ts +0 -143
- package/dist/solution/UnifiedBookingSales/types.js +0 -11
- package/lib/modules/Holder/index.d.ts +0 -48
- package/lib/modules/Holder/index.js +0 -402
- package/lib/modules/Holder/types.d.ts +0 -123
- package/lib/modules/Holder/types.js +0 -17
- package/lib/modules/Holder/utils.d.ts +0 -13
- package/lib/modules/Holder/utils.js +0 -71
- package/lib/modules/ResourcePlanner/index.d.ts +0 -24
- package/lib/modules/ResourcePlanner/index.js +0 -148
- package/lib/modules/ResourcePlanner/planner.d.ts +0 -14
- package/lib/modules/ResourcePlanner/planner.js +0 -933
- package/lib/modules/ResourcePlanner/types.d.ts +0 -227
- package/lib/modules/ResourcePlanner/types.js +0 -17
- package/lib/solution/UnifiedBookingSales/index.d.ts +0 -183
- package/lib/solution/UnifiedBookingSales/index.js +0 -1084
- package/lib/solution/UnifiedBookingSales/types.d.ts +0 -143
- package/lib/solution/UnifiedBookingSales/types.js +0 -33
|
@@ -1,227 +0,0 @@
|
|
|
1
|
-
export type ResourcePlannerMode = 'appointment' | 'scan_order' | 'venue_grid';
|
|
2
|
-
export type ResourcePlannerProductKind = 'normal' | 'duration' | 'session' | 'venue_slot';
|
|
3
|
-
export type ResourcePlannerResourceType = 'single' | 'multiple' | 'capacity';
|
|
4
|
-
export type ResourcePlannerStatus = 'available' | 'limited' | 'full' | 'conflict' | 'unavailable' | 'past';
|
|
5
|
-
export interface ResourcePlannerTimeRange {
|
|
6
|
-
start_at: string;
|
|
7
|
-
end_at: string;
|
|
8
|
-
}
|
|
9
|
-
export interface ResourcePlannerEvent extends ResourcePlannerTimeRange {
|
|
10
|
-
resourceId?: number | string;
|
|
11
|
-
resource_id?: number | string;
|
|
12
|
-
pax?: number;
|
|
13
|
-
product_uid?: string;
|
|
14
|
-
source?: 'remote' | 'cart' | 'selection';
|
|
15
|
-
[key: string]: any;
|
|
16
|
-
}
|
|
17
|
-
export interface ResourcePlannerResourceRequirement {
|
|
18
|
-
formId?: number | string;
|
|
19
|
-
resourceIds?: Array<number | string>;
|
|
20
|
-
resourceType?: ResourcePlannerResourceType;
|
|
21
|
-
capacityRequired?: number;
|
|
22
|
-
required?: boolean;
|
|
23
|
-
}
|
|
24
|
-
export interface ResourcePlannerProduct {
|
|
25
|
-
id: number | string;
|
|
26
|
-
title?: string;
|
|
27
|
-
kind: ResourcePlannerProductKind;
|
|
28
|
-
durationMinutes?: number;
|
|
29
|
-
schedule?: ResourcePlannerTimeRange[];
|
|
30
|
-
resourceRequirements?: ResourcePlannerResourceRequirement[];
|
|
31
|
-
capacityRequired?: number;
|
|
32
|
-
quantity?: number;
|
|
33
|
-
price?: string | number | null;
|
|
34
|
-
raw?: Record<string, any>;
|
|
35
|
-
}
|
|
36
|
-
export interface ResourcePlannerResource {
|
|
37
|
-
id: number | string;
|
|
38
|
-
formId?: number | string;
|
|
39
|
-
name?: string;
|
|
40
|
-
resourceType: ResourcePlannerResourceType;
|
|
41
|
-
capacity: number;
|
|
42
|
-
times: Array<ResourcePlannerTimeRange & {
|
|
43
|
-
event_list?: ResourcePlannerEvent[];
|
|
44
|
-
[key: string]: any;
|
|
45
|
-
}>;
|
|
46
|
-
childResourceIds?: Array<number | string>;
|
|
47
|
-
raw?: Record<string, any>;
|
|
48
|
-
}
|
|
49
|
-
export interface ResourcePlannerContextInput {
|
|
50
|
-
products?: ResourcePlannerProduct[];
|
|
51
|
-
resources?: ResourcePlannerResource[];
|
|
52
|
-
externalEvents?: ResourcePlannerEvent[];
|
|
53
|
-
slotDurationMinutes?: number;
|
|
54
|
-
businessStartTime?: string;
|
|
55
|
-
businessEndTime?: string;
|
|
56
|
-
}
|
|
57
|
-
export interface ResourcePlannerQuery {
|
|
58
|
-
mode?: ResourcePlannerMode;
|
|
59
|
-
productIds?: Array<number | string>;
|
|
60
|
-
date?: string;
|
|
61
|
-
dateRange?: {
|
|
62
|
-
start: string;
|
|
63
|
-
end: string;
|
|
64
|
-
};
|
|
65
|
-
startTime?: string;
|
|
66
|
-
endTime?: string;
|
|
67
|
-
resourceIds?: Array<number | string>;
|
|
68
|
-
serviceObjectIds?: Array<number | string>;
|
|
69
|
-
holderIds?: Array<number | string>;
|
|
70
|
-
pax?: number;
|
|
71
|
-
slotDurationMinutes?: number;
|
|
72
|
-
}
|
|
73
|
-
export interface ResourcePlannerSelection {
|
|
74
|
-
productIds: Array<number | string>;
|
|
75
|
-
date?: string;
|
|
76
|
-
startTime?: string;
|
|
77
|
-
endTime?: string;
|
|
78
|
-
resourceIds: Array<number | string>;
|
|
79
|
-
assignments: ResourcePlannerAssignment[];
|
|
80
|
-
mode?: ResourcePlannerMode;
|
|
81
|
-
}
|
|
82
|
-
export interface ResourcePlannerSelectionPatch extends Partial<ResourcePlannerSelection> {
|
|
83
|
-
replaceAssignments?: boolean;
|
|
84
|
-
}
|
|
85
|
-
export interface ResourcePlannerDemandInterval {
|
|
86
|
-
id: string;
|
|
87
|
-
productId: number | string;
|
|
88
|
-
source: Extract<ResourcePlannerProductKind, 'duration' | 'session' | 'venue_slot'>;
|
|
89
|
-
date: string;
|
|
90
|
-
start_at: string;
|
|
91
|
-
end_at: string;
|
|
92
|
-
durationMinutes: number;
|
|
93
|
-
quantity: number;
|
|
94
|
-
capacityRequired: number;
|
|
95
|
-
resourceRequirements: ResourcePlannerResourceRequirement[];
|
|
96
|
-
}
|
|
97
|
-
export interface ResourcePlannerConflict {
|
|
98
|
-
type: 'outside_resource_time' | 'remote_event_overlap' | 'cart_overlap' | 'capacity_full' | 'missing_time' | 'missing_resource' | 'missing_assignment' | 'past';
|
|
99
|
-
message: string;
|
|
100
|
-
event?: ResourcePlannerEvent;
|
|
101
|
-
resourceId?: number | string;
|
|
102
|
-
productId?: number | string;
|
|
103
|
-
}
|
|
104
|
-
export interface ResourcePlannerAvailabilityCell {
|
|
105
|
-
key: string;
|
|
106
|
-
productId: number | string;
|
|
107
|
-
resourceId?: number | string;
|
|
108
|
-
date?: string;
|
|
109
|
-
start_at: string;
|
|
110
|
-
end_at: string;
|
|
111
|
-
startTime?: string;
|
|
112
|
-
endTime?: string;
|
|
113
|
-
durationMinutes?: number;
|
|
114
|
-
cellType: 'availability_range' | 'fixed_interval' | 'unavailable';
|
|
115
|
-
status: ResourcePlannerStatus;
|
|
116
|
-
remainingCapacity?: number;
|
|
117
|
-
maxCapacity?: number;
|
|
118
|
-
reasonCodes: string[];
|
|
119
|
-
conflicts: ResourcePlannerConflict[];
|
|
120
|
-
}
|
|
121
|
-
export interface ResourcePlannerProductOption {
|
|
122
|
-
productId: number | string;
|
|
123
|
-
title?: string;
|
|
124
|
-
status: ResourcePlannerStatus;
|
|
125
|
-
reasonCodes: string[];
|
|
126
|
-
}
|
|
127
|
-
export interface ResourcePlannerResourceOption {
|
|
128
|
-
resourceId: number | string;
|
|
129
|
-
resourceName?: string;
|
|
130
|
-
resourceFormId?: number | string;
|
|
131
|
-
resourceType: ResourcePlannerResourceType;
|
|
132
|
-
status: ResourcePlannerStatus;
|
|
133
|
-
remainingCapacity?: number;
|
|
134
|
-
maxCapacity?: number;
|
|
135
|
-
reasonCodes: string[];
|
|
136
|
-
}
|
|
137
|
-
export interface ResourcePlannerDateSummary {
|
|
138
|
-
date: string;
|
|
139
|
-
status: ResourcePlannerStatus;
|
|
140
|
-
availableCount: number;
|
|
141
|
-
totalCount: number;
|
|
142
|
-
}
|
|
143
|
-
export interface ResourcePlannerTimeSlot {
|
|
144
|
-
startTime: string;
|
|
145
|
-
endTime: string;
|
|
146
|
-
status: ResourcePlannerStatus;
|
|
147
|
-
resourceId: number | string;
|
|
148
|
-
productId?: number | string;
|
|
149
|
-
remainingCapacity?: number;
|
|
150
|
-
maxCapacity?: number;
|
|
151
|
-
reasonCodes: string[];
|
|
152
|
-
}
|
|
153
|
-
export interface ResourcePlannerTimeGridRow {
|
|
154
|
-
resourceId: number | string;
|
|
155
|
-
resourceName?: string;
|
|
156
|
-
resourceFormId?: number | string;
|
|
157
|
-
slots: ResourcePlannerTimeSlot[];
|
|
158
|
-
}
|
|
159
|
-
export interface ResourcePlannerTimeGrid {
|
|
160
|
-
date?: string;
|
|
161
|
-
timeLabels: string[];
|
|
162
|
-
resources: ResourcePlannerTimeGridRow[];
|
|
163
|
-
}
|
|
164
|
-
export interface ResourcePlannerProjection {
|
|
165
|
-
query: ResourcePlannerQuery;
|
|
166
|
-
demandIntervals: ResourcePlannerDemandInterval[];
|
|
167
|
-
productOptions: ResourcePlannerProductOption[];
|
|
168
|
-
resourceOptions: ResourcePlannerResourceOption[];
|
|
169
|
-
dateSummary: ResourcePlannerDateSummary[];
|
|
170
|
-
timeGrid: ResourcePlannerTimeGrid;
|
|
171
|
-
cells: ResourcePlannerAvailabilityCell[];
|
|
172
|
-
}
|
|
173
|
-
export interface ResourcePlannerAssignment {
|
|
174
|
-
productId: number | string;
|
|
175
|
-
resourceId: number | string;
|
|
176
|
-
start_at: string;
|
|
177
|
-
end_at: string;
|
|
178
|
-
capacityRequired?: number;
|
|
179
|
-
}
|
|
180
|
-
export interface ResourcePlannerAssignableSlotResource {
|
|
181
|
-
resourceId: number | string;
|
|
182
|
-
resourceName?: string;
|
|
183
|
-
resourceFormId?: number | string;
|
|
184
|
-
resourceType?: ResourcePlannerResourceType;
|
|
185
|
-
capacityRequired?: number;
|
|
186
|
-
remainingCapacity?: number;
|
|
187
|
-
maxCapacity?: number;
|
|
188
|
-
}
|
|
189
|
-
export interface ResourcePlannerAssignableSlot {
|
|
190
|
-
key: string;
|
|
191
|
-
productId: number | string;
|
|
192
|
-
date: string;
|
|
193
|
-
start_at: string;
|
|
194
|
-
end_at: string;
|
|
195
|
-
startTime: string;
|
|
196
|
-
endTime: string;
|
|
197
|
-
durationMinutes: number;
|
|
198
|
-
status: ResourcePlannerStatus;
|
|
199
|
-
resources: ResourcePlannerAssignableSlotResource[];
|
|
200
|
-
assignments: ResourcePlannerAssignment[];
|
|
201
|
-
conflicts: ResourcePlannerConflict[];
|
|
202
|
-
}
|
|
203
|
-
export interface ResourcePlannerAssignableSlotResult {
|
|
204
|
-
projection: ResourcePlannerProjection;
|
|
205
|
-
slots: ResourcePlannerAssignableSlot[];
|
|
206
|
-
conflicts: ResourcePlannerConflict[];
|
|
207
|
-
}
|
|
208
|
-
export interface ResourcePlannerAssignmentResult {
|
|
209
|
-
assignments: ResourcePlannerAssignment[];
|
|
210
|
-
conflicts: ResourcePlannerConflict[];
|
|
211
|
-
}
|
|
212
|
-
export interface ResourcePlannerValidationResult {
|
|
213
|
-
ok: boolean;
|
|
214
|
-
conflicts: ResourcePlannerConflict[];
|
|
215
|
-
}
|
|
216
|
-
export interface ResourcePlannerSnapshot {
|
|
217
|
-
context: Required<ResourcePlannerContextInput>;
|
|
218
|
-
selection: ResourcePlannerSelection;
|
|
219
|
-
projection: ResourcePlannerProjection | null;
|
|
220
|
-
version: number;
|
|
221
|
-
}
|
|
222
|
-
export interface ResourcePlannerState {
|
|
223
|
-
context: Required<ResourcePlannerContextInput>;
|
|
224
|
-
selection: ResourcePlannerSelection;
|
|
225
|
-
projection: ResourcePlannerProjection | null;
|
|
226
|
-
version: number;
|
|
227
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
import type { Module } from '../../types';
|
|
2
|
-
import type { ProductData } from '../../modules';
|
|
3
|
-
import type { OpenDataConfig } from '../../modules/OpenData';
|
|
4
|
-
import type { LoadScheduleAvailableDateParams, ScheduleItem } from '../../modules/Schedule/types';
|
|
5
|
-
import type { ProductListLoadProductsParams } from '../../modules/ProductList';
|
|
6
|
-
import type { ResourcePlannerAssignment, ResourcePlannerAssignableSlotResult, ResourcePlannerEvent, ResourcePlannerProduct, ResourcePlannerProjection, ResourcePlannerQuery, ResourcePlannerResource, ResourcePlannerSelectionPatch, ResourcePlannerSnapshot, ResourcePlannerValidationResult } from '../../modules/ResourcePlanner';
|
|
7
|
-
import type { UnifiedBookingSalesCommitPlannerSelectionParams, UnifiedBookingSalesCommitResult, UnifiedBookingSalesAddRetailProductParams, UnifiedBookingSalesApplyPlannerDiscountsParams, UnifiedBookingSalesDiscountResult, UnifiedBookingSalesLoadProductsByScheduleDateParams, UnifiedBookingSalesLoadPlannerContextParams, UnifiedBookingSalesLoadOpenDataParams, UnifiedBookingSalesStagePlannerProductsParams, UnifiedBookingSalesStageRetailProductsParams, UnifiedBookingSalesState } from './types';
|
|
8
|
-
import { BookingTicket } from '../BookingTicket';
|
|
9
|
-
export * from './types';
|
|
10
|
-
/**
|
|
11
|
-
* Converts Rules/Order discount internals into a small UI-facing diagnostic. The result keeps
|
|
12
|
-
* candidate-card state separate from line-level applications: a selected card is not proof that
|
|
13
|
-
* it actually discounted a planner product.
|
|
14
|
-
*/
|
|
15
|
-
export declare function buildPlannerDiscountResult(params: {
|
|
16
|
-
customerId: number | null;
|
|
17
|
-
discountList: Record<string, any>[];
|
|
18
|
-
products: Record<string, any>[];
|
|
19
|
-
summaryBefore?: unknown;
|
|
20
|
-
summaryAfter?: unknown;
|
|
21
|
-
status: UnifiedBookingSalesDiscountResult['status'];
|
|
22
|
-
preferredDiscountId?: number | string;
|
|
23
|
-
preferredDiscountFound?: boolean;
|
|
24
|
-
}): UnifiedBookingSalesDiscountResult;
|
|
25
|
-
/** Converts a ProductList record into the pure input shape consumed by ResourcePlanner. */
|
|
26
|
-
export declare function normalizeProductForPlanner(product: ProductData | Record<string, any>): ResourcePlannerProduct;
|
|
27
|
-
/**
|
|
28
|
-
* Materializes resource work windows locally from v2's schedule ids, then keeps its flat
|
|
29
|
-
* event_list as planner events. This deliberately avoids the older API's times -> event_list
|
|
30
|
-
* response nesting and lets one resource response serve any requested date range.
|
|
31
|
-
*/
|
|
32
|
-
export declare function buildPlannerResourcesFromV2(params: {
|
|
33
|
-
rawResources: Record<string, any>[];
|
|
34
|
-
scheduleList: ScheduleItem[];
|
|
35
|
-
dateRange?: ResourcePlannerQuery['dateRange'];
|
|
36
|
-
}): {
|
|
37
|
-
resources: ResourcePlannerResource[];
|
|
38
|
-
externalEvents: ResourcePlannerEvent[];
|
|
39
|
-
};
|
|
40
|
-
/** Combines URL-locked resources with every resource referenced by the selected products. */
|
|
41
|
-
export declare function collectPlannerResourceIds(products: ResourcePlannerProduct[], explicitResourceIds?: Array<number | string>): Array<number | string>;
|
|
42
|
-
/** Convenience wrapper for the usual one-resource booking case. */
|
|
43
|
-
export declare function buildBookingFromAssignment(params: {
|
|
44
|
-
assignment: ResourcePlannerAssignment;
|
|
45
|
-
product: ResourcePlannerProduct;
|
|
46
|
-
}): Record<string, any>;
|
|
47
|
-
/**
|
|
48
|
-
* Converts all resources needed by one product/time interval into the one booking expected by
|
|
49
|
-
* OrderModule. Callers must group assignments before this function so a multi-form booking does
|
|
50
|
-
* not become several competing bookings.
|
|
51
|
-
*/
|
|
52
|
-
export declare function buildBookingFromAssignments(params: {
|
|
53
|
-
assignments: ResourcePlannerAssignment[];
|
|
54
|
-
product: ResourcePlannerProduct;
|
|
55
|
-
}): Record<string, any>;
|
|
56
|
-
/** Builds the exact identity BaseSales needs to remove only this solution's order lines. */
|
|
57
|
-
export declare function buildPlannerLineIdentity(product: Record<string, any>): Record<string, any>;
|
|
58
|
-
export declare class UnifiedBookingSalesImpl extends BookingTicket {
|
|
59
|
-
protected defaultName: string;
|
|
60
|
-
protected defaultVersion: string;
|
|
61
|
-
protected store: UnifiedBookingSalesState;
|
|
62
|
-
private unifiedProductCatalog;
|
|
63
|
-
private openDataTarget;
|
|
64
|
-
private loadOpenDataInFlight;
|
|
65
|
-
private loadOpenDataInFlightTarget;
|
|
66
|
-
/**
|
|
67
|
-
* Kiosk 不能把已收款订单留在本地等待重试:默认直接等待云端 checkout。
|
|
68
|
-
* 兼容仍需要 WebPOS 待同步模式的入口可显式传 checkoutSyncTaskEnabled: true。
|
|
69
|
-
*/
|
|
70
|
-
protected shouldUseCheckoutSyncTask(): boolean;
|
|
71
|
-
/** UnifiedBookingSales 的真实结账默认请求收据数据,供云端确认后再本地打印。 */
|
|
72
|
-
protected getDefaultCheckoutSmallTicketDataFlag(): number;
|
|
73
|
-
protected getRegisteredModuleNames(): readonly string[];
|
|
74
|
-
protected createSubModule(moduleName: string): Module | null;
|
|
75
|
-
/**
|
|
76
|
-
* Loads OpenData without borrowing BookingTicket. Cache ownership is tied to the exact
|
|
77
|
-
* business/channel target so a reused solution instance cannot leak another entry's menus.
|
|
78
|
-
*/
|
|
79
|
-
loadOpenData(params: UnifiedBookingSalesLoadOpenDataParams): Promise<OpenDataConfig>;
|
|
80
|
-
getOpenData(): Promise<OpenDataConfig | null>;
|
|
81
|
-
/**
|
|
82
|
-
* Loads the product catalog used by both UI and Planner. Schedule data is requested with each
|
|
83
|
-
* product because session products carry their fixed intervals there.
|
|
84
|
-
*/
|
|
85
|
-
loadProducts(params?: ProductListLoadProductsParams, options?: {
|
|
86
|
-
callback?: (result: any) => void;
|
|
87
|
-
subscriberId?: string;
|
|
88
|
-
}): Promise<ProductData[]>;
|
|
89
|
-
/** Date-first entry point. It delegates protocol details and cache ownership to ScheduleModule. */
|
|
90
|
-
loadScheduleAvailableDate(params: LoadScheduleAvailableDateParams): Promise<import("../../modules/Date/types").ITime[]>;
|
|
91
|
-
/**
|
|
92
|
-
* Implements the date-first product pool: the chosen date's product ids plus globally sellable
|
|
93
|
-
* other_product_ids. If a batch product query is unexpectedly empty, retry one id at a time so
|
|
94
|
-
* a partial backend incompatibility does not hide the entire date's catalog.
|
|
95
|
-
*/
|
|
96
|
-
loadProductsByScheduleDate(params: UnifiedBookingSalesLoadProductsByScheduleDateParams): Promise<ProductData[]>;
|
|
97
|
-
/** Returns a copy so UI consumers cannot accidentally mutate the solution's product cache. */
|
|
98
|
-
getProductCatalog(): {
|
|
99
|
-
products: ProductData[];
|
|
100
|
-
};
|
|
101
|
-
/**
|
|
102
|
-
* Read-only compatibility view for salesSdk skins. It reconnects a booking to its product but
|
|
103
|
-
* must not be used to mutate tempOrder; all writes go through BaseSales / planner APIs.
|
|
104
|
-
*/
|
|
105
|
-
getCart(): {
|
|
106
|
-
items: any[];
|
|
107
|
-
bookings: any[];
|
|
108
|
-
};
|
|
109
|
-
/**
|
|
110
|
-
* Loads the current customer's product coupons and discount cards after planner lines exist,
|
|
111
|
-
* then optionally lets the existing Rules engine select the best valid combination. This is a
|
|
112
|
-
* diagnostic boundary for new booking skins: no pricing logic is duplicated in the planner.
|
|
113
|
-
*/
|
|
114
|
-
applyPlannerDiscounts(params?: UnifiedBookingSalesApplyPlannerDiscountsParams): Promise<UnifiedBookingSalesDiscountResult>;
|
|
115
|
-
/** ResourcePlanner is a required child module; fail early instead of producing partial availability. */
|
|
116
|
-
private getPlanner;
|
|
117
|
-
private buildUnifiedOrderProduct;
|
|
118
|
-
/** Replacing a staged selection is idempotent and never removes unrelated cart lines. */
|
|
119
|
-
private removeExistingStagedLines;
|
|
120
|
-
private stageProducts;
|
|
121
|
-
/**
|
|
122
|
-
* Adds the current product choice to an otherwise clean planner cart without creating bookings.
|
|
123
|
-
* This separates "what the customer wants" from the later time/resource confirmation step.
|
|
124
|
-
*/
|
|
125
|
-
stagePlannerProducts(params: UnifiedBookingSalesStagePlannerProductsParams): Promise<Record<string, any> | null>;
|
|
126
|
-
/**
|
|
127
|
-
* Adds ordinary retail products without asking ResourcePlanner for booking facts.
|
|
128
|
-
* Its staged lines have separate ownership so planner and retail skins can coexist safely.
|
|
129
|
-
*/
|
|
130
|
-
stageRetailProducts(params: UnifiedBookingSalesStageRetailProductsParams): Promise<Record<string, any> | null>;
|
|
131
|
-
/**
|
|
132
|
-
* Adds one retail line without replacing the cart's existing retail selection.
|
|
133
|
-
* This is intentionally separate from stageRetailProducts(), whose contract is
|
|
134
|
-
* "replace the staged selection" for demo and wizard-like callers.
|
|
135
|
-
*/
|
|
136
|
-
addRetailProduct(params: UnifiedBookingSalesAddRetailProductParams): Promise<Record<string, any>[]>;
|
|
137
|
-
/** Normalizes caller-provided products or loads the catalog before any resource request is made. */
|
|
138
|
-
private loadPlannerProducts;
|
|
139
|
-
/** Loads the reusable store-level schedule catalog on demand. */
|
|
140
|
-
private ensurePlannerSchedulesLoaded;
|
|
141
|
-
/**
|
|
142
|
-
* v2 resources reference schedule ids rather than expanded work times. Refresh once when the
|
|
143
|
-
* cached schedule catalog cannot materialize all referenced ids.
|
|
144
|
-
*/
|
|
145
|
-
private ensurePlannerSchedulesForResources;
|
|
146
|
-
/**
|
|
147
|
-
* Fetches resource metadata plus flat occupied events. Work windows are intentionally derived
|
|
148
|
-
* locally in buildPlannerResourcesFromV2 from /schedule, rather than requested from the legacy
|
|
149
|
-
* resource dates endpoint.
|
|
150
|
-
*/
|
|
151
|
-
private fetchPlannerResourcesV2;
|
|
152
|
-
/**
|
|
153
|
-
* Resolves the Planner context in precedence order: explicit normalized context, test raw data,
|
|
154
|
-
* then the v2 resource API inferred from selected product requirements and any URL lock.
|
|
155
|
-
*/
|
|
156
|
-
private loadPlannerResources;
|
|
157
|
-
/**
|
|
158
|
-
* Boundary between IO and pure planning. Once this returns, all later availability/slot calls
|
|
159
|
-
* operate on the ResourcePlanner snapshot and do not issue resource requests themselves.
|
|
160
|
-
*/
|
|
161
|
-
loadPlannerContext(params?: UnifiedBookingSalesLoadPlannerContextParams): Promise<ResourcePlannerSnapshot>;
|
|
162
|
-
/** Returns cells, date summaries and a derived grid; cells are continuous ranges, not UI slots. */
|
|
163
|
-
queryPlannerAvailability(query?: ResourcePlannerQuery): Promise<ResourcePlannerProjection>;
|
|
164
|
-
/** Turns compatible availability ranges into user-selectable intervals and ready-to-commit assignments. */
|
|
165
|
-
resolveAssignableSlots(query?: ResourcePlannerQuery): ResourcePlannerAssignableSlotResult;
|
|
166
|
-
/** Stores a UI choice only. It is deliberately side-effect free with respect to tempOrder. */
|
|
167
|
-
setPlannerSelection(patch: ResourcePlannerSelectionPatch): ResourcePlannerSnapshot;
|
|
168
|
-
/**
|
|
169
|
-
* Legacy-friendly automatic assignment for already fixed intervals. Duration products without a
|
|
170
|
-
* start time intentionally remain unresolved; callers offering a picker should use slots.
|
|
171
|
-
*/
|
|
172
|
-
autoAssignPlanner(query?: ResourcePlannerQuery): Promise<ResourcePlannerSnapshot>;
|
|
173
|
-
/** Rechecks remote events, capacity and conflicts among the current selection before committing. */
|
|
174
|
-
validatePlannerSelection(): ResourcePlannerValidationResult;
|
|
175
|
-
/** Read-only snapshot for UI diagnostics and progressive flow steps. */
|
|
176
|
-
getPlannerSnapshot(): ResourcePlannerSnapshot;
|
|
177
|
-
/**
|
|
178
|
-
* Validates then writes assignments to tempOrder. Real order submission is opt-in so UI callers
|
|
179
|
-
* can safely preview the cart; pass submitAfterCommit only after an explicit confirmation.
|
|
180
|
-
*/
|
|
181
|
-
commitPlannerSelection(params?: UnifiedBookingSalesCommitPlannerSelectionParams): Promise<UnifiedBookingSalesCommitResult>;
|
|
182
|
-
}
|
|
183
|
-
export declare const UnifiedBookingSales: typeof UnifiedBookingSalesImpl;
|