Files
doneit-web/src/app/services/Repositorys/Agenda/model/eventInputDTO.ts
T

41 lines
1.0 KiB
TypeScript
Raw Normal View History

2024-05-30 10:20:46 +01:00
import { z } from 'zod';
import { EEventCategory, EEventOwnerType, EEventType } from './enums';
2024-05-30 10:20:46 +01:00
const attendeeSchema = z.object({
name: z.string(),
emailAddress: z.string(),
attendeeType: z.number(),
wxUserId: z.number()
2024-05-30 10:20:46 +01:00
});
const attachmentSchema = z.object({
docId: z.number(),
sourceName: z.string(),
description: z.string(),
applicationId: z.number()
2024-05-30 10:20:46 +01:00
});
const recurrenceSchema = z.object({
frequency: z.number(),
until: z.string().nullable().optional()
2024-05-30 10:20:46 +01:00
});
export const EventInputDTOSchema = z.object({
2024-05-30 10:20:46 +01:00
userId: z.number(),
ownerType: z.nativeEnum(EEventOwnerType),
2024-05-30 10:20:46 +01:00
subject: z.string(),
body: z.string(),
location: z.string(),
startDate: z.string(),
endDate: z.string(),
type: z.nativeEnum(EEventType),
category: z.nativeEnum(EEventCategory),
2024-05-30 10:20:46 +01:00
attendees: z.array(attendeeSchema),
attachments: z.array(attachmentSchema),
recurrence: recurrenceSchema,
organizerId: z.number(),
isAllDayEvent: z.boolean()
});
export type EventInputDTO = z.infer<typeof EventInputDTOSchema>