zinab_elgendy 4 viikkoa sitten
vanhempi
commit
f2478b73e6
36 muutettua tiedostoa jossa 5648 lisäystä ja 51 poistoa
  1. 67 0
      MTWorkHR.API/Controllers/ContractController.cs
  2. 1 1
      MTWorkHR.API/Program.cs
  3. 1 0
      MTWorkHR.Application/ApplicationServiceRegistration.cs
  4. 25 0
      MTWorkHR.Application/Dtos/Contract/ContractAllowanceDto.cs
  5. 67 0
      MTWorkHR.Application/Dtos/Contract/ContractDto.cs
  6. 27 0
      MTWorkHR.Application/Dtos/Contract/ContractTaskAttachmentDto.cs
  7. 26 0
      MTWorkHR.Application/Dtos/Contract/ContractTaskDto.cs
  8. 27 0
      MTWorkHR.Application/Dtos/Contract/ProjectStageAttachmentDto.cs
  9. 26 0
      MTWorkHR.Application/Dtos/Contract/ProjectStageDto.cs
  10. 1 0
      MTWorkHR.Application/Dtos/Identity/CompanyUserDto.cs
  11. 11 0
      MTWorkHR.Application/Mapper/MappingProfile.cs
  12. 104 0
      MTWorkHR.Application/Services/Contract/ContractService.cs
  13. 11 0
      MTWorkHR.Application/Services/Interfaces/IContractService.cs
  14. 55 31
      MTWorkHR.Core/Entities/Contract/Contract.cs
  15. 27 0
      MTWorkHR.Core/Entities/Contract/ContractAllowance.cs
  16. 27 0
      MTWorkHR.Core/Entities/Contract/ContractTask.cs
  17. 29 0
      MTWorkHR.Core/Entities/Contract/ContractTaskAttachment.cs
  18. 28 0
      MTWorkHR.Core/Entities/Contract/ProjectStage.cs
  19. 29 0
      MTWorkHR.Core/Entities/Contract/ProjectStageAttachment.cs
  20. 14 0
      MTWorkHR.Core/Global/Enum/BillingCycle.cs
  21. 16 0
      MTWorkHR.Core/Global/Enum/ContractStatusEnum.cs
  22. 16 0
      MTWorkHR.Core/Global/Enum/ContractTypeEnum.cs
  23. 14 0
      MTWorkHR.Core/Global/Enum/PaymentType.cs
  24. 15 0
      MTWorkHR.Core/Global/Enum/TerminateContractEnum.cs
  25. 14 0
      MTWorkHR.Core/Global/Enum/TypeOfWork.cs
  26. 14 0
      MTWorkHR.Core/Global/Enum/WorkingHours.cs
  27. 16 0
      MTWorkHR.Core/IRepositories/Contract/IContractRepository.cs
  28. 1 1
      MTWorkHR.Core/IUnitOfWork/IUnitOfWork.cs
  29. 2 1
      MTWorkHR.Infrastructure/DBContext/HRDataContext.cs
  30. 2 2
      MTWorkHR.Infrastructure/InfrastructureServiceRegistration.cs
  31. 4122 0
      MTWorkHR.Infrastructure/Migrations/20241015091013_contractTbls.Designer.cs
  32. 275 0
      MTWorkHR.Infrastructure/Migrations/20241015091013_contractTbls.cs
  33. 498 0
      MTWorkHR.Infrastructure/Migrations/HRDataContextModelSnapshot.cs
  34. 37 0
      MTWorkHR.Infrastructure/Repositories/Contract/ContractRepository.cs
  35. 0 15
      MTWorkHR.Infrastructure/Repositories/EmployeeRepository.cs
  36. 3 0
      MTWorkHR.Infrastructure/UnitOfWork/UnitOfWork.cs

+ 67 - 0
MTWorkHR.API/Controllers/ContractController.cs

@@ -0,0 +1,67 @@
+using Microsoft.AspNetCore.Authorization;
+
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using MTWorkHR.Application.Filters;
+using MTWorkHR.Application.Identity;
+using MTWorkHR.Application.Models;
+using MTWorkHR.Application.Services.Interfaces;
+using MTWorkHR.Identity.Services;
+
+namespace MTWorkHR.API.Controllers
+{
+    [Route("api/[controller]")]
+    [ApiController]
+    [AppAuthorize]
+    public class ContractController : ControllerBase
+    {
+        private readonly IContractService _ContractService;
+        public ContractController(IContractService UserContractService)
+        {
+            this._ContractService = UserContractService;
+        }
+        [HttpGet("GetAll")]
+        [ProducesResponseType(StatusCodes.Status200OK)]
+
+        public async Task<ActionResult<List<ContractDto>>> GetAll([FromQuery] PagingInputDto pagingInput)
+        {
+            return Ok(await _ContractService.GetAll(pagingInput));
+        }
+        [HttpGet("Get")]
+        [ProducesResponseType(StatusCodes.Status200OK)]
+       // [AppAuthorize(Permissions = "Contract")]
+        public async Task<ActionResult<ContractDto>> Get(long ContractId)
+        {
+            return Ok(await _ContractService.GetById(ContractId));
+        }
+
+
+        [HttpPost("Create")]
+        [ProducesResponseType(StatusCodes.Status200OK)]
+       // [AppAuthorize(Permissions = "Contract.Create")]
+        public async Task<ActionResult<ContractDto>> Create([FromBody] ContractDto input)
+        {
+            return await _ContractService.Create(input);
+        }
+
+        [HttpPost("Update")]
+        [ProducesResponseType(StatusCodes.Status200OK)]
+       // [AppAuthorize(Permissions = "Contract.Update")]
+        public async Task Update([FromBody] ContractDto input)
+        {
+            await _ContractService.Update(input);
+        }
+
+        [HttpDelete("Delete")]
+        [ProducesResponseType(StatusCodes.Status200OK)]
+       // [AppAuthorize(Permissions = "Contract.Delete")]
+
+        public async Task Delete([FromQuery] long id)
+        {
+            await _ContractService.Delete(id);
+        }
+
+
+
+    }
+}

+ 1 - 1
MTWorkHR.API/Program.cs

@@ -31,7 +31,7 @@ var config = new AppSettingsConfiguration();
 // Add services to the container.
 builder.Services.AddDbContext<HRDataContext>(options =>
 {
-    options.UseSqlServer(config.ConnectionStrings.MTWorkHRConnectionString);
+    options.UseSqlServer(config.ConnectionStrings.LocalConnectionString);
     //  options.UseSqlServer(builder.Configuration.GetSection("ConnectionStrings:MTWorkHRConnectionString").Value);
 });
 

+ 1 - 0
MTWorkHR.Application/ApplicationServiceRegistration.cs

@@ -35,6 +35,7 @@ namespace MTWorkHR.Application
             services.AddScoped<IOrderRequestService, OrderRequestService>();
             services.AddScoped<ILookupService, LookupService>();
             services.AddScoped<ICompanyService, CompanyService>();
+            services.AddScoped<IContractService, ContractService>();
             services.AddScoped<IOTPService, OTPService>();
             services.AddScoped<ILogService<UserLog>, LogService<UserLog>>();
 

