From f6595ed1dfb84cd920fc9d8837465019e99cc870 Mon Sep 17 00:00:00 2001 From: Sergio Matias Urquin Date: Mon, 12 May 2025 21:54:02 -0600 Subject: [PATCH] remove user consent services --- .../UseCases/Users/UserHandler.cs | 46 +------------------ .../Clients/ICerberosServiceClient.cs | 6 --- .../Controllers/UserController.cs | 40 ---------------- Core.Cerberos.Service.API/Program.cs | 2 - 4 files changed, 1 insertion(+), 93 deletions(-) diff --git a/Core.Cerberos.Application/UseCases/Users/UserHandler.cs b/Core.Cerberos.Application/UseCases/Users/UserHandler.cs index 436c245..78b7034 100644 --- a/Core.Cerberos.Application/UseCases/Users/UserHandler.cs +++ b/Core.Cerberos.Application/UseCases/Users/UserHandler.cs @@ -22,9 +22,7 @@ namespace Core.Cerberos.Application.UseCases.Users IComponentHandler, IComponentHandler, IComponentHandler, - IComponentHandler, - IComponentHandler, - IComponentHandler + IComponentHandler { private readonly IUserPort _port; private readonly IValidator _changeUserStatusValidator; @@ -380,48 +378,6 @@ namespace Core.Cerberos.Application.UseCases.Users var result = await _cerberosDALService.GetTokenAdapter(command.Email, cancellationToken).ConfigureAwait(false); - if (result == null) - { - _port.NoContentSuccess(); - return; - } - - _port.Success(result); - } - catch (Exception ex) - { - ApiResponseHelper.EvaluatePort(ex, _port); - } - } - - public async ValueTask ExecuteAsync(GetConsentFormPDFRequest command, CancellationToken cancellationToken = default) - { - try - { - ArgumentNullException.ThrowIfNull(command); - - var _result = await _cerberosDALService.GetConsentFormPDFAsync(cancellationToken).ConfigureAwait(false); - if (_result == null) - { - _port.NoContentSuccess(); - return; - } - _port.Success(_result); - } - catch (Exception ex) - { - ApiResponseHelper.EvaluatePort(ex, _port); - } - } - - public async ValueTask ExecuteAsync(AcceptUserConsentFormRequest command, CancellationToken cancellationToken = default) - { - try - { - ArgumentNullException.ThrowIfNull(command); - - var result = await _cerberosDALService.AcceptUserConsentFormAsync(cancellationToken).ConfigureAwait(false); - if (result == null) { _port.NoContentSuccess(); diff --git a/Core.Cerberos.External/Clients/ICerberosServiceClient.cs b/Core.Cerberos.External/Clients/ICerberosServiceClient.cs index 9c8717c..948b5a8 100644 --- a/Core.Cerberos.External/Clients/ICerberosServiceClient.cs +++ b/Core.Cerberos.External/Clients/ICerberosServiceClient.cs @@ -52,12 +52,6 @@ namespace Core.Cerberos.External.Clients [Delete("/v1/User/" + Routes.RemoveProject)] Task RemoveProjectToUserAsync([FromRoute] string userId, [FromRoute] string projectId, CancellationToken cancellationToken = default); - [Get("/v1/User/GetConsentFormPDF")] - Task GetConsentFormPDFAsync(CancellationToken cancellationToken = default); - - [Patch("/v1/User/AcceptUserConsentForm")] - Task AcceptUserConsentFormAsync(CancellationToken cancellationToken = default); - [Get("/v1/Role")] Task> GetAllRolesAsync(CancellationToken cancellationToken = default); diff --git a/Core.Cerberos.Service.API/Controllers/UserController.cs b/Core.Cerberos.Service.API/Controllers/UserController.cs index 4fc4314..68b6413 100644 --- a/Core.Cerberos.Service.API/Controllers/UserController.cs +++ b/Core.Cerberos.Service.API/Controllers/UserController.cs @@ -388,45 +388,5 @@ namespace Core.Cerberos.Service.API.Controllers return port.ViewModel; } - - /// - /// Get Consent Form PDF. - /// - [HttpGet] - [Route("GetConsentFormPDF")] - [ProducesResponseType(StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status204NoContent)] - [ProducesResponseType(StatusCodes.Status401Unauthorized)] - [ProducesResponseType(typeof(Notification), StatusCodes.Status412PreconditionFailed)] - [ProducesResponseType(typeof(Notification), StatusCodes.Status422UnprocessableEntity)] - [ProducesResponseType(StatusCodes.Status500InternalServerError)] - [ProducesResponseType(StatusCodes.Status400BadRequest)] - [Authorize(AuthenticationSchemes = Schemes.HeathScheme)] - [Permission("UserManagement.Read")] - public async Task GetConsentFormPDFAsync(CancellationToken cancellationToken) - { - await getConsentFormPDFHandler.ExecuteAsync(new GetConsentFormPDFRequest { }, cancellationToken).ConfigureAwait(false); - - return port.ViewModel; - } - - /// - /// Accept user consent form. - /// - [HttpPatch("AcceptUserConsentForm")] - [ProducesResponseType(StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status204NoContent)] - [ProducesResponseType(StatusCodes.Status401Unauthorized)] - [ProducesResponseType(typeof(Notification), StatusCodes.Status412PreconditionFailed)] - [ProducesResponseType(typeof(Notification), StatusCodes.Status422UnprocessableEntity)] - [ProducesResponseType(StatusCodes.Status400BadRequest)] - [ProducesResponseType(StatusCodes.Status500InternalServerError)] - [Authorize(AuthenticationSchemes = $"{Schemes.HeathScheme}, {Schemes.AzureScheme}")] - public async Task AcceptUserConsentFormAsync(CancellationToken cancellationToken) - { - await acceptUserConsentFormHandler.ExecuteAsync(new AcceptUserConsentFormRequest { }, cancellationToken).ConfigureAwait(false); - - return port.ViewModel; - } } } diff --git a/Core.Cerberos.Service.API/Program.cs b/Core.Cerberos.Service.API/Program.cs index f1c9758..0423a11 100644 --- a/Core.Cerberos.Service.API/Program.cs +++ b/Core.Cerberos.Service.API/Program.cs @@ -84,8 +84,6 @@ builder.Host.ConfigureServices((context, services) => services.AddScoped, UserHandler>(); services.AddScoped, UserHandler>(); services.AddScoped, UserHandler>(); - services.AddScoped, UserHandler>(); - services.AddScoped, UserHandler>(); services.AddValidatorsFromAssemblyContaining();