From aef73625f081830c368591d90bc09f12a31d7fef Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Fri, 6 Dec 2024 11:21:32 +0100 Subject: [PATCH] fix errors --- .../notification-remote-repository.ts | 0 ...otification-delete-all-use-case.service.ts | 21 +++++ .../datasource/remote-notification.service.ts | 5 ++ .../notification-repository.service.spec.ts | 16 ---- .../domain/notification.service.ts | 19 ++++ .../notification/notification.module.ts | 15 ++++ .../gabinete-digital.page.html | 2 - src/app/ui/chat/chat.page.ts | 1 + src/environments/suport/dev.ts | 90 +++++++++---------- version/git-version.ts | 12 +-- 10 files changed, 112 insertions(+), 69 deletions(-) create mode 100644 src/app/core/notification/repository/notification-remote-repository.ts create mode 100644 src/app/core/notification/use-case/notification-delete-all-use-case.service.ts delete mode 100644 src/app/module/notification/data/notification-repository.service.spec.ts create mode 100644 src/app/module/notification/domain/notification.service.ts create mode 100644 src/app/module/notification/notification.module.ts diff --git a/src/app/core/notification/repository/notification-remote-repository.ts b/src/app/core/notification/repository/notification-remote-repository.ts new file mode 100644 index 000000000..e69de29bb diff --git a/src/app/core/notification/use-case/notification-delete-all-use-case.service.ts b/src/app/core/notification/use-case/notification-delete-all-use-case.service.ts new file mode 100644 index 000000000..9ea406b45 --- /dev/null +++ b/src/app/core/notification/use-case/notification-delete-all-use-case.service.ts @@ -0,0 +1,21 @@ +import { Injectable } from '@angular/core'; +import { RemoteNotificationService } from 'src/app/module/notification/data/datasource/remote-notification.service'; +import { z } from 'zod'; + +const NotificationDeleteAllByUserIdSchema = z.any() +export type INotificationDeleteAllByUserId = z.infer + +@Injectable({ + providedIn: 'root' +}) +export class NotificationDeleteAllServiceUseCase { + + constructor( + private RemoteNotificationService:RemoteNotificationService + ) { } + + async execute(userId: INotificationDeleteAllByUserId) { + + return this.RemoteNotificationService.notificationDeleteAll(userId) + } +} diff --git a/src/app/module/notification/data/datasource/remote-notification.service.ts b/src/app/module/notification/data/datasource/remote-notification.service.ts index de5cd05fe..d68c340bf 100644 --- a/src/app/module/notification/data/datasource/remote-notification.service.ts +++ b/src/app/module/notification/data/datasource/remote-notification.service.ts @@ -26,4 +26,9 @@ export class RemoteNotificationService { return await this.httpService.patch(`${this.baseUrl}/Notifications/${id}/status`); } + + async notificationDeleteAll(userId: any) { + return await this.httpService.delete(`${this.baseUrl}/Notifications/${userId}`); + } + } diff --git a/src/app/module/notification/data/notification-repository.service.spec.ts b/src/app/module/notification/data/notification-repository.service.spec.ts deleted file mode 100644 index 4b12a2a12..000000000 --- a/src/app/module/notification/data/notification-repository.service.spec.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { TestBed } from '@angular/core/testing'; - -import { NotificationRepositoryService } from './notification-repository.service'; - -describe('NotificationRepositoryService', () => { - let service: NotificationRepositoryService; - - beforeEach(() => { - TestBed.configureTestingModule({}); - service = TestBed.inject(NotificationRepositoryService); - }); - - it('should be created', () => { - expect(service).toBeTruthy(); - }); -}); diff --git a/src/app/module/notification/domain/notification.service.ts b/src/app/module/notification/domain/notification.service.ts new file mode 100644 index 000000000..fc7cde440 --- /dev/null +++ b/src/app/module/notification/domain/notification.service.ts @@ -0,0 +1,19 @@ +import { Injectable } from '@angular/core'; +import { INotificationDeleteAllByUserId, NotificationDeleteAllServiceUseCase } from 'src/app/core/notification/use-case/notification-delete-all-use-case.service' + +@Injectable({ + providedIn: 'root' +}) +export class NotificationService { + + constructor( + private NotificationDeleteAllServiceUseCase: NotificationDeleteAllServiceUseCase + ) { } + + + deleteAllNotificationByUserId(userId: INotificationDeleteAllByUserId) { + this.NotificationDeleteAllServiceUseCase.execute(userId) + } + + +} diff --git a/src/app/module/notification/notification.module.ts b/src/app/module/notification/notification.module.ts new file mode 100644 index 000000000..57ff2f187 --- /dev/null +++ b/src/app/module/notification/notification.module.ts @@ -0,0 +1,15 @@ +import { NgModule } from '@angular/core'; +import { HttpModule } from 'src/app/infra/http/http.module'; + +@NgModule({ + imports: [HttpModule], + providers: [], + declarations: [], + schemas: [], + entryComponents: [] +}) +export class NotificationModule { + + constructor() {} + +} diff --git a/src/app/pages/gabinete-digital/gabinete-digital.page.html b/src/app/pages/gabinete-digital/gabinete-digital.page.html index e65f051e7..baf23f8db 100644 --- a/src/app/pages/gabinete-digital/gabinete-digital.page.html +++ b/src/app/pages/gabinete-digital/gabinete-digital.page.html @@ -155,8 +155,6 @@
- {{ TaskService.loadCount}}: TaskService.loadCount -
diff --git a/src/app/ui/chat/chat.page.ts b/src/app/ui/chat/chat.page.ts index deadb9dcd..d35d49df7 100644 --- a/src/app/ui/chat/chat.page.ts +++ b/src/app/ui/chat/chat.page.ts @@ -446,6 +446,7 @@ export class ChatPage implements OnInit { doRefresh(event) { setTimeout(() => { try { + this.ChatServiceService.getRoomList() event?.target?.complete(); } catch (error) { } }, 1000); diff --git a/src/environments/suport/dev.ts b/src/environments/suport/dev.ts index ff5a355cc..2ecb4ef5b 100644 --- a/src/environments/suport/dev.ts +++ b/src/environments/suport/dev.ts @@ -1,51 +1,51 @@ import { versionData } from '../../../version/git-version' import { Environment } from './../../app/models/envarioment' -export const environment: Environment = { - id:'3', - apiURL: 'http://gpr-dev-01:83/jwt/api/', - /* apiURL: 'https://gdapi-dev-0.dyndns.info/jwt/api/', */ - apiChatUrl: 'https://gdchat-dev.dyndns.info/api/v1/', - apiWsChatUrl: 'wss://gdchat-dev.dyndns.info/websocket', - apiPCURL: 'http://gpr-dev-01:86/api/', - /* apiPCURL: 'https://gdcmapi-dev.dyndns.info/api/', */ - logoLabel: 'Presidente da República', - despachoLabel: 'Presidenciais', - despachoLabel2: 'Despachos Presidênciais', - production: false, - domain: 'gabinetedigital.local', - defaultuser: 'paulo.pinto@gabinetedigital.local', - defaultuserpwd: 'tabteste@006', - chatOffline: true, - presidential: true, - version: versionData, - agendaPR: 'Agenda do PR', - agendaVP: 'Agenda do MD', - PR: 'PR', - VP: '', - dispatchPR: 'Despachos Presidênciais', - sentryUrl: 'https://9920cc36f1d740b987426ee8d80cf588@o4504340905525248.ingest.sentry.io/4504340946419712', - storageProduction: true, - rejectUnauthorized: "true", - fileHub: 'https://gdcmapi-dev.dyndns.info/FileHub' -/* production: true, - domain: 'gabinetedigital.local', - defaultuser: '', - defaultuserpwd: '', - chatOffline: true, - presidential: false, - version: versionData, - sentryUrl: 'https://9920cc36f1d740b987426ee8d80cf588@o4504340905525248.ingest.sentry.io/4504340946419712', - logoLabel: 'doneIT', - despachoLabel: 'do Titular', - despachoLabel2: 'Despachos do Titular', - agendaPR: 'Agenda do Titular', - agendaVP: 'Agenda do (MD)', - PR: 'Titular', - VP: '', - dispatchPR: 'Despachos Titular', - storageProduction: true */ -}; +// export const environment: Environment = { +// id:'3', +// apiURL: 'http://gpr-dev-01:83/jwt/api/', +// /* apiURL: 'https://gdapi-dev-0.dyndns.info/jwt/api/', */ +// apiChatUrl: 'https://gdchat-dev.dyndns.info/api/v1/', +// apiWsChatUrl: 'wss://gdchat-dev.dyndns.info/websocket', +// apiPCURL: 'http://gpr-dev-01:86/api/', +// /* apiPCURL: 'https://gdcmapi-dev.dyndns.info/api/', */ +// logoLabel: 'Presidente da República', +// despachoLabel: 'Presidenciais', +// despachoLabel2: 'Despachos Presidênciais', +// production: false, +// domain: 'gabinetedigital.local', +// defaultuser: 'paulo.pinto@gabinetedigital.local', +// defaultuserpwd: 'tabteste@006', +// chatOffline: true, +// presidential: true, +// version: versionData, +// agendaPR: 'Agenda do PR', +// agendaVP: 'Agenda do MD', +// PR: 'PR', +// VP: '', +// dispatchPR: 'Despachos Presidênciais', +// sentryUrl: 'https://9920cc36f1d740b987426ee8d80cf588@o4504340905525248.ingest.sentry.io/4504340946419712', +// storageProduction: true, +// rejectUnauthorized: "true", +// fileHub: 'https://gdcmapi-dev.dyndns.info/FileHub' +// /* production: true, +// domain: 'gabinetedigital.local', +// defaultuser: '', +// defaultuserpwd: '', +// chatOffline: true, +// presidential: false, +// version: versionData, +// sentryUrl: 'https://9920cc36f1d740b987426ee8d80cf588@o4504340905525248.ingest.sentry.io/4504340946419712', +// logoLabel: 'doneIT', +// despachoLabel: 'do Titular', +// despachoLabel2: 'Despachos do Titular', +// agendaPR: 'Agenda do Titular', +// agendaVP: 'Agenda do (MD)', +// PR: 'Titular', +// VP: '', +// dispatchPR: 'Despachos Titular', +// storageProduction: true */ +// }; export const DevDev: Environment = { diff --git a/version/git-version.ts b/version/git-version.ts index c28406196..5b0a3b391 100644 --- a/version/git-version.ts +++ b/version/git-version.ts @@ -1,11 +1,11 @@ export let versionData = { - "shortSHA": "dad392335", - "SHA": "dad392335e0043ef66332a82dd2e524e714443c2", + "shortSHA": "5a1bbe610", + "SHA": "5a1bbe6103c983534e6a66d69a7344a8520d67f5", "branch": "feature/login-v2", "lastCommitAuthor": "'Peter Maquiran'", - "lastCommitTime": "'Thu Nov 7 11:15:01 2024 +0100'", - "lastCommitMessage": "add logout v2", - "lastCommitNumber": "6133", - "changeStatus": "On branch feature/login-v2\nYour branch is up to date with 'origin/feature/login-v2'.\n\nChanges to be committed:\n (use \"git restore --staged ...\" to unstage)\n\tdeleted: src/app/Rules/user.service.spec.ts\n\tdeleted: src/app/Rules/user.service.ts\n\tmodified: src/app/app.module.ts\n\tmodified: src/app/core/chat/repository/room/room-remote-repository.ts\n\tmodified: src/app/core/chat/usecase/room/room-get-list-use-case.service.ts\n\tnew file: src/app/core/chat/usecase/room/room-search-by-name.service.ts\n\tmodified: src/app/core/user/repository/user-remote-repository.ts\n\tmodified: src/app/core/user/use-case/user-login-use-case.service.ts\n\tnew file: src/app/core/user/use-case/user-refresh-token.service.ts\n\tmodified: src/app/guards/auth.guard.ts\n\tmodified: src/app/infra/database/dexie/instance/chat/service.ts\n\tdeleted: src/app/interceptors/chatToken.interceptor.ts\n\tmodified: src/app/interceptors/token.interceptors.ts\n\tmodified: src/app/modals/create-process/create-process.page.ts\n\tmodified: src/app/modals/profile/profile.module.ts\n\tmodified: src/app/models/despacho.model.ts\n\tmodified: src/app/module/chat/data/repository/room/room-remote-repository.service.ts\n\tmodified: src/app/module/user/data/datasource/user-remote-repository.service.ts\n\tmodified: src/app/module/user/domain/user.service.ts\n\tmodified: src/app/module/user/user.module.ts\n\tmodified: src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.ts\n\tmodified: src/app/pages/gabinete-digital/gabinete-digital.page.html\n\tmodified: src/app/pages/gabinete-digital/gabinete-digital.page.ts\n\tmodified: src/app/pages/login/login.module.ts\n\tmodified: src/app/pages/login/login.page.ts\n\tmodified: src/app/services/auth.service.ts\n\tmodified: src/app/services/processes.service.ts\n\tmodified: src/app/services/task.service.ts\n\tmodified: src/app/shared/API/middleware/middleware-service.service.ts\n\tmodified: src/app/store/session.service.ts\n\tmodified: src/app/ui/chat/chat.page.html\n\tmodified: src/app/ui/chat/chat.page.ts\n\tmodified: src/app/ui/chat/component/messages/messages.page.html\n\tdeleted: src/app/ui/login/inactivity/inactivity-routing.module.ts\n\tdeleted: src/app/ui/login/inactivity/inactivity.module.ts\n\tdeleted: src/app/ui/login/inactivity/inactivity.page.html\n\tdeleted: src/app/ui/login/inactivity/inactivity.page.scss\n\tdeleted: src/app/ui/login/inactivity/inactivity.page.spec.ts\n\tdeleted: src/app/ui/login/inactivity/inactivity.page.ts\n\tdeleted: src/app/ui/login/login/login-routing.module.ts\n\tdeleted: src/app/ui/login/login/login.module.ts\n\tdeleted: src/app/ui/login/login/login.page.html\n\tdeleted: src/app/ui/login/login/login.page.scss\n\tdeleted: src/app/ui/login/login/login.page.spec.ts\n\tdeleted: src/app/ui/login/login/login.page.ts", + "lastCommitTime": "'Thu Dec 5 19:14:11 2024 +0100'", + "lastCommitMessage": "fix issues", + "lastCommitNumber": "6134", + "changeStatus": "On branch feature/login-v2\nYour branch is ahead of 'origin/feature/login-v2' by 1 commit.\n (use \"git push\" to publish your local commits)\n\nChanges to be committed:\n (use \"git restore --staged ...\" to unstage)\n\tnew file: src/app/core/notification/repository/notification-remote-repository.ts\n\tnew file: src/app/core/notification/use-case/notification-delete-all-use-case.service.ts\n\tmodified: src/app/module/notification/data/datasource/remote-notification.service.ts\n\tdeleted: src/app/module/notification/data/notification-repository.service.spec.ts\n\tnew file: src/app/module/notification/domain/notification.service.ts\n\tnew file: src/app/module/notification/notification.module.ts\n\tmodified: src/app/pages/gabinete-digital/gabinete-digital.page.html\n\tmodified: src/app/ui/chat/chat.page.ts\n\tmodified: src/environments/suport/dev.ts\n\tmodified: version/git-version.ts", "changeAuthor": "peter.maquiran" } \ No newline at end of file