+ 25 - 0
MTWorkHR.Application/Dtos/Contract/ContractAllowanceDto.cs

@@ -0,0 +1,25 @@
+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;
+using MTWorkHR.Core.Global;
+
+namespace MTWorkHR.Application.Models
+{
+    public class ContractAllowanceDto : EntityDto
+    {
+
+        public long ContractId{ get; set; }
+        [Required]
+        public long AllowanceType { get; set; }
+        public string? AllowanceDesc { get; set; }
+        public long EntitlementPercent { get; set; }// اختيار (مبلغ – يكتب المبلغ)    أو  (نسبة من الراتب – ويظهر المبلغ توماتك)      
+        public long EntitlementAmount { get; set; }
+        public PaymentType PaymentType { get; set; }
+
+    }
+}

+ 67 - 0
MTWorkHR.Application/Dtos/Contract/ContractDto.cs

@@ -0,0 +1,67 @@
+using MTWorkHR.Application.Models;
+using MTWorkHR.Core.Entities.Base;
+using MTWorkHR.Core.Global;
+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;
+
+namespace MTWorkHR.Application.Models
+{
+    public class ContractDto : EntityDto
+    {
+        public ContractTypeEnum ContractTypeId { get; set; }
+
+        public long CompanyId { get; set; }
+        public string CompanyRepresentativeId { get; set; }
+       
+        public string UserId { get; set; }
+      
+        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; }
+        //-------------------Scope of work-----------
+        public int? JobTitleId { get; set; }
+        public string? JobDescription{ get; set; }
+        [MaxLength(150)]
+        public string? JobNumber { get; set; } //ثابت و مأخوذ من المنصة
+        //----------------Contract data -------------------------
+        public DateTime? StartDate { get; set; }
+        public DateTime? EndDate { get; set; }
+        public int ContractDurationId { get; set; } //:  اختيار: شهري – ربعي – نصف سنوي – 3 ارباع – سنوي
+        public TypeOfWork TypeOfWork { get; set; } //: :   اختيار: عقد بدوام كامل -  عقد دوام جزئي   
+        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 أيام قبل انتهاء الاستحقاق) آخر: تعديل
+
+
+        //------Working time---------------
+        public string WorkingDays { get; set; } //:   اختيار متعدد الأيام سبت أحد اثنين..... (بحيث الأيام الأخرى تكون إجازة) 1,2,3,4,5
+        public WorkingHours WorkingHours { get; set; } //	يومي/ اسبوعي  
+        public DateTime? StartDailyWorkingHours { get; set; } // تحديد ساعات الدوام قائمة الساعات << التوقيت بحسب دولة صاحب العمل
+        public DateTime? EndDailyWorkingHours { get; set; } // تحديد ساعات الدوام قائمة الساعات << التوقيت بحسب دولة صاحب العمل
+
+        //----------Salary-----------------
+        [MaxLength(50)]
+        public string? Currency { get; set; }
+        public decimal? Salary{ get; set; }
+        public BillingCycle BillingCycle { get; set; }// 2 fortnightly, 4 Monthly
+
+
+        //---------Allowances----------------------
+        public bool IncludesAllAllowances { get; set; }
+        public List<ContractAllowanceDto>? FixedAllowances { get; set; }
+
+        //-------------------------------
+        public List<ContractTaskDto>? ContractTasks { get; set; }
+        public List<ProjectStageDto>? ProjectStages { get; set; }
+
+    }
+}

+ 27 - 0
MTWorkHR.Application/Dtos/Contract/ContractTaskAttachmentDto.cs

@@ -0,0 +1,27 @@
+using MTWorkHR.Core.Entities.Base;
+using System.ComponentModel.DataAnnotations.Schema;
+using System.ComponentModel.DataAnnotations;
+
+
+namespace MTWorkHR.Application.Models
+{
+    public class ContractTaskAttachmentDto : EntityDto
+    {
+        public long ContractTaskId { get; set; }
+
+        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 string? FilePath { get; set; }
+        public string? ContentType { get; set; }
+    }
+}

+ 26 - 0
MTWorkHR.Application/Dtos/Contract/ContractTaskDto.cs

@@ -0,0 +1,26 @@
+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.Application.Models
+{
+    public class ContractTaskDto : EntityDto
+    {
+
+        public long ContractId{ get; set; }
+        //public ContractDto? Contract { get; set; }
+        [Required]
+        [MaxLength(250)]
+        public string Title { get; set; }
+        public DateTime? StartDate{ get; set; }
+        public decimal? Amount { get; set; }
+        public string? ScopeOfWork { get; set; }
+        public List<ContractTaskAttachmentDto>? TaskAttachments { get; set; }
+
+    }
+}

+ 27 - 0
MTWorkHR.Application/Dtos/Contract/ProjectStageAttachmentDto.cs

@@ -0,0 +1,27 @@
+using MTWorkHR.Core.Entities.Base;
+using System.ComponentModel.DataAnnotations.Schema;
+using System.ComponentModel.DataAnnotations;
+
+
+namespace MTWorkHR.Application.Models
+{
+    public class ProjectStageAttachmentDto : EntityDto
+    {
+        public long ProjectStageId { get; set; }
+
+        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 string? FilePath { get; set; }
+        public string? ContentType { get; set; }
+    }
+}

+ 26 - 0
MTWorkHR.Application/Dtos/Contract/ProjectStageDto.cs

@@ -0,0 +1,26 @@
+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.Application.Models
+{
+    public class ProjectStageDto : EntityDto
+    {
+
+        public long ContractId{ get; set; }
+        [Required]
+        [MaxLength(250)]
+        public string Title { get; set; }
+        public DateTime? StartDate{ get; set; }
+        public DateTime? ExpectedEndDate { get; set; }
+        public decimal? AmountPercent { get; set; }
+        public string? ScopeOfWork { get; set; }
+        public List<ProjectStageAttachmentDto>? StageAttachments { get; set; }
+
+    }
+}

+ 1 - 0
MTWorkHR.Application/Dtos/Identity/CompanyUserDto.cs

@@ -32,6 +32,7 @@ namespace MTWorkHR.Application.Models
       
         public decimal? TaxNumber { get; set; }
         public decimal? IncomeTaxValue { get; set; }
+        public string? Position { get; set; }
         public IList<AttachmentDto>? UserAttachments{ get; set; }
         public UserAddressDto? UserAddress{ get; set; }
 

+ 11 - 0
MTWorkHR.Application/Mapper/MappingProfile.cs

@@ -130,6 +130,17 @@ namespace MTWorkHR.Application.Mapper
             CreateMap<CompanyUserDto, ApplicationUser>().ForMember(m => m.UserName, o => o.MapFrom(s => s.Email));
             CreateMap<ApplicationUser, CompanyUserDto>().ForMember(m => m.Password, op => op.Ignore());
             CreateMap<UserTaskStatus, UserTaskStatusDto>().ReverseMap();
+            //-----------Contract----
+            CreateMap<Contract, ContractDto>();
+            CreateMap<ContractDto, Contract>()
+                .ForMember(d => d.CreateDate, o => o.Ignore())
+                .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<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()); ;
+
 
         }
     }

