Bladeren bron

Identity joined in infrestructure, Meeting and Team

zinab_elgendy 11 maanden geleden
bovenliggende
commit
69cc54118f
100 gewijzigde bestanden met toevoegingen van 8242 en 1571 verwijderingen
  1. 63 0
      MTWorkHR.API/Controllers/MeetingController.cs
  2. 63 0
      MTWorkHR.API/Controllers/TeamController.cs
  3. 49 2
      MTWorkHR.API/Controllers/UserTaskController.cs
  4. 0 1
      MTWorkHR.API/MTWorkHR.API.csproj
  5. 3 5
      MTWorkHR.API/Program.cs
  6. 1 1
      MTWorkHR.API/appsettings.json
  7. 4 0
      MTWorkHR.Application/ApplicationServiceRegistration.cs
  8. 2 1
      MTWorkHR.Application/Dtos/Identity/AttachmentDto.cs
  9. 1 2
      MTWorkHR.Application/Dtos/Identity/UserAddressDto.cs
  10. 24 0
      MTWorkHR.Application/Dtos/User/MeetingDto.cs
  11. 17 0
      MTWorkHR.Application/Dtos/User/MeetingUserDto.cs
  12. 21 0
      MTWorkHR.Application/Dtos/User/TeamDto.cs
  13. 17 0
      MTWorkHR.Application/Dtos/User/TeamUserDto.cs
  14. 1 6
      MTWorkHR.Application/Dtos/User/UserTaskDto.cs
  15. 1 1
      MTWorkHR.Application/Filters/AppAuth.cs
  16. 0 1
      MTWorkHR.Application/MTWorkHR.Application.csproj
  17. 5 1
      MTWorkHR.Application/Mapper/MappingProfile.cs
  18. 1 1
      MTWorkHR.Application/Services/Auth/AuthService.cs
  19. 4 3
      MTWorkHR.Application/Services/Base/FileService.cs
  20. 2 8
      MTWorkHR.Application/Services/DbMigrationService.cs
  21. 2 2
      MTWorkHR.Application/Services/Interfaces/IFileService.cs
  22. 11 0
      MTWorkHR.Application/Services/Interfaces/IMeetingService.cs
  23. 11 0
      MTWorkHR.Application/Services/Interfaces/ITeamService.cs
  24. 12 0
      MTWorkHR.Application/Services/Interfaces/IUserTaskAttachmentService.cs
  25. 12 0
      MTWorkHR.Application/Services/Interfaces/IUserTaskHistoryService.cs
  26. 1 1
      MTWorkHR.Application/Services/User/ProjectService.cs
  27. 69 0
      MTWorkHR.Application/Services/Task/UserTaskAttachmentService.cs
  28. 66 0
      MTWorkHR.Application/Services/Task/UserTaskHistoryService.cs
  29. 1 1
      MTWorkHR.Application/Services/User/UserTaskService.cs
  30. 51 0
      MTWorkHR.Application/Services/User/MeetingService.cs
  31. 54 0
      MTWorkHR.Application/Services/User/TeamService.cs
  32. 1 1
      MTWorkHR.Application/Services/User/UserService.cs
  33. 0 0
      MTWorkHR.Core/Entities/Logging/AuthLog.cs
  34. 0 0
      MTWorkHR.Core/Entities/Logging/FileLog.cs
  35. 0 0
      MTWorkHR.Core/Entities/Logging/IAppLogger.cs
  36. 0 0
      MTWorkHR.Core/Entities/Logging/Log.cs
  37. 39 0
      MTWorkHR.Core/Entities/Logging/MeetingLog.cs
  38. 0 0
      MTWorkHR.Core/Entities/Logging/RoleLog.cs
  39. 0 0
      MTWorkHR.Core/Entities/Logging/SMSLog.cs
  40. 0 0
      MTWorkHR.Core/Entities/Logging/SettingLog.cs
  41. 39 0
      MTWorkHR.Core/Entities/Logging/TeamLog.cs
  42. 0 0
      MTWorkHR.Core/Entities/Logging/UserLog.cs
  43. 39 0
      MTWorkHR.Core/Entities/Logging/UserTaskLog.cs
  44. 26 0
      MTWorkHR.Core/Entities/User/Meeting.cs
  45. 21 0
      MTWorkHR.Core/Entities/User/MeetingUser.cs
  46. 0 0
      MTWorkHR.Core/Entities/User/Permission.cs
  47. 1 1
      MTWorkHR.Core/Entities/User/Project.cs
  48. 24 0
      MTWorkHR.Core/Entities/User/Team.cs
  49. 21 0
      MTWorkHR.Core/Entities/User/TeamUser.cs
  50. 1 1
      MTWorkHR.Core/Entities/User/UserTaskAttachment.cs
  51. 5 4
      MTWorkHR.Core/Entities/User/UserTaskHistory.cs
  52. 0 0
      MTWorkHR.Core/IRepositories/Task/IProjectRepository.cs
  53. 0 0
      MTWorkHR.Core/IRepositories/Task/ITaskStatusRepository.cs
  54. 0 1
      MTWorkHR.Core/IRepositories/IUserTaskAttachmentRepository.cs
  55. 0 0
      MTWorkHR.Core/IRepositories/Task/IUserTaskHistoryRepository.cs
  56. 0 6
      MTWorkHR.Core/IRepositories/IUserTaskRepository.cs
  57. 15 0
      MTWorkHR.Core/IRepositories/User/IMeetingRepository.cs
  58. 16 0
      MTWorkHR.Core/IRepositories/User/ITeamRepository.cs
  59. 3 1
      MTWorkHR.Core/IUnitOfWork/IUnitOfWork.cs
  60. 1 0
      MTWorkHR.Core/IUnitOfWork/IUnitOfWorkLog.cs
  61. 0 16
      MTWorkHR.Identity/Entities/JwtSettings.cs
  62. 0 17
      MTWorkHR.Identity/Entities/Permission.cs
  63. 0 51
      MTWorkHR.Identity/IdentityServiceRegistration.cs
  64. 0 533
      MTWorkHR.Identity/Migrations/20240128145047_InitialCreate.Designer.cs
  65. 0 370
      MTWorkHR.Identity/Migrations/20240128145047_InitialCreate.cs
  66. 0 214
      MTWorkHR.Identity/Migrations/20240221104859_updateUser.cs
  67. 1 1
      MTWorkHR.Infrastructure/Configurations/AttachmentTypeConfiguration.cs
  68. 2 2
      MTWorkHR.Identity/Configurations/RoleConfiguration.cs
  69. 2 2
      MTWorkHR.Identity/Configurations/UserConfiguration.cs
  70. 1 1
      MTWorkHR.Identity/Configurations/UserRoleConfiguration.cs
  71. 0 0
      MTWorkHR.Infrastructure/DBContext/Extensions/BuilderHasIndexExtensions.cs
  72. 0 0
      MTWorkHR.Infrastructure/DBContext/Extensions/BuilderSetQueryFilterExtensions.cs
  73. 36 6
      MTWorkHR.Identity/DBContext/HRIdentityDBContext.cs
  74. 16 16
      MTWorkHR.Infrastructure/EmailService/MailSender.cs
  75. 1 1
      MTWorkHR.Identity/Entities/ApplicationRole.cs
  76. 1 1
      MTWorkHR.Identity/Entities/ApplicationUser.cs
  77. 5 5
      MTWorkHR.Identity/Entities/ApplicationUserManager.cs
  78. 1 1
      MTWorkHR.Identity/Entities/IdentityExtension.cs
  79. 3 2
      MTWorkHR.Identity/Entities/RolePermission.cs
  80. 1 1
      MTWorkHR.Identity/Entities/UserAddress.cs
  81. 1 1
      MTWorkHR.Identity/Entities/UserAttachment.cs
  82. 48 13
      MTWorkHR.Infrastructure/InfrastructureServiceRegistration.cs
  83. 3 7
      MTWorkHR.Infrastructure/MTWorkHR.Infrastructure.csproj
  84. 700 80
      MTWorkHR.Identity/Migrations/20240221104859_updateUser.Designer.cs
  85. 823 0
      MTWorkHR.Infrastructure/Migrations/20240228105352_initial.cs
  86. 706 80
      MTWorkHR.Identity/Migrations/HRIdentityDBContextModelSnapshot.cs
  87. 29 0
      MTWorkHR.Infrastructure/Migrations/20240303141711_updateHistory.cs
  88. 1679 0
      MTWorkHR.Infrastructure/Migrations/20240304072047_addTeamMeeting.Designer.cs
  89. 274 0
      MTWorkHR.Infrastructure/Migrations/20240304072047_addTeamMeeting.cs
  90. 1795 0
      MTWorkHR.Infrastructure/Migrations/20240304100029_addTeamMeetinglogs.Designer.cs
  91. 75 0
      MTWorkHR.Infrastructure/Migrations/20240304100029_addTeamMeetinglogs.cs
  92. 1191 89
      MTWorkHR.Infrastructure/Migrations/HRDataContextModelSnapshot.cs
  93. 1 1
      MTWorkHR.Infrastructure/Repositories/Auth/PermissionRepository.cs
  94. 2 2
      MTWorkHR.Infrastructure/Repositories/Auth/RolePermissionRepository.cs
  95. 3 3
      MTWorkHR.Infrastructure/Repositories/Auth/UserRoleRepository.cs
  96. 2 1
      MTWorkHR.Infrastructure/Repositories/EmployeeRepository.cs
  97. 1 1
      MTWorkHR.Infrastructure/Repositories/Repository.cs
  98. 1 1
      MTWorkHR.Infrastructure/Repositories/RepositoryLog.cs
  99. 17 0
      MTWorkHR.Infrastructure/Repositories/Task/ProjectRepository.cs
  100. 0 0
      MTWorkHR.Infrastructure/Repositories/Task/TaskAttachmentRepository.cs

+ 63 - 0
MTWorkHR.API/Controllers/MeetingController.cs

@@ -0,0 +1,63 @@
+using Microsoft.AspNetCore.Authorization;
+
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using MTWorkHR.Application.Identity;
+using MTWorkHR.Application.Models;
+using MTWorkHR.Application.Services.Interfaces;
+using MTWorkHR.Identity.Services;
+
+namespace MTWorkHR.API.Controllers
+{
+    [Route("api/[controller]")]
+    [ApiController]
+    public class MeetingController : ControllerBase
+    {
+        private readonly IMeetingService _MeetingService;
+        public MeetingController(IMeetingService UserMeetingService)
+        {
+            this._MeetingService = UserMeetingService;
+        }
+        [HttpGet("GetAll")]
+        [ProducesResponseType(StatusCodes.Status200OK)]
+
+        public async Task<ActionResult<List<MeetingDto>>> GetAll([FromQuery] PagingInputDto pagingInput)
+        {
+            return Ok(await _MeetingService.GetAll(pagingInput));
+        }
+        [HttpGet("Get")]
+        [ProducesResponseType(StatusCodes.Status200OK)]
+
+        public async Task<ActionResult<MeetingDto>> Get(long MeetingId)
+        {
+            return Ok(await _MeetingService.GetById(MeetingId));
+        }
+
+
+        [HttpPost("Create")]
+        [ProducesResponseType(StatusCodes.Status200OK)]
+        public async Task<ActionResult<MeetingDto>> Create([FromBody] MeetingDto input)
+        {
+            return await _MeetingService.Create(input);
+        }
+
+        [HttpPost("Update")]
+        [ProducesResponseType(StatusCodes.Status200OK)]
+
+        public async Task Update([FromBody] MeetingDto input)
+        {
+            await _MeetingService.Update(input);
+        }
+
+        [HttpPost("Delete")]
+        [ProducesResponseType(StatusCodes.Status200OK)]
+
+        public async Task Delete(long id)
+        {
+            await _MeetingService.Delete(id);
+        }
+
+
+
+    }
+}

+ 63 - 0
MTWorkHR.API/Controllers/TeamController.cs

@@ -0,0 +1,63 @@
+using Microsoft.AspNetCore.Authorization;
+
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using MTWorkHR.Application.Identity;
+using MTWorkHR.Application.Models;
+using MTWorkHR.Application.Services.Interfaces;
+using MTWorkHR.Identity.Services;
+
+namespace MTWorkHR.API.Controllers
+{
+    [Route("api/[controller]")]
+    [ApiController]
+    public class TeamController : ControllerBase
+    {
+        private readonly ITeamService _TeamService;
+        public TeamController(ITeamService UserTeamService)
+        {
+            this._TeamService = UserTeamService;
+        }
+        [HttpGet("GetAll")]
+        [ProducesResponseType(StatusCodes.Status200OK)]
+
+        public async Task<ActionResult<List<TeamDto>>> GetAll([FromQuery] PagingInputDto pagingInput)
+        {
+            return Ok(await _TeamService.GetAll(pagingInput));
+        }
+        [HttpGet("Get")]
+        [ProducesResponseType(StatusCodes.Status200OK)]
+
+        public async Task<ActionResult<TeamDto>> Get(long TeamId)
+        {
+            return Ok(await _TeamService.GetById(TeamId));
+        }
+
+
+        [HttpPost("Create")]
+        [ProducesResponseType(StatusCodes.Status200OK)]
+        public async Task<ActionResult<TeamDto>> Create([FromBody] TeamDto input)
+        {
+            return await _TeamService.Create(input);
+        }
+
+        [HttpPost("Update")]
+        [ProducesResponseType(StatusCodes.Status200OK)]
+
+        public async Task Update([FromBody] TeamDto input)
+        {
+            await _TeamService.Update(input);
+        }
+
+        [HttpPost("Delete")]
+        [ProducesResponseType(StatusCodes.Status200OK)]
+
+        public async Task Delete(long id)
+        {
+            await _TeamService.Delete(id);
+        }
+
+
+
+    }
+}

+ 49 - 2
MTWorkHR.API/Controllers/UserTaskController.cs

@@ -14,9 +14,12 @@ namespace MTWorkHR.API.Controllers
     public class UserTaskController : ControllerBase
     {
         private readonly IUserTaskService _userTaskService;
-        public UserTaskController(IUserTaskService UserUserTaskService)
+        private readonly IUserTaskAttachmentService _attachmentService;
+        private readonly IUserTaskHistoryService _taskHistoryService;
+        public UserTaskController(IUserTaskService userUserTaskService, IUserTaskAttachmentService attachmentService)
         {
-            this._userTaskService = UserUserTaskService;
+            this._userTaskService = userUserTaskService;
+            _attachmentService = attachmentService;
         }
         [HttpGet("GetAll")]
         public async Task<ActionResult<List<UserTaskDto>>> GetAll([FromQuery]PagingInputDto pagingInput)
@@ -53,7 +56,51 @@ namespace MTWorkHR.API.Controllers
             await _userTaskService.Delete(id);
         }
 
+        #region attachments
+        [HttpPost("CreateAttachment")]
+        [ProducesResponseType(StatusCodes.Status200OK)]
+        public async Task<ActionResult<AttachmentDto>> CreateAttachment([FromBody] AttachmentDto input)
+        {
+            return await _attachmentService.Create(input);
+        }
+        [HttpPost("UpdateAttachment")]
+        [ProducesResponseType(StatusCodes.Status200OK)]
+        public async Task UpdateAttachment([FromBody] AttachmentDto input)
+        {
+            await _attachmentService.Update(input);
+        }
+
+        [HttpPost("DeleteAttachment")]
+        [ProducesResponseType(StatusCodes.Status200OK)]
+        public async Task DeleteAttachment(long id)
+        {
+            await _attachmentService.Delete(id);
+        }
+
+        #endregion
+
+        #region History
+        [HttpPost("CreateTaskHistory")]
+        [ProducesResponseType(StatusCodes.Status200OK)]
+        public async Task<ActionResult<UserTaskHistoryDto>> CreateTaskHistory([FromBody] UserTaskHistoryDto input)
+        {
+            return await _taskHistoryService.Create(input);
+        }
+
+        [HttpPost("UpdateTaskHistory")]
+        [ProducesResponseType(StatusCodes.Status200OK)]
+        public async Task UpdateTaskHistory([FromBody] UserTaskHistoryDto input)
+        {
+            await _taskHistoryService.Update(input);
+        }
+        [HttpPost("DeleteTaskHistory")]
+        [ProducesResponseType(StatusCodes.Status200OK)]
+        public async Task DeleteTaskHistory(long id)
+        {
+            await _taskHistoryService.Delete(id);
+        }
 
+        #endregion
 
     }
 }

+ 0 - 1
MTWorkHR.API/MTWorkHR.API.csproj

@@ -20,7 +20,6 @@
 
   <ItemGroup>
     <ProjectReference Include="..\MTWorkHR.Application\MTWorkHR.Application.csproj" />
-    <ProjectReference Include="..\MTWorkHR.Identity\MTWorkHR.Identity.csproj" />
     <ProjectReference Include="..\MTWorkHR.Infrastructure\MTWorkHR.Infrastructure.csproj" />
   </ItemGroup>
 

+ 3 - 5
MTWorkHR.API/Program.cs

@@ -1,8 +1,5 @@
 using MTWorkHR.Application;
 using MTWorkHR.Infrastructure;
-using MTWorkHR.Identity;
-using Microsoft.Extensions.Configuration;
-using MTWorkHR.Infrastructure.Data;
 using Microsoft.EntityFrameworkCore;
 using MTWorkHR.Core;
 using MTWorkHR.Core.Global;
@@ -11,6 +8,7 @@ using MTWorkHR.Application.Services.Interfaces;
 using MTWorkHR.Application.Filters;
 using MTWorkHR.Application.StartupService;
 using Microsoft.AspNetCore.Mvc;
+using MTWorkHR.Infrastructure.DBContext;
 
 var builder = WebApplication.CreateBuilder(args);
 
@@ -22,9 +20,9 @@ builder.Services.AddDbContext<HRDataContext>(options =>
 var config = new AppSettingsConfiguration();
 builder.Configuration.Bind(config);
 builder.Services.AddApplicationServices(config);
-builder.Services.AddInfrastructureServices(config);
+builder.Services.AddInfrastructureIdentityServices(config);
 //builder.Services.AddPersistenceServices(builder.Configuration);
-builder.Services.AddIdentityServices(config);
+//builder.Services.AddIdentityServices(config);
 builder.Services.AddHostedService<DbMigrationService>();
 
 //builder.Services.AddControllers();

+ 1 - 1
MTWorkHR.API/appsettings.json

@@ -6,7 +6,7 @@
     }
   },
   "ConnectionStrings": {
-    "MTWorkHRConnectionString": "Server=localhost;Database=MTWorkHRDB;User=sa;Password=p@ssw0rd;MultipleActiveResultSets=true;Integrated Security=True;Encrypt=False"
+    "MTWorkHRConnectionString": "Server=localhost;Database=MTWorkHRDataBase;User=sa;Password=p@ssw0rd;MultipleActiveResultSets=true;Integrated Security=True;Encrypt=False"
     // "HRIdentityDB": "Server=localhost;Database=HRIdentityDB;User=sa;Password=p@ssw0rd;MultipleActiveResultSets=true"
     //Data Source=.;Initial Catalog=CBQ_VIVR;Integrated Security=True;Encrypt=False
   },

+ 4 - 0
MTWorkHR.Application/ApplicationServiceRegistration.cs

@@ -24,6 +24,10 @@ namespace MTWorkHR.Application
             services.AddTransient<IFileService, FileService>();
             services.AddScoped<IProjectService, ProjectService>();
             services.AddScoped<IUserTaskService, UserTaskService>();
+            services.AddScoped<IUserTaskAttachmentService, UserTaskAttachmentService>();
+            services.AddScoped<IUserTaskHistoryService, UserTaskHistoryService>();
+            services.AddScoped<ITeamService, TeamService>();
+            services.AddScoped<IMeetingService, MeetingService>();
             
             return services;
         }

+ 2 - 1
MTWorkHR.Application/Dtos/Identity/AttachmentDto.cs

