list event to approve

This commit is contained in:
Peter Maquiran
2024-05-30 10:20:46 +01:00
parent 44b2fa7307
commit 3c4ec1a432
8 changed files with 199 additions and 49 deletions
@@ -0,0 +1,42 @@
import { z } from 'zod';
const attendeeSchema = z.object({
name: z.string(),
emailAddress: z.string(),
attendeeType: z.number(),
wxUserId: z.number()
});
const attachmentSchema = z.object({
docId: z.number(),
sourceName: z.string(),
description: z.string(),
applicationId: z.number()
});
const recurrenceSchema = z.object({
frequency: z.number(),
occurrences: z.number()
});
const EventInputDTOSchema = z.object({
userId: z.number(),
ownerType: z.number(),
subject: z.string(),
body: z.string(),
location: z.string(),
startDate: z.string().datetime(),
endDate: z.string().datetime(),
type: z.number(),
category: z.number(),
attendees: z.array(attendeeSchema),
attachments: z.array(attachmentSchema),
recurrence: recurrenceSchema,
organizerId: z.number(),
isAllDayEvent: z.boolean()
});
export type EventInputDTO = z.infer<typeof EventInputDTOSchema>
@@ -1,6 +1,6 @@
import { z } from "zod";
const EventToApproveList = z.object({
const EventToApproveList = z.array(z.object({
id: z.string().uuid(),
owner: z.string().nullable(),
ownerType: z.enum(["PR", "MD", "Other"]),
@@ -17,4 +17,6 @@ const EventToApproveList = z.object({
isPrivate: z.boolean(),
isAllDayEvent: z.boolean(),
status: z.enum(["Pending"])
});
}))
export type EventToApproveListOutputDTO = z.infer<typeof EventToApproveList>;