@servemate/dto 1.0.6 → 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 +102 -6
- 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/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 +4 -4
- package/dist/dto/tables.dto.d.ts.map +1 -1
- package/dist/dto/tables.dto.js +10 -6
- 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 @@
|
|
|
1
|
+
{"version":3,"file":"reservation.dto.d.ts","sourceRoot":"","sources":["../../src/dto/reservation.dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgD5B,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE/D;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBpC,CAAC;AAEH;;GAEG;AACH,MAAM,M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;AAEH;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE/E;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAalC,CAAC;AAEH;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE3E;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AAEvE;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAerC,CAAC;AAEH;;;;;;GAMG;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC"}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReservationGuestInfoSchema = exports.UpdateReservationSchema = exports.ReservationDetailedSchema = exports.ReservationConflict = exports.ReservationWithTablesSchema = exports.CreateReservationSchema = exports.ReservationSearchCriteria = exports.ReservationSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const enums_1 = require("./enums");
|
|
6
|
+
const global_1 = require("./global");
|
|
7
|
+
const orders_dto_1 = require("./orders.dto");
|
|
8
|
+
const tables_dto_1 = require("./tables.dto");
|
|
9
|
+
/**
|
|
10
|
+
* Schema for validating reservation data using Zod.
|
|
11
|
+
*
|
|
12
|
+
* Properties:
|
|
13
|
+
* - `id`: A positive integer representing the reservation ID.
|
|
14
|
+
* - `guestsCount`: A positive integer representing the number of guests.
|
|
15
|
+
* - `time`: A union of string (transformed to Date) or Date representing the reservation time.
|
|
16
|
+
* - `name`: A string representing the name of the person making the reservation.
|
|
17
|
+
* - `email`: An optional nullable string representing the email of the person making the reservation.
|
|
18
|
+
* - `phone`: A string representing the phone number of the person making the reservation.
|
|
19
|
+
* - `status`: A string transformed to uppercase and validated against the `ReservationStatus` enum, defaulting to `PENDING`.
|
|
20
|
+
* - `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.
|
|
21
|
+
* - `tables`: A union of an array of table IDs or a comma-separated string of table IDs, defaulting to an empty array.
|
|
22
|
+
* - `comments`: An optional nullable string for additional comments.
|
|
23
|
+
* - `createdAt`: A date representing when the reservation was created, defaulting to the current date.
|
|
24
|
+
* - `updatedAt`: A date representing when the reservation was last updated.
|
|
25
|
+
* - `isActive`: A union of boolean or string (transformed to boolean), defaulting to `true`.
|
|
26
|
+
*/
|
|
27
|
+
exports.ReservationSchema = zod_1.z.object({
|
|
28
|
+
id: zod_1.z.coerce.number().int().positive(),
|
|
29
|
+
guestsCount: zod_1.z.coerce.number().int().positive(),
|
|
30
|
+
time: zod_1.z.union([zod_1.z.string().transform((time) => new Date(time)), zod_1.z.date()]),
|
|
31
|
+
name: zod_1.z.string(),
|
|
32
|
+
email: zod_1.z.string().email().nullable().optional(),
|
|
33
|
+
phone: zod_1.z.string(),
|
|
34
|
+
status: zod_1.z
|
|
35
|
+
.string()
|
|
36
|
+
.transform((status) => status === null || status === void 0 ? void 0 : status.toUpperCase())
|
|
37
|
+
.pipe(zod_1.z.nativeEnum(enums_1.ReservationStatus))
|
|
38
|
+
.default(enums_1.ReservationStatus.PENDING),
|
|
39
|
+
allergies: zod_1.z
|
|
40
|
+
.union([
|
|
41
|
+
zod_1.z
|
|
42
|
+
.array(zod_1.z.string())
|
|
43
|
+
.transform((allergies) => allergies.map((allergy) => allergy.toUpperCase())),
|
|
44
|
+
zod_1.z.string().transform((str) => {
|
|
45
|
+
if (!str)
|
|
46
|
+
return [];
|
|
47
|
+
return str
|
|
48
|
+
.split(',')
|
|
49
|
+
.map((item) => item.trim().toUpperCase())
|
|
50
|
+
.filter(Boolean);
|
|
51
|
+
}),
|
|
52
|
+
])
|
|
53
|
+
.pipe(zod_1.z.array(zod_1.z.nativeEnum(orders_dto_1.Allergies))),
|
|
54
|
+
tables: zod_1.z
|
|
55
|
+
.union([
|
|
56
|
+
zod_1.z.array(tables_dto_1.TableBaseTableSchema.pick({ id: true })),
|
|
57
|
+
zod_1.z.string().transform((tables) => {
|
|
58
|
+
if (!tables)
|
|
59
|
+
return [];
|
|
60
|
+
return tables.split(',').map((table) => Number(table.trim()));
|
|
61
|
+
}),
|
|
62
|
+
])
|
|
63
|
+
.pipe(zod_1.z.array(tables_dto_1.TableBaseTableSchema.shape.id).default([])),
|
|
64
|
+
comments: zod_1.z.string().nullable().optional(),
|
|
65
|
+
createdAt: zod_1.z.date().default(() => new Date()),
|
|
66
|
+
updatedAt: zod_1.z.date(),
|
|
67
|
+
isActive: zod_1.z
|
|
68
|
+
.union([
|
|
69
|
+
zod_1.z.boolean(),
|
|
70
|
+
zod_1.z.string().transform((isActive) => {
|
|
71
|
+
if (isActive === 'true')
|
|
72
|
+
return true;
|
|
73
|
+
if (isActive === 'false')
|
|
74
|
+
return false;
|
|
75
|
+
return undefined;
|
|
76
|
+
}),
|
|
77
|
+
])
|
|
78
|
+
.default(true),
|
|
79
|
+
});
|
|
80
|
+
/**
|
|
81
|
+
* @constant
|
|
82
|
+
* @name ReservationSearchCriteria
|
|
83
|
+
* @description
|
|
84
|
+
* This schema defines the search criteria for reservations. It extends the base `searchCriteriaSchema`
|
|
85
|
+
* and includes a partial selection of fields from `ReservationSchema` with additional search-specific fields.
|
|
86
|
+
*
|
|
87
|
+
* @property {string} sortBy - The field by which to sort the results. Defaults to 'time'.
|
|
88
|
+
* @property {number} [guestsCountMin] - The minimum number of guests. Must be a positive integer.
|
|
89
|
+
* @property {number} [guestsCountMax] - The maximum number of guests. Must be a positive integer.
|
|
90
|
+
* @property {Date | string} [timeStart] - The start time for the reservation search. Can be a string that will be transformed into a Date object.
|
|
91
|
+
* @property {Date | string} [timeEnd] - The end time for the reservation search. Can be a string that will be transformed into a Date object.
|
|
92
|
+
*
|
|
93
|
+
* @extends searchCriteriaSchema
|
|
94
|
+
* @see ReservationSchema
|
|
95
|
+
*/
|
|
96
|
+
exports.ReservationSearchCriteria = global_1.searchCriteriaSchema.extend({
|
|
97
|
+
...exports.ReservationSchema.pick({
|
|
98
|
+
name: true,
|
|
99
|
+
email: true,
|
|
100
|
+
phone: true,
|
|
101
|
+
status: true,
|
|
102
|
+
guestsCount: true,
|
|
103
|
+
time: true,
|
|
104
|
+
allergies: true,
|
|
105
|
+
tables: true,
|
|
106
|
+
isActive: true,
|
|
107
|
+
}).partial().shape,
|
|
108
|
+
sortBy: zod_1.z.string().default('time'),
|
|
109
|
+
guestsCountMin: zod_1.z.coerce.number().int().positive().optional(),
|
|
110
|
+
guestsCountMax: zod_1.z.coerce.number().int().positive().optional(),
|
|
111
|
+
timeStart: zod_1.z.union([zod_1.z.string().transform((time) => new Date(time)), zod_1.z.date()]).optional(),
|
|
112
|
+
timeEnd: zod_1.z.union([zod_1.z.string().transform((time) => new Date(time)), zod_1.z.date()]).optional(),
|
|
113
|
+
});
|
|
114
|
+
/**
|
|
115
|
+
* Schema for creating a reservation, omitting the following fields:
|
|
116
|
+
* - `id`: The unique identifier for the reservation.
|
|
117
|
+
* - `updatedAt`: The timestamp when the reservation was last updated.
|
|
118
|
+
* - `createdAt`: The timestamp when the reservation was created.
|
|
119
|
+
* - `isActive`: The status indicating whether the reservation is active.
|
|
120
|
+
*/
|
|
121
|
+
exports.CreateReservationSchema = exports.ReservationSchema.omit({
|
|
122
|
+
id: true,
|
|
123
|
+
updatedAt: true,
|
|
124
|
+
createdAt: true,
|
|
125
|
+
isActive: true,
|
|
126
|
+
});
|
|
127
|
+
/**
|
|
128
|
+
* Extends the ReservationSchema to include an array of tables.
|
|
129
|
+
* Each table in the array contains only the `id` and `tableNumber` properties.
|
|
130
|
+
*
|
|
131
|
+
* @constant
|
|
132
|
+
* @type {ZodSchema}
|
|
133
|
+
*/
|
|
134
|
+
exports.ReservationWithTablesSchema = exports.ReservationSchema.extend({
|
|
135
|
+
tables: tables_dto_1.TableSchema.pick({ id: true, tableNumber: true }).array(),
|
|
136
|
+
});
|
|
137
|
+
/**
|
|
138
|
+
* Represents a conflict in a reservation.
|
|
139
|
+
*
|
|
140
|
+
* @constant
|
|
141
|
+
* @type {z.ZodObject}
|
|
142
|
+
*
|
|
143
|
+
* @property {string} reservationId - The unique identifier of the reservation.
|
|
144
|
+
* @property {string} time - The time of the reservation.
|
|
145
|
+
* @property {Array<{ id: string, tableNumber: number }>} tables - An array of tables involved in the reservation conflict, each containing an id and table number.
|
|
146
|
+
*/
|
|
147
|
+
exports.ReservationConflict = zod_1.z.object({
|
|
148
|
+
reservationId: exports.ReservationSchema.shape.id,
|
|
149
|
+
time: exports.ReservationSchema.shape.time,
|
|
150
|
+
tables: tables_dto_1.TableBaseTableSchema.pick({ id: true, tableNumber: true }).array(),
|
|
151
|
+
});
|
|
152
|
+
exports.ReservationDetailedSchema = zod_1.z.object({
|
|
153
|
+
reservation: exports.ReservationWithTablesSchema,
|
|
154
|
+
conflict: exports.ReservationConflict.array(),
|
|
155
|
+
});
|
|
156
|
+
/**
|
|
157
|
+
* Schema for updating a reservation.
|
|
158
|
+
*
|
|
159
|
+
* This schema is derived from `ReservationSchema` by omitting the fields
|
|
160
|
+
* `createdAt`, `updatedAt`, and `id`. The resulting schema is then made
|
|
161
|
+
* partially optional, meaning that any of the remaining fields can be
|
|
162
|
+
* provided, but none are required.
|
|
163
|
+
*
|
|
164
|
+
* Additionally, a refinement is added to ensure that at least one field
|
|
165
|
+
* is provided when updating a reservation. If no fields are provided,
|
|
166
|
+
* an error message "At least one field must be provided to update a reservation."
|
|
167
|
+
* will be returned.
|
|
168
|
+
*/
|
|
169
|
+
exports.UpdateReservationSchema = exports.ReservationSchema.omit({
|
|
170
|
+
createdAt: true,
|
|
171
|
+
updatedAt: true,
|
|
172
|
+
id: true,
|
|
173
|
+
})
|
|
174
|
+
.partial()
|
|
175
|
+
.refine((data) => {
|
|
176
|
+
return Object.keys(data).length > 0;
|
|
177
|
+
}, {
|
|
178
|
+
message: 'At least one field must be provided to update a reservation.',
|
|
179
|
+
});
|
|
180
|
+
/**
|
|
181
|
+
* Schema for validating partial updates to reservation guest information.
|
|
182
|
+
*
|
|
183
|
+
* This schema allows partial updates by making all fields optional and
|
|
184
|
+
* ensures that at least one field is provided when updating a reservation.
|
|
185
|
+
*
|
|
186
|
+
* Fields:
|
|
187
|
+
* - `email`: The email address of the guest.
|
|
188
|
+
* - `name`: The name of the guest.
|
|
189
|
+
* - `phone`: The phone number of the guest.
|
|
190
|
+
* - `allergies`: Any allergies the guest may have.
|
|
191
|
+
* - `guestsCount`: The number of guests.
|
|
192
|
+
*
|
|
193
|
+
* Validation:
|
|
194
|
+
* - At least one field must be provided to update a reservation.
|
|
195
|
+
*
|
|
196
|
+
* @constant {object} ReservationGuestInfoSchema
|
|
197
|
+
*/
|
|
198
|
+
exports.ReservationGuestInfoSchema = exports.ReservationSchema.pick({
|
|
199
|
+
email: true,
|
|
200
|
+
name: true,
|
|
201
|
+
phone: true,
|
|
202
|
+
allergies: true,
|
|
203
|
+
guestsCount: true,
|
|
204
|
+
})
|
|
205
|
+
.partial()
|
|
206
|
+
.refine((data) => {
|
|
207
|
+
return Object.keys(data).length > 0;
|
|
208
|
+
}, {
|
|
209
|
+
message: 'At least one field must be provided to update a reservation.',
|
|
210
|
+
});
|
|
211
|
+
//# sourceMappingURL=reservation.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reservation.dto.js","sourceRoot":"","sources":["../../src/dto/reservation.dto.ts"],"names":[],"mappings":";;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AAM,CACN,CAAC,IAAI,EAAE,EAAE;IACR,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;AACrC,CAAC,EACD;IACC,OAAO,EAAE,8DAA8D;CACvE,CACD,CAAC;AAeH;;;;;;;;;;;;;;;;;GAiBG;AACU,QAAA,0BAA0B,GAAG,yBAAiB,CAAC,IAAI,CAAC;IAChE,KAAK,EAAE,IAAI;IACX,IAAI,EAAE,IAAI;IACV,KAAK,EAAE,IAAI;IACX,SAAS,EAAE,IAAI;IACf,WAAW,EAAE,IAAI;CACjB,CAAC;KACA,OAAO,EAAE;KACT,MAAM,CACN,CAAC,IAAI,EAAE,EAAE;IACR,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;AACrC,CAAC,EACD;IACC,OAAO,EAAE,8DAA8D;CACvE,CACD,CAAC"}
|
package/dist/dto/tables.dto.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export type SeatingType = (typeof SeatingType)[keyof typeof SeatingType];
|
|
|
23
23
|
/**
|
|
24
24
|
* Table-related schemas
|
|
25
25
|
*/
|
|
26
|
-
export declare const
|
|
26
|
+
export declare const TableBaseTableSchema: z.ZodObject<{
|
|
27
27
|
id: z.ZodNumber;
|
|
28
28
|
tableNumber: z.ZodNumber;
|
|
29
29
|
capacity: z.ZodNumber;
|
|
@@ -76,10 +76,10 @@ export declare const TableSeatingSchema: z.ZodObject<z.objectUtil.extendShape<Pi
|
|
|
76
76
|
originalCapacity: z.ZodNumber;
|
|
77
77
|
}, "tableNumber" | "guests">, {
|
|
78
78
|
reservationId: z.ZodOptional<z.ZodNumber>;
|
|
79
|
-
SeatingType: z.ZodNativeEnum<{
|
|
79
|
+
SeatingType: z.ZodDefault<z.ZodPipeline<z.ZodEffects<z.ZodString, string, string>, z.ZodNativeEnum<{
|
|
80
80
|
readonly WALK_IN: "WALK_IN";
|
|
81
81
|
readonly RESERVATION: "RESERVATION";
|
|
82
|
-
}
|
|
82
|
+
}>>>;
|
|
83
83
|
}>, "strip", z.ZodTypeAny, {
|
|
84
84
|
tableNumber: number;
|
|
85
85
|
guests: number;
|
|
@@ -88,8 +88,8 @@ export declare const TableSeatingSchema: z.ZodObject<z.objectUtil.extendShape<Pi
|
|
|
88
88
|
}, {
|
|
89
89
|
tableNumber: number;
|
|
90
90
|
guests: number;
|
|
91
|
-
SeatingType: "WALK_IN" | "RESERVATION";
|
|
92
91
|
reservationId?: number | undefined;
|
|
92
|
+
SeatingType?: string | undefined;
|
|
93
93
|
}>;
|
|
94
94
|
export declare const TableAssignmentSchema: z.ZodObject<{
|
|
95
95
|
serverId: z.ZodNumber;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tables.dto.d.ts","sourceRoot":"","sources":["../../src/dto/tables.dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;;GAGG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;CAUvB,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,OAAO,oBAAoB,CAAC,CAAC;AAEhG,eAAO,MAAM,WAAW;;;CAGd,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,OAAO,WAAW,CAAC,CAAC;AAEzE;;GAEG;AACH,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"tables.dto.d.ts","sourceRoot":"","sources":["../../src/dto/tables.dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;;GAGG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;CAUvB,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,OAAO,oBAAoB,CAAC,CAAC;AAEhG,eAAO,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AAC;IACzB,SAAS,EAAE,KAAK,GAAG,MAAM,CAAC;CAC1B,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,SAAS,EAAE,kBAAkB,CAAC,CAAC;AAEhE,MAAM,MAAM,UAAU,GAAG;IACxB,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE7D;;;;GAIG;AACH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAEpD,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
|
package/dist/dto/tables.dto.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TableIdSchema = exports.TableUpdatesSchema = exports.TableCreateSchema = exports.TableSearchCriteriaSchema = exports.TableSchema = exports.TableAssignmentSchema = exports.TableSeatingSchema = exports.
|
|
3
|
+
exports.TableIdSchema = exports.TableUpdatesSchema = exports.TableCreateSchema = exports.TableSearchCriteriaSchema = exports.TableSchema = exports.TableAssignmentSchema = exports.TableSeatingSchema = exports.TableBaseTableSchema = exports.SeatingType = exports.TableSortOptionsEnum = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const enums_1 = require("./enums");
|
|
6
6
|
const orders_dto_1 = require("./orders.dto");
|
|
@@ -26,9 +26,9 @@ exports.SeatingType = {
|
|
|
26
26
|
/**
|
|
27
27
|
* Table-related schemas
|
|
28
28
|
*/
|
|
29
|
-
exports.
|
|
29
|
+
exports.TableBaseTableSchema = zod_1.z.object({
|
|
30
30
|
id: zod_1.z.number(),
|
|
31
|
-
tableNumber: zod_1.z.number().positive(),
|
|
31
|
+
tableNumber: zod_1.z.number().int().positive(),
|
|
32
32
|
capacity: zod_1.z.number(),
|
|
33
33
|
additionalCapacity: zod_1.z.number(),
|
|
34
34
|
isOccupied: zod_1.z.boolean(),
|
|
@@ -36,19 +36,23 @@ exports.BaseTableSchema = zod_1.z.object({
|
|
|
36
36
|
guests: zod_1.z.number(),
|
|
37
37
|
originalCapacity: zod_1.z.number(),
|
|
38
38
|
});
|
|
39
|
-
exports.TableSeatingSchema = exports.
|
|
39
|
+
exports.TableSeatingSchema = exports.TableBaseTableSchema.pick({
|
|
40
40
|
tableNumber: true,
|
|
41
41
|
guests: true,
|
|
42
42
|
}).extend({
|
|
43
43
|
reservationId: zod_1.z.number().positive().int().optional(),
|
|
44
|
-
SeatingType: zod_1.z
|
|
44
|
+
SeatingType: zod_1.z
|
|
45
|
+
.string()
|
|
46
|
+
.transform((status) => status === null || status === void 0 ? void 0 : status.toUpperCase())
|
|
47
|
+
.pipe(zod_1.z.nativeEnum(exports.SeatingType))
|
|
48
|
+
.default('WALK_IN'),
|
|
45
49
|
});
|
|
46
50
|
exports.TableAssignmentSchema = zod_1.z.object({
|
|
47
51
|
serverId: zod_1.z.coerce.number(),
|
|
48
52
|
isPrimary: zod_1.z.boolean().default(true),
|
|
49
53
|
assignedTables: zod_1.z.array(zod_1.z.coerce.number()),
|
|
50
54
|
});
|
|
51
|
-
exports.TableSchema = exports.
|
|
55
|
+
exports.TableSchema = exports.TableBaseTableSchema.extend({
|
|
52
56
|
orders: zod_1.z
|
|
53
57
|
.array(orders_dto_1.OrderSchema.pick({
|
|
54
58
|
id: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tables.dto.js","sourceRoot":"","sources":["../../src/dto/tables.dto.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,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AAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC,EAAE;QACrC,OAAO,EAAE,6BAA6B;KACtC,CAAC;CACH,CAAC,CAAC"}
|
package/dist/dto/user.dto.d.ts
CHANGED
|
@@ -42,8 +42,8 @@ export declare const UserSchema: z.ZodObject<{
|
|
|
42
42
|
createdAt: Date;
|
|
43
43
|
updatedAt: Date;
|
|
44
44
|
email: string;
|
|
45
|
-
role: "ADMIN" | "USER" | "HOST" | "MANAGER";
|
|
46
45
|
isActive: boolean;
|
|
46
|
+
role: "ADMIN" | "USER" | "HOST" | "MANAGER";
|
|
47
47
|
password: string;
|
|
48
48
|
lastLogin?: Date | null | undefined;
|
|
49
49
|
}, {
|
|
@@ -160,8 +160,8 @@ export declare const UserParamSchema: z.ZodObject<{
|
|
|
160
160
|
name?: string | undefined;
|
|
161
161
|
sortBy?: "id" | "name" | "createdAt" | "updatedAt" | "email" | "role" | undefined;
|
|
162
162
|
email?: string | undefined;
|
|
163
|
-
role?: "ADMIN" | "USER" | "HOST" | "MANAGER" | undefined;
|
|
164
163
|
isActive?: boolean | undefined;
|
|
164
|
+
role?: "ADMIN" | "USER" | "HOST" | "MANAGER" | undefined;
|
|
165
165
|
createdAfter?: string | undefined;
|
|
166
166
|
createdBefore?: string | undefined;
|
|
167
167
|
}, {
|
|
@@ -172,8 +172,8 @@ export declare const UserParamSchema: z.ZodObject<{
|
|
|
172
172
|
name?: string | undefined;
|
|
173
173
|
sortBy?: "id" | "name" | "createdAt" | "updatedAt" | "email" | "role" | undefined;
|
|
174
174
|
email?: string | undefined;
|
|
175
|
-
role?: string | undefined;
|
|
176
175
|
isActive?: "true" | "false" | undefined;
|
|
176
|
+
role?: string | undefined;
|
|
177
177
|
createdAfter?: string | undefined;
|
|
178
178
|
createdBefore?: string | undefined;
|
|
179
179
|
}>;
|
|
@@ -189,37 +189,37 @@ export declare const UserParamSchema: z.ZodObject<{
|
|
|
189
189
|
export declare const UpdateUserSchema: z.ZodEffects<z.ZodObject<{
|
|
190
190
|
name: z.ZodOptional<z.ZodString>;
|
|
191
191
|
email: z.ZodOptional<z.ZodString>;
|
|
192
|
+
isActive: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
192
193
|
role: z.ZodOptional<z.ZodNativeEnum<{
|
|
193
194
|
readonly ADMIN: "ADMIN";
|
|
194
195
|
readonly USER: "USER";
|
|
195
196
|
readonly HOST: "HOST";
|
|
196
197
|
readonly MANAGER: "MANAGER";
|
|
197
198
|
}>>;
|
|
198
|
-
isActive: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
199
199
|
lastLogin: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodDate>>>;
|
|
200
200
|
}, "strip", z.ZodTypeAny, {
|
|
201
201
|
name?: string | undefined;
|
|
202
202
|
email?: string | undefined;
|
|
203
|
-
role?: "ADMIN" | "USER" | "HOST" | "MANAGER" | undefined;
|
|
204
203
|
isActive?: boolean | undefined;
|
|
204
|
+
role?: "ADMIN" | "USER" | "HOST" | "MANAGER" | undefined;
|
|
205
205
|
lastLogin?: Date | null | undefined;
|
|
206
206
|
}, {
|
|
207
207
|
name?: string | undefined;
|
|
208
208
|
email?: string | undefined;
|
|
209
|
-
role?: "ADMIN" | "USER" | "HOST" | "MANAGER" | undefined;
|
|
210
209
|
isActive?: boolean | undefined;
|
|
210
|
+
role?: "ADMIN" | "USER" | "HOST" | "MANAGER" | undefined;
|
|
211
211
|
lastLogin?: Date | null | undefined;
|
|
212
212
|
}>, {
|
|
213
213
|
name?: string | undefined;
|
|
214
214
|
email?: string | undefined;
|
|
215
|
-
role?: "ADMIN" | "USER" | "HOST" | "MANAGER" | undefined;
|
|
216
215
|
isActive?: boolean | undefined;
|
|
216
|
+
role?: "ADMIN" | "USER" | "HOST" | "MANAGER" | undefined;
|
|
217
217
|
lastLogin?: Date | null | undefined;
|
|
218
218
|
}, {
|
|
219
219
|
name?: string | undefined;
|
|
220
220
|
email?: string | undefined;
|
|
221
|
-
role?: "ADMIN" | "USER" | "HOST" | "MANAGER" | undefined;
|
|
222
221
|
isActive?: boolean | undefined;
|
|
222
|
+
role?: "ADMIN" | "USER" | "HOST" | "MANAGER" | undefined;
|
|
223
223
|
lastLogin?: Date | null | undefined;
|
|
224
224
|
}>;
|
|
225
225
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@servemate/dto",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "Comprehensive DTO package for ServeMate restaurant management system. Includes type-safe DTOs with Zod validation for users, orders, payments, tables, and menu items management.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|