add either pattern

This commit is contained in:
Peter Maquiran
2024-07-09 12:36:46 +01:00
parent 06417ead0f
commit a26fbbddba
45 changed files with 985 additions and 701 deletions
+4
View File
@@ -313,6 +313,10 @@ const routes = [
{ {
path: 'event-recurrence', path: 'event-recurrence',
loadChildren: () => import('./modals/event-recurrence/event-recurrence.module').then( m => m.EventRecurrencePageModule) loadChildren: () => import('./modals/event-recurrence/event-recurrence.module').then( m => m.EventRecurrencePageModule)
},
{
path: 'delete-event-recurrence',
loadChildren: () => import('./modals/delete-event-recurrence/delete-event-recurrence.module').then( m => m.DeleteEventRecurrencePageModule)
} }
@@ -0,0 +1,17 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { DeleteEventRecurrencePage } from './delete-event-recurrence.page';
const routes: Routes = [
{
path: '',
component: DeleteEventRecurrencePage
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class DeleteEventRecurrencePageRoutingModule {}
@@ -0,0 +1,20 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { IonicModule } from '@ionic/angular';
import { DeleteEventRecurrencePageRoutingModule } from './delete-event-recurrence-routing.module';
import { DeleteEventRecurrencePage } from './delete-event-recurrence.page';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
DeleteEventRecurrencePageRoutingModule
],
declarations: [DeleteEventRecurrencePage]
})
export class DeleteEventRecurrencePageModule {}
@@ -0,0 +1,22 @@
<ion-content>
<div class="pb-30 text-center pt-25">Este é um evento recorrente</div>
<div>
<ion-buttons slot="start" class="pb-15">
<button class="btn-ok" style="width: 240px !important" fill="clear" color="#fff" (click)="close('DeleteAll')" >
<ion-label>Eliminar todos eventos da serie</ion-label>
</button>
</ion-buttons>
<ion-buttons slot="end" class="pb-15">
<button class="btn-cancel" fill="clear" color="#061b52" style="width: 240px !important" (click)="close('DeleteOne')">
<ion-label>Eliminar apenas este evento</ion-label>
</button>
</ion-buttons>
<ion-buttons slot="end">
<button class="btn-cancel" fill="clear" color="#061b52" style="width: 240px !important" (click)="close('Cancel')">
<ion-label>Cancelar</ion-label>
</button>
</ion-buttons>
</div>
</ion-content>
@@ -0,0 +1,24 @@
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { IonicModule } from '@ionic/angular';
import { DeleteEventRecurrencePage } from './delete-event-recurrence.page';
describe('DeleteEventRecurrencePage', () => {
let component: DeleteEventRecurrencePage;
let fixture: ComponentFixture<DeleteEventRecurrencePage>;
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [ DeleteEventRecurrencePage ],
imports: [IonicModule.forRoot()]
}).compileComponents();
fixture = TestBed.createComponent(DeleteEventRecurrencePage);
component = fixture.componentInstance;
fixture.detectChanges();
}));
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -0,0 +1,26 @@
import { Component, OnInit } from '@angular/core';
import { ModalController } from '@ionic/angular';
export type EventDeleteRecurrenceComponentReturn = 'DeleteAll' | 'DeleteOne' | 'Cancel'
@Component({
selector: 'app-delete-event-recurrence',
templateUrl: './delete-event-recurrence.page.html',
styleUrls: ['./delete-event-recurrence.page.scss'],
})
export class DeleteEventRecurrencePage implements OnInit {
constructor(
private modalController: ModalController
) { }
ngOnInit() {
}
close(data: EventDeleteRecurrenceComponentReturn) {
this.modalController.dismiss(data)
}
}
+19
View File
@@ -0,0 +1,19 @@
import { z } from "zod";
const userSchema = z.object({
Id: z.number(),
EmailAddress: z.string().optional(),
Name: z.string(),
IsRequired: z.boolean(),
UserType: z.string(),
IsPR: z.boolean(),
Entity: z.string(),
Acknowledgment: z.boolean(),
RoleDescription: z.string().nullable(),
RoleId: z.number(),
});
const usersSchema = z.array(userSchema);
export type UserListItem = z.infer<typeof userSchema>
export type UserList = z.infer<typeof usersSchema>
@@ -0,0 +1,17 @@
export interface NotificationLive {
id: string;
title: string;
Service: string;
Object: string;
IdObject: string;
FolderId: string;
body: string;
dateInit: string; // Assuming dateInit and dateEnd are strings representing formatted dates
dateEnd: string;
Location: string;
TypeAgenda: string;
Role: string;
Status: string;
read: boolean;
}
@@ -6,12 +6,18 @@ import { LocalNotificationService } from './datasource/local-notification.servic
import { SessionStore } from 'src/app/store/session.service'; import { SessionStore } from 'src/app/store/session.service';
import { NotificationListMapper } from '../domain/mapper/notificationListMapper'; import { NotificationListMapper } from '../domain/mapper/notificationListMapper';
import { NotificationTable } from './infra/db/notification.db'; import { NotificationTable } from './infra/db/notification.db';
import { Observable, Subject } from 'rxjs';
import { filter } from 'rxjs/operators';
import { NotificationMapper } from '../domain/mapper/notificationMapper';
import { NotificationLive } from './dto/NotificationLiveOutputDTO';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
}) })
export class NotificationRepositoryService { export class NotificationRepositoryService {
private notificationSubject: Subject<NotificationLive> = new Subject<NotificationLive>();
constructor( constructor(
private RemoteNotificationService: RemoteNotificationService, private RemoteNotificationService: RemoteNotificationService,
private FirebasePushNotificationService: FirebasePushNotificationService, private FirebasePushNotificationService: FirebasePushNotificationService,
@@ -19,10 +25,9 @@ export class NotificationRepositoryService {
) { ) {
this.FirebasePushNotificationService.onReceiveForeground(async (data)=> { this.FirebasePushNotificationService.onReceiveForeground(async (data)=> {
this.notificationSubject.next(NotificationMapper(data));
console.log('FirebasePushNotificationService', data) console.log('FirebasePushNotificationService', data)
this.init() this.init()
}) })
@@ -32,6 +37,12 @@ export class NotificationRepositoryService {
} }
listenToEventNotification(): Observable<any> {
return this.notificationSubject.pipe(
filter(notification => notification.Service == 'agenda' )
)
}
async init() { async init() {
const result = await this.getNotification({ const result = await this.getNotification({
PageNumber: "1", PageNumber: "1",
@@ -0,0 +1,80 @@
import { v4 as uuidv4 } from 'uuid'
import { NotificationLive } from '../../data/dto/NotificationLiveOutputDTO';
function getFormatedTime(dateString) {
var date = new Date(dateString);
var hours = date.getHours() /* > 12 ? date.getHours() - 12 : date.getHours() */;
var am_pm = date.getHours() >= 12 ? "pm" : "am";
var minutes = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
let time = hours + ":" + minutes /* + " " + am_pm */;
return time;
}
export function NotificationMapper(notification: any): NotificationLive {
let notificationObject;
if (notification.notification) {
notificationObject = {
id: notification?.id || uuidv4(),
title: notification.notification.title,
Service: notification.data.Service || notification.data.service,
Object: notification.data.Object || notification.data.object,
IdObject: notification.data.IdObject || notification.data.idObject,
FolderId: notification.data.FolderId || notification.data.folderId,
body: notification.notification.body,
dateInit: getFormatedTime(notification.data.dateInit),
dateEnd: getFormatedTime(notification.data.dateEnd),
Location: notification.data.Location,
TypeAgenda: notification.data.TypeAgenda,
Role: notification.data.Role,
Status: notification.data.Status,
read: false,
}
} else if (notification.data) {
notificationObject = {
id: notification?.id || uuidv4(),
title: notification.title,
Service: notification.data.Service || notification.data.service,
Object: notification.data.Object || notification.data.object,
IdObject: notification.data.IdObject || notification.data.idObject,
FolderId: notification.data.FolderId || notification.data.folderId,
body: notification.body,
dateInit: getFormatedTime(notification.data.dateInit),
dateEnd: getFormatedTime(notification.data.dateEnd),
Location: notification.data.Location,
TypeAgenda: notification.data.TypeAgenda,
Role: notification.data.Role,
Status: notification.data.Status,
read: false,
}
} else {
{
notificationObject = {
id: notification?.id || uuidv4(),
FolderId: notification.FolderId || notification.data.folderId,
IdObject: notification.IdObject || notification.data.idObject,
Location: notification.Location,
Object: notification.Object || notification.data.object,
Role: notification.Role,
Service: notification.Service || notification.data.service,
Status: notification.Status,
TypeAgenda: notification.TypeAgenda,
body: notification.body,
dateEnd: notification.dateEnd,
dateInit: notification.dateInit,
index: notification.index,
title: notification.title,
read: false,
}
}
}
return notificationObject
}
+23 -4
View File
@@ -1,4 +1,4 @@
import { Component, OnInit, ViewChild, Inject, LOCALE_ID } from '@angular/core'; import { Component, OnInit, ViewChild, Inject, LOCALE_ID, OnDestroy } from '@angular/core';
import { CalendarComponent } from 'ionic2-calendar'; import { CalendarComponent } from 'ionic2-calendar';
import { ModalController } from '@ionic/angular'; import { ModalController } from '@ionic/angular';
import { EventsService } from 'src/app/services/events.service'; import { EventsService } from 'src/app/services/events.service';
@@ -35,15 +35,17 @@ import { environment } from 'src/environments/environment';
import { RoleIdService } from 'src/app/services/role-id.service' import { RoleIdService } from 'src/app/services/role-id.service'
import { EventListStore } from 'src/app/models/agenda/AgendaEventList'; import { EventListStore } from 'src/app/models/agenda/AgendaEventList';
import { Cy } from 'cypress/enum' import { Cy } from 'cypress/enum'
import { Observable } from 'rxjs'; import { Observable, Subject, Subscription } from 'rxjs';
import { TableSharedCalendar } from 'src/app/services/Repositorys/Agenda/agenda-local-data-source.service'; import { TableSharedCalendar } from 'src/app/services/Repositorys/Agenda/agenda-local-data-source.service';
import { map } from 'rxjs/operators'; import { map, throttleTime } from 'rxjs/operators';
import { EEventFilterStatus } from 'src/app/services/Repositorys/Agenda/model/enums'; import { EEventFilterStatus } from 'src/app/services/Repositorys/Agenda/model/enums';
import { TracingType, XTracerAsync } from 'src/app/services/monitoring/opentelemetry/tracer'; import { TracingType, XTracerAsync } from 'src/app/services/monitoring/opentelemetry/tracer';
import { isHttpError } from 'src/app/services/http.service'; import { isHttpError } from 'src/app/services/http.service';
import { ToastService } from 'src/app/services/toast.service'; import { ToastService } from 'src/app/services/toast.service';
import { CalendarState, selectEventSource } from 'src/app/services/Repositorys/Agenda/agenda-memory-source.service'; import { CalendarState, selectEventSource } from 'src/app/services/Repositorys/Agenda/agenda-memory-source.service';
import { Store } from '@ngrx/store'; import { Store } from '@ngrx/store';
import { NotificationRepositoryService } from 'src/app/module/notification/data/notification-repository.service';
import { Unsubscribable } from '../../../../android/app/build/intermediates/assets/debug/public/assets/dexie/dist/dexie';
@Component({ @Component({
selector: 'app-agenda', selector: 'app-agenda',
templateUrl: './agenda.page.html', templateUrl: './agenda.page.html',
@@ -188,6 +190,9 @@ export class AgendaPage implements OnInit {
hasChangeCalendar = false hasChangeCalendar = false
eventSource$ = this.store.select(selectEventSource); eventSource$ = this.store.select(selectEventSource);
private NotificationUpdate = new Subject<void>();
listenToEventNotificationSubscription!: Subscription;
constructor( constructor(
@Inject(LOCALE_ID) private locale: string, @Inject(LOCALE_ID) private locale: string,
@@ -203,9 +208,20 @@ export class AgendaPage implements OnInit {
public RoleIdService: RoleIdService, public RoleIdService: RoleIdService,
public AgendaDataRepositoryService: AgendaDataRepositoryService, public AgendaDataRepositoryService: AgendaDataRepositoryService,
private toastService: ToastService, private toastService: ToastService,
private store: Store<CalendarState> private store: Store<CalendarState>,
private notificationRepository: NotificationRepositoryService
) { ) {
this.NotificationUpdate.pipe(
throttleTime(1000) // Prevents the function from being called more than once per second
).subscribe(() => {
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
});
this.listenToEventNotificationSubscription = this.notificationRepository.listenToEventNotification().subscribe(() => {
this.NotificationUpdate.next()
})
this.selectedUserCalendar = SessionStore.user.UserId this.selectedUserCalendar = SessionStore.user.UserId
this.AgendaDataRepositoryService.getSharedCalendar().then(async ()=> { this.AgendaDataRepositoryService.getSharedCalendar().then(async ()=> {
this.setCalendarByDefault(true) this.setCalendarByDefault(true)
@@ -291,6 +307,9 @@ export class AgendaPage implements OnInit {
this.weekToShow() this.weekToShow()
} }
OnDestroy() {
this.listenToEventNotificationSubscription?.unsubscribe()
}
hasPrCalendar(data: TableSharedCalendar[]) { hasPrCalendar(data: TableSharedCalendar[]) {
for(const e of data) { for(const e of data) {
@@ -456,15 +456,18 @@ export class EditEventPage implements OnInit {
const calendar = await this.agendaDataRepository.getCalendarByUserId(this.selectedUserCalendar) const calendar = await this.agendaDataRepository.getCalendarByUserId(this.selectedUserCalendar)
if(calendar.isOk()) { if(calendar.isOk()) {
this.agendaDataRepository.updateEvent(this.postEvent.EventId, this.postEvent, this.editAllEvent, calendar.value, tracing).subscribe((value) => { const value = await this.agendaDataRepository.updateEvent(this.postEvent.EventId, this.postEvent, this.editAllEvent, calendar.value, tracing)//.subscribe((value) => {
console.log(value)
if(value.isOk()) {
console.log(value.value)
this.close(); this.close();
this.httpErrorHandle.httpsSucessMessagge('Editar evento') this.httpErrorHandle.httpsSucessMessagge('Editar evento')
tracing.setAttribute('outcome', 'success') tracing.setAttribute('outcome', 'success')
}, ((error) => { } else {
tracing.setAttribute('outcome', 'failed') tracing.setAttribute('outcome', 'failed')
console.log('edit event error: ', error) console.log('edit event error: ', value.error)
})); }
console.log({serverCurrentList: this.serverCurrentList, Attendees: this.postEvent.Attendees}) console.log({serverCurrentList: this.serverCurrentList, Attendees: this.postEvent.Attendees})
@@ -472,7 +475,7 @@ export class EditEventPage implements OnInit {
console.log({insert, remove }) console.log({insert, remove })
if(insert.length >= 1) { if(insert.length >= 1) {
this.agendaDataRepository.addEventAttendee(this.postEvent.EventId, insert).subscribe((value) => { this.agendaDataRepository.addEventAttendee(this.postEvent.EventId, insert, tracing).subscribe((value) => {
console.log(value) console.log(value)
}, ((error) => { }, ((error) => {
tracing.setAttribute('failed.attendees', 'true') tracing.setAttribute('failed.attendees', 'true')
@@ -62,24 +62,19 @@ export class EventActionsPopoverPage implements OnInit {
const loader = this.toastService.loading() const loader = this.toastService.loading()
try { const value = await this.agendaDataRepository.approveEvent(this.serialNumber)// .subscribe((value) => {
/* await this.processes.PostTaskAction(body).toPromise() */ if(value.isOk()) {
this.agendaDataRepository.approveEvent(this.serialNumber).subscribe((value) => {
console.log(value) console.log(value.value)
this.TaskService.loadEventosParaAprovacao() this.TaskService.loadEventosParaAprovacao()
this.httpErrorHandle.httpsSucessMessagge('Evento aprovação') this.httpErrorHandle.httpsSucessMessagge('Evento aprovação')
this.goBack(); this.goBack();
}, ((error) => { } else {
console.log('aprove event error: ', error)
this.httpErrorHandle.httpStatusHandle(error)
}))
} catch (error) { console.log('aprove event error: ', value.error)
this.httpErrorHandle.httpStatusHandle(error) this.httpErrorHandle.httpStatusHandle(value.error)
} }
finally {
loader.remove() loader.remove()
}
} }
@@ -130,22 +125,17 @@ export class EventActionsPopoverPage implements OnInit {
const loader = this.toastService.loading() const loader = this.toastService.loading()
try {
/* await this.processes.PostTaskAction(body).toPromise(); */ const result = await this.agendaDataRepository.eventToaprovalStatus(this.serialNumber, 'Revision', res.data.note)// .subscribe((value) => {
this.agendaDataRepository.eventToaprovalStatus(this.serialNumber, 'Revision', res.data.note).subscribe((value) => { if(result.isOk()) {
this.httpErrorHandle.httpsSucessMessagge('Rever') this.httpErrorHandle.httpsSucessMessagge('Rever')
this.TaskService.loadEventosParaAprovacao() this.TaskService.loadEventosParaAprovacao()
this.goBack(); this.goBack();
}, ((error) => { } else {
console.log('send event to revision error: ', error) console.log('send event to revision error: ', result.error)
this.httpErrorHandle.httpStatusHandle(error) this.httpErrorHandle.httpStatusHandle(result.error)
}));
} catch (error) {
this.httpErrorHandle.httpStatusHandle(error)
} }
finally {
loader.remove() loader.remove()
}
} else { } else {
} }
@@ -160,22 +150,16 @@ export class EventActionsPopoverPage implements OnInit {
let body = { "serialNumber": this.serialNumber, "action": "Descartar" } let body = { "serialNumber": this.serialNumber, "action": "Descartar" }
const loader = this.toastService.loading(); const loader = this.toastService.loading();
try { const result = await this.agendaDataRepository.eventToaprovalStatus(this.serialNumber, 'Declined', '')//.subscribe((value) => {
/* await this.processes.PostTaskAction(body).toPromise(); */ if(result.isOk()) {
this.agendaDataRepository.eventToaprovalStatus(this.serialNumber, 'Declined', '').subscribe((value) => {
this.TaskService.loadEventosParaAprovacao() this.TaskService.loadEventosParaAprovacao()
this.httpErrorHandle.httpsSucessMessagge('Rejeitar') this.httpErrorHandle.httpsSucessMessagge('Rejeitar')
this.goBack(); this.goBack();
}, ((error) => { } else {
console.log('reject event error: ', error) console.log('reject event error: ', result.error)
this.httpErrorHandle.httpStatusHandle(error) this.httpErrorHandle.httpStatusHandle(result.error)
}))
} catch (error) {
this.httpErrorHandle.httpStatusHandle(error)
} }
finally {
loader.remove(); loader.remove();
}
} }
@@ -498,43 +498,28 @@ export class NewEventPage implements OnInit {
this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc); this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc);
this.postEvent.IsAllDayEvent = this.allDayCheck; this.postEvent.IsAllDayEvent = this.allDayCheck;
try { const value = await this.agendaDataRepository.createEvent(this.postEvent, this.documents, calendar.value, tracing)
const value = await this.agendaDataRepository.createEvent(this.postEvent, this.documents, calendar.value, tracing).toPromise() if(value.isOk()) {
console.log(value) console.log(value.value)
loader.remove() loader.remove()
this.hhtpErrorHandle.httpsSucessMessagge('new event') this.hhtpErrorHandle.httpsSucessMessagge('new event')
let data = Object.assign(this.postEvent) let data = Object.assign(this.postEvent)
this.modalController.dismiss(data); this.modalController.dismiss(data);
tracing.setAttribute('outcome', 'success'); tracing.setAttribute('outcome', 'success');
} catch(error) { } else {
tracing.setAttribute('outcome', 'failed'); tracing.setAttribute('outcome', 'failed');
console.log('create event error: ', error) console.log('create event error: ', value.error)
loader.remove() loader.remove()
} }
} else {
}
}
//This method return calendar id
selectedCalendarId() {
if (this.eventService.calendarNamesType[this.CalendarName]?.['Oficial'] && this.postEvent.CalendarName == 'Oficial') {
return this.eventService.calendarNamesType[this.CalendarName]['OficialId']
} else if (this.eventService.calendarNamesType[this.CalendarName]?.['Pessoal'] && this.postEvent.CalendarName == 'Pessoal') {
return this.eventService.calendarNamesType[this.CalendarName]['PessoalId']
} else { } else {
return '11:11'
} }
} }
//This method return calendar onwner user id //This method return calendar onwner user id
selectedCalendarUserId() { selectedCalendarUserId() {
@@ -19,6 +19,7 @@ import { AgendaDataRepositoryService } from 'src/app/services/Repositorys/Agenda
import { TracingType, XTracerAsync } from 'src/app/services/monitoring/opentelemetry/tracer'; import { TracingType, XTracerAsync } from 'src/app/services/monitoring/opentelemetry/tracer';
import { isHttpError } from 'src/app/services/http.service'; import { isHttpError } from 'src/app/services/http.service';
import { PermissionService } from 'src/app/services/permission.service'; import { PermissionService } from 'src/app/services/permission.service';
import { DeleteEventRecurrencePage, EventDeleteRecurrenceComponentReturn } from 'src/app/modals/delete-event-recurrence/delete-event-recurrence.page';
@Component({ @Component({
selector: 'app-view-event', selector: 'app-view-event',
@@ -186,42 +187,33 @@ export class ViewEventPage implements OnInit {
} }
deleteYesOrNo() { async deleteYesOrNo() {
if (this.loadedEvent.IsRecurring) { if (this.loadedEvent.IsRecurring) {
this.alertController.create({
header: 'Eliminar evento?',
message: 'Este evento tem recorrência, deseja eliminar a Sequência de eventos?',
inputs: [
{
name: 'confirm',
type: 'checkbox',
label: '',
value: 'confirm',
checked: false,
}
],
buttons: [
{
text: 'Sim',
handler: (data) => {
if (data.includes('confirm')) {
this.deleteEvent(true);
} else {
this.deleteEvent(false);
}
} const modal = await this.modalController.create({
}, component: DeleteEventRecurrencePage,
{ componentProps: {},
text: 'Não', cssClass: 'event-recurrence-modal',
handler: () => {
// sconsole.log('Let me think');
}
}
]
}).then(res => {
res.present();
}); });
modal.onDidDismiss().then((res) => {
const data: EventDeleteRecurrenceComponentReturn = res.data
if(data =='DeleteAll') {
this.deleteEvent(true);
} else if (data == 'DeleteOne') {
this.deleteEvent(false);
} else if(data == 'Cancel') {
this.close()
} else {
this.close()
}
});
await modal.present();
} else { } else {
this.alertController.create({ this.alertController.create({
header: 'Eliminar evento?', header: 'Eliminar evento?',
@@ -247,13 +239,14 @@ export class ViewEventPage implements OnInit {
} }
deleteEvent(deleteAll) { async deleteEvent(deleteAll) {
const loader = this.toastService.loading() const loader = this.toastService.loading()
console.log(this.loadedEvent.EventId) console.log(this.loadedEvent.EventId)
this.agendaDataRepository.deleteEvent(this.loadedEvent.EventId,deleteAll).subscribe(async () => { const result = await this.agendaDataRepository.deleteEvent(this.loadedEvent.EventId,deleteAll)//.subscribe(async () => {
if(result.isOk()) {
const alert = await this.alertController.create({ const alert = await this.alertController.create({
cssClass: 'my-custom-class', cssClass: 'my-custom-class',
header: 'Evento removido', header: 'Evento removido',
@@ -265,14 +258,14 @@ export class ViewEventPage implements OnInit {
}, 1500); }, 1500);
this.goBack(); this.goBack();
this.httpErrorHandle.httpsSucessMessagge('delete event') this.httpErrorHandle.httpsSucessMessagge('delete event')
}, (error) => { } else {
console.log('delete event error: ', error)
this.httpErrorHandle.httpStatusHandle(error) console.log('delete event error: ', result.error)
}, () => { this.httpErrorHandle.httpStatusHandle(result.error)
}
loader.remove(); loader.remove();
});
} }
@@ -143,26 +143,21 @@ export class ApproveEventPage implements OnInit {
const loader = this.toastService.loading() const loader = this.toastService.loading()
try { const result = await this.AgendaDataRepositoryService.approveEvent(serialNumber)//.subscribe(async (value) => {
this.AgendaDataRepositoryService.approveEvent(serialNumber).subscribe(async (value) => {
if(result.isOk()) {
await this.processes.PostTaskAction(body).toPromise() await this.processes.PostTaskAction(body).toPromise()
this.goBack(); this.goBack();
this.httpErrorHandle.httpsSucessMessagge('Evento aprovação') this.httpErrorHandle.httpsSucessMessagge('Evento aprovação')
this.TaskService.loadEventosParaAprovacao(); this.TaskService.loadEventosParaAprovacao();
}, ((error) => { } else {
console.log('aprove event error: ', error)
this.httpErrorHandle.httpStatusHandle(error)
}))
} catch (error) { console.log('aprove event error: ', result.error)
this.httpErrorHandle.httpStatusHandle(error) this.httpErrorHandle.httpStatusHandle(result.error)
} }
finally {
loader.remove() loader.remove()
}
} }
@@ -195,25 +190,22 @@ export class ApproveEventPage implements OnInit {
const loader = this.toastService.loading() const loader = this.toastService.loading()
try {
this.AgendaDataRepositoryService.eventToaprovalStatus(serialNumber, 'Revision', res.data.note).subscribe((value) => { const result = await this.AgendaDataRepositoryService.eventToaprovalStatus(serialNumber, 'Revision', res.data.note)//.subscribe((value) => {
if(result.isOk()) {
this.httpErrorHandle.httpsSucessMessagge('Rever') this.httpErrorHandle.httpsSucessMessagge('Rever')
this.TaskService.loadEventosParaAprovacao(); this.TaskService.loadEventosParaAprovacao();
this.goBack(); this.goBack();
}, ((error) => {
console.log('send event to revision error: ', error)
this.httpErrorHandle.httpStatusHandle(error)
this.offlineManager.storeRequestData('event-listRever', body);
}));
} catch (error) { } else {
this.httpErrorHandle.httpStatusHandle(error) console.log('send event to revision error: ', result.error)
} finally { this.httpErrorHandle.httpStatusHandle(result.error)
loader.remove() this.offlineManager.storeRequestData('event-listRever', body);
} }
loader.remove()
} }
}, (error) => { }, (error) => {
console.log(error) console.log(error)
@@ -227,23 +219,20 @@ export class ApproveEventPage implements OnInit {
let body = { "serialNumber": serialNumber, "action": "Descartar" } let body = { "serialNumber": serialNumber, "action": "Descartar" }
const loader = this.toastService.loading() const loader = this.toastService.loading()
try {
/* await this.processes.PostTaskAction(body).toPromise(); */ /* await this.processes.PostTaskAction(body).toPromise(); */
this.AgendaDataRepositoryService.eventToaprovalStatus(serialNumber, 'Declined', '').subscribe((value) => { const result = await this.AgendaDataRepositoryService.eventToaprovalStatus(serialNumber, 'Declined', '')//.subscribe((value) => {
if(result.isOk()) {
this.httpErrorHandle.httpsSucessMessagge('Rejeitar') this.httpErrorHandle.httpsSucessMessagge('Rejeitar')
this.TaskService.loadEventosParaAprovacao(); this.TaskService.loadEventosParaAprovacao();
this.goBack(); this.goBack();
}, ((error) => { } else {
console.log('reject event error: ', error)
this.httpErrorHandle.httpStatusHandle(error) console.log('reject event error: ', result.error)
})) this.httpErrorHandle.httpStatusHandle(result.error)
} catch (error) {
this.httpErrorHandle.httpStatusHandle(error)
} }
finally {
loader.remove() loader.remove()
} }
}
async viewDocument(DocId: string, Document) { async viewDocument(DocId: string, Document) {
@@ -369,27 +369,29 @@ export class BookMeetingModalPage implements OnInit {
const calendar = await this.agendaDataRepository.getCalendarByUserId(this.selectedUserCalendar) const calendar = await this.agendaDataRepository.getCalendarByUserId(this.selectedUserCalendar)
if(calendar.isOk()) { if(calendar.isOk()) {
try { const value = await this.agendaDataRepository.createEvent(postData, this.documents, calendar.value, tracing)
const value = await this.agendaDataRepository.createEvent(postData, this.documents, calendar.value, tracing).toPromise() if(value.isOk()) {
console.log(value)
console.log(value.value)
this.httpErroHandle.httpsSucessMessagge('new event') this.httpErroHandle.httpsSucessMessagge('new event')
loader.remove(); loader.remove();
tracing.setAttribute('outcome', 'success') tracing.setAttribute('outcome', 'success')
this.close(); this.close();
} catch (error) { } else {
if(!isHttpError(error)) { if(!isHttpError(value.error)) {
this.toastService._badRequest('Pedimos desculpa mas não foi possível executar a acção. Por favor, contacte o apoio técnico. #1') this.toastService._badRequest('Pedimos desculpa mas não foi possível executar a acção. Por favor, contacte o apoio técnico. #1')
console.log(error) console.log(value.error)
tracing.bugFlag() tracing.bugFlag()
} else { } else {
this.httpErroHandle.httpStatusHandle(error.status) this.httpErroHandle.httpStatusHandle(value.error.status)
} }
console.log('create event error: ', error) console.log('create event error: ', value.error)
tracing.setAttribute('outcome', 'failed') tracing.setAttribute('outcome', 'failed')
} }
} else { } else {
@@ -19,7 +19,6 @@ import { EventToApproveDataOutputDTOSchema } from './model/eventToApproveListOut
import { EventOutputDTOSchema } from './model/eventDTOOutput'; import { EventOutputDTOSchema } from './model/eventDTOOutput';
import { SharedCalendarListDetectChanges } from './async/change/shareCalendarChangeDetector'; import { SharedCalendarListDetectChanges } from './async/change/shareCalendarChangeDetector';
import { SharedCalendarListItemOutputDTO } from './model/sharedCalendarOutputDTO'; import { SharedCalendarListItemOutputDTO } from './model/sharedCalendarOutputDTO';
import { EventInputDTOSchema } from './agendaDataModels';
import { EventUpdateInputDTOSchema } from './model/eventUpdateInputDtO'; import { EventUpdateInputDTOSchema } from './model/eventUpdateInputDtO';
import { AttachInputDTOSchema } from './model/addAttachmentDTOInput'; import { AttachInputDTOSchema } from './model/addAttachmentDTOInput';
import { EventListDataOutputDTOSchema } from './model/eventListDTOOutput'; import { EventListDataOutputDTOSchema } from './model/eventListDTOOutput';
@@ -29,6 +28,8 @@ import { CalendarState, pushEvent, removeRangeForCalendar, selectEventsInRange }
import { NativeNotificationService } from 'src/app/services/native-notification.service'; import { NativeNotificationService } from 'src/app/services/native-notification.service';
import { ListBoxService } from 'src/app/services/agenda/list-box.service'; import { ListBoxService } from 'src/app/services/agenda/list-box.service';
import { EventListStore } from 'src/app/models/agenda/AgendaEventList'; import { EventListStore } from 'src/app/models/agenda/AgendaEventList';
import { AttendeeInputDTOSchema } from './model/attendeeInputDTO';
import { EventInputDTOSchema } from './model/eventInputDTO';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
}) })
@@ -59,61 +60,31 @@ export class AgendaDataRepositoryService {
} }
async getEventById(id: string, tracing?: TracingType) { async getEventById(id: string, tracing?: TracingType) {
try {
const result = await this.agendaDataService.getEvent(id).pipe( const result = await this.agendaDataService.getEvent(id, tracing)
map((response) => {
APINODReturn(EventOutputDTOSchema, response, `get/Events/${id}`, tracing) if(result.isOk()) {
return EventMapper.toDomain(response) APINODReturn(EventOutputDTOSchema, result.value, `get/Events/${id}`, tracing)
})
).toPromise() return result.map(e => EventMapper.toDomain(e))
return ok(result)
} catch (e) {
tracing.setAttribute('eventId', id)
if(isHttpError(e)) {
tracing?.setAttribute('status.code', e.status.toString())
if (e.status == 400) {
tracing?.bugFlag()
tracing?.setAttribute('outcome', 'failed')
}
} else {
tracing?.bugFlag()
tracing.setAttribute('outcome', 'failed')
tracing?.setAttribute('map.error', 'true')
tracing?.setAttribute('map.error.context', JSON.stringify(e))
}
return err(e as HttpErrorResponse)
} }
return result
} }
async getEventToApproveById(id: string, tracing?: TracingType) { async getEventToApproveById(id: string, tracing?: TracingType) {
try { const result = await this.agendaDataService.getEvent(id)
const result = await this.agendaDataService.getEvent(id).pipe(
map((response) => { if(result.isOk()) {
APINODReturn(EventOutputDTOSchema, response, `get/Events/${id}`, tracing) APINODReturn(EventOutputDTOSchema, result.value, `get/Events/${id}`, tracing)
console.log('response',response)
console.log('ToDomain',EventToApproveDetailsMapper.toDomain(response)) return result.map(e => EventToApproveDetailsMapper.toDomain(e))
return EventToApproveDetailsMapper.toDomain(response)
})
).toPromise()
return ok(result)
} catch (e) {
tracing.setAttribute('eventId', id)
if(isHttpError(e)) {
tracing?.setAttribute('status.code', e.status.toString())
if (e.status == 400) {
tracing?.bugFlag()
tracing?.setAttribute('outcome', 'failed')
}
} else {
tracing?.bugFlag()
tracing?.setAttribute('outcome', 'failed')
tracing?.setAttribute('map.error', 'true')
tracing?.setAttribute('map.error.context', JSON.stringify(e))
}
return err(e as HttpErrorResponse)
} }
return result
} }
async searchEvent(queryParameters: {value, status}, tracing?: TracingType) { async searchEvent(queryParameters: {value, status}, tracing?: TracingType) {
@@ -126,9 +97,11 @@ export class AgendaDataRepositoryService {
async EventList({ userId, startDate, endDate, status = EEventFilterStatus.Approved, category = null, type = null, calendarOwnerName = '' }, tracing?: TracingType) { async EventList({ userId, startDate, endDate, status = EEventFilterStatus.Approved, category = null, type = null, calendarOwnerName = '' }, tracing?: TracingType) {
try { const result = await this.agendaDataService.getEvents({userId, startDate, endDate, status, category, type})
const result = await this.agendaDataService.getEvents(userId, startDate, endDate, status, category, type).pipe(
map((response) => { if(result.isOk()) {
return result.map(response => {
APINODReturn(EventListDataOutputDTOSchema, response, 'get/Events', tracing) APINODReturn(EventListDataOutputDTOSchema, response, 'get/Events', tracing)
@@ -167,53 +140,26 @@ export class AgendaDataRepositoryService {
// console.log({localList}) // console.log({localList})
}); });
// this.memoryStore.dispatch(removeRangeForCalendar({ startDate, endDate, userId })); this.memoryStore.dispatch(removeRangeForCalendar({ startDate, endDate, userId }));
// this.memoryStore.dispatch(pushEvent({ eventsList:eventsList as any, userId, profile })); this.memoryStore.dispatch(pushEvent({ eventsList:listToPresent as any, userId, profile }));
return listToPresent return listToPresent
})
} }
)).toPromise()
return ok(result) return result
} catch (e) {
if(isHttpError(e)) {
console.log(e.status)
tracing?.setAttribute('status.code', e.status.toString())
if (e.status == 400) {
tracing?.bugFlag()
tracing?.setAttribute('outcome', 'failed')
}
} else {
tracing?.setAttribute('map.error', 'true')
tracing?.setAttribute('map.error.context', JSON.stringify(e))
}
return err(e as HttpErrorResponse)
}
} }
async eventToApproveList({ userId, startDate = null, endDate = null, status = EEventFilterStatus.Pending, category = null, type = null, calendarOwnerName = '' }, tracing?: TracingType) { async eventToApproveList({ userId, startDate = null, endDate = null, status = EEventFilterStatus.Pending, category = null, type = null, calendarOwnerName = '' }, tracing?: TracingType) {
try { const result = await this.agendaDataService.getEvents({userId, startDate : null, endDate: null, status, category: null, type: null}, tracing)
const result = await this.agendaDataService.getEvents(userId, startDate = null, endDate = null, status, category = null, type = null, tracing).pipe(
map((response) => { return result.map(response => {
APINODReturn(EventToApproveDataOutputDTOSchema, response, 'get/ApproveList', tracing) APINODReturn(EventToApproveDataOutputDTOSchema, response, 'get/ApproveList', tracing)
return EventListToApproveMapper.toDomain(response, calendarOwnerName, userId) return EventListToApproveMapper.toDomain(response, calendarOwnerName, userId)
} })
)).toPromise()
return ok(result)
} catch (e) {
if(isHttpError(e)) {
tracing?.setAttribute('status.code', e.status.toString())
if (e.status == 400) {
tracing?.bugFlag()
tracing?.setAttribute('outcome', 'failed')
}
} else {
tracing?.setAttribute('map.error', 'true')
tracing?.setAttribute('map.error.context', JSON.stringify(e))
}
return err(e as HttpErrorResponse)
}
} }
createEvent(eventData: Event, documents, calendar: TableSharedCalendar, tracing: TracingType) { createEvent(eventData: Event, documents, calendar: TableSharedCalendar, tracing: TracingType) {
@@ -278,14 +224,17 @@ export class AgendaDataRepositoryService {
return this.agendaDataService.updateEvent(eventId, eventInput) return this.agendaDataService.updateEvent(eventId, eventInput)
} }
addEventAttendee(id, attendeeData) { addEventAttendee(id, attendeeData, tracing?: TracingType) {
console.log(attendeeData) console.log(attendeeData)
console.log(this.utils.attendeesEdit(attendeeData)) console.log(this.utils.attendeesEdit(attendeeData))
const data = { attendees: this.utils.attendeesAdded(attendeeData) }
APINODReturn(AttendeeInputDTOSchema, data, `PUT/Events/${id}/Attendee`, tracing)
return this.agendaDataService.addEventAttendee(id, { attendees: this.utils.attendeesAdded(attendeeData) }); return this.agendaDataService.addEventAttendee(id, { attendees: this.utils.attendeesAdded(attendeeData) });
} }
removeEventAttendee(id, attendeeData: {Id : string}[]) { removeEventAttendee(id, attendeeData: {Id : string}[]) {
return this.agendaDataService.removeEventAttendee(id, { attendees: attendeeData.map(e => e.Id || e['id']) } ); return this.agendaDataService.removeEventAttendee(id, { attendees: attendeeData.map(e => e.Id || e['id']) } );
@@ -309,12 +258,7 @@ export class AgendaDataRepositoryService {
async deleteEvent1(eventId) { async deleteEvent1(eventId) {
try { return await this.agendaDataService.deleteEvent(eventId, false)
const result = await this.agendaDataService.deleteEvent(eventId, false).toPromise()
return ok(result)
} catch (e) {
return err(e as HttpErrorResponse)
}
} }
@@ -3,9 +3,8 @@ import { Injectable } from '@angular/core';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { EventInputDTO } from './model/eventInputDTO'; import { EventInputDTO } from './model/eventInputDTO';
import { SessionStore } from 'src/app/store/session.service'; import { SessionStore } from 'src/app/store/session.service';
import { SharedCalendarListOutputDTO, SharedCalendarListOutputDTOSchema } from './model/sharedCalendarOutputDTO'; import { SharedCalendarListOutputDTO } from './model/sharedCalendarOutputDTO';
import { HttpService } from '../../http.service'; import { HttpService } from '../../http.service';
import { APIReturn } from '../../decorator/api-validate-schema.decorator';
import { TracingType } from '../../monitoring/opentelemetry/tracer'; import { TracingType } from '../../monitoring/opentelemetry/tracer';
import { EventOutputDTO } from './model/eventDTOOutput'; import { EventOutputDTO } from './model/eventDTOOutput';
import { AttendeesRemoveInputDTO } from './model/attendeeRemoveInputDTO'; import { AttendeesRemoveInputDTO } from './model/attendeeRemoveInputDTO';
@@ -23,36 +22,34 @@ export class AgendaDataService {
private httpService: HttpService private httpService: HttpService
) { } ) { }
getContacts(value: string): Observable<any> {
const params = new HttpParams().set('value', value);
return this.http.get<any>(`${this.baseUrl}/Contacts`, { params });
}
// Documents Endpoints // Documents Endpoints
getAttachments(subject: string, applicationType: number): Observable<any> { getAttachments(subject: string, applicationType: number) {
const params = new HttpParams() const params = {
.set('Subject', subject) Subject: subject,
.set('ApplicationType', applicationType.toString()); ApplicationType: applicationType.toString()
return this.http.get<any>(`${this.baseUrl}/Documents/Attachments`, { params });
} }
viewDocument(userId: number, docId: number, applicationId: number): Observable<any> { return this.httpService.get<any>(`${this.baseUrl}/Documents/Attachments`, { params });
}
viewDocument(userId: number, docId: number, applicationId: number) {
const params = new HttpParams() const params = new HttpParams()
.set('userId', userId.toString()) .set('userId', userId.toString())
.set('docId', docId.toString()) .set('docId', docId.toString())
.set('applicationId', applicationId.toString()); .set('applicationId', applicationId.toString());
return this.http.get<any>(`${this.baseUrl}/Documents/view`, { params }); return this.httpService.get<any>(`${this.baseUrl}/Documents/view`, params);
} }
// Events Endpoints // Events Endpoints
createEvent(eventData: EventInputDTO) { createEvent(eventData: EventInputDTO) {
return this.http.post<any>(`${this.baseUrl}/Events`, eventData); return this.httpService.post<any>(`${this.baseUrl}/Events`, eventData);
} }
// @APIReturn(EventListOutputDTOSchema, 'get/Events') // @APIReturn(EventListOutputDTOSchema, 'get/Events')
getEvents(userId: number, startDate: string, endDate: string, status: number, category: string, type: string, tracing?: TracingType): Observable<EventListOutputDTO> { getEvents({userId, startDate, endDate, status, category, type }, tracing?: TracingType) {
let params = new HttpParams() let params: any = {
.set('UserId', userId) UserId: userId
}
if(userId == null || userId == undefined) { if(userId == null || userId == undefined) {
throw('userId '+ userId) throw('userId '+ userId)
@@ -60,43 +57,45 @@ export class AgendaDataService {
if(status != null || status != undefined) { if(status != null || status != undefined) {
params = params.set('status', status); params.status = status;
} }
if (startDate !== null && startDate !== undefined) { if (startDate !== null && startDate !== undefined) {
params = params.set('startDate', startDate); params.startDate = startDate;
} }
if (endDate !== null && endDate !== undefined) { if (endDate !== null && endDate !== undefined) {
params = params.set('endDate', endDate); params.endDate = endDate;
} }
return this.http.get<any>(`${this.baseUrl}/Events`, { params }); return this.httpService.get<EventListOutputDTO>(`${this.baseUrl}/Events`, params, tracing);
} }
searchEvent(queryParameter: {value, status}) { searchEvent(queryParameter: {value, status}) {
return this.httpService.get<EventListOutputDTO>(`${this.baseUrl}/Events`, queryParameter); return this.httpService.get<EventListOutputDTO>(`${this.baseUrl}/Events`, queryParameter);
} }
getEvent(id: string): Observable<EventOutputDTO> { getEvent(id: string, tracing?: TracingType) {
return this.http.get<any>(`${this.baseUrl}/Events/${id}`); return this.httpService.get<EventOutputDTO>(`${this.baseUrl}/Events/${id}`, {}, tracing);
} }
updateEvent(id: string, eventData: any): Observable<any> { updateEvent(id: string, eventData: any) {
return this.http.put<any>(`${this.baseUrl}/Events/${id}`, eventData); return this.httpService.put<any>(`${this.baseUrl}/Events/${id}`, eventData);
} }
approveEvent(id: string): Observable<any> { approveEvent(id: string) {
return this.http.patch<any>(`${this.baseUrl}/Events/${id}/Approval`, {}); return this.httpService.patch<any>(`${this.baseUrl}/Events/${id}/Approval`, {});
} }
deleteEvent(id: string, deleteAllEvents: boolean): Observable<any> { async deleteEvent(id: string, deleteAllEvents: boolean) {
const params = new HttpParams().set('DeleteAllEvents', deleteAllEvents.toString()); const params = {
return this.http.delete<any>(`${this.baseUrl}/Events/${id}`, { params }); 'DeleteAllEvents': deleteAllEvents.toString()
};
return this.httpService.delete<any>(`${this.baseUrl}/Events/${id}`, params);
} }
updateEventStatus(id: string, statusData: any): Observable<any> { updateEventStatus(id: string, statusData: Object) {
return this.http.patch<any>(`${this.baseUrl}/Events/${id}/Status`, statusData); return this.httpService.patch<any>(`${this.baseUrl}/Events/${id}/Status`, statusData);
} }
addEventAttendee(id: string, attendeeData: any): Observable<any> { addEventAttendee(id: string, attendeeData: any): Observable<any> {
@@ -116,20 +115,6 @@ export class AgendaDataService {
return this.http.delete<any>(`${this.baseUrl}/Events/${id}/Attachment`, { body: attachmentData }); return this.http.delete<any>(`${this.baseUrl}/Events/${id}/Attachment`, { body: attachmentData });
} }
communicateEvent(id: string, communicationData: any): Observable<any> {
return this.http.post<any>(`${this.baseUrl}/Events/${id}/Communicate`, communicationData);
}
// Users Endpoints
getUsers(value: string): Observable<any> {
const params = new HttpParams().set('value', value);
return this.http.get<any>(`${this.baseUrl}/Users`, { params });
}
getToken(): Observable<any> {
return this.http.get<any>(`${this.baseUrl}/Users/token`);
}
getDocumentAttachment(aplicationId,userId,value,PageNumber,PageSize): Observable<any> { getDocumentAttachment(aplicationId,userId,value,PageNumber,PageSize): Observable<any> {
const params = new HttpParams() const params = new HttpParams()
@@ -1,151 +1,151 @@
import { z } from 'zod'; // import { z } from 'zod';
export const AttachCommunicationInputDTOSchema = z.object({ // export const AttachCommunicationInputDTOSchema = z.object({
attachmentId: z.string().uuid(), // attachmentId: z.string().uuid(),
description: z.string().nullable().optional(), // description: z.string().nullable().optional(),
typeSharing: z.number().int(), // typeSharing: z.number().int(),
dateViewExpire: z.string().datetime().nullable().optional(), // dateViewExpire: z.string().datetime().nullable().optional(),
}).strict(); // }).strict();
export const AttachmentInputDTOSchema = z.object({ // export const AttachmentInputDTOSchema = z.object({
sourceId: z.string().nullable().optional(), // sourceId: z.string().nullable().optional(),
sourceName: z.string().nullable().optional(), // sourceName: z.string().nullable().optional(),
description: z.string().nullable().optional(), // description: z.string().nullable().optional(),
applicationId: z.number().int(), // applicationId: z.number().int(),
}).strict(); // }).strict();
export const AttendeeCommunicationInputDTOSchema = z.object({ // export const AttendeeCommunicationInputDTOSchema = z.object({
attendeeId: z.string().uuid(), // attendeeId: z.string().uuid(),
message: z.string().nullable().optional(), // message: z.string().nullable().optional(),
}).strict(); // }).strict();
export const AttendeeExternalInputDTOSchema = z.object({ // export const AttendeeExternalInputDTOSchema = z.object({
name: z.string().min(1), // name: z.string().min(1),
emailAddress: z.string().email().nullable().optional(), // emailAddress: z.string().email().nullable().optional(),
message: z.string().nullable().optional(), // message: z.string().nullable().optional(),
}).strict(); // }).strict();
export const AttendeeInputDTOSchema = z.object({ // export const AttendeeInputDTOSchema = z.object({
name: z.string().min(1), // name: z.string().min(1),
emailAddress: z.string().nullable().optional(), // emailAddress: z.string().nullable().optional(),
attendeeType: z.number(), // attendeeType: z.number(),
wxUserId: z.number().int(), // wxUserId: z.number().int(),
}).strict(); // }).strict();
const EAttendeeTypeDTO = z.number(); // const EAttendeeTypeDTO = z.number();
const EEventCategoryDTO = z.number(); // const EEventCategoryDTO = z.number();
const EEventFilterCategoryDTO = z.number(); // const EEventFilterCategoryDTO = z.number();
const EEventFilterStatusDTO = z.number(); // const EEventFilterStatusDTO = z.number();
const EEventFilterTypeDTO = z.number(); // const EEventFilterTypeDTO = z.number();
const EEventOwnerTypeDTO = z.number(); // const EEventOwnerTypeDTO = z.number();
const EEventStatusDTO = z.number(); // const EEventStatusDTO = z.number();
const EEventTypeDTO = z.number(); // const EEventTypeDTO = z.number();
const ERecurringTypeDTO = z.number(); // const ERecurringTypeDTO = z.number();
const EventAddAttachmentDTOSchema = z.object({ // const EventAddAttachmentDTOSchema = z.object({
attachments: z.array(AttachmentInputDTOSchema), // attachments: z.array(AttachmentInputDTOSchema),
}).strict(); // }).strict();
const EventAddAttendeeDTOSchema = z.object({ // const EventAddAttendeeDTOSchema = z.object({
attendees: z.array(AttendeeInputDTOSchema), // attendees: z.array(AttendeeInputDTOSchema),
}).strict(); // }).strict();
export const EventCommunicationInputDTOSchema = z.object({ // export const EventCommunicationInputDTOSchema = z.object({
attachs: z.array(AttachCommunicationInputDTOSchema).nullable().optional(), // attachs: z.array(AttachCommunicationInputDTOSchema).nullable().optional(),
attendees: z.array(AttendeeCommunicationInputDTOSchema).nullable().optional(), // attendees: z.array(AttendeeCommunicationInputDTOSchema).nullable().optional(),
externalAttendees: z.array(AttendeeExternalInputDTOSchema).nullable().optional(), // externalAttendees: z.array(AttendeeExternalInputDTOSchema).nullable().optional(),
}).strict(); // }).strict();
export const EventInputDTOSchema = z.object({ // // export const EventInputDTOSchema = z.object({
userId: z.number().int(), // // userId: z.number().int(),
ownerType: EEventOwnerTypeDTO, // // ownerType: EEventOwnerTypeDTO,
subject: z.string().min(1), // // subject: z.string().min(1),
body: z.string().min(1), // // body: z.string().min(1),
location: z.string().nullable().optional(), // // location: z.string().nullable().optional(),
startDate: z.string(), // // startDate: z.string(),
endDate: z.string(), // // endDate: z.string(),
type: EEventTypeDTO, // // type: EEventTypeDTO,
category: EEventCategoryDTO, // // category: EEventCategoryDTO,
attendees: z.array(AttendeeInputDTOSchema).nullable().optional(), // // attendees: z.array(AttendeeInputDTOSchema).nullable().optional(),
attachments: z.array(AttachmentInputDTOSchema).nullable().optional(), // // attachments: z.array(AttachmentInputDTOSchema).nullable().optional(),
recurrence: z.object({ // // recurrence: z.object({
frequency: z.number().int(), // // frequency: z.number().int(),
until: z.string(), // // until: z.string(),
}), // // }),
organizerId: z.number().int(), // // organizerId: z.number().int(),
isAllDayEvent: z.boolean(), // // isAllDayEvent: z.boolean(),
}).strict(); // // }).strict();
export const EventRecurrenceInputDTOSchema = z.object({ // export const EventRecurrenceInputDTOSchema = z.object({
frequency: z.number().int(), // frequency: z.number().int(),
occurrences: z.number().int(), // occurrences: z.number().int(),
}).strict(); // }).strict();
export const EventRemoveAttachmentDTOSchema = z.object({ // export const EventRemoveAttachmentDTOSchema = z.object({
attachments: z.array(z.string().uuid()), // attachments: z.array(z.string().uuid()),
}).strict(); // }).strict();
export const EventRemoveAttendeeDTOSchema = z.object({ // export const EventRemoveAttendeeDTOSchema = z.object({
attendees: z.array(z.string().uuid()), // attendees: z.array(z.string().uuid()),
}).strict(); // }).strict();
export const EventUpdateDTOSchema = z.object({ // export const EventUpdateDTOSchema = z.object({
subject: z.string().min(1), // subject: z.string().min(1),
body: z.string().min(1), // body: z.string().min(1),
location: z.string().min(1), // location: z.string().min(1),
startDate: z.string().datetime(), // startDate: z.string().datetime(),
endDate: z.string().datetime(), // endDate: z.string().datetime(),
isAllDayEvent: z.boolean(), // isAllDayEvent: z.boolean(),
updateAllEvents: z.boolean(), // updateAllEvents: z.boolean(),
recurrence: z.object({ // recurrence: z.object({
frequency: z.number().int(), // frequency: z.number().int(),
occurrences: z.number().int(), // occurrences: z.number().int(),
}), // }),
}).strict(); // }).strict();
export const EventUpdateStatusDTOSchema = z.object({ // export const EventUpdateStatusDTOSchema = z.object({
status: EEventStatusDTO, // status: EEventStatusDTO,
comment: z.string().nullable().optional(), // comment: z.string().nullable().optional(),
}).strict(); // }).strict();
export const ProblemDetailsDTOSchema = z.object({ // export const ProblemDetailsDTOSchema = z.object({
type: z.string().nullable().optional(), // type: z.string().nullable().optional(),
title: z.string().nullable().optional(), // title: z.string().nullable().optional(),
status: z.number().int().nullable().optional(), // status: z.number().int().nullable().optional(),
detail: z.string().nullable().optional(), // detail: z.string().nullable().optional(),
instance: z.string().nullable().optional(), // instance: z.string().nullable().optional(),
}).strict(); // }).strict();
export const ResponseSimpleDTOSchema = z.object({ // export const ResponseSimpleDTOSchema = z.object({
success: z.boolean(), // success: z.boolean(),
message: z.string().nullable().optional(), // message: z.string().nullable().optional(),
data: z.any().nullable().optional(), // data: z.any().nullable().optional(),
}) // })
export type AttachCommunicationInputDTO = z.infer<typeof AttachCommunicationInputDTOSchema>; // export type AttachCommunicationInputDTO = z.infer<typeof AttachCommunicationInputDTOSchema>;
export type AttachmentInputDTO = z.infer<typeof AttachCommunicationInputDTOSchema>; // export type AttachmentInputDTO = z.infer<typeof AttachCommunicationInputDTOSchema>;
export type AttendeeCommunicationInputDTO = z.infer<typeof AttachCommunicationInputDTOSchema>; // export type AttendeeCommunicationInputDTO = z.infer<typeof AttachCommunicationInputDTOSchema>;
export type AttendeeExternalInputDTO = z.infer<typeof AttachCommunicationInputDTOSchema>; // export type AttendeeExternalInputDTO = z.infer<typeof AttachCommunicationInputDTOSchema>;
export type AttendeeInputDTO = z.infer<typeof AttachCommunicationInputDTOSchema>; // export type AttendeeInputDTO = z.infer<typeof AttachCommunicationInputDTOSchema>;
export type EventAddAttachmentDTO = z.infer<typeof AttachCommunicationInputDTOSchema>; // export type EventAddAttachmentDTO = z.infer<typeof AttachCommunicationInputDTOSchema>;
export type EventAddAttendeeDTO = z.infer<typeof AttachCommunicationInputDTOSchema>; // export type EventAddAttendeeDTO = z.infer<typeof AttachCommunicationInputDTOSchema>;
export type EventCommunicationInputDTO = z.infer<typeof AttachCommunicationInputDTOSchema>; // export type EventCommunicationInputDTO = z.infer<typeof AttachCommunicationInputDTOSchema>;
export type EventInputDTO = z.infer<typeof EventInputDTOSchema>; // // export type EventInputDTO = z.infer<typeof EventInputDTOSchema>;
export type EventRecurrenceInputDTO = z.infer<typeof AttachCommunicationInputDTOSchema>; // export type EventRecurrenceInputDTO = z.infer<typeof AttachCommunicationInputDTOSchema>;
export type EventRemoveAttachmentDTO = z.infer<typeof AttachCommunicationInputDTOSchema>; // export type EventRemoveAttachmentDTO = z.infer<typeof AttachCommunicationInputDTOSchema>;
export type EventRemoveAttendeeDTO = z.infer<typeof AttachCommunicationInputDTOSchema>; // export type EventRemoveAttendeeDTO = z.infer<typeof AttachCommunicationInputDTOSchema>;
export type EventUpdateDTO = z.infer<typeof AttachCommunicationInputDTOSchema>; // export type EventUpdateDTO = z.infer<typeof AttachCommunicationInputDTOSchema>;
export type EventUpdateStatusDTO = z.infer<typeof AttachCommunicationInputDTOSchema>; // export type EventUpdateStatusDTO = z.infer<typeof AttachCommunicationInputDTOSchema>;
export type ProblemDetailsDTO = z.infer<typeof AttachCommunicationInputDTOSchema>; // export type ProblemDetailsDTO = z.infer<typeof AttachCommunicationInputDTOSchema>;
export type ResponseSimpleDTO = z.infer<typeof AttachCommunicationInputDTOSchema>; // export type ResponseSimpleDTO = z.infer<typeof AttachCommunicationInputDTOSchema>;
@@ -0,0 +1,14 @@
import { z } from 'zod';
export const AttendeeInputDTOSchema = z.array(z.object({
name: z.string(),
emailAddress: z.string(),
attendeeType: z.number(),
wxUserId: z.number(),
userType: z.enum(['GD','External', 'Internal']),
entity: z.string()
}))
export type AttendeeInputDTO = z.infer<typeof AttendeeInputDTOSchema>
@@ -5,7 +5,9 @@ const attendeeSchema = z.object({
name: z.string(), name: z.string(),
emailAddress: z.string(), emailAddress: z.string(),
attendeeType: z.number(), attendeeType: z.number(),
wxUserId: z.number() wxUserId: z.number(),
userType: z.enum(['GD','External', 'Internal']),
entity: z.string()
}); });
const attachmentSchema = z.object({ const attachmentSchema = z.object({
@@ -1,19 +1,6 @@
import { z } from 'zod'; import { z } from 'zod';
import { EEventCategory, EEventOwnerType, EEventType } from './enums'; 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({ const recurrenceSchema = z.object({
frequency: z.number(), frequency: z.number(),
+7 -1
View File
@@ -1,5 +1,4 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { AgendaDataService } from './agenda-data.service';
import { EventsService } from '../../events.service'; import { EventsService } from '../../events.service';
import { RoleIdService } from 'src/app/services/role-id.service' import { RoleIdService } from 'src/app/services/role-id.service'
import { TableSharedCalendar } from './agenda-local-data-source.service'; import { TableSharedCalendar } from './agenda-local-data-source.service';
@@ -131,12 +130,17 @@ export class Utils {
attendeesAdded(taskParticipants: any[]) { attendeesAdded(taskParticipants: any[]) {
console.log({taskParticipants});
return taskParticipants.map((e) => { return taskParticipants.map((e) => {
return { return {
name: e.Name, name: e.Name,
emailAddress: e.EmailAddress, emailAddress: e.EmailAddress,
attendeeType: this.atendeesSeletedType(JSON.stringify(e.IsRequired)), attendeeType: this.atendeesSeletedType(JSON.stringify(e.IsRequired)),
wxUserId: e.Id, wxUserId: e.Id,
userType: e.UserType,
entity: e.Entity,
} }
}); });
} }
@@ -159,6 +163,8 @@ export class Utils {
emailAddress: e.EmailAddress, emailAddress: e.EmailAddress,
attendeeType: this.atendeesSeletedType(JSON.stringify(e.IsRequired)), attendeeType: this.atendeesSeletedType(JSON.stringify(e.IsRequired)),
wxUserId: e.wxUserId || e.Id, wxUserId: e.wxUserId || e.Id,
userType: e.UserType,
entity: e.Entity,
} }
}); });
} }
@@ -0,0 +1,19 @@
import { z } from 'zod';
export const EventListOutputDTOSchema = z.object({
wxUserId: z.number(),
fullName: z.string(),
email: z.string(),
role: z.any(),
roleId: z.number(),
entity: z.string(),
userType: z.string(),
})
export const EventListDataOutputDTOSchema = z.object({
success: z.boolean(),
message: z.string(),
data: z.array(EventListOutputDTOSchema),
}).nullable();
export type ContactCombinedOutputDTO = z.infer<typeof EventListDataOutputDTOSchema>;
@@ -0,0 +1,18 @@
export interface UserContacts {
wxUserId: number;
wxFullName: string;
wxeMail: string | null;
userPhoto: string | null;
}
export interface UserListResult {
total: number,
result: UserContacts[]
}
export interface UserListOutOutDTO {
success: boolean;
message: string;
data: UserListResult;
}
@@ -0,0 +1,26 @@
import { Injectable } from '@angular/core';
import { HttpService } from 'src/app/services/http.service';
import { UserListOutOutDTO } from '../DTO/userListOutput';
import { ContactCombinedOutputDTO, EventListDataOutputDTOSchema } from '../DTO/contactsCombined';
import { APIReturn } from 'src/app/services/decorator/api-validate-schema.decorator';
@Injectable({
providedIn: 'root'
})
export class ContactsDataSourceService {
private baseUrl = 'https://gdapi-dev.dyndns.info/stage/api/v2'; // Your base URL
constructor(private httpService: HttpService) {}
@APIReturn(EventListDataOutputDTOSchema, '/Contacts/Combined')
async getCombinedList() {
return await this.httpService.get<ContactCombinedOutputDTO>(`${this.baseUrl}/Contacts/Combined`);
}
async getUsers() {
return await this.httpService.get<UserListOutOutDTO>(`${this.baseUrl}/Users`);
}
}
@@ -0,0 +1,28 @@
import { RoleIdService } from "src/app/services/role-id.service";
import { ContactCombinedOutputDTO } from "../DTO/contactsCombined";
import { UserList } from "src/app/models/entiry/agenda/contact";
const roles = new RoleIdService()
export class ListEventMapper {
// @XTracer({name:'ListEventMapper/toDomain', log: false, bugPrint: false})
static toDomain(dto: ContactCombinedOutputDTO): UserList {
return dto.data.map((e) => {
return {
Id: e.wxUserId,
EmailAddress: e.email,
Name: e.fullName,
UserType: e.userType,
Entity: e.entity,
IsPR: e.roleId == roles.PRES,
RoleId: e.roleId,
IsRequired: false
}
})
}
static toDTO() {}
}
@@ -0,0 +1,26 @@
import { Injectable } from '@angular/core';
import { ContactsDataSourceService } from '../data-source/contacts-data-source.service';
import { ListEventMapper } from '../mapper/contactCombinedMapper';
@Injectable({
providedIn: 'root'
})
export class ContactRepositoryService {
constructor(
private constactsDataSourceService: ContactsDataSourceService,
) {}
async getUsersMap() {
const result = await this.constactsDataSourceService.getCombinedList();
return result.map((result) => {
return ListEventMapper.toDomain(result).filter(e => e.EmailAddress != null)
});
}
async getUsers() {
const result = await this.constactsDataSourceService.getUsers();
return result;
}
}
@@ -13,7 +13,6 @@ import { NativeNotificationService } from 'src/app/services/native-notification.
import { SortService } from '../functions/sort.service'; import { SortService } from '../functions/sort.service';
import { chatUser } from 'src/app/models/chatMethod'; import { chatUser } from 'src/app/models/chatMethod';
import { NfService } from 'src/app/services/chat/nf.service' import { NfService } from 'src/app/services/chat/nf.service'
import { ChangeProfileService } from '../change-profile.service';
import { ChatMethodsService } from './chat-methods.service'; import { ChatMethodsService } from './chat-methods.service';
import { AESEncrypt } from '../aesencrypt.service' import { AESEncrypt } from '../aesencrypt.service'
import { AttachmentsService } from 'src/app/services/attachments.service'; import { AttachmentsService } from 'src/app/services/attachments.service';
@@ -11,6 +11,8 @@ export function APIReturn(schema: z.ZodTypeAny, path: string) {
descriptor.value = async function (...args: any[]) { descriptor.value = async function (...args: any[]) {
const result: Result<any, HttpErrorResponse> = await originalMethod.apply(this, args); const result: Result<any, HttpErrorResponse> = await originalMethod.apply(this, args);
const tracing: TracingType = args[args.length - 1];
if(result.isOk()) { if(result.isOk()) {
try { try {
// Validate the result using the provided schema // Validate the result using the provided schema
@@ -23,6 +25,14 @@ export function APIReturn(schema: z.ZodTypeAny, path: string) {
// Capture the Zod validation error with additional context // Capture the Zod validation error with additional context
console.error('Validation failed:', error.errors); console.error('Validation failed:', error.errors);
console.log(result.value) console.log(result.value)
tracing?.setAttribute?.('APIReturn.error', 'true')
let i = 0;
for(const schema of error.errors) {
tracing?.setAttribute?.('map.error.schema-'+i, JSON.stringify(schema))
}
} else { } else {
// Throw any other unexpected errors // Throw any other unexpected errors
// throw error; // throw error;
@@ -57,6 +67,7 @@ export function APINODReturn(schema: z.ZodTypeAny, data , path: string, tracing?
console.log(data) console.log(data)
tracing?.setAttribute('APIReturn.error', 'true') tracing?.setAttribute('APIReturn.error', 'true')
tracing?.setAttribute('path', path)
let i = 0; let i = 0;
for(const schema of error.errors) { for(const schema of error.errors) {
+30 -4
View File
@@ -2,6 +2,7 @@ import { HttpClient, HttpErrorResponse, HttpResponse } from '@angular/common/htt
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { ok, err, Result } from 'neverthrow'; import { ok, err, Result } from 'neverthrow';
import { HttpParams } from '@angular/common/http'; import { HttpParams } from '@angular/common/http';
import { TracingType } from './monitoring/opentelemetry/tracer';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
}) })
@@ -9,7 +10,7 @@ export class HttpService {
constructor(private http:HttpClient) { } constructor(private http:HttpClient) { }
async post<T>(url: string, body: any): Promise<Result<T, HttpErrorResponse>> { async post<T>(url: string, body: any, tracing?: TracingType): Promise<Result<T, HttpErrorResponse>> {
try { try {
const result = await this.http.post(url, body).toPromise() const result = await this.http.post(url, body).toPromise()
@@ -19,7 +20,7 @@ export class HttpService {
} }
} }
async get<T>(url: string, httpParamsObj = {} ): Promise<Result<T, HttpErrorResponse>> { async get<T>(url: string, httpParamsObj = {}, tracing?: TracingType): Promise<Result<T, HttpErrorResponse>> {
try { try {
let httpParams = new HttpParams(); let httpParams = new HttpParams();
@@ -38,6 +39,18 @@ export class HttpService {
return ok (result as T) return ok (result as T)
} catch (e) { } catch (e) {
if(isHttpError(e)) {
tracing?.setAttribute('status.code', e.status.toString())
if (e.status == 400) {
tracing?.bugFlag()
tracing?.setAttribute('outcome', 'failed')
}
} else {
tracing?.bugFlag()
tracing.setAttribute('outcome', 'failed')
tracing?.setAttribute('map.error', 'true')
tracing?.setAttribute('map.error.context', JSON.stringify(e))
}
return err(e as HttpErrorResponse) return err(e as HttpErrorResponse)
} }
} }
@@ -53,10 +66,23 @@ export class HttpService {
} }
async delete<T>(url: string): Promise<Result<T, HttpErrorResponse>> { async delete<T>(url: string, httpParamsObj = {}): Promise<Result<T, HttpErrorResponse>> {
let httpParams = new HttpParams();
// Convert params object to HttpParams
if (httpParamsObj) {
Object.keys(httpParamsObj).forEach(key => {
httpParams = httpParams.set(key, httpParamsObj[key]);
})
}
let opts = {
params : httpParams
}
try { try {
const result = await this.http.delete<T>(url).toPromise() const result = await this.http.delete<T>(url, opts).toPromise()
return ok (result as T) return ok (result as T)
} catch (e) { } catch (e) {
return err(e as HttpErrorResponse) return err(e as HttpErrorResponse)
+1 -3
View File
@@ -60,15 +60,13 @@ export class NotificationsService {
constructor( constructor(
private http: HttpClient, private http: HttpClient,
private storageService: StorageService,
public modalCtrl: AlertController, public modalCtrl: AlertController,
private platform: Platform, private platform: Platform,
private router: Router, private router: Router,
private zone: NgZone, private zone: NgZone,
private eventtrigger: EventTrigger, private eventtrigger: EventTrigger,
private afMessaging: AngularFireMessaging, private afMessaging: AngularFireMessaging,
public NotificationHolderService: NotificationHolderService, public NotificationHolderService: NotificationHolderService) {
private NotificationRepositoryService: NotificationRepositoryService) {
// this.onReciveForeground(); // this.onReciveForeground();
this.onReciveBackground(); this.onReciveBackground();
@@ -118,24 +118,22 @@ export class ApproveEventPage implements OnInit {
const loader = this.toastService.loading() const loader = this.toastService.loading()
try { const result = await this.agendaDataRepository.approveEvent(serialNumber)// .subscribe((value) => {
this.agendaDataRepository.approveEvent(serialNumber).subscribe((value) => { if(result.isOk()) {
console.log(value)
console.log(result.value)
this.modalController.dismiss(serialNumber); this.modalController.dismiss(serialNumber);
this.httpErroHandle.httpsSucessMessagge('Aprovar') this.httpErroHandle.httpsSucessMessagge('Aprovar')
this.TaskService.loadEventosParaAprovacao(); this.TaskService.loadEventosParaAprovacao();
}, ((error) => { } else {
console.log('aprove event error: ', error)
this.httpErroHandle.httpStatusHandle(error) console.log('aprove event error: ', result.error)
})) this.httpErroHandle.httpStatusHandle(result.error)
/* await this.processes.PostTaskAction(body).toPromise() */ }
} catch (error) {
this.httpErroHandle.httpStatusHandle(error)
} finally {
this.close() this.close()
loader.remove() loader.remove()
}
} }
@@ -145,24 +143,20 @@ export class ApproveEventPage implements OnInit {
const loader = this.toastService.loading() const loader = this.toastService.loading()
const result = await this.agendaDataRepository.eventToaprovalStatus(serialNumber, 'Declined', "")//.subscribe((value) => {
try { if(result.isOk()) {
/* await this.processes.PostTaskAction(body).toPromise() */
this.agendaDataRepository.eventToaprovalStatus(serialNumber, 'Declined', "").subscribe((value) => {
this.httpErroHandle.httpsSucessMessagge('Rejeitar'); this.httpErroHandle.httpsSucessMessagge('Rejeitar');
this.TaskService.loadEventosParaAprovacao(); this.TaskService.loadEventosParaAprovacao();
}, ((error) => {
console.log('reject event error: ', error)
this.httpErroHandle.httpStatusHandle(error)
}))
} catch (error) {
this.httpErroHandle.httpStatusHandle(error)
} finally {
loader.remove()
this.close() this.close()
} else {
console.log('reject event error: ', result.error)
this.httpErroHandle.httpStatusHandle(result.error)
} }
loader.remove()
} }
@@ -235,24 +229,21 @@ export class ApproveEventPage implements OnInit {
} }
const loader = this.toastService.loading(); const loader = this.toastService.loading();
try {
/* await this.processes.PostTaskAction(body).toPromise(); */ /* await this.processes.PostTaskAction(body).toPromise(); */
this.agendaDataRepository.eventToaprovalStatus(serialNumber, 'Revision', res.data.note).subscribe((value) => { const result = await this.agendaDataRepository.eventToaprovalStatus(serialNumber, 'Revision', res.data.note)// .subscribe((value) => {
if(result.isOk()) {
this.httpErroHandle.httpsSucessMessagge('Rever') this.httpErroHandle.httpsSucessMessagge('Rever')
this.TaskService.loadEventosParaAprovacao(); this.TaskService.loadEventosParaAprovacao();
this.close(); this.close();
},((error) => { } else {
console.log('send event to revision error: ', error)
this.httpErroHandle.httpStatusHandle(error)
}));
} catch (error) { console.log('send event to revision error: ', result.error)
this.httpErroHandle.httpStatusHandle(error) this.httpErroHandle.httpStatusHandle(result.error)
} finally {
loader.remove()
} }
loader.remove()
} else { } else {
} }
@@ -400,19 +400,20 @@ export class EditEventToApprovePage implements OnInit {
} }
try { try {
/* await this.eventsService.postEventToApproveEdit(event).toPromise() */
const calendar = await this.agendaDataRepository.getCalendarByUserId((this.eventProcess as any).owner.wxUserId) const calendar = await this.agendaDataRepository.getCalendarByUserId((this.eventProcess as any).owner.wxUserId)
if(calendar.isOk()) { if(calendar.isOk()) {
this.agendaDataRepository.updateEvent(this.eventProcess.serialNumber, event, true, calendar.value, tracing).subscribe((value) => { const value = await this.agendaDataRepository.updateEvent(this.eventProcess.serialNumber, event, true, calendar.value, tracing)
if(value.isOk()) {
console.log(value) console.log(value)
this.close() this.close()
tracing.setAttribute('outcome', 'success') tracing.setAttribute('outcome', 'success')
}, ((error) => { } else {
console.log('edit event error: ', error) console.log('edit event error: ', value.error)
tracing.setAttribute('outcome', 'failed') tracing.setAttribute('outcome', 'failed')
})); }
console.log({serverCurrentList, list: this.eventProcess.workflowInstanceDataFields.ParticipantsList, e: this.eventProcess}) console.log({serverCurrentList, list: this.eventProcess.workflowInstanceDataFields.ParticipantsList, e: this.eventProcess})
@@ -421,7 +422,7 @@ export class EditEventToApprovePage implements OnInit {
console.log({insert, remove}) console.log({insert, remove})
if(insert.length >= 1) { if(insert.length >= 1) {
this.agendaDataRepository.addEventAttendee(this.eventProcess.serialNumber, insert).subscribe((value) => { this.agendaDataRepository.addEventAttendee(this.eventProcess.serialNumber, insert, tracing).subscribe((value) => {
console.log(value) console.log(value)
}, ((error) => { }, ((error) => {
console.log('add Attendee error: ', error) console.log('add Attendee error: ', error)
@@ -416,34 +416,33 @@ export class EditEventPage implements OnInit {
try { try {
console.log('this.selectedUserCalendar', this.selectedUserCalendar)
const calendar = await this.agendaDataRepository.getCalendarByUserId(this.selectedUserCalendar) const calendar = await this.agendaDataRepository.getCalendarByUserId(this.selectedUserCalendar)
if(calendar.isOk()) { if(calendar.isOk()) {
this.showLoader = true; this.showLoader = true;
this.agendaDataRepository.updateEvent(this._postEvent.EventId, this._postEvent, this.editAllEvent, calendar.value, tracing).subscribe((value) => { const value = await this.agendaDataRepository.updateEvent(this._postEvent.EventId, this._postEvent, this.editAllEvent, calendar.value, tracing)
console.log(value)
if(value.isOk()) {
console.log(value.value)
this.httpErrorHandle.httpsSucessMessagge('Editar evento') this.httpErrorHandle.httpsSucessMessagge('Editar evento')
this.clearPostEvent.emit(); this.clearPostEvent.emit();
this.deleteTemporaryData(); this.deleteTemporaryData();
this.showLoader = false; this.showLoader = false;
this.close(); this.close();
tracing.setAttribute('outcome', 'success') tracing
} else {
}, ((error) => { console.log('edit event error: ', value.error)
console.log('edit event error: ', error)
tracing.setAttribute('outcome', 'failed') tracing.setAttribute('outcome', 'failed')
})); }
console.log({serverCurrentList, Attendees: this._postEvent.Attendees})
const { insert, remove } = AttendeesLIstChangeDetector(serverCurrentList as any, this._postEvent.Attendees as any) const { insert, remove } = AttendeesLIstChangeDetector(serverCurrentList as any, this._postEvent.Attendees as any)
console.log({ insert, remove }); console.log({ insert, remove });
if(insert.length >= 1) { if(insert.length >= 1) {
this.agendaDataRepository.addEventAttendee(this._postEvent.EventId, insert).subscribe((value) => { this.agendaDataRepository.addEventAttendee(this._postEvent.EventId, insert, tracing).subscribe((value) => {
console.log(value) console.log(value)
}, ((error) => { }, ((error) => {
tracing.setAttribute('failed.attendees', 'true') tracing.setAttribute('failed.attendees', 'true')
@@ -33,6 +33,8 @@ import { AgendaDataRepositoryService } from 'src/app/services/Repositorys/Agenda
import { RoleIdService } from 'src/app/services/role-id.service' import { RoleIdService } from 'src/app/services/role-id.service'
import { TableSharedCalendar } from 'src/app/services/Repositorys/Agenda/agenda-local-data-source.service'; import { TableSharedCalendar } from 'src/app/services/Repositorys/Agenda/agenda-local-data-source.service';
import { TracingType, XTracerAsync } from 'src/app/services/monitoring/opentelemetry/tracer'; import { TracingType, XTracerAsync } from 'src/app/services/monitoring/opentelemetry/tracer';
import { ContactRepositoryService } from 'src/app/services/Repositorys/contacts/repository/contacts-repository.service';
import { UserList } from 'src/app/models/entiry/agenda/contact';
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = { const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
@@ -85,7 +87,7 @@ export class NewEventPage implements OnInit {
@Input() selectedSegment: string; @Input() selectedSegment: string;
@Input() selectedDate: Date; @Input() selectedDate: Date;
@Input() CalendarDate: Date; @Input() CalendarDate: Date;
@Input() taskParticipants: EventPerson[] = []; @Input() taskParticipants: UserList = [];
@Input() taskParticipantsCc: any = []; @Input() taskParticipantsCc: any = [];
@Output() setIntervenient = new EventEmitter<any>(); @Output() setIntervenient = new EventEmitter<any>();
@@ -131,8 +133,8 @@ export class NewEventPage implements OnInit {
CalendarNamesOptions = ['Oficial', 'Pessoal'] CalendarNamesOptions = ['Oficial', 'Pessoal']
environment = environment environment = environment
eventPersons: EventPerson[]; eventPersons: UserList;
contacts: EventPerson[] = []; contacts: UserList = [];
allDayCheck: boolean = false; allDayCheck: boolean = false;
@@ -153,6 +155,7 @@ export class NewEventPage implements OnInit {
private changeProfileService: ChangeProfileService, private changeProfileService: ChangeProfileService,
private agendaDataRepository: AgendaDataRepositoryService, private agendaDataRepository: AgendaDataRepositoryService,
public RoleIdService: RoleIdService, public RoleIdService: RoleIdService,
private ContactRepositoryService: ContactRepositoryService
) { ) {
this.dateAdapter.setLocale('pt'); this.dateAdapter.setLocale('pt');
this.loggeduser = SessionStore.user; this.loggeduser = SessionStore.user;
@@ -208,7 +211,7 @@ export class NewEventPage implements OnInit {
if (this.postEvent.Attendees != null) { if (this.postEvent.Attendees != null) {
this.postEvent.Attendees.forEach(e => { this.postEvent.Attendees.forEach(e => {
if (e.IsRequired) { if (e.IsRequired) {
this.taskParticipants.push(e); this.taskParticipants.push(e as any);
} else { } else {
this.taskParticipantsCc.push(e); this.taskParticipantsCc.push(e);
} }
@@ -553,29 +556,30 @@ export class NewEventPage implements OnInit {
} }
let loader = this.toastService.loading(); let loader = this.toastService.loading();
this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc); this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc) as any
this.postEvent.IsAllDayEvent = this.allDayCheck; this.postEvent.IsAllDayEvent = this.allDayCheck;
const calendar = await this.agendaDataRepository.getCalendarByUserId(this.selectedUserCalendar) const calendar = await this.agendaDataRepository.getCalendarByUserId(this.selectedUserCalendar)
if(calendar.isOk()) { if(calendar.isOk()) {
try { const value = await this.agendaDataRepository.createEvent(this.postEvent, this.documents, calendar.value, tracing)
const value = await this.agendaDataRepository.createEvent(this.postEvent, this.documents, calendar.value, tracing).toPromise()
if(value.isOk()) {
console.log(value) console.log(value)
this.afterSave(); this.afterSave();
this.hhtpErrorHandle.httpsSucessMessagge('new event') this.hhtpErrorHandle.httpsSucessMessagge('new event')
loader.remove(); loader.remove();
tracing.setAttribute('outcome', 'success') tracing.setAttribute('outcome', 'success')
} catch (error) { } else {
console.log('create event error: ', error) console.log('create event error: ', value.error)
tracing.setAttribute('outcome', 'failed') tracing.setAttribute('outcome', 'failed')
loader.remove(); loader.remove();
this.hhtpErrorHandle.httpStatusHandle(error.status) this.hhtpErrorHandle.httpStatusHandle(value.error.status)
} }
} else {
} } else {}
} }
@@ -672,7 +676,11 @@ export class NewEventPage implements OnInit {
async fetchContacts(filter: string) { async fetchContacts(filter: string) {
console.log(this.loggeduser.Profile) console.log(this.loggeduser.Profile)
if (this.loggeduser.Profile == 'PR') { if (this.loggeduser.Profile == 'PR') {
this.contactsService.getContacts(filter).subscribe(result => {
const RequestResult = await this.ContactRepositoryService.getUsersMap();
if(RequestResult.isOk()) {
const result = RequestResult.value
if (this.eventPersons != null) { if (this.eventPersons != null) {
this.eventPersons.forEach(attendee => { this.eventPersons.forEach(attendee => {
const index: number = result.findIndex((cont) => { const index: number = result.findIndex((cont) => {
@@ -685,7 +693,7 @@ export class NewEventPage implements OnInit {
} }
this.contacts = result; this.contacts = result;
console.log('Attendes Email', this.loggeduser.Email) console.log('Attendes Email', this.loggeduser.Email)
let filterLoggedUserEmail = this.contacts.filter(item => item.RoleDescription == "Ministro e Director do Gabinete do PR") let filterLoggedUserEmail = this.contacts.filter(item => item.RoleId == this.RoleIdService.MD)
console.log('Attendes Email', filterLoggedUserEmail) console.log('Attendes Email', filterLoggedUserEmail)
this.contacts = filterLoggedUserEmail; this.contacts = filterLoggedUserEmail;
@@ -693,8 +701,11 @@ export class NewEventPage implements OnInit {
this.taskParticipants.push(this.contacts[0]); this.taskParticipants.push(this.contacts[0]);
this.setIntervenient.emit(this.taskParticipants); this.setIntervenient.emit(this.taskParticipants);
console.log('Attendes Email', this.taskParticipants) console.log('Attendes Email', this.taskParticipants)
} else {
} }
);
} }
} }
@@ -23,6 +23,7 @@ import { SearchList_v2 } from 'src/app/models/search-document';
import { TracingType, XTracerAsync } from 'src/app/services/monitoring/opentelemetry/tracer'; import { TracingType, XTracerAsync } from 'src/app/services/monitoring/opentelemetry/tracer';
import { isHttpError } from 'src/app/services/http.service'; import { isHttpError } from 'src/app/services/http.service';
import { PermissionService } from 'src/app/services/permission.service'; import { PermissionService } from 'src/app/services/permission.service';
import { DeleteEventRecurrencePage, EventDeleteRecurrenceComponentReturn } from 'src/app/modals/delete-event-recurrence/delete-event-recurrence.page';
@Component({ @Component({
selector: 'app-view-event', selector: 'app-view-event',
templateUrl: './view-event.page.html', templateUrl: './view-event.page.html',
@@ -209,40 +210,32 @@ export class ViewEventPage implements OnInit {
} }
deleteYesOrNo() { async deleteYesOrNo() {
if (this.loadedEvent.IsRecurring) { if (this.loadedEvent.IsRecurring) {
this.alertController.create({ const modal = await this.modalController.create({
header: 'Eliminar evento?', component: DeleteEventRecurrencePage,
message: 'Este evento tem recorrência, deseja eliminar a Sequência de eventos?', componentProps: {},
inputs: [ cssClass: 'event-recurrence-modal',
{
name: 'confirm',
type: 'checkbox',
label: '',
value: 'confirm',
checked: false,
}
],
buttons: [
{
text: 'Sim',
handler: (data) => {
if (data.includes('confirm')) {
this.deleteEvent_v2(true);
} else {
this.deleteEvent_v2(false);
}
}
},
{
text: 'Não',
handler: () => {
}
}
]
}).then(res => {
res.present();
}); });
modal.onDidDismiss().then((res) => {
const data: EventDeleteRecurrenceComponentReturn = res.data
if(data =='DeleteAll') {
this.deleteEvent_v2(true);
} else if (data == 'DeleteOne') {
this.deleteEvent_v2(false);
} else if(data == 'Cancel') {
this.close()
} else {
this.close()
}
});
await modal.present();
} else { } else {
this.alertController.create({ this.alertController.create({
header: 'Eliminar evento?', header: 'Eliminar evento?',
@@ -262,24 +255,29 @@ export class ViewEventPage implements OnInit {
] ]
}).then(res => { }).then(res => {
res.present(); res.present();
}); })
} }
} }
deleteEvent_v2(deleteAll) { async deleteEvent_v2(deleteAll) {
console.log(this.loadedEvent.EventId) console.log(this.loadedEvent.EventId)
const loader = this.toastService.loading() const loader = this.toastService.loading()
this.agendaDataRepository.deleteEvent(this.loadedEvent.EventId,deleteAll).subscribe(() => { const value = await this.agendaDataRepository.deleteEvent(this.loadedEvent.EventId,deleteAll)//.subscribe(() => {
console.log()
if(value.isOk()) {
console.log(value.value)
this.httpErrorHandle.httpsSucessMessagge('delete event') this.httpErrorHandle.httpsSucessMessagge('delete event')
this.close(); this.close();
},(error) => { } else {
console.log('delete event error: ',error)
this.httpErrorHandle.httpStatusHandle(error) console.log('delete event error: ', value.error)
},()=>{ this.httpErrorHandle.httpStatusHandle(value.error)
}
loader.remove(); loader.remove();
});
} }
// async deleteEvent() { // async deleteEvent() {
@@ -1,6 +1,4 @@
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { ModalController } from '@ionic/angular';
import { ContactsService } from 'src/app/services/contacts.service';
import { EventPerson } from 'src/app/models/eventperson.model'; import { EventPerson } from 'src/app/models/eventperson.model';
import { removeDuplicate } from 'src/plugin/removeDuplicate.js' import { removeDuplicate } from 'src/plugin/removeDuplicate.js'
import { ThemeService } from 'src/app/services/theme.service' import { ThemeService } from 'src/app/services/theme.service'
@@ -9,6 +7,7 @@ import { Searchbar } from 'ionic-angular';
import { LoginUserRespose } from 'src/app/models/user.model'; import { LoginUserRespose } from 'src/app/models/user.model';
import { SessionStore } from 'src/app/store/session.service'; import { SessionStore } from 'src/app/store/session.service';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import { ContactRepositoryService } from 'src/app/services/Repositorys/contacts/repository/contacts-repository.service';
@Component({ @Component({
selector: 'app-attendee-modal', selector: 'app-attendee-modal',
@@ -52,10 +51,9 @@ export class AttendeePage implements OnInit {
listOfNotAllowdRoute = ['/home/gabinete-digital/despachos/', ] listOfNotAllowdRoute = ['/home/gabinete-digital/despachos/', ]
constructor( constructor(
private modalCtrl: ModalController,
private contactsService: ContactsService,
public ThemeService: ThemeService, public ThemeService: ThemeService,
private router: Router,) { private router: Router,
private ContactRepositoryService: ContactRepositoryService) {
@@ -234,7 +232,13 @@ export class AttendeePage implements OnInit {
async fetchContacts(filter: string) { async fetchContacts(filter: string) {
this.showLoader = true; this.showLoader = true;
this.contactsService.getContacts(filter).subscribe(_result => { const RequestResult = await this.ContactRepositoryService.getUsersMap();
if(RequestResult.isOk()) {
const _result = RequestResult.value
console.log({_result})
let result let result
if(this.hideExternalDomain) { if(this.hideExternalDomain) {
@@ -270,8 +274,10 @@ export class AttendeePage implements OnInit {
this.showLoader = false; this.showLoader = false;
} }
} else {
} }
);
} }
checkStringNull(value: string) { checkStringNull(value: string) {
@@ -327,17 +327,19 @@ export class EditEventToApproveComponent implements OnInit {
const calendar = await this.agendaDataRepository.getCalendarByUserId((this.eventProcess as any).owner.wxUserId) const calendar = await this.agendaDataRepository.getCalendarByUserId((this.eventProcess as any).owner.wxUserId)
if(calendar.isOk()) { if(calendar.isOk()) {
this.agendaDataRepository.updateEvent(this.eventProcess.serialNumber, event, true, calendar.value, tracing).subscribe((value) => { const value = await this.agendaDataRepository.updateEvent(this.eventProcess.serialNumber, event, true, calendar.value, tracing)//.subscribe((value) => {
if(value.isOk()) {
console.log(value) console.log(value)
this.httpErroHalde.httpsSucessMessagge('Editar evento') this.httpErroHalde.httpsSucessMessagge('Editar evento')
window['approve-event-getTask']() window['approve-event-getTask']()
this.close(); this.close();
tracing.setAttribute('outcome', 'success') tracing.setAttribute('outcome', 'success')
}, ((error) => { } else {
this.httpErroHalde.httpStatusHandle(error) this.httpErroHalde.httpStatusHandle(value.error)
console.log('edit event error: ', error) console.log('edit event error: ', value.error)
tracing.setAttribute('outcome', 'failed') tracing.setAttribute('outcome', 'failed')
})); }
console.log({serverCurrentList, ParticipantsList:this.eventProcess.workflowInstanceDataFields.ParticipantsList}) console.log({serverCurrentList, ParticipantsList:this.eventProcess.workflowInstanceDataFields.ParticipantsList})
const { insert, remove } = AttendeesLIstChangeDetector(serverCurrentList as any, this.eventProcess.workflowInstanceDataFields.ParticipantsList as any) const { insert, remove } = AttendeesLIstChangeDetector(serverCurrentList as any, this.eventProcess.workflowInstanceDataFields.ParticipantsList as any)
@@ -346,7 +348,7 @@ export class EditEventToApproveComponent implements OnInit {
if(insert.length >= 1) { if(insert.length >= 1) {
this.agendaDataRepository.addEventAttendee(this.eventProcess.serialNumber, insert).subscribe((value) => { this.agendaDataRepository.addEventAttendee(this.eventProcess.serialNumber, insert, tracing).subscribe((value) => {
}, ((error) => { }, ((error) => {
console.log('add Attendee error: ', error) console.log('add Attendee error: ', error)
+2 -49
View File
@@ -11,9 +11,7 @@ import { ThemeService } from '../../services/theme.service';
import { RouteService } from 'src/app/services/route.service'; import { RouteService } from 'src/app/services/route.service';
import { PermissionList } from 'src/app/models/permission/permissionList'; import { PermissionList } from 'src/app/models/permission/permissionList';
import { PermissionService } from 'src/app/services/permission.service'; import { PermissionService } from 'src/app/services/permission.service';
import { EventTrigger } from 'src/app/services/eventTrigger.service'
import { ActiveTabService } from 'src/app/services/active-tab.service'; import { ActiveTabService } from 'src/app/services/active-tab.service';
import { NotificationsService } from 'src/app/services/notifications.service';
import { AttachmentsService } from 'src/app/services/attachments.service'; import { AttachmentsService } from 'src/app/services/attachments.service';
import { NotificationHolderService } from 'src/app/store/notification-holder.service'; import { NotificationHolderService } from 'src/app/store/notification-holder.service';
import { HeaderSettingsService } from "src/app/services/header-settings.service" import { HeaderSettingsService } from "src/app/services/header-settings.service"
@@ -64,15 +62,11 @@ export class HeaderPage implements OnInit {
private router: Router, private router: Router,
private modalController: ModalController, private modalController: ModalController,
private animationController: AnimationController, private animationController: AnimationController,
private storageservice: StorageService,
public platform: Platform, public platform: Platform,
public ThemeService: ThemeService, public ThemeService: ThemeService,
public RouteService: RouteService, public RouteService: RouteService,
public p: PermissionService, public p: PermissionService,
private eventTriger: EventTrigger,
public ActiveTabService: ActiveTabService, public ActiveTabService: ActiveTabService,
private notificationService: NotificationsService,
private cdRef: ChangeDetectorRef,
private storageService: StorageService, private storageService: StorageService,
private zone: NgZone, private zone: NgZone,
private attachmentService: AttachmentsService, private attachmentService: AttachmentsService,
@@ -84,10 +78,6 @@ export class HeaderPage implements OnInit {
this.notificationCount$ = this.notificationRepositoryService.getNotificationLiveCount() this.notificationCount$ = this.notificationRepositoryService.getNotificationLiveCount()
this.notificationCount$.subscribe(count => {
console.log('Notification Count:', count);
});
this.loggeduser = SessionStore.user; this.loggeduser = SessionStore.user;
router.events.subscribe((val) => { router.events.subscribe((val) => {
this.hideSearch(); this.hideSearch();
@@ -162,50 +152,15 @@ export class HeaderPage implements OnInit {
} }
updateReciveNotification() { updateReciveNotification() {
this.eventTriger.getObservable().subscribe((event) => {
if (event.notification == "recive") {
console.log('header', event.notification)
this.notificationLengthData()
}
});
} }
updateDeleteNotification() { updateDeleteNotification() {
this.eventTriger.getObservable().subscribe((event) => {
if (event.notification == "deleted") {
console.log('header', event.notification)
this.notificationLengthData()
}
});
} }
async notificationLengthData() {
console.log('Call notification data')
await this.storageservice.get("Notifications").then((value) => {
console.log('Get notification data',)
this.zone.run(() => {
this.notificationLength = value.length;
console.log('Call notification data', this.notificationLength)
});
}).catch((error) => {
if (!error) {
this.zone.run(() => {
console.error('header storage get notification', error)
this.notificationLength = 0;
});
} else {
console.error('header storage get notification', error)
}
})
}
hideSearch() { hideSearch() {
if (this.router.url.startsWith('/home/events') || this.router.url.startsWith('/home/chat')) { if (this.router.url.startsWith('/home/events') || this.router.url.startsWith('/home/chat')) {
this.hideSearchBtn = true; this.hideSearchBtn = true;
@@ -301,8 +256,6 @@ export class HeaderPage implements OnInit {
modal.onDidDismiss().then(() => { modal.onDidDismiss().then(() => {
this.notificationLengthData()
this.getProfilePictureSorage()
this.showProfileModal = false this.showProfileModal = false
}) })
+1 -1
View File
@@ -20,7 +20,7 @@ firebase.initializeApp(firebaseConfig);
const messaging = firebase.messaging(); const messaging = firebase.messaging();
messaging.onBackgroundMessage(function(payload) { messaging.onBackgroundMessage(function(payload) {
// console.log('Received background message 22 ', payload); console.log('Received background message 22 bbb ', payload);
const notificationTitle = payload.notification.title; const notificationTitle = payload.notification.title;
const notificationOptions = { const notificationOptions = {
+31 -12
View File
@@ -7,6 +7,10 @@
font-family: arial; font-family: arial;
} }
body {
margin: 0px;
}
.body { .body {
background-color: #f5f7fb; background-color: #f5f7fb;
padding: 35px; padding: 35px;
@@ -94,40 +98,45 @@
<img class="pa-15 m-auto d-flex" src="https://gwjkdh.stripocdn.email/content/guids/videoImgGuid/images/governo_de_angola_horizontal_logo_MH1.png" style="display:block; border:0; text-decoration:none;" alt="Logo" title="Logo" width="160" height="136"> <img class="pa-15 m-auto d-flex" src="https://gwjkdh.stripocdn.email/content/guids/videoImgGuid/images/governo_de_angola_horizontal_logo_MH1.png" style="display:block; border:0; text-decoration:none;" alt="Logo" title="Logo" width="160" height="136">
<p class="f-22 ma-15 text-center"><b>República De Angola</b></p> <p class="f-22 ma-15 text-center"><b>República De Angola</b></p>
<p class="f-22 ma-15 text-center"><b>Gabinete do Presidente da República</b></p> <p class="f-22 ma-15 text-center"><b>Gabinete do Presidente da República</b></p>
<p class="f-22 ma-15 text-center"><b>Convite para reunião</b></p> <p class="f-22 ma-15 text-center"><b>Agenda do dia</b></p>
</div> </div>
<hr/> <hr/>
<div class="pa-40"> <div class="pa-40">
<p class="f-weight-600 text-center" >Agenda da semana</p>
<table class="width-100"> <table class="width-100">
<thead> <thead>
<tr> <tr>
<th>
Localiizas&ccedil;&atilde;o
</th>
<th>
Data
</th>
<th> <th>
Assunto Assunto
</th> </th>
<th>
Inicio
</th>
<th>
Fim
</th>
<th>
Localização
</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<td >Palácio Presidencial de</td> <td >Palácio Presidencial de</td>
<td >15 de Julho de 2024 19:00</td> <td >08:24</td>
<td >09:24</td>
<td >Luanda</td> <td >Luanda</td>
</tr> </tr>
<tr> <tr>
<td >Palácio Presidencial de</td> <td >Palácio Presidencial de</td>
<td >15 de Julho de 2024 19:00</td> <td >08:24</td>
<td >09:24</td>
<td >Luanda</td> <td >Luanda</td>
</tr> </tr>
<tr> <tr>
<td >Palácio Presidencial de</td> <td >Palácio Presidencial de</td>
<td >15 de Julho de 2024 19:00</td> <td >07:23</td>
<td >08:23</td>
<td >Luanda</td> <td >Luanda</td>
</tr> </tr>
</tbody> </tbody>
@@ -135,6 +144,16 @@
</div> </div>
<hr/>
<div class="px-40">
<div>
<p class="text-gray f-13 d-block ">Mensagem</p>
<span class="d-block ">Cordial saudações prezado(a),<br>
Eis a vossa agenda do dia.</span>
</div>
</div>
<hr/> <hr/>
<div class="px-40 pb-40"> <div class="px-40 pb-40">
<div> <div>
@@ -147,7 +166,7 @@
</div> </div>
<div class="footer"> <div class="footer">
<p>&nbsp;&nbsp;&nbsp;<b>Gabinete Digital - Uma iniciativa do Presidente da República</b></p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>Gabinete Digital - Uma iniciativa do Presidente da República</b></p>
</div> </div>
</div> </div>
+6 -6
View File
@@ -1,11 +1,11 @@
export let versionData = { export let versionData = {
"shortSHA": "0e12b5de5", "shortSHA": "06417ead0",
"SHA": "0e12b5de5e32ff09a2fa53b7f69a9bff30e20d57", "SHA": "06417ead0fcc05d1d7f1fada6465ece88558be6d",
"branch": "feature/agenda-api-peter", "branch": "feature/agenda-api-peter",
"lastCommitAuthor": "'Peter Maquiran'", "lastCommitAuthor": "'Peter Maquiran'",
"lastCommitTime": "'Wed Jul 3 10:15:53 2024 +0100'", "lastCommitTime": "'Thu Jul 4 16:33:45 2024 +0100'",
"lastCommitMessage": "add margin", "lastCommitMessage": "create event from gabinete",
"lastCommitNumber": "5858", "lastCommitNumber": "5859",
"changeStatus": "On branch feature/agenda-api-peter\nYour branch is ahead of 'origin/feature/agenda-api-peter' by 5 commits.\n (use \"git push\" to publish your local commits)\n\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: package-lock.json\n\tmodified: package.json\n\tmodified: src/app/app.module.ts\n\tmodified: src/app/home/home.page.ts\n\tmodified: src/app/models/entiry/agenda/eventList.ts\n\tmodified: src/app/pages/agenda/agenda.page.html\n\tmodified: src/app/pages/agenda/agenda.page.ts\n\tmodified: src/app/pages/agenda/new-event/new-event.page.html\n\tmodified: src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.html\n\tmodified: src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.ts\n\tmodified: src/app/services/Repositorys/Agenda/agenda-data-repository.service.ts\n\tnew file: src/app/services/Repositorys/Agenda/agenda-memory-source.service.ts\n\tmodified: src/app/services/Repositorys/Agenda/utils.ts\n\tmodified: src/app/services/agenda/list-box.service.ts\n\tmodified: src/app/services/chat/chat-system.service.ts\n\tmodified: src/app/services/events.service.ts\n\tmodified: src/app/services/native-notification.service.ts\n\tmodified: src/app/shared/agenda/new-event/new-event.page.html\n\tmodified: src/app/shared/agenda/new-event/new-event.page.ts\n\tmodified: version/event-da-semana.html\n\tmodified: version/evento-revisao.html\n\tmodified: version/git-version.ts", "changeStatus": "On branch feature/agenda-api-peter\nYour branch is ahead of 'origin/feature/agenda-api-peter' by 6 commits.\n (use \"git push\" to publish your local commits)\n\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: src/app/app-routing.module.ts\n\tnew file: src/app/modals/delete-event-recurrence/delete-event-recurrence-routing.module.ts\n\tnew file: src/app/modals/delete-event-recurrence/delete-event-recurrence.module.ts\n\tnew file: src/app/modals/delete-event-recurrence/delete-event-recurrence.page.html\n\tnew file: src/app/modals/delete-event-recurrence/delete-event-recurrence.page.scss\n\tnew file: src/app/modals/delete-event-recurrence/delete-event-recurrence.page.spec.ts\n\tnew file: src/app/modals/delete-event-recurrence/delete-event-recurrence.page.ts\n\tnew file: src/app/models/entiry/agenda/contact.ts\n\tnew file: src/app/module/notification/data/dto/NotificationLiveOutputDTO.ts\n\tmodified: src/app/module/notification/data/notification-repository.service.ts\n\tnew file: src/app/module/notification/domain/mapper/notificationMapper.ts\n\tmodified: src/app/pages/agenda/agenda.page.ts\n\tmodified: src/app/pages/agenda/edit-event/edit-event.page.ts\n\tmodified: src/app/pages/agenda/event-actions-popover/event-actions-popover.page.ts\n\tmodified: src/app/pages/agenda/new-event/new-event.page.ts\n\tmodified: src/app/pages/agenda/view-event/view-event.page.ts\n\tmodified: src/app/pages/gabinete-digital/event-list/approve-event/approve-event.page.ts\n\tmodified: src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.ts\n\tmodified: src/app/services/Repositorys/Agenda/agenda-data-repository.service.ts\n\tmodified: src/app/services/Repositorys/Agenda/agenda-data.service.ts\n\tmodified: src/app/services/Repositorys/Agenda/agendaDataModels.ts\n\tnew file: src/app/services/Repositorys/Agenda/model/attendeeInputDTO.ts\n\tmodified: src/app/services/Repositorys/Agenda/model/eventInputDTO.ts\n\tmodified: src/app/services/Repositorys/Agenda/model/eventUpdateInputDtO.ts\n\tmodified: src/app/services/Repositorys/Agenda/utils.ts\n\tnew file: src/app/services/Repositorys/contacts/DTO/contactsCombined.ts\n\tnew file: src/app/services/Repositorys/contacts/DTO/userListOutput.ts\n\tnew file: src/app/services/Repositorys/contacts/data-source/contacts-data-source.service.ts\n\tnew file: src/app/services/Repositorys/contacts/mapper/contactCombinedMapper.ts\n\tnew file: src/app/services/Repositorys/contacts/repository/contacts-repository.service.ts\n\tmodified: src/app/services/chat/chat-system.service.ts\n\tmodified: src/app/services/decorator/api-validate-schema.decorator.ts\n\tmodified: src/app/services/http.service.ts\n\tmodified: src/app/services/notifications.service.ts\n\tmodified: src/app/shared/agenda/approve-event/approve-event.page.ts\n\tmodified: src/app/shared/agenda/edit-event-to-approve/edit-event-to-approve.page.ts\n\tmodified: src/app/shared/agenda/edit-event/edit-event.page.ts\n\tmodified: src/app/shared/agenda/new-event/new-event.page.ts\n\tmodified: src/app/shared/agenda/view-event/view-event.page.ts\n\tmodified: src/app/shared/event/attendee-modal/attendee-modal.page.ts\n\tmodified: src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page.ts\n\tmodified: src/app/shared/header/header.page.ts\n\tmodified: src/firebase-messaging-sw.js\n\tmodified: version/event-da-semana.html",
"changeAuthor": "peter.maquiran" "changeAuthor": "peter.maquiran"
} }