Repository: Mikita-Kliuchnikau/OnlineCasino.InnowiseInternship
Pull request #17: feature/add-presentation-layer
Author: login: Mikita-Kliuchnikau
Created: 2025-05-16T13:23:50Z | Merged: 2025-05-16T16:51:27Z



Diff:
diff --git a/src/Services/UserManagementService/src/UsersManagementService.BLL/Models/Image/ImagesMappingConfig.cs b/src/Services/UserManagementService/src/UsersManagementService.BLL/Models/Image/ImagesMappingConfig.cs
index b3f46c0..9de62af 100644
--- a/src/Services/UserManagementService/src/UsersManagementService.BLL/Models/Image/ImagesMappingConfig.cs
+++ b/src/Services/UserManagementService/src/UsersManagementService.BLL/Models/Image/ImagesMappingConfig.cs
@@ -21,8 +21,7 @@ public static void AddImagesMappingConfig(this IServiceCollection services)
             .Map(i => i.Id, src => src.Id)
             .Map(i => i.UserId, src => src.UserId)
             .Map(i => i.ImageUrl, src => src.ImageUrl)
-            .Map(i => i.Type, src => src.Type)
-            .Map(i => i.IsDeleted, src => src.IsDeleted);
+            .Map(i => i.Type, src => src.Type);
 
         TypeAdapterConfig.GlobalSettings.Scan(Assembly.GetExecutingAssembly());
     }
diff --git a/src/Services/UserManagementService/src/UsersManagementService.BLL/Models/Image/UpdateImage/UpdateImageModel.cs b/src/Services/UserManagementService/src/UsersManagementService.BLL/Models/Image/UpdateImage/UpdateImageModel.cs
index 7181c91..1581364 100644
--- a/src/Services/UserManagementService/src/UsersManagementService.BLL/Models/Image/UpdateImage/UpdateImageModel.cs
+++ b/src/Services/UserManagementService/src/UsersManagementService.BLL/Models/Image/UpdateImage/UpdateImageModel.cs
@@ -6,5 +6,4 @@ public record UpdateImageModel(
     Guid Id, 
     Guid UserId, 
     string ImageUrl, 
-    ImageType Type, 
-    bool IsDeleted);
\ No newline at end of file
+    ImageType Type);
\ No newline at end of file
diff --git a/src/Services/UserManagementService/src/UsersManagementService.BLL/Models/User/GetUser/UserViewModel.cs b/src/Services/UserManagementService/src/UsersManagementService.BLL/Models/User/GetUser/UserViewModel.cs
index 189c3e2..f5df980 100644
--- a/src/Services/UserManagementService/src/UsersManagementService.BLL/Models/User/GetUser/UserViewModel.cs
+++ b/src/Services/UserManagementService/src/UsersManagementService.BLL/Models/User/GetUser/UserViewModel.cs
@@ -15,5 +15,4 @@ public record UserViewModel(
     string? LastName = null,
     DateOnly? BirthDate = null,
     string? PassportNumber = null,
-    string? IdentificationNumber = null,
-    List<ImageViewModel>? Images = null);
\ No newline at end of file
+    string? IdentificationNumber = null);
\ No newline at end of file
diff --git a/src/Services/UserManagementService/src/UsersManagementService.BLL/Models/User/UpdateUser/UpdateUserModel.cs b/src/Services/UserManagementService/src/UsersManagementService.BLL/Models/User/UpdateUser/UpdateUserModel.cs
index acf16dd..63bd2e7 100644
--- a/src/Services/UserManagementService/src/UsersManagementService.BLL/Models/User/UpdateUser/UpdateUserModel.cs
+++ b/src/Services/UserManagementService/src/UsersManagementService.BLL/Models/User/UpdateUser/UpdateUserModel.cs
@@ -1,5 +1,4 @@
 ﻿using UsersManagementService.Common.Enums;
-using UsersManagementService.DAL.Entites.Core;
 
 namespace UsersManagementService.BLL.Models.User.UpdateUser;
 
@@ -11,11 +10,9 @@ public record UpdateUserModel(
     decimal Balance,
     VerificationStatus VerificationStatus,
     bool IsBanned,
-    bool IsDeleted,
     string? FirstName = null,
     string? SecondName = null,
     string? LastName = null,
     DateOnly? BirthDate = null,
     string? PassportNumber = null,
-    string? IdentificationNumber = null,
-    List<ImageEntity>? Images = null);
\ No newline at end of file
+    string? IdentificationNumber = null);
\ No newline at end of file
diff --git a/src/Services/UserManagementService/src/UsersManagementService.BLL/Models/User/UsersMappingConfig.cs b/src/Services/UserManagementService/src/UsersManagementService.BLL/Models/User/UsersMappingConfig.cs
index fc1d4ba..fa137ad 100644
--- a/src/Services/UserManagementService/src/UsersManagementService.BLL/Models/User/UsersMappingConfig.cs
+++ b/src/Services/UserManagementService/src/UsersManagementService.BLL/Models/User/UsersMappingConfig.cs
@@ -1,11 +1,12 @@
 ﻿using Mapster;
 using Microsoft.Extensions.DependencyInjection;
 using System.Reflection;