@@ -5,9 +5,10 @@ using System.ComponentModel.DataAnnotations.Schema;
 
 namespace MTWorkHR.Application.Models
 {
-    public class AttachmentDto
+    public class AttachmentDto : EntityDto
     {
         public long AttachmentTypeId { get; set; }
+        public long TaskId { get; set; }
 
         public string? AttachmentTypeName { get; set; }
 

+ 1 - 2
MTWorkHR.Application/Dtos/Identity/UserAddressDto.cs

@@ -1,5 +1,4 @@
-using MTWorkHR.Identity.Entities;
-using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations;
 using System.ComponentModel.DataAnnotations.Schema;
 
 namespace MTWorkHR.Application.Models

+ 24 - 0
MTWorkHR.Application/Dtos/User/MeetingDto.cs

@@ -0,0 +1,24 @@
+using Microsoft.AspNetCore.Http;
+using MTWorkHR.Core.Entities;
+using MTWorkHR.Core.Entities.Base;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+
+namespace MTWorkHR.Application.Models
+{
+    public class MeetingDto : EntityDto
+    {
+        [Required]
+        [MaxLength(250)]
+        [Filter]
+        public string Title { get; set; }
+
+        [MaxLength(500)]
+        [Filter]
+        public string? Description { get; set; }
+        public DateTime MeetingDateTime { get; set; }
+        [MaxLength(250)]
+        public string? MeetingLink { get; set; }
+        public List<MeetingUserDto>? MeetingUsers { get; set; }
+    }
+}

+ 17 - 0
MTWorkHR.Application/Dtos/User/MeetingUserDto.cs

@@ -0,0 +1,17 @@
+using Microsoft.AspNetCore.Http;
+using MTWorkHR.Core.Entities;
+using MTWorkHR.Core.Entities.Base;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+
+namespace MTWorkHR.Application.Models
+{
+    public class MeetingUserDto : EntityDto
+    {
+        public long MeetingId { get; set; }
+        [Required]
+        public string AssignedUserId { get; set; }
+        public string? AssignedUserName { get; set; }
+
+    }
+}

+ 21 - 0
MTWorkHR.Application/Dtos/User/TeamDto.cs

@@ -0,0 +1,21 @@
+using Microsoft.AspNetCore.Http;
+using MTWorkHR.Core.Entities;
+using MTWorkHR.Core.Entities.Base;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+
+namespace MTWorkHR.Application.Models
+{
+    public class TeamDto : EntityDto
+    {
+        [Required]
+        [MaxLength(250)]
+        [Filter]
+        public string NameAr { get; set; }
+        [Required]
+        [MaxLength(250)]
+        [Filter]
+        public string NameEn { get; set; }
+        public List<TeamUserDto>? TeamUsers { get; set; }
+    }
+}

+ 17 - 0
MTWorkHR.Application/Dtos/User/TeamUserDto.cs

@@ -0,0 +1,17 @@
+using Microsoft.AspNetCore.Http;
+using MTWorkHR.Core.Entities;
+using MTWorkHR.Core.Entities.Base;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+
+namespace MTWorkHR.Application.Models
+{
+    public class TeamUserDto : EntityDto
+    {
+        public long TeamId { get; set; }
+        [Required]
+        public string AssignedUserId { get; set; }
+        public string? AssignedUserName { get; set; }
+
+    }
+}

+ 1 - 6
MTWorkHR.Application/Dtos/User/UserTaskDto.cs

@@ -1,9 +1,4 @@
-using Microsoft.AspNetCore.Http;
-using MTWorkHR.Core.Entities;
-using MTWorkHR.Core.Entities.Base;
-using MTWorkHR.Core.Global;
-using System.ComponentModel.DataAnnotations;
-using System.ComponentModel.DataAnnotations.Schema;
+using MTWorkHR.Core.Global;
 
 namespace MTWorkHR.Application.Models
 {

+ 1 - 1
MTWorkHR.Application/Filters/AppAuth.cs

@@ -4,7 +4,7 @@ using Microsoft.AspNetCore.Mvc;
 using Microsoft.AspNetCore.Mvc.Filters;
 using Microsoft.Extensions.DependencyInjection;
 using MTWorkHR.Core.Global;
-using MTWorkHR.Identity.Entities;
+using MTWorkHR.Infrastructure.Entities;
 
 namespace MTWorkHR.Application.Filters
 {

+ 0 - 1
MTWorkHR.Application/MTWorkHR.Application.csproj

@@ -18,7 +18,6 @@
 
   <ItemGroup>
     <ProjectReference Include="..\MTWorkHR.Core\MTWorkHR.Core.csproj" />
-    <ProjectReference Include="..\MTWorkHR.Identity\MTWorkHR.Identity.csproj" />
     <ProjectReference Include="..\MTWorkHR.Infrastructure\MTWorkHR.Infrastructure.csproj" />
   </ItemGroup>
 

+ 5 - 1
MTWorkHR.Application/Mapper/MappingProfile.cs

@@ -3,7 +3,7 @@ using Microsoft.AspNetCore.Identity;
 using MTWorkHR.Application.Models;
 using MTWorkHR.Core.Entities;
 using MTWorkHR.Core.Global;
-using MTWorkHR.Identity.Entities;
+using MTWorkHR.Infrastructure.Entities;
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -62,6 +62,10 @@ namespace MTWorkHR.Application.Mapper
             CreateMap<UserTaskDto, UserTask>().ReverseMap();
             CreateMap<UserTaskAttachment, AttachmentDto>().ReverseMap();
             CreateMap<UserTaskHistory, UserTaskHistoryDto>().ReverseMap();
+            CreateMap<Team, TeamDto>().ReverseMap();
+            CreateMap<TeamUser, TeamUserDto>().ReverseMap();
+            CreateMap<Meeting, MeetingDto>().ReverseMap();
+            CreateMap<MeetingUser, MeetingUserDto>().ReverseMap();
 
             
 

+ 1 - 1
MTWorkHR.Application/Services/Auth/AuthService.cs

@@ -5,7 +5,7 @@ using MTWorkHR.Application.Exceptions;
 using MTWorkHR.Application.Identity;
 using MTWorkHR.Application.Models;
 using MTWorkHR.Core.Global;
-using MTWorkHR.Identity.Entities;
+using MTWorkHR.Infrastructure.Entities;
 using System.IdentityModel.Tokens.Jwt;
 using System.Security.Claims;
 using System.Text;

+ 4 - 3
MTWorkHR.Application/Services/Base/FileService.cs

@@ -16,12 +16,13 @@ namespace MTWorkHR.Application.Services
         {
             this.settings = settings;
         }
-        public string UploadFile(IFormFile file)
+        public async Task<string> UploadFile(IFormFile file)
         {
-            return UploadFiles(new List<IFormFile> { file }).First();
+            var filesName = await UploadFiles(new List<IFormFile> { file });
+            return filesName.First();
         }
 
-        public List<string> UploadFiles(List<IFormFile> files)
+        public async Task< List<string>> UploadFiles(List<IFormFile> files)
         {
             if (!AttachmentsMust(files))
                 throw new AppException(ExceptionEnum.InvalidFileType);

+ 2 - 8
MTWorkHR.Application/Services/DbMigrationService.cs

@@ -1,8 +1,7 @@
 using Microsoft.EntityFrameworkCore;
 using Microsoft.Extensions.DependencyInjection;
 using Microsoft.Extensions.Hosting;
-using MTWorkHR.Identity.DBContext;
-using MTWorkHR.Infrastructure.Data;
+using MTWorkHR.Infrastructure.DBContext;
 
 namespace MTWorkHR.Application.StartupService;
 
@@ -19,15 +18,10 @@ public class DbMigrationService : IHostedService
     {
         using (var scope = sp.CreateScope())
         {
-            var identityContext = scope.ServiceProvider.GetRequiredService<HRIdentityDBContext>();
-           
-
+            var identityContext = scope.ServiceProvider.GetRequiredService<HRDataContext>();
             await identityContext.Database.EnsureCreatedAsync(cancellationToken);
             await identityContext.Database.MigrateAsync(cancellationToken);
 
-            var HRDataContext = scope.ServiceProvider.GetRequiredService<HRDataContext>();
-            await HRDataContext.Database.EnsureCreatedAsync(cancellationToken);
-            await HRDataContext.Database.MigrateAsync(cancellationToken);
         }
     }
 

+ 2 - 2
MTWorkHR.Application/Services/Interfaces/IFileService.cs

@@ -10,8 +10,8 @@ namespace MTWorkHR.Application.Services.Interfaces
 {
     public interface IFileService
     {
-        string UploadFile(IFormFile file);
-        List<string> UploadFiles(List<IFormFile> files);
+        Task<string> UploadFile(IFormFile file);
+        Task<List<string>> UploadFiles(List<IFormFile> files);
         Task<bool> CopyFileToActualFolder(List<AttachmentDto> attachments);
         bool CopyFileToActualFolder(string FileName);
         bool DeleteFileFromTempFolder(string FileName);

+ 11 - 0
MTWorkHR.Application/Services/Interfaces/IMeetingService.cs

@@ -0,0 +1,11 @@
+
+using MTWorkHR.Application.Models;
+using MTWorkHR.Core.Entities;
+using System.Threading.Tasks;
+
+namespace MTWorkHR.Application.Services.Interfaces
+{
+    public interface IMeetingService : IService<Meeting, MeetingDto, MeetingDto>
+    {
+    }
+}

+ 11 - 0
MTWorkHR.Application/Services/Interfaces/ITeamService.cs

@@ -0,0 +1,11 @@
+
+using MTWorkHR.Application.Models;
+using MTWorkHR.Core.Entities;
+using System.Threading.Tasks;
+
+namespace MTWorkHR.Application.Services.Interfaces
+{
+    public interface ITeamService : IService<Team, TeamDto, TeamDto>
+    {
+    }
+}

+ 12 - 0
MTWorkHR.Application/Services/Interfaces/IUserTaskAttachmentService.cs

@@ -0,0 +1,12 @@
+
+using MTWorkHR.Application.Models;
+using MTWorkHR.Core.Entities.Base;
+using MTWorkHR.Core.Entities;
+using System.Threading.Tasks;
+
+namespace MTWorkHR.Application.Services.Interfaces
+{
+    public interface IUserTaskAttachmentService : IService<UserTaskAttachment, AttachmentDto, AttachmentDto>
+    {
+    }
+}

+ 12 - 0
MTWorkHR.Application/Services/Interfaces/IUserTaskHistoryService.cs

@@ -0,0 +1,12 @@
+
+using MTWorkHR.Application.Models;
+using MTWorkHR.Core.Entities.Base;
+using MTWorkHR.Core.Entities;
+using System.Threading.Tasks;
+
+namespace MTWorkHR.Application.Services.Interfaces
+{
+    public interface IUserTaskHistoryService : IService<UserTaskHistory, UserTaskHistoryDto, UserTaskHistoryDto>
+    {
+    }
+}

+ 1 - 1
MTWorkHR.Application/Services/User/ProjectService.cs

@@ -8,7 +8,7 @@ using MTWorkHR.Application.Models;
 using MTWorkHR.Core.Global;
 using MTWorkHR.Core.IRepositories;
 using MTWorkHR.Core.UnitOfWork;
-using MTWorkHR.Identity.Entities;
+using MTWorkHR.Infrastructure.Entities;
 using MTWorkHR.Application.Services.Interfaces;
 using MTWorkHR.Core.Email;
 using MTWorkHR.Core.Entities;

+ 69 - 0
MTWorkHR.Application/Services/Task/UserTaskAttachmentService.cs

@@ -0,0 +1,69 @@
+
+using MTWorkHR.Application.Models;
+using MTWorkHR.Core.UnitOfWork;
+using MTWorkHR.Application.Services.Interfaces;
+using MTWorkHR.Core.Entities;
+using Microsoft.AspNetCore.Identity;
+using MTWorkHR.Application.Mapper;
+using MTWorkHR.Core.Global;
+using MTWorkHR.Infrastructure.Entities;
+using MTWorkHR.Infrastructure.Repositories;
+using MTWorkHR.Infrastructure.UnitOfWorks;
+using MTWorkHR.Core.IRepositories.Base;
+
+namespace MTWorkHR.Application.Services
+{
+    public class UserTaskAttachmentService : BaseService<UserTaskAttachment, AttachmentDto, AttachmentDto>, IUserTaskAttachmentService
+    {
+        private readonly IUnitOfWork _unitOfWork;
+        //private readonly AppSettingsConfiguration _configuration;
+        //private readonly GlobalInfo _globalInfo;
+        private readonly IFileService _fileService;
+
+        public UserTaskAttachmentService(IUnitOfWork unitOfWork, IFileService fileService) : base(unitOfWork)
+        {
+            _unitOfWork = unitOfWork;
+            _fileService = fileService;
+        }
+
+
+        public override async Task<AttachmentDto> GetById(long id)
+        {
+            var entity = await _unitOfWork.UserTaskAttachment.GetByIdAsync(id);
+            var response = MapperObject.Mapper.Map<AttachmentDto>(entity);
+            return response;
+        }
+
+        public override async Task<AttachmentDto> Create(AttachmentDto input)
+        {
+            if (input.FileData != null)
+                input.FileName = await _fileService.UploadFile(input.FileData);
+            var entity = MapperObject.Mapper.Map<UserTaskAttachment>(input);
+            if (entity is null)
+            {
+                throw new AppException(ExceptionEnum.MapperIssue);
+            }
+
+            var task = await _unitOfWork.UserTaskAttachment.AddAsync(entity);
+            await _unitOfWork.CompleteAsync();
+
+            var response = MapperObject.Mapper.Map<AttachmentDto>(task);
+            return response;
+        }
+
+
+        //public override async Task<AttachmentDto> Update(AttachmentDto input)
+        //{
+        //    var entitiy = await _unitOfWork.UserTaskAttachment.GetByIdAsync(input.Id);
+
+        //    if (entitiy == null)
+        //        throw new AppException(ExceptionEnum.RecordNotExist);
+
+        //    MapperObject.Mapper.Map(input, entitiy, typeof(AttachmentDto), typeof(UserTaskAttachment));
+
+        //    await _unitOfWork.CompleteAsync();
+
+        //    return input;
+        //}
+    }
+}

+ 66 - 0
MTWorkHR.Application/Services/Task/UserTaskHistoryService.cs

@@ -0,0 +1,66 @@
+
+using MTWorkHR.Application.Models;
+using MTWorkHR.Core.UnitOfWork;
+using MTWorkHR.Application.Services.Interfaces;
+using MTWorkHR.Core.Entities;
+using Microsoft.AspNetCore.Identity;
+using MTWorkHR.Application.Mapper;
+using MTWorkHR.Core.Global;
+using MTWorkHR.Infrastructure.Entities;
+using MTWorkHR.Infrastructure.Repositories;
+using MTWorkHR.Infrastructure.UnitOfWorks;
+using MTWorkHR.Core.IRepositories.Base;
+
+namespace MTWorkHR.Application.Services
+{
+    public class UserTaskHistoryService : BaseService<UserTaskHistory, UserTaskHistoryDto, UserTaskHistoryDto>, IUserTaskHistoryService
+    {
+        private readonly IUnitOfWork _unitOfWork;
+
+        public UserTaskHistoryService(IUnitOfWork unitOfWork) : base(unitOfWork)
+        {
+            _unitOfWork = unitOfWork;
+        }
+
+
+        //public override async Task<UserTaskHistoryDto> GetById(long id)
+        //{
+        //    var entity = await _unitOfWork.UserTaskAttachment.GetByIdAsync(id);
+        //    var response = MapperObject.Mapper.Map<UserTaskHistoryDto>(entity);
+        //    return response;
+        //}
+
+  
+
+
+        //public override async Task<UserTaskHistoryDto> Create(UserTaskHistoryDto input)
+        //{          
+        //    var entity = MapperObject.Mapper.Map<UserTaskAttachment>(input);
+        //    if (entity is null)
+        //    {
+        //        throw new AppException(ExceptionEnum.MapperIssue);
+        //    }
+
+        //    var task = await _unitOfWork.UserTaskAttachment.AddAsync(entity);
+        //    await _unitOfWork.CompleteAsync();
+
+        //    var response = MapperObject.Mapper.Map<UserTaskHistoryDto>(task);
+        //    return response;
+        //}
+
+
+        //public override async Task<UserTaskHistoryDto> Update(UserTaskHistoryDto input)
+        //{
+        //    var entitiy = await _unitOfWork.UserTask.GetByIdAsync(input.Id);
+
+        //    if (entitiy == null)
+        //        throw new AppException(ExceptionEnum.RecordNotExist);
+
+        //    MapperObject.Mapper.Map(input, entitiy, typeof(UserTaskHistoryDto), typeof(UserTaskHistory));
+
+        //    await _unitOfWork.CompleteAsync();
+
+        //    return input;
+        //}
+    }
+}

+ 1 - 1
MTWorkHR.Application/Services/User/UserTaskService.cs

@@ -6,7 +6,7 @@ using MTWorkHR.Core.Entities;
 using Microsoft.AspNetCore.Identity;
 using MTWorkHR.Application.Mapper;
 using MTWorkHR.Core.Global;
-using MTWorkHR.Identity.Entities;
+using MTWorkHR.Infrastructure.Entities;
 using MTWorkHR.Infrastructure.Repositories;
 using MTWorkHR.Infrastructure.UnitOfWorks;
 using MTWorkHR.Core.IRepositories.Base;

+ 51 - 0
MTWorkHR.Application/Services/User/MeetingService.cs

@@ -0,0 +1,51 @@
+using Microsoft.AspNetCore.Identity;
+using Microsoft.AspNetCore.WebUtilities;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.Extensions.Configuration;
+using MTWorkHR.Application.Identity;
+using MTWorkHR.Application.Mapper;
+using MTWorkHR.Application.Models;
+using MTWorkHR.Core.Global;
+using MTWorkHR.Core.IRepositories;
+using MTWorkHR.Core.UnitOfWork;
+using MTWorkHR.Infrastructure.Entities;
+using MTWorkHR.Application.Services.Interfaces;
+using MTWorkHR.Core.Email;
+using MTWorkHR.Core.Entities;
+using MTWorkHR.Infrastructure.UnitOfWorks;
+
+namespace MTWorkHR.Application.Services
+{
+    public class MeetingService : BaseService<Meeting, MeetingDto, MeetingDto>, IMeetingService
+    {
+        private readonly IUnitOfWork _unitOfWork;
+
+        public MeetingService(IUnitOfWork unitOfWork):base(unitOfWork)
+        {
+            _unitOfWork = unitOfWork;
+        }
+
+        public override async Task<MeetingDto> GetById(long id)
+        {
+            var entity = await _unitOfWork.Meeting.GetByIdWithAllChildren(id);
+            var response = MapperObject.Mapper.Map<MeetingDto>(entity);
+            return response;
+        }
+
+        //public override async Task<List<MeetingDto>> GetAll()
+        //{
+        //    var Meetings = await _unitOfWork.Meeting.GetAllAsync();
+        //    var response = MapperObject.Mapper.Map<List<MeetingDto>>(Meetings);
+        //    return response;
+        //}
+
+        //public override async Task Delete(long id)
+        //{
+        //    var entity = await _unitOfWork.Meeting.GetByIdAsync(id);
+        //    await _unitOfWork.Meeting.DeleteAsync(entity);
+        //}
+
+
+
+    }
+}

+ 54 - 0
MTWorkHR.Application/Services/User/TeamService.cs

@@ -0,0 +1,54 @@
+using Microsoft.AspNetCore.Identity;
+using Microsoft.AspNetCore.WebUtilities;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.Extensions.Configuration;
+using MTWorkHR.Application.Identity;
+using MTWorkHR.Application.Mapper;
+using MTWorkHR.Application.Models;
+using MTWorkHR.Core.Global;
+using MTWorkHR.Core.IRepositories;
+using MTWorkHR.Core.UnitOfWork;
+using MTWorkHR.Infrastructure.Entities;
+using MTWorkHR.Application.Services.Interfaces;
+using MTWorkHR.Core.Email;
+using MTWorkHR.Core.Entities;
+using MTWorkHR.Infrastructure.UnitOfWorks;
+
+namespace MTWorkHR.Application.Services
+{
+    public class TeamService : BaseService<Team, TeamDto, TeamDto>, ITeamService
+    {
+        private readonly IUnitOfWork _unitOfWork;
+        //private readonly AppSettingsConfiguration _configuration;
+        //private readonly GlobalInfo _globalInfo;
+
+        public TeamService(IUnitOfWork unitOfWork):base(unitOfWork)
+        {
+            _unitOfWork = unitOfWork;
+        }
+
+
+        public override async Task<TeamDto> GetById(long id)
+        {
+            var entity = await _unitOfWork.Team.GetByIdWithAllChildren(id);
+            var response = MapperObject.Mapper.Map<TeamDto>(entity);
+            return response;
+        }
+
+        //public override async Task<List<TeamDto>> GetAll()
+        //{
+        //    var Teams = await _unitOfWork.Team.GetAllAsync();
+        //    var response = MapperObject.Mapper.Map<List<TeamDto>>(Teams);
+        //    return response;
+        //}
+
+        //public override async Task Delete(long id)
+        //{
+        //    var entity = await _unitOfWork.Team.GetByIdAsync(id);
+        //    await _unitOfWork.Team.DeleteAsync(entity);
+        //}
+
+
+
+    }
+}

+ 1 - 1
MTWorkHR.Application/Services/User/UserService.cs

@@ -8,11 +8,11 @@ using MTWorkHR.Application.Models;
 using MTWorkHR.Core.Global;
 using MTWorkHR.Core.IRepositories;
 using MTWorkHR.Core.UnitOfWork;
-using MTWorkHR.Identity.Entities;
 using MTWorkHR.Application.Services.Interfaces;
 using MTWorkHR.Core.Email;
 using MTWorkHR.Core.Entities;
 using MTWorkHR.Infrastructure.UnitOfWorks;
+using MTWorkHR.Infrastructure.Entities;
 
 namespace MTWorkHR.Application.Services
 {

MTWorkHR.Core/Logging/AuthLog.cs → MTWorkHR.Core/Entities/Logging/AuthLog.cs


MTWorkHR.Core/Logging/FileLog.cs → MTWorkHR.Core/Entities/Logging/FileLog.cs


MTWorkHR.Core/Logging/IAppLogger.cs → MTWorkHR.Core/Entities/Logging/IAppLogger.cs


MTWorkHR.Core/Logging/Log.cs → MTWorkHR.Core/Entities/Logging/Log.cs


+ 39 - 0
MTWorkHR.Core/Entities/Logging/MeetingLog.cs

@@ -0,0 +1,39 @@
+using System;
+
+namespace MTWorkHR.Core.Entities
+{
+    public class MeetingLog : Log
+    {
+        public MeetingLog():base()
+        {
+
+        }
+        public MeetingLog(string Method
+            , string QueryString
+            , string Input
+            , DateTime CreateDate
+            , string CreateUser
+            , string ServerIP
+            , string Channel
+            , string UserIP
+            , string ServiceResponseTimeInSeconds
+            , string ErrorCode
+            , string ErrorDescription
+            , string InnerException
+            ) : base(Method
+                , QueryString
+                , Input
+                , CreateDate
+                , CreateUser
+                , ServerIP
+                , Channel
+                , UserIP
+                , ServiceResponseTimeInSeconds
+                , ErrorCode
+                , ErrorDescription
+                , InnerException)
+        {
+            //
+        }
+    }
+}

MTWorkHR.Core/Logging/RoleLog.cs → MTWorkHR.Core/Entities/Logging/RoleLog.cs


MTWorkHR.Core/Logging/SMSLog.cs → MTWorkHR.Core/Entities/Logging/SMSLog.cs


MTWorkHR.Core/Logging/SettingLog.cs → MTWorkHR.Core/Entities/Logging/SettingLog.cs


+ 39 - 0
MTWorkHR.Core/Entities/Logging/TeamLog.cs

@@ -0,0 +1,39 @@
+using System;
+
+namespace MTWorkHR.Core.Entities
+{
+    public class TeamLog : Log
+    {
+        public TeamLog():base()
+        {
+
+        }
+        public TeamLog(string Method
+            , string QueryString
+            , string Input
+            , DateTime CreateDate
+            , string CreateUser
+            , string ServerIP
+            , string Channel
+            , string UserIP
+            , string ServiceResponseTimeInSeconds
+            , string ErrorCode
+            , string ErrorDescription
+            , string InnerException
+            ) : base(Method
+                , QueryString
+                , Input
+                , CreateDate
+                , CreateUser
+                , ServerIP
+                , Channel
+                , UserIP
+                , ServiceResponseTimeInSeconds
+                , ErrorCode
+                , ErrorDescription
+                , InnerException)
+        {
+            //
+        }
+    }
+}

MTWorkHR.Core/Logging/UserLog.cs → MTWorkHR.Core/Entities/Logging/UserLog.cs


+ 39 - 0
MTWorkHR.Core/Entities/Logging/UserTaskLog.cs

@@ -0,0 +1,39 @@
+using System;
+
+namespace MTWorkHR.Core.Entities
+{
+    public class UserTaskLog : Log
+    {
+        public UserTaskLog():base()
+        {
+
+        }
+        public UserTaskLog(string Method
+            , string QueryString
+            , string Input
+            , DateTime CreateDate
+            , string CreateUser
+            , string ServerIP
+            , string Channel
+            , string UserIP
+            , string ServiceResponseTimeInSeconds
+            , string ErrorCode
+            , string ErrorDescription
+            , string InnerException
+            ) : base(Method
+                , QueryString
+                , Input
+                , CreateDate
+                , CreateUser
+                , ServerIP
+                , Channel
+                , UserIP
+                , ServiceResponseTimeInSeconds
+                , ErrorCode
+                , ErrorDescription
+                , InnerException)
+        {
+            //
+        }
+    }
+}

+ 26 - 0
MTWorkHR.Core/Entities/User/Meeting.cs

@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using MTWorkHR.Core.Entities.Base;
+
+namespace MTWorkHR.Core.Entities
+{
+    public class Meeting : FullAuditEntity
+    {
+        [Required]
+        [MaxLength(250)]
+        [Filter]
+        public string Title { get; set; }
+
+        [MaxLength(500)]
+        [Filter]
+        public string? Description { get; set; }
+        public DateTime MeetingDateTime { get; set; }
+        [MaxLength(250)]
+        public string? MeetingLink { get; set; }
+        public List<MeetingUser>? MeetingUsers{ get; set; }
+    }
+}

+ 21 - 0
MTWorkHR.Core/Entities/User/MeetingUser.cs

@@ -0,0 +1,21 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using MTWorkHR.Core.Entities.Base;
+
+namespace MTWorkHR.Core.Entities
+{
+    public class MeetingUser : AuditEntity
+    {
+
+        public long MeetingId { get; set; }
+        [ForeignKey("MeetingId")]
+        public Meeting? Meeting { get; set; }
+        [Required]
+        public string AssignedUserId { get; set; }
+    }
+}

MTWorkHR.Core/Entities/Auth/Permission.cs → MTWorkHR.Core/Entities/User/Permission.cs


+ 1 - 1
MTWorkHR.Core/Entities/User/Project.cs

@@ -8,7 +8,7 @@ using MTWorkHR.Core.Entities.Base;
 
 namespace MTWorkHR.Core.Entities
 {
-    public class Project : Entity
+    public class Project : FullAuditEntity
     {
         [Required]
         [MaxLength(250)]

+ 24 - 0
MTWorkHR.Core/Entities/User/Team.cs

@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using MTWorkHR.Core.Entities.Base;
+
+namespace MTWorkHR.Core.Entities
+{
+    public class Team : FullAuditEntity
+    {
+        [Required]
+        [MaxLength(250)]
+        [Filter]
+        public string NameAr { get; set; }
+        [Required]
+        [MaxLength(250)]
+        [Filter]
+        public string NameEn { get; set; }
+        public List<TeamUser>? TeamUsers { get; set; }
+
+    }
+}

+ 21 - 0
MTWorkHR.Core/Entities/User/TeamUser.cs

@@ -0,0 +1,21 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using MTWorkHR.Core.Entities.Base;
+
+namespace MTWorkHR.Core.Entities
+{
+    public class TeamUser : AuditEntity
+    {
+
+        public long TeamId{ get; set; }
+        [ForeignKey("TeamId")]
+        public Team? Team { get; set; }
+        [Required]
+        public string AssignedUserId { get; set; }
+    }
+}

+ 1 - 1
MTWorkHR.Core/Entities/User/UserTaskAttachment.cs

@@ -17,7 +17,7 @@ namespace MTWorkHR.Core.Entities
         public AttachmentType AttachmentType { get; set; }
 
         [MaxLength(250)]
-        public string FileName { get; set; }
+        public string? FileName { get; set; }
 
         [MaxLength(250)]
         public string OriginalName { get; set; }

+ 5 - 4
MTWorkHR.Core/Entities/User/UserTaskHistory.cs

@@ -14,13 +14,14 @@ namespace MTWorkHR.Core.Entities
     {
         public long AssignedToUserId { get; set; }
         [MaxLength(500)]
-        public string Comment { get; set; }
-        
+        public string? Comment { get; set; }
+        public long TaskId { get; set; }
+
         public long CurrentStatusId { get; set; }
 
         [ForeignKey("CurrentStatusId")]
-        public UserTaskStatus TaskStatus { get; set; }
-        public bool IsDeleted { get; set; }
+        public UserTaskStatus? TaskStatus { get; set; }
+        public bool IsDeleted { get; set; } = false;
 
     }
 }

MTWorkHR.Core/IRepositories/IProjectRepository.cs → MTWorkHR.Core/IRepositories/Task/IProjectRepository.cs


MTWorkHR.Core/IRepositories/ITaskStatusRepository.cs → MTWorkHR.Core/IRepositories/Task/ITaskStatusRepository.cs


+ 0 - 1
MTWorkHR.Core/IRepositories/IUserTaskAttachmentRepository.cs

@@ -1,7 +1,6 @@
 using MTWorkHR.Core.Entities;
 using MTWorkHR.Core.IDto;
 using MTWorkHR.Core.IRepositories.Base;
-
 using System;
 using System.Collections.Generic;
 using System.Linq;

MTWorkHR.Core/IRepositories/IUserTaskHistoryRepository.cs → MTWorkHR.Core/IRepositories/Task/IUserTaskHistoryRepository.cs


+ 0 - 6
MTWorkHR.Core/IRepositories/IUserTaskRepository.cs

@@ -1,11 +1,5 @@
 using MTWorkHR.Core.Entities;
-using MTWorkHR.Core.IDto;
 using MTWorkHR.Core.IRepositories.Base;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
 
 namespace MTWorkHR.Core.IRepositories
 {

+ 15 - 0
MTWorkHR.Core/IRepositories/User/IMeetingRepository.cs

@@ -0,0 +1,15 @@
+using MTWorkHR.Core.Entities;
+using MTWorkHR.Core.IRepositories.Base;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace MTWorkHR.Core.IRepositories
+{
+    public interface IMeetingRepository : IRepository<Meeting>
+    {
+        Task<Meeting> GetByIdWithAllChildren(long id);
+    }
+}

+ 16 - 0
MTWorkHR.Core/IRepositories/User/ITeamRepository.cs

@@ -0,0 +1,16 @@
+using MTWorkHR.Core.Entities;
+using MTWorkHR.Core.IRepositories.Base;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace MTWorkHR.Core.IRepositories
+{
+    public interface ITeamRepository : IRepository<Team>
+    {
+        Task<Team> GetByIdWithAllChildren(long id);
+
+    }
+}

+ 3 - 1
MTWorkHR.Core/IUnitOfWork/IUnitOfWork.cs

@@ -11,10 +11,12 @@ namespace MTWorkHR.Core.UnitOfWork
         IPermissionRepository Permission { get; }
         IProjectRepository Project { get; }
         IUserTaskRepository UserTask { get; }
-      //  IUserTaskAttachmentRepository UserTaskAttachment { get; }
+        IUserTaskAttachmentRepository UserTaskAttachment { get; }
         ITaskStatusRepository UserTaskStatus { get; }
         IUserTaskHistoryRepository UserTaskHistory { get; }
         ICompanyRepository Company { get; }
+        ITeamRepository Team{ get; }
+        IMeetingRepository Meeting{ get; }
         Task<int> CompleteAsync();
 
         void BeginTran();

+ 1 - 0
MTWorkHR.Core/IUnitOfWork/IUnitOfWorkLog.cs

@@ -13,6 +13,7 @@ namespace MTWorkHR.Core.UnitOfWork
         IRepositoryLog<AuthLog> AuthLog { get; }
         IRepositoryLog<FileLog> FileLog { get; }
         IRepositoryLog<RoleLog> RoleLog { get; }
+        IRepositoryLog<UserTaskLog> UserTaskLog { get; }
 
 
 		Task<int> CompleteAsync();

+ 0 - 16
MTWorkHR.Identity/Entities/JwtSettings.cs

@@ -1,16 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace MTWorkHR.Identity.Entities
-{
-    public class JwtSettingsxxx
-    {
-        public string Key { get; set; }
-        public string Issuer { get; set; }
-        public string Audience{ get; set; }
-        public double DurationInMinutes { get; set; }
-    }
-}

+ 0 - 17
MTWorkHR.Identity/Entities/Permission.cs

@@ -1,17 +0,0 @@
-using MTWorkHR.Core.Entities.Base;
-using System.ComponentModel.DataAnnotations;
-
-namespace MTWorkHR.Identity.Entities
-{
-    public class Permission : Entity
-    {
-        [MaxLength(250)]
-        public string Name { get; set; }
-        [MaxLength(150)]
-        public string CategoryName { get; set; }
-
-        [MaxLength(250)]
-        public string Desc { get; set; }
-        public bool Show { get; set; }
-    }
-}

+ 0 - 51
MTWorkHR.Identity/IdentityServiceRegistration.cs

@@ -1,51 +0,0 @@
-using Microsoft.AspNetCore.Authentication.JwtBearer;
-using Microsoft.AspNetCore.Identity;
-using Microsoft.EntityFrameworkCore;
-using Microsoft.Extensions.Configuration;
-using Microsoft.Extensions.DependencyInjection;
-using Microsoft.IdentityModel.Tokens;
-using MTWorkHR.Core.Global;
-using MTWorkHR.Identity.DBContext;
-using MTWorkHR.Identity.Entities;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace MTWorkHR.Identity
-{
-    public static class IdentityServiceRegistration
-    {
-        public static IServiceCollection AddIdentityServices(this IServiceCollection services, AppSettingsConfiguration config)
-        {
-            services.AddSingleton(config);
-
-            var vv = config.ConnectionStrings.MTWorkHRConnectionString;
-            services.AddDbContext<HRIdentityDBContext>(options =>
-                options.UseSqlServer(
-                    config.ConnectionStrings.MTWorkHRConnectionString  //configuration.GetSection("ConnectionString:MTWorkHRConnectionString").Value
-                    ));
-           
-            services.AddIdentity<ApplicationUser, ApplicationRole>().AddEntityFrameworkStores<HRIdentityDBContext>().AddDefaultTokenProviders();
-
-           
-            services.AddAuthentication(options => {
-                 options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme; // "bearer"
-                 options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;
-
-            }).AddJwtBearer(o=> o.TokenValidationParameters = new TokenValidationParameters 
-                {
-                    ValidateIssuerSigningKey = true,
-                    ValidateIssuer = true,
-                    ValidateAudience = true,
-                    ValidateLifetime = true,
-                    ClockSkew = TimeSpan.Zero,
-                    ValidIssuer = config.JwtSettings.Issuer,
-                    ValidAudience = config.JwtSettings.Audience,
-                    IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(config.JwtSettings.SecretKey))
-                }) ;
-            return services;
-        }
-    }
-}

+ 0 - 533
MTWorkHR.Identity/Migrations/20240128145047_InitialCreate.Designer.cs

@@ -1,533 +0,0 @@
-// <auto-generated />
-using System;
-using MTWorkHR.Identity.DBContext;
-using Microsoft.EntityFrameworkCore;
-using Microsoft.EntityFrameworkCore.Infrastructure;
-using Microsoft.EntityFrameworkCore.Metadata;
-using Microsoft.EntityFrameworkCore.Migrations;
-using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
-
-#nullable disable
-
-namespace MTWorkHR.Identity.Migrations
-{
-    [DbContext(typeof(HRIdentityDBContext))]
-    [Migration("20240128145047_InitialCreate")]
-    partial class InitialCreate
-    {
-        /// <inheritdoc />
-        protected override void BuildTargetModel(ModelBuilder modelBuilder)
-        {
-#pragma warning disable 612, 618
-            modelBuilder
-                .HasAnnotation("ProductVersion", "8.0.1")
-                .HasAnnotation("Relational:MaxIdentifierLength", 128);
-
-            SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
-
-            modelBuilder.Entity("ApplicationRoleApplicationUser", b =>
-                {
-                    b.Property<string>("UserRolesId")
-                        .HasColumnType("nvarchar(450)");
-
-                    b.Property<string>("UsersId")
-                        .HasColumnType("nvarchar(450)");
-
-                    b.HasKey("UserRolesId", "UsersId");
-
-                    b.HasIndex("UsersId");
-
-                    b.ToTable("ApplicationRoleApplicationUser");
-                });
-
-            modelBuilder.Entity("MTWorkHR.Identity.Entities.ApplicationRole", b =>
-                {
-                    b.Property<string>("Id")
-                        .HasColumnType("nvarchar(450)");
-
-                    b.Property<string>("ConcurrencyStamp")
-                        .IsConcurrencyToken()
-                        .HasColumnType("nvarchar(max)");
-
-                    b.Property<DateTime>("CreateDate")
-                        .HasColumnType("datetime2");
-
-                    b.Property<string>("CreateUser")
-                        .HasColumnType("nvarchar(max)");
-
-                    b.Property<string>("DeleteUserId")
-                        .HasColumnType("nvarchar(max)");
-
-                    b.Property<bool?>("IsAdmin")
-                        .HasColumnType("bit");
-
-                    b.Property<bool>("IsDeleted")
-                        .HasColumnType("bit");
-
-                    b.Property<string>("Name")
-                        .HasMaxLength(256)
-                        .HasColumnType("nvarchar(256)");
-
-                    b.Property<string>("NormalizedName")
-                        .HasMaxLength(256)
-                        .HasColumnType("nvarchar(256)");
-
-                    b.Property<DateTime?>("UpdateDate")
-                        .HasColumnType("datetime2");
-
-                    b.Property<string>("UpdateUser")
-                        .HasColumnType("nvarchar(max)");
-
-                    b.HasKey("Id");
-
-                    b.HasIndex("NormalizedName")
-                        .IsUnique()
-                        .HasDatabaseName("RoleNameIndex")
-                        .HasFilter("[NormalizedName] IS NOT NULL");
-
-                    b.ToTable("AspNetRoles", (string)null);
-
-                    b.HasData(
-                        new
-                        {
-                            Id = "AD5B3B92-2311-48F8-9DEC-F9FAEF1F211A",
-                            CreateDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
-                            IsAdmin = true,
-                            IsDeleted = false,
-                            Name = "Admin",
-                            NormalizedName = "ADMIN"
-                        },
-                        new
-                        {
-                            Id = "EM5B3B92-2311-48F8-9DEC-F9FAEF1F211E",
-                            CreateDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
-                            IsAdmin = false,
-                            IsDeleted = false,
-                            Name = "Employee",
-                            NormalizedName = "EMPLOYEE"
-                        });
-                });
-
-            modelBuilder.Entity("MTWorkHR.Identity.Entities.ApplicationUser", b =>
-                {
-                    b.Property<string>("Id")
-                        .HasColumnType("nvarchar(450)");
-
-                    b.Property<int>("AccessFailedCount")
-                        .HasColumnType("int");
-
-                    b.Property<string>("ConcurrencyStamp")
-                        .IsConcurrencyToken()
-                        .HasColumnType("nvarchar(max)");
-
-                    b.Property<string>("CreateUser")
-                        .HasColumnType("nvarchar(max)");
-
-                    b.Property<string>("DeleteUserId")
-                        .HasColumnType("nvarchar(max)");
-
-                    b.Property<string>("Email")
-                        .HasMaxLength(256)
-                        .HasColumnType("nvarchar(256)");
-
-                    b.Property<bool>("EmailConfirmed")
-                        .HasColumnType("bit");
-
-                    b.Property<string>("FirstName")
-                        .IsRequired()
-                        .HasColumnType("nvarchar(max)");
-
-                    b.Property<bool>("IsDeleted")
-                        .HasColumnType("bit");
-
-                    b.Property<bool>("IsStopped")
-                        .HasColumnType("bit");
-
-                    b.Property<string>("LastName")
-                        .IsRequired()
-                        .HasColumnType("nvarchar(max)");
-
-                    b.Property<bool>("LockoutEnabled")
-                        .HasColumnType("bit");
-
-                    b.Property<DateTimeOffset?>("LockoutEnd")
-                        .HasColumnType("datetimeoffset");
-
-                    b.Property<string>("ManagerId")
-                        .HasColumnType("nvarchar(450)");
-
-                    b.Property<string>("NormalizedEmail")
-                        .HasMaxLength(256)
-                        .HasColumnType("nvarchar(256)");
-
-                    b.Property<string>("NormalizedUserName")
-                        .HasMaxLength(256)
-                        .HasColumnType("nvarchar(256)");
-
-                    b.Property<string>("PasswordHash")
-                        .HasColumnType("nvarchar(max)");
-
-                    b.Property<string>("PhoneNumber")
-                        .HasColumnType("nvarchar(max)");
-
-                    b.Property<bool>("PhoneNumberConfirmed")
-                        .HasColumnType("bit");
-
-                    b.Property<string>("SecurityStamp")
-                        .HasColumnType("nvarchar(max)");
-
-                    b.Property<bool>("TwoFactorEnabled")
-                        .HasColumnType("bit");
-
-                    b.Property<string>("UpdateUser")
-                        .HasColumnType("nvarchar(max)");
-
-                    b.Property<string>("UserName")
-                        .HasMaxLength(256)
-                        .HasColumnType("nvarchar(256)");
-
-                    b.Property<int>("UserType")
-                        .HasColumnType("int");
-
-                    b.HasKey("Id");
-
-                    b.HasIndex("ManagerId");
-
-                    b.HasIndex("NormalizedEmail")
-                        .HasDatabaseName("EmailIndex");
-
-                    b.HasIndex("NormalizedUserName")
-                        .IsUnique()
-                        .HasDatabaseName("UserNameIndex")
-                        .HasFilter("[NormalizedUserName] IS NOT NULL");
-
-                    b.ToTable("AspNetUsers", (string)null);
-
-                    b.HasData(
-                        new
-                        {
-                            Id = "ADMB3B92-2311-48F8-9DEC-F9FAEF1F21UA",
-                            AccessFailedCount = 0,
-                            ConcurrencyStamp = "7cc87689-9eab-4280-b8e3-1834080783a5",
-                            Email = "a@b.com",
-                            EmailConfirmed = true,
-                            FirstName = "Zinab",
-                            IsDeleted = false,
-                            IsStopped = false,
-                            LastName = "Elgendy",
-                            LockoutEnabled = false,
-                            NormalizedEmail = "A@B.COM",
-                            NormalizedUserName = "ADMIN",
-                            PasswordHash = "AQAAAAIAAYagAAAAEPg+ASbciPFxtyxQq8Wx5ilBUQ0RbAoITXXkOQm1PzC5BzySX0sn/wUmOjBKPDGV9w==",
-                            PhoneNumber = "1234567890",
-                            PhoneNumberConfirmed = true,
-                            SecurityStamp = "49bb16c3-4704-4c60-908d-dc8506950acc",
-                            TwoFactorEnabled = false,
-                            UserName = "Admin",
-                            UserType = 1
-                        },
-                        new
-                        {
-                            Id = "AL5B3B92-2311-48F8-9DEC-F9FAEF1F21UB",
-                            AccessFailedCount = 0,
-                            ConcurrencyStamp = "4af7b4cf-802a-455b-b598-997e167745b3",
-                            Email = "ali@b.com",
-                            EmailConfirmed = true,
-                            FirstName = "Ali",
-                            IsDeleted = false,
-                            IsStopped = false,
-                            LastName = "Farok",
-                            LockoutEnabled = false,
-                            NormalizedEmail = "ALI@B.COM",
-                            NormalizedUserName = "ALI",
-                            PasswordHash = "AQAAAAIAAYagAAAAEI3QJkcZjCH4Y8Db4rEgL8Mmll5oCvYcWiXZjQSN9bGW4SMcjHe3ZPMnkN/l9DmJeQ==",
-                            PhoneNumber = "1234567890",
-                            PhoneNumberConfirmed = true,
-                            SecurityStamp = "62549056-1b9d-46d4-84f8-adea3e4d8b68",
-                            TwoFactorEnabled = false,
-                            UserName = "ali",
-                            UserType = 1
-                        });
-                });
-
-            modelBuilder.Entity("MTWorkHR.Identity.Entities.Permission", b =>
-                {
-                    b.Property<long>("Id")
-                        .ValueGeneratedOnAdd()
-                        .HasColumnType("bigint")
-                        .HasColumnOrder(0);
-
-                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));
-
-                    b.Property<string>("CategoryName")
-                        .IsRequired()
-                        .HasMaxLength(150)
-                        .HasColumnType("nvarchar(150)");
-
-                    b.Property<string>("Desc")
-                        .IsRequired()
-                        .HasMaxLength(250)
-                        .HasColumnType("nvarchar(250)");
-
-                    b.Property<string>("Name")
-                        .IsRequired()
-                        .HasMaxLength(250)
-                        .HasColumnType("nvarchar(250)");
-
-                    b.Property<bool>("Show")
-                        .HasColumnType("bit");
-
-                    b.HasKey("Id");
-
-                    b.ToTable("Permissions");
-                });
-
-            modelBuilder.Entity("MTWorkHR.Identity.Entities.RolePermission", b =>
-                {
-                    b.Property<long>("Id")
-                        .ValueGeneratedOnAdd()
-                        .HasColumnType("bigint")
-                        .HasColumnOrder(0);
-
-                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));
-
-                    b.Property<long>("PermissionId")
-                        .HasColumnType("bigint");
-
-                    b.Property<string>("PermissionName")
-                        .IsRequired()
-                        .HasColumnType("nvarchar(max)");
-
-                    b.Property<string>("RoleId")
-                        .IsRequired()
-                        .HasColumnType("nvarchar(450)");
-
-                    b.HasKey("Id");
-
-                    b.HasIndex("PermissionId");
-
-                    b.HasIndex("RoleId");
-
-                    b.ToTable("RolePermissions");
-                });
-
-            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
-                {
-                    b.Property<int>("Id")
-                        .ValueGeneratedOnAdd()
-                        .HasColumnType("int");
-
-                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
-
-                    b.Property<string>("ClaimType")
-                        .HasColumnType("nvarchar(max)");
-
-                    b.Property<string>("ClaimValue")
-                        .HasColumnType("nvarchar(max)");
-
-                    b.Property<string>("RoleId")
-                        .IsRequired()
-                        .HasColumnType("nvarchar(450)");
-
-                    b.HasKey("Id");
-
-                    b.HasIndex("RoleId");
-
-                    b.ToTable("AspNetRoleClaims", (string)null);
-                });
-
-            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
-                {
-                    b.Property<int>("Id")
-                        .ValueGeneratedOnAdd()
-                        .HasColumnType("int");
-
-                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
-
-                    b.Property<string>("ClaimType")
-                        .HasColumnType("nvarchar(max)");
-
-                    b.Property<string>("ClaimValue")
-                        .HasColumnType("nvarchar(max)");
-
-                    b.Property<string>("UserId")
-                        .IsRequired()
-                        .HasColumnType("nvarchar(450)");
-
-                    b.HasKey("Id");
-
-                    b.HasIndex("UserId");
-
-                    b.ToTable("AspNetUserClaims", (string)null);
-                });
-
-            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
-                {
-                    b.Property<string>("LoginProvider")
-                        .HasColumnType("nvarchar(450)");
-
-                    b.Property<string>("ProviderKey")
-                        .HasColumnType("nvarchar(450)");
-
-                    b.Property<string>("ProviderDisplayName")
-                        .HasColumnType("nvarchar(max)");
-
-                    b.Property<string>("UserId")
-                        .IsRequired()
-                        .HasColumnType("nvarchar(450)");
-
-                    b.HasKey("LoginProvider", "ProviderKey");
-
-                    b.HasIndex("UserId");
-
-                    b.ToTable("AspNetUserLogins", (string)null);
-                });
-
-            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
-                {
-                    b.Property<string>("UserId")
-                        .HasColumnType("nvarchar(450)");
-
-                    b.Property<string>("RoleId")
-                        .HasColumnType("nvarchar(450)");
-
-                    b.HasKey("UserId", "RoleId");
-
-                    b.HasIndex("RoleId");
-
-                    b.ToTable("AspNetUserRoles", (string)null);
-
-                    b.HasData(
-                        new
-                        {
-                            UserId = "ADMB3B92-2311-48F8-9DEC-F9FAEF1F21UA",
-                            RoleId = "AD5B3B92-2311-48F8-9DEC-F9FAEF1F211A"
-                        },
-                        new
-                        {
-                            UserId = "AL5B3B92-2311-48F8-9DEC-F9FAEF1F21UB",
-                            RoleId = "EM5B3B92-2311-48F8-9DEC-F9FAEF1F211E"
-                        });
-                });
-
-            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
-                {
-                    b.Property<string>("UserId")
-                        .HasColumnType("nvarchar(450)");
-
-                    b.Property<string>("LoginProvider")
-                        .HasColumnType("nvarchar(450)");
-
-                    b.Property<string>("Name")
-                        .HasColumnType("nvarchar(450)");
-
-                    b.Property<string>("Value")
-                        .HasColumnType("nvarchar(max)");
-
-                    b.HasKey("UserId", "LoginProvider", "Name");
-
-                    b.ToTable("AspNetUserTokens", (string)null);
-                });
-
-            modelBuilder.Entity("ApplicationRoleApplicationUser", b =>
-                {
-                    b.HasOne("MTWorkHR.Identity.Entities.ApplicationRole", null)
-                        .WithMany()
-                        .HasForeignKey("UserRolesId")
-                        .OnDelete(DeleteBehavior.Cascade)
-                        .IsRequired();
-
-                    b.HasOne("MTWorkHR.Identity.Entities.ApplicationUser", null)
-                        .WithMany()
-                        .HasForeignKey("UsersId")
-                        .OnDelete(DeleteBehavior.Cascade)
-                        .IsRequired();
-                });
-
-            modelBuilder.Entity("MTWorkHR.Identity.Entities.ApplicationUser", b =>
-                {
-                    b.HasOne("MTWorkHR.Identity.Entities.ApplicationUser", "Manager")
-                        .WithMany()
-                        .HasForeignKey("ManagerId");
-
-                    b.Navigation("Manager");
-                });
-
-            modelBuilder.Entity("MTWorkHR.Identity.Entities.RolePermission", b =>
-                {
-                    b.HasOne("MTWorkHR.Identity.Entities.Permission", "Permission")
-                        .WithMany()
-                        .HasForeignKey("PermissionId")
-                        .OnDelete(DeleteBehavior.Cascade)
-                        .IsRequired();
-
-                    b.HasOne("MTWorkHR.Identity.Entities.ApplicationRole", "Role")
-                        .WithMany("RolePermissions")
-                        .HasForeignKey("RoleId")
-                        .OnDelete(DeleteBehavior.Cascade)
-                        .IsRequired();
-
-                    b.Navigation("Permission");
-
-                    b.Navigation("Role");
-                });
-
-            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
-                {
-                    b.HasOne("MTWorkHR.Identity.Entities.ApplicationRole", null)
-                        .WithMany()
-                        .HasForeignKey("RoleId")
-                        .OnDelete(DeleteBehavior.Cascade)
-                        .IsRequired();
-                });
-
-            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
-                {
-                    b.HasOne("MTWorkHR.Identity.Entities.ApplicationUser", null)
-                        .WithMany()
-                        .HasForeignKey("UserId")
-                        .OnDelete(DeleteBehavior.Cascade)
-                        .IsRequired();
-                });
-
-            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
-                {
-                    b.HasOne("MTWorkHR.Identity.Entities.ApplicationUser", null)
-                        .WithMany()
-                        .HasForeignKey("UserId")
-                        .OnDelete(DeleteBehavior.Cascade)
-                        .IsRequired();
-                });
-
-            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
-                {
-                    b.HasOne("MTWorkHR.Identity.Entities.ApplicationRole", null)
-                        .WithMany()
-                        .HasForeignKey("RoleId")
-                        .OnDelete(DeleteBehavior.Cascade)
-                        .IsRequired();
-
-                    b.HasOne("MTWorkHR.Identity.Entities.ApplicationUser", null)
-                        .WithMany()
-                        .HasForeignKey("UserId")
-                        .OnDelete(DeleteBehavior.Cascade)
-                        .IsRequired();
-                });
-
-            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
-                {
-                    b.HasOne("MTWorkHR.Identity.Entities.ApplicationUser", null)
-                        .WithMany()
-                        .HasForeignKey("UserId")
-                        .OnDelete(DeleteBehavior.Cascade)
-                        .IsRequired();
-                });
-
-            modelBuilder.Entity("MTWorkHR.Identity.Entities.ApplicationRole", b =>
-                {
-                    b.Navigation("RolePermissions");
-                });
-#pragma warning restore 612, 618
-        }
-    }
-}