+ 104 - 0
MTWorkHR.Application/Services/Contract/ContractService.cs

@@ -0,0 +1,104 @@
+using Microsoft.EntityFrameworkCore;
+using MTWorkHR.Application.Identity;
+using MTWorkHR.Application.Mapper;
+using MTWorkHR.Application.Models;
+using MTWorkHR.Core.Global;
+using MTWorkHR.Core.UnitOfWork;
+using MTWorkHR.Application.Services.Interfaces;
+using MTWorkHR.Core.Entities;
+using System.Linq.Dynamic.Core;
+
+namespace MTWorkHR.Application.Services
+{
+    public class ContractService : BaseService<Contract, ContractDto, ContractDto>, IContractService
+    {
+        private readonly IUnitOfWork _unitOfWork;
+        private readonly IUserService _userService;
+        private readonly GlobalInfo _globalInfo;
+
+        public ContractService(IUnitOfWork unitOfWork, IUserService userService, GlobalInfo globalInfo) : base(unitOfWork)
+        {
+            _unitOfWork = unitOfWork;
+            _userService = userService;
+            _globalInfo = globalInfo;
+        }
+
+        public override async Task<ContractDto> GetById(long id)
+        {
+            var entity = await _unitOfWork.Contract.GetByIdWithAllChildren(id);
+            var response = MapperObject.Mapper.Map<ContractDto>(entity);
+            return response;
+        }
+       
+        public override async Task<ContractDto> Create(ContractDto input)
+        {
+            var entity = MapperObject.Mapper.Map<Contract>(input);
+
+            if (entity is null)
+            {
+                throw new AppException(ExceptionEnum.MapperIssue);
+            }
+
+            var team = await _unitOfWork.Contract.AddAsync(entity);
+            await _unitOfWork.CompleteAsync();
+
+            var response = MapperObject.Mapper.Map<ContractDto>(team);
+            return response;
+        }
+
+        //public override async Task<ContractDto> Update(ContractDto input)
+        //{
+        //    var entity = MapperObject.Mapper.Map<Contract>(input);
+
+        //    if (entity is null)
+        //    {
+        //        throw new AppException(ExceptionEnum.MapperIssue);
+        //    }
+
+        //    var contract = await _unitOfWork.Contract.upd(entity);
+        //    await _unitOfWork.CompleteAsync();
+
+
+        //    var response = Mapper.MapperObject.Mapper.Map<ContractDto>(entity);
+        //    return response;
+        //}
+        public override async Task<PagingResultDto<ContractDto>> GetAll(PagingInputDto PagingInputDto)
+        {
+            var res = await _unitOfWork.Contract.GetAllWithChildrenAsync();
+            var query = res.Item1;
+
+            if (_globalInfo.UserType != UserTypeEnum.Business)
+            {
+               // query = query.Where(m => m.ContractUsers != null && m.ContractUsers.Count > 0 && m.ContractUsers.Count(u=> u.AssignedUserId == _globalInfo.UserId) > 0);
+
+            }
+            if (PagingInputDto.Filter != null)
+            {
+                var filter = PagingInputDto.Filter;
+                query = query.Where(u => u.JobDescription.Contains(filter));
+            }
+
+            var order = query.OrderBy(PagingInputDto.OrderByField + " " + PagingInputDto.OrderType);
+
+            var page = order.Skip((PagingInputDto.PageNumber * PagingInputDto.PageSize) - PagingInputDto.PageSize).Take(PagingInputDto.PageSize);
+
+            var total = await query.CountAsync();
+
+            var list = MapperObject.Mapper
+                .Map<IList<ContractDto>>(await page.ToListAsync());
+
+            var response = new PagingResultDto<ContractDto>
+            {
+                Result = list,
+                Total = total
+            };
+
+            return response;
+        }
+
+       
+
+
+
+    }
+}

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

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

+ 55 - 31
MTWorkHR.Core/Entities/Contract/Contract.cs

@@ -1,58 +1,82 @@
 using MTWorkHR.Core.Entities.Base;
+using MTWorkHR.Core.Global;
 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;
 
-namespace MTWorkHR.Infrastructure.Entities
+namespace MTWorkHR.Core.Entities
 {
     public class Contract : FullAuditEntity, IHaveCompany
     {
-        public string FirstName { get; set; }
-        public string MiddleName { get; set; }
-        public string LastName { get; set; }
-        public string Email { get; set; }
+        public ContractTypeEnum ContractTypeId { get; set; }
+        public ContractStatusEnum ContractStatusId { get; set; }
 
-        public int Nationality { get; set; }
-        public int LivingCountry { get; set; }
+        public long CompanyId { get; set; }
+        public string CompanyRepresentativeId { get; set; }
+       
+        public string UserId { get; set; }
       
-        public bool IsVisaNeeded { get; set; } = false;
+        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; }
+        
+        //-------------------Scope of work-----------
+        public int? JobTitleId { get; set; }
+        public string? JobDescription{ get; set; }
+        [MaxLength(150)]
+        public string? JobNumber { get; set; } //ثابت و مأخوذ من المنصة
+        //----------------Contract data -------------------------
+        public DateTime? StartDate { get; set; }
+        public DateTime? EndDate { get; set; }
+        public int ContractDurationId { get; set; } //:  اختيار: شهري – ربعي – نصف سنوي – 3 ارباع – سنوي
+        public TypeOfWork TypeOfWork { get; set; } //: :   اختيار: عقد بدوام كامل -  عقد دوام جزئي   
+        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 أيام قبل انتهاء الاستحقاق) آخر: تعديل
 
 
-        public string? EducationLevel { get; set; }
-        public string? LinkedInLink { get; set; }
-        public int? NoOfDependent { get; set; }
-        //Job Details-----------------
-        public string? SeniorityLevel { get; set; }
-        public string? JobTitle { get; set; }
-        public string? JobScope { get; set; }
+        //------Working time---------------
+        public string WorkingDays { get; set; } //:   اختيار متعدد الأيام سبت أحد اثنين..... (بحيث الأيام الأخرى تكون إجازة) 1,2,3,4,5
+        public WorkingHours WorkingHours { get; set; } //	يومي/ اسبوعي  
+        public DateTime? StartDailyWorkingHours { get; set; } // تحديد ساعات الدوام قائمة الساعات << التوقيت بحسب دولة صاحب العمل
+        public DateTime? EndDailyWorkingHours { get; set; } // تحديد ساعات الدوام قائمة الساعات << التوقيت بحسب دولة صاحب العمل
 
+        //----------Salary-----------------
+        [MaxLength(50)]
+        public string? Currency { get; set; }
+        public decimal? Salary{ get; set; }
+        public BillingCycle BillingCycle { get; set; }// 2 fortnightly, 4 Monthly
 
-        //Compensation----------------------
 
+        //---------Allowances----------------------
+        public bool IncludesAllAllowances { get; set; }
+        public List<ContractAllowance>? FixedAllowances { get; set; }
 
-        public decimal? GrossAnnualBaseSalary { get; set; }
+        //-------------------------------
+        public List<ContractTask>? ContractTasks { get; set; }
+        public List<ProjectStage>? ProjectStages { get; set; }
 
