mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
39 lines
980 B
TypeScript
39 lines
980 B
TypeScript
|
|
import { z } from 'zod';
|
||
|
|
import { EEventCategory, EEventOwnerType, EEventType } from './enums';
|
||
|
|
|
||
|
|
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(),
|
||
|
|
until: z.string().nullable().optional()
|
||
|
|
});
|
||
|
|
|
||
|
|
export const EventUpdateInputDTOSchema = z.object({
|
||
|
|
userId: z.number(),
|
||
|
|
ownerType: z.nativeEnum(EEventOwnerType),
|
||
|
|
subject: z.string(),
|
||
|
|
body: z.string().optional(),
|
||
|
|
location: z.string(),
|
||
|
|
startDate: z.string(),
|
||
|
|
endDate: z.string(),
|
||
|
|
type: z.nativeEnum(EEventType),
|
||
|
|
category: z.nativeEnum(EEventCategory),
|
||
|
|
recurrence: recurrenceSchema,
|
||
|
|
isAllDayEvent: z.boolean(),
|
||
|
|
updateAllEvents: z.boolean()
|
||
|
|
});
|
||
|
|
|
||
|
|
export type EventUpdateInputDTO = z.infer<typeof EventUpdateInputDTOSchema>
|