+ 0 - 370
MTWorkHR.Identity/Migrations/20240128145047_InitialCreate.cs

@@ -1,370 +0,0 @@
-using System;
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
-
-namespace MTWorkHR.Identity.Migrations
-{
-    /// <inheritdoc />
-    public partial class InitialCreate : Migration
-    {
-        /// <inheritdoc />
-        protected override void Up(MigrationBuilder migrationBuilder)
-        {
-            migrationBuilder.CreateTable(
-                name: "AspNetRoles",
-                columns: table => new
-                {
-                    Id = table.Column<string>(type: "nvarchar(450)", nullable: false),
-                    CreateUser = table.Column<string>(type: "nvarchar(max)", nullable: true),
-                    UpdateUser = table.Column<string>(type: "nvarchar(max)", nullable: true),
-                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
-                    UpdateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
-                    IsDeleted = table.Column<bool>(type: "bit", nullable: false),
-                    DeleteUserId = table.Column<string>(type: "nvarchar(max)", nullable: true),
-                    IsAdmin = table.Column<bool>(type: "bit", nullable: true),
-                    Name = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
-                    NormalizedName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
-                    ConcurrencyStamp = table.Column<string>(type: "nvarchar(max)", nullable: true)
-                },
-                constraints: table =>
-                {
-                    table.PrimaryKey("PK_AspNetRoles", x => x.Id);
-                });
-
-            migrationBuilder.CreateTable(
-                name: "AspNetUsers",
-                columns: table => new
-                {
-                    Id = table.Column<string>(type: "nvarchar(450)", nullable: false),
-                    FirstName = table.Column<string>(type: "nvarchar(max)", nullable: false),
-                    LastName = table.Column<string>(type: "nvarchar(max)", nullable: false),
-                    UserType = table.Column<int>(type: "int", nullable: false),
-                    ManagerId = table.Column<string>(type: "nvarchar(450)", nullable: true),
-                    CreateUser = table.Column<string>(type: "nvarchar(max)", nullable: true),
-                    UpdateUser = table.Column<string>(type: "nvarchar(max)", nullable: true),
-                    IsStopped = table.Column<bool>(type: "bit", nullable: false),
-                    IsDeleted = table.Column<bool>(type: "bit", nullable: false),
-                    DeleteUserId = table.Column<string>(type: "nvarchar(max)", nullable: true),
-                    UserName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
-                    NormalizedUserName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
-                    Email = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
-                    NormalizedEmail = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
-                    EmailConfirmed = table.Column<bool>(type: "bit", nullable: false),
-                    PasswordHash = table.Column<string>(type: "nvarchar(max)", nullable: true),
-                    SecurityStamp = table.Column<string>(type: "nvarchar(max)", nullable: true),
-                    ConcurrencyStamp = table.Column<string>(type: "nvarchar(max)", nullable: true),
-                    PhoneNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
-                    PhoneNumberConfirmed = table.Column<bool>(type: "bit", nullable: false),
-                    TwoFactorEnabled = table.Column<bool>(type: "bit", nullable: false),
-                    LockoutEnd = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true),
-                    LockoutEnabled = table.Column<bool>(type: "bit", nullable: false),
-                    AccessFailedCount = table.Column<int>(type: "int", nullable: false)
-                },
-                constraints: table =>
-                {
-                    table.PrimaryKey("PK_AspNetUsers", x => x.Id);
-                    table.ForeignKey(
-                        name: "FK_AspNetUsers_AspNetUsers_ManagerId",
-                        column: x => x.ManagerId,
-                        principalTable: "AspNetUsers",
-                        principalColumn: "Id");
-                });
-
-            migrationBuilder.CreateTable(
-                name: "Permissions",
-                columns: table => new
-                {
-                    Id = table.Column<long>(type: "bigint", nullable: false)
-                        .Annotation("SqlServer:Identity", "1, 1"),
-                    Name = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: false),
-                    CategoryName = table.Column<string>(type: "nvarchar(150)", maxLength: 150, nullable: false),
-                    Desc = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: false),
-                    Show = table.Column<bool>(type: "bit", nullable: false)
-                },
-                constraints: table =>
-                {
-                    table.PrimaryKey("PK_Permissions", x => x.Id);
-                });
-
-            migrationBuilder.CreateTable(
-                name: "AspNetRoleClaims",
-                columns: table => new
-                {
-                    Id = table.Column<int>(type: "int", nullable: false)
-                        .Annotation("SqlServer:Identity", "1, 1"),
-                    RoleId = table.Column<string>(type: "nvarchar(450)", nullable: false),
-                    ClaimType = table.Column<string>(type: "nvarchar(max)", nullable: true),
-                    ClaimValue = table.Column<string>(type: "nvarchar(max)", nullable: true)
-                },
-                constraints: table =>
-                {
-                    table.PrimaryKey("PK_AspNetRoleClaims", x => x.Id);
-                    table.ForeignKey(
-                        name: "FK_AspNetRoleClaims_AspNetRoles_RoleId",
-                        column: x => x.RoleId,
-                        principalTable: "AspNetRoles",
-                        principalColumn: "Id",
-                        onDelete: ReferentialAction.Cascade);
-                });
-
-            migrationBuilder.CreateTable(
-                name: "ApplicationRoleApplicationUser",
-                columns: table => new
-                {
-                    UserRolesId = table.Column<string>(type: "nvarchar(450)", nullable: false),
-                    UsersId = table.Column<string>(type: "nvarchar(450)", nullable: false)
-                },
-                constraints: table =>
-                {
-                    table.PrimaryKey("PK_ApplicationRoleApplicationUser", x => new { x.UserRolesId, x.UsersId });
-                    table.ForeignKey(
-                        name: "FK_ApplicationRoleApplicationUser_AspNetRoles_UserRolesId",
-                        column: x => x.UserRolesId,
-                        principalTable: "AspNetRoles",
-                        principalColumn: "Id",
-                        onDelete: ReferentialAction.Cascade);
-                    table.ForeignKey(
-                        name: "FK_ApplicationRoleApplicationUser_AspNetUsers_UsersId",
-                        column: x => x.UsersId,
-                        principalTable: "AspNetUsers",
-                        principalColumn: "Id",
-                        onDelete: ReferentialAction.Cascade);
-                });
-
-            migrationBuilder.CreateTable(
-                name: "AspNetUserClaims",
-                columns: table => new
-                {
-                    Id = table.Column<int>(type: "int", nullable: false)
-                        .Annotation("SqlServer:Identity", "1, 1"),
-                    UserId = table.Column<string>(type: "nvarchar(450)", nullable: false),
-                    ClaimType = table.Column<string>(type: "nvarchar(max)", nullable: true),
-                    ClaimValue = table.Column<string>(type: "nvarchar(max)", nullable: true)
-                },
-                constraints: table =>
-                {
-                    table.PrimaryKey("PK_AspNetUserClaims", x => x.Id);
-                    table.ForeignKey(
-                        name: "FK_AspNetUserClaims_AspNetUsers_UserId",
-                        column: x => x.UserId,
-                        principalTable: "AspNetUsers",
-                        principalColumn: "Id",
-                        onDelete: ReferentialAction.Cascade);
-                });
-
-            migrationBuilder.CreateTable(
-                name: "AspNetUserLogins",
-                columns: table => new
-                {
-                    LoginProvider = table.Column<string>(type: "nvarchar(450)", nullable: false),
-                    ProviderKey = table.Column<string>(type: "nvarchar(450)", nullable: false),
-                    ProviderDisplayName = table.Column<string>(type: "nvarchar(max)", nullable: true),
-                    UserId = table.Column<string>(type: "nvarchar(450)", nullable: false)
-                },
-                constraints: table =>
-                {
-                    table.PrimaryKey("PK_AspNetUserLogins", x => new { x.LoginProvider, x.ProviderKey });
-                    table.ForeignKey(
-                        name: "FK_AspNetUserLogins_AspNetUsers_UserId",
-                        column: x => x.UserId,
-                        principalTable: "AspNetUsers",
-                        principalColumn: "Id",
-                        onDelete: ReferentialAction.Cascade);
-                });
-
-            migrationBuilder.CreateTable(
-                name: "AspNetUserRoles",
-                columns: table => new
-                {
-                    UserId = table.Column<string>(type: "nvarchar(450)", nullable: false),
-                    RoleId = table.Column<string>(type: "nvarchar(450)", nullable: false)
-                },
-                constraints: table =>
-                {
-                    table.PrimaryKey("PK_AspNetUserRoles", x => new { x.UserId, x.RoleId });
-                    table.ForeignKey(
-                        name: "FK_AspNetUserRoles_AspNetRoles_RoleId",
-                        column: x => x.RoleId,
-                        principalTable: "AspNetRoles",
-                        principalColumn: "Id",
-                        onDelete: ReferentialAction.Cascade);
-                    table.ForeignKey(
-                        name: "FK_AspNetUserRoles_AspNetUsers_UserId",
-                        column: x => x.UserId,
-                        principalTable: "AspNetUsers",
-                        principalColumn: "Id",
-                        onDelete: ReferentialAction.Cascade);
-                });
-
-            migrationBuilder.CreateTable(
-                name: "AspNetUserTokens",
-                columns: table => new
-                {
-                    UserId = table.Column<string>(type: "nvarchar(450)", nullable: false),
-                    LoginProvider = table.Column<string>(type: "nvarchar(450)", nullable: false),
-                    Name = table.Column<string>(type: "nvarchar(450)", nullable: false),
-                    Value = table.Column<string>(type: "nvarchar(max)", nullable: true)
-                },
-                constraints: table =>
-                {
-                    table.PrimaryKey("PK_AspNetUserTokens", x => new { x.UserId, x.LoginProvider, x.Name });
-                    table.ForeignKey(
-                        name: "FK_AspNetUserTokens_AspNetUsers_UserId",
-                        column: x => x.UserId,
-                        principalTable: "AspNetUsers",
-                        principalColumn: "Id",
-                        onDelete: ReferentialAction.Cascade);
-                });
-
-            migrationBuilder.CreateTable(
-                name: "RolePermissions",
-                columns: table => new
-                {
-                    Id = table.Column<long>(type: "bigint", nullable: false)
-                        .Annotation("SqlServer:Identity", "1, 1"),
-                    RoleId = table.Column<string>(type: "nvarchar(450)", nullable: false),
-                    PermissionId = table.Column<long>(type: "bigint", nullable: false),
-                    PermissionName = table.Column<string>(type: "nvarchar(max)", nullable: false)
-                },
-                constraints: table =>
-                {
-                    table.PrimaryKey("PK_RolePermissions", x => x.Id);
-                    table.ForeignKey(
-                        name: "FK_RolePermissions_AspNetRoles_RoleId",
-                        column: x => x.RoleId,
-                        principalTable: "AspNetRoles",
-                        principalColumn: "Id",
-                        onDelete: ReferentialAction.Cascade);
-                    table.ForeignKey(
-                        name: "FK_RolePermissions_Permissions_PermissionId",
-                        column: x => x.PermissionId,
-                        principalTable: "Permissions",
-                        principalColumn: "Id",
-                        onDelete: ReferentialAction.Cascade);
-                });
-
-            migrationBuilder.InsertData(
-                table: "AspNetRoles",
-                columns: new[] { "Id", "ConcurrencyStamp", "CreateDate", "CreateUser", "DeleteUserId", "IsAdmin", "IsDeleted", "Name", "NormalizedName", "UpdateDate", "UpdateUser" },
-                values: new object[,]
-                {
-                    { "AD5B3B92-2311-48F8-9DEC-F9FAEF1F211A", null, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), null, null, true, false, "Admin", "ADMIN", null, null },
-                    { "EM5B3B92-2311-48F8-9DEC-F9FAEF1F211E", null, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), null, null, false, false, "Employee", "EMPLOYEE", null, null }
-                });
-
-            migrationBuilder.InsertData(
-                table: "AspNetUsers",
-                columns: new[] { "Id", "AccessFailedCount", "ConcurrencyStamp", "CreateUser", "DeleteUserId", "Email", "EmailConfirmed", "FirstName", "IsDeleted", "IsStopped", "LastName", "LockoutEnabled", "LockoutEnd", "ManagerId", "NormalizedEmail", "NormalizedUserName", "PasswordHash", "PhoneNumber", "PhoneNumberConfirmed", "SecurityStamp", "TwoFactorEnabled", "UpdateUser", "UserName", "UserType" },
-                values: new object[,]
-                {
-                    { "ADMB3B92-2311-48F8-9DEC-F9FAEF1F21UA", 0, "7cc87689-9eab-4280-b8e3-1834080783a5", null, null, "a@b.com", true, "Zinab", false, false, "Elgendy", false, null, null, "A@B.COM", "ADMIN", "AQAAAAIAAYagAAAAEPg+ASbciPFxtyxQq8Wx5ilBUQ0RbAoITXXkOQm1PzC5BzySX0sn/wUmOjBKPDGV9w==", "1234567890", true, "49bb16c3-4704-4c60-908d-dc8506950acc", false, null, "Admin", 1 },
-                    { "AL5B3B92-2311-48F8-9DEC-F9FAEF1F21UB", 0, "4af7b4cf-802a-455b-b598-997e167745b3", null, null, "ali@b.com", true, "Ali", false, false, "Farok", false, null, null, "ALI@B.COM", "ALI", "AQAAAAIAAYagAAAAEI3QJkcZjCH4Y8Db4rEgL8Mmll5oCvYcWiXZjQSN9bGW4SMcjHe3ZPMnkN/l9DmJeQ==", "1234567890", true, "62549056-1b9d-46d4-84f8-adea3e4d8b68", false, null, "ali", 1 }
-                });
-
-            migrationBuilder.InsertData(
-                table: "AspNetUserRoles",
-                columns: new[] { "RoleId", "UserId" },
-                values: new object[,]
-                {
-                    { "AD5B3B92-2311-48F8-9DEC-F9FAEF1F211A", "ADMB3B92-2311-48F8-9DEC-F9FAEF1F21UA" },
-                    { "EM5B3B92-2311-48F8-9DEC-F9FAEF1F211E", "AL5B3B92-2311-48F8-9DEC-F9FAEF1F21UB" }
-                });
-
-            migrationBuilder.CreateIndex(
-                name: "IX_ApplicationRoleApplicationUser_UsersId",
-                table: "ApplicationRoleApplicationUser",
-                column: "UsersId");
-
-            migrationBuilder.CreateIndex(
-                name: "IX_AspNetRoleClaims_RoleId",
-                table: "AspNetRoleClaims",
-                column: "RoleId");
-
-            migrationBuilder.CreateIndex(
-                name: "RoleNameIndex",
-                table: "AspNetRoles",
-                column: "NormalizedName",
-                unique: true,
-                filter: "[NormalizedName] IS NOT NULL");
-
-            migrationBuilder.CreateIndex(
-                name: "IX_AspNetUserClaims_UserId",
-                table: "AspNetUserClaims",
-                column: "UserId");
-
-            migrationBuilder.CreateIndex(
-                name: "IX_AspNetUserLogins_UserId",
-                table: "AspNetUserLogins",
-                column: "UserId");
-
-            migrationBuilder.CreateIndex(
-                name: "IX_AspNetUserRoles_RoleId",
-                table: "AspNetUserRoles",
-                column: "RoleId");
-
-            migrationBuilder.CreateIndex(
-                name: "EmailIndex",
-                table: "AspNetUsers",
-                column: "NormalizedEmail");
-
-            migrationBuilder.CreateIndex(
-                name: "IX_AspNetUsers_ManagerId",
-                table: "AspNetUsers",
-                column: "ManagerId");
-
-            migrationBuilder.CreateIndex(
-                name: "UserNameIndex",
-                table: "AspNetUsers",
-                column: "NormalizedUserName",
-                unique: true,
-                filter: "[NormalizedUserName] IS NOT NULL");
-
-            migrationBuilder.CreateIndex(
-                name: "IX_RolePermissions_PermissionId",
-                table: "RolePermissions",
-                column: "PermissionId");
-
-            migrationBuilder.CreateIndex(
-                name: "IX_RolePermissions_RoleId",
-                table: "RolePermissions",
-                column: "RoleId");
-        }
-
-        /// <inheritdoc />
-        protected override void Down(MigrationBuilder migrationBuilder)
-        {
-            migrationBuilder.DropTable(
-                name: "ApplicationRoleApplicationUser");
-
-            migrationBuilder.DropTable(
-                name: "AspNetRoleClaims");
-
-            migrationBuilder.DropTable(
-                name: "AspNetUserClaims");
-
-            migrationBuilder.DropTable(
-                name: "AspNetUserLogins");
-
-            migrationBuilder.DropTable(
-                name: "AspNetUserRoles");
-
-            migrationBuilder.DropTable(
-                name: "AspNetUserTokens");
-
-            migrationBuilder.DropTable(
-                name: "RolePermissions");
-
-            migrationBuilder.DropTable(
-                name: "AspNetUsers");
-
-            migrationBuilder.DropTable(
-                name: "AspNetRoles");
-
-            migrationBuilder.DropTable(
-                name: "Permissions");
-        }
-    }
-}