-        public bool? AddSigningBonus { get; set; }
-        public bool? AddAnnualVariableCompensation { get; set; }
-        public bool? FixedAllowances { get; set; }
-        public DateTime? StartDate { get; set; }
 
+        //  public decimal? GrossAnnualBaseSalary { get; set; }
 
-        public bool FullTime { get; set; } = true; //full-time that will be 40 hours , part-time will be add it manually
-        public int EmployeeTypeHours { get; set; } = 40; //full-time that will be 40 hours , part-time will be add it manually
+        //  public bool? AddSigningBonus { get; set; }
+        // public bool? AddAnnualVariableCompensation { get; set; }
 
-        public int PaidVacationDays { get; set; }
-        public int SickDays { get; set; }
-        public bool EmploymentTerms { get; set; }
-        public int ProbationPeriod { get; set; }
-        public int Gender { get; set; }
-        public DateTime? DateOfBirth { get; set; }
+        //public bool FullTime { get; set; } = true; //full-time that will be 40 hours , part-time will be add it manually
+        //public int EmployeeTypeHours { get; set; } = 40; //full-time that will be 40 hours , part-time will be add it manually
 
+        //public int PaidVacationDays { get; set; }
+        //public int SickDays { get; set; }
+        //public bool EmploymentTerms { get; set; }
 
-        public bool IsSkilled { get; set; }
-        public long CompanyId { get ; set; }
     }
 }

+ 27 - 0
MTWorkHR.Core/Entities/Contract/ContractAllowance.cs

@@ -0,0 +1,27 @@
+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;
+using MTWorkHR.Core.Global;
+
+namespace MTWorkHR.Core.Entities
+{
+    public class ContractAllowance : AuditEntity
+    {
+
+        public long ContractId{ get; set; }
+        [ForeignKey("ContractId")]
+        public Contract? Contract { get; set; }
+        [Required]
+        public long AllowanceType { get; set; }
+        public string? AllowanceDesc { get; set; }
+        public long EntitlementPercent { get; set; }// اختيار (مبلغ – يكتب المبلغ)    أو  (نسبة من الراتب – ويظهر المبلغ توماتك)      
+        public long EntitlementAmount { get; set; }
+        public PaymentType PaymentType { get; set; }
+
+    }
+}

+ 27 - 0
MTWorkHR.Core/Entities/Contract/ContractTask.cs

@@ -0,0 +1,27 @@
+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 ContractTask : AuditEntity
+    {
+
+        public long ContractId{ get; set; }
+        [ForeignKey("ContractId")]
+        public Contract? Contract { get; set; }
+        [Required]
+        [MaxLength(250)]
+        public string Title { get; set; }
+        public DateTime? StartDate{ get; set; }
+        public decimal? Amount { get; set; }
+        public string? ScopeOfWork { get; set; }
+        public List<ContractTaskAttachment>? TaskAttachments { get; set; }
+
+    }
+}

+ 29 - 0
MTWorkHR.Core/Entities/Contract/ContractTaskAttachment.cs

@@ -0,0 +1,29 @@
+using MTWorkHR.Core.Entities.Base;
+using System.ComponentModel.DataAnnotations.Schema;
+using System.ComponentModel.DataAnnotations;
+
+
+namespace MTWorkHR.Core.Entities
+{
+    public class ContractTaskAttachment : AuditEntity
+    {
+        public long ContractTaskId { get; set; }
+
+        [ForeignKey("ContractTaskId")]
+        public ContractTask ContractTask { get; set; }
+        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 string? FilePath { get; set; }
+        public string? ContentType { get; set; }
+    }
+}

+ 28 - 0
MTWorkHR.Core/Entities/Contract/ProjectStage.cs

@@ -0,0 +1,28 @@
+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 ProjectStage : AuditEntity
+    {
+
+        public long ContractId{ get; set; }
+        [ForeignKey("ContractId")]
+        public Contract? Contract { get; set; }
+        [Required]
+        [MaxLength(250)]
+        public string Title { get; set; }
+        public DateTime? StartDate{ get; set; }
+        public DateTime? ExpectedEndDate { get; set; }
+        public decimal? AmountPercent { get; set; }
+        public string? ScopeOfWork { get; set; }
+        public List<ProjectStageAttachment>? StageAttachments { get; set; }
+
+    }
+}

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

@@ -0,0 +1,29 @@
+using MTWorkHR.Core.Entities.Base;
+using System.ComponentModel.DataAnnotations.Schema;
+using System.ComponentModel.DataAnnotations;
+
+
+namespace MTWorkHR.Core.Entities
+{
+    public class ProjectStageAttachment : AuditEntity
+    {
+        public long ProjectStageId { get; set; }
+
+        [ForeignKey("ProjectStageId")]
+        public ProjectStage ProjectStage { get; set; }
+        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 string? FilePath { get; set; }
+        public string? ContentType { get; set; }
+    }
+}

+ 14 - 0
MTWorkHR.Core/Global/Enum/BillingCycle.cs

@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace MTWorkHR.Core.Global
+{
+    public enum BillingCycle
+    {
+        Monthly,
+        Fortnightly
+    }
+}

+ 16 - 0
MTWorkHR.Core/Global/Enum/ContractStatusEnum.cs

@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace MTWorkHR.Core.Global
+{
+    public enum ContractStatusEnum
+    {
+        Initiated = 1,
+        Reviewed= 2,
+        Approved= 3,
+        Canceled= 4,
+    }
+}

+ 16 - 0
MTWorkHR.Core/Global/Enum/ContractTypeEnum.cs

@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace MTWorkHR.Core.Global
+{
+    public enum ContractTypeEnum
+    {
+        EmployeeContract = 1,
+        FixedPayContract = 2,
+        PerProjectContract = 3,
+        PerTaskContract = 4,
+    }
+}

+ 14 - 0
MTWorkHR.Core/Global/Enum/PaymentType.cs

@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace MTWorkHR.Core.Global
+{
+    public enum PaymentType
+    {
+        OneTime,
+        ContinuousWithSalary
+    }
+}

+ 15 - 0
MTWorkHR.Core/Global/Enum/TerminateContractEnum.cs

@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace MTWorkHR.Core.Global
+{
+    public enum TerminateContractEnum
+    {
+        All = 1,
+        WorkOwner = 2,
+        Employee = 3
+    }
+}

+ 14 - 0
MTWorkHR.Core/Global/Enum/TypeOfWork.cs

@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace MTWorkHR.Core.Global
+{
+    public enum TypeOfWork
+    {
+        FullTime,
+        PartTime
+    }
+}

+ 14 - 0
MTWorkHR.Core/Global/Enum/WorkingHours.cs

@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace MTWorkHR.Core.Global
+{
+    public enum WorkingHours
+    {
+        Daily,
+        Weekly,
+    }
+}

+ 16 - 0
MTWorkHR.Core/IRepositories/Contract/IContractRepository.cs

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

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

@@ -36,7 +36,7 @@ namespace MTWorkHR.Core.UnitOfWork
         ILoginOTPRepository LoginOTP { get; }
 
         IChatMessageRepository ChatMessage { get; }
