mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
list events
This commit is contained in:
@@ -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>
|
||||
Reference in New Issue
Block a user