@venulog/phasing-engine-schemas 0.4.3 → 0.5.0-alpha.1

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.
@@ -1,139 +0,0 @@
1
- import { z } from './zod.js';
2
- export declare const getAvailableSlotsBodySchema: z.ZodObject<{
3
- event_id: z.ZodNumber;
4
- year: z.ZodNumber;
5
- month: z.ZodNumber;
6
- company_role: z.ZodString;
7
- schedule_type: z.ZodOptional<z.ZodEnum<{
8
- assembly: "assembly";
9
- dismantling: "dismantling";
10
- }>>;
11
- }, z.core.$strip>;
12
- export declare const availableTimeSlotSchema: z.ZodObject<{
13
- phase_slot_schedule_id: z.ZodNumber;
14
- date: z.ZodString;
15
- start_time: z.ZodString;
16
- end_time: z.ZodString;
17
- duration: z.ZodNumber;
18
- schedule_type: z.ZodEnum<{
19
- assembly: "assembly";
20
- dismantling: "dismantling";
21
- }>;
22
- max_capacity: z.ZodNumber;
23
- current_bookings: z.ZodNumber;
24
- confirmed_bookings: z.ZodNumber;
25
- available_capacity: z.ZodNumber;
26
- is_available: z.ZodBoolean;
27
- }, z.core.$strip>;
28
- export declare const availableSlotsResponseSchema: z.ZodObject<{
29
- event_id: z.ZodNumber;
30
- event_code: z.ZodString;
31
- event_name: z.ZodString;
32
- company_role: z.ZodString;
33
- year: z.ZodNumber;
34
- month: z.ZodNumber;
35
- available_slots: z.ZodArray<z.ZodObject<{
36
- phase_slot_schedule_id: z.ZodNumber;
37
- date: z.ZodString;
38
- start_time: z.ZodString;
39
- end_time: z.ZodString;
40
- duration: z.ZodNumber;
41
- schedule_type: z.ZodEnum<{
42
- assembly: "assembly";
43
- dismantling: "dismantling";
44
- }>;
45
- max_capacity: z.ZodNumber;
46
- current_bookings: z.ZodNumber;
47
- confirmed_bookings: z.ZodNumber;
48
- available_capacity: z.ZodNumber;
49
- is_available: z.ZodBoolean;
50
- }, z.core.$strip>>;
51
- total_slots: z.ZodNumber;
52
- }, z.core.$strip>;
53
- export declare const getPhaseSlotsByEventIdParamsSchema: z.ZodObject<{
54
- eventId: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
55
- }, z.core.$strip>;
56
- export declare const phaseSlotItemSchema: z.ZodObject<{
57
- id: z.ZodNumber;
58
- event_id: z.ZodNumber;
59
- name: z.ZodString;
60
- geometry: z.ZodNullable<z.ZodObject<{
61
- type: z.ZodEnum<{
62
- Polygon: "Polygon";
63
- MultiPolygon: "MultiPolygon";
64
- Point: "Point";
65
- LineString: "LineString";
66
- MultiLineString: "MultiLineString";
67
- MultiPoint: "MultiPoint";
68
- }>;
69
- coordinates: z.ZodArray<z.ZodUnknown>;
70
- crs: z.ZodOptional<z.ZodObject<{
71
- type: z.ZodLiteral<"name">;
72
- properties: z.ZodObject<{
73
- name: z.ZodString;
74
- }, z.core.$strip>;
75
- }, z.core.$strip>>;
76
- }, z.core.$strip>>;
77
- site_plan_image_url: z.ZodNullable<z.ZodString>;
78
- surface_area_sqm: z.ZodNullable<z.ZodNumber>;
79
- is_active: z.ZodBoolean;
80
- created_at: z.ZodString;
81
- updated_at: z.ZodString;
82
- created_by: z.ZodNullable<z.ZodString>;
83
- updated_by: z.ZodNullable<z.ZodString>;
84
- }, z.core.$strip>;
85
- export declare const getPhaseSlotsResponseSchema: z.ZodObject<{
86
- event_id: z.ZodNumber;
87
- slots: z.ZodArray<z.ZodObject<{
88
- id: z.ZodNumber;
89
- event_id: z.ZodNumber;
90
- name: z.ZodString;
91
- geometry: z.ZodNullable<z.ZodObject<{
92
- type: z.ZodEnum<{
93
- Polygon: "Polygon";
94
- MultiPolygon: "MultiPolygon";
95
- Point: "Point";
96
- LineString: "LineString";
97
- MultiLineString: "MultiLineString";
98
- MultiPoint: "MultiPoint";
99
- }>;
100
- coordinates: z.ZodArray<z.ZodUnknown>;
101
- crs: z.ZodOptional<z.ZodObject<{
102
- type: z.ZodLiteral<"name">;
103
- properties: z.ZodObject<{
104
- name: z.ZodString;
105
- }, z.core.$strip>;
106
- }, z.core.$strip>>;
107
- }, z.core.$strip>>;
108
- site_plan_image_url: z.ZodNullable<z.ZodString>;
109
- surface_area_sqm: z.ZodNullable<z.ZodNumber>;
110
- is_active: z.ZodBoolean;
111
- created_at: z.ZodString;
112
- updated_at: z.ZodString;
113
- created_by: z.ZodNullable<z.ZodString>;
114
- updated_by: z.ZodNullable<z.ZodString>;
115
- }, z.core.$strip>>;
116
- total_count: z.ZodNumber;
117
- }, z.core.$strip>;
118
- export declare const getCompanyRolesByEventIdParamsSchema: z.ZodObject<{
119
- eventId: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
120
- scheduleType: z.ZodEnum<{
121
- assembly: "assembly";
122
- dismantling: "dismantling";
123
- }>;
124
- }, z.core.$strip>;
125
- export declare const getCompanyRolesByEventIdResponseSchema: z.ZodObject<{
126
- event_id: z.ZodNumber;
127
- company_roles: z.ZodArray<z.ZodString>;
128
- total_count: z.ZodNumber;
129
- }, z.core.$strip>;
130
- export type GetAvailableSlotsBody = z.infer<typeof getAvailableSlotsBodySchema>;
131
- export type AvailableTimeSlot = z.infer<typeof availableTimeSlotSchema>;
132
- export type AvailableSlotsResponse = z.infer<typeof availableSlotsResponseSchema>;
133
- export type GetPhaseSlotsByEventIdParams = z.infer<typeof getPhaseSlotsByEventIdParamsSchema>;
134
- export type PhaseSlotItem = z.infer<typeof phaseSlotItemSchema>;
135
- export type GetPhaseSlotsResponse = z.infer<typeof getPhaseSlotsResponseSchema>;
136
- export type GetCompanyRolesByEventIdParams = z.infer<typeof getCompanyRolesByEventIdParamsSchema>;
137
- export type GetCompanyRolesByEventIdResponse = z.infer<typeof getCompanyRolesByEventIdResponseSchema>;
138
- export { pointSchema, polygonCoordinatesSchema, rectangleGeometrySchema, geoJsonPolygonSchema, parkingAreaItemSchema, parkingAreaWithSchedulesSchema, getParkingAreasByEventIdParamsSchema, getParkingAreaByIdParamsSchema, createParkingAreaBodySchema, createParkingAreaDataSchema, createParkingAreaResponseSchema, bulkCreateParkingAreasBodySchema, bulkCreateParkingAreasDataSchema, bulkCreateParkingAreasResponseSchema, updateParkingAreaParamsSchema, updateParkingAreaBodySchema, updateParkingAreaDataSchema, updateParkingAreaResponseSchema, deleteParkingAreaParamsSchema, deleteParkingAreaDataSchema, deleteParkingAreaResponseSchema, getParkingAreasDataSchema, getParkingAreasResponseSchema, getParkingAreaDetailResponseSchema, parkingAreaScheduleSchema, upsertParkingAreaScheduleItemSchema, deleteParkingAreaScheduleItemSchema, upsertParkingAreaSchedulesBodySchema, upsertParkingAreaSchedulesDataSchema, upsertParkingAreaSchedulesResponseSchema, uploadSitePlanImageParamsSchema, uploadSitePlanImageDataSchema, uploadSitePlanImageResponseSchema, getAvailableParkingAreaSlotsQuerySchema, availableParkingAreaTimeSlotSchema, availableParkingAreaSlotsResponseSchema } from './parkingArea.js';
139
- export type { Point, PolygonCoordinates, RectangleGeometry, GeoJsonPolygon, ParkingAreaItem, ParkingAreaWithSchedules, GetParkingAreasByEventIdParams, GetParkingAreaByIdParams, CreateParkingAreaBody, CreateParkingAreaData, CreateParkingAreaResponse, BulkCreateParkingAreasBody, BulkCreateParkingAreasData, BulkCreateParkingAreasResponse, UpdateParkingAreaParams, UpdateParkingAreaBody, UpdateParkingAreaData, UpdateParkingAreaResponse, DeleteParkingAreaParams, DeleteParkingAreaData, DeleteParkingAreaResponse, GetParkingAreasData, GetParkingAreasResponse, GetParkingAreaDetailResponse, ParkingAreaSchedule, UpsertParkingAreaScheduleItem, DeleteParkingAreaScheduleItem, UpsertParkingAreaSchedulesBody, UpsertParkingAreaSchedulesData, UpsertParkingAreaSchedulesResponse, UploadSitePlanImageParams, UploadSitePlanImageData, UploadSitePlanImageResponse, GetAvailableParkingAreaSlotsQuery, AvailableParkingAreaTimeSlot, AvailableParkingAreaSlotsResponse } from './parkingArea.js';
package/dist/phaseSlot.js DELETED
@@ -1,276 +0,0 @@
1
- // packages/phasing-schemas/src/phaseSlot.ts
2
- import { z } from './zod.js';
3
- // ------------------------------
4
- // Query parameters schema
5
- // ------------------------------
6
- export const getAvailableSlotsBodySchema = z
7
- .object({
8
- event_id: z.number().positive().openapi({
9
- description: 'The ID of the event',
10
- example: 1
11
- }),
12
- year: z.number().min(2024).openapi({
13
- description: 'Year for filtering slots (YYYY). Slots before today will be excluded.',
14
- example: 2026
15
- }),
16
- month: z.number().min(1).max(12).openapi({
17
- description: 'Month for filtering slots (1-12). Slots before today will be excluded.',
18
- example: 6
19
- }),
20
- company_role: z.string().min(1, 'Company role is required').openapi({
21
- description: 'Company role to filter schedules by',
22
- example: 'exhibitor'
23
- }),
24
- schedule_type: z.enum(['assembly', 'dismantling']).optional().openapi({
25
- description: 'Filter by schedule type',
26
- example: 'assembly'
27
- })
28
- })
29
- .openapi('GetAvailableSlotsBody');
30
- // ------------------------------
31
- // Response schemas
32
- // ------------------------------
33
- export const availableTimeSlotSchema = z
34
- .object({
35
- phase_slot_schedule_id: z.number().openapi({
36
- description: 'Phase slot schedule ID',
37
- example: 1
38
- }),
39
- date: z.string().openapi({
40
- description: 'Date of the time slot (YYYY-MM-DD)',
41
- example: '2026-06-15'
42
- }),
43
- start_time: z.string().openapi({
44
- description: 'Start time of the slot (HH:MM)',
45
- example: '08:00'
46
- }),
47
- end_time: z.string().openapi({
48
- description: 'End time of the slot (HH:MM)',
49
- example: '08:30'
50
- }),
51
- duration: z.number().openapi({
52
- description: 'Duration in minutes',
53
- example: 30
54
- }),
55
- schedule_type: z.enum(['assembly', 'dismantling']).openapi({
56
- description: 'Type of schedule',
57
- example: 'assembly'
58
- }),
59
- max_capacity: z.number().openapi({
60
- description: 'Maximum booking capacity for this slot',
61
- example: 5
62
- }),
63
- current_bookings: z.number().openapi({
64
- description: 'Number of current bookings',
65
- example: 3
66
- }),
67
- confirmed_bookings: z.number().openapi({
68
- description: 'Number of confirmed bookings',
69
- example: 1
70
- }),
71
- available_capacity: z.number().openapi({
72
- description: 'Remaining available capacity',
73
- example: 2
74
- }),
75
- is_available: z.boolean().openapi({
76
- description: 'Whether the slot is available for booking',
77
- example: true
78
- })
79
- })
80
- .openapi('AvailableTimeSlot');
81
- export const availableSlotsResponseSchema = z
82
- .object({
83
- event_id: z.number().openapi({
84
- description: 'ID of the event',
85
- example: 1
86
- }),
87
- event_code: z.string().openapi({
88
- description: 'Code of the event',
89
- example: 'COEC2025'
90
- }),
91
- event_name: z.string().openapi({
92
- description: 'Name of the event',
93
- example: 'COEC 2025'
94
- }),
95
- company_role: z.string().openapi({
96
- description: 'Company role that was used for filtering (returned for reference)',
97
- example: 'exhibitor'
98
- }),
99
- year: z.number().openapi({
100
- description: 'Year of the slots',
101
- example: 2026
102
- }),
103
- month: z.number().openapi({
104
- description: 'Month of the slots',
105
- example: 6
106
- }),
107
- available_slots: z.array(availableTimeSlotSchema).openapi({
108
- description: 'List of available time slots with capacity information'
109
- }),
110
- total_slots: z.number().openapi({
111
- description: 'Total number of time slots in the period',
112
- example: 48
113
- })
114
- })
115
- .openapi('AvailableSlotsResponse');
116
- // ------------------------------
117
- // Get Phase Slots by Event ID
118
- // ------------------------------
119
- export const getPhaseSlotsByEventIdParamsSchema = z
120
- .object({
121
- eventId: z
122
- .string()
123
- .min(1)
124
- .transform(val => parseInt(val, 10))
125
- .refine(val => !isNaN(val) && val > 0, {
126
- message: 'Event ID must be a positive number'
127
- })
128
- .openapi({
129
- description: 'The ID of the event',
130
- example: '1'
131
- })
132
- })
133
- .openapi('GetPhaseSlotsByEventIdParams');
134
- export const phaseSlotItemSchema = z
135
- .object({
136
- id: z.number().openapi({
137
- description: 'Phase slot ID',
138
- example: 1
139
- }),
140
- event_id: z.number().openapi({
141
- description: 'Event ID',
142
- example: 1
143
- }),
144
- name: z.string().openapi({
145
- description: 'Name of the parking area',
146
- example: 'Zone A - Loading Dock'
147
- }),
148
- geometry: z
149
- .object({
150
- type: z.enum([
151
- 'Polygon',
152
- 'MultiPolygon',
153
- 'Point',
154
- 'LineString',
155
- 'MultiLineString',
156
- 'MultiPoint'
157
- ]),
158
- coordinates: z.array(z.unknown()),
159
- crs: z
160
- .object({
161
- type: z.literal('name'),
162
- properties: z.object({
163
- name: z.string()
164
- })
165
- })
166
- .optional()
167
- })
168
- .nullable()
169
- .openapi({
170
- description: 'PostGIS polygon geometry representing the parking area boundary (GeoJSON format)',
171
- example: {
172
- type: 'Polygon',
173
- coordinates: [
174
- [
175
- [2.3522, 48.8566],
176
- [2.3532, 48.8566],
177
- [2.3532, 48.8576],
178
- [2.3522, 48.8576],
179
- [2.3522, 48.8566]
180
- ]
181
- ]
182
- }
183
- }),
184
- site_plan_image_url: z.string().nullable().openapi({
185
- description: 'URL to the site plan image',
186
- example: 'https://storage.example.com/plans/zone-a.jpg'
187
- }),
188
- surface_area_sqm: z.number().nullable().openapi({
189
- description: 'Surface area in square meters',
190
- example: 150.5
191
- }),
192
- is_active: z.boolean().openapi({
193
- description: 'Whether the slot is active',
194
- example: true
195
- }),
196
- created_at: z.string().openapi({
197
- description: 'Creation timestamp',
198
- example: '2025-12-16T10:30:00Z'
199
- }),
200
- updated_at: z.string().openapi({
201
- description: 'Last update timestamp',
202
- example: '2025-12-16T10:30:00Z'
203
- }),
204
- created_by: z.string().nullable().openapi({
205
- description: 'User ID who created the slot',
206
- example: 'user-uuid-123'
207
- }),
208
- updated_by: z.string().nullable().openapi({
209
- description: 'User ID who last updated the slot',
210
- example: 'user-uuid-123'
211
- })
212
- })
213
- .openapi('PhaseSlotItem');
214
- export const getPhaseSlotsResponseSchema = z
215
- .object({
216
- event_id: z.number().openapi({
217
- description: 'ID of the event',
218
- example: 1
219
- }),
220
- slots: z.array(phaseSlotItemSchema).openapi({
221
- description: 'List of phase slots for the event'
222
- }),
223
- total_count: z.number().openapi({
224
- description: 'Total number of phase slots',
225
- example: 10
226
- })
227
- })
228
- .openapi('GetPhaseSlotsResponse');
229
- export const getCompanyRolesByEventIdParamsSchema = z
230
- .object({
231
- eventId: z
232
- .string()
233
- .min(1, 'Event ID is required')
234
- .transform(val => parseInt(val, 10))
235
- .refine(val => !isNaN(val) && val > 0, { message: 'Event ID must be positive' })
236
- .openapi({
237
- description: 'The ID of the event to get company roles for',
238
- example: '1'
239
- }),
240
- scheduleType: z.enum(['assembly', 'dismantling']).openapi({
241
- description: 'Type of schedule',
242
- example: 'assembly'
243
- })
244
- })
245
- .openapi('GetCompanyRolesByEventIdParams');
246
- export const getCompanyRolesByEventIdResponseSchema = z
247
- .object({
248
- event_id: z.number().openapi({
249
- description: 'ID of the event',
250
- example: 1
251
- }),
252
- company_roles: z.array(z.string()).openapi({
253
- description: 'List of unique company roles for the event',
254
- example: ['exhibitor', 'organizer', 'contractor']
255
- }),
256
- total_count: z.number().openapi({
257
- description: 'Total number of unique company roles',
258
- example: 3
259
- })
260
- })
261
- .openapi('GetCompanyRolesByEventIdResponse');
262
- // ======================================================================
263
- // RE-EXPORTS FROM parkingArea.ts
264
- // These provide convenient access to parking area schemas from this module
265
- // ======================================================================
266
- export {
267
- // Geometry schemas
268
- pointSchema, polygonCoordinatesSchema, rectangleGeometrySchema, geoJsonPolygonSchema,
269
- // Parking area schemas
270
- parkingAreaItemSchema, parkingAreaWithSchedulesSchema, getParkingAreasByEventIdParamsSchema, getParkingAreaByIdParamsSchema, createParkingAreaBodySchema, createParkingAreaDataSchema, createParkingAreaResponseSchema, bulkCreateParkingAreasBodySchema, bulkCreateParkingAreasDataSchema, bulkCreateParkingAreasResponseSchema, updateParkingAreaParamsSchema, updateParkingAreaBodySchema, updateParkingAreaDataSchema, updateParkingAreaResponseSchema, deleteParkingAreaParamsSchema, deleteParkingAreaDataSchema, deleteParkingAreaResponseSchema, getParkingAreasDataSchema, getParkingAreasResponseSchema, getParkingAreaDetailResponseSchema,
271
- // Parking area schedule schemas
272
- parkingAreaScheduleSchema, upsertParkingAreaScheduleItemSchema, deleteParkingAreaScheduleItemSchema, upsertParkingAreaSchedulesBodySchema, upsertParkingAreaSchedulesDataSchema, upsertParkingAreaSchedulesResponseSchema,
273
- // Site plan image upload
274
- uploadSitePlanImageParamsSchema, uploadSitePlanImageDataSchema, uploadSitePlanImageResponseSchema,
275
- // Available slots (parking area version)
276
- getAvailableParkingAreaSlotsQuerySchema, availableParkingAreaTimeSlotSchema, availableParkingAreaSlotsResponseSchema } from './parkingArea.js';