Add tenant services, change id by _id and include delete endpoint for all entities
This commit is contained in:
		| @@ -15,6 +15,7 @@ namespace Core.Thalos.Application.UseCases.Role | ||||
|         IComponentHandler<UpdateRoleRequest>, | ||||
|         IComponentHandler<CreateRoleRequest>, | ||||
|         IComponentHandler<GetRoleRequest>, | ||||
|         IComponentHandler<DeleteRoleRequest>, | ||||
|         IComponentHandler<AddApplicationToRoleRequest>, | ||||
|         IComponentHandler<RemoveApplicationFromRoleRequest> | ||||
|  | ||||
| @@ -45,7 +46,29 @@ namespace Core.Thalos.Application.UseCases.Role | ||||
|             { | ||||
|                 ArgumentNullException.ThrowIfNull(command); | ||||
|  | ||||
|                 var result = await _thalosDALService.GetRoleByIdAsync(command.Id, cancellationToken).ConfigureAwait(false); | ||||
|                 var result = await _thalosDALService.GetRoleByIdAsync(command._Id, cancellationToken).ConfigureAwait(false); | ||||
|  | ||||
|                 if (result == null) | ||||
|                 { | ||||
|                     _port.NoContentSuccess(); | ||||
|                     return; | ||||
|                 } | ||||
|  | ||||
|                 _port.Success(result); | ||||
|             } | ||||
|             catch (Exception ex) | ||||
|             { | ||||
|                 ApiResponseHelper.EvaluatePort(ex, _port); | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         public async ValueTask ExecuteAsync(DeleteRoleRequest command, CancellationToken cancellationToken = default) | ||||
|         { | ||||
|             try | ||||
|             { | ||||
|                 ArgumentNullException.ThrowIfNull(command); | ||||
|  | ||||
|                 var result = await _thalosDALService.DeleteRoleAsync(command._Id, cancellationToken).ConfigureAwait(false); | ||||
|  | ||||
|                 if (result == null) | ||||
|                 { | ||||
| @@ -93,7 +116,7 @@ namespace Core.Thalos.Application.UseCases.Role | ||||
|                     return; | ||||
|                 } | ||||
|  | ||||
|                 var result = await _thalosDALService.ChangeRoleStatusAsync(command.Id, command.Status, cancellationToken).ConfigureAwait(false); | ||||
|                 var result = await _thalosDALService.ChangeRoleStatusAsync(command._Id, command.Status, cancellationToken).ConfigureAwait(false); | ||||
|  | ||||
|                 if (result == null) | ||||
|                 { | ||||
| @@ -161,7 +184,7 @@ namespace Core.Thalos.Application.UseCases.Role | ||||
|  | ||||
|                 var request = new RoleAdapter | ||||
|                 { | ||||
|                     Id = command.Id, | ||||
|                     _Id = command._Id, | ||||
|                     Name = command.Name, | ||||
|                     Description = command.Description, | ||||
|                     Applications = command.Applications, | ||||
| @@ -169,7 +192,7 @@ namespace Core.Thalos.Application.UseCases.Role | ||||
|                     Permissions = command.Permissions | ||||
|                 }; | ||||
|  | ||||
|                 string id = command.Id; | ||||
|                 string id = command._Id; | ||||
|  | ||||
|                 var result = await _thalosDALService.UpdateRoleAsync(request, id, cancellationToken).ConfigureAwait(false); | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Sergio Matias Urquin
					Sergio Matias Urquin