Fixed issues
This commit is contained in:
		| @@ -1,4 +1,5 @@ | ||||
| using ApplicationLayer.Services.Users.Requests; | ||||
| using ApplicationLayer.Services.Users.Models; | ||||
| using ApplicationLayer.Services.Users.Requests; | ||||
| using Domains.Users; | ||||
|  | ||||
| namespace ApplicationLayer.Services.Users; | ||||
| @@ -8,7 +9,7 @@ public interface IUsersService | ||||
| { | ||||
|     /// Returns all user accounts with role of approving authority | ||||
|     /// <param name="cancellationToken">Cancellation token</param> | ||||
|     Task<List<User>> GetAuthoritiesAccountsAsync(CancellationToken cancellationToken); | ||||
|     Task<List<UserModel>> GetAuthoritiesAccountsAsync(CancellationToken cancellationToken); | ||||
|  | ||||
|     /// Changes authentication data for an authority account | ||||
|     /// <param name="request"> Request object with identifier of user and new authentication data</param> | ||||
|   | ||||
| @@ -0,0 +1,16 @@ | ||||
| using System.ComponentModel.DataAnnotations; | ||||
| using Domains; | ||||
|  | ||||
| namespace ApplicationLayer.Services.Users.Models | ||||
| { | ||||
|     public class UserModel | ||||
|     { | ||||
|         /// Unique Identifier of user | ||||
|         [Required] | ||||
|         public Guid Id { get; private set; } = Guid.NewGuid(); | ||||
|  | ||||
|         [Required] | ||||
|         [MaxLength(ConfigurationConstraints.EmailLength)] | ||||
|         public string Email { get; set; } = null!; | ||||
|     } | ||||
| } | ||||
| @@ -2,15 +2,20 @@ | ||||
| using ApplicationLayer.Services.AuthServices.Common; | ||||
| using ApplicationLayer.Services.AuthServices.NeededServices; | ||||
| using ApplicationLayer.Services.Users.Exceptions; | ||||
| using ApplicationLayer.Services.Users.Models; | ||||
| using ApplicationLayer.Services.Users.Requests; | ||||
| using AutoMapper; | ||||
| using Domains.Users; | ||||
|  | ||||
| namespace ApplicationLayer.Services.Users; | ||||
|  | ||||
| public class UsersService(IUsersRepository users, IUnitOfWork unitOfWork) : IUsersService | ||||
| public class UsersService(IMapper mapper, IUsersRepository users, IUnitOfWork unitOfWork) : IUsersService | ||||
| { | ||||
|     async Task<List<User>> IUsersService.GetAuthoritiesAccountsAsync(CancellationToken cancellationToken) => | ||||
|         await users.GetAllOfRoleAsync(Role.ApprovingAuthority, cancellationToken); | ||||
|     async Task<List<UserModel>> IUsersService.GetAuthoritiesAccountsAsync(CancellationToken cancellationToken) | ||||
|     { | ||||
|         var userList = await users.GetAllOfRoleAsync(Role.ApprovingAuthority, cancellationToken); | ||||
|         return mapper.Map<List<UserModel>>(userList); | ||||
|     } | ||||
|  | ||||
|     async Task IUsersService.ChangeAuthorityAuthDataAsync(ChangeUserAuthDataRequest request, CancellationToken cancellationToken) | ||||
|     { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user