add recurence to agenda web

This commit is contained in:
Eudes Inácio
2024-06-07 14:10:17 +01:00
parent 95bb69be99
commit 4be9c6562e
7 changed files with 90 additions and 30 deletions
@@ -98,8 +98,8 @@ export class AgendaDataRepositoryService {
attendees: this.utils.attendeesAdded(eventData.Attendees),
attachments: this.utils.documentAdded(documents),
recurrence: {
frequency: 0,
occurrences: 0,
frequency: this.utils.eventRecurence(eventData.EventRecurrence.frequency),
until: eventData.EndDate.toISOString(),
},
organizerId: SessionStore.user.UserId,
isAllDayEvent: eventData.IsAllDayEvent,
@@ -80,7 +80,7 @@ export const EventInputDTOSchema = z.object({
attachments: z.array(AttachmentInputDTOSchema).nullable().optional(),
recurrence: z.object({
frequency: z.number().int(),
occurrences: z.number().int(),
until: z.string(),
}),
organizerId: z.number().int(),
isAllDayEvent: z.boolean(),
+35 -24
View File
@@ -3,16 +3,16 @@ import { AgendaDataService } from './agenda-data.service';
import { EventsService } from '../../events.service';
@Injectable({
providedIn: 'root'
providedIn: 'root'
})
export class Utils {
constructor(
private agendaDataService: AgendaDataService,
public eventService: EventsService,
) { }
constructor(
private agendaDataService: AgendaDataService,
public eventService: EventsService,
) { }
selectedCalendarUserId(CalendarName,postEvent) {
selectedCalendarUserId(CalendarName, postEvent) {
if (this.eventService.calendarNamesType[CalendarName]?.['Oficial'] && postEvent.CalendarName == 'Oficial') {
return this.eventService.calendarNamesType[CalendarName]['OwnerId']
@@ -60,8 +60,8 @@ export class Utils {
return selectedType[calendarName];
}
documentAdded(documents:any[]) {
console.log('added doc create event',documents)
documentAdded(documents: any[]) {
console.log('added doc create event', documents)
let listupdate = []
documents.forEach(element => {
let object = {
@@ -70,18 +70,18 @@ export class Utils {
description: "",
applicationId: element.applicationId
}
listupdate.push(object)
});
return listupdate
/* return documents.map((e) => {
return {
docId: e.docId,
sourceName: e.subject || e.sourceNames,
description: "",
applicationId: e.applicationId
};
}); */
/* return documents.map((e) => {
return {
docId: e.docId,
sourceName: e.subject || e.sourceNames,
description: "",
applicationId: e.applicationId
};
}); */
}
@@ -102,8 +102,8 @@ export class Utils {
atendeesSeletedType(type) {
var selectedType = {
'true': 0,
'false':1,
'other':2,
'false': 1,
'other': 2,
}
return selectedType[type];
}
@@ -115,7 +115,7 @@ export class Utils {
name: e.Name,
emailAddress: e.EmailAddress,
attendeeType: this.atendeesSeletedType(JSON.stringify(e.IsRequired)),
wxUserId: e.Id,
wxUserId: e.Id,
}
});
}
@@ -123,10 +123,10 @@ export class Utils {
statusEventAproval(type) {
var selectedType = {
'Pending': 0,
'Revision':1,
'Approved':2,
"Declined":3,
"Communicated":4
'Revision': 1,
'Approved': 2,
"Declined": 3,
"Communicated": 4
}
return selectedType[type];
}
@@ -141,4 +141,15 @@ export class Utils {
}
});
}
eventRecurence(type) {
var selectedType = {
'never': 0,
'daily': 1,
'weekly': 2,
"monthly": 3,
"yearly": 4
}
return selectedType[type];
}
}