Kaynağa Gözat

Merge branch 'master' into Payment

zinab_elgendy 2 ay önce
ebeveyn
işleme
1e9ce78038
65 değiştirilmiş dosya ile 30984 ekleme ve 187 silme
  1. 29 0
      MTWorkHR.API/Controllers/AdminController.cs
  2. 35 0
      MTWorkHR.API/Controllers/AttachmentController.cs
  3. 13 3
      MTWorkHR.API/Controllers/CompanyController.cs
  4. 24 2
      MTWorkHR.API/Controllers/ContractController.cs
  5. 1 1
      MTWorkHR.API/Controllers/LookupController.cs
  6. 11 1
      MTWorkHR.API/Controllers/UserController.cs
  7. 6 0
      MTWorkHR.API/MTWorkHR.API.csproj
  8. 5 0
      MTWorkHR.API/Program.cs
  9. 122 33
      MTWorkHR.API/Reports/ContractReport.Designer.cs
  10. 281 0
      MTWorkHR.API/Reports/ContractTasks.Designer.cs
  11. 16 0
      MTWorkHR.API/Reports/ContractTasks.cs
  12. 123 0
      MTWorkHR.API/Reports/ContractTasks.resx
  13. 313 0
      MTWorkHR.API/Reports/ProjectStages.Designer.cs
  14. 16 0
      MTWorkHR.API/Reports/ProjectStages.cs
  15. 123 0
      MTWorkHR.API/Reports/ProjectStages.resx
  16. 2 0
      MTWorkHR.Application/ApplicationServiceRegistration.cs
  17. 22 8
      MTWorkHR.Application/Dtos/Contract/ContractDto.cs
  18. 4 6
      MTWorkHR.Application/Dtos/Contract/ContractTaskAttachmentDto.cs
  19. 17 0
      MTWorkHR.Application/Dtos/Contract/ContractWorkingDayDto.cs
  20. 3 4
      MTWorkHR.Application/Dtos/Contract/ProjectStageAttachmentDto.cs
  21. 15 0
      MTWorkHR.Application/Dtos/Identity/AttachmentResponseDto.cs
  22. 0 4
      MTWorkHR.Application/Dtos/Identity/AuthResponse.cs
  23. 5 0
      MTWorkHR.Application/Dtos/User/CompanyDto.cs
  24. 4 1
      MTWorkHR.Application/Mapper/MappingProfile.cs
  25. 7 0
      MTWorkHR.Application/Middlewares/LoggingMiddleware.cs
  26. 34 29
      MTWorkHR.Application/Services/Auth/AuthService.cs
  27. 32 20
      MTWorkHR.Application/Services/Base/BlobFileService.cs
  28. 5 5
      MTWorkHR.Application/Services/Base/FileService.cs
  29. 93 0
      MTWorkHR.Application/Services/Contract/ContractTaskAttachmentService.cs
  30. 91 0
      MTWorkHR.Application/Services/Contract/ProjectStageAttachmentService.cs
  31. 2 1
      MTWorkHR.Application/Services/Interfaces/IAuthService.cs
  32. 1 0
      MTWorkHR.Application/Services/Interfaces/ICompanyService.cs
  33. 12 0
      MTWorkHR.Application/Services/Interfaces/IContractTaskAttachmentService.cs
  34. 2 2
      MTWorkHR.Application/Services/Interfaces/IFileService.cs
  35. 12 0
      MTWorkHR.Application/Services/Interfaces/IProjectStageAttachmentService.cs
  36. 1 0
      MTWorkHR.Application/Services/Interfaces/IUserService.cs
  37. 20 3
      MTWorkHR.Application/Services/User/CompanyService.cs
  38. 13 2
      MTWorkHR.Application/Services/User/UserService.cs
  39. 21 12
      MTWorkHR.Core/Entities/Contract/Contract.cs
  40. 1 3
      MTWorkHR.Core/Entities/Contract/ContractTaskAttachment.cs
  41. 24 0
      MTWorkHR.Core/Entities/Contract/ContractWorkingDay.cs
  42. 0 3
      MTWorkHR.Core/Entities/Contract/ProjectStageAttachment.cs
  43. 2 0
      MTWorkHR.Core/Entities/User/Company.cs
  44. 2 2
      MTWorkHR.Core/Global/AppExceptions.cs
  45. 1 0
      MTWorkHR.Core/IRepositories/Auth/ICompanyRepository.cs
  46. 15 0
      MTWorkHR.Core/IRepositories/Contract/IContractTaskAttachmentRepository.cs
  47. 15 0
      MTWorkHR.Core/IRepositories/Contract/IProjectStageAttachmentRepository.cs
  48. 3 0
      MTWorkHR.Core/IUnitOfWork/IUnitOfWork.cs
  49. 2 0
      MTWorkHR.Infrastructure/InfrastructureServiceRegistration.cs
  50. 5719 0
      MTWorkHR.Infrastructure/Migrations/20241210094124_alteContractfixedPay.Designer.cs
  51. 79 0
      MTWorkHR.Infrastructure/Migrations/20241210094124_alteContractfixedPay.cs
  52. 5770 0
      MTWorkHR.Infrastructure/Migrations/20241216201032_altrContractWorkingDay.Designer.cs
  53. 260 0
      MTWorkHR.Infrastructure/Migrations/20241216201032_altrContractWorkingDay.cs
  54. 5773 0
      MTWorkHR.Infrastructure/Migrations/20241218150942_altrContractAttach.Designer.cs
  55. 29 0
      MTWorkHR.Infrastructure/Migrations/20241218150942_altrContractAttach.cs
  56. 5749 0
      MTWorkHR.Infrastructure/Migrations/20241224101338_altrContracyAttachs.Designer.cs
  57. 80 0
      MTWorkHR.Infrastructure/Migrations/20241224101338_altrContracyAttachs.cs
  58. 5752 0
      MTWorkHR.Infrastructure/Migrations/20241226130909_altrCompanyPostal.Designer.cs
  59. 28 0
      MTWorkHR.Infrastructure/Migrations/20241226130909_altrCompanyPostal.cs
  60. 91 40
      MTWorkHR.Infrastructure/Migrations/HRDataContextModelSnapshot.cs
  61. 1 0
      MTWorkHR.Infrastructure/Repositories/Contract/ContractRepository.cs
  62. 17 0
      MTWorkHR.Infrastructure/Repositories/Contract/ContractTaskAttachmentRepository.cs
  63. 17 0
      MTWorkHR.Infrastructure/Repositories/Contract/ProjectStageAttachmentRepository.cs
  64. 12 1
      MTWorkHR.Infrastructure/Repositories/User/CompanyRepository.cs
  65. 6 1
      MTWorkHR.Infrastructure/UnitOfWork/UnitOfWork.cs

+ 29 - 0
MTWorkHR.API/Controllers/AdminController.cs

@@ -0,0 +1,29 @@
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Identity;
+using Microsoft.AspNetCore.Mvc;
+using MTWorkHR.Application.Filters;
+using MTWorkHR.Application.Identity;
+using MTWorkHR.Application.Models;
+using MTWorkHR.Core.Global;
+using MTWorkHR.Identity.Services;
+
+namespace MTWorkHR.API.Controllers
+{
+    [Route("api/[controller]")]
+    [ApiController]
+
+    public class AdminController : ControllerBase
+    {
+        private readonly IAuthService _authenticationService;
+        public AdminController(IAuthService authenticationService) 
+        {
+            _authenticationService = authenticationService;
+        }
+        [HttpPost("login")]
+        public async Task<ActionResult<AuthResponse>> Login(AuthRequest request)
+        {
+            return Ok( await _authenticationService.AdminLogin(request));
+        }
+       
+    }
+}

+ 35 - 0
MTWorkHR.API/Controllers/AttachmentController.cs

@@ -0,0 +1,35 @@
+using Microsoft.AspNetCore.Authorization;
+
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using MTWorkHR.Application.Filters;
+using MTWorkHR.Application.Models;
+using MTWorkHR.Application.Services;
+using MTWorkHR.Application.Services.Interfaces;
+
+namespace MTWorkHR.API.Controllers
+{
+    [Route("api/[controller]")]
+    [ApiController]
+    [AppAuthorize]
+    public class AttachmentController : ControllerBase
+    {
+        private readonly IFileService _fileService;
+
+        public AttachmentController(IFileService fileService)
+        {
+            _fileService = fileService;
+        }
+        
+
+        [HttpPost("Upload")]
+        [ProducesResponseType(StatusCodes.Status200OK)]
+        [Consumes("multipart/form-data")]
+        public async Task<ActionResult<AttachmentResponseDto>> Upload(IFormFile input)
+        {
+            return Ok( await _fileService.UploadFile(input));
+        }
+
+
+    }
+}

+ 13 - 3
MTWorkHR.API/Controllers/CompanyController.cs

@@ -53,15 +53,25 @@ namespace MTWorkHR.API.Controllers
         {
             return await _companyService.Update(input);
         }
-
+        
         [HttpDelete("Delete")]
         [ProducesResponseType(StatusCodes.Status200OK)]
-
+        // [AppAuthorize(Permissions = "Company.Delete")]
+        [Authorize(Policy = "SuperAdminOnly")]
         public async Task Delete([FromQuery] long id)
         {
             await _companyService.Delete(id);
         }
 
-       
+        [HttpDelete("Suspend")]
+        [ProducesResponseType(StatusCodes.Status200OK)]
+        //[AppAuthorize(Permissions = "Company.Suspend")]
+        [Authorize(Policy = "SuperAdminOnly")]
+        public async Task Suspend([FromQuery] long id)
+        {
+            await _companyService.Suspend(id);
+        }
+
+
     }
 }

+ 24 - 2
MTWorkHR.API/Controllers/ContractController.cs

@@ -15,9 +15,14 @@ namespace MTWorkHR.API.Controllers
     public class ContractController : ControllerBase
     {
         private readonly IContractService _ContractService;
-        public ContractController(IContractService UserContractService)
+        private readonly IContractTaskAttachmentService _ContractTaskAttachmentService;
+        private readonly IProjectStageAttachmentService _ProjectStageAttachmentService;
+        private readonly IFileService _fileService;
+
+        public ContractController(IContractService UserContractService, IFileService fileService)
         {
-            this._ContractService = UserContractService;
+            _ContractService = UserContractService;
+            _fileService = fileService;
         }
         [HttpGet("GetAll")]
         [ProducesResponseType(StatusCodes.Status200OK)]
@@ -68,5 +73,22 @@ namespace MTWorkHR.API.Controllers
             return await _ContractService.ChangeStatus(input.ContractId, input.StatusId);
         }
 
+       
+        //[HttpPost("CreateTaskAttachment")]
+        //[ProducesResponseType(StatusCodes.Status200OK)]
+        //[Consumes("multipart/form-data")]
+        //public async Task<ActionResult<AttachmentDto>> CreateTaskAttachment([FromForm] AttachmentDto input)
+        //{
+        //    return await _ContractTaskAttachmentService.Create(input);
+        //}
+
+        //[HttpPost("CreateProjectAttachment")]
+        //[ProducesResponseType(StatusCodes.Status200OK)]
+        //[Consumes("multipart/form-data")]
+        //public async Task<ActionResult<AttachmentDto>> CreateProjectAttachment([FromForm] AttachmentDto input)
+        //{
+        //    return await _ProjectStageAttachmentService.Create(input);
+        //}
+
     }
 }

+ 1 - 1
MTWorkHR.API/Controllers/LookupController.cs

@@ -12,7 +12,7 @@ namespace MTWorkHR.API.Controllers
 {
     [Route("api/[controller]")]
     [ApiController]
-   // [AppAuthorize]
+   
     public class LookupController : ControllerBase
     {
         private readonly ILookupService _LookupService;

+ 11 - 1
MTWorkHR.API/Controllers/UserController.cs

@@ -37,7 +37,7 @@ namespace MTWorkHR.API.Controllers
             return Ok(await _userService.GetById());
         }
         [HttpGet("GetById")]
-        public async Task<ActionResult<UserDto>> GetById(string userId)
+        public async Task<ActionResult<UserDto>> GetById([FromQuery] string userId)
         {
             return Ok(await _userService.GetById(userId));
         }
@@ -64,6 +64,7 @@ namespace MTWorkHR.API.Controllers
             return Ok(await _userService.Update(input));
         }
 
+        [Authorize(Policy = "SuperAdminOnly")]
         [HttpDelete("Delete")]
         [ProducesResponseType(StatusCodes.Status200OK)]
 
@@ -72,6 +73,15 @@ namespace MTWorkHR.API.Controllers
             await _userService.Delete(id);
         }
 
+        [Authorize(Policy = "SuperAdminOnly")]
+        [HttpDelete("Suspend")]
+        [ProducesResponseType(StatusCodes.Status200OK)]
+
+        public async Task Suspend([FromQuery] string id)
+        {
+            await _userService.Suspend(id);
+        }
+
         [HttpPost("ResetPassword")]
         [ProducesResponseType(StatusCodes.Status200OK)]
         public async Task<bool> ResetPassword([FromBody] ResetPasswordDto input)

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

@@ -30,6 +30,12 @@
   </ItemGroup>
 
   <ItemGroup>
+    <Compile Update="Reports\ProjectStages.cs">
+      <SubType>XtraReport</SubType>
+    </Compile>
+    <Compile Update="Reports\ContractTasks.cs">
+      <SubType>XtraReport</SubType>
+    </Compile>
     <Compile Update="Reports\ContractReport.cs">
       <SubType>XtraReport</SubType>
     </Compile>

+ 5 - 0
MTWorkHR.API/Program.cs

@@ -161,6 +161,11 @@ builder.Services.AddSwaggerGen(swagger =>
                 });
 });
 
+builder.Services.AddAuthorization(options =>
+{
+    options.AddPolicy("SuperAdminOnly", policy => policy.RequireRole("Admin"));
+});
+
 //--------------------------
 var app = builder.Build();
 

+ 122 - 33
MTWorkHR.API/Reports/ContractReport.Designer.cs

@@ -186,9 +186,6 @@
             this.xrLabel64 = new DevExpress.XtraReports.UI.XRLabel();
             this.xrLabel65 = new DevExpress.XtraReports.UI.XRLabel();
             this.xrLabel61 = new DevExpress.XtraReports.UI.XRLabel();
-            this.xrSubreport1 = new DevExpress.XtraReports.UI.XRSubreport();
-            this.ContractId = new DevExpress.XtraReports.Parameters.Parameter();
-            this.xrLabel60 = new DevExpress.XtraReports.UI.XRLabel();
             this.xrLabel59 = new DevExpress.XtraReports.UI.XRLabel();
             this.xrLabel58 = new DevExpress.XtraReports.UI.XRLabel();
             this.xrLabel57 = new DevExpress.XtraReports.UI.XRLabel();
@@ -246,6 +243,16 @@
             this.xrLabel5 = new DevExpress.XtraReports.UI.XRLabel();
             this.xrLabel2 = new DevExpress.XtraReports.UI.XRLabel();
             this.xrLabel1 = new DevExpress.XtraReports.UI.XRLabel();
+            this.SubBand1 = new DevExpress.XtraReports.UI.SubBand();
+            this.xrLabel60 = new DevExpress.XtraReports.UI.XRLabel();
+            this.xrSubreport1 = new DevExpress.XtraReports.UI.XRSubreport();
+            this.ContractId = new DevExpress.XtraReports.Parameters.Parameter();
+            this.SubBand2 = new DevExpress.XtraReports.UI.SubBand();
+            this.xrLabel80 = new DevExpress.XtraReports.UI.XRLabel();
+            this.xrSubreport2 = new DevExpress.XtraReports.UI.XRSubreport();
+            this.SubBand3 = new DevExpress.XtraReports.UI.SubBand();
+            this.xrLabel81 = new DevExpress.XtraReports.UI.XRLabel();
+            this.xrSubreport3 = new DevExpress.XtraReports.UI.XRSubreport();
             this.sqlDataSource1 = new DevExpress.DataAccess.Sql.SqlDataSource(this.components);
             this.xrControlStyle1 = new DevExpress.XtraReports.UI.XRControlStyle();
             ((System.ComponentModel.ISupportInitialize)(this)).BeginInit();
@@ -307,8 +314,6 @@
             this.xrLabel64,
             this.xrLabel65,
             this.xrLabel61,
-            this.xrSubreport1,
-            this.xrLabel60,
             this.xrLabel59,
             this.xrLabel58,
             this.xrLabel57,
@@ -367,6 +372,10 @@
             this.xrLabel2,
             this.xrLabel1});
             this.Detail.Name = "Detail";
