list events

This commit is contained in:
Peter Maquiran
2024-05-29 15:45:34 +01:00
parent caa11d6be7
commit 38d36a6e49
22 changed files with 629 additions and 198 deletions
@@ -0,0 +1,62 @@
import { z } from 'zod';
export const AttachmentInputDTOSchema = z.object({
sourceId: z.string().nullable(),
sourceName: z.string().nullable(),
description: z.string().nullable(),
applicationId: z.number().int(),
}).strict();
const EAttendeeTypeDTO = z.enum(["0", "1", "2"]);
const CommentSchema = z.object({
message: z.string(),
createdAt: z.string(),
});
const AttendeeSchema = z.object({
id: z.string(),
name: z.string(),
attendeeType: EAttendeeTypeDTO,
emailAddress: z.string(),
wxUserId: z.number(),
});
const OwnerSchema = z.object({
wxUserId: z.number(),
wxFullName: z.string(),
wxeMail: z.string(),
userPhoto: z.string(),
});
const OrganizerSchema = z.object({
wxUserId: z.number(),
wxFullName: z.string(),
wxeMail: z.string(),
userPhoto: z.string(),
});
export const EventOutputDTOSchema = z.object({
id: z.string(),
owner: OwnerSchema,
ownerType: z.string(),
subject: z.string(),
body: z.string(),
location: z.string(),
startDate: z.string(),
endDate: z.string(),
type: z.string(),
category: z.string(),
attendees: z.array(AttendeeSchema),
isRecurring: z.boolean(),
eventRecurrence: z.null(),
hasAttachments: z.boolean(),
attachments:z.array(AttachmentInputDTOSchema),
comments: z.array(CommentSchema),
isPrivate: z.boolean(),
isAllDayEvent: z.boolean(),
organizer: OrganizerSchema,
status: z.string(),
});
export type EventOutputDTO = z.infer<typeof EventOutputDTOSchema>