-
+        IContractRepository Contract { get; }
         Task<int> CompleteAsync();
 
         void BeginTran();

+ 2 - 1
MTWorkHR.Infrastructure/DBContext/HRDataContext.cs

@@ -50,8 +50,9 @@ namespace MTWorkHR.Infrastructure.DBContext
         public DbSet<JobTitle> JobTitles { get; set; }
         public DbSet<LoginOTP> LoginOTPs { get; set; }
         public DbSet<City> Cities { get; set; }
+        //-----------
+        public DbSet<Contract> Contracts { get; set; }
 
-        
         //------------------------Logs------------------------
         public DbSet<UserLog> UserLogs { get; set; }
         public DbSet<AuthLog> AuthLogs { get; set; }

+ 2 - 2
MTWorkHR.Infrastructure/InfrastructureServiceRegistration.cs

@@ -31,7 +31,7 @@ namespace MTWorkHR.Infrastructure
             
             services.AddDbContext<HRDataContext>(options =>
                 options.UseSqlServer(
-                    config.ConnectionStrings.MTWorkHRConnectionString  //configuration.GetSection("ConnectionString:MTWorkHRConnectionString").Value
+                    config.ConnectionStrings.LocalConnectionString  //configuration.GetSection("ConnectionString:MTWorkHRConnectionString").Value
                     ));
            
             services.AddIdentity<ApplicationUser, ApplicationRole>().AddEntityFrameworkStores<HRDataContext>().AddDefaultTokenProviders();
@@ -83,6 +83,7 @@ namespace MTWorkHR.Infrastructure
             services.AddScoped(typeof(ICityRepository), typeof(CityRepository));
             services.AddScoped(typeof(IProjectTeamRepository), typeof(ProjectTeamRepository));
             services.AddScoped(typeof(IChatMessageRepository), typeof(ChatMessageRepository));
+            services.AddScoped(typeof(IContractRepository), typeof(ContractRepository));
 
 
 
@@ -97,7 +98,6 @@ namespace MTWorkHR.Infrastructure
             services.AddScoped<ApplicationUserManager>();
             services.AddScoped<GlobalInfo>();
 
-            services.AddScoped<IEmployeeRepository, EmployeeRepository>();
 
             //services.AddScoped(typeof(IAppLogger<>), typeof(LoggerAdapter<>));
             return services;

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 4122 - 0
MTWorkHR.Infrastructure/Migrations/20241015091013_contractTbls.Designer.cs


+ 275 - 0
MTWorkHR.Infrastructure/Migrations/20241015091013_contractTbls.cs

@@ -0,0 +1,275 @@
+using System;
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace MTWorkHR.Infrastructure.Migrations
+{
+    /// <inheritdoc />
+    public partial class contractTbls : Migration
+    {
+        /// <inheritdoc />
+        protected override void Up(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.CreateTable(
+                name: "Contracts",
+                columns: table => new
+                {
+                    Id = table.Column<long>(type: "bigint", nullable: false)
+                        .Annotation("SqlServer:Identity", "1, 1"),
+                    CreateUser = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: true),
+                    UpdateUser = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: true),
+                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
+                    UpdateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
+                    IsDeleted = table.Column<bool>(type: "bit", nullable: false),
+                    DeleteUserId = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: true),
+                    ContractTypeId = table.Column<int>(type: "int", nullable: false),
+                    CompanyId = table.Column<long>(type: "bigint", nullable: false),
+                    CompanyRepresentativeId = table.Column<string>(type: "nvarchar(max)", nullable: false),
+                    UserId = table.Column<string>(type: "nvarchar(max)", nullable: false),
+                    JobId = table.Column<int>(type: "int", nullable: true),
+                    AcademicQualificationId = table.Column<int>(type: "int", nullable: true),
+                    SpecializationId = table.Column<int>(type: "int", nullable: true),
+                    WorkCountryId = table.Column<int>(type: "int", nullable: false),
+                    WorkStateId = table.Column<int>(type: "int", nullable: false),
+                    JobTitleId = table.Column<int>(type: "int", nullable: true),
+                    JobDescription = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    JobNumber = table.Column<string>(type: "nvarchar(150)", maxLength: 150, nullable: true),
+                    StartDate = table.Column<DateTime>(type: "datetime2", nullable: true),
+                    EndDate = table.Column<DateTime>(type: "datetime2", nullable: true),
+                    ContractDurationId = table.Column<int>(type: "int", nullable: false),
+                    TypeOfWork = table.Column<int>(type: "int", nullable: false),
+                    VacationDays = table.Column<int>(type: "int", nullable: false),
+                    TrialPeriod = table.Column<int>(type: "int", nullable: false),
+                    WhoCanTerminateContractInTrial = table.Column<int>(type: "int", nullable: false),
+                    WhoCanTerminateContract = table.Column<int>(type: "int", nullable: false),
+                    NoticePeriodBeforeTermination = table.Column<int>(type: "int", nullable: false),
+                    WorkingDays = table.Column<string>(type: "nvarchar(max)", nullable: false),
+                    WorkingHours = table.Column<int>(type: "int", nullable: false),
+                    StartDailyWorkingHours = table.Column<DateTime>(type: "datetime2", nullable: true),
+                    EndDailyWorkingHours = table.Column<DateTime>(type: "datetime2", nullable: true),
+                    Currency = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
+                    Salary = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
+                    BillingCycle = table.Column<int>(type: "int", nullable: false),
+                    IncludesAllAllowances = table.Column<bool>(type: "bit", nullable: false)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_Contracts", x => x.Id);
+                });
+
+            migrationBuilder.CreateTable(
+                name: "ContractAllowance",
+                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),
+                    AllowanceType = table.Column<long>(type: "bigint", nullable: false),
+                    AllowanceDesc = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    EntitlementPercent = table.Column<long>(type: "bigint", nullable: false),
+                    EntitlementAmount = table.Column<long>(type: "bigint", nullable: false),
+                    PaymentType = table.Column<int>(type: "int", nullable: false)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_ContractAllowance", x => x.Id);
+                    table.ForeignKey(
+                        name: "FK_ContractAllowance_Contracts_ContractId",
+                        column: x => x.ContractId,
+                        principalTable: "Contracts",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Cascade);
+                });
+
+            migrationBuilder.CreateTable(
+                name: "ContractTask",
+                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),
+                    Title = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: false),
+                    StartDate = table.Column<DateTime>(type: "datetime2", nullable: true),
+                    Amount = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
+                    ScopeOfWork = table.Column<string>(type: "nvarchar(max)", nullable: true)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_ContractTask", x => x.Id);
+                    table.ForeignKey(
+                        name: "FK_ContractTask_Contracts_ContractId",
+                        column: x => x.ContractId,
+                        principalTable: "Contracts",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Cascade);
+                });
+
+            migrationBuilder.CreateTable(
+                name: "ProjectStage",
+                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),
+                    Title = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: false),
+                    StartDate = table.Column<DateTime>(type: "datetime2", nullable: true),
+                    ExpectedEndDate = table.Column<DateTime>(type: "datetime2", nullable: true),
+                    AmountPercent = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
+                    ScopeOfWork = table.Column<string>(type: "nvarchar(max)", nullable: true)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_ProjectStage", x => x.Id);
+                    table.ForeignKey(
+                        name: "FK_ProjectStage_Contracts_ContractId",
+                        column: x => x.ContractId,
+                        principalTable: "Contracts",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Cascade);
+                });
+
+            migrationBuilder.CreateTable(
+                name: "ContractTaskAttachment",
+                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),
+                    ContractTaskId = table.Column<long>(type: "bigint", nullable: false),
+                    AttachmentTypeId = table.Column<long>(type: "bigint", nullable: true),
+                    FileName = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: true),
+                    OriginalName = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: true),
+                    Content = table.Column<byte[]>(type: "varbinary(max)", nullable: false),
+                    FilePath = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    ContentType = table.Column<string>(type: "nvarchar(max)", nullable: true)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_ContractTaskAttachment", x => x.Id);
+                    table.ForeignKey(
+                        name: "FK_ContractTaskAttachment_AttachmentTypes_AttachmentTypeId",
+                        column: x => x.AttachmentTypeId,
+                        principalTable: "AttachmentTypes",
+                        principalColumn: "Id");
+                    table.ForeignKey(
+                        name: "FK_ContractTaskAttachment_ContractTask_ContractTaskId",
+                        column: x => x.ContractTaskId,
+                        principalTable: "ContractTask",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Cascade);
+                });
+
+            migrationBuilder.CreateTable(
+                name: "ProjectStageAttachment",
+                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),
+                    ProjectStageId = table.Column<long>(type: "bigint", nullable: false),
+                    AttachmentTypeId = table.Column<long>(type: "bigint", nullable: true),
+                    FileName = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: true),
+                    OriginalName = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: true),
+                    Content = table.Column<byte[]>(type: "varbinary(max)", nullable: false),
+                    FilePath = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    ContentType = table.Column<string>(type: "nvarchar(max)", nullable: true)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_ProjectStageAttachment", x => x.Id);
+                    table.ForeignKey(
+                        name: "FK_ProjectStageAttachment_AttachmentTypes_AttachmentTypeId",
+                        column: x => x.AttachmentTypeId,
+                        principalTable: "AttachmentTypes",
+                        principalColumn: "Id");
+                    table.ForeignKey(
+                        name: "FK_ProjectStageAttachment_ProjectStage_ProjectStageId",
+                        column: x => x.ProjectStageId,
+                        principalTable: "ProjectStage",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Cascade);
+                });
+
+            migrationBuilder.CreateIndex(
+                name: "IX_ContractAllowance_ContractId",
+                table: "ContractAllowance",
+                column: "ContractId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_Contracts_CompanyId",
+                table: "Contracts",
+                column: "CompanyId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_ContractTask_ContractId",
+                table: "ContractTask",
+                column: "ContractId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_ContractTaskAttachment_AttachmentTypeId",
+                table: "ContractTaskAttachment",
+                column: "AttachmentTypeId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_ContractTaskAttachment_ContractTaskId",
+                table: "ContractTaskAttachment",
+                column: "ContractTaskId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_ProjectStage_ContractId",
+                table: "ProjectStage",
+                column: "ContractId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_ProjectStageAttachment_AttachmentTypeId",
+                table: "ProjectStageAttachment",
+                column: "AttachmentTypeId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_ProjectStageAttachment_ProjectStageId",
+                table: "ProjectStageAttachment",
+                column: "ProjectStageId");
+        }
+
+        /// <inheritdoc />
+        protected override void Down(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.DropTable(
+                name: "ContractAllowance");
+
+            migrationBuilder.DropTable(
+                name: "ContractTaskAttachment");
+
+            migrationBuilder.DropTable(
+                name: "ProjectStageAttachment");
+
+            migrationBuilder.DropTable(
+                name: "ContractTask");
+
+            migrationBuilder.DropTable(
+                name: "ProjectStage");
+
+            migrationBuilder.DropTable(
+                name: "Contracts");
+        }
+    }
+}

