2 次代碼提交 844e671eee ... 8f3edcc56b

作者 SHA1 備註 提交日期
  zinab_elgendy 8f3edcc56b EmployeeDto for OrderRequest 1 月之前
  zinab_elgendy 7a77ba4f09 OrderRequest:OverTime,BusinessTrip 1 月之前
共有 27 個文件被更改,包括 22122 次插入99 次删除
  1. 18 2
      MTWorkHR.API/Controllers/OrderRequestController.cs
  2. 1 1
      MTWorkHR.API/Program.cs
  3. 19 0
      MTWorkHR.Application/Dtos/Attendance/BusinessTripDto.cs
  4. 26 0
      MTWorkHR.Application/Dtos/Attendance/BusinessTripExpensesDto.cs
  5. 6 9
      MTWorkHR.Application/Dtos/Attendance/OrderRequestDto.cs
  6. 22 0
      MTWorkHR.Application/Dtos/Attendance/OverTimeDayDto.cs
  7. 17 0
      MTWorkHR.Application/Dtos/Attendance/OverTimeDto.cs
  8. 1 0
      MTWorkHR.Application/Dtos/Identity/UserDto.cs
  9. 20 0
      MTWorkHR.Application/Dtos/User/EmployeeDto.cs
  10. 6 0
      MTWorkHR.Application/Mapper/MappingProfile.cs
  11. 1 1
      MTWorkHR.Application/Services/Contract/ContractService.cs
  12. 68 48
      MTWorkHR.Application/Services/User/OrderRequestService.cs
  13. 1 1
      MTWorkHR.Application/Services/User/UserService.cs
  14. 23 0
      MTWorkHR.Core/Entities/Attendance/BusinessTripExpences.cs
  15. 25 0
      MTWorkHR.Core/Entities/Attendance/OrderAttachment.cs
  16. 8 5
      MTWorkHR.Core/Entities/Attendance/OrderRequest.cs
  17. 19 0
      MTWorkHR.Core/Entities/Attendance/OverTimeDate.cs
  18. 26 1
      MTWorkHR.Infrastructure/Configurations/AttachmentTypeConfiguration.cs
  19. 4 10
      MTWorkHR.Infrastructure/Configurations/OrderTypeConfiguration.cs
  20. 1 1
      MTWorkHR.Infrastructure/InfrastructureServiceRegistration.cs
  21. 7089 0
      MTWorkHR.Infrastructure/Migrations/20250224080933_altrOrderRequest3.Designer.cs
  22. 231 0
      MTWorkHR.Infrastructure/Migrations/20250224080933_altrOrderRequest3.cs
  23. 7083 0
      MTWorkHR.Infrastructure/Migrations/20250225085631_altrOvertime.Designer.cs
  24. 38 0
      MTWorkHR.Infrastructure/Migrations/20250225085631_altrOvertime.cs
  25. 7076 0
      MTWorkHR.Infrastructure/Migrations/20250225103824_altrOrderTypeConfig.Designer.cs
  26. 70 0
      MTWorkHR.Infrastructure/Migrations/20250225103824_altrOrderTypeConfig.cs
  27. 223 20
      MTWorkHR.Infrastructure/Migrations/HRDataContextModelSnapshot.cs

+ 18 - 2
MTWorkHR.API/Controllers/OrderRequestController.cs

@@ -5,6 +5,7 @@ using Microsoft.AspNetCore.Mvc;
 using MTWorkHR.Application.Filters;
 using MTWorkHR.Application.Identity;
 using MTWorkHR.Application.Models;
+using MTWorkHR.Application.Services;
 using MTWorkHR.Application.Services.Interfaces;
 using MTWorkHR.Identity.Services;
 
@@ -36,14 +37,29 @@ namespace MTWorkHR.API.Controllers
         }
 
 
-        [HttpPost("Create")]
+        [HttpPost("CreateLeave")]
         [ProducesResponseType(StatusCodes.Status200OK)]
         [AppAuthorize(Permissions = "OrderRequest.Create")]
-        public async Task<ActionResult<OrderRequestDto>> Create([FromBody] OrderRequestDto input)
+        public async Task<ActionResult<OrderRequestDto>> CreateLeave([FromBody] OrderRequestDto input)
         {
             return await _LeaveRequestService.Create(input);
         }
 
+        [HttpPost("CreateOverTime")]
+        public async Task<ActionResult<OrderRequestDto>> CreateOverTime([FromBody] OverTimeDto overtimeDto)
+        {
+            var orderRequest = await _LeaveRequestService.Create(overtimeDto);
+            return orderRequest;
+        }
+
+        [HttpPost("CreateBusinessTrip")]
+        public async Task<ActionResult<OrderRequestDto>> CreateBusinessTrip([FromBody] BusinessTripDto businessTripDto)
+        {
+            var orderRequest = await _LeaveRequestService.Create(businessTripDto);
+            return orderRequest;
+
+        }
+
         [HttpPost("Update")]
         [ProducesResponseType(StatusCodes.Status200OK)]
         [AppAuthorize(Permissions = "OrderRequest.Update")]

+ 1 - 1
MTWorkHR.API/Program.cs

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

+ 19 - 0
MTWorkHR.Application/Dtos/Attendance/BusinessTripDto.cs

@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using MTWorkHR.Application.Models;
+using MTWorkHR.Core.Entities;
+using MTWorkHR.Core.Entities.Base;
+using MTWorkHR.Core.Global;
+
+namespace MTWorkHR.Application.Models
+{
+    public class BusinessTripDto : OrderRequestDto
+    {
+        public BusinessTripExpensesDto? BusinessTripExpenses { get; set; }
+
+    }
+}