+            this.Detail.SubBands.AddRange(new DevExpress.XtraReports.UI.SubBand[] {
+            this.SubBand1,
+            this.SubBand2,
+            this.SubBand3});
             // 
             // xrLabel79
             // 
@@ -512,28 +521,6 @@
             this.xrLabel61.StylePriority.UseBorders = false;
             this.xrLabel61.StylePriority.UseFont = false;
             // 
-            // xrSubreport1
-            // 
-            this.xrSubreport1.Name = "xrSubreport1";
-            this.xrSubreport1.ParameterBindings.Add(new DevExpress.XtraReports.UI.ParameterBinding("ContractId", this.ContractId));
-            this.xrSubreport1.ReportSource = new MTWorkHR.Infrastructure.Reports.ContractAllowances();
-            // 
-            // ContractId
-            // 
-            this.ContractId.AllowNull = true;
-            this.ContractId.Name = "ContractId";
-            this.ContractId.Type = typeof(int);
-            this.ContractId.ValueInfo = "1";
-            // 
-            // xrLabel60
-            // 
-            this.xrLabel60.Borders = DevExpress.XtraPrinting.BorderSide.Bottom;
-            this.xrLabel60.Multiline = true;
-            this.xrLabel60.Name = "xrLabel60";
-            this.xrLabel60.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
-            this.xrLabel60.StylePriority.UseBorders = false;
-            this.xrLabel60.StylePriority.UseFont = false;
-            // 
             // xrLabel59
             // 
             this.xrLabel59.ExpressionBindings.AddRange(new DevExpress.XtraReports.UI.ExpressionBinding[] {
@@ -985,6 +972,85 @@
             this.xrLabel1.Name = "xrLabel1";
             this.xrLabel1.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
             // 
+            // SubBand1
+            // 
+            this.SubBand1.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
+            this.xrLabel60,
+            this.xrSubreport1});
+            this.SubBand1.ExpressionBindings.AddRange(new DevExpress.XtraReports.UI.ExpressionBinding[] {
+            new DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Visible", "Iif(([ContractTypeId] == 1), true, false)\n")});
+            this.SubBand1.Name = "SubBand1";
+            // 
+            // xrLabel60
+            // 
+            this.xrLabel60.Borders = DevExpress.XtraPrinting.BorderSide.Bottom;
+            this.xrLabel60.Multiline = true;
+            this.xrLabel60.Name = "xrLabel60";
+            this.xrLabel60.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
+            this.xrLabel60.StylePriority.UseBorders = false;
+            this.xrLabel60.StylePriority.UseFont = false;
+            // 
+            // xrSubreport1
+            // 
+            this.xrSubreport1.Name = "xrSubreport1";
+            this.xrSubreport1.ParameterBindings.Add(new DevExpress.XtraReports.UI.ParameterBinding("ContractId", this.ContractId));
+            this.xrSubreport1.ReportSource = new MTWorkHR.Infrastructure.Reports.ContractAllowances();
+            // 
+            // ContractId
+            // 
+            this.ContractId.AllowNull = true;
+            this.ContractId.Name = "ContractId";
+            this.ContractId.Type = typeof(int);
+            this.ContractId.ValueInfo = "1";
+            // 
+            // SubBand2
+            // 
+            this.SubBand2.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
+            this.xrLabel80,
+            this.xrSubreport2});
+            this.SubBand2.ExpressionBindings.AddRange(new DevExpress.XtraReports.UI.ExpressionBinding[] {
+            new DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Visible", "Iif(([ContractTypeId] == 4), true, false)\n")});
+            this.SubBand2.Name = "SubBand2";
+            // 
+            // xrLabel80
+            // 
+            this.xrLabel80.Borders = DevExpress.XtraPrinting.BorderSide.Bottom;
+            this.xrLabel80.Multiline = true;
+            this.xrLabel80.Name = "xrLabel80";
+            this.xrLabel80.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
+            this.xrLabel80.StylePriority.UseBorders = false;
+            this.xrLabel80.StylePriority.UseFont = false;
+            // 
+            // xrSubreport2
+            // 
+            this.xrSubreport2.Name = "xrSubreport2";
+            this.xrSubreport2.ParameterBindings.Add(new DevExpress.XtraReports.UI.ParameterBinding("ContractId", this.ContractId));
+            this.xrSubreport2.ReportSource = new MTWorkHR.Infrastructure.Reports.ContractTasks();
+            // 
+            // SubBand3
+            // 
+            this.SubBand3.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
+            this.xrLabel81,
+            this.xrSubreport3});
+            this.SubBand3.ExpressionBindings.AddRange(new DevExpress.XtraReports.UI.ExpressionBinding[] {
+            new DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Visible", "Iif(([ContractTypeId] == 3), true, false)\n")});
+            this.SubBand3.Name = "SubBand3";
+            // 
+            // xrLabel81
+            // 
+            this.xrLabel81.Borders = DevExpress.XtraPrinting.BorderSide.Bottom;
+            this.xrLabel81.Multiline = true;
+            this.xrLabel81.Name = "xrLabel81";
+            this.xrLabel81.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
+            this.xrLabel81.StylePriority.UseBorders = false;
+            this.xrLabel81.StylePriority.UseFont = false;
+            // 
+            // xrSubreport3
+            // 
+            this.xrSubreport3.Name = "xrSubreport3";
+            this.xrSubreport3.ParameterBindings.Add(new DevExpress.XtraReports.UI.ParameterBinding("ContractId", this.ContractId));
+            this.xrSubreport3.ReportSource = new MTWorkHR.Infrastructure.Reports.ProjectStages();
+            // 
             // sqlDataSource1
             // 
             this.sqlDataSource1.ConnectionName = "LocalConnectionString";
@@ -1330,12 +1396,16 @@
             this.DataMember = "Contracts";
             this.DataSource = this.sqlDataSource1;
             this.LocalizationItems.AddRange(new DevExpress.XtraReports.Localization.LocalizationItem[] {
+            new DevExpress.XtraReports.Localization.LocalizationItem(this.BottomMargin, "Default", "HeightF", 33.33333F),
             new DevExpress.XtraReports.Localization.LocalizationItem(this.ContractId, "Default", "Description", "ContractId"),
             new DevExpress.XtraReports.Localization.LocalizationItem(this, "Default", "Font", new DevExpress.Drawing.DXFont("Arial", 9.75F)),
-            new DevExpress.XtraReports.Localization.LocalizationItem(this, "Default", "Margins", new DevExpress.Drawing.DXMargins(100F, 100F, 84.16666F, 100F)),
+            new DevExpress.XtraReports.Localization.LocalizationItem(this, "Default", "Margins", new DevExpress.Drawing.DXMargins(100F, 100F, 73.83333F, 33.33333F)),
             new DevExpress.XtraReports.Localization.LocalizationItem(this, "en-US", "Margins", new DevExpress.Drawing.DXMargins(100F, 100F, 84.16666F, 100F)),
-            new DevExpress.XtraReports.Localization.LocalizationItem(this.Detail, "Default", "HeightF", 759.1667F),
-            new DevExpress.XtraReports.Localization.LocalizationItem(this.TopMargin, "Default", "HeightF", 84.16666F),
+            new DevExpress.XtraReports.Localization.LocalizationItem(this.Detail, "Default", "HeightF", 667.5F),
+            new DevExpress.XtraReports.Localization.LocalizationItem(this.SubBand1, "Default", "HeightF", 75.83334F),
+            new DevExpress.XtraReports.Localization.LocalizationItem(this.SubBand2, "Default", "HeightF", 88.33334F),
+            new DevExpress.XtraReports.Localization.LocalizationItem(this.SubBand3, "Default", "HeightF", 80F),
+            new DevExpress.XtraReports.Localization.LocalizationItem(this.TopMargin, "Default", "HeightF", 73.83333F),
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel1, "Default", "LocationFloat", new DevExpress.Utils.PointFloat(122.4999F, 33.83331F)),
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel1, "Default", "SizeF", new System.Drawing.SizeF(201.6667F, 23F)),
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel1, "Default", "Text", "xrLabel1"),
@@ -1573,7 +1643,7 @@
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel6, "Default", "Text", "xrLabel6"),
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel6, "Default", "TextFormatString", "{0:d}"),
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel60, "Default", "Font", new DevExpress.Drawing.DXFont("Arial", 14F, DevExpress.Drawing.DXFontStyle.Bold)),
-            new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel60, "Default", "LocationFloat", new DevExpress.Utils.PointFloat(22.49995F, 665.1667F)),
+            new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel60, "Default", "LocationFloat", new DevExpress.Utils.PointFloat(22.50005F, 0F)),
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel60, "Default", "SizeF", new System.Drawing.SizeF(600F, 23F)),
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel60, "Default", "Text", "Allowances"),
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel61, "Default", "Font", new DevExpress.Drawing.DXFont("Arial", 12F, DevExpress.Drawing.DXFontStyle.Bold)),
@@ -1655,13 +1725,25 @@
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel8, "Default", "SizeF", new System.Drawing.SizeF(272.4999F, 47.16666F)),
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel8, "en-US", "SizeF", new System.Drawing.SizeF(272.4999F, 47.16666F)),
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel8, "Default", "Text", "Employee Contract"),
+            new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel80, "Default", "Font", new DevExpress.Drawing.DXFont("Arial", 14F, DevExpress.Drawing.DXFontStyle.Bold)),
+            new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel80, "Default", "LocationFloat", new DevExpress.Utils.PointFloat(22.49995F, 0F)),
+            new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel80, "Default", "SizeF", new System.Drawing.SizeF(600F, 23F)),
+            new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel80, "Default", "Text", "Tasks"),
+            new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel81, "Default", "Font", new DevExpress.Drawing.DXFont("Arial", 14F, DevExpress.Drawing.DXFontStyle.Bold)),
+            new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel81, "Default", "LocationFloat", new DevExpress.Utils.PointFloat(23.33333F, 0F)),
+            new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel81, "Default", "SizeF", new System.Drawing.SizeF(600F, 23F)),
+            new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel81, "Default", "Text", "Projects"),
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel9, "Default", "Font", new DevExpress.Drawing.DXFont("Arial", 12F, DevExpress.Drawing.DXFontStyle.Bold)),
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel9, "Default", "LocationFloat", new DevExpress.Utils.PointFloat(21.66667F, 0F)),
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel9, "Default", "SizeF", new System.Drawing.SizeF(600F, 23F)),
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel9, "en-US", "SizeF", new System.Drawing.SizeF(618.3333F, 23F)),
             new DevExpress.XtraReports.Localization.LocalizationItem(this.xrLabel9, "Default", "Text", "Company Information:"),
-            new DevExpress.XtraReports.Localization.LocalizationItem(this.xrSubreport1, "Default", "LocationFloat", new DevExpress.Utils.PointFloat(23.33323F, 688.1667F)),
-            new DevExpress.XtraReports.Localization.LocalizationItem(this.xrSubreport1, "Default", "SizeF", new System.Drawing.SizeF(599.1667F, 44.66663F))});
+            new DevExpress.XtraReports.Localization.LocalizationItem(this.xrSubreport1, "Default", "LocationFloat", new DevExpress.Utils.PointFloat(23.33333F, 23F)),
+            new DevExpress.XtraReports.Localization.LocalizationItem(this.xrSubreport1, "Default", "SizeF", new System.Drawing.SizeF(599.1667F, 44.66663F)),
+            new DevExpress.XtraReports.Localization.LocalizationItem(this.xrSubreport2, "Default", "LocationFloat", new DevExpress.Utils.PointFloat(22.49995F, 23.00008F)),
+            new DevExpress.XtraReports.Localization.LocalizationItem(this.xrSubreport2, "Default", "SizeF", new System.Drawing.SizeF(600F, 58.66657F)),
+            new DevExpress.XtraReports.Localization.LocalizationItem(this.xrSubreport3, "Default", "LocationFloat", new DevExpress.Utils.PointFloat(23.33333F, 22.99988F)),
+            new DevExpress.XtraReports.Localization.LocalizationItem(this.xrSubreport3, "Default", "SizeF", new System.Drawing.SizeF(600F, 48.83344F))});
             this.Parameters.AddRange(new DevExpress.XtraReports.Parameters.Parameter[] {
             this.ContractId});
             this.StyleSheet.AddRange(new DevExpress.XtraReports.UI.XRControlStyle[] {
@@ -1759,5 +1841,12 @@
         private DevExpress.XtraReports.UI.XRLabel xrLabel76;
         private DevExpress.XtraReports.UI.XRLabel xrLabel79;
         private DevExpress.XtraReports.UI.XRLabel xrLabel78;
+        private DevExpress.XtraReports.UI.XRSubreport xrSubreport2;
+        private DevExpress.XtraReports.UI.XRLabel xrLabel80;
+        private DevExpress.XtraReports.UI.XRLabel xrLabel81;
+        private DevExpress.XtraReports.UI.XRSubreport xrSubreport3;
+        private DevExpress.XtraReports.UI.SubBand SubBand1;
+        private DevExpress.XtraReports.UI.SubBand SubBand2;
+        private DevExpress.XtraReports.UI.SubBand SubBand3;
     }
 }

+ 281 - 0
MTWorkHR.API/Reports/ContractTasks.Designer.cs

