From 2deb2927a6554228da822e28bf82b8024df696f3 Mon Sep 17 00:00:00 2001 From: harid Date: Tue, 10 Mar 2026 13:44:50 +0700 Subject: [PATCH] =?UTF-8?q?Migrate=20=E0=B9=80=E0=B8=9E=E0=B8=B4=E0=B9=88?= =?UTF-8?q?=E0=B8=A1=E0=B8=9F=E0=B8=B4=E0=B8=A5=E0=B8=94=E0=B9=8C=E0=B8=AA?= =?UTF-8?q?=E0=B8=96=E0=B8=B2=E0=B8=99=E0=B8=B0=E0=B8=84=E0=B8=B1=E0=B8=94?= =?UTF-8?q?=E0=B8=81=E0=B8=A3=E0=B8=AD=E0=B8=87=E0=B8=84=E0=B8=B8=E0=B8=93?= =?UTF-8?q?=E0=B8=AA=E0=B8=A1=E0=B8=9A=E0=B8=B1=E0=B8=95=E0=B8=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Controllers/RecruitController.cs | 33 +- ...tScore_add_field_ExamAttribute.Designer.cs | 1607 +++++++++++++++++ ...le_RecruitScore_add_field_ExamAttribute.cs | 32 + .../ApplicationDbContextModelSnapshot.cs | 6 + Models/Recruits/RecruitScore.cs | 3 + 5 files changed, 1671 insertions(+), 10 deletions(-) create mode 100644 Migrations/20260310063204_update_table_RecruitScore_add_field_ExamAttribute.Designer.cs create mode 100644 Migrations/20260310063204_update_table_RecruitScore_add_field_ExamAttribute.cs diff --git a/Controllers/RecruitController.cs b/Controllers/RecruitController.cs index 826b208..1fd405e 100644 --- a/Controllers/RecruitController.cs +++ b/Controllers/RecruitController.cs @@ -1418,7 +1418,7 @@ namespace BMA.EHR.Recruit.Service.Controllers // ใช้ dictionary lookup แทน query DB ทีละรอบ if (!string.IsNullOrEmpty(r.ExamId) && recruitsDict.TryGetValue(r.ExamId, out var recruit)) { - r.CitizenId = workSheet?.Cells[row, 3]?.GetValue(); + r.CitizenId = workSheet?.Cells[row, 3]?.GetValue()?.Trim(); // ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง r.FullA = 200; @@ -1457,6 +1457,9 @@ namespace BMA.EHR.Recruit.Service.Controllers } r.RemarkScore = string.IsNullOrWhiteSpace(workSheet?.Cells[row, 15]?.GetValue()) ? string.Empty : workSheet?.Cells[row, 15]?.GetValue(); + + r.ExamAttribute = (workSheet?.Cells[row, 16]?.GetValue()?.Trim() == "ผ่าน") ? "มีคุณสมบัติ" : "ไม่มีคุณสมบัติ"; + r.Major = workSheet.Name; r.CreatedAt = DateTime.Now; @@ -2036,10 +2039,15 @@ namespace BMA.EHR.Recruit.Service.Controllers : "", examScore = x.score == null ? 0.0 : x.score.TotalScore, examResult = x.score == null ? "" : x.score.ExamStatus, - examAttribute = x.recruit.Certificates.Any() && x.recruit.Certificates.First().IssueDate != null - ? _recruitService.CheckValidCertificate(x.recruit.Certificates.First().IssueDate, 5) - ? "มีคุณสมบัติ" : "ไม่มีคุณสมบัติ" - : "ไม่มีคุณสมบัติ", + // examAttribute = x.recruit.Certificates.Any() && x.recruit.Certificates.First().IssueDate != null + // ? _recruitService.CheckValidCertificate(x.recruit.Certificates.First().IssueDate, 5) + // ? "มีคุณสมบัติ" : "ไม่มีคุณสมบัติ" + // : "ไม่มีคุณสมบัติ", + examAttribute = x.score == null + ? "ไม่มีคุณสมบัติ" + : string.IsNullOrEmpty(x.score.ExamAttribute) + ? "ไม่มีคุณสมบัติ" + : x.score.ExamAttribute, remark = x.recruit.Remark, isSpecial = x.recruit.Isspecial == "Y" ? x.recruit.Isspecial : "", applyDate = x.recruit.ApplyDate.HasValue && x.recruit.ApplyDate.Value != DateTime.MinValue @@ -2170,11 +2178,16 @@ namespace BMA.EHR.Recruit.Service.Controllers : "" : "", ExamResult = sr == null ? "" : sr.ExamStatus, - ExamAttribute = p.Certificates.Count > 0 ? - _recruitService.CheckValidCertificate(p.Certificates.First().IssueDate, 5) - ? "มีคุณสมบัติ" - : "ไม่มีคุณสมบัติ" - : "ไม่มีคุณสมบัติ", + // ExamAttribute = p.Certificates.Count > 0 ? + // _recruitService.CheckValidCertificate(p.Certificates.First().IssueDate, 5) + // ? "มีคุณสมบัติ" + // : "ไม่มีคุณสมบัติ" + // : "ไม่มีคุณสมบัติ", + ExamAttribute = sr == null + ? "ไม่มีคุณสมบัติ" + : string.IsNullOrEmpty(sr.ExamAttribute) + ? "ไม่มีคุณสมบัติ" + : sr.ExamAttribute, IsSpecial = p.Isspecial, Remark = p.Remark, University = p.Educations.First().University, diff --git a/Migrations/20260310063204_update_table_RecruitScore_add_field_ExamAttribute.Designer.cs b/Migrations/20260310063204_update_table_RecruitScore_add_field_ExamAttribute.Designer.cs new file mode 100644 index 0000000..f2c08d3 --- /dev/null +++ b/Migrations/20260310063204_update_table_RecruitScore_add_field_ExamAttribute.Designer.cs @@ -0,0 +1,1607 @@ +// +using System; +using BMA.EHR.Recruit.Service.Data; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace BMA.EHR.Recruit.Service.Migrations +{ + [DbContext(typeof(ApplicationDbContext))] + [Migration("20260310063204_update_table_RecruitScore_add_field_ExamAttribute")] + partial class update_table_RecruitScore_add_field_ExamAttribute + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "7.0.3") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("BMA.EHR.Recruit.Service.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("Documents"); + }); + + modelBuilder.Entity("BMA.EHR.Recruit.Service.Models.Recruits.Recruit", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("ApplyDate") + .HasColumnType("datetime(6)"); + + b.Property("CitizenCardExpireDate") + .HasColumnType("datetime(6)"); + + b.Property("CitizenCardIssuer") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("CitizenId") + .IsRequired() + .HasMaxLength(13) + .HasColumnType("varchar(13)") + .HasComment("เลขประจำตัวประชาชน"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedDate") + .HasColumnType("datetime(6)"); + + 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("DateOfBirth") + .HasColumnType("datetime(6)"); + + b.Property("ExamId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("varchar(150)"); + + b.Property("Gendor") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("varchar(20)"); + + b.Property("HddPosition") + .HasColumnType("longtext") + .HasComment("บัญชีสอบ"); + + b.Property("Isspecial") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("varchar(1)"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("varchar(150)"); + + 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("Marry") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("varchar(20)"); + + b.Property("ModifiedDate") + .HasColumnType("datetime(6)"); + + b.Property("National") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("PositionLevel") + .HasColumnType("longtext"); + + b.Property("PositionName") + .HasColumnType("longtext"); + + b.Property("PositionType") + .HasColumnType("longtext"); + + b.Property("Prefix") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("Qualified") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("varchar(1)"); + + b.Property("Race") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("RecruitImportId") + .HasColumnType("char(36)"); + + b.Property("RefNo") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("varchar(20)"); + + b.Property("Religion") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Remark") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("typeTest") + .HasColumnType("longtext") + .HasComment("ประเภทการสอบภาค ก."); + + b.HasKey("Id"); + + b.HasIndex("RecruitImportId"); + + b.ToTable("Recruits"); + }); + + modelBuilder.Entity("BMA.EHR.Recruit.Service.Models.Recruits.RecruitAddress", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("Address") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Address1") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Amphur") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Amphur1") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + 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("District") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("District1") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + 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("Mobile") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Moo") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Moo1") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Province") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Province1") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("RecruitId") + .HasColumnType("char(36)"); + + b.Property("Road") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Road1") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Soi") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Soi1") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Telephone") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ZipCode") + .IsRequired() + .HasMaxLength(5) + .HasColumnType("varchar(5)"); + + b.Property("ZipCode1") + .IsRequired() + .HasMaxLength(5) + .HasColumnType("varchar(5)"); + + b.HasKey("Id"); + + b.HasIndex("RecruitId"); + + b.ToTable("RecruitAddresses"); + }); + + modelBuilder.Entity("BMA.EHR.Recruit.Service.Models.Recruits.RecruitCertificate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CertificateNo") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + 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() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ExpiredDate") + .HasColumnType("datetime(6)"); + + b.Property("IssueDate") + .HasColumnType("datetime(6)"); + + 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("RecruitId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("RecruitId"); + + b.ToTable("RecruitCertificates"); + }); + + modelBuilder.Entity("BMA.EHR.Recruit.Service.Models.Recruits.RecruitDocument", 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("CreatedDate") + .HasColumnType("datetime(6)"); + + 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("DocumentFileId") + .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("RecruitId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("DocumentFileId"); + + b.HasIndex("RecruitId"); + + b.ToTable("RecruitDocuments"); + }); + + modelBuilder.Entity("BMA.EHR.Recruit.Service.Models.Recruits.RecruitEducation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("BachelorDate") + .HasColumnType("datetime(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("Degree") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("GPA") + .HasColumnType("double"); + + b.Property("HighDegree") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + 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("Major") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("MajorGroupId") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("varchar(20)"); + + b.Property("MajorGroupName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("RecruitId") + .HasColumnType("char(36)"); + + b.Property("Specialist") + .IsRequired() + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("University") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("Id"); + + b.HasIndex("RecruitId"); + + b.ToTable("RecruitEducations"); + }); + + modelBuilder.Entity("BMA.EHR.Recruit.Service.Models.Recruits.RecruitImport", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("AnnouncementDate") + .HasColumnType("datetime(6)") + .HasColumnOrder(14) + .HasComment("วันที่ประกาศผลสอบ"); + + b.Property("AnnouncementEndDate") + .HasColumnType("datetime(6)") + .HasColumnOrder(7) + .HasComment("วันสิ้นสุดประกาศ"); + + b.Property("AnnouncementStartDate") + .HasColumnType("datetime(6)") + .HasColumnOrder(6) + .HasComment("วันเริ่มประกาศ"); + + b.Property("AuthName") + .HasColumnType("longtext"); + + b.Property("AuthPosition") + .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("Detail") + .HasColumnType("longtext") + .HasColumnOrder(4) + .HasComment("รายละเอียด"); + + b.Property("ExamDate") + .HasColumnType("datetime(6)") + .HasColumnOrder(12) + .HasComment("วันที่สอบ"); + + b.Property("Fee") + .HasColumnType("int") + .HasColumnOrder(5) + .HasComment("ค่าธรรมเนียม"); + + b.Property("ImportFileId") + .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("Name") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("varchar(250)") + .HasColumnOrder(2) + .HasComment("รอบการสอบ"); + + b.Property("Note") + .HasColumnType("text") + .HasColumnOrder(13) + .HasComment("หมายเหตุ"); + + b.Property("Order") + .HasColumnType("int") + .HasColumnOrder(3) + .HasComment("ครั้งที่"); + + b.Property("PaymentEndDate") + .HasColumnType("datetime(6)") + .HasColumnOrder(9) + .HasComment("วันสิ้นสุดชำระเงิน"); + + b.Property("PaymentStartDate") + .HasColumnType("datetime(6)") + .HasColumnOrder(8) + .HasComment("วันเริ่มชำระเงิน"); + + b.Property("RegisterEndDate") + .HasColumnType("datetime(6)") + .HasColumnOrder(11) + .HasComment("วันสิ้นสุดสมัครสอบ"); + + b.Property("RegisterStartDate") + .HasColumnType("datetime(6)") + .HasColumnOrder(10) + .HasComment("วันเริ่มสมัครสอบ"); + + b.Property("Year") + .HasColumnType("int") + .HasColumnOrder(1) + .HasComment("ปีงบประมาณที่จัดสอบ"); + + b.HasKey("Id"); + + b.HasIndex("ImportFileId"); + + b.ToTable("RecruitImports"); + }); + + modelBuilder.Entity("BMA.EHR.Recruit.Service.Models.Recruits.RecruitImportDocument", 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)") + .HasComment("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("RecruitImportId") + .HasColumnType("char(36)") + .HasComment("Id รอบสมัครสอบ"); + + b.HasKey("Id"); + + b.HasIndex("DocumentId"); + + b.HasIndex("RecruitImportId"); + + b.ToTable("RecruitImportDocuments"); + }); + + modelBuilder.Entity("BMA.EHR.Recruit.Service.Models.Recruits.RecruitImportHistory", 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") + .HasColumnOrder(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("RecruitImportId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("RecruitImportId"); + + b.ToTable("RecruitImportHistories"); + }); + + modelBuilder.Entity("BMA.EHR.Recruit.Service.Models.Recruits.RecruitImportImage", 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)") + .HasComment("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("RecruitImportId") + .HasColumnType("char(36)") + .HasComment("Id รอบสมัครสอบ"); + + b.HasKey("Id"); + + b.HasIndex("DocumentId"); + + b.HasIndex("RecruitImportId"); + + b.ToTable("RecruitImportImages"); + }); + + modelBuilder.Entity("BMA.EHR.Recruit.Service.Models.Recruits.RecruitOccupation", 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("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("Occupation") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Position") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("RecruitId") + .HasColumnType("char(36)"); + + b.Property("Telephone") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("WorkAge") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Workplace") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("Id"); + + b.HasIndex("RecruitId"); + + b.ToTable("RecruitOccupations"); + }); + + modelBuilder.Entity("BMA.EHR.Recruit.Service.Models.Recruits.RecruitPayment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("AccountNumber") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("Amount") + .HasColumnType("decimal(65,30)"); + + b.Property("BankCode") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("ChequeNo") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("ChqueBankCode") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("CompanyCode") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + 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("CreditDebit") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("CustomerName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + 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("PaymentId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("PaymentType") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("RecruitId") + .HasColumnType("char(36)"); + + b.Property("RefNo1") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("TellerId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("TermBranch") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("TextFile") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("TransDate") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("TransTime") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.HasKey("Id"); + + b.HasIndex("RecruitId"); + + b.ToTable("RecruitPayments"); + }); + + modelBuilder.Entity("BMA.EHR.Recruit.Service.Models.Recruits.RecruitScore", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("ABStatus") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasComment("ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง ผลประเมิน"); + + b.Property("AStatus") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasComment("ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง ผลประเมิน"); + + b.Property("BStatus") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("CStatus") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasComment("ภาคความเหมาะสมกับตำแหน่ง ผลประเมิน"); + + b.Property("CitizenId") + .IsRequired() + .HasMaxLength(13) + .HasColumnType("varchar(13)") + .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("ExamAttribute") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasComment("สถานะคัดกรองคุณสมบัติ"); + + b.Property("ExamId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasComment("เลขประจำตัวสอบ"); + + b.Property("ExamStatus") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasComment("สอบได้ / ตก / ขาดสอบ"); + + b.Property("FullA") + .HasColumnType("int") + .HasComment("ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง คะแนนเต็ม"); + + b.Property("FullB") + .HasColumnType("int"); + + b.Property("FullC") + .HasColumnType("int") + .HasComment("ภาคความเหมาะสมกับตำแหน่ง ทดสอบสมรรถนะ+ทดสอบจิตวิทยาฯ คะแนนเต็ม"); + + b.Property("FullD") + .HasColumnType("int") + .HasComment("ภาคความเหมาะสมกับตำแหน่ง สัมภาษณ์ คะแนนเต็ม"); + + b.Property("FullScore") + .HasColumnType("int") + .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("Major") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("ลำดับที่สอบได้"); + + b.Property("PercentageA") + .HasColumnType("double") + .HasComment("ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง ร้อยละ"); + + b.Property("PercentageB") + .HasColumnType("double"); + + b.Property("PercentageC") + .HasColumnType("double") + .HasComment("ภาคความเหมาะสมกับตำแหน่ง ร้อยละ"); + + b.Property("RemarkExamOrder") + .IsRequired() + .HasColumnType("longtext") + .HasComment("หมายเหตุจากลำดับที่สอบได้"); + + b.Property("RemarkScore") + .IsRequired() + .HasColumnType("longtext") + .HasComment("หมายเหตุจากบัญชีรวมคะแนน"); + + b.Property("ScoreImportId") + .HasColumnType("char(36)"); + + b.Property("SumA") + .HasColumnType("double") + .HasComment("ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง คะแนนรวม"); + + b.Property("SumAB") + .HasColumnType("double") + .HasComment("ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง คะแนนรวม"); + + b.Property("SumB") + .HasColumnType("double"); + + b.Property("SumC") + .HasColumnType("double") + .HasComment("ภาคความเหมาะสมกับตำแหน่ง ทดสอบสมรรถนะ+ทดสอบจิตวิทยาฯ คะแนนรวม"); + + b.Property("SumCD") + .HasColumnType("double") + .HasComment("ภาคความเหมาะสมกับตำแหน่ง คะแนนรวมทดสอบสมรรถนะ+ทดสอบจิตวิทยาฯ และสัมภาษณ์"); + + b.Property("SumD") + .HasColumnType("double") + .HasComment("ภาคความเหมาะสมกับตำแหน่ง สัมภาษณ์ คะแนนรวม"); + + b.Property("TotalScore") + .HasColumnType("double") + .HasComment("คะแนนรวม"); + + b.HasKey("Id"); + + b.HasIndex("ScoreImportId"); + + b.ToTable("RecruitScores"); + }); + + modelBuilder.Entity("BMA.EHR.Recruit.Service.Models.Recruits.ScoreImport", 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("ImportFileId") + .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("RecruitImportId") + .HasColumnType("char(36)"); + + b.Property("Year") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ImportFileId"); + + b.HasIndex("RecruitImportId") + .IsUnique(); + + b.ToTable("ScoreImports"); + }); + + modelBuilder.Entity("BMA.EHR.Recruit.Service.Models.Recruits.Recruit", b => + { + b.HasOne("BMA.EHR.Recruit.Service.Models.Recruits.RecruitImport", "RecruitImport") + .WithMany("Recruits") + .HasForeignKey("RecruitImportId") + .OnDelete(DeleteBehavior.Cascade); + + b.Navigation("RecruitImport"); + }); + + modelBuilder.Entity("BMA.EHR.Recruit.Service.Models.Recruits.RecruitAddress", b => + { + b.HasOne("BMA.EHR.Recruit.Service.Models.Recruits.Recruit", "Recruit") + .WithMany("Addresses") + .HasForeignKey("RecruitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Recruit"); + }); + + modelBuilder.Entity("BMA.EHR.Recruit.Service.Models.Recruits.RecruitCertificate", b => + { + b.HasOne("BMA.EHR.Recruit.Service.Models.Recruits.Recruit", "Recruit") + .WithMany("Certificates") + .HasForeignKey("RecruitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Recruit"); + }); + + modelBuilder.Entity("BMA.EHR.Recruit.Service.Models.Recruits.RecruitDocument", b => + { + b.HasOne("BMA.EHR.Recruit.Service.Models.Documents.Document", "DocumentFile") + .WithMany() + .HasForeignKey("DocumentFileId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Recruit.Service.Models.Recruits.Recruit", "Recruit") + .WithMany("Documents") + .HasForeignKey("RecruitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DocumentFile"); + + b.Navigation("Recruit"); + }); + + modelBuilder.Entity("BMA.EHR.Recruit.Service.Models.Recruits.RecruitEducation", b => + { + b.HasOne("BMA.EHR.Recruit.Service.Models.Recruits.Recruit", "Recruit") + .WithMany("Educations") + .HasForeignKey("RecruitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Recruit"); + }); + + modelBuilder.Entity("BMA.EHR.Recruit.Service.Models.Recruits.RecruitImport", b => + { + b.HasOne("BMA.EHR.Recruit.Service.Models.Documents.Document", "ImportFile") + .WithMany() + .HasForeignKey("ImportFileId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ImportFile"); + }); + + modelBuilder.Entity("BMA.EHR.Recruit.Service.Models.Recruits.RecruitImportDocument", b => + { + b.HasOne("BMA.EHR.Recruit.Service.Models.Documents.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Recruit.Service.Models.Recruits.RecruitImport", "RecruitImport") + .WithMany("RecruitDocuments") + .HasForeignKey("RecruitImportId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Document"); + + b.Navigation("RecruitImport"); + }); + + modelBuilder.Entity("BMA.EHR.Recruit.Service.Models.Recruits.RecruitImportHistory", b => + { + b.HasOne("BMA.EHR.Recruit.Service.Models.Recruits.RecruitImport", "RecruitImport") + .WithMany("ImportHostories") + .HasForeignKey("RecruitImportId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("RecruitImport"); + }); + + modelBuilder.Entity("BMA.EHR.Recruit.Service.Models.Recruits.RecruitImportImage", b => + { + b.HasOne("BMA.EHR.Recruit.Service.Models.Documents.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Recruit.Service.Models.Recruits.RecruitImport", "RecruitImport") + .WithMany("RecruitImages") + .HasForeignKey("RecruitImportId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Document"); + + b.Navigation("RecruitImport"); + }); + + modelBuilder.Entity("BMA.EHR.Recruit.Service.Models.Recruits.RecruitOccupation", b => + { + b.HasOne("BMA.EHR.Recruit.Service.Models.Recruits.Recruit", "Recruit") + .WithMany("Occupations") + .HasForeignKey("RecruitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Recruit"); + }); + + modelBuilder.Entity("BMA.EHR.Recruit.Service.Models.Recruits.RecruitPayment", b => + { + b.HasOne("BMA.EHR.Recruit.Service.Models.Recruits.Recruit", "Recruit") + .WithMany("Payments") + .HasForeignKey("RecruitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Recruit"); + }); + + modelBuilder.Entity("BMA.EHR.Recruit.Service.Models.Recruits.RecruitScore", b => + { + b.HasOne("BMA.EHR.Recruit.Service.Models.Recruits.ScoreImport", "ScoreImport") + .WithMany("Scores") + .HasForeignKey("ScoreImportId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ScoreImport"); + }); + + modelBuilder.Entity("BMA.EHR.Recruit.Service.Models.Recruits.ScoreImport", b => + { + b.HasOne("BMA.EHR.Recruit.Service.Models.Documents.Document", "ImportFile") + .WithMany() + .HasForeignKey("ImportFileId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Recruit.Service.Models.Recruits.RecruitImport", "RecruitImport") + .WithOne("ScoreImport") + .HasForeignKey("BMA.EHR.Recruit.Service.Models.Recruits.ScoreImport", "RecruitImportId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ImportFile"); + + b.Navigation("RecruitImport"); + }); + + modelBuilder.Entity("BMA.EHR.Recruit.Service.Models.Recruits.Recruit", b => + { + b.Navigation("Addresses"); + + b.Navigation("Certificates"); + + b.Navigation("Documents"); + + b.Navigation("Educations"); + + b.Navigation("Occupations"); + + b.Navigation("Payments"); + }); + + modelBuilder.Entity("BMA.EHR.Recruit.Service.Models.Recruits.RecruitImport", b => + { + b.Navigation("ImportHostories"); + + b.Navigation("RecruitDocuments"); + + b.Navigation("RecruitImages"); + + b.Navigation("Recruits"); + + b.Navigation("ScoreImport") + .IsRequired(); + }); + + modelBuilder.Entity("BMA.EHR.Recruit.Service.Models.Recruits.ScoreImport", b => + { + b.Navigation("Scores"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Migrations/20260310063204_update_table_RecruitScore_add_field_ExamAttribute.cs b/Migrations/20260310063204_update_table_RecruitScore_add_field_ExamAttribute.cs new file mode 100644 index 0000000..3089314 --- /dev/null +++ b/Migrations/20260310063204_update_table_RecruitScore_add_field_ExamAttribute.cs @@ -0,0 +1,32 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace BMA.EHR.Recruit.Service.Migrations +{ + /// + public partial class update_table_RecruitScore_add_field_ExamAttribute : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "ExamAttribute", + table: "RecruitScores", + type: "varchar(50)", + maxLength: 50, + nullable: false, + defaultValue: "", + comment: "สถานะคัดกรองคุณสมบัติ") + .Annotation("MySql:CharSet", "utf8mb4"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "ExamAttribute", + table: "RecruitScores"); + } + } +} diff --git a/Migrations/ApplicationDbContextModelSnapshot.cs b/Migrations/ApplicationDbContextModelSnapshot.cs index ce93624..d792f40 100644 --- a/Migrations/ApplicationDbContextModelSnapshot.cs +++ b/Migrations/ApplicationDbContextModelSnapshot.cs @@ -1200,6 +1200,12 @@ namespace BMA.EHR.Recruit.Service.Migrations .HasColumnOrder(101) .HasComment("User Id ที่สร้างข้อมูล"); + b.Property("ExamAttribute") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasComment("สถานะคัดกรองคุณสมบัติ"); + b.Property("ExamId") .IsRequired() .HasMaxLength(50) diff --git a/Models/Recruits/RecruitScore.cs b/Models/Recruits/RecruitScore.cs index bfb1b9d..9890f64 100644 --- a/Models/Recruits/RecruitScore.cs +++ b/Models/Recruits/RecruitScore.cs @@ -80,6 +80,9 @@ namespace BMA.EHR.Recruit.Service.Models.Recruits [Comment("หมายเหตุจากลำดับที่สอบได้")] public string RemarkExamOrder { get; set; } = string.Empty; + [MaxLength(50), Comment("สถานะคัดกรองคุณสมบัติ")] + public string ExamAttribute { get; set; } = string.Empty; + public ScoreImport ScoreImport { get; set; } } }