+ 498 - 0
MTWorkHR.Infrastructure/Migrations/HRDataContextModelSnapshot.cs

@@ -514,6 +514,304 @@ namespace MTWorkHR.Infrastructure.Migrations
                     b.ToTable("Companies");
                 });
 
+            modelBuilder.Entity("MTWorkHR.Core.Entities.Contract", b =>
+                {
+                    b.Property<long>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("bigint")
+                        .HasColumnOrder(0);
+
+                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));
+
+                    b.Property<int?>("AcademicQualificationId")
+                        .HasColumnType("int");
+
+                    b.Property<int>("BillingCycle")
+                        .HasColumnType("int");
+
+                    b.Property<long>("CompanyId")
+                        .HasColumnType("bigint");
+
+                    b.Property<string>("CompanyRepresentativeId")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<int>("ContractDurationId")
+                        .HasColumnType("int");
+
+                    b.Property<int>("ContractTypeId")
+                        .HasColumnType("int");
+
+                    b.Property<DateTime>("CreateDate")
+                        .HasColumnType("datetime2")
+                        .HasColumnOrder(3);
+
+                    b.Property<string>("CreateUser")
+                        .HasMaxLength(450)
+                        .HasColumnType("nvarchar(450)")
+                        .HasColumnOrder(1);
+
+                    b.Property<string>("Currency")
+                        .HasMaxLength(50)
+                        .HasColumnType("nvarchar(50)");
+
+                    b.Property<string>("DeleteUserId")
+                        .HasMaxLength(450)
+                        .HasColumnType("nvarchar(450)")
+                        .HasColumnOrder(8);
+
+                    b.Property<DateTime?>("EndDailyWorkingHours")
+                        .HasColumnType("datetime2");
+
+                    b.Property<DateTime?>("EndDate")
+                        .HasColumnType("datetime2");
+
+                    b.Property<bool>("IncludesAllAllowances")
+                        .HasColumnType("bit");
+
+                    b.Property<bool>("IsDeleted")
+                        .HasColumnType("bit")
+                        .HasColumnOrder(7);
+
+                    b.Property<string>("JobDescription")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<int?>("JobId")
+                        .HasColumnType("int");
+
+                    b.Property<string>("JobNumber")
+                        .HasMaxLength(150)
+                        .HasColumnType("nvarchar(150)");
+
+                    b.Property<int?>("JobTitleId")
+                        .HasColumnType("int");
+
+                    b.Property<int>("NoticePeriodBeforeTermination")
+                        .HasColumnType("int");
+
+                    b.Property<decimal?>("Salary")
+                        .HasColumnType("decimal(18,2)");
+
+                    b.Property<int?>("SpecializationId")
+                        .HasColumnType("int");
+
+                    b.Property<DateTime?>("StartDailyWorkingHours")
+                        .HasColumnType("datetime2");
+
+                    b.Property<DateTime?>("StartDate")
+                        .HasColumnType("datetime2");
+
+                    b.Property<int>("TrialPeriod")
+                        .HasColumnType("int");
+
+                    b.Property<int>("TypeOfWork")
+                        .HasColumnType("int");
+
+                    b.Property<DateTime?>("UpdateDate")
+                        .HasColumnType("datetime2")
+                        .HasColumnOrder(4);
+
+                    b.Property<string>("UpdateUser")
+                        .HasMaxLength(450)
+                        .HasColumnType("nvarchar(450)")
+                        .HasColumnOrder(2);
+
+                    b.Property<string>("UserId")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<int>("VacationDays")
+                        .HasColumnType("int");
+
+                    b.Property<int>("WhoCanTerminateContract")
+                        .HasColumnType("int");
+
+                    b.Property<int>("WhoCanTerminateContractInTrial")
+                        .HasColumnType("int");
+
+                    b.Property<int>("WorkCountryId")
+                        .HasColumnType("int");
+
+                    b.Property<int>("WorkStateId")
+                        .HasColumnType("int");
+
+                    b.Property<string>("WorkingDays")
+                        .IsRequired()
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<int>("WorkingHours")
+                        .HasColumnType("int");
+
+                    b.HasKey("Id");
+
+                    b.HasIndex("CompanyId");
+
+                    b.ToTable("Contracts");
+                });
+
+            modelBuilder.Entity("MTWorkHR.Core.Entities.ContractAllowance", b =>
+                {
+                    b.Property<long>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("bigint")
+                        .HasColumnOrder(0);
+
+                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));
+
+                    b.Property<string>("AllowanceDesc")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<long>("AllowanceType")
+                        .HasColumnType("bigint");
+
+                    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<long>("EntitlementAmount")
+                        .HasColumnType("bigint");
+
+                    b.Property<long>("EntitlementPercent")
+                        .HasColumnType("bigint");
+
+                    b.Property<int>("PaymentType")
+                        .HasColumnType("int");
+
+                    b.Property<DateTime?>("UpdateDate")
+                        .HasColumnType("datetime2")
+                        .HasColumnOrder(4);
+
+                    b.Property<string>("UpdateUser")
+                        .HasMaxLength(450)
+                        .HasColumnType("nvarchar(450)")
+                        .HasColumnOrder(2);
+
+                    b.HasKey("Id");
+
+                    b.HasIndex("ContractId");
+
+                    b.ToTable("ContractAllowance");
+                });
+
+            modelBuilder.Entity("MTWorkHR.Core.Entities.ContractTask", b =>
+                {
+                    b.Property<long>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("bigint")
+                        .HasColumnOrder(0);
+
+                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));
+
+                    b.Property<decimal?>("Amount")
+                        .HasColumnType("decimal(18,2)");
+
+                    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<string>("ScopeOfWork")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<DateTime?>("StartDate")
+                        .HasColumnType("datetime2");
+
+                    b.Property<string>("Title")
+                        .IsRequired()
+                        .HasMaxLength(250)
+                        .HasColumnType("nvarchar(250)");
+
+                    b.Property<DateTime?>("UpdateDate")
+                        .HasColumnType("datetime2")
+                        .HasColumnOrder(4);
+
+                    b.Property<string>("UpdateUser")
+                        .HasMaxLength(450)
+                        .HasColumnType("nvarchar(450)")
+                        .HasColumnOrder(2);
+
+                    b.HasKey("Id");
+
+                    b.HasIndex("ContractId");
+
+                    b.ToTable("ContractTask");
+                });
+
+            modelBuilder.Entity("MTWorkHR.Core.Entities.ContractTaskAttachment", b =>
+                {
+                    b.Property<long>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("bigint")
+                        .HasColumnOrder(0);
+
+                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));
+
+                    b.Property<long?>("AttachmentTypeId")
+                        .HasColumnType("bigint");
+
+                    b.Property<byte[]>("Content")
+                        .IsRequired()
+                        .HasColumnType("varbinary(max)");
+
+                    b.Property<string>("ContentType")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<long>("ContractTaskId")
+                        .HasColumnType("bigint");
+
+                    b.Property<DateTime>("CreateDate")
+                        .HasColumnType("datetime2")
+                        .HasColumnOrder(3);
+
+                    b.Property<string>("CreateUser")
+                        .HasMaxLength(450)
+                        .HasColumnType("nvarchar(450)")
+                        .HasColumnOrder(1);
+
+                    b.Property<string>("FileName")
+                        .HasMaxLength(250)
+                        .HasColumnType("nvarchar(250)");
+
+                    b.Property<string>("FilePath")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("OriginalName")
+                        .HasMaxLength(250)
+                        .HasColumnType("nvarchar(250)");
+
+                    b.Property<DateTime?>("UpdateDate")
+                        .HasColumnType("datetime2")
+                        .HasColumnOrder(4);
+
+                    b.Property<string>("UpdateUser")
+                        .HasMaxLength(450)
+                        .HasColumnType("nvarchar(450)")
+                        .HasColumnOrder(2);
+
+                    b.HasKey("Id");
+
+                    b.HasIndex("AttachmentTypeId");
+
+                    b.HasIndex("ContractTaskId");
+
+                    b.ToTable("ContractTaskAttachment");
+                });
+
             modelBuilder.Entity("MTWorkHR.Core.Entities.CountryLookup", b =>
                 {
                     b.Property<long>("Id")
@@ -1807,6 +2105,120 @@ namespace MTWorkHR.Infrastructure.Migrations
                     b.ToTable("Projects");
                 });
 