@@ -0,0 +1,281 @@
+namespace MTWorkHR.Infrastructure.Reports
+{
+    partial class ContractTasks
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary> 
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.components = new System.ComponentModel.Container();
+            DevExpress.DataAccess.Sql.SelectQuery selectQuery1 = new DevExpress.DataAccess.Sql.SelectQuery();
+            DevExpress.DataAccess.Sql.Column column1 = new DevExpress.DataAccess.Sql.Column();
+            DevExpress.DataAccess.Sql.ColumnExpression columnExpression1 = new DevExpress.DataAccess.Sql.ColumnExpression();
+            DevExpress.DataAccess.Sql.Table table1 = new DevExpress.DataAccess.Sql.Table();
+            DevExpress.DataAccess.Sql.Column column2 = new DevExpress.DataAccess.Sql.Column();
+            DevExpress.DataAccess.Sql.ColumnExpression columnExpression2 = new DevExpress.DataAccess.Sql.ColumnExpression();
+            DevExpress.DataAccess.Sql.Column column3 = new DevExpress.DataAccess.Sql.Column();
+            DevExpress.DataAccess.Sql.ColumnExpression columnExpression3 = new DevExpress.DataAccess.Sql.ColumnExpression();
+            DevExpress.DataAccess.Sql.Column column4 = new DevExpress.DataAccess.Sql.Column();
+            DevExpress.DataAccess.Sql.ColumnExpression columnExpression4 = new DevExpress.DataAccess.Sql.ColumnExpression();
+            DevExpress.DataAccess.Sql.QueryParameter queryParameter1 = new DevExpress.DataAccess.Sql.QueryParameter();
+            DevExpress.DataAccess.Sql.QueryParameter queryParameter2 = new DevExpress.DataAccess.Sql.QueryParameter();
+            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ContractTasks));
+            this.TopMargin = new DevExpress.XtraReports.UI.TopMarginBand();
+            this.xrLabel4 = new DevExpress.XtraReports.UI.XRLabel();
+            this.xrLine1 = new DevExpress.XtraReports.UI.XRLine();
+            this.xrLabel3 = new DevExpress.XtraReports.UI.XRLabel();
+            this.xrLabel2 = new DevExpress.XtraReports.UI.XRLabel();
+            this.xrLabel1 = new DevExpress.XtraReports.UI.XRLabel();
+            this.BottomMargin = new DevExpress.XtraReports.UI.BottomMarginBand();
+            this.Detail = new DevExpress.XtraReports.UI.DetailBand();
+            this.xrTable1 = new DevExpress.XtraReports.UI.XRTable();
+            this.xrTableRow1 = new DevExpress.XtraReports.UI.XRTableRow();
+            this.xrTableCell1 = new DevExpress.XtraReports.UI.XRTableCell();
+            this.xrTableCell2 = new DevExpress.XtraReports.UI.XRTableCell();
+            this.xrTableCell4 = new DevExpress.XtraReports.UI.XRTableCell();
+            this.xrTableCell3 = new DevExpress.XtraReports.UI.XRTableCell();
+            this.sqlDataSource1 = new DevExpress.DataAccess.Sql.SqlDataSource(this.components);
+            this.ContractId = new DevExpress.XtraReports.Parameters.Parameter();
+            ((System.ComponentModel.ISupportInitialize)(this.xrTable1)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this)).BeginInit();
+            // 
+            // TopMargin
+            // 
+            this.TopMargin.Borders = DevExpress.XtraPrinting.BorderSide.None;
+            this.TopMargin.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
+            this.xrLabel4,
+            this.xrLine1,
+            this.xrLabel3,
+            this.xrLabel2,
+            this.xrLabel1});
+            this.TopMargin.Name = "TopMargin";
+            this.TopMargin.StylePriority.UseBorders = false;
+            // 
+            // xrLabel4
+            // 
+            this.xrLabel4.Font = new DevExpress.Drawing.DXFont("Arial", 9.75F, DevExpress.Drawing.DXFontStyle.Bold);
+            this.xrLabel4.LocationFloat = new DevExpress.Utils.PointFloat(288.6765F, 75F);
+            this.xrLabel4.Multiline = true;
+            this.xrLabel4.Name = "xrLabel4";
+            this.xrLabel4.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
+            this.xrLabel4.SizeF = new System.Drawing.SizeF(100F, 23F);
+            this.xrLabel4.StylePriority.UseFont = false;
+            this.xrLabel4.Text = "Amount";
+            // 
+            // xrLine1
+            // 
+            this.xrLine1.LocationFloat = new DevExpress.Utils.PointFloat(2.098083E-05F, 98F);
+            this.xrLine1.Name = "xrLine1";
+            this.xrLine1.SizeF = new System.Drawing.SizeF(641F, 2F);
+            // 
+            // xrLabel3
+            // 
+            this.xrLabel3.Font = new DevExpress.Drawing.DXFont("Arial", 9.75F, DevExpress.Drawing.DXFontStyle.Bold);
+            this.xrLabel3.LocationFloat = new DevExpress.Utils.PointFloat(388.6765F, 75F);
+            this.xrLabel3.Multiline = true;
+            this.xrLabel3.Name = "xrLabel3";
+            this.xrLabel3.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
+            this.xrLabel3.SizeF = new System.Drawing.SizeF(158.3333F, 23F);
+            this.xrLabel3.StylePriority.UseFont = false;
+            this.xrLabel3.Text = "Scope of work";
+            // 
+            // xrLabel2
+            // 
+            this.xrLabel2.Font = new DevExpress.Drawing.DXFont("Arial", 9.75F, DevExpress.Drawing.DXFontStyle.Bold);
+            this.xrLabel2.LocationFloat = new DevExpress.Utils.PointFloat(188.6765F, 75F);
+            this.xrLabel2.Multiline = true;
+            this.xrLabel2.Name = "xrLabel2";
+            this.xrLabel2.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
+            this.xrLabel2.SizeF = new System.Drawing.SizeF(100F, 23F);
+            this.xrLabel2.StylePriority.UseFont = false;
+            this.xrLabel2.Text = "Start Date";
+            // 
+            // xrLabel1
+            // 
+            this.xrLabel1.Font = new DevExpress.Drawing.DXFont("Arial", 9.75F, DevExpress.Drawing.DXFontStyle.Bold);
+            this.xrLabel1.LocationFloat = new DevExpress.Utils.PointFloat(0F, 75F);
+            this.xrLabel1.Multiline = true;
+            this.xrLabel1.Name = "xrLabel1";
+            this.xrLabel1.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
+            this.xrLabel1.SizeF = new System.Drawing.SizeF(100F, 23F);
+            this.xrLabel1.StylePriority.UseFont = false;
+            this.xrLabel1.Text = "Title";
+            // 
+            // BottomMargin
+            // 
+            this.BottomMargin.HeightF = 6.666667F;
+            this.BottomMargin.Name = "BottomMargin";
+            // 
+            // Detail
+            // 
+            this.Detail.Borders = DevExpress.XtraPrinting.BorderSide.None;
+            this.Detail.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
+            this.xrTable1});
+            this.Detail.HeightF = 33.33333F;
+            this.Detail.Name = "Detail";
+            this.Detail.StylePriority.UseBorders = false;
+            // 
+            // xrTable1
+            // 
+            this.xrTable1.LocationFloat = new DevExpress.Utils.PointFloat(2.098083E-05F, 0F);
+            this.xrTable1.Name = "xrTable1";
+            this.xrTable1.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 96F);
+            this.xrTable1.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] {
+            this.xrTableRow1});
+            this.xrTable1.SizeF = new System.Drawing.SizeF(650F, 25F);
+            // 
+            // xrTableRow1
+            // 
+            this.xrTableRow1.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] {
+            this.xrTableCell1,
+            this.xrTableCell2,
+            this.xrTableCell4,
+            this.xrTableCell3});
+            this.xrTableRow1.Name = "xrTableRow1";
+            this.xrTableRow1.Weight = 1D;
+            // 
+            // xrTableCell1
+            // 
+            this.xrTableCell1.ExpressionBindings.AddRange(new DevExpress.XtraReports.UI.ExpressionBinding[] {
+            new DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[Title]")});
+            this.xrTableCell1.Multiline = true;
+            this.xrTableCell1.Name = "xrTableCell1";
+            this.xrTableCell1.Text = "xrTableCell1";
+            this.xrTableCell1.Weight = 2.4673079192938734D;
+            // 
+            // xrTableCell2
+            // 
+            this.xrTableCell2.ExpressionBindings.AddRange(new DevExpress.XtraReports.UI.ExpressionBinding[] {
+            new DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[StartDate]")});
+            this.xrTableCell2.Multiline = true;
+            this.xrTableCell2.Name = "xrTableCell2";
+            this.xrTableCell2.Text = "xrTableCell2";
+            this.xrTableCell2.TextFormatString = "{0:dd/MM/yyyy}";
+            this.xrTableCell2.Weight = 1.3076915240042131D;
+            // 
+            // xrTableCell4
+            // 
+            this.xrTableCell4.ExpressionBindings.AddRange(new DevExpress.XtraReports.UI.ExpressionBinding[] {
+            new DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[Amount]")});
+            this.xrTableCell4.Multiline = true;
+            this.xrTableCell4.Name = "xrTableCell4";
+            this.xrTableCell4.Text = "xrTableCell4";
+            this.xrTableCell4.Weight = 1.3076917235422048D;
+            // 
+            // xrTableCell3
+            // 
+            this.xrTableCell3.ExpressionBindings.AddRange(new DevExpress.XtraReports.UI.ExpressionBinding[] {
+            new DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[ScopeOfWork]")});
+            this.xrTableCell3.Multiline = true;
+            this.xrTableCell3.Name = "xrTableCell3";
+            this.xrTableCell3.Text = "xrTableCell3";
+            this.xrTableCell3.Weight = 3.4173080162502303D;
+            // 
+            // sqlDataSource1
+            // 
+            this.sqlDataSource1.ConnectionName = "LocalConnectionString";
+            this.sqlDataSource1.Name = "sqlDataSource1";
+            columnExpression1.ColumnName = "Title";
+            table1.MetaSerializable = "<Meta X=\"30\" Y=\"30\" Width=\"125\" Height=\"265\" />";
+            table1.Name = "ContractTask";
+            columnExpression1.Table = table1;
+            column1.Expression = columnExpression1;
+            columnExpression2.ColumnName = "StartDate";
+            columnExpression2.Table = table1;
+            column2.Expression = columnExpression2;
+            columnExpression3.ColumnName = "ScopeOfWork";
+            columnExpression3.Table = table1;
+            column3.Expression = columnExpression3;
+            columnExpression4.ColumnName = "Amount";
+            columnExpression4.Table = table1;
+            column4.Expression = columnExpression4;
+            selectQuery1.Columns.Add(column1);
+            selectQuery1.Columns.Add(column2);
+            selectQuery1.Columns.Add(column3);
+            selectQuery1.Columns.Add(column4);
+            selectQuery1.FilterString = "[ContractTask.ContractId] = ?ContractId";
+            selectQuery1.GroupFilterString = "";
+            selectQuery1.Name = "Query";
+            queryParameter1.Name = "ContractId";
+            queryParameter1.Type = typeof(global::DevExpress.DataAccess.Expression);
+            queryParameter1.Value = new DevExpress.DataAccess.Expression("?ContractId", typeof(long));
+            queryParameter2.Name = "Parameter1";
+            queryParameter2.Type = typeof(global::DevExpress.DataAccess.Expression);
+            queryParameter2.Value = new DevExpress.DataAccess.Expression("?ContractId", typeof(int));
+            selectQuery1.Parameters.AddRange(new DevExpress.DataAccess.Sql.QueryParameter[] {
+            queryParameter1,
+            queryParameter2});
+            selectQuery1.Tables.Add(table1);
+            this.sqlDataSource1.Queries.AddRange(new DevExpress.DataAccess.Sql.SqlQuery[] {
+            selectQuery1});
+            this.sqlDataSource1.ResultSchemaSerializable = resources.GetString("sqlDataSource1.ResultSchemaSerializable");
+            // 
+            // ContractId
+            // 
+            this.ContractId.Description = "ContractId";
+            this.ContractId.Name = "ContractId";
+            this.ContractId.Type = typeof(int);
+            this.ContractId.ValueInfo = "0";
+            // 
+            // ContractTasks
+            // 
+            this.Bands.AddRange(new DevExpress.XtraReports.UI.Band[] {
+            this.TopMargin,
+            this.BottomMargin,
+            this.Detail});
+            this.ComponentStorage.AddRange(new System.ComponentModel.IComponent[] {
+            this.sqlDataSource1});
+            this.DataMember = "Query";
+            this.DataSource = this.sqlDataSource1;
+            this.Font = new DevExpress.Drawing.DXFont("Arial", 9.75F);
+            this.Margins = new DevExpress.Drawing.DXMargins(100F, 100F, 100F, 6.666667F);
+            this.Parameters.AddRange(new DevExpress.XtraReports.Parameters.Parameter[] {
+            this.ContractId});
+            this.Version = "24.1";
+            ((System.ComponentModel.ISupportInitialize)(this.xrTable1)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this)).EndInit();
+
+        }
+
+        #endregion
+
+        private DevExpress.XtraReports.UI.TopMarginBand TopMargin;
+        private DevExpress.XtraReports.UI.BottomMarginBand BottomMargin;
+        private DevExpress.XtraReports.UI.DetailBand Detail;
+        private DevExpress.DataAccess.Sql.SqlDataSource sqlDataSource1;
+        private DevExpress.XtraReports.UI.XRLabel xrLabel1;
+        private DevExpress.XtraReports.UI.XRTable xrTable1;
+        private DevExpress.XtraReports.UI.XRTableRow xrTableRow1;
+        private DevExpress.XtraReports.UI.XRTableCell xrTableCell1;
+        private DevExpress.XtraReports.UI.XRTableCell xrTableCell2;
+        private DevExpress.XtraReports.UI.XRTableCell xrTableCell3;
+        private DevExpress.XtraReports.UI.XRLabel xrLabel3;
+        private DevExpress.XtraReports.UI.XRLabel xrLabel2;
+        private DevExpress.XtraReports.Parameters.Parameter ContractId;
+        private DevExpress.XtraReports.UI.XRLine xrLine1;
+        private DevExpress.XtraReports.UI.XRTableCell xrTableCell4;
+        private DevExpress.XtraReports.UI.XRLabel xrLabel4;
+    }
+}

+ 16 - 0
MTWorkHR.API/Reports/ContractTasks.cs

@@ -0,0 +1,16 @@
+using DevExpress.XtraReports.UI;
+using System;
+using System.Collections;
+using System.ComponentModel;
+using System.Drawing;
+
+namespace MTWorkHR.Infrastructure.Reports
+{
+    public partial class ContractTasks : DevExpress.XtraReports.UI.XtraReport
+    {
+        public ContractTasks()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 123 - 0
MTWorkHR.API/Reports/ContractTasks.resx

@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <data name="sqlDataSource1.ResultSchemaSerializable" xml:space="preserve">
+    <value>PERhdGFTZXQgTmFtZT0ic3FsRGF0YVNvdXJjZTEiPjxWaWV3IE5hbWU9IlF1ZXJ5Ij48RmllbGQgTmFtZT0iVGl0bGUiIFR5cGU9IlN0cmluZyIgLz48RmllbGQgTmFtZT0iU3RhcnREYXRlIiBUeXBlPSJEYXRlVGltZSIgLz48RmllbGQgTmFtZT0iU2NvcGVPZldvcmsiIFR5cGU9IlN0cmluZyIgLz48RmllbGQgTmFtZT0iQW1vdW50IiBUeXBlPSJEZWNpbWFsIiAvPjwvVmlldz48L0RhdGFTZXQ+</value>
+  </data>
+</root>

+ 313 - 0
MTWorkHR.API/Reports/ProjectStages.Designer.cs

@@ -0,0 +1,313 @@
+namespace MTWorkHR.Infrastructure.Reports
+{
+    partial class ProjectStages
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary> 
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.components = new System.ComponentModel.Container();
+            DevExpress.DataAccess.Sql.SelectQuery selectQuery1 = new DevExpress.DataAccess.Sql.SelectQuery();
+            DevExpress.DataAccess.Sql.Column column1 = new DevExpress.DataAccess.Sql.Column();
+            DevExpress.DataAccess.Sql.ColumnExpression columnExpression1 = new DevExpress.DataAccess.Sql.ColumnExpression();
+            DevExpress.DataAccess.Sql.Table table1 = new DevExpress.DataAccess.Sql.Table();
+            DevExpress.DataAccess.Sql.Column column2 = new DevExpress.DataAccess.Sql.Column();
+            DevExpress.DataAccess.Sql.ColumnExpression columnExpression2 = new DevExpress.DataAccess.Sql.ColumnExpression();
+            DevExpress.DataAccess.Sql.Column column3 = new DevExpress.DataAccess.Sql.Column();
+            DevExpress.DataAccess.Sql.ColumnExpression columnExpression3 = new DevExpress.DataAccess.Sql.ColumnExpression();
+            DevExpress.DataAccess.Sql.Column column4 = new DevExpress.DataAccess.Sql.Column();
+            DevExpress.DataAccess.Sql.ColumnExpression columnExpression4 = new DevExpress.DataAccess.Sql.ColumnExpression();
+            DevExpress.DataAccess.Sql.Column column5 = new DevExpress.DataAccess.Sql.Column();
+            DevExpress.DataAccess.Sql.ColumnExpression columnExpression5 = new DevExpress.DataAccess.Sql.ColumnExpression();
+            DevExpress.DataAccess.Sql.QueryParameter queryParameter1 = new DevExpress.DataAccess.Sql.QueryParameter();
+            DevExpress.DataAccess.Sql.QueryParameter queryParameter2 = new DevExpress.DataAccess.Sql.QueryParameter();
+            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ProjectStages));
+            this.TopMargin = new DevExpress.XtraReports.UI.TopMarginBand();
+            this.xrLabel4 = new DevExpress.XtraReports.UI.XRLabel();
+            this.xrLine1 = new DevExpress.XtraReports.UI.XRLine();
+            this.xrLabel3 = new DevExpress.XtraReports.UI.XRLabel();
+            this.xrLabel2 = new DevExpress.XtraReports.UI.XRLabel();
+            this.xrLabel1 = new DevExpress.XtraReports.UI.XRLabel();
+            this.BottomMargin = new DevExpress.XtraReports.UI.BottomMarginBand();
+            this.Detail = new DevExpress.XtraReports.UI.DetailBand();
+            this.xrTable1 = new DevExpress.XtraReports.UI.XRTable();
+            this.xrTableRow1 = new DevExpress.XtraReports.UI.XRTableRow();
+            this.xrTableCell1 = new DevExpress.XtraReports.UI.XRTableCell();
+            this.xrTableCell2 = new DevExpress.XtraReports.UI.XRTableCell();
+            this.xrTableCell4 = new DevExpress.XtraReports.UI.XRTableCell();
+            this.xrTableCell3 = new DevExpress.XtraReports.UI.XRTableCell();
+            this.sqlDataSource1 = new DevExpress.DataAccess.Sql.SqlDataSource(this.components);
+            this.ContractId = new DevExpress.XtraReports.Parameters.Parameter();
+            this.xrTableCell5 = new DevExpress.XtraReports.UI.XRTableCell();
+            this.xrLabel5 = new DevExpress.XtraReports.UI.XRLabel();
+            ((System.ComponentModel.ISupportInitialize)(this.xrTable1)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this)).BeginInit();
+            // 
+            // TopMargin
+            // 
+            this.TopMargin.Borders = DevExpress.XtraPrinting.BorderSide.None;
+            this.TopMargin.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
+            this.xrLabel5,
+            this.xrLabel4,
+            this.xrLine1,
+            this.xrLabel3,
+            this.xrLabel2,
+            this.xrLabel1});
+            this.TopMargin.Name = "TopMargin";
+            this.TopMargin.StylePriority.UseBorders = false;
+            // 
+            // xrLabel4
+            // 
+            this.xrLabel4.Font = new DevExpress.Drawing.DXFont("Arial", 9.75F, DevExpress.Drawing.DXFontStyle.Bold);
+            this.xrLabel4.LocationFloat = new DevExpress.Utils.PointFloat(285.0001F, 75F);
+            this.xrLabel4.Multiline = true;
+            this.xrLabel4.Name = "xrLabel4";
+            this.xrLabel4.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
+            this.xrLabel4.SizeF = new System.Drawing.SizeF(76.66666F, 23F);
+            this.xrLabel4.StylePriority.UseFont = false;
+            this.xrLabel4.Text = "Amount %";
+            // 
+            // xrLine1
+            // 
+            this.xrLine1.LocationFloat = new DevExpress.Utils.PointFloat(2.098083E-05F, 98F);
+            this.xrLine1.Name = "xrLine1";
+            this.xrLine1.SizeF = new System.Drawing.SizeF(641F, 2F);
+            // 
+            // xrLabel3
+            // 
+            this.xrLabel3.Font = new DevExpress.Drawing.DXFont("Arial", 9.75F, DevExpress.Drawing.DXFontStyle.Bold);
+            this.xrLabel3.LocationFloat = new DevExpress.Utils.PointFloat(361.6667F, 75F);
+            this.xrLabel3.Multiline = true;
+            this.xrLabel3.Name = "xrLabel3";
+            this.xrLabel3.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
+            this.xrLabel3.SizeF = new System.Drawing.SizeF(158.3333F, 23F);
+            this.xrLabel3.StylePriority.UseFont = false;
+            this.xrLabel3.Text = "Scope of work";
+            // 
+            // xrLabel2
+            // 
+            this.xrLabel2.Font = new DevExpress.Drawing.DXFont("Arial", 9.75F, DevExpress.Drawing.DXFontStyle.Bold);
+            this.xrLabel2.LocationFloat = new DevExpress.Utils.PointFloat(218.9805F, 63.33333F);
+            this.xrLabel2.Multiline = true;
+            this.xrLabel2.Name = "xrLabel2";
+            this.xrLabel2.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
+            this.xrLabel2.SizeF = new System.Drawing.SizeF(66.01958F, 34.66668F);
+            this.xrLabel2.StylePriority.UseFont = false;
+            this.xrLabel2.Text = "Expected End Date";
+            // 
+            // xrLabel1
+            // 
+            this.xrLabel1.Font = new DevExpress.Drawing.DXFont("Arial", 9.75F, DevExpress.Drawing.DXFontStyle.Bold);
+            this.xrLabel1.LocationFloat = new DevExpress.Utils.PointFloat(0F, 75F);
+            this.xrLabel1.Multiline = true;
+            this.xrLabel1.Name = "xrLabel1";
+            this.xrLabel1.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
+            this.xrLabel1.SizeF = new System.Drawing.SizeF(100F, 23F);
+            this.xrLabel1.StylePriority.UseFont = false;
+            this.xrLabel1.Text = "Title";
+            // 
+            // BottomMargin
+            // 
+            this.BottomMargin.HeightF = 6.666667F;
+            this.BottomMargin.Name = "BottomMargin";
+            // 
+            // Detail
+            // 
+            this.Detail.Borders = DevExpress.XtraPrinting.BorderSide.None;
+            this.Detail.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
+            this.xrTable1});
+            this.Detail.HeightF = 33.33333F;
+            this.Detail.Name = "Detail";
+            this.Detail.StylePriority.UseBorders = false;
+            // 
+            // xrTable1
+            // 
+            this.xrTable1.LocationFloat = new DevExpress.Utils.PointFloat(2.098083E-05F, 0F);
+            this.xrTable1.Name = "xrTable1";
+            this.xrTable1.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 96F);
+            this.xrTable1.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] {
+            this.xrTableRow1});
+            this.xrTable1.SizeF = new System.Drawing.SizeF(650F, 25F);
+            // 
+            // xrTableRow1
+            // 
+            this.xrTableRow1.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] {
+            this.xrTableCell1,
+            this.xrTableCell2,
+            this.xrTableCell4,
+            this.xrTableCell5,
+            this.xrTableCell3});
+            this.xrTableRow1.Name = "xrTableRow1";
+            this.xrTableRow1.Weight = 1D;
+            // 
+            // xrTableCell1
+            // 
+            this.xrTableCell1.ExpressionBindings.AddRange(new DevExpress.XtraReports.UI.ExpressionBinding[] {
+            new DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[Title]")});
+            this.xrTableCell1.Multiline = true;
+            this.xrTableCell1.Name = "xrTableCell1";
+            this.xrTableCell1.Text = "xrTableCell1";
+            this.xrTableCell1.Weight = 2.2284024744877051D;
+            // 
+            // xrTableCell2
+            // 
+            this.xrTableCell2.ExpressionBindings.AddRange(new DevExpress.XtraReports.UI.ExpressionBinding[] {
+            new DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[StartDate]")});
+            this.xrTableCell2.Multiline = true;
+            this.xrTableCell2.Name = "xrTableCell2";
+            this.xrTableCell2.Text = "xrTableCell2";
+            this.xrTableCell2.TextFormatString = "{0:dd/MM/yyyy}";
+            this.xrTableCell2.Weight = 1.0757408220807978D;
+            // 
+            // xrTableCell4
+            // 
+            this.xrTableCell4.ExpressionBindings.AddRange(new DevExpress.XtraReports.UI.ExpressionBinding[] {
+            new DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[ExpectedEndDate]")});
+            this.xrTableCell4.Multiline = true;
+            this.xrTableCell4.Name = "xrTableCell4";
+            this.xrTableCell4.Text = "xrTableCell4";
+            this.xrTableCell4.Weight = 0.99615276477591008D;
+            // 
+            // xrTableCell3
+            // 
+            this.xrTableCell3.ExpressionBindings.AddRange(new DevExpress.XtraReports.UI.ExpressionBinding[] {
+            new DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[ScopeOfWork]")});
+            this.xrTableCell3.Multiline = true;
+            this.xrTableCell3.Name = "xrTableCell3";
+            this.xrTableCell3.Text = "xrTableCell3";
+            this.xrTableCell3.Weight = 4.3980766464412362D;
+            // 
+            // sqlDataSource1
+            // 
+            this.sqlDataSource1.ConnectionName = "LocalConnectionString";
+            this.sqlDataSource1.Name = "sqlDataSource1";
+            columnExpression1.ColumnName = "Title";
+            table1.MetaSerializable = "<Meta X=\"30\" Y=\"30\" Width=\"125\" Height=\"285\" />";
+            table1.Name = "ProjectStage";
+            columnExpression1.Table = table1;
+            column1.Expression = columnExpression1;
+            columnExpression2.ColumnName = "StartDate";
+            columnExpression2.Table = table1;
+            column2.Expression = columnExpression2;
+            columnExpression3.ColumnName = "ExpectedEndDate";
+            columnExpression3.Table = table1;
+            column3.Expression = columnExpression3;
+            columnExpression4.ColumnName = "AmountPercent";
+            columnExpression4.Table = table1;
+            column4.Expression = columnExpression4;
+            columnExpression5.ColumnName = "ScopeOfWork";
+            columnExpression5.Table = table1;
+            column5.Expression = columnExpression5;
+            selectQuery1.Columns.Add(column1);
+            selectQuery1.Columns.Add(column2);
+            selectQuery1.Columns.Add(column3);
+            selectQuery1.Columns.Add(column4);
+            selectQuery1.Columns.Add(column5);
+            selectQuery1.FilterString = "[ProjectStage.ContractId] = ?ContractId";
+            selectQuery1.GroupFilterString = "";
+            selectQuery1.Name = "Query";
+            queryParameter1.Name = "ContractId";
+            queryParameter1.Type = typeof(global::DevExpress.DataAccess.Expression);
+            queryParameter1.Value = new DevExpress.DataAccess.Expression("?ContractId", typeof(long));
+            queryParameter2.Name = "Parameter1";
+            queryParameter2.Type = typeof(global::DevExpress.DataAccess.Expression);
+            queryParameter2.Value = new DevExpress.DataAccess.Expression("?ContractId", typeof(int));
+            selectQuery1.Parameters.AddRange(new DevExpress.DataAccess.Sql.QueryParameter[] {
+            queryParameter1,
+            queryParameter2});
+            selectQuery1.Tables.Add(table1);
+            this.sqlDataSource1.Queries.AddRange(new DevExpress.DataAccess.Sql.SqlQuery[] {
+            selectQuery1});
+            this.sqlDataSource1.ResultSchemaSerializable = resources.GetString("sqlDataSource1.ResultSchemaSerializable");
+            // 
+            // ContractId
+            // 
+            this.ContractId.Description = "ContractId";
+            this.ContractId.Name = "ContractId";
+            this.ContractId.Type = typeof(int);
+            this.ContractId.ValueInfo = "0";
+            // 
+            // xrTableCell5
+            // 
+            this.xrTableCell5.ExpressionBindings.AddRange(new DevExpress.XtraReports.UI.ExpressionBinding[] {
+            new DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[AmountPercent]")});
+            this.xrTableCell5.Multiline = true;
+            this.xrTableCell5.Name = "xrTableCell5";
+            this.xrTableCell5.Text = "xrTableCell5";
+            this.xrTableCell5.Weight = 1.1093181988470771D;
+            // 
+            // xrLabel5
+            // 
+            this.xrLabel5.Font = new DevExpress.Drawing.DXFont("Arial", 9.75F, DevExpress.Drawing.DXFontStyle.Bold);
+            this.xrLabel5.LocationFloat = new DevExpress.Utils.PointFloat(147.6863F, 75F);
+            this.xrLabel5.Multiline = true;
+            this.xrLabel5.Name = "xrLabel5";
+            this.xrLabel5.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
+            this.xrLabel5.SizeF = new System.Drawing.SizeF(71.29414F, 23F);
+            this.xrLabel5.StylePriority.UseFont = false;
+            this.xrLabel5.Text = "Start Date";
+            // 
+            // ProjectStages
+            // 
+            this.Bands.AddRange(new DevExpress.XtraReports.UI.Band[] {
+            this.TopMargin,
+            this.BottomMargin,
+            this.Detail});
+            this.ComponentStorage.AddRange(new System.ComponentModel.IComponent[] {
+            this.sqlDataSource1});
+            this.DataMember = "Query";
+            this.DataSource = this.sqlDataSource1;
+            this.Font = new DevExpress.Drawing.DXFont("Arial", 9.75F);
+            this.Margins = new DevExpress.Drawing.DXMargins(100F, 100F, 100F, 6.666667F);
+            this.Parameters.AddRange(new DevExpress.XtraReports.Parameters.Parameter[] {
+            this.ContractId});
+            this.Version = "24.1";
+            ((System.ComponentModel.ISupportInitialize)(this.xrTable1)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this)).EndInit();
+
+        }
+
+        #endregion
+
+        private DevExpress.XtraReports.UI.TopMarginBand TopMargin;
+        private DevExpress.XtraReports.UI.BottomMarginBand BottomMargin;
+        private DevExpress.XtraReports.UI.DetailBand Detail;
+        private DevExpress.DataAccess.Sql.SqlDataSource sqlDataSource1;
+        private DevExpress.XtraReports.UI.XRLabel xrLabel1;
+        private DevExpress.XtraReports.UI.XRTable xrTable1;
+        private DevExpress.XtraReports.UI.XRTableRow xrTableRow1;
+        private DevExpress.XtraReports.UI.XRTableCell xrTableCell1;
+        private DevExpress.XtraReports.UI.XRTableCell xrTableCell2;
+        private DevExpress.XtraReports.UI.XRTableCell xrTableCell3;
+        private DevExpress.XtraReports.UI.XRLabel xrLabel3;
+        private DevExpress.XtraReports.UI.XRLabel xrLabel2;
+        private DevExpress.XtraReports.Parameters.Parameter ContractId;
+        private DevExpress.XtraReports.UI.XRLine xrLine1;
+        private DevExpress.XtraReports.UI.XRTableCell xrTableCell4;
+        private DevExpress.XtraReports.UI.XRLabel xrLabel4;
+        private DevExpress.XtraReports.UI.XRLabel xrLabel5;
+        private DevExpress.XtraReports.UI.XRTableCell xrTableCell5;
+    }
+}

+ 16 - 0
MTWorkHR.API/Reports/ProjectStages.cs

@@ -0,0 +1,16 @@
+using DevExpress.XtraReports.UI;
+using System;
+using System.Collections;
+using System.ComponentModel;
+using System.Drawing;
+
+namespace MTWorkHR.Infrastructure.Reports
+{
+    public partial class ProjectStages : DevExpress.XtraReports.UI.XtraReport
+    {
+        public ProjectStages()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 123 - 0
MTWorkHR.API/Reports/ProjectStages.resx

@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <data name="sqlDataSource1.ResultSchemaSerializable" xml:space="preserve">
+    <value>PERhdGFTZXQgTmFtZT0ic3FsRGF0YVNvdXJjZTEiPjxWaWV3IE5hbWU9IlF1ZXJ5Ij48RmllbGQgTmFtZT0iVGl0bGUiIFR5cGU9IlN0cmluZyIgLz48RmllbGQgTmFtZT0iU3RhcnREYXRlIiBUeXBlPSJEYXRlVGltZSIgLz48RmllbGQgTmFtZT0iRXhwZWN0ZWRFbmREYXRlIiBUeXBlPSJEYXRlVGltZSIgLz48RmllbGQgTmFtZT0iQW1vdW50UGVyY2VudCIgVHlwZT0iRGVjaW1hbCIgLz48RmllbGQgTmFtZT0iU2NvcGVPZldvcmsiIFR5cGU9IlN0cmluZyIgLz48L1ZpZXc+PC9EYXRhU2V0Pg==</value>
+  </data>
+</root>

+ 2 - 0
MTWorkHR.Application/ApplicationServiceRegistration.cs

@@ -37,6 +37,8 @@ namespace MTWorkHR.Application
             services.AddScoped<ILookupService, LookupService>();
             services.AddScoped<ICompanyService, CompanyService>();
             services.AddScoped<IContractService, ContractService>();
+            services.AddScoped<IContractTaskAttachmentService, ContractTaskAttachmentService>();
+            services.AddScoped<IProjectStageAttachmentService, ProjectStageAttachmentService>();
             services.AddScoped<IOTPService, OTPService>();
             services.AddScoped<ILogService<UserLog>, LogService<UserLog>>();
             services.AddScoped<IMatchMoveService, MatchMoveService>();

+ 22 - 8
MTWorkHR.Application/Dtos/Contract/ContractDto.cs

@@ -40,19 +40,24 @@ namespace MTWorkHR.Application.Models
         public DateTime? StartDate { get; set; }
         [JsonProperty(Required = Required.AllowNull)]
         public DateTime? EndDate { get; set; }
-        public ContractDurationEnum ContractDurationId { get; set; } //:  اختيار: شهري – ربعي – نصف سنوي – 3 ارباع – سنوي
-        public TypeOfWork TypeOfWork { get; set; } //: :   اختيار: عقد بدوام كامل -  عقد دوام جزئي   
-        public int VacationDays { get; set; } //اختيار: بدون – سنويا (رقم)
-        public int TrialPeriod { get; set; } // تجربة (ادخال: تلقائياً كل ربع سنوي أسبوع تلقائياً) آخر: تعديل
+
+        [JsonProperty(Required = Required.AllowNull)]
+        public ContractDurationEnum? ContractDurationId { get; set; } //:  اختيار: شهري – ربعي – نصف سنوي – 3 ارباع – سنوي
+        public TypeOfWork? TypeOfWork { get; set; } //: :   اختيار: عقد بدوام كامل -  عقد دوام جزئي   
+        [JsonProperty(Required = Required.AllowNull)]
+        public int? VacationDays { get; set; } //اختيار: بدون – سنويا (رقم)
+        public int? TrialPeriod { get; set; } // تجربة (ادخال: تلقائياً كل ربع سنوي أسبوع تلقائياً) آخر: تعديل
         public TerminateContractEnum WhoCanTerminateContractInTrial { get; set; } //اختيار   الجميع – صاحب العمل – الموظف
         public TerminateContractEnum WhoCanTerminateContract { get; set; }
-        public int NoticePeriodBeforeTermination { get; set; } //اختيار: بدون – تحديد (ادخال: تلقائياً مدة 10 أيام قبل انتهاء الاستحقاق) آخر: تعديل
+        [JsonProperty(Required = Required.AllowNull)]
+        public int? NoticePeriodBeforeTermination { get; set; } //اختيار: بدون – تحديد (ادخال: تلقائياً مدة 10 أيام قبل انتهاء الاستحقاق) آخر: تعديل
 
 
         //------Working time---------------
-        public string WorkingDays { get; set; } //:   اختيار متعدد الأيام سبت أحد اثنين..... (بحيث الأيام الأخرى تكون إجازة) 1,2,3,4,5
+        [JsonProperty(Required = Required.AllowNull)]
+        public List<ContractWorkingDayDto>? WorkingDays { get; set; } //:   اختيار متعدد الأيام سبت أحد اثنين..... (بحيث الأيام الأخرى تكون إجازة) 1,2,3,4,5
         public WorkingHours WorkingHours { get; set; } //	يومي/ اسبوعي  
-        public int WorkingHoursNum { get; set; } // عدد الساعات
+        public int? WorkingHoursNum { get; set; } // عدد الساعات
         public DateTime? StartDailyWorkingHours { get; set; } // تحديد ساعات الدوام قائمة الساعات << التوقيت بحسب دولة صاحب العمل
         public DateTime? EndDailyWorkingHours { get; set; } // تحديد ساعات الدوام قائمة الساعات << التوقيت بحسب دولة صاحب العمل
 
@@ -60,7 +65,16 @@ namespace MTWorkHR.Application.Models
         [MaxLength(50)]
         public string? Currency { get; set; }
         public decimal? Salary{ get; set; }
-        public BillingCycle BillingCycle { get; set; }// 2 fortnightly, 4 Monthly
+        public string? BillingCycle { get; set; }// 2 fortnightly, 4 Monthly
+        //------------------------Fixed Pay----------------
+        public DateTime? FirstPatchDateFrom { get; set; } 
+        public DateTime? FirstPatchDateTo { get; set; } //
+        public decimal? FirstPatchAmount { get; set; }
+
+        public DateTime? LastPatchDateFrom { get; set; } //
+        public DateTime? LastPatchDateTo { get; set; } // 
+        public decimal? LastPatchAmount { get; set; }
+
 
 
         //---------Allowances----------------------

+ 4 - 6
MTWorkHR.Application/Dtos/Contract/ContractTaskAttachmentDto.cs

@@ -1,26 +1,24 @@
 using MTWorkHR.Core.Entities.Base;
 using System.ComponentModel.DataAnnotations.Schema;
 using System.ComponentModel.DataAnnotations;
+using Microsoft.AspNetCore.Http;
 
 
 namespace MTWorkHR.Application.Models
 {
     public class ContractTaskAttachmentDto : EntityDto
     {
-        public long ContractTaskId { get; set; }
+        public long ContractTaskId { get; set; } = 0;
 
         public long? AttachmentTypeId { get; set; }
 
-        [ForeignKey("AttachmentTypeId")]
-        public AttachmentType AttachmentType { get; set; }
-
+     
         [MaxLength(250)]
         public string? FileName { get; set; }
 
         [MaxLength(250)]
         public string? OriginalName { get; set; }
-
-        public byte[] Content { get; set; }
+        public IFormFile? FileData { get; set; }
         public string? FilePath { get; set; }
         public string? ContentType { get; set; }
     }

+ 17 - 0
MTWorkHR.Application/Dtos/Contract/ContractWorkingDayDto.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 ContractWorkingDayDto: EntityDto
+    {
+        public long ContractId { get; set; }
+        [Required]
+        [MaxLength(50)]
+        public string WorkingDay { get; set; }
+
+    }
+}

+ 3 - 4
MTWorkHR.Application/Dtos/Contract/ProjectStageAttachmentDto.cs

@@ -1,26 +1,25 @@
 using MTWorkHR.Core.Entities.Base;
 using System.ComponentModel.DataAnnotations.Schema;
 using System.ComponentModel.DataAnnotations;
+using Microsoft.AspNetCore.Http;
 
 
 namespace MTWorkHR.Application.Models
 {
     public class ProjectStageAttachmentDto : EntityDto
     {
-        public long ProjectStageId { get; set; }
+        public long ProjectStageId { get; set; } = 0;
 
         public long? AttachmentTypeId { get; set; }
 
-        [ForeignKey("AttachmentTypeId")]
-        public AttachmentType AttachmentType { get; set; }
 
         [MaxLength(250)]
         public string? FileName { get; set; }
 
         [MaxLength(250)]
         public string? OriginalName { get; set; }
+        public IFormFile? FileData { get; set; }
 
-        public byte[] Content { get; set; }
         public string? FilePath { get; set; }
         public string? ContentType { get; set; }
     }

+ 15 - 0
MTWorkHR.Application/Dtos/Identity/AttachmentResponseDto.cs

@@ -0,0 +1,15 @@
+using Microsoft.AspNetCore.Http;
+using MTWorkHR.Core.Entities.Base;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+
+namespace MTWorkHR.Application.Models
+{
+    public class AttachmentResponseDto 
+    {
+        public string? FileName { get; set; }
+
+        public string? FilePath { get; set; }
+
+    }
+}

+ 0 - 4
MTWorkHR.Application/Dtos/Identity/AuthResponse.cs

@@ -9,10 +9,6 @@ namespace MTWorkHR.Application.Models
 {
     public class AuthResponse
     {
-  //      public string Id { get; set; }
-      //  public string UserName { get; set; }
-       // public string Email { get; set; }
-   //     public int UserTypeId { get; set; }
         public UserDto User { get; set; }
         public string Token{ get; set; }
         public DateTime Expiration { get; set; }

+ 5 - 0
MTWorkHR.Application/Dtos/User/CompanyDto.cs

@@ -20,6 +20,9 @@ namespace MTWorkHR.Application.Models
         public string? Email { get; set; }
         public long? CountryId { get; set; }
         public long? CityId { get; set; }
+        public string? CityName { get; set; }
+        public string? PostalCode { get; set; }
+        public string? CountryName { get; set; }
         public UserTypeEnum? UserType { get; set; }
         public CompanyUserDto? CompanyUser { get; set; }
         public IFormFile? ProfileImage { get; set; }
@@ -29,6 +32,8 @@ namespace MTWorkHR.Application.Models
         public IFormFile? ExperienceCertificateAttach { get; set; }
         public IFormFile? IdAttach { get; set; }
         public string? CreateUser { get; set; }
+        public bool IsSuspended { get; set; }
+
 
     }
 }

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

@@ -114,7 +114,9 @@ namespace MTWorkHR.Application.Mapper
             CreateMap<OrderType, OrderTypeDto>().ReverseMap();
             CreateMap<LeaveType, LeaveTypeDto>().ReverseMap();
             CreateMap<CompanyDto, Company>().ForMember(d => d.CreateDate, o => o.Ignore()).ForMember(d => d.CreateUser, o => o.Ignore());
-            CreateMap<Company, CompanyDto>();
+            CreateMap<Company, CompanyDto>()
+                .ForMember(s => s.CityName, o => o.MapFrom(s => s.City == null ? "" : GlobalInfo.lang == "ar" ? s.City.NameAr : s.City.NameEn))
+                .ForMember(s => s.CountryName, o => o.MapFrom(s => s.Country == null ? "" : GlobalInfo.lang == "ar" ? s.Country.NameAr : s.Country.NameEn));
             CreateMap<CountryLookup, CountryDto>().ReverseMap();
             CreateMap<Industry, IndustryDto>().ReverseMap();
             CreateMap<JobTitle, JobTitleDto>().ReverseMap();
@@ -142,6 +144,7 @@ namespace MTWorkHR.Application.Mapper
                 .ForMember(d => d.CreateUser, o => o.Ignore());
             CreateMap<ContractAllowance, ContractAllowanceDto>().ReverseMap().ForMember(d => d.CreateDate, o => o.Ignore()).ForMember(d => d.CreateUser, o => o.Ignore()); ;
             CreateMap<ContractTask, ContractTaskDto>().ReverseMap().ForMember(d => d.CreateDate, o => o.Ignore()).ForMember(d => d.CreateUser, o => o.Ignore()); ;
+            CreateMap<ContractWorkingDay, ContractWorkingDayDto>().ReverseMap().ForMember(d => d.CreateDate, o => o.Ignore()).ForMember(d => d.CreateUser, o => o.Ignore()); ;
             CreateMap<ContractTaskAttachment, ContractTaskAttachmentDto>().ReverseMap().ForMember(d => d.CreateDate, o => o.Ignore()).ForMember(d => d.CreateUser, o => o.Ignore()); ;
             CreateMap<ProjectStage, ProjectStageDto>().ReverseMap().ForMember(d => d.CreateDate, o => o.Ignore()).ForMember(d => d.CreateUser, o => o.Ignore()); ;
             CreateMap<ProjectStageAttachment, ProjectStageAttachmentDto>().ReverseMap().ForMember(d => d.CreateDate, o => o.Ignore()).ForMember(d => d.CreateUser, o => o.Ignore()); ;

+ 7 - 0
MTWorkHR.Application/Middlewares/LoggingMiddleware.cs

@@ -97,6 +97,13 @@ namespace MTWorkHR.Application.Middlewares
                             context.Response.Clear();
                             context.Response.ContentType = "text/plain";
                             context.Response.StatusCode = StatusCodes.Status400BadRequest;
+                            context.Response.StatusCode = e.ErrorNumber switch
+                            {
+                                ExceptionEnum.EmailNotExist => StatusCodes.Status401Unauthorized,
+                                ExceptionEnum.NotAuthorized => StatusCodes.Status401Unauthorized,
+                                ExceptionEnum.WrongCredentials => StatusCodes.Status401Unauthorized,
+                                _ => StatusCodes.Status400BadRequest
+                            };
                             await context.Response.WriteAsJsonAsync(
                              new BadRequestResult
                              {

+ 34 - 29
MTWorkHR.Application/Services/Auth/AuthService.cs

@@ -1,4 +1,5 @@
 using Microsoft.AspNetCore.Identity;
+using Microsoft.AspNetCore.Mvc;
 using Microsoft.EntityFrameworkCore;
 using Microsoft.Extensions.Options;
 using Microsoft.IdentityModel.Tokens;
@@ -35,12 +36,12 @@ namespace MTWorkHR.Identity.Services
             var user = await _userManager.FindByEmailAsync(request.Email);           
             if (user == null)
             {
-                throw new AppException(ExceptionEnum.RecordNotExist);
+                throw new AppException(ExceptionEnum.EmailNotExist);
             }
             var result = await _signInManager.CheckPasswordSignInAsync(user, request.Password, false);
             if(!result.Succeeded)
             {
-                throw new AppException($"Credentials for '{request.Email} are not valid'.");
+                throw new AppException(ExceptionEnum.WrongCredentials);
             }
             var userResponse = await _userService.GetById(user.Id);
 
@@ -58,32 +59,6 @@ namespace MTWorkHR.Identity.Services
             };
             return response;
         }
-        //public async Task<RegistrationResponse> Register(RegistrationRequest request)
-        //{
-        //    var user = new ApplicationUser { 
-        //        Email = request.Email ,
-        //        UserName = request.UserName ,
-        //        FirstName = request.FirstName ,
-        //        LastName = request.LastName ,
-        //        EmailConfirmed  = true
-        //    };
-        //    var result = await _userManager.CreateAsync(user, request.Password);
-        //    if (result.Succeeded)
-        //    {
-        //        await _userManager.AddToRoleAsync(user, request.RoleName);
-        //        return new RegistrationResponse(){ UserId = user.Id };
-        //    }
-        //    else
-        //    {
-        //        StringBuilder str = new StringBuilder();
-        //        foreach (var err in result.Errors)
-        //        {
-        //            str.AppendFormat(".{0}\n", err.Description);
-        //        }
-        //        throw new BadRequest($"{str}");
-        //    }
-        //}
-
       
 
         private async Task<JwtSecurityToken> GenerateToken(ApplicationUser user)
@@ -112,7 +87,37 @@ namespace MTWorkHR.Identity.Services
             return jwtSecurityToken;
         }
 
-       
+        public async Task<AuthResponse> AdminLogin(AuthRequest request)
+        {
+            var user = await _userManager.FindByEmailAsync(request.Email);
+            if (user == null)
+            {
+                throw new AppException(ExceptionEnum.EmailNotExist);
+            }
+            var roles = await _userManager.GetRolesAsync(user);
+            if(!roles.Any(r => r == "Admin"))
+            {
+                throw new AppException(ExceptionEnum.NotAuthorized);
+            }
+            var roleClaims = roles.Select(r => new Claim(ClaimTypes.Role, r)).ToList();
+
+            var result = await _signInManager.CheckPasswordSignInAsync(user, request.Password, false);
+            if (!result.Succeeded)
+            {
+                throw new AppException(ExceptionEnum.WrongCredentials);
+            }
+            var userResponse = await _userService.GetById(user.Id);
+
+            JwtSecurityToken jwtToken = await GenerateToken(user);
+
+            var response = new AuthResponse
+            {
+                User = userResponse,
+                Token = new JwtSecurityTokenHandler().WriteToken(jwtToken),
+                Expiration = jwtToken.ValidTo
+            };
+            return response;
+        }
     }
   
 }

+ 32 - 20
MTWorkHR.Application/Services/Base/BlobFileService.cs

@@ -27,18 +27,25 @@ namespace MTWorkHR.Application.Services
             _containerClient = _blobServiceClient.GetBlobContainerClient(ContainerName);
             _containerClient.CreateIfNotExists();
         }
-        public async Task<string> UploadFile(IFormFile file)
+        public async Task<AttachmentResponseDto> UploadFile(IFormFile file)
         {
+            AttachmentResponseDto result = new AttachmentResponseDto();
             try
             {
                 var blobClient = _containerClient.GetBlobClient(file.FileName);
-                var status = await blobClient.UploadAsync(file.OpenReadStream(), true);
-                //if(status.Value == "201")
-                return blobClient.Uri.AbsoluteUri;
+                if (blobClient != null)
+                {
+                    var status = await blobClient.UploadAsync(file.OpenReadStream(), true);
+                    //if(status.Value == "201")
+                    result.FileName = file.FileName;
+                    result.FilePath = blobClient.Uri.AbsoluteUri;
+                    return result;
+                }else
+                    return result;
             }
             catch (Exception ex)
             {
-                return "";
+                return result;
             }
         }
         public async Task<string> UploadFileCloud(AttachmentDto file)
@@ -46,22 +53,27 @@ namespace MTWorkHR.Application.Services
             try
             {
                 var blobClient = _containerClient.GetBlobClient(file.FileName);
-                //var stream = file.FileData.OpenReadStream();
-                using (Stream fs = file.FileData.OpenReadStream())
+                if(blobClient != null)
                 {
-                    var status = await blobClient.UploadAsync(fs, true);
-                    fs.Position = 0;
-                    using (BinaryReader br = new BinaryReader(fs))
+                    //var stream = file.FileData.OpenReadStream();
+                    using (Stream fs = file.FileData.OpenReadStream())
                     {
-                        byte[] bytes = br.ReadBytes((Int32)fs.Length);
-                        var Headers = file.FileData.Headers;
-                        file.Content = bytes;
-                        file.ContentType = file.FileData.ContentType;
-                        file.FilePath = blobClient.Uri.AbsoluteUri;
+                        var status = await blobClient.UploadAsync(fs, true);
+                        fs.Position = 0;
+                        using (BinaryReader br = new BinaryReader(fs))
+                        {
+                            byte[] bytes = br.ReadBytes((Int32)fs.Length);
+                            var Headers = file.FileData.Headers;
+                            file.Content = bytes;
+                            file.ContentType = file.FileData.ContentType;
+                            file.FilePath = blobClient.Uri.AbsoluteUri;
+                        }
                     }
-                }
-                //if(status.Value == "201")
-                return blobClient.Uri.AbsoluteUri;
+                    //if(status.Value == "201")
+                    return blobClient.Uri.AbsoluteUri;
+                }else
+                    return "";
+
             }
             catch (Exception ex)
             {
@@ -96,9 +108,9 @@ namespace MTWorkHR.Application.Services
                 return null;
             }
         }
-        public async Task<List<string>> UploadFiles(List<IFormFile> files)
+        public async Task<List<AttachmentResponseDto>> UploadFiles(List<IFormFile> files)
         {
-            List<string> msgs = new List<string>();
+            List<AttachmentResponseDto> msgs = new List<AttachmentResponseDto>();
             foreach (var formFile in files)
             {
                 msgs.Add(await UploadFile(formFile));

+ 5 - 5
MTWorkHR.Application/Services/Base/FileService.cs

@@ -16,13 +16,13 @@ namespace MTWorkHR.Application.Services
         {
             this.settings = settings;
         }
-        public async Task<string> UploadFile(IFormFile file)
+        public async Task<AttachmentResponseDto> UploadFile(IFormFile file)
         {
             var filesName = await UploadFiles(new List<IFormFile> { file });
-            return filesName.First();
+            return  filesName.First() ;
         }
 
-        public async Task< List<string>> UploadFiles(List<IFormFile> files)
+        public async Task< List<AttachmentResponseDto>> UploadFiles(List<IFormFile> files)
         {
             if (!AttachmentsMust(files))
                 throw new AppException(ExceptionEnum.InvalidFileType);
@@ -31,14 +31,14 @@ namespace MTWorkHR.Application.Services
             if (!Directory.Exists(pathToSave))
                 Directory.CreateDirectory(pathToSave);
 
-            var fileNames = new List<string>();
+            var fileNames = new List<AttachmentResponseDto>();
             foreach (var formFile in files)
             {
                 var fname = ContentDispositionHeaderValue.Parse(formFile.ContentDisposition).FileName.Trim('"');
                 var fnameSplit = fname.Split(".");
                 var fNewName = Guid.NewGuid().ToString() + "." + fnameSplit[fnameSplit.Length - 1];
                 var fullPath = Path.Combine(pathToSave, fNewName);
-                fileNames.Add(fNewName);
+                fileNames.Add(new AttachmentResponseDto {FileName = fNewName, FilePath = fullPath });
                 if (formFile.Length > 0)
                 {
                     using (var stream = new FileStream(fullPath, FileMode.Create))

+ 93 - 0
MTWorkHR.Application/Services/Contract/ContractTaskAttachmentService.cs

@@ -0,0 +1,93 @@
+
+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;
+using Microsoft.AspNetCore.Http;
+using System.IO;
+
+namespace MTWorkHR.Application.Services
+{
+    public class ContractTaskAttachmentService : BaseService<ContractTaskAttachment, ContractTaskAttachmentDto, ContractTaskAttachmentDto>, IContractTaskAttachmentService
+    {
+        private readonly IUnitOfWork _unitOfWork;
+        //private readonly AppSettingsConfiguration _configuration;
+        //private readonly GlobalInfo _globalInfo;
+        private readonly IFileService _fileService;
+
+        public ContractTaskAttachmentService(IUnitOfWork unitOfWork, IFileService fileService) : base(unitOfWork)
+        {
+            _unitOfWork = unitOfWork;
+            _fileService = fileService;
+        }
+
+
+        public override async Task<ContractTaskAttachmentDto> GetById(long id)
+        {
+            var entity = await _unitOfWork.ContractTaskAttachment.GetByIdAsync(id);
+            var response = MapperObject.Mapper.Map<ContractTaskAttachmentDto>(entity);
+            return response;
+        }
+
+        public override async Task<ContractTaskAttachmentDto> Create(ContractTaskAttachmentDto input)
+        {
+            if (input.FileData != null)
+            {
+               // input.FilePath = await _fileService.UploadFile(input.FileData);
+                input.OriginalName = input.FileData.FileName;
+                List<AttachmentDto> attachs = new List<AttachmentDto>();
+                attachs.Add(new AttachmentDto {FileData = input.FileData, OriginalName = input.OriginalName, FileName = input.FileData.FileName });
+                _fileService.CopyFileToCloud(ref attachs);
+
+            }
+            
+            var entity = MapperObject.Mapper.Map<ContractTaskAttachment>(input);
+            if (entity is null)
+            {
+                throw new AppException(ExceptionEnum.MapperIssue);
+            }
+
+            var task = await _unitOfWork.ContractTaskAttachment.AddAsync(entity);
+            await _unitOfWork.CompleteAsync();
+
+            var response = MapperObject.Mapper.Map<ContractTaskAttachmentDto>(task);
+            //using (var stream = new MemoryStream(attach.Content))
+            //{
+            //    var file = new FormFile(stream, 0, stream.Length, Path.GetFileNameWithoutExtension(attach.FileName), attach.FileName)
+            //    {
+            //        Headers = new HeaderDictionary(),
+            //        ContentType = attach.ContentType,
+            //    };
+
+            //    System.Net.Mime.ContentDisposition cd = new System.Net.Mime.ContentDisposition
+            //    {
+            //        FileName = file.FileName
+            //    };
+            //    file.ContentDisposition = cd.ToString();
+            //}
+            return response;
+        }
+
+
+        //public override async Task<ContractTaskAttachmentDto> Update(ContractTaskAttachmentDto input)
+        //{
+        //    var entitiy = await _unitOfWork.ContractTaskAttachment.GetByIdAsync(input.Id);
+
+        //    if (entitiy == null)
+        //        throw new AppException(ExceptionEnum.RecordNotExist);
+
+        //    MapperObject.Mapper.Map(input, entitiy, typeof(ContractTaskAttachmentDto), typeof(ContractTaskAttachment));
+
+        //    await _unitOfWork.CompleteAsync();
+
+        //    return input;
+        //}
+    }
+}

+ 91 - 0
MTWorkHR.Application/Services/Contract/ProjectStageAttachmentService.cs

@@ -0,0 +1,91 @@
+
+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;
+using Microsoft.AspNetCore.Http;
+using System.IO;
+
+namespace MTWorkHR.Application.Services
+{
+    public class ProjectStageAttachmentService : BaseService<ProjectStageAttachment, ProjectStageAttachmentDto, ProjectStageAttachmentDto>, IProjectStageAttachmentService
+    {
+        private readonly IUnitOfWork _unitOfWork;
+        private readonly IFileService _fileService;
+
+        public ProjectStageAttachmentService(IUnitOfWork unitOfWork, IFileService fileService) : base(unitOfWork)
+        {
+            _unitOfWork = unitOfWork;
+            _fileService = fileService;
+        }
+
+
+        public override async Task<ProjectStageAttachmentDto> GetById(long id)
+        {
+            var entity = await _unitOfWork.ContractTaskAttachment.GetByIdAsync(id);
+            var response = MapperObject.Mapper.Map<ProjectStageAttachmentDto>(entity);
+            return response;
+        }
+
+        public override async Task<ProjectStageAttachmentDto> Create(ProjectStageAttachmentDto input)
+        {
+            if (input.FileData != null)
+            {
+               // input.FilePath = await _fileService.UploadFile(input.FileData);
+                input.OriginalName = input.FileData.FileName;
+                List<AttachmentDto> attachs = new List<AttachmentDto>();
+                attachs.Add(new AttachmentDto { FileData = input.FileData, OriginalName = input.OriginalName, FileName = input.FileData.FileName });
+                _fileService.CopyFileToCloud(ref attachs);
+
+            }
+            
+            var entity = MapperObject.Mapper.Map<ContractTaskAttachment>(input);
+            if (entity is null)
+            {
+                throw new AppException(ExceptionEnum.MapperIssue);
+            }
+
+            var task = await _unitOfWork.ContractTaskAttachment.AddAsync(entity);
+            await _unitOfWork.CompleteAsync();
+
+            var response = MapperObject.Mapper.Map<ProjectStageAttachmentDto>(task);
+            //using (var stream = new MemoryStream(attach.Content))
+            //{
+            //    var file = new FormFile(stream, 0, stream.Length, Path.GetFileNameWithoutExtension(attach.FileName), attach.FileName)
+            //    {
+            //        Headers = new HeaderDictionary(),
+            //        ContentType = attach.ContentType,
+            //    };
+
+            //    System.Net.Mime.ContentDisposition cd = new System.Net.Mime.ContentDisposition
+            //    {
+            //        FileName = file.FileName
+            //    };
+            //    file.ContentDisposition = cd.ToString();
+            //}
+            return response;
+        }
+
+
+        //public override async Task<ProjectStageAttachmentDto> Update(ProjectStageAttachmentDto input)
+        //{
+        //    var entitiy = await _unitOfWork.ContractTaskAttachment.GetByIdAsync(input.Id);
+
+        //    if (entitiy == null)
+        //        throw new AppException(ExceptionEnum.RecordNotExist);
+
+        //    MapperObject.Mapper.Map(input, entitiy, typeof(ProjectStageAttachmentDto), typeof(ContractTaskAttachment));
+
+        //    await _unitOfWork.CompleteAsync();
+
+        //    return input;
+        //}
+    }
+}

+ 2 - 1
MTWorkHR.Application/Services/Interfaces/IAuthService.cs

@@ -10,7 +10,8 @@ namespace MTWorkHR.Application.Identity
     public interface IAuthService
     {
         Task<AuthResponse> Login(AuthRequest request);
-
+        Task<AuthResponse> AdminLogin(AuthRequest request);
+        
 
     }
 }

+ 1 - 0
MTWorkHR.Application/Services/Interfaces/ICompanyService.cs

@@ -15,6 +15,7 @@ namespace MTWorkHR.Application.Services.Interfaces
         Task<List<CompanyDto>> GetAllCompanies();
         Task<CompanyDto> GetById();
         Task<CompanyDto> GetById(long companyId);
+        Task Suspend(long companyId);
 
     }
 }

+ 12 - 0
MTWorkHR.Application/Services/Interfaces/IContractTaskAttachmentService.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 IContractTaskAttachmentService : IService<ContractTaskAttachment, ContractTaskAttachmentDto, ContractTaskAttachmentDto>
+    {
+    }
+}

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

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

+ 12 - 0
MTWorkHR.Application/Services/Interfaces/IProjectStageAttachmentService.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 IProjectStageAttachmentService : IService<ProjectStageAttachment, ProjectStageAttachmentDto, ProjectStageAttachmentDto>
+    {
+    }
+}

+ 1 - 0
MTWorkHR.Application/Services/Interfaces/IUserService.cs

@@ -34,5 +34,6 @@ namespace MTWorkHR.Application.Identity
         Task<UserDto> GetUserWithAttachmentById(string id);
         Task<string> GetProfileImage(string userId);
         Task<bool> Update(string userId, long companyId);
+        Task Suspend(string id);
     }
 }

+ 20 - 3
MTWorkHR.Application/Services/User/CompanyService.cs

@@ -43,13 +43,21 @@ namespace MTWorkHR.Application.Services
             _roleManager = roleManager;
         }
 
