mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
ITOTEAM-525 send the rigth category and ownertype
This commit is contained in:
@@ -20,6 +20,8 @@ import { EventToApproveDataOutputDTOSchema } from './model/eventToApproveListOut
|
||||
import { EventOutputDTOSchema } from './model/eventDTOOutput';
|
||||
import { SharedCalendarListDetectChanges } from './async/change/shareCalendarChangeDetector';
|
||||
import { SharedCalendarListItemOutputDTO } from './model/sharedCalendarOutputDTO';
|
||||
import { EventInputDTOSchema } from './agendaDataModels';
|
||||
import { EventUpdateInputDTOSchema } from './model/eventUpdateInputDtO';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -156,7 +158,7 @@ export class AgendaDataRepositoryService {
|
||||
}
|
||||
}
|
||||
|
||||
createEvent(eventData: Event, documents, calendar: TableSharedCalendar) {
|
||||
createEvent(eventData: Event, documents, calendar: TableSharedCalendar, tracing: TracingType) {
|
||||
console.log('create repository 1',eventData, calendar)
|
||||
|
||||
let eventInput = {
|
||||
@@ -181,10 +183,11 @@ export class AgendaDataRepositoryService {
|
||||
|
||||
console.log('create repository 2',eventInput)
|
||||
|
||||
APINODReturn(EventInputDTOSchema, eventInput, 'post/Events', tracing)
|
||||
return this.agendaDataService.createEvent(eventInput)
|
||||
}
|
||||
|
||||
updateEvent(eventId, eventData, editAllEvent, calendar: TableSharedCalendar) {
|
||||
updateEvent(eventId, eventData, editAllEvent, calendar: TableSharedCalendar, tracing: TracingType) {
|
||||
|
||||
let body;
|
||||
if(typeof eventData?.Body == 'object') {
|
||||
@@ -212,7 +215,9 @@ export class AgendaDataRepositoryService {
|
||||
}
|
||||
|
||||
console.log({eventData})
|
||||
console.log({eventInput})
|
||||
|
||||
APINODReturn(EventUpdateInputDTOSchema, eventInput, 'PUT/Events', tracing)
|
||||
return this.agendaDataService.updateEvent(eventId, eventInput)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,34 +1,35 @@
|
||||
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()
|
||||
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()
|
||||
docId: z.number(),
|
||||
sourceName: z.string(),
|
||||
description: z.string(),
|
||||
applicationId: z.number()
|
||||
});
|
||||
|
||||
const recurrenceSchema = z.object({
|
||||
frequency: z.number(),
|
||||
occurrences: z.number()
|
||||
frequency: z.number(),
|
||||
until: z.string().nullable().optional()
|
||||
});
|
||||
|
||||
const EventInputDTOSchema = z.object({
|
||||
export const EventInputDTOSchema = z.object({
|
||||
userId: z.number(),
|
||||
ownerType: z.number(),
|
||||
ownerType: z.nativeEnum(EEventOwnerType),
|
||||
subject: z.string(),
|
||||
body: z.string(),
|
||||
location: z.string(),
|
||||
startDate: z.string().datetime(),
|
||||
endDate: z.string().datetime(),
|
||||
type: z.number(),
|
||||
category: z.number(),
|
||||
startDate: z.string(),
|
||||
endDate: z.string(),
|
||||
type: z.nativeEnum(EEventType),
|
||||
category: z.nativeEnum(EEventCategory),
|
||||
attendees: z.array(attendeeSchema),
|
||||
attachments: z.array(attachmentSchema),
|
||||
recurrence: recurrenceSchema,
|
||||
@@ -36,7 +37,4 @@ const EventInputDTOSchema = z.object({
|
||||
isAllDayEvent: z.boolean()
|
||||
});
|
||||
|
||||
|
||||
|
||||
export type EventInputDTO = z.infer<typeof EventInputDTOSchema>
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ export const EventListOutputDTOSchema = z.object({
|
||||
owner: OwnerSchema,
|
||||
ownerType: z.nativeEnum(EEventOwnerType),// ['MD','PR', 'Other'] // Assuming "MD" is the only valid option based on provided data
|
||||
subject: z.string(),
|
||||
body: z.string(),
|
||||
body: z.string().optional(),
|
||||
location: z.string().nullable(),
|
||||
startDate: z.string().datetime({ offset: true }),
|
||||
endDate: z.string().datetime({ offset: true }),
|
||||
|
||||
@@ -15,7 +15,7 @@ const EventToApproveList = z.array(z.object({
|
||||
owner: OwnerSchema,
|
||||
ownerType: z.nativeEnum(EEventOwnerType),
|
||||
subject: z.string(),
|
||||
body: z.string(),
|
||||
body: z.string().nullable().optional(),
|
||||
location: z.string().nullable(),
|
||||
startDate: z.string().datetime({ offset: true }),
|
||||
endDate: z.string().datetime({ offset: true }),
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
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>
|
||||
Reference in New Issue
Block a user