+ 0 - 214
MTWorkHR.Identity/Migrations/20240221104859_updateUser.cs

@@ -1,214 +0,0 @@
-using System;
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
-
-namespace MTWorkHR.Identity.Migrations
-{
-    /// <inheritdoc />
-    public partial class updateUser : Migration
-    {
-        /// <inheritdoc />
-        protected override void Up(MigrationBuilder migrationBuilder)
-        {
-            migrationBuilder.AddColumn<string>(
-                name: "FavoriteName",
-                table: "AspNetUsers",
-                type: "nvarchar(max)",
-                nullable: true);
-
-            migrationBuilder.AddColumn<decimal>(
-                name: "IncomeTaxValue",
-                table: "AspNetUsers",
-                type: "decimal(18,2)",
-                nullable: true);
-
-            migrationBuilder.AddColumn<string>(
-                name: "JobTitle",
-                table: "AspNetUsers",
-                type: "nvarchar(max)",
-                nullable: true);
-
-            migrationBuilder.AddColumn<string>(
-                name: "PassportNumber",
-                table: "AspNetUsers",
-                type: "nvarchar(max)",
-                nullable: false,
-                defaultValue: "");
-
-            migrationBuilder.AddColumn<int>(
-                name: "QualificationId",
-                table: "AspNetUsers",
-                type: "int",
-                nullable: true);
-
-            migrationBuilder.AddColumn<decimal>(
-                name: "TaxNumber",
-                table: "AspNetUsers",
-                type: "decimal(18,2)",
-                nullable: true);
-
-            migrationBuilder.AddColumn<string>(
-                name: "University",
-                table: "AspNetUsers",
-                type: "nvarchar(max)",
-                nullable: true);
-
-            migrationBuilder.CreateTable(
-                name: "AttachmentTypes",
-                columns: table => new
-                {
-                    Id = table.Column<long>(type: "bigint", nullable: false)
-                        .Annotation("SqlServer:Identity", "1, 1"),
-                    NameAr = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: false),
-                    NameEn = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: false),
-                    IsRequired = table.Column<bool>(type: "bit", nullable: false)
-                },
-                constraints: table =>
-                {
-                    table.PrimaryKey("PK_AttachmentTypes", x => x.Id);
-                });
-
-            migrationBuilder.CreateTable(
-                name: "UserAddress",
-                columns: table => new
-                {
-                    Id = table.Column<long>(type: "bigint", nullable: false)
-                        .Annotation("SqlServer:Identity", "1, 1"),
-                    CreateUser = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: true),
-                    UpdateUser = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: true),
-                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
-                    UpdateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
-                    UserId = table.Column<string>(type: "nvarchar(450)", nullable: false),
-                    CountryId = table.Column<int>(type: "int", nullable: false),
-                    City = table.Column<string>(type: "nvarchar(max)", nullable: false),
-                    PostalCode = table.Column<string>(type: "nvarchar(max)", nullable: false),
-                    AddressDesc = table.Column<string>(type: "nvarchar(max)", nullable: false)
-                },
-                constraints: table =>
-                {
-                    table.PrimaryKey("PK_UserAddress", x => x.Id);
-                    table.ForeignKey(
-                        name: "FK_UserAddress_AspNetUsers_UserId",
-                        column: x => x.UserId,
-                        principalTable: "AspNetUsers",
-                        principalColumn: "Id",
-                        onDelete: ReferentialAction.Cascade);
-                });
-
-            migrationBuilder.CreateTable(
-                name: "UserAttachments",
-                columns: table => new
-                {
-                    Id = table.Column<long>(type: "bigint", nullable: false)
-                        .Annotation("SqlServer:Identity", "1, 1"),
-                    CreateUser = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: true),
-                    UpdateUser = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: true),
-                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
-                    UpdateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
-                    UserId = table.Column<string>(type: "nvarchar(450)", nullable: false),
-                    AttachmentTypeId = table.Column<long>(type: "bigint", nullable: false),
-                    FileName = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: false),
-                    OriginalName = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: false)
-                },
-                constraints: table =>
-                {
-                    table.PrimaryKey("PK_UserAttachments", x => x.Id);
-                    table.ForeignKey(
-                        name: "FK_UserAttachments_AspNetUsers_UserId",
-                        column: x => x.UserId,
-                        principalTable: "AspNetUsers",
-                        principalColumn: "Id",
-                        onDelete: ReferentialAction.Cascade);
-                    table.ForeignKey(
-                        name: "FK_UserAttachments_AttachmentTypes_AttachmentTypeId",
-                        column: x => x.AttachmentTypeId,
-                        principalTable: "AttachmentTypes",
-                        principalColumn: "Id",
-                        onDelete: ReferentialAction.Cascade);
-                });
-
-            migrationBuilder.UpdateData(
-                table: "AspNetUsers",
-                keyColumn: "Id",
-                keyValue: "ADMB3B92-2311-48F8-9DEC-F9FAEF1F21UA",
-                columns: new[] { "FavoriteName", "IncomeTaxValue", "JobTitle", "PassportNumber", "QualificationId", "TaxNumber", "University" },
-                values: new object[] { null, 1m, null, "1234567", 1, 111m, null });
-
-            migrationBuilder.UpdateData(
-                table: "AspNetUsers",
-                keyColumn: "Id",
-                keyValue: "AL5B3B92-2311-48F8-9DEC-F9FAEF1F21UB",
-                columns: new[] { "FavoriteName", "IncomeTaxValue", "JobTitle", "PassportNumber", "QualificationId", "TaxNumber", "University" },
-                values: new object[] { null, 100m, null, "7654321001010", 1, 222m, null });
-
-            migrationBuilder.InsertData(
-                table: "AttachmentTypes",
-                columns: new[] { "Id", "IsRequired", "NameAr", "NameEn" },
-                values: new object[,]
-                {
-                    { 1L, false, "السيرة الذاتية", "CV" },
-                    { 2L, false, "الهوية", "Identification" }
-                });
-
-            migrationBuilder.CreateIndex(
-                name: "IX_UserAddress_UserId",
-                table: "UserAddress",
-                column: "UserId",
-                unique: true);
-
-            migrationBuilder.CreateIndex(
-                name: "IX_UserAttachments_AttachmentTypeId",
-                table: "UserAttachments",
-                column: "AttachmentTypeId");
-
-            migrationBuilder.CreateIndex(
-                name: "IX_UserAttachments_UserId",
-                table: "UserAttachments",
-                column: "UserId");
-        }
-
-        /// <inheritdoc />
-        protected override void Down(MigrationBuilder migrationBuilder)
-        {
-            migrationBuilder.DropTable(
-                name: "UserAddress");
-
-            migrationBuilder.DropTable(
-                name: "UserAttachments");
-
-            migrationBuilder.DropTable(
-                name: "AttachmentTypes");
-
-            migrationBuilder.DropColumn(
-                name: "FavoriteName",
-                table: "AspNetUsers");
-
-            migrationBuilder.DropColumn(
-                name: "IncomeTaxValue",
-                table: "AspNetUsers");
-
-            migrationBuilder.DropColumn(
-                name: "JobTitle",
-                table: "AspNetUsers");
-
-            migrationBuilder.DropColumn(
-                name: "PassportNumber",
-                table: "AspNetUsers");
-
-            migrationBuilder.DropColumn(
-                name: "QualificationId",
-                table: "AspNetUsers");
-
-            migrationBuilder.DropColumn(
-                name: "TaxNumber",
-                table: "AspNetUsers");
-
-            migrationBuilder.DropColumn(
-                name: "University",
-                table: "AspNetUsers");
-        }
-    }
-}