-     
+       
+
         public async Task<CompanyDto> GetById()
         {
-            var companyResponse = new CompanyDto();
             if (_globalInfo.CompanyId.HasValue)
+                return await GetById(_globalInfo.CompanyId.Value);
+            else 
+                return new CompanyDto();
+        }
+        public override async Task<CompanyDto> GetById(long companyId)
+        {
+            var companyResponse = new CompanyDto();
+            if (companyId > 0)
             {
-                var entity = await _unitOfWork.Company.GetByIdAsync(_globalInfo.CompanyId.Value);
+                var entity = await _unitOfWork.Company.GetByIdWithAllChildren(companyId);
                 companyResponse = MapperObject.Mapper.Map<CompanyDto>(entity);
                 var userDto = await _userService.GetById(entity.UserId);
                 companyResponse.CommercialRegAttach = userDto.CommercialRegAttach;
@@ -108,6 +116,7 @@ namespace MTWorkHR.Application.Services
             input.Address = string.IsNullOrEmpty(input.Address) ? input.CompanyUser?.UserAddress?.AddressDesc: input.Address;
             input.CountryId = input.CountryId!=null && input.CountryId > 0 ?  input.CountryId : input.CompanyUser?.UserAddress?.CountryId;
             input.CityId = input.CityId != null && input.CityId > 0 ?  input.CityId : input.CompanyUser?.UserAddress?.CityId;
+            input.PostalCode = input.PostalCode != null ?  input.PostalCode : input.CompanyUser?.UserAddress?.PostalCode;
             //UserDto companyUser = new UserDto
             //{
             //    UserType = UserTypeEnum.Business,
@@ -273,5 +282,13 @@ namespace MTWorkHR.Application.Services
             await _unitOfWork.Company.DeleteAsync(entity);
 
         }
+
+        public async Task Suspend(long id)
+        {
+            var entity = await _unitOfWork.Company.GetByIdAsync(id);
+            await _userService.Suspend(entity.UserId); // delete user first
+            entity.IsSuspended = true;
+            await _unitOfWork.CompleteAsync();
+        }
     }
 }

