diff --git a/BMA.EHR.Application/Repositories/Leaves/LeaveRequests/LeaveBeginingRepository.cs b/BMA.EHR.Application/Repositories/Leaves/LeaveRequests/LeaveBeginingRepository.cs index 35b18090..a62aa291 100644 --- a/BMA.EHR.Application/Repositories/Leaves/LeaveRequests/LeaveBeginingRepository.cs +++ b/BMA.EHR.Application/Repositories/Leaves/LeaveRequests/LeaveBeginingRepository.cs @@ -149,7 +149,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests var prevRemain = 0.0; if (prev != null) { - prevRemain = prev.LeaveDays - (prev.LeaveDaysUsed ?? 0.0); + prevRemain = prev.LeaveDays - prev.LeaveDaysUsed; } if (govAge >= 180) @@ -215,7 +215,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests var prevRemain = 0.0; if (prev != null) { - prevRemain = prev.LeaveDays - (prev.LeaveDaysUsed ?? 0.0); + prevRemain = prev.LeaveDays - prev.LeaveDaysUsed; } if (govAge >= 180) @@ -288,7 +288,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests var prevRemain = 0.0; if (prev != null) { - prevRemain = prev.LeaveDays - (prev.LeaveDaysUsed ?? 0.0); + prevRemain = prev.LeaveDays - prev.LeaveDaysUsed; } if (govAge >= 180) @@ -376,7 +376,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests var prevRemain = 0.0; if (prev != null) { - prevRemain = prev.LeaveDays - (prev.LeaveDaysUsed ?? 0.0); + prevRemain = prev.LeaveDays - prev.LeaveDaysUsed; } if (govAge >= 180) diff --git a/BMA.EHR.Application/Repositories/Leaves/LeaveRequests/LeaveRequestRepository.cs b/BMA.EHR.Application/Repositories/Leaves/LeaveRequests/LeaveRequestRepository.cs index 9487da2c..f9a7f58a 100644 --- a/BMA.EHR.Application/Repositories/Leaves/LeaveRequests/LeaveRequestRepository.cs +++ b/BMA.EHR.Application/Repositories/Leaves/LeaveRequests/LeaveRequestRepository.cs @@ -522,7 +522,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests //.Where(x => x.LeaveStatus != "REJECT" && x.LeaveStatus != "DELETE") .ToListAsync(); - return data.Sum(x => x.LeaveTotal) + (beginningLeave == null ? 0 : (beginningLeave.LeaveDaysUsed ?? 0.0)); + return data.Sum(x => x.LeaveTotal) + (beginningLeave == null ? 0 : beginningLeave.LeaveDaysUsed); } //public async Task GetSumApproveLeaveByTypeForUserAsync(Guid keycloakUserId, Guid leaveTypeId, int year) @@ -1486,7 +1486,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests KeycloakUserId = pf.Keycloak == null ? Guid.Empty : pf.Keycloak.Value, LeaveTypeId = b.LeaveTypeId, LeaveTypeCode = b.LeaveType!.Code, - SumLeaveDay = b.LeaveDaysUsed ?? 0.0 + SumLeaveDay = b.LeaveDaysUsed }); } } @@ -1887,20 +1887,6 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests else return 0; } - - public async Task GetSumApproveLeaveCountByTypeAndRangeForUser2(Guid keycloakUserId, Guid leaveTypeId, DateTime startDate, DateTime endDate) - { - var data = await _dbContext.Set().AsQueryable().AsNoTracking() - .Include(x => x.Type) - .Where(x => x.KeycloakUserId == keycloakUserId) - .Where(x => x.Type.Id == leaveTypeId) - .Where(x => ((x.DateSendLeave ?? x.CreatedAt).Date >= startDate && (x.DateSendLeave ??x.CreatedAt).Date < endDate)) - //.Where(x => x.LeaveStartDate.Date >= startDate.Date && x.LeaveStartDate.Date <= endDate.Date) - .Where(x => x.LeaveStatus == "APPROVE" || x.LeaveStatus == "DELETING") - .ToListAsync(); - - return data.Count; - } /// /// วันลาที่สร้างแบบร่างยังไม่ได้ยื่น diff --git a/BMA.EHR.Domain/Models/Leave/Requests/LeaveBeginning.cs b/BMA.EHR.Domain/Models/Leave/Requests/LeaveBeginning.cs index 0bb9a1c1..153b7d22 100644 --- a/BMA.EHR.Domain/Models/Leave/Requests/LeaveBeginning.cs +++ b/BMA.EHR.Domain/Models/Leave/Requests/LeaveBeginning.cs @@ -27,11 +27,11 @@ namespace BMA.EHR.Domain.Models.Leave.Requests [Required, Comment("จำนวนวันลาทั้งหมด")] public double LeaveDays { get; set; } = 0.0; - [Comment("จำนวนวันลาที่ใช้ไป")] - public double? LeaveDaysUsed { get; set; } = 0.0; + [Required, Comment("จำนวนวันลาที่ใช้ไป")] + public double LeaveDaysUsed { get; set; } = 0.0; [Comment("จำนวนครั้งที่ลาสะสม")] - public int? LeaveCount { get; set; } = 0; + public int LeaveCount { get; set; } = 0; public Guid? RootDnaId { get; set; } diff --git a/BMA.EHR.Infrastructure/Migrations/LeaveDb/20260505035145_Change Field.Designer.cs b/BMA.EHR.Infrastructure/Migrations/LeaveDb/20260505035145_Change Field.Designer.cs deleted file mode 100644 index f95eab33..00000000 --- a/BMA.EHR.Infrastructure/Migrations/LeaveDb/20260505035145_Change Field.Designer.cs +++ /dev/null @@ -1,1805 +0,0 @@ -// -using System; -using BMA.EHR.Infrastructure.Persistence; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace BMA.EHR.Infrastructure.Migrations.LeaveDb -{ - [DbContext(typeof(LeaveDbContext))] - [Migration("20260505035145_Change Field")] - partial class ChangeField - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "7.0.9") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("BMA.EHR.Domain.Models.Documents.Document", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("CreatedDate") - .HasColumnType("datetime(6)"); - - b.Property("Detail") - .IsRequired() - .HasColumnType("text"); - - b.Property("FileName") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("varchar(255)"); - - b.Property("FileSize") - .HasColumnType("int"); - - b.Property("FileType") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("varchar(128)"); - - b.Property("ObjectRefId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.ToTable("Document"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.Commons.LeaveType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("Code") - .IsRequired() - .HasColumnType("longtext") - .HasComment("รหัสประเภทการลา"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Limit") - .HasColumnType("int") - .HasComment("จำนวนวันลาสูงสุดประจำปี"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext") - .HasComment("ชื่อประเภทการลา"); - - b.HasKey("Id"); - - b.ToTable("LeaveTypes"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.Requests.LeaveBeginning", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("BeginningLeaveCount") - .HasColumnType("int") - .HasComment("จำนวนครั้งที่ลายกมา"); - - b.Property("BeginningLeaveDays") - .HasColumnType("double") - .HasComment("จำนวนวันลายกมา"); - - b.Property("Child1DnaId") - .HasColumnType("char(36)"); - - b.Property("Child2DnaId") - .HasColumnType("char(36)"); - - b.Property("Child3DnaId") - .HasColumnType("char(36)"); - - b.Property("Child4DnaId") - .HasColumnType("char(36)"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("FirstName") - .HasColumnType("longtext"); - - b.Property("LastName") - .HasColumnType("longtext"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("LeaveCount") - .HasColumnType("int") - .HasComment("จำนวนครั้งที่ลาสะสม"); - - b.Property("LeaveDays") - .HasColumnType("double") - .HasComment("จำนวนวันลาทั้งหมด"); - - b.Property("LeaveDaysUsed") - .HasColumnType("double") - .HasComment("จำนวนวันลาที่ใช้ไป"); - - b.Property("LeaveTypeId") - .HasColumnType("char(36)") - .HasComment("รหัสประเภทการลา"); - - b.Property("LeaveYear") - .HasColumnType("int") - .HasComment("ปีงบประมาณ"); - - b.Property("Prefix") - .HasColumnType("longtext"); - - b.Property("ProfileId") - .HasColumnType("char(36)") - .HasComment("รหัส Profile ในระบบทะเบียนประวัติ"); - - b.Property("RootDnaId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.HasIndex("LeaveTypeId"); - - b.ToTable("LeaveBeginnings"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.Requests.LeaveDocument", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("DocumentId") - .HasColumnType("char(36)"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("LeaveRequestId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.HasIndex("DocumentId"); - - b.HasIndex("LeaveRequestId"); - - b.ToTable("LeaveDocuments"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.Requests.LeaveRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("AbsentDayAt") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("AbsentDayGetIn") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("AbsentDayLocation") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("AbsentDayRegistorDate") - .HasColumnType("datetime(6)"); - - b.Property("AbsentDaySummon") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Amount") - .HasColumnType("double"); - - b.Property("ApproveStep") - .HasColumnType("longtext") - .HasComment("step การอนุมัติ st1 = จทน.อนุมัตื,st2 = ผู้บังคับบัญชา อนุมัติ "); - - b.Property("BirthDate") - .HasColumnType("datetime(6)"); - - b.Property("CancelLeaveWrote") - .HasColumnType("longtext") - .HasComment("เขียนที่ (ขอยกเลิก)"); - - b.Property("Child1") - .HasColumnType("longtext"); - - b.Property("Child1DnaId") - .HasColumnType("char(36)"); - - b.Property("Child1Id") - .HasColumnType("char(36)"); - - b.Property("Child2") - .HasColumnType("longtext"); - - b.Property("Child2DnaId") - .HasColumnType("char(36)"); - - b.Property("Child2Id") - .HasColumnType("char(36)"); - - b.Property("Child3") - .HasColumnType("longtext"); - - b.Property("Child3DnaId") - .HasColumnType("char(36)"); - - b.Property("Child3Id") - .HasColumnType("char(36)"); - - b.Property("Child4") - .HasColumnType("longtext"); - - b.Property("Child4DnaId") - .HasColumnType("char(36)"); - - b.Property("Child4Id") - .HasColumnType("char(36)"); - - b.Property("CitizenId") - .HasColumnType("longtext"); - - b.Property("CommanderPosition") - .HasColumnType("longtext"); - - b.Property("CoupleDayCountryHistory") - .HasColumnType("longtext"); - - b.Property("CoupleDayEndDateHistory") - .HasColumnType("datetime(6)"); - - b.Property("CoupleDayLevel") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("CoupleDayLevelCountry") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("CoupleDayName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("CoupleDayPosition") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("CoupleDayStartDateHistory") - .HasColumnType("datetime(6)"); - - b.Property("CoupleDaySumTotalHistory") - .HasColumnType("longtext"); - - b.Property("CoupleDayTotalHistory") - .HasColumnType("longtext"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("DateAppoint") - .HasColumnType("datetime(6)"); - - b.Property("DateSendLeave") - .HasColumnType("datetime(6)"); - - b.Property("Dear") - .HasColumnType("longtext") - .HasComment("เรียนใคร"); - - b.Property("FirstName") - .HasColumnType("longtext"); - - b.Property("Gender") - .HasColumnType("longtext"); - - b.Property("HajjDayStatus") - .HasColumnType("tinyint(1)"); - - b.Property("KeycloakUserId") - .HasColumnType("char(36)"); - - b.Property("LastName") - .HasColumnType("longtext"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("LeaveAddress") - .IsRequired() - .HasColumnType("longtext") - .HasComment("สถานที่ติดต่อขณะลา"); - - b.Property("LeaveBirthDate") - .HasColumnType("datetime(6)"); - - b.Property("LeaveCancelComment") - .HasColumnType("longtext") - .HasComment("เหตุผลในการขอยกเลิก"); - - b.Property("LeaveCancelDocumentId") - .HasColumnType("char(36)"); - - b.Property("LeaveCancelStatus") - .HasColumnType("longtext") - .HasComment("สถานะของคำขอยกเลิก"); - - b.Property("LeaveComment") - .HasColumnType("longtext") - .HasComment("ความเห็นของผู้บังคับบัญชา"); - - b.Property("LeaveDetail") - .IsRequired() - .HasColumnType("longtext") - .HasComment("รายละเอียดการลา"); - - b.Property("LeaveDirectorComment") - .HasColumnType("longtext") - .HasComment("ความเห็นของผู้อำนวยการสำนัก"); - - b.Property("LeaveDraftDocumentId") - .HasColumnType("char(36)"); - - b.Property("LeaveEndDate") - .HasColumnType("datetime(6)") - .HasComment("วัน เดือน ปีสิ้นสุดลา"); - - b.Property("LeaveGovernmentDate") - .HasColumnType("datetime(6)"); - - b.Property("LeaveLast") - .HasColumnType("datetime(6)"); - - b.Property("LeaveNumber") - .IsRequired() - .HasColumnType("longtext") - .HasComment("หมายเลขที่ติดต่อขณะลา"); - - b.Property("LeaveRange") - .HasColumnType("longtext") - .HasComment("ช่วงของการลาของวันเริ่ม เช่น ลาทั้งวัน ครึ่งวันเช้า ครึ่งวันบ่าย"); - - b.Property("LeaveRangeEnd") - .HasColumnType("longtext") - .HasComment("ช่วงของการลาของวันสิ้นสุด เช่น ลาทั้งวัน ครึ่งวันเช้า ครึ่งวันบ่าย"); - - b.Property("LeaveSalary") - .HasColumnType("int"); - - b.Property("LeaveSalaryText") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("LeaveStartDate") - .HasColumnType("datetime(6)") - .HasComment("วัน เดือน ปีเริ่มต้นลา"); - - b.Property("LeaveStatus") - .IsRequired() - .HasColumnType("longtext") - .HasComment("สถานะของคำร้อง"); - - b.Property("LeaveSubTypeName") - .HasColumnType("longtext"); - - b.Property("LeaveTotal") - .HasColumnType("double"); - - b.Property("LeaveTypeCode") - .HasColumnType("longtext") - .HasComment("code ของประเภทการลา"); - - b.Property("LeaveWrote") - .IsRequired() - .HasColumnType("longtext") - .HasComment("เขียนที่"); - - b.Property("OrdainDayBuddhistLentAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("OrdainDayBuddhistLentName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("OrdainDayLocationAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("OrdainDayLocationName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("OrdainDayLocationNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("OrdainDayOrdination") - .HasColumnType("datetime(6)"); - - b.Property("OrdainDayStatus") - .HasColumnType("tinyint(1)"); - - b.Property("OrganizationName") - .HasColumnType("longtext") - .HasComment("สังกัดผู้ยื่นขอ"); - - b.Property("PositionLevelName") - .HasColumnType("longtext") - .HasComment("ระดับผู้ยื่นขอ"); - - b.Property("PositionName") - .HasColumnType("longtext") - .HasComment("ตำแหน่งผู้ยื่นขอ"); - - b.Property("Prefix") - .HasColumnType("longtext"); - - b.Property("ProfileId") - .HasColumnType("char(36)"); - - b.Property("ProfileType") - .HasColumnType("longtext"); - - b.Property("RestDayCurrentTotal") - .HasColumnType("double"); - - b.Property("RestDayOldTotal") - .HasColumnType("double"); - - b.Property("Root") - .HasColumnType("longtext"); - - b.Property("RootDnaId") - .HasColumnType("char(36)"); - - b.Property("RootId") - .HasColumnType("char(36)"); - - b.Property("StudyDayCountry") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("StudyDayDegreeLevel") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("StudyDayScholarship") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("StudyDaySubject") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("StudyDayTrainingName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("StudyDayTrainingSubject") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("StudyDayUniversityName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TypeId") - .HasColumnType("char(36)"); - - b.Property("WifeDayDateBorn") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("WifeDayName") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("LeaveCancelDocumentId"); - - b.HasIndex("LeaveDraftDocumentId"); - - b.HasIndex("TypeId"); - - b.ToTable("LeaveRequests"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.Requests.LeaveRequestApprover", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("ApproveStatus") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ApproveType") - .HasColumnType("longtext"); - - b.Property("Comment") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("FirstName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("KeycloakId") - .HasColumnType("char(36)"); - - b.Property("LastName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("LeaveRequestId") - .HasColumnType("char(36)"); - - b.Property("OrganizationName") - .IsRequired() - .HasColumnType("longtext") - .HasComment("สังกัด"); - - b.Property("PosExecutiveName") - .IsRequired() - .HasColumnType("longtext") - .HasComment("ตำแหน่งทางการบริหาร"); - - b.Property("PositionLevelName") - .IsRequired() - .HasColumnType("longtext") - .HasComment("ประเภทระดับตำแหน่ง"); - - b.Property("PositionName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("PositionSign") - .HasColumnType("longtext") - .HasComment("ตำแหน่งใต้ลายเช็นต์"); - - b.Property("Prefix") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProfileId") - .HasColumnType("char(36)"); - - b.Property("Seq") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("LeaveRequestId"); - - b.ToTable("LeaveRequestApprovers"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.AdditionalCheckRequest", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CheckDate") - .HasColumnType("datetime(6)") - .HasComment("*วันที่ลงเวลา"); - - b.Property("CheckInEdit") - .HasColumnType("tinyint(1)") - .HasComment("*ขอลงเวลาช่วงเช้า"); - - b.Property("CheckOutEdit") - .HasColumnType("tinyint(1)") - .HasComment("*ขอลงเวลาช่วงบ่าย"); - - b.Property("Child1DnaId") - .HasColumnType("char(36)"); - - b.Property("Child2DnaId") - .HasColumnType("char(36)"); - - b.Property("Child3DnaId") - .HasColumnType("char(36)"); - - b.Property("Child4DnaId") - .HasColumnType("char(36)"); - - b.Property("Comment") - .HasColumnType("longtext") - .HasComment("หมายเหตุในการการอนุมัติ/ไม่อนุมัติ"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext") - .HasComment("*หมายเหตุขอลงเวลาพิเศษ"); - - b.Property("FirstName") - .HasColumnType("longtext"); - - b.Property("KeycloakUserId") - .HasColumnType("char(36)") - .HasComment("รหัส User ของ Keycloak ที่ร้องขอ"); - - b.Property("LastName") - .HasColumnType("longtext"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Latitude") - .HasColumnType("double"); - - b.Property("Longitude") - .HasColumnType("double"); - - b.Property("POI") - .HasColumnType("longtext"); - - b.Property("Prefix") - .HasColumnType("longtext"); - - b.Property("RootDnaId") - .HasColumnType("char(36)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("longtext") - .HasComment("สถานะการอนุมัติ"); - - b.HasKey("Id"); - - b.ToTable("AdditionalCheckRequests"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.CheckInJobStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("AdditionalData") - .HasColumnType("longtext") - .HasComment("ข้อมูลเพิ่มเติม (JSON)"); - - b.Property("CheckInId") - .HasColumnType("char(36)") - .HasComment("CheckInId สำหรับ Check-Out"); - - b.Property("CheckType") - .HasColumnType("longtext") - .HasComment("ประเภทการลงเวลา: CHECK_IN, CHECK_OUT"); - - b.Property("CompletedDate") - .HasColumnType("datetime(6)") - .HasComment("วันเวลาที่เสร็จสิ้นการประมวลผล"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedDate") - .HasColumnType("datetime(6)") - .HasComment("วันเวลาที่สร้างงาน"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("ErrorMessage") - .HasColumnType("longtext") - .HasComment("ข้อความแสดงข้อผิดพลาด"); - - b.Property("KeycloakUserId") - .HasColumnType("char(36)") - .HasComment("รหัส User ของ Keycloak"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("ProcessingDate") - .HasColumnType("datetime(6)") - .HasComment("วันเวลาที่เริ่มประมวลผล"); - - b.Property("Status") - .IsRequired() - .HasColumnType("longtext") - .HasComment("สถานะงาน: PENDING, PROCESSING, COMPLETED, FAILED"); - - b.Property("TaskId") - .HasColumnType("char(36)") - .HasComment("Task ID สำหรับติดตามสถานะงาน"); - - b.HasKey("Id"); - - b.ToTable("CheckInJobStatuses"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.DutyTime", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext") - .HasComment("คำอธิบาย"); - - b.Property("EndTimeAfternoon") - .IsRequired() - .HasColumnType("longtext") - .HasComment("เวลาออกงานช่วงบ่าย"); - - b.Property("EndTimeMorning") - .IsRequired() - .HasColumnType("longtext") - .HasComment("เวลาออกงานช่วงเช้า"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasComment("สถานะการเปิดใช้งาน (เปิด/ปิด)"); - - b.Property("IsDefault") - .HasColumnType("tinyint(1)") - .HasComment("สถานะว่ารอบใดเป็นค่า Default ของข้าราชการ (สำหรับทุกคนที่ยังไม่ได้ทำการเลือกรอบ)"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("StartTimeAfternoon") - .IsRequired() - .HasColumnType("longtext") - .HasComment("เวลาเข้างานช่วงบ่าย"); - - b.Property("StartTimeMorning") - .IsRequired() - .HasColumnType("longtext") - .HasComment("เวลาเข้างานช่วงเช้า"); - - b.HasKey("Id"); - - b.ToTable("DutyTimes"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.LeaveProcessJobStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CompletedDate") - .HasColumnType("datetime(6)") - .HasComment("วันเวลาที่เสร็จสิ้นการประมวลผล"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedDate") - .HasColumnType("datetime(6)") - .HasComment("วันเวลาที่สร้างงาน"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("EndDate") - .HasColumnType("datetime(6)") - .HasComment("วันสิ้นสุด"); - - b.Property("ErrorMessage") - .HasColumnType("longtext") - .HasComment("ข้อความแสดงข้อผิดพลาด"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("ProcessingDate") - .HasColumnType("datetime(6)") - .HasComment("วันเวลาที่เริ่มประมวลผล"); - - b.Property("RootDnaId") - .HasColumnType("char(36)") - .HasComment("รหัส Root DNA Id"); - - b.Property("StartDate") - .HasColumnType("datetime(6)") - .HasComment("วันเริ่มต้น"); - - b.Property("Status") - .IsRequired() - .HasColumnType("longtext") - .HasComment("สถานะงาน: PENDING, PROCESSING, COMPLETED, FAILED"); - - b.HasKey("Id"); - - b.ToTable("LeaveProcessJobStatuses"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.ProcessUserTimeStamp", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CheckIn") - .HasColumnType("datetime(6)") - .HasComment("วัน เวลา เข้างาน"); - - b.Property("CheckInImageUrl") - .IsRequired() - .HasColumnType("longtext") - .HasComment("รูปถ่ายสถานที่ Check-In"); - - b.Property("CheckInLat") - .HasColumnType("double") - .HasComment("พิกัดละติจูด Check-In"); - - b.Property("CheckInLocationName") - .HasColumnType("longtext") - .HasComment("กรณีเลือกนอกสถานที่ตั้ง ต้องระบุข้อมูลชื่อสถานะที่ Check-In"); - - b.Property("CheckInLon") - .HasColumnType("double") - .HasComment("พิกัดลองจิจูด Check-In"); - - b.Property("CheckInPOI") - .IsRequired() - .HasColumnType("longtext") - .HasComment("ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ Check-In"); - - b.Property("CheckInRemark") - .HasColumnType("longtext") - .HasComment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-In"); - - b.Property("CheckInStatus") - .IsRequired() - .HasColumnType("longtext") - .HasComment("สถานะ Check-In"); - - b.Property("CheckOut") - .HasColumnType("datetime(6)") - .HasComment("วัน เวลา ออกงาน"); - - b.Property("CheckOutImageUrl") - .IsRequired() - .HasColumnType("longtext") - .HasComment("รูปถ่ายสถานที่ Check-Out"); - - b.Property("CheckOutLat") - .HasColumnType("double") - .HasComment("พิกัดละติจูด Check-Out"); - - b.Property("CheckOutLocationName") - .HasColumnType("longtext") - .HasComment("กรณีเลือกนอกสถานที่ตั้ง ต้องระบุข้อมูลชื่อสถานะที่ Check-Out"); - - b.Property("CheckOutLon") - .HasColumnType("double") - .HasComment("พิกัดลองจิจูด Check-Out"); - - b.Property("CheckOutPOI") - .IsRequired() - .HasColumnType("longtext") - .HasComment("ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ Check-Out"); - - b.Property("CheckOutRemark") - .HasColumnType("longtext") - .HasComment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-Out"); - - b.Property("CheckOutStatus") - .HasColumnType("longtext") - .HasComment("สถานะ Check-Out"); - - b.Property("Child1") - .HasColumnType("longtext"); - - b.Property("Child1DnaId") - .HasColumnType("char(36)"); - - b.Property("Child1Id") - .HasColumnType("char(36)"); - - b.Property("Child2") - .HasColumnType("longtext"); - - b.Property("Child2DnaId") - .HasColumnType("char(36)"); - - b.Property("Child2Id") - .HasColumnType("char(36)"); - - b.Property("Child3") - .HasColumnType("longtext"); - - b.Property("Child3DnaId") - .HasColumnType("char(36)"); - - b.Property("Child3Id") - .HasColumnType("char(36)"); - - b.Property("Child4") - .HasColumnType("longtext"); - - b.Property("Child4DnaId") - .HasColumnType("char(36)"); - - b.Property("Child4Id") - .HasColumnType("char(36)"); - - b.Property("CitizenId") - .HasColumnType("longtext"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("EditReason") - .HasColumnType("longtext") - .HasComment("เหตุผลการอนุมัติ/ไม่อนุมัติขอลงเวลาพิเศษ"); - - b.Property("EditStatus") - .HasColumnType("longtext") - .HasComment("สถานะการของลงเวลาพิเศษ"); - - b.Property("FirstName") - .HasColumnType("longtext"); - - b.Property("Gender") - .HasColumnType("longtext"); - - b.Property("IsLocationCheckIn") - .HasColumnType("tinyint(1)") - .HasComment("true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-In"); - - b.Property("IsLocationCheckOut") - .HasColumnType("tinyint(1)") - .HasComment("true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-Out"); - - b.Property("IsProcess") - .HasColumnType("tinyint(1)") - .HasComment("นำไปประมวลผลแล้วหรือยัง"); - - b.Property("KeycloakUserId") - .HasColumnType("char(36)") - .HasComment("รหัส User ของ Keycloak"); - - b.Property("LastName") - .HasColumnType("longtext"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Prefix") - .HasColumnType("longtext"); - - b.Property("ProfileId") - .HasColumnType("char(36)"); - - b.Property("ProfileType") - .HasColumnType("longtext"); - - b.Property("Root") - .HasColumnType("longtext"); - - b.Property("RootDnaId") - .HasColumnType("char(36)"); - - b.Property("RootId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.ToTable("ProcessUserTimeStamps"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.UserCalendar", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("Calendar") - .IsRequired() - .HasColumnType("longtext") - .HasComment("ปฏิทินการทำงานของ ขรก ปกติ หรือ 6 วันต่อสัปดาห์"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("ProfileId") - .HasColumnType("char(36)") - .HasComment("รหัส Profile ในระบบทะเบียนประวัติ"); - - b.HasKey("Id"); - - b.ToTable("UserCalendars"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.UserDutyTime", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("Child1DnaId") - .HasColumnType("char(36)"); - - b.Property("Child2DnaId") - .HasColumnType("char(36)"); - - b.Property("Child3DnaId") - .HasColumnType("char(36)"); - - b.Property("Child4DnaId") - .HasColumnType("char(36)"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("DutyTimeId") - .HasColumnType("char(36)") - .HasComment("รหัสรอบการลงเวลา"); - - b.Property("EffectiveDate") - .HasColumnType("datetime(6)") - .HasComment("วันที่มีผล"); - - b.Property("IsProcess") - .HasColumnType("tinyint(1)") - .HasComment("ทำการประมวลผลแล้วหรือยัง"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("ProfileId") - .HasColumnType("char(36)") - .HasComment("รหัส Profile ในระบบทะเบียนประวัติ"); - - b.Property("Remark") - .HasColumnType("longtext") - .HasComment("หมายเหตุ"); - - b.Property("RootDnaId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.HasIndex("DutyTimeId"); - - b.ToTable("UserDutyTimes"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.UserTimeStamp", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)") - .HasColumnOrder(0) - .HasComment("PrimaryKey") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CheckIn") - .HasColumnType("datetime(6)") - .HasComment("วัน เวลา เข้างาน"); - - b.Property("CheckInImageUrl") - .IsRequired() - .HasColumnType("longtext") - .HasComment("รูปถ่ายสถานที่ Check-In"); - - b.Property("CheckInLat") - .HasColumnType("double") - .HasComment("พิกัดละติจูด Check-In"); - - b.Property("CheckInLocationName") - .HasColumnType("longtext") - .HasComment("กรณีเลือกนอกสถานที่ตั้ง ต้องระบุข้อมูลชื่อสถานะที่ Check-In"); - - b.Property("CheckInLon") - .HasColumnType("double") - .HasComment("พิกัดลองจิจูด Check-In"); - - b.Property("CheckInPOI") - .IsRequired() - .HasColumnType("longtext") - .HasComment("ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ Check-In"); - - b.Property("CheckInRemark") - .HasColumnType("longtext") - .HasComment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-In"); - - b.Property("CheckOut") - .HasColumnType("datetime(6)") - .HasComment("วัน เวลา ออกงาน"); - - b.Property("CheckOutImageUrl") - .IsRequired() - .HasColumnType("longtext") - .HasComment("รูปถ่ายสถานที่ Check-Out"); - - b.Property("CheckOutLat") - .HasColumnType("double") - .HasComment("พิกัดละติจูด Check-Out"); - - b.Property("CheckOutLocationName") - .HasColumnType("longtext") - .HasComment("กรณีเลือกนอกสถานที่ตั้ง ต้องระบุข้อมูลชื่อสถานะที่ Check-Out"); - - b.Property("CheckOutLon") - .HasColumnType("double") - .HasComment("พิกัดลองจิจูด Check-Out"); - - b.Property("CheckOutPOI") - .IsRequired() - .HasColumnType("longtext") - .HasComment("ชื่อสถานที่ ได้มาจากระบบ ArcGis ของกองสารสนเทศภูมิศาสตร์ Check-Out"); - - b.Property("CheckOutRemark") - .HasColumnType("longtext") - .HasComment("ข้อความหมายเหตุที่ต้องการระบุเพิ่ม(มีเผื่อไว้อาจไม่ได้ใช้) Check-Out"); - - b.Property("Child1") - .HasColumnType("longtext"); - - b.Property("Child1DnaId") - .HasColumnType("char(36)"); - - b.Property("Child1Id") - .HasColumnType("char(36)"); - - b.Property("Child2") - .HasColumnType("longtext"); - - b.Property("Child2DnaId") - .HasColumnType("char(36)"); - - b.Property("Child2Id") - .HasColumnType("char(36)"); - - b.Property("Child3") - .HasColumnType("longtext"); - - b.Property("Child3DnaId") - .HasColumnType("char(36)"); - - b.Property("Child3Id") - .HasColumnType("char(36)"); - - b.Property("Child4") - .HasColumnType("longtext"); - - b.Property("Child4DnaId") - .HasColumnType("char(36)"); - - b.Property("Child4Id") - .HasColumnType("char(36)"); - - b.Property("CitizenId") - .HasColumnType("longtext"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(100) - .HasComment("สร้างข้อมูลเมื่อ"); - - b.Property("CreatedFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(104) - .HasComment("ชื่อ User ที่สร้างข้อมูล"); - - b.Property("CreatedUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(101) - .HasComment("User Id ที่สร้างข้อมูล"); - - b.Property("FirstName") - .HasColumnType("longtext"); - - b.Property("Gender") - .HasColumnType("longtext"); - - b.Property("IsLocationCheckIn") - .HasColumnType("tinyint(1)") - .HasComment("true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-In"); - - b.Property("IsLocationCheckOut") - .HasColumnType("tinyint(1)") - .HasComment("true คือ ณ สถานที่ตั้ง, false คือ นอกสถานที่ตั้ง Check-Out"); - - b.Property("IsProcess") - .HasColumnType("tinyint(1)") - .HasComment("นำไปประมวลผลแล้วหรือยัง"); - - b.Property("KeycloakUserId") - .HasColumnType("char(36)") - .HasComment("รหัส User ของ Keycloak"); - - b.Property("LastName") - .HasColumnType("longtext"); - - b.Property("LastUpdateFullName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasColumnOrder(105) - .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdateUserId") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("varchar(40)") - .HasColumnOrder(103) - .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); - - b.Property("LastUpdatedAt") - .HasColumnType("datetime(6)") - .HasColumnOrder(102) - .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - - b.Property("Prefix") - .HasColumnType("longtext"); - - b.Property("ProfileId") - .HasColumnType("char(36)"); - - b.Property("ProfileType") - .HasColumnType("longtext"); - - b.Property("Root") - .HasColumnType("longtext"); - - b.Property("RootDnaId") - .HasColumnType("char(36)"); - - b.Property("RootId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.ToTable("UserTimeStamps"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.Requests.LeaveBeginning", b => - { - b.HasOne("BMA.EHR.Domain.Models.Leave.Commons.LeaveType", "LeaveType") - .WithMany() - .HasForeignKey("LeaveTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("LeaveType"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.Requests.LeaveDocument", b => - { - b.HasOne("BMA.EHR.Domain.Models.Documents.Document", "Document") - .WithMany() - .HasForeignKey("DocumentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("BMA.EHR.Domain.Models.Leave.Requests.LeaveRequest", "LeaveRequest") - .WithMany("LeaveDocument") - .HasForeignKey("LeaveRequestId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Document"); - - b.Navigation("LeaveRequest"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.Requests.LeaveRequest", b => - { - b.HasOne("BMA.EHR.Domain.Models.Documents.Document", "LeaveCancelDocument") - .WithMany() - .HasForeignKey("LeaveCancelDocumentId"); - - b.HasOne("BMA.EHR.Domain.Models.Documents.Document", "LeaveDraftDocument") - .WithMany() - .HasForeignKey("LeaveDraftDocumentId"); - - b.HasOne("BMA.EHR.Domain.Models.Leave.Commons.LeaveType", "Type") - .WithMany() - .HasForeignKey("TypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("LeaveCancelDocument"); - - b.Navigation("LeaveDraftDocument"); - - b.Navigation("Type"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.Requests.LeaveRequestApprover", b => - { - b.HasOne("BMA.EHR.Domain.Models.Leave.Requests.LeaveRequest", "LeaveRequest") - .WithMany("Approvers") - .HasForeignKey("LeaveRequestId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("LeaveRequest"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.TimeAttendants.UserDutyTime", b => - { - b.HasOne("BMA.EHR.Domain.Models.Leave.TimeAttendants.DutyTime", "DutyTime") - .WithMany() - .HasForeignKey("DutyTimeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("DutyTime"); - }); - - modelBuilder.Entity("BMA.EHR.Domain.Models.Leave.Requests.LeaveRequest", b => - { - b.Navigation("Approvers"); - - b.Navigation("LeaveDocument"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/BMA.EHR.Infrastructure/Migrations/LeaveDb/20260505035145_Change Field.cs b/BMA.EHR.Infrastructure/Migrations/LeaveDb/20260505035145_Change Field.cs deleted file mode 100644 index a6ffb9e4..00000000 --- a/BMA.EHR.Infrastructure/Migrations/LeaveDb/20260505035145_Change Field.cs +++ /dev/null @@ -1,62 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace BMA.EHR.Infrastructure.Migrations.LeaveDb -{ - /// - public partial class ChangeField : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "LeaveDaysUsed", - table: "LeaveBeginnings", - type: "double", - nullable: true, - comment: "จำนวนวันลาที่ใช้ไป", - oldClrType: typeof(double), - oldType: "double", - oldComment: "จำนวนวันลาที่ใช้ไป"); - - migrationBuilder.AlterColumn( - name: "LeaveCount", - table: "LeaveBeginnings", - type: "int", - nullable: true, - comment: "จำนวนครั้งที่ลาสะสม", - oldClrType: typeof(int), - oldType: "int", - oldComment: "จำนวนครั้งที่ลาสะสม"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "LeaveDaysUsed", - table: "LeaveBeginnings", - type: "double", - nullable: false, - defaultValue: 0.0, - comment: "จำนวนวันลาที่ใช้ไป", - oldClrType: typeof(double), - oldType: "double", - oldNullable: true, - oldComment: "จำนวนวันลาที่ใช้ไป"); - - migrationBuilder.AlterColumn( - name: "LeaveCount", - table: "LeaveBeginnings", - type: "int", - nullable: false, - defaultValue: 0, - comment: "จำนวนครั้งที่ลาสะสม", - oldClrType: typeof(int), - oldType: "int", - oldNullable: true, - oldComment: "จำนวนครั้งที่ลาสะสม"); - } - } -} diff --git a/BMA.EHR.Infrastructure/Migrations/LeaveDb/LeaveDbContextModelSnapshot.cs b/BMA.EHR.Infrastructure/Migrations/LeaveDb/LeaveDbContextModelSnapshot.cs index eb04cfc2..887d4f97 100644 --- a/BMA.EHR.Infrastructure/Migrations/LeaveDb/LeaveDbContextModelSnapshot.cs +++ b/BMA.EHR.Infrastructure/Migrations/LeaveDb/LeaveDbContextModelSnapshot.cs @@ -192,7 +192,7 @@ namespace BMA.EHR.Infrastructure.Migrations.LeaveDb .HasColumnOrder(102) .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - b.Property("LeaveCount") + b.Property("LeaveCount") .HasColumnType("int") .HasComment("จำนวนครั้งที่ลาสะสม"); @@ -200,7 +200,7 @@ namespace BMA.EHR.Infrastructure.Migrations.LeaveDb .HasColumnType("double") .HasComment("จำนวนวันลาทั้งหมด"); - b.Property("LeaveDaysUsed") + b.Property("LeaveDaysUsed") .HasColumnType("double") .HasComment("จำนวนวันลาที่ใช้ไป"); diff --git a/BMA.EHR.Leave/Controllers/LeaveBeginningController.cs b/BMA.EHR.Leave/Controllers/LeaveBeginningController.cs index a71ef428..e580b00a 100644 --- a/BMA.EHR.Leave/Controllers/LeaveBeginningController.cs +++ b/BMA.EHR.Leave/Controllers/LeaveBeginningController.cs @@ -33,7 +33,6 @@ namespace BMA.EHR.Leave.Service.Controllers private readonly IConfiguration _configuration; private readonly UserProfileRepository _userProfileRepository; private readonly PermissionRepository _permission; - private readonly LeaveRequestRepository _leaveRequestRepository; #endregion @@ -45,8 +44,7 @@ namespace BMA.EHR.Leave.Service.Controllers IWebHostEnvironment hostingEnvironment, IConfiguration configuration, UserProfileRepository userProfileRepository, - PermissionRepository permission, - LeaveRequestRepository leaveRequestRepository) + PermissionRepository permission) { _leaveBeginningRepository = leaveBeginningRepository; _context = context; @@ -55,7 +53,6 @@ namespace BMA.EHR.Leave.Service.Controllers _configuration = configuration; _userProfileRepository = userProfileRepository; _permission = permission; - _leaveRequestRepository = leaveRequestRepository; } #endregion @@ -395,35 +392,14 @@ namespace BMA.EHR.Leave.Service.Controllers { return Error("ไม่พบข้อมูลข้าราชการหรือลูกจ้าง", StatusCodes.Status404NotFound); } - - var startFiscalDate = new DateTime(DateTime.Now.Year - 1, 10, 1); - var endFiscalDate = new DateTime(DateTime.Now.Year, 9, 30); - - if (req.LeaveDaysUsed is null || req.LeaveCount is null) - { - var systemLeaveDays = await _leaveRequestRepository.GetSumApproveLeaveTotalByTypeAndRangeForUser2(profile.Keycloak ?? Guid.Empty, req.LeaveTypeId, startFiscalDate, endFiscalDate); - var systemLeaveCount = await _leaveRequestRepository.GetSumApproveLeaveCountByTypeAndRangeForUser2(profile.Keycloak ?? Guid.Empty, req.LeaveTypeId, startFiscalDate, endFiscalDate); - - leaveBeginning.LeaveDaysUsed = req.BeginningLeaveDays + systemLeaveDays; - leaveBeginning.LeaveCount = req.BeginningLeaveCount + systemLeaveCount; - - leaveBeginning.BeginningLeaveDays = req.BeginningLeaveDays; - leaveBeginning.BeginningLeaveCount = req.BeginningLeaveCount; - } - else - { - leaveBeginning.LeaveDaysUsed = req.LeaveDaysUsed; - leaveBeginning.LeaveCount = req.LeaveCount; - leaveBeginning.BeginningLeaveDays = req.BeginningLeaveDays; - leaveBeginning.BeginningLeaveCount = req.BeginningLeaveCount; - //var systemLeaveDays = await _leaveRequestRepository.GetSumApproveLeaveTotalByTypeAndRangeForUser2(profile.Keycloak ?? Guid.Empty, req.LeaveTypeId, startFiscalDate, endFiscalDate); - //var systemLeaveCount = await _leaveRequestRepository.GetSumApproveLeaveCountByTypeAndRangeForUser2(profile.Keycloak ?? Guid.Empty, req.LeaveTypeId, startFiscalDate, endFiscalDate); - } leaveBeginning.LeaveTypeId = req.LeaveTypeId; leaveBeginning.LeaveYear = req.LeaveYear; leaveBeginning.LeaveDays = req.LeaveDays; - + leaveBeginning.LeaveDaysUsed = req.LeaveDaysUsed; + leaveBeginning.LeaveCount = req.LeaveCount; + leaveBeginning.BeginningLeaveDays = req.BeginningLeaveDays; + leaveBeginning.BeginningLeaveCount = req.BeginningLeaveCount; leaveBeginning.ProfileId = req.ProfileId; leaveBeginning.Prefix = profile.Prefix; @@ -488,26 +464,13 @@ namespace BMA.EHR.Leave.Service.Controllers } var leaveBeginning = new LeaveBeginning(); - - if (req.LeaveDaysUsed is null || req.LeaveCount is null) - { - leaveBeginning.LeaveDaysUsed = req.BeginningLeaveDays; - leaveBeginning.LeaveCount = req.BeginningLeaveCount; - leaveBeginning.BeginningLeaveDays = req.BeginningLeaveDays; - leaveBeginning.BeginningLeaveCount = req.BeginningLeaveCount; - } - else - { - leaveBeginning.LeaveDaysUsed = req.LeaveDaysUsed; - leaveBeginning.LeaveCount = req.LeaveCount; - leaveBeginning.BeginningLeaveDays = req.BeginningLeaveDays; - leaveBeginning.BeginningLeaveCount = req.BeginningLeaveCount; - } - leaveBeginning.LeaveTypeId = req.LeaveTypeId; leaveBeginning.LeaveYear = req.LeaveYear; leaveBeginning.LeaveDays = req.LeaveDays; - + leaveBeginning.LeaveDaysUsed = req.LeaveDaysUsed; + leaveBeginning.LeaveCount = req.LeaveCount; + leaveBeginning.BeginningLeaveDays = req.BeginningLeaveDays; + leaveBeginning.BeginningLeaveCount = req.BeginningLeaveCount; leaveBeginning.ProfileId = req.ProfileId; leaveBeginning.Prefix = profile.Prefix; diff --git a/BMA.EHR.Leave/Controllers/LeaveController.cs b/BMA.EHR.Leave/Controllers/LeaveController.cs index 91289743..01da5781 100644 --- a/BMA.EHR.Leave/Controllers/LeaveController.cs +++ b/BMA.EHR.Leave/Controllers/LeaveController.cs @@ -3010,8 +3010,6 @@ namespace BMA.EHR.Leave.Service.Controllers [ProducesResponseType(StatusCodes.Status500InternalServerError)] public async Task> CheckoutCheckAsync(string isSeminar = "N") { - // "S" = Seminar, "N" = Normal, "O" = One Stop Service - var time = DateTime.Now; var userId = UserId != null ? Guid.Parse(UserId) : Guid.Empty; @@ -3043,11 +3041,9 @@ namespace BMA.EHR.Leave.Service.Controllers //var endTime = DateTimeOffset.Parse($"{DateTime.Now.Date.ToString("yyyy-MM-dd")}T{duty.EndTimeAfternoon}:00.0000000+07:00").ToLocalTime().DateTime; - //var endTime = DateTime.Parse($"{DateTime.Now.Date.ToString("yyyy-MM-dd")}T{duty.EndTimeAfternoon}:00.0000000+07:00"); - var endTime = isSeminar.Trim().ToUpper() == "S" +  //var endTime = DateTime.Parse($"{DateTime.Now.Date.ToString("yyyy-MM-dd")}T{duty.EndTimeAfternoon}:00.0000000+07:00"); + var endTime = isSeminar.Trim().ToUpper() == "Y" ? DateTime.Parse($"{DateTime.Now.Date.ToString("yyyy-MM-dd")} 14:30") - : isSeminar.Trim().ToUpper() == "O" - ? DateTime.Parse($"{DateTime.Now.Date.ToString("yyyy-MM-dd")} 18:30") : DateTime.Parse($"{DateTime.Now.Date.ToString("yyyy-MM-dd")} {duty.EndTimeAfternoon}"); var endTimeMorning = DateTime.Parse($"{DateTime.Now.Date.ToString("yyyy-MM-dd")} {duty.EndTimeMorning}"); diff --git a/BMA.EHR.Leave/Controllers/LeaveRequestController.cs b/BMA.EHR.Leave/Controllers/LeaveRequestController.cs index 93c0b1f8..9ba54be1 100644 --- a/BMA.EHR.Leave/Controllers/LeaveRequestController.cs +++ b/BMA.EHR.Leave/Controllers/LeaveRequestController.cs @@ -943,8 +943,8 @@ namespace BMA.EHR.Leave.Service.Controllers OrganizationName = orgName, //profile.Oc ?? "", LeaveLimit = leaveLimit, // จำนวนวันลาทั้งหมดในปีนั้นๆที่ลาได้ โดยรวมยอดที่เหลือจากปีก่อนมา (เอาค่ามาจากตาราง Beginning เลย) - LeaveTotal = sumLeave ?? 0, // จำนวนวันลาที่ลาไปแล้วในปีนั้นๆ โดยเมื่อมีการอนุมัติลา จะมาบวกค่านี้ไปเรื่อยๆ (เอาค่ามาจากตาราง Beginning เลย) - LeaveRemain = leaveLimit - (sumLeave ?? 0), + LeaveTotal = sumLeave, // จำนวนวันลาที่ลาไปแล้วในปีนั้นๆ โดยเมื่อมีการอนุมัติลา จะมาบวกค่านี้ไปเรื่อยๆ (เอาค่ามาจากตาราง Beginning เลย) + LeaveRemain = leaveLimit - sumLeave, RestDayTotalOld = restOldDay, // เอา leaveLimit มาลบ 10 (LV-005) RestDayTotalCurrent = restCurrentDay,// 10 วันเสมอ (LV-005) BirthDate = profile.BirthDate.Date, diff --git a/BMA.EHR.Leave/DTOs/LeaveBeginnings/EditLeaveBeginningDto.cs b/BMA.EHR.Leave/DTOs/LeaveBeginnings/EditLeaveBeginningDto.cs index 28c2686a..524072ec 100644 --- a/BMA.EHR.Leave/DTOs/LeaveBeginnings/EditLeaveBeginningDto.cs +++ b/BMA.EHR.Leave/DTOs/LeaveBeginnings/EditLeaveBeginningDto.cs @@ -17,16 +17,16 @@ namespace BMA.EHR.Leave.Service.DTOs.LeaveBeginnings [Required, Comment("จำนวนวันลายกมา")] public double LeaveDays { get; set; } = 0.0; - [Comment("จำนวนวันลาที่ใช้ไป")] - public double? LeaveDaysUsed { get; set; } = 0.0; + [Required, Comment("จำนวนวันลาที่ใช้ไป")] + public double LeaveDaysUsed { get; set; } = 0.0; - [Comment("จำนวนครั้งที่ลาสะสม")] - public int? LeaveCount { get; set; } = 0; + [Required, Comment("จำนวนครั้งที่ลาสะสม")] + public int LeaveCount { get; set; } = 0; - [Required, Comment("จำนวนวันลายกมาก่อนใช้ระบบ")] + [Required, Comment("จำนวนวันลายกมา")] public double BeginningLeaveDays { get; set; } = 0.0; - [Comment("จำนวนครั้งที่ลายกมาก่อนใช้ระบบ")] + [Comment("จำนวนครั้งที่ลายกมา")] public int BeginningLeaveCount { get; set; } = 0; }