+ 1 - 1
MTWorkHR.Infrastructure/Configurations/AttachmentTypeConfiguration.cs

@@ -6,7 +6,7 @@ using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
-using MTWorkHR.Identity.Entities;
+using MTWorkHR.Infrastructure.Entities;
 using MTWorkHR.Core.Entities.Base;
 
 namespace MTWorkHR.Infrastructure.Configurations

+ 2 - 2
MTWorkHR.Identity/Configurations/RoleConfiguration.cs

@@ -1,14 +1,14 @@
 using Microsoft.AspNetCore.Identity;
 using Microsoft.EntityFrameworkCore;
 using Microsoft.EntityFrameworkCore.Metadata.Builders;
-using MTWorkHR.Identity.Entities;
+using MTWorkHR.Infrastructure.Entities;
 using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 
-namespace MTWorkHR.Identity.Configurations
+namespace MTWorkHR.Infrastructure.Configurations
 {
     public class RoleConfiguration : IEntityTypeConfiguration<ApplicationRole>
     {

+ 2 - 2
MTWorkHR.Identity/Configurations/UserConfiguration.cs

@@ -6,9 +6,9 @@ using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
-using MTWorkHR.Identity.Entities;
+using MTWorkHR.Infrastructure.Entities;
 
-namespace MTWorkHR.Identity.Configurations
+namespace MTWorkHR.Infrastructure.Configurations
 {
     public class UserConfiguration : IEntityTypeConfiguration<ApplicationUser>
     {

+ 1 - 1
MTWorkHR.Identity/Configurations/UserRoleConfiguration.cs

@@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore;
 using Microsoft.EntityFrameworkCore.Metadata.Builders;
 
 
-namespace MTWorkHR.Identity.Configurations
+namespace MTWorkHR.Infrastructure.Configurations
 {
     public class UserRoleConfiguration : IEntityTypeConfiguration<IdentityUserRole<string>>
     {

MTWorkHR.Infrastructure/Data/Extensions/BuilderHasIndexExtensions.cs → MTWorkHR.Infrastructure/DBContext/Extensions/BuilderHasIndexExtensions.cs


MTWorkHR.Infrastructure/Data/Extensions/BuilderSetQueryFilterExtensions.cs → MTWorkHR.Infrastructure/DBContext/Extensions/BuilderSetQueryFilterExtensions.cs


+ 36 - 6
MTWorkHR.Identity/DBContext/HRIdentityDBContext.cs

@@ -1,17 +1,20 @@
 using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
 using Microsoft.EntityFrameworkCore;
+using MTWorkHR.Core.Entities;
 using MTWorkHR.Core.Entities.Base;
 using MTWorkHR.Core.Global;
-using MTWorkHR.Identity.Entities;
+using MTWorkHR.Infrastructure.Entities;
+using MTWorkHR.Infrastructure.Data;
+using System.Reflection.Emit;
 
 
-namespace MTWorkHR.Identity.DBContext
+namespace MTWorkHR.Infrastructure.DBContext
 {
-    public class HRIdentityDBContext : IdentityDbContext<ApplicationUser, ApplicationRole, string>
+    public class HRDataContext : IdentityDbContext<ApplicationUser, ApplicationRole, string>
     {
         private readonly GlobalInfo _globalInfo;
 
-        public HRIdentityDBContext(DbContextOptions<HRIdentityDBContext> options, GlobalInfo globalInfo) : base(options) {
+        public HRDataContext(DbContextOptions<HRDataContext> options, GlobalInfo globalInfo) : base(options) {
             this._globalInfo = globalInfo;
 
         }
@@ -19,13 +22,40 @@ namespace MTWorkHR.Identity.DBContext
         public DbSet<UserAttachment> UserAttachments { get; set; }
         public DbSet<Permission> Permissions { get; set; }
         public DbSet<RolePermission> RolePermissions { get; set; }
+
+
+
+        //-------------------------------------
+        public DbSet<Company> Companies { get; set; }
+        public DbSet<Project> Projects { get; set; }
+        //        public DbSet<AttachmentType> AttachmentTypes { get; set; }
+        public DbSet<UserTaskStatus> UserTaskStatuses { get; set; }
+        public DbSet<UserTask> UserTasks { get; set; }
+        public DbSet<UserTaskAttachment> UserTaskAttachments { get; set; }
+        public DbSet<UserTaskHistory> UserTaskHistories { get; set; }
+        public DbSet<Team> Teams { get; set; }
+        public DbSet<Meeting> Meetings { get; set; }
+        //------------------------Logs------------------------
+        public DbSet<UserLog> UserLogs { get; set; }
+        public DbSet<AuthLog> AuthLogs { get; set; }
+        public DbSet<FileLog> FileLogs { get; set; }
+        public DbSet<RoleLog> RoleLogs { get; set; }
+        public DbSet<SettingLog> SettingLogs { get; set; }
+        public DbSet<UserTaskLog> UserTaskLogs { get; set; }
+        public DbSet<TeamLog> TeamLogs { get; set; }
+        public DbSet<MeetingLog> MeetingLogs { get; set; }
+        //----------------------------------------
         protected override void OnModelCreating(ModelBuilder builder)
         {
             base.OnModelCreating(builder);
-            builder.ApplyConfigurationsFromAssembly(typeof(HRIdentityDBContext).Assembly);
+            SetGlobalFilters(builder);
+            builder.ApplyConfigurationsFromAssembly(typeof(HRDataContext).Assembly);
         }
 
-
+        private void SetGlobalFilters(ModelBuilder builder)
+        {
+            builder.SetQueryFilterOnAllEntities<ISoftDelete>(p => !p.IsDeleted);
+        }
         #region SaveChanges 
         public override Task<int> SaveChangesAsync(CancellationToken cancellationToken = default)
         {

+ 16 - 16
MTWorkHR.Infrastructure/EmailService/MailSender.cs

@@ -4,8 +4,8 @@ using MimeKit;
 using MTWorkHR.Core.Email;
 using MTWorkHR.Core.Entities;
 using MTWorkHR.Core.Global;
-using SendGrid;
-using SendGrid.Helpers.Mail;
+//using SendGrid;
+//using SendGrid.Helpers.Mail;
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -21,21 +21,21 @@ namespace MTWorkHR.Infrastructure.EmailService
         {
             _configuration = configuration;
         }
-        public async Task<bool> SendEmailGrid(EmailMessage email)
-        {
-            var client = new SendGridClient(_configuration.MailSettings.ApiKey);
-            var to = new EmailAddress(email.To);
-            var from = new EmailAddress
-            {
-                Email = _configuration.MailSettings.FromAddress,
-                Name = _configuration.MailSettings.FromName
-            };
-            email.Body = email.Body + "  /n" + email.url;
-            var message = MailHelper.CreateSingleEmail(from, to, email.Subject, email.Body, email.Body);
-            var response = await client.SendEmailAsync(message);
+        //public async Task<bool> SendEmailGrid(EmailMessage email)
+        //{
+        //    var client = new SendGridClient(_configuration.MailSettings.ApiKey);
+        //    var to = new EmailAddress(email.To);
+        //    var from = new EmailAddress
+        //    {
+        //        Email = _configuration.MailSettings.FromAddress,
+        //        Name = _configuration.MailSettings.FromName
+        //    };
+        //    email.Body = email.Body + "  /n" + email.url;
+        //    var message = MailHelper.CreateSingleEmail(from, to, email.Subject, email.Body, email.Body);
+        //    var response = await client.SendEmailAsync(message);
 
-            return response.IsSuccessStatusCode;
-        }
+        //    return response.IsSuccessStatusCode;
+        //}
 
         public async Task<bool> SendEmail(EmailMessage email)
         {

+ 1 - 1
MTWorkHR.Identity/Entities/ApplicationRole.cs

@@ -1,6 +1,6 @@
 using Microsoft.AspNetCore.Identity;
 
-namespace MTWorkHR.Identity.Entities
+namespace MTWorkHR.Infrastructure.Entities
 {
     public class ApplicationRole : IdentityRole
     {

+ 1 - 1
MTWorkHR.Identity/Entities/ApplicationUser.cs

@@ -6,7 +6,7 @@ using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 
-namespace MTWorkHR.Identity.Entities
+namespace MTWorkHR.Infrastructure.Entities
 {
     public class ApplicationUser : IdentityUser
     {

+ 5 - 5
MTWorkHR.Identity/Entities/ApplicationUserManager.cs

@@ -4,14 +4,14 @@ using Microsoft.EntityFrameworkCore;
 using Microsoft.Extensions.Logging;
 using Microsoft.Extensions.Options;
 using MTWorkHR.Core.Global;
-using MTWorkHR.Identity.DBContext;
+using MTWorkHR.Infrastructure.DBContext;
 
 
-namespace MTWorkHR.Identity.Entities
+namespace MTWorkHR.Infrastructure.Entities
 {
     public class ApplicationUserManager : UserManager<ApplicationUser>
     {
-        private UserStore<ApplicationUser, ApplicationRole, HRIdentityDBContext, string, IdentityUserClaim<string>
+        private UserStore<ApplicationUser, ApplicationRole, HRDataContext, string, IdentityUserClaim<string>
             , IdentityUserRole<string>, IdentityUserLogin<string>, IdentityUserToken<string>
             , IdentityRoleClaim<string>>
             _store;
@@ -20,9 +20,9 @@ namespace MTWorkHR.Identity.Entities
         {
             _globalInfo = globalInfo;
         }
-        private HRIdentityDBContext GetContext()
+        private HRDataContext GetContext()
         {
-            _store = (UserStore<ApplicationUser, ApplicationRole, HRIdentityDBContext, string, IdentityUserClaim<string>,
+            _store = (UserStore<ApplicationUser, ApplicationRole, HRDataContext, string, IdentityUserClaim<string>,
                     IdentityUserRole<string>, IdentityUserLogin<string>, IdentityUserToken<string>, IdentityRoleClaim<string>>)this.Store;
 
             var context = _store.Context;

+ 1 - 1
MTWorkHR.Identity/Entities/IdentityExtension.cs

@@ -9,7 +9,7 @@ using System.Security.Principal;
 using System.Text;
 using System.Threading.Tasks;
 
-namespace MTWorkHR.Identity.Entities
+namespace MTWorkHR.Infrastructure.Entities
 {
     public static class IdentityExtensions
     {

+ 3 - 2
MTWorkHR.Identity/Entities/RolePermission.cs

@@ -1,4 +1,5 @@
-using MTWorkHR.Core.Entities.Base;
+using MTWorkHR.Core.Entities;
+using MTWorkHR.Core.Entities.Base;
 using System;
 using System.Collections.Generic;
 using System.ComponentModel.DataAnnotations.Schema;
@@ -6,7 +7,7 @@ using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 
-namespace MTWorkHR.Identity.Entities
+namespace MTWorkHR.Infrastructure.Entities
 {
     // This partial class to add the navigation prop ApplicationRole
     // because ApplicationRole is defined in Infrastructure.Identity and cannot be used in Core layer

+ 1 - 1
MTWorkHR.Identity/Entities/UserAddress.cs

@@ -2,7 +2,7 @@
 using System.ComponentModel.DataAnnotations.Schema;
 using System.ComponentModel.DataAnnotations;
 
-namespace MTWorkHR.Identity.Entities
+namespace MTWorkHR.Infrastructure.Entities
 {
     public class UserAddress : AuditEntity
     {

+ 1 - 1
MTWorkHR.Identity/Entities/UserAttachment.cs

@@ -2,7 +2,7 @@
 using System.ComponentModel.DataAnnotations.Schema;
 using System.ComponentModel.DataAnnotations;
 
-namespace MTWorkHR.Identity.Entities
+namespace MTWorkHR.Infrastructure.Entities
 {
     public class UserAttachment : AuditEntity
     {

+ 48 - 13
MTWorkHR.Infrastructure/InfrastructureServiceRegistration.cs

@@ -1,28 +1,59 @@
-using Microsoft.Extensions.DependencyInjection;
-using Microsoft.Extensions.Configuration;
-using MTWorkHR.Infrastructure.EmailService;
-using MTWorkHR.Infrastructure.Logging;
-using MTWorkHR.Core.Global;
+using Microsoft.AspNetCore.Authentication.JwtBearer;
 using Microsoft.AspNetCore.Identity;
 using Microsoft.EntityFrameworkCore;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.DependencyInjection;
+using Microsoft.IdentityModel.Tokens;
+using MTWorkHR.Core.Email;
+using MTWorkHR.Core.Global;
 using MTWorkHR.Core.IRepositories.Base;
 using MTWorkHR.Core.IRepositories;
 using MTWorkHR.Core.UnitOfWork;
-using MTWorkHR.Identity.Entities;
-using MTWorkHR.Infrastructure.Data;
+using MTWorkHR.Infrastructure.DBContext;
+using MTWorkHR.Infrastructure.EmailService;
 using MTWorkHR.Infrastructure.Repositories;
 using MTWorkHR.Infrastructure.UnitOfWorks;
-using MTWorkHR.Core.Email;
-
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using MTWorkHR.Infrastructure.Entities;
 
 namespace MTWorkHR.Infrastructure
 {
     public static class InfrastructureServiceRegistration
     {
-        public static IServiceCollection AddInfrastructureServices (this IServiceCollection services, AppSettingsConfiguration configuration){
-            services.AddDbContext<HRDataContext>(options => {
-                options.UseSqlServer(configuration.ConnectionStrings.MTWorkHRConnectionString);
-            });
+        public static IServiceCollection AddInfrastructureIdentityServices(this IServiceCollection services, AppSettingsConfiguration config)
+        {
+            services.AddSingleton(config);
+
+            var vv = config.ConnectionStrings.MTWorkHRConnectionString;
+            services.AddDbContext<HRDataContext>(options =>
+                options.UseSqlServer(
+                    config.ConnectionStrings.MTWorkHRConnectionString  //configuration.GetSection("ConnectionString:MTWorkHRConnectionString").Value
+                    ));
+           
+            services.AddIdentity<ApplicationUser, ApplicationRole>().AddEntityFrameworkStores<HRDataContext>().AddDefaultTokenProviders();
+
+           
+            services.AddAuthentication(options => {
+                 options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme; // "bearer"
+                 options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;
+
+            }).AddJwtBearer(o=> o.TokenValidationParameters = new TokenValidationParameters 
+                {
+                    ValidateIssuerSigningKey = true,
+                    ValidateIssuer = true,
+                    ValidateAudience = true,
+                    ValidateLifetime = true,
+                    ClockSkew = TimeSpan.Zero,
+                    ValidIssuer = config.JwtSettings.Issuer,
+                    ValidAudience = config.JwtSettings.Audience,
+                    IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(config.JwtSettings.SecretKey))
+                }) ;
+
+
 
             services.AddScoped(typeof(IRepository<>), typeof(Repository<>));
             services.AddScoped(typeof(IRepositoryLog<>), typeof(RepositoryLog<>));
@@ -31,7 +62,11 @@ namespace MTWorkHR.Infrastructure
             services.AddScoped(typeof(IProjectRepository), typeof(ProjectRepository));
             services.AddScoped(typeof(ITaskStatusRepository), typeof(TaskStatusRepository));
             services.AddScoped(typeof(IUserTaskRepository), typeof(UserTaskRepository));
+            services.AddScoped(typeof(IUserTaskAttachmentRepository), typeof(UserTaskAttachmentRepository));
             services.AddScoped(typeof(IUserTaskHistoryRepository), typeof(UserTaskHistoryRepository));
+            
+            services.AddScoped(typeof(ITeamRepository), typeof(TeamRepository));
+            services.AddScoped(typeof(IMeetingRepository), typeof(MeetingRepository));
 
 
 

+ 3 - 7
MTWorkHR.Infrastructure/MTWorkHR.Infrastructure.csproj

@@ -7,12 +7,10 @@
   </PropertyGroup>
 
   <ItemGroup>
-    <Folder Include="Migrations\" />
-  </ItemGroup>
-
-  <ItemGroup>
     <PackageReference Include="MailKit" Version="4.3.0" />
-    <PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.0" />
+    <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.1" />
+    <PackageReference Include="Microsoft.AspNetCore.Identity" Version="2.2.0" />
+    <PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.0.1" />
     <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.1" />
     <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.1">
       <PrivateAssets>all</PrivateAssets>
@@ -20,13 +18,11 @@
     </PackageReference>
     <PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0" />
     <PackageReference Include="MimeKit" Version="4.3.0" />
-    <PackageReference Include="SendGrid" Version="9.28.1" />
     <PackageReference Include="System.Linq.Dynamic.Core" Version="1.3.8" />
   </ItemGroup>
 
   <ItemGroup>
     <ProjectReference Include="..\MTWorkHR.Core\MTWorkHR.Core.csproj" />
-    <ProjectReference Include="..\MTWorkHR.Identity\MTWorkHR.Identity.csproj" />
   </ItemGroup>
 
 </Project>

+ 700 - 80
MTWorkHR.Identity/Migrations/20240221104859_updateUser.Designer.cs

@@ -1,6 +1,6 @@
 // <auto-generated />
 using System;
-using MTWorkHR.Identity.DBContext;
+using MTWorkHR.Infrastructure.DBContext;
 using Microsoft.EntityFrameworkCore;
 using Microsoft.EntityFrameworkCore.Infrastructure;
 using Microsoft.EntityFrameworkCore.Metadata;
@@ -9,11 +9,11 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
 
 #nullable disable
 
-namespace MTWorkHR.Identity.Migrations
+namespace MTWorkHR.Infrastructure.Migrations
 {
-    [DbContext(typeof(HRIdentityDBContext))]
-    [Migration("20240221104859_updateUser")]
-    partial class updateUser
+    [DbContext(typeof(HRDataContext))]
+    [Migration("20240228105352_initial")]
+    partial class initial
     {
         /// <inheritdoc />
         protected override void BuildTargetModel(ModelBuilder modelBuilder)
@@ -40,6 +40,64 @@ namespace MTWorkHR.Identity.Migrations
                     b.ToTable("ApplicationRoleApplicationUser");
                 });
 
+            modelBuilder.Entity("MTWorkHR.Core.Entities.AuthLog", b =>
+                {
+                    b.Property<long>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("bigint")
+                        .HasColumnOrder(0);
+
+                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));
+
+                    b.Property<string>("Channel")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<DateTime>("CreateDate")
+                        .HasColumnType("datetime2");
+
+                    b.Property<string>("CreateUser")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("ErrorCode")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("ErrorDescription")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("InnerException")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("Input")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("Method")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("QueryString")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("ServerIP")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("ServiceResponseTimeInSeconds")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("UserIP")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("userAgent")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.HasKey("Id");
+
+                    b.ToTable("AuthLogs");
+                });
+
             modelBuilder.Entity("MTWorkHR.Core.Entities.Base.AttachmentType", b =>
                 {
                     b.Property<long>("Id")
@@ -49,9 +107,559 @@ namespace MTWorkHR.Identity.Migrations
 
                     SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));
 
-                    b.Property<bool>("IsRequired")
+                    b.Property<bool>("IsRequired")
+                        .HasColumnType("bit");
+
+                    b.Property<string>("NameAr")
+                        .IsRequired()
+                        .HasMaxLength(250)
+                        .HasColumnType("nvarchar(250)");
+
+                    b.Property<string>("NameEn")
+                        .IsRequired()
+                        .HasMaxLength(250)
+                        .HasColumnType("nvarchar(250)");
+
+                    b.HasKey("Id");
+
+                    b.ToTable("AttachmentTypes");
+
+                    b.HasData(
+                        new
+                        {
+                            Id = 1L,
+                            IsRequired = false,
+                            NameAr = "السيرة الذاتية",
+                            NameEn = "CV"
+                        },
+                        new
+                        {
+                            Id = 2L,
+                            IsRequired = false,
+                            NameAr = "الهوية",
+                            NameEn = "Identification"
+                        });
+                });
+
+            modelBuilder.Entity("MTWorkHR.Core.Entities.Company", b =>
+                {
+                    b.Property<long>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("bigint")
+                        .HasColumnOrder(0);
+
+                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));
+
+                    b.Property<string>("CRNumber")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("CompanyName")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<DateTime>("CreateDate")
+                        .HasColumnType("datetime2")
+                        .HasColumnOrder(3);
+
+                    b.Property<string>("CreateUser")
+                        .HasMaxLength(450)
+                        .HasColumnType("nvarchar(450)")
+                        .HasColumnOrder(1);
+
+                    b.Property<bool>("IsDeleted")
+                        .HasColumnType("bit");
+
+                    b.Property<int>("TaxNumber")
+                        .HasColumnType("int");
+
+                    b.Property<DateTime?>("UpdateDate")
+                        .HasColumnType("datetime2")
+                        .HasColumnOrder(4);
+
+                    b.Property<string>("UpdateUser")
+                        .HasMaxLength(450)
+                        .HasColumnType("nvarchar(450)")
+                        .HasColumnOrder(2);
+
+                    b.Property<long>("UserId")
+                        .HasColumnType("bigint");
+
+                    b.HasKey("Id");
+
+                    b.ToTable("Companies");
+                });
+
+            modelBuilder.Entity("MTWorkHR.Core.Entities.FileLog", b =>
+                {
+                    b.Property<long>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("bigint")
+                        .HasColumnOrder(0);
+
+                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));
+
+                    b.Property<string>("Channel")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<DateTime>("CreateDate")
+                        .HasColumnType("datetime2");
+
+                    b.Property<string>("CreateUser")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("ErrorCode")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("ErrorDescription")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("InnerException")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("Input")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("Method")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("QueryString")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("ServerIP")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("ServiceResponseTimeInSeconds")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("UserIP")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("userAgent")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.HasKey("Id");
+
+                    b.ToTable("FileLogs");
+                });
+
+            modelBuilder.Entity("MTWorkHR.Core.Entities.Permission", b =>
+                {
+                    b.Property<long>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("bigint")
+                        .HasColumnOrder(0);
+
+                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));
+
+                    b.Property<string>("CategoryName")
+                        .IsRequired()
+                        .HasMaxLength(150)
+                        .HasColumnType("nvarchar(150)");
+
+                    b.Property<string>("Desc")
+                        .IsRequired()
+                        .HasMaxLength(250)
+                        .HasColumnType("nvarchar(250)");
+
+                    b.Property<string>("Name")
+                        .IsRequired()
+                        .HasMaxLength(250)
+                        .HasColumnType("nvarchar(250)");
+
+                    b.Property<bool>("Show")
+                        .HasColumnType("bit");
+
+                    b.HasKey("Id");
+
+                    b.ToTable("Permissions");
+                });
+
+            modelBuilder.Entity("MTWorkHR.Core.Entities.Project", b =>
+                {
+                    b.Property<long>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("bigint")
+                        .HasColumnOrder(0);
+
+                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));
+
+                    b.Property<string>("NameAr")
+                        .IsRequired()
+                        .HasMaxLength(250)
+                        .HasColumnType("nvarchar(250)");
+
+                    b.Property<string>("NameEn")
+                        .IsRequired()
+                        .HasMaxLength(250)
+                        .HasColumnType("nvarchar(250)");
+
+                    b.HasKey("Id");
+
+                    b.ToTable("Projects");
+                });
+
+            modelBuilder.Entity("MTWorkHR.Core.Entities.RoleLog", b =>
+                {
+                    b.Property<long>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("bigint")
+                        .HasColumnOrder(0);
+
+                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));
+
+                    b.Property<string>("Channel")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<DateTime>("CreateDate")
+                        .HasColumnType("datetime2");
+
+                    b.Property<string>("CreateUser")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("ErrorCode")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("ErrorDescription")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("InnerException")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("Input")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("Method")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("QueryString")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("ServerIP")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("ServiceResponseTimeInSeconds")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("UserIP")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("userAgent")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.HasKey("Id");
+
+                    b.ToTable("RoleLogs");
+                });
+
+            modelBuilder.Entity("MTWorkHR.Core.Entities.SettingLog", b =>
+                {
+                    b.Property<long>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("bigint")
+                        .HasColumnOrder(0);
+
+                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));
+
+                    b.Property<string>("Channel")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<DateTime>("CreateDate")
+                        .HasColumnType("datetime2");
+
+                    b.Property<string>("CreateUser")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("ErrorCode")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("ErrorDescription")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("InnerException")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("Input")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("Method")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("QueryString")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("ServerIP")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("ServiceResponseTimeInSeconds")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("UserIP")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("userAgent")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.HasKey("Id");
+
+                    b.ToTable("SettingLogs");
+                });
+
+            modelBuilder.Entity("MTWorkHR.Core.Entities.UserLog", b =>
+                {
+                    b.Property<long>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("bigint")
+                        .HasColumnOrder(0);
+
+                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));
+
+                    b.Property<string>("Channel")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<DateTime>("CreateDate")
+                        .HasColumnType("datetime2");
+
+                    b.Property<string>("CreateUser")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("ErrorCode")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("ErrorDescription")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("InnerException")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("Input")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("Method")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("QueryString")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("ServerIP")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("ServiceResponseTimeInSeconds")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("UserIP")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("userAgent")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.HasKey("Id");
+
+                    b.ToTable("UserLogs");
+                });
+
+            modelBuilder.Entity("MTWorkHR.Core.Entities.UserTask", b =>
+                {
+                    b.Property<long>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("bigint")
+                        .HasColumnOrder(0);
+
+                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));
+
+                    b.Property<long>("AssignedUserId")
+                        .HasColumnType("bigint");
+
+                    b.Property<DateTime>("CreateDate")
+                        .HasColumnType("datetime2")
+                        .HasColumnOrder(3);
+
+                    b.Property<string>("CreateUser")
+                        .HasMaxLength(450)
+                        .HasColumnType("nvarchar(450)")
+                        .HasColumnOrder(1);
+
+                    b.Property<string>("DeleteUserId")
+                        .HasMaxLength(450)
+                        .HasColumnType("nvarchar(450)")
+                        .HasColumnOrder(8);
+
+                    b.Property<string>("Description")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<DateTime>("DueDate")
+                        .HasColumnType("datetime2");
+
+                    b.Property<bool>("IsDeleted")
+                        .HasColumnType("bit")
+                        .HasColumnOrder(7);
+
+                    b.Property<int>("Priority")
+                        .HasColumnType("int");
+
+                    b.Property<long>("ProjectId")
+                        .HasColumnType("bigint");
+
+                    b.Property<long>("StatusId")
+                        .HasColumnType("bigint");
+
+                    b.Property<string>("Title")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<DateTime?>("UpdateDate")
+                        .HasColumnType("datetime2")
+                        .HasColumnOrder(4);
+
+                    b.Property<string>("UpdateUser")
+                        .HasMaxLength(450)
+                        .HasColumnType("nvarchar(450)")
+                        .HasColumnOrder(2);
+
+                    b.HasKey("Id");
+
+                    b.HasIndex("ProjectId");
+
+                    b.HasIndex("StatusId");
+
+                    b.ToTable("UserTasks");
+                });
+
+            modelBuilder.Entity("MTWorkHR.Core.Entities.UserTaskAttachment", b =>
+                {
+                    b.Property<long>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("bigint")
+                        .HasColumnOrder(0);
+
+                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));
+
+                    b.Property<long>("AttachmentTypeId")
+                        .HasColumnType("bigint");
+
+                    b.Property<DateTime>("CreateDate")
+                        .HasColumnType("datetime2")
+                        .HasColumnOrder(3);
+
+                    b.Property<string>("CreateUser")
+                        .HasMaxLength(450)
+                        .HasColumnType("nvarchar(450)")
+                        .HasColumnOrder(1);
+
+                    b.Property<string>("FileName")
+                        .IsRequired()
+                        .HasMaxLength(250)
+                        .HasColumnType("nvarchar(250)");
+
+                    b.Property<string>("OriginalName")
+                        .IsRequired()
+                        .HasMaxLength(250)
+                        .HasColumnType("nvarchar(250)");
+
+                    b.Property<long>("TaskId")
+                        .HasColumnType("bigint");
+
+                    b.Property<DateTime?>("UpdateDate")
+                        .HasColumnType("datetime2")
+                        .HasColumnOrder(4);
+
+                    b.Property<string>("UpdateUser")
+                        .HasMaxLength(450)
+                        .HasColumnType("nvarchar(450)")
+                        .HasColumnOrder(2);
+
+                    b.HasKey("Id");
+
+                    b.HasIndex("AttachmentTypeId");
+
+                    b.HasIndex("TaskId");
+
+                    b.ToTable("UserTaskAttachments");
+                });
+
+            modelBuilder.Entity("MTWorkHR.Core.Entities.UserTaskHistory", b =>
+                {
+                    b.Property<long>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("bigint")
+                        .HasColumnOrder(0);
+
+                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));
+
+                    b.Property<long>("AssignedToUserId")
+                        .HasColumnType("bigint");
+
+                    b.Property<string>("Comment")
+                        .IsRequired()
+                        .HasMaxLength(500)
+                        .HasColumnType("nvarchar(500)");
+
+                    b.Property<DateTime>("CreateDate")
+                        .HasColumnType("datetime2")
+                        .HasColumnOrder(3);
+
+                    b.Property<string>("CreateUser")
+                        .HasMaxLength(450)
+                        .HasColumnType("nvarchar(450)")
+                        .HasColumnOrder(1);
+
+                    b.Property<long>("CurrentStatusId")
+                        .HasColumnType("bigint");
+
+                    b.Property<bool>("IsDeleted")
                         .HasColumnType("bit");
 
+                    b.Property<DateTime?>("UpdateDate")
+                        .HasColumnType("datetime2")
+                        .HasColumnOrder(4);
+
+                    b.Property<string>("UpdateUser")
+                        .HasMaxLength(450)
+                        .HasColumnType("nvarchar(450)")
+                        .HasColumnOrder(2);
+
+                    b.Property<long?>("UserTaskId")
+                        .HasColumnType("bigint");
+
+                    b.HasKey("Id");
+
+                    b.HasIndex("CurrentStatusId");
+
+                    b.HasIndex("UserTaskId");
+
+                    b.ToTable("UserTaskHistories");
+                });
+
+            modelBuilder.Entity("MTWorkHR.Core.Entities.UserTaskStatus", b =>
+                {
+                    b.Property<long>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("bigint")
+                        .HasColumnOrder(0);
+
+                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));
+
                     b.Property<string>("NameAr")
                         .IsRequired()
                         .HasMaxLength(250)
@@ -64,26 +672,10 @@ namespace MTWorkHR.Identity.Migrations
 
                     b.HasKey("Id");
 
-                    b.ToTable("AttachmentTypes");
-
-                    b.HasData(
-                        new
-                        {
-                            Id = 1L,
-                            IsRequired = false,
-                            NameAr = "السيرة الذاتية",
-                            NameEn = "CV"
-                        },
-                        new
-                        {
-                            Id = 2L,
-                            IsRequired = false,
-                            NameAr = "الهوية",
-                            NameEn = "Identification"
-                        });
+                    b.ToTable("UserTaskStatuses");
                 });
 
-            modelBuilder.Entity("MTWorkHR.Identity.Entities.ApplicationRole", b =>
+            modelBuilder.Entity("MTWorkHR.Infrastructure.Entities.ApplicationRole", b =>
                 {
                     b.Property<string>("Id")
                         .HasColumnType("nvarchar(450)");
@@ -151,7 +743,7 @@ namespace MTWorkHR.Identity.Migrations
                         });
                 });
 
-            modelBuilder.Entity("MTWorkHR.Identity.Entities.ApplicationUser", b =>
+            modelBuilder.Entity("MTWorkHR.Infrastructure.Entities.ApplicationUser", b =>
                 {
                     b.Property<string>("Id")
                         .HasColumnType("nvarchar(450)");
@@ -323,39 +915,7 @@ namespace MTWorkHR.Identity.Migrations
                         });
                 });
 
-            modelBuilder.Entity("MTWorkHR.Identity.Entities.Permission", b =>
-                {
-                    b.Property<long>("Id")
-                        .ValueGeneratedOnAdd()
-                        .HasColumnType("bigint")
-                        .HasColumnOrder(0);
-
-                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));
-
-                    b.Property<string>("CategoryName")
-                        .IsRequired()
-                        .HasMaxLength(150)
-                        .HasColumnType("nvarchar(150)");
-
-                    b.Property<string>("Desc")
-                        .IsRequired()
-                        .HasMaxLength(250)
-                        .HasColumnType("nvarchar(250)");
-
-                    b.Property<string>("Name")
-                        .IsRequired()
-                        .HasMaxLength(250)
-                        .HasColumnType("nvarchar(250)");
-
-                    b.Property<bool>("Show")
-                        .HasColumnType("bit");
-
-                    b.HasKey("Id");
-
-                    b.ToTable("Permissions");
-                });
-
-            modelBuilder.Entity("MTWorkHR.Identity.Entities.RolePermission", b =>
+            modelBuilder.Entity("MTWorkHR.Infrastructure.Entities.RolePermission", b =>
                 {
                     b.Property<long>("Id")
                         .ValueGeneratedOnAdd()
@@ -384,7 +944,7 @@ namespace MTWorkHR.Identity.Migrations
                     b.ToTable("RolePermissions");
                 });
 
-            modelBuilder.Entity("MTWorkHR.Identity.Entities.UserAddress", b =>
+            modelBuilder.Entity("MTWorkHR.Infrastructure.Entities.UserAddress", b =>
                 {
                     b.Property<long>("Id")
                         .ValueGeneratedOnAdd()
@@ -438,7 +998,7 @@ namespace MTWorkHR.Identity.Migrations
                     b.ToTable("UserAddress");
                 });
 
-            modelBuilder.Entity("MTWorkHR.Identity.Entities.UserAttachment", b =>
+            modelBuilder.Entity("MTWorkHR.Infrastructure.Entities.UserAttachment", b =>
                 {
                     b.Property<long>("Id")
                         .ValueGeneratedOnAdd()
@@ -611,37 +1171,90 @@ namespace MTWorkHR.Identity.Migrations
 
             modelBuilder.Entity("ApplicationRoleApplicationUser", b =>
                 {
-                    b.HasOne("MTWorkHR.Identity.Entities.ApplicationRole", null)
+                    b.HasOne("MTWorkHR.Infrastructure.Entities.ApplicationRole", null)
                         .WithMany()
                         .HasForeignKey("UserRolesId")
                         .OnDelete(DeleteBehavior.Cascade)
                         .IsRequired();
 
-                    b.HasOne("MTWorkHR.Identity.Entities.ApplicationUser", null)
+                    b.HasOne("MTWorkHR.Infrastructure.Entities.ApplicationUser", null)
                         .WithMany()
                         .HasForeignKey("UsersId")
                         .OnDelete(DeleteBehavior.Cascade)
                         .IsRequired();
                 });
 
-            modelBuilder.Entity("MTWorkHR.Identity.Entities.ApplicationUser", b =>
+            modelBuilder.Entity("MTWorkHR.Core.Entities.UserTask", b =>
+                {
+                    b.HasOne("MTWorkHR.Core.Entities.Project", "Project")
+                        .WithMany()
+                        .HasForeignKey("ProjectId")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
+                    b.HasOne("MTWorkHR.Core.Entities.UserTaskStatus", "TaskStatus")
+                        .WithMany()
+                        .HasForeignKey("StatusId")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
+                    b.Navigation("Project");
+
+                    b.Navigation("TaskStatus");
+                });
+
+            modelBuilder.Entity("MTWorkHR.Core.Entities.UserTaskAttachment", b =>
+                {
+                    b.HasOne("MTWorkHR.Core.Entities.Base.AttachmentType", "AttachmentType")
+                        .WithMany()
+                        .HasForeignKey("AttachmentTypeId")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
+                    b.HasOne("MTWorkHR.Core.Entities.UserTask", "UserTask")
+                        .WithMany("TaskAttachments")
+                        .HasForeignKey("TaskId")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
+                    b.Navigation("AttachmentType");
+
+                    b.Navigation("UserTask");
+                });
+
+            modelBuilder.Entity("MTWorkHR.Core.Entities.UserTaskHistory", b =>
+                {
+                    b.HasOne("MTWorkHR.Core.Entities.UserTaskStatus", "TaskStatus")
+                        .WithMany()
+                        .HasForeignKey("CurrentStatusId")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
+                    b.HasOne("MTWorkHR.Core.Entities.UserTask", null)
+                        .WithMany("UserTaskHistories")
+                        .HasForeignKey("UserTaskId");
+
+                    b.Navigation("TaskStatus");
+                });
+
+            modelBuilder.Entity("MTWorkHR.Infrastructure.Entities.ApplicationUser", b =>
                 {
-                    b.HasOne("MTWorkHR.Identity.Entities.ApplicationUser", "Manager")
+                    b.HasOne("MTWorkHR.Infrastructure.Entities.ApplicationUser", "Manager")
                         .WithMany()
                         .HasForeignKey("ManagerId");
 
                     b.Navigation("Manager");
                 });
 
-            modelBuilder.Entity("MTWorkHR.Identity.Entities.RolePermission", b =>
+            modelBuilder.Entity("MTWorkHR.Infrastructure.Entities.RolePermission", b =>
                 {
-                    b.HasOne("MTWorkHR.Identity.Entities.Permission", "Permission")
+                    b.HasOne("MTWorkHR.Core.Entities.Permission", "Permission")
                         .WithMany()
                         .HasForeignKey("PermissionId")
                         .OnDelete(DeleteBehavior.Cascade)
                         .IsRequired();
 
-                    b.HasOne("MTWorkHR.Identity.Entities.ApplicationRole", "Role")
+                    b.HasOne("MTWorkHR.Infrastructure.Entities.ApplicationRole", "Role")
                         .WithMany("RolePermissions")
                         .HasForeignKey("RoleId")
                         .OnDelete(DeleteBehavior.Cascade)
@@ -652,18 +1265,18 @@ namespace MTWorkHR.Identity.Migrations
                     b.Navigation("Role");
                 });
 
-            modelBuilder.Entity("MTWorkHR.Identity.Entities.UserAddress", b =>
+            modelBuilder.Entity("MTWorkHR.Infrastructure.Entities.UserAddress", b =>
                 {
-                    b.HasOne("MTWorkHR.Identity.Entities.ApplicationUser", "User")
+                    b.HasOne("MTWorkHR.Infrastructure.Entities.ApplicationUser", "User")
                         .WithOne("UserAddress")
-                        .HasForeignKey("MTWorkHR.Identity.Entities.UserAddress", "UserId")
+                        .HasForeignKey("MTWorkHR.Infrastructure.Entities.UserAddress", "UserId")
                         .OnDelete(DeleteBehavior.Cascade)
                         .IsRequired();
 
                     b.Navigation("User");
                 });
 
-            modelBuilder.Entity("MTWorkHR.Identity.Entities.UserAttachment", b =>
+            modelBuilder.Entity("MTWorkHR.Infrastructure.Entities.UserAttachment", b =>
                 {
                     b.HasOne("MTWorkHR.Core.Entities.Base.AttachmentType", "AttachmentType")
                         .WithMany()
@@ -671,7 +1284,7 @@ namespace MTWorkHR.Identity.Migrations
                         .OnDelete(DeleteBehavior.Cascade)
                         .IsRequired();
 
-                    b.HasOne("MTWorkHR.Identity.Entities.ApplicationUser", "User")
+                    b.HasOne("MTWorkHR.Infrastructure.Entities.ApplicationUser", "User")
                         .WithMany("UserAttachments")
                         .HasForeignKey("UserId")
                         .OnDelete(DeleteBehavior.Cascade)
@@ -684,7 +1297,7 @@ namespace MTWorkHR.Identity.Migrations
 
             modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
                 {
-                    b.HasOne("MTWorkHR.Identity.Entities.ApplicationRole", null)
+                    b.HasOne("MTWorkHR.Infrastructure.Entities.ApplicationRole", null)
                         .WithMany()
                         .HasForeignKey("RoleId")
                         .OnDelete(DeleteBehavior.Cascade)
@@ -693,7 +1306,7 @@ namespace MTWorkHR.Identity.Migrations
 
             modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
                 {
-                    b.HasOne("MTWorkHR.Identity.Entities.ApplicationUser", null)
+                    b.HasOne("MTWorkHR.Infrastructure.Entities.ApplicationUser", null)
                         .WithMany()
                         .HasForeignKey("UserId")
                         .OnDelete(DeleteBehavior.Cascade)
@@ -702,7 +1315,7 @@ namespace MTWorkHR.Identity.Migrations
 
             modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
                 {
-                    b.HasOne("MTWorkHR.Identity.Entities.ApplicationUser", null)
+                    b.HasOne("MTWorkHR.Infrastructure.Entities.ApplicationUser", null)
                         .WithMany()
                         .HasForeignKey("UserId")
                         .OnDelete(DeleteBehavior.Cascade)
@@ -711,13 +1324,13 @@ namespace MTWorkHR.Identity.Migrations
 
             modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
                 {
-                    b.HasOne("MTWorkHR.Identity.Entities.ApplicationRole", null)
+                    b.HasOne("MTWorkHR.Infrastructure.Entities.ApplicationRole", null)
                         .WithMany()
                         .HasForeignKey("RoleId")
                         .OnDelete(DeleteBehavior.Cascade)
                         .IsRequired();
 
-                    b.HasOne("MTWorkHR.Identity.Entities.ApplicationUser", null)
+                    b.HasOne("MTWorkHR.Infrastructure.Entities.ApplicationUser", null)
                         .WithMany()
                         .HasForeignKey("UserId")
                         .OnDelete(DeleteBehavior.Cascade)
@@ -726,19 +1339,26 @@ namespace MTWorkHR.Identity.Migrations
 
             modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
                 {
-                    b.HasOne("MTWorkHR.Identity.Entities.ApplicationUser", null)
+                    b.HasOne("MTWorkHR.Infrastructure.Entities.ApplicationUser", null)
                         .WithMany()
                         .HasForeignKey("UserId")
                         .OnDelete(DeleteBehavior.Cascade)
                         .IsRequired();
                 });
 
-            modelBuilder.Entity("MTWorkHR.Identity.Entities.ApplicationRole", b =>
+            modelBuilder.Entity("MTWorkHR.Core.Entities.UserTask", b =>
+                {
+                    b.Navigation("TaskAttachments");
+
+                    b.Navigation("UserTaskHistories");
+                });
+
+            modelBuilder.Entity("MTWorkHR.Infrastructure.Entities.ApplicationRole", b =>
                 {
                     b.Navigation("RolePermissions");
                 });
 
-            modelBuilder.Entity("MTWorkHR.Identity.Entities.ApplicationUser", b =>
+            modelBuilder.Entity("MTWorkHR.Infrastructure.Entities.ApplicationUser", b =>
                 {
                     b.Navigation("UserAddress")
                         .IsRequired();

File diff suppressed because it is too large
+ 823 - 0
MTWorkHR.Infrastructure/Migrations/20240228105352_initial.cs


+ 706 - 80
MTWorkHR.Identity/Migrations/HRIdentityDBContextModelSnapshot.cs

@@ -1,19 +1,22 @@
 // <auto-generated />
 using System;
-using MTWorkHR.Identity.DBContext;
+using MTWorkHR.Infrastructure.DBContext;
 using Microsoft.EntityFrameworkCore;
 using Microsoft.EntityFrameworkCore.Infrastructure;
 using Microsoft.EntityFrameworkCore.Metadata;
+using Microsoft.EntityFrameworkCore.Migrations;
 using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
 
 #nullable disable
 
-namespace MTWorkHR.Identity.Migrations
+namespace MTWorkHR.Infrastructure.Migrations
 {
-    [DbContext(typeof(HRIdentityDBContext))]
-    partial class HRIdentityDBContextModelSnapshot : ModelSnapshot
+    [DbContext(typeof(HRDataContext))]
+    [Migration("20240303141711_updateHistory")]
+    partial class updateHistory
     {
-        protected override void BuildModel(ModelBuilder modelBuilder)
+        /// <inheritdoc />
+        protected override void BuildTargetModel(ModelBuilder modelBuilder)
         {
 #pragma warning disable 612, 618
             modelBuilder
@@ -37,6 +40,64 @@ namespace MTWorkHR.Identity.Migrations
                     b.ToTable("ApplicationRoleApplicationUser");
                 });
 
+            modelBuilder.Entity("MTWorkHR.Core.Entities.AuthLog", b =>
+                {
+                    b.Property<long>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("bigint")
+                        .HasColumnOrder(0);
+
+                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));
+
+                    b.Property<string>("Channel")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<DateTime>("CreateDate")
+                        .HasColumnType("datetime2");
+
+                    b.Property<string>("CreateUser")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("ErrorCode")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("ErrorDescription")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("InnerException")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("Input")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("Method")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("QueryString")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("ServerIP")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("ServiceResponseTimeInSeconds")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("UserIP")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("userAgent")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.HasKey("Id");
+
+                    b.ToTable("AuthLogs");
+                });
+
             modelBuilder.Entity("MTWorkHR.Core.Entities.Base.AttachmentType", b =>
                 {
                     b.Property<long>("Id")
@@ -46,9 +107,562 @@ namespace MTWorkHR.Identity.Migrations
 
                     SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));
 
-                    b.Property<bool>("IsRequired")
+                    b.Property<bool>("IsRequired")
+                        .HasColumnType("bit");
+
+                    b.Property<string>("NameAr")
+                        .IsRequired()
+                        .HasMaxLength(250)
+                        .HasColumnType("nvarchar(250)");
+
+                    b.Property<string>("NameEn")
+                        .IsRequired()
+                        .HasMaxLength(250)
+                        .HasColumnType("nvarchar(250)");
+
+                    b.HasKey("Id");
+
+                    b.ToTable("AttachmentTypes");
+
+                    b.HasData(
+                        new
+                        {
+                            Id = 1L,
+                            IsRequired = false,
+                            NameAr = "السيرة الذاتية",
+                            NameEn = "CV"
+                        },
+                        new
+                        {
+                            Id = 2L,
+                            IsRequired = false,
+                            NameAr = "الهوية",
+                            NameEn = "Identification"
+                        });
+                });
+
+            modelBuilder.Entity("MTWorkHR.Core.Entities.Company", b =>
+                {
+                    b.Property<long>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("bigint")
+                        .HasColumnOrder(0);
+
+                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));
+
+                    b.Property<string>("CRNumber")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("CompanyName")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<DateTime>("CreateDate")
+                        .HasColumnType("datetime2")
+                        .HasColumnOrder(3);
+
+                    b.Property<string>("CreateUser")
+                        .HasMaxLength(450)
+                        .HasColumnType("nvarchar(450)")
+                        .HasColumnOrder(1);
+
+                    b.Property<bool>("IsDeleted")
+                        .HasColumnType("bit");
+
+                    b.Property<int>("TaxNumber")
+                        .HasColumnType("int");
+
+                    b.Property<DateTime?>("UpdateDate")
+                        .HasColumnType("datetime2")
+                        .HasColumnOrder(4);
+
+                    b.Property<string>("UpdateUser")
+                        .HasMaxLength(450)
+                        .HasColumnType("nvarchar(450)")
+                        .HasColumnOrder(2);
+
+                    b.Property<long>("UserId")
+                        .HasColumnType("bigint");
+
+                    b.HasKey("Id");
+
+                    b.ToTable("Companies");
+                });
+
+            modelBuilder.Entity("MTWorkHR.Core.Entities.FileLog", b =>
+                {
+                    b.Property<long>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("bigint")
+                        .HasColumnOrder(0);
+
+                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));
+
+                    b.Property<string>("Channel")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<DateTime>("CreateDate")
+                        .HasColumnType("datetime2");
+
+                    b.Property<string>("CreateUser")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("ErrorCode")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("ErrorDescription")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("InnerException")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("Input")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("Method")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("QueryString")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("ServerIP")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("ServiceResponseTimeInSeconds")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("UserIP")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("userAgent")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.HasKey("Id");
+
+                    b.ToTable("FileLogs");
+                });
+
+            modelBuilder.Entity("MTWorkHR.Core.Entities.Permission", b =>
+                {
+                    b.Property<long>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("bigint")
+                        .HasColumnOrder(0);
+
+                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));
+
+                    b.Property<string>("CategoryName")
+                        .IsRequired()
+                        .HasMaxLength(150)
+                        .HasColumnType("nvarchar(150)");
+
+                    b.Property<string>("Desc")
+                        .IsRequired()
+                        .HasMaxLength(250)
+                        .HasColumnType("nvarchar(250)");
+
+                    b.Property<string>("Name")
+                        .IsRequired()
+                        .HasMaxLength(250)
+                        .HasColumnType("nvarchar(250)");
+
+                    b.Property<bool>("Show")
+                        .HasColumnType("bit");
+
+                    b.HasKey("Id");
+
+                    b.ToTable("Permissions");
+                });
+
+            modelBuilder.Entity("MTWorkHR.Core.Entities.Project", b =>
+                {
+                    b.Property<long>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("bigint")
+                        .HasColumnOrder(0);
+
+                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));
+
+                    b.Property<string>("NameAr")
+                        .IsRequired()
+                        .HasMaxLength(250)
+                        .HasColumnType("nvarchar(250)");
+
+                    b.Property<string>("NameEn")
+                        .IsRequired()
+                        .HasMaxLength(250)
+                        .HasColumnType("nvarchar(250)");
+
+                    b.HasKey("Id");
+
+                    b.ToTable("Projects");
+                });
+
+            modelBuilder.Entity("MTWorkHR.Core.Entities.RoleLog", b =>
+                {
+                    b.Property<long>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("bigint")
+                        .HasColumnOrder(0);
+
+                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));
+
+                    b.Property<string>("Channel")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<DateTime>("CreateDate")
+                        .HasColumnType("datetime2");
+
+                    b.Property<string>("CreateUser")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("ErrorCode")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("ErrorDescription")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("InnerException")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("Input")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("Method")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("QueryString")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("ServerIP")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("ServiceResponseTimeInSeconds")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("UserIP")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("userAgent")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.HasKey("Id");
+
+                    b.ToTable("RoleLogs");
+                });
+
+            modelBuilder.Entity("MTWorkHR.Core.Entities.SettingLog", b =>
+                {
+                    b.Property<long>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("bigint")
+                        .HasColumnOrder(0);
+
+                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));
+
+                    b.Property<string>("Channel")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<DateTime>("CreateDate")
+                        .HasColumnType("datetime2");
+
+                    b.Property<string>("CreateUser")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("ErrorCode")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("ErrorDescription")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("InnerException")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("Input")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("Method")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("QueryString")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("ServerIP")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("ServiceResponseTimeInSeconds")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("UserIP")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("userAgent")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.HasKey("Id");
+
+                    b.ToTable("SettingLogs");
+                });
+
+            modelBuilder.Entity("MTWorkHR.Core.Entities.UserLog", b =>
+                {
+                    b.Property<long>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("bigint")
+                        .HasColumnOrder(0);
+
+                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));
+
+                    b.Property<string>("Channel")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<DateTime>("CreateDate")
+                        .HasColumnType("datetime2");
+
+                    b.Property<string>("CreateUser")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("ErrorCode")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("ErrorDescription")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("InnerException")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("Input")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("Method")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("QueryString")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("ServerIP")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("ServiceResponseTimeInSeconds")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("UserIP")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("userAgent")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.HasKey("Id");
+
+                    b.ToTable("UserLogs");
+                });
+
+            modelBuilder.Entity("MTWorkHR.Core.Entities.UserTask", b =>
+                {
+                    b.Property<long>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("bigint")
+                        .HasColumnOrder(0);
+
+                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));
+
+                    b.Property<long>("AssignedUserId")
+                        .HasColumnType("bigint");
+
+                    b.Property<DateTime>("CreateDate")
+                        .HasColumnType("datetime2")
+                        .HasColumnOrder(3);
+
+                    b.Property<string>("CreateUser")
+                        .HasMaxLength(450)
+                        .HasColumnType("nvarchar(450)")
+                        .HasColumnOrder(1);
+
+                    b.Property<string>("DeleteUserId")
+                        .HasMaxLength(450)
+                        .HasColumnType("nvarchar(450)")
+                        .HasColumnOrder(8);
+
+                    b.Property<string>("Description")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<DateTime>("DueDate")
+                        .HasColumnType("datetime2");
+
+                    b.Property<bool>("IsDeleted")
+                        .HasColumnType("bit")
+                        .HasColumnOrder(7);
+
+                    b.Property<int>("Priority")
+                        .HasColumnType("int");
+
+                    b.Property<long>("ProjectId")
+                        .HasColumnType("bigint");
+
+                    b.Property<long>("StatusId")
+                        .HasColumnType("bigint");
+
+                    b.Property<string>("Title")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<DateTime?>("UpdateDate")
+                        .HasColumnType("datetime2")
+                        .HasColumnOrder(4);
+
+                    b.Property<string>("UpdateUser")
+                        .HasMaxLength(450)
+                        .HasColumnType("nvarchar(450)")
+                        .HasColumnOrder(2);
+
+                    b.HasKey("Id");
+
+                    b.HasIndex("ProjectId");
+
+                    b.HasIndex("StatusId");
+
+                    b.ToTable("UserTasks");
+                });
+
+            modelBuilder.Entity("MTWorkHR.Core.Entities.UserTaskAttachment", b =>
+                {
+                    b.Property<long>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("bigint")
+                        .HasColumnOrder(0);
+
+                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));
+
+                    b.Property<long>("AttachmentTypeId")
+                        .HasColumnType("bigint");
+
+                    b.Property<DateTime>("CreateDate")
+                        .HasColumnType("datetime2")
+                        .HasColumnOrder(3);
+
+                    b.Property<string>("CreateUser")
+                        .HasMaxLength(450)
+                        .HasColumnType("nvarchar(450)")
+                        .HasColumnOrder(1);
+
+                    b.Property<string>("FileName")
+                        .IsRequired()
+                        .HasMaxLength(250)
+                        .HasColumnType("nvarchar(250)");
+
+                    b.Property<string>("OriginalName")
+                        .IsRequired()
+                        .HasMaxLength(250)
+                        .HasColumnType("nvarchar(250)");
+
+                    b.Property<long>("TaskId")
+                        .HasColumnType("bigint");
+
+                    b.Property<DateTime?>("UpdateDate")
+                        .HasColumnType("datetime2")
+                        .HasColumnOrder(4);
+
+                    b.Property<string>("UpdateUser")
+                        .HasMaxLength(450)
+                        .HasColumnType("nvarchar(450)")
+                        .HasColumnOrder(2);
+
+                    b.HasKey("Id");
+
+                    b.HasIndex("AttachmentTypeId");
+
+                    b.HasIndex("TaskId");
+
+                    b.ToTable("UserTaskAttachments");
+                });
+
+            modelBuilder.Entity("MTWorkHR.Core.Entities.UserTaskHistory", b =>
+                {
+                    b.Property<long>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("bigint")
+                        .HasColumnOrder(0);
+
+                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));
+
+                    b.Property<long>("AssignedToUserId")
+                        .HasColumnType("bigint");
+
+                    b.Property<string>("Comment")
+                        .IsRequired()
+                        .HasMaxLength(500)
+                        .HasColumnType("nvarchar(500)");
+
+                    b.Property<DateTime>("CreateDate")
+                        .HasColumnType("datetime2")
+                        .HasColumnOrder(3);
+
+                    b.Property<string>("CreateUser")
+                        .HasMaxLength(450)
+                        .HasColumnType("nvarchar(450)")
+                        .HasColumnOrder(1);
+
+                    b.Property<long>("CurrentStatusId")
+                        .HasColumnType("bigint");
+
+                    b.Property<bool>("IsDeleted")
                         .HasColumnType("bit");
 