+ 13 - 2
MTWorkHR.Application/Services/User/UserService.cs

@@ -88,10 +88,11 @@ namespace MTWorkHR.Application.Services
 
                     using (var stream = new MemoryStream(attach.Content))
                     {
-                        var file = new FormFile(stream, 0, stream.Length, Path.GetFileNameWithoutExtension(attach.FileName), attach.FileName)
+                        var file = new FormFile(stream, 0, stream.Length, Path.GetFileNameWithoutExtension(attach.FileName), attach.FilePath)
                         {
                             Headers = new HeaderDictionary(),
                             ContentType = attach.ContentType,
+                            
                         };
 
                         System.Net.Mime.ContentDisposition cd = new System.Net.Mime.ContentDisposition
@@ -194,7 +195,7 @@ namespace MTWorkHR.Application.Services
                 .Include(u => u.University)
                 .Include(u => u.Industry)
                 .Include(u => u.Country)
-                .Where(u => _globalInfo.CompanyId == null || u.CompanyId != _globalInfo.CompanyId);
+                .Where(u => !u.IsDeleted && !u.IsStopped && ( _globalInfo.CompanyId == null || u.CompanyId != _globalInfo.CompanyId));
 
             var filter = PagingInputDto.Filter?.Trim();
 
@@ -294,6 +295,16 @@ namespace MTWorkHR.Application.Services
                 await _userManager.UpdateAsync(user);
             }
         }
