This commit is contained in:
Peter Maquiran
2024-06-13 16:01:33 +01:00
parent 35b1f3ae08
commit ec1fd5ad91
8 changed files with 146 additions and 47 deletions
@@ -18,7 +18,7 @@ const CommentSchema = z.object({
const AttendeeSchema = z.object({
id: z.string(),
name: z.string(),
attendeeType: z.enum(["Required", "Acknowledgment", "Optional"]),
attendeeType: z.enum(["Required", "Acknowledgment", "Optional"]), // ["Required", "Acknowledgment", "Optional"] = [1,2,3]
emailAddress: z.string(),
wxUserId: z.number(),
});
@@ -50,14 +50,14 @@ const EventRecurrenceSchema = z.object({
export const EventOutputDTOSchema = z.object({
id: z.string(),
owner: OwnerSchema,
ownerType: z.enum(["PR", "MD", "Other"]),
ownerType: z.number(), // ["PR", "MD", "Other"] = [1,2,3],
subject: z.string(),
body: z.string(),
location: z.string(),
startDate: z.string(),
endDate: z.string(),
type: z.string(),
category: z.enum(['Oficial', 'Pessoal']),
category: z.number(), // ['Oficial', 'Pessoal'] = [1, 2]
attendees: z.array(AttendeeSchema),
isRecurring: z.boolean(),
eventRecurrence: EventRecurrenceSchema,
@@ -67,7 +67,7 @@ export const EventOutputDTOSchema = z.object({
isPrivate: z.boolean(),
isAllDayEvent: z.boolean(),
organizer: OrganizerSchema,
status: z.enum(['Pending', 'Revision']),
status: z.number(), // ['Pending', 'Revision', 'Approved', 'Declined', 'Communicated', 'ToCommunicate'] = [1, 2, 3, 4, 5, 6]
});
export type EventOutputDTO = z.infer<typeof EventOutputDTOSchema>
@@ -3,20 +3,22 @@ import { z } from 'zod';
const EventSchema = z.array(z.object({
id: z.string(),
owner: z.string().nullable(),
ownerType: z.enum(['MD','PR', 'Other']), // Assuming "MD" is the only valid option based on provided data
ownerType: z.number(),// ['MD','PR', 'Other'] // Assuming "MD" is the only valid option based on provided data
subject: z.string(),
body: z.string(),
location: z.string(),
startDate: z.string().datetime({ offset: true }),
endDate: z.string().datetime({ offset: true }),
type: z.enum(['Meeting', 'Travel']),
category: z.enum(['Oficial', 'Pessoal']), // Assuming "Oficial" is the only valid option based on provided data
type: z.number(), // ['Meeting', 'Travel'] = [1,2 ]
// category: z.enum(['Oficial', 'Pessoal']), // Assuming "Oficial" is the only valid option based on provided data
category: z.number(),
isRecurring: z.boolean(),
eventRecurrence: z.null(),
hasAttachments: z.boolean(),
isPrivate: z.boolean(),
isAllDayEvent: z.boolean(),
status: z.enum(['Approved']), // Assuming "Approved" is the only valid option based on provided data
// status: z.enum(['Approved']), // Assuming "Approved" is the only valid option based on provided data
status: z.number(), // Assuming "Approved" is the only valid option based on provided data
}))
export type EventListOutputDTO = z.infer<typeof EventSchema>;