+using UsersManagementService.BLL.Models.User.CreateUser;
 using UsersManagementService.BLL.Models.User.GetPagedUsers;
 using UsersManagementService.BLL.Models.User.GetUser;
 using UsersManagementService.BLL.Models.User.UpdateUser;
 using UsersManagementService.DAL.Entites.Core;
-using UsersManagementService.DAL.Entites.DTO;
+using UsersManagementService.DAL.Entites.Dto;
 
 namespace UsersManagementService.BLL.Models.User;
 
@@ -14,7 +15,6 @@ public static class UsersMappingConfig
     public static void AddUsersMappingConfig(this IServiceCollection services)
     {
         TypeAdapterConfig<UserEntity, UserViewModel>.NewConfig()
-            .Map(vm => vm.Id, src => src.Id)
             .Map(vm => vm.Username, src => src.Username)
             .Map(vm => vm.Email, src => src.Email)
             .Map(vm => vm.Balance, src => src.Balance)
@@ -26,26 +26,13 @@ public static void AddUsersMappingConfig(this IServiceCollection services)
             .Map(vm => vm.LastName, src => src.LastName)
             .Map(vm => vm.BirthDate, src => src.BirthDate)
             .Map(vm => vm.PassportNumber, src => src.PassportNumber)
-            .Map(vm => vm.IdentificationNumber, src => src.VerificationStatus)
-            .Map(vm => vm.Images, src => src.Images != null
-                ? src.Images.Select(i => i.Adapt<ImageViewModel>()).ToList()
-                : null);
+            .Map(vm => vm.IdentificationNumber, src => src.VerificationStatus);
 
-        TypeAdapterConfig<UpdateUserModel, UserEntity>.NewConfig()
+        TypeAdapterConfig<CreateUserModel, UserEntity>.NewConfig()
             .Map(u => u.Id, src => src.Id)
             .Map(u => u.AuthId, src => src.AuthId)
             .Map(u => u.Username, src => src.Username)
-            .Map(u => u.Email, src => src.Email)
-            .Map(u => u.Balance, src => src.Balance)
-            .Map(u => u.VerificationStatus, src => src.VerificationStatus)
-            .Map(u => u.IsBanned, src => src.IsBanned)
-            .Map(u => u.IsDeleted, src => src.IsDeleted)
-            .Map(u => u.FirstName, src => src.FirstName)
-            .Map(u => u.SecondName, src => src.SecondName)
-            .Map(u => u.LastName, src => src.LastName)
-            .Map(u => u.BirthDate, src => src.BirthDate)
-            .Map(u => u.PassportNumber, src => src.PassportNumber)
-            .Map(u => u.IdentificationNumber, src => src.VerificationStatus);
+            .Map(u => u.Email, src => src.Email);
 
         TypeAdapterConfig<UpdateUserModel, UserEntity>.NewConfig()
             .Map(u => u.Id, src => src.Id)
@@ -55,16 +42,12 @@ public static void AddUsersMappingConfig(this IServiceCollection services)
             .Map(u => u.Balance, src => src.Balance)
             .Map(u => u.VerificationStatus, src => src.VerificationStatus)
             .Map(u => u.IsBanned, src => src.IsBanned)
-            .Map(u => u.IsDeleted, src => src.IsDeleted)
             .Map(u => u.FirstName, src => src.FirstName)
             .Map(u => u.SecondName, src => src.SecondName)
             .Map(u => u.LastName, src => src.LastName)
             .Map(u => u.BirthDate, src => src.BirthDate)
             .Map(u => u.PassportNumber, src => src.PassportNumber)
-            .Map(u => u.IdentificationNumber, src => src.VerificationStatus)
-            .Map(u => u.Images, src => src.Images != null
-                ? src.Images.Select(i => i.Adapt<ImageEntity>()).ToList()
-                : null);
+            .Map(u => u.IdentificationNumber, src => src.VerificationStatus);
 
         TypeAdapterConfig<GetPagedUsersQuery, PagedUsersFilter>.NewConfig()
             .Map(f => f.PageNumber, src => src.PageNumber)
diff --git a/src/Services/UserManagementService/src/UsersManagementService.BLL/Services/UsersService.cs b/src/Services/UserManagementService/src/UsersManagementService.BLL/Services/UsersService.cs
index aff17a7..be6b6a4 100644
--- a/src/Services/UserManagementService/src/UsersManagementService.BLL/Services/UsersService.cs
+++ b/src/Services/UserManagementService/src/UsersManagementService.BLL/Services/UsersService.cs
@@ -7,7 +7,7 @@
 using UsersManagementService.BLL.Interfaces.Services;
 using Mapster;
 using UsersManagementService.DAL.Entites.Core;
-using UsersManagementService.DAL.Entites.DTO;
+using UsersManagementService.DAL.Entites.Dto;
 
 namespace UsersManagementService.BLL.Services;
 
diff --git a/src/Services/UserManagementService/src/UsersManagementService.DAL/Entites/DTO/PagedUsersFilter.cs b/src/Services/UserManagementService/src/UsersManagementService.DAL/Entites/DTO/PagedUsersFilter.cs
index a9142ee..ac659db 100644
--- a/src/Services/UserManagementService/src/UsersManagementService.DAL/Entites/DTO/PagedUsersFilter.cs
+++ b/src/Services/UserManagementService/src/UsersManagementService.DAL/Entites/DTO/PagedUsersFilter.cs
@@ -1,4 +1,4 @@
-﻿namespace UsersManagementService.DAL.Entites.DTO;
+﻿namespace UsersManagementService.DAL.Entites.Dto;
 
 public class PagedUsersFilter
 {
diff --git a/src/Services/UserManagementService/src/UsersManagementService.DAL/Entites/DTO/PagedUsersProjection.cs b/src/Services/UserManagementService/src/UsersManagementService.DAL/Entites/DTO/PagedUsersProjection.cs
index 2d6cdc8..f4b4d01 100644
--- a/src/Services/UserManagementService/src/UsersManagementService.DAL/Entites/DTO/PagedUsersProjection.cs
+++ b/src/Services/UserManagementService/src/UsersManagementService.DAL/Entites/DTO/PagedUsersProjection.cs
@@ -1,6 +1,6 @@
 ﻿using UsersManagementService.DAL.Entites.Core;
 
-namespace UsersManagementService.DAL.Entites.DTO;
+namespace UsersManagementService.DAL.Entites.Dto;
 
 public class PagedUsersProjection
 {
diff --git a/src/Services/UserManagementService/src/UsersManagementService.DAL/Interfaces/Repositories/IUsersRepository.cs b/src/Services/UserManagementService/src/UsersManagementService.DAL/Interfaces/Repositories/IUsersRepository.cs
index 2f8343e..c49130a 100644
--- a/src/Services/UserManagementService/src/UsersManagementService.DAL/Interfaces/Repositories/IUsersRepository.cs
+++ b/src/Services/UserManagementService/src/UsersManagementService.DAL/Interfaces/Repositories/IUsersRepository.cs
@@ -1,5 +1,5 @@
 ﻿using UsersManagementService.DAL.Entites.Core;
-using UsersManagementService.DAL.Entites.DTO;
+using UsersManagementService.DAL.Entites.Dto;
 
 namespace UsersManagementService.DAL.Interfaces.Repositories;
 
diff --git a/src/Services/UserManagementService/src/UsersManagementService.DAL/Repositories/UsersRepository.cs b/src/Services/UserManagementService/src/UsersManagementService.DAL/Repositories/UsersRepository.cs
index 94d0104..f1915a3 100644
--- a/src/Services/UserManagementService/src/UsersManagementService.DAL/Repositories/UsersRepository.cs
+++ b/src/Services/UserManagementService/src/UsersManagementService.DAL/Repositories/UsersRepository.cs
@@ -2,7 +2,7 @@
 using UsersManagementService.Common.Exceptions;
 using UsersManagementService.DAL.Context;
 using UsersManagementService.DAL.Entites.Core;
-using UsersManagementService.DAL.Entites.DTO;
+using UsersManagementService.DAL.Entites.Dto;
 using UsersManagementService.DAL.Interfaces.Repositories;
 
 namespace UsersManagementService.DAL.Repositories;
diff --git a/src/Services/UserManagementService/src/UsersManagmentService.Presentation/Controllers/ImageController.cs b/src/Services/UserManagementService/src/UsersManagmentService.Presentation/Controllers/ImageController.cs
new file mode 100644
index 0000000..a0869de
--- /dev/null
+++ b/src/Services/UserManagementService/src/UsersManagmentService.Presentation/Controllers/ImageController.cs
@@ -0,0 +1,35 @@
+﻿using Mapster;
+using Microsoft.AspNetCore.Mvc;
+using UsersManagementService.BLL.Interfaces.Services;
+using UsersManagementService.BLL.Models.Image.CreateImage;
+using UsersManagementService.BLL.Models.Image.UpdateImage;
+using UsersManagmentService.Presentation.Constants;
+using UsersManagmentService.Presentation.Models;
+
+namespace UsersManagmentService.Presentation.Controllers;
+
+[Produces(MediaTypeConstants.Json)]
+[Route("api/[controller]")]
+public class ImagesController(IImagesService imagesService) : ControllerBase
+{
+    [HttpPost]
+    public async Task<Guid> Create(ImageDto image, CancellationToken cancellationToken = default)
+    {
+        var imageModel = image.Adapt<CreateImageModel>();
+        return await imagesService.CreateImageAsync(imageModel, cancellationToken);
+    }
+
+    [HttpPut]
+    public async Task<Guid> Update(ImageDto image, CancellationToken cancellationToken = default)
+    {
+        var imageModel = image.Adapt<UpdateImageModel>();
+        return await imagesService.UpdateImageAsync(imageModel, cancellationToken);
+    }
+
+    [HttpDelete("{id}")]
+    public async Task<Guid> Delete(Guid id, CancellationToken cancellationToken)
+    {
+        return await imagesService.DeleteImageAsync(id, cancellationToken);
+    }
+
+}
diff --git a/src/Services/UserManagementService/src/UsersManagmentService.Presentation/Controllers/UserController.cs b/src/Services/UserManagementService/src/UsersManagmentService.Presentation/Controllers/UserController.cs
new file mode 100644
index 0000000..107e7a6
--- /dev/null
+++ b/src/Services/UserManagementService/src/UsersManagmentService.Presentation/Controllers/UserController.cs
@@ -0,0 +1,52 @@
+﻿using Mapster;
+using Microsoft.AspNetCore.Mvc;
+using UsersManagementService.BLL.Interfaces.Services;
+using UsersManagementService.BLL.Models.User.CreateUser;
+using UsersManagementService.BLL.Models.User.GetPagedUsers;
+using UsersManagementService.BLL.Models.User.GetUser;
+using UsersManagementService.BLL.Models.User.UpdateUser;
+using UsersManagmentService.Presentation.Constants;
+using UsersManagmentService.Presentation.Models;
+
+namespace UsersManagmentService.Presentation.Controllers;
+
+[Produces(MediaTypeConstants.Json)]
+[Route("api/[controller]")]
+public class UsersController(IUsersService usersService) : ControllerBase
+{
+    [HttpGet]
+    public async Task<PagedUsersViewModel> Get(
+        [FromQuery] int page, 
+        [FromQuery] int pageSize, 
+        CancellationToken cancellationToken = default)
+    {
+        var usersQuery = new GetPagedUsersQuery(page, pageSize);
+        return await usersService.GetPagedUsersAsync(usersQuery, cancellationToken);
+    }
+
+    [HttpGet("{id}")]
+    public async Task<UserViewModel> GetById(Guid id, CancellationToken cancellationToken = default)
+    {
+        return await usersService.GetUserByIdAsync(id, cancellationToken);
+    }
+
+    [HttpPost]
+    public async Task<Guid> Create([FromBody] UserDto user, CancellationToken cancellationToken = default)
+    {
+        var userModel = user.Adapt<CreateUserModel>();
+        return await usersService.CreateUserAsync(userModel, cancellationToken);
+    }
+
+    [HttpPut]
+    public async Task<Guid> Update([FromBody] UserDto user, CancellationToken cancellationToken = default)
+    {
+        var userModel = user.Adapt<UpdateUserModel>();
+        return await usersService.UpdateUserAsync(userModel, cancellationToken);
+    }
+
+    [HttpDelete("{id}")]
+    public async Task<Guid> Delete(Guid id, CancellationToken cancellationToken = default)
+    {
+        return await usersService.DeleteUserAsync(id, cancellationToken);
+    }
+}
diff --git a/src/Services/UserManagementService/src/UsersManagmentService.Presentation/DI/DependencyInjection.cs b/src/Services/UserManagementService/src/UsersManagmentService.Presentation/DI/DependencyInjection.cs
new file mode 100644
index 0000000..7c95d33
--- /dev/null
+++ b/src/Services/UserManagementService/src/UsersManagmentService.Presentation/DI/DependencyInjection.cs
@@ -0,0 +1,15 @@
+﻿using UsersManagementService.BLL.DI;
+using UsersManagmentService.Presentation.Models;
+
+namespace UsersManagmentService.Presentation.DI;
+
+public static class DependencyInjection
+{
+    public static IServiceCollection AddDependencies(this IServiceCollection services, IConfiguration configuration)
+    {
+        services.AddBLL(configuration);
+        services.AddDtoMappingConfig();
+
+        return services;
+    }
+}
diff --git a/src/Services/UserManagementService/src/UsersManagmentService.Presentation/Models/DTOMappingProfile.cs b/src/Services/UserManagementService/src/UsersManagmentService.Presentation/Models/DTOMappingProfile.cs
new file mode 100644
index 0000000..2989d18
--- /dev/null
+++ b/src/Services/UserManagementService/src/UsersManagmentService.Presentation/Models/DTOMappingProfile.cs
@@ -0,0 +1,46 @@
+﻿using Mapster;
+using UsersManagementService.BLL.Models.Image.CreateImage;
+using UsersManagementService.BLL.Models.Image.UpdateImage;
+using UsersManagementService.BLL.Models.User.CreateUser;
+using UsersManagementService.BLL.Models.User.UpdateUser;
+
+namespace UsersManagmentService.Presentation.Models;
+
+public static class DtoMappingProfile
+{
+    public static void AddDtoMappingConfig(this IServiceCollection services)
+    {
+        TypeAdapterConfig<UserDto, CreateUserModel>.NewConfig()
+            .Map(u => u.Id, src => src.Id)
+            .Map(u => u.AuthId, src => src.AuthId)
+            .Map(u => u.Username, src => src.Username)
+            .Map(u => u.Email, src => src.Email);
+
+        TypeAdapterConfig<UserDto, UpdateUserModel>.NewConfig() 
+            .Map(u => u.Id, src => src.Id)
+            .Map(u => u.AuthId, src => src.AuthId)
+            .Map(u => u.Username, src => src.Username)
+            .Map(u => u.Email, src => src.Email)
+            .Map(u => u.Balance, src => src.Balance)
+            .Map(u => u.VerificationStatus, src => src.VerificationStatus)
+            .Map(u => u.IsBanned, src => src.IsBanned)
+            .Map(u => u.FirstName, src => src.FirstName)
+            .Map(u => u.SecondName, src => src.SecondName)
+            .Map(u => u.LastName, src => src.LastName)
+            .Map(u => u.BirthDate, src => src.BirthDate)
+            .Map(u => u.PassportNumber, src => src.PassportNumber)
+            .Map(u => u.IdentificationNumber, src => src.VerificationStatus);
+
+        TypeAdapterConfig<ImageDto, CreateImageModel>.NewConfig()
+            .Map(i => i.Id, src => src.Id)
+            .Map(i => i.UserId, src => src.UserId)
+            .Map(i => i.ImageUrl, src => src.ImageUrl)
+            .Map(i => i.Type, src => src.Type);
+
+        TypeAdapterConfig<ImageDto, UpdateImageModel>.NewConfig()
+            .Map(i => i.Id, src => src.Id)
+            .Map(i => i.UserId, src => src.UserId)
+            .Map(i => i.ImageUrl, src => src.ImageUrl)
+            .Map(i => i.Type, src => src.Type);
+    }
+}
diff --git a/src/Services/UserManagementService/src/UsersManagmentService.Presentation/Models/ImageDTO.cs b/src/Services/UserManagementService/src/UsersManagmentService.Presentation/Models/ImageDTO.cs
new file mode 100644
index 0000000..703416a
--- /dev/null
+++ b/src/Services/UserManagementService/src/UsersManagmentService.Presentation/Models/ImageDTO.cs
@@ -0,0 +1,11 @@
+﻿using UsersManagementService.Common.Enums;
+
+namespace UsersManagmentService.Presentation.Models;
+
+public class ImageDto
+{
+    required public Guid Id;
+    required public Guid UserId;
+    required public string ImageUrl;
+    required public ImageType Type;
+}
diff --git a/src/Services/UserManagementService/src/UsersManagmentService.Presentation/Models/ImageDto.cs b/src/Services/UserManagementService/src/UsersManagmentService.Presentation/Models/ImageDto.cs
new file mode 100644
index 0000000..ca54e0e
--- /dev/null
+++ b/src/Services/UserManagementService/src/UsersManagmentService.Presentation/Models/ImageDto.cs
@@ -0,0 +1,11 @@
+﻿using UsersManagementService.Common.Enums;
+
+namespace UsersManagmentService.Presentation.Models;
+
+public class ImageDto
+{
+    required public Guid Id { get; set; }
+    required public Guid UserId { get; set; }
+    required public string ImageUrl { get; set; }
+    required public ImageType Type { get; set; }
+}
diff --git a/src/Services/UserManagementService/src/UsersManagmentService.Presentation/Models/UserDTO.cs b/src/Services/UserManagementService/src/UsersManagmentService.Presentation/Models/UserDTO.cs
new file mode 100644
index 0000000..dce6c18
--- /dev/null
+++ b/src/Services/UserManagementService/src/UsersManagmentService.Presentation/Models/UserDTO.cs
@@ -0,0 +1,20 @@
+﻿using UsersManagementService.Common.Enums;
+
+namespace UsersManagmentService.Presentation.Models;
+
+public class UserDto
+{
+    required public Guid Id;
+    required public Guid AuthId;
+    required public string Username;
+    required public string Email;
+    public decimal? Balance;
+    public VerificationStatus? VerificationStatus;
+    public bool? IsBanned;
+    public string? FirstName = null;
+    public string? SecondName = null;
+    public string? LastName = null;
+    public DateOnly? BirthDate = null;
+    public string? PassportNumber = null;
+    public string? IdentificationNumber = null;
+}
diff --git a/src/Services/UserManagementService/src/UsersManagmentService.Presentation/Models/UserDto.cs b/src/Services/UserManagementService/src/UsersManagmentService.Presentation/Models/UserDto.cs
new file mode 100644
index 0000000..054754d
--- /dev/null
+++ b/src/Services/UserManagementService/src/UsersManagmentService.Presentation/Models/UserDto.cs
@@ -0,0 +1,20 @@
+﻿using UsersManagementService.Common.Enums;
+
+namespace UsersManagmentService.Presentation.Models;
+
+public class UserDto
+{
+    required public Guid Id { get; set; }
+    required public Guid AuthId { get; set; }
+    required public string Username { get; set; }
+    required public string Email { get; set; }
+    public decimal? Balance { get; set; }
+    public VerificationStatus? VerificationStatus { get; set; }
+    public bool? IsBanned { get; set; }
+    public string? FirstName { get; set; }
+    public string? SecondName { get; set; }  
+    public string? LastName { get; set; }
+    public DateOnly? BirthDate { get; set; }
+    public string? PassportNumber { get; set; }
+    public string? IdentificationNumber { get; set; }
+}
diff --git a/src/Services/UserManagementService/src/UsersManagmentService.Presentation/Program.cs b/src/Services/UserManagementService/src/UsersManagmentService.Presentation/Program.cs
index eec05c3..3a3f9ad 100644
--- a/src/Services/UserManagementService/src/UsersManagmentService.Presentation/Program.cs
+++ b/src/Services/UserManagementService/src/UsersManagmentService.Presentation/Program.cs
@@ -1,11 +1,22 @@
+using UsersManagmentService.Presentation.DI;
 using UsersManagmentService.Presentation.Middleware;
-using UsersManagementService.BLL.DI;
 
 var builder = WebApplication.CreateBuilder(args);
-builder.Services.AddBLL(builder.Configuration);
+
+builder.Services.AddDependencies(builder.Configuration);
+
+builder.Services.AddControllers();
+
+builder.Services.AddSwaggerGen();
 
 var app = builder.Build();
 
 app.UseExceptionMiddleware();
 
+if (app.Environment.IsDevelopment())
+{
+    app.UseSwagger();
+    app.UseSwaggerUI();
+}
+
 await app.RunAsync();
diff --git a/src/Services/UserManagementService/src/UsersManagmentService.Presentation/UsersManagmentService.Presentation.csproj b/src/Services/UserManagementService/src/UsersManagmentService.Presentation/UsersManagmentService.Presentation.csproj
index 15ead56..8f0a174 100644
--- a/src/Services/UserManagementService/src/UsersManagmentService.Presentation/UsersManagmentService.Presentation.csproj
+++ b/src/Services/UserManagementService/src/UsersManagmentService.Presentation/UsersManagmentService.Presentation.csproj
@@ -1,4 +1,4 @@
-<Project Sdk="Microsoft.NET.Sdk.Web">
+﻿<Project Sdk="Microsoft.NET.Sdk.Web">
 
   <PropertyGroup>
     <TargetFramework>net8.0</TargetFramework>
@@ -7,14 +7,15 @@
   </PropertyGroup>
 
   <ItemGroup>
-    <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.4">
+    <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.5">
       <PrivateAssets>all</PrivateAssets>
       <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
     </PackageReference>
-    <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.4">
+    <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.5">
       <PrivateAssets>all</PrivateAssets>
       <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
     </PackageReference>
+    <PackageReference Include="Swashbuckle.AspNetCore" Version="8.1.1" />
   </ItemGroup>
 
   <ItemGroup>
diff --git a/src/Services/UserManagementService/tests/UsersManagementService.BLL.UnitTests/TestEntities/ImageValidationTestEntities.cs b/src/Services/UserManagementService/tests/UsersManagementService.BLL.UnitTests/TestEntities/ImageValidationTestEntities.cs
index bffe031..87fc914 100644
--- a/src/Services/UserManagementService/tests/UsersManagementService.BLL.UnitTests/TestEntities/ImageValidationTestEntities.cs
+++ b/src/Services/UserManagementService/tests/UsersManagementService.BLL.UnitTests/TestEntities/ImageValidationTestEntities.cs
@@ -11,7 +11,7 @@ public static class ImageValidationTestEntities
 {
     public static readonly CreateImageModel CreateModel = new(Guid.NewGuid(), Guid.NewGuid(), "url.com", ImageType.Default);
     public static readonly Guid DeleteModel = Guid.NewGuid();
-    public static readonly UpdateImageModel UpdateModel = new(Guid.NewGuid(), Guid.NewGuid(), "url.com", ImageType.Default, false);
+    public static readonly UpdateImageModel UpdateModel = new(Guid.NewGuid(), Guid.NewGuid(), "url.com", ImageType.Default);
 
     public static readonly IImagesRepository _imagesRepositoryMock = Substitute.For<IImagesRepository>();
 }
\ No newline at end of file
diff --git a/src/Services/UserManagementService/tests/UsersManagementService.BLL.UnitTests/TestEntities/ImagesServiceTestsEntities.cs b/src/Services/UserManagementService/tests/UsersManagementService.BLL.UnitTests/TestEntities/ImagesServiceTestsEntities.cs
index 26655df..6803c94 100644
--- a/src/Services/UserManagementService/tests/UsersManagementService.BLL.UnitTests/TestEntities/ImagesServiceTestsEntities.cs
+++ b/src/Services/UserManagementService/tests/UsersManagementService.BLL.UnitTests/TestEntities/ImagesServiceTestsEntities.cs
@@ -11,7 +11,7 @@ public static class ImagesServiceTestsEntities
 {
     public static readonly CreateImageModel CreateModel = new(Guid.NewGuid(), Guid.NewGuid(), "url.com", ImageType.Default);
     public static readonly Guid DeleteModel = Guid.NewGuid();
-    public static readonly UpdateImageModel UpdateModel = new(Guid.NewGuid(), Guid.NewGuid(), "url.com", ImageType.Default, false);
+    public static readonly UpdateImageModel UpdateModel = new(Guid.NewGuid(), Guid.NewGuid(), "url.com", ImageType.Default);
 
     public static readonly IImagesRepository _imagesRepositoryMock = Substitute.For<IImagesRepository>();
 }
diff --git a/src/Services/UserManagementService/tests/UsersManagementService.BLL.UnitTests/TestEntities/UserValidationTestEntities.cs b/src/Services/UserManagementService/tests/UsersManagementService.BLL.UnitTests/TestEntities/UserValidationTestEntities.cs
index f2439ee..f1a630b 100644
--- a/src/Services/UserManagementService/tests/UsersManagementService.BLL.UnitTests/TestEntities/UserValidationTestEntities.cs
+++ b/src/Services/UserManagementService/tests/UsersManagementService.BLL.UnitTests/TestEntities/UserValidationTestEntities.cs
@@ -15,7 +15,7 @@ public static class UserValidationTestEntities
     public static readonly Guid DeleteModel = Guid.NewGuid();
     public static readonly UpdateUserModel UpdateModel = new(
         Id: Guid.NewGuid(), AuthId: Guid.NewGuid(), Username: "user", Email: "user@email.com", Balance: 0,
-        VerificationStatus: VerificationStatus.UnVerified, IsBanned: false, IsDeleted: false, FirstName: "user",
+        VerificationStatus: VerificationStatus.UnVerified, IsBanned: false, FirstName: "user",
         SecondName: "user", LastName: "user", PassportNumber: "123456789", IdentificationNumber: "987654321");
     public static readonly Guid GetQuery = Guid.NewGuid();
     public static readonly GetPagedUsersQuery GetPagedQuery = new(1, 10);
diff --git a/src/Services/UserManagementService/tests/UsersManagementService.BLL.UnitTests/TestEntities/UsersServiceTestEntities.cs b/src/Services/UserManagementService/tests/UsersManagementService.BLL.UnitTests/TestEntities/UsersServiceTestEntities.cs
index 3645920..104646d 100644
--- a/src/Services/UserManagementService/tests/UsersManagementService.BLL.UnitTests/TestEntities/UsersServiceTestEntities.cs
+++ b/src/Services/UserManagementService/tests/UsersManagementService.BLL.UnitTests/TestEntities/UsersServiceTestEntities.cs
@@ -14,7 +14,7 @@ public static class UsersServiceTestEntities
     public static readonly Guid DeleteModel = Guid.NewGuid();
     public static readonly UpdateUserModel UpdateModel = new(
         Id: Guid.NewGuid(), AuthId: Guid.NewGuid(), Username: "user", Email: "user@email.com", Balance: 0,
-        VerificationStatus: VerificationStatus.UnVerified, IsBanned: false, IsDeleted: false, FirstName: "user",
+        VerificationStatus: VerificationStatus.UnVerified, IsBanned: false, FirstName: "user",
         SecondName: "user", LastName: "user", PassportNumber: "123456789", IdentificationNumber: "987654321");
     public static readonly Guid GetQuery = Guid.NewGuid();
     


Reviews:
user: login: moltenessence
state: CHANGES_REQUESTED
author_association: COLLABORATOR
submitted_at: 2025-05-16T13:30:56Z
user: login: moltenessence
state: APPROVED
author_association: COLLABORATOR
submitted_at: 2025-05-16T14:30:46Z
user: login: pavelGagarin0870
state: APPROVED
author_association: COLLABORATOR
submitted_at: 2025-05-16T14:43:26Z
user: login: DmitriyG0r4anin
state: APPROVED
author_association: COLLABORATOR
submitted_at: 2025-05-16T16:47:55Z

Review comments:
diff_hunk: @@ -0,0 +1,35 @@
+﻿using Mapster;
+using Microsoft.AspNetCore.Mvc;
+using System.Runtime.InteropServices;
+using UsersManagementService.BLL.Interfaces.Services;
+using UsersManagementService.BLL.Models.Image.CreateImage;
+using UsersManagementService.BLL.Models.Image.UpdateImage;
+using UsersManagmentService.Presentation.Models;
+
+namespace UsersManagmentService.Presentation.Controllers;
+
+[Produces("application/json")]
+[Route("api/[controller]")]
+public class ImageController(IImagesService imagesService) : ControllerBase
+{
+    [HttpPost]
+    public async Task<Guid> Create(ImageDTO image, CancellationToken cancellationToken = default)
+    {
+        var ImageModel = image.Adapt<CreateImageModel>();
path: src/Services/UserManagementService/src/UsersManagmentService.Presentation/Controllers/ImageController.cs
user: login: moltenessence
body: naming convention
created_at: 2025-05-16T13:28:32Z
author_association: COLLABORATOR
diff_hunk: @@ -0,0 +1,35 @@
+﻿using Mapster;
+using Microsoft.AspNetCore.Mvc;
+using System.Runtime.InteropServices;
+using UsersManagementService.BLL.Interfaces.Services;
+using UsersManagementService.BLL.Models.Image.CreateImage;
+using UsersManagementService.BLL.Models.Image.UpdateImage;
+using UsersManagmentService.Presentation.Models;
+
+namespace UsersManagmentService.Presentation.Controllers;
+
+[Produces("application/json")]
+[Route("api/[controller]")]
+public class ImageController(IImagesService imagesService) : ControllerBase
path: src/Services/UserManagementService/src/UsersManagmentService.Presentation/Controllers/ImageController.cs
user: login: moltenessence
body: https://restfulapi.net/resource-naming/
created_at: 2025-05-16T13:29:00Z
author_association: COLLABORATOR
diff_hunk: @@ -0,0 +1,51 @@
+﻿using Mapster;
+using Microsoft.AspNetCore.Mvc;
+using UsersManagementService.BLL.Interfaces.Services;
+using UsersManagementService.BLL.Models.User.CreateUser;
+using UsersManagementService.BLL.Models.User.GetPagedUsers;
+using UsersManagementService.BLL.Models.User.GetUser;
+using UsersManagementService.BLL.Models.User.UpdateUser;
+using UsersManagmentService.Presentation.Models;
+
+namespace UsersManagmentService.Presentation.Controllers;
+
+[Produces("application/json")]
+[Route("api/[controller]")]
+public class UserController(IUsersService usersService) : ControllerBase
path: src/Services/UserManagementService/src/UsersManagmentService.Presentation/Controllers/UserController.cs
user: login: moltenessence
body: https://restfulapi.net/resource-naming/
created_at: 2025-05-16T13:29:16Z
author_association: COLLABORATOR
diff_hunk: @@ -0,0 +1,51 @@
+﻿using Mapster;
+using Microsoft.AspNetCore.Mvc;
+using UsersManagementService.BLL.Interfaces.Services;
+using UsersManagementService.BLL.Models.User.CreateUser;
+using UsersManagementService.BLL.Models.User.GetPagedUsers;
+using UsersManagementService.BLL.Models.User.GetUser;
+using UsersManagementService.BLL.Models.User.UpdateUser;
+using UsersManagmentService.Presentation.Models;
+
+namespace UsersManagmentService.Presentation.Controllers;
+
+[Produces("application/json")]
path: src/Services/UserManagementService/src/UsersManagmentService.Presentation/Controllers/UserController.cs
user: login: moltenessence
body: use constant
created_at: 2025-05-16T13:29:26Z
author_association: COLLABORATOR
diff_hunk: @@ -0,0 +1,51 @@
+﻿using Mapster;
+using Microsoft.AspNetCore.Mvc;
+using UsersManagementService.BLL.Interfaces.Services;
+using UsersManagementService.BLL.Models.User.CreateUser;
+using UsersManagementService.BLL.Models.User.GetPagedUsers;
+using UsersManagementService.BLL.Models.User.GetUser;
+using UsersManagementService.BLL.Models.User.UpdateUser;
+using UsersManagmentService.Presentation.Models;
+
+namespace UsersManagmentService.Presentation.Controllers;
+
+[Produces("application/json")]
+[Route("api/[controller]")]
+public class UserController(IUsersService usersService) : ControllerBase
+{
+    [HttpGet]
+    public async Task<PagedUsersViewModel> Get(
+        [FromQuery] int page, 
+        [FromQuery] int pageSize, 
+        CancellationToken cancellationToken = default)
+    {
+        var usersQuery = new GetPagedUsersQuery(page, pageSize);
+        return await usersService.GetPagedUsersAsync(usersQuery, cancellationToken);
+    }
+
+    [HttpGet("{id}")]
+    public async Task<UserViewModel> GetById(Guid id, CancellationToken cancellationToken = default)
+    {
+        return await usersService.GetUserByIdAsync(id, cancellationToken);
+    }
+
+    [HttpPost]
+    public async Task<Guid> Create([FromQuery] UserDTO user, CancellationToken cancellationToken = default)
path: src/Services/UserManagementService/src/UsersManagmentService.Presentation/Controllers/UserController.cs
user: login: moltenessence
body: are you sure that [FromQuery]?
created_at: 2025-05-16T13:29:57Z
author_association: COLLABORATOR
diff_hunk: @@ -0,0 +1,51 @@
+﻿using Mapster;
+using Microsoft.AspNetCore.Mvc;
+using UsersManagementService.BLL.Interfaces.Services;
+using UsersManagementService.BLL.Models.User.CreateUser;
+using UsersManagementService.BLL.Models.User.GetPagedUsers;
+using UsersManagementService.BLL.Models.User.GetUser;
+using UsersManagementService.BLL.Models.User.UpdateUser;
+using UsersManagmentService.Presentation.Models;
+
+namespace UsersManagmentService.Presentation.Controllers;
+
+[Produces("application/json")]
+[Route("api/[controller]")]
+public class UserController(IUsersService usersService) : ControllerBase
+{
+    [HttpGet]
+    public async Task<PagedUsersViewModel> Get(
+        [FromQuery] int page, 
+        [FromQuery] int pageSize, 
+        CancellationToken cancellationToken = default)
+    {
+        var usersQuery = new GetPagedUsersQuery(page, pageSize);
+        return await usersService.GetPagedUsersAsync(usersQuery, cancellationToken);
+    }
+
+    [HttpGet("{id}")]
+    public async Task<UserViewModel> GetById(Guid id, CancellationToken cancellationToken = default)
+    {
+        return await usersService.GetUserByIdAsync(id, cancellationToken);
+    }
+
+    [HttpPost]
+    public async Task<Guid> Create([FromQuery] UserDTO user, CancellationToken cancellationToken = default)
+    {
+        var userModel = user.Adapt<CreateUserModel>();
+        return await usersService.CreateUserAsync(userModel, cancellationToken);
+    }
+
+    [HttpPut]
+    public async Task<Guid> Update([FromQuery] UserDTO user, CancellationToken cancellationToken = default)
path: src/Services/UserManagementService/src/UsersManagmentService.Presentation/Controllers/UserController.cs
user: login: moltenessence
body: are you sure that [FromQuery]?
created_at: 2025-05-16T13:30:27Z
author_association: COLLABORATOR

PR comments:
user: login: sonarqubecloud[bot]
created_at: 2025-05-16T14:27:04Z
body: ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=Mikita-Kliuchnikau_OnlineCasino.InnowiseInternship&pullRequest=17) **Quality Gate passed**  
Issues  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [20 New issues](https://sonarcloud.io/project/issues?id=Mikita-Kliuchnikau_OnlineCasino.InnowiseInternship&pullRequest=17&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=Mikita-Kliuchnikau_OnlineCasino.InnowiseInternship&pullRequest=17&issueStatuses=ACCEPTED)

Measures  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=Mikita-Kliuchnikau_OnlineCasino.InnowiseInternship&pullRequest=17&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [92.6% Coverage on New Code](https://sonarcloud.io/component_measures?id=Mikita-Kliuchnikau_OnlineCasino.InnowiseInternship&pullRequest=17&metric=new_coverage&view=list)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [1.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=Mikita-Kliuchnikau_OnlineCasino.InnowiseInternship&pullRequest=17&metric=new_duplicated_lines_density&view=list)  
  
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=Mikita-Kliuchnikau_OnlineCasino.InnowiseInternship&pullRequest=17)


author_association: NONE