+ 26 - 0
MTWorkHR.Application/Dtos/Attendance/BusinessTripExpensesDto.cs

@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using MTWorkHR.Application.Models;
+using MTWorkHR.Core.Entities;
+using MTWorkHR.Core.Entities.Base;
+using MTWorkHR.Core.Global;
+
+namespace MTWorkHR.Application.Models
+{
+    public class BusinessTripExpensesDto : EntityDto
+    {
+        public decimal? TicketCost{ get; set; }
+        public decimal? TransportationCost { get; set; }
+        public decimal? AccommodationCost { get; set; }
+        public decimal? OtherCost { get; set; }
+        public AttachmentDto? TicketAttachment { get; set; }
+        public AttachmentDto? TransportationAttachment { get; set; }
+        public AttachmentDto? AccommodationAttachment { get; set; }
+        public AttachmentDto? OtherAttachment { get; set; }
+
+    }
+}

+ 6 - 9
MTWorkHR.Application/Dtos/Attendance/OrderRequestDto.cs

@@ -4,9 +4,7 @@ using System.ComponentModel.DataAnnotations;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
-using MTWorkHR.Application.Models;
-using MTWorkHR.Core.Entities;
-using MTWorkHR.Core.Entities.Base;
+
 using MTWorkHR.Core.Global;
 
 namespace MTWorkHR.Application.Models
@@ -20,14 +18,13 @@ namespace MTWorkHR.Application.Models
         public int? LeaveTypeId { get; set; }
         public string? RequestComments { get; set; }
         public ApprovalStatusEnum OrderStatus { get; set; }
-        public int? CountryId { get; set; }
-        public int? CityId { get; set; }
+ 
         public OrderTypeDto? OrderType { get; set; }
         public LeaveTypeDto? LeaveType { get; set; }
-        public UserDto? Employee { get; set; }
-        public string? StartTime { get; set; }
-        public string? EndTime { get; set; }
+        public EmployeeDto? Employee { get; set; }
+       
         public long ContractId { get; set; }
-
+        public List<AttachmentDto>? OrderAttachments { get; set; }
+        //public List<OverTimeDayDto>? OverTimeDays { get; set; }
     }
 }

+ 22 - 0
MTWorkHR.Application/Dtos/Attendance/OverTimeDayDto.cs

@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using MTWorkHR.Application.Models;
+using MTWorkHR.Core.Entities;
+using MTWorkHR.Core.Entities.Base;
+using MTWorkHR.Core.Global;
+
+namespace MTWorkHR.Application.Models
+{
+    public class OverTimeDayDto : EntityDto
+    {
+        public DateTime? OverTimeDate { get; set; }
+        public string? StartTime { get; set; }
+        public string? EndTime { get; set; }
+        public decimal? TotalHours { get; set; }
+
+    }
+}

+ 17 - 0
MTWorkHR.Application/Dtos/Attendance/OverTimeDto.cs

@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+using MTWorkHR.Core.Global;
+
+namespace MTWorkHR.Application.Models
+{
+    public class OverTimeDto : OrderRequestDto
+    {
+        public List<OverTimeDayDto>? OverTimeDays { get; set; }
+        
+    }
+}

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

@@ -55,6 +55,7 @@ namespace MTWorkHR.Application.Models
         public long? CompanyId { get; set; }
         public bool IsCheckedIn { get; set; }
         public bool IsCheckedOut { get; set; }
+        public string? ProfileImagePath { get; set; }
         public IFormFile? ProfileImage { get; set; }
         public IFormFile? CVAttach { get; set; }
         public IFormFile? PassportAttach { get; set; }

+ 20 - 0
MTWorkHR.Application/Dtos/User/EmployeeDto.cs

@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using MTWorkHR.Core.Global;
+
+namespace MTWorkHR.Application.Models
+{
+    public class EmployeeDto 
+    {
+        public string? Id { get; set; }
+        public string? FirstName { get; set; }
+
+        public string? LastName { get; set; }
+        public string? Email { get; set; }
+        public string? ProfileImagePath { get; set; }
+    }
+}

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

@@ -114,6 +114,12 @@ namespace MTWorkHR.Application.Mapper
             CreateMap<OrderRequest, OrderRequestHRDto>().ForMember(d => d.LeaveTypeName, o=> o.MapFrom(s=> s.LeaveType != null ? GlobalInfo.lang == "ar" ? s.LeaveType.NameAr: s.LeaveType.NameEn:""))
                 .ForMember(d => d.OrderTypeName, o => o.MapFrom(s => s.OrderType != null ? GlobalInfo.lang == "ar" ? s.OrderType.NameAr : s.OrderType.NameEn:""));
             
+            CreateMap<OverTimeDay, OverTimeDayDto>().ReverseMap();
+            CreateMap<BusinessTripDto, OrderRequest>().ReverseMap();
+            CreateMap<OverTimeDto, OrderRequest>().ReverseMap();
+            CreateMap<BusinessTripExpensesDto, BusinessTripExpenses>().ReverseMap();
+
+
             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());

+ 1 - 1
MTWorkHR.Application/Services/Contract/ContractService.cs

@@ -11,7 +11,7 @@ using Microsoft.AspNetCore.Identity;
 using MTWorkHR.Infrastructure.Entities;
 using System.Linq;
 using MTWorkHR.Core.IDto;
