@servemate/dto 1.0.5 → 1.0.7
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/README.md +103 -6
- package/dist/dto/enums.d.ts +8 -0
- package/dist/dto/enums.d.ts.map +1 -1
- package/dist/dto/enums.js +8 -1
- package/dist/dto/enums.js.map +1 -1
- package/dist/dto/global.d.ts +4 -0
- package/dist/dto/global.d.ts.map +1 -1
- package/dist/dto/global.js.map +1 -1
- package/dist/dto/index.d.ts +1 -0
- package/dist/dto/index.d.ts.map +1 -1
- package/dist/dto/index.js +1 -0
- package/dist/dto/index.js.map +1 -1
- package/dist/dto/orders.dto.d.ts +73 -73
- package/dist/dto/payment.dto.d.ts +6 -6
- package/dist/dto/reservation.dto.d.ts +1042 -0
- package/dist/dto/reservation.dto.d.ts.map +1 -0
- package/dist/dto/reservation.dto.js +211 -0
- package/dist/dto/reservation.dto.js.map +1 -0
- package/dist/dto/tables.dto.d.ts +46 -5
- package/dist/dto/tables.dto.d.ts.map +1 -1
- package/dist/dto/tables.dto.js +21 -5
- package/dist/dto/tables.dto.js.map +1 -1
- package/dist/dto/user.dto.d.ts +8 -8
- package/package.json +1 -1
|
@@ -0,0 +1,1042 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Schema for validating reservation data using Zod.
|
|
4
|
+
*
|
|
5
|
+
* Properties:
|
|
6
|
+
* - `id`: A positive integer representing the reservation ID.
|
|
7
|
+
* - `guestsCount`: A positive integer representing the number of guests.
|
|
8
|
+
* - `time`: A union of string (transformed to Date) or Date representing the reservation time.
|
|
9
|
+
* - `name`: A string representing the name of the person making the reservation.
|
|
10
|
+
* - `email`: An optional nullable string representing the email of the person making the reservation.
|
|
11
|
+
* - `phone`: A string representing the phone number of the person making the reservation.
|
|
12
|
+
* - `status`: A string transformed to uppercase and validated against the `ReservationStatus` enum, defaulting to `PENDING`.
|
|
13
|
+
* - `allergies`: A union of an array of strings (transformed to uppercase) or a comma-separated string (transformed to an array of uppercase strings), validated against the `Allergies` enum.
|
|
14
|
+
* - `tables`: A union of an array of table IDs or a comma-separated string of table IDs, defaulting to an empty array.
|
|
15
|
+
* - `comments`: An optional nullable string for additional comments.
|
|
16
|
+
* - `createdAt`: A date representing when the reservation was created, defaulting to the current date.
|
|
17
|
+
* - `updatedAt`: A date representing when the reservation was last updated.
|
|
18
|
+
* - `isActive`: A union of boolean or string (transformed to boolean), defaulting to `true`.
|
|
19
|
+
*/
|
|
20
|
+
export declare const ReservationSchema: z.ZodObject<{
|
|
21
|
+
id: z.ZodNumber;
|
|
22
|
+
guestsCount: z.ZodNumber;
|
|
23
|
+
time: z.ZodUnion<[z.ZodEffects<z.ZodString, Date, string>, z.ZodDate]>;
|
|
24
|
+
name: z.ZodString;
|
|
25
|
+
email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
26
|
+
phone: z.ZodString;
|
|
27
|
+
status: z.ZodDefault<z.ZodPipeline<z.ZodEffects<z.ZodString, string, string>, z.ZodNativeEnum<{
|
|
28
|
+
readonly PENDING: "PENDING";
|
|
29
|
+
readonly CONFIRMED: "CONFIRMED";
|
|
30
|
+
readonly CANCELLED: "CANCELLED";
|
|
31
|
+
readonly COMPLETED: "COMPLETED";
|
|
32
|
+
readonly NO_SHOW: "NO_SHOW";
|
|
33
|
+
}>>>;
|
|
34
|
+
allergies: z.ZodPipeline<z.ZodUnion<[z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], string[]>, z.ZodEffects<z.ZodString, string[], string>]>, z.ZodArray<z.ZodNativeEnum<{
|
|
35
|
+
readonly NONE: "NONE";
|
|
36
|
+
readonly GLUTEN: "GLUTEN";
|
|
37
|
+
readonly DAIRY: "DAIRY";
|
|
38
|
+
readonly EGG: "EGG";
|
|
39
|
+
readonly PEANUT: "PEANUT";
|
|
40
|
+
readonly TREENUT: "TREENUT";
|
|
41
|
+
readonly FISH: "FISH";
|
|
42
|
+
readonly SHELLFISH: "SHELLFISH";
|
|
43
|
+
readonly SOY: "SOY";
|
|
44
|
+
readonly SESAME: "SESAME";
|
|
45
|
+
readonly CELERY: "CELERY";
|
|
46
|
+
readonly MUSTARD: "MUSTARD";
|
|
47
|
+
readonly LUPIN: "LUPIN";
|
|
48
|
+
readonly SULPHITES: "SULPHITES";
|
|
49
|
+
readonly MOLLUSCS: "MOLLUSCS";
|
|
50
|
+
}>, "many">>;
|
|
51
|
+
tables: z.ZodPipeline<z.ZodUnion<[z.ZodArray<z.ZodObject<Pick<{
|
|
52
|
+
id: z.ZodNumber;
|
|
53
|
+
tableNumber: z.ZodNumber;
|
|
54
|
+
capacity: z.ZodNumber;
|
|
55
|
+
additionalCapacity: z.ZodNumber;
|
|
56
|
+
isOccupied: z.ZodBoolean;
|
|
57
|
+
status: z.ZodNativeEnum<{
|
|
58
|
+
readonly AVAILABLE: "AVAILABLE";
|
|
59
|
+
readonly OCCUPIED: "OCCUPIED";
|
|
60
|
+
readonly RESERVED: "RESERVED";
|
|
61
|
+
readonly ORDERING: "ORDERING";
|
|
62
|
+
readonly SERVING: "SERVING";
|
|
63
|
+
readonly PAYMENT: "PAYMENT";
|
|
64
|
+
}>;
|
|
65
|
+
guests: z.ZodNumber;
|
|
66
|
+
originalCapacity: z.ZodNumber;
|
|
67
|
+
}, "id">, "strip", z.ZodTypeAny, {
|
|
68
|
+
id: number;
|
|
69
|
+
}, {
|
|
70
|
+
id: number;
|
|
71
|
+
}>, "many">, z.ZodEffects<z.ZodString, number[], string>]>, z.ZodDefault<z.ZodArray<z.ZodNumber, "many">>>;
|
|
72
|
+
comments: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
73
|
+
createdAt: z.ZodDefault<z.ZodDate>;
|
|
74
|
+
updatedAt: z.ZodDate;
|
|
75
|
+
isActive: z.ZodDefault<z.ZodUnion<[z.ZodBoolean, z.ZodEffects<z.ZodString, boolean | undefined, string>]>>;
|
|
76
|
+
}, "strip", z.ZodTypeAny, {
|
|
77
|
+
status: "PENDING" | "CONFIRMED" | "CANCELLED" | "COMPLETED" | "NO_SHOW";
|
|
78
|
+
id: number;
|
|
79
|
+
name: string;
|
|
80
|
+
createdAt: Date;
|
|
81
|
+
updatedAt: Date;
|
|
82
|
+
allergies: ("NONE" | "GLUTEN" | "DAIRY" | "EGG" | "PEANUT" | "TREENUT" | "FISH" | "SHELLFISH" | "SOY" | "SESAME" | "CELERY" | "MUSTARD" | "LUPIN" | "SULPHITES" | "MOLLUSCS")[];
|
|
83
|
+
guestsCount: number;
|
|
84
|
+
time: Date;
|
|
85
|
+
phone: string;
|
|
86
|
+
tables: number[];
|
|
87
|
+
isActive: boolean;
|
|
88
|
+
comments?: string | null | undefined;
|
|
89
|
+
email?: string | null | undefined;
|
|
90
|
+
}, {
|
|
91
|
+
id: number;
|
|
92
|
+
name: string;
|
|
93
|
+
updatedAt: Date;
|
|
94
|
+
allergies: string | string[];
|
|
95
|
+
guestsCount: number;
|
|
96
|
+
time: string | Date;
|
|
97
|
+
phone: string;
|
|
98
|
+
tables: string | {
|
|
99
|
+
id: number;
|
|
100
|
+
}[];
|
|
101
|
+
status?: string | undefined;
|
|
102
|
+
createdAt?: Date | undefined;
|
|
103
|
+
comments?: string | null | undefined;
|
|
104
|
+
email?: string | null | undefined;
|
|
105
|
+
isActive?: string | boolean | undefined;
|
|
106
|
+
}>;
|
|
107
|
+
/**
|
|
108
|
+
* Type representing a reservation data transfer object (DTO).
|
|
109
|
+
*/
|
|
110
|
+
export type ReservationDTO = z.infer<typeof ReservationSchema>;
|
|
111
|
+
/**
|
|
112
|
+
* @constant
|
|
113
|
+
* @name ReservationSearchCriteria
|
|
114
|
+
* @description
|
|
115
|
+
* This schema defines the search criteria for reservations. It extends the base `searchCriteriaSchema`
|
|
116
|
+
* and includes a partial selection of fields from `ReservationSchema` with additional search-specific fields.
|
|
117
|
+
*
|
|
118
|
+
* @property {string} sortBy - The field by which to sort the results. Defaults to 'time'.
|
|
119
|
+
* @property {number} [guestsCountMin] - The minimum number of guests. Must be a positive integer.
|
|
120
|
+
* @property {number} [guestsCountMax] - The maximum number of guests. Must be a positive integer.
|
|
121
|
+
* @property {Date | string} [timeStart] - The start time for the reservation search. Can be a string that will be transformed into a Date object.
|
|
122
|
+
* @property {Date | string} [timeEnd] - The end time for the reservation search. Can be a string that will be transformed into a Date object.
|
|
123
|
+
*
|
|
124
|
+
* @extends searchCriteriaSchema
|
|
125
|
+
* @see ReservationSchema
|
|
126
|
+
*/
|
|
127
|
+
export declare const ReservationSearchCriteria: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<Pick<{
|
|
128
|
+
page: z.ZodDefault<z.ZodNumber>;
|
|
129
|
+
pageSize: z.ZodDefault<z.ZodNumber>;
|
|
130
|
+
totalPages: z.ZodNumber;
|
|
131
|
+
totalCount: z.ZodNumber;
|
|
132
|
+
}, "page" | "pageSize">, {
|
|
133
|
+
sortOrder: z.ZodDefault<z.ZodOptional<z.ZodNativeEnum<{
|
|
134
|
+
readonly ASC: "asc";
|
|
135
|
+
readonly DESC: "desc";
|
|
136
|
+
}>>>;
|
|
137
|
+
}>, {
|
|
138
|
+
sortBy: z.ZodDefault<z.ZodString>;
|
|
139
|
+
guestsCountMin: z.ZodOptional<z.ZodNumber>;
|
|
140
|
+
guestsCountMax: z.ZodOptional<z.ZodNumber>;
|
|
141
|
+
timeStart: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, Date, string>, z.ZodDate]>>;
|
|
142
|
+
timeEnd: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, Date, string>, z.ZodDate]>>;
|
|
143
|
+
status: z.ZodOptional<z.ZodDefault<z.ZodPipeline<z.ZodEffects<z.ZodString, string, string>, z.ZodNativeEnum<{
|
|
144
|
+
readonly PENDING: "PENDING";
|
|
145
|
+
readonly CONFIRMED: "CONFIRMED";
|
|
146
|
+
readonly CANCELLED: "CANCELLED";
|
|
147
|
+
readonly COMPLETED: "COMPLETED";
|
|
148
|
+
readonly NO_SHOW: "NO_SHOW";
|
|
149
|
+
}>>>>;
|
|
150
|
+
name: z.ZodOptional<z.ZodString>;
|
|
151
|
+
allergies: z.ZodOptional<z.ZodPipeline<z.ZodUnion<[z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], string[]>, z.ZodEffects<z.ZodString, string[], string>]>, z.ZodArray<z.ZodNativeEnum<{
|
|
152
|
+
readonly NONE: "NONE";
|
|
153
|
+
readonly GLUTEN: "GLUTEN";
|
|
154
|
+
readonly DAIRY: "DAIRY";
|
|
155
|
+
readonly EGG: "EGG";
|
|
156
|
+
readonly PEANUT: "PEANUT";
|
|
157
|
+
readonly TREENUT: "TREENUT";
|
|
158
|
+
readonly FISH: "FISH";
|
|
159
|
+
readonly SHELLFISH: "SHELLFISH";
|
|
160
|
+
readonly SOY: "SOY";
|
|
161
|
+
readonly SESAME: "SESAME";
|
|
162
|
+
readonly CELERY: "CELERY";
|
|
163
|
+
readonly MUSTARD: "MUSTARD";
|
|
164
|
+
readonly LUPIN: "LUPIN";
|
|
165
|
+
readonly SULPHITES: "SULPHITES";
|
|
166
|
+
readonly MOLLUSCS: "MOLLUSCS";
|
|
167
|
+
}>, "many">>>;
|
|
168
|
+
guestsCount: z.ZodOptional<z.ZodNumber>;
|
|
169
|
+
time: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, Date, string>, z.ZodDate]>>;
|
|
170
|
+
email: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
171
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
172
|
+
tables: z.ZodOptional<z.ZodPipeline<z.ZodUnion<[z.ZodArray<z.ZodObject<Pick<{
|
|
173
|
+
id: z.ZodNumber;
|
|
174
|
+
tableNumber: z.ZodNumber;
|
|
175
|
+
capacity: z.ZodNumber;
|
|
176
|
+
additionalCapacity: z.ZodNumber;
|
|
177
|
+
isOccupied: z.ZodBoolean;
|
|
178
|
+
status: z.ZodNativeEnum<{
|
|
179
|
+
readonly AVAILABLE: "AVAILABLE";
|
|
180
|
+
readonly OCCUPIED: "OCCUPIED";
|
|
181
|
+
readonly RESERVED: "RESERVED";
|
|
182
|
+
readonly ORDERING: "ORDERING";
|
|
183
|
+
readonly SERVING: "SERVING";
|
|
184
|
+
readonly PAYMENT: "PAYMENT";
|
|
185
|
+
}>;
|
|
186
|
+
guests: z.ZodNumber;
|
|
187
|
+
originalCapacity: z.ZodNumber;
|
|
188
|
+
}, "id">, "strip", z.ZodTypeAny, {
|
|
189
|
+
id: number;
|
|
190
|
+
}, {
|
|
191
|
+
id: number;
|
|
192
|
+
}>, "many">, z.ZodEffects<z.ZodString, number[], string>]>, z.ZodDefault<z.ZodArray<z.ZodNumber, "many">>>>;
|
|
193
|
+
isActive: z.ZodOptional<z.ZodDefault<z.ZodUnion<[z.ZodBoolean, z.ZodEffects<z.ZodString, boolean | undefined, string>]>>>;
|
|
194
|
+
}>, "strip", z.ZodTypeAny, {
|
|
195
|
+
page: number;
|
|
196
|
+
pageSize: number;
|
|
197
|
+
sortOrder: "asc" | "desc";
|
|
198
|
+
sortBy: string;
|
|
199
|
+
status?: "PENDING" | "CONFIRMED" | "CANCELLED" | "COMPLETED" | "NO_SHOW" | undefined;
|
|
200
|
+
name?: string | undefined;
|
|
201
|
+
allergies?: ("NONE" | "GLUTEN" | "DAIRY" | "EGG" | "PEANUT" | "TREENUT" | "FISH" | "SHELLFISH" | "SOY" | "SESAME" | "CELERY" | "MUSTARD" | "LUPIN" | "SULPHITES" | "MOLLUSCS")[] | undefined;
|
|
202
|
+
guestsCount?: number | undefined;
|
|
203
|
+
time?: Date | undefined;
|
|
204
|
+
email?: string | null | undefined;
|
|
205
|
+
phone?: string | undefined;
|
|
206
|
+
tables?: number[] | undefined;
|
|
207
|
+
isActive?: boolean | undefined;
|
|
208
|
+
guestsCountMin?: number | undefined;
|
|
209
|
+
guestsCountMax?: number | undefined;
|
|
210
|
+
timeStart?: Date | undefined;
|
|
211
|
+
timeEnd?: Date | undefined;
|
|
212
|
+
}, {
|
|
213
|
+
status?: string | undefined;
|
|
214
|
+
page?: number | undefined;
|
|
215
|
+
pageSize?: number | undefined;
|
|
216
|
+
sortOrder?: "asc" | "desc" | undefined;
|
|
217
|
+
name?: string | undefined;
|
|
218
|
+
allergies?: string | string[] | undefined;
|
|
219
|
+
sortBy?: string | undefined;
|
|
220
|
+
guestsCount?: number | undefined;
|
|
221
|
+
time?: string | Date | undefined;
|
|
222
|
+
email?: string | null | undefined;
|
|
223
|
+
phone?: string | undefined;
|
|
224
|
+
tables?: string | {
|
|
225
|
+
id: number;
|
|
226
|
+
}[] | undefined;
|
|
227
|
+
isActive?: string | boolean | undefined;
|
|
228
|
+
guestsCountMin?: number | undefined;
|
|
229
|
+
guestsCountMax?: number | undefined;
|
|
230
|
+
timeStart?: string | Date | undefined;
|
|
231
|
+
timeEnd?: string | Date | undefined;
|
|
232
|
+
}>;
|
|
233
|
+
/**
|
|
234
|
+
* Type representing the search criteria for reservations.
|
|
235
|
+
*/
|
|
236
|
+
export type ReservationSearchCriteriaDTO = z.infer<typeof ReservationSearchCriteria>;
|
|
237
|
+
/**
|
|
238
|
+
* Schema for creating a reservation, omitting the following fields:
|
|
239
|
+
* - `id`: The unique identifier for the reservation.
|
|
240
|
+
* - `updatedAt`: The timestamp when the reservation was last updated.
|
|
241
|
+
* - `createdAt`: The timestamp when the reservation was created.
|
|
242
|
+
* - `isActive`: The status indicating whether the reservation is active.
|
|
243
|
+
*/
|
|
244
|
+
export declare const CreateReservationSchema: z.ZodObject<Omit<{
|
|
245
|
+
id: z.ZodNumber;
|
|
246
|
+
guestsCount: z.ZodNumber;
|
|
247
|
+
time: z.ZodUnion<[z.ZodEffects<z.ZodString, Date, string>, z.ZodDate]>;
|
|
248
|
+
name: z.ZodString;
|
|
249
|
+
email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
250
|
+
phone: z.ZodString;
|
|
251
|
+
status: z.ZodDefault<z.ZodPipeline<z.ZodEffects<z.ZodString, string, string>, z.ZodNativeEnum<{
|
|
252
|
+
readonly PENDING: "PENDING";
|
|
253
|
+
readonly CONFIRMED: "CONFIRMED";
|
|
254
|
+
readonly CANCELLED: "CANCELLED";
|
|
255
|
+
readonly COMPLETED: "COMPLETED";
|
|
256
|
+
readonly NO_SHOW: "NO_SHOW";
|
|
257
|
+
}>>>;
|
|
258
|
+
allergies: z.ZodPipeline<z.ZodUnion<[z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], string[]>, z.ZodEffects<z.ZodString, string[], string>]>, z.ZodArray<z.ZodNativeEnum<{
|
|
259
|
+
readonly NONE: "NONE";
|
|
260
|
+
readonly GLUTEN: "GLUTEN";
|
|
261
|
+
readonly DAIRY: "DAIRY";
|
|
262
|
+
readonly EGG: "EGG";
|
|
263
|
+
readonly PEANUT: "PEANUT";
|
|
264
|
+
readonly TREENUT: "TREENUT";
|
|
265
|
+
readonly FISH: "FISH";
|
|
266
|
+
readonly SHELLFISH: "SHELLFISH";
|
|
267
|
+
readonly SOY: "SOY";
|
|
268
|
+
readonly SESAME: "SESAME";
|
|
269
|
+
readonly CELERY: "CELERY";
|
|
270
|
+
readonly MUSTARD: "MUSTARD";
|
|
271
|
+
readonly LUPIN: "LUPIN";
|
|
272
|
+
readonly SULPHITES: "SULPHITES";
|
|
273
|
+
readonly MOLLUSCS: "MOLLUSCS";
|
|
274
|
+
}>, "many">>;
|
|
275
|
+
tables: z.ZodPipeline<z.ZodUnion<[z.ZodArray<z.ZodObject<Pick<{
|
|
276
|
+
id: z.ZodNumber;
|
|
277
|
+
tableNumber: z.ZodNumber;
|
|
278
|
+
capacity: z.ZodNumber;
|
|
279
|
+
additionalCapacity: z.ZodNumber;
|
|
280
|
+
isOccupied: z.ZodBoolean;
|
|
281
|
+
status: z.ZodNativeEnum<{
|
|
282
|
+
readonly AVAILABLE: "AVAILABLE";
|
|
283
|
+
readonly OCCUPIED: "OCCUPIED";
|
|
284
|
+
readonly RESERVED: "RESERVED";
|
|
285
|
+
readonly ORDERING: "ORDERING";
|
|
286
|
+
readonly SERVING: "SERVING";
|
|
287
|
+
readonly PAYMENT: "PAYMENT";
|
|
288
|
+
}>;
|
|
289
|
+
guests: z.ZodNumber;
|
|
290
|
+
originalCapacity: z.ZodNumber;
|
|
291
|
+
}, "id">, "strip", z.ZodTypeAny, {
|
|
292
|
+
id: number;
|
|
293
|
+
}, {
|
|
294
|
+
id: number;
|
|
295
|
+
}>, "many">, z.ZodEffects<z.ZodString, number[], string>]>, z.ZodDefault<z.ZodArray<z.ZodNumber, "many">>>;
|
|
296
|
+
comments: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
297
|
+
createdAt: z.ZodDefault<z.ZodDate>;
|
|
298
|
+
updatedAt: z.ZodDate;
|
|
299
|
+
isActive: z.ZodDefault<z.ZodUnion<[z.ZodBoolean, z.ZodEffects<z.ZodString, boolean | undefined, string>]>>;
|
|
300
|
+
}, "id" | "createdAt" | "updatedAt" | "isActive">, "strip", z.ZodTypeAny, {
|
|
301
|
+
status: "PENDING" | "CONFIRMED" | "CANCELLED" | "COMPLETED" | "NO_SHOW";
|
|
302
|
+
name: string;
|
|
303
|
+
allergies: ("NONE" | "GLUTEN" | "DAIRY" | "EGG" | "PEANUT" | "TREENUT" | "FISH" | "SHELLFISH" | "SOY" | "SESAME" | "CELERY" | "MUSTARD" | "LUPIN" | "SULPHITES" | "MOLLUSCS")[];
|
|
304
|
+
guestsCount: number;
|
|
305
|
+
time: Date;
|
|
306
|
+
phone: string;
|
|
307
|
+
tables: number[];
|
|
308
|
+
comments?: string | null | undefined;
|
|
309
|
+
email?: string | null | undefined;
|
|
310
|
+
}, {
|
|
311
|
+
name: string;
|
|
312
|
+
allergies: string | string[];
|
|
313
|
+
guestsCount: number;
|
|
314
|
+
time: string | Date;
|
|
315
|
+
phone: string;
|
|
316
|
+
tables: string | {
|
|
317
|
+
id: number;
|
|
318
|
+
}[];
|
|
319
|
+
status?: string | undefined;
|
|
320
|
+
comments?: string | null | undefined;
|
|
321
|
+
email?: string | null | undefined;
|
|
322
|
+
}>;
|
|
323
|
+
/**
|
|
324
|
+
* Type representing the data transfer object (DTO) for creating a reservation.
|
|
325
|
+
*/
|
|
326
|
+
export type CreateReservationDTO = z.infer<typeof CreateReservationSchema>;
|
|
327
|
+
/**
|
|
328
|
+
* Extends the ReservationSchema to include an array of tables.
|
|
329
|
+
* Each table in the array contains only the `id` and `tableNumber` properties.
|
|
330
|
+
*
|
|
331
|
+
* @constant
|
|
332
|
+
* @type {ZodSchema}
|
|
333
|
+
*/
|
|
334
|
+
export declare const ReservationWithTablesSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
335
|
+
id: z.ZodNumber;
|
|
336
|
+
guestsCount: z.ZodNumber;
|
|
337
|
+
time: z.ZodUnion<[z.ZodEffects<z.ZodString, Date, string>, z.ZodDate]>;
|
|
338
|
+
name: z.ZodString;
|
|
339
|
+
email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
340
|
+
phone: z.ZodString;
|
|
341
|
+
status: z.ZodDefault<z.ZodPipeline<z.ZodEffects<z.ZodString, string, string>, z.ZodNativeEnum<{
|
|
342
|
+
readonly PENDING: "PENDING";
|
|
343
|
+
readonly CONFIRMED: "CONFIRMED";
|
|
344
|
+
readonly CANCELLED: "CANCELLED";
|
|
345
|
+
readonly COMPLETED: "COMPLETED";
|
|
346
|
+
readonly NO_SHOW: "NO_SHOW";
|
|
347
|
+
}>>>;
|
|
348
|
+
allergies: z.ZodPipeline<z.ZodUnion<[z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], string[]>, z.ZodEffects<z.ZodString, string[], string>]>, z.ZodArray<z.ZodNativeEnum<{
|
|
349
|
+
readonly NONE: "NONE";
|
|
350
|
+
readonly GLUTEN: "GLUTEN";
|
|
351
|
+
readonly DAIRY: "DAIRY";
|
|
352
|
+
readonly EGG: "EGG";
|
|
353
|
+
readonly PEANUT: "PEANUT";
|
|
354
|
+
readonly TREENUT: "TREENUT";
|
|
355
|
+
readonly FISH: "FISH";
|
|
356
|
+
readonly SHELLFISH: "SHELLFISH";
|
|
357
|
+
readonly SOY: "SOY";
|
|
358
|
+
readonly SESAME: "SESAME";
|
|
359
|
+
readonly CELERY: "CELERY";
|
|
360
|
+
readonly MUSTARD: "MUSTARD";
|
|
361
|
+
readonly LUPIN: "LUPIN";
|
|
362
|
+
readonly SULPHITES: "SULPHITES";
|
|
363
|
+
readonly MOLLUSCS: "MOLLUSCS";
|
|
364
|
+
}>, "many">>;
|
|
365
|
+
tables: z.ZodPipeline<z.ZodUnion<[z.ZodArray<z.ZodObject<Pick<{
|
|
366
|
+
id: z.ZodNumber;
|
|
367
|
+
tableNumber: z.ZodNumber;
|
|
368
|
+
capacity: z.ZodNumber;
|
|
369
|
+
additionalCapacity: z.ZodNumber;
|
|
370
|
+
isOccupied: z.ZodBoolean;
|
|
371
|
+
status: z.ZodNativeEnum<{
|
|
372
|
+
readonly AVAILABLE: "AVAILABLE";
|
|
373
|
+
readonly OCCUPIED: "OCCUPIED";
|
|
374
|
+
readonly RESERVED: "RESERVED";
|
|
375
|
+
readonly ORDERING: "ORDERING";
|
|
376
|
+
readonly SERVING: "SERVING";
|
|
377
|
+
readonly PAYMENT: "PAYMENT";
|
|
378
|
+
}>;
|
|
379
|
+
guests: z.ZodNumber;
|
|
380
|
+
originalCapacity: z.ZodNumber;
|
|
381
|
+
}, "id">, "strip", z.ZodTypeAny, {
|
|
382
|
+
id: number;
|
|
383
|
+
}, {
|
|
384
|
+
id: number;
|
|
385
|
+
}>, "many">, z.ZodEffects<z.ZodString, number[], string>]>, z.ZodDefault<z.ZodArray<z.ZodNumber, "many">>>;
|
|
386
|
+
comments: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
387
|
+
createdAt: z.ZodDefault<z.ZodDate>;
|
|
388
|
+
updatedAt: z.ZodDate;
|
|
389
|
+
isActive: z.ZodDefault<z.ZodUnion<[z.ZodBoolean, z.ZodEffects<z.ZodString, boolean | undefined, string>]>>;
|
|
390
|
+
}, {
|
|
391
|
+
tables: z.ZodArray<z.ZodObject<Pick<z.objectUtil.extendShape<{
|
|
392
|
+
id: z.ZodNumber;
|
|
393
|
+
tableNumber: z.ZodNumber;
|
|
394
|
+
capacity: z.ZodNumber;
|
|
395
|
+
additionalCapacity: z.ZodNumber;
|
|
396
|
+
isOccupied: z.ZodBoolean;
|
|
397
|
+
status: z.ZodNativeEnum<{
|
|
398
|
+
readonly AVAILABLE: "AVAILABLE";
|
|
399
|
+
readonly OCCUPIED: "OCCUPIED";
|
|
400
|
+
readonly RESERVED: "RESERVED";
|
|
401
|
+
readonly ORDERING: "ORDERING";
|
|
402
|
+
readonly SERVING: "SERVING";
|
|
403
|
+
readonly PAYMENT: "PAYMENT";
|
|
404
|
+
}>;
|
|
405
|
+
guests: z.ZodNumber;
|
|
406
|
+
originalCapacity: z.ZodNumber;
|
|
407
|
+
}, {
|
|
408
|
+
orders: z.ZodOptional<z.ZodArray<z.ZodObject<Pick<{
|
|
409
|
+
id: z.ZodNumber;
|
|
410
|
+
tableNumber: z.ZodNumber;
|
|
411
|
+
orderNumber: z.ZodNumber;
|
|
412
|
+
guestsCount: z.ZodNumber;
|
|
413
|
+
orderTime: z.ZodDate;
|
|
414
|
+
updatedAt: z.ZodDate;
|
|
415
|
+
allergies: z.ZodOptional<z.ZodArray<z.ZodNativeEnum<{
|
|
416
|
+
readonly NONE: "NONE";
|
|
417
|
+
readonly GLUTEN: "GLUTEN";
|
|
418
|
+
readonly DAIRY: "DAIRY";
|
|
419
|
+
readonly EGG: "EGG";
|
|
420
|
+
readonly PEANUT: "PEANUT";
|
|
421
|
+
readonly TREENUT: "TREENUT";
|
|
422
|
+
readonly FISH: "FISH";
|
|
423
|
+
readonly SHELLFISH: "SHELLFISH";
|
|
424
|
+
readonly SOY: "SOY";
|
|
425
|
+
readonly SESAME: "SESAME";
|
|
426
|
+
readonly CELERY: "CELERY";
|
|
427
|
+
readonly MUSTARD: "MUSTARD";
|
|
428
|
+
readonly LUPIN: "LUPIN";
|
|
429
|
+
readonly SULPHITES: "SULPHITES";
|
|
430
|
+
readonly MOLLUSCS: "MOLLUSCS";
|
|
431
|
+
}>, "many">>;
|
|
432
|
+
serverId: z.ZodNumber;
|
|
433
|
+
totalAmount: z.ZodDefault<z.ZodNumber>;
|
|
434
|
+
status: z.ZodDefault<z.ZodNativeEnum<{
|
|
435
|
+
readonly AWAITING: "AWAITING";
|
|
436
|
+
readonly RECEIVED: "RECEIVED";
|
|
437
|
+
readonly SERVED: "SERVED";
|
|
438
|
+
readonly CANCELED: "CANCELED";
|
|
439
|
+
readonly DISPUTED: "DISPUTED";
|
|
440
|
+
readonly READY_TO_PAY: "READY_TO_PAY";
|
|
441
|
+
readonly COMPLETED: "COMPLETED";
|
|
442
|
+
}>>;
|
|
443
|
+
comments: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
444
|
+
completionTime: z.ZodNullable<z.ZodOptional<z.ZodDate>>;
|
|
445
|
+
discount: z.ZodDefault<z.ZodNumber>;
|
|
446
|
+
tip: z.ZodDefault<z.ZodNumber>;
|
|
447
|
+
shiftId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
448
|
+
}, "status" | "id" | "orderTime">, "strip", z.ZodTypeAny, {
|
|
449
|
+
status: "COMPLETED" | "AWAITING" | "RECEIVED" | "SERVED" | "CANCELED" | "DISPUTED" | "READY_TO_PAY";
|
|
450
|
+
id: number;
|
|
451
|
+
orderTime: Date;
|
|
452
|
+
}, {
|
|
453
|
+
id: number;
|
|
454
|
+
orderTime: Date;
|
|
455
|
+
status?: "COMPLETED" | "AWAITING" | "RECEIVED" | "SERVED" | "CANCELED" | "DISPUTED" | "READY_TO_PAY" | undefined;
|
|
456
|
+
}>, "many">>;
|
|
457
|
+
assignment: z.ZodOptional<z.ZodArray<z.ZodObject<Pick<{
|
|
458
|
+
serverId: z.ZodNumber;
|
|
459
|
+
isPrimary: z.ZodDefault<z.ZodBoolean>;
|
|
460
|
+
assignedTables: z.ZodArray<z.ZodNumber, "many">;
|
|
461
|
+
}, "serverId" | "isPrimary">, "strip", z.ZodTypeAny, {
|
|
462
|
+
serverId: number;
|
|
463
|
+
isPrimary: boolean;
|
|
464
|
+
}, {
|
|
465
|
+
serverId: number;
|
|
466
|
+
isPrimary?: boolean | undefined;
|
|
467
|
+
}>, "many">>;
|
|
468
|
+
}>, "id" | "tableNumber">, "strip", z.ZodTypeAny, {
|
|
469
|
+
id: number;
|
|
470
|
+
tableNumber: number;
|
|
471
|
+
}, {
|
|
472
|
+
id: number;
|
|
473
|
+
tableNumber: number;
|
|
474
|
+
}>, "many">;
|
|
475
|
+
}>, "strip", z.ZodTypeAny, {
|
|
476
|
+
status: "PENDING" | "CONFIRMED" | "CANCELLED" | "COMPLETED" | "NO_SHOW";
|
|
477
|
+
id: number;
|
|
478
|
+
name: string;
|
|
479
|
+
createdAt: Date;
|
|
480
|
+
updatedAt: Date;
|
|
481
|
+
allergies: ("NONE" | "GLUTEN" | "DAIRY" | "EGG" | "PEANUT" | "TREENUT" | "FISH" | "SHELLFISH" | "SOY" | "SESAME" | "CELERY" | "MUSTARD" | "LUPIN" | "SULPHITES" | "MOLLUSCS")[];
|
|
482
|
+
guestsCount: number;
|
|
483
|
+
time: Date;
|
|
484
|
+
phone: string;
|
|
485
|
+
tables: {
|
|
486
|
+
id: number;
|
|
487
|
+
tableNumber: number;
|
|
488
|
+
}[];
|
|
489
|
+
isActive: boolean;
|
|
490
|
+
comments?: string | null | undefined;
|
|
491
|
+
email?: string | null | undefined;
|
|
492
|
+
}, {
|
|
493
|
+
id: number;
|
|
494
|
+
name: string;
|
|
495
|
+
updatedAt: Date;
|
|
496
|
+
allergies: string | string[];
|
|
497
|
+
guestsCount: number;
|
|
498
|
+
time: string | Date;
|
|
499
|
+
phone: string;
|
|
500
|
+
tables: {
|
|
501
|
+
id: number;
|
|
502
|
+
tableNumber: number;
|
|
503
|
+
}[];
|
|
504
|
+
status?: string | undefined;
|
|
505
|
+
createdAt?: Date | undefined;
|
|
506
|
+
comments?: string | null | undefined;
|
|
507
|
+
email?: string | null | undefined;
|
|
508
|
+
isActive?: string | boolean | undefined;
|
|
509
|
+
}>;
|
|
510
|
+
/**
|
|
511
|
+
* Type representing a reservation with detailed table information.
|
|
512
|
+
*/
|
|
513
|
+
export type ReservationWithTablesDTO = z.infer<typeof ReservationWithTablesSchema>;
|
|
514
|
+
/**
|
|
515
|
+
* Represents a conflict in a reservation.
|
|
516
|
+
*
|
|
517
|
+
* @constant
|
|
518
|
+
* @type {z.ZodObject}
|
|
519
|
+
*
|
|
520
|
+
* @property {string} reservationId - The unique identifier of the reservation.
|
|
521
|
+
* @property {string} time - The time of the reservation.
|
|
522
|
+
* @property {Array<{ id: string, tableNumber: number }>} tables - An array of tables involved in the reservation conflict, each containing an id and table number.
|
|
523
|
+
*/
|
|
524
|
+
export declare const ReservationConflict: z.ZodObject<{
|
|
525
|
+
reservationId: z.ZodNumber;
|
|
526
|
+
time: z.ZodUnion<[z.ZodEffects<z.ZodString, Date, string>, z.ZodDate]>;
|
|
527
|
+
tables: z.ZodArray<z.ZodObject<Pick<{
|
|
528
|
+
id: z.ZodNumber;
|
|
529
|
+
tableNumber: z.ZodNumber;
|
|
530
|
+
capacity: z.ZodNumber;
|
|
531
|
+
additionalCapacity: z.ZodNumber;
|
|
532
|
+
isOccupied: z.ZodBoolean;
|
|
533
|
+
status: z.ZodNativeEnum<{
|
|
534
|
+
readonly AVAILABLE: "AVAILABLE";
|
|
535
|
+
readonly OCCUPIED: "OCCUPIED";
|
|
536
|
+
readonly RESERVED: "RESERVED";
|
|
537
|
+
readonly ORDERING: "ORDERING";
|
|
538
|
+
readonly SERVING: "SERVING";
|
|
539
|
+
readonly PAYMENT: "PAYMENT";
|
|
540
|
+
}>;
|
|
541
|
+
guests: z.ZodNumber;
|
|
542
|
+
originalCapacity: z.ZodNumber;
|
|
543
|
+
}, "id" | "tableNumber">, "strip", z.ZodTypeAny, {
|
|
544
|
+
id: number;
|
|
545
|
+
tableNumber: number;
|
|
546
|
+
}, {
|
|
547
|
+
id: number;
|
|
548
|
+
tableNumber: number;
|
|
549
|
+
}>, "many">;
|
|
550
|
+
}, "strip", z.ZodTypeAny, {
|
|
551
|
+
reservationId: number;
|
|
552
|
+
time: Date;
|
|
553
|
+
tables: {
|
|
554
|
+
id: number;
|
|
555
|
+
tableNumber: number;
|
|
556
|
+
}[];
|
|
557
|
+
}, {
|
|
558
|
+
reservationId: number;
|
|
559
|
+
time: string | Date;
|
|
560
|
+
tables: {
|
|
561
|
+
id: number;
|
|
562
|
+
tableNumber: number;
|
|
563
|
+
}[];
|
|
564
|
+
}>;
|
|
565
|
+
export type ReservationConflictDTO = z.infer<typeof ReservationConflict>;
|
|
566
|
+
export declare const ReservationDetailedSchema: z.ZodObject<{
|
|
567
|
+
reservation: z.ZodObject<z.objectUtil.extendShape<{
|
|
568
|
+
id: z.ZodNumber;
|
|
569
|
+
guestsCount: z.ZodNumber;
|
|
570
|
+
time: z.ZodUnion<[z.ZodEffects<z.ZodString, Date, string>, z.ZodDate]>;
|
|
571
|
+
name: z.ZodString;
|
|
572
|
+
email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
573
|
+
phone: z.ZodString;
|
|
574
|
+
status: z.ZodDefault<z.ZodPipeline<z.ZodEffects<z.ZodString, string, string>, z.ZodNativeEnum<{
|
|
575
|
+
readonly PENDING: "PENDING";
|
|
576
|
+
readonly CONFIRMED: "CONFIRMED";
|
|
577
|
+
readonly CANCELLED: "CANCELLED";
|
|
578
|
+
readonly COMPLETED: "COMPLETED";
|
|
579
|
+
readonly NO_SHOW: "NO_SHOW";
|
|
580
|
+
}>>>;
|
|
581
|
+
allergies: z.ZodPipeline<z.ZodUnion<[z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], string[]>, z.ZodEffects<z.ZodString, string[], string>]>, z.ZodArray<z.ZodNativeEnum<{
|
|
582
|
+
readonly NONE: "NONE";
|
|
583
|
+
readonly GLUTEN: "GLUTEN";
|
|
584
|
+
readonly DAIRY: "DAIRY";
|
|
585
|
+
readonly EGG: "EGG";
|
|
586
|
+
readonly PEANUT: "PEANUT";
|
|
587
|
+
readonly TREENUT: "TREENUT";
|
|
588
|
+
readonly FISH: "FISH";
|
|
589
|
+
readonly SHELLFISH: "SHELLFISH";
|
|
590
|
+
readonly SOY: "SOY";
|
|
591
|
+
readonly SESAME: "SESAME";
|
|
592
|
+
readonly CELERY: "CELERY";
|
|
593
|
+
readonly MUSTARD: "MUSTARD";
|
|
594
|
+
readonly LUPIN: "LUPIN";
|
|
595
|
+
readonly SULPHITES: "SULPHITES";
|
|
596
|
+
readonly MOLLUSCS: "MOLLUSCS";
|
|
597
|
+
}>, "many">>;
|
|
598
|
+
tables: z.ZodPipeline<z.ZodUnion<[z.ZodArray<z.ZodObject<Pick<{
|
|
599
|
+
id: z.ZodNumber;
|
|
600
|
+
tableNumber: z.ZodNumber;
|
|
601
|
+
capacity: z.ZodNumber;
|
|
602
|
+
additionalCapacity: z.ZodNumber;
|
|
603
|
+
isOccupied: z.ZodBoolean;
|
|
604
|
+
status: z.ZodNativeEnum<{
|
|
605
|
+
readonly AVAILABLE: "AVAILABLE";
|
|
606
|
+
readonly OCCUPIED: "OCCUPIED";
|
|
607
|
+
readonly RESERVED: "RESERVED";
|
|
608
|
+
readonly ORDERING: "ORDERING";
|
|
609
|
+
readonly SERVING: "SERVING";
|
|
610
|
+
readonly PAYMENT: "PAYMENT";
|
|
611
|
+
}>;
|
|
612
|
+
guests: z.ZodNumber;
|
|
613
|
+
originalCapacity: z.ZodNumber;
|
|
614
|
+
}, "id">, "strip", z.ZodTypeAny, {
|
|
615
|
+
id: number;
|
|
616
|
+
}, {
|
|
617
|
+
id: number;
|
|
618
|
+
}>, "many">, z.ZodEffects<z.ZodString, number[], string>]>, z.ZodDefault<z.ZodArray<z.ZodNumber, "many">>>;
|
|
619
|
+
comments: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
620
|
+
createdAt: z.ZodDefault<z.ZodDate>;
|
|
621
|
+
updatedAt: z.ZodDate;
|
|
622
|
+
isActive: z.ZodDefault<z.ZodUnion<[z.ZodBoolean, z.ZodEffects<z.ZodString, boolean | undefined, string>]>>;
|
|
623
|
+
}, {
|
|
624
|
+
tables: z.ZodArray<z.ZodObject<Pick<z.objectUtil.extendShape<{
|
|
625
|
+
id: z.ZodNumber;
|
|
626
|
+
tableNumber: z.ZodNumber;
|
|
627
|
+
capacity: z.ZodNumber;
|
|
628
|
+
additionalCapacity: z.ZodNumber;
|
|
629
|
+
isOccupied: z.ZodBoolean;
|
|
630
|
+
status: z.ZodNativeEnum<{
|
|
631
|
+
readonly AVAILABLE: "AVAILABLE";
|
|
632
|
+
readonly OCCUPIED: "OCCUPIED";
|
|
633
|
+
readonly RESERVED: "RESERVED";
|
|
634
|
+
readonly ORDERING: "ORDERING";
|
|
635
|
+
readonly SERVING: "SERVING";
|
|
636
|
+
readonly PAYMENT: "PAYMENT";
|
|
637
|
+
}>;
|
|
638
|
+
guests: z.ZodNumber;
|
|
639
|
+
originalCapacity: z.ZodNumber;
|
|
640
|
+
}, {
|
|
641
|
+
orders: z.ZodOptional<z.ZodArray<z.ZodObject<Pick<{
|
|
642
|
+
id: z.ZodNumber;
|
|
643
|
+
tableNumber: z.ZodNumber;
|
|
644
|
+
orderNumber: z.ZodNumber;
|
|
645
|
+
guestsCount: z.ZodNumber;
|
|
646
|
+
orderTime: z.ZodDate;
|
|
647
|
+
updatedAt: z.ZodDate;
|
|
648
|
+
allergies: z.ZodOptional<z.ZodArray<z.ZodNativeEnum<{
|
|
649
|
+
readonly NONE: "NONE";
|
|
650
|
+
readonly GLUTEN: "GLUTEN";
|
|
651
|
+
readonly DAIRY: "DAIRY";
|
|
652
|
+
readonly EGG: "EGG";
|
|
653
|
+
readonly PEANUT: "PEANUT";
|
|
654
|
+
readonly TREENUT: "TREENUT";
|
|
655
|
+
readonly FISH: "FISH";
|
|
656
|
+
readonly SHELLFISH: "SHELLFISH";
|
|
657
|
+
readonly SOY: "SOY";
|
|
658
|
+
readonly SESAME: "SESAME";
|
|
659
|
+
readonly CELERY: "CELERY";
|
|
660
|
+
readonly MUSTARD: "MUSTARD";
|
|
661
|
+
readonly LUPIN: "LUPIN";
|
|
662
|
+
readonly SULPHITES: "SULPHITES";
|
|
663
|
+
readonly MOLLUSCS: "MOLLUSCS";
|
|
664
|
+
}>, "many">>;
|
|
665
|
+
serverId: z.ZodNumber;
|
|
666
|
+
totalAmount: z.ZodDefault<z.ZodNumber>;
|
|
667
|
+
status: z.ZodDefault<z.ZodNativeEnum<{
|
|
668
|
+
readonly AWAITING: "AWAITING";
|
|
669
|
+
readonly RECEIVED: "RECEIVED";
|
|
670
|
+
readonly SERVED: "SERVED";
|
|
671
|
+
readonly CANCELED: "CANCELED";
|
|
672
|
+
readonly DISPUTED: "DISPUTED";
|
|
673
|
+
readonly READY_TO_PAY: "READY_TO_PAY";
|
|
674
|
+
readonly COMPLETED: "COMPLETED";
|
|
675
|
+
}>>;
|
|
676
|
+
comments: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
677
|
+
completionTime: z.ZodNullable<z.ZodOptional<z.ZodDate>>;
|
|
678
|
+
discount: z.ZodDefault<z.ZodNumber>;
|
|
679
|
+
tip: z.ZodDefault<z.ZodNumber>;
|
|
680
|
+
shiftId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
681
|
+
}, "status" | "id" | "orderTime">, "strip", z.ZodTypeAny, {
|
|
682
|
+
status: "COMPLETED" | "AWAITING" | "RECEIVED" | "SERVED" | "CANCELED" | "DISPUTED" | "READY_TO_PAY";
|
|
683
|
+
id: number;
|
|
684
|
+
orderTime: Date;
|
|
685
|
+
}, {
|
|
686
|
+
id: number;
|
|
687
|
+
orderTime: Date;
|
|
688
|
+
status?: "COMPLETED" | "AWAITING" | "RECEIVED" | "SERVED" | "CANCELED" | "DISPUTED" | "READY_TO_PAY" | undefined;
|
|
689
|
+
}>, "many">>;
|
|
690
|
+
assignment: z.ZodOptional<z.ZodArray<z.ZodObject<Pick<{
|
|
691
|
+
serverId: z.ZodNumber;
|
|
692
|
+
isPrimary: z.ZodDefault<z.ZodBoolean>;
|
|
693
|
+
assignedTables: z.ZodArray<z.ZodNumber, "many">;
|
|
694
|
+
}, "serverId" | "isPrimary">, "strip", z.ZodTypeAny, {
|
|
695
|
+
serverId: number;
|
|
696
|
+
isPrimary: boolean;
|
|
697
|
+
}, {
|
|
698
|
+
serverId: number;
|
|
699
|
+
isPrimary?: boolean | undefined;
|
|
700
|
+
}>, "many">>;
|
|
701
|
+
}>, "id" | "tableNumber">, "strip", z.ZodTypeAny, {
|
|
702
|
+
id: number;
|
|
703
|
+
tableNumber: number;
|
|
704
|
+
}, {
|
|
705
|
+
id: number;
|
|
706
|
+
tableNumber: number;
|
|
707
|
+
}>, "many">;
|
|
708
|
+
}>, "strip", z.ZodTypeAny, {
|
|
709
|
+
status: "PENDING" | "CONFIRMED" | "CANCELLED" | "COMPLETED" | "NO_SHOW";
|
|
710
|
+
id: number;
|
|
711
|
+
name: string;
|
|
712
|
+
createdAt: Date;
|
|
713
|
+
updatedAt: Date;
|
|
714
|
+
allergies: ("NONE" | "GLUTEN" | "DAIRY" | "EGG" | "PEANUT" | "TREENUT" | "FISH" | "SHELLFISH" | "SOY" | "SESAME" | "CELERY" | "MUSTARD" | "LUPIN" | "SULPHITES" | "MOLLUSCS")[];
|
|
715
|
+
guestsCount: number;
|
|
716
|
+
time: Date;
|
|
717
|
+
phone: string;
|
|
718
|
+
tables: {
|
|
719
|
+
id: number;
|
|
720
|
+
tableNumber: number;
|
|
721
|
+
}[];
|
|
722
|
+
isActive: boolean;
|
|
723
|
+
comments?: string | null | undefined;
|
|
724
|
+
email?: string | null | undefined;
|
|
725
|
+
}, {
|
|
726
|
+
id: number;
|
|
727
|
+
name: string;
|
|
728
|
+
updatedAt: Date;
|
|
729
|
+
allergies: string | string[];
|
|
730
|
+
guestsCount: number;
|
|
731
|
+
time: string | Date;
|
|
732
|
+
phone: string;
|
|
733
|
+
tables: {
|
|
734
|
+
id: number;
|
|
735
|
+
tableNumber: number;
|
|
736
|
+
}[];
|
|
737
|
+
status?: string | undefined;
|
|
738
|
+
createdAt?: Date | undefined;
|
|
739
|
+
comments?: string | null | undefined;
|
|
740
|
+
email?: string | null | undefined;
|
|
741
|
+
isActive?: string | boolean | undefined;
|
|
742
|
+
}>;
|
|
743
|
+
conflict: z.ZodArray<z.ZodObject<{
|
|
744
|
+
reservationId: z.ZodNumber;
|
|
745
|
+
time: z.ZodUnion<[z.ZodEffects<z.ZodString, Date, string>, z.ZodDate]>;
|
|
746
|
+
tables: z.ZodArray<z.ZodObject<Pick<{
|
|
747
|
+
id: z.ZodNumber;
|
|
748
|
+
tableNumber: z.ZodNumber;
|
|
749
|
+
capacity: z.ZodNumber;
|
|
750
|
+
additionalCapacity: z.ZodNumber;
|
|
751
|
+
isOccupied: z.ZodBoolean;
|
|
752
|
+
status: z.ZodNativeEnum<{
|
|
753
|
+
readonly AVAILABLE: "AVAILABLE";
|
|
754
|
+
readonly OCCUPIED: "OCCUPIED";
|
|
755
|
+
readonly RESERVED: "RESERVED";
|
|
756
|
+
readonly ORDERING: "ORDERING";
|
|
757
|
+
readonly SERVING: "SERVING";
|
|
758
|
+
readonly PAYMENT: "PAYMENT";
|
|
759
|
+
}>;
|
|
760
|
+
guests: z.ZodNumber;
|
|
761
|
+
originalCapacity: z.ZodNumber;
|
|
762
|
+
}, "id" | "tableNumber">, "strip", z.ZodTypeAny, {
|
|
763
|
+
id: number;
|
|
764
|
+
tableNumber: number;
|
|
765
|
+
}, {
|
|
766
|
+
id: number;
|
|
767
|
+
tableNumber: number;
|
|
768
|
+
}>, "many">;
|
|
769
|
+
}, "strip", z.ZodTypeAny, {
|
|
770
|
+
reservationId: number;
|
|
771
|
+
time: Date;
|
|
772
|
+
tables: {
|
|
773
|
+
id: number;
|
|
774
|
+
tableNumber: number;
|
|
775
|
+
}[];
|
|
776
|
+
}, {
|
|
777
|
+
reservationId: number;
|
|
778
|
+
time: string | Date;
|
|
779
|
+
tables: {
|
|
780
|
+
id: number;
|
|
781
|
+
tableNumber: number;
|
|
782
|
+
}[];
|
|
783
|
+
}>, "many">;
|
|
784
|
+
}, "strip", z.ZodTypeAny, {
|
|
785
|
+
reservation: {
|
|
786
|
+
status: "PENDING" | "CONFIRMED" | "CANCELLED" | "COMPLETED" | "NO_SHOW";
|
|
787
|
+
id: number;
|
|
788
|
+
name: string;
|
|
789
|
+
createdAt: Date;
|
|
790
|
+
updatedAt: Date;
|
|
791
|
+
allergies: ("NONE" | "GLUTEN" | "DAIRY" | "EGG" | "PEANUT" | "TREENUT" | "FISH" | "SHELLFISH" | "SOY" | "SESAME" | "CELERY" | "MUSTARD" | "LUPIN" | "SULPHITES" | "MOLLUSCS")[];
|
|
792
|
+
guestsCount: number;
|
|
793
|
+
time: Date;
|
|
794
|
+
phone: string;
|
|
795
|
+
tables: {
|
|
796
|
+
id: number;
|
|
797
|
+
tableNumber: number;
|
|
798
|
+
}[];
|
|
799
|
+
isActive: boolean;
|
|
800
|
+
comments?: string | null | undefined;
|
|
801
|
+
email?: string | null | undefined;
|
|
802
|
+
};
|
|
803
|
+
conflict: {
|
|
804
|
+
reservationId: number;
|
|
805
|
+
time: Date;
|
|
806
|
+
tables: {
|
|
807
|
+
id: number;
|
|
808
|
+
tableNumber: number;
|
|
809
|
+
}[];
|
|
810
|
+
}[];
|
|
811
|
+
}, {
|
|
812
|
+
reservation: {
|
|
813
|
+
id: number;
|
|
814
|
+
name: string;
|
|
815
|
+
updatedAt: Date;
|
|
816
|
+
allergies: string | string[];
|
|
817
|
+
guestsCount: number;
|
|
818
|
+
time: string | Date;
|
|
819
|
+
phone: string;
|
|
820
|
+
tables: {
|
|
821
|
+
id: number;
|
|
822
|
+
tableNumber: number;
|
|
823
|
+
}[];
|
|
824
|
+
status?: string | undefined;
|
|
825
|
+
createdAt?: Date | undefined;
|
|
826
|
+
comments?: string | null | undefined;
|
|
827
|
+
email?: string | null | undefined;
|
|
828
|
+
isActive?: string | boolean | undefined;
|
|
829
|
+
};
|
|
830
|
+
conflict: {
|
|
831
|
+
reservationId: number;
|
|
832
|
+
time: string | Date;
|
|
833
|
+
tables: {
|
|
834
|
+
id: number;
|
|
835
|
+
tableNumber: number;
|
|
836
|
+
}[];
|
|
837
|
+
}[];
|
|
838
|
+
}>;
|
|
839
|
+
/**
|
|
840
|
+
* Type representing detailed reservation information, including conflicts.
|
|
841
|
+
*/
|
|
842
|
+
export type ReservationDetailedDTO = z.infer<typeof ReservationDetailedSchema>;
|
|
843
|
+
/**
|
|
844
|
+
* Schema for updating a reservation.
|
|
845
|
+
*
|
|
846
|
+
* This schema is derived from `ReservationSchema` by omitting the fields
|
|
847
|
+
* `createdAt`, `updatedAt`, and `id`. The resulting schema is then made
|
|
848
|
+
* partially optional, meaning that any of the remaining fields can be
|
|
849
|
+
* provided, but none are required.
|
|
850
|
+
*
|
|
851
|
+
* Additionally, a refinement is added to ensure that at least one field
|
|
852
|
+
* is provided when updating a reservation. If no fields are provided,
|
|
853
|
+
* an error message "At least one field must be provided to update a reservation."
|
|
854
|
+
* will be returned.
|
|
855
|
+
*/
|
|
856
|
+
export declare const UpdateReservationSchema: z.ZodEffects<z.ZodObject<{
|
|
857
|
+
status: z.ZodOptional<z.ZodDefault<z.ZodPipeline<z.ZodEffects<z.ZodString, string, string>, z.ZodNativeEnum<{
|
|
858
|
+
readonly PENDING: "PENDING";
|
|
859
|
+
readonly CONFIRMED: "CONFIRMED";
|
|
860
|
+
readonly CANCELLED: "CANCELLED";
|
|
861
|
+
readonly COMPLETED: "COMPLETED";
|
|
862
|
+
readonly NO_SHOW: "NO_SHOW";
|
|
863
|
+
}>>>>;
|
|
864
|
+
name: z.ZodOptional<z.ZodString>;
|
|
865
|
+
allergies: z.ZodOptional<z.ZodPipeline<z.ZodUnion<[z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], string[]>, z.ZodEffects<z.ZodString, string[], string>]>, z.ZodArray<z.ZodNativeEnum<{
|
|
866
|
+
readonly NONE: "NONE";
|
|
867
|
+
readonly GLUTEN: "GLUTEN";
|
|
868
|
+
readonly DAIRY: "DAIRY";
|
|
869
|
+
readonly EGG: "EGG";
|
|
870
|
+
readonly PEANUT: "PEANUT";
|
|
871
|
+
readonly TREENUT: "TREENUT";
|
|
872
|
+
readonly FISH: "FISH";
|
|
873
|
+
readonly SHELLFISH: "SHELLFISH";
|
|
874
|
+
readonly SOY: "SOY";
|
|
875
|
+
readonly SESAME: "SESAME";
|
|
876
|
+
readonly CELERY: "CELERY";
|
|
877
|
+
readonly MUSTARD: "MUSTARD";
|
|
878
|
+
readonly LUPIN: "LUPIN";
|
|
879
|
+
readonly SULPHITES: "SULPHITES";
|
|
880
|
+
readonly MOLLUSCS: "MOLLUSCS";
|
|
881
|
+
}>, "many">>>;
|
|
882
|
+
guestsCount: z.ZodOptional<z.ZodNumber>;
|
|
883
|
+
comments: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
884
|
+
time: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, Date, string>, z.ZodDate]>>;
|
|
885
|
+
email: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
886
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
887
|
+
tables: z.ZodOptional<z.ZodPipeline<z.ZodUnion<[z.ZodArray<z.ZodObject<Pick<{
|
|
888
|
+
id: z.ZodNumber;
|
|
889
|
+
tableNumber: z.ZodNumber;
|
|
890
|
+
capacity: z.ZodNumber;
|
|
891
|
+
additionalCapacity: z.ZodNumber;
|
|
892
|
+
isOccupied: z.ZodBoolean;
|
|
893
|
+
status: z.ZodNativeEnum<{
|
|
894
|
+
readonly AVAILABLE: "AVAILABLE";
|
|
895
|
+
readonly OCCUPIED: "OCCUPIED";
|
|
896
|
+
readonly RESERVED: "RESERVED";
|
|
897
|
+
readonly ORDERING: "ORDERING";
|
|
898
|
+
readonly SERVING: "SERVING";
|
|
899
|
+
readonly PAYMENT: "PAYMENT";
|
|
900
|
+
}>;
|
|
901
|
+
guests: z.ZodNumber;
|
|
902
|
+
originalCapacity: z.ZodNumber;
|
|
903
|
+
}, "id">, "strip", z.ZodTypeAny, {
|
|
904
|
+
id: number;
|
|
905
|
+
}, {
|
|
906
|
+
id: number;
|
|
907
|
+
}>, "many">, z.ZodEffects<z.ZodString, number[], string>]>, z.ZodDefault<z.ZodArray<z.ZodNumber, "many">>>>;
|
|
908
|
+
isActive: z.ZodOptional<z.ZodDefault<z.ZodUnion<[z.ZodBoolean, z.ZodEffects<z.ZodString, boolean | undefined, string>]>>>;
|
|
909
|
+
}, "strip", z.ZodTypeAny, {
|
|
910
|
+
status?: "PENDING" | "CONFIRMED" | "CANCELLED" | "COMPLETED" | "NO_SHOW" | undefined;
|
|
911
|
+
name?: string | undefined;
|
|
912
|
+
allergies?: ("NONE" | "GLUTEN" | "DAIRY" | "EGG" | "PEANUT" | "TREENUT" | "FISH" | "SHELLFISH" | "SOY" | "SESAME" | "CELERY" | "MUSTARD" | "LUPIN" | "SULPHITES" | "MOLLUSCS")[] | undefined;
|
|
913
|
+
guestsCount?: number | undefined;
|
|
914
|
+
comments?: string | null | undefined;
|
|
915
|
+
time?: Date | undefined;
|
|
916
|
+
email?: string | null | undefined;
|
|
917
|
+
phone?: string | undefined;
|
|
918
|
+
tables?: number[] | undefined;
|
|
919
|
+
isActive?: boolean | undefined;
|
|
920
|
+
}, {
|
|
921
|
+
status?: string | undefined;
|
|
922
|
+
name?: string | undefined;
|
|
923
|
+
allergies?: string | string[] | undefined;
|
|
924
|
+
guestsCount?: number | undefined;
|
|
925
|
+
comments?: string | null | undefined;
|
|
926
|
+
time?: string | Date | undefined;
|
|
927
|
+
email?: string | null | undefined;
|
|
928
|
+
phone?: string | undefined;
|
|
929
|
+
tables?: string | {
|
|
930
|
+
id: number;
|
|
931
|
+
}[] | undefined;
|
|
932
|
+
isActive?: string | boolean | undefined;
|
|
933
|
+
}>, {
|
|
934
|
+
status?: "PENDING" | "CONFIRMED" | "CANCELLED" | "COMPLETED" | "NO_SHOW" | undefined;
|
|
935
|
+
name?: string | undefined;
|
|
936
|
+
allergies?: ("NONE" | "GLUTEN" | "DAIRY" | "EGG" | "PEANUT" | "TREENUT" | "FISH" | "SHELLFISH" | "SOY" | "SESAME" | "CELERY" | "MUSTARD" | "LUPIN" | "SULPHITES" | "MOLLUSCS")[] | undefined;
|
|
937
|
+
guestsCount?: number | undefined;
|
|
938
|
+
comments?: string | null | undefined;
|
|
939
|
+
time?: Date | undefined;
|
|
940
|
+
email?: string | null | undefined;
|
|
941
|
+
phone?: string | undefined;
|
|
942
|
+
tables?: number[] | undefined;
|
|
943
|
+
isActive?: boolean | undefined;
|
|
944
|
+
}, {
|
|
945
|
+
status?: string | undefined;
|
|
946
|
+
name?: string | undefined;
|
|
947
|
+
allergies?: string | string[] | undefined;
|
|
948
|
+
guestsCount?: number | undefined;
|
|
949
|
+
comments?: string | null | undefined;
|
|
950
|
+
time?: string | Date | undefined;
|
|
951
|
+
email?: string | null | undefined;
|
|
952
|
+
phone?: string | undefined;
|
|
953
|
+
tables?: string | {
|
|
954
|
+
id: number;
|
|
955
|
+
}[] | undefined;
|
|
956
|
+
isActive?: string | boolean | undefined;
|
|
957
|
+
}>;
|
|
958
|
+
/**
|
|
959
|
+
* Type representing the data transfer object (DTO) for updating a reservation.
|
|
960
|
+
* This type is inferred from the `UpdateReservationSchema` using Zod.
|
|
961
|
+
*/
|
|
962
|
+
export type UpdateReservationDTO = z.infer<typeof UpdateReservationSchema>;
|
|
963
|
+
/**
|
|
964
|
+
* Type representing the ID of a reservation.
|
|
965
|
+
*
|
|
966
|
+
* This type is inferred from the `id` shape of the `ReservationSchema`.
|
|
967
|
+
*/
|
|
968
|
+
export type ReservationId = z.infer<typeof ReservationSchema.shape.id>;
|
|
969
|
+
/**
|
|
970
|
+
* Schema for validating partial updates to reservation guest information.
|
|
971
|
+
*
|
|
972
|
+
* This schema allows partial updates by making all fields optional and
|
|
973
|
+
* ensures that at least one field is provided when updating a reservation.
|
|
974
|
+
*
|
|
975
|
+
* Fields:
|
|
976
|
+
* - `email`: The email address of the guest.
|
|
977
|
+
* - `name`: The name of the guest.
|
|
978
|
+
* - `phone`: The phone number of the guest.
|
|
979
|
+
* - `allergies`: Any allergies the guest may have.
|
|
980
|
+
* - `guestsCount`: The number of guests.
|
|
981
|
+
*
|
|
982
|
+
* Validation:
|
|
983
|
+
* - At least one field must be provided to update a reservation.
|
|
984
|
+
*
|
|
985
|
+
* @constant {object} ReservationGuestInfoSchema
|
|
986
|
+
*/
|
|
987
|
+
export declare const ReservationGuestInfoSchema: z.ZodEffects<z.ZodObject<{
|
|
988
|
+
name: z.ZodOptional<z.ZodString>;
|
|
989
|
+
allergies: z.ZodOptional<z.ZodPipeline<z.ZodUnion<[z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], string[]>, z.ZodEffects<z.ZodString, string[], string>]>, z.ZodArray<z.ZodNativeEnum<{
|
|
990
|
+
readonly NONE: "NONE";
|
|
991
|
+
readonly GLUTEN: "GLUTEN";
|
|
992
|
+
readonly DAIRY: "DAIRY";
|
|
993
|
+
readonly EGG: "EGG";
|
|
994
|
+
readonly PEANUT: "PEANUT";
|
|
995
|
+
readonly TREENUT: "TREENUT";
|
|
996
|
+
readonly FISH: "FISH";
|
|
997
|
+
readonly SHELLFISH: "SHELLFISH";
|
|
998
|
+
readonly SOY: "SOY";
|
|
999
|
+
readonly SESAME: "SESAME";
|
|
1000
|
+
readonly CELERY: "CELERY";
|
|
1001
|
+
readonly MUSTARD: "MUSTARD";
|
|
1002
|
+
readonly LUPIN: "LUPIN";
|
|
1003
|
+
readonly SULPHITES: "SULPHITES";
|
|
1004
|
+
readonly MOLLUSCS: "MOLLUSCS";
|
|
1005
|
+
}>, "many">>>;
|
|
1006
|
+
guestsCount: z.ZodOptional<z.ZodNumber>;
|
|
1007
|
+
email: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
1008
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
1009
|
+
}, "strip", z.ZodTypeAny, {
|
|
1010
|
+
name?: string | undefined;
|
|
1011
|
+
allergies?: ("NONE" | "GLUTEN" | "DAIRY" | "EGG" | "PEANUT" | "TREENUT" | "FISH" | "SHELLFISH" | "SOY" | "SESAME" | "CELERY" | "MUSTARD" | "LUPIN" | "SULPHITES" | "MOLLUSCS")[] | undefined;
|
|
1012
|
+
guestsCount?: number | undefined;
|
|
1013
|
+
email?: string | null | undefined;
|
|
1014
|
+
phone?: string | undefined;
|
|
1015
|
+
}, {
|
|
1016
|
+
name?: string | undefined;
|
|
1017
|
+
allergies?: string | string[] | undefined;
|
|
1018
|
+
guestsCount?: number | undefined;
|
|
1019
|
+
email?: string | null | undefined;
|
|
1020
|
+
phone?: string | undefined;
|
|
1021
|
+
}>, {
|
|
1022
|
+
name?: string | undefined;
|
|
1023
|
+
allergies?: ("NONE" | "GLUTEN" | "DAIRY" | "EGG" | "PEANUT" | "TREENUT" | "FISH" | "SHELLFISH" | "SOY" | "SESAME" | "CELERY" | "MUSTARD" | "LUPIN" | "SULPHITES" | "MOLLUSCS")[] | undefined;
|
|
1024
|
+
guestsCount?: number | undefined;
|
|
1025
|
+
email?: string | null | undefined;
|
|
1026
|
+
phone?: string | undefined;
|
|
1027
|
+
}, {
|
|
1028
|
+
name?: string | undefined;
|
|
1029
|
+
allergies?: string | string[] | undefined;
|
|
1030
|
+
guestsCount?: number | undefined;
|
|
1031
|
+
email?: string | null | undefined;
|
|
1032
|
+
phone?: string | undefined;
|
|
1033
|
+
}>;
|
|
1034
|
+
/**
|
|
1035
|
+
* Type representing the guest information for a reservation.
|
|
1036
|
+
*
|
|
1037
|
+
* This type is inferred from the `ReservationGuestInfoSchema` using Zod's `infer` method.
|
|
1038
|
+
*
|
|
1039
|
+
* @see ReservationGuestInfoSchema
|
|
1040
|
+
*/
|
|
1041
|
+
export type ReservationGuestInfo = z.infer<typeof ReservationGuestInfoSchema>;
|
|
1042
|
+
//# sourceMappingURL=reservation.dto.d.ts.map
|