@pisell/pisellos 2.2.291 → 2.2.293
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/index.d.ts +7 -0
- package/dist/core/index.js +108 -65
- package/dist/model/strategy/adapter/itemRule/adapter.d.ts +4 -1
- package/dist/model/strategy/adapter/itemRule/adapter.js +135 -35
- package/dist/model/strategy/adapter/itemRule/evaluator.d.ts +8 -1
- package/dist/model/strategy/adapter/itemRule/evaluator.js +25 -1
- package/dist/model/strategy/adapter/itemRule/type.d.ts +44 -0
- package/dist/model/strategy/adapter/itemRule/type.js +19 -1
- package/dist/model/strategy/adapter/promotion/index.js +0 -9
- package/dist/modules/BookingContext/index.d.ts +3 -0
- package/dist/modules/BookingContext/index.js +42 -13
- package/dist/modules/BookingContext/types.d.ts +4 -4
- package/dist/modules/BookingContext/types.js +3 -3
- package/dist/modules/OpenData/types.d.ts +1 -0
- package/dist/modules/Order/index.d.ts +18 -3
- package/dist/modules/Order/index.js +885 -485
- package/dist/modules/Order/salesNotes.d.ts +31 -0
- package/dist/modules/Order/salesNotes.js +492 -0
- package/dist/modules/Order/types.d.ts +93 -5
- package/dist/modules/Order/types.js +5 -0
- package/dist/modules/Order/utils.d.ts +12 -0
- package/dist/modules/Order/utils.js +96 -31
- package/dist/modules/Product/types.d.ts +2 -0
- package/dist/modules/ProductList/clientDataVariants.d.ts +50 -0
- package/dist/modules/ProductList/clientDataVariants.js +216 -0
- package/dist/modules/ProductList/index.d.ts +18 -3
- package/dist/modules/ProductList/index.js +220 -38
- package/dist/modules/ProductList/types.d.ts +10 -0
- package/dist/modules/Quotation/index.d.ts +22 -0
- package/dist/modules/Quotation/index.js +293 -28
- package/dist/modules/ResourcePlanner/index.d.ts +0 -22
- package/dist/modules/ResourcePlanner/index.js +1 -180
- package/dist/modules/ResourcePlanner/localClock.d.ts +33 -0
- package/dist/modules/ResourcePlanner/localClock.js +183 -0
- package/dist/modules/ResourcePlanner/planner.d.ts +5 -14
- package/dist/modules/ResourcePlanner/planner.js +2111 -958
- package/dist/modules/ResourcePlanner/types.d.ts +359 -187
- package/dist/modules/ResourcePlanner/types.js +33 -1
- package/dist/plugins/request.d.ts +1 -0
- package/dist/server/index.d.ts +17 -2
- package/dist/server/index.js +1134 -932
- package/dist/server/modules/floor-plan/index.d.ts +4 -0
- package/dist/server/modules/floor-plan/index.js +240 -98
- package/dist/server/modules/menu/index.js +48 -23
- package/dist/server/modules/order/index.d.ts +17 -7
- package/dist/server/modules/order/index.js +419 -207
- package/dist/server/modules/products/index.d.ts +10 -4
- package/dist/server/modules/products/index.js +177 -84
- package/dist/server/modules/resource/index.js +21 -13
- package/dist/server/utils/product.d.ts +1 -1
- package/dist/server/utils/product.js +186 -22
- package/dist/server/utils/small-ticket.d.ts +9 -1
- package/dist/server/utils/small-ticket.js +131 -84
- package/dist/solution/BaseSales/index.d.ts +26 -3
- package/dist/solution/BaseSales/index.js +1384 -905
- package/dist/solution/BaseSales/types.d.ts +2 -0
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +3 -0
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +10 -3
- package/dist/solution/BaseSales/utils.js +6 -3
- package/dist/solution/BookingByStep/index.d.ts +4 -4
- package/dist/solution/BookingTicket/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.js +4 -2
- package/dist/solution/BookingTicket/utils/addProductDecision.d.ts +2 -1
- package/dist/solution/BookingTicket/utils/addProductDecision.js +6 -3
- package/dist/solution/BookingTicket/utils/orderCustomer.js +3 -2
- package/dist/solution/RegisterAndLogin/config.d.ts +9 -3
- package/dist/solution/RegisterAndLogin/config.js +95 -40
- package/dist/solution/RegisterAndLogin/index.js +4 -1
- package/dist/solution/ScanOrder/index.d.ts +1 -0
- package/dist/solution/ScanOrder/index.js +31 -27
- package/dist/solution/ScanOrder/types.d.ts +2 -0
- package/dist/solution/ScanOrder/utils.d.ts +1 -0
- package/dist/solution/ScanOrder/utils.js +8 -3
- package/dist/solution/UnifiedBookingSales/index.d.ts +128 -74
- package/dist/solution/UnifiedBookingSales/index.js +3877 -963
- package/dist/solution/UnifiedBookingSales/remoteOccupancyCache.d.ts +49 -0
- package/dist/solution/UnifiedBookingSales/remoteOccupancyCache.js +430 -0
- package/dist/solution/UnifiedBookingSales/types.d.ts +161 -77
- package/dist/solution/UnifiedBookingSales/types.js +4 -9
- package/dist/solution/VenueBooking/index.d.ts +3 -0
- package/dist/solution/VenueBooking/index.js +549 -497
- package/dist/solution/VenueBooking/utils/dateSummary.d.ts +1 -0
- package/dist/solution/VenueBooking/utils/dateSummary.js +3 -1
- package/dist/solution/VenueBooking/utils/slotMerge.d.ts +2 -0
- package/dist/solution/VenueBooking/utils/slotMerge.js +3 -1
- package/dist/utils/platform.d.ts +8 -0
- package/dist/utils/platform.js +15 -0
- package/lib/core/index.d.ts +7 -0
- package/lib/core/index.js +20 -2
- package/lib/model/strategy/adapter/itemRule/adapter.d.ts +4 -1
- package/lib/model/strategy/adapter/itemRule/adapter.js +73 -4
- package/lib/model/strategy/adapter/itemRule/evaluator.d.ts +8 -1
- package/lib/model/strategy/adapter/itemRule/evaluator.js +23 -1
- package/lib/model/strategy/adapter/itemRule/type.d.ts +44 -0
- package/lib/model/strategy/adapter/itemRule/type.js +19 -1
- package/lib/modules/BookingContext/index.d.ts +3 -0
- package/lib/modules/BookingContext/index.js +35 -8
- package/lib/modules/BookingContext/types.d.ts +4 -4
- package/lib/modules/BookingContext/types.js +3 -3
- package/lib/modules/OpenData/types.d.ts +1 -0
- package/lib/modules/Order/index.d.ts +18 -3
- package/lib/modules/Order/index.js +325 -28
- package/lib/modules/Order/salesNotes.d.ts +31 -0
- package/lib/modules/Order/salesNotes.js +382 -0
- package/lib/modules/Order/types.d.ts +93 -5
- package/lib/modules/Order/types.js +4 -0
- package/lib/modules/Order/utils.d.ts +12 -0
- package/lib/modules/Order/utils.js +85 -16
- package/lib/modules/Product/types.d.ts +2 -0
- package/lib/modules/ProductList/clientDataVariants.d.ts +50 -0
- package/lib/modules/ProductList/clientDataVariants.js +204 -0
- package/lib/modules/ProductList/index.d.ts +18 -3
- package/lib/modules/ProductList/index.js +137 -8
- package/lib/modules/ProductList/types.d.ts +10 -0
- package/lib/modules/Quotation/index.d.ts +22 -0
- package/lib/modules/Quotation/index.js +158 -11
- package/lib/modules/ResourcePlanner/index.d.ts +0 -22
- package/lib/modules/ResourcePlanner/index.js +9 -129
- package/lib/modules/ResourcePlanner/localClock.d.ts +33 -0
- package/lib/modules/ResourcePlanner/localClock.js +205 -0
- package/lib/modules/ResourcePlanner/planner.d.ts +5 -14
- package/lib/modules/ResourcePlanner/planner.js +1807 -783
- package/lib/modules/ResourcePlanner/types.d.ts +359 -187
- package/lib/modules/ResourcePlanner/types.js +13 -1
- package/lib/plugins/request.d.ts +1 -0
- package/lib/server/index.d.ts +17 -2
- package/lib/server/index.js +149 -21
- package/lib/server/modules/floor-plan/index.d.ts +4 -0
- package/lib/server/modules/floor-plan/index.js +60 -7
- package/lib/server/modules/menu/index.js +26 -4
- package/lib/server/modules/order/index.d.ts +17 -7
- package/lib/server/modules/order/index.js +194 -57
- package/lib/server/modules/products/index.d.ts +10 -4
- package/lib/server/modules/products/index.js +93 -23
- package/lib/server/modules/resource/index.js +12 -2
- package/lib/server/utils/product.d.ts +1 -1
- package/lib/server/utils/product.js +163 -3
- package/lib/server/utils/small-ticket.d.ts +9 -1
- package/lib/server/utils/small-ticket.js +123 -79
- package/lib/solution/BaseSales/index.d.ts +26 -3
- package/lib/solution/BaseSales/index.js +396 -70
- package/lib/solution/BaseSales/types.d.ts +2 -0
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +3 -0
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +9 -2
- package/lib/solution/BaseSales/utils.js +3 -0
- package/lib/solution/BookingByStep/index.d.ts +4 -4
- package/lib/solution/BookingTicket/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.js +2 -1
- package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +2 -1
- package/lib/solution/BookingTicket/utils/addProductDecision.js +5 -2
- package/lib/solution/BookingTicket/utils/orderCustomer.js +2 -1
- package/lib/solution/RegisterAndLogin/config.d.ts +9 -3
- package/lib/solution/RegisterAndLogin/config.js +49 -8
- package/lib/solution/RegisterAndLogin/index.js +4 -1
- package/lib/solution/ScanOrder/index.d.ts +1 -0
- package/lib/solution/ScanOrder/index.js +5 -1
- package/lib/solution/ScanOrder/types.d.ts +2 -0
- package/lib/solution/ScanOrder/utils.d.ts +1 -0
- package/lib/solution/ScanOrder/utils.js +4 -0
- package/lib/solution/UnifiedBookingSales/index.d.ts +128 -74
- package/lib/solution/UnifiedBookingSales/index.js +2592 -424
- package/lib/solution/UnifiedBookingSales/remoteOccupancyCache.d.ts +49 -0
- package/lib/solution/UnifiedBookingSales/remoteOccupancyCache.js +316 -0
- package/lib/solution/UnifiedBookingSales/types.d.ts +161 -77
- package/lib/solution/UnifiedBookingSales/types.js +4 -6
- package/lib/solution/VenueBooking/index.d.ts +3 -0
- package/lib/solution/VenueBooking/index.js +33 -9
- package/lib/solution/VenueBooking/utils/dateSummary.d.ts +1 -0
- package/lib/solution/VenueBooking/utils/dateSummary.js +3 -1
- package/lib/solution/VenueBooking/utils/slotMerge.d.ts +2 -0
- package/lib/solution/VenueBooking/utils/slotMerge.js +3 -1
- package/lib/utils/platform.d.ts +8 -0
- package/lib/utils/platform.js +22 -0
- package/package.json +1 -1
|
@@ -1,227 +1,399 @@
|
|
|
1
|
-
export type
|
|
2
|
-
export type
|
|
3
|
-
export type
|
|
4
|
-
export type
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
resource_id?: number | string;
|
|
12
|
-
pax?: number;
|
|
13
|
-
product_uid?: string;
|
|
14
|
-
source?: 'remote' | 'cart' | 'selection';
|
|
15
|
-
[key: string]: any;
|
|
1
|
+
export type AvailabilityId = number | string;
|
|
2
|
+
export type AvailabilityMode = 'appointment' | 'scan_order' | 'venue_grid';
|
|
3
|
+
export type AvailabilityProductKind = 'normal' | 'duration' | 'session' | 'venue_slot';
|
|
4
|
+
export type AvailabilityResourceType = 'single' | 'multiple' | 'capacity';
|
|
5
|
+
export type AvailabilityStatus = 'available' | 'limited' | 'full' | 'conflict' | 'unavailable' | 'past';
|
|
6
|
+
export type AvailabilityScheduleMode = 'daily' | 'weekly' | 'designation';
|
|
7
|
+
export type AvailabilityErrorCode = 'MISSING_ANCHOR' | 'MISSING_CATALOG_SCOPE' | 'AVAILABILITY_CONTEXT_NOT_FOUND' | 'AVAILABILITY_SELECTION_STALE' | 'AVAILABILITY_COMMIT_IN_PROGRESS' | 'OPERATING_HOURS_RESOLVE_FAILED' | 'INVALID_DATE_RANGE' | 'RANGE_TOO_LARGE' | 'OUT_OF_PROJECTION_COVERAGE' | 'STALE_PROJECTION' | 'INVALID_TARGET_FILTER' | 'MISSING_TIME_CANDIDATES' | 'MISSING_SELECTED_RANGE' | 'PRODUCT_LINE_NOT_FOUND' | 'SELF_EXCLUSION_RESOLVE_FAILED' | 'INVALID_RESERVATION_QUANTITY' | 'REVALIDATION_FAILED';
|
|
8
|
+
export interface AvailabilityAbsoluteRange {
|
|
9
|
+
startAt: string;
|
|
10
|
+
endAt: string;
|
|
16
11
|
}
|
|
17
|
-
export interface
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
12
|
+
export interface AvailabilityDisplayRange extends AvailabilityAbsoluteRange {
|
|
13
|
+
date: string;
|
|
14
|
+
startTime: string;
|
|
15
|
+
endTime: string;
|
|
16
|
+
timezone: string;
|
|
17
|
+
}
|
|
18
|
+
export interface AvailabilityDateRange {
|
|
19
|
+
startDate: string;
|
|
20
|
+
endDate: string;
|
|
21
|
+
}
|
|
22
|
+
export interface AvailabilityScheduleRef {
|
|
23
|
+
scheduleId?: AvailabilityId;
|
|
24
|
+
timeSlotId?: AvailabilityId;
|
|
25
|
+
ruleId?: string;
|
|
26
|
+
source?: string;
|
|
27
|
+
label?: string;
|
|
28
|
+
}
|
|
29
|
+
export interface AvailabilityScheduleRule {
|
|
30
|
+
id: string;
|
|
31
|
+
mode: AvailabilityScheduleMode;
|
|
32
|
+
startTime: string;
|
|
33
|
+
endTime: string;
|
|
34
|
+
startDate?: string;
|
|
35
|
+
endDate?: string;
|
|
36
|
+
frequency?: number;
|
|
37
|
+
weekdays?: number[];
|
|
38
|
+
dates?: string[];
|
|
39
|
+
includeDates?: string[];
|
|
40
|
+
excludeDates?: string[];
|
|
41
|
+
scheduleRef?: AvailabilityScheduleRef;
|
|
42
|
+
}
|
|
43
|
+
export interface AvailabilitySessionRange extends AvailabilityAbsoluteRange {
|
|
44
|
+
scheduleRefs?: AvailabilityScheduleRef[];
|
|
45
|
+
}
|
|
46
|
+
export interface AvailabilityRequirementGroup {
|
|
47
|
+
id: string;
|
|
48
|
+
formId?: AvailabilityId;
|
|
49
|
+
title?: string;
|
|
50
|
+
code?: string;
|
|
51
|
+
resourceType: AvailabilityResourceType;
|
|
22
52
|
required?: boolean;
|
|
53
|
+
min?: number;
|
|
54
|
+
max?: number;
|
|
55
|
+
resourceIds?: AvailabilityId[];
|
|
56
|
+
capacityRequired?: number;
|
|
57
|
+
raw?: Record<string, any>;
|
|
23
58
|
}
|
|
24
|
-
export
|
|
25
|
-
|
|
59
|
+
export type AvailabilityCutOffPolicy = {
|
|
60
|
+
type: 'ongoing';
|
|
61
|
+
mode: 'before_end';
|
|
62
|
+
futureDay?: number;
|
|
63
|
+
} | {
|
|
64
|
+
type: 'ongoing';
|
|
65
|
+
mode: 'after_start';
|
|
66
|
+
graceMinutes: number;
|
|
67
|
+
futureDay?: number;
|
|
68
|
+
} | {
|
|
69
|
+
type: 'before_start';
|
|
70
|
+
futureDay?: number;
|
|
71
|
+
} | {
|
|
72
|
+
type: 'advance';
|
|
73
|
+
unit: number;
|
|
74
|
+
unitType: 'days' | 'hours' | 'minutes';
|
|
75
|
+
futureDay?: number;
|
|
76
|
+
} | {
|
|
77
|
+
type: 'invalid';
|
|
78
|
+
reason: string;
|
|
79
|
+
};
|
|
80
|
+
export interface AvailabilityProduct {
|
|
81
|
+
id: AvailabilityId;
|
|
26
82
|
title?: string;
|
|
27
|
-
kind:
|
|
83
|
+
kind: AvailabilityProductKind;
|
|
84
|
+
isFlexibleDuration?: boolean;
|
|
28
85
|
durationMinutes?: number;
|
|
29
|
-
schedule?: ResourcePlannerTimeRange[];
|
|
30
|
-
resourceRequirements?: ResourcePlannerResourceRequirement[];
|
|
31
|
-
capacityRequired?: number;
|
|
32
86
|
quantity?: number;
|
|
33
|
-
|
|
87
|
+
capacityRequired?: number;
|
|
88
|
+
cutOffPolicy?: AvailabilityCutOffPolicy;
|
|
89
|
+
requirementGroups?: AvailabilityRequirementGroup[];
|
|
90
|
+
sessionRules?: AvailabilityScheduleRule[];
|
|
91
|
+
sessionRanges?: AvailabilitySessionRange[];
|
|
92
|
+
raw?: Record<string, any>;
|
|
93
|
+
}
|
|
94
|
+
export interface AvailabilityResourceWindow extends AvailabilityAbsoluteRange {
|
|
95
|
+
source?: string;
|
|
34
96
|
raw?: Record<string, any>;
|
|
35
97
|
}
|
|
36
|
-
export
|
|
37
|
-
|
|
38
|
-
|
|
98
|
+
export type AvailabilityOperatingHoursSource = 'prepare_business_hours' | 'open_data_schedule' | 'default_business_hours';
|
|
99
|
+
export interface AvailabilityOperatingHoursSnapshot {
|
|
100
|
+
source: AvailabilityOperatingHoursSource;
|
|
101
|
+
scheduleIds: AvailabilityId[];
|
|
102
|
+
missingScheduleIds: AvailabilityId[];
|
|
103
|
+
windows: AvailabilityResourceWindow[];
|
|
104
|
+
}
|
|
105
|
+
export interface AvailabilityResource {
|
|
106
|
+
id: AvailabilityId;
|
|
107
|
+
formId?: AvailabilityId;
|
|
39
108
|
name?: string;
|
|
40
|
-
|
|
109
|
+
code?: string;
|
|
110
|
+
resourceType: AvailabilityResourceType;
|
|
41
111
|
capacity: number;
|
|
42
|
-
|
|
43
|
-
event_list?: ResourcePlannerEvent[];
|
|
44
|
-
[key: string]: any;
|
|
45
|
-
}>;
|
|
46
|
-
childResourceIds?: Array<number | string>;
|
|
112
|
+
windows: AvailabilityResourceWindow[];
|
|
47
113
|
raw?: Record<string, any>;
|
|
48
114
|
}
|
|
49
|
-
export interface
|
|
50
|
-
|
|
51
|
-
|
|
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>;
|
|
115
|
+
export interface AvailabilityOccupancy extends AvailabilityAbsoluteRange {
|
|
116
|
+
id?: string;
|
|
117
|
+
resourceId: AvailabilityId;
|
|
70
118
|
pax?: number;
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
endTime?: string;
|
|
78
|
-
resourceIds: Array<number | string>;
|
|
79
|
-
assignments: ResourcePlannerAssignment[];
|
|
80
|
-
mode?: ResourcePlannerMode;
|
|
119
|
+
source?: 'remote' | 'cart' | 'selection';
|
|
120
|
+
serverEventId?: AvailabilityId;
|
|
121
|
+
bookingUid?: AvailabilityId;
|
|
122
|
+
productUid?: AvailabilityId;
|
|
123
|
+
scheduleEventId?: AvailabilityId;
|
|
124
|
+
raw?: Record<string, any>;
|
|
81
125
|
}
|
|
82
|
-
export interface
|
|
83
|
-
|
|
126
|
+
export interface AvailabilityProjectionMeta {
|
|
127
|
+
readonly snapshotId: string;
|
|
128
|
+
readonly preparedAt: string;
|
|
129
|
+
readonly timezone: string;
|
|
130
|
+
readonly orderRevision?: AvailabilityId;
|
|
131
|
+
readonly mode: AvailabilityMode;
|
|
132
|
+
readonly coverage: Readonly<AvailabilityDateRange & AvailabilityAbsoluteRange>;
|
|
133
|
+
readonly defaults: {
|
|
134
|
+
readonly slotStepMinutes: number;
|
|
135
|
+
readonly businessHours: {
|
|
136
|
+
readonly startTime: string;
|
|
137
|
+
readonly endTime: string;
|
|
138
|
+
};
|
|
139
|
+
readonly operatingHours: Readonly<AvailabilityOperatingHoursSnapshot>;
|
|
140
|
+
};
|
|
141
|
+
readonly now: string;
|
|
142
|
+
readonly durationCandidateAnchorAt: string;
|
|
143
|
+
readonly prepareParams?: Readonly<Record<string, any>>;
|
|
144
|
+
readonly anchors?: {
|
|
145
|
+
readonly productIds?: readonly AvailabilityId[];
|
|
146
|
+
readonly resourceIds?: readonly AvailabilityId[];
|
|
147
|
+
readonly dateRange?: Readonly<AvailabilityDateRange>;
|
|
148
|
+
};
|
|
84
149
|
}
|
|
85
|
-
export interface
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
150
|
+
export interface AvailabilityProjectionInput {
|
|
151
|
+
products: AvailabilityProduct[];
|
|
152
|
+
resources: AvailabilityResource[];
|
|
153
|
+
resourceOccupancies?: AvailabilityOccupancy[];
|
|
154
|
+
mode?: AvailabilityMode;
|
|
155
|
+
timezone: string;
|
|
156
|
+
coverage: AvailabilityDateRange;
|
|
157
|
+
slotStepMinutes?: number;
|
|
158
|
+
businessHours?: {
|
|
159
|
+
startTime: string;
|
|
160
|
+
endTime: string;
|
|
161
|
+
};
|
|
162
|
+
operatingHours?: AvailabilityOperatingHoursSnapshot;
|
|
163
|
+
snapshotId?: string;
|
|
164
|
+
preparedAt?: string;
|
|
165
|
+
now?: string;
|
|
166
|
+
durationCandidateAnchorAt?: string;
|
|
167
|
+
orderRevision?: AvailabilityId;
|
|
168
|
+
anchors?: AvailabilityProjectionMeta['anchors'];
|
|
169
|
+
prepareParams?: Record<string, any>;
|
|
103
170
|
}
|
|
104
|
-
export interface
|
|
171
|
+
export interface AvailabilityCell extends AvailabilityDisplayRange {
|
|
105
172
|
key: string;
|
|
106
|
-
productId:
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
durationMinutes?: number;
|
|
114
|
-
cellType: 'availability_range' | 'fixed_interval' | 'unavailable';
|
|
115
|
-
status: ResourcePlannerStatus;
|
|
173
|
+
productId: AvailabilityId;
|
|
174
|
+
requirementGroupId?: string;
|
|
175
|
+
requirementFormId?: AvailabilityId;
|
|
176
|
+
resourceId?: AvailabilityId;
|
|
177
|
+
resourceName?: string;
|
|
178
|
+
resourceType?: AvailabilityResourceType;
|
|
179
|
+
status: AvailabilityStatus;
|
|
116
180
|
remainingCapacity?: number;
|
|
117
181
|
maxCapacity?: number;
|
|
118
182
|
reasonCodes: string[];
|
|
119
|
-
|
|
183
|
+
occupancyRefs: Array<{
|
|
184
|
+
id?: string;
|
|
185
|
+
resourceId: AvailabilityId;
|
|
186
|
+
source?: AvailabilityOccupancy['source'];
|
|
187
|
+
serverEventId?: AvailabilityId;
|
|
188
|
+
bookingUid?: AvailabilityId;
|
|
189
|
+
productUid?: AvailabilityId;
|
|
190
|
+
scheduleEventId?: AvailabilityId;
|
|
191
|
+
}>;
|
|
192
|
+
}
|
|
193
|
+
export interface AvailabilityProjection {
|
|
194
|
+
readonly meta: AvailabilityProjectionMeta;
|
|
195
|
+
readonly products: readonly AvailabilityProduct[];
|
|
196
|
+
readonly resources: readonly AvailabilityResource[];
|
|
197
|
+
readonly resourceOccupancies: readonly AvailabilityOccupancy[];
|
|
198
|
+
readonly cells: readonly AvailabilityCell[];
|
|
120
199
|
}
|
|
121
|
-
export interface
|
|
122
|
-
|
|
200
|
+
export interface ProductTimeRange extends AvailabilityDisplayRange {
|
|
201
|
+
key: string;
|
|
202
|
+
productId: AvailabilityId;
|
|
203
|
+
source: 'session_schedule' | 'duration_window';
|
|
204
|
+
/** Actual interval start used by availability evaluation, assignments, and cart booking. */
|
|
205
|
+
bookingStartAt: string;
|
|
206
|
+
/** Actual interval end kept explicitly for availability evaluation and cart compatibility. */
|
|
207
|
+
bookingEndAt: string;
|
|
208
|
+
scheduleRefs: AvailabilityScheduleRef[];
|
|
209
|
+
primaryScheduleRef?: AvailabilityScheduleRef;
|
|
210
|
+
}
|
|
211
|
+
export interface ProductTimeRangeGroup {
|
|
212
|
+
productId: AvailabilityId;
|
|
123
213
|
title?: string;
|
|
124
|
-
|
|
125
|
-
|
|
214
|
+
kind: AvailabilityProductKind;
|
|
215
|
+
slotStepMinutes?: number;
|
|
216
|
+
ranges: ProductTimeRange[];
|
|
217
|
+
}
|
|
218
|
+
export interface AvailabilityAssignment extends AvailabilityAbsoluteRange {
|
|
219
|
+
productId: AvailabilityId;
|
|
220
|
+
resourceId: AvailabilityId;
|
|
221
|
+
formId?: AvailabilityId;
|
|
222
|
+
capacityRequired?: number;
|
|
223
|
+
scheduleId?: AvailabilityId;
|
|
224
|
+
timeSlotId?: AvailabilityId;
|
|
126
225
|
}
|
|
127
|
-
export interface
|
|
128
|
-
|
|
226
|
+
export interface AvailabilityRequirementSelection {
|
|
227
|
+
requirementGroupId?: string;
|
|
228
|
+
formId?: AvailabilityId;
|
|
229
|
+
resourceIds: AvailabilityId[];
|
|
230
|
+
}
|
|
231
|
+
export interface GetProductTimeRangesRequest {
|
|
232
|
+
productIds?: AvailabilityId[];
|
|
233
|
+
dateRange?: Partial<AvailabilityDateRange>;
|
|
234
|
+
resourceIds?: AvailabilityId[];
|
|
235
|
+
partySize?: number;
|
|
236
|
+
durationMinutesByProductId?: Record<string, number>;
|
|
237
|
+
durationStartTimesByProductId?: Record<string, string[]>;
|
|
238
|
+
/**
|
|
239
|
+
* POS 手工输入时间的兼容开关:只为明确请求的 start time 补候选,
|
|
240
|
+
* 不改变常规候选列表仍按营业时间生成的规则。
|
|
241
|
+
*/
|
|
242
|
+
allowOutsideOperatingHoursForRequestedStartTimes?: boolean;
|
|
243
|
+
}
|
|
244
|
+
export interface GetProductTimeRangesRuntimeOptions {
|
|
245
|
+
evaluatedAt?: string;
|
|
246
|
+
}
|
|
247
|
+
export interface QueryAvailabilityBaseRequest {
|
|
248
|
+
productIds?: AvailabilityId[];
|
|
249
|
+
resourceIds?: AvailabilityId[];
|
|
250
|
+
partySize?: number;
|
|
251
|
+
}
|
|
252
|
+
export interface ProductAvailabilityQuery extends QueryAvailabilityBaseRequest {
|
|
253
|
+
target: 'product';
|
|
254
|
+
dateRange?: Partial<AvailabilityDateRange>;
|
|
255
|
+
}
|
|
256
|
+
export interface DateAvailabilityQuery extends QueryAvailabilityBaseRequest {
|
|
257
|
+
target: 'date';
|
|
258
|
+
dateRange?: Partial<AvailabilityDateRange>;
|
|
259
|
+
}
|
|
260
|
+
export interface TimeAvailabilityQuery extends QueryAvailabilityBaseRequest {
|
|
261
|
+
target: 'time';
|
|
262
|
+
candidates: ProductTimeRange[];
|
|
263
|
+
}
|
|
264
|
+
export interface ResourceAvailabilityQuery extends QueryAvailabilityBaseRequest {
|
|
265
|
+
target: 'resource';
|
|
266
|
+
selectedRanges: ProductTimeRange[];
|
|
267
|
+
}
|
|
268
|
+
export type AvailabilityQuery = ProductAvailabilityQuery | DateAvailabilityQuery | TimeAvailabilityQuery | ResourceAvailabilityQuery;
|
|
269
|
+
export interface AvailabilityResourceOption {
|
|
270
|
+
resourceId: AvailabilityId;
|
|
129
271
|
resourceName?: string;
|
|
130
|
-
resourceFormId?:
|
|
131
|
-
|
|
132
|
-
|
|
272
|
+
resourceFormId?: AvailabilityId;
|
|
273
|
+
policyId?: AvailabilityId;
|
|
274
|
+
resourceType: AvailabilityResourceType;
|
|
275
|
+
status: AvailabilityStatus;
|
|
276
|
+
remainingCapacity?: number;
|
|
277
|
+
maxCapacity?: number;
|
|
278
|
+
maxPartySize: number;
|
|
279
|
+
reasonCodes: string[];
|
|
280
|
+
}
|
|
281
|
+
export interface AvailabilityRequirementGroupResult {
|
|
282
|
+
groupId: string;
|
|
283
|
+
formId?: AvailabilityId;
|
|
284
|
+
title?: string;
|
|
285
|
+
code?: string;
|
|
286
|
+
resourceType: AvailabilityResourceType;
|
|
287
|
+
required: boolean;
|
|
288
|
+
min: number;
|
|
289
|
+
max: number;
|
|
290
|
+
status: AvailabilityStatus;
|
|
291
|
+
availableResourceCount: number;
|
|
292
|
+
totalResourceCount: number;
|
|
293
|
+
maxPartySize: number;
|
|
133
294
|
remainingCapacity?: number;
|
|
134
295
|
maxCapacity?: number;
|
|
135
296
|
reasonCodes: string[];
|
|
297
|
+
options: AvailabilityResourceOption[];
|
|
298
|
+
}
|
|
299
|
+
export interface TimeAvailabilityItem extends ProductTimeRange {
|
|
300
|
+
status: AvailabilityStatus;
|
|
301
|
+
maxPartySize: number;
|
|
302
|
+
reasonCodes: string[];
|
|
303
|
+
requirementGroups: AvailabilityRequirementGroupResult[];
|
|
136
304
|
}
|
|
137
|
-
export interface
|
|
305
|
+
export interface ProductAvailabilityItem {
|
|
306
|
+
productId: AvailabilityId;
|
|
307
|
+
title?: string;
|
|
308
|
+
status: AvailabilityStatus;
|
|
309
|
+
reasonCodes: string[];
|
|
310
|
+
availableDateCount: number;
|
|
311
|
+
totalDateCount: number;
|
|
312
|
+
availableTimeCount: number;
|
|
313
|
+
totalTimeCount: number;
|
|
314
|
+
maxPartySize: number;
|
|
315
|
+
}
|
|
316
|
+
export interface DateAvailabilityItem {
|
|
138
317
|
date: string;
|
|
139
|
-
status:
|
|
318
|
+
status: AvailabilityStatus;
|
|
140
319
|
availableCount: number;
|
|
141
320
|
totalCount: number;
|
|
321
|
+
maxPartySize: number;
|
|
322
|
+
remainingCapacity: number;
|
|
323
|
+
maxCapacity: number;
|
|
324
|
+
reasonCodes: string[];
|
|
142
325
|
}
|
|
143
|
-
export interface
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
326
|
+
export interface ProductAvailabilityGroup {
|
|
327
|
+
productId: AvailabilityId;
|
|
328
|
+
title?: string;
|
|
329
|
+
item: ProductAvailabilityItem;
|
|
330
|
+
}
|
|
331
|
+
export interface DateAvailabilityGroup {
|
|
332
|
+
productId: AvailabilityId;
|
|
333
|
+
title?: string;
|
|
334
|
+
dates: DateAvailabilityItem[];
|
|
335
|
+
}
|
|
336
|
+
export interface TimeAvailabilityGroup {
|
|
337
|
+
productId: AvailabilityId;
|
|
338
|
+
title?: string;
|
|
339
|
+
times: TimeAvailabilityItem[];
|
|
340
|
+
}
|
|
341
|
+
export interface ResourceAvailabilityRangeGroup {
|
|
342
|
+
range: ProductTimeRange;
|
|
343
|
+
status: AvailabilityStatus;
|
|
344
|
+
maxPartySize: number;
|
|
151
345
|
reasonCodes: string[];
|
|
346
|
+
requirementGroups: AvailabilityRequirementGroupResult[];
|
|
152
347
|
}
|
|
153
|
-
export interface
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
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;
|
|
348
|
+
export interface ResourceAvailabilityGroup {
|
|
349
|
+
productId: AvailabilityId;
|
|
350
|
+
title?: string;
|
|
351
|
+
ranges: ResourceAvailabilityRangeGroup[];
|
|
352
|
+
}
|
|
353
|
+
export interface AvailabilityQueryResultBase<TTarget extends AvailabilityQuery['target'], TData> {
|
|
354
|
+
target: TTarget;
|
|
355
|
+
evaluatedAt: string;
|
|
356
|
+
snapshotId: string;
|
|
357
|
+
data: TData;
|
|
179
358
|
}
|
|
180
|
-
export
|
|
181
|
-
|
|
359
|
+
export type ProductAvailabilityQueryResult = AvailabilityQueryResultBase<'product', ProductAvailabilityGroup[]>;
|
|
360
|
+
export type DateAvailabilityQueryResult = AvailabilityQueryResultBase<'date', DateAvailabilityGroup[]>;
|
|
361
|
+
export type TimeAvailabilityQueryResult = AvailabilityQueryResultBase<'time', TimeAvailabilityGroup[]>;
|
|
362
|
+
export type ResourceAvailabilityQueryResult = AvailabilityQueryResultBase<'resource', ResourceAvailabilityGroup[]>;
|
|
363
|
+
export type AvailabilityQueryResult = ProductAvailabilityQueryResult | DateAvailabilityQueryResult | TimeAvailabilityQueryResult | ResourceAvailabilityQueryResult;
|
|
364
|
+
export interface AvailabilityValidationConflict {
|
|
365
|
+
code: string;
|
|
366
|
+
message: string;
|
|
367
|
+
reasonCodes?: string[];
|
|
368
|
+
productId?: AvailabilityId;
|
|
369
|
+
requirementGroupId?: string;
|
|
370
|
+
formId?: AvailabilityId;
|
|
371
|
+
resourceId?: AvailabilityId;
|
|
182
372
|
resourceName?: string;
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
373
|
+
candidateKey?: string;
|
|
374
|
+
requestedQuantity?: number;
|
|
375
|
+
availableQuantity?: number;
|
|
186
376
|
remainingCapacity?: number;
|
|
187
|
-
|
|
377
|
+
capacityPerBooking?: number;
|
|
188
378
|
}
|
|
189
|
-
export interface
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
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 {
|
|
379
|
+
export interface AvailabilitySelectionValidationParams {
|
|
380
|
+
candidate: ProductTimeRange;
|
|
381
|
+
partySize?: number;
|
|
382
|
+
bookingCount?: number;
|
|
383
|
+
requirementSelections: AvailabilityRequirementSelection[];
|
|
384
|
+
}
|
|
385
|
+
export interface AvailabilitySelectionValidationResult {
|
|
213
386
|
ok: boolean;
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
}
|
|
222
|
-
export
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
version: number;
|
|
387
|
+
status: AvailabilityStatus;
|
|
388
|
+
assignments: AvailabilityAssignment[];
|
|
389
|
+
conflicts: AvailabilityValidationConflict[];
|
|
390
|
+
availability: TimeAvailabilityItem;
|
|
391
|
+
}
|
|
392
|
+
export interface AvailabilityErrorDetails {
|
|
393
|
+
[key: string]: any;
|
|
394
|
+
}
|
|
395
|
+
export declare class AvailabilityError extends Error {
|
|
396
|
+
code: AvailabilityErrorCode;
|
|
397
|
+
details?: AvailabilityErrorDetails;
|
|
398
|
+
constructor(code: AvailabilityErrorCode, message: string, details?: AvailabilityErrorDetails);
|
|
227
399
|
}
|
|
@@ -2,4 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
|
-
});
|
|
5
|
+
});
|
|
6
|
+
exports.AvailabilityError = void 0;
|
|
7
|
+
class AvailabilityError extends Error {
|
|
8
|
+
code;
|
|
9
|
+
details;
|
|
10
|
+
constructor(code, message, details) {
|
|
11
|
+
super(message);
|
|
12
|
+
this.name = 'AvailabilityError';
|
|
13
|
+
this.code = code;
|
|
14
|
+
this.details = details;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.AvailabilityError = AvailabilityError;
|
package/lib/plugins/request.d.ts
CHANGED
package/lib/server/index.d.ts
CHANGED
|
@@ -51,6 +51,8 @@ declare class Server {
|
|
|
51
51
|
private productQueryScheduleTimers;
|
|
52
52
|
/** 餐牌筛选为空时才触发的菜单/日程缓存自愈,避免每次商品查询都请求远端。 */
|
|
53
53
|
private menuScheduleRefreshInFlight;
|
|
54
|
+
/** 启动阶段模块预加载任务;预渲染商品查询复用该任务,避免缓存尚未 ready 时误触发远端自愈。 */
|
|
55
|
+
private startupModulePreloadInFlight;
|
|
54
56
|
private lastMenuScheduleRefreshAt;
|
|
55
57
|
private readonly MENU_SCHEDULE_REFRESH_COOLDOWN_MS;
|
|
56
58
|
private orderQuerySubscribers;
|
|
@@ -126,6 +128,9 @@ declare class Server {
|
|
|
126
128
|
private runCheckoutSync;
|
|
127
129
|
private omitCheckoutSyncMode;
|
|
128
130
|
private buildRemoteCheckoutData;
|
|
131
|
+
private buildCheckoutDeviceHeaders;
|
|
132
|
+
private applyKioskCheckoutOperator;
|
|
133
|
+
private resolveKioskCheckoutOperatorId;
|
|
129
134
|
private mergeCheckoutSyncPayments;
|
|
130
135
|
private persistSyncedCheckoutOrder;
|
|
131
136
|
/**
|
|
@@ -157,13 +162,17 @@ declare class Server {
|
|
|
157
162
|
* 重新拉取全量 SSE 接口,更新本地数据后触发 onProductsSyncCompleted
|
|
158
163
|
* 不影响当前界面展示,适用于切回前台、定时刷新等场景
|
|
159
164
|
*/
|
|
160
|
-
refreshProductsInBackground(
|
|
165
|
+
refreshProductsInBackground(options?: {
|
|
166
|
+
trigger?: string;
|
|
167
|
+
}): Promise<void>;
|
|
161
168
|
/**
|
|
162
169
|
* 后台静默刷新订单数据
|
|
163
170
|
* 重新拉取全量 SSE 接口,更新本地数据后触发 onOrdersSyncCompleted
|
|
164
171
|
* 不影响当前界面展示,适用于切回前台、定时刷新等场景
|
|
165
172
|
*/
|
|
166
|
-
refreshOrdersInBackground(
|
|
173
|
+
refreshOrdersInBackground(options?: {
|
|
174
|
+
trigger?: string;
|
|
175
|
+
}): Promise<void>;
|
|
167
176
|
/**
|
|
168
177
|
* 编辑正式订单时强制查询 Server 最新快照并覆盖本地缓存。
|
|
169
178
|
* 商品成员增删由 OrderModule 在 SQLite/Store 更新完成后广播,
|
|
@@ -511,6 +520,12 @@ declare class Server {
|
|
|
511
520
|
private stringifyCheckoutResourceIdentifier;
|
|
512
521
|
private normalizeCheckoutSubmitData;
|
|
513
522
|
private ensureCheckoutOrderNumbers;
|
|
523
|
+
/**
|
|
524
|
+
* Notes 允许在本地草稿阶段暂存空订单目标;checkout 的统一出口负责用最终
|
|
525
|
+
* shop_order_number 完成绑定并校验,保证后端请求、pending、设备任务和打印
|
|
526
|
+
* 都使用同一份完整快照。
|
|
527
|
+
*/
|
|
528
|
+
private finalizeCheckoutSalesNotes;
|
|
514
529
|
private dispatchCheckoutSyncTask;
|
|
515
530
|
private dispatchPrintOtherReceiptTask;
|
|
516
531
|
private buildPrintOtherReceiptIdempotencyKey;
|