mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
add all enums
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
export enum EEventFilterStatus {
|
||||
All = -1,
|
||||
Pending = 1,
|
||||
Revision,
|
||||
Approved,
|
||||
Declined,
|
||||
Communicated,
|
||||
ToCommunicate,
|
||||
AllToCommunicate,
|
||||
PendingEvents,
|
||||
}
|
||||
|
||||
|
||||
// Define your TypeScript enum
|
||||
export enum EEventStatus {
|
||||
Pending = 1,
|
||||
Revision,
|
||||
Approved,
|
||||
Declined,
|
||||
Communicated,
|
||||
ToCommunicate,
|
||||
}
|
||||
|
||||
|
||||
export enum EEventCategory
|
||||
{
|
||||
Oficial = 1,
|
||||
Pessoal
|
||||
}
|
||||
|
||||
export enum EEventOwnerType {
|
||||
PR = 1,
|
||||
MD,
|
||||
Others
|
||||
}
|
||||
|
||||
|
||||
export enum EEventType
|
||||
{
|
||||
Meeting = 1,
|
||||
Travel,
|
||||
Conference,
|
||||
}
|
||||
|
||||
|
||||
export enum EAttendeeType {
|
||||
Required,
|
||||
Acknowledgment,
|
||||
Optional
|
||||
}
|
||||
|
||||
@@ -1,24 +1,25 @@
|
||||
import { z } from 'zod';
|
||||
import { EEventCategory, EEventOwnerType, EEventStatus, EEventType } from './enums';
|
||||
|
||||
const EventSchema = z.array(z.object({
|
||||
id: z.string(),
|
||||
owner: z.string().nullable(),
|
||||
ownerType: z.number(),// ['MD','PR', 'Other'] // Assuming "MD" is the only valid option based on provided data
|
||||
ownerType: z.nativeEnum(EEventOwnerType),// ['MD','PR', 'Other'] // Assuming "MD" is the only valid option based on provided data
|
||||
subject: z.string(),
|
||||
body: z.string(),
|
||||
location: z.string(),
|
||||
startDate: z.string().datetime({ offset: true }),
|
||||
endDate: z.string().datetime({ offset: true }),
|
||||
type: z.number(), // ['Meeting', 'Travel'] = [1,2 ]
|
||||
type: z.nativeEnum(EEventType), // ['Meeting', 'Travel'] = [1,2 ]
|
||||
// category: z.enum(['Oficial', 'Pessoal']), // Assuming "Oficial" is the only valid option based on provided data
|
||||
category: z.number(),
|
||||
category: z.nativeEnum(EEventCategory),
|
||||
isRecurring: z.boolean(),
|
||||
eventRecurrence: z.null(),
|
||||
hasAttachments: z.boolean(),
|
||||
isPrivate: z.boolean(),
|
||||
isAllDayEvent: z.boolean(),
|
||||
// status: z.enum(['Approved']), // Assuming "Approved" is the only valid option based on provided data
|
||||
status: z.number(), // Assuming "Approved" is the only valid option based on provided data
|
||||
status: z.nativeEnum(EEventStatus), // Assuming "Approved" is the only valid option based on provided data
|
||||
}))
|
||||
|
||||
export type EventListOutputDTO = z.infer<typeof EventSchema>;
|
||||
|
||||
@@ -1,22 +1,23 @@
|
||||
import { z } from "zod";
|
||||
import { EEventOwnerType, EEventType, EEventCategory, EEventStatus } from "./enums";
|
||||
|
||||
const EventToApproveList = z.array(z.object({
|
||||
id: z.string().uuid(),
|
||||
owner: z.string().nullable(),
|
||||
ownerType: z.enum(["PR", "MD", "Other"]),
|
||||
ownerType: z.nativeEnum(EEventOwnerType),
|
||||
subject: z.string(),
|
||||
body: z.string(),
|
||||
location: z.string(),
|
||||
startDate: z.string().datetime(),
|
||||
endDate: z.string().datetime(),
|
||||
type: z.enum(["Meeting"]),
|
||||
category: z.enum(["Oficial", "Pessoal"]),
|
||||
type: z.nativeEnum(EEventType),
|
||||
category: z.nativeEnum(EEventCategory),
|
||||
isRecurring: z.boolean(),
|
||||
eventRecurrence: z.any().nullable(),
|
||||
hasAttachments: z.boolean(),
|
||||
isPrivate: z.boolean(),
|
||||
isAllDayEvent: z.boolean(),
|
||||
status: z.enum(["Pending"])
|
||||
status: z.nativeEnum(EEventStatus)
|
||||
}))
|
||||
|
||||
export type EventToApproveListOutputDTO = z.infer<typeof EventToApproveList>;
|
||||
|
||||
Reference in New Issue
Block a user