+        public async Task Suspend(string id)
+        {
+            var user = await _userManager.FindByIdAsync(id);
+            if (user != null)
+            {
+                user.IsStopped = true;
+
+                await _userManager.UpdateAsync(user);
+            }
+        }
 
 
         public async Task<UserDto> Create(UserDto input)

+ 21 - 12
MTWorkHR.Core/Entities/Contract/Contract.cs

@@ -23,9 +23,9 @@ namespace MTWorkHR.Core.Entities
         public int? JobId { get; set; }
         public int? AcademicQualificationId { get; set; }
         public int? SpecializationId { get; set; }
-        public int WorkCountryId { get; set; }
-        public int WorkStateId { get; set; }
-        public int ContractorTaxResidencyId { get; set; }
+        public int? WorkCountryId { get; set; }
+        public int? WorkStateId { get; set; }
+        public int? ContractorTaxResidencyId { get; set; }
         
         //-------------------Scope of work-----------
         public string? JobTitleName { get; set; }
@@ -35,19 +35,19 @@ namespace MTWorkHR.Core.Entities
         //----------------Contract data -------------------------
         public DateTime? StartDate { get; set; }
         public DateTime? EndDate { get; set; }
-        public int ContractDurationId { get; set; } //:  اختيار: شهري – ربعي – نصف سنوي – 3 ارباع – سنوي
+        public int? ContractDurationId { get; set; } //:  اختيار: شهري – ربعي – نصف سنوي – 3 ارباع – سنوي
         public TypeOfWork TypeOfWork { get; set; } //: :   اختيار: عقد بدوام كامل -  عقد دوام جزئي   
-        public int VacationDays { get; set; } //اختيار: بدون – سنويا (رقم)
+        public int? VacationDays { get; set; } //اختيار: بدون – سنويا (رقم)
         public int TrialPeriod { get; set; } // تجربة (ادخال: تلقائياً كل ربع سنوي أسبوع تلقائياً) آخر: تعديل
-        public int WhoCanTerminateContractInTrial { get; set; } //اختيار   الجميع – صاحب العمل – الموظف
-        public int WhoCanTerminateContract { get; set; }
-        public int NoticePeriodBeforeTermination { get; set; } //اختيار: بدون – تحديد (ادخال: تلقائياً مدة 10 أيام قبل انتهاء الاستحقاق) آخر: تعديل
+        public int? WhoCanTerminateContractInTrial { get; set; } //اختيار   الجميع – صاحب العمل – الموظف
+        public int? WhoCanTerminateContract { get; set; }
+        public int? NoticePeriodBeforeTermination { get; set; } //اختيار: بدون – تحديد (ادخال: تلقائياً مدة 10 أيام قبل انتهاء الاستحقاق) آخر: تعديل
 
 
         //------Working time---------------
-        public string WorkingDays { get; set; } //:   اختيار متعدد الأيام سبت أحد اثنين..... (بحيث الأيام الأخرى تكون إجازة) 1,2,3,4,5
-        public int WorkingHours { get; set; } //	يومي/ اسبوعي  
-        public int WorkingHoursNum { get; set; } // عدد الساعات
+        public List<ContractWorkingDay>? WorkingDays { get; set; } //:   اختيار متعدد الأيام سبت أحد اثنين..... (بحيث الأيام الأخرى تكون إجازة) 1,2,3,4,5
+        public int? WorkingHours { get; set; } //	يومي/ اسبوعي  
+        public int? WorkingHoursNum { get; set; } // عدد الساعات
         public DateTime? StartDailyWorkingHours { get; set; } // تحديد ساعات الدوام قائمة الساعات << التوقيت بحسب دولة صاحب العمل
         public DateTime? EndDailyWorkingHours { get; set; } // تحديد ساعات الدوام قائمة الساعات << التوقيت بحسب دولة صاحب العمل
 
