diff --git a/Controllers/DisableController.cs b/Controllers/DisableController.cs index e9f26e8..b42c74e 100644 --- a/Controllers/DisableController.cs +++ b/Controllers/DisableController.cs @@ -185,32 +185,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers throw; } } - private List GetAllIdByRoot(Guid id) - { - try - { - var ret = new List(); - - var oc = _contextMetadata.Organizations.FirstOrDefault(x => x.Id == id && x.IsActive); - if (oc != null) - ret.Add(oc.Id); - - var child = _contextMetadata.Organizations.AsQueryable().Where(x => x.ParentId == id && x.IsActive).ToList(); - if (child.Any()) - { - foreach (var item in child) - { - ret.AddRange(GetAllIdByRoot(item.Id)); - } - } - - return ret; - } - catch - { - throw; - } - } #endregion @@ -717,45 +691,10 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers x.CreatedUserId, }) .ToListAsync(); - var profileOrganizations = await _contextMetadata.ProfileOrganizations.AsQueryable() - .ToListAsync(); - var _periodExams = (from x in data - join po in profileOrganizations on Guid.Parse(x.CreatedUserId) equals po?.UserId into poGroup - from po in poGroup.DefaultIfEmpty() - select new - { - x.Id, - x.Year, - x.Name, - x.Round, - x.ImportDate, - x.ExamCount, - x.Score, - x.CreatedUserId, - OcId = po == null ? null : po.OrganizationId, - }).AsQueryable() - .ToList(); var roles = _httpContextAccessor?.HttpContext?.User?.FindAll(ClaimTypes.Role)?.Select(c => c.Value).ToList(); - // if (!roles.Contains("head")) - // { - // var criteria = new List(); - // var profileOrganization = await _contextMetadata.ProfileOrganizations.AsQueryable() - // .FirstOrDefaultAsync(x => x.UserId == Guid.Parse(UserId)); - // if (profileOrganization == null) - // return Success(new List()); - - // var ocId = _contextMetadata.Organizations.AsQueryable() - // .FirstOrDefault(x => x.Id == profileOrganization.OrganizationId); - // if (ocId == null) - // return Success(new List()); - // criteria = GetAllIdByRoot(ocId.Id); - // if (criteria.Any()) - // _periodExams = _periodExams.Where(x => x.CreatedUserId == UserId || criteria.Contains(x.OcId == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : x.OcId)).ToList(); - // } - - return Success(_periodExams); + return Success(data); } catch (Exception ex) { @@ -867,6 +806,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers r.CitizenCardExpireDate = Convert.ToDateTime(workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.PersonalCardExpireDate)]?.GetValue().ToDateTime(DateTimeFormat.Ymd, "-")); r.ApplyDate = (DateTime)workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.ApplyDate)]?.GetValue(); r.PositionName = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.PositionName)]?.GetValue().IsNull(""); + r.PositionType = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.PositionType)]?.GetValue().IsNull(""); + r.PositionLevel = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.PositionLevel)]?.GetValue().IsNull(""); // address @@ -1229,6 +1170,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers r.CitizenCardExpireDate = Convert.ToDateTime(workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.PersonalCardExpireDate)]?.GetValue().ToDateTime(DateTimeFormat.Ymd, "-")); r.ApplyDate = (DateTime)workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.ApplyDate)]?.GetValue(); r.PositionName = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.PositionName)]?.GetValue().IsNull(""); + r.PositionType = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.PositionType)]?.GetValue().IsNull(""); + r.PositionLevel = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.PositionLevel)]?.GetValue().IsNull(""); // address r.Addresses.Add(new DisableAddress() @@ -1626,6 +1569,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers applyDate = dr["applydate"] == null ? "" : Convert.ToDateTime(dr["applydate"]).ToThaiShortDate(), university = dr["university"].ToString(), position_name = dr["position_name"].ToString(), + position_level = dr["position_level"].ToString(), + position_type = dr["position_type"].ToString(), exam_name = dr["exam_name"].ToString(), exam_order = dr["exam_order"].ToString(), score_year = Convert.ToInt32(dr["score_year"]).ToThaiYear().ToString(), @@ -1722,6 +1667,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers Remark = p.Remark, University = p.Educations.First().University, PositionName = p.PositionName, + PositionType = p.PositionType, + PositionLevel = p.PositionLevel, ExamName = p.PeriodExam.Name, ExamOrder = p.PeriodExam.Round, ExamYear = p.PeriodExam.Year == null ? 0 : p.PeriodExam.Year.Value.ToThaiYear(), @@ -1820,7 +1767,9 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers ExamId = x.ExamId, CitizenId = x.CitizenId, Fullname = $"{x.Prefix}{x.FirstName} {x.LastName}", - PositionName = x.PositionName + PositionName = x.PositionName, + PositionType = x.PositionType, + PositionLevel = x.PositionLevel }) .ToList(); @@ -1835,69 +1784,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers } }; return Success(_data); - //var template_dir = Path.Combine(_webHostEnvironment.ContentRootPath, "Templates"); - - //var template_file = Path.Combine(template_dir, "ExamList.xlsx"); - - //var tmpDir = Path.Combine(_webHostEnvironment.ContentRootPath, "tmp"); - //if (!Directory.Exists(tmpDir)) - // Directory.CreateDirectory(tmpDir); - - //var exportFile = Path.Combine(tmpDir, $"ExamList_{DateTime.Now.ToString("yyyyMMddHHmmss")}.xlsx"); - //try - //{ - // // copy template - // System.IO.File.Copy(template_file, exportFile); - - // using (var excel = new ExcelPackage(new FileInfo(exportFile))) - // { - // var workSheet = excel.Workbook.Worksheets[0]; - - - // workSheet.Cells[1, 2].Value = header; - // var disables = data.Disables.OrderBy(x => x.ExamId).ToList(); - - // var row = 4; // start at row 4 - // foreach (var item in disables) - // { - // workSheet.Cells[row, 1].Value = item.ExamId; - // workSheet.Cells[row, 2].Value = item.CitizenId; - // workSheet.Cells[row, 3].Value = $"{item.Prefix}{item.FirstName} {item.LastName}"; - // workSheet.Cells[row, 4].Value = item.PositionName; - - // row++; - // } - - // excel.Save(); - - // using (FileStream fs = new FileStream(exportFile, FileMode.Open, FileAccess.Read)) - // { - // byte[] bytes = System.IO.File.ReadAllBytes(exportFile); - // fs.Read(bytes, 0, System.Convert.ToInt32(fs.Length)); - // fs.Close(); - - // var fname = Path.GetFileName(exportFile); - - // Response.Headers["Content-Disposition"] = $"inline; filename={fname}"; - - // var ret = new FileContentResult(bytes, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") - // { - // FileDownloadName = fname - // }; - - // return ret; - // } - // } - //} - //catch (Exception ex) - //{ - // return Error(ex, "ไม่สามารถส่งออกรายชื่อผู้มีสิทธิ์สอบได้!!"); - //} - //finally - //{ - // if (System.IO.File.Exists(exportFile)) - // System.IO.File.Delete(exportFile); - //} } [HttpGet("export/pass-exam/{id:length(36)}")] @@ -1928,9 +1814,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers { r.ExamId, r.CitizenId, - r.Prefix, - r.FirstName, - r.LastName, + Fullname = $"{r.Prefix}{r.FirstName} {r.LastName}", s.FullA, s.SumA, s.AStatus, @@ -1946,87 +1830,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers } }; return Success(_data); - //var template_dir = Path.Combine(_webHostEnvironment.ContentRootPath, "Templates"); - - //var template_file = Path.Combine(template_dir, "PassAExamList.xlsx"); - - //var tmpDir = Path.Combine(_webHostEnvironment.ContentRootPath, "tmp"); - //if (!Directory.Exists(tmpDir)) - // Directory.CreateDirectory(tmpDir); - - //var exportFile = Path.Combine(tmpDir, $"PassExamList_{DateTime.Now.ToString("yyyyMMddHHmmss")}.xlsx"); - - //try - //{ - // var result = (from r in data.Disables.ToList() - // join s in data_pass.ScoreImport.Scores.Where(x => x.AStatus == "ผ่าน").ToList() on r.ExamId equals s.ExamId - // select new - // { - // r.ExamId, - // r.CitizenId, - // r.Prefix, - // r.FirstName, - // r.LastName, - // s.FullA, - // s.SumA, - // s.AStatus, - - // }).ToList(); - - // // copy template - // System.IO.File.Copy(template_file, exportFile); - - // using (var excel = new ExcelPackage(new FileInfo(exportFile))) - // { - // var workSheet = excel.Workbook.Worksheets[0]; - - - // workSheet.Cells[1, 2].Value = header; - // var disables = data.Disables.OrderBy(x => x.ExamId).ToList(); - - // var row = 4; // start at row 4 - // foreach (var item in result) - // { - // workSheet.Cells[row, 1].Value = item.ExamId; - // workSheet.Cells[row, 2].Value = item.CitizenId; - // workSheet.Cells[row, 3].Value = $"{item.Prefix}{item.FirstName} {item.LastName}"; - // workSheet.Cells[row, 4].Value = item.FullA; - // workSheet.Cells[row, 5].Value = item.SumA; - // workSheet.Cells[row, 6].Value = item.AStatus; - - // row++; - // } - - // excel.Save(); - - // using (FileStream fs = new FileStream(exportFile, FileMode.Open, FileAccess.Read)) - // { - // byte[] bytes = System.IO.File.ReadAllBytes(exportFile); - // fs.Read(bytes, 0, System.Convert.ToInt32(fs.Length)); - // fs.Close(); - - // var fname = Path.GetFileName(exportFile); - - // Response.Headers["Content-Disposition"] = $"inline; filename={fname}"; - - // var ret = new FileContentResult(bytes, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") - // { - // FileDownloadName = fname - // }; - - // return ret; - // } - // } - //} - //catch (Exception ex) - //{ - // return Error(ex, "ไม่สามารถส่งออกรายชื่อผู้สอบผ่านได้!!"); - //} - //finally - //{ - // if (System.IO.File.Exists(exportFile)) - // System.IO.File.Delete(exportFile); - //} } [HttpGet("export/pass/{id:length(36)}")] @@ -2060,8 +1863,10 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers Full = s.FullA + s.FullB + s.FullC, Sum = s.SumA + s.SumB + s.SumC, Status = s.ExamStatus, - Number = s.Number, - PositionName = r.PositionName, + s.Number, + r.PositionName, + r.PositionType, + r.PositionLevel, }).ToList() .OrderBy(x => x.ExamId) .ThenBy(x => x.PositionName) @@ -2078,90 +1883,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers } }; return Success(_data); - //var template_dir = Path.Combine(_webHostEnvironment.ContentRootPath, "Templates"); - - //var template_file = Path.Combine(template_dir, "PassExamList.xlsx"); - - //var tmpDir = Path.Combine(_webHostEnvironment.ContentRootPath, "tmp"); - //if (!Directory.Exists(tmpDir)) - // Directory.CreateDirectory(tmpDir); - - //var exportFile = Path.Combine(tmpDir, $"PassExamList_{DateTime.Now.ToString("yyyyMMddHHmmss")}.xlsx"); - - //try - //{ - // var result = (from r in data.Disables.ToList() - // join s in data_pass.ScoreImport.Scores.Where(x => x.ExamStatus == "ผ่าน").ToList() on r.ExamId equals s.ExamId - // select new - // { - // r.ExamId, - // r.CitizenId, - // r.Prefix, - // r.FirstName, - // r.LastName, - // Full = s.FullA + s.FullB + s.FullC, - // Sum = s.SumA + s.SumB + s.SumC, - // Status = s.ExamStatus, - // r.PositionName, - // s.Number - // }).ToList(); - - // // copy template - // System.IO.File.Copy(template_file, exportFile); - - // using (var excel = new ExcelPackage(new FileInfo(exportFile))) - // { - // var workSheet = excel.Workbook.Worksheets[0]; - - - // workSheet.Cells[1, 2].Value = header; - // var disables = data.Disables.OrderBy(x => x.ExamId).ToList(); - - // var row = 4; // start at row 4 - // foreach (var item in result) - // { - // workSheet.Cells[row, 1].Value = item.ExamId; - // workSheet.Cells[row, 2].Value = item.CitizenId; - // workSheet.Cells[row, 3].Value = $"{item.Prefix}{item.FirstName} {item.LastName}"; - // workSheet.Cells[row, 4].Value = item.Full; - // workSheet.Cells[row, 5].Value = item.Sum; - // workSheet.Cells[row, 6].Value = item.Status; - // workSheet.Cells[row, 7].Value = item.Number; - // workSheet.Cells[row, 8].Value = item.PositionName; - - // row++; - // } - - // excel.Save(); - - // using (FileStream fs = new FileStream(exportFile, FileMode.Open, FileAccess.Read)) - // { - // byte[] bytes = System.IO.File.ReadAllBytes(exportFile); - // fs.Read(bytes, 0, System.Convert.ToInt32(fs.Length)); - // fs.Close(); - - // var fname = Path.GetFileName(exportFile); - - // Response.Headers["Content-Disposition"] = $"inline; filename={fname}"; - - // var ret = new FileContentResult(bytes, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") - // { - // FileDownloadName = fname - // }; - - // return ret; - // } - // } - //} - //catch (Exception ex) - //{ - // return Error(ex, "ไม่สามารถส่งออกรายชื่อผู้สอบผ่านได้!!"); - //} - //finally - //{ - // if (System.IO.File.Exists(exportFile)) - // System.IO.File.Delete(exportFile); - //} } /// diff --git a/Controllers/DisableReportController.cs b/Controllers/DisableReportController.cs index 7131bc8..c0a4ad1 100644 --- a/Controllers/DisableReportController.cs +++ b/Controllers/DisableReportController.cs @@ -179,6 +179,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers ExamResult = sr == null ? "" : sr.ExamStatus, University = p.Educations.First().University, PositionName = p.PositionName, + PositionType = p.PositionType, + PositionLevel = p.PositionLevel, ExamName = $"{p.PeriodExam.Name} ครั้งที่ {p.PeriodExam.Round}/{p.PeriodExam.Year.Value.ToThaiYear()}", Number = sr == null ? "" : sr.Number, // ExamCount = 10, diff --git a/Data/MetadataDbContext.cs b/Data/MetadataDbContext.cs index 506f92c..578579d 100644 --- a/Data/MetadataDbContext.cs +++ b/Data/MetadataDbContext.cs @@ -34,36 +34,36 @@ namespace BMA.EHR.Recurit.Exam.Service.Data } } - public DbSet ProfileOrganizations { get; set; } - public DbSet Profiles { get; set; } - public DbSet ProfileSalaries { get; set; } - public DbSet Organizations { get; set; } + // public DbSet ProfileOrganizations { get; set; } + // public DbSet Profiles { get; set; } + // public DbSet ProfileSalaries { get; set; } + // public DbSet Organizations { get; set; } - public DbSet Prefixes { get; set; } + // public DbSet Prefixes { get; set; } - public DbSet Religions { get; set; } + // public DbSet Religions { get; set; } - public DbSet EducationLevels { get; set; } + // public DbSet EducationLevels { get; set; } - public DbSet Relationships { get; set; } + // public DbSet Relationships { get; set; } - public DbSet Provinces { get; set; } + // public DbSet Provinces { get; set; } - public DbSet Districts { get; set; } + // public DbSet Districts { get; set; } - public DbSet SubDistricts { get; set; } + // public DbSet SubDistricts { get; set; } - public DbSet OrganizationOrganizations { get; set; } + // public DbSet OrganizationOrganizations { get; set; } - public DbSet OrganizationShortNames { get; set; } + // public DbSet OrganizationShortNames { get; set; } public DbSet Placements { get; set; } public DbSet PlacementCertificates { get; set; } public DbSet PlacementEducations { get; set; } public DbSet PlacementIsProperties { get; set; } public DbSet PlacementProfiles { get; set; } public DbSet PlacementTypes { get; set; } - public DbSet PositionPaths { get; set; } - public DbSet Genders { get; set; } + // public DbSet PositionPaths { get; set; } + // public DbSet Genders { get; set; } public DbSet Documents { get; set; } } } diff --git a/Data/Migrations/ApplicationDbContextModelSnapshot.cs b/Data/Migrations/ApplicationDbContextModelSnapshot.cs index 9542400..532b016 100644 --- a/Data/Migrations/ApplicationDbContextModelSnapshot.cs +++ b/Data/Migrations/ApplicationDbContextModelSnapshot.cs @@ -1146,9 +1146,15 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations 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) @@ -2727,7 +2733,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Career", b => { b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Candidate", "Candidate") - .WithMany() + .WithMany("Careers") .HasForeignKey("CandidateId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); @@ -2938,6 +2944,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Candidate", b => { + b.Navigation("Careers"); + b.Navigation("Educations"); }); diff --git a/Data/OrgDbContext.cs b/Data/OrgDbContext.cs new file mode 100644 index 0000000..c199ccc --- /dev/null +++ b/Data/OrgDbContext.cs @@ -0,0 +1,46 @@ +using BMA.EHR.Recurit.Exam.Service.Models; +using BMA.EHR.Recurit.Exam.Service.Models.Documents; +using Microsoft.EntityFrameworkCore; +using BMA.EHR.Domain.Models.Placement; + +namespace BMA.EHR.Recurit.Exam.Service.Data +{ + public class OrgDbContext : DbContext + { + public OrgDbContext(DbContextOptions options) + : base(options) + { + } + + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + } + + // The following configures EF to create a Sqlite database file in the + // special "local" folder for your platform. + protected override void OnConfiguring(DbContextOptionsBuilder options) + { + if (!options.IsConfigured) + { + var environment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") ?? "Production"; + var configurationBuilder = new ConfigurationBuilder() + .AddJsonFile("appsettings.json", optional: true, true) + .AddJsonFile($"appsettings.{environment}.json", true, true) + .AddEnvironmentVariables() + .Build(); + + var historyConnection = configurationBuilder.GetConnectionString("HistoryConnection"); + options.UseMySql(historyConnection, ServerVersion.AutoDetect(historyConnection)); + + } + } + public DbSet prefixe { get; set; } + public DbSet religion { get; set; } + public DbSet educationLevel { get; set; } + public DbSet relationship { get; set; } + public DbSet province { get; set; } + public DbSet district { get; set; } + public DbSet subDistrict { get; set; } + public DbSet gender { get; set; } + } +} diff --git a/Migrations/20241228061323_update table Disable add postype.Designer.cs b/Migrations/20241228061323_update table Disable add postype.Designer.cs new file mode 100644 index 0000000..fd167da --- /dev/null +++ b/Migrations/20241228061323_update table Disable add postype.Designer.cs @@ -0,0 +1,2996 @@ +// +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("20241228061323_update table Disable add postype")] + partial class updatetableDisableaddpostype + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "7.0.5") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.BankExam", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("AccountName") + .HasColumnType("longtext") + .HasComment("ชื่อบัญชี"); + + b.Property("AccountNumber") + .HasColumnType("longtext") + .HasComment("เลขบัญชี"); + + b.Property("BankName") + .HasColumnType("longtext") + .HasComment("ธนาคาร"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .HasComment("สถานะการใช้งาน"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("PeriodExamId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("PeriodExamId"); + + b.ToTable("BankExams"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.CMSAgency", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CMSCandidateId") + .HasColumnType("char(36)"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .HasComment("สถานะการใช้งาน"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Link") + .HasColumnType("longtext") + .HasComment("ลิงค์"); + + b.Property("Name") + .HasColumnType("longtext") + .HasComment("ชื่อลิงค์"); + + b.HasKey("Id"); + + b.HasIndex("CMSCandidateId"); + + b.ToTable("CMSAgencys"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.CMSCandidate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("About") + .HasColumnType("longtext") + .HasComment("ข้อมูลเกี่ยวกับเรา"); + + b.Property("Address") + .HasColumnType("longtext") + .HasComment("ที่อยู่ปัจจุบัน"); + + b.Property("BannerImgId") + .HasColumnType("char(36)"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("Description") + .HasColumnType("longtext") + .HasComment("ข้อมูลเว็บโดยย่อ"); + + b.Property("DistrictId") + .HasColumnType("char(36)") + .HasComment("Id อำเภอ"); + + b.Property("DistrictName") + .HasColumnType("longtext") + .HasComment("อำเภอ"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .HasComment("สถานะการใช้งาน"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("LogoImgId") + .HasColumnType("char(36)"); + + b.Property("NameEn") + .HasColumnType("longtext") + .HasComment("ชื่อเว็บภาษาอังกฤษ"); + + b.Property("NameTh") + .HasColumnType("longtext") + .HasComment("ชื่อเว็บภาษาไทย"); + + b.Property("ProvinceId") + .HasColumnType("char(36)") + .HasComment("Id จังหวัด"); + + b.Property("ProvinceName") + .HasColumnType("longtext") + .HasComment("จังหวัด"); + + b.Property("ShortName") + .HasColumnType("longtext") + .HasComment("ชื่อย่อ"); + + b.Property("SubDistrictId") + .HasColumnType("char(36)") + .HasComment("Id ตำบล"); + + b.Property("SubDistrictName") + .HasColumnType("longtext") + .HasComment("ตำบล"); + + b.Property("Telephone") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("โทรศัพท์"); + + b.Property("ZipCode") + .HasMaxLength(10) + .HasColumnType("varchar(10)") + .HasComment("รหัสไปรษณีย์"); + + b.HasKey("Id"); + + b.HasIndex("BannerImgId"); + + b.HasIndex("LogoImgId"); + + b.ToTable("CMSCandidates"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.CMSGovernment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CMSCandidateId") + .HasColumnType("char(36)"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .HasComment("สถานะการใช้งาน"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Link") + .HasColumnType("longtext") + .HasComment("ลิงค์"); + + b.Property("Name") + .HasColumnType("longtext") + .HasComment("ชื่อลิงค์"); + + b.HasKey("Id"); + + b.HasIndex("CMSCandidateId"); + + b.ToTable("CMSGovernments"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Candidate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CitizenDate") + .HasColumnType("datetime(6)") + .HasComment("วันที่ออกบัตร"); + + b.Property("CitizenDistrictId") + .HasColumnType("char(36)") + .HasComment("Id เขตที่ออกบัตรประชาชน"); + + b.Property("CitizenDistrictName") + .HasColumnType("longtext") + .HasComment("เขตที่ออกบัตรประชาชน"); + + b.Property("CitizenId") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("เลขประจำตัวประชาชน"); + + b.Property("CitizenProvinceId") + .HasColumnType("char(36)") + .HasComment("Id จังหวัดที่ออกบัตรประชาชน"); + + b.Property("CitizenProvinceName") + .HasColumnType("longtext") + .HasComment("จังหวัดที่ออกบัตรประชาชน"); + + b.Property("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("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .HasComment("สถานะการใช้งาน"); + + b.Property("Knowledge") + .HasColumnType("longtext") + .HasComment("ความสามารถพิเศษ"); + + b.Property("LastName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnOrder(2) + .HasComment("นามสกุล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Marry") + .HasColumnType("tinyint(1)") + .HasComment("คู่สมรส"); + + b.Property("MarryFirstName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("ชื่อจริงคู่สมรส"); + + b.Property("MarryLastName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("นามสกุลคู่สมรส"); + + b.Property("MarryNationality") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("สัญชาติคู่สมรส"); + + b.Property("MarryOccupation") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("อาชีพคู่สมรส"); + + b.Property("MarryPrefixId") + .HasColumnType("char(36)") + .HasComment("Id คำนำหน้าชื่อคู่สมรส"); + + b.Property("MarryPrefixName") + .HasColumnType("longtext") + .HasComment("คำนำหน้าชื่อคู่สมรส"); + + b.Property("MobilePhone") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("โทรศัพท์มือถือ"); + + b.Property("MotherFirstName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("ชื่อจริงมารดา"); + + b.Property("MotherLastName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("นามสกุลมารดา"); + + b.Property("MotherNationality") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("สัญชาติมารดา"); + + b.Property("MotherOccupation") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("อาชีพมารดา"); + + b.Property("MotherPrefixId") + .HasColumnType("char(36)") + .HasComment("Id คำนำหน้าชื่อมารดา"); + + b.Property("MotherPrefixName") + .HasColumnType("longtext") + .HasComment("คำนำหน้าชื่อมารดา"); + + b.Property("Nationality") + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(3) + .HasComment("สัญชาติ"); + + b.Property("Number") + .HasColumnType("longtext") + .HasComment("ลำดับที่สอบได้"); + + b.Property("OccupationGroup") + .HasColumnType("longtext") + .HasComment("ตำแหน่งปัจจุบัน กลุ่ม/ฝ่าย"); + + b.Property("OccupationOrg") + .HasColumnType("longtext") + .HasComment("ตำแหน่งปัจจุบัน ชื่อตำแหน่ง"); + + b.Property("OccupationPile") + .HasColumnType("longtext") + .HasComment("ตำแหน่งปัจจุบัน กอง"); + + b.Property("OccupationPosition") + .HasColumnType("longtext") + .HasComment("ตำแหน่งปัจจุบัน สังกัด"); + + b.Property("OccupationPositionType") + .HasColumnType("longtext") + .HasComment("ตำแหน่งปัจจุบัน ประเภทราชการ"); + + b.Property("OccupationSalary") + .HasColumnType("int") + .HasComment("ตำแหน่งปัจจุบัน เงินเดือน"); + + b.Property("OccupationTelephone") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("ตำแหน่งปัจจุบัน เบอร์โทรที่ทำงาน"); + + b.Property("Pass") + .HasColumnType("longtext") + .HasComment("ผลสมัครสอบ"); + + b.Property("PaymentDate") + .HasColumnType("datetime(6)") + .HasComment("วันที่ชำระเงิน"); + + b.Property("PaymentImgId") + .HasColumnType("char(36)"); + + b.Property("PeriodExamId") + .HasColumnType("char(36)"); + + b.Property("PointA") + .HasColumnType("longtext") + .HasComment("คะแนนภาค ก"); + + b.Property("PointB") + .HasColumnType("longtext") + .HasComment("คะแนนภาค ข"); + + b.Property("PointC") + .HasColumnType("longtext") + .HasComment("คะแนนภาค ค"); + + b.Property("PointPath1A") + .HasColumnType("longtext") + .HasComment("คะแนนภาค ก ความสามารถในการคิดวิเคราะห์"); + + b.Property("PointPath1C") + .HasColumnType("longtext") + .HasComment("คะแนนภาค คทดสอบสมรรถนะหลัก"); + + b.Property("PointPath2A") + .HasColumnType("longtext") + .HasComment("คะแนนภาค ก ภาษาอังกฤษ"); + + b.Property("PointPath2C") + .HasColumnType("longtext") + .HasComment("คะแนนภาค ค สัมภาษณ์"); + + b.Property("PointPath3A") + .HasColumnType("longtext") + .HasComment("คะแนนภาค ก ความรู้และลักษณะการเป็นข้าราชการที่ดี"); + + b.Property("PointPerA") + .HasColumnType("longtext") + .HasComment("คะแนนภาค ก เปอร์เซนต์"); + + b.Property("PointPerB") + .HasColumnType("longtext") + .HasComment("คะแนนภาค ข เปอร์เซนต์"); + + b.Property("PointPerC") + .HasColumnType("longtext") + .HasComment("คะแนนภาค ค เปอร์เซนต์"); + + b.Property("PointTotalA") + .HasColumnType("longtext") + .HasComment("คะแนนเต็มภาค ก"); + + b.Property("PointTotalB") + .HasColumnType("longtext") + .HasComment("คะแนนเต็มภาค ข"); + + b.Property("PointTotalC") + .HasColumnType("longtext") + .HasComment("คะแนนเต็มภาค ค"); + + b.Property("PositionExamId") + .HasColumnType("char(36)"); + + b.Property("PrefixId") + .HasColumnType("char(36)") + .HasComment("Id คำนำหน้าชื่อ"); + + b.Property("PrefixName") + .HasColumnType("longtext") + .HasComment("คำนำหน้าชื่อ"); + + b.Property("ProfileImgId") + .HasColumnType("char(36)"); + + b.Property("RegistAddress") + .HasColumnType("longtext") + .HasComment("ที่อยู่ตามทะเบียนบ้าน"); + + b.Property("RegistDistrictId") + .HasColumnType("char(36)") + .HasComment("Id อำเภอที่อยู่ตามทะเบียนบ้าน"); + + b.Property("RegistDistrictName") + .HasColumnType("longtext") + .HasComment("อำเภอที่อยู่ตามทะเบียนบ้าน"); + + b.Property("RegistProvinceId") + .HasColumnType("char(36)") + .HasComment("Id จังหวัดที่อยู่ตามทะเบียนบ้าน"); + + b.Property("RegistProvinceName") + .HasColumnType("longtext") + .HasComment("จังหวัดที่อยู่ตามทะเบียนบ้าน"); + + b.Property("RegistSame") + .HasColumnType("tinyint(1)") + .HasComment("ที่อยู่ปัจจุบันเหมือนที่อยู่ตามทะเบียนบ้าน"); + + b.Property("RegistSubDistrictId") + .HasColumnType("char(36)") + .HasComment("Id ตำบลที่อยู่ตามทะเบียนบ้าน"); + + b.Property("RegistSubDistrictName") + .HasColumnType("longtext") + .HasComment("ตำบลที่อยู่ตามทะเบียนบ้าน"); + + b.Property("RegistZipCode") + .HasMaxLength(10) + .HasColumnType("varchar(10)") + .HasComment("รหัสไปรษณีย์ที่อยู่ตามทะเบียนบ้าน"); + + b.Property("RegisterDate") + .HasMaxLength(40) + .HasColumnType("datetime(6)") + .HasComment("วันที่สมัคร"); + + b.Property("RejectDetail") + .HasColumnType("longtext") + .HasComment("เหตุผลการไม่อนุมัติ"); + + b.Property("RelationshipId") + .HasColumnType("char(36)") + .HasComment("Id สถานภาพ"); + + b.Property("RelationshipName") + .HasColumnType("longtext") + .HasComment("สถานภาพ"); + + b.Property("ReligionId") + .HasColumnType("char(36)") + .HasComment("Id ศาสนา"); + + b.Property("ReligionName") + .HasColumnType("longtext") + .HasComment("ศาสนา"); + + b.Property("ResultA") + .HasColumnType("longtext") + .HasComment("ผลสอบภาค ก"); + + b.Property("ResultB") + .HasColumnType("longtext") + .HasComment("ผลสอบภาค ข"); + + b.Property("ResultC") + .HasColumnType("longtext") + .HasComment("ผลสอบภาค ค"); + + b.Property("Review") + .HasColumnType("longtext") + .HasComment("ข้อแนะนำ"); + + b.Property("ReviewPoint") + .HasColumnType("int") + .HasComment("คะแนนความพึงพอใจ"); + + b.Property("SeatNumber") + .HasColumnType("longtext") + .HasComment("เลขที่นั่งสอบ"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("สถานะผู้สมัคร"); + + b.Property("Telephone") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("โทรศัพท์"); + + b.Property("UserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasComment("User Id ผู้สมัคร"); + + b.HasKey("Id"); + + b.HasIndex("PaymentImgId"); + + b.HasIndex("PeriodExamId"); + + b.HasIndex("PositionExamId"); + + b.HasIndex("ProfileImgId"); + + b.ToTable("Candidates"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.CandidateDocument", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CandidateId") + .HasColumnType("char(36)"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .HasComment("สถานะการใช้งาน"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("CandidateId"); + + b.HasIndex("DocumentId"); + + b.ToTable("CandidateDocuments"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Career", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CandidateId") + .HasColumnType("char(36)"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DurationEnd") + .HasColumnType("datetime(6)") + .HasColumnOrder(2) + .HasComment("ระยะเวลาสิ้นสุด"); + + b.Property("DurationStart") + .HasColumnType("datetime(6)") + .HasColumnOrder(1) + .HasComment("ระยะเวลาเริ่ม"); + + b.Property("Group") + .HasColumnType("longtext") + .HasColumnOrder(4) + .HasComment("กลุ่ม/ฝ่าย"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .HasComment("สถานะการใช้งาน"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Org") + .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("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .HasComment("สถานะการใช้งาน"); + + b.Property("Isspecial") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("varchar(1)"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("varchar(150)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Marry") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("varchar(20)"); + + b.Property("ModifiedDate") + .HasColumnType("datetime(6)"); + + b.Property("National") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("PeriodExamId") + .HasColumnType("char(36)"); + + b.Property("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("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .HasComment("สถานะการใช้งาน"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Mobile") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Moo") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Moo1") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Province") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Province1") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Road") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Road1") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Soi") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Soi1") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Telephone") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ZipCode") + .IsRequired() + .HasMaxLength(5) + .HasColumnType("varchar(5)"); + + b.Property("ZipCode1") + .IsRequired() + .HasMaxLength(5) + .HasColumnType("varchar(5)"); + + b.HasKey("Id"); + + b.HasIndex("DisableId"); + + b.ToTable("DisableAddresses"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.DisableCertificate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CertificateNo") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("Description") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("DisableId") + .HasColumnType("char(36)"); + + b.Property("ExpiredDate") + .HasColumnType("datetime(6)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .HasComment("สถานะการใช้งาน"); + + b.Property("IssueDate") + .HasColumnType("datetime(6)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisableId"); + + b.ToTable("DisableCertificates"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.DisableDocument", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedDate") + .HasColumnType("datetime(6)"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisableId") + .HasColumnType("char(36)"); + + b.Property("DocumentFileId") + .HasColumnType("char(36)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .HasComment("สถานะการใช้งาน"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisableId"); + + b.HasIndex("DocumentFileId"); + + b.ToTable("DisableDocuments"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.DisableEducation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("BachelorDate") + .HasColumnType("datetime(6)"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("Degree") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("DisableId") + .HasColumnType("char(36)"); + + b.Property("GPA") + .HasColumnType("double"); + + b.Property("HighDegree") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .HasComment("สถานะการใช้งาน"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Major") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("MajorGroupId") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("varchar(20)"); + + b.Property("MajorGroupName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Specialist") + .IsRequired() + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("University") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("Id"); + + b.HasIndex("DisableId"); + + b.ToTable("DisableEducations"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.DisableImportHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("Description") + .IsRequired() + .HasColumnType("longtext") + .HasColumnOrder(1) + .HasComment("รายละเอียดการนำเข้า"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .HasComment("สถานะการใช้งาน"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("PeriodExamId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("PeriodExamId"); + + b.ToTable("DisableImportHistories"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.DisableOccupation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisableId") + .HasColumnType("char(36)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .HasComment("สถานะการใช้งาน"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Occupation") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Position") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Telephone") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("WorkAge") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Workplace") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("Id"); + + b.HasIndex("DisableId"); + + b.ToTable("DisableOccupations"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.DisablePayment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("AccountNumber") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("Amount") + .HasColumnType("decimal(65,30)"); + + b.Property("BankCode") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("ChequeNo") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("ChqueBankCode") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("CompanyCode") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("CreditDebit") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("CustomerName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("DisableId") + .HasColumnType("char(36)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .HasComment("สถานะการใช้งาน"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("PaymentId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("PaymentType") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("RefNo1") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("TellerId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("TermBranch") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("TextFile") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("TransDate") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("TransTime") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.HasKey("Id"); + + b.HasIndex("DisableId"); + + b.ToTable("DisablePayments"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.DisableScore", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("ABStatus") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("AStatus") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("BStatus") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("CStatus") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("ExamId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("ExamStatus") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("FullA") + .HasColumnType("int"); + + b.Property("FullB") + .HasColumnType("int"); + + b.Property("FullC") + .HasColumnType("int"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .HasComment("สถานะการใช้งาน"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Major") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("ลำดับที่สอบได้"); + + b.Property("PercentageA") + .HasColumnType("double"); + + b.Property("PercentageB") + .HasColumnType("double"); + + b.Property("PercentageC") + .HasColumnType("double"); + + b.Property("ScoreImportId") + .HasColumnType("char(36)"); + + b.Property("SumA") + .HasColumnType("int"); + + b.Property("SumAB") + .HasColumnType("int"); + + b.Property("SumB") + .HasColumnType("int"); + + b.Property("SumC") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ScoreImportId"); + + b.ToTable("DisableScores"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.ScoreImport", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("ImportFileId") + .HasColumnType("char(36)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .HasComment("สถานะการใช้งาน"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("PeriodExamId") + .HasColumnType("char(36)"); + + b.Property("Year") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ImportFileId"); + + b.HasIndex("PeriodExamId") + .IsUnique(); + + b.ToTable("ScoreImports"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Documents.Document", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreatedDate") + .HasColumnType("datetime(6)"); + + b.Property("Detail") + .IsRequired() + .HasColumnType("text"); + + b.Property("FileName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("FileSize") + .HasColumnType("int"); + + b.Property("FileType") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ObjectRefId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.ToTable("Documents"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Education", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CandidateId") + .HasColumnType("char(36)"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("EducationEndDate") + .HasColumnType("datetime(6)") + .HasComment("วันที่สำเร็จการศึกษา"); + + b.Property("EducationLevelExamId") + .HasColumnType("char(36)") + .HasComment("Id วุฒิที่ใช้สมัครสอบ"); + + b.Property("EducationLevelExamName") + .HasColumnType("longtext") + .HasComment("วุฒิที่ใช้สมัครสอบ"); + + b.Property("EducationLevelHighId") + .HasColumnType("char(36)") + .HasComment("Id วุฒิการศึกษาสูงสุด"); + + b.Property("EducationLevelHighName") + .HasColumnType("longtext") + .HasComment("วุฒิการศึกษาสูงสุด"); + + b.Property("EducationLocation") + .HasColumnType("longtext") + .HasComment("ชื่อสถานศึกษา"); + + b.Property("EducationMajor") + .HasColumnType("longtext") + .HasComment("สาขาวิชา/วิชาเอก"); + + b.Property("EducationName") + .HasColumnType("longtext") + .HasComment("ชื่อปริญญา"); + + b.Property("EducationScores") + .HasColumnType("longtext") + .HasComment("คะแนนเฉลี่ยสะสม"); + + b.Property("EducationType") + .HasColumnType("longtext") + .HasComment("ประเภทสถานศึกษา"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .HasComment("สถานะการใช้งาน"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("CandidateId"); + + b.ToTable("Educations"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.PeriodExam", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("AnnouncementDate") + .HasColumnType("datetime(6)") + .HasColumnOrder(5) + .HasComment("วันประกาศผลสอบ"); + + b.Property("AnnouncementEndDate") + .HasColumnType("datetime(6)") + .HasColumnOrder(7) + .HasComment("วันสิ้นสุดประกาศ"); + + b.Property("AnnouncementExam") + .HasColumnType("tinyint(1)") + .HasComment("ประกาศนี้มีสมัครสอบคัดเลือก"); + + b.Property("AnnouncementStartDate") + .HasColumnType("datetime(6)") + .HasColumnOrder(6) + .HasComment("วันเริ่มประกาศ"); + + b.Property("Category") + .HasColumnType("longtext") + .HasComment("สำนัก"); + + b.Property("CheckDisability") + .HasColumnType("tinyint(1)") + .HasComment("คนพิการ"); + + b.Property("CheckDocument") + .HasColumnType("tinyint(1)") + .HasComment("ตรวจสอบเอกสารหลังประกาศผลสอบ"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("Detail") + .HasColumnType("longtext") + .HasComment("รายละเอียดสมัครสอบ"); + + b.Property("EditorCondition") + .HasColumnType("longtext") + .HasComment("รายละเอียดเงื่อนไขการสมัคร"); + + b.Property("EditorConfirm") + .HasColumnType("longtext") + .HasComment("รายละเอียดคำรับรอง"); + + b.Property("ExamDate") + .HasColumnType("datetime(6)") + .HasComment("วันที่สอบ"); + + b.Property("Fee") + .HasColumnType("float") + .HasComment("ค่าธรรมเนียม"); + + b.Property("ImportFileId") + .HasColumnType("char(36)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasComment("สถานะการใช้งาน"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("varchar(150)") + .HasColumnOrder(8) + .HasComment("ชื่อการสอบ"); + + b.Property("Note") + .HasColumnType("longtext") + .HasComment("หมายเหตุ"); + + b.Property("OrganizationCodeId") + .HasColumnType("char(36)") + .HasComment("Id รหัสส่วนราชการ"); + + b.Property("OrganizationCodeName") + .HasColumnType("longtext") + .HasComment("ชื่อรหัสส่วนราชการ"); + + b.Property("OrganizationId") + .HasColumnType("char(36)") + .HasComment("Id หน่วยงาน"); + + b.Property("OrganizationName") + .HasColumnType("longtext") + .HasComment("ชื่อหน่วยงาน"); + + b.Property("PaymentEndDate") + .HasColumnType("datetime(6)") + .HasColumnOrder(4) + .HasComment("วันสิ้นสุดชำระเงิน"); + + b.Property("PaymentKrungThai") + .HasColumnType("longtext") + .HasComment("ชำระเงินผ่านกรุงไทย"); + + b.Property("PaymentStartDate") + .HasColumnType("datetime(6)") + .HasColumnOrder(3) + .HasComment("วันเริ่มชำระเงิน"); + + b.Property("RegisterEndDate") + .HasColumnType("datetime(6)") + .HasColumnOrder(2) + .HasComment("วันสิ้นสุดสมัครสอบ"); + + b.Property("RegisterStartDate") + .HasColumnType("datetime(6)") + .HasColumnOrder(1) + .HasComment("วันเริ่มสมัครสอบ"); + + b.Property("Round") + .HasColumnType("int") + .HasColumnOrder(9) + .HasComment("รอบการสอบ"); + + b.Property("SetSeat") + .HasColumnType("tinyint(1)") + .HasComment("เช็คอัพคะแนน"); + + b.Property("Year") + .HasColumnType("int") + .HasComment("ปีงบประมาณ"); + + b.HasKey("Id"); + + b.HasIndex("ImportFileId"); + + b.ToTable("PeriodExams"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.PeriodExamDocument", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .HasComment("สถานะการใช้งาน"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("PeriodExamId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("DocumentId"); + + b.HasIndex("PeriodExamId"); + + b.ToTable("PeriodExamDocuments"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.PeriodExamImage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .HasComment("สถานะการใช้งาน"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("PeriodExamId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("DocumentId"); + + b.HasIndex("PeriodExamId"); + + b.ToTable("PeriodExamImages"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.PositionExam", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("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("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(106) + .HasComment("สถานะการใช้งาน"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("PeriodExamId") + .HasColumnType("char(36)"); + + b.Property("PositionId") + .HasColumnType("char(36)") + .HasComment("Id ตำแหน่ง"); + + b.Property("PositionLevelId") + .HasColumnType("char(36)") + .HasComment("Id ระดับ"); + + b.Property("PositionLevelName") + .HasColumnType("longtext") + .HasComment("ชื่อระดับ"); + + b.Property("PositionName") + .HasColumnType("longtext") + .HasComment("ชื่อตำแหน่ง"); + + b.Property("TypeId") + .HasColumnType("longtext") + .HasComment("Id ประเภทแบบฟอร์ม"); + + b.Property("TypeName") + .HasColumnType("longtext") + .HasComment("ชื่อประเภทแบบฟอร์ม"); + + b.HasKey("Id"); + + b.HasIndex("PeriodExamId"); + + b.ToTable("PositionExams"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.BankExam", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.PeriodExam", "PeriodExam") + .WithMany("BankExam") + .HasForeignKey("PeriodExamId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("PeriodExam"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.CMSAgency", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.CMSCandidate", "CMSCandidate") + .WithMany("CMSAgencys") + .HasForeignKey("CMSCandidateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("CMSCandidate"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.CMSCandidate", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Documents.Document", "BannerImg") + .WithMany() + .HasForeignKey("BannerImgId"); + + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Documents.Document", "LogoImg") + .WithMany() + .HasForeignKey("LogoImgId"); + + b.Navigation("BannerImg"); + + b.Navigation("LogoImg"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.CMSGovernment", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.CMSCandidate", "CMSCandidate") + .WithMany("CMSGovernments") + .HasForeignKey("CMSCandidateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("CMSCandidate"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Candidate", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Documents.Document", "PaymentImg") + .WithMany() + .HasForeignKey("PaymentImgId"); + + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.PeriodExam", "PeriodExam") + .WithMany("Candidate") + .HasForeignKey("PeriodExamId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.PositionExam", "PositionExam") + .WithMany() + .HasForeignKey("PositionExamId"); + + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Documents.Document", "ProfileImg") + .WithMany() + .HasForeignKey("ProfileImgId"); + + b.Navigation("PaymentImg"); + + b.Navigation("PeriodExam"); + + b.Navigation("PositionExam"); + + b.Navigation("ProfileImg"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.CandidateDocument", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Candidate", "Candidate") + .WithMany() + .HasForeignKey("CandidateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Documents.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Candidate"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Career", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Candidate", "Candidate") + .WithMany("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.PeriodExamDocument", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Documents.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.PeriodExam", "PeriodExam") + .WithMany("PeriodExamDocuments") + .HasForeignKey("PeriodExamId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Document"); + + b.Navigation("PeriodExam"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.PeriodExamImage", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Documents.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.PeriodExam", "PeriodExam") + .WithMany("PeriodExamImages") + .HasForeignKey("PeriodExamId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Document"); + + b.Navigation("PeriodExam"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.PositionExam", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.PeriodExam", "PeriodExam") + .WithMany("PositionExam") + .HasForeignKey("PeriodExamId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("PeriodExam"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.CMSCandidate", b => + { + b.Navigation("CMSAgencys"); + + b.Navigation("CMSGovernments"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Candidate", b => + { + b.Navigation("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("PeriodExamDocuments"); + + b.Navigation("PeriodExamImages"); + + b.Navigation("PositionExam"); + + b.Navigation("ScoreImport"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Migrations/20241228061323_update table Disable add postype.cs b/Migrations/20241228061323_update table Disable add postype.cs new file mode 100644 index 0000000..9ee1198 --- /dev/null +++ b/Migrations/20241228061323_update table Disable add postype.cs @@ -0,0 +1,40 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace BMA.EHR.Recurit.Exam.Service.Migrations +{ + /// + public partial class updatetableDisableaddpostype : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "PositionLevel", + table: "Disables", + type: "longtext", + nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "PositionType", + table: "Disables", + type: "longtext", + nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "PositionLevel", + table: "Disables"); + + migrationBuilder.DropColumn( + name: "PositionType", + table: "Disables"); + } + } +} diff --git a/Models/Disable/Disable.cs b/Models/Disable/Disable.cs index efd1cbc..1a1e257 100644 --- a/Models/Disable/Disable.cs +++ b/Models/Disable/Disable.cs @@ -78,5 +78,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Models.Disables public DateTime ApplyDate { get; set; } public string? PositionName { get; set; }// + public string? PositionType { get; set; } + public string? PositionLevel { get; set; } } } diff --git a/Models/District.cs b/Models/District.cs index 0d6c13d..6240c7d 100644 --- a/Models/District.cs +++ b/Models/District.cs @@ -7,13 +7,13 @@ namespace BMA.EHR.Recurit.Exam.Service.Models public class District : EntityBase { [Required, MaxLength(150), Column(Order = 1), Comment("เขต/อำเภอ")] - public string Name { get; set; } = string.Empty; + public string name { get; set; } = string.Empty; - [Column(Order = 2), Comment("สถานะการใช้งาน")] - public bool IsActive { get; set; } = true; + // [Column(Order = 2), Comment("สถานะการใช้งาน")] + // public bool IsActive { get; set; } = true; - public virtual List SubDistricts { get; set; } = new(); + // public virtual List SubDistricts { get; set; } = new(); - public virtual Province? Province { get; set; } + // public virtual Province? Province { get; set; } } } diff --git a/Models/EducationLevel.cs b/Models/EducationLevel.cs index 314bd8c..55f249e 100644 --- a/Models/EducationLevel.cs +++ b/Models/EducationLevel.cs @@ -7,9 +7,9 @@ namespace BMA.EHR.Recurit.Exam.Service.Models public class EducationLevel : EntityBase { [Required, MaxLength(100), Column(Order = 1), Comment("ระดับการศึกษา")] - public string Name { get; set; } = string.Empty; + public string name { get; set; } = string.Empty; - [Column(Order = 2), Comment("สถานะการใช้งาน")] - public bool IsActive { get; set; } = true; + // [Column(Order = 2), Comment("สถานะการใช้งาน")] + // public bool IsActive { get; set; } = true; } } diff --git a/Models/EntityBase.cs b/Models/EntityBase.cs index e5032ab..df08b9f 100644 --- a/Models/EntityBase.cs +++ b/Models/EntityBase.cs @@ -29,7 +29,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Models [Column(Order = 105), Comment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"), MaxLength(200)] public string LastUpdateFullName { get; set; } = string.Empty; - [Column(Order = 106), Comment("สถานะการใช้งาน")] - public bool IsActive { get; set; } = true; + // [Column(Order = 106), Comment("สถานะการใช้งาน")] + // public bool IsActive { get; set; } = true; } } diff --git a/Models/Gendor.cs b/Models/Gendor.cs index d765b45..c2759d8 100644 --- a/Models/Gendor.cs +++ b/Models/Gendor.cs @@ -7,6 +7,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Models public class Gender : EntityBase { [Required, MaxLength(20), Column(Order = 1), Comment("เพศ")] - public string Name { get; set; } = string.Empty; + public string name { get; set; } = string.Empty; } } diff --git a/Models/Placement/Placement.cs b/Models/Placement/Placement.cs index 3b7e0b1..4a73e58 100644 --- a/Models/Placement/Placement.cs +++ b/Models/Placement/Placement.cs @@ -23,6 +23,9 @@ namespace BMA.EHR.Domain.Models.Placement [Comment("สถานะการใช้งาน")] public bool IsActive { get; set; } = true; + + [Comment("Id การสอบ")] + public Guid? RefId { get; set; } public virtual List PlacementProfiles { get; set; } = new List(); } } diff --git a/Models/Placement/PlacementEducation.cs b/Models/Placement/PlacementEducation.cs index c984187..8805909 100644 --- a/Models/Placement/PlacementEducation.cs +++ b/Models/Placement/PlacementEducation.cs @@ -9,7 +9,9 @@ namespace BMA.EHR.Domain.Models.Placement [Required, Comment("Id ผู้สมัคร")] public virtual PlacementProfile? PlacementProfile { get; set; } [Comment("Idวุฒิที่ได้รับ")] - public virtual EducationLevel? EducationLevel { get; set; } + public Guid? EducationLevelId { get; set; } + [Comment("วุฒิที่ได้รับ")] + public string? EducationLevelName { get; set; } [MaxLength(1000), Comment("สถานศึกษา")] public string? Institute { get; set; } [MaxLength(200), Comment("วุฒิการศึกษา")] diff --git a/Models/Placement/PlacementProfile.cs b/Models/Placement/PlacementProfile.cs index b13aefa..51b603e 100644 --- a/Models/Placement/PlacementProfile.cs +++ b/Models/Placement/PlacementProfile.cs @@ -19,13 +19,9 @@ namespace BMA.EHR.Domain.Models.Placement [Comment("Id เพศ")] public string? Gender { get; set; } - [Comment("Id ตำแหน่งที่สอบได้")] - public PositionPath? PositionCandidate { get; set; } [Comment("ตำแหน่งที่สอบได้")] public string? positionName { get; set; } - // [Comment("Id เลขที่ตำแหน่ง")] - // public OrganizationPositionEntity? OrganizationPosition { get; set; } [Comment("วันที่บรรจุ")] public DateTime? RecruitDate { get; set; } [Comment("วันที่รายงานตัว")] @@ -50,8 +46,6 @@ namespace BMA.EHR.Domain.Models.Placement public bool IsRelief { get; set; } = false; [Comment("เหตุผลผ่อนผัน")] public string? ReliefReason { get; set; } - // [Comment("Id เอกสารผ่อนผัน")] - // public Document? ReliefDoc { get; set; } [Comment("การคัดกรองคุณสมบัติ")] public string? IsProperty { get; set; } @@ -66,8 +60,6 @@ namespace BMA.EHR.Domain.Models.Placement [Comment("Id สถานภาพ")] public string? Relationship { get; set; } - // [Comment("Id กลุ่มเลือด")] - // public BloodGroup? BloodGroup { get; set; } [Comment("Id ศาสนา")] public string? Religion { get; set; } @@ -78,10 +70,10 @@ namespace BMA.EHR.Domain.Models.Placement public string? CitizenId { get; set; } [Comment("Id เขตที่ออกบัตรประชาชน")] - public string? CitizenDistrictId { get; set; } + public Guid? CitizenDistrictId { get; set; } [Comment("Id จังหวัดที่ออกบัตรประชาชน")] - public string? CitizenProvinceId { get; set; } + public Guid? CitizenProvinceId { get; set; } [Comment("วันที่ออกบัตร")] public DateTime? CitizenDate { get; set; } @@ -99,13 +91,13 @@ namespace BMA.EHR.Domain.Models.Placement public string? RegistAddress { get; set; } [Comment("Id จังหวัดที่อยู่ตามทะเบียนบ้าน")] - public string? RegistProvinceId { get; set; } + public Guid? RegistProvinceId { get; set; } [Comment("Id อำเภอที่อยู่ตามทะเบียนบ้าน")] - public string? RegistDistrictId { get; set; } + public Guid? RegistDistrictId { get; set; } [Comment("Id ตำบลที่อยู่ตามทะเบียนบ้าน")] - public string? RegistSubDistrictId { get; set; } + public Guid? RegistSubDistrictId { get; set; } [MaxLength(10), Comment("รหัสไปรษณีย์ที่อยู่ตามทะเบียนบ้าน")] public string? RegistZipCode { get; set; } @@ -117,13 +109,13 @@ namespace BMA.EHR.Domain.Models.Placement public string? CurrentAddress { get; set; } [Comment("Id จังหวัดที่อยู่ปัจจุบัน")] - public string? CurrentProvinceId { get; set; } + public Guid? CurrentProvinceId { get; set; } [Comment("Id อำเภอที่อยู่ปัจจุบัน")] - public string? CurrentDistrictId { get; set; } + public Guid? CurrentDistrictId { get; set; } [Comment("Id ตำบลที่อยู่ปัจจุบัน")] - public string? CurrentSubDistrictId { get; set; } + public Guid? CurrentSubDistrictId { get; set; } [MaxLength(10), Comment("รหัสไปรษณีย์ที่อยู่ปัจจุบัน")] public string? CurrentZipCode { get; set; } @@ -192,25 +184,15 @@ namespace BMA.EHR.Domain.Models.Placement [MaxLength(20), Comment("ตำแหน่งปัจจุบัน เบอร์โทรที่ทำงาน")] public string? OccupationTelephone { get; set; } - // [Comment("Id ตำแหน่งเลขที่")] - // public PositionNumberEntity? PositionNumber { get; set; } - - // [Comment("Id ตำแหน่ง")] - // public PositionPath? PositionPath { get; set; } - - // [Comment("Id ด้าน/สาขา")] - // public PositionPathSide? PositionPathSide { get; set; } + [Comment("ตำแหน่งสอบ")] + public string? PositionCandidate { get; set; } [Comment("ประเภทตำแหน่ง")] public string? PositionType { get; set; } - // [Comment("Id สายงาน")] - // public PositionLine? PositionLine { get; set; } - [Comment("ระดับ")] public string? PositionLevel { get; set; } - [Comment("คะแนนเต็มภาค ก")] public double? PointTotalA { get; set; } diff --git a/Models/Prefix.cs b/Models/Prefix.cs index 91cf8ce..4add9f1 100644 --- a/Models/Prefix.cs +++ b/Models/Prefix.cs @@ -7,9 +7,9 @@ namespace BMA.EHR.Recurit.Exam.Service.Models public class Prefix : EntityBase { [Required, MaxLength(50), Column(Order = 2), Comment("รายละเอียดคำนำหน้า")] - public string Name { get; set; } = string.Empty; + public string name { get; set; } = string.Empty; - [Column(Order = 3), Comment("สถานะการใช้งาน")] - public bool IsActive { get; set; } = true; + // [Column(Order = 3), Comment("สถานะการใช้งาน")] + // public bool IsActive { get; set; } = true; } } diff --git a/Models/Province.cs b/Models/Province.cs index aea5c64..906617a 100644 --- a/Models/Province.cs +++ b/Models/Province.cs @@ -7,11 +7,11 @@ namespace BMA.EHR.Recurit.Exam.Service.Models public class Province : EntityBase { [Required, MaxLength(150), Column(Order = 1), Comment("จังหวัด")] - public string Name { get; set; } = string.Empty; + public string name { get; set; } = string.Empty; - [Column(Order = 2), Comment("สถานะการใช้งาน")] - public bool IsActive { get; set; } = true; + // [Column(Order = 2), Comment("สถานะการใช้งาน")] + // public bool IsActive { get; set; } = true; - public virtual List Districts { get; set; } = new(); + // public virtual List Districts { get; set; } = new(); } } diff --git a/Models/Relationship.cs b/Models/Relationship.cs index dae82d2..10de7c6 100644 --- a/Models/Relationship.cs +++ b/Models/Relationship.cs @@ -7,8 +7,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Models; public class Relationship : EntityBase { [Required, MaxLength(50), Column(Order = 1), Comment("ชื่อความสัมพันธ์")] - public string Name { get; set; } = string.Empty; + public string name { get; set; } = string.Empty; - [Column(Order = 2), Comment("สถานะการใช้งาน")] - public bool IsActive { get; set; } = true; + // [Column(Order = 2), Comment("สถานะการใช้งาน")] + // public bool IsActive { get; set; } = true; } \ No newline at end of file diff --git a/Models/Religion.cs b/Models/Religion.cs index ae493ec..cc4adc2 100644 --- a/Models/Religion.cs +++ b/Models/Religion.cs @@ -7,9 +7,9 @@ namespace BMA.EHR.Recurit.Exam.Service.Models public class Religion : EntityBase { [Required, MaxLength(100), Column(Order = 1), Comment("ศาสนา")] - public string Name { get; set; } = string.Empty; + public string name { get; set; } = string.Empty; - [Column(Order = 2), Comment("สถานะการใช้งาน")] - public bool IsActive { get; set; } = true; + // [Column(Order = 2), Comment("สถานะการใช้งาน")] + // public bool IsActive { get; set; } = true; } } diff --git a/Models/SubDistrict.cs b/Models/SubDistrict.cs index d01c634..71688a1 100644 --- a/Models/SubDistrict.cs +++ b/Models/SubDistrict.cs @@ -7,14 +7,14 @@ namespace BMA.EHR.Recurit.Exam.Service.Models public class SubDistrict : EntityBase { [Required, MaxLength(150), Column(Order = 1), Comment("เขต/อำเภอ")] - public string Name { get; set; } = string.Empty; + public string name { get; set; } = string.Empty; [Required, MaxLength(10), Column(Order = 2), Comment("รหัสไปรษณีย์")] - public string ZipCode { get; set; } = string.Empty; + public string zipCode { get; set; } = string.Empty; - [Column(Order = 3), Comment("สถานะการใช้งาน")] - public bool IsActive { get; set; } = true; + // [Column(Order = 3), Comment("สถานะการใช้งาน")] + // public bool IsActive { get; set; } = true; - public virtual District? District { get; set; } + // public virtual District? District { get; set; } } } diff --git a/Program.cs b/Program.cs index 0f4517a..c2b8de5 100644 --- a/Program.cs +++ b/Program.cs @@ -65,6 +65,9 @@ builder.Host.UseSerilog(); var examConnection = builder.Configuration.GetConnectionString("ExamConnection"); builder.Services.AddDbContext(options => options.UseMySql(examConnection, ServerVersion.AutoDetect(examConnection))); +var orgConnection = builder.Configuration.GetConnectionString("OrgConnection"); +builder.Services.AddDbContext(options => + options.UseMySql(orgConnection, ServerVersion.AutoDetect(orgConnection))); var defaultConnection = builder.Configuration.GetConnectionString("DefaultConnection"); builder.Services.AddDbContext(options => options.UseMySql(defaultConnection, ServerVersion.AutoDetect(defaultConnection))); diff --git a/Request/Disables/CandidateFileHeader.cs b/Request/Disables/CandidateFileHeader.cs index 133b346..90134f2 100644 --- a/Request/Disables/CandidateFileHeader.cs +++ b/Request/Disables/CandidateFileHeader.cs @@ -19,6 +19,8 @@ public static string PersonalCardExpireDate = "CusIDExpireDate"; public static string ApplyDate = "DateTime"; public static string PositionName = "PositionName"; + public static string PositionType = "PositionType"; + public static string PositionLevel = "PositionLevel"; // Address public static string Address = "Address"; diff --git a/Response/PeriodExamCandidateResponseItem.cs b/Response/PeriodExamCandidateResponseItem.cs index cf04caf..7c626e6 100644 --- a/Response/PeriodExamCandidateResponseItem.cs +++ b/Response/PeriodExamCandidateResponseItem.cs @@ -11,7 +11,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Response public bool CheckDisability { get; set; } public int? Round { get; set; } public int? Year { get; set; } - public Guid? OcId { get; set; } public string CreatedUserId { get; set; } public float? Fee { get; set; } public DateTime? RegisterStartDate { get; set; } diff --git a/Services/CMSCandidateService.cs b/Services/CMSCandidateService.cs index c62adcc..8d0485f 100644 --- a/Services/CMSCandidateService.cs +++ b/Services/CMSCandidateService.cs @@ -19,7 +19,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services #region " Fields " private readonly ApplicationDbContext _context; - private readonly MetadataDbContext _contextMetadata; + private readonly OrgDbContext _contextOrg; private readonly IHttpContextAccessor _httpContextAccessor; private readonly MinIOService _minioService; @@ -28,12 +28,12 @@ namespace BMA.EHR.Recurit.Exam.Service.Services #region " Constructor and Destructor " public CMSCandidateService(ApplicationDbContext context, - MetadataDbContext contextMetadata, + OrgDbContext contextOrg, IHttpContextAccessor httpContextAccessor, MinIOService minioService) { _context = context; - _contextMetadata = contextMetadata; + _contextOrg = contextOrg; _httpContextAccessor = httpContextAccessor; _minioService = minioService; } @@ -139,39 +139,39 @@ namespace BMA.EHR.Recurit.Exam.Service.Services if (updated.ProvinceId != null) { - var province = await _contextMetadata.Provinces.AsQueryable() + var province = await _contextOrg.province.AsQueryable() .FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.ProvinceId)); if (province == null) throw new Exception(GlobalMessages.ProvinceNotFound); cms.ProvinceId = province.Id; - cms.ProvinceName = province.Name; + cms.ProvinceName = province.name; } if (updated.DistrictId != null) { - var pistrict = await _contextMetadata.Districts.AsQueryable() + var pistrict = await _contextOrg.district.AsQueryable() .FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.DistrictId)); if (pistrict == null) throw new Exception(GlobalMessages.DistrictNotFound); cms.DistrictId = pistrict.Id; - cms.DistrictName = pistrict.Name; + cms.DistrictName = pistrict.name; } if (updated.SubDistrictId != null) { - var subDistrict = await _contextMetadata.SubDistricts.AsQueryable() + var subDistrict = await _contextOrg.subDistrict.AsQueryable() .FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.SubDistrictId)); if (subDistrict == null) throw new Exception(GlobalMessages.SubDistrictNotFound); cms.SubDistrictId = subDistrict.Id; - cms.SubDistrictName = subDistrict.Name; - cms.ZipCode = subDistrict.ZipCode; + cms.SubDistrictName = subDistrict.name; + cms.ZipCode = subDistrict.zipCode; } cms.About = updated.About; diff --git a/Services/CandidateService.cs b/Services/CandidateService.cs index f21b802..2aa8bea 100644 --- a/Services/CandidateService.cs +++ b/Services/CandidateService.cs @@ -1,5 +1,4 @@ using System.Security.Claims; -using BMA.EHR.Domain.Models.Placement; using BMA.EHR.Recurit.Exam.Service.Extensions; using BMA.EHR.Recurit.Exam.Service.Core; using BMA.EHR.Recurit.Exam.Service.Data; @@ -7,7 +6,6 @@ using BMA.EHR.Recurit.Exam.Service.Models; using BMA.EHR.Recurit.Exam.Service.Request; using BMA.EHR.Recurit.Exam.Service.Response; using BMA.EHR.Recurit.Exam.Service.Responses.Document; -using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; namespace BMA.EHR.Recurit.Exam.Service.Services @@ -17,7 +15,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services #region " Fields " private readonly ApplicationDbContext _context; - private readonly MetadataDbContext _contextMetadata; + private readonly OrgDbContext _contextOrg; private readonly IHttpContextAccessor _httpContextAccessor; private readonly MinIOService _minioService; private readonly MailService _mailService; @@ -27,13 +25,13 @@ namespace BMA.EHR.Recurit.Exam.Service.Services #region " Constructor and Destructor " public CandidateService(ApplicationDbContext context, - MetadataDbContext contextMetadata, + OrgDbContext contextOrg, IHttpContextAccessor httpContextAccessor, MinIOService minioService, MailService mailService) { _context = context; - _contextMetadata = contextMetadata; + _contextOrg = contextOrg; _httpContextAccessor = httpContextAccessor; _minioService = minioService; _mailService = mailService; @@ -742,112 +740,112 @@ namespace BMA.EHR.Recurit.Exam.Service.Services if (updated.PrefixId != null) { - var prefix = await _contextMetadata.Prefixes.AsQueryable() + var prefix = await _contextOrg.prefixe.AsQueryable() .FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.PrefixId)); if (prefix == null) throw new Exception(GlobalMessages.PrefixNotFound); candidate.PrefixId = prefix.Id; - candidate.PrefixName = prefix.Name; + candidate.PrefixName = prefix.name; } if (updated.ContactPrefixId != null) { - var prefix = await _contextMetadata.Prefixes.AsQueryable() + var prefix = await _contextOrg.prefixe.AsQueryable() .FirstOrDefaultAsync(x => x.Id == updated.ContactPrefixId); if (prefix == null) throw new Exception(GlobalMessages.PrefixNotFound); candidate.ContactPrefixId = prefix.Id; - candidate.ContactPrefixName = prefix.Name; + candidate.ContactPrefixName = prefix.name; } if (updated.ReligionId != null) { - var religion = await _contextMetadata.Religions.AsQueryable() + var religion = await _contextOrg.religion.AsQueryable() .FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.ReligionId)); if (religion == null) throw new Exception(GlobalMessages.ReligionNotFound); candidate.ReligionId = religion.Id; - candidate.ReligionName = religion.Name; + candidate.ReligionName = religion.name; } if (updated.RegistProvinceId != null) { - var registProvince = await _contextMetadata.Provinces.AsQueryable() + var registProvince = await _contextOrg.province.AsQueryable() .FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.RegistProvinceId)); if (registProvince == null) throw new Exception(GlobalMessages.ProvinceNotFound); candidate.RegistProvinceId = registProvince.Id; - candidate.RegistProvinceName = registProvince.Name; + candidate.RegistProvinceName = registProvince.name; } if (updated.RegistDistrictId != null) { - var registDistrict = await _contextMetadata.Districts.AsQueryable() + var registDistrict = await _contextOrg.district.AsQueryable() .FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.RegistDistrictId)); if (registDistrict == null) throw new Exception(GlobalMessages.DistrictNotFound); candidate.RegistDistrictId = registDistrict.Id; - candidate.RegistDistrictName = registDistrict.Name; + candidate.RegistDistrictName = registDistrict.name; } if (updated.RegistSubDistrictId != null) { - var registSubDistrict = await _contextMetadata.SubDistricts.AsQueryable() + var registSubDistrict = await _contextOrg.subDistrict.AsQueryable() .FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.RegistSubDistrictId)); if (registSubDistrict == null) throw new Exception(GlobalMessages.SubDistrictNotFound); candidate.RegistSubDistrictId = registSubDistrict.Id; - candidate.RegistSubDistrictName = registSubDistrict.Name; - candidate.RegistZipCode = registSubDistrict.ZipCode; + candidate.RegistSubDistrictName = registSubDistrict.name; + candidate.RegistZipCode = registSubDistrict.zipCode; } if (updated.CurrentProvinceId != null) { - var currentProvince = await _contextMetadata.Provinces.AsQueryable() + var currentProvince = await _contextOrg.province.AsQueryable() .FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.CurrentProvinceId)); if (currentProvince == null) throw new Exception(GlobalMessages.ProvinceNotFound); candidate.CurrentProvinceId = currentProvince.Id; - candidate.CurrentProvinceName = currentProvince.Name; + candidate.CurrentProvinceName = currentProvince.name; } if (updated.CurrentDistrictId != null) { - var currentDistrict = await _contextMetadata.Districts.AsQueryable() + var currentDistrict = await _contextOrg.district.AsQueryable() .FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.CurrentDistrictId)); if (currentDistrict == null) throw new Exception(GlobalMessages.DistrictNotFound); candidate.CurrentDistrictId = currentDistrict.Id; - candidate.CurrentDistrictName = currentDistrict.Name; + candidate.CurrentDistrictName = currentDistrict.name; } if (updated.CurrentSubDistrictId != null) { - var currentSubDistrict = await _contextMetadata.SubDistricts.AsQueryable() + var currentSubDistrict = await _contextOrg.subDistrict.AsQueryable() .FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.CurrentSubDistrictId)); if (currentSubDistrict == null) throw new Exception(GlobalMessages.SubDistrictNotFound); candidate.CurrentSubDistrictId = currentSubDistrict.Id; - candidate.CurrentSubDistrictName = currentSubDistrict.Name; - candidate.CurrentZipCode = currentSubDistrict.ZipCode; + candidate.CurrentSubDistrictName = currentSubDistrict.name; + candidate.CurrentZipCode = currentSubDistrict.zipCode; } candidate.FirstName = updated.FirstName; @@ -896,24 +894,24 @@ namespace BMA.EHR.Recurit.Exam.Service.Services }; if (updated.EducationLevelExamId != null) { - var educationLevelExam = await _contextMetadata.EducationLevels.AsQueryable() + var educationLevelExam = await _contextOrg.educationLevel.AsQueryable() .FirstOrDefaultAsync(x => x.Id == updated.EducationLevelExamId); if (educationLevelExam == null) throw new Exception(GlobalMessages.EducationLevelNotFound); education.EducationLevelExamId = educationLevelExam.Id; - education.EducationLevelExamName = educationLevelExam.Name; + education.EducationLevelExamName = educationLevelExam.name; } if (updated.EducationLevelHighId != null) { - var educationLevelHigh = await _contextMetadata.EducationLevels.AsQueryable() + var educationLevelHigh = await _contextOrg.educationLevel.AsQueryable() .FirstOrDefaultAsync(x => x.Id == updated.EducationLevelHighId); if (educationLevelHigh == null) throw new Exception(GlobalMessages.EducationLevelNotFound); education.EducationLevelHighId = educationLevelHigh.Id; - education.EducationLevelHighName = educationLevelHigh.Name; + education.EducationLevelHighName = educationLevelHigh.name; } await _context.Educations.AddAsync(education); } @@ -930,24 +928,24 @@ namespace BMA.EHR.Recurit.Exam.Service.Services candidate.Educations.FirstOrDefault().LastUpdateFullName = FullName ?? ""; if (updated.EducationLevelExamId != null) { - var educationLevelExam = await _contextMetadata.EducationLevels.AsQueryable() + var educationLevelExam = await _contextOrg.educationLevel.AsQueryable() .FirstOrDefaultAsync(x => x.Id == updated.EducationLevelExamId); if (educationLevelExam == null) throw new Exception(GlobalMessages.EducationLevelNotFound); candidate.Educations.FirstOrDefault().EducationLevelExamId = educationLevelExam.Id; - candidate.Educations.FirstOrDefault().EducationLevelExamName = educationLevelExam.Name; + candidate.Educations.FirstOrDefault().EducationLevelExamName = educationLevelExam.name; } if (updated.EducationLevelHighId != null) { - var educationLevelHigh = await _contextMetadata.EducationLevels.AsQueryable() + var educationLevelHigh = await _contextOrg.educationLevel.AsQueryable() .FirstOrDefaultAsync(x => x.Id == updated.EducationLevelHighId); if (educationLevelHigh == null) throw new Exception(GlobalMessages.EducationLevelNotFound); candidate.Educations.FirstOrDefault().EducationLevelHighId = educationLevelHigh.Id; - candidate.Educations.FirstOrDefault().EducationLevelHighName = educationLevelHigh.Name; + candidate.Educations.FirstOrDefault().EducationLevelHighName = educationLevelHigh.name; } } @@ -966,112 +964,112 @@ namespace BMA.EHR.Recurit.Exam.Service.Services if (updated.PrefixId != null) { - var prefix = await _contextMetadata.Prefixes.AsQueryable() + var prefix = await _contextOrg.prefixe.AsQueryable() .FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.PrefixId)); if (prefix == null) throw new Exception(GlobalMessages.PrefixNotFound); candidate.PrefixId = prefix.Id; - candidate.PrefixName = prefix.Name; + candidate.PrefixName = prefix.name; } if (updated.ContactPrefixId != null) { - var prefix = await _contextMetadata.Prefixes.AsQueryable() + var prefix = await _contextOrg.prefixe.AsQueryable() .FirstOrDefaultAsync(x => x.Id == updated.ContactPrefixId); if (prefix == null) throw new Exception(GlobalMessages.PrefixNotFound); candidate.ContactPrefixId = prefix.Id; - candidate.ContactPrefixName = prefix.Name; + candidate.ContactPrefixName = prefix.name; } if (updated.ReligionId != null) { - var religion = await _contextMetadata.Religions.AsQueryable() + var religion = await _contextOrg.religion.AsQueryable() .FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.ReligionId)); if (religion == null) throw new Exception(GlobalMessages.ReligionNotFound); candidate.ReligionId = religion.Id; - candidate.ReligionName = religion.Name; + candidate.ReligionName = religion.name; } if (updated.RegistProvinceId != null) { - var registProvince = await _contextMetadata.Provinces.AsQueryable() + var registProvince = await _contextOrg.province.AsQueryable() .FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.RegistProvinceId)); if (registProvince == null) throw new Exception(GlobalMessages.ProvinceNotFound); candidate.RegistProvinceId = registProvince.Id; - candidate.RegistProvinceName = registProvince.Name; + candidate.RegistProvinceName = registProvince.name; } if (updated.RegistDistrictId != null) { - var registDistrict = await _contextMetadata.Districts.AsQueryable() + var registDistrict = await _contextOrg.district.AsQueryable() .FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.RegistDistrictId)); if (registDistrict == null) throw new Exception(GlobalMessages.DistrictNotFound); candidate.RegistDistrictId = registDistrict.Id; - candidate.RegistDistrictName = registDistrict.Name; + candidate.RegistDistrictName = registDistrict.name; } if (updated.RegistSubDistrictId != null) { - var registSubDistrict = await _contextMetadata.SubDistricts.AsQueryable() + var registSubDistrict = await _contextOrg.subDistrict.AsQueryable() .FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.RegistSubDistrictId)); if (registSubDistrict == null) throw new Exception(GlobalMessages.SubDistrictNotFound); candidate.RegistSubDistrictId = registSubDistrict.Id; - candidate.RegistSubDistrictName = registSubDistrict.Name; - candidate.RegistZipCode = registSubDistrict.ZipCode; + candidate.RegistSubDistrictName = registSubDistrict.name; + candidate.RegistZipCode = registSubDistrict.zipCode; } if (updated.CurrentProvinceId != null) { - var currentProvince = await _contextMetadata.Provinces.AsQueryable() + var currentProvince = await _contextOrg.province.AsQueryable() .FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.CurrentProvinceId)); if (currentProvince == null) throw new Exception(GlobalMessages.ProvinceNotFound); candidate.CurrentProvinceId = currentProvince.Id; - candidate.CurrentProvinceName = currentProvince.Name; + candidate.CurrentProvinceName = currentProvince.name; } if (updated.CurrentDistrictId != null) { - var currentDistrict = await _contextMetadata.Districts.AsQueryable() + var currentDistrict = await _contextOrg.district.AsQueryable() .FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.CurrentDistrictId)); if (currentDistrict == null) throw new Exception(GlobalMessages.DistrictNotFound); candidate.CurrentDistrictId = currentDistrict.Id; - candidate.CurrentDistrictName = currentDistrict.Name; + candidate.CurrentDistrictName = currentDistrict.name; } if (updated.CurrentSubDistrictId != null) { - var currentSubDistrict = await _contextMetadata.SubDistricts.AsQueryable() + var currentSubDistrict = await _contextOrg.subDistrict.AsQueryable() .FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.CurrentSubDistrictId)); if (currentSubDistrict == null) throw new Exception(GlobalMessages.SubDistrictNotFound); candidate.CurrentSubDistrictId = currentSubDistrict.Id; - candidate.CurrentSubDistrictName = currentSubDistrict.Name; - candidate.CurrentZipCode = currentSubDistrict.ZipCode; + candidate.CurrentSubDistrictName = currentSubDistrict.name; + candidate.CurrentZipCode = currentSubDistrict.zipCode; } candidate.FirstName = updated.FirstName; @@ -1121,24 +1119,24 @@ namespace BMA.EHR.Recurit.Exam.Service.Services }; if (updated.EducationLevelExamId != null) { - var educationLevelExam = await _contextMetadata.EducationLevels.AsQueryable() + var educationLevelExam = await _contextOrg.educationLevel.AsQueryable() .FirstOrDefaultAsync(x => x.Id == updated.EducationLevelExamId); if (educationLevelExam == null) throw new Exception(GlobalMessages.EducationLevelNotFound); education.EducationLevelExamId = educationLevelExam.Id; - education.EducationLevelExamName = educationLevelExam.Name; + education.EducationLevelExamName = educationLevelExam.name; } if (updated.EducationLevelHighId != null) { - var educationLevelHigh = await _contextMetadata.EducationLevels.AsQueryable() + var educationLevelHigh = await _contextOrg.educationLevel.AsQueryable() .FirstOrDefaultAsync(x => x.Id == updated.EducationLevelHighId); if (educationLevelHigh == null) throw new Exception(GlobalMessages.EducationLevelNotFound); education.EducationLevelHighId = educationLevelHigh.Id; - education.EducationLevelHighName = educationLevelHigh.Name; + education.EducationLevelHighName = educationLevelHigh.name; } await _context.Educations.AddAsync(education); } @@ -1155,24 +1153,24 @@ namespace BMA.EHR.Recurit.Exam.Service.Services candidate.Educations.FirstOrDefault().LastUpdateFullName = FullName ?? ""; if (updated.EducationLevelExamId != null) { - var educationLevelExam = await _contextMetadata.EducationLevels.AsQueryable() + var educationLevelExam = await _contextOrg.educationLevel.AsQueryable() .FirstOrDefaultAsync(x => x.Id == updated.EducationLevelExamId); if (educationLevelExam == null) throw new Exception(GlobalMessages.EducationLevelNotFound); candidate.Educations.FirstOrDefault().EducationLevelExamId = educationLevelExam.Id; - candidate.Educations.FirstOrDefault().EducationLevelExamName = educationLevelExam.Name; + candidate.Educations.FirstOrDefault().EducationLevelExamName = educationLevelExam.name; } if (updated.EducationLevelHighId != null) { - var educationLevelHigh = await _contextMetadata.EducationLevels.AsQueryable() + var educationLevelHigh = await _contextOrg.educationLevel.AsQueryable() .FirstOrDefaultAsync(x => x.Id == updated.EducationLevelHighId); if (educationLevelHigh == null) throw new Exception(GlobalMessages.EducationLevelNotFound); candidate.Educations.FirstOrDefault().EducationLevelHighId = educationLevelHigh.Id; - candidate.Educations.FirstOrDefault().EducationLevelHighName = educationLevelHigh.Name; + candidate.Educations.FirstOrDefault().EducationLevelHighName = educationLevelHigh.name; } } await _context.SaveChangesAsync(); @@ -1190,50 +1188,50 @@ namespace BMA.EHR.Recurit.Exam.Service.Services if (updated.PrefixId != null) { - var prefix = await _contextMetadata.Prefixes.AsQueryable() + var prefix = await _contextOrg.prefixe.AsQueryable() .FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.PrefixId)); if (prefix == null) throw new Exception(GlobalMessages.PrefixNotFound); candidate.PrefixId = prefix.Id; - candidate.PrefixName = prefix.Name; + candidate.PrefixName = prefix.name; } if (updated.RelationshipId != null) { - var relationship = await _contextMetadata.Relationships.AsQueryable() + var relationship = await _contextOrg.relationship.AsQueryable() .FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.RelationshipId)); if (relationship == null) throw new Exception(GlobalMessages.RelationshipNotFound); candidate.RelationshipId = relationship.Id; - candidate.RelationshipName = relationship.Name; + candidate.RelationshipName = relationship.name; } if (updated.CitizenProvinceId != null) { - var citizenProvince = await _contextMetadata.Provinces.AsQueryable() + var citizenProvince = await _contextOrg.province.AsQueryable() .FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.CitizenProvinceId)); if (citizenProvince == null) throw new Exception(GlobalMessages.ProvinceNotFound); candidate.CitizenProvinceId = citizenProvince.Id; - candidate.CitizenProvinceName = citizenProvince.Name; + candidate.CitizenProvinceName = citizenProvince.name; } if (updated.CitizenDistrictId != null) { - var citizenDistrict = await _contextMetadata.Districts.AsQueryable() + var citizenDistrict = await _contextOrg.district.AsQueryable() .FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.CitizenDistrictId)); if (citizenDistrict == null) throw new Exception(GlobalMessages.DistrictNotFound); candidate.CitizenDistrictId = citizenDistrict.Id; - candidate.CitizenDistrictName = citizenDistrict.Name; + candidate.CitizenDistrictName = citizenDistrict.name; } candidate.FirstName = updated.FirstName; @@ -1310,76 +1308,76 @@ namespace BMA.EHR.Recurit.Exam.Service.Services if (updated.RegistProvinceId != null) { - var registProvince = await _contextMetadata.Provinces.AsQueryable() + var registProvince = await _contextOrg.province.AsQueryable() .FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.RegistProvinceId)); if (registProvince == null) throw new Exception(GlobalMessages.ProvinceNotFound); candidate.RegistProvinceId = registProvince.Id; - candidate.RegistProvinceName = registProvince.Name; + candidate.RegistProvinceName = registProvince.name; } if (updated.RegistDistrictId != null) { - var registDistrict = await _contextMetadata.Districts.AsQueryable() + var registDistrict = await _contextOrg.district.AsQueryable() .FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.RegistDistrictId)); if (registDistrict == null) throw new Exception(GlobalMessages.DistrictNotFound); candidate.RegistDistrictId = registDistrict.Id; - candidate.RegistDistrictName = registDistrict.Name; + candidate.RegistDistrictName = registDistrict.name; } if (updated.RegistSubDistrictId != null) { - var registSubDistrict = await _contextMetadata.SubDistricts.AsQueryable() + var registSubDistrict = await _contextOrg.subDistrict.AsQueryable() .FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.RegistSubDistrictId)); if (registSubDistrict == null) throw new Exception(GlobalMessages.SubDistrictNotFound); candidate.RegistSubDistrictId = registSubDistrict.Id; - candidate.RegistSubDistrictName = registSubDistrict.Name; - candidate.RegistZipCode = registSubDistrict.ZipCode; + candidate.RegistSubDistrictName = registSubDistrict.name; + candidate.RegistZipCode = registSubDistrict.zipCode; } if (updated.CurrentProvinceId != null) { - var currentProvince = await _contextMetadata.Provinces.AsQueryable() + var currentProvince = await _contextOrg.province.AsQueryable() .FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.CurrentProvinceId)); if (currentProvince == null) throw new Exception(GlobalMessages.ProvinceNotFound); candidate.CurrentProvinceId = currentProvince.Id; - candidate.CurrentProvinceName = currentProvince.Name; + candidate.CurrentProvinceName = currentProvince.name; } if (updated.CurrentDistrictId != null) { - var currentDistrict = await _contextMetadata.Districts.AsQueryable() + var currentDistrict = await _contextOrg.district.AsQueryable() .FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.CurrentDistrictId)); if (currentDistrict == null) throw new Exception(GlobalMessages.DistrictNotFound); candidate.CurrentDistrictId = currentDistrict.Id; - candidate.CurrentDistrictName = currentDistrict.Name; + candidate.CurrentDistrictName = currentDistrict.name; } if (updated.CurrentSubDistrictId != null) { - var currentSubDistrict = await _contextMetadata.SubDistricts.AsQueryable() + var currentSubDistrict = await _contextOrg.subDistrict.AsQueryable() .FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.CurrentSubDistrictId)); if (currentSubDistrict == null) throw new Exception(GlobalMessages.SubDistrictNotFound); candidate.CurrentSubDistrictId = currentSubDistrict.Id; - candidate.CurrentSubDistrictName = currentSubDistrict.Name; - candidate.CurrentZipCode = currentSubDistrict.ZipCode; + candidate.CurrentSubDistrictName = currentSubDistrict.name; + candidate.CurrentZipCode = currentSubDistrict.zipCode; } candidate.RegistAddress = updated.RegistAddress; @@ -1401,38 +1399,38 @@ namespace BMA.EHR.Recurit.Exam.Service.Services if (updated.MarryPrefixId != null) { - var prefix = await _contextMetadata.Prefixes.AsQueryable() + var prefix = await _contextOrg.prefixe.AsQueryable() .FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.MarryPrefixId)); if (prefix == null) throw new Exception(GlobalMessages.PrefixNotFound); candidate.MarryPrefixId = prefix.Id; - candidate.MarryPrefixName = prefix.Name; + candidate.MarryPrefixName = prefix.name; } if (updated.FatherPrefixId != null) { - var prefix = await _contextMetadata.Prefixes.AsQueryable() + var prefix = await _contextOrg.prefixe.AsQueryable() .FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.FatherPrefixId)); if (prefix == null) throw new Exception(GlobalMessages.PrefixNotFound); candidate.FatherPrefixId = prefix.Id; - candidate.FatherPrefixName = prefix.Name; + candidate.FatherPrefixName = prefix.name; } if (updated.MotherPrefixId != null) { - var prefix = await _contextMetadata.Prefixes.AsQueryable() + var prefix = await _contextOrg.prefixe.AsQueryable() .FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.MotherPrefixId)); if (prefix == null) throw new Exception(GlobalMessages.PrefixNotFound); candidate.MotherPrefixId = prefix.Id; - candidate.MotherPrefixName = prefix.Name; + candidate.MotherPrefixName = prefix.name; } candidate.Marry = updated.Marry == null ? null : updated.Marry; @@ -1485,14 +1483,14 @@ namespace BMA.EHR.Recurit.Exam.Service.Services if (updated.ContactPrefixId != null) { - var prefix = await _contextMetadata.Prefixes.AsQueryable() + var prefix = await _contextOrg.prefixe.AsQueryable() .FirstOrDefaultAsync(x => x.Id == updated.ContactPrefixId); if (prefix == null) throw new Exception(GlobalMessages.PrefixNotFound); candidate.ContactPrefixId = prefix.Id; - candidate.ContactPrefixName = prefix.Name; + candidate.ContactPrefixName = prefix.name; } candidate.ContactFirstname = updated.ContactFirstname; candidate.ContactLastname = updated.ContactLastname; @@ -1681,24 +1679,24 @@ namespace BMA.EHR.Recurit.Exam.Service.Services }; if (updated.EducationLevelExamId != null) { - var educationLevelExam = await _contextMetadata.EducationLevels.AsQueryable() + var educationLevelExam = await _contextOrg.educationLevel.AsQueryable() .FirstOrDefaultAsync(x => x.Id == updated.EducationLevelExamId); if (educationLevelExam == null) throw new Exception(GlobalMessages.EducationLevelNotFound); education.EducationLevelExamId = educationLevelExam.Id; - education.EducationLevelExamName = educationLevelExam.Name; + education.EducationLevelExamName = educationLevelExam.name; } if (updated.EducationLevelHighId != null) { - var educationLevelHigh = await _contextMetadata.EducationLevels.AsQueryable() + var educationLevelHigh = await _contextOrg.educationLevel.AsQueryable() .FirstOrDefaultAsync(x => x.Id == updated.EducationLevelHighId); if (educationLevelHigh == null) throw new Exception(GlobalMessages.EducationLevelNotFound); education.EducationLevelHighId = educationLevelHigh.Id; - education.EducationLevelHighName = educationLevelHigh.Name; + education.EducationLevelHighName = educationLevelHigh.name; } await _context.Educations.AddAsync(education); } @@ -1715,24 +1713,24 @@ namespace BMA.EHR.Recurit.Exam.Service.Services candidate.Educations.FirstOrDefault().LastUpdateFullName = FullName ?? ""; if (updated.EducationLevelExamId != null) { - var educationLevelExam = await _contextMetadata.EducationLevels.AsQueryable() + var educationLevelExam = await _contextOrg.educationLevel.AsQueryable() .FirstOrDefaultAsync(x => x.Id == updated.EducationLevelExamId); if (educationLevelExam == null) throw new Exception(GlobalMessages.EducationLevelNotFound); candidate.Educations.FirstOrDefault().EducationLevelExamId = educationLevelExam.Id; - candidate.Educations.FirstOrDefault().EducationLevelExamName = educationLevelExam.Name; + candidate.Educations.FirstOrDefault().EducationLevelExamName = educationLevelExam.name; } if (updated.EducationLevelHighId != null) { - var educationLevelHigh = await _contextMetadata.EducationLevels.AsQueryable() + var educationLevelHigh = await _contextOrg.educationLevel.AsQueryable() .FirstOrDefaultAsync(x => x.Id == updated.EducationLevelHighId); if (educationLevelHigh == null) throw new Exception(GlobalMessages.EducationLevelNotFound); candidate.Educations.FirstOrDefault().EducationLevelHighId = educationLevelHigh.Id; - candidate.Educations.FirstOrDefault().EducationLevelHighName = educationLevelHigh.Name; + candidate.Educations.FirstOrDefault().EducationLevelHighName = educationLevelHigh.name; } } @@ -1767,24 +1765,24 @@ namespace BMA.EHR.Recurit.Exam.Service.Services }; if (updated.EducationLevelExamId != null) { - var educationLevelExam = await _contextMetadata.EducationLevels.AsQueryable() + var educationLevelExam = await _contextOrg.educationLevel.AsQueryable() .FirstOrDefaultAsync(x => x.Id == updated.EducationLevelExamId); if (educationLevelExam == null) throw new Exception(GlobalMessages.EducationLevelNotFound); education.EducationLevelExamId = educationLevelExam.Id; - education.EducationLevelExamName = educationLevelExam.Name; + education.EducationLevelExamName = educationLevelExam.name; } if (updated.EducationLevelHighId != null) { - var educationLevelHigh = await _contextMetadata.EducationLevels.AsQueryable() + var educationLevelHigh = await _contextOrg.educationLevel.AsQueryable() .FirstOrDefaultAsync(x => x.Id == updated.EducationLevelHighId); if (educationLevelHigh == null) throw new Exception(GlobalMessages.EducationLevelNotFound); education.EducationLevelHighId = educationLevelHigh.Id; - education.EducationLevelHighName = educationLevelHigh.Name; + education.EducationLevelHighName = educationLevelHigh.name; } await _context.Educations.AddAsync(education); } @@ -1801,24 +1799,24 @@ namespace BMA.EHR.Recurit.Exam.Service.Services candidate.Educations.FirstOrDefault().LastUpdateFullName = FullName ?? ""; if (updated.EducationLevelExamId != null) { - var educationLevelExam = await _contextMetadata.EducationLevels.AsQueryable() + var educationLevelExam = await _contextOrg.educationLevel.AsQueryable() .FirstOrDefaultAsync(x => x.Id == updated.EducationLevelExamId); if (educationLevelExam == null) throw new Exception(GlobalMessages.EducationLevelNotFound); candidate.Educations.FirstOrDefault().EducationLevelExamId = educationLevelExam.Id; - candidate.Educations.FirstOrDefault().EducationLevelExamName = educationLevelExam.Name; + candidate.Educations.FirstOrDefault().EducationLevelExamName = educationLevelExam.name; } if (updated.EducationLevelHighId != null) { - var educationLevelHigh = await _contextMetadata.EducationLevels.AsQueryable() + var educationLevelHigh = await _contextOrg.educationLevel.AsQueryable() .FirstOrDefaultAsync(x => x.Id == updated.EducationLevelHighId); if (educationLevelHigh == null) throw new Exception(GlobalMessages.EducationLevelNotFound); candidate.Educations.FirstOrDefault().EducationLevelHighId = educationLevelHigh.Id; - candidate.Educations.FirstOrDefault().EducationLevelHighName = educationLevelHigh.Name; + candidate.Educations.FirstOrDefault().EducationLevelHighName = educationLevelHigh.name; } } await _context.SaveChangesAsync(); @@ -1868,7 +1866,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services // if (education == null) // throw new Exception(GlobalMessages.EducationNotFound); - // var educationLevel = await _contextMetadata.EducationLevels.AsQueryable() + // var educationLevel = await _contextOrg.educationLevel.AsQueryable() // .FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.EducationLevelId)); // if (educationLevel == null) diff --git a/Services/PeriodExamService.cs b/Services/PeriodExamService.cs index d39471d..74bd17f 100644 --- a/Services/PeriodExamService.cs +++ b/Services/PeriodExamService.cs @@ -1,18 +1,14 @@ using System.Security.Claims; -using System.Text.Json; using BMA.EHR.Domain.Models.Placement; using BMA.EHR.Recurit.Exam.Service.Extensions; using BMA.EHR.Recurit.Exam.Service.Core; using BMA.EHR.Recurit.Exam.Service.Data; using BMA.EHR.Recurit.Exam.Service.Models; -using BMA.EHR.Recurit.Exam.Service.Models.Documents; using BMA.EHR.Recurit.Exam.Service.Request; using BMA.EHR.Recurit.Exam.Service.Response; using BMA.EHR.Recurit.Exam.Service.Responses.Document; using Microsoft.EntityFrameworkCore; -using Newtonsoft.Json.Linq; using OfficeOpenXml; -using BMA.EHR.Domain.Models.Placement; using OfficeOpenXml.Style; using System.Text; using Newtonsoft.Json; @@ -26,6 +22,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services private readonly ApplicationDbContext _context; private readonly MetadataDbContext _contextMetadata; + private readonly OrgDbContext _contextOrg; private readonly IHttpContextAccessor _httpContextAccessor; private readonly MinIOService _minioService; private readonly MailService _mailService; @@ -37,6 +34,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services public PeriodExamService(ApplicationDbContext context, MetadataDbContext contextMetadata, + OrgDbContext contextOrg, IHttpContextAccessor httpContextAccessor, MinIOService minioService, MailService mailService, @@ -44,6 +42,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services { _context = context; _contextMetadata = contextMetadata; + _contextOrg = contextOrg; _httpContextAccessor = httpContextAccessor; _minioService = minioService; _mailService = mailService; @@ -92,33 +91,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Services } } - private List GetAllIdByRoot(Guid id) - { - try - { - var ret = new List(); - - var oc = _contextMetadata.Organizations.FirstOrDefault(x => x.Id == id && x.IsActive); - if (oc != null) - ret.Add(oc.Id); - - var child = _contextMetadata.Organizations.AsQueryable().Where(x => x.ParentId == id && x.IsActive).ToList(); - if (child.Any()) - { - foreach (var item in child) - { - ret.AddRange(GetAllIdByRoot(item.Id)); - } - } - - return ret; - } - catch - { - throw; - } - } - public async Task> GetsAsync(string type, bool showAll = true) { var periodExams = await _context.PeriodExams.AsQueryable() @@ -126,11 +98,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services .Where(p => p.CheckDisability == false) .Where(p => type.ToUpper() == "ALL" ? (p.AnnouncementExam == true || p.AnnouncementExam == false) : (type.ToUpper() == "EXAM" ? p.AnnouncementExam == true : p.AnnouncementExam == false)) .OrderByDescending(d => d.CreatedAt).ToListAsync(); - var profileOrganizations = await _contextMetadata.ProfileOrganizations.AsQueryable() - .ToListAsync(); var _periodExams = (from x in periodExams - join po in profileOrganizations on Guid.Parse(x.CreatedUserId) equals po?.UserId into poGroup - from po in poGroup.DefaultIfEmpty() select new PeriodExamCandidateResponseItem { ExamDate = x.ExamDate, @@ -161,30 +129,11 @@ namespace BMA.EHR.Recurit.Exam.Service.Services Round = x.Round, SetSeat = x.SetSeat, Year = x.Year, - OcId = po == null ? null : po.OrganizationId, CreatedUserId = x.CreatedUserId, }).AsQueryable() .ToList(); var roles = _httpContextAccessor?.HttpContext?.User?.FindAll(ClaimTypes.Role)?.Select(c => c.Value).ToList(); - // if (!roles.Contains("head")) - // { - // var criteria = new List(); - // var profileOrganization = await _contextMetadata.ProfileOrganizations.AsQueryable() - // .FirstOrDefaultAsync(x => x.UserId == Guid.Parse(UserId)); - - // if (profileOrganization == null) - // return new List(); - - // var ocId = _contextMetadata.Organizations.AsQueryable() - // .FirstOrDefault(x => x.Id == profileOrganization.OrganizationId); - // if (ocId == null) - // return new List(); - // criteria = GetAllIdByRoot(ocId.Id); - - // if (criteria.Any()) - // _periodExams = _periodExams.Where(x => x.CreatedUserId == UserId || criteria.Contains(x.OcId == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : x.OcId)).ToList(); - // } return _periodExams; } @@ -1810,7 +1759,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Services } if (careers.Count == 0) row++; - Console.WriteLine(num); num = num + 1; } summarySheet.Cells[summarySheet.Dimension.Address].AutoFitColumns(); @@ -2080,13 +2028,14 @@ namespace BMA.EHR.Recurit.Exam.Service.Services throw new Exception(GlobalMessages.ExamNotFound); var _placement = await _contextMetadata.Placements.AsQueryable() - .FirstOrDefaultAsync(x => x.Name == periodExam.Name && x.Year == ((int)(periodExam.Year == null ? 0 : periodExam.Year))); + .FirstOrDefaultAsync(x => x.PlacementType.Name == "สอบคัดเลือก" && x.RefId == periodExam.Id); if (_placement != null) throw new Exception("รอบการสอบนี้ได้ทำการบรรจุไปแล้ว"); var placement = new Placement { Name = periodExam.Name, + RefId = periodExam.Id, Round = periodExam.Round == null ? "" : periodExam.Round.ToString(), Year = (int)(periodExam.Year == null ? 0 : periodExam.Year), Number = periodExam.Candidate.Where(x => x.Status.Contains("done")).Count(), @@ -2126,65 +2075,50 @@ namespace BMA.EHR.Recurit.Exam.Service.Services } } - var profile = await _contextMetadata.Profiles - .Include(x => x.Salaries) - .FirstOrDefaultAsync(p => p.CitizenId == candidate.CitizenId); - var Prefix = await _contextMetadata.Prefixes.Where(x => x.Id == candidate.PrefixId).FirstOrDefaultAsync() == null ? null : await _contextMetadata.Prefixes.Where(x => x.Id == candidate.PrefixId).FirstOrDefaultAsync(); - var Religion = await _contextMetadata.Religions.Where(x => x.Id == candidate.ReligionId).FirstOrDefaultAsync() == null ? null : await _contextMetadata.Prefixes.Where(x => x.Id == candidate.ReligionId).FirstOrDefaultAsync(); - var CitizenDistrict = await _contextMetadata.Districts.Where(x => x.Id == candidate.CitizenDistrictId).FirstOrDefaultAsync() == null ? null : await _contextMetadata.Prefixes.Where(x => x.Id == candidate.CitizenDistrictId).FirstOrDefaultAsync(); - var CitizenProvince = await _contextMetadata.Provinces.Where(x => x.Id == candidate.CitizenProvinceId).FirstOrDefaultAsync() == null ? null : await _contextMetadata.Prefixes.Where(x => x.Id == candidate.CitizenProvinceId).FirstOrDefaultAsync(); - var RegistProvince = await _contextMetadata.Provinces.Where(x => x.Id == candidate.RegistProvinceId).FirstOrDefaultAsync() == null ? null : await _contextMetadata.Prefixes.Where(x => x.Id == candidate.RegistProvinceId).FirstOrDefaultAsync(); - var RegistDistrict = await _contextMetadata.Districts.Where(x => x.Id == candidate.RegistDistrictId).FirstOrDefaultAsync() == null ? null : await _contextMetadata.Prefixes.Where(x => x.Id == candidate.RegistDistrictId).FirstOrDefaultAsync(); - var RegistSubDistrict = await _contextMetadata.SubDistricts.Where(x => x.Id == candidate.RegistSubDistrictId).FirstOrDefaultAsync() == null ? null : await _contextMetadata.Prefixes.Where(x => x.Id == candidate.RegistSubDistrictId).FirstOrDefaultAsync(); - var CurrentProvince = await _contextMetadata.Provinces.Where(x => x.Id == candidate.CurrentProvinceId).FirstOrDefaultAsync() == null ? null : await _contextMetadata.Prefixes.Where(x => x.Id == candidate.CurrentProvinceId).FirstOrDefaultAsync(); - var CurrentDistrict = await _contextMetadata.Districts.Where(x => x.Id == candidate.CurrentDistrictId).FirstOrDefaultAsync() == null ? null : await _contextMetadata.Prefixes.Where(x => x.Id == candidate.CurrentDistrictId).FirstOrDefaultAsync(); - var CurrentSubDistrict = await _contextMetadata.SubDistricts.Where(x => x.Id == candidate.CurrentSubDistrictId).FirstOrDefaultAsync() == null ? null : await _contextMetadata.Prefixes.Where(x => x.Id == candidate.CurrentSubDistrictId).FirstOrDefaultAsync(); - var MarryPrefix = await _contextMetadata.Prefixes.Where(x => x.Id == candidate.MarryPrefixId).FirstOrDefaultAsync() == null ? null : await _contextMetadata.Prefixes.Where(x => x.Id == candidate.MarryPrefixId).FirstOrDefaultAsync(); - var FatherPrefix = await _contextMetadata.Prefixes.Where(x => x.Id == candidate.FatherPrefixId).FirstOrDefaultAsync() == null ? null : await _contextMetadata.Prefixes.Where(x => x.Id == candidate.FatherPrefixId).FirstOrDefaultAsync(); - var MotherPrefix = await _contextMetadata.Prefixes.Where(x => x.Id == candidate.MotherPrefixId).FirstOrDefaultAsync() == null ? null : await _contextMetadata.Prefixes.Where(x => x.Id == candidate.MotherPrefixId).FirstOrDefaultAsync(); var placementProfile = new PlacementProfile { Placement = placement, - PositionCandidate = await _contextMetadata.PositionPaths.FirstOrDefaultAsync(x => x.Id == (candidate.PositionExam == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : candidate.PositionExam.PositionId)), - positionName = candidate.PositionExam.PositionName, - Prefix = Prefix == null ? null : Prefix.Name, - ProfileImg = candidate.ProfileImg, + PositionCandidate = candidate?.PositionExam?.PositionName ?? null, + PositionLevel = candidate?.PositionExam?.PositionLevelName ?? null, + PositionType = candidate.PositionExam == null ? null : (candidate.PositionExam.HighDegree == null ? null : (candidate.PositionExam.HighDegree == true ? "วิชาการ" : "ทั่วไป")), + Prefix = candidate.PrefixName, + // ProfileImg = candidate.ProfileImg, Firstname = candidate.FirstName, Lastname = candidate.LastName, Nationality = candidate.Nationality, DateOfBirth = candidate.DateOfBirth, - Religion = Religion == null ? null : Religion.Name, + Religion = candidate.ReligionName, Email = candidate.Email, CitizenId = candidate.CitizenId, - CitizenDistrictId = CitizenDistrict == null ? null : CitizenDistrict.Id.ToString(), - CitizenProvinceId = CitizenProvince == null ? null : CitizenProvince.Id.ToString(), + CitizenDistrictId = candidate.CitizenDistrictId, + CitizenProvinceId = candidate.CitizenProvinceId, CitizenDate = candidate.CitizenDate, Telephone = candidate.Telephone, MobilePhone = candidate.MobilePhone, Knowledge = candidate.Knowledge, RegistAddress = candidate.RegistAddress, - RegistProvinceId = RegistProvince == null ? null : RegistProvince.Id.ToString(), - RegistDistrictId = RegistDistrict == null ? null : RegistDistrict.Id.ToString(), - RegistSubDistrictId = RegistSubDistrict == null ? null : RegistSubDistrict.Id.ToString(), + RegistProvinceId = candidate.RegistProvinceId, + RegistDistrictId = candidate.RegistDistrictId, + RegistSubDistrictId = candidate.RegistSubDistrictId, RegistZipCode = candidate.RegistZipCode, RegistSame = candidate.RegistSame, CurrentAddress = candidate.CurrentAddress, - CurrentProvinceId = CurrentProvince == null ? null : CurrentProvince.Id.ToString(), - CurrentDistrictId = CurrentDistrict == null ? null : CurrentDistrict.Id.ToString(), - CurrentSubDistrictId = CurrentSubDistrict == null ? null : CurrentSubDistrict.Id.ToString(), + CurrentProvinceId = candidate.CurrentProvinceId, + CurrentDistrictId = candidate.CurrentDistrictId, + CurrentSubDistrictId = candidate.CurrentSubDistrictId, CurrentZipCode = candidate.CurrentZipCode, Marry = candidate.Marry, - MarryPrefix = MarryPrefix == null ? null : MarryPrefix.Name, + MarryPrefix = candidate.MarryPrefixName, MarryFirstName = candidate.MarryFirstName, MarryLastName = candidate.MarryLastName, MarryOccupation = candidate.MarryOccupation, MarryNationality = candidate.MarryNationality, - FatherPrefix = FatherPrefix == null ? null : FatherPrefix.Name, + FatherPrefix = candidate.FatherPrefixName, FatherFirstName = candidate.FatherFirstName, FatherLastName = candidate.FatherLastName, FatherOccupation = candidate.FatherOccupation, FatherNationality = candidate.FatherNationality, - MotherPrefix = MotherPrefix == null ? null : MotherPrefix.Name, + MotherPrefix = candidate.MotherPrefixName, MotherFirstName = candidate.MotherFirstName, MotherLastName = candidate.MotherLastName, MotherOccupation = candidate.MotherOccupation, @@ -2195,8 +2129,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Services OccupationSalary = candidate.OccupationSalary, OccupationPosition = candidate.OccupationPosition, OccupationPositionType = candidate.OccupationPositionType, - PositionLevel = candidate.PositionExam.PositionLevelName, - PositionType = candidate.PositionExam == null ? null : (candidate.PositionExam.HighDegree == null ? null : (candidate.PositionExam.HighDegree == true ? "วิชาการ":"ทั่วไป")), OccupationTelephone = candidate.OccupationTelephone, PointTotalA = candidate.PointTotalA == null ? null : Convert.ToDouble(candidate.PointTotalA), PointA = candidate.PointA == null ? null : Convert.ToDouble(candidate.PointA), @@ -2210,9 +2142,9 @@ namespace BMA.EHR.Recurit.Exam.Service.Services PlacementStatus = "UN-CONTAIN", Pass = candidate.Pass, RemarkHorizontal = "โดยมีเงื่อนไขว่าต้องปฏิบัติงานให้กรุงเทพมหานครเป็นระยะเวลาไม่น้อยกว่า ๕ ปี นับแต่วันที่ได้รับการบรรจุและแต่งตั้ง โดยห้ามโอนไปหน่วยงานหรือส่วนราชการอื่น เว้นเเต่ลาออกจากราชการ", - Amount = org == null || org.result == null ? null : org.result.amount, - PositionSalaryAmount = org == null || org.result == null ? null : org.result.positionSalaryAmount, - MouthSalaryAmount = org == null || org.result == null ? null : org.result.mouthSalaryAmount, + Amount = org?.result?.amount ?? null, + PositionSalaryAmount = org?.result?.positionSalaryAmount ?? null, + MouthSalaryAmount = org?.result?.mouthSalaryAmount ?? null, CreatedAt = DateTime.Now, CreatedUserId = UserId ?? "", CreatedFullName = FullName ?? "", @@ -2220,36 +2152,34 @@ namespace BMA.EHR.Recurit.Exam.Service.Services LastUpdateUserId = UserId ?? "", LastUpdateFullName = FullName ?? "", IsOfficer = IsOfficer, - profileId = org == null || org.result == null ? null : org.result.profileId, + profileId = org?.result?.profileId ?? null, IsOld = org == null || org.result == null ? false : true, - AmountOld = org == null || org.result == null ? null : org.result.AmountOld, - nodeOld = org == null || org.result == null ? null : org.result.node, - nodeIdOld = org == null || org.result == null ? null : org.result.nodeId, - posmasterIdOld = org == null || org.result == null ? null : org.result.posmasterId, - rootOld = org == null || org.result == null ? null : org.result.root, - rootIdOld = org == null || org.result == null ? null : org.result.rootId, - rootShortNameOld = org == null || org.result == null ? null : org.result.rootShortName, - child1Old = org == null || org.result == null ? null : org.result.child1, - child1IdOld = org == null || org.result == null ? null : org.result.child1Id, - child1ShortNameOld = org == null || org.result == null ? null : org.result.child1ShortName, - child2Old = org == null || org.result == null ? null : org.result.child2, - child2IdOld = org == null || org.result == null ? null : org.result.child2Id, - child2ShortNameOld = org == null || org.result == null ? null : org.result.child2ShortName, - child3Old = org == null || org.result == null ? null : org.result.child3, - child3IdOld = org == null || org.result == null ? null : org.result.child3Id, - child3ShortNameOld = org == null || org.result == null ? null : org.result.child3ShortName, - child4Old = org == null || org.result == null ? null : org.result.child4, - child4IdOld = org == null || org.result == null ? null : org.result.child4Id, - child4ShortNameOld = org == null || org.result == null ? null : org.result.child4ShortName, - orgRevisionIdOld = org == null || org.result == null ? null : org.result.orgRevisionId, - // positionIdOld = org == null || org.result == null ? null : org.result.positionIdOld, - posMasterNoOld = org == null || org.result == null ? null : org.result.posMasterNo, - positionNameOld = org == null || org.result == null ? null : org.result.position, - // positionFieldOld = org == null || org.result == null ? null : org.result.positionFieldOld, - posTypeIdOld = org == null || org.result == null ? null : org.result.posTypeId, - posTypeNameOld = org == null || org.result == null ? null : org.result.posTypeName, - posLevelIdOld = org == null || org.result == null ? null : org.result.posLevelId, - posLevelNameOld = org == null || org.result == null ? null : org.result.posLevelName, + AmountOld = org?.result?.AmountOld ?? null, + nodeOld = org?.result?.node ?? null, + nodeIdOld = org?.result?.nodeId ?? null, + posmasterIdOld = org?.result?.posmasterId ?? null, + rootOld = org?.result?.root ?? null, + rootIdOld = org?.result?.rootId ?? null, + rootShortNameOld = org?.result?.rootShortName ?? null, + child1Old = org?.result?.child1 ?? null, + child1IdOld = org?.result?.child1Id ?? null, + child1ShortNameOld = org?.result?.child1ShortName ?? null, + child2Old = org?.result?.child2 ?? null, + child2IdOld = org?.result?.child2Id ?? null, + child2ShortNameOld = org?.result?.child2ShortName ?? null, + child3Old = org?.result?.child3 ?? null, + child3IdOld = org?.result?.child3Id ?? null, + child3ShortNameOld = org?.result?.child3ShortName ?? null, + child4Old = org?.result?.child4 ?? null, + child4IdOld = org?.result?.child4Id ?? null, + child4ShortNameOld = org?.result?.child4ShortName ?? null, + orgRevisionIdOld = org?.result?.orgRevisionId ?? null, + posMasterNoOld = org?.result?.posMasterNo ?? null, + positionNameOld = org?.result?.position ?? null, + posTypeIdOld = org?.result?.posTypeId ?? null, + posTypeNameOld = org?.result?.posTypeName ?? null, + posLevelIdOld = org?.result?.posLevelId ?? null, + posLevelNameOld = org?.result?.posLevelName ?? null, }; await _contextMetadata.PlacementProfiles.AddAsync(placementProfile); @@ -2258,7 +2188,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Services var placementEducation = new PlacementEducation { PlacementProfile = placementProfile, - EducationLevel = await _contextMetadata.EducationLevels.FirstOrDefaultAsync(x => x.Id == education.EducationLevelExamId), + EducationLevelId = education.EducationLevelExamId, + EducationLevelName = education.EducationLevelExamName, Field = education.EducationMajor, Gpa = education.EducationScores, Institute = education.EducationLocation, @@ -2287,13 +2218,14 @@ namespace BMA.EHR.Recurit.Exam.Service.Services throw new Exception(GlobalMessages.ExamNotFound); var _placement = await _contextMetadata.Placements.AsQueryable() - .FirstOrDefaultAsync(x => x.Name == periodExam.Name && x.Year == ((int)(periodExam.Year == null ? 0 : periodExam.Year))); + .FirstOrDefaultAsync(x => x.PlacementType.Name == "คัดเลือกคนพิการ" && x.RefId == periodExam.Id); if (_placement != null) throw new Exception("รอบการสอบนี้ได้ทำการบรรจุไปแล้ว"); var placement = new Placement { Name = periodExam.Name, + RefId = periodExam.Id, Round = periodExam.Round == null ? "" : periodExam.Round.ToString(), Year = (int)(periodExam.Year == null ? 0 : periodExam.Year), Number = await _context.Disables.AsQueryable().Where(x => x.PeriodExam == periodExam).CountAsync(), @@ -2356,21 +2288,12 @@ namespace BMA.EHR.Recurit.Exam.Service.Services .FirstOrDefaultAsync(x => x.ExamId == candidate.ExamId && x.ScoreImport == scoreImport); if (disableScore == null) continue; - var profile = await _contextMetadata.Profiles - .Include(x => x.Salaries) - .FirstOrDefaultAsync(p => p.CitizenId == candidate.CitizenId); - var CitizenProvince = await _contextMetadata.Provinces.Where(x => x.Name == candidate.CitizenCardIssuer).FirstOrDefaultAsync(); - var RegistProvince = candidate.Addresses.FirstOrDefault() == null ? null : await _contextMetadata.Provinces.Where(x => x.Name == candidate.Addresses.FirstOrDefault().Province).FirstOrDefaultAsync(); - var RegistDistrict = candidate.Addresses.FirstOrDefault() == null ? null : await _contextMetadata.Districts.Where(x => x.Name == candidate.Addresses.FirstOrDefault().District).FirstOrDefaultAsync(); - var RegistSubDistrict = candidate.Addresses.FirstOrDefault() == null ? null : await _contextMetadata.SubDistricts.Where(x => x.Name == candidate.Addresses.FirstOrDefault().Amphur).FirstOrDefaultAsync(); - var CurrentProvince = candidate.Addresses.FirstOrDefault() == null ? null : await _contextMetadata.Provinces.Where(x => x.Name == candidate.Addresses.FirstOrDefault().Province1).FirstOrDefaultAsync(); - var CurrentDistrict = candidate.Addresses.FirstOrDefault() == null ? null : await _contextMetadata.Districts.Where(x => x.Name == candidate.Addresses.FirstOrDefault().District1).FirstOrDefaultAsync(); - var CurrentSubDistrict = candidate.Addresses.FirstOrDefault() == null ? null : await _contextMetadata.SubDistricts.Where(x => x.Name == candidate.Addresses.FirstOrDefault().Amphur1).FirstOrDefaultAsync(); var placementProfile = new PlacementProfile { Placement = placement, - PositionCandidate = await _contextMetadata.PositionPaths.FirstOrDefaultAsync(x => x.Name == candidate.PositionName), - positionName = candidate.PositionName, + PositionCandidate = candidate.PositionName, + PositionType = candidate.PositionType, + PositionLevel = candidate.PositionLevel, Prefix = candidate.Prefix, Firstname = candidate.FirstName, Lastname = candidate.LastName, @@ -2380,48 +2303,27 @@ namespace BMA.EHR.Recurit.Exam.Service.Services Religion = candidate.Religion, DateOfBirth = candidate.DateOfBirth, Relationship = candidate.Marry, - // Email = candidate.Email, CitizenId = candidate.CitizenId, - // CitizenDistrict = await _contextMetadata.Districts.FirstOrDefaultAsync(x => x.Id == candidate.CitizenDistrictId), - CitizenProvinceId = CitizenProvince == null ? null : CitizenProvince.Id.ToString(), + CitizenProvinceId = _contextOrg.province.FirstOrDefault(x => x.name == candidate.CitizenCardIssuer)?.Id ?? null, CitizenDate = candidate.CitizenCardExpireDate, - Telephone = candidate.Addresses.FirstOrDefault() == null ? null : candidate.Addresses.FirstOrDefault().Telephone, - MobilePhone = candidate.Addresses.FirstOrDefault() == null ? null : candidate.Addresses.FirstOrDefault().Mobile, - // Knowledge = candidate.Knowledge, + Telephone = candidate?.Addresses?.FirstOrDefault()?.Telephone ?? null, + MobilePhone = candidate?.Addresses?.FirstOrDefault()?.Mobile ?? null, RegistAddress = $"{Address}{Moo}{Soi}{Road}", - RegistProvinceId = RegistProvince == null ? null : RegistProvince.Id.ToString(), - RegistDistrictId = RegistDistrict == null ? null : RegistDistrict.Id.ToString(), - RegistSubDistrictId = RegistSubDistrict == null ? null : RegistSubDistrict.Id.ToString(), - RegistZipCode = candidate.Addresses.FirstOrDefault() == null ? null : candidate.Addresses.FirstOrDefault().ZipCode, + RegistProvinceId = _contextOrg.province.FirstOrDefault(x => x.name == (candidate!.Addresses!.FirstOrDefault()!.Province ?? ""))?.Id ?? null, + RegistDistrictId = _contextOrg.district.FirstOrDefault(x => x.name == (candidate!.Addresses!.FirstOrDefault()!.District ?? ""))?.Id ?? null, + RegistSubDistrictId = _contextOrg.subDistrict.FirstOrDefault(x => x.name == (candidate!.Addresses!.FirstOrDefault()!.Soi ?? ""))?.Id ?? null, + RegistZipCode = candidate?.Addresses?.FirstOrDefault()?.ZipCode ?? null, RegistSame = false, CurrentAddress = $"{Address1}{Moo1}{Soi1}{Road1}", - CurrentProvinceId = CurrentProvince == null ? null : CurrentProvince.Id.ToString(), - CurrentDistrictId = CurrentDistrict == null ? null : CurrentDistrict.Id.ToString(), - CurrentSubDistrictId = CurrentSubDistrict == null ? null : CurrentSubDistrict.Id.ToString(), - CurrentZipCode = candidate.Addresses.FirstOrDefault() == null ? null : candidate.Addresses.FirstOrDefault().ZipCode1, - Marry = candidate.Marry.Contains("สมรส"), - // MarryPrefix = await _contextMetadata.Prefixes.FirstOrDefaultAsync(x => x.Id == candidate.MarryPrefixId), - // MarryFirstName = candidate.MarryFirstName, - // MarryLastName = candidate.MarryLastName, - // MarryOccupation = candidate.MarryOccupation, - // MarryNationality = candidate.MarryNationality, - // FatherPrefix = await _contextMetadata.Prefixes.FirstOrDefaultAsync(x => x.Id == candidate.FatherPrefixId), - // FatherFirstName = candidate.FatherFirstName, - // FatherLastName = candidate.FatherLastName, - // FatherOccupation = candidate.FatherOccupation, - // FatherNationality = candidate.FatherNationality, - // MotherPrefix = await _contextMetadata.Prefixes.FirstOrDefaultAsync(x => x.Id == candidate.MotherPrefixId), - // MotherFirstName = candidate.MotherFirstName, - // MotherLastName = candidate.MotherLastName, - // MotherOccupation = candidate.MotherOccupation, - // MotherNationality = candidate.MotherNationality, + CurrentProvinceId = _contextOrg.province.FirstOrDefault(x => x.name == (candidate!.Addresses!.FirstOrDefault()!.Province1 ?? ""))?.Id ?? null, + CurrentDistrictId = _contextOrg.district.FirstOrDefault(x => x.name == (candidate!.Addresses!.FirstOrDefault()!.District1 ?? ""))?.Id ?? null, + CurrentSubDistrictId = _contextOrg.subDistrict.FirstOrDefault(x => x.name == (candidate!.Addresses!.FirstOrDefault()!.Soi1 ?? ""))?.Id ?? null, + CurrentZipCode = candidate?.Addresses?.FirstOrDefault()?.ZipCode1 ?? null, + Marry = candidate?.Marry?.Contains("สมรส") ?? false, OccupationPositionType = "other", - // OccupationCompany = candidate.OccupationCompany, - // OccupationDepartment = candidate.Occupations.FirstOrDefault() == null ? null : candidate.Occupations.FirstOrDefault().Workplace, - // OccupationEmail = candidate.OccupationEmail, - OccupationTelephone = candidate.Occupations.FirstOrDefault() == null ? null : candidate.Occupations.FirstOrDefault().Telephone, - OccupationPosition = candidate.Occupations.FirstOrDefault() == null ? null : candidate.Occupations.FirstOrDefault().Position, + OccupationTelephone = candidate?.Occupations?.FirstOrDefault()?.Telephone ?? null, + OccupationPosition = candidate?.Occupations?.FirstOrDefault()?.Position ?? null, PointTotalA = disableScore == null ? null : Convert.ToDouble(disableScore.FullA), PointA = disableScore == null ? null : Convert.ToDouble(disableScore.SumA), @@ -2435,10 +2337,9 @@ namespace BMA.EHR.Recurit.Exam.Service.Services PlacementStatus = "UN-CONTAIN", Pass = disableScore == null ? null : disableScore.ExamStatus, RemarkHorizontal = "โดยมีเงื่อนไขว่าต้องปฏิบัติงานให้กรุงเทพมหานครเป็นระยะเวลาไม่น้อยกว่า ๕ ปี นับแต่วันที่ได้รับการบรรจุและแต่งตั้ง โดยห้ามโอนไปหน่วยงานหรือส่วนราชการอื่น เว้นเเต่ลาออกจากราชการ", - // ReportingDate = DateTime.Now, - Amount = org == null || org.result == null ? null : org.result.amount, - PositionSalaryAmount = org == null || org.result == null ? null : org.result.positionSalaryAmount, - MouthSalaryAmount = org == null || org.result == null ? null : org.result.mouthSalaryAmount, + Amount = org?.result?.amount ?? null, + PositionSalaryAmount = org?.result?.positionSalaryAmount ?? null, + MouthSalaryAmount = org?.result?.mouthSalaryAmount ?? null, CreatedAt = DateTime.Now, CreatedUserId = UserId ?? "", CreatedFullName = FullName ?? "", @@ -2446,56 +2347,48 @@ namespace BMA.EHR.Recurit.Exam.Service.Services LastUpdateUserId = UserId ?? "", LastUpdateFullName = FullName ?? "", IsOfficer = IsOfficer, - profileId = org == null || org.result == null ? null : org.result.profileId, + profileId = org?.result?.profileId ?? null, IsOld = org == null || org.result == null ? false : true, - AmountOld = org == null || org.result == null ? null : org.result.AmountOld, - nodeOld = org == null || org.result == null ? null : org.result.node, - nodeIdOld = org == null || org.result == null ? null : org.result.nodeId, - posmasterIdOld = org == null || org.result == null ? null : org.result.posmasterId, - rootOld = org == null || org.result == null ? null : org.result.root, - rootIdOld = org == null || org.result == null ? null : org.result.rootId, - rootShortNameOld = org == null || org.result == null ? null : org.result.rootShortName, - child1Old = org == null || org.result == null ? null : org.result.child1, - child1IdOld = org == null || org.result == null ? null : org.result.child1Id, - child1ShortNameOld = org == null || org.result == null ? null : org.result.child1ShortName, - child2Old = org == null || org.result == null ? null : org.result.child2, - child2IdOld = org == null || org.result == null ? null : org.result.child2Id, - child2ShortNameOld = org == null || org.result == null ? null : org.result.child2ShortName, - child3Old = org == null || org.result == null ? null : org.result.child3, - child3IdOld = org == null || org.result == null ? null : org.result.child3Id, - child3ShortNameOld = org == null || org.result == null ? null : org.result.child3ShortName, - child4Old = org == null || org.result == null ? null : org.result.child4, - child4IdOld = org == null || org.result == null ? null : org.result.child4Id, - child4ShortNameOld = org == null || org.result == null ? null : org.result.child4ShortName, - orgRevisionIdOld = org == null || org.result == null ? null : org.result.orgRevisionId, - // positionIdOld = org == null || org.result == null ? null : org.result.positionIdOld, - posMasterNoOld = org == null || org.result == null ? null : org.result.posMasterNo, - positionNameOld = org == null || org.result == null ? null : org.result.position, - // positionFieldOld = org == null || org.result == null ? null : org.result.positionFieldOld, - posTypeIdOld = org == null || org.result == null ? null : org.result.posTypeId, - posTypeNameOld = org == null || org.result == null ? null : org.result.posTypeName, - posLevelIdOld = org == null || org.result == null ? null : org.result.posLevelId, - posLevelNameOld = org == null || org.result == null ? null : org.result.posLevelName, + AmountOld = org?.result?.AmountOld ?? null, + nodeOld = org?.result?.node ?? null, + nodeIdOld = org?.result?.nodeId ?? null, + posmasterIdOld = org?.result?.posmasterId ?? null, + rootOld = org?.result?.root ?? null, + rootIdOld = org?.result?.rootId ?? null, + rootShortNameOld = org?.result?.rootShortName ?? null, + child1Old = org?.result?.child1 ?? null, + child1IdOld = org?.result?.child1Id ?? null, + child1ShortNameOld = org?.result?.child1ShortName ?? null, + child2Old = org?.result?.child2 ?? null, + child2IdOld = org?.result?.child2Id ?? null, + child2ShortNameOld = org?.result?.child2ShortName ?? null, + child3Old = org?.result?.child3 ?? null, + child3IdOld = org?.result?.child3Id ?? null, + child3ShortNameOld = org?.result?.child3ShortName ?? null, + child4Old = org?.result?.child4 ?? null, + child4IdOld = org?.result?.child4Id ?? null, + child4ShortNameOld = org?.result?.child4ShortName ?? null, + orgRevisionIdOld = org?.result?.orgRevisionId ?? null, + posMasterNoOld = org?.result?.posMasterNo ?? null, + positionNameOld = org?.result?.position ?? null, + posTypeIdOld = org?.result?.posTypeId ?? null, + posTypeNameOld = org?.result?.posTypeName ?? null, + posLevelIdOld = org?.result?.posLevelId ?? null, + posLevelNameOld = org?.result?.posLevelName ?? null, }; await _contextMetadata.PlacementProfiles.AddAsync(placementProfile); var placementEducation = new PlacementEducation { PlacementProfile = placementProfile, - EducationLevel = await _contextMetadata.EducationLevels.FirstOrDefaultAsync(x => x.Name == (candidate.Educations.FirstOrDefault() == null ? null : candidate.Educations.FirstOrDefault().HighDegree)), - Field = candidate.Educations.FirstOrDefault() == null ? null : candidate.Educations.FirstOrDefault().Major, - Gpa = candidate.Educations.FirstOrDefault() == null ? null : candidate.Educations.FirstOrDefault().GPA.ToString(), - Institute = candidate.Educations.FirstOrDefault() == null ? null : candidate.Educations.FirstOrDefault().University, - Degree = candidate.Educations.FirstOrDefault() == null ? null : candidate.Educations.FirstOrDefault().Degree, - // Country = education.Name, - // Duration = education.Name, - // Other = education.Name, - // FundName = education.Name, - // DurationYear = education.Name, - FinishDate = candidate.Educations.FirstOrDefault() == null ? null : candidate.Educations.FirstOrDefault().BachelorDate, + EducationLevelId = _contextOrg.educationLevel.FirstOrDefault(x => x.name == (candidate!.Educations!.FirstOrDefault()!.HighDegree ?? ""))?.Id ?? null, + EducationLevelName = _contextOrg.educationLevel.FirstOrDefault(x => x.name == (candidate!.Educations!.FirstOrDefault()!.HighDegree ?? ""))?.name ?? null, + Field = candidate?.Educations?.FirstOrDefault()?.Major ?? null, + Gpa = candidate?.Educations?.FirstOrDefault()?.GPA!.ToString() ?? null, + Institute = candidate?.Educations?.FirstOrDefault()?.University ?? null, + Degree = candidate?.Educations?.FirstOrDefault()?.Degree ?? null, + FinishDate = candidate?.Educations?.FirstOrDefault()?.BachelorDate ?? null, IsDate = true, - // StartDate = education.DurationStart, - // EndDate = education.DurationEnd, CreatedAt = DateTime.Now, CreatedUserId = UserId ?? "", LastUpdatedAt = DateTime.Now, @@ -2508,11 +2401,10 @@ namespace BMA.EHR.Recurit.Exam.Service.Services var placementCertificate = new PlacementCertificate { PlacementProfile = placementProfile, - CertificateNo = candidate.Certificates.FirstOrDefault() == null ? null : candidate.Certificates.FirstOrDefault().CertificateNo, - // Issuer = candidate.Certificates.FirstOrDefault() == null ? null : candidate.Certificates.FirstOrDefault().Issuer, - IssueDate = candidate.Certificates.FirstOrDefault() == null ? null : candidate.Certificates.FirstOrDefault().IssueDate, - ExpireDate = candidate.Certificates.FirstOrDefault() == null ? null : candidate.Certificates.FirstOrDefault().ExpiredDate, - CertificateType = candidate.Certificates.FirstOrDefault() == null ? null : candidate.Certificates.FirstOrDefault().Description, + CertificateNo = candidate?.Certificates?.FirstOrDefault()?.CertificateNo ?? null, + IssueDate = candidate?.Certificates?.FirstOrDefault()?.IssueDate ?? null, + ExpireDate = candidate?.Certificates?.FirstOrDefault()?.ExpiredDate ?? null, + CertificateType = candidate?.Certificates?.FirstOrDefault()?.Description ?? null, CreatedAt = DateTime.Now, CreatedUserId = UserId ?? "", LastUpdatedAt = DateTime.Now, diff --git a/appsettings.Development.json b/appsettings.Development.json index ca2a5f8..96572ba 100644 --- a/appsettings.Development.json +++ b/appsettings.Development.json @@ -13,16 +13,17 @@ }, "AllowedHosts": "*", "ConnectionStrings": { - "DefaultConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", - "ExamConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms_exam;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", - "LeaveConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms_leave;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", - "DisciplineConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms_discipline;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", - "RecruitConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms_recruit;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", - "HistoryConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms_history;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;" + "DefaultConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", + "ExamConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_exam_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", + "LeaveConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_leave_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", + "DisciplineConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_discipline_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", + "RecruitConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_recruit_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", + "OrgConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_organization_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", + "HistoryConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_history_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;" }, "Jwt": { - "Key": "j7C9RO_p4nRtuwCH4z9Db_A_6We42tkD_p4lZtDrezc", - "Issuer": "https://hrms-id.chin.in.th/realms/hrms" + "Key": "HP-FnQMUj9msHMSD3T9HtdEnphAKoCJLEl85CIqROFI", + "Issuer": "https://id.frappet.synology.me/realms/bma-ehr" }, "EPPlus": { "ExcelPackage": { @@ -30,10 +31,10 @@ } }, "MinIO": { - "Endpoint": "https://hrms-s3.chin.in.th/", - "AccessKey": "QtXsmeR4mBqOO5RFisKo", - "SecretKey": "Fdu7UDCr9Js7iP9SFMT44GjcldD3Ud0SU32PvCOA", - "BucketName": "hrms-fpt" + "Endpoint": "http://127.0.0.1:9000", + "AccessKey": "ZQOGEjHxDesiVIHR", + "SecretKey": "vKTpcxY0Wjjp775aDwNn1q6VWJu8EFb6", + "BucketName": "bma-recruit" }, "Protocol": "HTTPS", "KeycloakCron": { @@ -75,8 +76,8 @@ } ] }, - "APIPROBATION": "https://hrms.chin.in.th/api/v1/probation", - "API": "https://hrms.chin.in.th/api/v1", - "APIV2": "https://hrms.chin.in.th/api/v2", + "APIPROBATION": "https://bma-ehr.frappet.synology.me/api/v1/probation", + "API": "https://bma-ehr.frappet.synology.me/api/v1", + "APIV2": "https://bma-ehr.frappet.synology.me/api/v2", "API_KEY": "fKRL16yyEgbyTEJdsMw2h64tGSCmkW685PRtM3CygzX1JOSdptT9UJtpgWwKM8FybRTJups3GTFwj27ZRvlPdIkv3XgCoVJaD5LmR06ozuEPvCCRSdp2WFthg08V5xHc56fTPfZLpr1VmXrhd6dvYhHIqKkQUJR02Rlkss11cLRWEQOssEFVA4xdu2J5DIRO1EM5m7wRRvEwcDB4mYRXD9HH52SMq6iYqUWEWsMwLdbk7QW9yYESUEuzMW5gWrb6vIeWZxJV5bTz1PcWUyR7eO9Fyw1F5DiQYc9JgzTC1mW7cv31fEtTtrfbJYKIb5EbWilqIEUKC6A0UKBDDek35ML0006cqRVm0pvdOH6jeq7VQyYrhdXe59dBEyhYGUIfozoVBvW7Up4QBuOMjyPjSqJPlMBKwaseptfrblxQV1AOOivSBpf1ZcQyOZ8JktRtKUDSuXsmG0lsXwFlI3JCeSHdpVdgZWFYcJPegqfrB6KotR02t9AVkpLs1ZWrixwz" } \ No newline at end of file diff --git a/appsettings.json b/appsettings.json index ca2a5f8..84e115d 100644 --- a/appsettings.json +++ b/appsettings.json @@ -13,16 +13,17 @@ }, "AllowedHosts": "*", "ConnectionStrings": { - "DefaultConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", - "ExamConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms_exam;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", - "LeaveConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms_leave;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", - "DisciplineConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms_discipline;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", - "RecruitConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms_recruit;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", - "HistoryConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms_history;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;" + "DefaultConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database==bma_ehr_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", + "ExamConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database==bma_ehr_exam_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", + "LeaveConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database==bma_ehr_leave_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", + "DisciplineConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database==bma_ehr_discipline_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", + "RecruitConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database==bma_ehr_recruit_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", + "OrgConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_organization_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", + "HistoryConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database==bma_ehr_history_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;" }, "Jwt": { - "Key": "j7C9RO_p4nRtuwCH4z9Db_A_6We42tkD_p4lZtDrezc", - "Issuer": "https://hrms-id.chin.in.th/realms/hrms" + "Key": "HP-FnQMUj9msHMSD3T9HtdEnphAKoCJLEl85CIqROFI", + "Issuer": "https://id.frappet.synology.me/realms/bma-ehr" }, "EPPlus": { "ExcelPackage": { @@ -30,10 +31,10 @@ } }, "MinIO": { - "Endpoint": "https://hrms-s3.chin.in.th/", - "AccessKey": "QtXsmeR4mBqOO5RFisKo", - "SecretKey": "Fdu7UDCr9Js7iP9SFMT44GjcldD3Ud0SU32PvCOA", - "BucketName": "hrms-fpt" + "Endpoint": "http://127.0.0.1:9000", + "AccessKey": "ZQOGEjHxDesiVIHR", + "SecretKey": "vKTpcxY0Wjjp775aDwNn1q6VWJu8EFb6", + "BucketName": "bma-recruit" }, "Protocol": "HTTPS", "KeycloakCron": { @@ -75,8 +76,8 @@ } ] }, - "APIPROBATION": "https://hrms.chin.in.th/api/v1/probation", - "API": "https://hrms.chin.in.th/api/v1", - "APIV2": "https://hrms.chin.in.th/api/v2", + "APIPROBATION": "https://bma-ehr.frappet.synology.me/api/v1/probation", + "API": "https://bma-ehr.frappet.synology.me/api/v1", + "APIV2": "https://bma-ehr.frappet.synology.me/api/v2", "API_KEY": "fKRL16yyEgbyTEJdsMw2h64tGSCmkW685PRtM3CygzX1JOSdptT9UJtpgWwKM8FybRTJups3GTFwj27ZRvlPdIkv3XgCoVJaD5LmR06ozuEPvCCRSdp2WFthg08V5xHc56fTPfZLpr1VmXrhd6dvYhHIqKkQUJR02Rlkss11cLRWEQOssEFVA4xdu2J5DIRO1EM5m7wRRvEwcDB4mYRXD9HH52SMq6iYqUWEWsMwLdbk7QW9yYESUEuzMW5gWrb6vIeWZxJV5bTz1PcWUyR7eO9Fyw1F5DiQYc9JgzTC1mW7cv31fEtTtrfbJYKIb5EbWilqIEUKC6A0UKBDDek35ML0006cqRVm0pvdOH6jeq7VQyYrhdXe59dBEyhYGUIfozoVBvW7Up4QBuOMjyPjSqJPlMBKwaseptfrblxQV1AOOivSBpf1ZcQyOZ8JktRtKUDSuXsmG0lsXwFlI3JCeSHdpVdgZWFYcJPegqfrB6KotR02t9AVkpLs1ZWrixwz" } \ No newline at end of file diff --git a/bin/Debug/net7.0/appsettings.Development.json b/bin/Debug/net7.0/appsettings.Development.json index ca2a5f8..96572ba 100644 --- a/bin/Debug/net7.0/appsettings.Development.json +++ b/bin/Debug/net7.0/appsettings.Development.json @@ -13,16 +13,17 @@ }, "AllowedHosts": "*", "ConnectionStrings": { - "DefaultConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", - "ExamConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms_exam;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", - "LeaveConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms_leave;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", - "DisciplineConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms_discipline;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", - "RecruitConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms_recruit;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", - "HistoryConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms_history;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;" + "DefaultConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", + "ExamConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_exam_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", + "LeaveConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_leave_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", + "DisciplineConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_discipline_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", + "RecruitConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_recruit_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", + "OrgConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_organization_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", + "HistoryConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_history_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;" }, "Jwt": { - "Key": "j7C9RO_p4nRtuwCH4z9Db_A_6We42tkD_p4lZtDrezc", - "Issuer": "https://hrms-id.chin.in.th/realms/hrms" + "Key": "HP-FnQMUj9msHMSD3T9HtdEnphAKoCJLEl85CIqROFI", + "Issuer": "https://id.frappet.synology.me/realms/bma-ehr" }, "EPPlus": { "ExcelPackage": { @@ -30,10 +31,10 @@ } }, "MinIO": { - "Endpoint": "https://hrms-s3.chin.in.th/", - "AccessKey": "QtXsmeR4mBqOO5RFisKo", - "SecretKey": "Fdu7UDCr9Js7iP9SFMT44GjcldD3Ud0SU32PvCOA", - "BucketName": "hrms-fpt" + "Endpoint": "http://127.0.0.1:9000", + "AccessKey": "ZQOGEjHxDesiVIHR", + "SecretKey": "vKTpcxY0Wjjp775aDwNn1q6VWJu8EFb6", + "BucketName": "bma-recruit" }, "Protocol": "HTTPS", "KeycloakCron": { @@ -75,8 +76,8 @@ } ] }, - "APIPROBATION": "https://hrms.chin.in.th/api/v1/probation", - "API": "https://hrms.chin.in.th/api/v1", - "APIV2": "https://hrms.chin.in.th/api/v2", + "APIPROBATION": "https://bma-ehr.frappet.synology.me/api/v1/probation", + "API": "https://bma-ehr.frappet.synology.me/api/v1", + "APIV2": "https://bma-ehr.frappet.synology.me/api/v2", "API_KEY": "fKRL16yyEgbyTEJdsMw2h64tGSCmkW685PRtM3CygzX1JOSdptT9UJtpgWwKM8FybRTJups3GTFwj27ZRvlPdIkv3XgCoVJaD5LmR06ozuEPvCCRSdp2WFthg08V5xHc56fTPfZLpr1VmXrhd6dvYhHIqKkQUJR02Rlkss11cLRWEQOssEFVA4xdu2J5DIRO1EM5m7wRRvEwcDB4mYRXD9HH52SMq6iYqUWEWsMwLdbk7QW9yYESUEuzMW5gWrb6vIeWZxJV5bTz1PcWUyR7eO9Fyw1F5DiQYc9JgzTC1mW7cv31fEtTtrfbJYKIb5EbWilqIEUKC6A0UKBDDek35ML0006cqRVm0pvdOH6jeq7VQyYrhdXe59dBEyhYGUIfozoVBvW7Up4QBuOMjyPjSqJPlMBKwaseptfrblxQV1AOOivSBpf1ZcQyOZ8JktRtKUDSuXsmG0lsXwFlI3JCeSHdpVdgZWFYcJPegqfrB6KotR02t9AVkpLs1ZWrixwz" } \ No newline at end of file diff --git a/bin/Debug/net7.0/appsettings.json b/bin/Debug/net7.0/appsettings.json index ca2a5f8..84e115d 100644 --- a/bin/Debug/net7.0/appsettings.json +++ b/bin/Debug/net7.0/appsettings.json @@ -13,16 +13,17 @@ }, "AllowedHosts": "*", "ConnectionStrings": { - "DefaultConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", - "ExamConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms_exam;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", - "LeaveConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms_leave;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", - "DisciplineConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms_discipline;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", - "RecruitConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms_recruit;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", - "HistoryConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms_history;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;" + "DefaultConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database==bma_ehr_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", + "ExamConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database==bma_ehr_exam_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", + "LeaveConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database==bma_ehr_leave_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", + "DisciplineConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database==bma_ehr_discipline_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", + "RecruitConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database==bma_ehr_recruit_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", + "OrgConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_organization_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", + "HistoryConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database==bma_ehr_history_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;" }, "Jwt": { - "Key": "j7C9RO_p4nRtuwCH4z9Db_A_6We42tkD_p4lZtDrezc", - "Issuer": "https://hrms-id.chin.in.th/realms/hrms" + "Key": "HP-FnQMUj9msHMSD3T9HtdEnphAKoCJLEl85CIqROFI", + "Issuer": "https://id.frappet.synology.me/realms/bma-ehr" }, "EPPlus": { "ExcelPackage": { @@ -30,10 +31,10 @@ } }, "MinIO": { - "Endpoint": "https://hrms-s3.chin.in.th/", - "AccessKey": "QtXsmeR4mBqOO5RFisKo", - "SecretKey": "Fdu7UDCr9Js7iP9SFMT44GjcldD3Ud0SU32PvCOA", - "BucketName": "hrms-fpt" + "Endpoint": "http://127.0.0.1:9000", + "AccessKey": "ZQOGEjHxDesiVIHR", + "SecretKey": "vKTpcxY0Wjjp775aDwNn1q6VWJu8EFb6", + "BucketName": "bma-recruit" }, "Protocol": "HTTPS", "KeycloakCron": { @@ -75,8 +76,8 @@ } ] }, - "APIPROBATION": "https://hrms.chin.in.th/api/v1/probation", - "API": "https://hrms.chin.in.th/api/v1", - "APIV2": "https://hrms.chin.in.th/api/v2", + "APIPROBATION": "https://bma-ehr.frappet.synology.me/api/v1/probation", + "API": "https://bma-ehr.frappet.synology.me/api/v1", + "APIV2": "https://bma-ehr.frappet.synology.me/api/v2", "API_KEY": "fKRL16yyEgbyTEJdsMw2h64tGSCmkW685PRtM3CygzX1JOSdptT9UJtpgWwKM8FybRTJups3GTFwj27ZRvlPdIkv3XgCoVJaD5LmR06ozuEPvCCRSdp2WFthg08V5xHc56fTPfZLpr1VmXrhd6dvYhHIqKkQUJR02Rlkss11cLRWEQOssEFVA4xdu2J5DIRO1EM5m7wRRvEwcDB4mYRXD9HH52SMq6iYqUWEWsMwLdbk7QW9yYESUEuzMW5gWrb6vIeWZxJV5bTz1PcWUyR7eO9Fyw1F5DiQYc9JgzTC1mW7cv31fEtTtrfbJYKIb5EbWilqIEUKC6A0UKBDDek35ML0006cqRVm0pvdOH6jeq7VQyYrhdXe59dBEyhYGUIfozoVBvW7Up4QBuOMjyPjSqJPlMBKwaseptfrblxQV1AOOivSBpf1ZcQyOZ8JktRtKUDSuXsmG0lsXwFlI3JCeSHdpVdgZWFYcJPegqfrB6KotR02t9AVkpLs1ZWrixwz" } \ No newline at end of file