+            modelBuilder.Entity("MTWorkHR.Core.Entities.ProjectStage", b =>
+                {
+                    b.Property<long>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("bigint")
+                        .HasColumnOrder(0);
+
+                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));
+
+                    b.Property<decimal?>("AmountPercent")
+                        .HasColumnType("decimal(18,2)");
+
+                    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?>("ExpectedEndDate")
+                        .HasColumnType("datetime2");
+
+                    b.Property<string>("ScopeOfWork")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<DateTime?>("StartDate")
+                        .HasColumnType("datetime2");
+
+                    b.Property<string>("Title")
+                        .IsRequired()
+                        .HasMaxLength(250)
+                        .HasColumnType("nvarchar(250)");
+
+                    b.Property<DateTime?>("UpdateDate")
+                        .HasColumnType("datetime2")
+                        .HasColumnOrder(4);
+
+                    b.Property<string>("UpdateUser")
+                        .HasMaxLength(450)
+                        .HasColumnType("nvarchar(450)")
+                        .HasColumnOrder(2);
+
+                    b.HasKey("Id");
+
+                    b.HasIndex("ContractId");
+
+                    b.ToTable("ProjectStage");
+                });
+
+            modelBuilder.Entity("MTWorkHR.Core.Entities.ProjectStageAttachment", b =>
+                {
+                    b.Property<long>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("bigint")
+                        .HasColumnOrder(0);
+
+                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));
+
+                    b.Property<long?>("AttachmentTypeId")
+                        .HasColumnType("bigint");
+
+                    b.Property<byte[]>("Content")
+                        .IsRequired()
+                        .HasColumnType("varbinary(max)");
+
+                    b.Property<string>("ContentType")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<DateTime>("CreateDate")
+                        .HasColumnType("datetime2")
+                        .HasColumnOrder(3);
+
+                    b.Property<string>("CreateUser")
+                        .HasMaxLength(450)
+                        .HasColumnType("nvarchar(450)")
+                        .HasColumnOrder(1);
+
+                    b.Property<string>("FileName")
+                        .HasMaxLength(250)
+                        .HasColumnType("nvarchar(250)");
+
+                    b.Property<string>("FilePath")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<string>("OriginalName")
+                        .HasMaxLength(250)
+                        .HasColumnType("nvarchar(250)");
+
+                    b.Property<long>("ProjectStageId")
+                        .HasColumnType("bigint");
+
+                    b.Property<DateTime?>("UpdateDate")
+                        .HasColumnType("datetime2")
+                        .HasColumnOrder(4);
+
+                    b.Property<string>("UpdateUser")
+                        .HasMaxLength(450)
+                        .HasColumnType("nvarchar(450)")
+                        .HasColumnOrder(2);
+
+                    b.HasKey("Id");
+
+                    b.HasIndex("AttachmentTypeId");
+
+                    b.HasIndex("ProjectStageId");
+
+                    b.ToTable("ProjectStageAttachment");
+                });
+
             modelBuilder.Entity("MTWorkHR.Core.Entities.ProjectTeam", b =>
                 {
                     b.Property<long>("Id")
@@ -3290,6 +3702,45 @@ namespace MTWorkHR.Infrastructure.Migrations
                     b.Navigation("Country");
                 });
 