-
+using MTWorkHR.Core.Entities.User;
 namespace MTWorkHR.Application.Services
 {
     public class ContractService : BaseService<Contract, ContractDto, ContractDto>, IContractService

+ 68 - 48
MTWorkHR.Application/Services/User/OrderRequestService.cs

@@ -13,9 +13,10 @@ using MTWorkHR.Application.Services.Interfaces;
 using MTWorkHR.Core.Email;
 using MTWorkHR.Core.Entities;
 using MTWorkHR.Infrastructure.UnitOfWorks;
-using MTWorkHR.Core.Entities.User;
 using System.Linq.Dynamic.Core;
 using Microsoft.AspNetCore.Http;
+using MTWorkHR.Core.Entities.User;
+using MTWorkHR.Core.Entities.Base;
 
 namespace MTWorkHR.Application.Services
 {
@@ -41,7 +42,9 @@ namespace MTWorkHR.Application.Services
         {
             var entity = await _unitOfWork.OrderRequest.GetByIdWithAllChildren(id);
             var response = MapperObject.Mapper.Map<OrderRequestDto>(entity);
-            response.Employee = await _userService.GetUserWithAttachmentById(entity.RequestingEmployeeId);
+            var user = await _userService.GetUserById(entity.RequestingEmployeeId);
+            var image = await _userService.GetProfileImage(entity.RequestingEmployeeId);
+            response.Employee = new EmployeeDto { Id = entity.RequestingEmployeeId, FirstName = user.FirstName, LastName = user.LastName, Email = user.Email, ProfileImagePath = image };
             return response;
         }
       
@@ -94,24 +97,24 @@ namespace MTWorkHR.Application.Services
                     var user = await _userService.GetUserWithAttachmentById(item.RequestingEmployeeId);
                     if (user != null)
                     {
-                        item.Employee = user;
+                        item.Employee = new EmployeeDto { Id = item.RequestingEmployeeId, FirstName = user.FirstName, LastName = user.LastName, Email = user.Email };
                         var attach = user.UserAttachments?.FirstOrDefault(a => a.AttachmentTypeId == 9);
-                        if(attach != null)
-                        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();
-                            item.Employee.ProfileImage = file;
-                        }
+                        item.Employee.ProfileImagePath = attach?.FilePath;
+                       // if (attach != null)
+                        //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();
+                        //}
                     }
                 }
             }
@@ -130,23 +133,39 @@ namespace MTWorkHR.Application.Services
             {
                 input.RequestingEmployeeId = _globalInfo.UserId;
             }
-            if(input.OrderTypeId == 1 &&  input.LeaveTypeId == 1) // Annual vacation in contract
+            if (input is BusinessTripDto)
             {
-                var contractId = await _unitOfWork.Contract.GetLatestActiveContract(input.RequestingEmployeeId);
-                var allocation = await _unitOfWork.OrderAllocation.GetUserAllocations(input.RequestingEmployeeId, input.OrderTypeId, input.LeaveTypeId, contractId.Id, period);
-                input.ContractId = contractId.Id;
-                if (allocation is null)
-                {
-                    throw new AppException(ExceptionEnum.NoVacationBalance, "You do not have any allocations for this leave type.");
-                }
-                else
+                input.OrderTypeId = 3;
+                input.LeaveTypeId = null;
+            }
+            else if (input is OverTimeDto)
+            {
+                input.OrderTypeId = 2;
+                input.LeaveTypeId = null;
+            }
+            var contract = await _unitOfWork.Contract.GetLatestActiveContract(input.RequestingEmployeeId);
+            if(contract!= null)
+                input.ContractId = contract.Id;
+            if (input.OrderTypeId == 1 &&  input.LeaveTypeId == 1) // Annual vacation in contract
+            {
+                if (contract != null)
                 {
-                    int daysRequested = (int)(input.EndDate - input.StartDate).TotalDays;
-                    if (daysRequested > allocation.NumberOfDays)
+                    var allocation = await _unitOfWork.OrderAllocation.GetUserAllocations(input.RequestingEmployeeId, input.OrderTypeId, input.LeaveTypeId, contract.Id, period);
+
+                    if (allocation is null)
+                    {
+                        throw new AppException(ExceptionEnum.NoVacationBalance, "You do not have any allocations for this leave type.");
+                    }
+                    else
                     {
-                        throw new AppException(ExceptionEnum.NoVacationBalance, "You do not have enough days for this request");
+                        int daysRequested = (int)(input.EndDate - input.StartDate).TotalDays;
+                        if (daysRequested > allocation.NumberOfDays)
+                        {
+                            throw new AppException(ExceptionEnum.NoVacationBalance, "You do not have enough days for this request");
+                        }
                     }
                 }
+                
             }
           
             var orderRequest = MapperObject.Mapper.Map<OrderRequest>(input);
@@ -179,24 +198,25 @@ namespace MTWorkHR.Application.Services
                 var user = await _userService.GetUserWithAttachmentById(response.RequestingEmployeeId);
                 if (user != null)
                 {
-                    response.Employee = user;
+                    response.Employee = new EmployeeDto { Id = response.RequestingEmployeeId, FirstName = user.FirstName, LastName = user.LastName, Email = user.Email };
                     var attach = user.UserAttachments?.FirstOrDefault(a => a.AttachmentTypeId == 9);
-                    if (attach != null)
-                        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();
-                            response.Employee.ProfileImage = file;
-                        }
+                    response.Employee.ProfileImagePath = attach?.FilePath;
+                    //if (attach != null)
+                    //    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();
+                    //        response.Employee.ProfileImage = file;
+                    //    }
                 }
             }
             return response;

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