+                    b.Property<long>("TaskId")
+                        .HasColumnType("bigint");
+
+                    b.Property<DateTime?>("UpdateDate")
+                        .HasColumnType("datetime2")
+                        .HasColumnOrder(4);
+
+                    b.Property<string>("UpdateUser")
+                        .HasMaxLength(450)
+                        .HasColumnType("nvarchar(450)")
+                        .HasColumnOrder(2);
+
+                    b.Property<long?>("UserTaskId")
+                        .HasColumnType("bigint");
+
+                    b.HasKey("Id");
+
+                    b.HasIndex("CurrentStatusId");
+
+                    b.HasIndex("UserTaskId");
+
+                    b.ToTable("UserTaskHistories");
+                });
+
+            modelBuilder.Entity("MTWorkHR.Core.Entities.UserTaskStatus", b =>
+                {
+                    b.Property<long>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("bigint")
+                        .HasColumnOrder(0);
+
+                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));
+
                     b.Property<string>("NameAr")
                         .IsRequired()
                         .HasMaxLength(250)
@@ -61,26 +675,10 @@ namespace MTWorkHR.Identity.Migrations
 
                     b.HasKey("Id");
 
-                    b.ToTable("AttachmentTypes");
-
-                    b.HasData(
-                        new
-                        {
-                            Id = 1L,
-                            IsRequired = false,
-                            NameAr = "السيرة الذاتية",
-                            NameEn = "CV"
-                        },
-                        new
-                        {
-                            Id = 2L,
-                            IsRequired = false,
-                            NameAr = "الهوية",
-                            NameEn = "Identification"
-                        });
+                    b.ToTable("UserTaskStatuses");
                 });
 
