浏览代码

OrderRequest:OverTime,BusinessTrip

zinab_elgendy 1 月之前
父节点
当前提交
7a77ba4f09
共有 24 个文件被更改,包括 22043 次插入51 次删除
  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. 5 8
      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. 6 0
      MTWorkHR.Application/Mapper/MappingProfile.cs
  9. 1 1
      MTWorkHR.Application/Services/Contract/ContractService.cs
  10. 12 2
      MTWorkHR.Application/Services/User/OrderRequestService.cs
  11. 23 0
      MTWorkHR.Core/Entities/Attendance/BusinessTripExpences.cs
  12. 25 0
      MTWorkHR.Core/Entities/Attendance/OrderAttachment.cs
  13. 8 5
      MTWorkHR.Core/Entities/Attendance/OrderRequest.cs
  14. 19 0
      MTWorkHR.Core/Entities/Attendance/OverTimeDate.cs
  15. 26 1
      MTWorkHR.Infrastructure/Configurations/AttachmentTypeConfiguration.cs
  16. 4 10
      MTWorkHR.Infrastructure/Configurations/OrderTypeConfiguration.cs
  17. 1 1
      MTWorkHR.Infrastructure/InfrastructureServiceRegistration.cs
  18. 7089 0
      MTWorkHR.Infrastructure/Migrations/20250224080933_altrOrderRequest3.Designer.cs
  19. 231 0
      MTWorkHR.Infrastructure/Migrations/20250224080933_altrOrderRequest3.cs
  20. 7083 0
      MTWorkHR.Infrastructure/Migrations/20250225085631_altrOvertime.Designer.cs
  21. 38 0
      MTWorkHR.Infrastructure/Migrations/20250225085631_altrOvertime.cs
  22. 7076 0
      MTWorkHR.Infrastructure/Migrations/20250225103824_altrOrderTypeConfig.Designer.cs
  23. 70 0
      MTWorkHR.Infrastructure/Migrations/20250225103824_altrOrderTypeConfig.cs
  24. 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.Filters;
 using MTWorkHR.Application.Identity;
 using MTWorkHR.Application.Identity;
 using MTWorkHR.Application.Models;
 using MTWorkHR.Application.Models;
+using MTWorkHR.Application.Services;
 using MTWorkHR.Application.Services.Interfaces;
 using MTWorkHR.Application.Services.Interfaces;
 using MTWorkHR.Identity.Services;
 using MTWorkHR.Identity.Services;
 
 
@@ -36,14 +37,29 @@ namespace MTWorkHR.API.Controllers
         }
         }
 
 
 
 
-        [HttpPost("Create")]
+        [HttpPost("CreateLeave")]
         [ProducesResponseType(StatusCodes.Status200OK)]
         [ProducesResponseType(StatusCodes.Status200OK)]
         [AppAuthorize(Permissions = "OrderRequest.Create")]
         [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);
             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")]
         [HttpPost("Update")]
         [ProducesResponseType(StatusCodes.Status200OK)]
         [ProducesResponseType(StatusCodes.Status200OK)]
         [AppAuthorize(Permissions = "OrderRequest.Update")]
         [AppAuthorize(Permissions = "OrderRequest.Update")]

+ 1 - 1
MTWorkHR.API/Program.cs

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

+ 5 - 8
MTWorkHR.Application/Dtos/Attendance/OrderRequestDto.cs

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

+ 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:""))
             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:""));
                 .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<OrderType, OrderTypeDto>().ReverseMap();
             CreateMap<LeaveType, LeaveTypeDto>().ReverseMap();
             CreateMap<LeaveType, LeaveTypeDto>().ReverseMap();
             CreateMap<CompanyDto, Company>().ForMember(d => d.CreateDate, o => o.Ignore()).ForMember(d => d.CreateUser, o => o.Ignore());
             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 MTWorkHR.Infrastructure.Entities;
 using System.Linq;
 using System.Linq;
 using MTWorkHR.Core.IDto;
 using MTWorkHR.Core.IDto;