@@ -165,7 +165,7 @@ namespace MTWorkHR.Application.Services
 
         public async Task<string> GetProfileImage(string userId)
         {
-            string imagePath = null;
+            string imagePath = "";
             var user = await _userManager.Users.Include(u => u.UserAttachments)
                 .FirstOrDefaultAsync(x => x.Id == userId);
             if (user != null)

+ 23 - 0
MTWorkHR.Core/Entities/Attendance/BusinessTripExpences.cs

@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using MTWorkHR.Core.Entities.Base;
+
+namespace MTWorkHR.Core.Entities
+{ 
+    public class BusinessTripExpenses : Entity
+    {
+        public decimal? TicketCost{ get; set; }
+        public decimal? TransportationCost { get; set; }
+        public decimal? AccommodationCost { get; set; }
+        public decimal? OtherCost { get; set; }
+        public OrderAttachment? TicketAttachment { get; set; }
+        public OrderAttachment? TransportationAttachment { get; set; }
+        public OrderAttachment? AccommodationAttachment { get; set; }
+        public OrderAttachment? OtherAttachment { get; set; }
+
+    }
+}

+ 25 - 0
MTWorkHR.Core/Entities/Attendance/OrderAttachment.cs

@@ -0,0 +1,25 @@
+using MTWorkHR.Core.Entities.Base;
+using System.ComponentModel.DataAnnotations.Schema;
+using System.ComponentModel.DataAnnotations;
+using MTWorkHR.Core.Entities.User;
+
+namespace MTWorkHR.Core.Entities
+{
+    public class OrderAttachment : AuditEntity
+    {
+        public long OrderRequestId { get; set; }
+
+        [ForeignKey("OrderRequestId")]
+        public OrderRequest OrderRequest { get; set; }
+        public long? AttachmentTypeId { get; set; }
+
+        [MaxLength(250)]
+        public string? FileName { get; set; }
+
+        [MaxLength(250)]
+        public string? OriginalName { get; set; }
+
+        public string? FilePath { get; set; }
+        public string? ContentType { get; set; }
+    }
+}

+ 8 - 5
MTWorkHR.Core/Entities/Attendance/OrderRequest.cs

@@ -1,4 +1,5 @@
-using MTWorkHR.Core.Entities.Base;
+using MTWorkHR.Core.Entities;
+using MTWorkHR.Core.Entities.Base;
 using MTWorkHR.Core.Global;
 using System;
 using System.Collections.Generic;
@@ -26,13 +27,15 @@ namespace MTWorkHR.Core.Entities.User
         public ApprovalStatusEnum? OrderStatus { get; set; }
         [Filter]
         public string RequestingEmployeeId { get; set; }
-        public int? CountryId{ get; set; }
-        public int? CityId { get; set; }
-        public string? StartTime { get; set; }
-        public string? EndTime { get; set; }
+     
 
         public long CompanyId { get; set ; }
         public long? ContractId { get; set ; }
 
+        public List<OrderAttachment>? OrderAttachments { get; set; }
+        public List<OverTimeDay>? OverTimeDays { get; set; }
+
+        public BusinessTripExpenses? BusinessTripExpenses { get; set; }
+
     }
 }

+ 19 - 0
MTWorkHR.Core/Entities/Attendance/OverTimeDate.cs

@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using MTWorkHR.Core.Entities.Base;
+
+namespace MTWorkHR.Core.Entities
+{
+    public class OverTimeDay : Entity
+    {
+        public DateTime? OverTimeDate{ get; set; }
+        public string? StartTime { get; set; }
+        public string? EndTime { get; set; }
+        public decimal? TotalHours { get; set; }
+
+    }
+}

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

@@ -75,7 +75,32 @@ namespace MTWorkHR.Infrastructure.Configurations
                     Id = 9,
                     NameEn = "Image",
                     NameAr = "الصورة"
-                }
+                },
+                 new AttachmentType
+                 {
+                     Id = 10,
+                     NameEn = "Ticket Cost",
+                     NameAr = "تكلفة التذكرة"
+                 }
+                 ,
+                  new AttachmentType
+                  {
+                      Id = 11,
+                      NameEn = "Transportation Cost",
+                      NameAr = "تكلفة المواصلات"
+                  }
+                  , new AttachmentType
+                  {
+                      Id = 12,
+                      NameEn = "Accommodation Cost",
+                      NameAr = "تكلفة الاقامة"
+                  },
+                   new AttachmentType
+                   {
+                       Id = 13,
+                       NameEn = "Other",
+                       NameAr = "اخرى"
+                   }
                ) ;
         }
     }

+ 4 - 10
MTWorkHR.Infrastructure/Configurations/OrderTypeConfiguration.cs

@@ -26,23 +26,17 @@ namespace MTWorkHR.Infrastructure.Configurations
                     NameAr = "إذن",
                     DefaultDays = 2
                 },