@@ -55,7 +55,7 @@ namespace MTWorkHR.Core.Entities
         [MaxLength(50)]
         public string? Currency { get; set; }
         public decimal? Salary{ get; set; }
-        public int BillingCycle { get; set; }// 2 fortnightly, 4 Monthly
+        public string? BillingCycle { get; set; }// 2 fortnightly, 4 Monthly
 
 
         //---------Allowances----------------------
@@ -66,6 +66,15 @@ namespace MTWorkHR.Core.Entities
         public List<ContractTask>? ContractTasks { get; set; }
         public List<ProjectStage>? ProjectStages { get; set; }
 
+        //-------------------------------
+        public DateTime? FirstPatchDateFrom { get; set; }
+        public DateTime? FirstPatchDateTo { get; set; } //
+        public decimal? FirstPatchAmount { get; set; }
+
+        public DateTime? LastPatchDateFrom { get; set; } //
+        public DateTime? LastPatchDateTo { get; set; } // 
+        public decimal? LastPatchAmount { get; set; }
+
 
         //  public decimal? GrossAnnualBaseSalary { get; set; }
 

+ 1 - 3
MTWorkHR.Core/Entities/Contract/ContractTaskAttachment.cs

@@ -13,8 +13,7 @@ namespace MTWorkHR.Core.Entities
         public ContractTask ContractTask { get; set; }
         public long? AttachmentTypeId { get; set; }
 
-        [ForeignKey("AttachmentTypeId")]
-        public AttachmentType AttachmentType { get; set; }
+       
 
         [MaxLength(250)]
         public string? FileName { get; set; }
@@ -22,7 +21,6 @@ namespace MTWorkHR.Core.Entities
         [MaxLength(250)]
         public string? OriginalName { get; set; }
 
-        public byte[] Content { get; set; }
         public string? FilePath { get; set; }
         public string? ContentType { get; set; }
     }

+ 24 - 0
MTWorkHR.Core/Entities/Contract/ContractWorkingDay.cs

@@ -0,0 +1,24 @@
+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 ContractWorkingDay : AuditEntity
+    {
+
+        public long ContractId{ get; set; }
+        [ForeignKey("ContractId")]
+        public Contract? Contract { get; set; }
+        [Required]
+        [MaxLength(50)]
+        public string WorkingDay { get; set; }
+       
+
+    }
+}

+ 0 - 3
MTWorkHR.Core/Entities/Contract/ProjectStageAttachment.cs

@@ -13,8 +13,6 @@ namespace MTWorkHR.Core.Entities
         public ProjectStage ProjectStage { get; set; }
         public long? AttachmentTypeId { get; set; }
 
-        [ForeignKey("AttachmentTypeId")]
-        public AttachmentType AttachmentType { get; set; }
 
         [MaxLength(250)]
         public string? FileName { get; set; }
@@ -22,7 +20,6 @@ namespace MTWorkHR.Core.Entities
         [MaxLength(250)]
         public string? OriginalName { get; set; }
 
-        public byte[] Content { get; set; }
         public string? FilePath { get; set; }
         public string? ContentType { get; set; }
     }

+ 2 - 0
MTWorkHR.Core/Entities/User/Company.cs

@@ -19,6 +19,8 @@ namespace MTWorkHR.Core.Entities
         public string PhoneNumber { get; set; }
         public string Address { get; set; }
         public string Email { get; set; }
+        public string? PostalCode { get; set; }
+        public bool IsSuspended { get; set; }
 
         public long? CountryId { get; set; }
         [ForeignKey("CountryId")]

+ 2 - 2
MTWorkHR.Core/Global/AppExceptions.cs

@@ -32,8 +32,8 @@ namespace MTWorkHR.Core.Global
             } },
             {ExceptionEnum.WrongCredentials, new Dictionary<string, string>
             {
-                { "en", "Username or password incorrect!" },
-                { "ar", "اسم المستخدم أو كلمة المرور غير صحيحة!" }
+                { "en", "Password is incorrect!" },
+                { "ar", "كلمة المرور غير صحيحة!" }
             }},
             {ExceptionEnum.RecordCannotBeDelete, new Dictionary<string, string>
             {

+ 1 - 0
MTWorkHR.Core/IRepositories/Auth/ICompanyRepository.cs

@@ -11,5 +11,6 @@ namespace MTWorkHR.Core.IRepositories
 {
     public interface ICompanyRepository : IRepository<Company>
     {
+        Task<Company> GetByIdWithAllChildren(long id);
     }
 }

+ 15 - 0
MTWorkHR.Core/IRepositories/Contract/IContractTaskAttachmentRepository.cs

@@ -0,0 +1,15 @@
+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
+{
+    public interface IContractTaskAttachmentRepository : IRepository<ContractTaskAttachment>
+    {
+    }
+}

+ 15 - 0
MTWorkHR.Core/IRepositories/Contract/IProjectStageAttachmentRepository.cs

@@ -0,0 +1,15 @@
+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
+{
+    public interface IProjectStageAttachmentRepository : IRepository<ProjectStageAttachment>
+    {
+    }
+}

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

@@ -37,6 +37,9 @@ namespace MTWorkHR.Core.UnitOfWork
 
         IChatMessageRepository ChatMessage { get; }
         IContractRepository Contract { get; }
+        IContractTaskAttachmentRepository ContractTaskAttachment { get; }
+        IProjectStageAttachmentRepository ProjectStageAttachment { get; }
+
         IHubConnectionRepository HubConnection { get; }
 
         Task<int> CompleteAsync();

+ 2 - 0
MTWorkHR.Infrastructure/InfrastructureServiceRegistration.cs

@@ -104,6 +104,8 @@ namespace MTWorkHR.Infrastructure
             services.AddScoped(typeof(IProjectTeamRepository), typeof(ProjectTeamRepository));
             services.AddScoped(typeof(IChatMessageRepository), typeof(ChatMessageRepository));
             services.AddScoped(typeof(IContractRepository), typeof(ContractRepository));
+            services.AddScoped(typeof(IContractTaskAttachmentRepository), typeof(ContractTaskAttachmentRepository));
+            services.AddScoped(typeof(IProjectStageAttachmentRepository), typeof(ProjectStageAttachmentRepository));
 
             services.AddScoped(typeof(IHubConnectionRepository), typeof(HubConnectionRepository));
             

Dosya farkı çok büyük olduğundan ihmal edildi
+ 5719 - 0
MTWorkHR.Infrastructure/Migrations/20241210094124_alteContractfixedPay.Designer.cs


+ 79 - 0
MTWorkHR.Infrastructure/Migrations/20241210094124_alteContractfixedPay.cs

@@ -0,0 +1,79 @@
+using System;
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace MTWorkHR.Infrastructure.Migrations
+{
+    /// <inheritdoc />
+    public partial class alteContractfixedPay : Migration
+    {
+        /// <inheritdoc />
+        protected override void Up(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.AddColumn<decimal>(
+                name: "FirstPatchAmount",
+                table: "Contracts",
+                type: "decimal(18,2)",
+                nullable: true);
+
+            migrationBuilder.AddColumn<DateTime>(
+                name: "FirstPatchDateFrom",
+                table: "Contracts",
+                type: "datetime2",
+                nullable: true);
+
+            migrationBuilder.AddColumn<DateTime>(
+                name: "FirstPatchDateTo",
+                table: "Contracts",
+                type: "datetime2",
+                nullable: true);
+
+            migrationBuilder.AddColumn<decimal>(
+                name: "LastPatchAmount",
+                table: "Contracts",
+                type: "decimal(18,2)",
+                nullable: true);
+
+            migrationBuilder.AddColumn<DateTime>(
+                name: "LastPatchDateFrom",
+                table: "Contracts",
+                type: "datetime2",
+                nullable: true);
+
+            migrationBuilder.AddColumn<DateTime>(
+                name: "LastPatchDateTo",
+                table: "Contracts",
+                type: "datetime2",
+                nullable: true);
+        }
+
+        /// <inheritdoc />
+        protected override void Down(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.DropColumn(
+                name: "FirstPatchAmount",
+                table: "Contracts");
+
+            migrationBuilder.DropColumn(
+                name: "FirstPatchDateFrom",
+                table: "Contracts");
+
+            migrationBuilder.DropColumn(
+                name: "FirstPatchDateTo",
+                table: "Contracts");
+
+            migrationBuilder.DropColumn(
+                name: "LastPatchAmount",
+                table: "Contracts");
+
+            migrationBuilder.DropColumn(
+                name: "LastPatchDateFrom",
+                table: "Contracts");
+
+            migrationBuilder.DropColumn(
+                name: "LastPatchDateTo",
+                table: "Contracts");
+        }
+    }
+}

Dosya farkı çok büyük olduğundan ihmal edildi
+ 5770 - 0
MTWorkHR.Infrastructure/Migrations/20241216201032_altrContractWorkingDay.Designer.cs


+ 260 - 0
MTWorkHR.Infrastructure/Migrations/20241216201032_altrContractWorkingDay.cs

@@ -0,0 +1,260 @@
+using System;
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace MTWorkHR.Infrastructure.Migrations
+{
+    /// <inheritdoc />
+    public partial class altrContractWorkingDay : Migration
+    {
+        /// <inheritdoc />
+        protected override void Up(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.DropColumn(
+                name: "WorkingDays",
+                table: "Contracts");
+
+            migrationBuilder.AlterColumn<int>(
+                name: "WorkingHoursNum",
+                table: "Contracts",
+                type: "int",
+                nullable: true,
+                oldClrType: typeof(int),
+                oldType: "int");
+
+            migrationBuilder.AlterColumn<int>(
+                name: "WorkingHours",
+                table: "Contracts",
+                type: "int",
+                nullable: true,
+                oldClrType: typeof(int),
+                oldType: "int");
+
+            migrationBuilder.AlterColumn<int>(
+                name: "WorkStateId",
+                table: "Contracts",
+                type: "int",
+                nullable: true,
+                oldClrType: typeof(int),
+                oldType: "int");
+
+            migrationBuilder.AlterColumn<int>(
+                name: "WorkCountryId",
+                table: "Contracts",
+                type: "int",
+                nullable: true,
+                oldClrType: typeof(int),
+                oldType: "int");
+
+            migrationBuilder.AlterColumn<int>(
+                name: "WhoCanTerminateContractInTrial",
+                table: "Contracts",
+                type: "int",
+                nullable: true,
+                oldClrType: typeof(int),
+                oldType: "int");
+
+            migrationBuilder.AlterColumn<int>(
+                name: "WhoCanTerminateContract",
+                table: "Contracts",
+                type: "int",
+                nullable: true,
+                oldClrType: typeof(int),
+                oldType: "int");
+
+            migrationBuilder.AlterColumn<int>(
+                name: "VacationDays",
+                table: "Contracts",
+                type: "int",
+                nullable: true,
+                oldClrType: typeof(int),
+                oldType: "int");
+
+            migrationBuilder.AlterColumn<int>(
+                name: "NoticePeriodBeforeTermination",
+                table: "Contracts",
+                type: "int",
+                nullable: true,
+                oldClrType: typeof(int),
+                oldType: "int");
+
+            migrationBuilder.AlterColumn<int>(
+                name: "ContractorTaxResidencyId",
+                table: "Contracts",
+                type: "int",
+                nullable: true,
+                oldClrType: typeof(int),
+                oldType: "int");
+
+            migrationBuilder.AlterColumn<int>(
+                name: "ContractDurationId",
+                table: "Contracts",
+                type: "int",
+                nullable: true,
+                oldClrType: typeof(int),
+                oldType: "int");
+
+            migrationBuilder.AlterColumn<string>(
+                name: "BillingCycle",
+                table: "Contracts",
+                type: "nvarchar(max)",
+                nullable: true,
+                oldClrType: typeof(int),
+                oldType: "int");
+
+            migrationBuilder.CreateTable(
+                name: "ContractWorkingDay",
+                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),
+                    ContractId = table.Column<long>(type: "bigint", nullable: false),
+                    WorkingDay = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_ContractWorkingDay", x => x.Id);
+                    table.ForeignKey(
+                        name: "FK_ContractWorkingDay_Contracts_ContractId",
+                        column: x => x.ContractId,
+                        principalTable: "Contracts",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Cascade);
+                });
+
+            migrationBuilder.CreateIndex(
+                name: "IX_ContractWorkingDay_ContractId",
+                table: "ContractWorkingDay",
+                column: "ContractId");
+        }
+
+        /// <inheritdoc />
+        protected override void Down(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.DropTable(
+                name: "ContractWorkingDay");
+
+            migrationBuilder.AlterColumn<int>(
+                name: "WorkingHoursNum",
+                table: "Contracts",
+                type: "int",
+                nullable: false,
+                defaultValue: 0,
+                oldClrType: typeof(int),
+                oldType: "int",
+                oldNullable: true);
+
+            migrationBuilder.AlterColumn<int>(
+                name: "WorkingHours",
+                table: "Contracts",
+                type: "int",
+                nullable: false,
+                defaultValue: 0,
+                oldClrType: typeof(int),
+                oldType: "int",
+                oldNullable: true);
+
+            migrationBuilder.AlterColumn<int>(
+                name: "WorkStateId",
+                table: "Contracts",
+                type: "int",
+                nullable: false,
+                defaultValue: 0,
+                oldClrType: typeof(int),
+                oldType: "int",
+                oldNullable: true);
+
+            migrationBuilder.AlterColumn<int>(
+                name: "WorkCountryId",
+                table: "Contracts",
+                type: "int",
+                nullable: false,
+                defaultValue: 0,
+                oldClrType: typeof(int),
+                oldType: "int",
+                oldNullable: true);
+
+            migrationBuilder.AlterColumn<int>(
+                name: "WhoCanTerminateContractInTrial",
+                table: "Contracts",
+                type: "int",
+                nullable: false,
+                defaultValue: 0,
+                oldClrType: typeof(int),
+                oldType: "int",
+                oldNullable: true);
+
+            migrationBuilder.AlterColumn<int>(
+                name: "WhoCanTerminateContract",
+                table: "Contracts",
+                type: "int",
+                nullable: false,
+                defaultValue: 0,
+                oldClrType: typeof(int),
+                oldType: "int",
+                oldNullable: true);
+
+            migrationBuilder.AlterColumn<int>(
+                name: "VacationDays",
+                table: "Contracts",
+                type: "int",
+                nullable: false,
+                defaultValue: 0,
+                oldClrType: typeof(int),
+                oldType: "int",
+                oldNullable: true);
+
+            migrationBuilder.AlterColumn<int>(
+                name: "NoticePeriodBeforeTermination",
+                table: "Contracts",
+                type: "int",
+                nullable: false,
+                defaultValue: 0,
+                oldClrType: typeof(int),
+                oldType: "int",
+                oldNullable: true);
+
+            migrationBuilder.AlterColumn<int>(
+                name: "ContractorTaxResidencyId",
+                table: "Contracts",
+                type: "int",
+                nullable: false,
+                defaultValue: 0,
+                oldClrType: typeof(int),
+                oldType: "int",
+                oldNullable: true);
+
+            migrationBuilder.AlterColumn<int>(
+                name: "ContractDurationId",
+                table: "Contracts",
+                type: "int",
+                nullable: false,
+                defaultValue: 0,
+                oldClrType: typeof(int),
+                oldType: "int",
+                oldNullable: true);
+
+            migrationBuilder.AlterColumn<int>(
+                name: "BillingCycle",
+                table: "Contracts",
+                type: "int",
+                nullable: false,
+                defaultValue: 0,
+                oldClrType: typeof(string),
+                oldType: "nvarchar(max)",
+                oldNullable: true);
+
+            migrationBuilder.AddColumn<string>(
+                name: "WorkingDays",
+                table: "Contracts",
+                type: "nvarchar(max)",
+                nullable: false,
+                defaultValue: "");
+        }
+    }
+}

Dosya farkı çok büyük olduğundan ihmal edildi
+ 5773 - 0
MTWorkHR.Infrastructure/Migrations/20241218150942_altrContractAttach.Designer.cs


+ 29 - 0
MTWorkHR.Infrastructure/Migrations/20241218150942_altrContractAttach.cs

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

Dosya farkı çok büyük olduğundan ihmal edildi
+ 5749 - 0
MTWorkHR.Infrastructure/Migrations/20241224101338_altrContracyAttachs.Designer.cs


+ 80 - 0
MTWorkHR.Infrastructure/Migrations/20241224101338_altrContracyAttachs.cs