-            modelBuilder.Entity("MTWorkHR.Identity.Entities.ApplicationRole", b =>
+            modelBuilder.Entity("MTWorkHR.Infrastructure.Entities.ApplicationRole", b =>
                 {
                     b.Property<string>("Id")
                         .HasColumnType("nvarchar(450)");
@@ -148,7 +746,7 @@ namespace MTWorkHR.Identity.Migrations
                         });
                 });
 
-            modelBuilder.Entity("MTWorkHR.Identity.Entities.ApplicationUser", b =>
+            modelBuilder.Entity("MTWorkHR.Infrastructure.Entities.ApplicationUser", b =>
                 {
                     b.Property<string>("Id")
                         .HasColumnType("nvarchar(450)");
@@ -320,39 +918,7 @@ namespace MTWorkHR.Identity.Migrations
                         });
                 });
 
-            modelBuilder.Entity("MTWorkHR.Identity.Entities.Permission", b =>
-                {
-                    b.Property<long>("Id")
-                        .ValueGeneratedOnAdd()
-                        .HasColumnType("bigint")
-                        .HasColumnOrder(0);
-
-                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));
-
-                    b.Property<string>("CategoryName")
-                        .IsRequired()
-                        .HasMaxLength(150)
-                        .HasColumnType("nvarchar(150)");
-
-                    b.Property<string>("Desc")
-                        .IsRequired()
-                        .HasMaxLength(250)
-                        .HasColumnType("nvarchar(250)");
-
-                    b.Property<string>("Name")
-                        .IsRequired()
-                        .HasMaxLength(250)
-                        .HasColumnType("nvarchar(250)");
-
-                    b.Property<bool>("Show")
-                        .HasColumnType("bit");
-
-                    b.HasKey("Id");
-
-                    b.ToTable("Permissions");
-                });
-
-            modelBuilder.Entity("MTWorkHR.Identity.Entities.RolePermission", b =>
+            modelBuilder.Entity("MTWorkHR.Infrastructure.Entities.RolePermission", b =>
                 {
                     b.Property<long>("Id")
                         .ValueGeneratedOnAdd()
@@ -381,7 +947,7 @@ namespace MTWorkHR.Identity.Migrations
                     b.ToTable("RolePermissions");
                 });
 
-            modelBuilder.Entity("MTWorkHR.Identity.Entities.UserAddress", b =>
+            modelBuilder.Entity("MTWorkHR.Infrastructure.Entities.UserAddress", b =>
                 {
                     b.Property<long>("Id")
                         .ValueGeneratedOnAdd()
@@ -435,7 +1001,7 @@ namespace MTWorkHR.Identity.Migrations
                     b.ToTable("UserAddress");
                 });
 
-            modelBuilder.Entity("MTWorkHR.Identity.Entities.UserAttachment", b =>
+            modelBuilder.Entity("MTWorkHR.Infrastructure.Entities.UserAttachment", b =>
                 {
                     b.Property<long>("Id")
                         .ValueGeneratedOnAdd()
@@ -608,37 +1174,90 @@ namespace MTWorkHR.Identity.Migrations
 
             modelBuilder.Entity("ApplicationRoleApplicationUser", b =>
                 {
-                    b.HasOne("MTWorkHR.Identity.Entities.ApplicationRole", null)
+                    b.HasOne("MTWorkHR.Infrastructure.Entities.ApplicationRole", null)
                         .WithMany()
                         .HasForeignKey("UserRolesId")
                         .OnDelete(DeleteBehavior.Cascade)
                         .IsRequired();
 
-                    b.HasOne("MTWorkHR.Identity.Entities.ApplicationUser", null)
+                    b.HasOne("MTWorkHR.Infrastructure.Entities.ApplicationUser", null)
                         .WithMany()
                         .HasForeignKey("UsersId")
                         .OnDelete(DeleteBehavior.Cascade)
                         .IsRequired();
                 });
 
-            modelBuilder.Entity("MTWorkHR.Identity.Entities.ApplicationUser", b =>
+            modelBuilder.Entity("MTWorkHR.Core.Entities.UserTask", b =>
+                {
+                    b.HasOne("MTWorkHR.Core.Entities.Project", "Project")
+                        .WithMany()
+                        .HasForeignKey("ProjectId")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
+                    b.HasOne("MTWorkHR.Core.Entities.UserTaskStatus", "TaskStatus")
+                        .WithMany()
+                        .HasForeignKey("StatusId")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
+                    b.Navigation("Project");
+
+                    b.Navigation("TaskStatus");
+                });
+
+            modelBuilder.Entity("MTWorkHR.Core.Entities.UserTaskAttachment", b =>
+                {
+                    b.HasOne("MTWorkHR.Core.Entities.Base.AttachmentType", "AttachmentType")
+                        .WithMany()
+                        .HasForeignKey("AttachmentTypeId")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
+                    b.HasOne("MTWorkHR.Core.Entities.UserTask", "UserTask")
+                        .WithMany("TaskAttachments")
+                        .HasForeignKey("TaskId")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
+                    b.Navigation("AttachmentType");
+
+                    b.Navigation("UserTask");
+                });
+
+            modelBuilder.Entity("MTWorkHR.Core.Entities.UserTaskHistory", b =>
+                {
+                    b.HasOne("MTWorkHR.Core.Entities.UserTaskStatus", "TaskStatus")
+                        .WithMany()
+                        .HasForeignKey("CurrentStatusId")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
+                    b.HasOne("MTWorkHR.Core.Entities.UserTask", null)
+                        .WithMany("UserTaskHistories")
+                        .HasForeignKey("UserTaskId");
+
+                    b.Navigation("TaskStatus");
+                });
+
+            modelBuilder.Entity("MTWorkHR.Infrastructure.Entities.ApplicationUser", b =>
                 {
-                    b.HasOne("MTWorkHR.Identity.Entities.ApplicationUser", "Manager")
+                    b.HasOne("MTWorkHR.Infrastructure.Entities.ApplicationUser", "Manager")
                         .WithMany()
                         .HasForeignKey("ManagerId");
 
                     b.Navigation("Manager");
                 });
 
-            modelBuilder.Entity("MTWorkHR.Identity.Entities.RolePermission", b =>
+            modelBuilder.Entity("MTWorkHR.Infrastructure.Entities.RolePermission", b =>
                 {
-                    b.HasOne("MTWorkHR.Identity.Entities.Permission", "Permission")
+                    b.HasOne("MTWorkHR.Core.Entities.Permission", "Permission")
                         .WithMany()
                         .HasForeignKey("PermissionId")
                         .OnDelete(DeleteBehavior.Cascade)
                         .IsRequired();
 
-                    b.HasOne("MTWorkHR.Identity.Entities.ApplicationRole", "Role")
+                    b.HasOne("MTWorkHR.Infrastructure.Entities.ApplicationRole", "Role")
                         .WithMany("RolePermissions")
                         .HasForeignKey("RoleId")
                         .OnDelete(DeleteBehavior.Cascade)
@@ -649,18 +1268,18 @@ namespace MTWorkHR.Identity.Migrations
                     b.Navigation("Role");
                 });
 
-            modelBuilder.Entity("MTWorkHR.Identity.Entities.UserAddress", b =>
+            modelBuilder.Entity("MTWorkHR.Infrastructure.Entities.UserAddress", b =>
                 {
-                    b.HasOne("MTWorkHR.Identity.Entities.ApplicationUser", "User")
+                    b.HasOne("MTWorkHR.Infrastructure.Entities.ApplicationUser", "User")
                         .WithOne("UserAddress")
-                        .HasForeignKey("MTWorkHR.Identity.Entities.UserAddress", "UserId")
+                        .HasForeignKey("MTWorkHR.Infrastructure.Entities.UserAddress", "UserId")
                         .OnDelete(DeleteBehavior.Cascade)
                         .IsRequired();
 
                     b.Navigation("User");
                 });
 
-            modelBuilder.Entity("MTWorkHR.Identity.Entities.UserAttachment", b =>
+            modelBuilder.Entity("MTWorkHR.Infrastructure.Entities.UserAttachment", b =>
                 {
                     b.HasOne("MTWorkHR.Core.Entities.Base.AttachmentType", "AttachmentType")
                         .WithMany()
@@ -668,7 +1287,7 @@ namespace MTWorkHR.Identity.Migrations
                         .OnDelete(DeleteBehavior.Cascade)
                         .IsRequired();
 
-                    b.HasOne("MTWorkHR.Identity.Entities.ApplicationUser", "User")
+                    b.HasOne("MTWorkHR.Infrastructure.Entities.ApplicationUser", "User")
                         .WithMany("UserAttachments")
                         .HasForeignKey("UserId")
                         .OnDelete(DeleteBehavior.Cascade)
@@ -681,7 +1300,7 @@ namespace MTWorkHR.Identity.Migrations
 
             modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
                 {
-                    b.HasOne("MTWorkHR.Identity.Entities.ApplicationRole", null)
+                    b.HasOne("MTWorkHR.Infrastructure.Entities.ApplicationRole", null)
                         .WithMany()
                         .HasForeignKey("RoleId")
                         .OnDelete(DeleteBehavior.Cascade)
@@ -690,7 +1309,7 @@ namespace MTWorkHR.Identity.Migrations
 
             modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
                 {
-                    b.HasOne("MTWorkHR.Identity.Entities.ApplicationUser", null)
+                    b.HasOne("MTWorkHR.Infrastructure.Entities.ApplicationUser", null)
                         .WithMany()
                         .HasForeignKey("UserId")
                         .OnDelete(DeleteBehavior.Cascade)
@@ -699,7 +1318,7 @@ namespace MTWorkHR.Identity.Migrations
 
             modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
                 {
-                    b.HasOne("MTWorkHR.Identity.Entities.ApplicationUser", null)
+                    b.HasOne("MTWorkHR.Infrastructure.Entities.ApplicationUser", null)
                         .WithMany()
                         .HasForeignKey("UserId")
                         .OnDelete(DeleteBehavior.Cascade)
@@ -708,13 +1327,13 @@ namespace MTWorkHR.Identity.Migrations
 
             modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
                 {
-                    b.HasOne("MTWorkHR.Identity.Entities.ApplicationRole", null)
+                    b.HasOne("MTWorkHR.Infrastructure.Entities.ApplicationRole", null)
                         .WithMany()
                         .HasForeignKey("RoleId")
                         .OnDelete(DeleteBehavior.Cascade)
                         .IsRequired();
 
-                    b.HasOne("MTWorkHR.Identity.Entities.ApplicationUser", null)
+                    b.HasOne("MTWorkHR.Infrastructure.Entities.ApplicationUser", null)
                         .WithMany()
                         .HasForeignKey("UserId")
                         .OnDelete(DeleteBehavior.Cascade)
@@ -723,19 +1342,26 @@ namespace MTWorkHR.Identity.Migrations
 
             modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
                 {
-                    b.HasOne("MTWorkHR.Identity.Entities.ApplicationUser", null)
+                    b.HasOne("MTWorkHR.Infrastructure.Entities.ApplicationUser", null)
                         .WithMany()
                         .HasForeignKey("UserId")
                         .OnDelete(DeleteBehavior.Cascade)
                         .IsRequired();
                 });
 
-            modelBuilder.Entity("MTWorkHR.Identity.Entities.ApplicationRole", b =>
+            modelBuilder.Entity("MTWorkHR.Core.Entities.UserTask", b =>
+                {
+                    b.Navigation("TaskAttachments");
+
+                    b.Navigation("UserTaskHistories");
+                });
+
+            modelBuilder.Entity("MTWorkHR.Infrastructure.Entities.ApplicationRole", b =>
                 {
                     b.Navigation("RolePermissions");
                 });
 
-            modelBuilder.Entity("MTWorkHR.Identity.Entities.ApplicationUser", b =>
+            modelBuilder.Entity("MTWorkHR.Infrastructure.Entities.ApplicationUser", b =>
                 {
                     b.Navigation("UserAddress")
                         .IsRequired();

+ 29 - 0
MTWorkHR.Infrastructure/Migrations/20240303141711_updateHistory.cs

@@ -0,0 +1,29 @@
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace MTWorkHR.Infrastructure.Migrations
+{
+    /// <inheritdoc />
+    public partial class updateHistory : Migration
+    {
+        /// <inheritdoc />
+        protected override void Up(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.AddColumn<long>(
+                name: "TaskId",
+                table: "UserTaskHistories",
+                type: "bigint",
+                nullable: false,
+                defaultValue: 0L);
+        }
+
+        /// <inheritdoc />
+        protected override void Down(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.DropColumn(
+                name: "TaskId",
+                table: "UserTaskHistories");
+        }
+    }
+}

File diff suppressed because it is too large
+ 1679 - 0
MTWorkHR.Infrastructure/Migrations/20240304072047_addTeamMeeting.Designer.cs


+ 274 - 0
MTWorkHR.Infrastructure/Migrations/20240304072047_addTeamMeeting.cs

@@ -0,0 +1,274 @@
+using System;
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace MTWorkHR.Infrastructure.Migrations
+{
+    /// <inheritdoc />
+    public partial class addTeamMeeting : Migration
+    {
+        /// <inheritdoc />
+        protected override void Up(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.AlterColumn<string>(
+                name: "Comment",
+                table: "UserTaskHistories",
+                type: "nvarchar(500)",
+                maxLength: 500,
+                nullable: true,
+                oldClrType: typeof(string),
+                oldType: "nvarchar(500)",
+                oldMaxLength: 500);
+
+            migrationBuilder.AlterColumn<string>(
+                name: "FileName",
+                table: "UserTaskAttachments",
+                type: "nvarchar(250)",
+                maxLength: 250,
+                nullable: true,
+                oldClrType: typeof(string),
+                oldType: "nvarchar(250)",
+                oldMaxLength: 250);
+
+            migrationBuilder.AddColumn<DateTime>(
+                name: "CreateDate",
+                table: "Projects",
+                type: "datetime2",
+                nullable: false,
+                defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified))
+                .Annotation("Relational:ColumnOrder", 3);
+
+            migrationBuilder.AddColumn<string>(
+                name: "CreateUser",
+                table: "Projects",
+                type: "nvarchar(450)",
+                maxLength: 450,
+                nullable: true)
+                .Annotation("Relational:ColumnOrder", 1);
+
+            migrationBuilder.AddColumn<string>(
+                name: "DeleteUserId",
+                table: "Projects",
+                type: "nvarchar(450)",
+                maxLength: 450,
+                nullable: true)
+                .Annotation("Relational:ColumnOrder", 8);
+
+            migrationBuilder.AddColumn<bool>(
+                name: "IsDeleted",
+                table: "Projects",
+                type: "bit",
+                nullable: false,
+                defaultValue: false)
+                .Annotation("Relational:ColumnOrder", 7);
+
+            migrationBuilder.AddColumn<DateTime>(
+                name: "UpdateDate",
+                table: "Projects",
+                type: "datetime2",
+                nullable: true)
+                .Annotation("Relational:ColumnOrder", 4);
+
+            migrationBuilder.AddColumn<string>(
+                name: "UpdateUser",
+                table: "Projects",
+                type: "nvarchar(450)",
+                maxLength: 450,
+                nullable: true)
+                .Annotation("Relational:ColumnOrder", 2);
+
+            migrationBuilder.CreateTable(
+                name: "Meetings",
+                columns: table => new
+                {
+                    Id = table.Column<long>(type: "bigint", nullable: false)
+                        .Annotation("SqlServer:Identity", "1, 1"),
+                    CreateUser = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: true),
+                    UpdateUser = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: true),
+                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
+                    UpdateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
+                    IsDeleted = table.Column<bool>(type: "bit", nullable: false),
+                    DeleteUserId = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: true),
+                    Title = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: false),
+                    Description = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
+                    MeetingDateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
+                    MeetingLink = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: true)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_Meetings", x => x.Id);
+                });
+
+            migrationBuilder.CreateTable(
+                name: "Teams",
+                columns: table => new
+                {
+                    Id = table.Column<long>(type: "bigint", nullable: false)
+                        .Annotation("SqlServer:Identity", "1, 1"),
+                    CreateUser = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: true),
+                    UpdateUser = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: true),
+                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
+                    UpdateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
+                    IsDeleted = table.Column<bool>(type: "bit", nullable: false),
+                    DeleteUserId = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: true),
+                    NameAr = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: false),
+                    NameEn = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: false)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_Teams", x => x.Id);
+                });
+
+            migrationBuilder.CreateTable(
+                name: "UserTaskLogs",
+                columns: table => new
+                {
+                    Id = table.Column<long>(type: "bigint", nullable: false)
+                        .Annotation("SqlServer:Identity", "1, 1"),
+                    Method = table.Column<string>(type: "nvarchar(max)", nullable: false),
+                    QueryString = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    Input = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
+                    CreateUser = table.Column<string>(type: "nvarchar(max)", nullable: false),
+                    ServerIP = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    Channel = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    UserIP = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    ServiceResponseTimeInSeconds = table.Column<string>(type: "nvarchar(max)", nullable: false),
+                    ErrorCode = table.Column<string>(type: "nvarchar(max)", nullable: false),
+                    ErrorDescription = table.Column<string>(type: "nvarchar(max)", nullable: false),
+                    InnerException = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    userAgent = table.Column<string>(type: "nvarchar(max)", nullable: true)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_UserTaskLogs", x => x.Id);
+                });
+
+            migrationBuilder.CreateTable(
+                name: "MeetingUser",
+                columns: table => new
+                {
+                    Id = table.Column<long>(type: "bigint", nullable: false)
+                        .Annotation("SqlServer:Identity", "1, 1"),
+                    CreateUser = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: true),
+                    UpdateUser = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: true),
+                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
+                    UpdateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
+                    MeetingId = table.Column<long>(type: "bigint", nullable: false),
+                    AssignedUserId = table.Column<string>(type: "nvarchar(max)", nullable: false)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_MeetingUser", x => x.Id);
+                    table.ForeignKey(
+                        name: "FK_MeetingUser_Meetings_MeetingId",
+                        column: x => x.MeetingId,
+                        principalTable: "Meetings",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Cascade);
+                });
+
+            migrationBuilder.CreateTable(
+                name: "TeamUser",
+                columns: table => new
+                {
+                    Id = table.Column<long>(type: "bigint", nullable: false)
+                        .Annotation("SqlServer:Identity", "1, 1"),
+                    CreateUser = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: true),
+                    UpdateUser = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: true),
+                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
+                    UpdateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
+                    TeamId = table.Column<long>(type: "bigint", nullable: false),
+                    AssignedUserId = table.Column<string>(type: "nvarchar(max)", nullable: false)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_TeamUser", x => x.Id);
+                    table.ForeignKey(
+                        name: "FK_TeamUser_Teams_TeamId",
+                        column: x => x.TeamId,
+                        principalTable: "Teams",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Cascade);
+                });
+
+            migrationBuilder.CreateIndex(
+                name: "IX_MeetingUser_MeetingId",
+                table: "MeetingUser",
+                column: "MeetingId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_TeamUser_TeamId",
+                table: "TeamUser",
+                column: "TeamId");
+        }
+
+        /// <inheritdoc />
+        protected override void Down(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.DropTable(
+                name: "MeetingUser");
+
+            migrationBuilder.DropTable(
+                name: "TeamUser");
+
+            migrationBuilder.DropTable(
+                name: "UserTaskLogs");
+
+            migrationBuilder.DropTable(
+                name: "Meetings");
+
+            migrationBuilder.DropTable(
+                name: "Teams");
+
+            migrationBuilder.DropColumn(
+                name: "CreateDate",
+                table: "Projects");
+
+            migrationBuilder.DropColumn(
+                name: "CreateUser",
+                table: "Projects");
+
+            migrationBuilder.DropColumn(
+                name: "DeleteUserId",
+                table: "Projects");
+
+            migrationBuilder.DropColumn(
+                name: "IsDeleted",
+                table: "Projects");
+
+            migrationBuilder.DropColumn(
+                name: "UpdateDate",
+                table: "Projects");
+
+            migrationBuilder.DropColumn(
+                name: "UpdateUser",
+                table: "Projects");
+
+            migrationBuilder.AlterColumn<string>(
+                name: "Comment",
+                table: "UserTaskHistories",
+                type: "nvarchar(500)",
+                maxLength: 500,
+                nullable: false,
+                defaultValue: "",
+                oldClrType: typeof(string),
+                oldType: "nvarchar(500)",
+                oldMaxLength: 500,
+                oldNullable: true);
+
+            migrationBuilder.AlterColumn<string>(
+                name: "FileName",
+                table: "UserTaskAttachments",
+                type: "nvarchar(250)",
+                maxLength: 250,
+                nullable: false,
+                defaultValue: "",
+                oldClrType: typeof(string),
+                oldType: "nvarchar(250)",
+                oldMaxLength: 250,
+                oldNullable: true);
+        }
+    }
+}

File diff suppressed because it is too large
+ 1795 - 0
MTWorkHR.Infrastructure/Migrations/20240304100029_addTeamMeetinglogs.Designer.cs


+ 75 - 0
MTWorkHR.Infrastructure/Migrations/20240304100029_addTeamMeetinglogs.cs

@@ -0,0 +1,75 @@
+using System;
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace MTWorkHR.Infrastructure.Migrations
+{
+    /// <inheritdoc />
+    public partial class addTeamMeetinglogs : Migration
+    {
+        /// <inheritdoc />
+        protected override void Up(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.CreateTable(
+                name: "MeetingLogs",
+                columns: table => new
+                {
+                    Id = table.Column<long>(type: "bigint", nullable: false)
+                        .Annotation("SqlServer:Identity", "1, 1"),
+                    Method = table.Column<string>(type: "nvarchar(max)", nullable: false),
+                    QueryString = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    Input = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
+                    CreateUser = table.Column<string>(type: "nvarchar(max)", nullable: false),
+                    ServerIP = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    Channel = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    UserIP = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    ServiceResponseTimeInSeconds = table.Column<string>(type: "nvarchar(max)", nullable: false),
+                    ErrorCode = table.Column<string>(type: "nvarchar(max)", nullable: false),
+                    ErrorDescription = table.Column<string>(type: "nvarchar(max)", nullable: false),
+                    InnerException = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    userAgent = table.Column<string>(type: "nvarchar(max)", nullable: true)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_MeetingLogs", x => x.Id);
+                });
+
+            migrationBuilder.CreateTable(
+                name: "TeamLogs",
+                columns: table => new
+                {
+                    Id = table.Column<long>(type: "bigint", nullable: false)
+                        .Annotation("SqlServer:Identity", "1, 1"),
+                    Method = table.Column<string>(type: "nvarchar(max)", nullable: false),
+                    QueryString = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    Input = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
+                    CreateUser = table.Column<string>(type: "nvarchar(max)", nullable: false),
+                    ServerIP = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    Channel = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    UserIP = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    ServiceResponseTimeInSeconds = table.Column<string>(type: "nvarchar(max)", nullable: false),
+                    ErrorCode = table.Column<string>(type: "nvarchar(max)", nullable: false),
+                    ErrorDescription = table.Column<string>(type: "nvarchar(max)", nullable: false),
+                    InnerException = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    userAgent = table.Column<string>(type: "nvarchar(max)", nullable: true)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_TeamLogs", x => x.Id);
+                });
+        }
+
+        /// <inheritdoc />
+        protected override void Down(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.DropTable(
+                name: "MeetingLogs");
+
+            migrationBuilder.DropTable(
+                name: "TeamLogs");
+        }
+    }
+}

File diff suppressed because it is too large
+ 1191 - 89
MTWorkHR.Infrastructure/Migrations/HRDataContextModelSnapshot.cs


+ 1 - 1
MTWorkHR.Infrastructure/Repositories/Auth/PermissionRepository.cs

@@ -1,7 +1,7 @@
 using Microsoft.EntityFrameworkCore;
 using MTWorkHR.Core.Entities;
 using MTWorkHR.Core.IRepositories;
-using MTWorkHR.Infrastructure.Data;
+using MTWorkHR.Infrastructure.DBContext;
 using System;
 using System.Collections.Generic;
 using System.Linq;

+ 2 - 2
MTWorkHR.Infrastructure/Repositories/Auth/RolePermissionRepository.cs

@@ -2,13 +2,13 @@
 using MTWorkHR.Core.Entities.Base;
 using MTWorkHR.Core.IDto;
 using MTWorkHR.Core.IRepositories;
-using MTWorkHR.Identity.Entities;
-using MTWorkHR.Infrastructure.Data;
+using MTWorkHR.Infrastructure.Entities;
 using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using MTWorkHR.Infrastructure.DBContext;
 
 namespace MTWorkHR.Infrastructure.Repositories
 {

+ 3 - 3
MTWorkHR.Infrastructure/Repositories/Auth/UserRoleRepository.cs

@@ -3,16 +3,16 @@ using Microsoft.EntityFrameworkCore;
 using MTWorkHR.Core.Entities.Base;
 using MTWorkHR.Core.IDto;
 using MTWorkHR.Core.IRepositories;
-using MTWorkHR.Identity.DBContext;
+using MTWorkHR.Infrastructure.DBContext;
 
 namespace MTWorkHR.Infrastructure.Repositories
 {
     public class UserRoleRepository : IUserRoleRepository<IdentityUserRole<string>>
     {
-        protected readonly HRIdentityDBContext context;
+        protected readonly HRDataContext context;
         private readonly DbSet<IdentityUserRole<string>> dbSet;
 
-        public UserRoleRepository(HRIdentityDBContext _econtext)
+        public UserRoleRepository(HRDataContext _econtext)
         {
             context = _econtext;
             dbSet = context.Set<IdentityUserRole<string>>();

+ 2 - 1
MTWorkHR.Infrastructure/Repositories/EmployeeRepository.cs

@@ -1,6 +1,7 @@
 using MTWorkHR.Core.Entities;
 using MTWorkHR.Core.IRepositories;
-using MTWorkHR.Infrastructure.Data;
+
+using MTWorkHR.Infrastructure.DBContext;
 
 
 namespace MTWorkHR.Infrastructure.Repositories

+ 1 - 1
MTWorkHR.Infrastructure/Repositories/Repository.cs

@@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore;
 using MTWorkHR.Core.Entities.Base;
 using MTWorkHR.Core.IDto;
 using MTWorkHR.Core.IRepositories.Base;
-using MTWorkHR.Infrastructure.Data;
+using MTWorkHR.Infrastructure.DBContext;
 using System.Linq;
 using System.Linq.Dynamic.Core;
 

+ 1 - 1
MTWorkHR.Infrastructure/Repositories/RepositoryLog.cs

@@ -1,6 +1,6 @@
 using Microsoft.EntityFrameworkCore;
 using MTWorkHR.Core.IRepositories.Base;
-using MTWorkHR.Infrastructure.Data;
+using MTWorkHR.Infrastructure.DBContext;
 using System;
 using System.Collections.Generic;
 using System.Linq;

+ 17 - 0
MTWorkHR.Infrastructure/Repositories/Task/ProjectRepository.cs

@@ -0,0 +1,17 @@
+using Microsoft.EntityFrameworkCore;
+using MTWorkHR.Core.Entities;
+using MTWorkHR.Core.IDto;
+using MTWorkHR.Infrastructure.Entities;
+using MTWorkHR.Infrastructure.DBContext;
+using MTWorkHR.Core.IRepositories;
+
+namespace MTWorkHR.Infrastructure.Repositories
+{
+    public class ProjectRepository : Repository<Project>, IProjectRepository
+    {
+        public ProjectRepository(HRDataContext context) : base(context)
+        {
+        }
+
+    }
+}

+ 0 - 0
MTWorkHR.Infrastructure/Repositories/Task/TaskAttachmentRepository.cs


Some files were not shown because too many files changed in this diff