-                 new OrderType
-                 {
-                     Id = 2,
-                     NameEn = "Medical",
-                     NameAr = "طبية",
-                     DefaultDays = 15
-                 },
+                 
                 new OrderType
                 {
-                    Id = 3,
+                    Id = 2,
                     NameEn = "Overtime",
                     NameAr = "وقت إضافي",
                     DefaultDays = 20
                 },
                 new OrderType
                 {
-                    Id = 4,
+                    Id = 3,
                     NameEn = "Business trip", //(after closed from employee / manager)
                     NameAr = "رحلة عمل",
                     DefaultDays = 0
@@ -50,7 +44,7 @@ namespace MTWorkHR.Infrastructure.Configurations
                 },
                 new OrderType
                 {
-                    Id = 5,
+                    Id = 4,
                     NameEn = "Course",
                     NameAr = "دورة تدريبية",
                     DefaultDays = 0

+ 1 - 1
MTWorkHR.Infrastructure/InfrastructureServiceRegistration.cs

@@ -32,7 +32,7 @@ namespace MTWorkHR.Infrastructure
             
             services.AddDbContext<HRDataContext>(options =>
                 options.UseSqlServer(
-                    config.ConnectionStrings.LocalConnectionString  //configuration.GetSection("ConnectionString:MTWorkHRConnectionString").Value
+                    config.ConnectionStrings.MTWorkHRConnectionString  //configuration.GetSection("ConnectionString:MTWorkHRConnectionString").Value
                     ));
            
             services.AddIdentity<ApplicationUser, ApplicationRole>().AddEntityFrameworkStores<HRDataContext>().AddDefaultTokenProviders();

文件差異過大導致無法顯示
+ 7089 - 0
MTWorkHR.Infrastructure/Migrations/20250224080933_altrOrderRequest3.Designer.cs


+ 231 - 0
MTWorkHR.Infrastructure/Migrations/20250224080933_altrOrderRequest3.cs

@@ -0,0 +1,231 @@
+using System;
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
+
+namespace MTWorkHR.Infrastructure.Migrations
+{
+    /// <inheritdoc />
+    public partial class altrOrderRequest3 : Migration
+    {
+        /// <inheritdoc />
+        protected override void Up(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.DropColumn(
+                name: "CityId",
+                table: "OrderRequests");
+
+            migrationBuilder.DropColumn(
+                name: "CountryId",
+                table: "OrderRequests");
+
+            migrationBuilder.AddColumn<long>(
+                name: "BusinessTripExpensesId",
+                table: "OrderRequests",
+                type: "bigint",
+                nullable: true);
+
+            migrationBuilder.CreateTable(
+                name: "OrderAttachment",
+                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),
+                    OrderRequestId = 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),
+                    FilePath = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    ContentType = table.Column<string>(type: "nvarchar(max)", nullable: true)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_OrderAttachment", x => x.Id);
+                    table.ForeignKey(
+                        name: "FK_OrderAttachment_OrderRequests_OrderRequestId",
+                        column: x => x.OrderRequestId,
+                        principalTable: "OrderRequests",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Cascade);
+                });
+
+            migrationBuilder.CreateTable(
+                name: "OverTimeDay",
+                columns: table => new
+                {
+                    Id = table.Column<long>(type: "bigint", nullable: false)
+                        .Annotation("SqlServer:Identity", "1, 1"),
+                    OverTimeDate = table.Column<DateTime>(type: "datetime2", nullable: true),
+                    StartTime = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    EndTime = table.Column<string>(type: "nvarchar(max)", nullable: true),
+                    TotalHours = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
+                    OrderRequestId = table.Column<long>(type: "bigint", nullable: true)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_OverTimeDay", x => x.Id);
+                    table.ForeignKey(
+                        name: "FK_OverTimeDay_OrderRequests_OrderRequestId",
+                        column: x => x.OrderRequestId,
+                        principalTable: "OrderRequests",
+                        principalColumn: "Id");
+                });
+
+            migrationBuilder.CreateTable(
+                name: "BusinessTripExpenses",
+                columns: table => new
+                {
+                    Id = table.Column<long>(type: "bigint", nullable: false)
+                        .Annotation("SqlServer:Identity", "1, 1"),
+                    TicketCost = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
+                    TransportationCost = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
+                    AccommodationCost = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
+                    OtherCost = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
+                    TicketAttachmentId = table.Column<long>(type: "bigint", nullable: true),
+                    TransportationAttachmentId = table.Column<long>(type: "bigint", nullable: true),
+                    AccommodationAttachmentId = table.Column<long>(type: "bigint", nullable: true),
+                    OtherAttachmentId = table.Column<long>(type: "bigint", nullable: true)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_BusinessTripExpenses", x => x.Id);
+                    table.ForeignKey(
+                        name: "FK_BusinessTripExpenses_OrderAttachment_AccommodationAttachmentId",
+                        column: x => x.AccommodationAttachmentId,
+                        principalTable: "OrderAttachment",
+                        principalColumn: "Id");
+                    table.ForeignKey(
+                        name: "FK_BusinessTripExpenses_OrderAttachment_OtherAttachmentId",
+                        column: x => x.OtherAttachmentId,
+                        principalTable: "OrderAttachment",
+                        principalColumn: "Id");
+                    table.ForeignKey(
+                        name: "FK_BusinessTripExpenses_OrderAttachment_TicketAttachmentId",
+                        column: x => x.TicketAttachmentId,
+                        principalTable: "OrderAttachment",
+                        principalColumn: "Id");
+                    table.ForeignKey(
+                        name: "FK_BusinessTripExpenses_OrderAttachment_TransportationAttachmentId",
+                        column: x => x.TransportationAttachmentId,
+                        principalTable: "OrderAttachment",
+                        principalColumn: "Id");
+                });
+
+            migrationBuilder.InsertData(
+                table: "AttachmentTypes",
+                columns: new[] { "Id", "IsRequired", "NameAr", "NameEn" },
+                values: new object[,]
+                {
+                    { 10L, false, "تكلفة التذكرة", "Ticket Cost" },
+                    { 11L, false, "تكلفة المواصلات", "Transportation Cost" },
+                    { 12L, false, "تكلفة الاقامة", "Accommodation Cost" },
+                    { 13L, false, "اخرى", "Other" }
+                });
+
+            migrationBuilder.CreateIndex(
+                name: "IX_OrderRequests_BusinessTripExpensesId",
+                table: "OrderRequests",
+                column: "BusinessTripExpensesId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_BusinessTripExpenses_AccommodationAttachmentId",
+                table: "BusinessTripExpenses",
+                column: "AccommodationAttachmentId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_BusinessTripExpenses_OtherAttachmentId",
+                table: "BusinessTripExpenses",
+                column: "OtherAttachmentId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_BusinessTripExpenses_TicketAttachmentId",
+                table: "BusinessTripExpenses",
+                column: "TicketAttachmentId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_BusinessTripExpenses_TransportationAttachmentId",
+                table: "BusinessTripExpenses",
+                column: "TransportationAttachmentId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_OrderAttachment_OrderRequestId",
+                table: "OrderAttachment",
+                column: "OrderRequestId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_OverTimeDay_OrderRequestId",
+                table: "OverTimeDay",
+                column: "OrderRequestId");
+
+            migrationBuilder.AddForeignKey(
+                name: "FK_OrderRequests_BusinessTripExpenses_BusinessTripExpensesId",
+                table: "OrderRequests",
+                column: "BusinessTripExpensesId",
+                principalTable: "BusinessTripExpenses",
+                principalColumn: "Id");
+        }
+
+        /// <inheritdoc />
+        protected override void Down(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.DropForeignKey(
+                name: "FK_OrderRequests_BusinessTripExpenses_BusinessTripExpensesId",
+                table: "OrderRequests");
+
+            migrationBuilder.DropTable(
+                name: "BusinessTripExpenses");
+
+            migrationBuilder.DropTable(
+                name: "OverTimeDay");
+
+            migrationBuilder.DropTable(
+                name: "OrderAttachment");
+
+            migrationBuilder.DropIndex(
+                name: "IX_OrderRequests_BusinessTripExpensesId",
+                table: "OrderRequests");
+
+            migrationBuilder.DeleteData(
+                table: "AttachmentTypes",
+                keyColumn: "Id",
+                keyValue: 10L);
+
+            migrationBuilder.DeleteData(
+                table: "AttachmentTypes",
+                keyColumn: "Id",
+                keyValue: 11L);
+
+            migrationBuilder.DeleteData(
+                table: "AttachmentTypes",
+                keyColumn: "Id",
+                keyValue: 12L);
+
+            migrationBuilder.DeleteData(
+                table: "AttachmentTypes",
+                keyColumn: "Id",
+                keyValue: 13L);
+
+            migrationBuilder.DropColumn(
+                name: "BusinessTripExpensesId",
+                table: "OrderRequests");
+
+            migrationBuilder.AddColumn<int>(
+                name: "CityId",
+                table: "OrderRequests",
+                type: "int",
+                nullable: true);
+
+            migrationBuilder.AddColumn<int>(
+                name: "CountryId",
+                table: "OrderRequests",
+                type: "int",
+                nullable: true);
+        }
+    }
+}

