diff --git a/Controllers/CandidateController.cs b/Controllers/CandidateController.cs
new file mode 100644
index 0000000..40b8b3d
--- /dev/null
+++ b/Controllers/CandidateController.cs
@@ -0,0 +1,454 @@
+using BMA.EHR.Recurit.Exam.Service.Response;
+using BMA.EHR.Recurit.Exam.Service.Services;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Mvc;
+using Swashbuckle.AspNetCore.Annotations;
+
+namespace BMA.EHR.Recurit.Exam.Service.Controllers
+{
+ [Route("api/v{version:apiVersion}/candidate")]
+ [ApiVersion("1.0")]
+ [ApiController]
+ [Produces("application/json")]
+ [Authorize]
+ [SwaggerTag("จัดการข้อมูลศาสนา เพื่อนำไปใช้งานในระบบ")]
+ public class CandidateController : BaseController
+ {
+ #region " Fields "
+
+ private readonly CandidateService _candidateService;
+
+ #endregion
+
+ #region " Constructor and Destructor "
+
+ public CandidateController(CandidateService candidateService)
+ {
+ _candidateService = candidateService;
+ }
+
+ #endregion
+
+ #region " Methods "
+
+ ///
+ /// ข้อมูล ข้อมูลส่วนตัว ผู้สมัคร
+ ///
+ /// รหัสการสมัคร
+ ///
+ /// เมื่อทำการดึง ข้อมูล ข้อมูลส่วนตัว ผู้สมัคร สำเร็จ
+ /// ไม่ได้ Login เข้าระบบ
+ /// เมื่อเกิดข้อผิดพลาดในการทำงาน
+ [HttpGet("information/{examId:length(36)}")]
+ [ProducesResponseType(StatusCodes.Status200OK)]
+ [ProducesResponseType(StatusCodes.Status401Unauthorized)]
+ [ProducesResponseType(StatusCodes.Status500InternalServerError)]
+ public async Task> GetsAsyncInformation(string examId)
+ {
+ try
+ {
+ var items = await _candidateService.GetsAsyncInformation(examId);
+
+ return Success(items);
+ }
+ catch (Exception ex)
+ {
+ return Error(ex);
+ }
+ }
+
+ ///
+ /// ข้อมูล ข้อมูลที่อยู่ ผู้สมัคร
+ ///
+ /// รหัสการสมัคร
+ ///
+ /// เมื่อทำการดึง ข้อมูล ข้อมูลที่อยู่ ผู้สมัคร สำเร็จ
+ /// ไม่ได้ Login เข้าระบบ
+ /// เมื่อเกิดข้อผิดพลาดในการทำงาน
+ [HttpGet("address/{examId:length(36)}")]
+ [ProducesResponseType(StatusCodes.Status200OK)]
+ [ProducesResponseType(StatusCodes.Status401Unauthorized)]
+ [ProducesResponseType(StatusCodes.Status500InternalServerError)]
+ public async Task> GetsAsyncAddress(string examId)
+ {
+ try
+ {
+ var items = await _candidateService.GetsAsyncAddress(examId);
+
+ return Success(items);
+ }
+ catch (Exception ex)
+ {
+ return Error(ex);
+ }
+ }
+
+ ///
+ /// ข้อมูล ข้อมูลครอบครัว ผู้สมัคร
+ ///
+ /// รหัสการสมัคร
+ ///
+ /// เมื่อทำการดึง ข้อมูล ข้อมูลครอบครัว ผู้สมัคร สำเร็จ
+ /// ไม่ได้ Login เข้าระบบ
+ /// เมื่อเกิดข้อผิดพลาดในการทำงาน
+ [HttpGet("family/{examId:length(36)}")]
+ [ProducesResponseType(StatusCodes.Status200OK)]
+ [ProducesResponseType(StatusCodes.Status401Unauthorized)]
+ [ProducesResponseType(StatusCodes.Status500InternalServerError)]
+ public async Task> GetsAsyncFamily(string examId)
+ {
+ try
+ {
+ var items = await _candidateService.GetsAsyncFamily(examId);
+
+ return Success(items);
+ }
+ catch (Exception ex)
+ {
+ return Error(ex);
+ }
+ }
+
+ ///
+ /// ข้อมูล อาชีพ ผู้สมัคร
+ ///
+ /// รหัสการสมัคร
+ ///
+ /// เมื่อทำการดึง ข้อมูล อาชีพ ผู้สมัคร สำเร็จ
+ /// ไม่ได้ Login เข้าระบบ
+ /// เมื่อเกิดข้อผิดพลาดในการทำงาน
+ [HttpGet("occupation/{examId:length(36)}")]
+ [ProducesResponseType(StatusCodes.Status200OK)]
+ [ProducesResponseType(StatusCodes.Status401Unauthorized)]
+ [ProducesResponseType(StatusCodes.Status500InternalServerError)]
+ public async Task> GetsAsyncOccupation(string examId)
+ {
+ try
+ {
+ var items = await _candidateService.GetsAsyncOccupation(examId);
+
+ return Success(items);
+ }
+ catch (Exception ex)
+ {
+ return Error(ex);
+ }
+ }
+
+ ///
+ /// ข้อมูล ประวัติการทำงาน/ฝึกงาน ผู้สมัคร
+ ///
+ /// รหัสการสมัคร
+ ///
+ /// เมื่อทำการดึง ข้อมูล ประวัติการทำงาน/ฝึกงาน ผู้สมัคร สำเร็จ
+ /// ไม่ได้ Login เข้าระบบ
+ /// เมื่อเกิดข้อผิดพลาดในการทำงาน
+ [HttpGet("career/{examId:length(36)}")]
+ [ProducesResponseType(StatusCodes.Status200OK)]
+ [ProducesResponseType(StatusCodes.Status401Unauthorized)]
+ [ProducesResponseType(StatusCodes.Status500InternalServerError)]
+ public async Task> GetsAsyncCareer(string examId)
+ {
+ try
+ {
+ var items = await _candidateService.GetsAsyncCareer(examId);
+
+ return Success(items);
+ }
+ catch (Exception ex)
+ {
+ return Error(ex);
+ }
+ }
+
+ ///
+ /// ข้อมูล ประวัติการศีกษา ผู้สมัคร
+ ///
+ /// รหัสการสมัคร
+ ///
+ /// เมื่อทำการดึง ข้อมูล ประวัติการศีกษา ผู้สมัคร สำเร็จ
+ /// ไม่ได้ Login เข้าระบบ
+ /// เมื่อเกิดข้อผิดพลาดในการทำงาน
+ [HttpGet("education/{examId:length(36)}")]
+ [ProducesResponseType(StatusCodes.Status200OK)]
+ [ProducesResponseType(StatusCodes.Status401Unauthorized)]
+ [ProducesResponseType(StatusCodes.Status500InternalServerError)]
+ public async Task> GetsAsyncEducation(string examId)
+ {
+ try
+ {
+ var items = await _candidateService.GetsAsyncEducation(examId);
+
+ return Success(items);
+ }
+ catch (Exception ex)
+ {
+ return Error(ex);
+ }
+ }
+
+ ///
+ /// ตรวจสอบว่าผู้ใช้งานสมัครสอบหรือยัง
+ ///
+ /// รหัสการสมัคร
+ ///
+ /// เมื่อทำการตรวจสอบว่าผู้ใช้งานสมัครสอบหรือยัง สำเร็จ
+ /// ไม่ได้ Login เข้าระบบ
+ /// เมื่อเกิดข้อผิดพลาดในการทำงาน
+ [HttpGet("check/{examId:length(36)}")]
+ [ProducesResponseType(StatusCodes.Status200OK)]
+ [ProducesResponseType(StatusCodes.Status401Unauthorized)]
+ [ProducesResponseType(StatusCodes.Status500InternalServerError)]
+ public async Task> GetsAsyncRegisterExam(string examId)
+ {
+ try
+ {
+ var items = await _candidateService.GetsAsyncRegisterExam(examId);
+
+ return Success(items);
+ }
+ catch (Exception ex)
+ {
+ return Error(ex);
+ }
+ }
+
+ ///
+ /// อัพเดทข้อมูล ข้อมูลส่วนตัว ผู้สมัคร
+ ///
+ /// ข้อมูลส่วนตัว
+ ///
+ /// เมื่อทำการอัพเดทข้อมูล ข้อมูลส่วนตัว ผู้สมัคร สำเร็จ
+ /// ไม่ได้ Login เข้าระบบ
+ /// เมื่อเกิดข้อผิดพลาดในการทำงาน
+ [HttpPost("information/{examId:length(36)}")]
+ [ProducesResponseType(StatusCodes.Status200OK)]
+ [ProducesResponseType(StatusCodes.Status401Unauthorized)]
+ [ProducesResponseType(StatusCodes.Status500InternalServerError)]
+ public async Task> UpdateAsyncInformation(string examId, CandidateInformationResponseItem candidateInformation)
+ {
+ try
+ {
+ await _candidateService.UpdateAsyncInformation(examId, candidateInformation);
+
+ return Success();
+ }
+ catch (Exception ex)
+ {
+ return Error(ex);
+ }
+ }
+
+ ///
+ /// อัพเดทข้อมูล ข้อมูลที่อยู่ ผู้สมัคร
+ ///
+ /// ข้อมูลที่อยู่
+ ///
+ /// เมื่อทำการอัพเดทข้อมูล ข้อมูลที่อยู่ ผู้สมัคร สำเร็จ
+ /// ไม่ได้ Login เข้าระบบ
+ /// เมื่อเกิดข้อผิดพลาดในการทำงาน
+ [HttpPost("address/{examId:length(36)}")]
+ [ProducesResponseType(StatusCodes.Status200OK)]
+ [ProducesResponseType(StatusCodes.Status401Unauthorized)]
+ [ProducesResponseType(StatusCodes.Status500InternalServerError)]
+ public async Task> UpdateAsyncAddress(string examId, CandidateAddressResponseItem candidateAddress)
+ {
+ try
+ {
+ await _candidateService.UpdateAsyncAddress(examId, candidateAddress);
+
+ return Success();
+ }
+ catch (Exception ex)
+ {
+ return Error(ex);
+ }
+ }
+
+ ///
+ /// อัพเดทข้อมูล ข้อมูลครอบครัว ผู้สมัคร
+ ///
+ /// ข้อมูลครอบครัว
+ ///
+ /// เมื่อทำการอัพเดทข้อมูล ข้อมูลครอบครัว ผู้สมัคร สำเร็จ
+ /// ไม่ได้ Login เข้าระบบ
+ /// เมื่อเกิดข้อผิดพลาดในการทำงาน
+ [HttpPost("family/{examId:length(36)}")]
+ [ProducesResponseType(StatusCodes.Status200OK)]
+ [ProducesResponseType(StatusCodes.Status401Unauthorized)]
+ [ProducesResponseType(StatusCodes.Status500InternalServerError)]
+ public async Task> UpdateAsyncFamily(string examId, CandidateFamilyResponseItem candidateFamily)
+ {
+ try
+ {
+ await _candidateService.UpdateAsyncFamily(examId, candidateFamily);
+
+ return Success();
+ }
+ catch (Exception ex)
+ {
+ return Error(ex);
+ }
+ }
+
+ ///
+ /// อัพเดทข้อมูล อาชีพ ผู้สมัคร
+ ///
+ /// อาชีพ
+ ///
+ /// เมื่อทำการอัพเดทข้อมูล อาชีพ ผู้สมัคร สำเร็จ
+ /// ไม่ได้ Login เข้าระบบ
+ /// เมื่อเกิดข้อผิดพลาดในการทำงาน
+ [HttpPost("occupation/{examId:length(36)}")]
+ [ProducesResponseType(StatusCodes.Status200OK)]
+ [ProducesResponseType(StatusCodes.Status401Unauthorized)]
+ [ProducesResponseType(StatusCodes.Status500InternalServerError)]
+ public async Task> UpdateAsyncOccupation(string examId, CandidateOccupationResponseItem candidateOccupation)
+ {
+ try
+ {
+ await _candidateService.UpdateAsyncOccupation(examId, candidateOccupation);
+
+ return Success();
+ }
+ catch (Exception ex)
+ {
+ return Error(ex);
+ }
+ }
+
+ ///
+ /// สร้างข้อมูล ประวัติการทำงาน/ฝึกงาน ผู้สมัคร
+ ///
+ /// ข้อมูลประวัติการทำงาน/ฝึกงาน
+ ///
+ /// เมื่อทำการสร้างข้อมูล ประวัติการทำงาน/ฝึกงาน ผู้สมัคร สำเร็จ
+ /// ไม่ได้ Login เข้าระบบ
+ /// เมื่อเกิดข้อผิดพลาดในการทำงาน
+ [HttpPost("career/{examId:length(36)}")]
+ [ProducesResponseType(StatusCodes.Status200OK)]
+ [ProducesResponseType(StatusCodes.Status401Unauthorized)]
+ [ProducesResponseType(StatusCodes.Status500InternalServerError)]
+ public async Task> CreateAsyncCareer(string examId, CandidateCareerResponseItem candidateCareer)
+ {
+ try
+ {
+ await _candidateService.CreateAsyncCareer(examId, candidateCareer);
+
+ return Success();
+ }
+ catch (Exception ex)
+ {
+ return Error(ex);
+ }
+ }
+
+ ///
+ /// สร้างข้อมูล ประวัติการศีกษา ผู้สมัคร
+ ///
+ /// ข้อมูลประวัติการศีกษา
+ ///
+ /// เมื่อทำการสร้างข้อมูล ประวัติการศีกษา ผู้สมัคร สำเร็จ
+ /// ไม่ได้ Login เข้าระบบ
+ /// เมื่อเกิดข้อผิดพลาดในการทำงาน
+ [HttpPost("education/{examId:length(36)}")]
+ [ProducesResponseType(StatusCodes.Status200OK)]
+ [ProducesResponseType(StatusCodes.Status401Unauthorized)]
+ [ProducesResponseType(StatusCodes.Status500InternalServerError)]
+ public async Task> CreateAsyncEducation(string examId, CandidateEducationResponseItem candidateEducation)
+ {
+ try
+ {
+ await _candidateService.CreateAsyncEducation(examId, candidateEducation);
+
+ return Success();
+ }
+ catch (Exception ex)
+ {
+ return Error(ex);
+ }
+ }
+
+ ///
+ /// อัพเดทข้อมูล ประวัติการทำงาน/ฝึกงาน ผู้สมัคร
+ ///
+ /// รหัสประวัติการทำงาน/ฝึกงาน
+ /// ข้อมูลประวัติการทำงาน/ฝึกงาน
+ ///
+ /// เมื่อทำการอัพเดทข้อมูล ประวัติการทำงาน/ฝึกงาน ผู้สมัคร สำเร็จ
+ /// ไม่ได้ Login เข้าระบบ
+ /// เมื่อเกิดข้อผิดพลาดในการทำงาน
+ [HttpPut("career/{careerId:length(36)}")]
+ [ProducesResponseType(StatusCodes.Status200OK)]
+ [ProducesResponseType(StatusCodes.Status401Unauthorized)]
+ [ProducesResponseType(StatusCodes.Status500InternalServerError)]
+ public async Task> UpdateAsyncCareer(string careerId, CandidateCareerResponseItem candidateCareer)
+ {
+ try
+ {
+ await _candidateService.UpdateAsyncCareer(careerId, candidateCareer);
+
+ return Success();
+ }
+ catch (Exception ex)
+ {
+ return Error(ex);
+ }
+ }
+
+ ///
+ /// อัพเดทข้อมูล ประวัติการศีกษา ผู้สมัคร
+ ///
+ /// รหัสประวัติการศีกษา
+ /// ข้อมูลประวัติการศีกษา
+ ///
+ /// เมื่อทำการอัพเดทข้อมูล ประวัติการศีกษา ผู้สมัคร สำเร็จ
+ /// ไม่ได้ Login เข้าระบบ
+ /// เมื่อเกิดข้อผิดพลาดในการทำงาน
+ [HttpPut("career/{educationId:length(36)}")]
+ [ProducesResponseType(StatusCodes.Status200OK)]
+ [ProducesResponseType(StatusCodes.Status401Unauthorized)]
+ [ProducesResponseType(StatusCodes.Status500InternalServerError)]
+ public async Task> UpdateAsyncEducation(string educationId, CandidateEducationResponseItem candidateEducation)
+ {
+ try
+ {
+ await _candidateService.UpdateAsyncEducation(educationId, candidateEducation);
+
+ return Success();
+ }
+ catch (Exception ex)
+ {
+ return Error(ex);
+ }
+ }
+
+ ///
+ /// ผู้สมัครทำการสมัครสอบ
+ ///
+ /// รหัสการสมัคร
+ ///
+ /// เมื่อทำการผู้สมัครทำการสมัครสอบ สำเร็จ
+ /// ไม่ได้ Login เข้าระบบ
+ /// เมื่อเกิดข้อผิดพลาดในการทำงาน
+ [HttpGet("register/{examId:length(36)}")]
+ [ProducesResponseType(StatusCodes.Status200OK)]
+ [ProducesResponseType(StatusCodes.Status401Unauthorized)]
+ [ProducesResponseType(StatusCodes.Status500InternalServerError)]
+ public async Task> RegisterCandidateService(string examId)
+ {
+ try
+ {
+ await _candidateService.RegisterCandidateService(examId);
+
+ return Success();
+ }
+ catch (Exception ex)
+ {
+ return Error(ex);
+ }
+ }
+
+ #endregion
+ }
+}
diff --git a/Controllers/EducationLevelController.cs b/Controllers/EducationLevelController.cs
index 53ff658..e8c0765 100644
--- a/Controllers/EducationLevelController.cs
+++ b/Controllers/EducationLevelController.cs
@@ -2,6 +2,7 @@
using BMA.EHR.Recurit.Exam.Service.Services;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
+using Swashbuckle.AspNetCore.Annotations;
namespace BMA.EHR.Recurit.Exam.Service.Controllers
{
@@ -10,6 +11,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
[ApiController]
[Produces("application/json")]
[Authorize]
+ [SwaggerTag("จัดการข้อมูลระดับการศึกษา เพื่อนำไปใช้งานในระบบ")]
public class EducationLevelController : BaseController
{
#region " Fields "
diff --git a/Controllers/PrefixController.cs b/Controllers/PrefixController.cs
index a58568f..bbea613 100644
--- a/Controllers/PrefixController.cs
+++ b/Controllers/PrefixController.cs
@@ -2,6 +2,7 @@ using BMA.EHR.Recurit.Exam.Service.Response;
using BMA.EHR.Recurit.Exam.Service.Services;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
+using Swashbuckle.AspNetCore.Annotations;
namespace BMA.EHR.Recurit.Exam.Service.Controllers
{
@@ -10,6 +11,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
[ApiController]
[Produces("application/json")]
[Authorize]
+ [SwaggerTag("จัดการข้อมูลคำนำหน้า เพื่อนำไปใช้งานในระบบ")]
public class PrefixController : BaseController
{
#region " Fields "
diff --git a/Controllers/RelationshipController.cs b/Controllers/RelationshipController.cs
index 9ede7f0..7810a27 100644
--- a/Controllers/RelationshipController.cs
+++ b/Controllers/RelationshipController.cs
@@ -2,7 +2,7 @@
using BMA.EHR.Recurit.Exam.Service.Services;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
-
+using Swashbuckle.AspNetCore.Annotations;
namespace BMA.EHR.Recurit.Exam.Service.Controllers
{
@@ -11,6 +11,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
[ApiController]
[Produces("application/json")]
[Authorize]
+ [SwaggerTag("จัดการข้อมูลสถานะภาพ เพื่อนำไปใช้งานในระบบ")]
public class RelationshipController : BaseController
{
#region " Fields "
diff --git a/Controllers/ReligionController.cs b/Controllers/ReligionController.cs
index 7b03e4b..6ccfe4c 100644
--- a/Controllers/ReligionController.cs
+++ b/Controllers/ReligionController.cs
@@ -2,6 +2,7 @@
using BMA.EHR.Recurit.Exam.Service.Services;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
+using Swashbuckle.AspNetCore.Annotations;
namespace BMA.EHR.Recurit.Exam.Service.Controllers
{
@@ -10,6 +11,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
[ApiController]
[Produces("application/json")]
[Authorize]
+ [SwaggerTag("จัดการข้อมูลศาสนา เพื่อนำไปใช้งานในระบบ")]
public class ReligionController : BaseController
{
#region " Fields "
diff --git a/Core/GlobalMessages.cs b/Core/GlobalMessages.cs
new file mode 100644
index 0000000..62cdce7
--- /dev/null
+++ b/Core/GlobalMessages.cs
@@ -0,0 +1,19 @@
+namespace BMA.EHR.Recurit.Exam.Service.Core
+{
+ public class GlobalMessages
+ {
+ public const string DataExist = "มีข้อมูลดังกล่าวอยู่ในระบบแล้ว";
+ public const string NameDupicate = "ชื่อวันหยุดนี้มีอยู่ในระบบอยู่แล้ว";
+ public const string ExamNotFound = "ไม่พบข้อมูลการรับสมัครสอบ";
+ public const string CandidateNotFound = "ไม่พบข้อมูลผู้สมัครสอบ";
+ public const string CareerNotFound = "ไม่พบข้อมูลประวัติการทำงาน/ฝึกงาน";
+ public const string EducationNotFound = "ไม่พบข้อมูลประวัติการศีกษา";
+ public const string DistrictNotFound = "ไม่พบข้อมูลเขต/อำเภอ";
+ public const string EducationLevelNotFound = "ไม่พบข้อมูลวุฒิการศีกษา";
+ public const string PrefixNotFound = "ไม่พบข้อมูลคำนำหน้า";
+ public const string ProvinceNotFound = "ไม่พบข้อมูลจังหวัด";
+ public const string RelationshipNotFound = "ไม่พบข้อมูลสถานะภาพ";
+ public const string ReligionNotFound = "ไม่พบข้อมูลศาสนา";
+ public const string SubDistrictNotFound = "ไม่พบข้อมูลตำบล/แขวง";
+ }
+}
diff --git a/Core/HolidayHelper.cs b/Core/HolidayHelper.cs
new file mode 100644
index 0000000..d687a6b
--- /dev/null
+++ b/Core/HolidayHelper.cs
@@ -0,0 +1,39 @@
+namespace BMA.EHR.Recurit.Exam.Service.Core
+{
+ public static class HolidayHelper
+ {
+ public static bool IsHoliday(DateTime date, List holidays)
+ {
+ return holidays.Contains(date);
+ }
+
+ public static bool IsWeekend(DateTime date)
+ {
+ return date.DayOfWeek == DayOfWeek.Saturday
+ || date.DayOfWeek == DayOfWeek.Sunday;
+ }
+
+ public static bool IsWeekend6Days(DateTime date)
+ {
+ return date.DayOfWeek == DayOfWeek.Sunday;
+ }
+
+ public static DateTime GetNextWorkingDay(DateTime date, List holidays)
+ {
+ do
+ {
+ date = date.AddDays(1);
+ } while (IsHoliday(date, holidays) || IsWeekend(date));
+ return date;
+ }
+
+ public static DateTime GetNextWorkingDay6Days(DateTime date, List holidays)
+ {
+ do
+ {
+ date = date.AddDays(1);
+ } while (IsHoliday(date, holidays) || IsWeekend6Days(date));
+ return date;
+ }
+ }
+}
diff --git a/Data/ApplicationDbContext.cs b/Data/ApplicationDbContext.cs
index c1b033c..da67518 100644
--- a/Data/ApplicationDbContext.cs
+++ b/Data/ApplicationDbContext.cs
@@ -28,5 +28,13 @@ namespace BMA.EHR.Recurit.Exam.Service.Data
public DbSet SubDistricts { get; set; }
+ public DbSet PeriodExams { get; set; }
+
+ public DbSet Candidates { get; set; }
+
+ public DbSet Careers { get; set; }
+
+ public DbSet Educations { get; set; }
+
}
}
diff --git a/Data/Migrations/ApplicationDbContextModelSnapshot.cs b/Data/Migrations/ApplicationDbContextModelSnapshot.cs
index 1fc7238..a5ed1a0 100644
--- a/Data/Migrations/ApplicationDbContextModelSnapshot.cs
+++ b/Data/Migrations/ApplicationDbContextModelSnapshot.cs
@@ -19,6 +19,360 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
.HasAnnotation("ProductVersion", "7.0.4")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
+ 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)");
+
+ b.Property("CitizenId")
+ .HasMaxLength(20)
+ .HasColumnType("varchar(20)")
+ .HasComment("เลขประจำตัวประชาชน");
+
+ b.Property("CitizenProvinceId")
+ .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("CurrentAddress")
+ .HasColumnType("longtext")
+ .HasComment("ที่อยู่ปัจจุบัน");
+
+ b.Property("CurrentDistrictId")
+ .HasColumnType("char(36)");
+
+ b.Property("CurrentProvinceId")
+ .HasColumnType("char(36)");
+
+ b.Property("CurrentSubDistrictId")
+ .HasColumnType("char(36)");
+
+ 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("FatherFirstName")
+ .HasMaxLength(100)
+ .HasColumnType("varchar(100)")
+ .HasComment("ชื่อจริงบิดา");
+
+ b.Property("FatherLastName")
+ .HasMaxLength(100)
+ .HasColumnType("varchar(100)")
+ .HasComment("นามสกุลบิดา");
+
+ b.Property("FatherPrefixId")
+ .HasColumnType("char(36)");
+
+ b.Property("FirstName")
+ .HasMaxLength(100)
+ .HasColumnType("varchar(100)")
+ .HasColumnOrder(1)
+ .HasComment("ชื่อจริง");
+
+ b.Property("Knowledge")
+ .HasColumnType("longtext")
+ .HasComment("ความสามารถพิเศษ");
+
+ b.Property("LastName")
+ .HasMaxLength(100)
+ .HasColumnType("varchar(100)")
+ .HasColumnOrder(2)
+ .HasComment("นามสกุล");
+
+ b.Property("LastUpdateFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(105)
+ .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdateUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(103)
+ .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(102)
+ .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
+
+ b.Property("Marry")
+ .HasColumnType("tinyint(1)")
+ .HasComment("คู่สมรส");
+
+ b.Property("MarryFirstName")
+ .HasMaxLength(100)
+ .HasColumnType("varchar(100)")
+ .HasComment("ชื่อจริงคู่สมรส");
+
+ b.Property("MarryLastName")
+ .HasMaxLength(100)
+ .HasColumnType("varchar(100)")
+ .HasComment("นามสกุลคู่สมรส");
+
+ b.Property("MarryPrefixId")
+ .HasColumnType("char(36)");
+
+ 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("MotherPrefixId")
+ .HasColumnType("char(36)");
+
+ b.Property("Nationality")
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(3)
+ .HasComment("สัญชาติ");
+
+ b.Property("OccupationCompany")
+ .HasColumnType("longtext")
+ .HasComment("สำนัก/บริษัท บริษัท");
+
+ b.Property("OccupationDepartment")
+ .HasColumnType("longtext")
+ .HasComment("กอง/ฝ่าย บริษัท");
+
+ b.Property("OccupationEmail")
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasComment("อีเมล บริษัท");
+
+ b.Property("OccupationTelephone")
+ .HasMaxLength(20)
+ .HasColumnType("varchar(20)")
+ .HasComment("โทรศัพท์ บริษัท");
+
+ b.Property("OccupationType")
+ .HasColumnType("longtext")
+ .HasComment("ประเภทอาชีพที่ทำงานมาก่อน");
+
+ b.Property("PeriodExamId")
+ .HasColumnType("char(36)");
+
+ b.Property("PrefixId")
+ .HasColumnType("char(36)");
+
+ b.Property("RegistAddress")
+ .HasColumnType("longtext")
+ .HasComment("ที่อยู่ตามทะเบียนบ้าน");
+
+ b.Property("RegistDistrictId")
+ .HasColumnType("char(36)");
+
+ b.Property("RegistProvinceId")
+ .HasColumnType("char(36)");
+
+ b.Property("RegistSame")
+ .HasColumnType("tinyint(1)")
+ .HasComment("ที่อยู่ปัจจุบันเหมือนที่อยู่ตามทะเบียนบ้าน");
+
+ b.Property("RegistSubDistrictId")
+ .HasColumnType("char(36)");
+
+ b.Property("RegistZipCode")
+ .HasMaxLength(10)
+ .HasColumnType("varchar(10)")
+ .HasComment("รหัสไปรษณีย์ที่อยู่ตามทะเบียนบ้าน");
+
+ b.Property("RelationshipId")
+ .HasColumnType("char(36)");
+
+ b.Property("Telephone")
+ .HasMaxLength(20)
+ .HasColumnType("varchar(20)")
+ .HasComment("โทรศัพท์");
+
+ b.Property("UserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasComment("User Id ผู้สมัคร");
+
+ b.Property("status")
+ .IsRequired()
+ .HasMaxLength(20)
+ .HasColumnType("varchar(20)")
+ .HasComment("สถานะผู้สมัคร");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CitizenDistrictId");
+
+ b.HasIndex("CitizenProvinceId");
+
+ b.HasIndex("CurrentDistrictId");
+
+ b.HasIndex("CurrentProvinceId");
+
+ b.HasIndex("CurrentSubDistrictId");
+
+ b.HasIndex("FatherPrefixId");
+
+ b.HasIndex("MarryPrefixId");
+
+ b.HasIndex("MotherPrefixId");
+
+ b.HasIndex("PeriodExamId");
+
+ b.HasIndex("PrefixId");
+
+ b.HasIndex("RegistDistrictId");
+
+ b.HasIndex("RegistProvinceId");
+
+ b.HasIndex("RegistSubDistrictId");
+
+ b.HasIndex("RelationshipId");
+
+ b.ToTable("Candidates");
+ });
+
+ 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("LastUpdateFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(105)
+ .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdateUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(103)
+ .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(102)
+ .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasColumnOrder(3)
+ .HasComment("สถานที่ทำงาน/ฝึกงาน");
+
+ b.Property("Position")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasColumnOrder(4)
+ .HasComment("ตำแหน่ง/ลักษณะงาน");
+
+ b.Property("Reason")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasColumnOrder(6)
+ .HasComment("เหตุผลที่ออก");
+
+ b.Property("Salary")
+ .HasMaxLength(20)
+ .HasColumnType("int")
+ .HasColumnOrder(5)
+ .HasComment("เงินเดือนสุดท้ายก่อนออก");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CandidateId");
+
+ b.ToTable("Careers");
+ });
+
modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.District", b =>
{
b.Property("Id")
@@ -88,6 +442,96 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
b.ToTable("Districts");
});
+ modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Education", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("char(36)")
+ .HasColumnOrder(0)
+ .HasComment("PrimaryKey")
+ .HasAnnotation("Relational:JsonPropertyName", "id");
+
+ b.Property("CandidateId")
+ .HasColumnType("char(36)");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(100)
+ .HasComment("สร้างข้อมูลเมื่อ");
+
+ b.Property("CreatedFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(104)
+ .HasComment("ชื่อ User ที่สร้างข้อมูล");
+
+ b.Property("CreatedUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(101)
+ .HasComment("User Id ที่สร้างข้อมูล");
+
+ b.Property("DurationEnd")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(2)
+ .HasComment("ระยะเวลาสิ้นสุด");
+
+ b.Property("DurationStart")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(1)
+ .HasComment("ระยะเวลาเริ่ม");
+
+ b.Property("EducationLevelId")
+ .HasColumnType("char(36)");
+
+ b.Property("LastUpdateFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(105)
+ .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdateUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(103)
+ .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(102)
+ .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
+
+ b.Property("Major")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasColumnOrder(4)
+ .HasComment("สาขาวิชา/วิชาเอก");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasColumnOrder(3)
+ .HasComment("ชื่อสถานศึกษา");
+
+ b.Property("Scores")
+ .HasMaxLength(10)
+ .HasColumnType("int")
+ .HasColumnOrder(6)
+ .HasComment("คะแนนเฉลี่ยตลอดหลักสูตร");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CandidateId");
+
+ b.HasIndex("EducationLevelId");
+
+ b.ToTable("Educations");
+ });
+
modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.EducationLevel", b =>
{
b.Property("Id")
@@ -152,6 +596,86 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
b.ToTable("EducationLevels");
});
+ 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("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")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasColumnOrder(4)
+ .HasComment("รายละเอียดสมัครสอบ");
+
+ b.Property("EndDate")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(3)
+ .HasComment("วันสิ้นสุด");
+
+ b.Property("IsActive")
+ .HasColumnType("tinyint(1)")
+ .HasColumnOrder(5)
+ .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(1)
+ .HasComment("ชื่อการสอบ");
+
+ b.Property("StartDate")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(2)
+ .HasComment("วันเริ่มสมัครสอบ");
+
+ b.HasKey("Id");
+
+ b.ToTable("PeriodExams");
+ });
+
modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Prefix", b =>
{
b.Property("Id")
@@ -484,6 +1008,106 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
b.ToTable("SubDistricts");
});
+ modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Candidate", b =>
+ {
+ b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.District", "CitizenDistrict")
+ .WithMany()
+ .HasForeignKey("CitizenDistrictId");
+
+ b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Province", "CitizenProvince")
+ .WithMany()
+ .HasForeignKey("CitizenProvinceId");
+
+ b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.District", "CurrentDistrict")
+ .WithMany()
+ .HasForeignKey("CurrentDistrictId");
+
+ b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Province", "CurrentProvince")
+ .WithMany()
+ .HasForeignKey("CurrentProvinceId");
+
+ b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.SubDistrict", "CurrentSubDistrict")
+ .WithMany()
+ .HasForeignKey("CurrentSubDistrictId");
+
+ b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Prefix", "FatherPrefix")
+ .WithMany()
+ .HasForeignKey("FatherPrefixId");
+
+ b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Prefix", "MarryPrefix")
+ .WithMany()
+ .HasForeignKey("MarryPrefixId");
+
+ b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Prefix", "MotherPrefix")
+ .WithMany()
+ .HasForeignKey("MotherPrefixId");
+
+ b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.PeriodExam", "PeriodExam")
+ .WithMany()
+ .HasForeignKey("PeriodExamId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Prefix", "Prefix")
+ .WithMany()
+ .HasForeignKey("PrefixId");
+
+ b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.District", "RegistDistrict")
+ .WithMany()
+ .HasForeignKey("RegistDistrictId");
+
+ b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Province", "RegistProvince")
+ .WithMany()
+ .HasForeignKey("RegistProvinceId");
+
+ b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.SubDistrict", "RegistSubDistrict")
+ .WithMany()
+ .HasForeignKey("RegistSubDistrictId");
+
+ b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Relationship", "Relationship")
+ .WithMany()
+ .HasForeignKey("RelationshipId");
+
+ b.Navigation("CitizenDistrict");
+
+ b.Navigation("CitizenProvince");
+
+ b.Navigation("CurrentDistrict");
+
+ b.Navigation("CurrentProvince");
+
+ b.Navigation("CurrentSubDistrict");
+
+ b.Navigation("FatherPrefix");
+
+ b.Navigation("MarryPrefix");
+
+ b.Navigation("MotherPrefix");
+
+ b.Navigation("PeriodExam");
+
+ b.Navigation("Prefix");
+
+ b.Navigation("RegistDistrict");
+
+ b.Navigation("RegistProvince");
+
+ b.Navigation("RegistSubDistrict");
+
+ b.Navigation("Relationship");
+ });
+
+ modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Career", b =>
+ {
+ b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Candidate", "Candidate")
+ .WithMany()
+ .HasForeignKey("CandidateId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Candidate");
+ });
+
modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.District", b =>
{
b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Province", "Province")
@@ -493,6 +1117,25 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
b.Navigation("Province");
});
+ modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Education", 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.EducationLevel", "EducationLevel")
+ .WithMany()
+ .HasForeignKey("EducationLevelId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Candidate");
+
+ b.Navigation("EducationLevel");
+ });
+
modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.SubDistrict", b =>
{
b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.District", "District")
diff --git a/Migrations/20230323095454_create table Candidate.Designer.cs b/Migrations/20230323095454_create table Candidate.Designer.cs
new file mode 100644
index 0000000..2bc51f9
--- /dev/null
+++ b/Migrations/20230323095454_create table Candidate.Designer.cs
@@ -0,0 +1,1180 @@
+//
+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("20230323095454_create table Candidate")]
+ partial class createtableCandidate
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "7.0.4")
+ .HasAnnotation("Relational:MaxIdentifierLength", 64);
+
+ 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)");
+
+ b.Property("CitizenId")
+ .IsRequired()
+ .HasMaxLength(20)
+ .HasColumnType("varchar(20)")
+ .HasComment("เลขประจำตัวประชาชน");
+
+ b.Property("CitizenProvinceId")
+ .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("CurrentAddress")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasComment("ที่อยู่ปัจจุบัน");
+
+ b.Property("CurrentDistrictId")
+ .HasColumnType("char(36)");
+
+ b.Property("CurrentProvinceId")
+ .HasColumnType("char(36)");
+
+ b.Property("CurrentSubDistrictId")
+ .HasColumnType("char(36)");
+
+ b.Property("CurrentZipCode")
+ .IsRequired()
+ .HasMaxLength(10)
+ .HasColumnType("varchar(10)")
+ .HasComment("รหัสไปรษณีย์ที่อยู่ปัจจุบัน");
+
+ b.Property("DateOfBirth")
+ .HasMaxLength(40)
+ .HasColumnType("datetime(6)")
+ .HasComment("วันเกิด");
+
+ b.Property("Email")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasComment("อีเมล");
+
+ b.Property("FatherFirstName")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("varchar(100)")
+ .HasComment("ชื่อจริงบิดา");
+
+ b.Property("FatherLastName")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("varchar(100)")
+ .HasComment("นามสกุลบิดา");
+
+ b.Property("FatherPrefixId")
+ .HasColumnType("char(36)");
+
+ b.Property("FirstName")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("varchar(100)")
+ .HasColumnOrder(1)
+ .HasComment("ชื่อจริง");
+
+ b.Property("Knowledge")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasComment("ความสามารถพิเศษ");
+
+ b.Property("LastName")
+ .IsRequired()
+ .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")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("varchar(100)")
+ .HasComment("ชื่อจริงคู่สมรส");
+
+ b.Property("MarryLastName")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("varchar(100)")
+ .HasComment("นามสกุลคู่สมรส");
+
+ b.Property("MarryPrefixId")
+ .HasColumnType("char(36)");
+
+ b.Property("MobilePhone")
+ .IsRequired()
+ .HasMaxLength(20)
+ .HasColumnType("varchar(20)")
+ .HasComment("โทรศัพท์มือถือ");
+
+ b.Property("MotherFirstName")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("varchar(100)")
+ .HasComment("ชื่อจริงมารดา");
+
+ b.Property("MotherLastName")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("varchar(100)")
+ .HasComment("นามสกุลมารดา");
+
+ b.Property("MotherPrefixId")
+ .HasColumnType("char(36)");
+
+ b.Property("Nationality")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(3)
+ .HasComment("สัญชาติ");
+
+ b.Property("OccupationCompany")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasComment("สำนัก/บริษัท บริษัท");
+
+ b.Property("OccupationDepartment")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasComment("กอง/ฝ่าย บริษัท");
+
+ b.Property("OccupationEmail")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasComment("อีเมล บริษัท");
+
+ b.Property("OccupationTelephone")
+ .IsRequired()
+ .HasMaxLength(20)
+ .HasColumnType("varchar(20)")
+ .HasComment("โทรศัพท์ บริษัท");
+
+ b.Property("OccupationType")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasComment("ประเภทอาชีพที่ทำงานมาก่อน");
+
+ b.Property("PeriodExamId")
+ .HasColumnType("char(36)");
+
+ b.Property("PrefixId")
+ .HasColumnType("char(36)");
+
+ b.Property("RegistAddress")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasComment("ที่อยู่ตามทะเบียนบ้าน");
+
+ b.Property("RegistDistrictId")
+ .HasColumnType("char(36)");
+
+ b.Property("RegistProvinceId")
+ .HasColumnType("char(36)");
+
+ b.Property("RegistSame")
+ .HasColumnType("tinyint(1)")
+ .HasComment("ที่อยู่ปัจจุบันเหมือนที่อยู่ตามทะเบียนบ้าน");
+
+ b.Property("RegistSubDistrictId")
+ .HasColumnType("char(36)");
+
+ b.Property("RegistZipCode")
+ .IsRequired()
+ .HasMaxLength(10)
+ .HasColumnType("varchar(10)")
+ .HasComment("รหัสไปรษณีย์ที่อยู่ตามทะเบียนบ้าน");
+
+ b.Property("RelationshipId")
+ .HasColumnType("char(36)");
+
+ b.Property("Telephone")
+ .IsRequired()
+ .HasMaxLength(20)
+ .HasColumnType("varchar(20)")
+ .HasComment("โทรศัพท์");
+
+ b.Property("UserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasComment("User Id ผู้สมัคร");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CitizenDistrictId");
+
+ b.HasIndex("CitizenProvinceId");
+
+ b.HasIndex("CurrentDistrictId");
+
+ b.HasIndex("CurrentProvinceId");
+
+ b.HasIndex("CurrentSubDistrictId");
+
+ b.HasIndex("FatherPrefixId");
+
+ b.HasIndex("MarryPrefixId");
+
+ b.HasIndex("MotherPrefixId");
+
+ b.HasIndex("PeriodExamId");
+
+ b.HasIndex("PrefixId");
+
+ b.HasIndex("RegistDistrictId");
+
+ b.HasIndex("RegistProvinceId");
+
+ b.HasIndex("RegistSubDistrictId");
+
+ b.HasIndex("RelationshipId");
+
+ b.ToTable("Candidates");
+ });
+
+ 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("LastUpdateFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(105)
+ .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdateUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(103)
+ .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(102)
+ .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasColumnOrder(3)
+ .HasComment("สถานที่ทำงาน/ฝึกงาน");
+
+ b.Property("Position")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasColumnOrder(4)
+ .HasComment("ตำแหน่ง/ลักษณะงาน");
+
+ b.Property("Reason")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasColumnOrder(6)
+ .HasComment("เหตุผลที่ออก");
+
+ b.Property("Salary")
+ .HasMaxLength(20)
+ .HasColumnType("int")
+ .HasColumnOrder(5)
+ .HasComment("เงินเดือนสุดท้ายก่อนออก");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CandidateId");
+
+ b.ToTable("Careers");
+ });
+
+ modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.District", 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("IsActive")
+ .HasColumnType("tinyint(1)")
+ .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("Name")
+ .IsRequired()
+ .HasMaxLength(150)
+ .HasColumnType("varchar(150)")
+ .HasColumnOrder(1)
+ .HasComment("เขต/อำเภอ");
+
+ b.Property("ProvinceId")
+ .HasColumnType("char(36)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ProvinceId");
+
+ b.ToTable("Districts");
+ });
+
+ modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Education", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("char(36)")
+ .HasColumnOrder(0)
+ .HasComment("PrimaryKey")
+ .HasAnnotation("Relational:JsonPropertyName", "id");
+
+ b.Property("CandidateId")
+ .HasColumnType("char(36)");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(100)
+ .HasComment("สร้างข้อมูลเมื่อ");
+
+ b.Property("CreatedFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(104)
+ .HasComment("ชื่อ User ที่สร้างข้อมูล");
+
+ b.Property("CreatedUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(101)
+ .HasComment("User Id ที่สร้างข้อมูล");
+
+ b.Property("DurationEnd")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(2)
+ .HasComment("ระยะเวลาสิ้นสุด");
+
+ b.Property("DurationStart")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(1)
+ .HasComment("ระยะเวลาเริ่ม");
+
+ b.Property("EducationLevelId")
+ .HasColumnType("char(36)");
+
+ b.Property("LastUpdateFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(105)
+ .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdateUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(103)
+ .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(102)
+ .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
+
+ b.Property("Major")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasColumnOrder(4)
+ .HasComment("สาขาวิชา/วิชาเอก");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasColumnOrder(3)
+ .HasComment("ชื่อสถานศึกษา");
+
+ b.Property("Scores")
+ .HasMaxLength(10)
+ .HasColumnType("int")
+ .HasColumnOrder(6)
+ .HasComment("คะแนนเฉลี่ยตลอดหลักสูตร");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CandidateId");
+
+ b.HasIndex("EducationLevelId");
+
+ b.ToTable("Educations");
+ });
+
+ modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.EducationLevel", 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("IsActive")
+ .HasColumnType("tinyint(1)")
+ .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("Name")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("varchar(100)")
+ .HasColumnOrder(1)
+ .HasComment("ระดับการศึกษา");
+
+ b.HasKey("Id");
+
+ b.ToTable("EducationLevels");
+ });
+
+ 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("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")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasColumnOrder(4)
+ .HasComment("รายละเอียดสมัครสอบ");
+
+ b.Property("EndDate")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(3)
+ .HasComment("วันสิ้นสุด");
+
+ b.Property("IsActive")
+ .HasColumnType("tinyint(1)")
+ .HasColumnOrder(5)
+ .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(1)
+ .HasComment("ชื่อการสอบ");
+
+ b.Property("StartDate")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(2)
+ .HasComment("วันเริ่มสมัครสอบ");
+
+ b.HasKey("Id");
+
+ b.ToTable("PeriodExams");
+ });
+
+ modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Prefix", 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("IsActive")
+ .HasColumnType("tinyint(1)")
+ .HasColumnOrder(3)
+ .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(50)
+ .HasColumnType("varchar(50)")
+ .HasColumnOrder(2)
+ .HasComment("รายละเอียดคำนำหน้า");
+
+ b.HasKey("Id");
+
+ b.ToTable("Prefixes");
+ });
+
+ modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Province", 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("IsActive")
+ .HasColumnType("tinyint(1)")
+ .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("Name")
+ .IsRequired()
+ .HasMaxLength(150)
+ .HasColumnType("varchar(150)")
+ .HasColumnOrder(1)
+ .HasComment("จังหวัด");
+
+ b.HasKey("Id");
+
+ b.ToTable("Provinces");
+ });
+
+ modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Relationship", 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("IsActive")
+ .HasColumnType("tinyint(1)")
+ .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("Name")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("varchar(50)")
+ .HasColumnOrder(1)
+ .HasComment("ชื่อความสัมพันธ์");
+
+ b.HasKey("Id");
+
+ b.ToTable("Relationships");
+ });
+
+ modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Religion", 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