Renamed Student to Attendee
This commit is contained in:
33
packages/shared/src/schemas/attendees.ts
Normal file
33
packages/shared/src/schemas/attendees.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import { z } from 'zod';
|
||||
import { createPageSchema, createPageSizeSchema, createPaginationSchema } from './pagination.js';
|
||||
|
||||
const isoDateTimeSchema = z.string().datetime();
|
||||
const pageSchema = createPageSchema();
|
||||
const pageSizeSchema = createPageSizeSchema(10);
|
||||
const paginationSchema = createPaginationSchema();
|
||||
|
||||
export const AttendeeDtoSchema = z.object({
|
||||
id: z.string(),
|
||||
groupId: z.string(),
|
||||
fullName: z.string(),
|
||||
email: z.string().nullable(),
|
||||
phone: z.string().nullable(),
|
||||
guardianName: z.string().nullable(),
|
||||
guardianPhone: z.string().nullable(),
|
||||
notes: z.string().nullable(),
|
||||
createdAt: isoDateTimeSchema,
|
||||
updatedAt: isoDateTimeSchema,
|
||||
});
|
||||
export type AttendeeDto = z.output<typeof AttendeeDtoSchema>;
|
||||
|
||||
export const AttendeeQuerySchema = z.object({
|
||||
page: pageSchema,
|
||||
pageSize: pageSizeSchema,
|
||||
});
|
||||
export type AttendeeQuery = z.output<typeof AttendeeQuerySchema>;
|
||||
|
||||
export const AttendeeListSchema = z.object({
|
||||
data: z.array(AttendeeDtoSchema),
|
||||
pagination: paginationSchema,
|
||||
});
|
||||
export type AttendeeList = z.output<typeof AttendeeListSchema>;
|
||||
Reference in New Issue
Block a user