文件差異過大導致無法顯示
+ 7083 - 0
MTWorkHR.Infrastructure/Migrations/20250225085631_altrOvertime.Designer.cs


+ 38 - 0
MTWorkHR.Infrastructure/Migrations/20250225085631_altrOvertime.cs

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

文件差異過大導致無法顯示
+ 7076 - 0
MTWorkHR.Infrastructure/Migrations/20250225103824_altrOrderTypeConfig.Designer.cs


+ 70 - 0
MTWorkHR.Infrastructure/Migrations/20250225103824_altrOrderTypeConfig.cs

@@ -0,0 +1,70 @@
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace MTWorkHR.Infrastructure.Migrations
+{
+    /// <inheritdoc />
+    public partial class altrOrderTypeConfig : Migration
+    {
+        /// <inheritdoc />
+        protected override void Up(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.DeleteData(
+                table: "OrderTypes",
+                keyColumn: "Id",
+                keyValue: 5L);
+
+            migrationBuilder.UpdateData(
+                table: "OrderTypes",
+                keyColumn: "Id",
+                keyValue: 2L,
+                columns: new[] { "DefaultDays", "NameAr", "NameEn" },
+                values: new object[] { 20, "وقت إضافي", "Overtime" });
+
+            migrationBuilder.UpdateData(
+                table: "OrderTypes",
+                keyColumn: "Id",
+                keyValue: 3L,
+                columns: new[] { "DefaultDays", "NameAr", "NameEn" },
+                values: new object[] { 0, "رحلة عمل", "Business trip" });
+
+            migrationBuilder.UpdateData(
+                table: "OrderTypes",
+                keyColumn: "Id",
+                keyValue: 4L,
+                columns: new[] { "NameAr", "NameEn" },
+                values: new object[] { "دورة تدريبية", "Course" });
+        }
+
+        /// <inheritdoc />
+        protected override void Down(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.UpdateData(
+                table: "OrderTypes",
+                keyColumn: "Id",
+                keyValue: 2L,
+                columns: new[] { "DefaultDays", "NameAr", "NameEn" },
+                values: new object[] { 15, "طبية", "Medical" });
+
+            migrationBuilder.UpdateData(
+                table: "OrderTypes",
+                keyColumn: "Id",
+                keyValue: 3L,
+                columns: new[] { "DefaultDays", "NameAr", "NameEn" },
+                values: new object[] { 20, "وقت إضافي", "Overtime" });
+
+            migrationBuilder.UpdateData(
+                table: "OrderTypes",
+                keyColumn: "Id",
+                keyValue: 4L,
+                columns: new[] { "NameAr", "NameEn" },
+                values: new object[] { "رحلة عمل", "Business trip" });
+
+            migrationBuilder.InsertData(
+                table: "OrderTypes",
+                columns: new[] { "Id", "DefaultDays", "NameAr", "NameEn" },
+                values: new object[] { 5L, 0, "دورة تدريبية", "Course" });
+        }
+    }
+}

