diff --git a/Controllers/PeriodExamController.cs b/Controllers/PeriodExamController.cs index b0e2c44..0c395c9 100644 --- a/Controllers/PeriodExamController.cs +++ b/Controllers/PeriodExamController.cs @@ -260,6 +260,14 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers { await _periodExamService.UpdateImgAsync(examId, files); } + else if (type == "barcode") + { + await _periodExamService.UpdateBarcodeAsync(examId, files); + } + else if (type == "qrcode") + { + await _periodExamService.UpdateQrcodeAsync(examId, files); + } else { await _periodExamService.UpdateDocAsync(examId, files); @@ -735,7 +743,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers //string excelName = $"Candidate_{DateTime.Now.ToString("yyyyMMddHHmmssfff")}.xlsx"; //return File(stream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", excelName); - + var data = await _periodExamService.NewDownloadCandidateAsync(examId); return Success(data); } @@ -765,7 +773,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers //string excelName = $"Candidate_{DateTime.Now.ToString("yyyyMMddHHmmssfff")}.xlsx"; //return File(stream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", excelName); - + var data = await _periodExamService.NewDownloadCandidateAllAsync(examId); return Success(data); } diff --git a/Data/ApplicationDbContext.cs b/Data/ApplicationDbContext.cs index 144eeef..864e3d8 100644 --- a/Data/ApplicationDbContext.cs +++ b/Data/ApplicationDbContext.cs @@ -56,6 +56,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Data public DbSet PeriodExamDocuments { get; set; } public DbSet PeriodExamImages { get; set; } + public DbSet PeriodExamBarCodes { get; set; } + public DbSet PeriodExamQrCodes { get; set; } public DbSet CMSCandidates { get; set; } diff --git a/Data/Migrations/ApplicationDbContextModelSnapshot.cs b/Data/Migrations/ApplicationDbContextModelSnapshot.cs index 532b016..0c93885 100644 --- a/Data/Migrations/ApplicationDbContextModelSnapshot.cs +++ b/Data/Migrations/ApplicationDbContextModelSnapshot.cs @@ -59,11 +59,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations .HasColumnOrder(101) .HasComment("User Id ที่สร้างข้อมูล"); - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(106) - .HasComment("สถานะการใช้งาน"); - b.Property("LastUpdateFullName") .IsRequired() .HasMaxLength(200) @@ -124,11 +119,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations .HasColumnOrder(101) .HasComment("User Id ที่สร้างข้อมูล"); - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(106) - .HasComment("สถานะการใช้งาน"); - b.Property("LastUpdateFullName") .IsRequired() .HasMaxLength(200) @@ -214,11 +204,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations .HasColumnType("longtext") .HasComment("อำเภอ"); - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(106) - .HasComment("สถานะการใช้งาน"); - b.Property("LastUpdateFullName") .IsRequired() .HasMaxLength(200) @@ -319,11 +304,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations .HasColumnOrder(101) .HasComment("User Id ที่สร้างข้อมูล"); - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(106) - .HasComment("สถานะการใช้งาน"); - b.Property("LastUpdateFullName") .IsRequired() .HasMaxLength(200) @@ -520,11 +500,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations .HasColumnOrder(1) .HasComment("ชื่อจริง"); - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(106) - .HasComment("สถานะการใช้งาน"); - b.Property("Knowledge") .HasColumnType("longtext") .HasComment("ความสามารถพิเศษ"); @@ -892,11 +867,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations b.Property("DocumentId") .HasColumnType("char(36)"); - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(106) - .HasComment("สถานะการใช้งาน"); - b.Property("LastUpdateFullName") .IsRequired() .HasMaxLength(200) @@ -971,11 +941,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations .HasColumnOrder(4) .HasComment("กลุ่ม/ฝ่าย"); - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(106) - .HasComment("สถานะการใช้งาน"); - b.Property("LastUpdateFullName") .IsRequired() .HasMaxLength(200) @@ -1096,11 +1061,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations .HasMaxLength(20) .HasColumnType("varchar(20)"); - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(106) - .HasComment("สถานะการใช้งาน"); - b.Property("Isspecial") .IsRequired() .HasMaxLength(1) @@ -1253,11 +1213,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations .HasMaxLength(200) .HasColumnType("varchar(200)"); - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(106) - .HasComment("สถานะการใช้งาน"); - b.Property("LastUpdateFullName") .IsRequired() .HasMaxLength(200) @@ -1388,11 +1343,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations b.Property("ExpiredDate") .HasColumnType("datetime(6)"); - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(106) - .HasComment("สถานะการใช้งาน"); - b.Property("IssueDate") .HasColumnType("datetime(6)"); @@ -1459,11 +1409,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations b.Property("DocumentFileId") .HasColumnType("char(36)"); - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(106) - .HasComment("สถานะการใช้งาน"); - b.Property("LastUpdateFullName") .IsRequired() .HasMaxLength(200) @@ -1539,11 +1484,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations .HasMaxLength(200) .HasColumnType("varchar(200)"); - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(106) - .HasComment("สถานะการใช้งาน"); - b.Property("LastUpdateFullName") .IsRequired() .HasMaxLength(200) @@ -1629,11 +1569,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations .HasColumnOrder(1) .HasComment("รายละเอียดการนำเข้า"); - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(106) - .HasComment("สถานะการใช้งาน"); - b.Property("LastUpdateFullName") .IsRequired() .HasMaxLength(200) @@ -1694,11 +1629,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations b.Property("DisableId") .HasColumnType("char(36)"); - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(106) - .HasComment("สถานะการใช้งาน"); - b.Property("LastUpdateFullName") .IsRequired() .HasMaxLength(200) @@ -1819,11 +1749,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations b.Property("DisableId") .HasColumnType("char(36)"); - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(106) - .HasComment("สถานะการใช้งาน"); - b.Property("LastUpdateFullName") .IsRequired() .HasMaxLength(200) @@ -1957,11 +1882,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations b.Property("FullC") .HasColumnType("int"); - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(106) - .HasComment("สถานะการใช้งาน"); - b.Property("LastUpdateFullName") .IsRequired() .HasMaxLength(200) @@ -2054,11 +1974,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations b.Property("ImportFileId") .HasColumnType("char(36)"); - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(106) - .HasComment("สถานะการใช้งาน"); - b.Property("LastUpdateFullName") .IsRequired() .HasMaxLength(200) @@ -2199,11 +2114,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations .HasColumnType("longtext") .HasComment("ประเภทสถานศึกษา"); - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(106) - .HasComment("สถานะการใช้งาน"); - b.Property("LastUpdateFullName") .IsRequired() .HasMaxLength(200) @@ -2270,6 +2180,10 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations .HasColumnType("tinyint(1)") .HasComment("ตรวจสอบเอกสารหลังประกาศผลสอบ"); + b.Property("CompanyCode") + .HasColumnType("longtext") + .HasComment("Company code"); + b.Property("CreatedAt") .HasColumnType("datetime(6)") .HasColumnOrder(100) @@ -2289,6 +2203,10 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations .HasColumnOrder(101) .HasComment("User Id ที่สร้างข้อมูล"); + b.Property("CustomerName") + .HasColumnType("longtext") + .HasComment("Customer name"); + b.Property("Detail") .HasColumnType("longtext") .HasComment("รายละเอียดสมัครสอบ"); @@ -2376,6 +2294,14 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations .HasColumnOrder(3) .HasComment("วันเริ่มชำระเงิน"); + b.Property("Reason") + .HasColumnType("text") + .HasComment("หมายเหตุ"); + + b.Property("RefNo1") + .HasColumnType("longtext") + .HasComment("Ref No1"); + b.Property("RegisterEndDate") .HasColumnType("datetime(6)") .HasColumnOrder(2) @@ -2386,6 +2312,10 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations .HasColumnOrder(1) .HasComment("วันเริ่มสมัครสอบ"); + b.Property("Remark") + .HasColumnType("text") + .HasComment("remark"); + b.Property("Round") .HasColumnType("int") .HasColumnOrder(9) @@ -2406,6 +2336,68 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations b.ToTable("PeriodExams"); }); + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.PeriodExamBarCode", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("PeriodExamId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("DocumentId"); + + b.HasIndex("PeriodExamId"); + + b.ToTable("PeriodExamBarCodes"); + }); + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.PeriodExamDocument", b => { b.Property("Id") @@ -2437,11 +2429,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations b.Property("DocumentId") .HasColumnType("char(36)"); - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(106) - .HasComment("สถานะการใช้งาน"); - b.Property("LastUpdateFullName") .IsRequired() .HasMaxLength(200) @@ -2504,11 +2491,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations b.Property("DocumentId") .HasColumnType("char(36)"); - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(106) - .HasComment("สถานะการใช้งาน"); - b.Property("LastUpdateFullName") .IsRequired() .HasMaxLength(200) @@ -2540,6 +2522,68 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations b.ToTable("PeriodExamImages"); }); + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.PeriodExamQrCode", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("PeriodExamId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("DocumentId"); + + b.HasIndex("PeriodExamId"); + + b.ToTable("PeriodExamQrCodes"); + }); + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.PositionExam", b => { b.Property("Id") @@ -2576,11 +2620,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations .HasColumnType("tinyint(1)") .HasComment("ปริญญาบัตรขึ้นไป"); - b.Property("IsActive") - .HasColumnType("tinyint(1)") - .HasColumnOrder(106) - .HasComment("สถานะการใช้งาน"); - b.Property("LastUpdateFullName") .IsRequired() .HasMaxLength(200) @@ -2886,6 +2925,25 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations b.Navigation("ImportFile"); }); + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.PeriodExamBarCode", 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("PeriodExamBarCodes") + .HasForeignKey("PeriodExamId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Document"); + + b.Navigation("PeriodExam"); + }); + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.PeriodExamDocument", b => { b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Documents.Document", "Document") @@ -2924,6 +2982,25 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations b.Navigation("PeriodExam"); }); + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.PeriodExamQrCode", 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("PeriodExamQrCodes") + .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") @@ -2979,10 +3056,14 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations b.Navigation("ImportHostories"); + b.Navigation("PeriodExamBarCodes"); + b.Navigation("PeriodExamDocuments"); b.Navigation("PeriodExamImages"); + b.Navigation("PeriodExamQrCodes"); + b.Navigation("PositionExam"); b.Navigation("ScoreImport"); diff --git a/Migrations/20250127060832_update table period add qrcode.Designer.cs b/Migrations/20250127060832_update table period add qrcode.Designer.cs new file mode 100644 index 0000000..1961ea9 --- /dev/null +++ b/Migrations/20250127060832_update table period add qrcode.Designer.cs @@ -0,0 +1,3077 @@ +// +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("20250127060832_update table period add qrcode")] + partial class updatetableperiodaddqrcode + { + /// + 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("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("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("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("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("ContactFirstname") + .HasColumnType("longtext") + .HasComment("ชื่อ บุคคลที่สามารถติดต่อได้"); + + b.Property("ContactLastname") + .HasColumnType("longtext") + .HasComment("สกุล บุคคลที่สามารถติดต่อได้"); + + b.Property("ContactPrefixId") + .HasColumnType("char(36)") + .HasComment("Id คำนำหน้า บุคคลที่สามารถติดต่อได้"); + + b.Property("ContactPrefixName") + .HasColumnType("longtext") + .HasComment("คำนำหน้า บุคคลที่สามารถติดต่อได้"); + + b.Property("ContactRelations") + .HasColumnType("longtext") + .HasComment("เกี่ยวข้องเป็น บุคคลที่สามารถติดต่อได้"); + + b.Property("ContactTel") + .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("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("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") + .HasColumnType("longtext") + .HasColumnOrder(4) + .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") + .HasColumnType("longtext") + .HasColumnOrder(6) + .HasComment("สังกัด"); + + b.Property("Pile") + .HasColumnType("longtext") + .HasColumnOrder(5) + .HasComment("กอง"); + + b.Property("Position") + .IsRequired() + .HasColumnType("longtext") + .HasColumnOrder(3) + .HasComment("ชื่อตำแหน่ง"); + + b.Property("RangeDate") + .IsRequired() + .HasColumnType("longtext") + .HasColumnOrder(7) + .HasComment("ระยะเวลา"); + + b.Property("Type") + .IsRequired() + .HasColumnType("longtext") + .HasColumnOrder(8) + .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("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("PositionLevel") + .HasColumnType("longtext"); + + b.Property("PositionName") + .HasColumnType("longtext"); + + b.Property("PositionType") + .HasColumnType("longtext"); + + b.Property("Prefix") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("Qualified") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("varchar(1)"); + + b.Property("Race") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("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("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("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("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("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("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("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("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("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("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("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("CompanyCode") + .HasColumnType("longtext") + .HasComment("Company code"); + + 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("CustomerName") + .HasColumnType("longtext") + .HasComment("Customer name"); + + 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("Reason") + .HasColumnType("text") + .HasComment("หมายเหตุ"); + + b.Property("RefNo1") + .HasColumnType("longtext") + .HasComment("Ref No1"); + + b.Property("RegisterEndDate") + .HasColumnType("datetime(6)") + .HasColumnOrder(2) + .HasComment("วันสิ้นสุดสมัครสอบ"); + + b.Property("RegisterStartDate") + .HasColumnType("datetime(6)") + .HasColumnOrder(1) + .HasComment("วันเริ่มสมัครสอบ"); + + b.Property("Remark") + .HasColumnType("text") + .HasComment("remark"); + + 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.PeriodExamBarCode", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("PeriodExamId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("DocumentId"); + + b.HasIndex("PeriodExamId"); + + b.ToTable("PeriodExamBarCodes"); + }); + + 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("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("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.PeriodExamQrCode", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("PeriodExamId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("DocumentId"); + + b.HasIndex("PeriodExamId"); + + b.ToTable("PeriodExamQrCodes"); + }); + + 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("Code") + .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("HighDegree") + .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("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("Careers") + .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.PeriodExamBarCode", 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("PeriodExamBarCodes") + .HasForeignKey("PeriodExamId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Document"); + + b.Navigation("PeriodExam"); + }); + + 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.PeriodExamQrCode", 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("PeriodExamQrCodes") + .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("Careers"); + + 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("PeriodExamBarCodes"); + + b.Navigation("PeriodExamDocuments"); + + b.Navigation("PeriodExamImages"); + + b.Navigation("PeriodExamQrCodes"); + + b.Navigation("PositionExam"); + + b.Navigation("ScoreImport"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Migrations/20250127060832_update table period add qrcode.cs b/Migrations/20250127060832_update table period add qrcode.cs new file mode 100644 index 0000000..d0e8520 --- /dev/null +++ b/Migrations/20250127060832_update table period add qrcode.cs @@ -0,0 +1,450 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace BMA.EHR.Recurit.Exam.Service.Migrations +{ + /// + public partial class updatetableperiodaddqrcode : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "IsActive", + table: "ScoreImports"); + + migrationBuilder.DropColumn( + name: "IsActive", + table: "PositionExams"); + + migrationBuilder.DropColumn( + name: "IsActive", + table: "PeriodExamImages"); + + migrationBuilder.DropColumn( + name: "IsActive", + table: "PeriodExamDocuments"); + + migrationBuilder.DropColumn( + name: "IsActive", + table: "Educations"); + + migrationBuilder.DropColumn( + name: "IsActive", + table: "DisableScores"); + + migrationBuilder.DropColumn( + name: "IsActive", + table: "Disables"); + + migrationBuilder.DropColumn( + name: "IsActive", + table: "DisablePayments"); + + migrationBuilder.DropColumn( + name: "IsActive", + table: "DisableOccupations"); + + migrationBuilder.DropColumn( + name: "IsActive", + table: "DisableImportHistories"); + + migrationBuilder.DropColumn( + name: "IsActive", + table: "DisableEducations"); + + migrationBuilder.DropColumn( + name: "IsActive", + table: "DisableDocuments"); + + migrationBuilder.DropColumn( + name: "IsActive", + table: "DisableCertificates"); + + migrationBuilder.DropColumn( + name: "IsActive", + table: "DisableAddresses"); + + migrationBuilder.DropColumn( + name: "IsActive", + table: "CMSGovernments"); + + migrationBuilder.DropColumn( + name: "IsActive", + table: "CMSCandidates"); + + migrationBuilder.DropColumn( + name: "IsActive", + table: "CMSAgencys"); + + migrationBuilder.DropColumn( + name: "IsActive", + table: "Careers"); + + migrationBuilder.DropColumn( + name: "IsActive", + table: "Candidates"); + + migrationBuilder.DropColumn( + name: "IsActive", + table: "CandidateDocuments"); + + migrationBuilder.DropColumn( + name: "IsActive", + table: "BankExams"); + + migrationBuilder.AddColumn( + name: "CompanyCode", + table: "PeriodExams", + type: "longtext", + nullable: true, + comment: "Company code") + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "CustomerName", + table: "PeriodExams", + type: "longtext", + nullable: true, + comment: "Customer name") + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "Reason", + table: "PeriodExams", + type: "text", + nullable: true, + comment: "หมายเหตุ") + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "RefNo1", + table: "PeriodExams", + type: "longtext", + nullable: true, + comment: "Ref No1") + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "Remark", + table: "PeriodExams", + type: "text", + nullable: true, + comment: "remark") + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "PeriodExamBarCodes", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + CreatedAt = table.Column(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), + CreatedUserId = table.Column(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล") + .Annotation("MySql:CharSet", "utf8mb4"), + LastUpdatedAt = table.Column(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"), + LastUpdateUserId = table.Column(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด") + .Annotation("MySql:CharSet", "utf8mb4"), + CreatedFullName = table.Column(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล") + .Annotation("MySql:CharSet", "utf8mb4"), + LastUpdateFullName = table.Column(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด") + .Annotation("MySql:CharSet", "utf8mb4"), + PeriodExamId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + DocumentId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") + }, + constraints: table => + { + table.PrimaryKey("PK_PeriodExamBarCodes", x => x.Id); + table.ForeignKey( + name: "FK_PeriodExamBarCodes_Documents_DocumentId", + column: x => x.DocumentId, + principalTable: "Documents", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_PeriodExamBarCodes_PeriodExams_PeriodExamId", + column: x => x.PeriodExamId, + principalTable: "PeriodExams", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "PeriodExamQrCodes", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + CreatedAt = table.Column(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), + CreatedUserId = table.Column(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล") + .Annotation("MySql:CharSet", "utf8mb4"), + LastUpdatedAt = table.Column(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"), + LastUpdateUserId = table.Column(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด") + .Annotation("MySql:CharSet", "utf8mb4"), + CreatedFullName = table.Column(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล") + .Annotation("MySql:CharSet", "utf8mb4"), + LastUpdateFullName = table.Column(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด") + .Annotation("MySql:CharSet", "utf8mb4"), + PeriodExamId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + DocumentId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") + }, + constraints: table => + { + table.PrimaryKey("PK_PeriodExamQrCodes", x => x.Id); + table.ForeignKey( + name: "FK_PeriodExamQrCodes_Documents_DocumentId", + column: x => x.DocumentId, + principalTable: "Documents", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_PeriodExamQrCodes_PeriodExams_PeriodExamId", + column: x => x.PeriodExamId, + principalTable: "PeriodExams", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateIndex( + name: "IX_PeriodExamBarCodes_DocumentId", + table: "PeriodExamBarCodes", + column: "DocumentId"); + + migrationBuilder.CreateIndex( + name: "IX_PeriodExamBarCodes_PeriodExamId", + table: "PeriodExamBarCodes", + column: "PeriodExamId"); + + migrationBuilder.CreateIndex( + name: "IX_PeriodExamQrCodes_DocumentId", + table: "PeriodExamQrCodes", + column: "DocumentId"); + + migrationBuilder.CreateIndex( + name: "IX_PeriodExamQrCodes_PeriodExamId", + table: "PeriodExamQrCodes", + column: "PeriodExamId"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "PeriodExamBarCodes"); + + migrationBuilder.DropTable( + name: "PeriodExamQrCodes"); + + migrationBuilder.DropColumn( + name: "CompanyCode", + table: "PeriodExams"); + + migrationBuilder.DropColumn( + name: "CustomerName", + table: "PeriodExams"); + + migrationBuilder.DropColumn( + name: "Reason", + table: "PeriodExams"); + + migrationBuilder.DropColumn( + name: "RefNo1", + table: "PeriodExams"); + + migrationBuilder.DropColumn( + name: "Remark", + table: "PeriodExams"); + + migrationBuilder.AddColumn( + name: "IsActive", + table: "ScoreImports", + type: "tinyint(1)", + nullable: false, + defaultValue: false, + comment: "สถานะการใช้งาน") + .Annotation("Relational:ColumnOrder", 106); + + migrationBuilder.AddColumn( + name: "IsActive", + table: "PositionExams", + type: "tinyint(1)", + nullable: false, + defaultValue: false, + comment: "สถานะการใช้งาน") + .Annotation("Relational:ColumnOrder", 106); + + migrationBuilder.AddColumn( + name: "IsActive", + table: "PeriodExamImages", + type: "tinyint(1)", + nullable: false, + defaultValue: false, + comment: "สถานะการใช้งาน") + .Annotation("Relational:ColumnOrder", 106); + + migrationBuilder.AddColumn( + name: "IsActive", + table: "PeriodExamDocuments", + type: "tinyint(1)", + nullable: false, + defaultValue: false, + comment: "สถานะการใช้งาน") + .Annotation("Relational:ColumnOrder", 106); + + migrationBuilder.AddColumn( + name: "IsActive", + table: "Educations", + type: "tinyint(1)", + nullable: false, + defaultValue: false, + comment: "สถานะการใช้งาน") + .Annotation("Relational:ColumnOrder", 106); + + migrationBuilder.AddColumn( + name: "IsActive", + table: "DisableScores", + type: "tinyint(1)", + nullable: false, + defaultValue: false, + comment: "สถานะการใช้งาน") + .Annotation("Relational:ColumnOrder", 106); + + migrationBuilder.AddColumn( + name: "IsActive", + table: "Disables", + type: "tinyint(1)", + nullable: false, + defaultValue: false, + comment: "สถานะการใช้งาน") + .Annotation("Relational:ColumnOrder", 106); + + migrationBuilder.AddColumn( + name: "IsActive", + table: "DisablePayments", + type: "tinyint(1)", + nullable: false, + defaultValue: false, + comment: "สถานะการใช้งาน") + .Annotation("Relational:ColumnOrder", 106); + + migrationBuilder.AddColumn( + name: "IsActive", + table: "DisableOccupations", + type: "tinyint(1)", + nullable: false, + defaultValue: false, + comment: "สถานะการใช้งาน") + .Annotation("Relational:ColumnOrder", 106); + + migrationBuilder.AddColumn( + name: "IsActive", + table: "DisableImportHistories", + type: "tinyint(1)", + nullable: false, + defaultValue: false, + comment: "สถานะการใช้งาน") + .Annotation("Relational:ColumnOrder", 106); + + migrationBuilder.AddColumn( + name: "IsActive", + table: "DisableEducations", + type: "tinyint(1)", + nullable: false, + defaultValue: false, + comment: "สถานะการใช้งาน") + .Annotation("Relational:ColumnOrder", 106); + + migrationBuilder.AddColumn( + name: "IsActive", + table: "DisableDocuments", + type: "tinyint(1)", + nullable: false, + defaultValue: false, + comment: "สถานะการใช้งาน") + .Annotation("Relational:ColumnOrder", 106); + + migrationBuilder.AddColumn( + name: "IsActive", + table: "DisableCertificates", + type: "tinyint(1)", + nullable: false, + defaultValue: false, + comment: "สถานะการใช้งาน") + .Annotation("Relational:ColumnOrder", 106); + + migrationBuilder.AddColumn( + name: "IsActive", + table: "DisableAddresses", + type: "tinyint(1)", + nullable: false, + defaultValue: false, + comment: "สถานะการใช้งาน") + .Annotation("Relational:ColumnOrder", 106); + + migrationBuilder.AddColumn( + name: "IsActive", + table: "CMSGovernments", + type: "tinyint(1)", + nullable: false, + defaultValue: false, + comment: "สถานะการใช้งาน") + .Annotation("Relational:ColumnOrder", 106); + + migrationBuilder.AddColumn( + name: "IsActive", + table: "CMSCandidates", + type: "tinyint(1)", + nullable: false, + defaultValue: false, + comment: "สถานะการใช้งาน") + .Annotation("Relational:ColumnOrder", 106); + + migrationBuilder.AddColumn( + name: "IsActive", + table: "CMSAgencys", + type: "tinyint(1)", + nullable: false, + defaultValue: false, + comment: "สถานะการใช้งาน") + .Annotation("Relational:ColumnOrder", 106); + + migrationBuilder.AddColumn( + name: "IsActive", + table: "Careers", + type: "tinyint(1)", + nullable: false, + defaultValue: false, + comment: "สถานะการใช้งาน") + .Annotation("Relational:ColumnOrder", 106); + + migrationBuilder.AddColumn( + name: "IsActive", + table: "Candidates", + type: "tinyint(1)", + nullable: false, + defaultValue: false, + comment: "สถานะการใช้งาน") + .Annotation("Relational:ColumnOrder", 106); + + migrationBuilder.AddColumn( + name: "IsActive", + table: "CandidateDocuments", + type: "tinyint(1)", + nullable: false, + defaultValue: false, + comment: "สถานะการใช้งาน") + .Annotation("Relational:ColumnOrder", 106); + + migrationBuilder.AddColumn( + name: "IsActive", + table: "BankExams", + type: "tinyint(1)", + nullable: false, + defaultValue: false, + comment: "สถานะการใช้งาน") + .Annotation("Relational:ColumnOrder", 106); + } + } +} diff --git a/Models/PeriodExam.cs b/Models/PeriodExam.cs index 24cdf03..8a4c33b 100644 --- a/Models/PeriodExam.cs +++ b/Models/PeriodExam.cs @@ -89,6 +89,21 @@ namespace BMA.EHR.Recurit.Exam.Service.Models [Comment("สำนัก")] public string? Category { get; set; } + [Comment("remark"), Column(TypeName = "text")] + public string? Remark { get; set; } + + [Comment("Company code")] + public string? CompanyCode { get; set; } + + [Comment("Customer name")] + public string? CustomerName { get; set; } + + [Comment("หมายเหตุ"), Column(TypeName = "text")] + public string? Reason { get; set; } + + [Comment("Ref No1")] + public string? RefNo1 { get; set; } + [Comment("รายชื่อคนสม้ครในรอบ")] public List Candidate { get; set; } = new List(); @@ -103,6 +118,12 @@ namespace BMA.EHR.Recurit.Exam.Service.Models [Comment("รูป")] public virtual List PeriodExamImages { get; set; } = new(); + + [Comment("qr code")] + public virtual List PeriodExamQrCodes { get; set; } = new(); + + [Comment("bar code")] + public virtual List PeriodExamBarCodes { get; set; } = new(); public Document? ImportFile { get; set; } = new Document(); public List Disables { get; set; } = new List(); public ScoreImport? ScoreImport { get; set; } diff --git a/Models/PeriodExamBarCode.cs b/Models/PeriodExamBarCode.cs new file mode 100644 index 0000000..32f8f60 --- /dev/null +++ b/Models/PeriodExamBarCode.cs @@ -0,0 +1,15 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Recurit.Exam.Service.Models.Documents; + +namespace BMA.EHR.Recurit.Exam.Service.Models +{ + public class PeriodExamBarCode : EntityBase + { + [Required, Comment("Id รอบสมัครสอบ")] + public virtual PeriodExam? PeriodExam { get; set; } + [Required, Comment("Id ไฟล์รูป")] + public virtual Document? Document { get; set; } + } +} diff --git a/Models/PeriodExamQrCode.cs b/Models/PeriodExamQrCode.cs new file mode 100644 index 0000000..e63cc9e --- /dev/null +++ b/Models/PeriodExamQrCode.cs @@ -0,0 +1,15 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Recurit.Exam.Service.Models.Documents; + +namespace BMA.EHR.Recurit.Exam.Service.Models +{ + public class PeriodExamQrCode : EntityBase + { + [Required, Comment("Id รอบสมัครสอบ")] + public virtual PeriodExam? PeriodExam { get; set; } + [Required, Comment("Id ไฟล์รูป")] + public virtual Document? Document { get; set; } + } +} diff --git a/Request/RequestPeriodExam.cs b/Request/RequestPeriodExam.cs index 0e617f8..a4f0985 100644 --- a/Request/RequestPeriodExam.cs +++ b/Request/RequestPeriodExam.cs @@ -29,6 +29,12 @@ namespace BMA.EHR.Recurit.Exam.Service.Request public string? EditorCondition { get; set; } public string? EditorConfirm { get; set; } public string? Note { get; set; } + public string? Remark { get; set; } + public string? CompanyCode { get; set; } + public string? CustomerName { get; set; } + public string? Reason { get; set; } + public string? RefNo1 { get; set; } + public List? Doc { get; set; } public List? Image { get; set; } public List BankExam { get; set; } = new(); diff --git a/Response/PeriodExamCandidateResponseItem.cs b/Response/PeriodExamCandidateResponseItem.cs index 7c626e6..a765efb 100644 --- a/Response/PeriodExamCandidateResponseItem.cs +++ b/Response/PeriodExamCandidateResponseItem.cs @@ -34,10 +34,17 @@ namespace BMA.EHR.Recurit.Exam.Service.Response public string? Note { get; set; } public bool IsActive { get; set; } public bool SetSeat { get; set; } + public string? Remark { get; set; } + public string? CompanyCode { get; set; } + public string? CustomerName { get; set; } + public string? Reason { get; set; } + public string? RefNo1 { get; set; } public List Candidate { get; set; } = new List(); public List PositionExam { get; set; } = new List(); public List BankExam { get; set; } = new List(); public List Documents { get; set; } = new List(); public List Images { get; set; } = new List(); + public List BarCodes { get; set; } = new List(); + public List QrCodes { get; set; } = new List(); } } diff --git a/Services/PeriodExamService.cs b/Services/PeriodExamService.cs index 55e2688..2251cdd 100644 --- a/Services/PeriodExamService.cs +++ b/Services/PeriodExamService.cs @@ -115,6 +115,11 @@ namespace BMA.EHR.Recurit.Exam.Service.Services IsActive = x.IsActive, Name = x.Name, Note = x.Note, + Remark = x.Remark, + CompanyCode = x.CompanyCode, + CustomerName = x.CustomerName, + Reason = x.Reason, + RefNo1 = x.RefNo1, OrganizationCodeId = x.OrganizationCodeId, OrganizationCodeName = x.OrganizationCodeName, OrganizationId = x.OrganizationId, @@ -160,6 +165,11 @@ namespace BMA.EHR.Recurit.Exam.Service.Services IsActive = x.IsActive, Name = x.Name, Note = x.Note, + Remark = x.Remark, + CompanyCode = x.CompanyCode, + CustomerName = x.CustomerName, + Reason = x.Reason, + RefNo1 = x.RefNo1, OrganizationCodeId = x.OrganizationCodeId, OrganizationCodeName = x.OrganizationCodeName, OrganizationId = x.OrganizationId, @@ -209,6 +219,22 @@ namespace BMA.EHR.Recurit.Exam.Service.Services FileType = b.Document == null ? "" : b.Document.FileType, Detail = b.Document == null ? "" : b.Document.Id.ToString(), }).ToList(), + BarCodes = x.PeriodExamBarCodes.OrderBy(o => o.CreatedAt).Select(b => new FileListResponse + { + Id = b.Document == null ? "" : b.Document.Id.ToString(), + FileName = b.Document == null ? "" : b.Document.FileName, + FileSize = b.Document == null ? 0 : b.Document.FileSize, + FileType = b.Document == null ? "" : b.Document.FileType, + Detail = b.Document == null ? "" : b.Document.Id.ToString(), + }).ToList(), + QrCodes = x.PeriodExamQrCodes.OrderBy(o => o.CreatedAt).Select(b => new FileListResponse + { + Id = b.Document == null ? "" : b.Document.Id.ToString(), + FileName = b.Document == null ? "" : b.Document.FileName, + FileSize = b.Document == null ? 0 : b.Document.FileSize, + FileType = b.Document == null ? "" : b.Document.FileType, + Detail = b.Document == null ? "" : b.Document.Id.ToString(), + }).ToList(), }) .FirstOrDefaultAsync(x => x.Id == Guid.Parse(examId)); @@ -229,6 +255,20 @@ namespace BMA.EHR.Recurit.Exam.Service.Services periodExam.Documents[i].Detail = _minioService.ImagesPath(Guid.Parse(periodExam.Documents[i].Detail)).Result; i++; } + i = 0; + foreach (var item in periodExam.QrCodes) + { + if (periodExam.QrCodes[i].Detail != null && periodExam.QrCodes[i].Detail != "") + periodExam.QrCodes[i].Detail = _minioService.ImagesPath(Guid.Parse(periodExam.QrCodes[i].Detail)).Result; + i++; + } + i = 0; + foreach (var item in periodExam.BarCodes) + { + if (periodExam.BarCodes[i].Detail != null && periodExam.BarCodes[i].Detail != "") + periodExam.BarCodes[i].Detail = _minioService.ImagesPath(Guid.Parse(periodExam.BarCodes[i].Detail)).Result; + i++; + } return periodExam; } @@ -319,6 +359,11 @@ namespace BMA.EHR.Recurit.Exam.Service.Services EditorCondition = inserted.EditorCondition, EditorConfirm = inserted.EditorConfirm, Note = inserted.Note, + Remark = inserted.Remark, + CompanyCode = inserted.CompanyCode, + CustomerName = inserted.CustomerName, + Reason = inserted.Reason, + RefNo1 = inserted.RefNo1, CreatedAt = DateTime.Now, CreatedUserId = UserId ?? "", LastUpdatedAt = DateTime.Now, @@ -415,6 +460,11 @@ namespace BMA.EHR.Recurit.Exam.Service.Services periodExam.EditorCondition = updated.EditorCondition; periodExam.EditorConfirm = updated.EditorConfirm; periodExam.Note = updated.Note; + periodExam.Remark = updated.Remark; + periodExam.CompanyCode = updated.CompanyCode; + periodExam.CustomerName = updated.CustomerName; + periodExam.Reason = updated.Reason; + periodExam.RefNo1 = updated.RefNo1; periodExam.LastUpdatedAt = DateTime.Now; periodExam.LastUpdateUserId = UserId ?? ""; periodExam.LastUpdateFullName = FullName ?? ""; @@ -599,6 +649,73 @@ namespace BMA.EHR.Recurit.Exam.Service.Services await _context.SaveChangesAsync(); } + public async Task UpdateBarcodeAsync(string examId, IFormFileCollection files) + { + var periodExam = await _context.PeriodExams.AsQueryable() + .Include(x => x.PeriodExamBarCodes) + .ThenInclude(x => x.Document) + .FirstOrDefaultAsync(x => x.Id == Guid.Parse(examId)); + + if (periodExam == null) + throw new Exception(GlobalMessages.ExamNotFound); + if (periodExam.PeriodExamBarCodes != null && periodExam.PeriodExamBarCodes[0] != null && periodExam.PeriodExamBarCodes[0].Document != null) + await _minioService.DeleteFileAsync(periodExam.PeriodExamBarCodes[0].Document.Id); + foreach (var file in files) + { + var doc = await _minioService.UploadFileAsync(file); + + var document = await _context.Documents.AsQueryable() + .FirstOrDefaultAsync(x => x.Id == doc.Id); + + if (document == null) + throw new Exception(GlobalMessages.NoFileToUpload); + + var periodExamBarCode = new PeriodExamBarCode + { + PeriodExam = periodExam, + Document = document, + }; + + await _context.PeriodExamBarCodes.AddAsync(periodExamBarCode); + } + + await _context.SaveChangesAsync(); + } + + public async Task UpdateQrcodeAsync(string examId, IFormFileCollection files) + { + var periodExam = await _context.PeriodExams.AsQueryable() + .Include(x => x.PeriodExamBarCodes) + .ThenInclude(x => x.Document) + .FirstOrDefaultAsync(x => x.Id == Guid.Parse(examId)); + + if (periodExam == null) + throw new Exception(GlobalMessages.ExamNotFound); + if (periodExam.PeriodExamBarCodes != null && periodExam.PeriodExamBarCodes[0] != null && periodExam.PeriodExamBarCodes[0].Document != null) + await _minioService.DeleteFileAsync(periodExam.PeriodExamBarCodes[0].Document.Id); + + foreach (var file in files) + { + var doc = await _minioService.UploadFileAsync(file); + + var document = await _context.Documents.AsQueryable() + .FirstOrDefaultAsync(x => x.Id == doc.Id); + + if (document == null) + throw new Exception(GlobalMessages.NoFileToUpload); + + var periodExamQrCode = new PeriodExamQrCode + { + PeriodExam = periodExam, + Document = document, + }; + + await _context.PeriodExamQrCodes.AddAsync(periodExamQrCode); + } + + await _context.SaveChangesAsync(); + } + public async Task DeleteDocument(string documentId) { await _minioService.DeleteFileAsync(Guid.Parse(documentId));