-
+using MTWorkHR.Core.Entities.User;
 namespace MTWorkHR.Application.Services
 namespace MTWorkHR.Application.Services
 {
 {
     public class ContractService : BaseService<Contract, ContractDto, ContractDto>, IContractService
     public class ContractService : BaseService<Contract, ContractDto, ContractDto>, IContractService

+ 12 - 2
MTWorkHR.Application/Services/User/OrderRequestService.cs

@@ -13,9 +13,9 @@ using MTWorkHR.Application.Services.Interfaces;
 using MTWorkHR.Core.Email;
 using MTWorkHR.Core.Email;
 using MTWorkHR.Core.Entities;
 using MTWorkHR.Core.Entities;
 using MTWorkHR.Infrastructure.UnitOfWorks;
 using MTWorkHR.Infrastructure.UnitOfWorks;
-using MTWorkHR.Core.Entities.User;
 using System.Linq.Dynamic.Core;
 using System.Linq.Dynamic.Core;
 using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Http;
+using MTWorkHR.Core.Entities.User;
 
 
 namespace MTWorkHR.Application.Services
 namespace MTWorkHR.Application.Services
 {
 {
@@ -130,7 +130,17 @@ namespace MTWorkHR.Application.Services
             {
             {
                 input.RequestingEmployeeId = _globalInfo.UserId;
                 input.RequestingEmployeeId = _globalInfo.UserId;
             }
             }
-            if(input.OrderTypeId == 1 &&  input.LeaveTypeId == 1) // Annual vacation in contract
+            if (input is BusinessTripDto)
+            {
+                input.OrderTypeId = 3;
+                input.LeaveTypeId = null;
+            }
+            else if (input is OverTimeDto)
+            {
+                input.OrderTypeId = 2;
+                input.LeaveTypeId = null;
+            }
+            if (input.OrderTypeId == 1 &&  input.LeaveTypeId == 1) // Annual vacation in contract
             {
             {
                 var contractId = await _unitOfWork.Contract.GetLatestActiveContract(input.RequestingEmployeeId);
                 var contractId = await _unitOfWork.Contract.GetLatestActiveContract(input.RequestingEmployeeId);
                 var allocation = await _unitOfWork.OrderAllocation.GetUserAllocations(input.RequestingEmployeeId, input.OrderTypeId, input.LeaveTypeId, contractId.Id, period);
                 var allocation = await _unitOfWork.OrderAllocation.GetUserAllocations(input.RequestingEmployeeId, input.OrderTypeId, input.LeaveTypeId, contractId.Id, period);

+ 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 MTWorkHR.Core.Global;
 using System;
 using System;
 using System.Collections.Generic;
 using System.Collections.Generic;
@@ -26,13 +27,15 @@ namespace MTWorkHR.Core.Entities.User
         public ApprovalStatusEnum? OrderStatus { get; set; }
         public ApprovalStatusEnum? OrderStatus { get; set; }
         [Filter]
         [Filter]
         public string RequestingEmployeeId { get; set; }
         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 CompanyId { get; set ; }
         public long? ContractId { 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,
                     Id = 9,
                     NameEn = "Image",
                     NameEn = "Image",
                     NameAr = "الصورة"
                     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 = "إذن",
                     NameAr = "إذن",
                     DefaultDays = 2
                     DefaultDays = 2
                 },
                 },
-                 new OrderType
-                 {
-                     Id = 2,
-                     NameEn = "Medical",
-                     NameAr = "طبية",
-                     DefaultDays = 15
-                 },
+                 
                 new OrderType
                 new OrderType
                 {
                 {
-                    Id = 3,
+                    Id = 2,
                     NameEn = "Overtime",
                     NameEn = "Overtime",
                     NameAr = "وقت إضافي",
                     NameAr = "وقت إضافي",
                     DefaultDays = 20
                     DefaultDays = 20
                 },
                 },
                 new OrderType
                 new OrderType
                 {
                 {
-                    Id = 4,
+                    Id = 3,
                     NameEn = "Business trip", //(after closed from employee / manager)
                     NameEn = "Business trip", //(after closed from employee / manager)
                     NameAr = "رحلة عمل",
                     NameAr = "رحلة عمل",
                     DefaultDays = 0
                     DefaultDays = 0
@@ -50,7 +44,7 @@ namespace MTWorkHR.Infrastructure.Configurations
                 },
                 },
                 new OrderType
                 new OrderType
                 {
                 {
-                    Id = 5,
+                    Id = 4,
                     NameEn = "Course",
                     NameEn = "Course",
                     NameAr = "دورة تدريبية",
                     NameAr = "دورة تدريبية",
                     DefaultDays = 0
                     DefaultDays = 0

+ 1 - 1
MTWorkHR.Infrastructure/InfrastructureServiceRegistration.cs

@@ -32,7 +32,7 @@ namespace MTWorkHR.Infrastructure
             
             
             services.AddDbContext<HRDataContext>(options =>
             services.AddDbContext<HRDataContext>(options =>
                 options.UseSqlServer(
                 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();
             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,
                             IsRequired = false,
                             NameAr = "الصورة",
                             NameAr = "الصورة",
                             NameEn = "Image"
                             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 =>
             modelBuilder.Entity("MTWorkHR.Core.Entities.ChatAttachment", b =>
                 {
                 {
                     b.Property<long>("Id")
                     b.Property<long>("Id")
@@ -3342,6 +3416,60 @@ namespace MTWorkHR.Infrastructure.Migrations
                     b.ToTable("OrderAllocations");
                     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 =>
             modelBuilder.Entity("MTWorkHR.Core.Entities.OrderType", b =>
                 {
                 {
                     b.Property<long>("Id")
                     b.Property<long>("Id")
@@ -3377,33 +3505,57 @@ namespace MTWorkHR.Infrastructure.Migrations
                         new
                         new
                         {
                         {
                             Id = 2L,
                             Id = 2L,
-                            DefaultDays = 15,
-                            NameAr = "طبية",
-                            NameEn = "Medical"
-                        },
-                        new
-                        {
-                            Id = 3L,
                             DefaultDays = 20,
                             DefaultDays = 20,
                             NameAr = "وقت إضافي",
                             NameAr = "وقت إضافي",
                             NameEn = "Overtime"
                             NameEn = "Overtime"
                         },
                         },
                         new
                         new
                         {
                         {
-                            Id = 4L,
+                            Id = 3L,
                             DefaultDays = 0,
                             DefaultDays = 0,
                             NameAr = "رحلة عمل",
                             NameAr = "رحلة عمل",
                             NameEn = "Business trip"
                             NameEn = "Business trip"
                         },
                         },
                         new
                         new
                         {
                         {
-                            Id = 5L,
+                            Id = 4L,
                             DefaultDays = 0,
                             DefaultDays = 0,
                             NameAr = "دورة تدريبية",
                             NameAr = "دورة تدريبية",
                             NameEn = "Course"
                             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 =>
             modelBuilder.Entity("MTWorkHR.Core.Entities.Permission", b =>
                 {
                 {
                     b.Property<long>("Id")
                     b.Property<long>("Id")
@@ -4539,8 +4691,8 @@ namespace MTWorkHR.Infrastructure.Migrations
 
 
                     SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));
                     SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));
 
 
-                    b.Property<int?>("CityId")
-                        .HasColumnType("int");
+                    b.Property<long?>("BusinessTripExpensesId")
+                        .HasColumnType("bigint");
 
 
                     b.Property<long>("CompanyId")
                     b.Property<long>("CompanyId")
                         .HasColumnType("bigint");
                         .HasColumnType("bigint");
@@ -4548,9 +4700,6 @@ namespace MTWorkHR.Infrastructure.Migrations
                     b.Property<long?>("ContractId")
                     b.Property<long?>("ContractId")
                         .HasColumnType("bigint");
                         .HasColumnType("bigint");
 
 
-                    b.Property<int?>("CountryId")
-                        .HasColumnType("int");
-
                     b.Property<DateTime>("CreateDate")
                     b.Property<DateTime>("CreateDate")
                         .HasColumnType("datetime2")
                         .HasColumnType("datetime2")
                         .HasColumnOrder(3);
                         .HasColumnOrder(3);
@@ -4568,9 +4717,6 @@ namespace MTWorkHR.Infrastructure.Migrations
                     b.Property<DateTime?>("EndDate")
                     b.Property<DateTime?>("EndDate")
                         .HasColumnType("datetime2");
                         .HasColumnType("datetime2");
 
 
-                    b.Property<string>("EndTime")
-                        .HasColumnType("nvarchar(max)");
-
                     b.Property<bool>("IsDeleted")
                     b.Property<bool>("IsDeleted")
                         .HasColumnType("bit")
                         .HasColumnType("bit")
                         .HasColumnOrder(7);
                         .HasColumnOrder(7);
@@ -4594,9 +4740,6 @@ namespace MTWorkHR.Infrastructure.Migrations
                     b.Property<DateTime>("StartDate")
                     b.Property<DateTime>("StartDate")
                         .HasColumnType("datetime2");
                         .HasColumnType("datetime2");
 
 
-                    b.Property<string>("StartTime")
-                        .HasColumnType("nvarchar(max)");
-
                     b.Property<DateTime?>("UpdateDate")
                     b.Property<DateTime?>("UpdateDate")
                         .HasColumnType("datetime2")
                         .HasColumnType("datetime2")
                         .HasColumnOrder(4);
                         .HasColumnOrder(4);
@@ -4608,6 +4751,8 @@ namespace MTWorkHR.Infrastructure.Migrations
 
 
                     b.HasKey("Id");
                     b.HasKey("Id");
 
 
+                    b.HasIndex("BusinessTripExpensesId");
+
                     b.HasIndex("CompanyId");
                     b.HasIndex("CompanyId");
 
 
                     b.HasIndex("LeaveTypeId");
                     b.HasIndex("LeaveTypeId");
@@ -6422,6 +6567,33 @@ namespace MTWorkHR.Infrastructure.Migrations
                         .IsRequired();
                         .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 =>
             modelBuilder.Entity("MTWorkHR.Core.Entities.ChatAttachment", b =>
                 {
                 {
                     b.HasOne("MTWorkHR.Core.Entities.ChatMessage", "ChatMessage")
                     b.HasOne("MTWorkHR.Core.Entities.ChatMessage", "ChatMessage")
@@ -6520,6 +6692,24 @@ namespace MTWorkHR.Infrastructure.Migrations
                     b.Navigation("OrderType");
                     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 =>
             modelBuilder.Entity("MTWorkHR.Core.Entities.ProjectStage", b =>
                 {
                 {
                     b.HasOne("MTWorkHR.Core.Entities.Contract", "Contract")
                     b.HasOne("MTWorkHR.Core.Entities.Contract", "Contract")
@@ -6577,6 +6767,10 @@ namespace MTWorkHR.Infrastructure.Migrations
 
 
             modelBuilder.Entity("MTWorkHR.Core.Entities.User.OrderRequest", b =>
             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")
                     b.HasOne("MTWorkHR.Core.Entities.LeaveType", "LeaveType")
                         .WithMany()
                         .WithMany()
                         .HasForeignKey("LeaveTypeId");
                         .HasForeignKey("LeaveTypeId");
@@ -6587,6 +6781,8 @@ namespace MTWorkHR.Infrastructure.Migrations
                         .OnDelete(DeleteBehavior.Cascade)
                         .OnDelete(DeleteBehavior.Cascade)
                         .IsRequired();
                         .IsRequired();
 
 
+                    b.Navigation("BusinessTripExpenses");
+
                     b.Navigation("LeaveType");
                     b.Navigation("LeaveType");
 
 
                     b.Navigation("OrderType");
                     b.Navigation("OrderType");
@@ -6843,6 +7039,13 @@ namespace MTWorkHR.Infrastructure.Migrations
                     b.Navigation("TeamUsers");
                     b.Navigation("TeamUsers");
                 });
                 });
 
 
+            modelBuilder.Entity("MTWorkHR.Core.Entities.User.OrderRequest", b =>
+                {
+                    b.Navigation("OrderAttachments");
+
+                    b.Navigation("OverTimeDays");
+                });
+
             modelBuilder.Entity("MTWorkHR.Core.Entities.UserTask", b =>
             modelBuilder.Entity("MTWorkHR.Core.Entities.UserTask", b =>
                 {
                 {
                     b.Navigation("TaskAttachments");
                     b.Navigation("TaskAttachments");