+ 223 - 20
MTWorkHR.Infrastructure/Migrations/HRDataContextModelSnapshot.cs

@@ -311,9 +311,83 @@ namespace MTWorkHR.Infrastructure.Migrations
                             IsRequired = false,
                             NameAr = "الصورة",
                             NameEn = "Image"
+                        },
+                        new
+                        {
+                            Id = 10L,
+                            IsRequired = false,
+                            NameAr = "تكلفة التذكرة",
+                            NameEn = "Ticket Cost"
+                        },
+                        new
+                        {
+                            Id = 11L,
+                            IsRequired = false,
+                            NameAr = "تكلفة المواصلات",
+                            NameEn = "Transportation Cost"
+                        },
+                        new
+                        {
+                            Id = 12L,
+                            IsRequired = false,
+                            NameAr = "تكلفة الاقامة",
+                            NameEn = "Accommodation Cost"
+                        },
+                        new
+                        {
+                            Id = 13L,
+                            IsRequired = false,
+                            NameAr = "اخرى",
+                            NameEn = "Other"
                         });
                 });
 
+            modelBuilder.Entity("MTWorkHR.Core.Entities.BusinessTripExpenses", b =>
+                {
+                    b.Property<long>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("bigint")
+                        .HasColumnOrder(0);
+
+                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));
+
+                    b.Property<long?>("AccommodationAttachmentId")
+                        .HasColumnType("bigint");
+
+                    b.Property<decimal?>("AccommodationCost")
+                        .HasColumnType("decimal(18,2)");
+
+                    b.Property<long?>("OtherAttachmentId")
+                        .HasColumnType("bigint");
+
+                    b.Property<decimal?>("OtherCost")
+                        .HasColumnType("decimal(18,2)");
+
+                    b.Property<long?>("TicketAttachmentId")
+                        .HasColumnType("bigint");
+
+                    b.Property<decimal?>("TicketCost")
+                        .HasColumnType("decimal(18,2)");
+
+                    b.Property<long?>("TransportationAttachmentId")
+                        .HasColumnType("bigint");
+
+                    b.Property<decimal?>("TransportationCost")
+                        .HasColumnType("decimal(18,2)");
+
+                    b.HasKey("Id");
+
+                    b.HasIndex("AccommodationAttachmentId");
+
+                    b.HasIndex("OtherAttachmentId");
+
+                    b.HasIndex("TicketAttachmentId");
+
+                    b.HasIndex("TransportationAttachmentId");
+
+                    b.ToTable("BusinessTripExpenses");
+                });
+
             modelBuilder.Entity("MTWorkHR.Core.Entities.ChatAttachment", b =>
                 {
                     b.Property<long>("Id")
@@ -3342,6 +3416,60 @@ namespace MTWorkHR.Infrastructure.Migrations
                     b.ToTable("OrderAllocations");
                 });
 
+            modelBuilder.Entity("MTWorkHR.Core.Entities.OrderAttachment", b =>
+                {
+                    b.Property<long>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("bigint")
+                        .HasColumnOrder(0);
+
+                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));
+
+                    b.Property<long?>("AttachmentTypeId")
+                        .HasColumnType("bigint");
+
+                    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<long>("OrderRequestId")
+                        .HasColumnType("bigint");
+
+                    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("OrderRequestId");
+
+                    b.ToTable("OrderAttachment");
+                });
+
             modelBuilder.Entity("MTWorkHR.Core.Entities.OrderType", b =>
                 {
                     b.Property<long>("Id")
@@ -3377,33 +3505,57 @@ namespace MTWorkHR.Infrastructure.Migrations
                         new
                         {
                             Id = 2L,
-                            DefaultDays = 15,
-                            NameAr = "طبية",
-                            NameEn = "Medical"
-                        },
-                        new
-                        {
-                            Id = 3L,
                             DefaultDays = 20,
                             NameAr = "وقت إضافي",
                             NameEn = "Overtime"
                         },
                         new
                         {
-                            Id = 4L,
+                            Id = 3L,
                             DefaultDays = 0,
                             NameAr = "رحلة عمل",
                             NameEn = "Business trip"
                         },
                         new
                         {
-                            Id = 5L,
+                            Id = 4L,
                             DefaultDays = 0,
                             NameAr = "دورة تدريبية",
                             NameEn = "Course"
                         });
                 });
 
+            modelBuilder.Entity("MTWorkHR.Core.Entities.OverTimeDay", b =>
+                {
+                    b.Property<long>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("bigint")
+                        .HasColumnOrder(0);
+
+                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));
+
+                    b.Property<string>("EndTime")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<long?>("OrderRequestId")
+                        .HasColumnType("bigint");
+
+                    b.Property<DateTime?>("OverTimeDate")
+                        .HasColumnType("datetime2");
+
+                    b.Property<string>("StartTime")
+                        .HasColumnType("nvarchar(max)");
+
+                    b.Property<decimal?>("TotalHours")
+                        .HasColumnType("decimal(18,2)");
+
+                    b.HasKey("Id");
+
+                    b.HasIndex("OrderRequestId");
+
+                    b.ToTable("OverTimeDay");
+                });
+
             modelBuilder.Entity("MTWorkHR.Core.Entities.Permission", b =>
                 {
                     b.Property<long>("Id")
@@ -4539,8 +4691,8 @@ namespace MTWorkHR.Infrastructure.Migrations
 
                     SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));
 
-                    b.Property<int?>("CityId")
-                        .HasColumnType("int");
+                    b.Property<long?>("BusinessTripExpensesId")
+                        .HasColumnType("bigint");
 
                     b.Property<long>("CompanyId")
                         .HasColumnType("bigint");