@@ -0,0 +1,80 @@
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace MTWorkHR.Infrastructure.Migrations
+{
+    /// <inheritdoc />
+    public partial class altrContracyAttachs : Migration
+    {
+        /// <inheritdoc />
+        protected override void Up(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.DropForeignKey(
+                name: "FK_ContractTaskAttachment_AttachmentTypes_AttachmentTypeId",
+                table: "ContractTaskAttachment");
+
+            migrationBuilder.DropForeignKey(
+                name: "FK_ProjectStageAttachment_AttachmentTypes_AttachmentTypeId",
+                table: "ProjectStageAttachment");
+
+            migrationBuilder.DropIndex(
+                name: "IX_ProjectStageAttachment_AttachmentTypeId",
+                table: "ProjectStageAttachment");
+
+            migrationBuilder.DropIndex(
+                name: "IX_ContractTaskAttachment_AttachmentTypeId",
+                table: "ContractTaskAttachment");
+
+            migrationBuilder.DropColumn(
+                name: "Content",
+                table: "ProjectStageAttachment");
+
+            migrationBuilder.DropColumn(
+                name: "Content",
+                table: "ContractTaskAttachment");
+        }
+
+        /// <inheritdoc />
+        protected override void Down(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.AddColumn<byte[]>(
+                name: "Content",
+                table: "ProjectStageAttachment",
+                type: "varbinary(max)",
+                nullable: false,
+                defaultValue: new byte[0]);
+
+            migrationBuilder.AddColumn<byte[]>(
+                name: "Content",
+                table: "ContractTaskAttachment",
+                type: "varbinary(max)",
+                nullable: false,
+                defaultValue: new byte[0]);
+
+            migrationBuilder.CreateIndex(
+                name: "IX_ProjectStageAttachment_AttachmentTypeId",
+                table: "ProjectStageAttachment",
+                column: "AttachmentTypeId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_ContractTaskAttachment_AttachmentTypeId",
+                table: "ContractTaskAttachment",
+                column: "AttachmentTypeId");
+
+            migrationBuilder.AddForeignKey(
+                name: "FK_ContractTaskAttachment_AttachmentTypes_AttachmentTypeId",
+                table: "ContractTaskAttachment",
+                column: "AttachmentTypeId",
+                principalTable: "AttachmentTypes",
+                principalColumn: "Id");
+
+            migrationBuilder.AddForeignKey(
+                name: "FK_ProjectStageAttachment_AttachmentTypes_AttachmentTypeId",
+                table: "ProjectStageAttachment",
+                column: "AttachmentTypeId",
+                principalTable: "AttachmentTypes",
+                principalColumn: "Id");
+        }
+    }
+}

Dosya farkı çok büyük olduğundan ihmal edildi
+ 5752 - 0
MTWorkHR.Infrastructure/Migrations/20241226130909_altrCompanyPostal.Designer.cs


+ 28 - 0
MTWorkHR.Infrastructure/Migrations/20241226130909_altrCompanyPostal.cs

@@ -0,0 +1,28 @@
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace MTWorkHR.Infrastructure.Migrations
+{
+    /// <inheritdoc />
+    public partial class altrCompanyPostal : Migration
+    {
+        /// <inheritdoc />
+        protected override void Up(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.AddColumn<string>(
+                name: "PostalCode",
+                table: "Companies",
+                type: "nvarchar(max)",
+                nullable: true);
+        }
+
+        /// <inheritdoc />
+        protected override void Down(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.DropColumn(
+                name: "PostalCode",
+                table: "Companies");
+        }
+    }
+}

+ 91 - 40
MTWorkHR.Infrastructure/Migrations/HRDataContextModelSnapshot.cs

@@ -507,10 +507,16 @@ namespace MTWorkHR.Infrastructure.Migrations
                         .HasColumnType("bit")
                         .HasColumnOrder(7);
 
+                    b.Property<bool>("IsSuspended")
+                        .HasColumnType("bit");
+
                     b.Property<string>("PhoneNumber")
                         .IsRequired()
                         .HasColumnType("nvarchar(max)");
 
+                    b.Property<string>("PostalCode")
+                        .HasColumnType("nvarchar(max)");
+
                     b.Property<int>("TaxNumber")
                         .HasColumnType("int");
 
@@ -548,8 +554,8 @@ namespace MTWorkHR.Infrastructure.Migrations
                     b.Property<int?>("AcademicQualificationId")
                         .HasColumnType("int");
 
-                    b.Property<int>("BillingCycle")
-                        .HasColumnType("int");
+                    b.Property<string>("BillingCycle")
+                        .HasColumnType("nvarchar(max)");
 
                     b.Property<long>("CompanyId")
                         .HasColumnType("bigint");
@@ -558,7 +564,7 @@ namespace MTWorkHR.Infrastructure.Migrations
                         .IsRequired()
                         .HasColumnType("nvarchar(max)");
 
-                    b.Property<int>("ContractDurationId")
+                    b.Property<int?>("ContractDurationId")
                         .HasColumnType("int");
 
                     b.Property<int>("ContractStatusId")
@@ -567,7 +573,7 @@ namespace MTWorkHR.Infrastructure.Migrations
                     b.Property<int>("ContractTypeId")
                         .HasColumnType("int");
 
-                    b.Property<int>("ContractorTaxResidencyId")
+                    b.Property<int?>("ContractorTaxResidencyId")
                         .HasColumnType("int");
 
                     b.Property<DateTime>("CreateDate")
@@ -594,6 +600,15 @@ namespace MTWorkHR.Infrastructure.Migrations
                     b.Property<DateTime?>("EndDate")
                         .HasColumnType("datetime2");
 
+                    b.Property<decimal?>("FirstPatchAmount")
+                        .HasColumnType("decimal(18,2)");
+
+                    b.Property<DateTime?>("FirstPatchDateFrom")
+                        .HasColumnType("datetime2");
+
+                    b.Property<DateTime?>("FirstPatchDateTo")
+                        .HasColumnType("datetime2");
+
                     b.Property<bool>("IncludesAllAllowances")
                         .HasColumnType("bit");
 
@@ -614,7 +629,16 @@ namespace MTWorkHR.Infrastructure.Migrations
                     b.Property<string>("JobTitleName")
                         .HasColumnType("nvarchar(max)");
 
-                    b.Property<int>("NoticePeriodBeforeTermination")
+                    b.Property<decimal?>("LastPatchAmount")
+                        .HasColumnType("decimal(18,2)");
+
+                    b.Property<DateTime?>("LastPatchDateFrom")
+                        .HasColumnType("datetime2");
+
+                    b.Property<DateTime?>("LastPatchDateTo")
+                        .HasColumnType("datetime2");
+
+                    b.Property<int?>("NoticePeriodBeforeTermination")
                         .HasColumnType("int");
 
                     b.Property<decimal?>("Salary")
@@ -648,29 +672,25 @@ namespace MTWorkHR.Infrastructure.Migrations
                         .IsRequired()
                         .HasColumnType("nvarchar(max)");
 
-                    b.Property<int>("VacationDays")
+                    b.Property<int?>("VacationDays")
                         .HasColumnType("int");
 
-                    b.Property<int>("WhoCanTerminateContract")
+                    b.Property<int?>("WhoCanTerminateContract")
                         .HasColumnType("int");
 
-                    b.Property<int>("WhoCanTerminateContractInTrial")
+                    b.Property<int?>("WhoCanTerminateContractInTrial")
                         .HasColumnType("int");
 
-                    b.Property<int>("WorkCountryId")
+                    b.Property<int?>("WorkCountryId")
                         .HasColumnType("int");
 
-                    b.Property<int>("WorkStateId")
+                    b.Property<int?>("WorkStateId")
                         .HasColumnType("int");
 
-                    b.Property<string>("WorkingDays")
-                        .IsRequired()
-                        .HasColumnType("nvarchar(max)");
-
-                    b.Property<int>("WorkingHours")
+                    b.Property<int?>("WorkingHours")
                         .HasColumnType("int");
 
-                    b.Property<int>("WorkingHoursNum")
+                    b.Property<int?>("WorkingHoursNum")
                         .HasColumnType("int");
 
                     b.HasKey("Id");
@@ -795,10 +815,6 @@ namespace MTWorkHR.Infrastructure.Migrations
                     b.Property<long?>("AttachmentTypeId")
                         .HasColumnType("bigint");
 
-                    b.Property<byte[]>("Content")
-                        .IsRequired()
-                        .HasColumnType("varbinary(max)");
-
                     b.Property<string>("ContentType")
                         .HasColumnType("nvarchar(max)");
 
@@ -836,13 +852,53 @@ namespace MTWorkHR.Infrastructure.Migrations
 
                     b.HasKey("Id");
 
-                    b.HasIndex("AttachmentTypeId");
-
                     b.HasIndex("ContractTaskId");
 
                     b.ToTable("ContractTaskAttachment");
                 });
 
+            modelBuilder.Entity("MTWorkHR.Core.Entities.ContractWorkingDay", b =>
+                {
+                    b.Property<long>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("bigint")
+                        .HasColumnOrder(0);
+
+                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));
+
+                    b.Property<long>("ContractId")
+                        .HasColumnType("bigint");
+
+                    b.Property<DateTime>("CreateDate")
+                        .HasColumnType("datetime2")
+                        .HasColumnOrder(3);
+
+                    b.Property<string>("CreateUser")
+                        .HasMaxLength(450)
+                        .HasColumnType("nvarchar(450)")
+                        .HasColumnOrder(1);
+
+                    b.Property<DateTime?>("UpdateDate")
+                        .HasColumnType("datetime2")
+                        .HasColumnOrder(4);
+
+                    b.Property<string>("UpdateUser")
+                        .HasMaxLength(450)
+                        .HasColumnType("nvarchar(450)")
+                        .HasColumnOrder(2);
+
+                    b.Property<string>("WorkingDay")
+                        .IsRequired()
+                        .HasMaxLength(50)
+                        .HasColumnType("nvarchar(50)");
+
+                    b.HasKey("Id");
+
+                    b.HasIndex("ContractId");
+
+                    b.ToTable("ContractWorkingDay");
+                });
+
             modelBuilder.Entity("MTWorkHR.Core.Entities.CountryLookup", b =>
                 {
                     b.Property<long>("Id")
@@ -3709,10 +3765,6 @@ namespace MTWorkHR.Infrastructure.Migrations
                     b.Property<long?>("AttachmentTypeId")
                         .HasColumnType("bigint");
 
-                    b.Property<byte[]>("Content")
-                        .IsRequired()
-                        .HasColumnType("varbinary(max)");
-
                     b.Property<string>("ContentType")
                         .HasColumnType("nvarchar(max)");
 
@@ -3750,8 +3802,6 @@ namespace MTWorkHR.Infrastructure.Migrations
 
                     b.HasKey("Id");
 
-                    b.HasIndex("AttachmentTypeId");
-
                     b.HasIndex("ProjectStageId");
 
                     b.ToTable("ProjectStageAttachment");
@@ -5299,21 +5349,26 @@ namespace MTWorkHR.Infrastructure.Migrations
 
             modelBuilder.Entity("MTWorkHR.Core.Entities.ContractTaskAttachment", b =>
                 {
-                    b.HasOne("MTWorkHR.Core.Entities.Base.AttachmentType", "AttachmentType")
-                        .WithMany()
-                        .HasForeignKey("AttachmentTypeId");
-
                     b.HasOne("MTWorkHR.Core.Entities.ContractTask", "ContractTask")
                         .WithMany("TaskAttachments")
                         .HasForeignKey("ContractTaskId")
                         .OnDelete(DeleteBehavior.Cascade)
                         .IsRequired();
 
-                    b.Navigation("AttachmentType");
-
                     b.Navigation("ContractTask");
                 });
 
+            modelBuilder.Entity("MTWorkHR.Core.Entities.ContractWorkingDay", b =>
+                {
+                    b.HasOne("MTWorkHR.Core.Entities.Contract", "Contract")
+                        .WithMany("WorkingDays")
+                        .HasForeignKey("ContractId")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
+                    b.Navigation("Contract");
+                });
+
             modelBuilder.Entity("MTWorkHR.Core.Entities.MeetingUser", b =>
                 {
                     b.HasOne("MTWorkHR.Core.Entities.Meeting", "Meeting")
@@ -5355,18 +5410,12 @@ namespace MTWorkHR.Infrastructure.Migrations
 
             modelBuilder.Entity("MTWorkHR.Core.Entities.ProjectStageAttachment", b =>
                 {
-                    b.HasOne("MTWorkHR.Core.Entities.Base.AttachmentType", "AttachmentType")
-                        .WithMany()
-                        .HasForeignKey("AttachmentTypeId");
-
                     b.HasOne("MTWorkHR.Core.Entities.ProjectStage", "ProjectStage")
                         .WithMany("StageAttachments")
                         .HasForeignKey("ProjectStageId")
                         .OnDelete(DeleteBehavior.Cascade)
                         .IsRequired();
 
-                    b.Navigation("AttachmentType");
-
                     b.Navigation("ProjectStage");
                 });
 
@@ -5644,6 +5693,8 @@ namespace MTWorkHR.Infrastructure.Migrations
                     b.Navigation("FixedAllowances");
 
                     b.Navigation("ProjectStages");
+
+                    b.Navigation("WorkingDays");
                 });
 
             modelBuilder.Entity("MTWorkHR.Core.Entities.ContractTask", b =>

+ 1 - 0
MTWorkHR.Infrastructure/Repositories/Contract/ContractRepository.cs

@@ -21,6 +21,7 @@ namespace MTWorkHR.Infrastructure.Repositories
                 .Include(x => x.ContractTasks)
                 .Include(x => x.FixedAllowances)
                 .Include(x => x.ProjectStages)
+                .Include(x => x.WorkingDays)
                 .FirstOrDefaultAsync(x => x.Id == id);
         }
 

+ 17 - 0
MTWorkHR.Infrastructure/Repositories/Contract/ContractTaskAttachmentRepository.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 ContractTaskAttachmentRepository : Repository<ContractTaskAttachment>, IContractTaskAttachmentRepository
+    {
+        public ContractTaskAttachmentRepository(HRDataContext context) : base(context)
+        {
+        }
+
+    }
+}

+ 17 - 0
MTWorkHR.Infrastructure/Repositories/Contract/ProjectStageAttachmentRepository.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 ProjectStageAttachmentRepository : Repository<ProjectStageAttachment>, IProjectStageAttachmentRepository
+    {
+        public ProjectStageAttachmentRepository(HRDataContext context) : base(context)
+        {
+        }
+
+    }
+}

+ 12 - 1
MTWorkHR.Infrastructure/Repositories/User/CompanyRepository.cs

@@ -9,9 +9,20 @@ namespace MTWorkHR.Infrastructure.Repositories
 {
     public class CompanyRepository : Repository<Company>, ICompanyRepository
     {
+        private readonly DbSet<Company> dbSet;
+   
         public CompanyRepository(HRDataContext context) : base(context)
         {
-        }
+            dbSet = context.Set<Company>();
 
+          
+        }
+        public async Task<Company> GetByIdWithAllChildren(long id)
+        {
+            return await dbSet
+                .Include(x => x.City)
+                .Include(x => x.Country)
+                .FirstOrDefaultAsync(x => x.Id == id);
+        }
     }
 }

+ 6 - 1
MTWorkHR.Infrastructure/UnitOfWork/UnitOfWork.cs

@@ -41,7 +41,8 @@ namespace MTWorkHR.Infrastructure.UnitOfWorks
         public IChatMessageRepository ChatMessage { get; }
         public IHubConnectionRepository HubConnection { get; }
         public IContractRepository Contract{ get; }
-
+        public IContractTaskAttachmentRepository ContractTaskAttachment { get; }
+        public IProjectStageAttachmentRepository ProjectStageAttachment { get; }
         public UnitOfWork(HRDataContext _context
             , IPermissionRepository permission
             , ICompanyRepository company
@@ -69,6 +70,8 @@ namespace MTWorkHR.Infrastructure.UnitOfWorks
             , IProjectTeamRepository projectTeam
             , IChatMessageRepository chatMessage
             , IContractRepository contract
+            , IContractTaskAttachmentRepository contractTaskAttachment
+            , IProjectStageAttachmentRepository projectStageAttachment
             , IHubConnectionRepository connection
 
             )
@@ -101,6 +104,8 @@ namespace MTWorkHR.Infrastructure.UnitOfWorks
             ChatMessage = chatMessage;
             Contract = contract;
             HubConnection = connection;
+            ContractTaskAttachment = contractTaskAttachment;
+            ProjectStageAttachment = projectStageAttachment;
         }
 
         public async Task<int> CompleteAsync()