lot of changes

This commit is contained in:
Eudes Inácio
2024-06-02 13:53:46 +01:00
parent 599d278e57
commit e9c8e0fbd9
19 changed files with 428 additions and 264 deletions
@@ -93,7 +93,7 @@ export class AgendaDataRepositoryService {
type: this.utils.calendarTypeSeleted(eventData.Category),
category: this.utils.calendarCategorySeleted(eventData.CalendarName),
attendees: this.utils.attendeesAdded(eventData.Attendees),
attachments: this.utils.documentAdded(documents),
attachments: documents,
recurrence: {
frequency: 0,
occurrences: 0,
@@ -125,8 +125,10 @@ export class AgendaDataRepositoryService {
return this.agendaDataService.updateEvent(eventId, eventInput)
}
addEventAttendee(id,attendeeData) {
return this.agendaDataService.addEventAttendee(id,attendeeData);
addEventAttendee(id,attendeeData,) {
console.log(attendeeData)
console.log(this.utils.attendeesEdit(attendeeData))
return this.agendaDataService.addEventAttendee(id,{ attendees: this.utils.attendeesAdded(attendeeData) });
}
addEventAttachment(id,attachmentData) {
@@ -153,6 +155,14 @@ export class AgendaDataRepositoryService {
}
eventToaprovalStatus(eventId, status) {
return this.agendaDataService.updateEventStatus(eventId,this.utils.statusEventAproval(status))
let statusObject = {
status: this.utils.statusEventAproval(status),
comment: ""
}
return this.agendaDataService.updateEventStatus(eventId,statusObject)
}
getDocumentAttachments(applicationId,userId,subject,pageNumber,pageSize) {
return this.agendaDataService.getDocumentAttachment(applicationId,userId,subject,pageNumber,pageSize)
}
}
@@ -106,4 +106,13 @@ export class AgendaDataService {
getToken(): Observable<any> {
return this.http.get<any>(`${this.baseUrl}/Users/token`);
}
getDocumentAttachment(aplicationId,userId,value,PageNumber,PageSize): Observable<any> {
const params = new HttpParams()
.set('userId', userId)
.set('Value', value)
.set('PageNumber', PageNumber)
.set('PageSize', PageSize);
return this.http.get<any>(`${this.baseUrl}/Documents/Attachments${aplicationId}`, {params});
}
}
@@ -21,7 +21,8 @@ export class EventMapper {
"EndDate": dto.endDate,
"EventType": "Single",
"Attendees": dto.attendees.map((e) => ({
Id: e.id,
//Id: e.id,
wxUserId: e.wxUserId,
EmailAddress: e.emailAddress,
Name: e.name,
IsRequired: e.attendeeType == '0' ? true : false,
@@ -73,6 +73,19 @@ export class Utils {
}
editDocumentAdded(documents: any[]) {
console.log('document added', documents)
return documents.map((element) => {
return {
docId: parseInt(element.SourceId),
sourceName: element.SourceName,
description: "",
applicationId: parseInt(element.ApplicationId)
};
});
}
atendeesSeletedType(type) {
var selectedType = {
@@ -105,4 +118,15 @@ export class Utils {
}
return selectedType[type];
}
attendeesEdit(taskParticipants: any[]) {
return taskParticipants.map((e) => {
return {
name: e.Name,
emailAddress: e.EmailAddress,
attendeeType: this.atendeesSeletedType(JSON.stringify(e.IsRequired)),
wxUserId: e.wxUserId || e.Id,
}
});
}
}