diff --git a/Controllers/CandidateController.cs b/Controllers/CandidateController.cs index d8225f1..9cc2361 100644 --- a/Controllers/CandidateController.cs +++ b/Controllers/CandidateController.cs @@ -264,7 +264,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status500InternalServerError)] - public async Task> GetsAsyncRegisterExam(string examId, string positionId) + public async Task> GetsAsyncRegisterExam(Guid examId, Guid positionId) { try { @@ -555,32 +555,32 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers } } - /// - /// อัพเดทข้อมูล ประวัติการศีกษา ผู้สมัคร - /// - /// รหัสประวัติการศีกษา - /// ข้อมูลประวัติการศีกษา - /// - /// เมื่อทำการอัพเดทข้อมูล ประวัติการศีกษา ผู้สมัคร สำเร็จ - /// ไม่ได้ Login เข้าระบบ - /// เมื่อเกิดข้อผิดพลาดในการทำงาน - [HttpPut("education/{educationId:length(36)}")] - [ProducesResponseType(StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status401Unauthorized)] - [ProducesResponseType(StatusCodes.Status500InternalServerError)] - public async Task> UpdateAsyncEducation(string educationId, CandidateEducationResponseItem candidateEducation) - { - try - { - await _candidateService.UpdateAsyncEducation(educationId, candidateEducation); + // /// + // /// อัพเดทข้อมูล ประวัติการศีกษา ผู้สมัคร + // /// + // /// รหัสประวัติการศีกษา + // /// ข้อมูลประวัติการศีกษา + // /// + // /// เมื่อทำการอัพเดทข้อมูล ประวัติการศีกษา ผู้สมัคร สำเร็จ + // /// ไม่ได้ Login เข้าระบบ + // /// เมื่อเกิดข้อผิดพลาดในการทำงาน + // [HttpPut("education/{educationId:length(36)}")] + // [ProducesResponseType(StatusCodes.Status200OK)] + // [ProducesResponseType(StatusCodes.Status401Unauthorized)] + // [ProducesResponseType(StatusCodes.Status500InternalServerError)] + // public async Task> UpdateAsyncEducation(string educationId, CandidateEducationResponseItem candidateEducation) + // { + // try + // { + // await _candidateService.UpdateAsyncEducation(educationId, candidateEducation); - return Success(); - } - catch (Exception ex) - { - return Error(ex); - } - } + // return Success(); + // } + // catch (Exception ex) + // { + // return Error(ex); + // } + // } /// /// ลบข้อมูล ประวัติการศีกษา ผู้สมัคร diff --git a/Data/Migrations/ApplicationDbContextModelSnapshot.cs b/Data/Migrations/ApplicationDbContextModelSnapshot.cs index d09671c..0a3a347 100644 --- a/Data/Migrations/ApplicationDbContextModelSnapshot.cs +++ b/Data/Migrations/ApplicationDbContextModelSnapshot.cs @@ -605,31 +605,34 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations .HasColumnType("longtext") .HasComment("ลำดับที่สอบได้"); - b.Property("OccupationCompany") + b.Property("OccupationGroup") .HasColumnType("longtext") - .HasComment("สำนัก/บริษัท บริษัท"); + .HasComment("ตำแหน่งปัจจุบัน กลุ่ม/ฝ่าย"); - b.Property("OccupationDepartment") + b.Property("OccupationOrg") .HasColumnType("longtext") - .HasComment("กอง/ฝ่าย บริษัท"); + .HasComment("ตำแหน่งปัจจุบัน ชื่อตำแหน่ง"); - b.Property("OccupationEmail") - .HasMaxLength(200) - .HasColumnType("varchar(200)") - .HasComment("อีเมล บริษัท"); + b.Property("OccupationPile") + .HasColumnType("longtext") + .HasComment("ตำแหน่งปัจจุบัน กอง"); b.Property("OccupationPosition") .HasColumnType("longtext") - .HasComment("ตำแหน่งอาชีพ"); + .HasComment("ตำแหน่งปัจจุบัน สังกัด"); + + b.Property("OccupationPositionType") + .HasColumnType("longtext") + .HasComment("ตำแหน่งปัจจุบัน ประเภทราชการ"); + + b.Property("OccupationSalary") + .HasColumnType("int") + .HasComment("ตำแหน่งปัจจุบัน เงินเดือน"); b.Property("OccupationTelephone") .HasMaxLength(20) .HasColumnType("varchar(20)") - .HasComment("โทรศัพท์ บริษัท"); - - b.Property("OccupationType") - .HasColumnType("longtext") - .HasComment("ประเภทอาชีพที่ทำงานมาก่อน"); + .HasComment("ตำแหน่งปัจจุบัน เบอร์โทรที่ทำงาน"); b.Property("Pass") .HasColumnType("longtext") @@ -769,6 +772,14 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations .HasColumnType("longtext") .HasComment("สถานภาพ"); + b.Property("ReligionId") + .HasColumnType("char(36)") + .HasComment("Id ศาสนา"); + + b.Property("ReligionName") + .HasColumnType("longtext") + .HasComment("ศาสนา"); + b.Property("ResultA") .HasColumnType("longtext") .HasComment("ผลสอบภาค ก"); @@ -931,6 +942,12 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations .HasColumnOrder(1) .HasComment("ระยะเวลาเริ่ม"); + b.Property("Group") + .IsRequired() + .HasColumnType("longtext") + .HasColumnOrder(4) + .HasComment("กลุ่ม/ฝ่าย"); + b.Property("IsActive") .HasColumnType("tinyint(1)") .HasColumnOrder(106) @@ -955,29 +972,29 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations .HasColumnOrder(102) .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - b.Property("Name") + b.Property("Org") .IsRequired() .HasColumnType("longtext") - .HasColumnOrder(3) - .HasComment("สถานที่ทำงาน/ฝึกงาน"); + .HasColumnOrder(6) + .HasComment("สังกัด"); + + b.Property("Pile") + .IsRequired() + .HasColumnType("longtext") + .HasColumnOrder(5) + .HasComment("กอง"); b.Property("Position") .IsRequired() .HasColumnType("longtext") - .HasColumnOrder(4) - .HasComment("ตำแหน่ง/ลักษณะงาน"); + .HasColumnOrder(3) + .HasComment("ชื่อตำแหน่ง"); - b.Property("Reason") + b.Property("RangeDate") .IsRequired() .HasColumnType("longtext") - .HasColumnOrder(6) - .HasComment("เหตุผลที่ออก"); - - b.Property("Salary") - .HasMaxLength(20) - .HasColumnType("int") - .HasColumnOrder(5) - .HasComment("เงินเดือนสุดท้ายก่อนออก"); + .HasColumnOrder(7) + .HasComment("ระยะเวลา"); b.HasKey("Id"); @@ -2109,23 +2126,45 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations .HasColumnOrder(101) .HasComment("User Id ที่สร้างข้อมูล"); - b.Property("DurationEnd") + b.Property("EducationEndDate") .HasColumnType("datetime(6)") - .HasColumnOrder(2) - .HasComment("ระยะเวลาสิ้นสุด"); + .HasComment("วันที่สำเร็จการศึกษา"); - b.Property("DurationStart") - .HasColumnType("datetime(6)") - .HasColumnOrder(1) - .HasComment("ระยะเวลาเริ่ม"); - - b.Property("EducationLevelId") + b.Property("EducationLevelExamId") .HasColumnType("char(36)") - .HasComment("Idวุฒิที่ได้รับ"); + .HasComment("Id วุฒิที่ใช้สมัครสอบ"); - b.Property("EducationLevelName") + b.Property("EducationLevelExamName") .HasColumnType("longtext") - .HasComment("วุฒิที่ได้รับ"); + .HasComment("วุฒิที่ใช้สมัครสอบ"); + + b.Property("EducationLevelHighId") + .HasColumnType("char(36)") + .HasComment("Id วุฒิการศึกษาสูงสุด"); + + b.Property("EducationLevelHighName") + .HasColumnType("longtext") + .HasComment("วุฒิการศึกษาสูงสุด"); + + b.Property("EducationLocation") + .HasColumnType("longtext") + .HasComment("ชื่อสถานศึกษา"); + + b.Property("EducationMajor") + .HasColumnType("longtext") + .HasComment("สาขาวิชา/วิชาเอก"); + + b.Property("EducationName") + .HasColumnType("longtext") + .HasComment("ชื่อปริญญา"); + + b.Property("EducationScores") + .HasColumnType("longtext") + .HasComment("คะแนนเฉลี่ยสะสม"); + + b.Property("EducationType") + .HasColumnType("longtext") + .HasComment("ประเภทสถานศึกษา"); b.Property("IsActive") .HasColumnType("tinyint(1)") @@ -2151,24 +2190,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations .HasColumnOrder(102) .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); - b.Property("Major") - .IsRequired() - .HasColumnType("longtext") - .HasColumnOrder(4) - .HasComment("สาขาวิชา/วิชาเอก"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext") - .HasColumnOrder(3) - .HasComment("ชื่อสถานศึกษา"); - - b.Property("Scores") - .HasMaxLength(10) - .HasColumnType("float") - .HasColumnOrder(6) - .HasComment("คะแนนเฉลี่ยตลอดหลักสูตร"); - b.HasKey("Id"); b.HasIndex("CandidateId"); @@ -2239,6 +2260,14 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations .HasColumnType("longtext") .HasComment("รายละเอียดสมัครสอบ"); + b.Property("EditorCondition") + .HasColumnType("longtext") + .HasComment("รายละเอียดเงื่อนไขการสมัคร"); + + b.Property("EditorConfirm") + .HasColumnType("longtext") + .HasComment("รายละเอียดคำรับรอง"); + b.Property("ExamDate") .HasColumnType("datetime(6)") .HasComment("วันที่สอบ"); @@ -2508,7 +2537,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations b.Property("HighDegree") .HasColumnType("tinyint(1)") - .HasComment("ปริญญาขึ้นไป"); + .HasComment("ปริญญาบัตรขึ้นไป"); b.Property("IsActive") .HasColumnType("tinyint(1)") @@ -2541,6 +2570,14 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations .HasColumnType("char(36)") .HasComment("Id ตำแหน่ง"); + b.Property("PositionLevelId") + .HasColumnType("char(36)") + .HasComment("Id ระดับ"); + + b.Property("PositionLevelName") + .HasColumnType("longtext") + .HasComment("ชื่อระดับ"); + b.Property("PositionName") .HasColumnType("longtext") .HasComment("ชื่อตำแหน่ง"); @@ -2795,7 +2832,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Education", b => { b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Candidate", "Candidate") - .WithMany() + .WithMany("Educations") .HasForeignKey("CandidateId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); @@ -2868,6 +2905,11 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations b.Navigation("CMSGovernments"); }); + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Candidate", b => + { + b.Navigation("Educations"); + }); + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.Disable", b => { b.Navigation("Addresses"); diff --git a/Migrations/20230929135727_Update Table PositionExam Add PositionLevel.Designer.cs b/Migrations/20230929135727_Update Table PositionExam Add PositionLevel.Designer.cs new file mode 100644 index 0000000..a79588d --- /dev/null +++ b/Migrations/20230929135727_Update Table PositionExam Add PositionLevel.Designer.cs @@ -0,0 +1,2944 @@ +// +using System; +using BMA.EHR.Recurit.Exam.Service.Data; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace BMA.EHR.Recurit.Exam.Service.Migrations +{ + [DbContext(typeof(ApplicationDbContext))] + [Migration("20230929135727_Update Table PositionExam Add PositionLevel")] + partial class UpdateTablePositionExamAddPositionLevel + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "7.0.5") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.BankExam", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("AccountName") + .HasColumnType("longtext") + .HasComment("ชื่อบัญชี"); + + b.Property("AccountNumber") + .HasColumnType("longtext") + .HasComment("เลขบัญชี"); + + b.Property("BankName") + .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("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .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("PeriodExamId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("PeriodExamId"); + + b.ToTable("BankExams"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.CMSAgency", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CMSCandidateId") + .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("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .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("Link") + .HasColumnType("longtext") + .HasComment("ลิงค์"); + + b.Property("Name") + .HasColumnType("longtext") + .HasComment("ชื่อลิงค์"); + + b.HasKey("Id"); + + b.HasIndex("CMSCandidateId"); + + b.ToTable("CMSAgencys"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.CMSCandidate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("About") + .HasColumnType("longtext") + .HasComment("ข้อมูลเกี่ยวกับเรา"); + + b.Property("Address") + .HasColumnType("longtext") + .HasComment("ที่อยู่ปัจจุบัน"); + + b.Property("BannerImgId") + .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("Description") + .HasColumnType("longtext") + .HasComment("ข้อมูลเว็บโดยย่อ"); + + b.Property("DistrictId") + .HasColumnType("char(36)") + .HasComment("Id อำเภอ"); + + b.Property("DistrictName") + .HasColumnType("longtext") + .HasComment("อำเภอ"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .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("LogoImgId") + .HasColumnType("char(36)"); + + b.Property("NameEn") + .HasColumnType("longtext") + .HasComment("ชื่อเว็บภาษาอังกฤษ"); + + b.Property("NameTh") + .HasColumnType("longtext") + .HasComment("ชื่อเว็บภาษาไทย"); + + b.Property("ProvinceId") + .HasColumnType("char(36)") + .HasComment("Id จังหวัด"); + + b.Property("ProvinceName") + .HasColumnType("longtext") + .HasComment("จังหวัด"); + + b.Property("ShortName") + .HasColumnType("longtext") + .HasComment("ชื่อย่อ"); + + b.Property("SubDistrictId") + .HasColumnType("char(36)") + .HasComment("Id ตำบล"); + + b.Property("SubDistrictName") + .HasColumnType("longtext") + .HasComment("ตำบล"); + + b.Property("Telephone") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("โทรศัพท์"); + + b.Property("ZipCode") + .HasMaxLength(10) + .HasColumnType("varchar(10)") + .HasComment("รหัสไปรษณีย์"); + + b.HasKey("Id"); + + b.HasIndex("BannerImgId"); + + b.HasIndex("LogoImgId"); + + b.ToTable("CMSCandidates"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.CMSGovernment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CMSCandidateId") + .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("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .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("Link") + .HasColumnType("longtext") + .HasComment("ลิงค์"); + + b.Property("Name") + .HasColumnType("longtext") + .HasComment("ชื่อลิงค์"); + + b.HasKey("Id"); + + b.HasIndex("CMSCandidateId"); + + b.ToTable("CMSGovernments"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Candidate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CitizenDate") + .HasColumnType("datetime(6)") + .HasComment("วันที่ออกบัตร"); + + b.Property("CitizenDistrictId") + .HasColumnType("char(36)") + .HasComment("Id เขตที่ออกบัตรประชาชน"); + + b.Property("CitizenDistrictName") + .HasColumnType("longtext") + .HasComment("เขตที่ออกบัตรประชาชน"); + + b.Property("CitizenId") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("เลขประจำตัวประชาชน"); + + b.Property("CitizenProvinceId") + .HasColumnType("char(36)") + .HasComment("Id จังหวัดที่ออกบัตรประชาชน"); + + b.Property("CitizenProvinceName") + .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("CurrentAddress") + .HasColumnType("longtext") + .HasComment("ที่อยู่ปัจจุบัน"); + + b.Property("CurrentDistrictId") + .HasColumnType("char(36)") + .HasComment("Id อำเภอที่อยู่ปัจจุบัน"); + + b.Property("CurrentDistrictName") + .HasColumnType("longtext") + .HasComment("อำเภอที่อยู่ปัจจุบัน"); + + b.Property("CurrentProvinceId") + .HasColumnType("char(36)") + .HasComment("Id จังหวัดที่อยู่ปัจจุบัน"); + + b.Property("CurrentProvinceName") + .HasColumnType("longtext") + .HasComment("จังหวัดที่อยู่ปัจจุบัน"); + + b.Property("CurrentSubDistrictId") + .HasColumnType("char(36)") + .HasComment("Id ตำบลที่อยู่ปัจจุบัน"); + + b.Property("CurrentSubDistrictName") + .HasColumnType("longtext") + .HasComment("ตำบลที่อยู่ปัจจุบัน"); + + b.Property("CurrentZipCode") + .HasMaxLength(10) + .HasColumnType("varchar(10)") + .HasComment("รหัสไปรษณีย์ที่อยู่ปัจจุบัน"); + + b.Property("DateOfBirth") + .HasMaxLength(40) + .HasColumnType("datetime(6)") + .HasComment("วันเกิด"); + + b.Property("Email") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("อีเมล"); + + b.Property("ExamIdenNumber") + .HasColumnType("longtext") + .HasComment("เลขประจำตัวสอบ"); + + b.Property("ExamReason") + .HasColumnType("longtext") + .HasComment("หมายเหตุ"); + + b.Property("FatherFirstName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("ชื่อจริงบิดา"); + + b.Property("FatherLastName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("นามสกุลบิดา"); + + b.Property("FatherNationality") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("สัญชาติบิดา"); + + b.Property("FatherOccupation") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("อาชีพบิดา"); + + b.Property("FatherPrefixId") + .HasColumnType("char(36)") + .HasComment("Id คำนำหน้าชื่อบิดา"); + + b.Property("FatherPrefixName") + .HasColumnType("longtext") + .HasComment("คำนำหน้าชื่อบิดา"); + + b.Property("FirstName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnOrder(1) + .HasComment("ชื่อจริง"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .HasComment("สถานะการใช้งาน"); + + b.Property("Knowledge") + .HasColumnType("longtext") + .HasComment("ความสามารถพิเศษ"); + + b.Property("LastName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnOrder(2) + .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("Marry") + .HasColumnType("tinyint(1)") + .HasComment("คู่สมรส"); + + b.Property("MarryFirstName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("ชื่อจริงคู่สมรส"); + + b.Property("MarryLastName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("นามสกุลคู่สมรส"); + + b.Property("MarryNationality") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("สัญชาติคู่สมรส"); + + b.Property("MarryOccupation") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("อาชีพคู่สมรส"); + + b.Property("MarryPrefixId") + .HasColumnType("char(36)") + .HasComment("Id คำนำหน้าชื่อคู่สมรส"); + + b.Property("MarryPrefixName") + .HasColumnType("longtext") + .HasComment("คำนำหน้าชื่อคู่สมรส"); + + b.Property("MobilePhone") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("โทรศัพท์มือถือ"); + + b.Property("MotherFirstName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("ชื่อจริงมารดา"); + + b.Property("MotherLastName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("นามสกุลมารดา"); + + b.Property("MotherNationality") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("สัญชาติมารดา"); + + b.Property("MotherOccupation") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("อาชีพมารดา"); + + b.Property("MotherPrefixId") + .HasColumnType("char(36)") + .HasComment("Id คำนำหน้าชื่อมารดา"); + + b.Property("MotherPrefixName") + .HasColumnType("longtext") + .HasComment("คำนำหน้าชื่อมารดา"); + + b.Property("Nationality") + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(3) + .HasComment("สัญชาติ"); + + b.Property("Number") + .HasColumnType("longtext") + .HasComment("ลำดับที่สอบได้"); + + b.Property("OccupationCompany") + .HasColumnType("longtext") + .HasComment("สำนัก/บริษัท บริษัท"); + + b.Property("OccupationDepartment") + .HasColumnType("longtext") + .HasComment("กอง/ฝ่าย บริษัท"); + + b.Property("OccupationEmail") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("อีเมล บริษัท"); + + b.Property("OccupationPosition") + .HasColumnType("longtext") + .HasComment("ตำแหน่งอาชีพ"); + + b.Property("OccupationTelephone") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("โทรศัพท์ บริษัท"); + + b.Property("OccupationType") + .HasColumnType("longtext") + .HasComment("ประเภทอาชีพที่ทำงานมาก่อน"); + + b.Property("Pass") + .HasColumnType("longtext") + .HasComment("ผลสมัครสอบ"); + + b.Property("PaymentDate") + .HasColumnType("datetime(6)") + .HasComment("วันที่ชำระเงิน"); + + b.Property("PaymentImgId") + .HasColumnType("char(36)"); + + b.Property("PeriodExamId") + .HasColumnType("char(36)"); + + b.Property("PointA") + .HasColumnType("longtext") + .HasComment("คะแนนภาค ก"); + + b.Property("PointB") + .HasColumnType("longtext") + .HasComment("คะแนนภาค ข"); + + b.Property("PointC") + .HasColumnType("longtext") + .HasComment("คะแนนภาค ค"); + + b.Property("PointPath1A") + .HasColumnType("longtext") + .HasComment("คะแนนภาค ก ความสามารถในการคิดวิเคราะห์"); + + b.Property("PointPath1C") + .HasColumnType("longtext") + .HasComment("คะแนนภาค คทดสอบสมรรถนะหลัก"); + + b.Property("PointPath2A") + .HasColumnType("longtext") + .HasComment("คะแนนภาค ก ภาษาอังกฤษ"); + + b.Property("PointPath2C") + .HasColumnType("longtext") + .HasComment("คะแนนภาค ค สัมภาษณ์"); + + b.Property("PointPath3A") + .HasColumnType("longtext") + .HasComment("คะแนนภาค ก ความรู้และลักษณะการเป็นข้าราชการที่ดี"); + + b.Property("PointPerA") + .HasColumnType("longtext") + .HasComment("คะแนนภาค ก เปอร์เซนต์"); + + b.Property("PointPerB") + .HasColumnType("longtext") + .HasComment("คะแนนภาค ข เปอร์เซนต์"); + + b.Property("PointPerC") + .HasColumnType("longtext") + .HasComment("คะแนนภาค ค เปอร์เซนต์"); + + b.Property("PointTotalA") + .HasColumnType("longtext") + .HasComment("คะแนนเต็มภาค ก"); + + b.Property("PointTotalB") + .HasColumnType("longtext") + .HasComment("คะแนนเต็มภาค ข"); + + b.Property("PointTotalC") + .HasColumnType("longtext") + .HasComment("คะแนนเต็มภาค ค"); + + b.Property("PositionExamId") + .HasColumnType("char(36)"); + + b.Property("PrefixId") + .HasColumnType("char(36)") + .HasComment("Id คำนำหน้าชื่อ"); + + b.Property("PrefixName") + .HasColumnType("longtext") + .HasComment("คำนำหน้าชื่อ"); + + b.Property("ProfileImgId") + .HasColumnType("char(36)"); + + b.Property("RegistAddress") + .HasColumnType("longtext") + .HasComment("ที่อยู่ตามทะเบียนบ้าน"); + + b.Property("RegistDistrictId") + .HasColumnType("char(36)") + .HasComment("Id อำเภอที่อยู่ตามทะเบียนบ้าน"); + + b.Property("RegistDistrictName") + .HasColumnType("longtext") + .HasComment("อำเภอที่อยู่ตามทะเบียนบ้าน"); + + b.Property("RegistProvinceId") + .HasColumnType("char(36)") + .HasComment("Id จังหวัดที่อยู่ตามทะเบียนบ้าน"); + + b.Property("RegistProvinceName") + .HasColumnType("longtext") + .HasComment("จังหวัดที่อยู่ตามทะเบียนบ้าน"); + + b.Property("RegistSame") + .HasColumnType("tinyint(1)") + .HasComment("ที่อยู่ปัจจุบันเหมือนที่อยู่ตามทะเบียนบ้าน"); + + b.Property("RegistSubDistrictId") + .HasColumnType("char(36)") + .HasComment("Id ตำบลที่อยู่ตามทะเบียนบ้าน"); + + b.Property("RegistSubDistrictName") + .HasColumnType("longtext") + .HasComment("ตำบลที่อยู่ตามทะเบียนบ้าน"); + + b.Property("RegistZipCode") + .HasMaxLength(10) + .HasColumnType("varchar(10)") + .HasComment("รหัสไปรษณีย์ที่อยู่ตามทะเบียนบ้าน"); + + b.Property("RegisterDate") + .HasMaxLength(40) + .HasColumnType("datetime(6)") + .HasComment("วันที่สมัคร"); + + b.Property("RejectDetail") + .HasColumnType("longtext") + .HasComment("เหตุผลการไม่อนุมัติ"); + + b.Property("RelationshipId") + .HasColumnType("char(36)") + .HasComment("Id สถานภาพ"); + + b.Property("RelationshipName") + .HasColumnType("longtext") + .HasComment("สถานภาพ"); + + b.Property("ReligionId") + .HasColumnType("char(36)") + .HasComment("Id ศาสนา"); + + b.Property("ReligionName") + .HasColumnType("longtext") + .HasComment("ศาสนา"); + + b.Property("ResultA") + .HasColumnType("longtext") + .HasComment("ผลสอบภาค ก"); + + b.Property("ResultB") + .HasColumnType("longtext") + .HasComment("ผลสอบภาค ข"); + + b.Property("ResultC") + .HasColumnType("longtext") + .HasComment("ผลสอบภาค ค"); + + b.Property("Review") + .HasColumnType("longtext") + .HasComment("ข้อแนะนำ"); + + b.Property("ReviewPoint") + .HasColumnType("int") + .HasComment("คะแนนความพึงพอใจ"); + + b.Property("SeatNumber") + .HasColumnType("longtext") + .HasComment("เลขที่นั่งสอบ"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("สถานะผู้สมัคร"); + + b.Property("Telephone") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("โทรศัพท์"); + + b.Property("UserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasComment("User Id ผู้สมัคร"); + + b.HasKey("Id"); + + b.HasIndex("PaymentImgId"); + + b.HasIndex("PeriodExamId"); + + b.HasIndex("PositionExamId"); + + b.HasIndex("ProfileImgId"); + + b.ToTable("Candidates"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.CandidateDocument", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CandidateId") + .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("DocumentId") + .HasColumnType("char(36)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .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.HasKey("Id"); + + b.HasIndex("CandidateId"); + + b.HasIndex("DocumentId"); + + b.ToTable("CandidateDocuments"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Career", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CandidateId") + .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("DurationEnd") + .HasColumnType("datetime(6)") + .HasColumnOrder(2) + .HasComment("ระยะเวลาสิ้นสุด"); + + b.Property("DurationStart") + .HasColumnType("datetime(6)") + .HasColumnOrder(1) + .HasComment("ระยะเวลาเริ่ม"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .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("Name") + .IsRequired() + .HasColumnType("longtext") + .HasColumnOrder(3) + .HasComment("สถานที่ทำงาน/ฝึกงาน"); + + b.Property("Position") + .IsRequired() + .HasColumnType("longtext") + .HasColumnOrder(4) + .HasComment("ตำแหน่ง/ลักษณะงาน"); + + b.Property("Reason") + .IsRequired() + .HasColumnType("longtext") + .HasColumnOrder(6) + .HasComment("เหตุผลที่ออก"); + + b.Property("Salary") + .HasMaxLength(20) + .HasColumnType("int") + .HasColumnOrder(5) + .HasComment("เงินเดือนสุดท้ายก่อนออก"); + + b.HasKey("Id"); + + b.HasIndex("CandidateId"); + + b.ToTable("Careers"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.Disable", 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("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .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("PeriodExamId") + .HasColumnType("char(36)"); + + b.Property("PositionName") + .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("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.HasKey("Id"); + + b.HasIndex("PeriodExamId"); + + b.ToTable("Disables"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.DisableAddress", 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("DisableId") + .HasColumnType("char(36)"); + + b.Property("District") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("District1") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .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("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("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("DisableId"); + + b.ToTable("DisableAddresses"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.DisableCertificate", 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("DisableId") + .HasColumnType("char(36)"); + + b.Property("ExpiredDate") + .HasColumnType("datetime(6)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .HasComment("สถานะการใช้งาน"); + + 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.HasKey("Id"); + + b.HasIndex("DisableId"); + + b.ToTable("DisableCertificates"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.DisableDocument", 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("DisableId") + .HasColumnType("char(36)"); + + b.Property("DocumentFileId") + .HasColumnType("char(36)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .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.HasKey("Id"); + + b.HasIndex("DisableId"); + + b.HasIndex("DocumentFileId"); + + b.ToTable("DisableDocuments"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.DisableEducation", 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("DisableId") + .HasColumnType("char(36)"); + + b.Property("GPA") + .HasColumnType("double"); + + b.Property("HighDegree") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .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("MajorGroupId") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("varchar(20)"); + + b.Property("MajorGroupName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Specialist") + .IsRequired() + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("University") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("Id"); + + b.HasIndex("DisableId"); + + b.ToTable("DisableEducations"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.DisableImportHistory", 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("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .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("PeriodExamId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("PeriodExamId"); + + b.ToTable("DisableImportHistories"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.DisableOccupation", 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("DisableId") + .HasColumnType("char(36)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .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("Occupation") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Position") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + 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("DisableId"); + + b.ToTable("DisableOccupations"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.DisablePayment", 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("DisableId") + .HasColumnType("char(36)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .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("PaymentId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("PaymentType") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + 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("DisableId"); + + b.ToTable("DisablePayments"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.DisableScore", 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)"); + + b.Property("AStatus") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("BStatus") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("CStatus") + .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("ExamId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("ExamStatus") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("FullA") + .HasColumnType("int"); + + b.Property("FullB") + .HasColumnType("int"); + + b.Property("FullC") + .HasColumnType("int"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .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"); + + b.Property("PercentageB") + .HasColumnType("double"); + + b.Property("PercentageC") + .HasColumnType("double"); + + b.Property("ScoreImportId") + .HasColumnType("char(36)"); + + b.Property("SumA") + .HasColumnType("int"); + + b.Property("SumAB") + .HasColumnType("int"); + + b.Property("SumB") + .HasColumnType("int"); + + b.Property("SumC") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ScoreImportId"); + + b.ToTable("DisableScores"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.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("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .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("PeriodExamId") + .HasColumnType("char(36)"); + + b.Property("Year") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ImportFileId"); + + b.HasIndex("PeriodExamId") + .IsUnique(); + + b.ToTable("ScoreImports"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.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.Recurit.Exam.Service.Models.Education", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CandidateId") + .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("DurationEnd") + .HasColumnType("datetime(6)") + .HasColumnOrder(2) + .HasComment("ระยะเวลาสิ้นสุด"); + + b.Property("DurationStart") + .HasColumnType("datetime(6)") + .HasColumnOrder(1) + .HasComment("ระยะเวลาเริ่ม"); + + b.Property("EducationLevelId") + .HasColumnType("char(36)") + .HasComment("Idวุฒิที่ได้รับ"); + + b.Property("EducationLevelName") + .HasColumnType("longtext") + .HasComment("วุฒิที่ได้รับ"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .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() + .HasColumnType("longtext") + .HasColumnOrder(4) + .HasComment("สาขาวิชา/วิชาเอก"); + + b.Property("Name") + .IsRequired() + .HasColumnType("longtext") + .HasColumnOrder(3) + .HasComment("ชื่อสถานศึกษา"); + + b.Property("Scores") + .HasMaxLength(10) + .HasColumnType("float") + .HasColumnOrder(6) + .HasComment("คะแนนเฉลี่ยตลอดหลักสูตร"); + + b.HasKey("Id"); + + b.HasIndex("CandidateId"); + + b.ToTable("Educations"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.PeriodExam", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("AnnouncementDate") + .HasColumnType("datetime(6)") + .HasColumnOrder(5) + .HasComment("วันประกาศผลสอบ"); + + b.Property("AnnouncementEndDate") + .HasColumnType("datetime(6)") + .HasColumnOrder(7) + .HasComment("วันสิ้นสุดประกาศ"); + + b.Property("AnnouncementExam") + .HasColumnType("tinyint(1)") + .HasComment("ประกาศนี้มีสมัครสอบคัดเลือก"); + + b.Property("AnnouncementStartDate") + .HasColumnType("datetime(6)") + .HasColumnOrder(6) + .HasComment("วันเริ่มประกาศ"); + + b.Property("Category") + .HasColumnType("longtext") + .HasComment("สำนัก"); + + b.Property("CheckDisability") + .HasColumnType("tinyint(1)") + .HasComment("คนพิการ"); + + b.Property("CheckDocument") + .HasColumnType("tinyint(1)") + .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("Detail") + .HasColumnType("longtext") + .HasComment("รายละเอียดสมัครสอบ"); + + b.Property("EditorCondition") + .HasColumnType("longtext") + .HasComment("รายละเอียดเงื่อนไขการสมัคร"); + + b.Property("EditorConfirm") + .HasColumnType("longtext") + .HasComment("รายละเอียดคำรับรอง"); + + b.Property("ExamDate") + .HasColumnType("datetime(6)") + .HasComment("วันที่สอบ"); + + b.Property("Fee") + .HasColumnType("float") + .HasComment("ค่าธรรมเนียม"); + + b.Property("ImportFileId") + .HasColumnType("char(36)"); + + b.Property("IsActive") + .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("Name") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("varchar(150)") + .HasColumnOrder(8) + .HasComment("ชื่อการสอบ"); + + b.Property("Note") + .HasColumnType("longtext") + .HasComment("หมายเหตุ"); + + b.Property("OrganizationCodeId") + .HasColumnType("char(36)") + .HasComment("Id รหัสส่วนราชการ"); + + b.Property("OrganizationCodeName") + .HasColumnType("longtext") + .HasComment("ชื่อรหัสส่วนราชการ"); + + b.Property("OrganizationId") + .HasColumnType("char(36)") + .HasComment("Id หน่วยงาน"); + + b.Property("OrganizationName") + .HasColumnType("longtext") + .HasComment("ชื่อหน่วยงาน"); + + b.Property("PaymentEndDate") + .HasColumnType("datetime(6)") + .HasColumnOrder(4) + .HasComment("วันสิ้นสุดชำระเงิน"); + + b.Property("PaymentKrungThai") + .HasColumnType("longtext") + .HasComment("ชำระเงินผ่านกรุงไทย"); + + b.Property("PaymentStartDate") + .HasColumnType("datetime(6)") + .HasColumnOrder(3) + .HasComment("วันเริ่มชำระเงิน"); + + b.Property("RegisterEndDate") + .HasColumnType("datetime(6)") + .HasColumnOrder(2) + .HasComment("วันสิ้นสุดสมัครสอบ"); + + b.Property("RegisterStartDate") + .HasColumnType("datetime(6)") + .HasColumnOrder(1) + .HasComment("วันเริ่มสมัครสอบ"); + + b.Property("Round") + .HasColumnType("int") + .HasColumnOrder(9) + .HasComment("รอบการสอบ"); + + b.Property("SetSeat") + .HasColumnType("tinyint(1)") + .HasComment("เช็คอัพคะแนน"); + + b.Property("Year") + .HasColumnType("int") + .HasComment("ปีงบประมาณ"); + + b.HasKey("Id"); + + b.HasIndex("ImportFileId"); + + b.ToTable("PeriodExams"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.PeriodExamDocument", 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("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .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("PeriodExamId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("DocumentId"); + + b.HasIndex("PeriodExamId"); + + b.ToTable("PeriodExamDocuments"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.PeriodExamImage", 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("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .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("PeriodExamId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("DocumentId"); + + b.HasIndex("PeriodExamId"); + + b.ToTable("PeriodExamImages"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.PositionExam", 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("HighDegree") + .HasColumnType("tinyint(1)") + .HasComment("ปริญญาบัตรขึ้นไป"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .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("PeriodExamId") + .HasColumnType("char(36)"); + + b.Property("PositionId") + .HasColumnType("char(36)") + .HasComment("Id ตำแหน่ง"); + + b.Property("PositionLevelId") + .HasColumnType("char(36)") + .HasComment("Id ระดับ"); + + b.Property("PositionLevelName") + .HasColumnType("longtext") + .HasComment("ชื่อระดับ"); + + b.Property("PositionName") + .HasColumnType("longtext") + .HasComment("ชื่อตำแหน่ง"); + + b.Property("TypeId") + .HasColumnType("longtext") + .HasComment("Id ประเภทแบบฟอร์ม"); + + b.Property("TypeName") + .HasColumnType("longtext") + .HasComment("ชื่อประเภทแบบฟอร์ม"); + + b.HasKey("Id"); + + b.HasIndex("PeriodExamId"); + + b.ToTable("PositionExams"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.BankExam", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.PeriodExam", "PeriodExam") + .WithMany("BankExam") + .HasForeignKey("PeriodExamId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("PeriodExam"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.CMSAgency", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.CMSCandidate", "CMSCandidate") + .WithMany("CMSAgencys") + .HasForeignKey("CMSCandidateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("CMSCandidate"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.CMSCandidate", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Documents.Document", "BannerImg") + .WithMany() + .HasForeignKey("BannerImgId"); + + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Documents.Document", "LogoImg") + .WithMany() + .HasForeignKey("LogoImgId"); + + b.Navigation("BannerImg"); + + b.Navigation("LogoImg"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.CMSGovernment", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.CMSCandidate", "CMSCandidate") + .WithMany("CMSGovernments") + .HasForeignKey("CMSCandidateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("CMSCandidate"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Candidate", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Documents.Document", "PaymentImg") + .WithMany() + .HasForeignKey("PaymentImgId"); + + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.PeriodExam", "PeriodExam") + .WithMany("Candidate") + .HasForeignKey("PeriodExamId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.PositionExam", "PositionExam") + .WithMany() + .HasForeignKey("PositionExamId"); + + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Documents.Document", "ProfileImg") + .WithMany() + .HasForeignKey("ProfileImgId"); + + b.Navigation("PaymentImg"); + + b.Navigation("PeriodExam"); + + b.Navigation("PositionExam"); + + b.Navigation("ProfileImg"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.CandidateDocument", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Candidate", "Candidate") + .WithMany() + .HasForeignKey("CandidateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Documents.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Candidate"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Career", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Candidate", "Candidate") + .WithMany() + .HasForeignKey("CandidateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Candidate"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.Disable", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.PeriodExam", "PeriodExam") + .WithMany("Disables") + .HasForeignKey("PeriodExamId") + .OnDelete(DeleteBehavior.Cascade); + + b.Navigation("PeriodExam"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.DisableAddress", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Disables.Disable", "Disable") + .WithMany("Addresses") + .HasForeignKey("DisableId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Disable"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.DisableCertificate", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Disables.Disable", "Disable") + .WithMany("Certificates") + .HasForeignKey("DisableId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Disable"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.DisableDocument", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Disables.Disable", "Disable") + .WithMany("Documents") + .HasForeignKey("DisableId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Documents.Document", "DocumentFile") + .WithMany() + .HasForeignKey("DocumentFileId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Disable"); + + b.Navigation("DocumentFile"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.DisableEducation", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Disables.Disable", "Disable") + .WithMany("Educations") + .HasForeignKey("DisableId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Disable"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.DisableImportHistory", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.PeriodExam", "PeriodExam") + .WithMany("ImportHostories") + .HasForeignKey("PeriodExamId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("PeriodExam"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.DisableOccupation", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Disables.Disable", "Disable") + .WithMany("Occupations") + .HasForeignKey("DisableId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Disable"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.DisablePayment", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Disables.Disable", "Disable") + .WithMany("Payments") + .HasForeignKey("DisableId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Disable"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.DisableScore", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Disables.ScoreImport", "ScoreImport") + .WithMany("Scores") + .HasForeignKey("ScoreImportId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ScoreImport"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.ScoreImport", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Documents.Document", "ImportFile") + .WithMany() + .HasForeignKey("ImportFileId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.PeriodExam", "PeriodExam") + .WithOne("ScoreImport") + .HasForeignKey("BMA.EHR.Recurit.Exam.Service.Models.Disables.ScoreImport", "PeriodExamId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ImportFile"); + + b.Navigation("PeriodExam"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Education", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Candidate", "Candidate") + .WithMany("Educations") + .HasForeignKey("CandidateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Candidate"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.PeriodExam", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Documents.Document", "ImportFile") + .WithMany() + .HasForeignKey("ImportFileId"); + + b.Navigation("ImportFile"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.PeriodExamDocument", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Documents.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.PeriodExam", "PeriodExam") + .WithMany("PeriodExamDocuments") + .HasForeignKey("PeriodExamId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Document"); + + b.Navigation("PeriodExam"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.PeriodExamImage", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Documents.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.PeriodExam", "PeriodExam") + .WithMany("PeriodExamImages") + .HasForeignKey("PeriodExamId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Document"); + + b.Navigation("PeriodExam"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.PositionExam", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.PeriodExam", "PeriodExam") + .WithMany("PositionExam") + .HasForeignKey("PeriodExamId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("PeriodExam"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.CMSCandidate", b => + { + b.Navigation("CMSAgencys"); + + b.Navigation("CMSGovernments"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Candidate", b => + { + b.Navigation("Educations"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.Disable", b => + { + b.Navigation("Addresses"); + + b.Navigation("Certificates"); + + b.Navigation("Documents"); + + b.Navigation("Educations"); + + b.Navigation("Occupations"); + + b.Navigation("Payments"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.ScoreImport", b => + { + b.Navigation("Scores"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.PeriodExam", b => + { + b.Navigation("BankExam"); + + b.Navigation("Candidate"); + + b.Navigation("Disables"); + + b.Navigation("ImportHostories"); + + b.Navigation("PeriodExamDocuments"); + + b.Navigation("PeriodExamImages"); + + b.Navigation("PositionExam"); + + b.Navigation("ScoreImport"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Migrations/20230929135727_Update Table PositionExam Add PositionLevel.cs b/Migrations/20230929135727_Update Table PositionExam Add PositionLevel.cs new file mode 100644 index 0000000..434af54 --- /dev/null +++ b/Migrations/20230929135727_Update Table PositionExam Add PositionLevel.cs @@ -0,0 +1,111 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace BMA.EHR.Recurit.Exam.Service.Migrations +{ + /// + public partial class UpdateTablePositionExamAddPositionLevel : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "HighDegree", + table: "PositionExams", + type: "tinyint(1)", + nullable: false, + comment: "ปริญญาบัตรขึ้นไป", + oldClrType: typeof(bool), + oldType: "tinyint(1)", + oldComment: "ปริญญาขึ้นไป"); + + migrationBuilder.AddColumn( + name: "PositionLevelId", + table: "PositionExams", + type: "char(36)", + nullable: true, + comment: "Id ระดับ", + collation: "ascii_general_ci"); + + migrationBuilder.AddColumn( + name: "PositionLevelName", + table: "PositionExams", + type: "longtext", + nullable: true, + comment: "ชื่อระดับ") + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "EditorCondition", + table: "PeriodExams", + type: "longtext", + nullable: true, + comment: "รายละเอียดเงื่อนไขการสมัคร") + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "EditorConfirm", + table: "PeriodExams", + type: "longtext", + nullable: true, + comment: "รายละเอียดคำรับรอง") + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "ReligionId", + table: "Candidates", + type: "char(36)", + nullable: true, + comment: "Id ศาสนา", + collation: "ascii_general_ci"); + + migrationBuilder.AddColumn( + name: "ReligionName", + table: "Candidates", + type: "longtext", + nullable: true, + comment: "ศาสนา") + .Annotation("MySql:CharSet", "utf8mb4"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "PositionLevelId", + table: "PositionExams"); + + migrationBuilder.DropColumn( + name: "PositionLevelName", + table: "PositionExams"); + + migrationBuilder.DropColumn( + name: "EditorCondition", + table: "PeriodExams"); + + migrationBuilder.DropColumn( + name: "EditorConfirm", + table: "PeriodExams"); + + migrationBuilder.DropColumn( + name: "ReligionId", + table: "Candidates"); + + migrationBuilder.DropColumn( + name: "ReligionName", + table: "Candidates"); + + migrationBuilder.AlterColumn( + name: "HighDegree", + table: "PositionExams", + type: "tinyint(1)", + nullable: false, + comment: "ปริญญาขึ้นไป", + oldClrType: typeof(bool), + oldType: "tinyint(1)", + oldComment: "ปริญญาบัตรขึ้นไป"); + } + } +} diff --git a/Migrations/20231001081015_Update Table PositionExam Add PositionLevel1.Designer.cs b/Migrations/20231001081015_Update Table PositionExam Add PositionLevel1.Designer.cs new file mode 100644 index 0000000..6d27462 --- /dev/null +++ b/Migrations/20231001081015_Update Table PositionExam Add PositionLevel1.Designer.cs @@ -0,0 +1,2957 @@ +// +using System; +using BMA.EHR.Recurit.Exam.Service.Data; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace BMA.EHR.Recurit.Exam.Service.Migrations +{ + [DbContext(typeof(ApplicationDbContext))] + [Migration("20231001081015_Update Table PositionExam Add PositionLevel1")] + partial class UpdateTablePositionExamAddPositionLevel1 + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "7.0.5") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.BankExam", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("AccountName") + .HasColumnType("longtext") + .HasComment("ชื่อบัญชี"); + + b.Property("AccountNumber") + .HasColumnType("longtext") + .HasComment("เลขบัญชี"); + + b.Property("BankName") + .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("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .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("PeriodExamId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("PeriodExamId"); + + b.ToTable("BankExams"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.CMSAgency", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CMSCandidateId") + .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("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .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("Link") + .HasColumnType("longtext") + .HasComment("ลิงค์"); + + b.Property("Name") + .HasColumnType("longtext") + .HasComment("ชื่อลิงค์"); + + b.HasKey("Id"); + + b.HasIndex("CMSCandidateId"); + + b.ToTable("CMSAgencys"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.CMSCandidate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("About") + .HasColumnType("longtext") + .HasComment("ข้อมูลเกี่ยวกับเรา"); + + b.Property("Address") + .HasColumnType("longtext") + .HasComment("ที่อยู่ปัจจุบัน"); + + b.Property("BannerImgId") + .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("Description") + .HasColumnType("longtext") + .HasComment("ข้อมูลเว็บโดยย่อ"); + + b.Property("DistrictId") + .HasColumnType("char(36)") + .HasComment("Id อำเภอ"); + + b.Property("DistrictName") + .HasColumnType("longtext") + .HasComment("อำเภอ"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .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("LogoImgId") + .HasColumnType("char(36)"); + + b.Property("NameEn") + .HasColumnType("longtext") + .HasComment("ชื่อเว็บภาษาอังกฤษ"); + + b.Property("NameTh") + .HasColumnType("longtext") + .HasComment("ชื่อเว็บภาษาไทย"); + + b.Property("ProvinceId") + .HasColumnType("char(36)") + .HasComment("Id จังหวัด"); + + b.Property("ProvinceName") + .HasColumnType("longtext") + .HasComment("จังหวัด"); + + b.Property("ShortName") + .HasColumnType("longtext") + .HasComment("ชื่อย่อ"); + + b.Property("SubDistrictId") + .HasColumnType("char(36)") + .HasComment("Id ตำบล"); + + b.Property("SubDistrictName") + .HasColumnType("longtext") + .HasComment("ตำบล"); + + b.Property("Telephone") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("โทรศัพท์"); + + b.Property("ZipCode") + .HasMaxLength(10) + .HasColumnType("varchar(10)") + .HasComment("รหัสไปรษณีย์"); + + b.HasKey("Id"); + + b.HasIndex("BannerImgId"); + + b.HasIndex("LogoImgId"); + + b.ToTable("CMSCandidates"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.CMSGovernment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CMSCandidateId") + .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("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .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("Link") + .HasColumnType("longtext") + .HasComment("ลิงค์"); + + b.Property("Name") + .HasColumnType("longtext") + .HasComment("ชื่อลิงค์"); + + b.HasKey("Id"); + + b.HasIndex("CMSCandidateId"); + + b.ToTable("CMSGovernments"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Candidate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CitizenDate") + .HasColumnType("datetime(6)") + .HasComment("วันที่ออกบัตร"); + + b.Property("CitizenDistrictId") + .HasColumnType("char(36)") + .HasComment("Id เขตที่ออกบัตรประชาชน"); + + b.Property("CitizenDistrictName") + .HasColumnType("longtext") + .HasComment("เขตที่ออกบัตรประชาชน"); + + b.Property("CitizenId") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("เลขประจำตัวประชาชน"); + + b.Property("CitizenProvinceId") + .HasColumnType("char(36)") + .HasComment("Id จังหวัดที่ออกบัตรประชาชน"); + + b.Property("CitizenProvinceName") + .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("CurrentAddress") + .HasColumnType("longtext") + .HasComment("ที่อยู่ปัจจุบัน"); + + b.Property("CurrentDistrictId") + .HasColumnType("char(36)") + .HasComment("Id อำเภอที่อยู่ปัจจุบัน"); + + b.Property("CurrentDistrictName") + .HasColumnType("longtext") + .HasComment("อำเภอที่อยู่ปัจจุบัน"); + + b.Property("CurrentProvinceId") + .HasColumnType("char(36)") + .HasComment("Id จังหวัดที่อยู่ปัจจุบัน"); + + b.Property("CurrentProvinceName") + .HasColumnType("longtext") + .HasComment("จังหวัดที่อยู่ปัจจุบัน"); + + b.Property("CurrentSubDistrictId") + .HasColumnType("char(36)") + .HasComment("Id ตำบลที่อยู่ปัจจุบัน"); + + b.Property("CurrentSubDistrictName") + .HasColumnType("longtext") + .HasComment("ตำบลที่อยู่ปัจจุบัน"); + + b.Property("CurrentZipCode") + .HasMaxLength(10) + .HasColumnType("varchar(10)") + .HasComment("รหัสไปรษณีย์ที่อยู่ปัจจุบัน"); + + b.Property("DateOfBirth") + .HasMaxLength(40) + .HasColumnType("datetime(6)") + .HasComment("วันเกิด"); + + b.Property("Email") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("อีเมล"); + + b.Property("ExamIdenNumber") + .HasColumnType("longtext") + .HasComment("เลขประจำตัวสอบ"); + + b.Property("ExamReason") + .HasColumnType("longtext") + .HasComment("หมายเหตุ"); + + b.Property("FatherFirstName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("ชื่อจริงบิดา"); + + b.Property("FatherLastName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("นามสกุลบิดา"); + + b.Property("FatherNationality") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("สัญชาติบิดา"); + + b.Property("FatherOccupation") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("อาชีพบิดา"); + + b.Property("FatherPrefixId") + .HasColumnType("char(36)") + .HasComment("Id คำนำหน้าชื่อบิดา"); + + b.Property("FatherPrefixName") + .HasColumnType("longtext") + .HasComment("คำนำหน้าชื่อบิดา"); + + b.Property("FirstName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnOrder(1) + .HasComment("ชื่อจริง"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .HasComment("สถานะการใช้งาน"); + + b.Property("Knowledge") + .HasColumnType("longtext") + .HasComment("ความสามารถพิเศษ"); + + b.Property("LastName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnOrder(2) + .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("Marry") + .HasColumnType("tinyint(1)") + .HasComment("คู่สมรส"); + + b.Property("MarryFirstName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("ชื่อจริงคู่สมรส"); + + b.Property("MarryLastName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("นามสกุลคู่สมรส"); + + b.Property("MarryNationality") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("สัญชาติคู่สมรส"); + + b.Property("MarryOccupation") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("อาชีพคู่สมรส"); + + b.Property("MarryPrefixId") + .HasColumnType("char(36)") + .HasComment("Id คำนำหน้าชื่อคู่สมรส"); + + b.Property("MarryPrefixName") + .HasColumnType("longtext") + .HasComment("คำนำหน้าชื่อคู่สมรส"); + + b.Property("MobilePhone") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("โทรศัพท์มือถือ"); + + b.Property("MotherFirstName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("ชื่อจริงมารดา"); + + b.Property("MotherLastName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("นามสกุลมารดา"); + + b.Property("MotherNationality") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("สัญชาติมารดา"); + + b.Property("MotherOccupation") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("อาชีพมารดา"); + + b.Property("MotherPrefixId") + .HasColumnType("char(36)") + .HasComment("Id คำนำหน้าชื่อมารดา"); + + b.Property("MotherPrefixName") + .HasColumnType("longtext") + .HasComment("คำนำหน้าชื่อมารดา"); + + b.Property("Nationality") + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(3) + .HasComment("สัญชาติ"); + + b.Property("Number") + .HasColumnType("longtext") + .HasComment("ลำดับที่สอบได้"); + + b.Property("OccupationGroup") + .HasColumnType("longtext") + .HasComment("ตำแหน่งปัจจุบัน กลุ่ม/ฝ่าย"); + + b.Property("OccupationOrg") + .HasColumnType("longtext") + .HasComment("ตำแหน่งปัจจุบัน ชื่อตำแหน่ง"); + + b.Property("OccupationPile") + .HasColumnType("longtext") + .HasComment("ตำแหน่งปัจจุบัน กอง"); + + b.Property("OccupationPosition") + .HasColumnType("longtext") + .HasComment("ตำแหน่งปัจจุบัน สังกัด"); + + b.Property("OccupationPositionType") + .HasColumnType("longtext") + .HasComment("ตำแหน่งปัจจุบัน ประเภทราชการ"); + + b.Property("OccupationSalary") + .HasColumnType("int") + .HasComment("ตำแหน่งปัจจุบัน เงินเดือน"); + + b.Property("OccupationTelephone") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("ตำแหน่งปัจจุบัน เบอร์โทรที่ทำงาน"); + + b.Property("Pass") + .HasColumnType("longtext") + .HasComment("ผลสมัครสอบ"); + + b.Property("PaymentDate") + .HasColumnType("datetime(6)") + .HasComment("วันที่ชำระเงิน"); + + b.Property("PaymentImgId") + .HasColumnType("char(36)"); + + b.Property("PeriodExamId") + .HasColumnType("char(36)"); + + b.Property("PointA") + .HasColumnType("longtext") + .HasComment("คะแนนภาค ก"); + + b.Property("PointB") + .HasColumnType("longtext") + .HasComment("คะแนนภาค ข"); + + b.Property("PointC") + .HasColumnType("longtext") + .HasComment("คะแนนภาค ค"); + + b.Property("PointPath1A") + .HasColumnType("longtext") + .HasComment("คะแนนภาค ก ความสามารถในการคิดวิเคราะห์"); + + b.Property("PointPath1C") + .HasColumnType("longtext") + .HasComment("คะแนนภาค คทดสอบสมรรถนะหลัก"); + + b.Property("PointPath2A") + .HasColumnType("longtext") + .HasComment("คะแนนภาค ก ภาษาอังกฤษ"); + + b.Property("PointPath2C") + .HasColumnType("longtext") + .HasComment("คะแนนภาค ค สัมภาษณ์"); + + b.Property("PointPath3A") + .HasColumnType("longtext") + .HasComment("คะแนนภาค ก ความรู้และลักษณะการเป็นข้าราชการที่ดี"); + + b.Property("PointPerA") + .HasColumnType("longtext") + .HasComment("คะแนนภาค ก เปอร์เซนต์"); + + b.Property("PointPerB") + .HasColumnType("longtext") + .HasComment("คะแนนภาค ข เปอร์เซนต์"); + + b.Property("PointPerC") + .HasColumnType("longtext") + .HasComment("คะแนนภาค ค เปอร์เซนต์"); + + b.Property("PointTotalA") + .HasColumnType("longtext") + .HasComment("คะแนนเต็มภาค ก"); + + b.Property("PointTotalB") + .HasColumnType("longtext") + .HasComment("คะแนนเต็มภาค ข"); + + b.Property("PointTotalC") + .HasColumnType("longtext") + .HasComment("คะแนนเต็มภาค ค"); + + b.Property("PositionExamId") + .HasColumnType("char(36)"); + + b.Property("PrefixId") + .HasColumnType("char(36)") + .HasComment("Id คำนำหน้าชื่อ"); + + b.Property("PrefixName") + .HasColumnType("longtext") + .HasComment("คำนำหน้าชื่อ"); + + b.Property("ProfileImgId") + .HasColumnType("char(36)"); + + b.Property("RegistAddress") + .HasColumnType("longtext") + .HasComment("ที่อยู่ตามทะเบียนบ้าน"); + + b.Property("RegistDistrictId") + .HasColumnType("char(36)") + .HasComment("Id อำเภอที่อยู่ตามทะเบียนบ้าน"); + + b.Property("RegistDistrictName") + .HasColumnType("longtext") + .HasComment("อำเภอที่อยู่ตามทะเบียนบ้าน"); + + b.Property("RegistProvinceId") + .HasColumnType("char(36)") + .HasComment("Id จังหวัดที่อยู่ตามทะเบียนบ้าน"); + + b.Property("RegistProvinceName") + .HasColumnType("longtext") + .HasComment("จังหวัดที่อยู่ตามทะเบียนบ้าน"); + + b.Property("RegistSame") + .HasColumnType("tinyint(1)") + .HasComment("ที่อยู่ปัจจุบันเหมือนที่อยู่ตามทะเบียนบ้าน"); + + b.Property("RegistSubDistrictId") + .HasColumnType("char(36)") + .HasComment("Id ตำบลที่อยู่ตามทะเบียนบ้าน"); + + b.Property("RegistSubDistrictName") + .HasColumnType("longtext") + .HasComment("ตำบลที่อยู่ตามทะเบียนบ้าน"); + + b.Property("RegistZipCode") + .HasMaxLength(10) + .HasColumnType("varchar(10)") + .HasComment("รหัสไปรษณีย์ที่อยู่ตามทะเบียนบ้าน"); + + b.Property("RegisterDate") + .HasMaxLength(40) + .HasColumnType("datetime(6)") + .HasComment("วันที่สมัคร"); + + b.Property("RejectDetail") + .HasColumnType("longtext") + .HasComment("เหตุผลการไม่อนุมัติ"); + + b.Property("RelationshipId") + .HasColumnType("char(36)") + .HasComment("Id สถานภาพ"); + + b.Property("RelationshipName") + .HasColumnType("longtext") + .HasComment("สถานภาพ"); + + b.Property("ReligionId") + .HasColumnType("char(36)") + .HasComment("Id ศาสนา"); + + b.Property("ReligionName") + .HasColumnType("longtext") + .HasComment("ศาสนา"); + + b.Property("ResultA") + .HasColumnType("longtext") + .HasComment("ผลสอบภาค ก"); + + b.Property("ResultB") + .HasColumnType("longtext") + .HasComment("ผลสอบภาค ข"); + + b.Property("ResultC") + .HasColumnType("longtext") + .HasComment("ผลสอบภาค ค"); + + b.Property("Review") + .HasColumnType("longtext") + .HasComment("ข้อแนะนำ"); + + b.Property("ReviewPoint") + .HasColumnType("int") + .HasComment("คะแนนความพึงพอใจ"); + + b.Property("SeatNumber") + .HasColumnType("longtext") + .HasComment("เลขที่นั่งสอบ"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("สถานะผู้สมัคร"); + + b.Property("Telephone") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("โทรศัพท์"); + + b.Property("UserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasComment("User Id ผู้สมัคร"); + + b.HasKey("Id"); + + b.HasIndex("PaymentImgId"); + + b.HasIndex("PeriodExamId"); + + b.HasIndex("PositionExamId"); + + b.HasIndex("ProfileImgId"); + + b.ToTable("Candidates"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.CandidateDocument", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CandidateId") + .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("DocumentId") + .HasColumnType("char(36)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .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.HasKey("Id"); + + b.HasIndex("CandidateId"); + + b.HasIndex("DocumentId"); + + b.ToTable("CandidateDocuments"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Career", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CandidateId") + .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("DurationEnd") + .HasColumnType("datetime(6)") + .HasColumnOrder(2) + .HasComment("ระยะเวลาสิ้นสุด"); + + b.Property("DurationStart") + .HasColumnType("datetime(6)") + .HasColumnOrder(1) + .HasComment("ระยะเวลาเริ่ม"); + + b.Property("Group") + .IsRequired() + .HasColumnType("longtext") + .HasColumnOrder(4) + .HasComment("กลุ่ม/ฝ่าย"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .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("Org") + .IsRequired() + .HasColumnType("longtext") + .HasColumnOrder(6) + .HasComment("สังกัด"); + + b.Property("Pile") + .IsRequired() + .HasColumnType("longtext") + .HasColumnOrder(5) + .HasComment("กอง"); + + b.Property("Position") + .IsRequired() + .HasColumnType("longtext") + .HasColumnOrder(3) + .HasComment("ชื่อตำแหน่ง"); + + b.Property("RangeDate") + .IsRequired() + .HasColumnType("longtext") + .HasColumnOrder(7) + .HasComment("ระยะเวลา"); + + b.HasKey("Id"); + + b.HasIndex("CandidateId"); + + b.ToTable("Careers"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.Disable", 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("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .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("PeriodExamId") + .HasColumnType("char(36)"); + + b.Property("PositionName") + .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("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.HasKey("Id"); + + b.HasIndex("PeriodExamId"); + + b.ToTable("Disables"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.DisableAddress", 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("DisableId") + .HasColumnType("char(36)"); + + b.Property("District") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("District1") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .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("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("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("DisableId"); + + b.ToTable("DisableAddresses"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.DisableCertificate", 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("DisableId") + .HasColumnType("char(36)"); + + b.Property("ExpiredDate") + .HasColumnType("datetime(6)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .HasComment("สถานะการใช้งาน"); + + 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.HasKey("Id"); + + b.HasIndex("DisableId"); + + b.ToTable("DisableCertificates"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.DisableDocument", 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("DisableId") + .HasColumnType("char(36)"); + + b.Property("DocumentFileId") + .HasColumnType("char(36)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .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.HasKey("Id"); + + b.HasIndex("DisableId"); + + b.HasIndex("DocumentFileId"); + + b.ToTable("DisableDocuments"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.DisableEducation", 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("DisableId") + .HasColumnType("char(36)"); + + b.Property("GPA") + .HasColumnType("double"); + + b.Property("HighDegree") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .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("MajorGroupId") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("varchar(20)"); + + b.Property("MajorGroupName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Specialist") + .IsRequired() + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("University") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("Id"); + + b.HasIndex("DisableId"); + + b.ToTable("DisableEducations"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.DisableImportHistory", 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("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .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("PeriodExamId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("PeriodExamId"); + + b.ToTable("DisableImportHistories"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.DisableOccupation", 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("DisableId") + .HasColumnType("char(36)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .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("Occupation") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Position") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + 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("DisableId"); + + b.ToTable("DisableOccupations"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.DisablePayment", 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("DisableId") + .HasColumnType("char(36)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .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("PaymentId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("PaymentType") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + 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("DisableId"); + + b.ToTable("DisablePayments"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.DisableScore", 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)"); + + b.Property("AStatus") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("BStatus") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("CStatus") + .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("ExamId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("ExamStatus") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("FullA") + .HasColumnType("int"); + + b.Property("FullB") + .HasColumnType("int"); + + b.Property("FullC") + .HasColumnType("int"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .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"); + + b.Property("PercentageB") + .HasColumnType("double"); + + b.Property("PercentageC") + .HasColumnType("double"); + + b.Property("ScoreImportId") + .HasColumnType("char(36)"); + + b.Property("SumA") + .HasColumnType("int"); + + b.Property("SumAB") + .HasColumnType("int"); + + b.Property("SumB") + .HasColumnType("int"); + + b.Property("SumC") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ScoreImportId"); + + b.ToTable("DisableScores"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.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("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .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("PeriodExamId") + .HasColumnType("char(36)"); + + b.Property("Year") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ImportFileId"); + + b.HasIndex("PeriodExamId") + .IsUnique(); + + b.ToTable("ScoreImports"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.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.Recurit.Exam.Service.Models.Education", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CandidateId") + .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("EducationEndDate") + .HasColumnType("datetime(6)") + .HasComment("วันที่สำเร็จการศึกษา"); + + b.Property("EducationLevelExamId") + .HasColumnType("char(36)") + .HasComment("Id วุฒิที่ใช้สมัครสอบ"); + + b.Property("EducationLevelExamName") + .HasColumnType("longtext") + .HasComment("วุฒิที่ใช้สมัครสอบ"); + + b.Property("EducationLevelHighId") + .HasColumnType("char(36)") + .HasComment("Id วุฒิการศึกษาสูงสุด"); + + b.Property("EducationLevelHighName") + .HasColumnType("longtext") + .HasComment("วุฒิการศึกษาสูงสุด"); + + b.Property("EducationLocation") + .HasColumnType("longtext") + .HasComment("ชื่อสถานศึกษา"); + + b.Property("EducationMajor") + .HasColumnType("longtext") + .HasComment("สาขาวิชา/วิชาเอก"); + + b.Property("EducationName") + .HasColumnType("longtext") + .HasComment("ชื่อปริญญา"); + + b.Property("EducationScores") + .HasColumnType("longtext") + .HasComment("คะแนนเฉลี่ยสะสม"); + + b.Property("EducationType") + .HasColumnType("longtext") + .HasComment("ประเภทสถานศึกษา"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .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.HasKey("Id"); + + b.HasIndex("CandidateId"); + + b.ToTable("Educations"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.PeriodExam", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("AnnouncementDate") + .HasColumnType("datetime(6)") + .HasColumnOrder(5) + .HasComment("วันประกาศผลสอบ"); + + b.Property("AnnouncementEndDate") + .HasColumnType("datetime(6)") + .HasColumnOrder(7) + .HasComment("วันสิ้นสุดประกาศ"); + + b.Property("AnnouncementExam") + .HasColumnType("tinyint(1)") + .HasComment("ประกาศนี้มีสมัครสอบคัดเลือก"); + + b.Property("AnnouncementStartDate") + .HasColumnType("datetime(6)") + .HasColumnOrder(6) + .HasComment("วันเริ่มประกาศ"); + + b.Property("Category") + .HasColumnType("longtext") + .HasComment("สำนัก"); + + b.Property("CheckDisability") + .HasColumnType("tinyint(1)") + .HasComment("คนพิการ"); + + b.Property("CheckDocument") + .HasColumnType("tinyint(1)") + .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("Detail") + .HasColumnType("longtext") + .HasComment("รายละเอียดสมัครสอบ"); + + b.Property("EditorCondition") + .HasColumnType("longtext") + .HasComment("รายละเอียดเงื่อนไขการสมัคร"); + + b.Property("EditorConfirm") + .HasColumnType("longtext") + .HasComment("รายละเอียดคำรับรอง"); + + b.Property("ExamDate") + .HasColumnType("datetime(6)") + .HasComment("วันที่สอบ"); + + b.Property("Fee") + .HasColumnType("float") + .HasComment("ค่าธรรมเนียม"); + + b.Property("ImportFileId") + .HasColumnType("char(36)"); + + b.Property("IsActive") + .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("Name") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("varchar(150)") + .HasColumnOrder(8) + .HasComment("ชื่อการสอบ"); + + b.Property("Note") + .HasColumnType("longtext") + .HasComment("หมายเหตุ"); + + b.Property("OrganizationCodeId") + .HasColumnType("char(36)") + .HasComment("Id รหัสส่วนราชการ"); + + b.Property("OrganizationCodeName") + .HasColumnType("longtext") + .HasComment("ชื่อรหัสส่วนราชการ"); + + b.Property("OrganizationId") + .HasColumnType("char(36)") + .HasComment("Id หน่วยงาน"); + + b.Property("OrganizationName") + .HasColumnType("longtext") + .HasComment("ชื่อหน่วยงาน"); + + b.Property("PaymentEndDate") + .HasColumnType("datetime(6)") + .HasColumnOrder(4) + .HasComment("วันสิ้นสุดชำระเงิน"); + + b.Property("PaymentKrungThai") + .HasColumnType("longtext") + .HasComment("ชำระเงินผ่านกรุงไทย"); + + b.Property("PaymentStartDate") + .HasColumnType("datetime(6)") + .HasColumnOrder(3) + .HasComment("วันเริ่มชำระเงิน"); + + b.Property("RegisterEndDate") + .HasColumnType("datetime(6)") + .HasColumnOrder(2) + .HasComment("วันสิ้นสุดสมัครสอบ"); + + b.Property("RegisterStartDate") + .HasColumnType("datetime(6)") + .HasColumnOrder(1) + .HasComment("วันเริ่มสมัครสอบ"); + + b.Property("Round") + .HasColumnType("int") + .HasColumnOrder(9) + .HasComment("รอบการสอบ"); + + b.Property("SetSeat") + .HasColumnType("tinyint(1)") + .HasComment("เช็คอัพคะแนน"); + + b.Property("Year") + .HasColumnType("int") + .HasComment("ปีงบประมาณ"); + + b.HasKey("Id"); + + b.HasIndex("ImportFileId"); + + b.ToTable("PeriodExams"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.PeriodExamDocument", 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("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .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("PeriodExamId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("DocumentId"); + + b.HasIndex("PeriodExamId"); + + b.ToTable("PeriodExamDocuments"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.PeriodExamImage", 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("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .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("PeriodExamId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("DocumentId"); + + b.HasIndex("PeriodExamId"); + + b.ToTable("PeriodExamImages"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.PositionExam", 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("HighDegree") + .HasColumnType("tinyint(1)") + .HasComment("ปริญญาบัตรขึ้นไป"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .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("PeriodExamId") + .HasColumnType("char(36)"); + + b.Property("PositionId") + .HasColumnType("char(36)") + .HasComment("Id ตำแหน่ง"); + + b.Property("PositionLevelId") + .HasColumnType("char(36)") + .HasComment("Id ระดับ"); + + b.Property("PositionLevelName") + .HasColumnType("longtext") + .HasComment("ชื่อระดับ"); + + b.Property("PositionName") + .HasColumnType("longtext") + .HasComment("ชื่อตำแหน่ง"); + + b.Property("TypeId") + .HasColumnType("longtext") + .HasComment("Id ประเภทแบบฟอร์ม"); + + b.Property("TypeName") + .HasColumnType("longtext") + .HasComment("ชื่อประเภทแบบฟอร์ม"); + + b.HasKey("Id"); + + b.HasIndex("PeriodExamId"); + + b.ToTable("PositionExams"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.BankExam", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.PeriodExam", "PeriodExam") + .WithMany("BankExam") + .HasForeignKey("PeriodExamId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("PeriodExam"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.CMSAgency", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.CMSCandidate", "CMSCandidate") + .WithMany("CMSAgencys") + .HasForeignKey("CMSCandidateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("CMSCandidate"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.CMSCandidate", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Documents.Document", "BannerImg") + .WithMany() + .HasForeignKey("BannerImgId"); + + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Documents.Document", "LogoImg") + .WithMany() + .HasForeignKey("LogoImgId"); + + b.Navigation("BannerImg"); + + b.Navigation("LogoImg"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.CMSGovernment", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.CMSCandidate", "CMSCandidate") + .WithMany("CMSGovernments") + .HasForeignKey("CMSCandidateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("CMSCandidate"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Candidate", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Documents.Document", "PaymentImg") + .WithMany() + .HasForeignKey("PaymentImgId"); + + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.PeriodExam", "PeriodExam") + .WithMany("Candidate") + .HasForeignKey("PeriodExamId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.PositionExam", "PositionExam") + .WithMany() + .HasForeignKey("PositionExamId"); + + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Documents.Document", "ProfileImg") + .WithMany() + .HasForeignKey("ProfileImgId"); + + b.Navigation("PaymentImg"); + + b.Navigation("PeriodExam"); + + b.Navigation("PositionExam"); + + b.Navigation("ProfileImg"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.CandidateDocument", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Candidate", "Candidate") + .WithMany() + .HasForeignKey("CandidateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Documents.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Candidate"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Career", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Candidate", "Candidate") + .WithMany() + .HasForeignKey("CandidateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Candidate"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.Disable", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.PeriodExam", "PeriodExam") + .WithMany("Disables") + .HasForeignKey("PeriodExamId") + .OnDelete(DeleteBehavior.Cascade); + + b.Navigation("PeriodExam"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.DisableAddress", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Disables.Disable", "Disable") + .WithMany("Addresses") + .HasForeignKey("DisableId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Disable"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.DisableCertificate", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Disables.Disable", "Disable") + .WithMany("Certificates") + .HasForeignKey("DisableId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Disable"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.DisableDocument", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Disables.Disable", "Disable") + .WithMany("Documents") + .HasForeignKey("DisableId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Documents.Document", "DocumentFile") + .WithMany() + .HasForeignKey("DocumentFileId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Disable"); + + b.Navigation("DocumentFile"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.DisableEducation", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Disables.Disable", "Disable") + .WithMany("Educations") + .HasForeignKey("DisableId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Disable"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.DisableImportHistory", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.PeriodExam", "PeriodExam") + .WithMany("ImportHostories") + .HasForeignKey("PeriodExamId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("PeriodExam"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.DisableOccupation", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Disables.Disable", "Disable") + .WithMany("Occupations") + .HasForeignKey("DisableId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Disable"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.DisablePayment", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Disables.Disable", "Disable") + .WithMany("Payments") + .HasForeignKey("DisableId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Disable"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.DisableScore", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Disables.ScoreImport", "ScoreImport") + .WithMany("Scores") + .HasForeignKey("ScoreImportId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ScoreImport"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.ScoreImport", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Documents.Document", "ImportFile") + .WithMany() + .HasForeignKey("ImportFileId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.PeriodExam", "PeriodExam") + .WithOne("ScoreImport") + .HasForeignKey("BMA.EHR.Recurit.Exam.Service.Models.Disables.ScoreImport", "PeriodExamId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ImportFile"); + + b.Navigation("PeriodExam"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Education", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Candidate", "Candidate") + .WithMany("Educations") + .HasForeignKey("CandidateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Candidate"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.PeriodExam", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Documents.Document", "ImportFile") + .WithMany() + .HasForeignKey("ImportFileId"); + + b.Navigation("ImportFile"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.PeriodExamDocument", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Documents.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.PeriodExam", "PeriodExam") + .WithMany("PeriodExamDocuments") + .HasForeignKey("PeriodExamId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Document"); + + b.Navigation("PeriodExam"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.PeriodExamImage", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Documents.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.PeriodExam", "PeriodExam") + .WithMany("PeriodExamImages") + .HasForeignKey("PeriodExamId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Document"); + + b.Navigation("PeriodExam"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.PositionExam", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.PeriodExam", "PeriodExam") + .WithMany("PositionExam") + .HasForeignKey("PeriodExamId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("PeriodExam"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.CMSCandidate", b => + { + b.Navigation("CMSAgencys"); + + b.Navigation("CMSGovernments"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Candidate", b => + { + b.Navigation("Educations"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.Disable", b => + { + b.Navigation("Addresses"); + + b.Navigation("Certificates"); + + b.Navigation("Documents"); + + b.Navigation("Educations"); + + b.Navigation("Occupations"); + + b.Navigation("Payments"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.ScoreImport", b => + { + b.Navigation("Scores"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.PeriodExam", b => + { + b.Navigation("BankExam"); + + b.Navigation("Candidate"); + + b.Navigation("Disables"); + + b.Navigation("ImportHostories"); + + b.Navigation("PeriodExamDocuments"); + + b.Navigation("PeriodExamImages"); + + b.Navigation("PositionExam"); + + b.Navigation("ScoreImport"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Migrations/20231001081015_Update Table PositionExam Add PositionLevel1.cs b/Migrations/20231001081015_Update Table PositionExam Add PositionLevel1.cs new file mode 100644 index 0000000..5ede968 --- /dev/null +++ b/Migrations/20231001081015_Update Table PositionExam Add PositionLevel1.cs @@ -0,0 +1,504 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace BMA.EHR.Recurit.Exam.Service.Migrations +{ + /// + public partial class UpdateTablePositionExamAddPositionLevel1 : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "DurationEnd", + table: "Educations"); + + migrationBuilder.DropColumn( + name: "DurationStart", + table: "Educations"); + + migrationBuilder.DropColumn( + name: "EducationLevelId", + table: "Educations"); + + migrationBuilder.DropColumn( + name: "EducationLevelName", + table: "Educations"); + + migrationBuilder.DropColumn( + name: "Major", + table: "Educations"); + + migrationBuilder.DropColumn( + name: "Name", + table: "Educations"); + + migrationBuilder.DropColumn( + name: "Scores", + table: "Educations"); + + migrationBuilder.DropColumn( + name: "Name", + table: "Careers"); + + migrationBuilder.DropColumn( + name: "Reason", + table: "Careers"); + + migrationBuilder.DropColumn( + name: "Salary", + table: "Careers"); + + migrationBuilder.DropColumn( + name: "OccupationCompany", + table: "Candidates"); + + migrationBuilder.DropColumn( + name: "OccupationDepartment", + table: "Candidates"); + + migrationBuilder.DropColumn( + name: "OccupationEmail", + table: "Candidates"); + + migrationBuilder.DropColumn( + name: "OccupationType", + table: "Candidates"); + + migrationBuilder.AddColumn( + name: "EducationEndDate", + table: "Educations", + type: "datetime(6)", + nullable: true, + comment: "วันที่สำเร็จการศึกษา"); + + migrationBuilder.AddColumn( + name: "EducationLevelExamId", + table: "Educations", + type: "char(36)", + nullable: true, + comment: "Id วุฒิที่ใช้สมัครสอบ", + collation: "ascii_general_ci"); + + migrationBuilder.AddColumn( + name: "EducationLevelExamName", + table: "Educations", + type: "longtext", + nullable: true, + comment: "วุฒิที่ใช้สมัครสอบ") + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "EducationLevelHighId", + table: "Educations", + type: "char(36)", + nullable: true, + comment: "Id วุฒิการศึกษาสูงสุด", + collation: "ascii_general_ci"); + + migrationBuilder.AddColumn( + name: "EducationLevelHighName", + table: "Educations", + type: "longtext", + nullable: true, + comment: "วุฒิการศึกษาสูงสุด") + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "EducationLocation", + table: "Educations", + type: "longtext", + nullable: true, + comment: "ชื่อสถานศึกษา") + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "EducationMajor", + table: "Educations", + type: "longtext", + nullable: true, + comment: "สาขาวิชา/วิชาเอก") + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "EducationName", + table: "Educations", + type: "longtext", + nullable: true, + comment: "ชื่อปริญญา") + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "EducationScores", + table: "Educations", + type: "longtext", + nullable: true, + comment: "คะแนนเฉลี่ยสะสม") + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "EducationType", + table: "Educations", + type: "longtext", + nullable: true, + comment: "ประเภทสถานศึกษา") + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "Position", + table: "Careers", + type: "longtext", + nullable: false, + comment: "ชื่อตำแหน่ง", + oldClrType: typeof(string), + oldType: "longtext", + oldComment: "ตำแหน่ง/ลักษณะงาน") + .Annotation("MySql:CharSet", "utf8mb4") + .Annotation("Relational:ColumnOrder", 3) + .OldAnnotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("Relational:ColumnOrder", 4); + + migrationBuilder.AddColumn( + name: "Group", + table: "Careers", + type: "longtext", + nullable: false, + comment: "กลุ่ม/ฝ่าย") + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "Org", + table: "Careers", + type: "longtext", + nullable: false, + comment: "สังกัด") + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "Pile", + table: "Careers", + type: "longtext", + nullable: false, + comment: "กอง") + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "RangeDate", + table: "Careers", + type: "longtext", + nullable: false, + comment: "ระยะเวลา") + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "OccupationTelephone", + table: "Candidates", + type: "varchar(20)", + maxLength: 20, + nullable: true, + comment: "ตำแหน่งปัจจุบัน เบอร์โทรที่ทำงาน", + oldClrType: typeof(string), + oldType: "varchar(20)", + oldMaxLength: 20, + oldNullable: true, + oldComment: "โทรศัพท์ บริษัท") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "OccupationPosition", + table: "Candidates", + type: "longtext", + nullable: true, + comment: "ตำแหน่งปัจจุบัน สังกัด", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "ตำแหน่งอาชีพ") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "OccupationGroup", + table: "Candidates", + type: "longtext", + nullable: true, + comment: "ตำแหน่งปัจจุบัน กลุ่ม/ฝ่าย") + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "OccupationOrg", + table: "Candidates", + type: "longtext", + nullable: true, + comment: "ตำแหน่งปัจจุบัน ชื่อตำแหน่ง") + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "OccupationPile", + table: "Candidates", + type: "longtext", + nullable: true, + comment: "ตำแหน่งปัจจุบัน กอง") + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "OccupationPositionType", + table: "Candidates", + type: "longtext", + nullable: true, + comment: "ตำแหน่งปัจจุบัน ประเภทราชการ") + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "OccupationSalary", + table: "Candidates", + type: "int", + nullable: true, + comment: "ตำแหน่งปัจจุบัน เงินเดือน"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "EducationEndDate", + table: "Educations"); + + migrationBuilder.DropColumn( + name: "EducationLevelExamId", + table: "Educations"); + + migrationBuilder.DropColumn( + name: "EducationLevelExamName", + table: "Educations"); + + migrationBuilder.DropColumn( + name: "EducationLevelHighId", + table: "Educations"); + + migrationBuilder.DropColumn( + name: "EducationLevelHighName", + table: "Educations"); + + migrationBuilder.DropColumn( + name: "EducationLocation", + table: "Educations"); + + migrationBuilder.DropColumn( + name: "EducationMajor", + table: "Educations"); + + migrationBuilder.DropColumn( + name: "EducationName", + table: "Educations"); + + migrationBuilder.DropColumn( + name: "EducationScores", + table: "Educations"); + + migrationBuilder.DropColumn( + name: "EducationType", + table: "Educations"); + + migrationBuilder.DropColumn( + name: "Group", + table: "Careers"); + + migrationBuilder.DropColumn( + name: "Org", + table: "Careers"); + + migrationBuilder.DropColumn( + name: "Pile", + table: "Careers"); + + migrationBuilder.DropColumn( + name: "RangeDate", + table: "Careers"); + + migrationBuilder.DropColumn( + name: "OccupationGroup", + table: "Candidates"); + + migrationBuilder.DropColumn( + name: "OccupationOrg", + table: "Candidates"); + + migrationBuilder.DropColumn( + name: "OccupationPile", + table: "Candidates"); + + migrationBuilder.DropColumn( + name: "OccupationPositionType", + table: "Candidates"); + + migrationBuilder.DropColumn( + name: "OccupationSalary", + table: "Candidates"); + + migrationBuilder.AddColumn( + name: "DurationEnd", + table: "Educations", + type: "datetime(6)", + nullable: false, + defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + comment: "ระยะเวลาสิ้นสุด") + .Annotation("Relational:ColumnOrder", 2); + + migrationBuilder.AddColumn( + name: "DurationStart", + table: "Educations", + type: "datetime(6)", + nullable: false, + defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + comment: "ระยะเวลาเริ่ม") + .Annotation("Relational:ColumnOrder", 1); + + migrationBuilder.AddColumn( + name: "EducationLevelId", + table: "Educations", + type: "char(36)", + nullable: true, + comment: "Idวุฒิที่ได้รับ", + collation: "ascii_general_ci"); + + migrationBuilder.AddColumn( + name: "EducationLevelName", + table: "Educations", + type: "longtext", + nullable: true, + comment: "วุฒิที่ได้รับ") + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "Major", + table: "Educations", + type: "longtext", + nullable: false, + comment: "สาขาวิชา/วิชาเอก") + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "Name", + table: "Educations", + type: "longtext", + nullable: false, + comment: "ชื่อสถานศึกษา") + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "Scores", + table: "Educations", + type: "float", + maxLength: 10, + nullable: false, + defaultValue: 0f, + comment: "คะแนนเฉลี่ยตลอดหลักสูตร") + .Annotation("Relational:ColumnOrder", 6); + + migrationBuilder.AlterColumn( + name: "Position", + table: "Careers", + type: "longtext", + nullable: false, + comment: "ตำแหน่ง/ลักษณะงาน", + oldClrType: typeof(string), + oldType: "longtext", + oldComment: "ชื่อตำแหน่ง") + .Annotation("MySql:CharSet", "utf8mb4") + .Annotation("Relational:ColumnOrder", 4) + .OldAnnotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("Relational:ColumnOrder", 3); + + migrationBuilder.AddColumn( + name: "Name", + table: "Careers", + type: "longtext", + nullable: false, + comment: "สถานที่ทำงาน/ฝึกงาน") + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "Reason", + table: "Careers", + type: "longtext", + nullable: false, + comment: "เหตุผลที่ออก") + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "Salary", + table: "Careers", + type: "int", + maxLength: 20, + nullable: false, + defaultValue: 0, + comment: "เงินเดือนสุดท้ายก่อนออก") + .Annotation("Relational:ColumnOrder", 5); + + migrationBuilder.AlterColumn( + name: "OccupationTelephone", + table: "Candidates", + type: "varchar(20)", + maxLength: 20, + nullable: true, + comment: "โทรศัพท์ บริษัท", + oldClrType: typeof(string), + oldType: "varchar(20)", + oldMaxLength: 20, + oldNullable: true, + oldComment: "ตำแหน่งปัจจุบัน เบอร์โทรที่ทำงาน") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "OccupationPosition", + table: "Candidates", + type: "longtext", + nullable: true, + comment: "ตำแหน่งอาชีพ", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "ตำแหน่งปัจจุบัน สังกัด") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "OccupationCompany", + table: "Candidates", + type: "longtext", + nullable: true, + comment: "สำนัก/บริษัท บริษัท") + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "OccupationDepartment", + table: "Candidates", + type: "longtext", + nullable: true, + comment: "กอง/ฝ่าย บริษัท") + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "OccupationEmail", + table: "Candidates", + type: "varchar(200)", + maxLength: 200, + nullable: true, + comment: "อีเมล บริษัท") + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "OccupationType", + table: "Candidates", + type: "longtext", + nullable: true, + comment: "ประเภทอาชีพที่ทำงานมาก่อน") + .Annotation("MySql:CharSet", "utf8mb4"); + } + } +} diff --git a/Models/Candidate.cs b/Models/Candidate.cs index eb5f47e..54ba6b4 100644 --- a/Models/Candidate.cs +++ b/Models/Candidate.cs @@ -110,6 +110,12 @@ namespace BMA.EHR.Recurit.Exam.Service.Models [Comment("สถานภาพ")] public string? RelationshipName { get; set; } + [Comment("Id ศาสนา")] + public Guid? ReligionId { get; set; } + + [Comment("ศาสนา")] + public string? ReligionName { get; set; } + [MaxLength(200), Comment("อีเมล")] public string? Email { get; set; } @@ -253,24 +259,20 @@ namespace BMA.EHR.Recurit.Exam.Service.Models [MaxLength(100), Comment("สัญชาติมารดา")] public string? MotherNationality { get; set; } - - - [Comment("ประเภทอาชีพที่ทำงานมาก่อน")] - public string? OccupationType { get; set; } - - [Comment("ตำแหน่งอาชีพ")] + [Comment("ตำแหน่งปัจจุบัน ชื่อตำแหน่ง")] + public string? OccupationOrg { get; set; } + [Comment("ตำแหน่งปัจจุบัน กอง")] + public string? OccupationPile { get; set; } + [Comment("ตำแหน่งปัจจุบัน กลุ่ม/ฝ่าย")] + public string? OccupationGroup { get; set; } + [Comment("ตำแหน่งปัจจุบัน เงินเดือน")] + public int? OccupationSalary { get; set; } + [Comment("ตำแหน่งปัจจุบัน สังกัด")] public string? OccupationPosition { get; set; } + [Comment("ตำแหน่งปัจจุบัน ประเภทราชการ")] + public string? OccupationPositionType { get; set; } - [Comment("สำนัก/บริษัท บริษัท")] - public string? OccupationCompany { get; set; } - - [Comment("กอง/ฝ่าย บริษัท")] - public string? OccupationDepartment { get; set; } - - [MaxLength(200), Comment("อีเมล บริษัท")] - public string? OccupationEmail { get; set; } - - [MaxLength(20), Comment("โทรศัพท์ บริษัท")] + [MaxLength(20), Comment("ตำแหน่งปัจจุบัน เบอร์โทรที่ทำงาน")] public string? OccupationTelephone { get; set; } [Comment("เหตุผลการไม่อนุมัติ")] diff --git a/Models/Career.cs b/Models/Career.cs index c4561e0..0c25b92 100644 --- a/Models/Career.cs +++ b/Models/Career.cs @@ -6,17 +6,20 @@ namespace BMA.EHR.Recurit.Exam.Service.Models { public class Career : EntityBase { - [Required, Column(Order = 7), Comment("Id ผู้สมัคร")] + [Required, Column(Order = 8), Comment("Id ผู้สมัคร")] public virtual Candidate? Candidate { get; set; } - [Required, Column(Order = 3), Comment("สถานที่ทำงาน/ฝึกงาน")] - public string Name { get; set; } = string.Empty; - - [Required, Column(Order = 4), Comment("ตำแหน่ง/ลักษณะงาน")] + [Required, Column(Order = 3), Comment("ชื่อตำแหน่ง")] public string Position { get; set; } = string.Empty; - [Required, MaxLength(20), Column(Order = 5), Comment("เงินเดือนสุดท้ายก่อนออก")] - public int Salary { get; set; } + [Required, Column(Order = 4), Comment("กลุ่ม/ฝ่าย")] + public string Group { get; set; } = string.Empty; + + [Required, Column(Order = 5), Comment("กอง")] + public string Pile { get; set; } = string.Empty; + + [Required, Column(Order = 6), Comment("สังกัด")] + public string Org { get; set; } = string.Empty; [Required, Column(Order = 1), Comment("ระยะเวลาเริ่ม")] public DateTime DurationStart { get; set; } = DateTime.Now.Date; @@ -24,7 +27,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Models [Required, Column(Order = 2), Comment("ระยะเวลาสิ้นสุด")] public DateTime DurationEnd { get; set; } = DateTime.Now.Date; - [Required, Column(Order = 6), Comment("เหตุผลที่ออก")] - public string Reason { get; set; } = string.Empty; + [Required, Column(Order = 7), Comment("ระยะเวลา")] + public string RangeDate { get; set; } = string.Empty; } } diff --git a/Models/Education.cs b/Models/Education.cs index 2954925..439f305 100644 --- a/Models/Education.cs +++ b/Models/Education.cs @@ -8,26 +8,25 @@ namespace BMA.EHR.Recurit.Exam.Service.Models { [Required, Column(Order = 7), Comment("Id ผู้สมัคร")] public virtual Candidate? Candidate { get; set; } - - [Comment("Idวุฒิที่ได้รับ")] - public Guid? EducationLevelId { get; set; } - - [Comment("วุฒิที่ได้รับ")] - public string? EducationLevelName { get; set; } - - [Required, Column(Order = 4), Comment("สาขาวิชา/วิชาเอก")] - public string Major { get; set; } = string.Empty; - - [Required, MaxLength(10), Column(Order = 6), Comment("คะแนนเฉลี่ยตลอดหลักสูตร")] - public float Scores { get; set; } - - [Required, Column(Order = 3), Comment("ชื่อสถานศึกษา")] - public string Name { get; set; } = string.Empty; - - [Required, Column(Order = 1), Comment("ระยะเวลาเริ่ม")] - public DateTime DurationStart { get; set; } = DateTime.Now.Date; - - [Required, Column(Order = 2), Comment("ระยะเวลาสิ้นสุด")] - public DateTime DurationEnd { get; set; } = DateTime.Now.Date; + [Comment("Id วุฒิที่ใช้สมัครสอบ")] + public Guid? EducationLevelExamId { get; set; } + [Comment("วุฒิที่ใช้สมัครสอบ")] + public string? EducationLevelExamName { get; set; } + [Comment("ชื่อปริญญา")] + public string? EducationName { get; set; } + [Comment("สาขาวิชา/วิชาเอก")] + public string? EducationMajor { get; set; } + [Comment("ชื่อสถานศึกษา")] + public string? EducationLocation { get; set; } + [Comment("ประเภทสถานศึกษา")] + public string? EducationType { get; set; } + [Comment("วันที่สำเร็จการศึกษา")] + public DateTime? EducationEndDate { get; set; } + [Comment("คะแนนเฉลี่ยสะสม")] + public string? EducationScores { get; set; } + [Comment("Id วุฒิการศึกษาสูงสุด")] + public Guid? EducationLevelHighId { get; set; } + [Comment("วุฒิการศึกษาสูงสุด")] + public string? EducationLevelHighName { get; set; } } } diff --git a/Models/PeriodExam.cs b/Models/PeriodExam.cs index bb3f062..24cdf03 100644 --- a/Models/PeriodExam.cs +++ b/Models/PeriodExam.cs @@ -68,6 +68,12 @@ namespace BMA.EHR.Recurit.Exam.Service.Models [Comment("รายละเอียดสมัครสอบ")] public string? Detail { get; set; } + [Comment("รายละเอียดเงื่อนไขการสมัคร")] + public string? EditorCondition { get; set; } + + [Comment("รายละเอียดคำรับรอง")] + public string? EditorConfirm { get; set; } + [Comment("หมายเหตุ")] public string? Note { get; set; } diff --git a/Models/Placement/PlacementProfile.cs b/Models/Placement/PlacementProfile.cs index 7f712f9..ef8515d 100644 --- a/Models/Placement/PlacementProfile.cs +++ b/Models/Placement/PlacementProfile.cs @@ -173,23 +173,21 @@ namespace BMA.EHR.Domain.Models.Placement [MaxLength(100), Comment("สัญชาติมารดา")] public string? MotherNationality { get; set; } - [Comment("ประเภทอาชีพที่ทำงานมาก่อน")] - public string? OccupationType { get; set; } - - [Comment("สำนัก/บริษัท บริษัท")] - public string? OccupationCompany { get; set; } - - [Comment("กอง/ฝ่าย บริษัท")] - public string? OccupationDepartment { get; set; } - - [MaxLength(200), Comment("อีเมล บริษัท")] - public string? OccupationEmail { get; set; } - - [MaxLength(200), Comment("โทรศัพท์ บริษัท")] - public string? OccupationTelephone { get; set; } - - [Comment("ตำแหน่งอาชีพ")] + [Comment("ตำแหน่งปัจจุบัน ชื่อตำแหน่ง")] + public string? OccupationOrg { get; set; } + [Comment("ตำแหน่งปัจจุบัน กอง")] + public string? OccupationPile { get; set; } + [Comment("ตำแหน่งปัจจุบัน กลุ่ม/ฝ่าย")] + public string? OccupationGroup { get; set; } + [Comment("ตำแหน่งปัจจุบัน เงินเดือน")] + public int? OccupationSalary { get; set; } + [Comment("ตำแหน่งปัจจุบัน สังกัด")] public string? OccupationPosition { get; set; } + [Comment("ตำแหน่งปัจจุบัน ประเภทราชการ")] + public string? OccupationPositionType { get; set; } + + [MaxLength(20), Comment("ตำแหน่งปัจจุบัน เบอร์โทรที่ทำงาน")] + public string? OccupationTelephone { get; set; } // [Comment("Id ตำแหน่งเลขที่")] // public PositionNumberEntity? PositionNumber { get; set; } diff --git a/Models/Placement/PositionLevel.cs b/Models/Placement/PositionLevel.cs new file mode 100644 index 0000000..8f2cd5a --- /dev/null +++ b/Models/Placement/PositionLevel.cs @@ -0,0 +1,25 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Recurit.Exam.Service.Models; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.Domain.Models.Placement +{ + public class PositionLevel : EntityBaseNoIsActive + { + [Column(Order = 1), Comment("ลำดับ")] + public int? Order { get; set; } + + [Required, MaxLength(100), Column(Order = 2), Comment("ชื่อระดับตำแหน่ง")] + public string Name { get; set; } = string.Empty; + + [Required, MaxLength(100), Column(Order = 3), Comment("ชื่อย่อระดับตำแหน่ง")] + public string ShortName { get; set; } = string.Empty; + + [Column(Order = 4), Comment("ลำดับชั้นของระดับตำแหน่ง")] + public int Level { get; set; } = 0; + + [Column(Order = 5), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/Models/PositionExam.cs b/Models/PositionExam.cs index f3ac20a..8ec3a7f 100644 --- a/Models/PositionExam.cs +++ b/Models/PositionExam.cs @@ -2,6 +2,7 @@ using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations; using BMA.EHR.Recurit.Exam.Service.Models.Documents; +using BMA.EHR.Domain.Models.Placement; namespace BMA.EHR.Recurit.Exam.Service.Models { @@ -16,13 +17,19 @@ namespace BMA.EHR.Recurit.Exam.Service.Models [Comment("ชื่อตำแหน่ง")] public string? PositionName { get; set; } + [Comment("Id ระดับ")] + public Guid? PositionLevelId { get; set; } + + [Comment("ชื่อระดับ")] + public string? PositionLevelName { get; set; } + [Comment("Id ประเภทแบบฟอร์ม")] public string? TypeId { get; set; } [Comment("ชื่อประเภทแบบฟอร์ม")] public string? TypeName { get; set; } - [Comment("ปริญญาขึ้นไป")] + [Comment("ปริญญาบัตรขึ้นไป")] public bool HighDegree { get; set; } } } diff --git a/Request/RequestCardCandidate.cs b/Request/RequestCardCandidate.cs index 6215c06..9260c5f 100644 --- a/Request/RequestCardCandidate.cs +++ b/Request/RequestCardCandidate.cs @@ -35,6 +35,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Request public int? ReviewPoint { get; set; } public string? Review { get; set; } public string? Position { get; set; } + public string? PositionLevel { get; set; } public string? HighDegree { get; set; } public DateTime? AnnouncementDate { get; set; } public Guid? Id { get; set; } diff --git a/Request/RequestPeriodExam.cs b/Request/RequestPeriodExam.cs index e30aa4a..0e617f8 100644 --- a/Request/RequestPeriodExam.cs +++ b/Request/RequestPeriodExam.cs @@ -26,6 +26,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Request public bool AnnouncementExam { get; set; } public string? Category { get; set; } public string? Detail { get; set; } + public string? EditorCondition { get; set; } + public string? EditorConfirm { get; set; } public string? Note { get; set; } public List? Doc { get; set; } public List? Image { get; set; } diff --git a/Request/RequestPositionExam.cs b/Request/RequestPositionExam.cs index efb6e35..2d0cd1a 100644 --- a/Request/RequestPositionExam.cs +++ b/Request/RequestPositionExam.cs @@ -7,6 +7,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Request public Guid? Id { get; set; } public Guid? PositionId { get; set; } public string? PositionName { get; set; } + public Guid? PositionLevelId { get; set; } + public string? PositionLevelName { get; set; } public bool HighDegree { get; set; } public string? TypeId { get; set; } public string? TypeName { get; set; } diff --git a/Request/RequestPositionName.cs b/Request/RequestPositionName.cs index 9f6c73c..2e657d7 100644 --- a/Request/RequestPositionName.cs +++ b/Request/RequestPositionName.cs @@ -8,6 +8,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Request public string? Name { get; set; } public int? Round { get; set; } public int? Year { get; set; } - public PositionExam? Posiiton { get; set; } + public string? Position { get; set; } + public string? PositionLevel { get; set; } } } diff --git a/Request/RequestStatusRegistry.cs b/Request/RequestStatusRegistry.cs index 7f2750c..981edb7 100644 --- a/Request/RequestStatusRegistry.cs +++ b/Request/RequestStatusRegistry.cs @@ -10,6 +10,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Request public bool Bank { get; set; } public bool Payment { get; set; } public string? Status { get; set; } + public string? EditorCondition { get; set; } + public string? EditorConfirm { get; set; } public PositionExam? PositionExam { get; set; } } } diff --git a/Response/CMSExamResponseItem.cs b/Response/CMSExamResponseItem.cs index 37e1869..fd4e55f 100644 --- a/Response/CMSExamResponseItem.cs +++ b/Response/CMSExamResponseItem.cs @@ -21,9 +21,13 @@ namespace BMA.EHR.Recurit.Exam.Service.Response public string? Payment_endDate { get; set; } public string? Title { get; set; } public string? Detail { get; set; } + public string? EditorCondition { get; set; } + public string? EditorConfirm { get; set; } public string? Image { get; set; } public List? Images { get; set; } public List? Files { get; set; } public List? Positions { get; set; } + public List? PositionsTrue { get; set; } + public List? PositionsFalse { get; set; } } } diff --git a/Response/CandidateCareerResponseItem.cs b/Response/CandidateCareerResponseItem.cs index 588d326..5e7f92a 100644 --- a/Response/CandidateCareerResponseItem.cs +++ b/Response/CandidateCareerResponseItem.cs @@ -3,11 +3,12 @@ namespace BMA.EHR.Recurit.Exam.Service.Response { public class CandidateCareerResponseItem { - public string Name { get; set; } = string.Empty; public string Position { get; set; } = string.Empty; - public int Salary { get; set; } - public DateTime DurationStart { get; set; } - public DateTime DurationEnd { get; set; } - public string Reason { get; set; } = string.Empty; + public string Group { get; set; } = string.Empty; + public string Pile { get; set; } = string.Empty; + public string Org { get; set; } = string.Empty; + public DateTime DurationStart { get; set; } = DateTime.Now.Date; + public DateTime DurationEnd { get; set; } = DateTime.Now.Date; + public string RangeDate { get; set; } = string.Empty; } } diff --git a/Response/CandidateEducationResponseItem.cs b/Response/CandidateEducationResponseItem.cs index a875ba2..bb3502f 100644 --- a/Response/CandidateEducationResponseItem.cs +++ b/Response/CandidateEducationResponseItem.cs @@ -3,11 +3,13 @@ namespace BMA.EHR.Recurit.Exam.Service.Response { public class CandidateEducationResponseItem { - public string EducationLevelId { get; set; } = string.Empty; - public string Major { get; set; } = string.Empty; - public float Scores { get; set; } - public string Name { get; set; } = string.Empty; - public DateTime DurationStart { get; set; } - public DateTime DurationEnd { get; set; } + public Guid EducationLevelExamId { get; set; } + public string EducationName { get; set; } = string.Empty; + public string EducationMajor { get; set; } = string.Empty; + public string EducationLocation { get; set; } = string.Empty; + public string EducationType { get; set; } = string.Empty; + public DateTime EducationEndDate { get; set; } + public string EducationScores { get; set; } = string.Empty; + public Guid EducationLevelHighId { get; set; } } } diff --git a/Response/CandidateInformationResponseItem.cs b/Response/CandidateInformationResponseItem.cs index a01ff4b..a0beb2a 100644 --- a/Response/CandidateInformationResponseItem.cs +++ b/Response/CandidateInformationResponseItem.cs @@ -13,6 +13,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Response // public Models.Relationship? Relationship { get; set; } public string? RelationshipId { get; set; } public string? Relationship { get; set; } + public string? ReligionId { get; set; } + public string? Religion { get; set; } public string? Email { get; set; } = string.Empty; public string? CitizenId { get; set; } = string.Empty; // public Models.Province? CitizenProvince { get; set; } diff --git a/Response/CandidateOccupationResponseItem.cs b/Response/CandidateOccupationResponseItem.cs index 66f058e..14c7b9a 100644 --- a/Response/CandidateOccupationResponseItem.cs +++ b/Response/CandidateOccupationResponseItem.cs @@ -3,16 +3,12 @@ namespace BMA.EHR.Recurit.Exam.Service.Response { public class CandidateOccupationResponseItem { - public string? OccupationType { get; set; } - - public string? OccupationCompany { get; set; } - - public string? OccupationDepartment { get; set; } - - public string? OccupationEmail { get; set; } - - public string? OccupationTelephone { get; set; } - + public string? OccupationOrg { get; set; } + public string? OccupationPile { get; set; } + public string? OccupationGroup { get; set; } + public int? OccupationSalary { get; set; } public string? OccupationPosition { get; set; } + public string? OccupationPositionType { get; set; } + public string? OccupationTelephone { get; set; } } } diff --git a/Response/CandidateResponseItem.cs b/Response/CandidateResponseItem.cs index 47a109d..9baa441 100644 --- a/Response/CandidateResponseItem.cs +++ b/Response/CandidateResponseItem.cs @@ -11,17 +11,17 @@ namespace BMA.EHR.Recurit.Exam.Service.Response public string? Nationality { get; set; } = string.Empty; public DateTime? DateOfBirth { get; set; } // public Models.Relationship? Relationship { get; set; } - public string? RelationshipId { get; set; } - public string? Relationship { get; set; } + public string? ReligionId { get; set; } + // public string? Religion { get; set; } public string? Email { get; set; } = string.Empty; public string? CitizenId { get; set; } = string.Empty; // public Models.Province? CitizenProvince { get; set; } - public string? CitizenProvinceId { get; set; } - public string? CitizenProvince { get; set; } - // public Models.District? CitizenDistrict { get; set; } - public string? CitizenDistrictId { get; set; } - public string? CitizenDistrict { get; set; } - public DateTime? CitizenDate { get; set; } + // public string? CitizenProvinceId { get; set; } + // public string? CitizenProvince { get; set; } + // // public Models.District? CitizenDistrict { get; set; } + // public string? CitizenDistrictId { get; set; } + // public string? CitizenDistrict { get; set; } + // public DateTime? CitizenDate { get; set; } public string? Telephone { get; set; } public string? MobilePhone { get; set; } public string? Knowledge { get; set; } @@ -48,38 +48,43 @@ namespace BMA.EHR.Recurit.Exam.Service.Response public string? CurrentSubDistrictId { get; set; } public string? CurrentSubDistrict { get; set; } public string? CurrentZipCode { get; set; } - public bool? Marry { get; set; } - // public Models.Prefix? MarryPrefix { get; set; } - public string? MarryPrefixId { get; set; } - public string? MarryPrefix { get; set; } - public string? MarryFirstName { get; set; } - public string? MarryLastName { get; set; } - public string? MarryOccupation { get; set; } - public string? MarryNationality { get; set; } - // public Models.Prefix? FatherPrefix { get; set; } - public string? FatherPrefixId { get; set; } - public string? FatherPrefix { get; set; } - public string? FatherFirstName { get; set; } - public string? FatherLastName { get; set; } - public string? FatherOccupation { get; set; } - public string? FatherNationality { get; set; } - // public Models.Prefix? MotherPrefix { get; set; } - public string? MotherPrefixId { get; set; } - public string? MotherPrefix { get; set; } - public string? MotherFirstName { get; set; } - public string? MotherLastName { get; set; } - public string? MotherOccupation { get; set; } - public string? MotherNationality { get; set; } - public string? OccupationType { get; set; } - - public string? OccupationCompany { get; set; } - - public string? OccupationDepartment { get; set; } - - public string? OccupationEmail { get; set; } - + // public bool? Marry { get; set; } + // // public Models.Prefix? MarryPrefix { get; set; } + // public string? MarryPrefixId { get; set; } + // public string? MarryPrefix { get; set; } + // public string? MarryFirstName { get; set; } + // public string? MarryLastName { get; set; } + // public string? MarryOccupation { get; set; } + // public string? MarryNationality { get; set; } + // // public Models.Prefix? FatherPrefix { get; set; } + // public string? FatherPrefixId { get; set; } + // public string? FatherPrefix { get; set; } + // public string? FatherFirstName { get; set; } + // public string? FatherLastName { get; set; } + // public string? FatherOccupation { get; set; } + // public string? FatherNationality { get; set; } + // // public Models.Prefix? MotherPrefix { get; set; } + // public string? MotherPrefixId { get; set; } + // public string? MotherPrefix { get; set; } + // public string? MotherFirstName { get; set; } + // public string? MotherLastName { get; set; } + // public string? MotherOccupation { get; set; } + // public string? MotherNationality { get; set; } + public string? OccupationOrg { get; set; } + public string? OccupationPile { get; set; } + public string? OccupationGroup { get; set; } + public int? OccupationSalary { get; set; } + public string? OccupationPosition { get; set; } + public string? OccupationPositionType { get; set; } public string? OccupationTelephone { get; set; } - public string? OccupationPosition { get; set; } + public Guid EducationLevelExamId { get; set; } + public string EducationName { get; set; } = string.Empty; + public string EducationMajor { get; set; } = string.Empty; + public string EducationLocation { get; set; } = string.Empty; + public string EducationType { get; set; } = string.Empty; + public DateTime EducationEndDate { get; set; } + public string EducationScores { get; set; } = string.Empty; + public Guid EducationLevelHighId { get; set; } } } diff --git a/Response/HomePageResponseItem.cs b/Response/HomePageResponseItem.cs index 17d52a4..3a4f160 100644 --- a/Response/HomePageResponseItem.cs +++ b/Response/HomePageResponseItem.cs @@ -17,6 +17,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Response public class HomePageLinkResponseItem { public string? Title { get; set; } + public string? Level { get; set; } public string? Url { get; set; } public string? Id { get; set; } public string? Path { get; set; } diff --git a/Response/PeriodExamCandidateResponseItem.cs b/Response/PeriodExamCandidateResponseItem.cs index e2e5a01..cf04caf 100644 --- a/Response/PeriodExamCandidateResponseItem.cs +++ b/Response/PeriodExamCandidateResponseItem.cs @@ -30,6 +30,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Response public bool AnnouncementExam { get; set; } public string? Category { get; set; } public string? Detail { get; set; } + public string? EditorCondition { get; set; } + public string? EditorConfirm { get; set; } public string? Note { get; set; } public bool IsActive { get; set; } public bool SetSeat { get; set; } diff --git a/Services/CMSCandidateService.cs b/Services/CMSCandidateService.cs index 4a562d0..8bd8d8d 100644 --- a/Services/CMSCandidateService.cs +++ b/Services/CMSCandidateService.cs @@ -460,11 +460,13 @@ namespace BMA.EHR.Recurit.Exam.Service.Services Announcement_endDate = x.AnnouncementEndDate.ToString("yyyy-MM-dd"), AnnouncementExam = x.AnnouncementExam, Register_startDate = x.RegisterStartDate == null ? null : x.RegisterStartDate.Value.ToString("yyyy-MM-dd"), - Register_endDate = x.RegisterEndDate == null ? null : x.RegisterEndDate.Value.ToString("yyyy-MM-dd"), + Register_endDate = x.RegisterEndDate == null || x.RegisterEndDate == x.RegisterStartDate ? null : x.RegisterEndDate.Value.ToString("yyyy-MM-dd"), Payment_startDate = x.PaymentStartDate == null ? null : x.PaymentStartDate.Value.ToString("yyyy-MM-dd"), - Payment_endDate = x.PaymentEndDate == null ? null : x.PaymentEndDate.Value.ToString("yyyy-MM-dd"), + Payment_endDate = x.PaymentEndDate == null || x.PaymentEndDate == x.PaymentStartDate ? null : x.PaymentEndDate.Value.ToString("yyyy-MM-dd"), Title = x.Name, Detail = x.Detail, + EditorCondition = x.EditorCondition, + EditorConfirm = x.EditorConfirm, Images = x.PeriodExamImages.OrderBy(x => x.CreatedAt).Select(s => new HomePageLinkResponseItem { Title = s.Document.FileName, @@ -479,9 +481,29 @@ namespace BMA.EHR.Recurit.Exam.Service.Services { Id = s.Id.ToString(), Title = s.PositionName == null ? x.Name : s.PositionName, - HighDegree = s.HighDegree == true ? "ปริญญาขึ้นไป" : "ต่ำกว่าปริญญาตรี", + Level = s.PositionLevelName == null ? "-" : s.PositionLevelName, + HighDegree = s.HighDegree == true ? "ปริญญาบัตรขึ้นไป" : "ต่ำกว่าปริญญาบัตร", Path = $"{x.Id}/{s.Id}", - }).ToList(), + }) + .ToList(), + PositionsTrue = x.PositionExam.OrderBy(x => x.CreatedAt).Where(x => x.HighDegree == true).Select(s => new HomePageLinkResponseItem + { + Id = s.Id.ToString(), + Title = s.PositionName == null ? x.Name : s.PositionName, + Level = s.PositionLevelName == null ? "-" : s.PositionLevelName, + HighDegree = s.HighDegree == true ? "ปริญญาบัตรขึ้นไป" : "ต่ำกว่าปริญญาบัตร", + Path = $"{x.Id}/{s.Id}", + }) + .ToList(), + PositionsFalse = x.PositionExam.OrderBy(x => x.CreatedAt).Where(x => x.HighDegree == false).Select(s => new HomePageLinkResponseItem + { + Id = s.Id.ToString(), + Title = s.PositionName == null ? x.Name : s.PositionName, + Level = s.PositionLevelName == null ? "-" : s.PositionLevelName, + HighDegree = s.HighDegree == true ? "ปริญญาบัตรขึ้นไป" : "ต่ำกว่าปริญญาบัตร", + Path = $"{x.Id}/{s.Id}", + }) + .ToList(), }) .FirstOrDefaultAsync(); diff --git a/Services/CandidateService.cs b/Services/CandidateService.cs index e5cf496..679a2aa 100644 --- a/Services/CandidateService.cs +++ b/Services/CandidateService.cs @@ -1,4 +1,5 @@ using System.Security.Claims; +using BMA.EHR.Domain.Models.Placement; using BMA.EHR.Recurit.Exam.Service.Core; using BMA.EHR.Recurit.Exam.Service.Data; using BMA.EHR.Recurit.Exam.Service.Models; @@ -87,8 +88,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Services LastName = x.LastName, Nationality = x.Nationality, DateOfBirth = x.DateOfBirth, - Relationship = x.RelationshipName, - RelationshipId = x.RelationshipId != null ? x.RelationshipId.ToString() : null, + Religion = x.ReligionName, + ReligionId = x.ReligionId != null ? x.ReligionId.ToString() : null, CitizenProvince = x.CitizenProvinceName, CitizenProvinceId = x.CitizenProvinceId != null ? x.CitizenProvinceId.ToString() : null, CitizenDistrict = x.CitizenDistrictName, @@ -114,8 +115,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Services LastName = x.LastName, Nationality = x.Nationality, DateOfBirth = x.DateOfBirth, - Relationship = x.RelationshipName, - RelationshipId = x.RelationshipId != null ? x.RelationshipId.ToString() : null, + Religion = x.ReligionName, + ReligionId = x.ReligionId != null ? x.ReligionId.ToString() : null, CitizenProvince = x.CitizenProvinceName, CitizenProvinceId = x.CitizenProvinceId != null ? x.CitizenProvinceId.ToString() : null, CitizenDistrict = x.CitizenDistrictName, @@ -294,12 +295,13 @@ namespace BMA.EHR.Recurit.Exam.Service.Services .Where(x => x.PeriodExam == exam && x.UserId == UserId && x.PositionExam == position) .Select(x => new CandidateOccupationResponseItem { - OccupationType = x.OccupationType, - OccupationCompany = x.OccupationCompany, - OccupationDepartment = x.OccupationDepartment, - OccupationEmail = x.OccupationEmail, - OccupationTelephone = x.OccupationTelephone, + OccupationOrg = x.OccupationOrg, + OccupationPile = x.OccupationPile, + OccupationGroup = x.OccupationGroup, + OccupationSalary = x.OccupationSalary, OccupationPosition = x.OccupationPosition, + OccupationPositionType = x.OccupationPositionType, + OccupationTelephone = x.OccupationTelephone, }) .FirstOrDefaultAsync(); } @@ -309,12 +311,13 @@ namespace BMA.EHR.Recurit.Exam.Service.Services .Where(x => x.PeriodExam == exam && x.UserId == UserId) .Select(x => new CandidateOccupationResponseItem { - OccupationType = x.OccupationType, - OccupationCompany = x.OccupationCompany, - OccupationDepartment = x.OccupationDepartment, - OccupationEmail = x.OccupationEmail, - OccupationTelephone = x.OccupationTelephone, + OccupationOrg = x.OccupationOrg, + OccupationPile = x.OccupationPile, + OccupationGroup = x.OccupationGroup, + OccupationSalary = x.OccupationSalary, OccupationPosition = x.OccupationPosition, + OccupationPositionType = x.OccupationPositionType, + OccupationTelephone = x.OccupationTelephone, }) .FirstOrDefaultAsync(); } @@ -353,7 +356,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services .ToListAsync(); } - public async Task> GetsAsyncEducation(string examId, string positionId) + public async Task GetsAsyncEducation(string examId, string positionId) { var exam = await _context.PeriodExams.AsQueryable() .Where(p => p.CheckDisability == false) @@ -382,8 +385,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services return await _context.Educations.AsQueryable() .Where(x => x.Candidate == candidate) - .OrderBy(d => d.DurationStart) - .ToListAsync(); + .FirstOrDefaultAsync(); } public async Task> GetsAsyncFileUpload(string examId, string positionId) @@ -574,12 +576,12 @@ namespace BMA.EHR.Recurit.Exam.Service.Services return candidate.PaymentImg == null ? "" : candidate.PaymentImg.Detail.ToString(); } - public async Task GetsAsyncRegisterExam(string examId, string positionId) + public async Task GetsAsyncRegisterExam(Guid examId, Guid positionId) { var exam = await _context.PeriodExams.AsQueryable() .Where(p => p.CheckDisability == false) .Include(x => x.BankExam) - .FirstOrDefaultAsync(x => x.Id == Guid.Parse(examId)); + .FirstOrDefaultAsync(x => x.Id == examId); if (exam == null) throw new Exception(GlobalMessages.ExamNotFound); @@ -588,9 +590,9 @@ namespace BMA.EHR.Recurit.Exam.Service.Services .FirstOrDefaultAsync(x => x.PeriodExam == exam && x.UserId == UserId); var position = await _context.PositionExams.AsQueryable() - .FirstOrDefaultAsync(x => x.Id == Guid.Parse(positionId) && x.PeriodExam == exam); + .FirstOrDefaultAsync(x => x.Id == positionId); - if (positionId != "00000000-0000-0000-0000-000000000000") + if (positionId != Guid.Parse("00000000-0000-0000-0000-000000000000")) { // var position = await _context.PositionExams.AsQueryable() // .FirstOrDefaultAsync(x => x.Id == Guid.Parse(positionId) && x.PeriodExam == exam); @@ -613,6 +615,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Services PositionExam = candidatePosition?.PositionExam, Bank = exam.BankExam.Count() > 0, Payment = exam.Fee > 0, + EditorCondition = exam.EditorCondition, + EditorConfirm = exam.EditorConfirm, Position = candidatePosition == null ? false : true }; } @@ -673,7 +677,9 @@ namespace BMA.EHR.Recurit.Exam.Service.Services { var candidateId = await CreateAsyncCandidate(examId, positionId); - var candidate = await _context.Candidates.AsQueryable() + var candidate = await _context.Candidates + .AsQueryable() + .Include(x => x.Educations) .FirstOrDefaultAsync(x => x.Id == Guid.Parse(candidateId)); if (candidate == null) @@ -691,40 +697,16 @@ namespace BMA.EHR.Recurit.Exam.Service.Services candidate.PrefixName = prefix.Name; } - if (updated.RelationshipId != null) + if (updated.ReligionId != null) { - var relationship = await _contextMetadata.Relationships.AsQueryable() - .FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.RelationshipId)); + var religion = await _contextMetadata.Religions.AsQueryable() + .FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.ReligionId)); - if (relationship == null) - throw new Exception(GlobalMessages.RelationshipNotFound); + if (religion == null) + throw new Exception(GlobalMessages.ReligionNotFound); - candidate.RelationshipId = relationship.Id; - candidate.RelationshipName = relationship.Name; - } - - if (updated.CitizenProvinceId != null) - { - var citizenProvince = await _contextMetadata.Provinces.AsQueryable() - .FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.CitizenProvinceId)); - - if (citizenProvince == null) - throw new Exception(GlobalMessages.ProvinceNotFound); - - candidate.CitizenProvinceId = citizenProvince.Id; - candidate.CitizenProvinceName = citizenProvince.Name; - } - - if (updated.CitizenDistrictId != null) - { - var citizenDistrict = await _contextMetadata.Districts.AsQueryable() - .FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.CitizenDistrictId)); - - if (citizenDistrict == null) - throw new Exception(GlobalMessages.DistrictNotFound); - - candidate.CitizenDistrictId = citizenDistrict.Id; - candidate.CitizenDistrictName = citizenDistrict.Name; + candidate.ReligionId = religion.Id; + candidate.ReligionName = religion.Name; } if (updated.RegistProvinceId != null) @@ -801,49 +783,12 @@ namespace BMA.EHR.Recurit.Exam.Service.Services candidate.CurrentZipCode = currentSubDistrict.ZipCode; } - if (updated.MarryPrefixId != null) - { - var prefix = await _contextMetadata.Prefixes.AsQueryable() - .FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.MarryPrefixId)); - - if (prefix == null) - throw new Exception(GlobalMessages.PrefixNotFound); - - candidate.MarryPrefixId = prefix.Id; - candidate.MarryPrefixName = prefix.Name; - } - - if (updated.FatherPrefixId != null) - { - var prefix = await _contextMetadata.Prefixes.AsQueryable() - .FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.FatherPrefixId)); - - if (prefix == null) - throw new Exception(GlobalMessages.PrefixNotFound); - - candidate.FatherPrefixId = prefix.Id; - candidate.FatherPrefixName = prefix.Name; - } - - if (updated.MotherPrefixId != null) - { - var prefix = await _contextMetadata.Prefixes.AsQueryable() - .FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.MotherPrefixId)); - - if (prefix == null) - throw new Exception(GlobalMessages.PrefixNotFound); - - candidate.MotherPrefixId = prefix.Id; - candidate.MotherPrefixName = prefix.Name; - } - candidate.FirstName = updated.FirstName; candidate.LastName = updated.LastName; candidate.Nationality = updated.Nationality; candidate.DateOfBirth = updated.DateOfBirth; candidate.Email = updated.Email; candidate.CitizenId = updated.CitizenId; - candidate.CitizenDate = updated.CitizenDate; candidate.Telephone = updated.Telephone; candidate.MobilePhone = updated.MobilePhone; candidate.Knowledge = updated.Knowledge; @@ -852,33 +797,74 @@ namespace BMA.EHR.Recurit.Exam.Service.Services candidate.RegistSame = updated.RegistSame == null ? null : updated.RegistSame; candidate.CurrentAddress = updated.CurrentAddress; - candidate.Marry = updated.Marry == null ? null : updated.Marry; - candidate.MarryFirstName = updated.MarryFirstName; - candidate.MarryLastName = updated.MarryLastName; - candidate.MarryOccupation = updated.MarryOccupation; - candidate.MarryNationality = updated.MarryNationality; - candidate.FatherFirstName = updated.FatherFirstName; - candidate.FatherLastName = updated.FatherLastName; - candidate.FatherOccupation = updated.FatherOccupation; - candidate.FatherNationality = updated.FatherNationality; - candidate.MotherFirstName = updated.MotherFirstName; - candidate.MotherLastName = updated.MotherLastName; - candidate.MotherOccupation = updated.MotherOccupation; - candidate.MotherNationality = updated.MotherNationality; - - candidate.OccupationType = updated.OccupationType; - candidate.OccupationCompany = updated.OccupationCompany; - candidate.OccupationDepartment = updated.OccupationDepartment; - candidate.OccupationEmail = updated.OccupationEmail; - candidate.OccupationTelephone = updated.OccupationTelephone; + candidate.OccupationOrg = updated.OccupationOrg; + candidate.OccupationPile = updated.OccupationPile; + candidate.OccupationGroup = updated.OccupationGroup; + candidate.OccupationSalary = updated.OccupationSalary; candidate.OccupationPosition = updated.OccupationPosition; + candidate.OccupationPositionType = updated.OccupationPositionType; + candidate.OccupationTelephone = updated.OccupationTelephone; + + var educationLevelExam = await _contextMetadata.EducationLevels.AsQueryable() + .FirstOrDefaultAsync(x => x.Id == updated.EducationLevelExamId); + + if (educationLevelExam == null) + throw new Exception(GlobalMessages.EducationLevelNotFound); + + var educationLevelHigh = await _contextMetadata.EducationLevels.AsQueryable() + .FirstOrDefaultAsync(x => x.Id == updated.EducationLevelHighId); + + if (educationLevelHigh == null) + throw new Exception(GlobalMessages.EducationLevelNotFound); + if (candidate.Educations.FirstOrDefault() == null) + { + var education = new Education + { + Candidate = candidate, + EducationLevelExamId = educationLevelExam.Id, + EducationLevelExamName = educationLevelExam.Name, + EducationName = updated.EducationName, + EducationMajor = updated.EducationMajor, + EducationLocation = updated.EducationLocation, + EducationType = updated.EducationType, + EducationEndDate = updated.EducationEndDate, + EducationScores = updated.EducationScores, + EducationLevelHighId = educationLevelHigh.Id, + EducationLevelHighName = educationLevelHigh.Name, + CreatedAt = DateTime.Now, + CreatedUserId = UserId ?? "", + CreatedFullName = FullName ?? "", + LastUpdatedAt = DateTime.Now, + LastUpdateUserId = UserId ?? "", + LastUpdateFullName = FullName ?? "", + }; + await _context.Educations.AddAsync(education); + } + else + { + candidate.Educations.FirstOrDefault().EducationLevelExamId = educationLevelExam.Id; + candidate.Educations.FirstOrDefault().EducationLevelExamName = educationLevelExam.Name; + candidate.Educations.FirstOrDefault().EducationName = updated.EducationName; + candidate.Educations.FirstOrDefault().EducationMajor = updated.EducationMajor; + candidate.Educations.FirstOrDefault().EducationLocation = updated.EducationLocation; + candidate.Educations.FirstOrDefault().EducationType = updated.EducationType; + candidate.Educations.FirstOrDefault().EducationEndDate = updated.EducationEndDate; + candidate.Educations.FirstOrDefault().EducationScores = updated.EducationScores; + candidate.Educations.FirstOrDefault().EducationLevelHighId = educationLevelHigh.Id; + candidate.Educations.FirstOrDefault().EducationLevelHighName = educationLevelHigh.Name; + candidate.Educations.FirstOrDefault().LastUpdatedAt = DateTime.Now; + candidate.Educations.FirstOrDefault().LastUpdateUserId = UserId ?? ""; + candidate.Educations.FirstOrDefault().LastUpdateFullName = FullName ?? ""; + } await _context.SaveChangesAsync(); } public async Task UpdateAdminAsync(string candidateId, CandidateResponseItem updated) { - var candidate = await _context.Candidates.AsQueryable() + var candidate = await _context.Candidates + .AsQueryable() + .Include(x => x.Educations) .FirstOrDefaultAsync(x => x.Id == Guid.Parse(candidateId)); if (candidate == null) @@ -896,40 +882,16 @@ namespace BMA.EHR.Recurit.Exam.Service.Services candidate.PrefixName = prefix.Name; } - if (updated.RelationshipId != null) + if (updated.ReligionId != null) { - var relationship = await _contextMetadata.Relationships.AsQueryable() - .FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.RelationshipId)); + var religion = await _contextMetadata.Religions.AsQueryable() + .FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.ReligionId)); - if (relationship == null) - throw new Exception(GlobalMessages.RelationshipNotFound); + if (religion == null) + throw new Exception(GlobalMessages.ReligionNotFound); - candidate.RelationshipId = relationship.Id; - candidate.RelationshipName = relationship.Name; - } - - if (updated.CitizenProvinceId != null) - { - var citizenProvince = await _contextMetadata.Provinces.AsQueryable() - .FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.CitizenProvinceId)); - - if (citizenProvince == null) - throw new Exception(GlobalMessages.ProvinceNotFound); - - candidate.CitizenProvinceId = citizenProvince.Id; - candidate.CitizenProvinceName = citizenProvince.Name; - } - - if (updated.CitizenDistrictId != null) - { - var citizenDistrict = await _contextMetadata.Districts.AsQueryable() - .FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.CitizenDistrictId)); - - if (citizenDistrict == null) - throw new Exception(GlobalMessages.DistrictNotFound); - - candidate.CitizenDistrictId = citizenDistrict.Id; - candidate.CitizenDistrictName = citizenDistrict.Name; + candidate.ReligionId = religion.Id; + candidate.ReligionName = religion.Name; } if (updated.RegistProvinceId != null) @@ -1006,49 +968,12 @@ namespace BMA.EHR.Recurit.Exam.Service.Services candidate.CurrentZipCode = currentSubDistrict.ZipCode; } - if (updated.MarryPrefixId != null) - { - var prefix = await _contextMetadata.Prefixes.AsQueryable() - .FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.MarryPrefixId)); - - if (prefix == null) - throw new Exception(GlobalMessages.PrefixNotFound); - - candidate.MarryPrefixId = prefix.Id; - candidate.MarryPrefixName = prefix.Name; - } - - if (updated.FatherPrefixId != null) - { - var prefix = await _contextMetadata.Prefixes.AsQueryable() - .FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.FatherPrefixId)); - - if (prefix == null) - throw new Exception(GlobalMessages.PrefixNotFound); - - candidate.FatherPrefixId = prefix.Id; - candidate.FatherPrefixName = prefix.Name; - } - - if (updated.MotherPrefixId != null) - { - var prefix = await _contextMetadata.Prefixes.AsQueryable() - .FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.MotherPrefixId)); - - if (prefix == null) - throw new Exception(GlobalMessages.PrefixNotFound); - - candidate.MotherPrefixId = prefix.Id; - candidate.MotherPrefixName = prefix.Name; - } - candidate.FirstName = updated.FirstName; candidate.LastName = updated.LastName; candidate.Nationality = updated.Nationality; candidate.DateOfBirth = updated.DateOfBirth; candidate.Email = updated.Email; candidate.CitizenId = updated.CitizenId; - candidate.CitizenDate = updated.CitizenDate; candidate.Telephone = updated.Telephone; candidate.MobilePhone = updated.MobilePhone; candidate.Knowledge = updated.Knowledge; @@ -1057,27 +982,65 @@ namespace BMA.EHR.Recurit.Exam.Service.Services candidate.RegistSame = updated.RegistSame == null ? null : updated.RegistSame; candidate.CurrentAddress = updated.CurrentAddress; - candidate.Marry = updated.Marry == null ? null : updated.Marry; - candidate.MarryFirstName = updated.MarryFirstName; - candidate.MarryLastName = updated.MarryLastName; - candidate.MarryOccupation = updated.MarryOccupation; - candidate.MarryNationality = updated.MarryNationality; - candidate.FatherFirstName = updated.FatherFirstName; - candidate.FatherLastName = updated.FatherLastName; - candidate.FatherOccupation = updated.FatherOccupation; - candidate.FatherNationality = updated.FatherNationality; - candidate.MotherFirstName = updated.MotherFirstName; - candidate.MotherLastName = updated.MotherLastName; - candidate.MotherOccupation = updated.MotherOccupation; - candidate.MotherNationality = updated.MotherNationality; - - candidate.OccupationType = updated.OccupationType; - candidate.OccupationCompany = updated.OccupationCompany; - candidate.OccupationDepartment = updated.OccupationDepartment; - candidate.OccupationEmail = updated.OccupationEmail; - candidate.OccupationTelephone = updated.OccupationTelephone; + candidate.OccupationOrg = updated.OccupationOrg; + candidate.OccupationPile = updated.OccupationPile; + candidate.OccupationGroup = updated.OccupationGroup; + candidate.OccupationSalary = updated.OccupationSalary; candidate.OccupationPosition = updated.OccupationPosition; + candidate.OccupationPositionType = updated.OccupationPositionType; + candidate.OccupationTelephone = updated.OccupationTelephone; + var educationLevelExam = await _contextMetadata.EducationLevels.AsQueryable() + .FirstOrDefaultAsync(x => x.Id == updated.EducationLevelExamId); + + if (educationLevelExam == null) + throw new Exception(GlobalMessages.EducationLevelNotFound); + + var educationLevelHigh = await _contextMetadata.EducationLevels.AsQueryable() + .FirstOrDefaultAsync(x => x.Id == updated.EducationLevelHighId); + + if (educationLevelHigh == null) + throw new Exception(GlobalMessages.EducationLevelNotFound); + if (candidate.Educations.FirstOrDefault() == null) + { + var education = new Education + { + Candidate = candidate, + EducationLevelExamId = educationLevelExam.Id, + EducationLevelExamName = educationLevelExam.Name, + EducationName = updated.EducationName, + EducationMajor = updated.EducationMajor, + EducationLocation = updated.EducationLocation, + EducationType = updated.EducationType, + EducationEndDate = updated.EducationEndDate, + EducationScores = updated.EducationScores, + EducationLevelHighId = educationLevelHigh.Id, + EducationLevelHighName = educationLevelHigh.Name, + CreatedAt = DateTime.Now, + CreatedUserId = UserId ?? "", + CreatedFullName = FullName ?? "", + LastUpdatedAt = DateTime.Now, + LastUpdateUserId = UserId ?? "", + LastUpdateFullName = FullName ?? "", + }; + await _context.Educations.AddAsync(education); + } + else + { + candidate.Educations.FirstOrDefault().EducationLevelExamId = educationLevelExam.Id; + candidate.Educations.FirstOrDefault().EducationLevelExamName = educationLevelExam.Name; + candidate.Educations.FirstOrDefault().EducationName = updated.EducationName; + candidate.Educations.FirstOrDefault().EducationMajor = updated.EducationMajor; + candidate.Educations.FirstOrDefault().EducationLocation = updated.EducationLocation; + candidate.Educations.FirstOrDefault().EducationType = updated.EducationType; + candidate.Educations.FirstOrDefault().EducationEndDate = updated.EducationEndDate; + candidate.Educations.FirstOrDefault().EducationScores = updated.EducationScores; + candidate.Educations.FirstOrDefault().EducationLevelHighId = educationLevelHigh.Id; + candidate.Educations.FirstOrDefault().EducationLevelHighName = educationLevelHigh.Name; + candidate.Educations.FirstOrDefault().LastUpdatedAt = DateTime.Now; + candidate.Educations.FirstOrDefault().LastUpdateUserId = UserId ?? ""; + candidate.Educations.FirstOrDefault().LastUpdateFullName = FullName ?? ""; + } await _context.SaveChangesAsync(); } @@ -1365,12 +1328,13 @@ namespace BMA.EHR.Recurit.Exam.Service.Services if (candidate == null) throw new Exception(GlobalMessages.ExamNotFound); - candidate.OccupationType = updated.OccupationType; - candidate.OccupationCompany = updated.OccupationCompany; - candidate.OccupationDepartment = updated.OccupationDepartment; - candidate.OccupationEmail = updated.OccupationEmail; - candidate.OccupationTelephone = updated.OccupationTelephone; + candidate.OccupationOrg = updated.OccupationOrg; + candidate.OccupationPile = updated.OccupationPile; + candidate.OccupationGroup = updated.OccupationGroup; + candidate.OccupationSalary = updated.OccupationSalary; candidate.OccupationPosition = updated.OccupationPosition; + candidate.OccupationPositionType = updated.OccupationPositionType; + candidate.OccupationTelephone = updated.OccupationTelephone; await _context.SaveChangesAsync(); } @@ -1475,12 +1439,13 @@ namespace BMA.EHR.Recurit.Exam.Service.Services var career = new Career { Candidate = candidate, - Name = updated.Name, Position = updated.Position, - Salary = updated.Salary, + Group = updated.Group, + Pile = updated.Pile, + Org = updated.Org, DurationStart = updated.DurationStart, DurationEnd = updated.DurationEnd, - Reason = updated.Reason, + RangeDate = updated.RangeDate, CreatedAt = DateTime.Now, CreatedUserId = UserId ?? "", LastUpdatedAt = DateTime.Now, @@ -1501,12 +1466,13 @@ namespace BMA.EHR.Recurit.Exam.Service.Services var career = new Career { Candidate = candidate, - Name = updated.Name, Position = updated.Position, - Salary = updated.Salary, + Group = updated.Group, + Pile = updated.Pile, + Org = updated.Org, DurationStart = updated.DurationStart, DurationEnd = updated.DurationEnd, - Reason = updated.Reason, + RangeDate = updated.RangeDate, CreatedAt = DateTime.Now, CreatedUserId = UserId ?? "", LastUpdatedAt = DateTime.Now, @@ -1524,33 +1490,64 @@ namespace BMA.EHR.Recurit.Exam.Service.Services var candidateId = await CreateAsyncCandidate(examId, positionId); var candidate = await _context.Candidates.AsQueryable() + .Include(x => x.Educations) .FirstOrDefaultAsync(x => x.Id == Guid.Parse(candidateId)); - var educationLevel = await _contextMetadata.EducationLevels.AsQueryable() - .FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.EducationLevelId)); + if (candidate == null) + throw new Exception(GlobalMessages.CandidateNotFound); - if (educationLevel == null) + var educationLevelExam = await _contextMetadata.EducationLevels.AsQueryable() + .FirstOrDefaultAsync(x => x.Id == updated.EducationLevelExamId); + + if (educationLevelExam == null) throw new Exception(GlobalMessages.EducationLevelNotFound); - var education = new Education - { - Candidate = candidate, - EducationLevelId = educationLevel.Id, - EducationLevelName = educationLevel.Name, - Major = updated.Major, - Scores = updated.Scores, - Name = updated.Name, - DurationStart = updated.DurationStart, - DurationEnd = updated.DurationEnd, - CreatedAt = DateTime.Now, - CreatedUserId = UserId ?? "", - LastUpdatedAt = DateTime.Now, - LastUpdateUserId = UserId ?? "", - CreatedFullName = FullName ?? "", - LastUpdateFullName = FullName ?? "", - }; + var educationLevelHigh = await _contextMetadata.EducationLevels.AsQueryable() + .FirstOrDefaultAsync(x => x.Id == updated.EducationLevelHighId); + + if (educationLevelHigh == null) + throw new Exception(GlobalMessages.EducationLevelNotFound); + if (candidate.Educations.FirstOrDefault() == null) + { + var education = new Education + { + Candidate = candidate, + EducationLevelExamId = educationLevelExam.Id, + EducationLevelExamName = educationLevelExam.Name, + EducationName = updated.EducationName, + EducationMajor = updated.EducationMajor, + EducationLocation = updated.EducationLocation, + EducationType = updated.EducationType, + EducationEndDate = updated.EducationEndDate, + EducationScores = updated.EducationScores, + EducationLevelHighId = educationLevelHigh.Id, + EducationLevelHighName = educationLevelHigh.Name, + CreatedAt = DateTime.Now, + CreatedUserId = UserId ?? "", + CreatedFullName = FullName ?? "", + LastUpdatedAt = DateTime.Now, + LastUpdateUserId = UserId ?? "", + LastUpdateFullName = FullName ?? "", + }; + await _context.Educations.AddAsync(education); + } + else + { + candidate.Educations.FirstOrDefault().EducationLevelExamId = educationLevelExam.Id; + candidate.Educations.FirstOrDefault().EducationLevelExamName = educationLevelExam.Name; + candidate.Educations.FirstOrDefault().EducationName = updated.EducationName; + candidate.Educations.FirstOrDefault().EducationMajor = updated.EducationMajor; + candidate.Educations.FirstOrDefault().EducationLocation = updated.EducationLocation; + candidate.Educations.FirstOrDefault().EducationType = updated.EducationType; + candidate.Educations.FirstOrDefault().EducationEndDate = updated.EducationEndDate; + candidate.Educations.FirstOrDefault().EducationScores = updated.EducationScores; + candidate.Educations.FirstOrDefault().EducationLevelHighId = educationLevelHigh.Id; + candidate.Educations.FirstOrDefault().EducationLevelHighName = educationLevelHigh.Name; + candidate.Educations.FirstOrDefault().LastUpdatedAt = DateTime.Now; + candidate.Educations.FirstOrDefault().LastUpdateUserId = UserId ?? ""; + candidate.Educations.FirstOrDefault().LastUpdateFullName = FullName ?? ""; + } - await _context.Educations.AddAsync(education); await _context.SaveChangesAsync(); } @@ -1559,31 +1556,60 @@ namespace BMA.EHR.Recurit.Exam.Service.Services var candidate = await _context.Candidates.AsQueryable() .FirstOrDefaultAsync(x => x.Id == Guid.Parse(candidateId)); - var educationLevel = await _contextMetadata.EducationLevels.AsQueryable() - .FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.EducationLevelId)); + if (candidate == null) + throw new Exception(GlobalMessages.CandidateNotFound); - if (educationLevel == null) + var educationLevelExam = await _contextMetadata.EducationLevels.AsQueryable() + .FirstOrDefaultAsync(x => x.Id == updated.EducationLevelExamId); + + if (educationLevelExam == null) throw new Exception(GlobalMessages.EducationLevelNotFound); - var education = new Education - { - Candidate = candidate, - EducationLevelId = educationLevel.Id, - EducationLevelName = educationLevel.Name, - Major = updated.Major, - Scores = updated.Scores, - Name = updated.Name, - DurationStart = updated.DurationStart, - DurationEnd = updated.DurationEnd, - CreatedAt = DateTime.Now, - CreatedUserId = UserId ?? "", - LastUpdatedAt = DateTime.Now, - LastUpdateUserId = UserId ?? "", - CreatedFullName = FullName ?? "", - LastUpdateFullName = FullName ?? "", - }; + var educationLevelHigh = await _contextMetadata.EducationLevels.AsQueryable() + .FirstOrDefaultAsync(x => x.Id == updated.EducationLevelHighId); - await _context.Educations.AddAsync(education); + if (educationLevelHigh == null) + throw new Exception(GlobalMessages.EducationLevelNotFound); + if (candidate.Educations.FirstOrDefault() == null) + { + var education = new Education + { + Candidate = candidate, + EducationLevelExamId = educationLevelExam.Id, + EducationLevelExamName = educationLevelExam.Name, + EducationName = updated.EducationName, + EducationMajor = updated.EducationMajor, + EducationLocation = updated.EducationLocation, + EducationType = updated.EducationType, + EducationEndDate = updated.EducationEndDate, + EducationScores = updated.EducationScores, + EducationLevelHighId = educationLevelHigh.Id, + EducationLevelHighName = educationLevelHigh.Name, + CreatedAt = DateTime.Now, + CreatedUserId = UserId ?? "", + CreatedFullName = FullName ?? "", + LastUpdatedAt = DateTime.Now, + LastUpdateUserId = UserId ?? "", + LastUpdateFullName = FullName ?? "", + }; + await _context.Educations.AddAsync(education); + } + else + { + candidate.Educations.FirstOrDefault().EducationLevelExamId = educationLevelExam.Id; + candidate.Educations.FirstOrDefault().EducationLevelExamName = educationLevelExam.Name; + candidate.Educations.FirstOrDefault().EducationName = updated.EducationName; + candidate.Educations.FirstOrDefault().EducationMajor = updated.EducationMajor; + candidate.Educations.FirstOrDefault().EducationLocation = updated.EducationLocation; + candidate.Educations.FirstOrDefault().EducationType = updated.EducationType; + candidate.Educations.FirstOrDefault().EducationEndDate = updated.EducationEndDate; + candidate.Educations.FirstOrDefault().EducationScores = updated.EducationScores; + candidate.Educations.FirstOrDefault().EducationLevelHighId = educationLevelHigh.Id; + candidate.Educations.FirstOrDefault().EducationLevelHighName = educationLevelHigh.Name; + candidate.Educations.FirstOrDefault().LastUpdatedAt = DateTime.Now; + candidate.Educations.FirstOrDefault().LastUpdateUserId = UserId ?? ""; + candidate.Educations.FirstOrDefault().LastUpdateFullName = FullName ?? ""; + } await _context.SaveChangesAsync(); } @@ -1595,12 +1621,13 @@ namespace BMA.EHR.Recurit.Exam.Service.Services if (career == null) throw new Exception(GlobalMessages.CareerNotFound); - career.Name = updated.Name; career.Position = updated.Position; - career.Salary = updated.Salary; + career.Group = updated.Group; + career.Pile = updated.Pile; + career.Org = updated.Org; career.DurationStart = updated.DurationStart; career.DurationEnd = updated.DurationEnd; - career.Reason = updated.Reason; + career.RangeDate = updated.RangeDate; career.LastUpdatedAt = DateTime.Now; career.LastUpdateUserId = UserId ?? ""; career.LastUpdateFullName = FullName ?? ""; @@ -1621,33 +1648,33 @@ namespace BMA.EHR.Recurit.Exam.Service.Services await _context.SaveChangesAsync(); } - public async Task UpdateAsyncEducation(string educationId, CandidateEducationResponseItem updated) - { - var education = await _context.Educations.AsQueryable() - .FirstOrDefaultAsync(x => x.Id == Guid.Parse(educationId)); + // public async Task UpdateAsyncEducation(string educationId, CandidateEducationResponseItem updated) + // { + // var education = await _context.Educations.AsQueryable() + // .FirstOrDefaultAsync(x => x.Id == Guid.Parse(educationId)); - if (education == null) - throw new Exception(GlobalMessages.EducationNotFound); + // if (education == null) + // throw new Exception(GlobalMessages.EducationNotFound); - var educationLevel = await _contextMetadata.EducationLevels.AsQueryable() - .FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.EducationLevelId)); + // var educationLevel = await _contextMetadata.EducationLevels.AsQueryable() + // .FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.EducationLevelId)); - if (educationLevel == null) - throw new Exception(GlobalMessages.EducationLevelNotFound); + // if (educationLevel == null) + // throw new Exception(GlobalMessages.EducationLevelNotFound); - education.EducationLevelId = educationLevel.Id; - education.EducationLevelName = educationLevel.Name; - education.Major = updated.Major; - education.Scores = updated.Scores; - education.Name = updated.Name; - education.DurationStart = updated.DurationStart; - education.DurationEnd = updated.DurationEnd; - education.LastUpdatedAt = DateTime.Now; - education.LastUpdateUserId = UserId ?? ""; - education.LastUpdateFullName = FullName ?? ""; + // education.EducationLevelId = educationLevel.Id; + // education.EducationLevelName = educationLevel.Name; + // education.Major = updated.Major; + // education.Scores = updated.Scores; + // education.Name = updated.Name; + // education.DurationStart = updated.DurationStart; + // education.DurationEnd = updated.DurationEnd; + // education.LastUpdatedAt = DateTime.Now; + // education.LastUpdateUserId = UserId ?? ""; + // education.LastUpdateFullName = FullName ?? ""; - await _context.SaveChangesAsync(); - } + // await _context.SaveChangesAsync(); + // } public async Task DeleteAsyncEducation(string educationId) { @@ -1702,6 +1729,12 @@ namespace BMA.EHR.Recurit.Exam.Service.Services if (exam == null) throw new Exception(GlobalMessages.ExamNotFound); + if (exam.RegisterStartDate != null && exam.RegisterStartDate.Value.Date < DateTime.Now.Date) + throw new Exception("ยังไม่ถึงช่วงเวลาสมัครสอบ"); + + if (exam.RegisterEndDate != null && exam.RegisterEndDate.Value.Date > DateTime.Now.Date) + throw new Exception("หมดเวลาช่วงสมัครสอบ"); + var candidate = await _context.Candidates.AsQueryable() .FirstOrDefaultAsync(x => x.PeriodExam == exam && x.UserId == UserId); @@ -1887,6 +1920,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services .FirstOrDefaultAsync(); var positionName = ""; + var positionLevelName = ""; var highDegree = ""; if (positionId != "00000000-0000-0000-0000-000000000000") { @@ -1900,7 +1934,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Services .Where(x => x.PeriodExam == exam && x.UserId == UserId && x.PositionExam == position) .FirstOrDefaultAsync(); positionName = position.PositionName; - highDegree = position.HighDegree == true ? "ปริญญาขึ้นไป" : "ต่ำกว่าปริญญาตรี"; + positionLevelName = position.PositionLevelName; + highDegree = position.HighDegree == true ? "ปริญญาบัตรขึ้นไป" : "ต่ำกว่าปริญญาบัตร"; } if (candidate == null) @@ -1940,6 +1975,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services AnnouncementDate = exam.AnnouncementDate?.AddYears(2), Id = candidate.Id, Position = positionName, + PositionLevel = positionLevelName, HighDegree = highDegree, }; } @@ -1955,11 +1991,13 @@ namespace BMA.EHR.Recurit.Exam.Service.Services throw new Exception(GlobalMessages.CandidateNotFound); var positionName = ""; + var positionLevelName = ""; var highDegree = ""; if (candidate.PositionExam != null) { positionName = candidate.PositionExam.PositionName; - highDegree = candidate.PositionExam.HighDegree == true ? "ปริญญาขึ้นไป" : "ต่ำกว่าปริญญาตรี"; + positionLevelName = candidate.PositionExam.PositionLevelName; + highDegree = candidate.PositionExam.HighDegree == true ? "ปริญญาบัตรขึ้นไป" : "ต่ำกว่าปริญญาบัตร"; } return new RequestCardCandidate @@ -1996,6 +2034,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services AnnouncementDate = candidate.PeriodExam?.AnnouncementDate?.AddYears(2), Id = candidate.Id, Position = positionName, + PositionLevel = positionLevelName, HighDegree = highDegree, }; } diff --git a/Services/PeriodExamService.cs b/Services/PeriodExamService.cs index fa830dc..76dded9 100644 --- a/Services/PeriodExamService.cs +++ b/Services/PeriodExamService.cs @@ -78,11 +78,9 @@ namespace BMA.EHR.Recurit.Exam.Service.Services { switch (status.Trim().ToUpper()) { - case "OFFICIAL": return "ข้าราชการกรุงเทพมหานคร"; - case "PERSONNEL": return "บุคลากรกรุงเทพมหานคร"; - case "OFFICIALSOTHER": return "ข้าราชการประเภทอื่น"; - case "EMPLOYEE": return "ลูกจ้าง/พนักงานราชการของส่วนราชการอื่น"; - case "OTHER": return "อื่นๆ"; + case "prem": return "ลูกจ้างประจำ"; + case "temp": return "ลูกจ้างชั่วคราว"; + case "other": return "ผู้ปฏิบัติงานอื่นในกรุงเทพมหานคร"; default: return status; } } @@ -135,6 +133,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Services CheckDisability = x.CheckDisability, CheckDocument = x.CheckDocument, Detail = x.Detail, + EditorCondition = x.EditorCondition, + EditorConfirm = x.EditorConfirm, Fee = x.Fee, Id = x.Id, IsActive = x.IsActive, @@ -197,6 +197,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Services CheckDisability = x.CheckDisability, CheckDocument = x.CheckDocument, Detail = x.Detail, + EditorCondition = x.EditorCondition, + EditorConfirm = x.EditorConfirm, Fee = x.Fee, Id = x.Id, IsActive = x.IsActive, @@ -230,6 +232,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Services TypeName = b.TypeName, PositionId = b.PositionId, PositionName = b.PositionName, + PositionLevelId = b.PositionLevelId, + PositionLevelName = b.PositionLevelName, HighDegree = b.HighDegree, }).ToList(), Documents = x.PeriodExamDocuments.OrderBy(o => o.CreatedAt).Select(b => new FileListResponse @@ -300,6 +304,12 @@ namespace BMA.EHR.Recurit.Exam.Service.Services if (periodExam == null) throw new Exception(GlobalMessages.ExamNotFound); + var positionExam = await _context.PositionExams.AsQueryable() + .FirstOrDefaultAsync(x => x.Id == Guid.Parse(positionId)); + + if (positionExam == null) + throw new Exception(GlobalMessages.ExamNotFound); + if (positionId != "00000000-0000-0000-0000-000000000000") { return new RequestPositionName @@ -307,7 +317,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Services Name = periodExam.Name, Round = periodExam.Round, Year = periodExam.Year, - Posiiton = periodExam.PositionExam.FirstOrDefault(x => x.Id == Guid.Parse(positionId) && x.PeriodExam == periodExam), + Position = positionExam.PositionName, + PositionLevel = positionExam.PositionLevelName, }; } else @@ -317,7 +328,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Services Name = periodExam.Name, Round = periodExam.Round, Year = periodExam.Year, - Posiiton = null, + Position = null, + PositionLevel = null, }; } } @@ -347,6 +359,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Services AnnouncementExam = inserted.AnnouncementExam, Category = inserted.Category, Detail = inserted.Detail, + EditorCondition = inserted.EditorCondition, + EditorConfirm = inserted.EditorConfirm, Note = inserted.Note, CreatedAt = DateTime.Now, CreatedUserId = UserId ?? "", @@ -384,6 +398,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Services PeriodExam = periodExam, PositionId = position.PositionId, PositionName = position.PositionName, + PositionLevelId = position.PositionLevelId, + PositionLevelName = position.PositionLevelName, HighDegree = position.HighDegree, TypeId = position.TypeId, TypeName = position.TypeName, @@ -438,6 +454,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Services // periodExam.AnnouncementExam = updated.AnnouncementExam; periodExam.Category = updated.Category; periodExam.Detail = updated.Detail; + periodExam.EditorCondition = updated.EditorCondition; + periodExam.EditorConfirm = updated.EditorConfirm; periodExam.Note = updated.Note; periodExam.LastUpdatedAt = DateTime.Now; periodExam.LastUpdateUserId = UserId ?? ""; @@ -508,6 +526,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Services { position.PositionId = positionData.PositionId; position.PositionName = positionData.PositionName; + position.PositionLevelId = positionData.PositionLevelId; + position.PositionLevelName = positionData.PositionLevelName; position.HighDegree = positionData.HighDegree; position.TypeId = positionData.TypeId; position.TypeName = positionData.TypeName; @@ -539,6 +559,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Services PeriodExam = periodExam, PositionId = position.PositionId, PositionName = position.PositionName, + PositionLevelId = position.PositionLevelId, + PositionLevelName = position.PositionLevelName, HighDegree = position.HighDegree, TypeId = position.TypeId, TypeName = position.TypeName, @@ -660,6 +682,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services if (status == "all") { var candidate = await _context.Candidates.AsQueryable() + .Include(x => x.PositionExam) .Include(x => x.ProfileImg) .OrderByDescending(d => d.CreatedAt) .Where(x => x.PeriodExam == periodExam && x.RegisterDate != null && x.Status != "register" && x.Status != "rejectRegister") @@ -678,6 +701,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services else { var candidate = await _context.Candidates.AsQueryable() + .Include(x => x.PositionExam) .Include(x => x.ProfileImg) .OrderByDescending(d => d.CreatedAt) .Where(x => x.PeriodExam == periodExam && x.Status == status) @@ -707,8 +731,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Services LastName = x.LastName, Nationality = x.Nationality, DateOfBirth = x.DateOfBirth, - Relationship = x.RelationshipName, - RelationshipId = x.RelationshipId != null ? x.RelationshipId.ToString() : null, + Religion = x.ReligionName, + ReligionId = x.ReligionId != null ? x.ReligionId.ToString() : null, CitizenProvince = x.CitizenProvinceName, CitizenProvinceId = x.CitizenProvinceId != null ? x.CitizenProvinceId.ToString() : null, CitizenDistrict = x.CitizenDistrictName, @@ -754,12 +778,13 @@ namespace BMA.EHR.Recurit.Exam.Service.Services .Where(x => x.Id == Guid.Parse(candidateId)) .Select(x => new CandidateOccupationResponseItem { - OccupationType = x.OccupationType, - OccupationCompany = x.OccupationCompany, - OccupationDepartment = x.OccupationDepartment, - OccupationEmail = x.OccupationEmail, - OccupationTelephone = x.OccupationTelephone, + OccupationOrg = x.OccupationOrg, + OccupationPile = x.OccupationPile, + OccupationGroup = x.OccupationGroup, + OccupationSalary = x.OccupationSalary, OccupationPosition = x.OccupationPosition, + OccupationPositionType = x.OccupationPositionType, + OccupationTelephone = x.OccupationTelephone, }) .FirstOrDefaultAsync(); } @@ -820,12 +845,17 @@ namespace BMA.EHR.Recurit.Exam.Service.Services .FirstOrDefaultAsync(); } - public async Task> GetsAsyncEducation(string candidateId) + public async Task GetsAsyncEducation(string candidateId) { + var candidate = await _context.Candidates.AsQueryable() + .FirstOrDefaultAsync(x => x.Id == Guid.Parse(candidateId)); + + if (candidate == null) + throw new Exception(GlobalMessages.ExamNotFound); + return await _context.Educations.AsQueryable() - .Where(x => x.Candidate.Id == Guid.Parse(candidateId)) - .OrderBy(d => d.DurationStart) - .ToListAsync(); + .Where(x => x.Candidate == candidate) + .FirstOrDefaultAsync(); } public async Task> GetsAsyncCareer(string candidateId) @@ -1319,7 +1349,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services Nationality = c.Nationality, DateOfBirth = c.DateOfBirth == null ? "" : c.DateOfBirth.Value.Date.ToThaiShortDate(), Age = c.DateOfBirth == null ? "" : c.DateOfBirth.Value.Date.CalculateAgeStrV2(0, 0), - RelationshipName = c.RelationshipName, + ReligionName = c.ReligionName, Telephone = c.Telephone, MobilePhone = c.MobilePhone, Email = c.Email, @@ -1334,14 +1364,12 @@ namespace BMA.EHR.Recurit.Exam.Service.Services CurrentDistrictName = c.CurrentDistrictName, CurrentSubDistrictName = c.CurrentSubDistrictName, CurrentZipCode = c.CurrentZipCode, - MarryFullName = $"{c.MarryPrefixName}{c.MarryFirstName} {c.MarryLastName}", - FatherFullName = $"{c.FatherPrefixName}{c.FatherFirstName} {c.FatherLastName}", - MotherFullName = $"{c.MotherPrefixName}{c.MotherFirstName} {c.MotherLastName}", - OccupationType = c.OccupationType, + OccupationOrg = c.OccupationOrg, + OccupationPile = c.OccupationPile, + OccupationGroup = c.OccupationGroup, + OccupationSalary = c.OccupationSalary, OccupationPosition = c.OccupationPosition, - OccupationCompany = c.OccupationCompany, - OccupationDepartment = c.OccupationDepartment, - OccupationEmail = c.OccupationEmail, + OccupationPositionType = c.OccupationPositionType, OccupationTelephone = c.OccupationTelephone, RegisterDate = c.RegisterDate, @@ -1384,7 +1412,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services summarySheet.Cells[1, 4].Value = "สัญชาติ"; summarySheet.Cells[1, 5].Value = "วันเกิด"; summarySheet.Cells[1, 6].Value = "อายุ"; - summarySheet.Cells[1, 7].Value = "สถานภาพ"; + summarySheet.Cells[1, 7].Value = "ศาสนา"; summarySheet.Cells[1, 8].Value = "โทรศัพท์"; summarySheet.Cells[1, 9].Value = "โทรศัพท์มือถือ"; summarySheet.Cells[1, 10].Value = "อีเมล"; @@ -1399,46 +1427,54 @@ namespace BMA.EHR.Recurit.Exam.Service.Services summarySheet.Cells[1, 19].Value = "เขต/อำเภอที่อยู่ปัจจุบัน"; summarySheet.Cells[1, 20].Value = "ตำบล/แขวงที่อยู่ปัจจุบัน"; summarySheet.Cells[1, 21].Value = "รหัสไปรษณีย์ที่อยู่ปัจจุบัน"; - summarySheet.Cells[1, 22].Value = "คู่สมรส"; - summarySheet.Cells[1, 23].Value = "บิดา"; - summarySheet.Cells[1, 24].Value = "มารดา"; - summarySheet.Cells[1, 25].Value = "อาชีพ"; - summarySheet.Cells[1, 26].Value = "ตำแหน่ง"; - summarySheet.Cells[1, 27].Value = "สำนัก/บริษัท"; - summarySheet.Cells[1, 28].Value = "กอง/ฝ่าย"; - summarySheet.Cells[1, 29].Value = "อีเมลบริษัท"; - summarySheet.Cells[1, 30].Value = "โทรศัพท์บริษัท"; - summarySheet.Cells[1, 31].Value = "วุฒิที่ได้รับ"; - summarySheet.Cells[1, 32].Value = "สาขา/วิชาเอก"; - summarySheet.Cells[1, 33].Value = "คะแนนเฉลี่ยตลอดหลักสูตร"; - summarySheet.Cells[1, 34].Value = "ชื่อสถานศีกษา"; - summarySheet.Cells[1, 35].Value = "ระยะเวลาเริ่มศึกษา"; - summarySheet.Cells[1, 36].Value = "ระยะเวลาสิ้นสุดศึกษา"; - summarySheet.Cells[1, 37].Value = "สถานที่ทำงาน/ฝึกงาน"; - summarySheet.Cells[1, 38].Value = "ตำแหน่ง/ลักษณะงาน"; - summarySheet.Cells[1, 39].Value = "เงินเดือนสุดท้านก่อนออก"; - summarySheet.Cells[1, 40].Value = "ระยะเวลาเริ่มทำงาน/ฝึกงาน"; - summarySheet.Cells[1, 41].Value = "ระยะเวลาสิ้นสุดทำงาน/ฝึกงาน"; - summarySheet.Cells[1, 42].Value = "เหตุผลที่ออก"; - summarySheet.Cells[1, 43].Value = "ลำดับที่สอบได้"; - summarySheet.Cells[1, 44].Value = "เลขประจำตัวสอบ"; - summarySheet.Cells[1, 45].Value = "เลขที่นั่งสอบ"; - summarySheet.Cells[1, 46].Value = "คะแนนเต็มภาค ข"; - summarySheet.Cells[1, 47].Value = "คะแนนภาค ข"; - summarySheet.Cells[1, 48].Value = "ผลสอบภาค ข"; - summarySheet.Cells[1, 49].Value = "คะแนนเต็มภาค ค"; - summarySheet.Cells[1, 50].Value = "คะแนนภาค ค"; - summarySheet.Cells[1, 51].Value = "ผลสอบภาค ค"; - summarySheet.Cells[1, 52].Value = "ผลการสอบ"; - summarySheet.Cells[1, 53].Value = "วันที่สมัคร"; - summarySheet.Cells[1, 54].Value = "วันเและเวลาที่สมัคร"; + + summarySheet.Cells[1, 22].Value = "ประเภทตำแหน่งปัจจุบัน"; + summarySheet.Cells[1, 23].Value = "ชื่อตำแหน่งปัจจุบัน"; + summarySheet.Cells[1, 24].Value = "เงินเดือน ตำแหน่งปัจจุบัน"; + summarySheet.Cells[1, 25].Value = "กลุ่ม/ฝ่าย ตำแหน่งปัจจุบัน"; + summarySheet.Cells[1, 26].Value = "กอง ตำแหน่งปัจจุบัน"; + summarySheet.Cells[1, 27].Value = "สังกัด ตำแหน่งปัจจุบัน"; + summarySheet.Cells[1, 28].Value = "เบอร์ที่ทำงาน ตำแหน่งปัจจุบัน"; + + summarySheet.Cells[1, 29].Value = "วุฒิที่ใช้สมัครสอบ"; + summarySheet.Cells[1, 30].Value = "ชื่อปริญญา"; + summarySheet.Cells[1, 31].Value = "สาขาวิชา/วิชาเอก"; + summarySheet.Cells[1, 32].Value = "ชื่อสถานศึกษา"; + summarySheet.Cells[1, 33].Value = "ประเภทสถานศึกษา"; + summarySheet.Cells[1, 34].Value = "วันที่สำเร็จการศึกษา"; + summarySheet.Cells[1, 35].Value = "คะแนนเฉลี่ยสะสม"; + summarySheet.Cells[1, 36].Value = "วุฒิการศึกษาสูงสุด"; + + summarySheet.Cells[1, 37].Value = "ตำแหน่งปัจจุบัน ชื่อตำแหน่ง"; + summarySheet.Cells[1, 38].Value = "ตำแหน่งปัจจุบัน กอง"; + summarySheet.Cells[1, 39].Value = "ตำแหน่งปัจจุบัน กลุ่ม/ฝ่าย"; + summarySheet.Cells[1, 40].Value = "ตำแหน่งปัจจุบัน เงินเดือน"; + summarySheet.Cells[1, 41].Value = "ตำแหน่งปัจจุบัน สังกัด"; + summarySheet.Cells[1, 42].Value = "ตำแหน่งปัจจุบัน ประเภทราชการ"; + summarySheet.Cells[1, 43].Value = "เบอร์โทรที่ทำงาน"; + + summarySheet.Cells[1, 44].Value = "ลำดับที่สอบได้"; + summarySheet.Cells[1, 45].Value = "เลขประจำตัวสอบ"; + summarySheet.Cells[1, 46].Value = "เลขที่นั่งสอบ"; + summarySheet.Cells[1, 47].Value = "คะแนนเต็มภาค ก"; + summarySheet.Cells[1, 48].Value = "คะแนนภาค ก"; + summarySheet.Cells[1, 49].Value = "ผลสอบภาค ก"; + summarySheet.Cells[1, 50].Value = "คะแนนเต็มภาค ข"; + summarySheet.Cells[1, 51].Value = "คะแนนภาค ข"; + summarySheet.Cells[1, 52].Value = "ผลสอบภาค ข"; + summarySheet.Cells[1, 53].Value = "คะแนนเต็มภาค ค"; + summarySheet.Cells[1, 54].Value = "คะแนนภาค ค"; + summarySheet.Cells[1, 55].Value = "ผลสอบภาค ค"; + summarySheet.Cells[1, 56].Value = "ผลการสอบ"; + summarySheet.Cells[1, 57].Value = "วันที่สมัคร"; + summarySheet.Cells[1, 58].Value = "วันเและเวลาที่สมัคร"; int row = 2; foreach (var item in candidates) { var educations = await _context.Educations .AsQueryable() - .OrderBy(x => x.DurationStart) + .OrderBy(x => x.EducationEndDate) .Where(x => x.Candidate.Id == item.Id) .ToListAsync(); @@ -1450,7 +1486,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services summarySheet.Cells[row, 4].Value = item.Nationality; summarySheet.Cells[row, 5].Value = item.DateOfBirth; summarySheet.Cells[row, 6].Value = item.Age; - summarySheet.Cells[row, 7].Value = item.RelationshipName; + summarySheet.Cells[row, 7].Value = item.ReligionName; summarySheet.Cells[row, 8].Value = item.Telephone; summarySheet.Cells[row, 9].Value = item.MobilePhone; summarySheet.Cells[row, 10].Value = item.Email; @@ -1465,36 +1501,39 @@ namespace BMA.EHR.Recurit.Exam.Service.Services summarySheet.Cells[row, 19].Value = item.CurrentDistrictName; summarySheet.Cells[row, 20].Value = item.CurrentSubDistrictName; summarySheet.Cells[row, 21].Value = item.CurrentZipCode; - summarySheet.Cells[row, 22].Value = item.MarryFullName; - summarySheet.Cells[row, 23].Value = item.FatherFullName; - summarySheet.Cells[row, 24].Value = item.MotherFullName; - summarySheet.Cells[row, 25].Value = item.OccupationType == null ? null : GenerateStatusOccupation(item.OccupationType); - summarySheet.Cells[row, 26].Value = item.OccupationPosition; - summarySheet.Cells[row, 27].Value = item.OccupationCompany; - summarySheet.Cells[row, 28].Value = item.OccupationDepartment; - summarySheet.Cells[row, 29].Value = item.OccupationEmail; - summarySheet.Cells[row, 30].Value = item.OccupationTelephone; - summarySheet.Cells[row, 31].Value = education.EducationLevelName; - summarySheet.Cells[row, 32].Value = education.Major; - summarySheet.Cells[row, 33].Value = education.Scores; - summarySheet.Cells[row, 34].Value = education.Name; - summarySheet.Cells[row, 35].Value = education.DurationStart == null ? "" : education.DurationStart.Date.ToThaiShortDate(); - summarySheet.Cells[row, 36].Value = education.DurationEnd == null ? "" : education.DurationEnd.Date.ToThaiShortDate(); - summarySheet.Cells[row, 43].Value = item.Number; - summarySheet.Cells[row, 44].Value = item.ExamIdenNumber; - summarySheet.Cells[row, 45].Value = item.SeatNumber; - summarySheet.Cells[row, 46].Value = item.PointTotalA; - summarySheet.Cells[row, 47].Value = item.PointA; - summarySheet.Cells[row, 48].Value = item.ResultA; - summarySheet.Cells[row, 49].Value = item.PointTotalB; - summarySheet.Cells[row, 50].Value = item.PointB; - summarySheet.Cells[row, 51].Value = item.ResultB; - summarySheet.Cells[row, 52].Value = item.PointTotalC; - summarySheet.Cells[row, 53].Value = item.PointC; - summarySheet.Cells[row, 54].Value = item.ResultC; - summarySheet.Cells[row, 55].Value = item.Pass; - summarySheet.Cells[row, 56].Value = item.CreatedAt.Date.ToThaiShortDate(); - summarySheet.Cells[row, 57].Value = item.RegisterDate; + + summarySheet.Cells[row, 22].Value = item.OccupationPosition; + summarySheet.Cells[row, 23].Value = item.OccupationSalary; + summarySheet.Cells[row, 24].Value = item.OccupationGroup; + summarySheet.Cells[row, 25].Value = item.OccupationPile; + summarySheet.Cells[row, 26].Value = item.OccupationOrg; + summarySheet.Cells[row, 27].Value = item.OccupationPositionType == null ? null : GenerateStatusOccupation(item.OccupationPositionType); + summarySheet.Cells[row, 28].Value = item.OccupationTelephone; + + summarySheet.Cells[row, 29].Value = education.EducationLevelExamName; + summarySheet.Cells[row, 30].Value = education.EducationName; + summarySheet.Cells[row, 31].Value = education.EducationMajor; + summarySheet.Cells[row, 32].Value = education.EducationLocation; + summarySheet.Cells[row, 33].Value = education.EducationType; + summarySheet.Cells[row, 34].Value = education.EducationEndDate == null ? "-" : education.EducationEndDate.Value.Date.ToThaiShortDate(); + summarySheet.Cells[row, 35].Value = education.EducationScores; + summarySheet.Cells[row, 36].Value = education.EducationLevelHighName; + + summarySheet.Cells[row, 44].Value = item.Number; + summarySheet.Cells[row, 45].Value = item.ExamIdenNumber; + summarySheet.Cells[row, 46].Value = item.SeatNumber; + summarySheet.Cells[row, 47].Value = item.PointTotalA; + summarySheet.Cells[row, 48].Value = item.PointA; + summarySheet.Cells[row, 49].Value = item.ResultA; + summarySheet.Cells[row, 50].Value = item.PointTotalB; + summarySheet.Cells[row, 51].Value = item.PointB; + summarySheet.Cells[row, 52].Value = item.ResultB; + summarySheet.Cells[row, 53].Value = item.PointTotalC; + summarySheet.Cells[row, 54].Value = item.PointC; + summarySheet.Cells[row, 55].Value = item.ResultC; + summarySheet.Cells[row, 56].Value = item.Pass; + summarySheet.Cells[row, 57].Value = item.CreatedAt.Date.ToThaiShortDate(); + summarySheet.Cells[row, 58].Value = item.RegisterDate; row++; } var careers = await _context.Careers @@ -1511,7 +1550,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services summarySheet.Cells[row, 4].Value = item.Nationality; summarySheet.Cells[row, 5].Value = item.DateOfBirth; summarySheet.Cells[row, 6].Value = item.Age; - summarySheet.Cells[row, 7].Value = item.RelationshipName; + summarySheet.Cells[row, 7].Value = item.ReligionName; summarySheet.Cells[row, 8].Value = item.Telephone; summarySheet.Cells[row, 9].Value = item.MobilePhone; summarySheet.Cells[row, 10].Value = item.Email; @@ -1526,36 +1565,38 @@ namespace BMA.EHR.Recurit.Exam.Service.Services summarySheet.Cells[row, 19].Value = item.CurrentDistrictName; summarySheet.Cells[row, 20].Value = item.CurrentSubDistrictName; summarySheet.Cells[row, 21].Value = item.CurrentZipCode; - summarySheet.Cells[row, 22].Value = item.MarryFullName; - summarySheet.Cells[row, 23].Value = item.FatherFullName; - summarySheet.Cells[row, 24].Value = item.MotherFullName; - summarySheet.Cells[row, 25].Value = item.OccupationType == null ? null : GenerateStatusOccupation(item.OccupationType); - summarySheet.Cells[row, 26].Value = item.OccupationPosition; - summarySheet.Cells[row, 27].Value = item.OccupationCompany; - summarySheet.Cells[row, 28].Value = item.OccupationDepartment; - summarySheet.Cells[row, 29].Value = item.OccupationEmail; - summarySheet.Cells[row, 30].Value = item.OccupationTelephone; - summarySheet.Cells[row, 37].Value = career.Name; - summarySheet.Cells[row, 38].Value = career.Position; - summarySheet.Cells[row, 39].Value = career.Salary; - summarySheet.Cells[row, 40].Value = career.DurationStart == null ? "" : career.DurationStart.Date.ToThaiShortDate(); - summarySheet.Cells[row, 41].Value = career.DurationEnd == null ? "" : career.DurationEnd.Date.ToThaiShortDate(); - summarySheet.Cells[row, 42].Value = career.Reason; - summarySheet.Cells[row, 43].Value = item.Number; - summarySheet.Cells[row, 44].Value = item.ExamIdenNumber; - summarySheet.Cells[row, 45].Value = item.SeatNumber; - summarySheet.Cells[row, 46].Value = item.PointTotalA; - summarySheet.Cells[row, 47].Value = item.PointA; - summarySheet.Cells[row, 48].Value = item.ResultA; - summarySheet.Cells[row, 49].Value = item.PointTotalB; - summarySheet.Cells[row, 50].Value = item.PointB; - summarySheet.Cells[row, 51].Value = item.ResultB; - summarySheet.Cells[row, 52].Value = item.PointTotalC; - summarySheet.Cells[row, 53].Value = item.PointC; - summarySheet.Cells[row, 54].Value = item.ResultC; - summarySheet.Cells[row, 55].Value = item.Pass; - summarySheet.Cells[row, 56].Value = item.CreatedAt.Date.ToThaiShortDate(); - summarySheet.Cells[row, 57].Value = item.RegisterDate; + + summarySheet.Cells[row, 22].Value = item.OccupationPosition; + summarySheet.Cells[row, 23].Value = item.OccupationSalary; + summarySheet.Cells[row, 24].Value = item.OccupationGroup; + summarySheet.Cells[row, 25].Value = item.OccupationPile; + summarySheet.Cells[row, 26].Value = item.OccupationOrg; + summarySheet.Cells[row, 27].Value = item.OccupationPositionType == null ? null : GenerateStatusOccupation(item.OccupationPositionType); + summarySheet.Cells[row, 28].Value = item.OccupationTelephone; + + summarySheet.Cells[row, 37].Value = career.Position; + summarySheet.Cells[row, 38].Value = career.Group; + summarySheet.Cells[row, 39].Value = career.Pile; + summarySheet.Cells[row, 40].Value = career.Org; + summarySheet.Cells[row, 41].Value = career.DurationStart == null ? "-" : career.DurationStart.Date.ToThaiShortDate(); + summarySheet.Cells[row, 42].Value = career.DurationEnd == null ? "-" : career.DurationEnd.Date.ToThaiShortDate(); + summarySheet.Cells[row, 43].Value = career.RangeDate; + + summarySheet.Cells[row, 44].Value = item.Number; + summarySheet.Cells[row, 45].Value = item.ExamIdenNumber; + summarySheet.Cells[row, 46].Value = item.SeatNumber; + summarySheet.Cells[row, 47].Value = item.PointTotalA; + summarySheet.Cells[row, 48].Value = item.PointA; + summarySheet.Cells[row, 49].Value = item.ResultA; + summarySheet.Cells[row, 50].Value = item.PointTotalB; + summarySheet.Cells[row, 51].Value = item.PointB; + summarySheet.Cells[row, 52].Value = item.ResultB; + summarySheet.Cells[row, 53].Value = item.PointTotalC; + summarySheet.Cells[row, 54].Value = item.PointC; + summarySheet.Cells[row, 55].Value = item.ResultC; + summarySheet.Cells[row, 56].Value = item.Pass; + summarySheet.Cells[row, 57].Value = item.CreatedAt.Date.ToThaiShortDate(); + summarySheet.Cells[row, 58].Value = item.RegisterDate; row++; } if (educations.Count() == 0 && careers.Count() == 0) @@ -1566,7 +1607,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services summarySheet.Cells[row, 4].Value = item.Nationality; summarySheet.Cells[row, 5].Value = item.DateOfBirth; summarySheet.Cells[row, 6].Value = item.Age; - summarySheet.Cells[row, 7].Value = item.RelationshipName; + summarySheet.Cells[row, 7].Value = item.ReligionName; summarySheet.Cells[row, 8].Value = item.Telephone; summarySheet.Cells[row, 9].Value = item.MobilePhone; summarySheet.Cells[row, 10].Value = item.Email; @@ -1581,31 +1622,30 @@ namespace BMA.EHR.Recurit.Exam.Service.Services summarySheet.Cells[row, 19].Value = item.CurrentDistrictName; summarySheet.Cells[row, 20].Value = item.CurrentSubDistrictName; summarySheet.Cells[row, 21].Value = item.CurrentZipCode; - summarySheet.Cells[row, 22].Value = item.MarryFullName; - summarySheet.Cells[row, 23].Value = item.FatherFullName; - summarySheet.Cells[row, 24].Value = item.MotherFullName; - summarySheet.Cells[row, 25].Value = item.OccupationType == null ? null : GenerateStatusOccupation(item.OccupationType); - summarySheet.Cells[row, 26].Value = item.OccupationPosition; - summarySheet.Cells[row, 27].Value = item.OccupationCompany; - summarySheet.Cells[row, 28].Value = item.OccupationDepartment; - summarySheet.Cells[row, 29].Value = item.OccupationEmail; - summarySheet.Cells[row, 30].Value = item.OccupationTelephone; - summarySheet.Cells[row, 43].Value = item.Number; - summarySheet.Cells[row, 44].Value = item.ExamIdenNumber; - summarySheet.Cells[row, 45].Value = item.SeatNumber; - summarySheet.Cells[row, 46].Value = item.PointTotalA; - summarySheet.Cells[row, 47].Value = item.PointA; - summarySheet.Cells[row, 48].Value = item.ResultA; - summarySheet.Cells[row, 49].Value = item.PointTotalB; - summarySheet.Cells[row, 50].Value = item.PointB; - summarySheet.Cells[row, 51].Value = item.ResultB; - summarySheet.Cells[row, 52].Value = item.PointTotalC; - summarySheet.Cells[row, 53].Value = item.PointC; - summarySheet.Cells[row, 54].Value = item.ResultC; - summarySheet.Cells[row, 55].Value = item.Pass; - summarySheet.Cells[row, 56].Value = item.CreatedAt.Date.ToThaiShortDate(); - summarySheet.Cells[row, 57].Value = item.RegisterDate; + summarySheet.Cells[row, 22].Value = item.OccupationPosition; + summarySheet.Cells[row, 23].Value = item.OccupationSalary; + summarySheet.Cells[row, 24].Value = item.OccupationGroup; + summarySheet.Cells[row, 25].Value = item.OccupationPile; + summarySheet.Cells[row, 26].Value = item.OccupationOrg; + summarySheet.Cells[row, 27].Value = item.OccupationPositionType == null ? null : GenerateStatusOccupation(item.OccupationPositionType); + summarySheet.Cells[row, 28].Value = item.OccupationTelephone; + + summarySheet.Cells[row, 44].Value = item.Number; + summarySheet.Cells[row, 45].Value = item.ExamIdenNumber; + summarySheet.Cells[row, 46].Value = item.SeatNumber; + summarySheet.Cells[row, 47].Value = item.PointTotalA; + summarySheet.Cells[row, 48].Value = item.PointA; + summarySheet.Cells[row, 49].Value = item.ResultA; + summarySheet.Cells[row, 50].Value = item.PointTotalB; + summarySheet.Cells[row, 51].Value = item.PointB; + summarySheet.Cells[row, 52].Value = item.ResultB; + summarySheet.Cells[row, 53].Value = item.PointTotalC; + summarySheet.Cells[row, 54].Value = item.PointC; + summarySheet.Cells[row, 55].Value = item.ResultC; + summarySheet.Cells[row, 56].Value = item.Pass; + summarySheet.Cells[row, 57].Value = item.CreatedAt.Date.ToThaiShortDate(); + summarySheet.Cells[row, 58].Value = item.RegisterDate; row++; } } @@ -1641,7 +1681,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services Nationality = c.Nationality, DateOfBirth = c.DateOfBirth == null ? "" : c.DateOfBirth.Value.Date.ToThaiShortDate(), Age = c.DateOfBirth == null ? 0 : DateTime.Now.Date.Year - c.DateOfBirth.Value.Date.Year, - RelationshipName = c.RelationshipName, + ReligionName = c.ReligionName, Telephone = c.Telephone, MobilePhone = c.MobilePhone, Email = c.Email, @@ -1656,14 +1696,12 @@ namespace BMA.EHR.Recurit.Exam.Service.Services CurrentDistrictName = c.CurrentDistrictName, CurrentSubDistrictName = c.CurrentSubDistrictName, CurrentZipCode = c.CurrentZipCode, - MarryFullName = $"{c.MarryPrefixName}{c.MarryFirstName} {c.MarryLastName}", - FatherFullName = $"{c.FatherPrefixName}{c.FatherFirstName} {c.FatherLastName}", - MotherFullName = $"{c.MotherPrefixName}{c.MotherFirstName} {c.MotherLastName}", - OccupationType = c.OccupationType, + OccupationOrg = c.OccupationOrg, + OccupationPile = c.OccupationPile, + OccupationGroup = c.OccupationGroup, + OccupationSalary = c.OccupationSalary, OccupationPosition = c.OccupationPosition, - OccupationCompany = c.OccupationCompany, - OccupationDepartment = c.OccupationDepartment, - OccupationEmail = c.OccupationEmail, + OccupationPositionType = c.OccupationPositionType, OccupationTelephone = c.OccupationTelephone, Number = c.Number, ExamIdenNumber = c.ExamIdenNumber, @@ -1729,7 +1767,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services .Where(x => x.Candidate.PeriodExam == periodExam) .Where(x => x.Candidate.CreatedAt.Date <= item.DateEnd.Date) .Where(x => x.Candidate.CreatedAt.Date >= item.DateStart.Date) - .GroupBy(x => x.EducationLevelName) + .GroupBy(x => x.EducationLevelExamName) .Select(x => new { Name = x.Key, @@ -1746,7 +1784,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services } if (educations.Count() != 0) { - summarySheet.Cells[5, fixMerge, 5, rowName - 1].Value = "วุฒิการศึกษา"; + summarySheet.Cells[5, fixMerge, 5, rowName - 1].Value = "วุฒิที่ใช้สมัครสอบ"; summarySheet.Cells[5, fixMerge, 5, rowName - 1].Merge = true; fixMerge = rowCount; } @@ -1755,7 +1793,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services .Where(x => x.Candidate.PeriodExam == periodExam) .Where(x => x.Candidate.CreatedAt.Date <= item.DateEnd.Date) .Where(x => x.Candidate.CreatedAt.Date >= item.DateStart.Date) - .GroupBy(x => x.Name) + .GroupBy(x => x.Position) .Select(x => new { Name = x.Key, @@ -1866,8 +1904,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Services public async Task UpdateAsyncCandidateToPlacement(Guid examId) { var periodExam = await _context.PeriodExams.AsQueryable() - .Include(x => x.Candidate) - .ThenInclude(x => x.Educations) .Include(x => x.Candidate) .ThenInclude(x => x.PositionExam) .Include(x => x.Candidate) @@ -1911,7 +1947,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services Lastname = candidate.LastName, Nationality = candidate.Nationality, DateOfBirth = candidate.DateOfBirth, - Relationship = await _contextMetadata.Relationships.FirstOrDefaultAsync(x => x.Id == candidate.RelationshipId), + Religion = await _contextMetadata.Religions.FirstOrDefaultAsync(x => x.Id == candidate.ReligionId), Email = candidate.Email, CitizenId = candidate.CitizenId, CitizenDistrict = await _contextMetadata.Districts.FirstOrDefaultAsync(x => x.Id == candidate.CitizenDistrictId), @@ -1947,12 +1983,13 @@ namespace BMA.EHR.Recurit.Exam.Service.Services MotherLastName = candidate.MotherLastName, MotherOccupation = candidate.MotherOccupation, MotherNationality = candidate.MotherNationality, - OccupationType = candidate.OccupationType, - OccupationCompany = candidate.OccupationCompany, - OccupationDepartment = candidate.OccupationDepartment, - OccupationEmail = candidate.OccupationEmail, - OccupationTelephone = candidate.OccupationTelephone, + OccupationOrg = candidate.OccupationOrg, + OccupationPile = candidate.OccupationPile, + OccupationGroup = candidate.OccupationGroup, + OccupationSalary = candidate.OccupationSalary, OccupationPosition = candidate.OccupationPosition, + OccupationPositionType = candidate.OccupationPositionType, + OccupationTelephone = candidate.OccupationTelephone, PointTotalA = candidate.PointTotalA == null ? null : Convert.ToDouble(candidate.PointTotalA), PointA = candidate.PointA == null ? null : Convert.ToDouble(candidate.PointA), PointTotalB = candidate.PointTotalB == null ? null : Convert.ToDouble(candidate.PointTotalB), @@ -1978,13 +2015,12 @@ namespace BMA.EHR.Recurit.Exam.Service.Services var placementEducation = new PlacementEducation { PlacementProfile = placementProfile, - EducationLevel = await _contextMetadata.EducationLevels.FirstOrDefaultAsync(x => x.Id == education.EducationLevelId), - Field = education.Major, - Gpa = education.Scores.ToString(), - Institute = education.Name, + EducationLevel = await _contextMetadata.EducationLevels.FirstOrDefaultAsync(x => x.Id == education.EducationLevelExamId), + Field = education.EducationMajor, + Gpa = education.EducationScores, + Institute = education.EducationLocation, IsDate = true, - StartDate = education.DurationStart, - EndDate = education.DurationEnd, + FinishDate = education.EducationEndDate, CreatedAt = DateTime.Now, CreatedUserId = UserId ?? "", LastUpdatedAt = DateTime.Now, @@ -2103,12 +2139,14 @@ namespace BMA.EHR.Recurit.Exam.Service.Services // MotherLastName = candidate.MotherLastName, // MotherOccupation = candidate.MotherOccupation, // MotherNationality = candidate.MotherNationality, - OccupationType = "other", + + OccupationPositionType = "other", // OccupationCompany = candidate.OccupationCompany, - OccupationDepartment = candidate.Occupations.FirstOrDefault() == null ? null : candidate.Occupations.FirstOrDefault().Workplace, + // OccupationDepartment = candidate.Occupations.FirstOrDefault() == null ? null : candidate.Occupations.FirstOrDefault().Workplace, // OccupationEmail = candidate.OccupationEmail, OccupationTelephone = candidate.Occupations.FirstOrDefault() == null ? null : candidate.Occupations.FirstOrDefault().Telephone, OccupationPosition = candidate.Occupations.FirstOrDefault() == null ? null : candidate.Occupations.FirstOrDefault().Position, + PointTotalA = disableScore == null ? null : Convert.ToDouble(disableScore.FullA), PointA = disableScore == null ? null : Convert.ToDouble(disableScore.SumA), PointTotalB = disableScore == null ? null : Convert.ToDouble(disableScore.FullB),