+            modelBuilder.Entity("MTWorkHR.Core.Entities.ContractAllowance", b =>
+                {
+                    b.HasOne("MTWorkHR.Core.Entities.Contract", "Contract")
+                        .WithMany("FixedAllowances")
+                        .HasForeignKey("ContractId")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
+                    b.Navigation("Contract");
+                });
+
+            modelBuilder.Entity("MTWorkHR.Core.Entities.ContractTask", b =>
+                {
+                    b.HasOne("MTWorkHR.Core.Entities.Contract", "Contract")
+                        .WithMany("ContractTasks")
+                        .HasForeignKey("ContractId")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
+                    b.Navigation("Contract");
+                });
+
+            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.MeetingUser", b =>
                 {
                     b.HasOne("MTWorkHR.Core.Entities.Meeting", "Meeting")
@@ -3318,6 +3769,34 @@ namespace MTWorkHR.Infrastructure.Migrations
                     b.Navigation("OrderType");
                 });
 
+            modelBuilder.Entity("MTWorkHR.Core.Entities.ProjectStage", b =>
+                {
+                    b.HasOne("MTWorkHR.Core.Entities.Contract", "Contract")
+                        .WithMany("ProjectStages")
+                        .HasForeignKey("ContractId")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
+                    b.Navigation("Contract");
+                });
+
+            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");
+                });
+
             modelBuilder.Entity("MTWorkHR.Core.Entities.ProjectTeam", b =>
                 {
                     b.HasOne("MTWorkHR.Core.Entities.Project", "Project")
@@ -3579,6 +4058,20 @@ namespace MTWorkHR.Infrastructure.Migrations
                     b.Navigation("ChatAttachments");
                 });
 
+            modelBuilder.Entity("MTWorkHR.Core.Entities.Contract", b =>
+                {
+                    b.Navigation("ContractTasks");
+
+                    b.Navigation("FixedAllowances");
+
+                    b.Navigation("ProjectStages");
+                });
+
+            modelBuilder.Entity("MTWorkHR.Core.Entities.ContractTask", b =>
+                {
+                    b.Navigation("TaskAttachments");
+                });
+
             modelBuilder.Entity("MTWorkHR.Core.Entities.Meeting", b =>
                 {
                     b.Navigation("MeetingUsers");
@@ -3589,6 +4082,11 @@ namespace MTWorkHR.Infrastructure.Migrations
                     b.Navigation("ProjectTeams");
                 });
 
+            modelBuilder.Entity("MTWorkHR.Core.Entities.ProjectStage", b =>
+                {
+                    b.Navigation("StageAttachments");
+                });
+
             modelBuilder.Entity("MTWorkHR.Core.Entities.Team", b =>
                 {
                     b.Navigation("TeamUsers");

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

@@ -0,0 +1,37 @@
+using Microsoft.EntityFrameworkCore;
+using MTWorkHR.Core.Entities;
+using MTWorkHR.Core.IDto;
+using MTWorkHR.Core.IRepositories;
+using MTWorkHR.Infrastructure.Entities;
+using MTWorkHR.Infrastructure.DBContext;
+
+namespace MTWorkHR.Infrastructure.Repositories
+{
+    public class ContractRepository : Repository<Contract>, IContractRepository
+    {
+        private readonly DbSet<Contract> dbSet;
+        public ContractRepository(HRDataContext context) : base(context)
+        {
+            dbSet = context.Set<Contract>();
+
+        }
+        public async Task<Contract> GetByIdWithAllChildren(long id)
+        {
+            return await dbSet
+                .Include(x => x.ContractTasks)
+                .Include(x => x.FixedAllowances)
+                .Include(x => x.ProjectStages)
+                .FirstOrDefaultAsync(x => x.Id == id);
+        }
+
+
+        public async Task<Tuple<IQueryable<Contract>, int>> GetAllWithChildrenAsync()
+        {
+            var query = dbSet//.Include(x => x.ContractUsers)
+                .AsQueryable();
+            var total = await query.CountAsync();
+
+            return new Tuple<IQueryable<Contract>, int>(query, total);
+        }
+    }
+}

+ 0 - 15
MTWorkHR.Infrastructure/Repositories/EmployeeRepository.cs

@@ -1,15 +0,0 @@
-using MTWorkHR.Core.Entities;
-using MTWorkHR.Core.IRepositories;
-
-using MTWorkHR.Infrastructure.DBContext;
-
-
-namespace MTWorkHR.Infrastructure.Repositories
-{
-    public class EmployeeRepository : Repository<Employee>, IEmployeeRepository
-    {
-        public EmployeeRepository(HRDataContext context) : base(context)
-        {
-        }
-    }
-}

+ 3 - 0
MTWorkHR.Infrastructure/UnitOfWork/UnitOfWork.cs

@@ -39,6 +39,7 @@ namespace MTWorkHR.Infrastructure.UnitOfWorks
         public ILoginOTPRepository LoginOTP { get; }
         public ICityRepository City { get; }
         public IChatMessageRepository ChatMessage { get; }
+        public IContractRepository Contract{ get; }
 
         public UnitOfWork(HRDataContext _context
             , IPermissionRepository permission
@@ -66,6 +67,7 @@ namespace MTWorkHR.Infrastructure.UnitOfWorks
             , IMeetingUserRepository meetingUser
             , IProjectTeamRepository projectTeam
             , IChatMessageRepository chatMessage
+            , IContractRepository contract
             )
         {
             context = _context;
@@ -94,6 +96,7 @@ namespace MTWorkHR.Infrastructure.UnitOfWorks
             MeetingUser = meetingUser;
             ProjectTeam = projectTeam;
             ChatMessage = chatMessage;
+            Contract = contract;
         }
 
         public async Task<int> CompleteAsync()