@@ -4548,9 +4700,6 @@ namespace MTWorkHR.Infrastructure.Migrations
                     b.Property<long?>("ContractId")
                         .HasColumnType("bigint");
 
-                    b.Property<int?>("CountryId")
-                        .HasColumnType("int");
-
                     b.Property<DateTime>("CreateDate")
                         .HasColumnType("datetime2")
                         .HasColumnOrder(3);
@@ -4568,9 +4717,6 @@ namespace MTWorkHR.Infrastructure.Migrations
                     b.Property<DateTime?>("EndDate")
                         .HasColumnType("datetime2");
 
-                    b.Property<string>("EndTime")
-                        .HasColumnType("nvarchar(max)");
-
                     b.Property<bool>("IsDeleted")
                         .HasColumnType("bit")
                         .HasColumnOrder(7);
@@ -4594,9 +4740,6 @@ namespace MTWorkHR.Infrastructure.Migrations
                     b.Property<DateTime>("StartDate")
                         .HasColumnType("datetime2");
 
-                    b.Property<string>("StartTime")
-                        .HasColumnType("nvarchar(max)");
-
                     b.Property<DateTime?>("UpdateDate")
                         .HasColumnType("datetime2")
                         .HasColumnOrder(4);
@@ -4608,6 +4751,8 @@ namespace MTWorkHR.Infrastructure.Migrations
 
                     b.HasKey("Id");
 
+                    b.HasIndex("BusinessTripExpensesId");
+
                     b.HasIndex("CompanyId");
 
                     b.HasIndex("LeaveTypeId");
@@ -6422,6 +6567,33 @@ namespace MTWorkHR.Infrastructure.Migrations
                         .IsRequired();
                 });
 
+            modelBuilder.Entity("MTWorkHR.Core.Entities.BusinessTripExpenses", b =>
+                {
+                    b.HasOne("MTWorkHR.Core.Entities.OrderAttachment", "AccommodationAttachment")
+                        .WithMany()
+                        .HasForeignKey("AccommodationAttachmentId");
+
+                    b.HasOne("MTWorkHR.Core.Entities.OrderAttachment", "OtherAttachment")
+                        .WithMany()
+                        .HasForeignKey("OtherAttachmentId");
+
+                    b.HasOne("MTWorkHR.Core.Entities.OrderAttachment", "TicketAttachment")
+                        .WithMany()
+                        .HasForeignKey("TicketAttachmentId");
+
+                    b.HasOne("MTWorkHR.Core.Entities.OrderAttachment", "TransportationAttachment")
+                        .WithMany()
+                        .HasForeignKey("TransportationAttachmentId");
+
+                    b.Navigation("AccommodationAttachment");
+
+                    b.Navigation("OtherAttachment");
+
+                    b.Navigation("TicketAttachment");
+
+                    b.Navigation("TransportationAttachment");
+                });
+
             modelBuilder.Entity("MTWorkHR.Core.Entities.ChatAttachment", b =>
                 {
                     b.HasOne("MTWorkHR.Core.Entities.ChatMessage", "ChatMessage")
@@ -6520,6 +6692,24 @@ namespace MTWorkHR.Infrastructure.Migrations
                     b.Navigation("OrderType");
                 });
 
+            modelBuilder.Entity("MTWorkHR.Core.Entities.OrderAttachment", b =>
+                {
+                    b.HasOne("MTWorkHR.Core.Entities.User.OrderRequest", "OrderRequest")
+                        .WithMany("OrderAttachments")
+                        .HasForeignKey("OrderRequestId")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
+                    b.Navigation("OrderRequest");
+                });
+
+            modelBuilder.Entity("MTWorkHR.Core.Entities.OverTimeDay", b =>
+                {
+                    b.HasOne("MTWorkHR.Core.Entities.User.OrderRequest", null)
+                        .WithMany("OverTimeDays")
+                        .HasForeignKey("OrderRequestId");
+                });
+
             modelBuilder.Entity("MTWorkHR.Core.Entities.ProjectStage", b =>
                 {
                     b.HasOne("MTWorkHR.Core.Entities.Contract", "Contract")
@@ -6577,6 +6767,10 @@ namespace MTWorkHR.Infrastructure.Migrations
 
             modelBuilder.Entity("MTWorkHR.Core.Entities.User.OrderRequest", b =>
                 {
+                    b.HasOne("MTWorkHR.Core.Entities.BusinessTripExpenses", "BusinessTripExpenses")
+                        .WithMany()
+                        .HasForeignKey("BusinessTripExpensesId");
+
                     b.HasOne("MTWorkHR.Core.Entities.LeaveType", "LeaveType")
                         .WithMany()
                         .HasForeignKey("LeaveTypeId");
@@ -6587,6 +6781,8 @@ namespace MTWorkHR.Infrastructure.Migrations
                         .OnDelete(DeleteBehavior.Cascade)
                         .IsRequired();
 
+                    b.Navigation("BusinessTripExpenses");
+
                     b.Navigation("LeaveType");
 
                     b.Navigation("OrderType");
@@ -6843,6 +7039,13 @@ namespace MTWorkHR.Infrastructure.Migrations
                     b.Navigation("TeamUsers");
                 });
 
+            modelBuilder.Entity("MTWorkHR.Core.Entities.User.OrderRequest", b =>
+                {
+                    b.Navigation("OrderAttachments");
+
+                    b.Navigation("OverTimeDays");
+                });
+
             modelBuilder.Entity("MTWorkHR.Core.Entities.UserTask", b =>
                 {
                     b.Navigation("TaskAttachments");