diff --git a/.github/workflows/release_discipline.yaml b/.github/workflows/release_discipline.yaml index 2dc3f5db..6d240854 100644 --- a/.github/workflows/release_discipline.yaml +++ b/.github/workflows/release_discipline.yaml @@ -67,21 +67,21 @@ jobs: docker-compose pull docker-compose up -d echo "${{ steps.gen_ver.outputs.image_ver }}"> success - # - uses: snow-actions/line-notify@v1.1.0 - # if: success() - # with: - # access_token: ${{ env.TOKEN_LINE }} - # message: | - # -Success✅✅✅ - # Image: ${{env.IMAGE_NAME}} - # Version: ${{ github.event.inputs.IMAGE_VER }} - # By: ${{secrets.DOCKER_USER}} - # - uses: snow-actions/line-notify@v1.1.0 - # if: failure() - # with: - # access_token: ${{ env.TOKEN_LINE }} - # message: | - # -Failure❌❌❌ - # Image: ${{env.IMAGE_NAME}} - # Version: ${{ github.event.inputs.IMAGE_VER }} - # By: ${{secrets.DOCKER_USER}} + - uses: snow-actions/line-notify@v1.1.0 + if: success() + with: + access_token: ${{ env.TOKEN_LINE }} + message: | + -Success✅✅✅ + Image: ${{env.IMAGE_NAME}} + Version: ${{ github.event.inputs.IMAGE_VER }} + By: ${{secrets.DOCKER_USER}} + - uses: snow-actions/line-notify@v1.1.0 + if: failure() + with: + access_token: ${{ env.TOKEN_LINE }} + message: | + -Failure❌❌❌ + Image: ${{env.IMAGE_NAME}} + Version: ${{ github.event.inputs.IMAGE_VER }} + By: ${{secrets.DOCKER_USER}} diff --git a/BMA.EHR.Discipline.Service/Controllers/DisciplineComplaintController.cs b/BMA.EHR.Discipline.Service/Controllers/DisciplineComplaintController.cs index 02909fa8..f1570f0f 100644 --- a/BMA.EHR.Discipline.Service/Controllers/DisciplineComplaintController.cs +++ b/BMA.EHR.Discipline.Service/Controllers/DisciplineComplaintController.cs @@ -70,6 +70,7 @@ namespace BMA.EHR.DisciplineComplaint.Service.Controllers CreatedAt = x.CreatedAt,//วันที่สร้างเรื่องร้องเรียน LevelConsideration = x.LevelConsideration,//ระดับการพิจารณา DateConsideration = x.DateConsideration,//วันที่กำหนดพิจารณา + DateReceived = x.DateReceived,//วันที่รับเรื่อง Status = x.Status,//สถานะเรื่องร้องเรียน มีดังนี้ ใหม่ (NEW), ยุติเรื่อง (STOP), มีมูลส่งไปสืบสวนแล้ว (SEND_INVESTIGATE) Result = x.Result, }) @@ -393,8 +394,8 @@ namespace BMA.EHR.DisciplineComplaint.Service.Controllers var persons = data.DisciplineComplaint_Profiles.Where(x => req.persons.Contains(x.Id)).ToList(); foreach (var item in persons) { - disciplineInvestigate.DisciplineInvestigate_Profiles.Add( - new DisciplineInvestigate_Profile + disciplineInvestigate.DisciplineInvestigate_ProfileComplaints.Add( + new DisciplineInvestigate_ProfileComplaint { PersonId = item.PersonId, CitizenId = item.CitizenId, @@ -507,7 +508,7 @@ namespace BMA.EHR.DisciplineComplaint.Service.Controllers } /// - /// ลบอัพไฟล์เอกสารร้องเรียนวินัย + /// ลบไฟล์เอกสารร้องเรียนวินัย /// /// /// @@ -533,8 +534,12 @@ namespace BMA.EHR.DisciplineComplaint.Service.Controllers await _context.SaveChangesAsync(); await _documentService.DeleteFileAsync(docId); await _context.SaveChangesAsync(); + return Success(); + } + else + { + return Error(new Exception("ไม่พอไฟล์นี้ในระบบ"), (int)StatusCodes.Status404NotFound); } - return Success(); } } } diff --git a/BMA.EHR.Discipline.Service/Controllers/DisciplineDisciplinaryController.cs b/BMA.EHR.Discipline.Service/Controllers/DisciplineDisciplinaryController.cs new file mode 100644 index 00000000..2982cf8d --- /dev/null +++ b/BMA.EHR.Discipline.Service/Controllers/DisciplineDisciplinaryController.cs @@ -0,0 +1,1278 @@ +using BMA.EHR.Application.Repositories; +using BMA.EHR.Application.Repositories.MessageQueue; +using BMA.EHR.Discipline.Service.Requests; +using BMA.EHR.Domain.Common; +using BMA.EHR.Domain.Models.Discipline; +using BMA.EHR.Domain.Shared; +using BMA.EHR.Infrastructure.Persistence; +// using BMA.EHR.Placement.Service.Requests; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; +using Swashbuckle.AspNetCore.Annotations; +using System.Security.Claims; + +namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers +{ + [Route("api/v{version:apiVersion}/discipline/disciplinary")] + [ApiVersion("1.0")] + [ApiController] + [Produces("application/json")] + [Authorize] + [SwaggerTag("ระบบวินัยเรื่องสอบสวน")] + public class DisciplineDisciplinaryController : BaseController + { + private readonly DisciplineDbContext _context; + private readonly MinIODisciplineService _documentService; + private readonly IHttpContextAccessor _httpContextAccessor; + + public DisciplineDisciplinaryController(DisciplineDbContext context, + MinIODisciplineService documentService, + IHttpContextAccessor httpContextAccessor) + { + // _repository = repository; + _context = context; + _documentService = documentService; + _httpContextAccessor = httpContextAccessor; + } + + #region " Properties " + + private string? UserId => _httpContextAccessor?.HttpContext?.User?.FindFirst(ClaimTypes.NameIdentifier)?.Value; + + private string? FullName => _httpContextAccessor?.HttpContext?.User?.FindFirst("name")?.Value; + + #endregion + + /// + /// list รายการวินัยเรื่องสอบสวน + /// + /// + /// + /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง + /// ไม่ได้ Login เข้าระบบ + /// เมื่อเกิดข้อผิดพลาดในการทำงาน + [HttpGet()] + public async Task> GetDisciplineDisciplinary(int page = 1, int pageSize = 25, string keyword = "") + { + var data_search = (from x in _context.DisciplineDisciplinarys + where x.Title.Contains(keyword) || + x.DisciplinaryFaultLevel.Contains(keyword) || + x.DisciplinaryCaseFault.Contains(keyword) + select x).ToList(); + var data = data_search + .Select(x => new + { + Id = x.Id,//id ข้อมูลเรื่องสอบสวน + Title = x.Title,//ชื่อเรื่อง + RespondentType = x.RespondentType,//ผู้ถูกสืบสวน + OffenseDetails = x.OffenseDetails,//ลักษณะความผิด + DisciplinaryFaultLevel = x.DisciplinaryFaultLevel,//ระดับโทษความผิด + DisciplinaryCaseFault = x.DisciplinaryCaseFault,//กรณีความผิด + Status = x.Status,//สถานะหรือผลการสอบสวน + CreatedAt = x.CreatedAt,//วันที่สร้างเรื่องสอบสวน + }) + .OrderByDescending(x => x.CreatedAt) + .Skip((page - 1) * pageSize) + .Take(pageSize) + .ToList(); + return Success(new { data, total = data_search.Count() }); + } + + /// + /// get รายการวินัยเรื่องร้องเรียน + /// + /// + /// + /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง + /// ไม่ได้ Login เข้าระบบ + /// เมื่อเกิดข้อผิดพลาดในการทำงาน + [HttpGet("complaint/{id:guid}")] + public async Task> GetByDisciplineDisciplinaryComplaint(Guid id) + { + var _data = await _context.DisciplineDisciplinarys + .Select(x => new + { + Id = x.Id,//id ข้อมูลเรื่องสอบสวน + IdInvestigate = x.DisciplineInvestigate.Id,//id ข้อมูลเรื่องสืบสวน + IdComplaint = x.DisciplineInvestigate.DisciplineComplaint.Id,//id ข้อมูลเรื่องร้องเรียน + RespondentType = x.RespondentType,//ผู้ถูกสืบสวน + Persons = x.DisciplineDisciplinary_ProfileComplaintInvestigates.Select(p => new + { + Id = p.Id, + Idcard = p.CitizenId, + Name = $"{p.Prefix}{p.FirstName} {p.LastName}", + Prefix = p.Prefix, + FirstName = p.FirstName, + LastName = p.LastName, + Position = p.Position, + PositionLevel = p.PositionLevel, + Salary = p.Salary, + PersonId = p.PersonId, + PosNo = p.PosNo, + Organization = p.Organization, + }),//รายการข้อมูลบุคลผู้ถูกสืบสวน + OrganizationId = x.Organization,//id หน่วยงานกรณี type เป็นหน่วยงาน + ConsideredAgency = x.ConsideredAgency,//หน่วยงานที่พิจารณา จะเปลี่ยนไปตามผู้ถูกร้องดูรายละเอียดด้านล่าง + Title = x.Title,//ชื่อเรื่อง + Description = x.Description,//รายละเอียด + DateReceived = x.DateReceived,//วันที่รับเรื่อง + LevelConsideration = x.LevelConsideration,//ระดับการพัฒนา + DateConsideration = x.DateConsideration,//วันที่กำหนดพิจารณา + OffenseDetails = x.OffenseDetails,//ลักษณะความผิด + DateNotification = x.DateNotification,//วันแจ้งเตือนล่วงหน้า + ComplaintFrom = x.ComplaintFrom,//รับเรื่องสืบสวนจาก + Appellant = x.Appellant,//ผู้ถูกสืบสวน + Result = x.ResultComplaint,//ผลการตรวจสอบ + Status = x.Status,//สถานะเรื่องสืบสวน + DisciplineDisciplinaryDocComplaintInvestigates = x.DisciplineDisciplinary_DocComplaintInvestigates.Where(d => d.Document != null).Select(d => new { d.Document.Id, d.Document.FileName }), + }) + .Where(x => x.Id == id) + .FirstOrDefaultAsync(); + if (_data == null) + return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound); + + var disciplineDisciplinaryDocComplaintInvestigates = new List(); + foreach (var doc in _data.DisciplineDisciplinaryDocComplaintInvestigates) + { + var _doc = new + { + doc.Id, + doc.FileName, + PathName = await _documentService.ImagesPath(doc.Id) + }; + disciplineDisciplinaryDocComplaintInvestigates.Add(_doc); + } + var data = new + { + _data.Id, + _data.IdInvestigate, + _data.IdComplaint, + _data.RespondentType, + _data.Persons, + _data.OrganizationId, + _data.ConsideredAgency, + _data.Title, + _data.Description, + _data.DateReceived, + _data.LevelConsideration, + _data.DateConsideration, + _data.OffenseDetails, + _data.DateNotification, + _data.ComplaintFrom, + _data.Appellant, + _data.Result, + _data.Status, + disciplineDisciplinaryDocComplaintInvestigates, + }; + return Success(data); + } + + /// + /// แก้ไขรายการวินัยเรื่องร้องเรียน + /// + /// + /// + /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง + /// ไม่ได้ Login เข้าระบบ + /// เมื่อเกิดข้อผิดพลาดในการทำงาน + [HttpPut("complaint/{id:guid}")] + public async Task> UpdateDisciplineDisciplinaryComplaint([FromBody] DisciplineDisciplinaryComplaintRequest req, Guid id) + { + var data = await _context.DisciplineDisciplinarys.Include(x => x.DisciplineDisciplinary_ProfileComplaintInvestigates).Where(x => x.Id == id).FirstOrDefaultAsync(); + if (data == null) + return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound); + if (data.Status.Trim().ToUpper() != "NEW") + return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), (int)StatusCodes.Status500InternalServerError); + + data.Title = req.title; + data.Description = req.description; + data.OffenseDetails = req.offenseDetails.Trim().ToUpper(); + data.LastUpdateFullName = FullName ?? "System Administrator"; + data.LastUpdateUserId = UserId ?? ""; + data.LastUpdatedAt = DateTime.Now; + _context.DisciplineDisciplinary_ProfileComplaintInvestigates.RemoveRange(data.DisciplineDisciplinary_ProfileComplaintInvestigates); + if (data.RespondentType.Trim().ToUpper() == "PERSON") + { + foreach (var item in req.persons) + { + data.DisciplineDisciplinary_ProfileComplaintInvestigates.Add( + new DisciplineDisciplinary_ProfileComplaintInvestigate + { + CitizenId = item.idcard, + Prefix = item.prefix, + FirstName = item.firstName, + LastName = item.lastName, + Organization = item.organization, + Position = item.position, + PositionLevel = item.positionLevel, + Salary = item.salary, + PersonId = item.personId, + PosNo = item.posNo, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, + } + ); + } + } + await _context.SaveChangesAsync(); + return Success(data.Id); + } + + /// + /// get รายการวินัยเรื่องสืบสวน + /// + /// + /// + /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง + /// ไม่ได้ Login เข้าระบบ + /// เมื่อเกิดข้อผิดพลาดในการทำงาน + [HttpGet("investigate/{id:guid}")] + public async Task> GetByDisciplineDisciplinaryInvestigate(Guid id) + { + var _data = await _context.DisciplineDisciplinarys + .Select(x => new + { + Id = x.Id,//id ข้อมูลเรื่องสอบสวน + IdInvestigate = x.DisciplineInvestigate.Id,//id ข้อมูลเรื่องสืบสวน + IdComplaint = x.DisciplineInvestigate.DisciplineComplaint.Id,//id ข้อมูลเรื่องร้องเรียน + InvestigationDetail = x.InvestigationDetail, + InvestigationDetailOther = x.InvestigationDetailOther, + InvestigationDateStart = x.InvestigationDateStart, + InvestigationDateEnd = x.InvestigationDateEnd, + InvestigationDescription = x.InvestigationDescription, + InvestigationStatusResult = x.InvestigationStatusResult, + InvestigationCauseText = x.InvestigationCauseText, + Status = x.Status,//สถานะเรื่องสืบสวน + Result = x.Result,//ผลการตรวจสอบ + Director = x.DisciplineDisciplinary_DirectorInvestigates.Select(d => new + { + Id = d.Id, + DirectorId = d.DisciplineDirector.Id, + Prefix = d.DisciplineDirector.Prefix, + FirstName = d.DisciplineDirector.FirstName, + LastName = d.DisciplineDirector.LastName, + Position = d.DisciplineDirector.Position, + Email = d.DisciplineDirector.Email, + Duty = "", + Phone = d.DisciplineDirector.Phone, + Total = d.DisciplineDirector.DisciplineDisciplinary_DirectorInvestigates.Count(), + }).ToList(), + DisciplineDisciplinaryDocInvestigates = x.DisciplineDisciplinary_DocInvestigates.Where(d => d.Document != null).Select(d => new { d.Document.Id, d.Document.FileName }), + DisciplineDisciplinaryDocInvestigateRelevants = x.DisciplineDisciplinary_DocInvestigateRelevants.Where(d => d.Document != null).Select(d => new { d.Document.Id, d.Document.FileName }), + }) + .Where(x => x.Id == id) + .FirstOrDefaultAsync(); + if (_data == null) + return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound); + + var disciplineDisciplinaryDocInvestigates = new List(); + foreach (var doc in _data.DisciplineDisciplinaryDocInvestigates) + { + var _doc = new + { + doc.Id, + doc.FileName, + PathName = await _documentService.ImagesPath(doc.Id) + }; + disciplineDisciplinaryDocInvestigates.Add(_doc); + } + + var disciplineDisciplinaryDocInvestigateRelevants = new List(); + foreach (var doc in _data.DisciplineDisciplinaryDocInvestigateRelevants) + { + var _doc = new + { + doc.Id, + doc.FileName, + PathName = await _documentService.ImagesPath(doc.Id) + }; + disciplineDisciplinaryDocInvestigateRelevants.Add(_doc); + } + var data = new + { + _data.Id, + _data.IdInvestigate, + _data.IdComplaint, + _data.InvestigationDetail, + _data.InvestigationDetailOther, + _data.InvestigationDateStart, + _data.InvestigationDateEnd, + _data.InvestigationDescription, + _data.InvestigationStatusResult, + _data.InvestigationCauseText, + _data.Status, + _data.Result, + _data.Director, + disciplineDisciplinaryDocInvestigates, + disciplineDisciplinaryDocInvestigateRelevants, + }; + return Success(data); + } + + /// + /// แก้ไขรายการวินัยเรื่องสืบสวน + /// + /// + /// + /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง + /// ไม่ได้ Login เข้าระบบ + /// เมื่อเกิดข้อผิดพลาดในการทำงาน + [HttpPut("investigate/{id:guid}")] + public async Task> UpdateDisciplineDisciplinaryInvestigate([FromBody] DisciplineDisciplinaryInvestigateRequest req, Guid id) + { + var data = await _context.DisciplineDisciplinarys + .Include(x => x.DisciplineDisciplinary_DirectorInvestigates) + .ThenInclude(x => x.DisciplineDirector) + .Where(x => x.Id == id) + .FirstOrDefaultAsync(); + if (data == null) + return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound); + if (data.Status.Trim().ToUpper() != "NEW") + return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), (int)StatusCodes.Status500InternalServerError); + + data.InvestigationDetail = req.investigationDetail.Trim().ToUpper(); + data.InvestigationDetailOther = req.investigationDetailOther; + data.InvestigationDateStart = req.investigationDateStart; + data.InvestigationDateEnd = req.investigationDateEnd; + data.InvestigationDescription = req.investigationDescription; + data.InvestigationStatusResult = req.investigationStatusResult.Trim().ToUpper(); + data.InvestigationCauseText = req.investigationCauseText.Trim().ToUpper(); + data.Result = req.result; + data.LastUpdateFullName = FullName ?? "System Administrator"; + data.LastUpdateUserId = UserId ?? ""; + data.LastUpdatedAt = DateTime.Now; + _context.DisciplineDisciplinary_DirectorInvestigates.RemoveRange(data.DisciplineDisciplinary_DirectorInvestigates); + foreach (var item in req.directors) + { + var director = await _context.DisciplineDirectors.AsQueryable() + .FirstOrDefaultAsync(x => x.Id == item); + if (director != null) + { + data.DisciplineDisciplinary_DirectorInvestigates.Add( + new DisciplineDisciplinary_DirectorInvestigate + { + DisciplineDirector = director, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, + } + ); + } + } + await _context.SaveChangesAsync(); + return Success(data.Id); + } + + /// + /// get รายการวินัยเรื่องสอบสวน + /// + /// + /// + /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง + /// ไม่ได้ Login เข้าระบบ + /// เมื่อเกิดข้อผิดพลาดในการทำงาน + [HttpGet("{id:guid}")] + public async Task> GetByDisciplineDisciplinary(Guid id) + { + var _data = await _context.DisciplineDisciplinarys + .Select(x => new + { + Id = x.Id,//id ข้อมูลเรื่องสอบสวน + IdInvestigate = x.DisciplineInvestigate.Id,//id ข้อมูลเรื่องสืบสวน + IdComplaint = x.DisciplineInvestigate.DisciplineComplaint.Id,//id ข้อมูลเรื่องร้องเรียน + DisciplinaryWitnesses = x.DisciplinaryWitnesses, + DisciplinaryRecordAccuser = x.DisciplinaryRecordAccuser, + DisciplinarySummaryEvidence = x.DisciplinarySummaryEvidence, + DisciplinaryRefLaw = x.DisciplinaryRefLaw, + DisciplinaryFaultLevel = x.DisciplinaryFaultLevel, + DisciplinaryInvestigateAt = x.DisciplinaryInvestigateAt, + DisciplinaryCaseFault = x.DisciplinaryCaseFault, + DisciplinaryDateEvident = x.DisciplinaryDateEvident, + DisciplinaryDateAllegation = x.DisciplinaryDateAllegation, + Result = x.Result, + Director = x.DisciplineDisciplinary_DirectorInvestigates.Select(d => new + { + Id = d.Id, + DirectorId = d.DisciplineDirector.Id, + Prefix = d.DisciplineDirector.Prefix, + FirstName = d.DisciplineDirector.FirstName, + LastName = d.DisciplineDirector.LastName, + Position = d.DisciplineDirector.Position, + Email = d.DisciplineDirector.Email, + Duty = "", + Phone = d.DisciplineDirector.Phone, + Total = d.DisciplineDirector.DisciplineDisciplinary_DirectorInvestigates.Count(), + }).ToList(), + RespondentType = x.RespondentType,//ผู้ถูกสืบสวน + Persons = x.DisciplineDisciplinary_ProfileComplaintInvestigates.Select(p => new + { + Id = p.Id, + Idcard = p.CitizenId, + Name = $"{p.Prefix}{p.FirstName} {p.LastName}", + Prefix = p.Prefix, + FirstName = p.FirstName, + LastName = p.LastName, + Position = p.Position, + PositionLevel = p.PositionLevel, + Salary = p.Salary, + PersonId = p.PersonId, + PosNo = p.PosNo, + Organization = p.Organization, + }),//รายการข้อมูลบุคลผู้ถูกสืบสวน + OrganizationId = x.Organization,//id หน่วยงานกรณี type เป็นหน่วยงาน + DisciplineDisciplinary_DocSummaryEvidences = x.DisciplineDisciplinary_DocSummaryEvidences.Where(d => d.Document != null).Select(d => new { d.Document.Id, d.Document.FileName }), + DisciplineDisciplinary_DocRecordAccusers = x.DisciplineDisciplinary_DocRecordAccusers.Where(d => d.Document != null).Select(d => new { d.Document.Id, d.Document.FileName }), + DisciplineDisciplinary_DocWitnessess = x.DisciplineDisciplinary_DocWitnessess.Where(d => d.Document != null).Select(d => new { d.Document.Id, d.Document.FileName }), + DisciplineDisciplinary_DocOthers = x.DisciplineDisciplinary_DocOthers.Where(d => d.Document != null).Select(d => new { d.Document.Id, d.Document.FileName }), + }) + .Where(x => x.Id == id) + .FirstOrDefaultAsync(); + if (_data == null) + return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound); + + var disciplineDisciplinary_DocSummaryEvidences = new List(); + foreach (var doc in _data.DisciplineDisciplinary_DocSummaryEvidences) + { + var _doc = new + { + doc.Id, + doc.FileName, + PathName = await _documentService.ImagesPath(doc.Id) + }; + disciplineDisciplinary_DocSummaryEvidences.Add(_doc); + } + var disciplineDisciplinary_DocRecordAccusers = new List(); + foreach (var doc in _data.DisciplineDisciplinary_DocRecordAccusers) + { + var _doc = new + { + doc.Id, + doc.FileName, + PathName = await _documentService.ImagesPath(doc.Id) + }; + disciplineDisciplinary_DocRecordAccusers.Add(_doc); + } + var disciplineDisciplinary_DocWitnessess = new List(); + foreach (var doc in _data.DisciplineDisciplinary_DocWitnessess) + { + var _doc = new + { + doc.Id, + doc.FileName, + PathName = await _documentService.ImagesPath(doc.Id) + }; + disciplineDisciplinary_DocWitnessess.Add(_doc); + } + var disciplineDisciplinary_DocOthers = new List(); + foreach (var doc in _data.DisciplineDisciplinary_DocOthers) + { + var _doc = new + { + doc.Id, + doc.FileName, + PathName = await _documentService.ImagesPath(doc.Id) + }; + disciplineDisciplinary_DocOthers.Add(_doc); + } + var data = new + { + _data.Id, + _data.IdInvestigate, + _data.IdComplaint, + _data.DisciplinaryWitnesses, + _data.DisciplinaryRecordAccuser, + _data.DisciplinarySummaryEvidence, + _data.DisciplinaryRefLaw, + _data.DisciplinaryFaultLevel, + _data.DisciplinaryInvestigateAt, + _data.DisciplinaryCaseFault, + _data.DisciplinaryDateEvident, + _data.DisciplinaryDateAllegation, + _data.Result, + _data.Director, + _data.RespondentType, + _data.Persons, + _data.OrganizationId, + disciplineDisciplinary_DocSummaryEvidences, + disciplineDisciplinary_DocRecordAccusers, + disciplineDisciplinary_DocWitnessess, + disciplineDisciplinary_DocOthers, + }; + return Success(data); + } + + /// + /// แก้ไขรายการวินัยเรื่องสอบสวน + /// + /// + /// + /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง + /// ไม่ได้ Login เข้าระบบ + /// เมื่อเกิดข้อผิดพลาดในการทำงาน + [HttpPut("{id:guid}")] + public async Task> UpdateDisciplineDisciplinary([FromBody] DisciplineDisciplinaryRequest req, Guid id) + { + var data = await _context.DisciplineDisciplinarys + .Include(x => x.DisciplineDisciplinary_DirectorInvestigates) + .ThenInclude(x => x.DisciplineDirector) + .Where(x => x.Id == id) + .FirstOrDefaultAsync(); + if (data == null) + return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound); + if (data.Status.Trim().ToUpper() != "NEW") + return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), (int)StatusCodes.Status500InternalServerError); + + data.DisciplinaryWitnesses = req.DisciplinaryWitnesses; + data.DisciplinaryRecordAccuser = req.DisciplinaryRecordAccuser; + data.DisciplinarySummaryEvidence = req.DisciplinarySummaryEvidence; + data.DisciplinaryRefLaw = req.DisciplinaryRefLaw; + data.DisciplinaryFaultLevel = req.DisciplinaryFaultLevel; + data.DisciplinaryInvestigateAt = req.DisciplinaryInvestigateAt; + data.DisciplinaryCaseFault = req.DisciplinaryCaseFault; + data.DisciplinaryDateEvident = req.DisciplinaryDateEvident; + data.DisciplinaryDateAllegation = req.DisciplinaryDateAllegation; + data.Result = req.Result; + data.LastUpdateFullName = FullName ?? "System Administrator"; + data.LastUpdateUserId = UserId ?? ""; + data.LastUpdatedAt = DateTime.Now; + _context.DisciplineDisciplinary_DirectorInvestigates.RemoveRange(data.DisciplineDisciplinary_DirectorInvestigates); + foreach (var item in req.directors) + { + var director = await _context.DisciplineDirectors.AsQueryable() + .FirstOrDefaultAsync(x => x.Id == item); + if (director != null) + { + data.DisciplineDisciplinary_DirectorInvestigates.Add( + new DisciplineDisciplinary_DirectorInvestigate + { + DisciplineDirector = director, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, + } + ); + } + } + data.Organization = req.organizationId; + data.RespondentType = req.respondentType; + _context.DisciplineDisciplinary_ProfileComplaintInvestigates.RemoveRange(data.DisciplineDisciplinary_ProfileComplaintInvestigates); + if (data.RespondentType.Trim().ToUpper() == "PERSON") + { + foreach (var item in req.persons) + { + data.DisciplineDisciplinary_ProfileComplaintInvestigates.Add( + new DisciplineDisciplinary_ProfileComplaintInvestigate + { + CitizenId = item.idcard, + Prefix = item.prefix, + FirstName = item.firstName, + LastName = item.lastName, + Organization = item.organization, + Position = item.position, + PositionLevel = item.positionLevel, + Salary = item.salary, + PersonId = item.personId, + PosNo = item.posNo, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, + } + ); + } + } + await _context.SaveChangesAsync(); + return Success(data.Id); + } + + /// + /// ยุติเรื่อง + /// + /// + /// + /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง + /// ไม่ได้ Login เข้าระบบ + /// เมื่อเกิดข้อผิดพลาดในการทำงาน + [HttpGet("reject/{id:guid}")] + public async Task> RejectDisciplineDisciplinary(Guid id) + { + var data = await _context.DisciplineDisciplinarys + .Where(x => x.Id == id) + .FirstOrDefaultAsync(); + if (data == null) + return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound); + if (data.Status.Trim().ToUpper() != "NEW") + return Error(new Exception("ไม่สามารถยุติเรื่องได้"), (int)StatusCodes.Status500InternalServerError); + if (data.InvestigationStatusResult == null || data.InvestigationStatusResult.Trim().ToUpper() != "NO_CAUSE") + return Error(new Exception("ไม่สามารถยุติเรื่องได้"), (int)StatusCodes.Status500InternalServerError); + data.Status = "STOP"; + + await _context.SaveChangesAsync(); + return Success(); + } + + /// + /// ส่งเรื่องสอบสวน + /// + /// + /// + /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง + /// ไม่ได้ Login เข้าระบบ + /// เมื่อเกิดข้อผิดพลาดในการทำงาน + [HttpGet("approve/{id:guid}")] + public async Task> ApproveDisciplineDisciplinary(Guid id) + { + var data = await _context.DisciplineDisciplinarys + .Where(x => x.Id == id) + .FirstOrDefaultAsync(); + if (data == null) + return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound); + if (data.Status.Trim().ToUpper() != "NEW") + return Error(new Exception("ไม่สามารถเสร็จสิ้นสอบสวนได้"), (int)StatusCodes.Status500InternalServerError); + data.Status = "DONE"; + + await _context.SaveChangesAsync(); + return Success(); + } + + /// + /// ยกเลิกการยุติเรื่อง + /// + /// + /// + /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง + /// ไม่ได้ Login เข้าระบบ + /// เมื่อเกิดข้อผิดพลาดในการทำงาน + [HttpGet("resume/{id:guid}")] + public async Task> ResumeDisciplineDisciplinary(Guid id) + { + var data = await _context.DisciplineDisciplinarys + .Where(x => x.Id == id) + .FirstOrDefaultAsync(); + if (data == null) + return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound); + if (data.Status.Trim().ToUpper() != "STOP") + return Error(new Exception("รายการนี้ยังไม่ถูกยุติเรื่อง"), (int)StatusCodes.Status500InternalServerError); + data.Status = "NEW"; + + await _context.SaveChangesAsync(); + return Success(); + } + + /// + /// อัพไฟล์เอกสารสืบสวนวินัย + /// + /// + /// + /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง + /// ไม่ได้ Login เข้าระบบ + /// เมื่อเกิดข้อผิดพลาดในการทำงาน + [HttpPut("file/{id:guid}")] + public async Task> UploadFileDisciplineDisciplinaryInvestigate([FromForm] DisciplineFileRequest req, Guid id) + { + var data = await _context.DisciplineDisciplinarys + .Where(x => x.Id == id) + .FirstOrDefaultAsync(); + if (data == null) + return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound); + if (data.Status.Trim().ToUpper() != "NEW") + return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), (int)StatusCodes.Status500InternalServerError); + + if (Request.Form.Files != null && Request.Form.Files.Count != 0) + { + foreach (var file in Request.Form.Files) + { + var fileExtension = Path.GetExtension(file.FileName); + var doc = await _documentService.UploadFileAsync(file, file.FileName); + var _doc = await _context.Documents.AsQueryable() + .FirstOrDefaultAsync(x => x.Id == doc.Id); + if (_doc != null) + { + var disciplineDisciplinary_DocInvestigate = new DisciplineDisciplinary_DocInvestigate + { + DisciplineDisciplinary = data, + Document = _doc, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, + }; + await _context.DisciplineDisciplinary_DocInvestigates.AddAsync(disciplineDisciplinary_DocInvestigate); + } + } + } + await _context.SaveChangesAsync(); + return Success(); + } + + /// + /// ลบไฟล์เอกสารสืบสวนวินัย + /// + /// + /// + /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง + /// ไม่ได้ Login เข้าระบบ + /// เมื่อเกิดข้อผิดพลาดในการทำงาน + [HttpDelete("file/{id:guid}/{docId:guid}")] + public async Task> DeleteFileDisciplineDisciplinaryInvestigate(Guid id, Guid docId) + { + var data = await _context.DisciplineDisciplinarys + .Include(x => x.DisciplineDisciplinary_DocInvestigates) + .ThenInclude(x => x.Document) + .Include(x => x.DisciplineInvestigate) + .ThenInclude(x => x.DisciplineInvestigate_Docs) + .ThenInclude(x => x.Document) + .Where(x => x.Id == id) + .FirstOrDefaultAsync(); + if (data == null) + return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound); + if (data.Status.Trim().ToUpper() != "NEW") + return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), (int)StatusCodes.Status500InternalServerError); + var dataDoc = data.DisciplineDisciplinary_DocInvestigates.Where(x => x.Document.Id == docId).FirstOrDefault(); + if (dataDoc != null) + { + _context.DisciplineDisciplinary_DocInvestigates.Remove(dataDoc); + await _context.SaveChangesAsync(); + var dataDocComplaint = data.DisciplineInvestigate.DisciplineInvestigate_Docs.Where(x => x.Document.Id == docId).FirstOrDefault(); + if (dataDocComplaint == null) + { + await _documentService.DeleteFileAsync(docId); + await _context.SaveChangesAsync(); + } + return Success(); + } + else + { + return Error(new Exception("ไม่พอไฟล์นี้ในระบบ"), (int)StatusCodes.Status404NotFound); + } + } + + /// + /// อัพไฟล์เอกสารร้องเรียนวินัย + /// + /// + /// + /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง + /// ไม่ได้ Login เข้าระบบ + /// เมื่อเกิดข้อผิดพลาดในการทำงาน + [HttpPut("complaint/file/{id:guid}")] + public async Task> UploadFileDisciplineDisciplinaryComplaint([FromForm] DisciplineFileRequest req, Guid id) + { + var data = await _context.DisciplineDisciplinarys + .Where(x => x.Id == id) + .FirstOrDefaultAsync(); + if (data == null) + return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound); + if (data.Status.Trim().ToUpper() != "NEW") + return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), (int)StatusCodes.Status500InternalServerError); + + if (Request.Form.Files != null && Request.Form.Files.Count != 0) + { + foreach (var file in Request.Form.Files) + { + var fileExtension = Path.GetExtension(file.FileName); + var doc = await _documentService.UploadFileAsync(file, file.FileName); + var _doc = await _context.Documents.AsQueryable() + .FirstOrDefaultAsync(x => x.Id == doc.Id); + if (_doc != null) + { + var disciplineDisciplinary_DocComplaintInvestigate = new DisciplineDisciplinary_DocComplaintInvestigate + { + DisciplineDisciplinary = data, + Document = _doc, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, + }; + await _context.DisciplineDisciplinary_DocComplaintInvestigates.AddAsync(disciplineDisciplinary_DocComplaintInvestigate); + } + } + } + await _context.SaveChangesAsync(); + return Success(); + } + + /// + /// ลบไฟล์เอกสารร้องเรียนวินัย + /// + /// + /// + /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง + /// ไม่ได้ Login เข้าระบบ + /// เมื่อเกิดข้อผิดพลาดในการทำงาน + [HttpDelete("complaint/file/{id:guid}/{docId:guid}")] + public async Task> DeleteFileDisciplineDisciplinaryComplaint(Guid id, Guid docId) + { + var data = await _context.DisciplineDisciplinarys + .Include(x => x.DisciplineDisciplinary_DocComplaintInvestigates) + .ThenInclude(x => x.Document) + .Include(x => x.DisciplineInvestigate) + .ThenInclude(x => x.DisciplineComplaint) + .ThenInclude(x => x.DisciplineComplaint_Docs) + .ThenInclude(x => x.Document) + .Where(x => x.Id == id) + .FirstOrDefaultAsync(); + if (data == null) + return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound); + if (data.Status.Trim().ToUpper() != "NEW") + return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), (int)StatusCodes.Status500InternalServerError); + var dataDoc = data.DisciplineDisciplinary_DocComplaintInvestigates.Where(x => x.Document.Id == docId).FirstOrDefault(); + if (dataDoc != null) + { + _context.DisciplineDisciplinary_DocComplaintInvestigates.Remove(dataDoc); + await _context.SaveChangesAsync(); + var dataDocComplaint = data.DisciplineInvestigate.DisciplineComplaint.DisciplineComplaint_Docs.Where(x => x.Document.Id == docId).FirstOrDefault(); + if (dataDocComplaint == null) + { + await _documentService.DeleteFileAsync(docId); + await _context.SaveChangesAsync(); + } + return Success(); + } + else + { + return Error(new Exception("ไม่พอไฟล์นี้ในระบบ"), (int)StatusCodes.Status404NotFound); + } + } + + /// + /// อัพไฟล์เอกสารเกี่ยวข้องสืบสวนวินัย + /// + /// + /// + /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง + /// ไม่ได้ Login เข้าระบบ + /// เมื่อเกิดข้อผิดพลาดในการทำงาน + [HttpPut("relevant/file/{id:guid}")] + public async Task> UploadFileDisciplineDisciplinaryInvestigateRelevant([FromForm] DisciplineFileRequest req, Guid id) + { + var data = await _context.DisciplineDisciplinarys + .Where(x => x.Id == id) + .FirstOrDefaultAsync(); + if (data == null) + return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound); + if (data.Status.Trim().ToUpper() != "NEW") + return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), (int)StatusCodes.Status500InternalServerError); + + if (Request.Form.Files != null && Request.Form.Files.Count != 0) + { + foreach (var file in Request.Form.Files) + { + var fileExtension = Path.GetExtension(file.FileName); + var doc = await _documentService.UploadFileAsync(file, file.FileName); + var _doc = await _context.Documents.AsQueryable() + .FirstOrDefaultAsync(x => x.Id == doc.Id); + if (_doc != null) + { + var disciplineDisciplinary_DocInvestigateRelevant = new DisciplineDisciplinary_DocInvestigateRelevant + { + DisciplineDisciplinary = data, + Document = _doc, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, + }; + await _context.DisciplineDisciplinary_DocInvestigateRelevants.AddAsync(disciplineDisciplinary_DocInvestigateRelevant); + } + } + } + await _context.SaveChangesAsync(); + return Success(); + } + + /// + /// ลบไฟล์เอกสารเกี่ยวข้องสืบสวนวินัย + /// + /// + /// + /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง + /// ไม่ได้ Login เข้าระบบ + /// เมื่อเกิดข้อผิดพลาดในการทำงาน + [HttpDelete("relevant/file/{id:guid}/{docId:guid}")] + public async Task> DeleteFileDisciplineDisciplinaryInvestigateRelevant(Guid id, Guid docId) + { + var data = await _context.DisciplineDisciplinarys + .Include(x => x.DisciplineDisciplinary_DocInvestigateRelevants) + .ThenInclude(x => x.Document) + .Include(x => x.DisciplineInvestigate) + .ThenInclude(x => x.DisciplineInvestigateRelevant_Docs) + .ThenInclude(x => x.Document) + .Where(x => x.Id == id) + .FirstOrDefaultAsync(); + if (data == null) + return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound); + if (data.Status.Trim().ToUpper() != "NEW") + return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), (int)StatusCodes.Status500InternalServerError); + var dataDoc = data.DisciplineDisciplinary_DocInvestigateRelevants.Where(x => x.Document.Id == docId).FirstOrDefault(); + if (dataDoc != null) + { + _context.DisciplineDisciplinary_DocInvestigateRelevants.Remove(dataDoc); + await _context.SaveChangesAsync(); + var dataDocComplaint = data.DisciplineInvestigate.DisciplineInvestigateRelevant_Docs.Where(x => x.Document.Id == docId).FirstOrDefault(); + if (dataDocComplaint == null) + { + await _documentService.DeleteFileAsync(docId); + await _context.SaveChangesAsync(); + } + return Success(); + } + else + { + return Error(new Exception("ไม่พอไฟล์นี้ในระบบ"), (int)StatusCodes.Status404NotFound); + } + } + + /// + /// อัพไฟล์หลักฐานสนับสนุนข้อกล่าวหา + /// + /// + /// + /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง + /// ไม่ได้ Login เข้าระบบ + /// เมื่อเกิดข้อผิดพลาดในการทำงาน + [HttpPut("summaryEvidence/file/{id:guid}")] + public async Task> UploadFileDisciplineDisciplinarySummaryEvidences([FromForm] DisciplineFileRequest req, Guid id) + { + var data = await _context.DisciplineDisciplinarys + .Where(x => x.Id == id) + .FirstOrDefaultAsync(); + if (data == null) + return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound); + if (data.Status.Trim().ToUpper() != "NEW") + return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), (int)StatusCodes.Status500InternalServerError); + + if (Request.Form.Files != null && Request.Form.Files.Count != 0) + { + foreach (var file in Request.Form.Files) + { + var fileExtension = Path.GetExtension(file.FileName); + var doc = await _documentService.UploadFileAsync(file, file.FileName); + var _doc = await _context.Documents.AsQueryable() + .FirstOrDefaultAsync(x => x.Id == doc.Id); + if (_doc != null) + { + var disciplineDisciplinary_DocSummaryEvidence = new DisciplineDisciplinary_DocSummaryEvidence + { + DisciplineDisciplinary = data, + Document = _doc, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, + }; + await _context.DisciplineDisciplinary_DocSummaryEvidences.AddAsync(disciplineDisciplinary_DocSummaryEvidence); + } + } + } + await _context.SaveChangesAsync(); + return Success(); + } + + /// + /// ลบหลักฐานสนับสนุนข้อกล่าวหา + /// + /// + /// + /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง + /// ไม่ได้ Login เข้าระบบ + /// เมื่อเกิดข้อผิดพลาดในการทำงาน + [HttpDelete("summaryEvidence/file/{id:guid}/{docId:guid}")] + public async Task> DeleteFileDisciplineDisciplinarySummaryEvidences(Guid id, Guid docId) + { + var data = await _context.DisciplineDisciplinarys + .Include(x => x.DisciplineDisciplinary_DocSummaryEvidences) + .ThenInclude(x => x.Document) + .Where(x => x.Id == id) + .FirstOrDefaultAsync(); + if (data == null) + return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound); + if (data.Status.Trim().ToUpper() != "NEW") + return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), (int)StatusCodes.Status500InternalServerError); + var dataDoc = data.DisciplineDisciplinary_DocSummaryEvidences.Where(x => x.Document.Id == docId).FirstOrDefault(); + if (dataDoc != null) + { + _context.DisciplineDisciplinary_DocSummaryEvidences.Remove(dataDoc); + await _context.SaveChangesAsync(); + await _documentService.DeleteFileAsync(docId); + await _context.SaveChangesAsync(); + return Success(); + } + else + { + return Error(new Exception("ไม่พอไฟล์นี้ในระบบ"), (int)StatusCodes.Status404NotFound); + } + } + + /// + /// อัพไฟล์บันทึกถ้อยคำของผู้กล่าวหา + /// + /// + /// + /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง + /// ไม่ได้ Login เข้าระบบ + /// เมื่อเกิดข้อผิดพลาดในการทำงาน + [HttpPut("recordAccuser/file/{id:guid}")] + public async Task> UploadFileDisciplineDisciplinaryRecordAccusers([FromForm] DisciplineFileRequest req, Guid id) + { + var data = await _context.DisciplineDisciplinarys + .Where(x => x.Id == id) + .FirstOrDefaultAsync(); + if (data == null) + return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound); + if (data.Status.Trim().ToUpper() != "NEW") + return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), (int)StatusCodes.Status500InternalServerError); + + if (Request.Form.Files != null && Request.Form.Files.Count != 0) + { + foreach (var file in Request.Form.Files) + { + var fileExtension = Path.GetExtension(file.FileName); + var doc = await _documentService.UploadFileAsync(file, file.FileName); + var _doc = await _context.Documents.AsQueryable() + .FirstOrDefaultAsync(x => x.Id == doc.Id); + if (_doc != null) + { + var disciplineDisciplinary_DocRecordAccuser = new DisciplineDisciplinary_DocRecordAccuser + { + DisciplineDisciplinary = data, + Document = _doc, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, + }; + await _context.DisciplineDisciplinary_DocRecordAccusers.AddAsync(disciplineDisciplinary_DocRecordAccuser); + } + } + } + await _context.SaveChangesAsync(); + return Success(); + } + + /// + /// ลบไฟล์บันทึกถ้อยคำของผู้กล่าวหา + /// + /// + /// + /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง + /// ไม่ได้ Login เข้าระบบ + /// เมื่อเกิดข้อผิดพลาดในการทำงาน + [HttpDelete("recordAccuser/file/{id:guid}/{docId:guid}")] + public async Task> DeleteFileDisciplineDisciplinaryRecordAccusers(Guid id, Guid docId) + { + var data = await _context.DisciplineDisciplinarys + .Include(x => x.DisciplineDisciplinary_DocRecordAccusers) + .ThenInclude(x => x.Document) + .Where(x => x.Id == id) + .FirstOrDefaultAsync(); + if (data == null) + return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound); + if (data.Status.Trim().ToUpper() != "NEW") + return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), (int)StatusCodes.Status500InternalServerError); + var dataDoc = data.DisciplineDisciplinary_DocRecordAccusers.Where(x => x.Document.Id == docId).FirstOrDefault(); + if (dataDoc != null) + { + _context.DisciplineDisciplinary_DocRecordAccusers.Remove(dataDoc); + await _context.SaveChangesAsync(); + await _documentService.DeleteFileAsync(docId); + await _context.SaveChangesAsync(); + return Success(); + } + else + { + return Error(new Exception("ไม่พอไฟล์นี้ในระบบ"), (int)StatusCodes.Status404NotFound); + } + } + + /// + /// อัพไฟล์พยานและการบันทึกถ้อยคำ + /// + /// + /// + /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง + /// ไม่ได้ Login เข้าระบบ + /// เมื่อเกิดข้อผิดพลาดในการทำงาน + [HttpPut("witnesses/file/{id:guid}")] + public async Task> UploadFileDisciplineDisciplinaryWitnessess([FromForm] DisciplineFileRequest req, Guid id) + { + var data = await _context.DisciplineDisciplinarys + .Where(x => x.Id == id) + .FirstOrDefaultAsync(); + if (data == null) + return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound); + if (data.Status.Trim().ToUpper() != "NEW") + return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), (int)StatusCodes.Status500InternalServerError); + + if (Request.Form.Files != null && Request.Form.Files.Count != 0) + { + foreach (var file in Request.Form.Files) + { + var fileExtension = Path.GetExtension(file.FileName); + var doc = await _documentService.UploadFileAsync(file, file.FileName); + var _doc = await _context.Documents.AsQueryable() + .FirstOrDefaultAsync(x => x.Id == doc.Id); + if (_doc != null) + { + var disciplineDisciplinary_DocWitnesses = new DisciplineDisciplinary_DocWitnesses + { + DisciplineDisciplinary = data, + Document = _doc, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, + }; + await _context.DisciplineDisciplinary_DocWitnessess.AddAsync(disciplineDisciplinary_DocWitnesses); + } + } + } + await _context.SaveChangesAsync(); + return Success(); + } + + /// + /// ลบไฟล์พยานและการบันทึกถ้อยคำ + /// + /// + /// + /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง + /// ไม่ได้ Login เข้าระบบ + /// เมื่อเกิดข้อผิดพลาดในการทำงาน + [HttpDelete("witnesses/file/{id:guid}/{docId:guid}")] + public async Task> DeleteFileDisciplineDisciplinaryWitnessess(Guid id, Guid docId) + { + var data = await _context.DisciplineDisciplinarys + .Include(x => x.DisciplineDisciplinary_DocWitnessess) + .ThenInclude(x => x.Document) + .Where(x => x.Id == id) + .FirstOrDefaultAsync(); + if (data == null) + return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound); + if (data.Status.Trim().ToUpper() != "NEW") + return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), (int)StatusCodes.Status500InternalServerError); + var dataDoc = data.DisciplineDisciplinary_DocWitnessess.Where(x => x.Document.Id == docId).FirstOrDefault(); + if (dataDoc != null) + { + _context.DisciplineDisciplinary_DocWitnessess.Remove(dataDoc); + await _context.SaveChangesAsync(); + await _documentService.DeleteFileAsync(docId); + await _context.SaveChangesAsync(); + return Success(); + } + else + { + return Error(new Exception("ไม่พอไฟล์นี้ในระบบ"), (int)StatusCodes.Status404NotFound); + } + } + + /// + /// อัพไฟล์เอกสารหลักฐานอื่น ๆ + /// + /// + /// + /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง + /// ไม่ได้ Login เข้าระบบ + /// เมื่อเกิดข้อผิดพลาดในการทำงาน + [HttpPut("other/file/{id:guid}")] + public async Task> UploadFileDisciplineDisciplinaryOther([FromForm] DisciplineFileRequest req, Guid id) + { + var data = await _context.DisciplineDisciplinarys + .Where(x => x.Id == id) + .FirstOrDefaultAsync(); + if (data == null) + return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound); + if (data.Status.Trim().ToUpper() != "NEW") + return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), (int)StatusCodes.Status500InternalServerError); + + if (Request.Form.Files != null && Request.Form.Files.Count != 0) + { + foreach (var file in Request.Form.Files) + { + var fileExtension = Path.GetExtension(file.FileName); + var doc = await _documentService.UploadFileAsync(file, file.FileName); + var _doc = await _context.Documents.AsQueryable() + .FirstOrDefaultAsync(x => x.Id == doc.Id); + if (_doc != null) + { + var disciplineDisciplinary_DocOther = new DisciplineDisciplinary_DocOther + { + DisciplineDisciplinary = data, + Document = _doc, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, + }; + await _context.DisciplineDisciplinary_DocOthers.AddAsync(disciplineDisciplinary_DocOther); + } + } + } + await _context.SaveChangesAsync(); + return Success(); + } + + /// + /// ลบไฟล์เอกสารหลักฐานอื่น ๆ + /// + /// + /// + /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง + /// ไม่ได้ Login เข้าระบบ + /// เมื่อเกิดข้อผิดพลาดในการทำงาน + [HttpDelete("other/file/{id:guid}/{docId:guid}")] + public async Task> DeleteFileDisciplineDisciplinaryOther(Guid id, Guid docId) + { + var data = await _context.DisciplineDisciplinarys + .Include(x => x.DisciplineDisciplinary_DocOthers) + .ThenInclude(x => x.Document) + .Where(x => x.Id == id) + .FirstOrDefaultAsync(); + if (data == null) + return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound); + if (data.Status.Trim().ToUpper() != "NEW") + return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), (int)StatusCodes.Status500InternalServerError); + var dataDoc = data.DisciplineDisciplinary_DocOthers.Where(x => x.Document.Id == docId).FirstOrDefault(); + if (dataDoc != null) + { + _context.DisciplineDisciplinary_DocOthers.Remove(dataDoc); + await _context.SaveChangesAsync(); + await _documentService.DeleteFileAsync(docId); + await _context.SaveChangesAsync(); + return Success(); + } + else + { + return Error(new Exception("ไม่พอไฟล์นี้ในระบบ"), (int)StatusCodes.Status404NotFound); + } + } + } +} diff --git a/BMA.EHR.Discipline.Service/Controllers/DisciplineInvestigateController.cs b/BMA.EHR.Discipline.Service/Controllers/DisciplineInvestigateController.cs index 3d4ee3e4..bf585bf5 100644 --- a/BMA.EHR.Discipline.Service/Controllers/DisciplineInvestigateController.cs +++ b/BMA.EHR.Discipline.Service/Controllers/DisciplineInvestigateController.cs @@ -57,21 +57,13 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers { var data_search = (from x in _context.DisciplineInvestigates where x.Title.Contains(keyword) - // x.Description.Contains(keyword) || - // x.Appellant.Contains(keyword) - // TextOffenseDetails(x.OffenseDetails).Contains(keyword) || - // x.CreatedAt.Contains(keyword) || - // TextLevelConsideration(x.LevelConsideration).Contains(keyword) || - // x.DateConsideration.Contains(keyword) || - // TextStatus(x.Status).Contains(keyword) || - // x.RejectReason == null ? false : x.RejectReason.Contains(keyword) select x).ToList(); var data = data_search .Select(x => new { Id = x.Id,//id ข้อมูลเรื่องสืบสวน Title = x.Title,//ชื่อเรื่อง - RespondentType = x.RespondentType, + RespondentType = x.RespondentType,//ผู้ถูกสืบสวน OffenseDetails = x.OffenseDetails,//ลักษณะความผิด Status = x.Status,//สถานะหรือผลการสืบสวน InvestigationDateStart = x.InvestigationDateStart, @@ -104,7 +96,7 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers Id = x.Id,//id ข้อมูลเรื่องสืบสวน IdComplaint = x.DisciplineComplaint.Id,//id ข้อมูลเรื่องร้องเรียน RespondentType = x.RespondentType,//ผู้ถูกสืบสวน - Persons = x.DisciplineInvestigate_Profiles.Select(p => new + Persons = x.DisciplineInvestigate_ProfileComplaints.Select(p => new { Id = p.Id, Idcard = p.CitizenId, @@ -183,9 +175,9 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpPut("complaint/{id:guid}")] - public async Task> UpdateDisciplineInvestigate([FromBody] DisciplineInvestigateComplaintRequest req, Guid id) + public async Task> UpdateDisciplineInvestigateComplaint([FromBody] DisciplineInvestigateComplaintRequest req, Guid id) { - var data = await _context.DisciplineInvestigates.Include(x => x.DisciplineInvestigate_Profiles).Where(x => x.Id == id).FirstOrDefaultAsync(); + var data = await _context.DisciplineInvestigates.Include(x => x.DisciplineInvestigate_ProfileComplaints).Where(x => x.Id == id).FirstOrDefaultAsync(); if (data == null) return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound); if (data.Status.Trim().ToUpper() != "NEW") @@ -197,13 +189,13 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers data.LastUpdateFullName = FullName ?? "System Administrator"; data.LastUpdateUserId = UserId ?? ""; data.LastUpdatedAt = DateTime.Now; - _context.DisciplineInvestigate_Profiles.RemoveRange(data.DisciplineInvestigate_Profiles); + _context.DisciplineInvestigate_ProfileComplaints.RemoveRange(data.DisciplineInvestigate_ProfileComplaints); if (data.RespondentType.Trim().ToUpper() == "PERSON") { foreach (var item in req.persons) { - data.DisciplineInvestigate_Profiles.Add( - new DisciplineInvestigate_Profile + data.DisciplineInvestigate_ProfileComplaints.Add( + new DisciplineInvestigate_ProfileComplaint { CitizenId = item.idcard, Prefix = item.prefix, @@ -267,6 +259,23 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers Phone = d.DisciplineDirector.Phone, Total = d.DisciplineDirector.DisciplineInvestigate_Directors.Count(), }).ToList(), + RespondentType = x.RespondentType,//ผู้ถูกสืบสวน + Persons = x.DisciplineInvestigate_ProfileComplaints.Select(p => new + { + Id = p.Id, + Idcard = p.CitizenId, + Name = $"{p.Prefix}{p.FirstName} {p.LastName}", + Prefix = p.Prefix, + FirstName = p.FirstName, + LastName = p.LastName, + Position = p.Position, + PositionLevel = p.PositionLevel, + Salary = p.Salary, + PersonId = p.PersonId, + PosNo = p.PosNo, + Organization = p.Organization, + }),//รายการข้อมูลบุคลผู้ถูกสืบสวน + OrganizationId = x.Organization,//id หน่วยงานกรณี type เป็นหน่วยงาน DisciplineInvestigateDocs = x.DisciplineInvestigate_Docs.Where(d => d.Document != null).Select(d => new { d.Document.Id, d.Document.FileName }), DisciplineInvestigateRelevantDocs = x.DisciplineInvestigateRelevant_Docs.Where(d => d.Document != null).Select(d => new { d.Document.Id, d.Document.FileName }), }) @@ -312,6 +321,9 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers _data.Status, _data.Result, _data.Director, + _data.RespondentType, + _data.Persons, + _data.OrganizationId, disciplineInvestigateDocs, disciplineInvestigateRelevantDocs, }; @@ -345,7 +357,7 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers data.InvestigationDateEnd = req.investigationDateEnd; data.InvestigationDescription = req.investigationDescription; data.InvestigationStatusResult = req.investigationStatusResult.Trim().ToUpper(); - data.InvestigationCauseText = req.investigationCauseText.Trim().ToUpper(); + data.InvestigationCauseText = req.investigationCauseText; data.Result = req.result; data.LastUpdateFullName = FullName ?? "System Administrator"; data.LastUpdateUserId = UserId ?? ""; @@ -371,6 +383,36 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers ); } } + data.Organization = req.organizationId; + data.RespondentType = req.respondentType; + _context.DisciplineInvestigate_ProfileComplaints.RemoveRange(data.DisciplineInvestigate_ProfileComplaints); + if (data.RespondentType.Trim().ToUpper() == "PERSON") + { + foreach (var item in req.persons) + { + data.DisciplineInvestigate_ProfileComplaints.Add( + new DisciplineInvestigate_ProfileComplaint + { + CitizenId = item.idcard, + Prefix = item.prefix, + FirstName = item.firstName, + LastName = item.lastName, + Organization = item.organization, + Position = item.position, + PositionLevel = item.positionLevel, + Salary = item.salary, + PersonId = item.personId, + PosNo = item.posNo, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, + } + ); + } + } await _context.SaveChangesAsync(); return Success(data.Id); } @@ -409,17 +451,144 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน - [HttpGet("approve/{id:guid}")] - public async Task> ApproveDisciplineInvestigate(Guid id) + [HttpPut("approve/{id:guid}")] + public async Task> ApproveDisciplineInvestigate([FromBody] DisciplinePersonIdRequest req, Guid id) { var data = await _context.DisciplineInvestigates + .Include(x => x.DisciplineInvestigate_DocComplaints) + .ThenInclude(x => x.Document) + .Include(x => x.DisciplineInvestigate_Docs) + .ThenInclude(x => x.Document) + .Include(x => x.DisciplineInvestigateRelevant_Docs) + .ThenInclude(x => x.Document) + .Include(x => x.DisciplineInvestigate_ProfileComplaints) + .Include(x => x.DisciplineInvestigate_Directors) + .ThenInclude(x => x.DisciplineDirector) .Where(x => x.Id == id) .FirstOrDefaultAsync(); if (data == null) return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound); if (data.Status.Trim().ToUpper() != "NEW") - return Error(new Exception("ไม่สามารถส่งต่อไปสืบสวนได้"), (int)StatusCodes.Status500InternalServerError); - data.Status = "SEND_INVESTIGATE"; + return Error(new Exception("ไม่สามารถส่งต่อไปสอบสวนได้"), (int)StatusCodes.Status500InternalServerError); + data.Status = "SEND_DISCIPLINARY"; + + var disciplineDisciplinary = new Domain.Models.Discipline.DisciplineDisciplinary + { + RespondentType = data.RespondentType.Trim().ToUpper(), + Organization = data.Organization, + ConsideredAgency = data.ConsideredAgency, + Title = data.Title, + Description = data.Description, + DateReceived = data.DateReceived, + LevelConsideration = data.LevelConsideration.Trim().ToUpper(), + DateConsideration = data.DateConsideration, + OffenseDetails = data.OffenseDetails.Trim().ToUpper(), + DateNotification = data.DateNotification, + ComplaintFrom = data.ComplaintFrom, + Appellant = data.Appellant, + ResultComplaint = data.ResultComplaint, + ResultInvestigate = data.Result, + + InvestigationDetail = data.InvestigationDetail, + InvestigationDetailOther = data.InvestigationDetailOther, + InvestigationDateStart = data.InvestigationDateStart, + InvestigationDateEnd = data.InvestigationDateEnd, + InvestigationDescription = data.InvestigationDescription, + InvestigationStatusResult = data.InvestigationStatusResult, + InvestigationCauseText = data.InvestigationCauseText, + + Status = "NEW", + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, + }; + var persons = data.DisciplineInvestigate_ProfileComplaints.Where(x => req.persons.Contains(x.Id)).ToList(); + foreach (var item in persons) + { + disciplineDisciplinary.DisciplineDisciplinary_ProfileComplaintInvestigates.Add( + new DisciplineDisciplinary_ProfileComplaintInvestigate + { + PersonId = item.PersonId, + CitizenId = item.CitizenId, + Prefix = item.Prefix, + FirstName = item.FirstName, + LastName = item.LastName, + Organization = item.Organization, + Salary = item.Salary, + PosNo = item.PosNo, + Position = item.Position, + PositionLevel = item.PositionLevel, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, + }); + } + foreach (var item in data.DisciplineInvestigate_DocComplaints) + { + disciplineDisciplinary.DisciplineDisciplinary_DocComplaintInvestigates.Add( + new DisciplineDisciplinary_DocComplaintInvestigate + { + Document = item.Document, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, + }); + } + foreach (var item in data.DisciplineInvestigate_Docs) + { + disciplineDisciplinary.DisciplineDisciplinary_DocInvestigates.Add( + new DisciplineDisciplinary_DocInvestigate + { + Document = item.Document, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, + }); + } + foreach (var item in data.DisciplineInvestigateRelevant_Docs) + { + disciplineDisciplinary.DisciplineDisciplinary_DocInvestigateRelevants.Add( + new DisciplineDisciplinary_DocInvestigateRelevant + { + Document = item.Document, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, + }); + } + foreach (var item in data.DisciplineInvestigate_Directors) + { + disciplineDisciplinary.DisciplineDisciplinary_DirectorInvestigates.Add( + new DisciplineDisciplinary_DirectorInvestigate + { + DisciplineDirector = item.DisciplineDirector, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, + }); + } + + data.DisciplineDisciplinarys.Add(disciplineDisciplinary); + await _context.SaveChangesAsync(); + return Success(disciplineDisciplinary.Id); await _context.SaveChangesAsync(); return Success(); @@ -498,7 +667,7 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers } /// - /// ลบอัพไฟล์เอกสารสืบสวนวินัย + /// ลบไฟล์เอกสารสืบสวนวินัย /// /// /// @@ -524,8 +693,12 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers await _context.SaveChangesAsync(); await _documentService.DeleteFileAsync(docId); await _context.SaveChangesAsync(); + return Success(); + } + else + { + return Error(new Exception("ไม่พอไฟล์นี้ในระบบ"), (int)StatusCodes.Status404NotFound); } - return Success(); } /// @@ -577,7 +750,7 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers } /// - /// ลบอัพไฟล์เอกสารร้องเรียนวินัย + /// ลบไฟล์เอกสารร้องเรียนวินัย /// /// /// @@ -610,8 +783,12 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers await _documentService.DeleteFileAsync(docId); await _context.SaveChangesAsync(); } + return Success(); + } + else + { + return Error(new Exception("ไม่พอไฟล์นี้ในระบบ"), (int)StatusCodes.Status404NotFound); } - return Success(); } /// @@ -663,7 +840,7 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers } /// - /// ลบอัพไฟล์เอกสารเกี่ยวข้องสืบสวนวินัย + /// ลบไฟล์เอกสารเกี่ยวข้องสืบสวนวินัย /// /// /// @@ -689,8 +866,12 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers await _context.SaveChangesAsync(); await _documentService.DeleteFileAsync(docId); await _context.SaveChangesAsync(); + return Success(); + } + else + { + return Error(new Exception("ไม่พอไฟล์นี้ในระบบ"), (int)StatusCodes.Status404NotFound); } - return Success(); } } } diff --git a/BMA.EHR.Discipline.Service/Requests/DisciplineDisciplinaryComplaintRequest.cs b/BMA.EHR.Discipline.Service/Requests/DisciplineDisciplinaryComplaintRequest.cs new file mode 100644 index 00000000..1dca1c56 --- /dev/null +++ b/BMA.EHR.Discipline.Service/Requests/DisciplineDisciplinaryComplaintRequest.cs @@ -0,0 +1,25 @@ +using Microsoft.EntityFrameworkCore; + +namespace BMA.EHR.Discipline.Service.Requests +{ + public class DisciplineDisciplinaryComplaintRequest + { + public DisciplineDisciplinaryInvestigateComplaintProfileRequest[] persons { get; set; }// กรณีบุคคลใส่ id คน มาใน array แต่ถ้าเป็น type อื่นจะ null + public string title { get; set; }// *เรื่องที่ร้องเรียน + public string description { get; set; }// *รายละเอียดของเรื่องร้องเรียน + public string offenseDetails { get; set; }// *ลักษณะความผิดครั้งแรกจะเป็น "ยังไม่ระบุ" (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง) + } + public class DisciplineDisciplinaryInvestigateComplaintProfileRequest + { + public Guid? personId { get; set; } + public string? idcard { get; set; } + public string? prefix { get; set; } + public string? firstName { get; set; } + public string? lastName { get; set; } + public string? organization { get; set; } + public string? position { get; set; } + public string? positionLevel { get; set; } + public string? posNo { get; set; } + public double? salary { get; set; } + } +} diff --git a/BMA.EHR.Discipline.Service/Requests/DisciplineDisciplinaryInvestigateRequest.cs b/BMA.EHR.Discipline.Service/Requests/DisciplineDisciplinaryInvestigateRequest.cs new file mode 100644 index 00000000..f9663745 --- /dev/null +++ b/BMA.EHR.Discipline.Service/Requests/DisciplineDisciplinaryInvestigateRequest.cs @@ -0,0 +1,18 @@ +using Microsoft.EntityFrameworkCore; + +namespace BMA.EHR.Discipline.Service.Requests +{ + public class DisciplineDisciplinaryInvestigateRequest + { + public string investigationDetail { get; set; } + public string? investigationDetailOther { get; set; } + public DateTime investigationDateStart { get; set; } + public DateTime investigationDateEnd { get; set; } + public string investigationDescription { get; set; } + public string investigationStatusResult { get; set; } + public string? investigationCauseText { get; set; } + public string? result { get; set; } + public Guid[] directors { get; set; } + + } +} diff --git a/BMA.EHR.Discipline.Service/Requests/DisciplineDisciplinaryRequest.cs b/BMA.EHR.Discipline.Service/Requests/DisciplineDisciplinaryRequest.cs new file mode 100644 index 00000000..588640ae --- /dev/null +++ b/BMA.EHR.Discipline.Service/Requests/DisciplineDisciplinaryRequest.cs @@ -0,0 +1,23 @@ +using Microsoft.EntityFrameworkCore; + +namespace BMA.EHR.Discipline.Service.Requests +{ + public class DisciplineDisciplinaryRequest + { + public string? DisciplinaryWitnesses { get; set; } + public string? DisciplinaryRecordAccuser { get; set; } + public string? DisciplinarySummaryEvidence { get; set; } + public string? DisciplinaryRefLaw { get; set; } + public string? DisciplinaryFaultLevel { get; set; } + public string? DisciplinaryInvestigateAt { get; set; } + public string? DisciplinaryCaseFault { get; set; } + public DateTime DisciplinaryDateEvident { get; set; } + public DateTime DisciplinaryDateAllegation { get; set; } + public string? Result { get; set; } + public Guid[] directors { get; set; } + public DisciplineDisciplinaryInvestigateComplaintProfileRequest[] persons { get; set; }// กรณีบุคคลใส่ id คน มาใน array แต่ถ้าเป็น type อื่นจะ null + public Guid? organizationId { get; set; }// กรณีหน่วยงานใส่ id ของหน่วยงาน + public string respondentType { get; set; }// *ผู้ถูกร้องเรียน (PERSON คือ บุคคล, ORGANIZATION คือ หน่วยงาน, BANGKOK คือ กรุงเทพมหานคร) + + } +} diff --git a/BMA.EHR.Discipline.Service/Requests/DisciplineInvestigateComplaintRequest.cs b/BMA.EHR.Discipline.Service/Requests/DisciplineInvestigateComplaintRequest.cs index 53233f2a..4731e4b0 100644 --- a/BMA.EHR.Discipline.Service/Requests/DisciplineInvestigateComplaintRequest.cs +++ b/BMA.EHR.Discipline.Service/Requests/DisciplineInvestigateComplaintRequest.cs @@ -4,7 +4,7 @@ namespace BMA.EHR.Discipline.Service.Requests { public class DisciplineInvestigateComplaintRequest { - public DisciplineComplaintProfileRequest[] persons { get; set; }// กรณีบุคคลใส่ id คน มาใน array แต่ถ้าเป็น type อื่นจะ null + public DisciplineInvestigateComplaintProfileRequest[] persons { get; set; }// กรณีบุคคลใส่ id คน มาใน array แต่ถ้าเป็น type อื่นจะ null public string title { get; set; }// *เรื่องที่ร้องเรียน public string description { get; set; }// *รายละเอียดของเรื่องร้องเรียน public string offenseDetails { get; set; }// *ลักษณะความผิดครั้งแรกจะเป็น "ยังไม่ระบุ" (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง) diff --git a/BMA.EHR.Discipline.Service/Requests/DisciplineInvestigateRequest.cs b/BMA.EHR.Discipline.Service/Requests/DisciplineInvestigateRequest.cs index 92daa621..e7a4be02 100644 --- a/BMA.EHR.Discipline.Service/Requests/DisciplineInvestigateRequest.cs +++ b/BMA.EHR.Discipline.Service/Requests/DisciplineInvestigateRequest.cs @@ -5,14 +5,17 @@ namespace BMA.EHR.Discipline.Service.Requests public class DisciplineInvestigateRequest { public string investigationDetail { get; set; } - public string investigationDetailOther { get; set; } + public string? investigationDetailOther { get; set; } public DateTime investigationDateStart { get; set; } public DateTime investigationDateEnd { get; set; } public string investigationDescription { get; set; } public string investigationStatusResult { get; set; } - public string investigationCauseText { get; set; } - public string result { get; set; } + public string? investigationCauseText { get; set; } + public string? result { get; set; } public Guid[] directors { get; set; } + public DisciplineInvestigateComplaintProfileRequest[] persons { get; set; }// กรณีบุคคลใส่ id คน มาใน array แต่ถ้าเป็น type อื่นจะ null + public Guid? organizationId { get; set; }// กรณีหน่วยงานใส่ id ของหน่วยงาน + public string respondentType { get; set; }// *ผู้ถูกร้องเรียน (PERSON คือ บุคคล, ORGANIZATION คือ หน่วยงาน, BANGKOK คือ กรุงเทพมหานคร) } } diff --git a/BMA.EHR.Domain/Models/Discipline/DisciplineDirector.cs b/BMA.EHR.Domain/Models/Discipline/DisciplineDirector.cs index ed7a783a..d26c6c2b 100644 --- a/BMA.EHR.Domain/Models/Discipline/DisciplineDirector.cs +++ b/BMA.EHR.Domain/Models/Discipline/DisciplineDirector.cs @@ -25,5 +25,6 @@ namespace BMA.EHR.Domain.Models.Discipline [Required, Comment("เบอร์โทรศัพท์")] public string Phone { get; set; } = string.Empty; public virtual List DisciplineInvestigate_Directors { get; set; } = new List(); + public virtual List DisciplineDisciplinary_DirectorInvestigates { get; set; } = new List(); } } diff --git a/BMA.EHR.Domain/Models/Discipline/DisciplineDisciplinary.cs b/BMA.EHR.Domain/Models/Discipline/DisciplineDisciplinary.cs new file mode 100644 index 00000000..9dc5d180 --- /dev/null +++ b/BMA.EHR.Domain/Models/Discipline/DisciplineDisciplinary.cs @@ -0,0 +1,113 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using BMA.EHR.Domain.Models.Base; +using BMA.EHR.Domain.Models.Organizations; +using Microsoft.EntityFrameworkCore; + +namespace BMA.EHR.Domain.Models.Discipline +{ + public class DisciplineDisciplinary : EntityBase + { + + [Required, Comment("สถานะเรื่องร้องเรียน มีดังนี้ ใหม่ (NEW), ยุติเรื่อง (STOP), มีมูลส่งไปสืบสวนแล้ว (SEND_INVESTIGATE)")] + public string Status { get; set; } = string.Empty; + [Required, Comment("ผู้ถูกร้องเรียน (PERSON คือ บุคคล, ORGANIZATION คือ หน่วยงาน, BANGKOK คือ กรุงเทพมหานคร)")] + public string RespondentType { get; set; } = string.Empty; + + [Required, Comment("เรื่องที่ร้องเรียน"), Column(TypeName = "text")] + public string Title { get; set; } = string.Empty; + + [Required, Comment("รายละเอียดของเรื่องร้องเรียน"), Column(TypeName = "text")] + public string Description { get; set; } = string.Empty; + + [Required, Comment("วันที่รับเรื่อง เป็นวันที่ถือเป็นจุดเริ่มต้นของวินัยนั้น ๆ")] + public DateTime DateReceived { get; set; } + [Required, Comment("ระดับการพิจารณา 'ยังไม่ระบุ' (NORMAL คือ ปกติ, URGENT คือ ด่วน, VERY_URGENT คือ ด่วนมาก)")] + public string LevelConsideration { get; set; } = string.Empty; + + [Comment("วันที่กำหนดพิจารณา")] + public DateTime? DateConsideration { get; set; } + [Required, Comment("ลักษณะความผิดครั้งแรกจะเป็น 'ยังไม่ระบุ' (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง)")] + public string OffenseDetails { get; set; } = string.Empty; + + [Required, Comment("วันแจ้งเตือนล่วงหน้า")] + public DateTime DateNotification { get; set; } + [Required, Comment("รับเรื่องร้องเรียนจาก ระบุว่ารับเรื่องมาจากใคร/หน่วยงานไหน (สตง., ปปช., ปปท., จดหมาย, อีเมล, โทรศัพท์, บอกกล่าว)")] + public string ComplaintFrom { get; set; } = string.Empty; + + [Required, Comment("ผู้ร้องเรียน")] + public string Appellant { get; set; } = string.Empty; + + // [Required, Comment("อ้างอิงรหัสเอกสาร")] + // public Document Document { get; set; } + + [Comment("ผลการตรวจสอบเรื่องร้องเรียน")] + public string? ResultComplaint { get; set; } + + [Comment("ผลการตรวจสอบเรื่องสืบสวน")] + public string? ResultInvestigate { get; set; } + + [Comment("ผลการตรวจสอบ")] + public string? Result { get; set; } + + [Comment("กรณีหน่วยงานใส่ id ของหน่วยงาน")] + public Guid? Organization { get; set; } + + [Required, Comment("หน่วยงานที่พิจารณา จะเปลี่ยนไปตามผู้ถูกร้องดูรายละเอียดด้านล่าง")] + public Guid ConsideredAgency { get; set; } + + + [Comment("ลักษณะการสืบสวน (APPOINT_DIRECTORS คือ แต่งตั้งกรรมการสืบสวน, SECRET_INVESTIGATION คือ สืบสวนทางลับ, OTHER คือ อื่น ๆ)")] + public string? InvestigationDetail { get; set; } + + [Comment("ลักษณะการสืบสวนกรณีเลือกอื่นๆ")] + public string? InvestigationDetailOther { get; set; } + + [Comment("วันที่เริ่มการสืบสวน")] + public DateTime? InvestigationDateStart { get; set; } + + [Comment("วันที่สิ้นสุดการสืบสวน")] + public DateTime? InvestigationDateEnd { get; set; } + + [Comment("รายละเอียดเกี่ยวกับการสืบสวน")] + public string? InvestigationDescription { get; set; } + + [Comment("สถานะหรือผลการสืบสวน (NOT_SPECIFIED คือ ยังไม่ระบุ, HAVE_CAUSE คือ มีมูล, NO_CAUSE คือ ไม่มีมูล")] + public string? InvestigationStatusResult { get; set; } + + [Comment("กรณีมีมูลต้องเลือกว่า 'ร้ายแรง' หรือ 'ไม่ร้ายแรง'")] + public string? InvestigationCauseText { get; set; } + + + [Comment("พยานและบันทึกถ้อยคำพยาน")] + public string? DisciplinaryWitnesses { get; set; } + [Comment("บันทึกถ้อยคำของผู้กล่าวหา")] + public string? DisciplinaryRecordAccuser { get; set; } + [Comment("สรุปพยานหลักฐานสนับสนุนข้อกล่าวหา")] + public string? DisciplinarySummaryEvidence { get; set; } + [Comment("อ้างอิงมาตราตามกฎหมาย")] + public string? DisciplinaryRefLaw { get; set; } + [Comment("ระดับโทษความผิด กรณีไม่ร้ายแรง: ภาคทัณฑ์, ตัดเงินเดือน, ลดขั้นเงินเดือน | กรณีร้ายแรง: ปลดออก, ไล่ออก")] + public string? DisciplinaryFaultLevel { get; set; } + [Comment("สอบสวนที่")] + public string? DisciplinaryInvestigateAt { get; set; } + [Comment("กรณีความผิด")] + public string? DisciplinaryCaseFault { get; set; } + [Comment("วันที่สรุปพยานหลักฐาน")] + public DateTime? DisciplinaryDateEvident { get; set; } + [Comment("วันที่รับทราบข้อกล่าวหา")] + public DateTime? DisciplinaryDateAllegation { get; set; } + + public DisciplineInvestigate DisciplineInvestigate { get; set; } + public virtual List DisciplineDisciplinary_ProfileComplaintInvestigates { get; set; } = new List(); + public virtual List DisciplineDisciplinary_DocComplaintInvestigates { get; set; } = new List(); + public virtual List DisciplineDisciplinary_DocInvestigates { get; set; } = new List(); + public virtual List DisciplineDisciplinary_DocInvestigateRelevants { get; set; } = new List(); + public virtual List DisciplineDisciplinary_DirectorInvestigates { get; set; } = new List(); + + public virtual List DisciplineDisciplinary_DocSummaryEvidences { get; set; } = new List(); + public virtual List DisciplineDisciplinary_DocRecordAccusers { get; set; } = new List(); + public virtual List DisciplineDisciplinary_DocWitnessess { get; set; } = new List(); + public virtual List DisciplineDisciplinary_DocOthers { get; set; } = new List(); + } +} diff --git a/BMA.EHR.Domain/Models/Discipline/DisciplineDisciplinary_DirectorInvestigate.cs b/BMA.EHR.Domain/Models/Discipline/DisciplineDisciplinary_DirectorInvestigate.cs new file mode 100644 index 00000000..f9f8c22f --- /dev/null +++ b/BMA.EHR.Domain/Models/Discipline/DisciplineDisciplinary_DirectorInvestigate.cs @@ -0,0 +1,16 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using BMA.EHR.Domain.Models.Base; +using BMA.EHR.Domain.Models.Organizations; +using Microsoft.EntityFrameworkCore; + +namespace BMA.EHR.Domain.Models.Discipline +{ + public class DisciplineDisciplinary_DirectorInvestigate : EntityBase + { + [Required, Comment("อ้างอิงรหัสกรรมการ")] + public DisciplineDirector DisciplineDirector { get; set; } + [Required, Comment("อ้างอิงเรื่องสอบสวน")] + public DisciplineDisciplinary DisciplineDisciplinary { get; set; } + } +} diff --git a/BMA.EHR.Domain/Models/Discipline/DisciplineDisciplinary_DocComplaintInvestigate.cs b/BMA.EHR.Domain/Models/Discipline/DisciplineDisciplinary_DocComplaintInvestigate.cs new file mode 100644 index 00000000..5af97e3e --- /dev/null +++ b/BMA.EHR.Domain/Models/Discipline/DisciplineDisciplinary_DocComplaintInvestigate.cs @@ -0,0 +1,16 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using BMA.EHR.Domain.Models.Base; +using BMA.EHR.Domain.Models.Organizations; +using Microsoft.EntityFrameworkCore; + +namespace BMA.EHR.Domain.Models.Discipline +{ + public class DisciplineDisciplinary_DocComplaintInvestigate : EntityBase + { + [Required, Comment("อ้างอิงรหัสเอกสาร")] + public Document Document { get; set; } + [Required, Comment("อ้างอิงเรื่องสอบสวน")] + public DisciplineDisciplinary DisciplineDisciplinary { get; set; } + } +} diff --git a/BMA.EHR.Domain/Models/Discipline/DisciplineDisciplinary_DocInvestigate.cs b/BMA.EHR.Domain/Models/Discipline/DisciplineDisciplinary_DocInvestigate.cs new file mode 100644 index 00000000..ddc1d85f --- /dev/null +++ b/BMA.EHR.Domain/Models/Discipline/DisciplineDisciplinary_DocInvestigate.cs @@ -0,0 +1,16 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using BMA.EHR.Domain.Models.Base; +using BMA.EHR.Domain.Models.Organizations; +using Microsoft.EntityFrameworkCore; + +namespace BMA.EHR.Domain.Models.Discipline +{ + public class DisciplineDisciplinary_DocInvestigate : EntityBase + { + [Required, Comment("อ้างอิงรหัสเอกสาร")] + public Document Document { get; set; } + [Required, Comment("อ้างอิงเรื่องสอบสวน")] + public DisciplineDisciplinary DisciplineDisciplinary { get; set; } + } +} diff --git a/BMA.EHR.Domain/Models/Discipline/DisciplineDisciplinary_DocInvestigateRelevant.cs b/BMA.EHR.Domain/Models/Discipline/DisciplineDisciplinary_DocInvestigateRelevant.cs new file mode 100644 index 00000000..2f8e97c8 --- /dev/null +++ b/BMA.EHR.Domain/Models/Discipline/DisciplineDisciplinary_DocInvestigateRelevant.cs @@ -0,0 +1,16 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using BMA.EHR.Domain.Models.Base; +using BMA.EHR.Domain.Models.Organizations; +using Microsoft.EntityFrameworkCore; + +namespace BMA.EHR.Domain.Models.Discipline +{ + public class DisciplineDisciplinary_DocInvestigateRelevant : EntityBase + { + [Required, Comment("อ้างอิงรหัสเอกสาร")] + public Document Document { get; set; } + [Required, Comment("อ้างอิงเรื่องสอบสวน")] + public DisciplineDisciplinary DisciplineDisciplinary { get; set; } + } +} diff --git a/BMA.EHR.Domain/Models/Discipline/DisciplineDisciplinary_DocOther.cs b/BMA.EHR.Domain/Models/Discipline/DisciplineDisciplinary_DocOther.cs new file mode 100644 index 00000000..3c20f52c --- /dev/null +++ b/BMA.EHR.Domain/Models/Discipline/DisciplineDisciplinary_DocOther.cs @@ -0,0 +1,16 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using BMA.EHR.Domain.Models.Base; +using BMA.EHR.Domain.Models.Organizations; +using Microsoft.EntityFrameworkCore; + +namespace BMA.EHR.Domain.Models.Discipline +{ + public class DisciplineDisciplinary_DocOther : EntityBase + { + [Required, Comment("อ้างอิงรหัสเอกสาร")] + public Document Document { get; set; } + [Required, Comment("อ้างอิงเรื่องสอบสวน")] + public DisciplineDisciplinary DisciplineDisciplinary { get; set; } + } +} diff --git a/BMA.EHR.Domain/Models/Discipline/DisciplineDisciplinary_DocRecordAccuser.cs b/BMA.EHR.Domain/Models/Discipline/DisciplineDisciplinary_DocRecordAccuser.cs new file mode 100644 index 00000000..3d6a50ed --- /dev/null +++ b/BMA.EHR.Domain/Models/Discipline/DisciplineDisciplinary_DocRecordAccuser.cs @@ -0,0 +1,16 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using BMA.EHR.Domain.Models.Base; +using BMA.EHR.Domain.Models.Organizations; +using Microsoft.EntityFrameworkCore; + +namespace BMA.EHR.Domain.Models.Discipline +{ + public class DisciplineDisciplinary_DocRecordAccuser : EntityBase + { + [Required, Comment("อ้างอิงรหัสเอกสาร")] + public Document Document { get; set; } + [Required, Comment("อ้างอิงเรื่องสอบสวน")] + public DisciplineDisciplinary DisciplineDisciplinary { get; set; } + } +} diff --git a/BMA.EHR.Domain/Models/Discipline/DisciplineDisciplinary_DocSummaryEvidence.cs b/BMA.EHR.Domain/Models/Discipline/DisciplineDisciplinary_DocSummaryEvidence.cs new file mode 100644 index 00000000..412e0a1b --- /dev/null +++ b/BMA.EHR.Domain/Models/Discipline/DisciplineDisciplinary_DocSummaryEvidence.cs @@ -0,0 +1,16 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using BMA.EHR.Domain.Models.Base; +using BMA.EHR.Domain.Models.Organizations; +using Microsoft.EntityFrameworkCore; + +namespace BMA.EHR.Domain.Models.Discipline +{ + public class DisciplineDisciplinary_DocSummaryEvidence : EntityBase + { + [Required, Comment("อ้างอิงรหัสเอกสาร")] + public Document Document { get; set; } + [Required, Comment("อ้างอิงเรื่องสอบสวน")] + public DisciplineDisciplinary DisciplineDisciplinary { get; set; } + } +} diff --git a/BMA.EHR.Domain/Models/Discipline/DisciplineDisciplinary_DocWitnesses.cs b/BMA.EHR.Domain/Models/Discipline/DisciplineDisciplinary_DocWitnesses.cs new file mode 100644 index 00000000..7301f9a9 --- /dev/null +++ b/BMA.EHR.Domain/Models/Discipline/DisciplineDisciplinary_DocWitnesses.cs @@ -0,0 +1,16 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using BMA.EHR.Domain.Models.Base; +using BMA.EHR.Domain.Models.Organizations; +using Microsoft.EntityFrameworkCore; + +namespace BMA.EHR.Domain.Models.Discipline +{ + public class DisciplineDisciplinary_DocWitnesses : EntityBase + { + [Required, Comment("อ้างอิงรหัสเอกสาร")] + public Document Document { get; set; } + [Required, Comment("อ้างอิงเรื่องสอบสวน")] + public DisciplineDisciplinary DisciplineDisciplinary { get; set; } + } +} diff --git a/BMA.EHR.Domain/Models/Discipline/DisciplineDisciplinary_ProfileComplaintInvestigate.cs b/BMA.EHR.Domain/Models/Discipline/DisciplineDisciplinary_ProfileComplaintInvestigate.cs new file mode 100644 index 00000000..874efd26 --- /dev/null +++ b/BMA.EHR.Domain/Models/Discipline/DisciplineDisciplinary_ProfileComplaintInvestigate.cs @@ -0,0 +1,35 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using BMA.EHR.Domain.Models.Base; +using BMA.EHR.Domain.Models.MetaData; +using BMA.EHR.Domain.Models.Organizations; +using Microsoft.EntityFrameworkCore; + +namespace BMA.EHR.Domain.Models.Discipline +{ + public class DisciplineDisciplinary_ProfileComplaintInvestigate : EntityBase + { + [Comment("id อ้างอิง profile")] + public Guid? PersonId { get; set; } + [MaxLength(13), Comment("รหัสบัตรประชาชน")] + public string? CitizenId { get; set; } + [Comment("คำนำหน้า")] + public string? Prefix { get; set; } + [Required, MaxLength(100), Comment("ชื่อ")] + public string? FirstName { get; set; } + [Required, MaxLength(100), Comment("นามสกุล")] + public string? LastName { get; set; } + [Comment("สังกัด")] + public string? Organization { get; set; } + [Comment("ตำแหน่ง")] + public string? Position { get; set; } + [Comment("เลขที่ตำแหน่ง")] + public string? PosNo { get; set; } + [Comment("ระดับ")] + public string? PositionLevel { get; set; } + [Comment("เงินเดือน")] + public double? Salary { get; set; } + [Required, Comment("Id เรื่องสอบสวน")] + public DisciplineDisciplinary DisciplineDisciplinary { get; set; } + } +} diff --git a/BMA.EHR.Domain/Models/Discipline/DisciplineInvestigate.cs b/BMA.EHR.Domain/Models/Discipline/DisciplineInvestigate.cs index 4e975a32..ad693868 100644 --- a/BMA.EHR.Domain/Models/Discipline/DisciplineInvestigate.cs +++ b/BMA.EHR.Domain/Models/Discipline/DisciplineInvestigate.cs @@ -60,10 +60,10 @@ namespace BMA.EHR.Domain.Models.Discipline [Comment("ลักษณะการสืบสวนกรณีเลือกอื่นๆ")] public string? InvestigationDetailOther { get; set; } - [Comment("วันที่เริ่มการสอบสวน")] + [Comment("วันที่เริ่มการสืบสวน")] public DateTime? InvestigationDateStart { get; set; } - [Comment("วันที่สิ้นสุดการสอบสวน")] + [Comment("วันที่สิ้นสุดการสืบสวน")] public DateTime? InvestigationDateEnd { get; set; } [Comment("รายละเอียดเกี่ยวกับการสืบสวน")] @@ -75,10 +75,11 @@ namespace BMA.EHR.Domain.Models.Discipline [Comment("กรณีมีมูลต้องเลือกว่า 'ร้ายแรง' หรือ 'ไม่ร้ายแรง'")] public string? InvestigationCauseText { get; set; } public DisciplineComplaint DisciplineComplaint { get; set; } - public virtual List DisciplineInvestigate_Profiles { get; set; } = new List(); + public virtual List DisciplineInvestigate_ProfileComplaints { get; set; } = new List(); public virtual List DisciplineInvestigate_DocComplaints { get; set; } = new List(); public virtual List DisciplineInvestigate_Docs { get; set; } = new List(); public virtual List DisciplineInvestigateRelevant_Docs { get; set; } = new List(); public virtual List DisciplineInvestigate_Directors { get; set; } = new List(); + public virtual List DisciplineDisciplinarys { get; set; } = new List(); } } diff --git a/BMA.EHR.Domain/Models/Discipline/DisciplineInvestigateRelevant_Doc.cs b/BMA.EHR.Domain/Models/Discipline/DisciplineInvestigateRelevant_Doc.cs index 86d2a05a..9041e183 100644 --- a/BMA.EHR.Domain/Models/Discipline/DisciplineInvestigateRelevant_Doc.cs +++ b/BMA.EHR.Domain/Models/Discipline/DisciplineInvestigateRelevant_Doc.cs @@ -10,7 +10,7 @@ namespace BMA.EHR.Domain.Models.Discipline { [Required, Comment("อ้างอิงรหัสเอกสาร")] public Document Document { get; set; } - [Required, Comment("อ้างอิงเรื่องสอบสวน")] + [Required, Comment("อ้างอิงเรื่องสืบสวน")] public DisciplineInvestigate DisciplineInvestigate { get; set; } } } diff --git a/BMA.EHR.Domain/Models/Discipline/DisciplineInvestigate_Director.cs b/BMA.EHR.Domain/Models/Discipline/DisciplineInvestigate_Director.cs index 783b6a38..3dc15cf2 100644 --- a/BMA.EHR.Domain/Models/Discipline/DisciplineInvestigate_Director.cs +++ b/BMA.EHR.Domain/Models/Discipline/DisciplineInvestigate_Director.cs @@ -10,7 +10,7 @@ namespace BMA.EHR.Domain.Models.Discipline { [Required, Comment("อ้างอิงรหัสกรรมการ")] public DisciplineDirector DisciplineDirector { get; set; } - [Required, Comment("อ้างอิงเรื่องร้องเรียน")] + [Required, Comment("อ้างอิงเรื่องสืบสวน")] public DisciplineInvestigate DisciplineInvestigate { get; set; } } } diff --git a/BMA.EHR.Domain/Models/Discipline/DisciplineInvestigate_Doc.cs b/BMA.EHR.Domain/Models/Discipline/DisciplineInvestigate_Doc.cs index 7547d7d8..dea11d6d 100644 --- a/BMA.EHR.Domain/Models/Discipline/DisciplineInvestigate_Doc.cs +++ b/BMA.EHR.Domain/Models/Discipline/DisciplineInvestigate_Doc.cs @@ -10,7 +10,7 @@ namespace BMA.EHR.Domain.Models.Discipline { [Required, Comment("อ้างอิงรหัสเอกสาร")] public Document Document { get; set; } - [Required, Comment("อ้างอิงเรื่องสอบสวน")] + [Required, Comment("อ้างอิงเรื่องสืบสวน")] public DisciplineInvestigate DisciplineInvestigate { get; set; } } } diff --git a/BMA.EHR.Domain/Models/Discipline/DisciplineInvestigate_DocComplaint.cs b/BMA.EHR.Domain/Models/Discipline/DisciplineInvestigate_DocComplaint.cs index 472f3386..bbfdb413 100644 --- a/BMA.EHR.Domain/Models/Discipline/DisciplineInvestigate_DocComplaint.cs +++ b/BMA.EHR.Domain/Models/Discipline/DisciplineInvestigate_DocComplaint.cs @@ -10,7 +10,7 @@ namespace BMA.EHR.Domain.Models.Discipline { [Required, Comment("อ้างอิงรหัสเอกสาร")] public Document Document { get; set; } - [Required, Comment("อ้างอิงเรื่องร้องเรียน")] + [Required, Comment("อ้างอิงเรื่องสืบสวน")] public DisciplineInvestigate DisciplineInvestigate { get; set; } } } diff --git a/BMA.EHR.Domain/Models/Discipline/DisciplineInvestigate_Profile.cs b/BMA.EHR.Domain/Models/Discipline/DisciplineInvestigate_ProfileComplaint.cs similarity index 90% rename from BMA.EHR.Domain/Models/Discipline/DisciplineInvestigate_Profile.cs rename to BMA.EHR.Domain/Models/Discipline/DisciplineInvestigate_ProfileComplaint.cs index d137ca76..47572169 100644 --- a/BMA.EHR.Domain/Models/Discipline/DisciplineInvestigate_Profile.cs +++ b/BMA.EHR.Domain/Models/Discipline/DisciplineInvestigate_ProfileComplaint.cs @@ -7,7 +7,7 @@ using Microsoft.EntityFrameworkCore; namespace BMA.EHR.Domain.Models.Discipline { - public class DisciplineInvestigate_Profile : EntityBase + public class DisciplineInvestigate_ProfileComplaint : EntityBase { [Comment("id อ้างอิง profile")] public Guid? PersonId { get; set; } @@ -29,7 +29,7 @@ namespace BMA.EHR.Domain.Models.Discipline public string? PositionLevel { get; set; } [Comment("เงินเดือน")] public double? Salary { get; set; } - [Required, Comment("Id เรื่องร้องเรียน")] + [Required, Comment("Id เรื่องสืบสวน")] public DisciplineInvestigate DisciplineInvestigate { get; set; } } } diff --git a/BMA.EHR.Infrastructure/Migrations/DisciplineDb/20231123133022_add table DisciplineDisciplinary.Designer.cs b/BMA.EHR.Infrastructure/Migrations/DisciplineDb/20231123133022_add table DisciplineDisciplinary.Designer.cs new file mode 100644 index 00000000..254fd34f --- /dev/null +++ b/BMA.EHR.Infrastructure/Migrations/DisciplineDb/20231123133022_add table DisciplineDisciplinary.Designer.cs @@ -0,0 +1,10654 @@ +// +using System; +using BMA.EHR.Infrastructure.Persistence; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb +{ + [DbContext(typeof(DisciplineDbContext))] + [Migration("20231123133022_add table DisciplineDisciplinary")] + partial class addtableDisciplineDisciplinary + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "7.0.9") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("Appellant") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ผู้ร้องเรียน"); + + b.Property("ComplaintFrom") + .IsRequired() + .HasColumnType("longtext") + .HasComment("รับเรื่องร้องเรียนจาก ระบุว่ารับเรื่องมาจากใคร/หน่วยงานไหน (สตง., ปปช., ปปท., จดหมาย, อีเมล, โทรศัพท์, บอกกล่าว)"); + + b.Property("ConsideredAgency") + .HasColumnType("char(36)") + .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("DateConsideration") + .HasColumnType("datetime(6)") + .HasComment("วันที่กำหนดพิจารณา"); + + b.Property("DateNotification") + .HasColumnType("datetime(6)") + .HasComment("วันแจ้งเตือนล่วงหน้า"); + + b.Property("DateReceived") + .HasColumnType("datetime(6)") + .HasComment("วันที่รับเรื่อง เป็นวันที่ถือเป็นจุดเริ่มต้นของวินัยนั้น ๆ"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text") + .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("LevelConsideration") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ระดับการพิจารณา 'ยังไม่ระบุ' (NORMAL คือ ปกติ, URGENT คือ ด่วน, VERY_URGENT คือ ด่วนมาก)"); + + b.Property("OffenseDetails") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ลักษณะความผิดครั้งแรกจะเป็น 'ยังไม่ระบุ' (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง)"); + + b.Property("Organization") + .HasColumnType("char(36)") + .HasComment("กรณีหน่วยงานใส่ id ของหน่วยงาน"); + + b.Property("RespondentType") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ผู้ถูกร้องเรียน (PERSON คือ บุคคล, ORGANIZATION คือ หน่วยงาน, BANGKOK คือ กรุงเทพมหานคร)"); + + b.Property("Result") + .HasColumnType("longtext") + .HasComment("ผลการตรวจสอบ"); + + b.Property("Status") + .IsRequired() + .HasColumnType("longtext") + .HasComment("สถานะเรื่องร้องเรียน มีดังนี้ ใหม่ (NEW), ยุติเรื่อง (STOP), มีมูลส่งไปสืบสวนแล้ว (SEND_INVESTIGATE)"); + + b.Property("Title") + .IsRequired() + .HasColumnType("text") + .HasComment("เรื่องที่ร้องเรียน"); + + b.HasKey("Id"); + + b.ToTable("DisciplineComplaints"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Channel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Name") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ชื่อประเภทการร้องเรียน"); + + b.HasKey("Id"); + + b.ToTable("DisciplineComplaint_Channels"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Doc", 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("DisciplineComplaintId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineComplaintId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineComplaint_Docs"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Profile", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CitizenId") + .HasMaxLength(13) + .HasColumnType("varchar(13)") + .HasComment("รหัสบัตรประชาชน"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineComplaintId") + .HasColumnType("char(36)"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("ชื่อ"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .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("Organization") + .HasColumnType("longtext") + .HasComment("สังกัด"); + + b.Property("PersonId") + .HasColumnType("char(36)") + .HasComment("id อ้างอิง profile"); + + b.Property("PosNo") + .HasColumnType("longtext") + .HasComment("เลขที่ตำแหน่ง"); + + b.Property("Position") + .HasColumnType("longtext") + .HasComment("ตำแหน่ง"); + + b.Property("PositionLevel") + .HasColumnType("longtext") + .HasComment("ระดับ"); + + b.Property("Prefix") + .HasColumnType("longtext") + .HasComment("คำนำหน้า"); + + b.Property("Salary") + .HasColumnType("double") + .HasComment("เงินเดือน"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineComplaintId"); + + b.ToTable("DisciplineComplaint_Profiles"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDirector", 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("Email") + .IsRequired() + .HasColumnType("longtext") + .HasComment("อีเมล"); + + b.Property("FirstName") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ชื่อ"); + + b.Property("LastName") + .IsRequired() + .HasColumnType("longtext") + .HasComment("นามสกุล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Phone") + .IsRequired() + .HasColumnType("longtext") + .HasComment("เบอร์โทรศัพท์"); + + b.Property("Position") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ตำแหน่ง"); + + b.Property("Prefix") + .IsRequired() + .HasColumnType("longtext") + .HasComment("คำนำหน้าชื่อ"); + + b.HasKey("Id"); + + b.ToTable("DisciplineDirectors"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("Appellant") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ผู้ร้องเรียน"); + + b.Property("ComplaintFrom") + .IsRequired() + .HasColumnType("longtext") + .HasComment("รับเรื่องร้องเรียนจาก ระบุว่ารับเรื่องมาจากใคร/หน่วยงานไหน (สตง., ปปช., ปปท., จดหมาย, อีเมล, โทรศัพท์, บอกกล่าว)"); + + b.Property("ConsideredAgency") + .HasColumnType("char(36)") + .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("DateConsideration") + .HasColumnType("datetime(6)") + .HasComment("วันที่กำหนดพิจารณา"); + + b.Property("DateNotification") + .HasColumnType("datetime(6)") + .HasComment("วันแจ้งเตือนล่วงหน้า"); + + b.Property("DateReceived") + .HasColumnType("datetime(6)") + .HasComment("วันที่รับเรื่อง เป็นวันที่ถือเป็นจุดเริ่มต้นของวินัยนั้น ๆ"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text") + .HasComment("รายละเอียดของเรื่องร้องเรียน"); + + b.Property("DisciplineComplaintId") + .HasColumnType("char(36)"); + + b.Property("InvestigationCauseText") + .HasColumnType("longtext") + .HasComment("กรณีมีมูลต้องเลือกว่า 'ร้ายแรง' หรือ 'ไม่ร้ายแรง'"); + + b.Property("InvestigationDateEnd") + .HasColumnType("datetime(6)") + .HasComment("วันที่สิ้นสุดการสอบสวน"); + + b.Property("InvestigationDateStart") + .HasColumnType("datetime(6)") + .HasComment("วันที่เริ่มการสอบสวน"); + + b.Property("InvestigationDescription") + .HasColumnType("longtext") + .HasComment("รายละเอียดเกี่ยวกับการสืบสวน"); + + b.Property("InvestigationDetail") + .HasColumnType("longtext") + .HasComment("ลักษณะการสืบสวน (appoint_directors คือ แต่งตั้งกรรมการสืบสวน, secret_investigation คือ สืบสวนทางลับ, other คือ อื่น ๆ)"); + + b.Property("InvestigationDetailOther") + .HasColumnType("longtext") + .HasComment("ลักษณะการสืบสวนกรณีเลือกอื่นๆ"); + + b.Property("InvestigationStatusResult") + .HasColumnType("longtext") + .HasComment("สถานะหรือผลการสืบสวน (not_specified คือ ยังไม่ระบุ, have_cause คือ มีมูล, no_cause คือ ไม่มีมูล"); + + 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("LevelConsideration") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ระดับการพิจารณา 'ยังไม่ระบุ' (NORMAL คือ ปกติ, URGENT คือ ด่วน, VERY_URGENT คือ ด่วนมาก)"); + + b.Property("OffenseDetails") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ลักษณะความผิดครั้งแรกจะเป็น 'ยังไม่ระบุ' (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง)"); + + b.Property("Organization") + .HasColumnType("char(36)") + .HasComment("กรณีหน่วยงานใส่ id ของหน่วยงาน"); + + b.Property("RespondentType") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ผู้ถูกร้องเรียน (PERSON คือ บุคคล, ORGANIZATION คือ หน่วยงาน, BANGKOK คือ กรุงเทพมหานคร)"); + + b.Property("Result") + .HasColumnType("longtext") + .HasComment("ผลการตรวจสอบ"); + + b.Property("ResultComplaint") + .HasColumnType("longtext") + .HasComment("ผลการตรวจสอบเรื่องร้องเรียน"); + + b.Property("Status") + .IsRequired() + .HasColumnType("longtext") + .HasComment("สถานะเรื่องร้องเรียน มีดังนี้ ใหม่ (NEW), ยุติเรื่อง (STOP), มีมูลส่งไปสืบสวนแล้ว (SEND_INVESTIGATE)"); + + b.Property("Title") + .IsRequired() + .HasColumnType("text") + .HasComment("เรื่องที่ร้องเรียน"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineComplaintId"); + + b.ToTable("DisciplineDisciplinarys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DirectorInvestigate", 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("DisciplineDirectorId") + .HasColumnType("char(36)"); + + b.Property("DisciplineInvestigateId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDirectorId"); + + b.HasIndex("DisciplineInvestigateId"); + + b.ToTable("DisciplineDisciplinary_DirectorInvestigates"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocComplaintInvestigate", 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("DisciplineInvestigateId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineInvestigateId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineDisciplinary_DocComplaintInvestigates"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocInvestigate", 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("DisciplineInvestigateId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineInvestigateId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineDisciplinary_DocInvestigates"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocInvestigateRelevant", 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("DisciplineInvestigateId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineInvestigateId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineDisciplinary_DocInvestigateRelevants"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_ProfileComplaintInvestigate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CitizenId") + .HasMaxLength(13) + .HasColumnType("varchar(13)") + .HasComment("รหัสบัตรประชาชน"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineInvestigateId") + .HasColumnType("char(36)"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("ชื่อ"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .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("Organization") + .HasColumnType("longtext") + .HasComment("สังกัด"); + + b.Property("PersonId") + .HasColumnType("char(36)") + .HasComment("id อ้างอิง profile"); + + b.Property("PosNo") + .HasColumnType("longtext") + .HasComment("เลขที่ตำแหน่ง"); + + b.Property("Position") + .HasColumnType("longtext") + .HasComment("ตำแหน่ง"); + + b.Property("PositionLevel") + .HasColumnType("longtext") + .HasComment("ระดับ"); + + b.Property("Prefix") + .HasColumnType("longtext") + .HasComment("คำนำหน้า"); + + b.Property("Salary") + .HasColumnType("double") + .HasComment("เงินเดือน"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineInvestigateId"); + + b.ToTable("DisciplineDisciplinary_ProfileComplaintInvestigates"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("Appellant") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ผู้ร้องเรียน"); + + b.Property("ComplaintFrom") + .IsRequired() + .HasColumnType("longtext") + .HasComment("รับเรื่องร้องเรียนจาก ระบุว่ารับเรื่องมาจากใคร/หน่วยงานไหน (สตง., ปปช., ปปท., จดหมาย, อีเมล, โทรศัพท์, บอกกล่าว)"); + + b.Property("ConsideredAgency") + .HasColumnType("char(36)") + .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("DateConsideration") + .HasColumnType("datetime(6)") + .HasComment("วันที่กำหนดพิจารณา"); + + b.Property("DateNotification") + .HasColumnType("datetime(6)") + .HasComment("วันแจ้งเตือนล่วงหน้า"); + + b.Property("DateReceived") + .HasColumnType("datetime(6)") + .HasComment("วันที่รับเรื่อง เป็นวันที่ถือเป็นจุดเริ่มต้นของวินัยนั้น ๆ"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text") + .HasComment("รายละเอียดของเรื่องร้องเรียน"); + + b.Property("DisciplineComplaintId") + .HasColumnType("char(36)"); + + b.Property("InvestigationCauseText") + .HasColumnType("longtext") + .HasComment("กรณีมีมูลต้องเลือกว่า 'ร้ายแรง' หรือ 'ไม่ร้ายแรง'"); + + b.Property("InvestigationDateEnd") + .HasColumnType("datetime(6)") + .HasComment("วันที่สิ้นสุดการสอบสวน"); + + b.Property("InvestigationDateStart") + .HasColumnType("datetime(6)") + .HasComment("วันที่เริ่มการสอบสวน"); + + b.Property("InvestigationDescription") + .HasColumnType("longtext") + .HasComment("รายละเอียดเกี่ยวกับการสืบสวน"); + + b.Property("InvestigationDetail") + .HasColumnType("longtext") + .HasComment("ลักษณะการสืบสวน (appoint_directors คือ แต่งตั้งกรรมการสืบสวน, secret_investigation คือ สืบสวนทางลับ, other คือ อื่น ๆ)"); + + b.Property("InvestigationDetailOther") + .HasColumnType("longtext") + .HasComment("ลักษณะการสืบสวนกรณีเลือกอื่นๆ"); + + b.Property("InvestigationStatusResult") + .HasColumnType("longtext") + .HasComment("สถานะหรือผลการสืบสวน (not_specified คือ ยังไม่ระบุ, have_cause คือ มีมูล, no_cause คือ ไม่มีมูล"); + + 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("LevelConsideration") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ระดับการพิจารณา 'ยังไม่ระบุ' (NORMAL คือ ปกติ, URGENT คือ ด่วน, VERY_URGENT คือ ด่วนมาก)"); + + b.Property("OffenseDetails") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ลักษณะความผิดครั้งแรกจะเป็น 'ยังไม่ระบุ' (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง)"); + + b.Property("Organization") + .HasColumnType("char(36)") + .HasComment("กรณีหน่วยงานใส่ id ของหน่วยงาน"); + + b.Property("RespondentType") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ผู้ถูกร้องเรียน (PERSON คือ บุคคล, ORGANIZATION คือ หน่วยงาน, BANGKOK คือ กรุงเทพมหานคร)"); + + b.Property("Result") + .HasColumnType("longtext") + .HasComment("ผลการตรวจสอบ"); + + b.Property("ResultComplaint") + .HasColumnType("longtext") + .HasComment("ผลการตรวจสอบเรื่องร้องเรียน"); + + b.Property("Status") + .IsRequired() + .HasColumnType("longtext") + .HasComment("สถานะเรื่องร้องเรียน มีดังนี้ ใหม่ (NEW), ยุติเรื่อง (STOP), มีมูลส่งไปสืบสวนแล้ว (SEND_INVESTIGATE)"); + + b.Property("Title") + .IsRequired() + .HasColumnType("text") + .HasComment("เรื่องที่ร้องเรียน"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineComplaintId"); + + b.ToTable("DisciplineInvestigates"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigateRelevant_Doc", 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("DisciplineDisciplinaryId") + .HasColumnType("char(36)"); + + b.Property("DisciplineInvestigateId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.HasIndex("DisciplineInvestigateId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineInvestigateRelevant_Docs"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_Director", 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("DisciplineDirectorId") + .HasColumnType("char(36)"); + + b.Property("DisciplineDisciplinaryId") + .HasColumnType("char(36)"); + + b.Property("DisciplineInvestigateId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDirectorId"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.HasIndex("DisciplineInvestigateId"); + + b.ToTable("DisciplineInvestigate_Directors"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_Doc", 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("DisciplineDisciplinaryId") + .HasColumnType("char(36)"); + + b.Property("DisciplineInvestigateId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.HasIndex("DisciplineInvestigateId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineInvestigate_Docs"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_DocComplaint", 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("DisciplineDisciplinaryId") + .HasColumnType("char(36)"); + + b.Property("DisciplineInvestigateId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.HasIndex("DisciplineInvestigateId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineInvestigate_DocComplaints"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_ProfileComplaint", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CitizenId") + .HasMaxLength(13) + .HasColumnType("varchar(13)") + .HasComment("รหัสบัตรประชาชน"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineDisciplinaryId") + .HasColumnType("char(36)"); + + b.Property("DisciplineInvestigateId") + .HasColumnType("char(36)"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("ชื่อ"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .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("Organization") + .HasColumnType("longtext") + .HasComment("สังกัด"); + + b.Property("PersonId") + .HasColumnType("char(36)") + .HasComment("id อ้างอิง profile"); + + b.Property("PosNo") + .HasColumnType("longtext") + .HasComment("เลขที่ตำแหน่ง"); + + b.Property("Position") + .HasColumnType("longtext") + .HasComment("ตำแหน่ง"); + + b.Property("PositionLevel") + .HasColumnType("longtext") + .HasComment("ระดับ"); + + b.Property("Prefix") + .HasColumnType("longtext") + .HasComment("คำนำหน้า"); + + b.Property("Salary") + .HasColumnType("double") + .HasComment("เงินเดือน"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.HasIndex("DisciplineInvestigateId"); + + b.ToTable("DisciplineInvestigate_ProfileComplaints"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.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.Domain.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("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.LimitLeave", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Name") + .HasColumnType("longtext") + .HasComment("ยังไม่ชัวใช้อะไรเป็นkey"); + + b.HasKey("Id"); + + b.ToTable("LimitLeave"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.LimitTypeLeave", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("LimitLeaveId") + .HasColumnType("char(36)"); + + b.Property("NumLeave") + .HasColumnType("double") + .HasComment("จำนวนที่ลาได้"); + + b.Property("TypeLeaveId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("LimitLeaveId"); + + b.HasIndex("TypeLeaveId"); + + b.ToTable("LimitTypeLeave"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.Profile", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("Ability") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("AvatarId") + .HasColumnType("char(36)"); + + b.Property("AvatarRef") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("BirthDate") + .HasColumnType("datetime(6)") + .HasComment("วันเกิด"); + + b.Property("BloodGroupId") + .HasColumnType("char(36)") + .HasComment("Id กลุ่มเลือด"); + + b.Property("CitizenId") + .HasMaxLength(13) + .HasColumnType("varchar(13)") + .HasComment("รหัสบัตรประชาชน"); + + b.Property("Couple") + .HasColumnType("tinyint(1)") + .HasComment("คู่สมรส"); + + b.Property("CoupleCareer") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("อาชีพคู่สมรส"); + + b.Property("CoupleCitizenId") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("เลขที่บัตรประชาชนคู่สมรส"); + + b.Property("CoupleFirstName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("ชื่อคู่สมรส"); + + b.Property("CoupleLastName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("นามสกุลคู่สมรส"); + + b.Property("CoupleLastNameOld") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("นามสกุลคู่สมรส(เดิม)"); + + b.Property("CoupleLive") + .HasColumnType("tinyint(1)") + .HasComment("มีชีวิตคู่สมรส"); + + b.Property("CouplePrefixId") + .HasColumnType("char(36)") + .HasComment("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("CreatedUser") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("CurrentAddress") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("ที่อยู่ปัจจุบัน"); + + b.Property("CurrentDistrictId") + .HasColumnType("char(36)") + .HasComment("Id เขตปัจจุบัน"); + + b.Property("CurrentProvinceId") + .HasColumnType("char(36)") + .HasComment("Id จังหวัดปัจจุบัน"); + + b.Property("CurrentSubDistrictId") + .HasColumnType("char(36)") + .HasComment("Id แขวงปัจจุบัน"); + + b.Property("CurrentZipCode") + .HasMaxLength(5) + .HasColumnType("varchar(5)") + .HasComment("รหัสไปรษณีย์ปัจจุบัน"); + + b.Property("DateAppoint") + .HasColumnType("datetime(6)"); + + b.Property("DateRetire") + .HasColumnType("datetime(6)"); + + b.Property("DateStart") + .HasColumnType("datetime(6)"); + + b.Property("EmployeeClass") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("ประเภทลูกจ้าง"); + + b.Property("EmployeeMoneyAllowance") + .HasColumnType("double") + .HasComment("เงินช่วยเหลือค่าครองชีพชั่วคราว"); + + b.Property("EmployeeMoneyEmployee") + .HasColumnType("double") + .HasComment("เงินสมทบประกันสังคม(ลูกจ้าง)"); + + b.Property("EmployeeMoneyEmployer") + .HasColumnType("double") + .HasComment("เงินสมทบประกันสังคม(นายจ้าง)"); + + b.Property("EmployeeMoneyIncrease") + .HasColumnType("double") + .HasComment("เงินเพิ่มการครองชีพชั่วคราว"); + + b.Property("EmployeeOc") + .HasColumnType("longtext") + .HasComment("สังกัด"); + + b.Property("EmployeeType") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("ประเภทการจ้าง"); + + b.Property("EmployeeTypeIndividual") + .HasColumnType("longtext") + .HasComment("ประเภทบุคคล"); + + b.Property("EmployeeWage") + .HasColumnType("double") + .HasComment("ค่าจ้าง"); + + b.Property("EntryStatus") + .IsRequired() + .HasMaxLength(5) + .HasColumnType("varchar(5)"); + + b.Property("FatherCareer") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("อาชีพบิดา"); + + b.Property("FatherCitizenId") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("เลขที่บัตรประชาชนบิดา"); + + b.Property("FatherFirstName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("ชื่อบิดา"); + + b.Property("FatherLastName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("นามสกุลบิดา"); + + b.Property("FatherLive") + .HasColumnType("tinyint(1)") + .HasComment("มีชีวิตบิดา"); + + b.Property("FatherPrefixId") + .HasColumnType("char(36)") + .HasComment("Id คำนำหน้าบิดา"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("ชื่อ"); + + b.Property("FirstNameOld") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("ชื่อ(เดิม)"); + + b.Property("GenderId") + .HasColumnType("char(36)"); + + b.Property("GovAgeAbsent") + .HasColumnType("int"); + + b.Property("GovAgePlus") + .HasColumnType("int"); + + b.Property("GovernmentCode") + .HasColumnType("longtext"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("IsLeave") + .HasColumnType("tinyint(1)"); + + b.Property("IsProbation") + .HasColumnType("tinyint(1)"); + + b.Property("IsTransfer") + .HasColumnType("tinyint(1)"); + + b.Property("IsVerified") + .HasColumnType("tinyint(1)"); + + b.Property("KeycloakId") + .HasColumnType("char(36)"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("นามสกุล"); + + b.Property("LastNameOld") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .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("LeaveDate") + .HasColumnType("datetime(6)"); + + b.Property("LeaveDateOrder") + .HasColumnType("datetime(6)"); + + b.Property("LeaveDetail") + .HasColumnType("longtext"); + + b.Property("LeaveNumberOrder") + .HasColumnType("longtext"); + + b.Property("LeaveReason") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("LimitLeaveId") + .HasColumnType("char(36)"); + + b.Property("ModifiedDate") + .HasColumnType("datetime(6)"); + + b.Property("MotherCareer") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("อาชีพมารดา"); + + b.Property("MotherCitizenId") + .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("MotherLive") + .HasColumnType("tinyint(1)") + .HasComment("มีชีวิตมารดา"); + + b.Property("MotherPrefixId") + .HasColumnType("char(36)") + .HasComment("Id คำนำหน้ามารดา"); + + b.Property("Nationality") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("สัญชาติ"); + + b.Property("Oc") + .HasColumnType("longtext") + .HasComment("สังกัด"); + + b.Property("OcId") + .HasColumnType("char(36)") + .HasComment("Id สังกัด"); + + b.Property("OrganizationOrganization") + .HasColumnType("longtext"); + + b.Property("OrganizationOrganizationId") + .HasColumnType("char(36)"); + + b.Property("OrganizationShortName") + .HasColumnType("longtext"); + + b.Property("OrganizationShortNameId") + .HasColumnType("char(36)"); + + b.Property("Physical") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("สถานภาพทางกาย"); + + b.Property("PosNoEmployee") + .HasColumnType("longtext") + .HasComment("เลขที่ตำแหน่งลูกจ้าง"); + + b.Property("PosNoId") + .HasColumnType("char(36)"); + + b.Property("PositionEmployeeGroupId") + .HasColumnType("char(36)"); + + b.Property("PositionEmployeeLevelId") + .HasColumnType("char(36)"); + + b.Property("PositionEmployeeLineId") + .HasColumnType("char(36)"); + + b.Property("PositionEmployeePositionId") + .HasColumnType("char(36)"); + + b.Property("PositionEmployeePositionSideId") + .HasColumnType("char(36)"); + + b.Property("PositionExecutive") + .HasColumnType("longtext") + .HasComment("ตำแหน่งทางการบริหาร"); + + b.Property("PositionExecutiveId") + .HasColumnType("char(36)") + .HasComment("Id ตำแหน่งทางการบริหาร"); + + b.Property("PositionExecutiveSide") + .HasColumnType("longtext") + .HasComment("ด้านทางการบริหาร"); + + b.Property("PositionExecutiveSideId") + .HasColumnType("char(36)") + .HasComment("Id ด้านทางการบริหาร"); + + b.Property("PositionId") + .HasColumnType("char(36)"); + + b.Property("PositionLevelId") + .HasColumnType("char(36)"); + + b.Property("PositionLine") + .HasColumnType("longtext") + .HasComment("สายงาน"); + + b.Property("PositionLineId") + .HasColumnType("char(36)") + .HasComment("Id สายงาน"); + + b.Property("PositionPathSide") + .HasColumnType("longtext") + .HasComment("ด้าน/สาขา"); + + b.Property("PositionPathSideId") + .HasColumnType("char(36)") + .HasComment("Id ด้าน/สาขา"); + + b.Property("PositionTypeId") + .HasColumnType("char(36)"); + + b.Property("PrefixId") + .HasColumnType("char(36)"); + + b.Property("PrefixOldId") + .HasColumnType("char(36)") + .HasComment("Id คำนำหน้า(เดิม)"); + + b.Property("ProfileType") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("Race") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("เชื้อชาติ"); + + b.Property("ReasonSameDate") + .HasColumnType("longtext"); + + b.Property("RegistrationAddress") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("Id แขวงตามทะเบียนบ้าน"); + + b.Property("RegistrationDistrictId") + .HasColumnType("char(36)") + .HasComment("Id เขตตามทะเบียนบ้าน"); + + b.Property("RegistrationProvinceId") + .HasColumnType("char(36)") + .HasComment("Id จังหวัดตามทะเบียนบ้าน"); + + b.Property("RegistrationSame") + .HasColumnType("tinyint(1)") + .HasComment("ที่อยู่ปัจจุบันตรงกับที่อยู่ตามทะเบียนบ้านหรือไม่"); + + b.Property("RegistrationSubDistrictId") + .HasColumnType("char(36)") + .HasComment("แขวงตามทะเบียนบ้าน"); + + b.Property("RegistrationZipCode") + .HasMaxLength(5) + .HasColumnType("varchar(5)") + .HasComment("รหัสไปรษณีย์ตามทะเบียนบ้าน"); + + b.Property("RelationshipId") + .HasColumnType("char(36)") + .HasComment("Id สถานะภาพ"); + + b.Property("ReligionId") + .HasColumnType("char(36)") + .HasComment("Id ศาสนา"); + + b.Property("TelephoneNumber") + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasComment("เบอร์โทร"); + + b.Property("TransferDate") + .HasColumnType("datetime(6)"); + + b.Property("VerifiedDate") + .HasColumnType("datetime(6)"); + + b.Property("VerifiedUser") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.HasKey("Id"); + + b.HasIndex("AvatarId"); + + b.HasIndex("GenderId"); + + b.HasIndex("LimitLeaveId"); + + b.HasIndex("PosNoId"); + + b.HasIndex("PositionEmployeeGroupId"); + + b.HasIndex("PositionEmployeeLevelId"); + + b.HasIndex("PositionEmployeeLineId"); + + b.HasIndex("PositionEmployeePositionId"); + + b.HasIndex("PositionEmployeePositionSideId"); + + b.HasIndex("PositionId"); + + b.HasIndex("PositionLevelId"); + + b.HasIndex("PositionTypeId"); + + b.HasIndex("PrefixId"); + + b.ToTable("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAbility", 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("DateEnd") + .HasColumnType("datetime(6)") + .HasComment("วันที่สิ้นสุด"); + + b.Property("DateStart") + .HasColumnType("datetime(6)") + .HasComment("วันที่เริ่มต้น"); + + b.Property("Detail") + .HasColumnType("longtext") + .HasComment("รายละเอียด"); + + b.Property("Field") + .HasColumnType("longtext") + .HasComment("ด้าน"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.Property("Reference") + .HasColumnType("longtext") + .HasComment("เอกสารอ้างอิง"); + + b.Property("Remark") + .HasColumnType("longtext") + .HasComment("หมายเหตุ"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileAbility"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAbilityHistory", 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("DateEnd") + .HasColumnType("datetime(6)") + .HasComment("วันที่สิ้นสุด"); + + b.Property("DateStart") + .HasColumnType("datetime(6)") + .HasComment("วันที่เริ่มต้น"); + + b.Property("Detail") + .HasColumnType("longtext") + .HasComment("รายละเอียด"); + + b.Property("Field") + .HasColumnType("longtext") + .HasComment("ด้าน"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("ProfileAbilityId") + .HasColumnType("char(36)"); + + b.Property("Reference") + .HasColumnType("longtext") + .HasComment("เอกสารอ้างอิง"); + + b.Property("Remark") + .HasColumnType("longtext") + .HasComment("หมายเหตุ"); + + b.HasKey("Id"); + + b.HasIndex("ProfileAbilityId"); + + b.ToTable("ProfileAbilityHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAddressHistory", 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("CurrentAddress") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("ที่อยู่ปัจจุบัน"); + + b.Property("CurrentDistrict") + .HasColumnType("longtext") + .HasComment("เขตปัจจุบัน"); + + b.Property("CurrentDistrictId") + .HasColumnType("char(36)") + .HasComment("Id เขตปัจจุบัน"); + + b.Property("CurrentProvince") + .HasColumnType("longtext") + .HasComment("จังหวัดปัจจุบัน"); + + b.Property("CurrentProvinceId") + .HasColumnType("char(36)") + .HasComment("Id จังหวัดปัจจุบัน"); + + b.Property("CurrentSubDistrict") + .HasColumnType("longtext") + .HasComment("แขวงปัจจุบัน"); + + b.Property("CurrentSubDistrictId") + .HasColumnType("char(36)") + .HasComment("Id แขวงปัจจุบัน"); + + b.Property("CurrentZipCode") + .HasMaxLength(5) + .HasColumnType("varchar(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("ProfileId") + .HasColumnType("char(36)"); + + b.Property("RegistrationAddress") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("ที่อยู่ตามทะเบียนบ้าน"); + + b.Property("RegistrationDistrict") + .HasColumnType("longtext") + .HasComment("เขตตามทะเบียนบ้าน"); + + b.Property("RegistrationDistrictId") + .HasColumnType("char(36)") + .HasComment("Id เขตตามทะเบียนบ้าน"); + + b.Property("RegistrationProvince") + .HasColumnType("longtext") + .HasComment("จังหวัดตามทะเบียนบ้าน"); + + b.Property("RegistrationProvinceId") + .HasColumnType("char(36)") + .HasComment("Id จังหวัดตามทะเบียนบ้าน"); + + b.Property("RegistrationSame") + .HasColumnType("tinyint(1)") + .HasComment("ที่อยู่ปัจจุบันตรงกับที่อยู่ตามทะเบียนบ้านหรือไม่"); + + b.Property("RegistrationSubDistrict") + .HasColumnType("longtext") + .HasComment("แขวงตามทะเบียนบ้าน"); + + b.Property("RegistrationSubDistrictId") + .HasColumnType("char(36)") + .HasComment("Id แขวงตามทะเบียนบ้าน"); + + b.Property("RegistrationZipCode") + .HasMaxLength(5) + .HasColumnType("varchar(5)") + .HasComment("รหัสไปรษณีย์ตามทะเบียนบ้าน"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileAddressHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAssessment", 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("Date") + .HasColumnType("datetime(6)") + .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") + .HasColumnType("longtext") + .HasComment("ชื่อแบบประเมิน"); + + b.Property("Point1") + .HasColumnType("double") + .HasComment("ผลประเมินส่วนที่1 (คะแนน)"); + + b.Property("Point1Total") + .HasColumnType("double") + .HasComment("ส่วนที่1 (คะแนน)"); + + b.Property("Point2") + .HasColumnType("double") + .HasComment("ผลประเมินส่วนที่2 (คะแนน)"); + + b.Property("Point2Total") + .HasColumnType("double") + .HasComment("ส่วนที่2 (คะแนน)"); + + b.Property("PointSum") + .HasColumnType("double") + .HasComment("ผลประเมินรวม (คะแนน)"); + + b.Property("PointSumTotal") + .HasColumnType("double") + .HasComment("ผลรวม (คะแนน)"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileAssessment"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAssessmentHistory", 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("Date") + .HasColumnType("datetime(6)") + .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") + .HasColumnType("longtext") + .HasComment("ชื่อแบบประเมิน"); + + b.Property("Point1") + .HasColumnType("double") + .HasComment("ผลประเมินส่วนที่1 (คะแนน)"); + + b.Property("Point1Total") + .HasColumnType("double") + .HasComment("ส่วนที่1 (คะแนน)"); + + b.Property("Point2") + .HasColumnType("double") + .HasComment("ผลประเมินส่วนที่2 (คะแนน)"); + + b.Property("Point2Total") + .HasColumnType("double") + .HasComment("ส่วนที่2 (คะแนน)"); + + b.Property("PointSum") + .HasColumnType("double") + .HasComment("ผลประเมินรวม (คะแนน)"); + + b.Property("PointSumTotal") + .HasColumnType("double") + .HasComment("ผลรวม (คะแนน)"); + + b.Property("ProfileAssessmentId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileAssessmentId"); + + b.ToTable("ProfileAssessmentHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAvatarHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("AvatarFileId") + .HasColumnType("char(36)"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("AvatarFileId"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileAvatarHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileCertificate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CertificateNo") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("เลขที่ใบอนุญาต"); + + b.Property("CertificateType") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .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("ExpireDate") + .HasColumnType("datetime(6)") + .HasComment("วันที่หมดอายุ"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("IssueDate") + .HasColumnType("datetime(6)") + .HasComment("วันที่ออกใบอนุญาต"); + + b.Property("Issuer") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .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("ProfileId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileCertificate"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileCertificateHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CertificateNo") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("เลขที่ใบอนุญาต"); + + b.Property("CertificateType") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .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("ExpireDate") + .HasColumnType("datetime(6)") + .HasComment("วันที่หมดอายุ"); + + b.Property("IssueDate") + .HasColumnType("datetime(6)") + .HasComment("วันที่ออกใบอนุญาต"); + + b.Property("Issuer") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .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("ProfileCertificateId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileCertificateId"); + + b.ToTable("ProfileCertificateHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileChangeName", 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("FirstName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("ชื่อ"); + + b.Property("LastName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .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("Prefix") + .HasColumnType("longtext") + .HasComment("คำนำหน้า"); + + b.Property("PrefixId") + .HasColumnType("char(36)") + .HasComment("Id คำนำหน้า"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.Property("Status") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("สถานะ"); + + b.HasKey("Id"); + + b.HasIndex("DocumentId"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileChangeName"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileChangeNameHistory", 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("FirstName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("ชื่อ"); + + b.Property("LastName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .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("Prefix") + .HasColumnType("longtext") + .HasComment("คำนำหน้า"); + + b.Property("PrefixId") + .HasColumnType("char(36)") + .HasComment("Id คำนำหน้า"); + + b.Property("ProfileChangeNameId") + .HasColumnType("char(36)"); + + b.Property("Status") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("สถานะ"); + + b.HasKey("Id"); + + b.HasIndex("DocumentId"); + + b.HasIndex("ProfileChangeNameId"); + + b.ToTable("ProfileChangeNameHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileChildren", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("ChildrenCareer") + .HasColumnType("longtext") + .HasComment("อาชีพบุตร"); + + b.Property("ChildrenFirstName") + .HasColumnType("longtext") + .HasComment("ชื่อบุตร"); + + b.Property("ChildrenLastName") + .HasColumnType("longtext") + .HasComment("นามสกุลบุตร"); + + b.Property("ChildrenPrefix") + .HasColumnType("longtext") + .HasComment("คำนำหน้าบุตร"); + + b.Property("ChildrenPrefixId") + .HasColumnType("char(36)") + .HasComment("Id คำนำหน้าบุตร"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileChildren"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileChildrenHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("ChildrenCareer") + .HasColumnType("longtext") + .HasComment("อาชีพบุตร"); + + b.Property("ChildrenFirstName") + .HasColumnType("longtext") + .HasComment("ชื่อบุตร"); + + b.Property("ChildrenLastName") + .HasColumnType("longtext") + .HasComment("นามสกุลบุตร"); + + b.Property("ChildrenPrefix") + .HasColumnType("longtext") + .HasComment("คำนำหน้าบุตร"); + + b.Property("ChildrenPrefixId") + .HasColumnType("char(36)") + .HasComment("Id คำนำหน้าบุตร"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("ProfileChildrenId") + .HasColumnType("char(36)"); + + b.Property("ProfileFamilyHistoryId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileChildrenId"); + + b.HasIndex("ProfileFamilyHistoryId"); + + b.ToTable("ProfileChildrenHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileCoupleHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasComment("ไม่ใช้"); + + b.Property("Career") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("CreatedDate") + .HasColumnType("datetime(6)"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("Prefix") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileCoupleHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileCurrentAddressHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasComment("ไม่ใช้"); + + b.Property("Address") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("CreatedDate") + .HasColumnType("datetime(6)"); + + b.Property("DistrictId") + .HasColumnType("char(36)"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.Property("ProvinceId") + .HasColumnType("char(36)"); + + b.Property("SubDistrictId") + .HasColumnType("char(36)"); + + b.Property("ZipCode") + .IsRequired() + .HasMaxLength(5) + .HasColumnType("varchar(5)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileCurrentAddressHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileDiscipline", 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("Date") + .HasColumnType("datetime(6)") + .HasComment("วัน เดือน ปี"); + + b.Property("Detail") + .HasColumnType("text") + .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("Level") + .HasColumnType("longtext") + .HasComment("ระดับความผิด"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.Property("RefCommandDate") + .HasColumnType("datetime(6)") + .HasComment("เอกสารอ้างอิง (ลงวันที่)"); + + b.Property("RefCommandNo") + .HasColumnType("longtext") + .HasComment("เอกสารอ้างอิง (เลขที่คำสั่ง)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileDiscipline"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileDisciplineHistory", 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("Date") + .HasColumnType("datetime(6)") + .HasComment("วัน เดือน ปี"); + + b.Property("Detail") + .HasColumnType("text") + .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("Level") + .HasColumnType("longtext") + .HasComment("ระดับความผิด"); + + b.Property("ProfileDisciplineId") + .HasColumnType("char(36)"); + + b.Property("RefCommandDate") + .HasColumnType("datetime(6)") + .HasComment("เอกสารอ้างอิง (ลงวันที่)"); + + b.Property("RefCommandNo") + .HasColumnType("longtext") + .HasComment("เอกสารอ้างอิง (เลขที่คำสั่ง)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileDisciplineId"); + + b.ToTable("ProfileDisciplineHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileDuty", 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("DateEnd") + .HasColumnType("datetime(6)") + .HasComment("สิ้นสุด"); + + b.Property("DateStart") + .HasColumnType("datetime(6)") + .HasComment("เริ่มต้น"); + + b.Property("Detail") + .HasColumnType("longtext") + .HasComment("รายละเอียด"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.Property("Reference") + .HasColumnType("longtext") + .HasComment("เอกสารอ้างอิง"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileDuty"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileDutyHistory", 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("DateEnd") + .HasColumnType("datetime(6)") + .HasComment("สิ้นสุด"); + + b.Property("DateStart") + .HasColumnType("datetime(6)") + .HasComment("เริ่มต้น"); + + b.Property("Detail") + .HasColumnType("longtext") + .HasComment("รายละเอียด"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("ProfileDutyId") + .HasColumnType("char(36)"); + + b.Property("Reference") + .HasColumnType("longtext") + .HasComment("เอกสารอ้างอิง"); + + b.HasKey("Id"); + + b.HasIndex("ProfileDutyId"); + + b.ToTable("ProfileDutyHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileEducation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("Country") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)") + .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("Degree") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("วุฒิการศึกษา"); + + b.Property("Duration") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)") + .HasComment("ระยะเวลา"); + + b.Property("DurationYear") + .HasColumnType("int") + .HasComment("ระยะเวลาหลักสูตร"); + + b.Property("EducationLevel") + .HasColumnType("longtext") + .HasComment("ระดับศึกษา"); + + b.Property("EducationLevelId") + .HasColumnType("char(36)") + .HasComment("Id ระดับศึกษา"); + + b.Property("EndDate") + .HasColumnType("datetime(6)") + .HasComment("ถึง"); + + b.Property("Field") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("สาขาวิชา/ทาง"); + + b.Property("FinishDate") + .HasColumnType("datetime(6)") + .HasComment("วันที่สำเร็จการศึกษา"); + + b.Property("FundName") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)") + .HasComment("ทุน"); + + b.Property("Gpa") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("เกรดเฉลี่ย"); + + b.Property("Institute") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)") + .HasComment("สถานศึกษา"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + 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("Other") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)") + .HasComment("ข้อมูลการติดต่อ"); + + b.Property("PositionPath") + .HasColumnType("longtext") + .HasComment("เป็นวุฒิการศึกษาในตำแหน่ง"); + + b.Property("PositionPathId") + .HasColumnType("char(36)") + .HasComment("Id เป็นวุฒิการศึกษาในตำแหน่ง"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.Property("StartDate") + .HasColumnType("datetime(6)") + .HasComment("ตั้งแต่"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileEducation"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileEducationHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("Country") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)") + .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("Degree") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("วุฒิการศึกษา"); + + b.Property("Duration") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)") + .HasComment("ระยะเวลา"); + + b.Property("DurationYear") + .HasColumnType("int") + .HasComment("ระยะเวลาหลักสูตร"); + + b.Property("EducationLevel") + .HasColumnType("longtext") + .HasComment("ระดับศึกษา"); + + b.Property("EducationLevelId") + .HasColumnType("char(36)") + .HasComment("Id ระดับศึกษา"); + + b.Property("EndDate") + .HasColumnType("datetime(6)") + .HasComment("ถึง"); + + b.Property("Field") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("สาขาวิชา/ทาง"); + + b.Property("FinishDate") + .HasColumnType("datetime(6)") + .HasComment("วันที่สำเร็จการศึกษา"); + + b.Property("FundName") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)") + .HasComment("ทุน"); + + b.Property("Gpa") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("เกรดเฉลี่ย"); + + b.Property("Institute") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)") + .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("Other") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)") + .HasComment("ข้อมูลการติดต่อ"); + + b.Property("PositionPath") + .HasColumnType("longtext") + .HasComment("เป็นวุฒิการศึกษาในตำแหน่ง"); + + b.Property("PositionPathId") + .HasColumnType("char(36)") + .HasComment("Id เป็นวุฒิการศึกษาในตำแหน่ง"); + + b.Property("ProfileEducationId") + .HasColumnType("char(36)"); + + b.Property("StartDate") + .HasColumnType("datetime(6)") + .HasComment("ตั้งแต่"); + + b.HasKey("Id"); + + b.HasIndex("ProfileEducationId"); + + b.ToTable("ProfileEducationHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileEmployment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("Command") + .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("Date") + .HasColumnType("datetime(6)") + .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("ProfileId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileEmployment"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileFamilyHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("Couple") + .HasColumnType("tinyint(1)") + .HasComment("คู่สมรส"); + + b.Property("CoupleCareer") + .HasColumnType("longtext") + .HasComment("อาชีพคู่สมรส"); + + b.Property("CoupleFirstName") + .HasColumnType("longtext") + .HasComment("ชื่อคู่สมรส"); + + b.Property("CoupleLastName") + .HasColumnType("longtext") + .HasComment("นามสกุลคู่สมรส"); + + b.Property("CoupleLastNameOld") + .HasColumnType("longtext") + .HasComment("นามสกุลคู่สมรส(เดิม)"); + + b.Property("CouplePrefix") + .HasColumnType("longtext") + .HasComment("คำนำหน้าคู่สมรส"); + + b.Property("CouplePrefixId") + .HasColumnType("char(36)") + .HasComment("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("FatherCareer") + .HasColumnType("longtext") + .HasComment("อาชีพบิดา"); + + b.Property("FatherFirstName") + .HasColumnType("longtext") + .HasComment("ชื่อบิดา"); + + b.Property("FatherLastName") + .HasColumnType("longtext") + .HasComment("นามสกุลบิดา"); + + b.Property("FatherPrefix") + .HasColumnType("longtext") + .HasComment("คำนำหน้าบิดา"); + + b.Property("FatherPrefixId") + .HasColumnType("char(36)") + .HasComment("Id คำนำหน้าบิดา"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("MotherCareer") + .HasColumnType("longtext") + .HasComment("อาชีพมารดา"); + + b.Property("MotherFirstName") + .HasColumnType("longtext") + .HasComment("ชื่อมารดา"); + + b.Property("MotherLastName") + .HasColumnType("longtext") + .HasComment("นามสกุลมารดา"); + + b.Property("MotherPrefix") + .HasColumnType("longtext") + .HasComment("คำนำหน้ามารดา"); + + b.Property("MotherPrefixId") + .HasColumnType("char(36)") + .HasComment("Id คำนำหน้ามารดา"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileFamilyHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileFatherHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasComment("ไม่ใช้"); + + b.Property("Career") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("CreatedDate") + .HasColumnType("datetime(6)"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("Prefix") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileFatherHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileGovernmentHistory", 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("DateAppoint") + .HasColumnType("datetime(6)") + .HasComment("วันที่สั่งบรรจุ"); + + b.Property("DateStart") + .HasColumnType("datetime(6)") + .HasComment("เริ่มปฎิบัติราชการ"); + + b.Property("GovAge") + .HasColumnType("longtext") + .HasComment("อายุราชการ"); + + b.Property("GovAgeAbsent") + .HasColumnType("int") + .HasComment("ขาดราชการ"); + + b.Property("GovAgePlus") + .HasColumnType("int") + .HasComment("อายุราชการเกื้อกูล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Oc") + .HasColumnType("longtext") + .HasComment("สังกัด"); + + b.Property("OcId") + .HasColumnType("char(36)") + .HasComment("Id สังกัด"); + + b.Property("PosNo") + .HasColumnType("longtext") + .HasComment("เลขที่ตำแหน่ง"); + + b.Property("PosNoId") + .HasColumnType("char(36)") + .HasComment("Id เลขที่ตำแหน่ง"); + + b.Property("Position") + .HasColumnType("longtext") + .HasComment("ตำแหน่ง"); + + b.Property("PositionEmployeeGroup") + .HasColumnType("longtext") + .HasComment("กลุ่มงาน"); + + b.Property("PositionEmployeeLevel") + .HasColumnType("longtext") + .HasComment("ระดับชั้นงาน"); + + b.Property("PositionEmployeePosition") + .HasColumnType("longtext") + .HasComment("ตำแหน่ง"); + + b.Property("PositionEmployeePositionSide") + .HasColumnType("longtext") + .HasComment("ด้านของตำแหน่ง"); + + b.Property("PositionExecutive") + .HasColumnType("longtext") + .HasComment("ตำแหน่งทางการบริหาร"); + + b.Property("PositionId") + .HasColumnType("char(36)") + .HasComment("Id ตำแหน่ง"); + + b.Property("PositionLevel") + .HasColumnType("longtext") + .HasComment("ระดับตำแหน่ง"); + + b.Property("PositionLine") + .HasColumnType("longtext") + .HasComment("สายงาน"); + + b.Property("PositionType") + .HasColumnType("longtext") + .HasComment("ประเภทตำแหน่ง"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.Property("ReasonSameDate") + .HasColumnType("longtext") + .HasComment("เหตุผลกรณีไม่ตรงวัน"); + + b.Property("RetireDate") + .HasColumnType("longtext") + .HasComment("วันเกษียณอายุ"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileGovernmentHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("BirthDate") + .HasColumnType("datetime(6)") + .HasComment("วันเกิด"); + + b.Property("BloodGroup") + .HasColumnType("longtext") + .HasComment("กลุ่มเลือด"); + + b.Property("BloodGroupId") + .HasColumnType("char(36)") + .HasComment("Id กลุ่มเลือด"); + + b.Property("CitizenId") + .HasMaxLength(13) + .HasColumnType("varchar(13)") + .HasComment("รหัสบัตรประชาชน"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("EmployeeClass") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("ประเภทลูกจ้าง"); + + b.Property("EmployeeType") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("ประเภทการจ้าง"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("ชื่อ"); + + b.Property("Gender") + .HasColumnType("longtext") + .HasComment("เพศ"); + + b.Property("GenderId") + .HasColumnType("char(36)") + .HasComment("Id เพศ"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .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("Nationality") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("สัญชาติ"); + + b.Property("Prefix") + .HasColumnType("longtext") + .HasComment("คำนำหน้า"); + + b.Property("PrefixId") + .HasColumnType("char(36)") + .HasComment("Id คำนำหน้า"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.Property("Race") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("เชื้อชาติ"); + + b.Property("Relationship") + .HasColumnType("longtext") + .HasComment("สถานะภาพ"); + + b.Property("RelationshipId") + .HasColumnType("char(36)") + .HasComment("Id สถานะภาพ"); + + b.Property("Religion") + .HasColumnType("longtext") + .HasComment("ศาสนา"); + + b.Property("ReligionId") + .HasColumnType("char(36)") + .HasComment("Id ศาสนา"); + + b.Property("TelephoneNumber") + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasComment("เบอร์โทร"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileHonor", 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") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)") + .HasComment("รายละเอียด"); + + b.Property("IssueDate") + .HasColumnType("datetime(6)") + .HasComment("วันที่ได้รับ"); + + b.Property("Issuer") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .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("ProfileId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileHonor"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileHonorHistory", 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") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)") + .HasComment("รายละเอียด"); + + b.Property("IssueDate") + .HasColumnType("datetime(6)") + .HasComment("วันที่ได้รับ"); + + b.Property("Issuer") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .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("ProfileHonorId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileHonorId"); + + b.ToTable("ProfileHonorHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileInsignia", 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("DateAnnounce") + .HasColumnType("datetime(6)") + .HasComment("วันที่ประกาศในราชกิจจาฯ"); + + b.Property("InsigniaId") + .HasColumnType("char(36)"); + + b.Property("InsigniaType") + .HasColumnType("longtext") + .HasComment("ประเภท"); + + b.Property("Issue") + .HasMaxLength(300) + .HasColumnType("varchar(300)") + .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("No") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("ลำดับที่"); + + b.Property("Page") + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasComment("หน้า"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.Property("ReceiveDate") + .HasColumnType("datetime(6)") + .HasComment("ลงวันที่"); + + b.Property("RefCommandDate") + .HasColumnType("datetime(6)") + .HasComment("เอกสารอ้างอิง (ลงวันที่)"); + + b.Property("RefCommandNo") + .HasColumnType("longtext") + .HasComment("เอกสารอ้างอิง (เลขที่คำสั่ง)"); + + b.Property("Section") + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasComment("ตอน"); + + b.Property("Volume") + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasComment("เล่ม"); + + b.Property("VolumeNo") + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasComment("เล่มที่"); + + b.Property("Year") + .HasColumnType("int") + .HasComment("ปีที่ยื่นขอ"); + + b.HasKey("Id"); + + b.HasIndex("InsigniaId"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileInsignia"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileInsigniaHistory", 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("DateAnnounce") + .HasColumnType("datetime(6)") + .HasComment("วันที่ประกาศในราชกิจจาฯ"); + + b.Property("Insignia") + .HasColumnType("longtext") + .HasComment("ชื่อเครื่องราชฯ"); + + b.Property("InsigniaId") + .HasColumnType("char(36)"); + + b.Property("InsigniaType") + .HasColumnType("longtext") + .HasComment("ประเภท"); + + b.Property("Issue") + .HasMaxLength(300) + .HasColumnType("varchar(300)") + .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("No") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("ลำดับที่"); + + b.Property("Page") + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasComment("หน้า"); + + b.Property("ProfileInsigniaId") + .HasColumnType("char(36)"); + + b.Property("ReceiveDate") + .HasColumnType("datetime(6)") + .HasComment("ลงวันที่"); + + b.Property("Section") + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasComment("ตอน"); + + b.Property("Volume") + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasComment("เล่ม"); + + b.Property("VolumeNo") + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasComment("เล่มที่"); + + b.Property("Year") + .HasColumnType("int") + .HasComment("ปีที่ยื่นขอ"); + + b.HasKey("Id"); + + b.HasIndex("ProfileInsigniaId"); + + b.ToTable("ProfileInsigniaHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileLeave", 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("DateEndLeave") + .HasColumnType("datetime(6)") + .HasComment("วัน เดือน ปี ที่สิ้นสุดลา"); + + b.Property("DateStartLeave") + .HasColumnType("datetime(6)") + .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("NumLeave") + .HasColumnType("double") + .HasComment("ลาครั้งที่"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.Property("Reason") + .HasColumnType("longtext") + .HasComment("เหตุผล"); + + b.Property("Status") + .HasColumnType("longtext") + .HasComment("สถานะ"); + + b.Property("SumLeave") + .HasColumnType("double") + .HasComment("ลามาแล้ว"); + + b.Property("TotalLeave") + .HasColumnType("double") + .HasComment("รวมเป็น"); + + b.Property("TypeLeaveId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.HasIndex("TypeLeaveId"); + + b.ToTable("ProfileLeave"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileLeaveHistory", 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("DateEndLeave") + .HasColumnType("datetime(6)") + .HasComment("วัน เดือน ปี ที่สิ้นสุดลา"); + + b.Property("DateStartLeave") + .HasColumnType("datetime(6)") + .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("NumLeave") + .HasColumnType("double") + .HasComment("ลาครั้งที่"); + + b.Property("ProfileLeaveId") + .HasColumnType("char(36)"); + + b.Property("Reason") + .HasColumnType("longtext") + .HasComment("เหตุผล"); + + b.Property("Status") + .HasColumnType("longtext") + .HasComment("สถานะ"); + + b.Property("SumLeave") + .HasColumnType("double") + .HasComment("ลามาแล้ว"); + + b.Property("TotalLeave") + .HasColumnType("double") + .HasComment("รวมเป็น"); + + b.Property("TypeLeaveId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileLeaveId"); + + b.HasIndex("TypeLeaveId"); + + b.ToTable("ProfileLeaveHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileMotherHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasComment("ไม่ใช้"); + + b.Property("Career") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("CreatedDate") + .HasColumnType("datetime(6)"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("Prefix") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileMotherHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileNopaid", 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("Date") + .HasColumnType("datetime(6)") + .HasComment("วัน เดือน ปี"); + + b.Property("Detail") + .HasColumnType("longtext") + .HasComment("รายละเอียด"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.Property("Reference") + .HasColumnType("longtext") + .HasComment("เอกสารอ้างอิง"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileNopaid"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileNopaidHistory", 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("Date") + .HasColumnType("datetime(6)") + .HasComment("วัน เดือน ปี"); + + b.Property("Detail") + .HasColumnType("longtext") + .HasComment("รายละเอียด"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("ProfileNopaidId") + .HasColumnType("char(36)"); + + b.Property("Reference") + .HasColumnType("longtext") + .HasComment("เอกสารอ้างอิง"); + + b.HasKey("Id"); + + b.HasIndex("ProfileNopaidId"); + + b.ToTable("ProfileNopaidHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileOther", 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("Date") + .HasColumnType("datetime(6)") + .HasComment("วันที่"); + + b.Property("Detail") + .HasColumnType("longtext") + .HasComment("รายละเอียด"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileOther"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileOtherHistory", 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("Date") + .HasColumnType("datetime(6)") + .HasComment("วันที่"); + + b.Property("Detail") + .HasColumnType("longtext") + .HasComment("รายละเอียด"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("ProfileOtherId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileOtherId"); + + b.ToTable("ProfileOtherHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfilePaper", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CategoryName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .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") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasComment("ชื่อไฟล์"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("DocumentId"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfilePaper"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileRegistrationAddressHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasComment("ไม่ใช้"); + + b.Property("Address") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("CreatedDate") + .HasColumnType("datetime(6)"); + + b.Property("DistrictId") + .HasColumnType("char(36)"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.Property("ProvinceId") + .HasColumnType("char(36)"); + + b.Property("SubDistrictId") + .HasColumnType("char(36)"); + + b.Property("ZipCode") + .IsRequired() + .HasMaxLength(5) + .HasColumnType("varchar(5)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileRegistrationAddressHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileSalary", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("Amount") + .HasColumnType("double") + .HasComment("เงินเดือน"); + + b.Property("CommandNo") + .IsRequired() + .HasColumnType("longtext") + .HasComment("เลขที่คำสั่ง"); + + b.Property("CommandTypeName") + .IsRequired() + .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("Date") + .HasColumnType("datetime(6)") + .HasComment("วัน เดือน ปี รับตำแหน่ง"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + 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("MouthSalaryAmount") + .HasColumnType("double") + .HasComment("เงินค่าตอบแทนรายเดือน"); + + b.Property("OcId") + .HasColumnType("char(36)") + .HasComment("Id สังกัด"); + + b.Property("Order") + .HasColumnType("int") + .HasComment("ลำดับ"); + + b.Property("OrganizationShortNameId") + .HasColumnType("char(36)") + .HasComment("Id ชื่อย่อหน่วยงาน"); + + b.Property("PosNoEmployee") + .HasColumnType("longtext") + .HasComment("เลขที่ตำแหน่งลูกจ้าง"); + + b.Property("PosNoId") + .HasColumnType("char(36)") + .HasComment("Id เลขที่ตำแหน่ง"); + + b.Property("PositionEmployeeGroupId") + .HasColumnType("char(36)") + .HasComment("Id กลุ่มงาน"); + + b.Property("PositionEmployeeLevelId") + .HasColumnType("char(36)") + .HasComment(" Id ระดับชั้นงาน"); + + b.Property("PositionEmployeePositionId") + .HasColumnType("char(36)") + .HasComment("Id ตำแหน่ง"); + + b.Property("PositionEmployeePositionSideId") + .HasColumnType("char(36)") + .HasComment("Id ด้านของตำแหน่ง"); + + b.Property("PositionExecutiveId") + .HasColumnType("char(36)") + .HasComment("Id ตำแหน่งทางการบริหาร"); + + b.Property("PositionExecutiveSideId") + .HasColumnType("char(36)") + .HasComment("Id ด้านทางการบริหาร"); + + b.Property("PositionId") + .HasColumnType("char(36)") + .HasComment("Id ตำแหน่ง"); + + b.Property("PositionLevelId") + .HasColumnType("char(36)"); + + b.Property("PositionLineId") + .HasColumnType("char(36)") + .HasComment("Id สายงาน"); + + b.Property("PositionPathSideId") + .HasColumnType("char(36)") + .HasComment("Id ด้าน/สาขา"); + + b.Property("PositionSalaryAmount") + .HasColumnType("double") + .HasComment("เงินประจำตำแหน่ง"); + + b.Property("PositionTypeId") + .HasColumnType("char(36)") + .HasComment("Id ประเภทตำแหน่ง"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.Property("RefCommandNo") + .HasColumnType("longtext") + .HasComment("เอกสารอ้างอิง (เลขที่คำสั่ง)"); + + b.Property("SalaryClass") + .HasColumnType("longtext") + .HasComment("ตำแหน่ง (รายละเอียด)"); + + b.Property("SalaryRef") + .HasColumnType("longtext") + .HasComment("เอกสารอ้างอิง"); + + b.Property("SalaryStatus") + .HasColumnType("longtext") + .HasComment("ประเภทตำแหน่งกรณีพิเศษ"); + + b.HasKey("Id"); + + b.HasIndex("PositionLevelId"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileSalary"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileSalaryHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("Amount") + .HasColumnType("double") + .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("Date") + .HasColumnType("datetime(6)") + .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("MouthSalaryAmount") + .HasColumnType("double") + .HasComment("เงินค่าตอบแทนรายเดือน"); + + b.Property("Oc") + .HasColumnType("longtext") + .HasComment("สังกัด"); + + b.Property("OcId") + .HasColumnType("char(36)") + .HasComment("Id สังกัด"); + + b.Property("OrganizationShortName") + .HasColumnType("longtext"); + + b.Property("OrganizationShortNameId") + .HasColumnType("char(36)"); + + b.Property("PosNo") + .HasColumnType("longtext") + .HasComment("เลขที่ตำแหน่ง"); + + b.Property("PosNoEmployee") + .HasColumnType("longtext") + .HasComment("เลขที่ตำแหน่งลูกจ้าง"); + + b.Property("PosNoId") + .HasColumnType("char(36)") + .HasComment("Id เลขที่ตำแหน่ง"); + + b.Property("Position") + .HasColumnType("longtext") + .HasComment("ตำแหน่ง"); + + b.Property("PositionEmployeeGroup") + .HasColumnType("longtext") + .HasComment("กลุ่มงาน"); + + b.Property("PositionEmployeeGroupId") + .HasColumnType("char(36)") + .HasComment("Id กลุ่มงาน"); + + b.Property("PositionEmployeeLevel") + .HasColumnType("longtext") + .HasComment("ระดับชั้นงาน"); + + b.Property("PositionEmployeeLevelId") + .HasColumnType("char(36)") + .HasComment(" Id ระดับชั้นงาน"); + + b.Property("PositionEmployeePosition") + .HasColumnType("longtext") + .HasComment("ตำแหน่ง"); + + b.Property("PositionEmployeePositionId") + .HasColumnType("char(36)") + .HasComment("Id ตำแหน่ง"); + + b.Property("PositionEmployeePositionSide") + .HasColumnType("longtext") + .HasComment("ด้านของตำแหน่ง"); + + b.Property("PositionEmployeePositionSideId") + .HasColumnType("char(36)") + .HasComment("Id ด้านของตำแหน่ง"); + + b.Property("PositionExecutive") + .HasColumnType("longtext") + .HasComment("ตำแหน่งทางการบริหาร"); + + b.Property("PositionExecutiveId") + .HasColumnType("char(36)") + .HasComment("Id ด้านทางการบริหาร"); + + b.Property("PositionExecutiveSide") + .HasColumnType("longtext") + .HasComment("ด้านทางการบริหาร"); + + b.Property("PositionExecutiveSideId") + .HasColumnType("char(36)") + .HasComment("Id ด้านทางการบริหาร"); + + b.Property("PositionId") + .HasColumnType("char(36)") + .HasComment("Id ตำแหน่ง"); + + b.Property("PositionLevel") + .HasColumnType("longtext") + .HasComment("ระดับ"); + + b.Property("PositionLevelId") + .HasColumnType("char(36)") + .HasComment(" Id ระดับ"); + + b.Property("PositionLine") + .HasColumnType("longtext") + .HasComment("สายงาน"); + + b.Property("PositionLineId") + .HasColumnType("char(36)") + .HasComment("Id สายงาน"); + + b.Property("PositionPathSide") + .HasColumnType("longtext") + .HasComment("ด้าน/สาขา"); + + b.Property("PositionPathSideId") + .HasColumnType("char(36)") + .HasComment("Id ด้าน/สาขา"); + + b.Property("PositionSalaryAmount") + .HasColumnType("double") + .HasComment("เงินประจำตำแหน่ง"); + + b.Property("PositionType") + .HasColumnType("longtext") + .HasComment("ประเภทตำแหน่ง"); + + b.Property("PositionTypeId") + .HasColumnType("char(36)") + .HasComment("Id ประเภทตำแหน่ง"); + + b.Property("ProfileSalaryId") + .HasColumnType("char(36)"); + + b.Property("SalaryClass") + .HasColumnType("longtext") + .HasComment("ตำแหน่ง (รายละเอียด)"); + + b.Property("SalaryRef") + .HasColumnType("longtext") + .HasComment("เอกสารอ้างอิง"); + + b.HasKey("Id"); + + b.HasIndex("ProfileSalaryId"); + + b.ToTable("ProfileSalaryHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileTraining", 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("DateOrder") + .HasColumnType("datetime(6)") + .HasComment("คำสั่งลงวันที่/หนังสืออนุมัติลงวันที่"); + + b.Property("Department") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("หน่วยงานที่รับผิดชอบจัดการฝึกอบรม/ดูงาน"); + + b.Property("Duration") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("รวมระยะเวลาในการฝึกอบรม/ดูงาน"); + + b.Property("EndDate") + .HasColumnType("datetime(6)") + .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") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("ชื่อโครงการ/หลักสูตรการฝึกอบรม"); + + b.Property("NumberOrder") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("เลขที่คำสั่ง/เลขที่หนังสืออนุมัติ"); + + b.Property("Place") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("สถานที่ฝึกอบรม/ดูงาน"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.Property("StartDate") + .HasColumnType("datetime(6)") + .HasComment("วันเริ่มต้นการฝึกอบรม/ดูงาน"); + + b.Property("Topic") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("หัวข้อการฝึกอบรม/ดูงาน"); + + b.Property("Yearly") + .HasMaxLength(200) + .HasColumnType("int") + .HasComment("ปีที่อบรม (พ.ศ.)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileTraining"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileTrainingHistory", 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("DateOrder") + .HasColumnType("datetime(6)") + .HasComment("คำสั่งลงวันที่/หนังสืออนุมัติลงวันที่"); + + b.Property("Department") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("หน่วยงานที่รับผิดชอบจัดการฝึกอบรม/ดูงาน"); + + b.Property("Duration") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("รวมระยะเวลาในการฝึกอบรม/ดูงาน"); + + b.Property("EndDate") + .HasColumnType("datetime(6)") + .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") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("ชื่อโครงการ/หลักสูตรการฝึกอบรม"); + + b.Property("NumberOrder") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("เลขที่คำสั่ง/เลขที่หนังสืออนุมัติ"); + + b.Property("Place") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("สถานที่ฝึกอบรม/ดูงาน"); + + b.Property("ProfileTrainingId") + .HasColumnType("char(36)"); + + b.Property("StartDate") + .HasColumnType("datetime(6)") + .HasComment("วันเริ่มต้นการฝึกอบรม/ดูงาน"); + + b.Property("Topic") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("หัวข้อการฝึกอบรม/ดูงาน"); + + b.Property("Yearly") + .HasMaxLength(200) + .HasColumnType("int") + .HasComment("ปีที่อบรม (พ.ศ.)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileTrainingId"); + + b.ToTable("ProfileTrainingHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.TypeLeave", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Name") + .HasColumnType("longtext") + .HasComment("ประเภทการลา"); + + b.HasKey("Id"); + + b.ToTable("TypeLeave"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.BloodGroup", 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(2) + .HasColumnType("varchar(2)") + .HasColumnOrder(1) + .HasComment("ชื่อหมู่โลหิต"); + + b.HasKey("Id"); + + b.ToTable("BloodGroups"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.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.Domain.Models.MetaData.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.Domain.Models.MetaData.Gender", 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(20) + .HasColumnType("varchar(20)") + .HasColumnOrder(1) + .HasComment("เพศ"); + + b.HasKey("Id"); + + b.ToTable("Genders"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.Holiday", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("Category") + .IsRequired() + .HasColumnType("longtext") + .HasColumnOrder(6) + .HasComment("ประเภทของวันหยุดสำหรับ ทำงาน 5 วัน=`NORMAL`,ทำงาน 6 วัน=`6DAYS`"); + + 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("HolidayDate") + .HasColumnType("datetime(6)") + .HasColumnOrder(2) + .HasComment("วันหยุด"); + + b.Property("IsSpecial") + .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(250) + .HasColumnType("varchar(250)") + .HasColumnOrder(4) + .HasComment("ชื่อวันหยุด"); + + b.Property("OriginalDate") + .HasColumnType("datetime(6)") + .HasColumnOrder(3) + .HasComment("วันหยุด(Original)"); + + b.Property("Year") + .HasColumnType("int") + .HasColumnOrder(1) + .HasComment("ประจำปี"); + + b.HasKey("Id"); + + b.ToTable("Holidays"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.Insignia", 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("InsigniaTypeId") + .HasColumnType("char(36)"); + + 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("Level") + .HasColumnType("int") + .HasColumnOrder(4) + .HasComment("ลำดับชั้นของเครื่องราช เอาไว้ตรวจสอบเวลาขอว่าต้องได้ชั้นที่สูงกว่าที่เคยได้รับแล้วเท่านั้น"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnOrder(1) + .HasComment("ชื่อเครื่องราช"); + + b.Property("Note") + .IsRequired() + .HasColumnType("longtext") + .HasColumnOrder(5) + .HasComment("หมายเหตุ"); + + b.Property("ShortName") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasColumnOrder(2) + .HasComment("ชื่อย่อเครื่องราช"); + + b.HasKey("Id"); + + b.HasIndex("InsigniaTypeId"); + + b.ToTable("Insignias"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.InsigniaType", 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("InsigniaTypes"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.OrganizationAgency", 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("OrganizationAgencys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.OrganizationFax", 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("OrganizationFaxs"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.OrganizationGovernmentAgency", 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("OrganizationGovernmentAgencys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.OrganizationLevel", 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("OrganizationLevels"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.OrganizationOrganization", 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.Property("Note") + .IsRequired() + .HasColumnType("longtext") + .HasColumnOrder(3) + .HasComment("หมายเหตุ"); + + b.HasKey("Id"); + + b.ToTable("OrganizationOrganizations"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.OrganizationShortName", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("AgencyCode") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnOrder(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("GovernmentCode") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnOrder(2) + .HasComment("ข้อมูลโครงสร้างหน่วยงานชื่อ รหัสส่วนราชการ"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(4) + .HasComment("สถานะการใช้งาน"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnOrder(3) + .HasComment("ข้อมูลโครงสร้างหน่วยงานชื่อ ตัวย่อหน่วยงาน"); + + b.Property("Note") + .IsRequired() + .HasColumnType("longtext") + .HasColumnOrder(5) + .HasComment("หมายเหตุ"); + + b.HasKey("Id"); + + b.ToTable("OrganizationShortNames"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.OrganizationStatus", 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("OrganizationStatuses"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.OrganizationTelExternal", 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("OrganizationTelExternals"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.OrganizationTelInternal", 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("OrganizationTelInternals"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.OrganizationType", 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("OrganizationTypes"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PhysicalStatus", 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("PhysicalStatuses"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.Position", 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("ExecutiveName") + .IsRequired() + .HasMaxLength(300) + .HasColumnType("varchar(300)") + .HasColumnOrder(3) + .HasComment("ชื่อตำแหน่งทางการบริหาร"); + + b.Property("ExecutiveSideId") + .HasColumnType("char(36)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(9) + .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(300) + .HasColumnType("varchar(300)") + .HasColumnOrder(1) + .HasComment("ชื่อตำแหน่ง"); + + b.Property("PathSideId") + .HasColumnType("char(36)"); + + b.Property("PositionCategory") + .IsRequired() + .HasColumnType("longtext") + .HasColumnOrder(8) + .HasComment("ตำแหน่งสำหรับข้าราชการหรือลูกจ้าง officer/employee"); + + b.Property("PositionLevelId") + .HasColumnType("char(36)"); + + b.Property("PositionPathId") + .HasColumnType("char(36)"); + + b.Property("PositionTypeId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ExecutiveSideId"); + + b.HasIndex("PathSideId"); + + b.HasIndex("PositionLevelId"); + + b.HasIndex("PositionPathId"); + + b.HasIndex("PositionTypeId"); + + b.ToTable("Positions"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PositionEmployeeGroup", 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("PositionEmployeeGroups"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PositionEmployeeLevel", 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(100) + .HasColumnType("varchar(100)") + .HasColumnOrder(2) + .HasComment("ชื่อระดับชั้นงานข้อมูลตำแหน่งของลูกจ้างกรุงเทพ"); + + b.Property("Order") + .HasColumnType("int") + .HasColumnOrder(1) + .HasComment("ลำดับ"); + + b.HasKey("Id"); + + b.ToTable("PositionEmployeeLevels"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PositionEmployeeLine", 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("PositionEmployeeLines"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PositionEmployeePosition", 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.Property("Note") + .IsRequired() + .HasColumnType("longtext") + .HasColumnOrder(3) + .HasComment("หมายเหตุ"); + + b.HasKey("Id"); + + b.ToTable("PositionEmployeePositions"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PositionEmployeePositionSide", 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.Property("Note") + .IsRequired() + .HasColumnType("longtext") + .HasColumnOrder(3) + .HasComment("หมายเหตุ"); + + b.HasKey("Id"); + + b.ToTable("PositionEmployeePositionSides"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PositionEmployeeStatus", 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("PositionEmployeeStatuses"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PositionExecutive", 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("PositionExecutives"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PositionExecutiveSide", 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.Property("Note") + .IsRequired() + .HasColumnType("longtext") + .HasColumnOrder(3) + .HasComment("หมายเหตุ"); + + b.HasKey("Id"); + + b.ToTable("PositionExecutiveSides"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PositionLevel", 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(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("Level") + .HasColumnType("int") + .HasColumnOrder(4) + .HasComment("ลำดับชั้นของระดับตำแหน่ง"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnOrder(2) + .HasComment("ชื่อระดับตำแหน่ง"); + + b.Property("Order") + .HasColumnType("int") + .HasColumnOrder(1) + .HasComment("ลำดับ"); + + b.Property("ShortName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnOrder(3) + .HasComment("ชื่อย่อระดับตำแหน่ง"); + + b.HasKey("Id"); + + b.ToTable("PositionLevels"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PositionLine", 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("PositionLines"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PositionPath", 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.Property("Note") + .IsRequired() + .HasColumnType("longtext") + .HasColumnOrder(3) + .HasComment("หมายเหตุ"); + + b.HasKey("Id"); + + b.ToTable("PositionPaths"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PositionPathSide", 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.Property("Note") + .IsRequired() + .HasColumnType("longtext") + .HasColumnOrder(3) + .HasComment("หมายเหตุ"); + + b.HasKey("Id"); + + b.ToTable("PositionPathSides"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PositionStatus", 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("PositionStatuss"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PositionType", 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(100) + .HasColumnType("varchar(100)") + .HasColumnOrder(2) + .HasComment("ชื่อประเภทตำแหน่ง"); + + b.Property("Order") + .HasColumnType("int") + .HasColumnOrder(1) + .HasComment("ลำดับ"); + + b.HasKey("Id"); + + b.ToTable("PositionTypes"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.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.Domain.Models.MetaData.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.Domain.Models.MetaData.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.Domain.Models.MetaData.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("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("Religions"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.Royal", 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(100) + .HasColumnType("varchar(100)") + .HasColumnOrder(1) + .HasComment("ชื่อประเภทข้อมูลเหรียญตรา"); + + b.Property("ShortName") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("varchar(10)") + .HasColumnOrder(2) + .HasComment("ชื่อย่อเหรียญตรา"); + + b.HasKey("Id"); + + b.ToTable("Royals"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.RoyalHierarchy", 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("RoyalHierarchys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.RoyalType", 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("RoyalTypes"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.SubDistrict", 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("DistrictId") + .HasColumnType("char(36)"); + + 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(150) + .HasColumnType("varchar(150)") + .HasColumnOrder(1) + .HasComment("เขต/อำเภอ"); + + b.Property("ZipCode") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("varchar(10)") + .HasColumnOrder(2) + .HasComment("รหัสไปรษณีย์"); + + b.HasKey("Id"); + + b.HasIndex("DistrictId"); + + b.ToTable("SubDistricts"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.AvailablePositionLevelEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("PositionLevelId") + .HasColumnType("char(36)"); + + b.Property("PositionMasterId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("PositionLevelId"); + + b.HasIndex("PositionMasterId"); + + b.ToTable("AvailablePositionLevels"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.OrganizationEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("Agency") + .HasColumnType("longtext") + .HasColumnOrder(14) + .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("Department") + .HasColumnType("longtext") + .HasColumnOrder(16) + .HasComment("ฝ่าย/ส่วน"); + + b.Property("Government") + .HasColumnType("longtext") + .HasColumnOrder(15) + .HasComment("ส่วนราชการ"); + + 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("OrganizationAgencyId") + .HasColumnType("char(36)") + .HasColumnOrder(10) + .HasComment("OrganizationAgencyId"); + + b.Property("OrganizationFaxId") + .HasColumnType("char(36)"); + + b.Property("OrganizationGovernmentAgencyId") + .HasColumnType("char(36)") + .HasColumnOrder(11) + .HasComment("OrganizationGovernmentAgencyId"); + + b.Property("OrganizationLevelId") + .HasColumnType("char(36)"); + + b.Property("OrganizationOrder") + .HasColumnType("int") + .HasColumnOrder(12) + .HasComment("OrganizationOrder"); + + b.Property("OrganizationOrganizationId") + .HasColumnType("char(36)"); + + b.Property("OrganizationShortNameId") + .HasColumnType("char(36)"); + + b.Property("OrganizationStatusId") + .HasColumnType("char(36)"); + + b.Property("OrganizationTelExternalId") + .HasColumnType("char(36)"); + + b.Property("OrganizationTelInternalId") + .HasColumnType("char(36)"); + + b.Property("OrganizationTypeId") + .HasColumnType("char(36)"); + + b.Property("OrganizationUserNote") + .HasColumnType("longtext") + .HasColumnOrder(13) + .HasComment("OrganizationUserNote"); + + b.Property("ParentId") + .HasColumnType("char(36)"); + + b.Property("Pile") + .HasColumnType("longtext") + .HasColumnOrder(17) + .HasComment("กอง"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationFaxId"); + + b.HasIndex("OrganizationLevelId"); + + b.HasIndex("OrganizationOrganizationId"); + + b.HasIndex("OrganizationShortNameId"); + + b.HasIndex("OrganizationStatusId"); + + b.HasIndex("OrganizationTelExternalId"); + + b.HasIndex("OrganizationTelInternalId"); + + b.HasIndex("OrganizationTypeId"); + + b.HasIndex("ParentId"); + + b.ToTable("Organizations"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.OrganizationPositionEntity", 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("IsDirector") + .HasColumnType("tinyint(1)") + .HasColumnOrder(3) + .HasComment("Is Director"); + + 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("OrganizationId") + .HasColumnType("char(36)"); + + b.Property("PositionMasterId") + .HasColumnType("char(36)"); + + b.Property("PositionNumberId") + .HasColumnType("char(36)"); + + b.Property("PositionUserNote") + .HasColumnType("longtext") + .HasColumnOrder(4) + .HasComment("positionUserNote"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationId"); + + b.HasIndex("PositionMasterId"); + + b.HasIndex("PositionNumberId"); + + b.ToTable("OrganizationPositions"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.PositionMasterEntity", 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("IsDirector") + .HasColumnType("tinyint(1)") + .HasColumnOrder(14) + .HasComment("IsDirector"); + + 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("PositionCondition") + .HasColumnType("longtext") + .HasColumnOrder(11) + .HasComment("PositionCondition"); + + b.Property("PositionExecutiveId") + .HasColumnType("char(36)"); + + b.Property("PositionExecutiveSideId") + .HasColumnType("char(36)"); + + b.Property("PositionExecutiveSideObject") + .HasColumnType("longtext"); + + b.Property("PositionId") + .HasColumnType("char(36)") + .HasColumnOrder(2) + .HasComment("PositionId"); + + b.Property("PositionLineId") + .HasColumnType("char(36)"); + + b.Property("PositionMasterUserNote") + .HasColumnType("longtext") + .HasColumnOrder(13) + .HasComment("PositionMasterUserNote"); + + b.Property("PositionPathId") + .HasColumnType("char(36)"); + + b.Property("PositionPathSideId") + .HasColumnType("char(36)"); + + b.Property("PositionPathSideObject") + .HasColumnType("longtext"); + + b.Property("PositionStatusId") + .HasColumnType("char(36)"); + + b.Property("PositionTypeId") + .HasColumnType("char(36)"); + + b.Property("Qualification") + .HasColumnType("longtext") + .HasColumnOrder(15) + .HasComment("คุณวุฒิ"); + + b.HasKey("Id"); + + b.HasIndex("PositionExecutiveId"); + + b.HasIndex("PositionExecutiveSideId"); + + b.HasIndex("PositionLineId"); + + b.HasIndex("PositionPathId"); + + b.HasIndex("PositionPathSideId"); + + b.HasIndex("PositionStatusId"); + + b.HasIndex("PositionTypeId"); + + b.ToTable("PositionMasters"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.PositionMasterHistoryEntity", 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("IsDirector") + .HasColumnType("tinyint(1)") + .HasColumnOrder(14) + .HasComment("IsDirector"); + + 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("Position") + .HasColumnType("longtext") + .HasColumnOrder(2) + .HasComment("Position"); + + b.Property("PositionCondition") + .HasColumnType("longtext") + .HasColumnOrder(11) + .HasComment("PositionCondition"); + + b.Property("PositionExecutive") + .HasColumnType("longtext") + .HasColumnOrder(5) + .HasComment("PositionExecutive"); + + b.Property("PositionExecutiveSide") + .HasColumnType("longtext") + .HasColumnOrder(6) + .HasComment("PositionExecutiveSide"); + + b.Property("PositionExecutiveSideObject") + .HasColumnType("longtext"); + + b.Property("PositionLevel") + .HasColumnType("longtext") + .HasColumnOrder(12) + .HasComment("PositionLevel"); + + b.Property("PositionLine") + .HasColumnType("longtext") + .HasColumnOrder(8) + .HasComment("PositionLine"); + + b.Property("PositionMasterEntityId") + .HasColumnType("char(36)"); + + b.Property("PositionMasterUserNote") + .HasColumnType("longtext") + .HasColumnOrder(13) + .HasComment("PositionMasterUserNote"); + + b.Property("PositionPath") + .HasColumnType("longtext") + .HasColumnOrder(3) + .HasComment("PositionPath"); + + b.Property("PositionPathSide") + .HasColumnType("longtext") + .HasColumnOrder(7) + .HasComment("PositionPathSide"); + + b.Property("PositionPathSideObject") + .HasColumnType("longtext"); + + b.Property("PositionStatus") + .HasColumnType("longtext") + .HasColumnOrder(10) + .HasComment("PositionStatus"); + + b.Property("PositionType") + .HasColumnType("longtext") + .HasColumnOrder(4) + .HasComment("PositionType"); + + b.Property("Qualification") + .HasColumnType("longtext") + .HasColumnOrder(15) + .HasComment("คุณวุฒิ"); + + b.HasKey("Id"); + + b.HasIndex("PositionMasterEntityId"); + + b.ToTable("PositionMasterHistoryEntity"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.PositionNumberEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Name") + .HasMaxLength(300) + .HasColumnType("varchar(300)") + .HasColumnOrder(2) + .HasComment("ชื่อ"); + + b.Property("OrganizationShortNameId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationShortNameId"); + + b.ToTable("PositionNumbers"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.ProfilePosition", 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)"); + + b.Property("IsPublished") + .HasColumnType("tinyint(1)"); + + 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("OrganizationPositionId") + .HasColumnType("char(36)"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationPositionId"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfilePositions"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Doc", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint", "DisciplineComplaint") + .WithMany("DisciplineComplaint_Docs") + .HasForeignKey("DisciplineComplaintId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineComplaint"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Profile", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint", "DisciplineComplaint") + .WithMany("DisciplineComplaint_Profiles") + .HasForeignKey("DisciplineComplaintId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineComplaint"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint", "DisciplineComplaint") + .WithMany() + .HasForeignKey("DisciplineComplaintId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineComplaint"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DirectorInvestigate", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDirector", "DisciplineDirector") + .WithMany() + .HasForeignKey("DisciplineDirectorId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate") + .WithMany() + .HasForeignKey("DisciplineInvestigateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDirector"); + + b.Navigation("DisciplineInvestigate"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocComplaintInvestigate", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate") + .WithMany() + .HasForeignKey("DisciplineInvestigateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineInvestigate"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocInvestigate", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate") + .WithMany() + .HasForeignKey("DisciplineInvestigateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineInvestigate"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocInvestigateRelevant", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate") + .WithMany() + .HasForeignKey("DisciplineInvestigateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineInvestigate"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_ProfileComplaintInvestigate", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate") + .WithMany() + .HasForeignKey("DisciplineInvestigateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineInvestigate"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint", "DisciplineComplaint") + .WithMany("DisciplineInvestigates") + .HasForeignKey("DisciplineComplaintId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineComplaint"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigateRelevant_Doc", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", null) + .WithMany("DisciplineInvestigateRelevant_Docs") + .HasForeignKey("DisciplineDisciplinaryId"); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate") + .WithMany("DisciplineInvestigateRelevant_Docs") + .HasForeignKey("DisciplineInvestigateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineInvestigate"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_Director", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDirector", "DisciplineDirector") + .WithMany("DisciplineInvestigate_Directors") + .HasForeignKey("DisciplineDirectorId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", null) + .WithMany("DisciplineInvestigate_Directors") + .HasForeignKey("DisciplineDisciplinaryId"); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate") + .WithMany("DisciplineInvestigate_Directors") + .HasForeignKey("DisciplineInvestigateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDirector"); + + b.Navigation("DisciplineInvestigate"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_Doc", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", null) + .WithMany("DisciplineInvestigate_Docs") + .HasForeignKey("DisciplineDisciplinaryId"); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate") + .WithMany("DisciplineInvestigate_Docs") + .HasForeignKey("DisciplineInvestigateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineInvestigate"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_DocComplaint", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", null) + .WithMany("DisciplineInvestigate_DocComplaints") + .HasForeignKey("DisciplineDisciplinaryId"); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate") + .WithMany("DisciplineInvestigate_DocComplaints") + .HasForeignKey("DisciplineInvestigateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineInvestigate"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_ProfileComplaint", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", null) + .WithMany("DisciplineInvestigate_ProfileComplaints") + .HasForeignKey("DisciplineDisciplinaryId"); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate") + .WithMany("DisciplineInvestigate_ProfileComplaints") + .HasForeignKey("DisciplineInvestigateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineInvestigate"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.LimitTypeLeave", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.LimitLeave", "LimitLeave") + .WithMany("LimitTypeLeaves") + .HasForeignKey("LimitLeaveId"); + + b.HasOne("BMA.EHR.Domain.Models.HR.TypeLeave", "TypeLeave") + .WithMany("LimitTypeLeaves") + .HasForeignKey("TypeLeaveId"); + + b.Navigation("LimitLeave"); + + b.Navigation("TypeLeave"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.Profile", b => + { + b.HasOne("BMA.EHR.Domain.Models.Documents.Document", "Avatar") + .WithMany() + .HasForeignKey("AvatarId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.Gender", "Gender") + .WithMany() + .HasForeignKey("GenderId"); + + b.HasOne("BMA.EHR.Domain.Models.HR.LimitLeave", "LimitLeave") + .WithMany("Profiles") + .HasForeignKey("LimitLeaveId"); + + b.HasOne("BMA.EHR.Domain.Models.Organizations.PositionNumberEntity", "PosNo") + .WithMany() + .HasForeignKey("PosNoId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionEmployeeGroup", "PositionEmployeeGroup") + .WithMany() + .HasForeignKey("PositionEmployeeGroupId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionEmployeeLevel", "PositionEmployeeLevel") + .WithMany() + .HasForeignKey("PositionEmployeeLevelId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionEmployeeLine", "PositionEmployeeLine") + .WithMany() + .HasForeignKey("PositionEmployeeLineId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionEmployeePosition", "PositionEmployeePosition") + .WithMany() + .HasForeignKey("PositionEmployeePositionId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionEmployeePositionSide", "PositionEmployeePositionSide") + .WithMany() + .HasForeignKey("PositionEmployeePositionSideId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionPath", "Position") + .WithMany() + .HasForeignKey("PositionId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionLevel", "PositionLevel") + .WithMany() + .HasForeignKey("PositionLevelId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionType", "PositionType") + .WithMany() + .HasForeignKey("PositionTypeId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.Prefix", "Prefix") + .WithMany() + .HasForeignKey("PrefixId"); + + b.Navigation("Avatar"); + + b.Navigation("Gender"); + + b.Navigation("LimitLeave"); + + b.Navigation("PosNo"); + + b.Navigation("Position"); + + b.Navigation("PositionEmployeeGroup"); + + b.Navigation("PositionEmployeeLevel"); + + b.Navigation("PositionEmployeeLine"); + + b.Navigation("PositionEmployeePosition"); + + b.Navigation("PositionEmployeePositionSide"); + + b.Navigation("PositionLevel"); + + b.Navigation("PositionType"); + + b.Navigation("Prefix"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAbility", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("Abilitys") + .HasForeignKey("ProfileId"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAbilityHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.ProfileAbility", "ProfileAbility") + .WithMany("ProfileAbilityHistorys") + .HasForeignKey("ProfileAbilityId"); + + b.Navigation("ProfileAbility"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAddressHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("AddressHistory") + .HasForeignKey("ProfileId"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAssessment", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("Assessments") + .HasForeignKey("ProfileId"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAssessmentHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.ProfileAssessment", "ProfileAssessment") + .WithMany("ProfileAssessmentHistorys") + .HasForeignKey("ProfileAssessmentId"); + + b.Navigation("ProfileAssessment"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAvatarHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.Documents.Document", "AvatarFile") + .WithMany() + .HasForeignKey("AvatarFileId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("AvatarHistory") + .HasForeignKey("ProfileId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("AvatarFile"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileCertificate", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("Certificates") + .HasForeignKey("ProfileId"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileCertificateHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.ProfileCertificate", "ProfileCertificate") + .WithMany("ProfileCertificateHistorys") + .HasForeignKey("ProfileCertificateId"); + + b.Navigation("ProfileCertificate"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileChangeName", b => + { + b.HasOne("BMA.EHR.Domain.Models.Documents.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId"); + + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("ChangeNames") + .HasForeignKey("ProfileId"); + + b.Navigation("Document"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileChangeNameHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.Documents.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId"); + + b.HasOne("BMA.EHR.Domain.Models.HR.ProfileChangeName", "ProfileChangeName") + .WithMany("ProfileChangeNameHistorys") + .HasForeignKey("ProfileChangeNameId"); + + b.Navigation("Document"); + + b.Navigation("ProfileChangeName"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileChildren", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("Childrens") + .HasForeignKey("ProfileId"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileChildrenHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.ProfileChildren", null) + .WithMany("ProfileChildrenHistorys") + .HasForeignKey("ProfileChildrenId"); + + b.HasOne("BMA.EHR.Domain.Models.HR.ProfileFamilyHistory", null) + .WithMany("Childrens") + .HasForeignKey("ProfileFamilyHistoryId"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileCoupleHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("CoupleHistory") + .HasForeignKey("ProfileId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileCurrentAddressHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("CurrentAddressHistory") + .HasForeignKey("ProfileId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileDiscipline", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("Disciplines") + .HasForeignKey("ProfileId"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileDisciplineHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.ProfileDiscipline", "ProfileDiscipline") + .WithMany("ProfileDisciplineHistorys") + .HasForeignKey("ProfileDisciplineId"); + + b.Navigation("ProfileDiscipline"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileDuty", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("Dutys") + .HasForeignKey("ProfileId"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileDutyHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.ProfileDuty", "ProfileDuty") + .WithMany("ProfileDutyHistorys") + .HasForeignKey("ProfileDutyId"); + + b.Navigation("ProfileDuty"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileEducation", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("Educations") + .HasForeignKey("ProfileId"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileEducationHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.ProfileEducation", "ProfileEducation") + .WithMany("ProfileEducationHistorys") + .HasForeignKey("ProfileEducationId"); + + b.Navigation("ProfileEducation"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileEmployment", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("Employments") + .HasForeignKey("ProfileId"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileFamilyHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("FamilyHistory") + .HasForeignKey("ProfileId"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileFatherHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("FatherHistory") + .HasForeignKey("ProfileId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileGovernmentHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("GovernmentHistory") + .HasForeignKey("ProfileId"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("ProfileHistory") + .HasForeignKey("ProfileId"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileHonor", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("Honors") + .HasForeignKey("ProfileId"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileHonorHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.ProfileHonor", "ProfileHonor") + .WithMany("ProfileHonorHistorys") + .HasForeignKey("ProfileHonorId"); + + b.Navigation("ProfileHonor"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileInsignia", b => + { + b.HasOne("BMA.EHR.Domain.Models.MetaData.Insignia", "Insignia") + .WithMany() + .HasForeignKey("InsigniaId"); + + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("Insignias") + .HasForeignKey("ProfileId"); + + b.Navigation("Insignia"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileInsigniaHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.ProfileInsignia", "ProfileInsignia") + .WithMany("ProfileInsigniaHistorys") + .HasForeignKey("ProfileInsigniaId"); + + b.Navigation("ProfileInsignia"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileLeave", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("Leaves") + .HasForeignKey("ProfileId"); + + b.HasOne("BMA.EHR.Domain.Models.HR.TypeLeave", "TypeLeave") + .WithMany() + .HasForeignKey("TypeLeaveId"); + + b.Navigation("Profile"); + + b.Navigation("TypeLeave"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileLeaveHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.ProfileLeave", "ProfileLeave") + .WithMany("ProfileLeaveHistorys") + .HasForeignKey("ProfileLeaveId"); + + b.HasOne("BMA.EHR.Domain.Models.HR.TypeLeave", "TypeLeave") + .WithMany() + .HasForeignKey("TypeLeaveId"); + + b.Navigation("ProfileLeave"); + + b.Navigation("TypeLeave"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileMotherHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("MotherHistory") + .HasForeignKey("ProfileId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileNopaid", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("Nopaids") + .HasForeignKey("ProfileId"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileNopaidHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.ProfileNopaid", "ProfileNopaid") + .WithMany("ProfileNopaidHistorys") + .HasForeignKey("ProfileNopaidId"); + + b.Navigation("ProfileNopaid"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileOther", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("Others") + .HasForeignKey("ProfileId"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileOtherHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.ProfileOther", "ProfileOther") + .WithMany("ProfileOtherHistorys") + .HasForeignKey("ProfileOtherId"); + + b.Navigation("ProfileOther"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfilePaper", b => + { + b.HasOne("BMA.EHR.Domain.Models.Documents.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("Papers") + .HasForeignKey("ProfileId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Document"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileRegistrationAddressHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("RegistrationAddressHistory") + .HasForeignKey("ProfileId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileSalary", b => + { + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionLevel", "PositionLevel") + .WithMany() + .HasForeignKey("PositionLevelId"); + + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("Salaries") + .HasForeignKey("ProfileId"); + + b.Navigation("PositionLevel"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileSalaryHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.ProfileSalary", "ProfileSalary") + .WithMany("ProfileSalaryHistorys") + .HasForeignKey("ProfileSalaryId"); + + b.Navigation("ProfileSalary"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileTraining", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("Trainings") + .HasForeignKey("ProfileId"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileTrainingHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.ProfileTraining", "ProfileTraining") + .WithMany("ProfileTrainingHistorys") + .HasForeignKey("ProfileTrainingId"); + + b.Navigation("ProfileTraining"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.District", b => + { + b.HasOne("BMA.EHR.Domain.Models.MetaData.Province", "Province") + .WithMany("Districts") + .HasForeignKey("ProvinceId"); + + b.Navigation("Province"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.Insignia", b => + { + b.HasOne("BMA.EHR.Domain.Models.MetaData.InsigniaType", "InsigniaType") + .WithMany() + .HasForeignKey("InsigniaTypeId"); + + b.Navigation("InsigniaType"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.Position", b => + { + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionExecutiveSide", "ExecutiveSide") + .WithMany() + .HasForeignKey("ExecutiveSideId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionPathSide", "PathSide") + .WithMany() + .HasForeignKey("PathSideId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionLevel", "PositionLevel") + .WithMany() + .HasForeignKey("PositionLevelId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionPath", "PositionPath") + .WithMany() + .HasForeignKey("PositionPathId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionType", "PositionType") + .WithMany() + .HasForeignKey("PositionTypeId"); + + b.Navigation("ExecutiveSide"); + + b.Navigation("PathSide"); + + b.Navigation("PositionLevel"); + + b.Navigation("PositionPath"); + + b.Navigation("PositionType"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.SubDistrict", b => + { + b.HasOne("BMA.EHR.Domain.Models.MetaData.District", "District") + .WithMany("SubDistricts") + .HasForeignKey("DistrictId"); + + b.Navigation("District"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.AvailablePositionLevelEntity", b => + { + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionLevel", "PositionLevel") + .WithMany() + .HasForeignKey("PositionLevelId"); + + b.HasOne("BMA.EHR.Domain.Models.Organizations.PositionMasterEntity", "PositionMaster") + .WithMany() + .HasForeignKey("PositionMasterId"); + + b.Navigation("PositionLevel"); + + b.Navigation("PositionMaster"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.OrganizationEntity", b => + { + b.HasOne("BMA.EHR.Domain.Models.MetaData.OrganizationFax", "OrganizationFax") + .WithMany() + .HasForeignKey("OrganizationFaxId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.OrganizationLevel", "OrganizationLevel") + .WithMany() + .HasForeignKey("OrganizationLevelId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.OrganizationOrganization", "OrganizationOrganization") + .WithMany() + .HasForeignKey("OrganizationOrganizationId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.OrganizationShortName", "OrganizationShortName") + .WithMany() + .HasForeignKey("OrganizationShortNameId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.OrganizationStatus", "OrganizationStatus") + .WithMany() + .HasForeignKey("OrganizationStatusId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.OrganizationTelExternal", "OrganizationTelExternal") + .WithMany() + .HasForeignKey("OrganizationTelExternalId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.OrganizationTelInternal", "OrganizationTelInternal") + .WithMany() + .HasForeignKey("OrganizationTelInternalId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.OrganizationType", "OrganizationType") + .WithMany() + .HasForeignKey("OrganizationTypeId"); + + b.HasOne("BMA.EHR.Domain.Models.Organizations.OrganizationEntity", "Parent") + .WithMany("Organizations") + .HasForeignKey("ParentId"); + + b.Navigation("OrganizationFax"); + + b.Navigation("OrganizationLevel"); + + b.Navigation("OrganizationOrganization"); + + b.Navigation("OrganizationShortName"); + + b.Navigation("OrganizationStatus"); + + b.Navigation("OrganizationTelExternal"); + + b.Navigation("OrganizationTelInternal"); + + b.Navigation("OrganizationType"); + + b.Navigation("Parent"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.OrganizationPositionEntity", b => + { + b.HasOne("BMA.EHR.Domain.Models.Organizations.OrganizationEntity", "Organization") + .WithMany() + .HasForeignKey("OrganizationId"); + + b.HasOne("BMA.EHR.Domain.Models.Organizations.PositionMasterEntity", "PositionMaster") + .WithMany() + .HasForeignKey("PositionMasterId"); + + b.HasOne("BMA.EHR.Domain.Models.Organizations.PositionNumberEntity", "PositionNumber") + .WithMany() + .HasForeignKey("PositionNumberId"); + + b.Navigation("Organization"); + + b.Navigation("PositionMaster"); + + b.Navigation("PositionNumber"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.PositionMasterEntity", b => + { + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionExecutive", "PositionExecutive") + .WithMany() + .HasForeignKey("PositionExecutiveId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionExecutiveSide", "PositionExecutiveSide") + .WithMany() + .HasForeignKey("PositionExecutiveSideId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionLine", "PositionLine") + .WithMany() + .HasForeignKey("PositionLineId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionPath", "PositionPath") + .WithMany() + .HasForeignKey("PositionPathId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionPathSide", "PositionPathSide") + .WithMany() + .HasForeignKey("PositionPathSideId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionStatus", "PositionStatus") + .WithMany() + .HasForeignKey("PositionStatusId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionType", "PositionType") + .WithMany() + .HasForeignKey("PositionTypeId"); + + b.Navigation("PositionExecutive"); + + b.Navigation("PositionExecutiveSide"); + + b.Navigation("PositionLine"); + + b.Navigation("PositionPath"); + + b.Navigation("PositionPathSide"); + + b.Navigation("PositionStatus"); + + b.Navigation("PositionType"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.PositionMasterHistoryEntity", b => + { + b.HasOne("BMA.EHR.Domain.Models.Organizations.PositionMasterEntity", "PositionMasterEntity") + .WithMany("PositionMasterHistorys") + .HasForeignKey("PositionMasterEntityId"); + + b.Navigation("PositionMasterEntity"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.PositionNumberEntity", b => + { + b.HasOne("BMA.EHR.Domain.Models.MetaData.OrganizationShortName", "OrganizationShortName") + .WithMany() + .HasForeignKey("OrganizationShortNameId"); + + b.Navigation("OrganizationShortName"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.ProfilePosition", b => + { + b.HasOne("BMA.EHR.Domain.Models.Organizations.OrganizationPositionEntity", "OrganizationPosition") + .WithMany() + .HasForeignKey("OrganizationPositionId"); + + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany() + .HasForeignKey("ProfileId"); + + b.Navigation("OrganizationPosition"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint", b => + { + b.Navigation("DisciplineComplaint_Docs"); + + b.Navigation("DisciplineComplaint_Profiles"); + + b.Navigation("DisciplineInvestigates"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDirector", b => + { + b.Navigation("DisciplineInvestigate_Directors"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", b => + { + b.Navigation("DisciplineInvestigateRelevant_Docs"); + + b.Navigation("DisciplineInvestigate_Directors"); + + b.Navigation("DisciplineInvestigate_DocComplaints"); + + b.Navigation("DisciplineInvestigate_Docs"); + + b.Navigation("DisciplineInvestigate_ProfileComplaints"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", b => + { + b.Navigation("DisciplineInvestigateRelevant_Docs"); + + b.Navigation("DisciplineInvestigate_Directors"); + + b.Navigation("DisciplineInvestigate_DocComplaints"); + + b.Navigation("DisciplineInvestigate_Docs"); + + b.Navigation("DisciplineInvestigate_ProfileComplaints"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.LimitLeave", b => + { + b.Navigation("LimitTypeLeaves"); + + b.Navigation("Profiles"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.Profile", b => + { + b.Navigation("Abilitys"); + + b.Navigation("AddressHistory"); + + b.Navigation("Assessments"); + + b.Navigation("AvatarHistory"); + + b.Navigation("Certificates"); + + b.Navigation("ChangeNames"); + + b.Navigation("Childrens"); + + b.Navigation("CoupleHistory"); + + b.Navigation("CurrentAddressHistory"); + + b.Navigation("Disciplines"); + + b.Navigation("Dutys"); + + b.Navigation("Educations"); + + b.Navigation("Employments"); + + b.Navigation("FamilyHistory"); + + b.Navigation("FatherHistory"); + + b.Navigation("GovernmentHistory"); + + b.Navigation("Honors"); + + b.Navigation("Insignias"); + + b.Navigation("Leaves"); + + b.Navigation("MotherHistory"); + + b.Navigation("Nopaids"); + + b.Navigation("Others"); + + b.Navigation("Papers"); + + b.Navigation("ProfileHistory"); + + b.Navigation("RegistrationAddressHistory"); + + b.Navigation("Salaries"); + + b.Navigation("Trainings"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAbility", b => + { + b.Navigation("ProfileAbilityHistorys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAssessment", b => + { + b.Navigation("ProfileAssessmentHistorys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileCertificate", b => + { + b.Navigation("ProfileCertificateHistorys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileChangeName", b => + { + b.Navigation("ProfileChangeNameHistorys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileChildren", b => + { + b.Navigation("ProfileChildrenHistorys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileDiscipline", b => + { + b.Navigation("ProfileDisciplineHistorys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileDuty", b => + { + b.Navigation("ProfileDutyHistorys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileEducation", b => + { + b.Navigation("ProfileEducationHistorys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileFamilyHistory", b => + { + b.Navigation("Childrens"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileHonor", b => + { + b.Navigation("ProfileHonorHistorys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileInsignia", b => + { + b.Navigation("ProfileInsigniaHistorys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileLeave", b => + { + b.Navigation("ProfileLeaveHistorys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileNopaid", b => + { + b.Navigation("ProfileNopaidHistorys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileOther", b => + { + b.Navigation("ProfileOtherHistorys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileSalary", b => + { + b.Navigation("ProfileSalaryHistorys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileTraining", b => + { + b.Navigation("ProfileTrainingHistorys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.TypeLeave", b => + { + b.Navigation("LimitTypeLeaves"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.District", b => + { + b.Navigation("SubDistricts"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.Province", b => + { + b.Navigation("Districts"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.OrganizationEntity", b => + { + b.Navigation("Organizations"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.PositionMasterEntity", b => + { + b.Navigation("PositionMasterHistorys"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/BMA.EHR.Infrastructure/Migrations/DisciplineDb/20231123133022_add table DisciplineDisciplinary.cs b/BMA.EHR.Infrastructure/Migrations/DisciplineDb/20231123133022_add table DisciplineDisciplinary.cs new file mode 100644 index 00000000..832e1fea --- /dev/null +++ b/BMA.EHR.Infrastructure/Migrations/DisciplineDb/20231123133022_add table DisciplineDisciplinary.cs @@ -0,0 +1,589 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb +{ + /// + public partial class addtableDisciplineDisciplinary : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "DisciplineInvestigate_Profiles"); + + migrationBuilder.AddColumn( + name: "DisciplineDisciplinaryId", + table: "DisciplineInvestigateRelevant_Docs", + type: "char(36)", + nullable: true, + collation: "ascii_general_ci"); + + migrationBuilder.AddColumn( + name: "DisciplineDisciplinaryId", + table: "DisciplineInvestigate_Docs", + type: "char(36)", + nullable: true, + collation: "ascii_general_ci"); + + migrationBuilder.AddColumn( + name: "DisciplineDisciplinaryId", + table: "DisciplineInvestigate_DocComplaints", + type: "char(36)", + nullable: true, + collation: "ascii_general_ci"); + + migrationBuilder.AddColumn( + name: "DisciplineDisciplinaryId", + table: "DisciplineInvestigate_Directors", + type: "char(36)", + nullable: true, + collation: "ascii_general_ci"); + + migrationBuilder.CreateTable( + name: "DisciplineDisciplinary_DirectorInvestigates", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + CreatedAt = table.Column(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), + CreatedUserId = table.Column(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล") + .Annotation("MySql:CharSet", "utf8mb4"), + LastUpdatedAt = table.Column(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"), + LastUpdateUserId = table.Column(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด") + .Annotation("MySql:CharSet", "utf8mb4"), + CreatedFullName = table.Column(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล") + .Annotation("MySql:CharSet", "utf8mb4"), + LastUpdateFullName = table.Column(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด") + .Annotation("MySql:CharSet", "utf8mb4"), + DisciplineDirectorId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + DisciplineInvestigateId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") + }, + constraints: table => + { + table.PrimaryKey("PK_DisciplineDisciplinary_DirectorInvestigates", x => x.Id); + table.ForeignKey( + name: "FK_DisciplineDisciplinary_DirectorInvestigates_DisciplineDirect~", + column: x => x.DisciplineDirectorId, + principalTable: "DisciplineDirectors", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_DisciplineDisciplinary_DirectorInvestigates_DisciplineInvest~", + column: x => x.DisciplineInvestigateId, + principalTable: "DisciplineInvestigates", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "DisciplineDisciplinary_DocComplaintInvestigates", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + CreatedAt = table.Column(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), + CreatedUserId = table.Column(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล") + .Annotation("MySql:CharSet", "utf8mb4"), + LastUpdatedAt = table.Column(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"), + LastUpdateUserId = table.Column(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด") + .Annotation("MySql:CharSet", "utf8mb4"), + CreatedFullName = table.Column(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล") + .Annotation("MySql:CharSet", "utf8mb4"), + LastUpdateFullName = table.Column(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด") + .Annotation("MySql:CharSet", "utf8mb4"), + DocumentId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + DisciplineInvestigateId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") + }, + constraints: table => + { + table.PrimaryKey("PK_DisciplineDisciplinary_DocComplaintInvestigates", x => x.Id); + table.ForeignKey( + name: "FK_DisciplineDisciplinary_DocComplaintInvestigates_DisciplineIn~", + column: x => x.DisciplineInvestigateId, + principalTable: "DisciplineInvestigates", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_DisciplineDisciplinary_DocComplaintInvestigates_Documents_Do~", + column: x => x.DocumentId, + principalTable: "Documents", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "DisciplineDisciplinary_DocInvestigateRelevants", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + CreatedAt = table.Column(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), + CreatedUserId = table.Column(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล") + .Annotation("MySql:CharSet", "utf8mb4"), + LastUpdatedAt = table.Column(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"), + LastUpdateUserId = table.Column(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด") + .Annotation("MySql:CharSet", "utf8mb4"), + CreatedFullName = table.Column(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล") + .Annotation("MySql:CharSet", "utf8mb4"), + LastUpdateFullName = table.Column(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด") + .Annotation("MySql:CharSet", "utf8mb4"), + DocumentId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + DisciplineInvestigateId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") + }, + constraints: table => + { + table.PrimaryKey("PK_DisciplineDisciplinary_DocInvestigateRelevants", x => x.Id); + table.ForeignKey( + name: "FK_DisciplineDisciplinary_DocInvestigateRelevants_DisciplineInv~", + column: x => x.DisciplineInvestigateId, + principalTable: "DisciplineInvestigates", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_DisciplineDisciplinary_DocInvestigateRelevants_Documents_Doc~", + column: x => x.DocumentId, + principalTable: "Documents", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "DisciplineDisciplinary_DocInvestigates", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + CreatedAt = table.Column(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), + CreatedUserId = table.Column(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล") + .Annotation("MySql:CharSet", "utf8mb4"), + LastUpdatedAt = table.Column(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"), + LastUpdateUserId = table.Column(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด") + .Annotation("MySql:CharSet", "utf8mb4"), + CreatedFullName = table.Column(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล") + .Annotation("MySql:CharSet", "utf8mb4"), + LastUpdateFullName = table.Column(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด") + .Annotation("MySql:CharSet", "utf8mb4"), + DocumentId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + DisciplineInvestigateId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") + }, + constraints: table => + { + table.PrimaryKey("PK_DisciplineDisciplinary_DocInvestigates", x => x.Id); + table.ForeignKey( + name: "FK_DisciplineDisciplinary_DocInvestigates_DisciplineInvestigate~", + column: x => x.DisciplineInvestigateId, + principalTable: "DisciplineInvestigates", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_DisciplineDisciplinary_DocInvestigates_Documents_DocumentId", + column: x => x.DocumentId, + principalTable: "Documents", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "DisciplineDisciplinary_ProfileComplaintInvestigates", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + CreatedAt = table.Column(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), + CreatedUserId = table.Column(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล") + .Annotation("MySql:CharSet", "utf8mb4"), + LastUpdatedAt = table.Column(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"), + LastUpdateUserId = table.Column(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด") + .Annotation("MySql:CharSet", "utf8mb4"), + CreatedFullName = table.Column(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล") + .Annotation("MySql:CharSet", "utf8mb4"), + LastUpdateFullName = table.Column(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด") + .Annotation("MySql:CharSet", "utf8mb4"), + PersonId = table.Column(type: "char(36)", nullable: true, comment: "id อ้างอิง profile", collation: "ascii_general_ci"), + CitizenId = table.Column(type: "varchar(13)", maxLength: 13, nullable: true, comment: "รหัสบัตรประชาชน") + .Annotation("MySql:CharSet", "utf8mb4"), + Prefix = table.Column(type: "longtext", nullable: true, comment: "คำนำหน้า") + .Annotation("MySql:CharSet", "utf8mb4"), + FirstName = table.Column(type: "varchar(100)", maxLength: 100, nullable: false, comment: "ชื่อ") + .Annotation("MySql:CharSet", "utf8mb4"), + LastName = table.Column(type: "varchar(100)", maxLength: 100, nullable: false, comment: "นามสกุล") + .Annotation("MySql:CharSet", "utf8mb4"), + Organization = table.Column(type: "longtext", nullable: true, comment: "สังกัด") + .Annotation("MySql:CharSet", "utf8mb4"), + Position = table.Column(type: "longtext", nullable: true, comment: "ตำแหน่ง") + .Annotation("MySql:CharSet", "utf8mb4"), + PosNo = table.Column(type: "longtext", nullable: true, comment: "เลขที่ตำแหน่ง") + .Annotation("MySql:CharSet", "utf8mb4"), + PositionLevel = table.Column(type: "longtext", nullable: true, comment: "ระดับ") + .Annotation("MySql:CharSet", "utf8mb4"), + Salary = table.Column(type: "double", nullable: true, comment: "เงินเดือน"), + DisciplineInvestigateId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") + }, + constraints: table => + { + table.PrimaryKey("PK_DisciplineDisciplinary_ProfileComplaintInvestigates", x => x.Id); + table.ForeignKey( + name: "FK_DisciplineDisciplinary_ProfileComplaintInvestigates_Discipli~", + column: x => x.DisciplineInvestigateId, + principalTable: "DisciplineInvestigates", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "DisciplineDisciplinarys", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + CreatedAt = table.Column(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), + CreatedUserId = table.Column(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล") + .Annotation("MySql:CharSet", "utf8mb4"), + LastUpdatedAt = table.Column(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"), + LastUpdateUserId = table.Column(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด") + .Annotation("MySql:CharSet", "utf8mb4"), + CreatedFullName = table.Column(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล") + .Annotation("MySql:CharSet", "utf8mb4"), + LastUpdateFullName = table.Column(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด") + .Annotation("MySql:CharSet", "utf8mb4"), + Status = table.Column(type: "longtext", nullable: false, comment: "สถานะเรื่องร้องเรียน มีดังนี้ ใหม่ (NEW), ยุติเรื่อง (STOP), มีมูลส่งไปสืบสวนแล้ว (SEND_INVESTIGATE)") + .Annotation("MySql:CharSet", "utf8mb4"), + RespondentType = table.Column(type: "longtext", nullable: false, comment: "ผู้ถูกร้องเรียน (PERSON คือ บุคคล, ORGANIZATION คือ หน่วยงาน, BANGKOK คือ กรุงเทพมหานคร)") + .Annotation("MySql:CharSet", "utf8mb4"), + Title = table.Column(type: "text", nullable: false, comment: "เรื่องที่ร้องเรียน") + .Annotation("MySql:CharSet", "utf8mb4"), + Description = table.Column(type: "text", nullable: false, comment: "รายละเอียดของเรื่องร้องเรียน") + .Annotation("MySql:CharSet", "utf8mb4"), + DateReceived = table.Column(type: "datetime(6)", nullable: false, comment: "วันที่รับเรื่อง เป็นวันที่ถือเป็นจุดเริ่มต้นของวินัยนั้น ๆ"), + LevelConsideration = table.Column(type: "longtext", nullable: false, comment: "ระดับการพิจารณา 'ยังไม่ระบุ' (NORMAL คือ ปกติ, URGENT คือ ด่วน, VERY_URGENT คือ ด่วนมาก)") + .Annotation("MySql:CharSet", "utf8mb4"), + DateConsideration = table.Column(type: "datetime(6)", nullable: true, comment: "วันที่กำหนดพิจารณา"), + OffenseDetails = table.Column(type: "longtext", nullable: false, comment: "ลักษณะความผิดครั้งแรกจะเป็น 'ยังไม่ระบุ' (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง)") + .Annotation("MySql:CharSet", "utf8mb4"), + DateNotification = table.Column(type: "datetime(6)", nullable: false, comment: "วันแจ้งเตือนล่วงหน้า"), + ComplaintFrom = table.Column(type: "longtext", nullable: false, comment: "รับเรื่องร้องเรียนจาก ระบุว่ารับเรื่องมาจากใคร/หน่วยงานไหน (สตง., ปปช., ปปท., จดหมาย, อีเมล, โทรศัพท์, บอกกล่าว)") + .Annotation("MySql:CharSet", "utf8mb4"), + Appellant = table.Column(type: "longtext", nullable: false, comment: "ผู้ร้องเรียน") + .Annotation("MySql:CharSet", "utf8mb4"), + ResultComplaint = table.Column(type: "longtext", nullable: true, comment: "ผลการตรวจสอบเรื่องร้องเรียน") + .Annotation("MySql:CharSet", "utf8mb4"), + Result = table.Column(type: "longtext", nullable: true, comment: "ผลการตรวจสอบ") + .Annotation("MySql:CharSet", "utf8mb4"), + Organization = table.Column(type: "char(36)", nullable: true, comment: "กรณีหน่วยงานใส่ id ของหน่วยงาน", collation: "ascii_general_ci"), + ConsideredAgency = table.Column(type: "char(36)", nullable: false, comment: "หน่วยงานที่พิจารณา จะเปลี่ยนไปตามผู้ถูกร้องดูรายละเอียดด้านล่าง", collation: "ascii_general_ci"), + InvestigationDetail = table.Column(type: "longtext", nullable: true, comment: "ลักษณะการสืบสวน (appoint_directors คือ แต่งตั้งกรรมการสืบสวน, secret_investigation คือ สืบสวนทางลับ, other คือ อื่น ๆ)") + .Annotation("MySql:CharSet", "utf8mb4"), + InvestigationDetailOther = table.Column(type: "longtext", nullable: true, comment: "ลักษณะการสืบสวนกรณีเลือกอื่นๆ") + .Annotation("MySql:CharSet", "utf8mb4"), + InvestigationDateStart = table.Column(type: "datetime(6)", nullable: true, comment: "วันที่เริ่มการสอบสวน"), + InvestigationDateEnd = table.Column(type: "datetime(6)", nullable: true, comment: "วันที่สิ้นสุดการสอบสวน"), + InvestigationDescription = table.Column(type: "longtext", nullable: true, comment: "รายละเอียดเกี่ยวกับการสืบสวน") + .Annotation("MySql:CharSet", "utf8mb4"), + InvestigationStatusResult = table.Column(type: "longtext", nullable: true, comment: "สถานะหรือผลการสืบสวน (not_specified คือ ยังไม่ระบุ, have_cause คือ มีมูล, no_cause คือ ไม่มีมูล") + .Annotation("MySql:CharSet", "utf8mb4"), + InvestigationCauseText = table.Column(type: "longtext", nullable: true, comment: "กรณีมีมูลต้องเลือกว่า 'ร้ายแรง' หรือ 'ไม่ร้ายแรง'") + .Annotation("MySql:CharSet", "utf8mb4"), + DisciplineComplaintId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") + }, + constraints: table => + { + table.PrimaryKey("PK_DisciplineDisciplinarys", x => x.Id); + table.ForeignKey( + name: "FK_DisciplineDisciplinarys_DisciplineComplaints_DisciplineCompl~", + column: x => x.DisciplineComplaintId, + principalTable: "DisciplineComplaints", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "DisciplineInvestigate_ProfileComplaints", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + CreatedAt = table.Column(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), + CreatedUserId = table.Column(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล") + .Annotation("MySql:CharSet", "utf8mb4"), + LastUpdatedAt = table.Column(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"), + LastUpdateUserId = table.Column(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด") + .Annotation("MySql:CharSet", "utf8mb4"), + CreatedFullName = table.Column(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล") + .Annotation("MySql:CharSet", "utf8mb4"), + LastUpdateFullName = table.Column(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด") + .Annotation("MySql:CharSet", "utf8mb4"), + PersonId = table.Column(type: "char(36)", nullable: true, comment: "id อ้างอิง profile", collation: "ascii_general_ci"), + CitizenId = table.Column(type: "varchar(13)", maxLength: 13, nullable: true, comment: "รหัสบัตรประชาชน") + .Annotation("MySql:CharSet", "utf8mb4"), + Prefix = table.Column(type: "longtext", nullable: true, comment: "คำนำหน้า") + .Annotation("MySql:CharSet", "utf8mb4"), + FirstName = table.Column(type: "varchar(100)", maxLength: 100, nullable: false, comment: "ชื่อ") + .Annotation("MySql:CharSet", "utf8mb4"), + LastName = table.Column(type: "varchar(100)", maxLength: 100, nullable: false, comment: "นามสกุล") + .Annotation("MySql:CharSet", "utf8mb4"), + Organization = table.Column(type: "longtext", nullable: true, comment: "สังกัด") + .Annotation("MySql:CharSet", "utf8mb4"), + Position = table.Column(type: "longtext", nullable: true, comment: "ตำแหน่ง") + .Annotation("MySql:CharSet", "utf8mb4"), + PosNo = table.Column(type: "longtext", nullable: true, comment: "เลขที่ตำแหน่ง") + .Annotation("MySql:CharSet", "utf8mb4"), + PositionLevel = table.Column(type: "longtext", nullable: true, comment: "ระดับ") + .Annotation("MySql:CharSet", "utf8mb4"), + Salary = table.Column(type: "double", nullable: true, comment: "เงินเดือน"), + DisciplineInvestigateId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + DisciplineDisciplinaryId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") + }, + constraints: table => + { + table.PrimaryKey("PK_DisciplineInvestigate_ProfileComplaints", x => x.Id); + table.ForeignKey( + name: "FK_DisciplineInvestigate_ProfileComplaints_DisciplineDisciplina~", + column: x => x.DisciplineDisciplinaryId, + principalTable: "DisciplineDisciplinarys", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_DisciplineInvestigate_ProfileComplaints_DisciplineInvestigat~", + column: x => x.DisciplineInvestigateId, + principalTable: "DisciplineInvestigates", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineInvestigateRelevant_Docs_DisciplineDisciplinaryId", + table: "DisciplineInvestigateRelevant_Docs", + column: "DisciplineDisciplinaryId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineInvestigate_Docs_DisciplineDisciplinaryId", + table: "DisciplineInvestigate_Docs", + column: "DisciplineDisciplinaryId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineInvestigate_DocComplaints_DisciplineDisciplinaryId", + table: "DisciplineInvestigate_DocComplaints", + column: "DisciplineDisciplinaryId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineInvestigate_Directors_DisciplineDisciplinaryId", + table: "DisciplineInvestigate_Directors", + column: "DisciplineDisciplinaryId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineDisciplinary_DirectorInvestigates_DisciplineDirect~", + table: "DisciplineDisciplinary_DirectorInvestigates", + column: "DisciplineDirectorId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineDisciplinary_DirectorInvestigates_DisciplineInvest~", + table: "DisciplineDisciplinary_DirectorInvestigates", + column: "DisciplineInvestigateId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineDisciplinary_DocComplaintInvestigates_DisciplineIn~", + table: "DisciplineDisciplinary_DocComplaintInvestigates", + column: "DisciplineInvestigateId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineDisciplinary_DocComplaintInvestigates_DocumentId", + table: "DisciplineDisciplinary_DocComplaintInvestigates", + column: "DocumentId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineDisciplinary_DocInvestigateRelevants_DisciplineInv~", + table: "DisciplineDisciplinary_DocInvestigateRelevants", + column: "DisciplineInvestigateId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineDisciplinary_DocInvestigateRelevants_DocumentId", + table: "DisciplineDisciplinary_DocInvestigateRelevants", + column: "DocumentId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineDisciplinary_DocInvestigates_DisciplineInvestigate~", + table: "DisciplineDisciplinary_DocInvestigates", + column: "DisciplineInvestigateId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineDisciplinary_DocInvestigates_DocumentId", + table: "DisciplineDisciplinary_DocInvestigates", + column: "DocumentId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineDisciplinary_ProfileComplaintInvestigates_Discipli~", + table: "DisciplineDisciplinary_ProfileComplaintInvestigates", + column: "DisciplineInvestigateId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineDisciplinarys_DisciplineComplaintId", + table: "DisciplineDisciplinarys", + column: "DisciplineComplaintId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineInvestigate_ProfileComplaints_DisciplineDisciplina~", + table: "DisciplineInvestigate_ProfileComplaints", + column: "DisciplineDisciplinaryId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineInvestigate_ProfileComplaints_DisciplineInvestigat~", + table: "DisciplineInvestigate_ProfileComplaints", + column: "DisciplineInvestigateId"); + + migrationBuilder.AddForeignKey( + name: "FK_DisciplineInvestigate_Directors_DisciplineDisciplinarys_Disc~", + table: "DisciplineInvestigate_Directors", + column: "DisciplineDisciplinaryId", + principalTable: "DisciplineDisciplinarys", + principalColumn: "Id"); + + migrationBuilder.AddForeignKey( + name: "FK_DisciplineInvestigate_DocComplaints_DisciplineDisciplinarys_~", + table: "DisciplineInvestigate_DocComplaints", + column: "DisciplineDisciplinaryId", + principalTable: "DisciplineDisciplinarys", + principalColumn: "Id"); + + migrationBuilder.AddForeignKey( + name: "FK_DisciplineInvestigate_Docs_DisciplineDisciplinarys_Disciplin~", + table: "DisciplineInvestigate_Docs", + column: "DisciplineDisciplinaryId", + principalTable: "DisciplineDisciplinarys", + principalColumn: "Id"); + + migrationBuilder.AddForeignKey( + name: "FK_DisciplineInvestigateRelevant_Docs_DisciplineDisciplinarys_D~", + table: "DisciplineInvestigateRelevant_Docs", + column: "DisciplineDisciplinaryId", + principalTable: "DisciplineDisciplinarys", + principalColumn: "Id"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_DisciplineInvestigate_Directors_DisciplineDisciplinarys_Disc~", + table: "DisciplineInvestigate_Directors"); + + migrationBuilder.DropForeignKey( + name: "FK_DisciplineInvestigate_DocComplaints_DisciplineDisciplinarys_~", + table: "DisciplineInvestigate_DocComplaints"); + + migrationBuilder.DropForeignKey( + name: "FK_DisciplineInvestigate_Docs_DisciplineDisciplinarys_Disciplin~", + table: "DisciplineInvestigate_Docs"); + + migrationBuilder.DropForeignKey( + name: "FK_DisciplineInvestigateRelevant_Docs_DisciplineDisciplinarys_D~", + table: "DisciplineInvestigateRelevant_Docs"); + + migrationBuilder.DropTable( + name: "DisciplineDisciplinary_DirectorInvestigates"); + + migrationBuilder.DropTable( + name: "DisciplineDisciplinary_DocComplaintInvestigates"); + + migrationBuilder.DropTable( + name: "DisciplineDisciplinary_DocInvestigateRelevants"); + + migrationBuilder.DropTable( + name: "DisciplineDisciplinary_DocInvestigates"); + + migrationBuilder.DropTable( + name: "DisciplineDisciplinary_ProfileComplaintInvestigates"); + + migrationBuilder.DropTable( + name: "DisciplineInvestigate_ProfileComplaints"); + + migrationBuilder.DropTable( + name: "DisciplineDisciplinarys"); + + migrationBuilder.DropIndex( + name: "IX_DisciplineInvestigateRelevant_Docs_DisciplineDisciplinaryId", + table: "DisciplineInvestigateRelevant_Docs"); + + migrationBuilder.DropIndex( + name: "IX_DisciplineInvestigate_Docs_DisciplineDisciplinaryId", + table: "DisciplineInvestigate_Docs"); + + migrationBuilder.DropIndex( + name: "IX_DisciplineInvestigate_DocComplaints_DisciplineDisciplinaryId", + table: "DisciplineInvestigate_DocComplaints"); + + migrationBuilder.DropIndex( + name: "IX_DisciplineInvestigate_Directors_DisciplineDisciplinaryId", + table: "DisciplineInvestigate_Directors"); + + migrationBuilder.DropColumn( + name: "DisciplineDisciplinaryId", + table: "DisciplineInvestigateRelevant_Docs"); + + migrationBuilder.DropColumn( + name: "DisciplineDisciplinaryId", + table: "DisciplineInvestigate_Docs"); + + migrationBuilder.DropColumn( + name: "DisciplineDisciplinaryId", + table: "DisciplineInvestigate_DocComplaints"); + + migrationBuilder.DropColumn( + name: "DisciplineDisciplinaryId", + table: "DisciplineInvestigate_Directors"); + + migrationBuilder.CreateTable( + name: "DisciplineInvestigate_Profiles", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + CreatedAt = table.Column(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), + CreatedUserId = table.Column(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล") + .Annotation("MySql:CharSet", "utf8mb4"), + LastUpdatedAt = table.Column(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"), + LastUpdateUserId = table.Column(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด") + .Annotation("MySql:CharSet", "utf8mb4"), + CreatedFullName = table.Column(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล") + .Annotation("MySql:CharSet", "utf8mb4"), + LastUpdateFullName = table.Column(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด") + .Annotation("MySql:CharSet", "utf8mb4"), + DisciplineInvestigateId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + CitizenId = table.Column(type: "varchar(13)", maxLength: 13, nullable: true, comment: "รหัสบัตรประชาชน") + .Annotation("MySql:CharSet", "utf8mb4"), + FirstName = table.Column(type: "varchar(100)", maxLength: 100, nullable: false, comment: "ชื่อ") + .Annotation("MySql:CharSet", "utf8mb4"), + LastName = table.Column(type: "varchar(100)", maxLength: 100, nullable: false, comment: "นามสกุล") + .Annotation("MySql:CharSet", "utf8mb4"), + Organization = table.Column(type: "longtext", nullable: true, comment: "สังกัด") + .Annotation("MySql:CharSet", "utf8mb4"), + PersonId = table.Column(type: "char(36)", nullable: true, comment: "id อ้างอิง profile", collation: "ascii_general_ci"), + PosNo = table.Column(type: "longtext", nullable: true, comment: "เลขที่ตำแหน่ง") + .Annotation("MySql:CharSet", "utf8mb4"), + Position = table.Column(type: "longtext", nullable: true, comment: "ตำแหน่ง") + .Annotation("MySql:CharSet", "utf8mb4"), + PositionLevel = table.Column(type: "longtext", nullable: true, comment: "ระดับ") + .Annotation("MySql:CharSet", "utf8mb4"), + Prefix = table.Column(type: "longtext", nullable: true, comment: "คำนำหน้า") + .Annotation("MySql:CharSet", "utf8mb4"), + Salary = table.Column(type: "double", nullable: true, comment: "เงินเดือน") + }, + constraints: table => + { + table.PrimaryKey("PK_DisciplineInvestigate_Profiles", x => x.Id); + table.ForeignKey( + name: "FK_DisciplineInvestigate_Profiles_DisciplineInvestigates_Discip~", + column: x => x.DisciplineInvestigateId, + principalTable: "DisciplineInvestigates", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineInvestigate_Profiles_DisciplineInvestigateId", + table: "DisciplineInvestigate_Profiles", + column: "DisciplineInvestigateId"); + } + } +} diff --git a/BMA.EHR.Infrastructure/Migrations/DisciplineDb/20231124030032_add table DisciplineDisciplinary_DocOthers.Designer.cs b/BMA.EHR.Infrastructure/Migrations/DisciplineDb/20231124030032_add table DisciplineDisciplinary_DocOthers.Designer.cs new file mode 100644 index 00000000..b2a87f20 --- /dev/null +++ b/BMA.EHR.Infrastructure/Migrations/DisciplineDb/20231124030032_add table DisciplineDisciplinary_DocOthers.Designer.cs @@ -0,0 +1,10985 @@ +// +using System; +using BMA.EHR.Infrastructure.Persistence; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb +{ + [DbContext(typeof(DisciplineDbContext))] + [Migration("20231124030032_add table DisciplineDisciplinary_DocOthers")] + partial class addtableDisciplineDisciplinary_DocOthers + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "7.0.9") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("Appellant") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ผู้ร้องเรียน"); + + b.Property("ComplaintFrom") + .IsRequired() + .HasColumnType("longtext") + .HasComment("รับเรื่องร้องเรียนจาก ระบุว่ารับเรื่องมาจากใคร/หน่วยงานไหน (สตง., ปปช., ปปท., จดหมาย, อีเมล, โทรศัพท์, บอกกล่าว)"); + + b.Property("ConsideredAgency") + .HasColumnType("char(36)") + .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("DateConsideration") + .HasColumnType("datetime(6)") + .HasComment("วันที่กำหนดพิจารณา"); + + b.Property("DateNotification") + .HasColumnType("datetime(6)") + .HasComment("วันแจ้งเตือนล่วงหน้า"); + + b.Property("DateReceived") + .HasColumnType("datetime(6)") + .HasComment("วันที่รับเรื่อง เป็นวันที่ถือเป็นจุดเริ่มต้นของวินัยนั้น ๆ"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text") + .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("LevelConsideration") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ระดับการพิจารณา 'ยังไม่ระบุ' (NORMAL คือ ปกติ, URGENT คือ ด่วน, VERY_URGENT คือ ด่วนมาก)"); + + b.Property("OffenseDetails") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ลักษณะความผิดครั้งแรกจะเป็น 'ยังไม่ระบุ' (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง)"); + + b.Property("Organization") + .HasColumnType("char(36)") + .HasComment("กรณีหน่วยงานใส่ id ของหน่วยงาน"); + + b.Property("RespondentType") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ผู้ถูกร้องเรียน (PERSON คือ บุคคล, ORGANIZATION คือ หน่วยงาน, BANGKOK คือ กรุงเทพมหานคร)"); + + b.Property("Result") + .HasColumnType("longtext") + .HasComment("ผลการตรวจสอบ"); + + b.Property("Status") + .IsRequired() + .HasColumnType("longtext") + .HasComment("สถานะเรื่องร้องเรียน มีดังนี้ ใหม่ (NEW), ยุติเรื่อง (STOP), มีมูลส่งไปสืบสวนแล้ว (SEND_INVESTIGATE)"); + + b.Property("Title") + .IsRequired() + .HasColumnType("text") + .HasComment("เรื่องที่ร้องเรียน"); + + b.HasKey("Id"); + + b.ToTable("DisciplineComplaints"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Channel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Name") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ชื่อประเภทการร้องเรียน"); + + b.HasKey("Id"); + + b.ToTable("DisciplineComplaint_Channels"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Doc", 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("DisciplineComplaintId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineComplaintId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineComplaint_Docs"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Profile", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CitizenId") + .HasMaxLength(13) + .HasColumnType("varchar(13)") + .HasComment("รหัสบัตรประชาชน"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineComplaintId") + .HasColumnType("char(36)"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("ชื่อ"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .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("Organization") + .HasColumnType("longtext") + .HasComment("สังกัด"); + + b.Property("PersonId") + .HasColumnType("char(36)") + .HasComment("id อ้างอิง profile"); + + b.Property("PosNo") + .HasColumnType("longtext") + .HasComment("เลขที่ตำแหน่ง"); + + b.Property("Position") + .HasColumnType("longtext") + .HasComment("ตำแหน่ง"); + + b.Property("PositionLevel") + .HasColumnType("longtext") + .HasComment("ระดับ"); + + b.Property("Prefix") + .HasColumnType("longtext") + .HasComment("คำนำหน้า"); + + b.Property("Salary") + .HasColumnType("double") + .HasComment("เงินเดือน"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineComplaintId"); + + b.ToTable("DisciplineComplaint_Profiles"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDirector", 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("Email") + .IsRequired() + .HasColumnType("longtext") + .HasComment("อีเมล"); + + b.Property("FirstName") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ชื่อ"); + + b.Property("LastName") + .IsRequired() + .HasColumnType("longtext") + .HasComment("นามสกุล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Phone") + .IsRequired() + .HasColumnType("longtext") + .HasComment("เบอร์โทรศัพท์"); + + b.Property("Position") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ตำแหน่ง"); + + b.Property("Prefix") + .IsRequired() + .HasColumnType("longtext") + .HasComment("คำนำหน้าชื่อ"); + + b.HasKey("Id"); + + b.ToTable("DisciplineDirectors"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("Appellant") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ผู้ร้องเรียน"); + + b.Property("ComplaintFrom") + .IsRequired() + .HasColumnType("longtext") + .HasComment("รับเรื่องร้องเรียนจาก ระบุว่ารับเรื่องมาจากใคร/หน่วยงานไหน (สตง., ปปช., ปปท., จดหมาย, อีเมล, โทรศัพท์, บอกกล่าว)"); + + b.Property("ConsideredAgency") + .HasColumnType("char(36)") + .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("DateConsideration") + .HasColumnType("datetime(6)") + .HasComment("วันที่กำหนดพิจารณา"); + + b.Property("DateNotification") + .HasColumnType("datetime(6)") + .HasComment("วันแจ้งเตือนล่วงหน้า"); + + b.Property("DateReceived") + .HasColumnType("datetime(6)") + .HasComment("วันที่รับเรื่อง เป็นวันที่ถือเป็นจุดเริ่มต้นของวินัยนั้น ๆ"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text") + .HasComment("รายละเอียดของเรื่องร้องเรียน"); + + b.Property("DisciplinaryCaseFault") + .HasColumnType("longtext") + .HasComment("กรณีความผิด"); + + b.Property("DisciplinaryDateAllegation") + .HasColumnType("datetime(6)") + .HasComment("วันที่รับทราบข้อกล่าวหา"); + + b.Property("DisciplinaryDateEvident") + .HasColumnType("datetime(6)") + .HasComment("วันที่สรุปพยานหลักฐาน"); + + b.Property("DisciplinaryFaultLevel") + .HasColumnType("longtext") + .HasComment("ระดับโทษความผิด กรณีไม่ร้ายแรง: ภาคทัณฑ์, ตัดเงินเดือน, ลดขั้นเงินเดือน | กรณีร้ายแรง: ปลดออก, ไล่ออก"); + + b.Property("DisciplinaryInvestigateAt") + .HasColumnType("longtext") + .HasComment("สอบสวนที่"); + + b.Property("DisciplinaryRecordAccuser") + .HasColumnType("longtext") + .HasComment("บันทึกถ้อยคำของผู้กล่าวหา"); + + b.Property("DisciplinaryRefLaw") + .HasColumnType("longtext") + .HasComment("อ้างอิงมาตราตามกฎหมาย"); + + b.Property("DisciplinarySummaryEvidence") + .HasColumnType("longtext") + .HasComment("สรุปพยานหลักฐานสนับสนุนข้อกล่าวหา"); + + b.Property("DisciplinaryWitnesses") + .HasColumnType("longtext") + .HasComment("พยานและบันทึกถ้อยคำพยาน"); + + b.Property("DisciplineInvestigateId") + .HasColumnType("char(36)"); + + b.Property("InvestigationCauseText") + .HasColumnType("longtext") + .HasComment("กรณีมีมูลต้องเลือกว่า 'ร้ายแรง' หรือ 'ไม่ร้ายแรง'"); + + b.Property("InvestigationDateEnd") + .HasColumnType("datetime(6)") + .HasComment("วันที่สิ้นสุดการสอบสวน"); + + b.Property("InvestigationDateStart") + .HasColumnType("datetime(6)") + .HasComment("วันที่เริ่มการสอบสวน"); + + b.Property("InvestigationDescription") + .HasColumnType("longtext") + .HasComment("รายละเอียดเกี่ยวกับการสืบสวน"); + + b.Property("InvestigationDetail") + .HasColumnType("longtext") + .HasComment("ลักษณะการสืบสวน (APPOINT_DIRECTORS คือ แต่งตั้งกรรมการสืบสวน, SECRET_INVESTIGATION คือ สืบสวนทางลับ, OTHER คือ อื่น ๆ)"); + + b.Property("InvestigationDetailOther") + .HasColumnType("longtext") + .HasComment("ลักษณะการสืบสวนกรณีเลือกอื่นๆ"); + + b.Property("InvestigationStatusResult") + .HasColumnType("longtext") + .HasComment("สถานะหรือผลการสืบสวน (NOT_SPECIFIED คือ ยังไม่ระบุ, HAVE_CAUSE คือ มีมูล, NO_CAUSE คือ ไม่มีมูล"); + + 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("LevelConsideration") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ระดับการพิจารณา 'ยังไม่ระบุ' (NORMAL คือ ปกติ, URGENT คือ ด่วน, VERY_URGENT คือ ด่วนมาก)"); + + b.Property("OffenseDetails") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ลักษณะความผิดครั้งแรกจะเป็น 'ยังไม่ระบุ' (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง)"); + + b.Property("Organization") + .HasColumnType("char(36)") + .HasComment("กรณีหน่วยงานใส่ id ของหน่วยงาน"); + + b.Property("RespondentType") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ผู้ถูกร้องเรียน (PERSON คือ บุคคล, ORGANIZATION คือ หน่วยงาน, BANGKOK คือ กรุงเทพมหานคร)"); + + b.Property("Result") + .HasColumnType("longtext") + .HasComment("ผลการตรวจสอบ"); + + b.Property("ResultComplaint") + .HasColumnType("longtext") + .HasComment("ผลการตรวจสอบเรื่องร้องเรียน"); + + b.Property("ResultInvestigate") + .HasColumnType("longtext") + .HasComment("ผลการตรวจสอบเรื่องสืบสวน"); + + b.Property("Status") + .IsRequired() + .HasColumnType("longtext") + .HasComment("สถานะเรื่องร้องเรียน มีดังนี้ ใหม่ (NEW), ยุติเรื่อง (STOP), มีมูลส่งไปสืบสวนแล้ว (SEND_INVESTIGATE)"); + + b.Property("Title") + .IsRequired() + .HasColumnType("text") + .HasComment("เรื่องที่ร้องเรียน"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineInvestigateId"); + + b.ToTable("DisciplineDisciplinarys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DirectorInvestigate", 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("DisciplineDirectorId") + .HasColumnType("char(36)"); + + b.Property("DisciplineDisciplinaryId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDirectorId"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.ToTable("DisciplineDisciplinary_DirectorInvestigates"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocComplaintInvestigate", 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("DisciplineDisciplinaryId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineDisciplinary_DocComplaintInvestigates"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocInvestigate", 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("DisciplineDisciplinaryId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineDisciplinary_DocInvestigates"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocInvestigateRelevant", 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("DisciplineDisciplinaryId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineDisciplinary_DocInvestigateRelevants"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocOther", 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("DisciplineDisciplinaryId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineDisciplinary_DocOthers"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocRecordAccuser", 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("DisciplineDisciplinaryId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineDisciplinary_DocRecordAccusers"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocSummaryEvidence", 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("DisciplineDisciplinaryId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineDisciplinary_DocSummaryEvidences"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocWitnesses", 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("DisciplineDisciplinaryId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineDisciplinary_DocWitnessess"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_ProfileComplaintInvestigate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CitizenId") + .HasMaxLength(13) + .HasColumnType("varchar(13)") + .HasComment("รหัสบัตรประชาชน"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineDisciplinaryId") + .HasColumnType("char(36)"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("ชื่อ"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .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("Organization") + .HasColumnType("longtext") + .HasComment("สังกัด"); + + b.Property("PersonId") + .HasColumnType("char(36)") + .HasComment("id อ้างอิง profile"); + + b.Property("PosNo") + .HasColumnType("longtext") + .HasComment("เลขที่ตำแหน่ง"); + + b.Property("Position") + .HasColumnType("longtext") + .HasComment("ตำแหน่ง"); + + b.Property("PositionLevel") + .HasColumnType("longtext") + .HasComment("ระดับ"); + + b.Property("Prefix") + .HasColumnType("longtext") + .HasComment("คำนำหน้า"); + + b.Property("Salary") + .HasColumnType("double") + .HasComment("เงินเดือน"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.ToTable("DisciplineDisciplinary_ProfileComplaintInvestigates"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("Appellant") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ผู้ร้องเรียน"); + + b.Property("ComplaintFrom") + .IsRequired() + .HasColumnType("longtext") + .HasComment("รับเรื่องร้องเรียนจาก ระบุว่ารับเรื่องมาจากใคร/หน่วยงานไหน (สตง., ปปช., ปปท., จดหมาย, อีเมล, โทรศัพท์, บอกกล่าว)"); + + b.Property("ConsideredAgency") + .HasColumnType("char(36)") + .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("DateConsideration") + .HasColumnType("datetime(6)") + .HasComment("วันที่กำหนดพิจารณา"); + + b.Property("DateNotification") + .HasColumnType("datetime(6)") + .HasComment("วันแจ้งเตือนล่วงหน้า"); + + b.Property("DateReceived") + .HasColumnType("datetime(6)") + .HasComment("วันที่รับเรื่อง เป็นวันที่ถือเป็นจุดเริ่มต้นของวินัยนั้น ๆ"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text") + .HasComment("รายละเอียดของเรื่องร้องเรียน"); + + b.Property("DisciplineComplaintId") + .HasColumnType("char(36)"); + + b.Property("InvestigationCauseText") + .HasColumnType("longtext") + .HasComment("กรณีมีมูลต้องเลือกว่า 'ร้ายแรง' หรือ 'ไม่ร้ายแรง'"); + + b.Property("InvestigationDateEnd") + .HasColumnType("datetime(6)") + .HasComment("วันที่สิ้นสุดการสอบสวน"); + + b.Property("InvestigationDateStart") + .HasColumnType("datetime(6)") + .HasComment("วันที่เริ่มการสอบสวน"); + + b.Property("InvestigationDescription") + .HasColumnType("longtext") + .HasComment("รายละเอียดเกี่ยวกับการสืบสวน"); + + b.Property("InvestigationDetail") + .HasColumnType("longtext") + .HasComment("ลักษณะการสืบสวน (appoint_directors คือ แต่งตั้งกรรมการสืบสวน, secret_investigation คือ สืบสวนทางลับ, other คือ อื่น ๆ)"); + + b.Property("InvestigationDetailOther") + .HasColumnType("longtext") + .HasComment("ลักษณะการสืบสวนกรณีเลือกอื่นๆ"); + + b.Property("InvestigationStatusResult") + .HasColumnType("longtext") + .HasComment("สถานะหรือผลการสืบสวน (not_specified คือ ยังไม่ระบุ, have_cause คือ มีมูล, no_cause คือ ไม่มีมูล"); + + 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("LevelConsideration") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ระดับการพิจารณา 'ยังไม่ระบุ' (NORMAL คือ ปกติ, URGENT คือ ด่วน, VERY_URGENT คือ ด่วนมาก)"); + + b.Property("OffenseDetails") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ลักษณะความผิดครั้งแรกจะเป็น 'ยังไม่ระบุ' (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง)"); + + b.Property("Organization") + .HasColumnType("char(36)") + .HasComment("กรณีหน่วยงานใส่ id ของหน่วยงาน"); + + b.Property("RespondentType") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ผู้ถูกร้องเรียน (PERSON คือ บุคคล, ORGANIZATION คือ หน่วยงาน, BANGKOK คือ กรุงเทพมหานคร)"); + + b.Property("Result") + .HasColumnType("longtext") + .HasComment("ผลการตรวจสอบ"); + + b.Property("ResultComplaint") + .HasColumnType("longtext") + .HasComment("ผลการตรวจสอบเรื่องร้องเรียน"); + + b.Property("Status") + .IsRequired() + .HasColumnType("longtext") + .HasComment("สถานะเรื่องร้องเรียน มีดังนี้ ใหม่ (NEW), ยุติเรื่อง (STOP), มีมูลส่งไปสืบสวนแล้ว (SEND_INVESTIGATE)"); + + b.Property("Title") + .IsRequired() + .HasColumnType("text") + .HasComment("เรื่องที่ร้องเรียน"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineComplaintId"); + + b.ToTable("DisciplineInvestigates"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigateRelevant_Doc", 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("DisciplineInvestigateId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineInvestigateId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineInvestigateRelevant_Docs"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_Director", 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("DisciplineDirectorId") + .HasColumnType("char(36)"); + + b.Property("DisciplineInvestigateId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDirectorId"); + + b.HasIndex("DisciplineInvestigateId"); + + b.ToTable("DisciplineInvestigate_Directors"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_Doc", 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("DisciplineInvestigateId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineInvestigateId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineInvestigate_Docs"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_DocComplaint", 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("DisciplineInvestigateId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineInvestigateId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineInvestigate_DocComplaints"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_ProfileComplaint", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CitizenId") + .HasMaxLength(13) + .HasColumnType("varchar(13)") + .HasComment("รหัสบัตรประชาชน"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineInvestigateId") + .HasColumnType("char(36)"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("ชื่อ"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .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("Organization") + .HasColumnType("longtext") + .HasComment("สังกัด"); + + b.Property("PersonId") + .HasColumnType("char(36)") + .HasComment("id อ้างอิง profile"); + + b.Property("PosNo") + .HasColumnType("longtext") + .HasComment("เลขที่ตำแหน่ง"); + + b.Property("Position") + .HasColumnType("longtext") + .HasComment("ตำแหน่ง"); + + b.Property("PositionLevel") + .HasColumnType("longtext") + .HasComment("ระดับ"); + + b.Property("Prefix") + .HasColumnType("longtext") + .HasComment("คำนำหน้า"); + + b.Property("Salary") + .HasColumnType("double") + .HasComment("เงินเดือน"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineInvestigateId"); + + b.ToTable("DisciplineInvestigate_ProfileComplaints"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.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.Domain.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("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.LimitLeave", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Name") + .HasColumnType("longtext") + .HasComment("ยังไม่ชัวใช้อะไรเป็นkey"); + + b.HasKey("Id"); + + b.ToTable("LimitLeave"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.LimitTypeLeave", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("LimitLeaveId") + .HasColumnType("char(36)"); + + b.Property("NumLeave") + .HasColumnType("double") + .HasComment("จำนวนที่ลาได้"); + + b.Property("TypeLeaveId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("LimitLeaveId"); + + b.HasIndex("TypeLeaveId"); + + b.ToTable("LimitTypeLeave"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.Profile", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("Ability") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("AvatarId") + .HasColumnType("char(36)"); + + b.Property("AvatarRef") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("BirthDate") + .HasColumnType("datetime(6)") + .HasComment("วันเกิด"); + + b.Property("BloodGroupId") + .HasColumnType("char(36)") + .HasComment("Id กลุ่มเลือด"); + + b.Property("CitizenId") + .HasMaxLength(13) + .HasColumnType("varchar(13)") + .HasComment("รหัสบัตรประชาชน"); + + b.Property("Couple") + .HasColumnType("tinyint(1)") + .HasComment("คู่สมรส"); + + b.Property("CoupleCareer") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("อาชีพคู่สมรส"); + + b.Property("CoupleCitizenId") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("เลขที่บัตรประชาชนคู่สมรส"); + + b.Property("CoupleFirstName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("ชื่อคู่สมรส"); + + b.Property("CoupleLastName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("นามสกุลคู่สมรส"); + + b.Property("CoupleLastNameOld") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("นามสกุลคู่สมรส(เดิม)"); + + b.Property("CoupleLive") + .HasColumnType("tinyint(1)") + .HasComment("มีชีวิตคู่สมรส"); + + b.Property("CouplePrefixId") + .HasColumnType("char(36)") + .HasComment("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("CreatedUser") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("CurrentAddress") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("ที่อยู่ปัจจุบัน"); + + b.Property("CurrentDistrictId") + .HasColumnType("char(36)") + .HasComment("Id เขตปัจจุบัน"); + + b.Property("CurrentProvinceId") + .HasColumnType("char(36)") + .HasComment("Id จังหวัดปัจจุบัน"); + + b.Property("CurrentSubDistrictId") + .HasColumnType("char(36)") + .HasComment("Id แขวงปัจจุบัน"); + + b.Property("CurrentZipCode") + .HasMaxLength(5) + .HasColumnType("varchar(5)") + .HasComment("รหัสไปรษณีย์ปัจจุบัน"); + + b.Property("DateAppoint") + .HasColumnType("datetime(6)"); + + b.Property("DateRetire") + .HasColumnType("datetime(6)"); + + b.Property("DateStart") + .HasColumnType("datetime(6)"); + + b.Property("EmployeeClass") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("ประเภทลูกจ้าง"); + + b.Property("EmployeeMoneyAllowance") + .HasColumnType("double") + .HasComment("เงินช่วยเหลือค่าครองชีพชั่วคราว"); + + b.Property("EmployeeMoneyEmployee") + .HasColumnType("double") + .HasComment("เงินสมทบประกันสังคม(ลูกจ้าง)"); + + b.Property("EmployeeMoneyEmployer") + .HasColumnType("double") + .HasComment("เงินสมทบประกันสังคม(นายจ้าง)"); + + b.Property("EmployeeMoneyIncrease") + .HasColumnType("double") + .HasComment("เงินเพิ่มการครองชีพชั่วคราว"); + + b.Property("EmployeeOc") + .HasColumnType("longtext") + .HasComment("สังกัด"); + + b.Property("EmployeeType") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("ประเภทการจ้าง"); + + b.Property("EmployeeTypeIndividual") + .HasColumnType("longtext") + .HasComment("ประเภทบุคคล"); + + b.Property("EmployeeWage") + .HasColumnType("double") + .HasComment("ค่าจ้าง"); + + b.Property("EntryStatus") + .IsRequired() + .HasMaxLength(5) + .HasColumnType("varchar(5)"); + + b.Property("FatherCareer") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("อาชีพบิดา"); + + b.Property("FatherCitizenId") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("เลขที่บัตรประชาชนบิดา"); + + b.Property("FatherFirstName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("ชื่อบิดา"); + + b.Property("FatherLastName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("นามสกุลบิดา"); + + b.Property("FatherLive") + .HasColumnType("tinyint(1)") + .HasComment("มีชีวิตบิดา"); + + b.Property("FatherPrefixId") + .HasColumnType("char(36)") + .HasComment("Id คำนำหน้าบิดา"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("ชื่อ"); + + b.Property("FirstNameOld") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("ชื่อ(เดิม)"); + + b.Property("GenderId") + .HasColumnType("char(36)"); + + b.Property("GovAgeAbsent") + .HasColumnType("int"); + + b.Property("GovAgePlus") + .HasColumnType("int"); + + b.Property("GovernmentCode") + .HasColumnType("longtext"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("IsLeave") + .HasColumnType("tinyint(1)"); + + b.Property("IsProbation") + .HasColumnType("tinyint(1)"); + + b.Property("IsTransfer") + .HasColumnType("tinyint(1)"); + + b.Property("IsVerified") + .HasColumnType("tinyint(1)"); + + b.Property("KeycloakId") + .HasColumnType("char(36)"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("นามสกุล"); + + b.Property("LastNameOld") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .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("LeaveDate") + .HasColumnType("datetime(6)"); + + b.Property("LeaveDateOrder") + .HasColumnType("datetime(6)"); + + b.Property("LeaveDetail") + .HasColumnType("longtext"); + + b.Property("LeaveNumberOrder") + .HasColumnType("longtext"); + + b.Property("LeaveReason") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("LimitLeaveId") + .HasColumnType("char(36)"); + + b.Property("ModifiedDate") + .HasColumnType("datetime(6)"); + + b.Property("MotherCareer") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("อาชีพมารดา"); + + b.Property("MotherCitizenId") + .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("MotherLive") + .HasColumnType("tinyint(1)") + .HasComment("มีชีวิตมารดา"); + + b.Property("MotherPrefixId") + .HasColumnType("char(36)") + .HasComment("Id คำนำหน้ามารดา"); + + b.Property("Nationality") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("สัญชาติ"); + + b.Property("Oc") + .HasColumnType("longtext") + .HasComment("สังกัด"); + + b.Property("OcId") + .HasColumnType("char(36)") + .HasComment("Id สังกัด"); + + b.Property("OrganizationOrganization") + .HasColumnType("longtext"); + + b.Property("OrganizationOrganizationId") + .HasColumnType("char(36)"); + + b.Property("OrganizationShortName") + .HasColumnType("longtext"); + + b.Property("OrganizationShortNameId") + .HasColumnType("char(36)"); + + b.Property("Physical") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("สถานภาพทางกาย"); + + b.Property("PosNoEmployee") + .HasColumnType("longtext") + .HasComment("เลขที่ตำแหน่งลูกจ้าง"); + + b.Property("PosNoId") + .HasColumnType("char(36)"); + + b.Property("PositionEmployeeGroupId") + .HasColumnType("char(36)"); + + b.Property("PositionEmployeeLevelId") + .HasColumnType("char(36)"); + + b.Property("PositionEmployeeLineId") + .HasColumnType("char(36)"); + + b.Property("PositionEmployeePositionId") + .HasColumnType("char(36)"); + + b.Property("PositionEmployeePositionSideId") + .HasColumnType("char(36)"); + + b.Property("PositionExecutive") + .HasColumnType("longtext") + .HasComment("ตำแหน่งทางการบริหาร"); + + b.Property("PositionExecutiveId") + .HasColumnType("char(36)") + .HasComment("Id ตำแหน่งทางการบริหาร"); + + b.Property("PositionExecutiveSide") + .HasColumnType("longtext") + .HasComment("ด้านทางการบริหาร"); + + b.Property("PositionExecutiveSideId") + .HasColumnType("char(36)") + .HasComment("Id ด้านทางการบริหาร"); + + b.Property("PositionId") + .HasColumnType("char(36)"); + + b.Property("PositionLevelId") + .HasColumnType("char(36)"); + + b.Property("PositionLine") + .HasColumnType("longtext") + .HasComment("สายงาน"); + + b.Property("PositionLineId") + .HasColumnType("char(36)") + .HasComment("Id สายงาน"); + + b.Property("PositionPathSide") + .HasColumnType("longtext") + .HasComment("ด้าน/สาขา"); + + b.Property("PositionPathSideId") + .HasColumnType("char(36)") + .HasComment("Id ด้าน/สาขา"); + + b.Property("PositionTypeId") + .HasColumnType("char(36)"); + + b.Property("PrefixId") + .HasColumnType("char(36)"); + + b.Property("PrefixOldId") + .HasColumnType("char(36)") + .HasComment("Id คำนำหน้า(เดิม)"); + + b.Property("ProfileType") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("Race") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("เชื้อชาติ"); + + b.Property("ReasonSameDate") + .HasColumnType("longtext"); + + b.Property("RegistrationAddress") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("Id แขวงตามทะเบียนบ้าน"); + + b.Property("RegistrationDistrictId") + .HasColumnType("char(36)") + .HasComment("Id เขตตามทะเบียนบ้าน"); + + b.Property("RegistrationProvinceId") + .HasColumnType("char(36)") + .HasComment("Id จังหวัดตามทะเบียนบ้าน"); + + b.Property("RegistrationSame") + .HasColumnType("tinyint(1)") + .HasComment("ที่อยู่ปัจจุบันตรงกับที่อยู่ตามทะเบียนบ้านหรือไม่"); + + b.Property("RegistrationSubDistrictId") + .HasColumnType("char(36)") + .HasComment("แขวงตามทะเบียนบ้าน"); + + b.Property("RegistrationZipCode") + .HasMaxLength(5) + .HasColumnType("varchar(5)") + .HasComment("รหัสไปรษณีย์ตามทะเบียนบ้าน"); + + b.Property("RelationshipId") + .HasColumnType("char(36)") + .HasComment("Id สถานะภาพ"); + + b.Property("ReligionId") + .HasColumnType("char(36)") + .HasComment("Id ศาสนา"); + + b.Property("TelephoneNumber") + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasComment("เบอร์โทร"); + + b.Property("TransferDate") + .HasColumnType("datetime(6)"); + + b.Property("VerifiedDate") + .HasColumnType("datetime(6)"); + + b.Property("VerifiedUser") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.HasKey("Id"); + + b.HasIndex("AvatarId"); + + b.HasIndex("GenderId"); + + b.HasIndex("LimitLeaveId"); + + b.HasIndex("PosNoId"); + + b.HasIndex("PositionEmployeeGroupId"); + + b.HasIndex("PositionEmployeeLevelId"); + + b.HasIndex("PositionEmployeeLineId"); + + b.HasIndex("PositionEmployeePositionId"); + + b.HasIndex("PositionEmployeePositionSideId"); + + b.HasIndex("PositionId"); + + b.HasIndex("PositionLevelId"); + + b.HasIndex("PositionTypeId"); + + b.HasIndex("PrefixId"); + + b.ToTable("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAbility", 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("DateEnd") + .HasColumnType("datetime(6)") + .HasComment("วันที่สิ้นสุด"); + + b.Property("DateStart") + .HasColumnType("datetime(6)") + .HasComment("วันที่เริ่มต้น"); + + b.Property("Detail") + .HasColumnType("longtext") + .HasComment("รายละเอียด"); + + b.Property("Field") + .HasColumnType("longtext") + .HasComment("ด้าน"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.Property("Reference") + .HasColumnType("longtext") + .HasComment("เอกสารอ้างอิง"); + + b.Property("Remark") + .HasColumnType("longtext") + .HasComment("หมายเหตุ"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileAbility"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAbilityHistory", 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("DateEnd") + .HasColumnType("datetime(6)") + .HasComment("วันที่สิ้นสุด"); + + b.Property("DateStart") + .HasColumnType("datetime(6)") + .HasComment("วันที่เริ่มต้น"); + + b.Property("Detail") + .HasColumnType("longtext") + .HasComment("รายละเอียด"); + + b.Property("Field") + .HasColumnType("longtext") + .HasComment("ด้าน"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("ProfileAbilityId") + .HasColumnType("char(36)"); + + b.Property("Reference") + .HasColumnType("longtext") + .HasComment("เอกสารอ้างอิง"); + + b.Property("Remark") + .HasColumnType("longtext") + .HasComment("หมายเหตุ"); + + b.HasKey("Id"); + + b.HasIndex("ProfileAbilityId"); + + b.ToTable("ProfileAbilityHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAddressHistory", 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("CurrentAddress") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("ที่อยู่ปัจจุบัน"); + + b.Property("CurrentDistrict") + .HasColumnType("longtext") + .HasComment("เขตปัจจุบัน"); + + b.Property("CurrentDistrictId") + .HasColumnType("char(36)") + .HasComment("Id เขตปัจจุบัน"); + + b.Property("CurrentProvince") + .HasColumnType("longtext") + .HasComment("จังหวัดปัจจุบัน"); + + b.Property("CurrentProvinceId") + .HasColumnType("char(36)") + .HasComment("Id จังหวัดปัจจุบัน"); + + b.Property("CurrentSubDistrict") + .HasColumnType("longtext") + .HasComment("แขวงปัจจุบัน"); + + b.Property("CurrentSubDistrictId") + .HasColumnType("char(36)") + .HasComment("Id แขวงปัจจุบัน"); + + b.Property("CurrentZipCode") + .HasMaxLength(5) + .HasColumnType("varchar(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("ProfileId") + .HasColumnType("char(36)"); + + b.Property("RegistrationAddress") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("ที่อยู่ตามทะเบียนบ้าน"); + + b.Property("RegistrationDistrict") + .HasColumnType("longtext") + .HasComment("เขตตามทะเบียนบ้าน"); + + b.Property("RegistrationDistrictId") + .HasColumnType("char(36)") + .HasComment("Id เขตตามทะเบียนบ้าน"); + + b.Property("RegistrationProvince") + .HasColumnType("longtext") + .HasComment("จังหวัดตามทะเบียนบ้าน"); + + b.Property("RegistrationProvinceId") + .HasColumnType("char(36)") + .HasComment("Id จังหวัดตามทะเบียนบ้าน"); + + b.Property("RegistrationSame") + .HasColumnType("tinyint(1)") + .HasComment("ที่อยู่ปัจจุบันตรงกับที่อยู่ตามทะเบียนบ้านหรือไม่"); + + b.Property("RegistrationSubDistrict") + .HasColumnType("longtext") + .HasComment("แขวงตามทะเบียนบ้าน"); + + b.Property("RegistrationSubDistrictId") + .HasColumnType("char(36)") + .HasComment("Id แขวงตามทะเบียนบ้าน"); + + b.Property("RegistrationZipCode") + .HasMaxLength(5) + .HasColumnType("varchar(5)") + .HasComment("รหัสไปรษณีย์ตามทะเบียนบ้าน"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileAddressHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAssessment", 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("Date") + .HasColumnType("datetime(6)") + .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") + .HasColumnType("longtext") + .HasComment("ชื่อแบบประเมิน"); + + b.Property("Point1") + .HasColumnType("double") + .HasComment("ผลประเมินส่วนที่1 (คะแนน)"); + + b.Property("Point1Total") + .HasColumnType("double") + .HasComment("ส่วนที่1 (คะแนน)"); + + b.Property("Point2") + .HasColumnType("double") + .HasComment("ผลประเมินส่วนที่2 (คะแนน)"); + + b.Property("Point2Total") + .HasColumnType("double") + .HasComment("ส่วนที่2 (คะแนน)"); + + b.Property("PointSum") + .HasColumnType("double") + .HasComment("ผลประเมินรวม (คะแนน)"); + + b.Property("PointSumTotal") + .HasColumnType("double") + .HasComment("ผลรวม (คะแนน)"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileAssessment"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAssessmentHistory", 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("Date") + .HasColumnType("datetime(6)") + .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") + .HasColumnType("longtext") + .HasComment("ชื่อแบบประเมิน"); + + b.Property("Point1") + .HasColumnType("double") + .HasComment("ผลประเมินส่วนที่1 (คะแนน)"); + + b.Property("Point1Total") + .HasColumnType("double") + .HasComment("ส่วนที่1 (คะแนน)"); + + b.Property("Point2") + .HasColumnType("double") + .HasComment("ผลประเมินส่วนที่2 (คะแนน)"); + + b.Property("Point2Total") + .HasColumnType("double") + .HasComment("ส่วนที่2 (คะแนน)"); + + b.Property("PointSum") + .HasColumnType("double") + .HasComment("ผลประเมินรวม (คะแนน)"); + + b.Property("PointSumTotal") + .HasColumnType("double") + .HasComment("ผลรวม (คะแนน)"); + + b.Property("ProfileAssessmentId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileAssessmentId"); + + b.ToTable("ProfileAssessmentHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAvatarHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("AvatarFileId") + .HasColumnType("char(36)"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("AvatarFileId"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileAvatarHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileCertificate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CertificateNo") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("เลขที่ใบอนุญาต"); + + b.Property("CertificateType") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .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("ExpireDate") + .HasColumnType("datetime(6)") + .HasComment("วันที่หมดอายุ"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("IssueDate") + .HasColumnType("datetime(6)") + .HasComment("วันที่ออกใบอนุญาต"); + + b.Property("Issuer") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .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("ProfileId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileCertificate"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileCertificateHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CertificateNo") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("เลขที่ใบอนุญาต"); + + b.Property("CertificateType") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .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("ExpireDate") + .HasColumnType("datetime(6)") + .HasComment("วันที่หมดอายุ"); + + b.Property("IssueDate") + .HasColumnType("datetime(6)") + .HasComment("วันที่ออกใบอนุญาต"); + + b.Property("Issuer") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .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("ProfileCertificateId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileCertificateId"); + + b.ToTable("ProfileCertificateHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileChangeName", 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("FirstName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("ชื่อ"); + + b.Property("LastName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .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("Prefix") + .HasColumnType("longtext") + .HasComment("คำนำหน้า"); + + b.Property("PrefixId") + .HasColumnType("char(36)") + .HasComment("Id คำนำหน้า"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.Property("Status") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("สถานะ"); + + b.HasKey("Id"); + + b.HasIndex("DocumentId"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileChangeName"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileChangeNameHistory", 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("FirstName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("ชื่อ"); + + b.Property("LastName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .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("Prefix") + .HasColumnType("longtext") + .HasComment("คำนำหน้า"); + + b.Property("PrefixId") + .HasColumnType("char(36)") + .HasComment("Id คำนำหน้า"); + + b.Property("ProfileChangeNameId") + .HasColumnType("char(36)"); + + b.Property("Status") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("สถานะ"); + + b.HasKey("Id"); + + b.HasIndex("DocumentId"); + + b.HasIndex("ProfileChangeNameId"); + + b.ToTable("ProfileChangeNameHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileChildren", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("ChildrenCareer") + .HasColumnType("longtext") + .HasComment("อาชีพบุตร"); + + b.Property("ChildrenFirstName") + .HasColumnType("longtext") + .HasComment("ชื่อบุตร"); + + b.Property("ChildrenLastName") + .HasColumnType("longtext") + .HasComment("นามสกุลบุตร"); + + b.Property("ChildrenPrefix") + .HasColumnType("longtext") + .HasComment("คำนำหน้าบุตร"); + + b.Property("ChildrenPrefixId") + .HasColumnType("char(36)") + .HasComment("Id คำนำหน้าบุตร"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileChildren"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileChildrenHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("ChildrenCareer") + .HasColumnType("longtext") + .HasComment("อาชีพบุตร"); + + b.Property("ChildrenFirstName") + .HasColumnType("longtext") + .HasComment("ชื่อบุตร"); + + b.Property("ChildrenLastName") + .HasColumnType("longtext") + .HasComment("นามสกุลบุตร"); + + b.Property("ChildrenPrefix") + .HasColumnType("longtext") + .HasComment("คำนำหน้าบุตร"); + + b.Property("ChildrenPrefixId") + .HasColumnType("char(36)") + .HasComment("Id คำนำหน้าบุตร"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("ProfileChildrenId") + .HasColumnType("char(36)"); + + b.Property("ProfileFamilyHistoryId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileChildrenId"); + + b.HasIndex("ProfileFamilyHistoryId"); + + b.ToTable("ProfileChildrenHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileCoupleHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasComment("ไม่ใช้"); + + b.Property("Career") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("CreatedDate") + .HasColumnType("datetime(6)"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("Prefix") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileCoupleHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileCurrentAddressHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasComment("ไม่ใช้"); + + b.Property("Address") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("CreatedDate") + .HasColumnType("datetime(6)"); + + b.Property("DistrictId") + .HasColumnType("char(36)"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.Property("ProvinceId") + .HasColumnType("char(36)"); + + b.Property("SubDistrictId") + .HasColumnType("char(36)"); + + b.Property("ZipCode") + .IsRequired() + .HasMaxLength(5) + .HasColumnType("varchar(5)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileCurrentAddressHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileDiscipline", 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("Date") + .HasColumnType("datetime(6)") + .HasComment("วัน เดือน ปี"); + + b.Property("Detail") + .HasColumnType("text") + .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("Level") + .HasColumnType("longtext") + .HasComment("ระดับความผิด"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.Property("RefCommandDate") + .HasColumnType("datetime(6)") + .HasComment("เอกสารอ้างอิง (ลงวันที่)"); + + b.Property("RefCommandNo") + .HasColumnType("longtext") + .HasComment("เอกสารอ้างอิง (เลขที่คำสั่ง)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileDiscipline"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileDisciplineHistory", 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("Date") + .HasColumnType("datetime(6)") + .HasComment("วัน เดือน ปี"); + + b.Property("Detail") + .HasColumnType("text") + .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("Level") + .HasColumnType("longtext") + .HasComment("ระดับความผิด"); + + b.Property("ProfileDisciplineId") + .HasColumnType("char(36)"); + + b.Property("RefCommandDate") + .HasColumnType("datetime(6)") + .HasComment("เอกสารอ้างอิง (ลงวันที่)"); + + b.Property("RefCommandNo") + .HasColumnType("longtext") + .HasComment("เอกสารอ้างอิง (เลขที่คำสั่ง)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileDisciplineId"); + + b.ToTable("ProfileDisciplineHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileDuty", 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("DateEnd") + .HasColumnType("datetime(6)") + .HasComment("สิ้นสุด"); + + b.Property("DateStart") + .HasColumnType("datetime(6)") + .HasComment("เริ่มต้น"); + + b.Property("Detail") + .HasColumnType("longtext") + .HasComment("รายละเอียด"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.Property("Reference") + .HasColumnType("longtext") + .HasComment("เอกสารอ้างอิง"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileDuty"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileDutyHistory", 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("DateEnd") + .HasColumnType("datetime(6)") + .HasComment("สิ้นสุด"); + + b.Property("DateStart") + .HasColumnType("datetime(6)") + .HasComment("เริ่มต้น"); + + b.Property("Detail") + .HasColumnType("longtext") + .HasComment("รายละเอียด"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("ProfileDutyId") + .HasColumnType("char(36)"); + + b.Property("Reference") + .HasColumnType("longtext") + .HasComment("เอกสารอ้างอิง"); + + b.HasKey("Id"); + + b.HasIndex("ProfileDutyId"); + + b.ToTable("ProfileDutyHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileEducation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("Country") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)") + .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("Degree") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("วุฒิการศึกษา"); + + b.Property("Duration") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)") + .HasComment("ระยะเวลา"); + + b.Property("DurationYear") + .HasColumnType("int") + .HasComment("ระยะเวลาหลักสูตร"); + + b.Property("EducationLevel") + .HasColumnType("longtext") + .HasComment("ระดับศึกษา"); + + b.Property("EducationLevelId") + .HasColumnType("char(36)") + .HasComment("Id ระดับศึกษา"); + + b.Property("EndDate") + .HasColumnType("datetime(6)") + .HasComment("ถึง"); + + b.Property("Field") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("สาขาวิชา/ทาง"); + + b.Property("FinishDate") + .HasColumnType("datetime(6)") + .HasComment("วันที่สำเร็จการศึกษา"); + + b.Property("FundName") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)") + .HasComment("ทุน"); + + b.Property("Gpa") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("เกรดเฉลี่ย"); + + b.Property("Institute") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)") + .HasComment("สถานศึกษา"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + 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("Other") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)") + .HasComment("ข้อมูลการติดต่อ"); + + b.Property("PositionPath") + .HasColumnType("longtext") + .HasComment("เป็นวุฒิการศึกษาในตำแหน่ง"); + + b.Property("PositionPathId") + .HasColumnType("char(36)") + .HasComment("Id เป็นวุฒิการศึกษาในตำแหน่ง"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.Property("StartDate") + .HasColumnType("datetime(6)") + .HasComment("ตั้งแต่"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileEducation"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileEducationHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("Country") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)") + .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("Degree") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("วุฒิการศึกษา"); + + b.Property("Duration") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)") + .HasComment("ระยะเวลา"); + + b.Property("DurationYear") + .HasColumnType("int") + .HasComment("ระยะเวลาหลักสูตร"); + + b.Property("EducationLevel") + .HasColumnType("longtext") + .HasComment("ระดับศึกษา"); + + b.Property("EducationLevelId") + .HasColumnType("char(36)") + .HasComment("Id ระดับศึกษา"); + + b.Property("EndDate") + .HasColumnType("datetime(6)") + .HasComment("ถึง"); + + b.Property("Field") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("สาขาวิชา/ทาง"); + + b.Property("FinishDate") + .HasColumnType("datetime(6)") + .HasComment("วันที่สำเร็จการศึกษา"); + + b.Property("FundName") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)") + .HasComment("ทุน"); + + b.Property("Gpa") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("เกรดเฉลี่ย"); + + b.Property("Institute") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)") + .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("Other") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)") + .HasComment("ข้อมูลการติดต่อ"); + + b.Property("PositionPath") + .HasColumnType("longtext") + .HasComment("เป็นวุฒิการศึกษาในตำแหน่ง"); + + b.Property("PositionPathId") + .HasColumnType("char(36)") + .HasComment("Id เป็นวุฒิการศึกษาในตำแหน่ง"); + + b.Property("ProfileEducationId") + .HasColumnType("char(36)"); + + b.Property("StartDate") + .HasColumnType("datetime(6)") + .HasComment("ตั้งแต่"); + + b.HasKey("Id"); + + b.HasIndex("ProfileEducationId"); + + b.ToTable("ProfileEducationHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileEmployment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("Command") + .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("Date") + .HasColumnType("datetime(6)") + .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("ProfileId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileEmployment"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileFamilyHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("Couple") + .HasColumnType("tinyint(1)") + .HasComment("คู่สมรส"); + + b.Property("CoupleCareer") + .HasColumnType("longtext") + .HasComment("อาชีพคู่สมรส"); + + b.Property("CoupleFirstName") + .HasColumnType("longtext") + .HasComment("ชื่อคู่สมรส"); + + b.Property("CoupleLastName") + .HasColumnType("longtext") + .HasComment("นามสกุลคู่สมรส"); + + b.Property("CoupleLastNameOld") + .HasColumnType("longtext") + .HasComment("นามสกุลคู่สมรส(เดิม)"); + + b.Property("CouplePrefix") + .HasColumnType("longtext") + .HasComment("คำนำหน้าคู่สมรส"); + + b.Property("CouplePrefixId") + .HasColumnType("char(36)") + .HasComment("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("FatherCareer") + .HasColumnType("longtext") + .HasComment("อาชีพบิดา"); + + b.Property("FatherFirstName") + .HasColumnType("longtext") + .HasComment("ชื่อบิดา"); + + b.Property("FatherLastName") + .HasColumnType("longtext") + .HasComment("นามสกุลบิดา"); + + b.Property("FatherPrefix") + .HasColumnType("longtext") + .HasComment("คำนำหน้าบิดา"); + + b.Property("FatherPrefixId") + .HasColumnType("char(36)") + .HasComment("Id คำนำหน้าบิดา"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("MotherCareer") + .HasColumnType("longtext") + .HasComment("อาชีพมารดา"); + + b.Property("MotherFirstName") + .HasColumnType("longtext") + .HasComment("ชื่อมารดา"); + + b.Property("MotherLastName") + .HasColumnType("longtext") + .HasComment("นามสกุลมารดา"); + + b.Property("MotherPrefix") + .HasColumnType("longtext") + .HasComment("คำนำหน้ามารดา"); + + b.Property("MotherPrefixId") + .HasColumnType("char(36)") + .HasComment("Id คำนำหน้ามารดา"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileFamilyHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileFatherHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasComment("ไม่ใช้"); + + b.Property("Career") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("CreatedDate") + .HasColumnType("datetime(6)"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("Prefix") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileFatherHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileGovernmentHistory", 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("DateAppoint") + .HasColumnType("datetime(6)") + .HasComment("วันที่สั่งบรรจุ"); + + b.Property("DateStart") + .HasColumnType("datetime(6)") + .HasComment("เริ่มปฎิบัติราชการ"); + + b.Property("GovAge") + .HasColumnType("longtext") + .HasComment("อายุราชการ"); + + b.Property("GovAgeAbsent") + .HasColumnType("int") + .HasComment("ขาดราชการ"); + + b.Property("GovAgePlus") + .HasColumnType("int") + .HasComment("อายุราชการเกื้อกูล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Oc") + .HasColumnType("longtext") + .HasComment("สังกัด"); + + b.Property("OcId") + .HasColumnType("char(36)") + .HasComment("Id สังกัด"); + + b.Property("PosNo") + .HasColumnType("longtext") + .HasComment("เลขที่ตำแหน่ง"); + + b.Property("PosNoId") + .HasColumnType("char(36)") + .HasComment("Id เลขที่ตำแหน่ง"); + + b.Property("Position") + .HasColumnType("longtext") + .HasComment("ตำแหน่ง"); + + b.Property("PositionEmployeeGroup") + .HasColumnType("longtext") + .HasComment("กลุ่มงาน"); + + b.Property("PositionEmployeeLevel") + .HasColumnType("longtext") + .HasComment("ระดับชั้นงาน"); + + b.Property("PositionEmployeePosition") + .HasColumnType("longtext") + .HasComment("ตำแหน่ง"); + + b.Property("PositionEmployeePositionSide") + .HasColumnType("longtext") + .HasComment("ด้านของตำแหน่ง"); + + b.Property("PositionExecutive") + .HasColumnType("longtext") + .HasComment("ตำแหน่งทางการบริหาร"); + + b.Property("PositionId") + .HasColumnType("char(36)") + .HasComment("Id ตำแหน่ง"); + + b.Property("PositionLevel") + .HasColumnType("longtext") + .HasComment("ระดับตำแหน่ง"); + + b.Property("PositionLine") + .HasColumnType("longtext") + .HasComment("สายงาน"); + + b.Property("PositionType") + .HasColumnType("longtext") + .HasComment("ประเภทตำแหน่ง"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.Property("ReasonSameDate") + .HasColumnType("longtext") + .HasComment("เหตุผลกรณีไม่ตรงวัน"); + + b.Property("RetireDate") + .HasColumnType("longtext") + .HasComment("วันเกษียณอายุ"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileGovernmentHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("BirthDate") + .HasColumnType("datetime(6)") + .HasComment("วันเกิด"); + + b.Property("BloodGroup") + .HasColumnType("longtext") + .HasComment("กลุ่มเลือด"); + + b.Property("BloodGroupId") + .HasColumnType("char(36)") + .HasComment("Id กลุ่มเลือด"); + + b.Property("CitizenId") + .HasMaxLength(13) + .HasColumnType("varchar(13)") + .HasComment("รหัสบัตรประชาชน"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("EmployeeClass") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("ประเภทลูกจ้าง"); + + b.Property("EmployeeType") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("ประเภทการจ้าง"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("ชื่อ"); + + b.Property("Gender") + .HasColumnType("longtext") + .HasComment("เพศ"); + + b.Property("GenderId") + .HasColumnType("char(36)") + .HasComment("Id เพศ"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .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("Nationality") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("สัญชาติ"); + + b.Property("Prefix") + .HasColumnType("longtext") + .HasComment("คำนำหน้า"); + + b.Property("PrefixId") + .HasColumnType("char(36)") + .HasComment("Id คำนำหน้า"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.Property("Race") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("เชื้อชาติ"); + + b.Property("Relationship") + .HasColumnType("longtext") + .HasComment("สถานะภาพ"); + + b.Property("RelationshipId") + .HasColumnType("char(36)") + .HasComment("Id สถานะภาพ"); + + b.Property("Religion") + .HasColumnType("longtext") + .HasComment("ศาสนา"); + + b.Property("ReligionId") + .HasColumnType("char(36)") + .HasComment("Id ศาสนา"); + + b.Property("TelephoneNumber") + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasComment("เบอร์โทร"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileHonor", 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") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)") + .HasComment("รายละเอียด"); + + b.Property("IssueDate") + .HasColumnType("datetime(6)") + .HasComment("วันที่ได้รับ"); + + b.Property("Issuer") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .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("ProfileId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileHonor"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileHonorHistory", 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") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)") + .HasComment("รายละเอียด"); + + b.Property("IssueDate") + .HasColumnType("datetime(6)") + .HasComment("วันที่ได้รับ"); + + b.Property("Issuer") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .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("ProfileHonorId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileHonorId"); + + b.ToTable("ProfileHonorHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileInsignia", 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("DateAnnounce") + .HasColumnType("datetime(6)") + .HasComment("วันที่ประกาศในราชกิจจาฯ"); + + b.Property("InsigniaId") + .HasColumnType("char(36)"); + + b.Property("InsigniaType") + .HasColumnType("longtext") + .HasComment("ประเภท"); + + b.Property("Issue") + .HasMaxLength(300) + .HasColumnType("varchar(300)") + .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("No") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("ลำดับที่"); + + b.Property("Page") + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasComment("หน้า"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.Property("ReceiveDate") + .HasColumnType("datetime(6)") + .HasComment("ลงวันที่"); + + b.Property("RefCommandDate") + .HasColumnType("datetime(6)") + .HasComment("เอกสารอ้างอิง (ลงวันที่)"); + + b.Property("RefCommandNo") + .HasColumnType("longtext") + .HasComment("เอกสารอ้างอิง (เลขที่คำสั่ง)"); + + b.Property("Section") + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasComment("ตอน"); + + b.Property("Volume") + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasComment("เล่ม"); + + b.Property("VolumeNo") + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasComment("เล่มที่"); + + b.Property("Year") + .HasColumnType("int") + .HasComment("ปีที่ยื่นขอ"); + + b.HasKey("Id"); + + b.HasIndex("InsigniaId"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileInsignia"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileInsigniaHistory", 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("DateAnnounce") + .HasColumnType("datetime(6)") + .HasComment("วันที่ประกาศในราชกิจจาฯ"); + + b.Property("Insignia") + .HasColumnType("longtext") + .HasComment("ชื่อเครื่องราชฯ"); + + b.Property("InsigniaId") + .HasColumnType("char(36)"); + + b.Property("InsigniaType") + .HasColumnType("longtext") + .HasComment("ประเภท"); + + b.Property("Issue") + .HasMaxLength(300) + .HasColumnType("varchar(300)") + .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("No") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("ลำดับที่"); + + b.Property("Page") + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasComment("หน้า"); + + b.Property("ProfileInsigniaId") + .HasColumnType("char(36)"); + + b.Property("ReceiveDate") + .HasColumnType("datetime(6)") + .HasComment("ลงวันที่"); + + b.Property("Section") + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasComment("ตอน"); + + b.Property("Volume") + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasComment("เล่ม"); + + b.Property("VolumeNo") + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasComment("เล่มที่"); + + b.Property("Year") + .HasColumnType("int") + .HasComment("ปีที่ยื่นขอ"); + + b.HasKey("Id"); + + b.HasIndex("ProfileInsigniaId"); + + b.ToTable("ProfileInsigniaHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileLeave", 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("DateEndLeave") + .HasColumnType("datetime(6)") + .HasComment("วัน เดือน ปี ที่สิ้นสุดลา"); + + b.Property("DateStartLeave") + .HasColumnType("datetime(6)") + .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("NumLeave") + .HasColumnType("double") + .HasComment("ลาครั้งที่"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.Property("Reason") + .HasColumnType("longtext") + .HasComment("เหตุผล"); + + b.Property("Status") + .HasColumnType("longtext") + .HasComment("สถานะ"); + + b.Property("SumLeave") + .HasColumnType("double") + .HasComment("ลามาแล้ว"); + + b.Property("TotalLeave") + .HasColumnType("double") + .HasComment("รวมเป็น"); + + b.Property("TypeLeaveId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.HasIndex("TypeLeaveId"); + + b.ToTable("ProfileLeave"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileLeaveHistory", 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("DateEndLeave") + .HasColumnType("datetime(6)") + .HasComment("วัน เดือน ปี ที่สิ้นสุดลา"); + + b.Property("DateStartLeave") + .HasColumnType("datetime(6)") + .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("NumLeave") + .HasColumnType("double") + .HasComment("ลาครั้งที่"); + + b.Property("ProfileLeaveId") + .HasColumnType("char(36)"); + + b.Property("Reason") + .HasColumnType("longtext") + .HasComment("เหตุผล"); + + b.Property("Status") + .HasColumnType("longtext") + .HasComment("สถานะ"); + + b.Property("SumLeave") + .HasColumnType("double") + .HasComment("ลามาแล้ว"); + + b.Property("TotalLeave") + .HasColumnType("double") + .HasComment("รวมเป็น"); + + b.Property("TypeLeaveId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileLeaveId"); + + b.HasIndex("TypeLeaveId"); + + b.ToTable("ProfileLeaveHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileMotherHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasComment("ไม่ใช้"); + + b.Property("Career") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("CreatedDate") + .HasColumnType("datetime(6)"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("Prefix") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileMotherHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileNopaid", 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("Date") + .HasColumnType("datetime(6)") + .HasComment("วัน เดือน ปี"); + + b.Property("Detail") + .HasColumnType("longtext") + .HasComment("รายละเอียด"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.Property("Reference") + .HasColumnType("longtext") + .HasComment("เอกสารอ้างอิง"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileNopaid"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileNopaidHistory", 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("Date") + .HasColumnType("datetime(6)") + .HasComment("วัน เดือน ปี"); + + b.Property("Detail") + .HasColumnType("longtext") + .HasComment("รายละเอียด"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("ProfileNopaidId") + .HasColumnType("char(36)"); + + b.Property("Reference") + .HasColumnType("longtext") + .HasComment("เอกสารอ้างอิง"); + + b.HasKey("Id"); + + b.HasIndex("ProfileNopaidId"); + + b.ToTable("ProfileNopaidHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileOther", 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("Date") + .HasColumnType("datetime(6)") + .HasComment("วันที่"); + + b.Property("Detail") + .HasColumnType("longtext") + .HasComment("รายละเอียด"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileOther"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileOtherHistory", 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("Date") + .HasColumnType("datetime(6)") + .HasComment("วันที่"); + + b.Property("Detail") + .HasColumnType("longtext") + .HasComment("รายละเอียด"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("ProfileOtherId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileOtherId"); + + b.ToTable("ProfileOtherHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfilePaper", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CategoryName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .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") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasComment("ชื่อไฟล์"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("DocumentId"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfilePaper"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileRegistrationAddressHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasComment("ไม่ใช้"); + + b.Property("Address") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("CreatedDate") + .HasColumnType("datetime(6)"); + + b.Property("DistrictId") + .HasColumnType("char(36)"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.Property("ProvinceId") + .HasColumnType("char(36)"); + + b.Property("SubDistrictId") + .HasColumnType("char(36)"); + + b.Property("ZipCode") + .IsRequired() + .HasMaxLength(5) + .HasColumnType("varchar(5)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileRegistrationAddressHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileSalary", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("Amount") + .HasColumnType("double") + .HasComment("เงินเดือน"); + + b.Property("CommandNo") + .IsRequired() + .HasColumnType("longtext") + .HasComment("เลขที่คำสั่ง"); + + b.Property("CommandTypeName") + .IsRequired() + .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("Date") + .HasColumnType("datetime(6)") + .HasComment("วัน เดือน ปี รับตำแหน่ง"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + 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("MouthSalaryAmount") + .HasColumnType("double") + .HasComment("เงินค่าตอบแทนรายเดือน"); + + b.Property("OcId") + .HasColumnType("char(36)") + .HasComment("Id สังกัด"); + + b.Property("Order") + .HasColumnType("int") + .HasComment("ลำดับ"); + + b.Property("OrganizationShortNameId") + .HasColumnType("char(36)") + .HasComment("Id ชื่อย่อหน่วยงาน"); + + b.Property("PosNoEmployee") + .HasColumnType("longtext") + .HasComment("เลขที่ตำแหน่งลูกจ้าง"); + + b.Property("PosNoId") + .HasColumnType("char(36)") + .HasComment("Id เลขที่ตำแหน่ง"); + + b.Property("PositionEmployeeGroupId") + .HasColumnType("char(36)") + .HasComment("Id กลุ่มงาน"); + + b.Property("PositionEmployeeLevelId") + .HasColumnType("char(36)") + .HasComment(" Id ระดับชั้นงาน"); + + b.Property("PositionEmployeePositionId") + .HasColumnType("char(36)") + .HasComment("Id ตำแหน่ง"); + + b.Property("PositionEmployeePositionSideId") + .HasColumnType("char(36)") + .HasComment("Id ด้านของตำแหน่ง"); + + b.Property("PositionExecutiveId") + .HasColumnType("char(36)") + .HasComment("Id ตำแหน่งทางการบริหาร"); + + b.Property("PositionExecutiveSideId") + .HasColumnType("char(36)") + .HasComment("Id ด้านทางการบริหาร"); + + b.Property("PositionId") + .HasColumnType("char(36)") + .HasComment("Id ตำแหน่ง"); + + b.Property("PositionLevelId") + .HasColumnType("char(36)"); + + b.Property("PositionLineId") + .HasColumnType("char(36)") + .HasComment("Id สายงาน"); + + b.Property("PositionPathSideId") + .HasColumnType("char(36)") + .HasComment("Id ด้าน/สาขา"); + + b.Property("PositionSalaryAmount") + .HasColumnType("double") + .HasComment("เงินประจำตำแหน่ง"); + + b.Property("PositionTypeId") + .HasColumnType("char(36)") + .HasComment("Id ประเภทตำแหน่ง"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.Property("RefCommandNo") + .HasColumnType("longtext") + .HasComment("เอกสารอ้างอิง (เลขที่คำสั่ง)"); + + b.Property("SalaryClass") + .HasColumnType("longtext") + .HasComment("ตำแหน่ง (รายละเอียด)"); + + b.Property("SalaryRef") + .HasColumnType("longtext") + .HasComment("เอกสารอ้างอิง"); + + b.Property("SalaryStatus") + .HasColumnType("longtext") + .HasComment("ประเภทตำแหน่งกรณีพิเศษ"); + + b.HasKey("Id"); + + b.HasIndex("PositionLevelId"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileSalary"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileSalaryHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("Amount") + .HasColumnType("double") + .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("Date") + .HasColumnType("datetime(6)") + .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("MouthSalaryAmount") + .HasColumnType("double") + .HasComment("เงินค่าตอบแทนรายเดือน"); + + b.Property("Oc") + .HasColumnType("longtext") + .HasComment("สังกัด"); + + b.Property("OcId") + .HasColumnType("char(36)") + .HasComment("Id สังกัด"); + + b.Property("OrganizationShortName") + .HasColumnType("longtext"); + + b.Property("OrganizationShortNameId") + .HasColumnType("char(36)"); + + b.Property("PosNo") + .HasColumnType("longtext") + .HasComment("เลขที่ตำแหน่ง"); + + b.Property("PosNoEmployee") + .HasColumnType("longtext") + .HasComment("เลขที่ตำแหน่งลูกจ้าง"); + + b.Property("PosNoId") + .HasColumnType("char(36)") + .HasComment("Id เลขที่ตำแหน่ง"); + + b.Property("Position") + .HasColumnType("longtext") + .HasComment("ตำแหน่ง"); + + b.Property("PositionEmployeeGroup") + .HasColumnType("longtext") + .HasComment("กลุ่มงาน"); + + b.Property("PositionEmployeeGroupId") + .HasColumnType("char(36)") + .HasComment("Id กลุ่มงาน"); + + b.Property("PositionEmployeeLevel") + .HasColumnType("longtext") + .HasComment("ระดับชั้นงาน"); + + b.Property("PositionEmployeeLevelId") + .HasColumnType("char(36)") + .HasComment(" Id ระดับชั้นงาน"); + + b.Property("PositionEmployeePosition") + .HasColumnType("longtext") + .HasComment("ตำแหน่ง"); + + b.Property("PositionEmployeePositionId") + .HasColumnType("char(36)") + .HasComment("Id ตำแหน่ง"); + + b.Property("PositionEmployeePositionSide") + .HasColumnType("longtext") + .HasComment("ด้านของตำแหน่ง"); + + b.Property("PositionEmployeePositionSideId") + .HasColumnType("char(36)") + .HasComment("Id ด้านของตำแหน่ง"); + + b.Property("PositionExecutive") + .HasColumnType("longtext") + .HasComment("ตำแหน่งทางการบริหาร"); + + b.Property("PositionExecutiveId") + .HasColumnType("char(36)") + .HasComment("Id ด้านทางการบริหาร"); + + b.Property("PositionExecutiveSide") + .HasColumnType("longtext") + .HasComment("ด้านทางการบริหาร"); + + b.Property("PositionExecutiveSideId") + .HasColumnType("char(36)") + .HasComment("Id ด้านทางการบริหาร"); + + b.Property("PositionId") + .HasColumnType("char(36)") + .HasComment("Id ตำแหน่ง"); + + b.Property("PositionLevel") + .HasColumnType("longtext") + .HasComment("ระดับ"); + + b.Property("PositionLevelId") + .HasColumnType("char(36)") + .HasComment(" Id ระดับ"); + + b.Property("PositionLine") + .HasColumnType("longtext") + .HasComment("สายงาน"); + + b.Property("PositionLineId") + .HasColumnType("char(36)") + .HasComment("Id สายงาน"); + + b.Property("PositionPathSide") + .HasColumnType("longtext") + .HasComment("ด้าน/สาขา"); + + b.Property("PositionPathSideId") + .HasColumnType("char(36)") + .HasComment("Id ด้าน/สาขา"); + + b.Property("PositionSalaryAmount") + .HasColumnType("double") + .HasComment("เงินประจำตำแหน่ง"); + + b.Property("PositionType") + .HasColumnType("longtext") + .HasComment("ประเภทตำแหน่ง"); + + b.Property("PositionTypeId") + .HasColumnType("char(36)") + .HasComment("Id ประเภทตำแหน่ง"); + + b.Property("ProfileSalaryId") + .HasColumnType("char(36)"); + + b.Property("SalaryClass") + .HasColumnType("longtext") + .HasComment("ตำแหน่ง (รายละเอียด)"); + + b.Property("SalaryRef") + .HasColumnType("longtext") + .HasComment("เอกสารอ้างอิง"); + + b.HasKey("Id"); + + b.HasIndex("ProfileSalaryId"); + + b.ToTable("ProfileSalaryHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileTraining", 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("DateOrder") + .HasColumnType("datetime(6)") + .HasComment("คำสั่งลงวันที่/หนังสืออนุมัติลงวันที่"); + + b.Property("Department") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("หน่วยงานที่รับผิดชอบจัดการฝึกอบรม/ดูงาน"); + + b.Property("Duration") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("รวมระยะเวลาในการฝึกอบรม/ดูงาน"); + + b.Property("EndDate") + .HasColumnType("datetime(6)") + .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") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("ชื่อโครงการ/หลักสูตรการฝึกอบรม"); + + b.Property("NumberOrder") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("เลขที่คำสั่ง/เลขที่หนังสืออนุมัติ"); + + b.Property("Place") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("สถานที่ฝึกอบรม/ดูงาน"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.Property("StartDate") + .HasColumnType("datetime(6)") + .HasComment("วันเริ่มต้นการฝึกอบรม/ดูงาน"); + + b.Property("Topic") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("หัวข้อการฝึกอบรม/ดูงาน"); + + b.Property("Yearly") + .HasMaxLength(200) + .HasColumnType("int") + .HasComment("ปีที่อบรม (พ.ศ.)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileTraining"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileTrainingHistory", 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("DateOrder") + .HasColumnType("datetime(6)") + .HasComment("คำสั่งลงวันที่/หนังสืออนุมัติลงวันที่"); + + b.Property("Department") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("หน่วยงานที่รับผิดชอบจัดการฝึกอบรม/ดูงาน"); + + b.Property("Duration") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("รวมระยะเวลาในการฝึกอบรม/ดูงาน"); + + b.Property("EndDate") + .HasColumnType("datetime(6)") + .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") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("ชื่อโครงการ/หลักสูตรการฝึกอบรม"); + + b.Property("NumberOrder") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("เลขที่คำสั่ง/เลขที่หนังสืออนุมัติ"); + + b.Property("Place") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("สถานที่ฝึกอบรม/ดูงาน"); + + b.Property("ProfileTrainingId") + .HasColumnType("char(36)"); + + b.Property("StartDate") + .HasColumnType("datetime(6)") + .HasComment("วันเริ่มต้นการฝึกอบรม/ดูงาน"); + + b.Property("Topic") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("หัวข้อการฝึกอบรม/ดูงาน"); + + b.Property("Yearly") + .HasMaxLength(200) + .HasColumnType("int") + .HasComment("ปีที่อบรม (พ.ศ.)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileTrainingId"); + + b.ToTable("ProfileTrainingHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.TypeLeave", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Name") + .HasColumnType("longtext") + .HasComment("ประเภทการลา"); + + b.HasKey("Id"); + + b.ToTable("TypeLeave"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.BloodGroup", 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(2) + .HasColumnType("varchar(2)") + .HasColumnOrder(1) + .HasComment("ชื่อหมู่โลหิต"); + + b.HasKey("Id"); + + b.ToTable("BloodGroups"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.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.Domain.Models.MetaData.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.Domain.Models.MetaData.Gender", 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(20) + .HasColumnType("varchar(20)") + .HasColumnOrder(1) + .HasComment("เพศ"); + + b.HasKey("Id"); + + b.ToTable("Genders"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.Holiday", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("Category") + .IsRequired() + .HasColumnType("longtext") + .HasColumnOrder(6) + .HasComment("ประเภทของวันหยุดสำหรับ ทำงาน 5 วัน=`NORMAL`,ทำงาน 6 วัน=`6DAYS`"); + + 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("HolidayDate") + .HasColumnType("datetime(6)") + .HasColumnOrder(2) + .HasComment("วันหยุด"); + + b.Property("IsSpecial") + .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(250) + .HasColumnType("varchar(250)") + .HasColumnOrder(4) + .HasComment("ชื่อวันหยุด"); + + b.Property("OriginalDate") + .HasColumnType("datetime(6)") + .HasColumnOrder(3) + .HasComment("วันหยุด(Original)"); + + b.Property("Year") + .HasColumnType("int") + .HasColumnOrder(1) + .HasComment("ประจำปี"); + + b.HasKey("Id"); + + b.ToTable("Holidays"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.Insignia", 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("InsigniaTypeId") + .HasColumnType("char(36)"); + + 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("Level") + .HasColumnType("int") + .HasColumnOrder(4) + .HasComment("ลำดับชั้นของเครื่องราช เอาไว้ตรวจสอบเวลาขอว่าต้องได้ชั้นที่สูงกว่าที่เคยได้รับแล้วเท่านั้น"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnOrder(1) + .HasComment("ชื่อเครื่องราช"); + + b.Property("Note") + .IsRequired() + .HasColumnType("longtext") + .HasColumnOrder(5) + .HasComment("หมายเหตุ"); + + b.Property("ShortName") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasColumnOrder(2) + .HasComment("ชื่อย่อเครื่องราช"); + + b.HasKey("Id"); + + b.HasIndex("InsigniaTypeId"); + + b.ToTable("Insignias"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.InsigniaType", 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("InsigniaTypes"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.OrganizationAgency", 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("OrganizationAgencys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.OrganizationFax", 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("OrganizationFaxs"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.OrganizationGovernmentAgency", 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("OrganizationGovernmentAgencys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.OrganizationLevel", 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("OrganizationLevels"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.OrganizationOrganization", 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.Property("Note") + .IsRequired() + .HasColumnType("longtext") + .HasColumnOrder(3) + .HasComment("หมายเหตุ"); + + b.HasKey("Id"); + + b.ToTable("OrganizationOrganizations"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.OrganizationShortName", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("AgencyCode") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnOrder(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("GovernmentCode") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnOrder(2) + .HasComment("ข้อมูลโครงสร้างหน่วยงานชื่อ รหัสส่วนราชการ"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(4) + .HasComment("สถานะการใช้งาน"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnOrder(3) + .HasComment("ข้อมูลโครงสร้างหน่วยงานชื่อ ตัวย่อหน่วยงาน"); + + b.Property("Note") + .IsRequired() + .HasColumnType("longtext") + .HasColumnOrder(5) + .HasComment("หมายเหตุ"); + + b.HasKey("Id"); + + b.ToTable("OrganizationShortNames"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.OrganizationStatus", 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("OrganizationStatuses"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.OrganizationTelExternal", 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("OrganizationTelExternals"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.OrganizationTelInternal", 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("OrganizationTelInternals"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.OrganizationType", 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("OrganizationTypes"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PhysicalStatus", 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("PhysicalStatuses"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.Position", 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("ExecutiveName") + .IsRequired() + .HasMaxLength(300) + .HasColumnType("varchar(300)") + .HasColumnOrder(3) + .HasComment("ชื่อตำแหน่งทางการบริหาร"); + + b.Property("ExecutiveSideId") + .HasColumnType("char(36)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(9) + .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(300) + .HasColumnType("varchar(300)") + .HasColumnOrder(1) + .HasComment("ชื่อตำแหน่ง"); + + b.Property("PathSideId") + .HasColumnType("char(36)"); + + b.Property("PositionCategory") + .IsRequired() + .HasColumnType("longtext") + .HasColumnOrder(8) + .HasComment("ตำแหน่งสำหรับข้าราชการหรือลูกจ้าง officer/employee"); + + b.Property("PositionLevelId") + .HasColumnType("char(36)"); + + b.Property("PositionPathId") + .HasColumnType("char(36)"); + + b.Property("PositionTypeId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ExecutiveSideId"); + + b.HasIndex("PathSideId"); + + b.HasIndex("PositionLevelId"); + + b.HasIndex("PositionPathId"); + + b.HasIndex("PositionTypeId"); + + b.ToTable("Positions"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PositionEmployeeGroup", 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("PositionEmployeeGroups"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PositionEmployeeLevel", 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(100) + .HasColumnType("varchar(100)") + .HasColumnOrder(2) + .HasComment("ชื่อระดับชั้นงานข้อมูลตำแหน่งของลูกจ้างกรุงเทพ"); + + b.Property("Order") + .HasColumnType("int") + .HasColumnOrder(1) + .HasComment("ลำดับ"); + + b.HasKey("Id"); + + b.ToTable("PositionEmployeeLevels"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PositionEmployeeLine", 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("PositionEmployeeLines"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PositionEmployeePosition", 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.Property("Note") + .IsRequired() + .HasColumnType("longtext") + .HasColumnOrder(3) + .HasComment("หมายเหตุ"); + + b.HasKey("Id"); + + b.ToTable("PositionEmployeePositions"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PositionEmployeePositionSide", 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.Property("Note") + .IsRequired() + .HasColumnType("longtext") + .HasColumnOrder(3) + .HasComment("หมายเหตุ"); + + b.HasKey("Id"); + + b.ToTable("PositionEmployeePositionSides"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PositionEmployeeStatus", 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("PositionEmployeeStatuses"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PositionExecutive", 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("PositionExecutives"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PositionExecutiveSide", 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.Property("Note") + .IsRequired() + .HasColumnType("longtext") + .HasColumnOrder(3) + .HasComment("หมายเหตุ"); + + b.HasKey("Id"); + + b.ToTable("PositionExecutiveSides"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PositionLevel", 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(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("Level") + .HasColumnType("int") + .HasColumnOrder(4) + .HasComment("ลำดับชั้นของระดับตำแหน่ง"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnOrder(2) + .HasComment("ชื่อระดับตำแหน่ง"); + + b.Property("Order") + .HasColumnType("int") + .HasColumnOrder(1) + .HasComment("ลำดับ"); + + b.Property("ShortName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnOrder(3) + .HasComment("ชื่อย่อระดับตำแหน่ง"); + + b.HasKey("Id"); + + b.ToTable("PositionLevels"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PositionLine", 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("PositionLines"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PositionPath", 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.Property("Note") + .IsRequired() + .HasColumnType("longtext") + .HasColumnOrder(3) + .HasComment("หมายเหตุ"); + + b.HasKey("Id"); + + b.ToTable("PositionPaths"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PositionPathSide", 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.Property("Note") + .IsRequired() + .HasColumnType("longtext") + .HasColumnOrder(3) + .HasComment("หมายเหตุ"); + + b.HasKey("Id"); + + b.ToTable("PositionPathSides"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PositionStatus", 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("PositionStatuss"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PositionType", 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(100) + .HasColumnType("varchar(100)") + .HasColumnOrder(2) + .HasComment("ชื่อประเภทตำแหน่ง"); + + b.Property("Order") + .HasColumnType("int") + .HasColumnOrder(1) + .HasComment("ลำดับ"); + + b.HasKey("Id"); + + b.ToTable("PositionTypes"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.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.Domain.Models.MetaData.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.Domain.Models.MetaData.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.Domain.Models.MetaData.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("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("Religions"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.Royal", 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(100) + .HasColumnType("varchar(100)") + .HasColumnOrder(1) + .HasComment("ชื่อประเภทข้อมูลเหรียญตรา"); + + b.Property("ShortName") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("varchar(10)") + .HasColumnOrder(2) + .HasComment("ชื่อย่อเหรียญตรา"); + + b.HasKey("Id"); + + b.ToTable("Royals"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.RoyalHierarchy", 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("RoyalHierarchys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.RoyalType", 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("RoyalTypes"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.SubDistrict", 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("DistrictId") + .HasColumnType("char(36)"); + + 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(150) + .HasColumnType("varchar(150)") + .HasColumnOrder(1) + .HasComment("เขต/อำเภอ"); + + b.Property("ZipCode") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("varchar(10)") + .HasColumnOrder(2) + .HasComment("รหัสไปรษณีย์"); + + b.HasKey("Id"); + + b.HasIndex("DistrictId"); + + b.ToTable("SubDistricts"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.AvailablePositionLevelEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("PositionLevelId") + .HasColumnType("char(36)"); + + b.Property("PositionMasterId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("PositionLevelId"); + + b.HasIndex("PositionMasterId"); + + b.ToTable("AvailablePositionLevels"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.OrganizationEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("Agency") + .HasColumnType("longtext") + .HasColumnOrder(14) + .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("Department") + .HasColumnType("longtext") + .HasColumnOrder(16) + .HasComment("ฝ่าย/ส่วน"); + + b.Property("Government") + .HasColumnType("longtext") + .HasColumnOrder(15) + .HasComment("ส่วนราชการ"); + + 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("OrganizationAgencyId") + .HasColumnType("char(36)") + .HasColumnOrder(10) + .HasComment("OrganizationAgencyId"); + + b.Property("OrganizationFaxId") + .HasColumnType("char(36)"); + + b.Property("OrganizationGovernmentAgencyId") + .HasColumnType("char(36)") + .HasColumnOrder(11) + .HasComment("OrganizationGovernmentAgencyId"); + + b.Property("OrganizationLevelId") + .HasColumnType("char(36)"); + + b.Property("OrganizationOrder") + .HasColumnType("int") + .HasColumnOrder(12) + .HasComment("OrganizationOrder"); + + b.Property("OrganizationOrganizationId") + .HasColumnType("char(36)"); + + b.Property("OrganizationShortNameId") + .HasColumnType("char(36)"); + + b.Property("OrganizationStatusId") + .HasColumnType("char(36)"); + + b.Property("OrganizationTelExternalId") + .HasColumnType("char(36)"); + + b.Property("OrganizationTelInternalId") + .HasColumnType("char(36)"); + + b.Property("OrganizationTypeId") + .HasColumnType("char(36)"); + + b.Property("OrganizationUserNote") + .HasColumnType("longtext") + .HasColumnOrder(13) + .HasComment("OrganizationUserNote"); + + b.Property("ParentId") + .HasColumnType("char(36)"); + + b.Property("Pile") + .HasColumnType("longtext") + .HasColumnOrder(17) + .HasComment("กอง"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationFaxId"); + + b.HasIndex("OrganizationLevelId"); + + b.HasIndex("OrganizationOrganizationId"); + + b.HasIndex("OrganizationShortNameId"); + + b.HasIndex("OrganizationStatusId"); + + b.HasIndex("OrganizationTelExternalId"); + + b.HasIndex("OrganizationTelInternalId"); + + b.HasIndex("OrganizationTypeId"); + + b.HasIndex("ParentId"); + + b.ToTable("Organizations"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.OrganizationPositionEntity", 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("IsDirector") + .HasColumnType("tinyint(1)") + .HasColumnOrder(3) + .HasComment("Is Director"); + + 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("OrganizationId") + .HasColumnType("char(36)"); + + b.Property("PositionMasterId") + .HasColumnType("char(36)"); + + b.Property("PositionNumberId") + .HasColumnType("char(36)"); + + b.Property("PositionUserNote") + .HasColumnType("longtext") + .HasColumnOrder(4) + .HasComment("positionUserNote"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationId"); + + b.HasIndex("PositionMasterId"); + + b.HasIndex("PositionNumberId"); + + b.ToTable("OrganizationPositions"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.PositionMasterEntity", 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("IsDirector") + .HasColumnType("tinyint(1)") + .HasColumnOrder(14) + .HasComment("IsDirector"); + + 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("PositionCondition") + .HasColumnType("longtext") + .HasColumnOrder(11) + .HasComment("PositionCondition"); + + b.Property("PositionExecutiveId") + .HasColumnType("char(36)"); + + b.Property("PositionExecutiveSideId") + .HasColumnType("char(36)"); + + b.Property("PositionExecutiveSideObject") + .HasColumnType("longtext"); + + b.Property("PositionId") + .HasColumnType("char(36)") + .HasColumnOrder(2) + .HasComment("PositionId"); + + b.Property("PositionLineId") + .HasColumnType("char(36)"); + + b.Property("PositionMasterUserNote") + .HasColumnType("longtext") + .HasColumnOrder(13) + .HasComment("PositionMasterUserNote"); + + b.Property("PositionPathId") + .HasColumnType("char(36)"); + + b.Property("PositionPathSideId") + .HasColumnType("char(36)"); + + b.Property("PositionPathSideObject") + .HasColumnType("longtext"); + + b.Property("PositionStatusId") + .HasColumnType("char(36)"); + + b.Property("PositionTypeId") + .HasColumnType("char(36)"); + + b.Property("Qualification") + .HasColumnType("longtext") + .HasColumnOrder(15) + .HasComment("คุณวุฒิ"); + + b.HasKey("Id"); + + b.HasIndex("PositionExecutiveId"); + + b.HasIndex("PositionExecutiveSideId"); + + b.HasIndex("PositionLineId"); + + b.HasIndex("PositionPathId"); + + b.HasIndex("PositionPathSideId"); + + b.HasIndex("PositionStatusId"); + + b.HasIndex("PositionTypeId"); + + b.ToTable("PositionMasters"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.PositionMasterHistoryEntity", 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("IsDirector") + .HasColumnType("tinyint(1)") + .HasColumnOrder(14) + .HasComment("IsDirector"); + + 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("Position") + .HasColumnType("longtext") + .HasColumnOrder(2) + .HasComment("Position"); + + b.Property("PositionCondition") + .HasColumnType("longtext") + .HasColumnOrder(11) + .HasComment("PositionCondition"); + + b.Property("PositionExecutive") + .HasColumnType("longtext") + .HasColumnOrder(5) + .HasComment("PositionExecutive"); + + b.Property("PositionExecutiveSide") + .HasColumnType("longtext") + .HasColumnOrder(6) + .HasComment("PositionExecutiveSide"); + + b.Property("PositionExecutiveSideObject") + .HasColumnType("longtext"); + + b.Property("PositionLevel") + .HasColumnType("longtext") + .HasColumnOrder(12) + .HasComment("PositionLevel"); + + b.Property("PositionLine") + .HasColumnType("longtext") + .HasColumnOrder(8) + .HasComment("PositionLine"); + + b.Property("PositionMasterEntityId") + .HasColumnType("char(36)"); + + b.Property("PositionMasterUserNote") + .HasColumnType("longtext") + .HasColumnOrder(13) + .HasComment("PositionMasterUserNote"); + + b.Property("PositionPath") + .HasColumnType("longtext") + .HasColumnOrder(3) + .HasComment("PositionPath"); + + b.Property("PositionPathSide") + .HasColumnType("longtext") + .HasColumnOrder(7) + .HasComment("PositionPathSide"); + + b.Property("PositionPathSideObject") + .HasColumnType("longtext"); + + b.Property("PositionStatus") + .HasColumnType("longtext") + .HasColumnOrder(10) + .HasComment("PositionStatus"); + + b.Property("PositionType") + .HasColumnType("longtext") + .HasColumnOrder(4) + .HasComment("PositionType"); + + b.Property("Qualification") + .HasColumnType("longtext") + .HasColumnOrder(15) + .HasComment("คุณวุฒิ"); + + b.HasKey("Id"); + + b.HasIndex("PositionMasterEntityId"); + + b.ToTable("PositionMasterHistoryEntity"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.PositionNumberEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Name") + .HasMaxLength(300) + .HasColumnType("varchar(300)") + .HasColumnOrder(2) + .HasComment("ชื่อ"); + + b.Property("OrganizationShortNameId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationShortNameId"); + + b.ToTable("PositionNumbers"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.ProfilePosition", 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)"); + + b.Property("IsPublished") + .HasColumnType("tinyint(1)"); + + 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("OrganizationPositionId") + .HasColumnType("char(36)"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationPositionId"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfilePositions"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Doc", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint", "DisciplineComplaint") + .WithMany("DisciplineComplaint_Docs") + .HasForeignKey("DisciplineComplaintId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineComplaint"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Profile", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint", "DisciplineComplaint") + .WithMany("DisciplineComplaint_Profiles") + .HasForeignKey("DisciplineComplaintId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineComplaint"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate") + .WithMany("DisciplineDisciplinarys") + .HasForeignKey("DisciplineInvestigateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineInvestigate"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DirectorInvestigate", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDirector", "DisciplineDirector") + .WithMany("DisciplineDisciplinary_DirectorInvestigates") + .HasForeignKey("DisciplineDirectorId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DirectorInvestigates") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDirector"); + + b.Navigation("DisciplineDisciplinary"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocComplaintInvestigate", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DocComplaintInvestigates") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocInvestigate", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DocInvestigates") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocInvestigateRelevant", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DocInvestigateRelevants") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocOther", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DocOthers") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocRecordAccuser", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DocRecordAccusers") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocSummaryEvidence", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DocSummaryEvidences") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocWitnesses", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DocWitnessess") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_ProfileComplaintInvestigate", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_ProfileComplaintInvestigates") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint", "DisciplineComplaint") + .WithMany("DisciplineInvestigates") + .HasForeignKey("DisciplineComplaintId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineComplaint"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigateRelevant_Doc", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate") + .WithMany("DisciplineInvestigateRelevant_Docs") + .HasForeignKey("DisciplineInvestigateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineInvestigate"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_Director", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDirector", "DisciplineDirector") + .WithMany("DisciplineInvestigate_Directors") + .HasForeignKey("DisciplineDirectorId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate") + .WithMany("DisciplineInvestigate_Directors") + .HasForeignKey("DisciplineInvestigateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDirector"); + + b.Navigation("DisciplineInvestigate"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_Doc", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate") + .WithMany("DisciplineInvestigate_Docs") + .HasForeignKey("DisciplineInvestigateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineInvestigate"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_DocComplaint", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate") + .WithMany("DisciplineInvestigate_DocComplaints") + .HasForeignKey("DisciplineInvestigateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineInvestigate"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_ProfileComplaint", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate") + .WithMany("DisciplineInvestigate_ProfileComplaints") + .HasForeignKey("DisciplineInvestigateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineInvestigate"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.LimitTypeLeave", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.LimitLeave", "LimitLeave") + .WithMany("LimitTypeLeaves") + .HasForeignKey("LimitLeaveId"); + + b.HasOne("BMA.EHR.Domain.Models.HR.TypeLeave", "TypeLeave") + .WithMany("LimitTypeLeaves") + .HasForeignKey("TypeLeaveId"); + + b.Navigation("LimitLeave"); + + b.Navigation("TypeLeave"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.Profile", b => + { + b.HasOne("BMA.EHR.Domain.Models.Documents.Document", "Avatar") + .WithMany() + .HasForeignKey("AvatarId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.Gender", "Gender") + .WithMany() + .HasForeignKey("GenderId"); + + b.HasOne("BMA.EHR.Domain.Models.HR.LimitLeave", "LimitLeave") + .WithMany("Profiles") + .HasForeignKey("LimitLeaveId"); + + b.HasOne("BMA.EHR.Domain.Models.Organizations.PositionNumberEntity", "PosNo") + .WithMany() + .HasForeignKey("PosNoId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionEmployeeGroup", "PositionEmployeeGroup") + .WithMany() + .HasForeignKey("PositionEmployeeGroupId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionEmployeeLevel", "PositionEmployeeLevel") + .WithMany() + .HasForeignKey("PositionEmployeeLevelId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionEmployeeLine", "PositionEmployeeLine") + .WithMany() + .HasForeignKey("PositionEmployeeLineId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionEmployeePosition", "PositionEmployeePosition") + .WithMany() + .HasForeignKey("PositionEmployeePositionId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionEmployeePositionSide", "PositionEmployeePositionSide") + .WithMany() + .HasForeignKey("PositionEmployeePositionSideId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionPath", "Position") + .WithMany() + .HasForeignKey("PositionId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionLevel", "PositionLevel") + .WithMany() + .HasForeignKey("PositionLevelId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionType", "PositionType") + .WithMany() + .HasForeignKey("PositionTypeId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.Prefix", "Prefix") + .WithMany() + .HasForeignKey("PrefixId"); + + b.Navigation("Avatar"); + + b.Navigation("Gender"); + + b.Navigation("LimitLeave"); + + b.Navigation("PosNo"); + + b.Navigation("Position"); + + b.Navigation("PositionEmployeeGroup"); + + b.Navigation("PositionEmployeeLevel"); + + b.Navigation("PositionEmployeeLine"); + + b.Navigation("PositionEmployeePosition"); + + b.Navigation("PositionEmployeePositionSide"); + + b.Navigation("PositionLevel"); + + b.Navigation("PositionType"); + + b.Navigation("Prefix"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAbility", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("Abilitys") + .HasForeignKey("ProfileId"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAbilityHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.ProfileAbility", "ProfileAbility") + .WithMany("ProfileAbilityHistorys") + .HasForeignKey("ProfileAbilityId"); + + b.Navigation("ProfileAbility"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAddressHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("AddressHistory") + .HasForeignKey("ProfileId"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAssessment", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("Assessments") + .HasForeignKey("ProfileId"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAssessmentHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.ProfileAssessment", "ProfileAssessment") + .WithMany("ProfileAssessmentHistorys") + .HasForeignKey("ProfileAssessmentId"); + + b.Navigation("ProfileAssessment"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAvatarHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.Documents.Document", "AvatarFile") + .WithMany() + .HasForeignKey("AvatarFileId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("AvatarHistory") + .HasForeignKey("ProfileId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("AvatarFile"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileCertificate", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("Certificates") + .HasForeignKey("ProfileId"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileCertificateHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.ProfileCertificate", "ProfileCertificate") + .WithMany("ProfileCertificateHistorys") + .HasForeignKey("ProfileCertificateId"); + + b.Navigation("ProfileCertificate"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileChangeName", b => + { + b.HasOne("BMA.EHR.Domain.Models.Documents.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId"); + + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("ChangeNames") + .HasForeignKey("ProfileId"); + + b.Navigation("Document"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileChangeNameHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.Documents.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId"); + + b.HasOne("BMA.EHR.Domain.Models.HR.ProfileChangeName", "ProfileChangeName") + .WithMany("ProfileChangeNameHistorys") + .HasForeignKey("ProfileChangeNameId"); + + b.Navigation("Document"); + + b.Navigation("ProfileChangeName"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileChildren", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("Childrens") + .HasForeignKey("ProfileId"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileChildrenHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.ProfileChildren", null) + .WithMany("ProfileChildrenHistorys") + .HasForeignKey("ProfileChildrenId"); + + b.HasOne("BMA.EHR.Domain.Models.HR.ProfileFamilyHistory", null) + .WithMany("Childrens") + .HasForeignKey("ProfileFamilyHistoryId"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileCoupleHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("CoupleHistory") + .HasForeignKey("ProfileId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileCurrentAddressHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("CurrentAddressHistory") + .HasForeignKey("ProfileId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileDiscipline", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("Disciplines") + .HasForeignKey("ProfileId"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileDisciplineHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.ProfileDiscipline", "ProfileDiscipline") + .WithMany("ProfileDisciplineHistorys") + .HasForeignKey("ProfileDisciplineId"); + + b.Navigation("ProfileDiscipline"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileDuty", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("Dutys") + .HasForeignKey("ProfileId"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileDutyHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.ProfileDuty", "ProfileDuty") + .WithMany("ProfileDutyHistorys") + .HasForeignKey("ProfileDutyId"); + + b.Navigation("ProfileDuty"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileEducation", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("Educations") + .HasForeignKey("ProfileId"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileEducationHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.ProfileEducation", "ProfileEducation") + .WithMany("ProfileEducationHistorys") + .HasForeignKey("ProfileEducationId"); + + b.Navigation("ProfileEducation"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileEmployment", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("Employments") + .HasForeignKey("ProfileId"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileFamilyHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("FamilyHistory") + .HasForeignKey("ProfileId"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileFatherHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("FatherHistory") + .HasForeignKey("ProfileId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileGovernmentHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("GovernmentHistory") + .HasForeignKey("ProfileId"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("ProfileHistory") + .HasForeignKey("ProfileId"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileHonor", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("Honors") + .HasForeignKey("ProfileId"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileHonorHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.ProfileHonor", "ProfileHonor") + .WithMany("ProfileHonorHistorys") + .HasForeignKey("ProfileHonorId"); + + b.Navigation("ProfileHonor"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileInsignia", b => + { + b.HasOne("BMA.EHR.Domain.Models.MetaData.Insignia", "Insignia") + .WithMany() + .HasForeignKey("InsigniaId"); + + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("Insignias") + .HasForeignKey("ProfileId"); + + b.Navigation("Insignia"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileInsigniaHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.ProfileInsignia", "ProfileInsignia") + .WithMany("ProfileInsigniaHistorys") + .HasForeignKey("ProfileInsigniaId"); + + b.Navigation("ProfileInsignia"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileLeave", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("Leaves") + .HasForeignKey("ProfileId"); + + b.HasOne("BMA.EHR.Domain.Models.HR.TypeLeave", "TypeLeave") + .WithMany() + .HasForeignKey("TypeLeaveId"); + + b.Navigation("Profile"); + + b.Navigation("TypeLeave"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileLeaveHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.ProfileLeave", "ProfileLeave") + .WithMany("ProfileLeaveHistorys") + .HasForeignKey("ProfileLeaveId"); + + b.HasOne("BMA.EHR.Domain.Models.HR.TypeLeave", "TypeLeave") + .WithMany() + .HasForeignKey("TypeLeaveId"); + + b.Navigation("ProfileLeave"); + + b.Navigation("TypeLeave"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileMotherHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("MotherHistory") + .HasForeignKey("ProfileId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileNopaid", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("Nopaids") + .HasForeignKey("ProfileId"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileNopaidHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.ProfileNopaid", "ProfileNopaid") + .WithMany("ProfileNopaidHistorys") + .HasForeignKey("ProfileNopaidId"); + + b.Navigation("ProfileNopaid"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileOther", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("Others") + .HasForeignKey("ProfileId"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileOtherHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.ProfileOther", "ProfileOther") + .WithMany("ProfileOtherHistorys") + .HasForeignKey("ProfileOtherId"); + + b.Navigation("ProfileOther"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfilePaper", b => + { + b.HasOne("BMA.EHR.Domain.Models.Documents.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("Papers") + .HasForeignKey("ProfileId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Document"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileRegistrationAddressHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("RegistrationAddressHistory") + .HasForeignKey("ProfileId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileSalary", b => + { + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionLevel", "PositionLevel") + .WithMany() + .HasForeignKey("PositionLevelId"); + + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("Salaries") + .HasForeignKey("ProfileId"); + + b.Navigation("PositionLevel"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileSalaryHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.ProfileSalary", "ProfileSalary") + .WithMany("ProfileSalaryHistorys") + .HasForeignKey("ProfileSalaryId"); + + b.Navigation("ProfileSalary"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileTraining", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("Trainings") + .HasForeignKey("ProfileId"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileTrainingHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.ProfileTraining", "ProfileTraining") + .WithMany("ProfileTrainingHistorys") + .HasForeignKey("ProfileTrainingId"); + + b.Navigation("ProfileTraining"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.District", b => + { + b.HasOne("BMA.EHR.Domain.Models.MetaData.Province", "Province") + .WithMany("Districts") + .HasForeignKey("ProvinceId"); + + b.Navigation("Province"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.Insignia", b => + { + b.HasOne("BMA.EHR.Domain.Models.MetaData.InsigniaType", "InsigniaType") + .WithMany() + .HasForeignKey("InsigniaTypeId"); + + b.Navigation("InsigniaType"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.Position", b => + { + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionExecutiveSide", "ExecutiveSide") + .WithMany() + .HasForeignKey("ExecutiveSideId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionPathSide", "PathSide") + .WithMany() + .HasForeignKey("PathSideId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionLevel", "PositionLevel") + .WithMany() + .HasForeignKey("PositionLevelId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionPath", "PositionPath") + .WithMany() + .HasForeignKey("PositionPathId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionType", "PositionType") + .WithMany() + .HasForeignKey("PositionTypeId"); + + b.Navigation("ExecutiveSide"); + + b.Navigation("PathSide"); + + b.Navigation("PositionLevel"); + + b.Navigation("PositionPath"); + + b.Navigation("PositionType"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.SubDistrict", b => + { + b.HasOne("BMA.EHR.Domain.Models.MetaData.District", "District") + .WithMany("SubDistricts") + .HasForeignKey("DistrictId"); + + b.Navigation("District"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.AvailablePositionLevelEntity", b => + { + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionLevel", "PositionLevel") + .WithMany() + .HasForeignKey("PositionLevelId"); + + b.HasOne("BMA.EHR.Domain.Models.Organizations.PositionMasterEntity", "PositionMaster") + .WithMany() + .HasForeignKey("PositionMasterId"); + + b.Navigation("PositionLevel"); + + b.Navigation("PositionMaster"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.OrganizationEntity", b => + { + b.HasOne("BMA.EHR.Domain.Models.MetaData.OrganizationFax", "OrganizationFax") + .WithMany() + .HasForeignKey("OrganizationFaxId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.OrganizationLevel", "OrganizationLevel") + .WithMany() + .HasForeignKey("OrganizationLevelId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.OrganizationOrganization", "OrganizationOrganization") + .WithMany() + .HasForeignKey("OrganizationOrganizationId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.OrganizationShortName", "OrganizationShortName") + .WithMany() + .HasForeignKey("OrganizationShortNameId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.OrganizationStatus", "OrganizationStatus") + .WithMany() + .HasForeignKey("OrganizationStatusId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.OrganizationTelExternal", "OrganizationTelExternal") + .WithMany() + .HasForeignKey("OrganizationTelExternalId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.OrganizationTelInternal", "OrganizationTelInternal") + .WithMany() + .HasForeignKey("OrganizationTelInternalId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.OrganizationType", "OrganizationType") + .WithMany() + .HasForeignKey("OrganizationTypeId"); + + b.HasOne("BMA.EHR.Domain.Models.Organizations.OrganizationEntity", "Parent") + .WithMany("Organizations") + .HasForeignKey("ParentId"); + + b.Navigation("OrganizationFax"); + + b.Navigation("OrganizationLevel"); + + b.Navigation("OrganizationOrganization"); + + b.Navigation("OrganizationShortName"); + + b.Navigation("OrganizationStatus"); + + b.Navigation("OrganizationTelExternal"); + + b.Navigation("OrganizationTelInternal"); + + b.Navigation("OrganizationType"); + + b.Navigation("Parent"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.OrganizationPositionEntity", b => + { + b.HasOne("BMA.EHR.Domain.Models.Organizations.OrganizationEntity", "Organization") + .WithMany() + .HasForeignKey("OrganizationId"); + + b.HasOne("BMA.EHR.Domain.Models.Organizations.PositionMasterEntity", "PositionMaster") + .WithMany() + .HasForeignKey("PositionMasterId"); + + b.HasOne("BMA.EHR.Domain.Models.Organizations.PositionNumberEntity", "PositionNumber") + .WithMany() + .HasForeignKey("PositionNumberId"); + + b.Navigation("Organization"); + + b.Navigation("PositionMaster"); + + b.Navigation("PositionNumber"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.PositionMasterEntity", b => + { + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionExecutive", "PositionExecutive") + .WithMany() + .HasForeignKey("PositionExecutiveId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionExecutiveSide", "PositionExecutiveSide") + .WithMany() + .HasForeignKey("PositionExecutiveSideId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionLine", "PositionLine") + .WithMany() + .HasForeignKey("PositionLineId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionPath", "PositionPath") + .WithMany() + .HasForeignKey("PositionPathId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionPathSide", "PositionPathSide") + .WithMany() + .HasForeignKey("PositionPathSideId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionStatus", "PositionStatus") + .WithMany() + .HasForeignKey("PositionStatusId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionType", "PositionType") + .WithMany() + .HasForeignKey("PositionTypeId"); + + b.Navigation("PositionExecutive"); + + b.Navigation("PositionExecutiveSide"); + + b.Navigation("PositionLine"); + + b.Navigation("PositionPath"); + + b.Navigation("PositionPathSide"); + + b.Navigation("PositionStatus"); + + b.Navigation("PositionType"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.PositionMasterHistoryEntity", b => + { + b.HasOne("BMA.EHR.Domain.Models.Organizations.PositionMasterEntity", "PositionMasterEntity") + .WithMany("PositionMasterHistorys") + .HasForeignKey("PositionMasterEntityId"); + + b.Navigation("PositionMasterEntity"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.PositionNumberEntity", b => + { + b.HasOne("BMA.EHR.Domain.Models.MetaData.OrganizationShortName", "OrganizationShortName") + .WithMany() + .HasForeignKey("OrganizationShortNameId"); + + b.Navigation("OrganizationShortName"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.ProfilePosition", b => + { + b.HasOne("BMA.EHR.Domain.Models.Organizations.OrganizationPositionEntity", "OrganizationPosition") + .WithMany() + .HasForeignKey("OrganizationPositionId"); + + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany() + .HasForeignKey("ProfileId"); + + b.Navigation("OrganizationPosition"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint", b => + { + b.Navigation("DisciplineComplaint_Docs"); + + b.Navigation("DisciplineComplaint_Profiles"); + + b.Navigation("DisciplineInvestigates"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDirector", b => + { + b.Navigation("DisciplineDisciplinary_DirectorInvestigates"); + + b.Navigation("DisciplineInvestigate_Directors"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", b => + { + b.Navigation("DisciplineDisciplinary_DirectorInvestigates"); + + b.Navigation("DisciplineDisciplinary_DocComplaintInvestigates"); + + b.Navigation("DisciplineDisciplinary_DocInvestigateRelevants"); + + b.Navigation("DisciplineDisciplinary_DocInvestigates"); + + b.Navigation("DisciplineDisciplinary_DocOthers"); + + b.Navigation("DisciplineDisciplinary_DocRecordAccusers"); + + b.Navigation("DisciplineDisciplinary_DocSummaryEvidences"); + + b.Navigation("DisciplineDisciplinary_DocWitnessess"); + + b.Navigation("DisciplineDisciplinary_ProfileComplaintInvestigates"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", b => + { + b.Navigation("DisciplineDisciplinarys"); + + b.Navigation("DisciplineInvestigateRelevant_Docs"); + + b.Navigation("DisciplineInvestigate_Directors"); + + b.Navigation("DisciplineInvestigate_DocComplaints"); + + b.Navigation("DisciplineInvestigate_Docs"); + + b.Navigation("DisciplineInvestigate_ProfileComplaints"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.LimitLeave", b => + { + b.Navigation("LimitTypeLeaves"); + + b.Navigation("Profiles"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.Profile", b => + { + b.Navigation("Abilitys"); + + b.Navigation("AddressHistory"); + + b.Navigation("Assessments"); + + b.Navigation("AvatarHistory"); + + b.Navigation("Certificates"); + + b.Navigation("ChangeNames"); + + b.Navigation("Childrens"); + + b.Navigation("CoupleHistory"); + + b.Navigation("CurrentAddressHistory"); + + b.Navigation("Disciplines"); + + b.Navigation("Dutys"); + + b.Navigation("Educations"); + + b.Navigation("Employments"); + + b.Navigation("FamilyHistory"); + + b.Navigation("FatherHistory"); + + b.Navigation("GovernmentHistory"); + + b.Navigation("Honors"); + + b.Navigation("Insignias"); + + b.Navigation("Leaves"); + + b.Navigation("MotherHistory"); + + b.Navigation("Nopaids"); + + b.Navigation("Others"); + + b.Navigation("Papers"); + + b.Navigation("ProfileHistory"); + + b.Navigation("RegistrationAddressHistory"); + + b.Navigation("Salaries"); + + b.Navigation("Trainings"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAbility", b => + { + b.Navigation("ProfileAbilityHistorys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAssessment", b => + { + b.Navigation("ProfileAssessmentHistorys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileCertificate", b => + { + b.Navigation("ProfileCertificateHistorys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileChangeName", b => + { + b.Navigation("ProfileChangeNameHistorys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileChildren", b => + { + b.Navigation("ProfileChildrenHistorys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileDiscipline", b => + { + b.Navigation("ProfileDisciplineHistorys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileDuty", b => + { + b.Navigation("ProfileDutyHistorys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileEducation", b => + { + b.Navigation("ProfileEducationHistorys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileFamilyHistory", b => + { + b.Navigation("Childrens"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileHonor", b => + { + b.Navigation("ProfileHonorHistorys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileInsignia", b => + { + b.Navigation("ProfileInsigniaHistorys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileLeave", b => + { + b.Navigation("ProfileLeaveHistorys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileNopaid", b => + { + b.Navigation("ProfileNopaidHistorys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileOther", b => + { + b.Navigation("ProfileOtherHistorys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileSalary", b => + { + b.Navigation("ProfileSalaryHistorys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileTraining", b => + { + b.Navigation("ProfileTrainingHistorys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.TypeLeave", b => + { + b.Navigation("LimitTypeLeaves"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.District", b => + { + b.Navigation("SubDistricts"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.Province", b => + { + b.Navigation("Districts"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.OrganizationEntity", b => + { + b.Navigation("Organizations"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.PositionMasterEntity", b => + { + b.Navigation("PositionMasterHistorys"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/BMA.EHR.Infrastructure/Migrations/DisciplineDb/20231124030032_add table DisciplineDisciplinary_DocOthers.cs b/BMA.EHR.Infrastructure/Migrations/DisciplineDb/20231124030032_add table DisciplineDisciplinary_DocOthers.cs new file mode 100644 index 00000000..53943eb1 --- /dev/null +++ b/BMA.EHR.Infrastructure/Migrations/DisciplineDb/20231124030032_add table DisciplineDisciplinary_DocOthers.cs @@ -0,0 +1,794 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb +{ + /// + public partial class addtableDisciplineDisciplinary_DocOthers : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_DisciplineDisciplinary_DirectorInvestigates_DisciplineInvest~", + table: "DisciplineDisciplinary_DirectorInvestigates"); + + migrationBuilder.DropForeignKey( + name: "FK_DisciplineDisciplinary_DocComplaintInvestigates_DisciplineIn~", + table: "DisciplineDisciplinary_DocComplaintInvestigates"); + + migrationBuilder.DropForeignKey( + name: "FK_DisciplineDisciplinary_DocInvestigateRelevants_DisciplineInv~", + table: "DisciplineDisciplinary_DocInvestigateRelevants"); + + migrationBuilder.DropForeignKey( + name: "FK_DisciplineDisciplinary_DocInvestigates_DisciplineInvestigate~", + table: "DisciplineDisciplinary_DocInvestigates"); + + migrationBuilder.DropForeignKey( + name: "FK_DisciplineDisciplinary_ProfileComplaintInvestigates_Discipli~", + table: "DisciplineDisciplinary_ProfileComplaintInvestigates"); + + migrationBuilder.DropForeignKey( + name: "FK_DisciplineDisciplinarys_DisciplineComplaints_DisciplineCompl~", + table: "DisciplineDisciplinarys"); + + migrationBuilder.DropForeignKey( + name: "FK_DisciplineInvestigate_Directors_DisciplineDisciplinarys_Disc~", + table: "DisciplineInvestigate_Directors"); + + migrationBuilder.DropForeignKey( + name: "FK_DisciplineInvestigate_DocComplaints_DisciplineDisciplinarys_~", + table: "DisciplineInvestigate_DocComplaints"); + + migrationBuilder.DropForeignKey( + name: "FK_DisciplineInvestigate_Docs_DisciplineDisciplinarys_Disciplin~", + table: "DisciplineInvestigate_Docs"); + + migrationBuilder.DropForeignKey( + name: "FK_DisciplineInvestigate_ProfileComplaints_DisciplineDisciplina~", + table: "DisciplineInvestigate_ProfileComplaints"); + + migrationBuilder.DropForeignKey( + name: "FK_DisciplineInvestigateRelevant_Docs_DisciplineDisciplinarys_D~", + table: "DisciplineInvestigateRelevant_Docs"); + + migrationBuilder.DropIndex( + name: "IX_DisciplineInvestigateRelevant_Docs_DisciplineDisciplinaryId", + table: "DisciplineInvestigateRelevant_Docs"); + + migrationBuilder.DropIndex( + name: "IX_DisciplineInvestigate_ProfileComplaints_DisciplineDisciplina~", + table: "DisciplineInvestigate_ProfileComplaints"); + + migrationBuilder.DropIndex( + name: "IX_DisciplineInvestigate_Docs_DisciplineDisciplinaryId", + table: "DisciplineInvestigate_Docs"); + + migrationBuilder.DropIndex( + name: "IX_DisciplineInvestigate_DocComplaints_DisciplineDisciplinaryId", + table: "DisciplineInvestigate_DocComplaints"); + + migrationBuilder.DropIndex( + name: "IX_DisciplineInvestigate_Directors_DisciplineDisciplinaryId", + table: "DisciplineInvestigate_Directors"); + + migrationBuilder.DropColumn( + name: "DisciplineDisciplinaryId", + table: "DisciplineInvestigateRelevant_Docs"); + + migrationBuilder.DropColumn( + name: "DisciplineDisciplinaryId", + table: "DisciplineInvestigate_ProfileComplaints"); + + migrationBuilder.DropColumn( + name: "DisciplineDisciplinaryId", + table: "DisciplineInvestigate_Docs"); + + migrationBuilder.DropColumn( + name: "DisciplineDisciplinaryId", + table: "DisciplineInvestigate_DocComplaints"); + + migrationBuilder.DropColumn( + name: "DisciplineDisciplinaryId", + table: "DisciplineInvestigate_Directors"); + + migrationBuilder.RenameColumn( + name: "DisciplineComplaintId", + table: "DisciplineDisciplinarys", + newName: "DisciplineInvestigateId"); + + migrationBuilder.RenameIndex( + name: "IX_DisciplineDisciplinarys_DisciplineComplaintId", + table: "DisciplineDisciplinarys", + newName: "IX_DisciplineDisciplinarys_DisciplineInvestigateId"); + + migrationBuilder.RenameColumn( + name: "DisciplineInvestigateId", + table: "DisciplineDisciplinary_ProfileComplaintInvestigates", + newName: "DisciplineDisciplinaryId"); + + migrationBuilder.RenameColumn( + name: "DisciplineInvestigateId", + table: "DisciplineDisciplinary_DocInvestigates", + newName: "DisciplineDisciplinaryId"); + + migrationBuilder.RenameIndex( + name: "IX_DisciplineDisciplinary_DocInvestigates_DisciplineInvestigate~", + table: "DisciplineDisciplinary_DocInvestigates", + newName: "IX_DisciplineDisciplinary_DocInvestigates_DisciplineDisciplinar~"); + + migrationBuilder.RenameColumn( + name: "DisciplineInvestigateId", + table: "DisciplineDisciplinary_DocInvestigateRelevants", + newName: "DisciplineDisciplinaryId"); + + migrationBuilder.RenameIndex( + name: "IX_DisciplineDisciplinary_DocInvestigateRelevants_DisciplineInv~", + table: "DisciplineDisciplinary_DocInvestigateRelevants", + newName: "IX_DisciplineDisciplinary_DocInvestigateRelevants_DisciplineDis~"); + + migrationBuilder.RenameColumn( + name: "DisciplineInvestigateId", + table: "DisciplineDisciplinary_DocComplaintInvestigates", + newName: "DisciplineDisciplinaryId"); + + migrationBuilder.RenameIndex( + name: "IX_DisciplineDisciplinary_DocComplaintInvestigates_DisciplineIn~", + table: "DisciplineDisciplinary_DocComplaintInvestigates", + newName: "IX_DisciplineDisciplinary_DocComplaintInvestigates_DisciplineDi~"); + + migrationBuilder.RenameColumn( + name: "DisciplineInvestigateId", + table: "DisciplineDisciplinary_DirectorInvestigates", + newName: "DisciplineDisciplinaryId"); + + migrationBuilder.RenameIndex( + name: "IX_DisciplineDisciplinary_DirectorInvestigates_DisciplineInvest~", + table: "DisciplineDisciplinary_DirectorInvestigates", + newName: "IX_DisciplineDisciplinary_DirectorInvestigates_DisciplineDiscip~"); + + migrationBuilder.AlterColumn( + name: "InvestigationStatusResult", + table: "DisciplineDisciplinarys", + type: "longtext", + nullable: true, + comment: "สถานะหรือผลการสืบสวน (NOT_SPECIFIED คือ ยังไม่ระบุ, HAVE_CAUSE คือ มีมูล, NO_CAUSE คือ ไม่มีมูล", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "สถานะหรือผลการสืบสวน (not_specified คือ ยังไม่ระบุ, have_cause คือ มีมูล, no_cause คือ ไม่มีมูล") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "InvestigationDetail", + table: "DisciplineDisciplinarys", + type: "longtext", + nullable: true, + comment: "ลักษณะการสืบสวน (APPOINT_DIRECTORS คือ แต่งตั้งกรรมการสืบสวน, SECRET_INVESTIGATION คือ สืบสวนทางลับ, OTHER คือ อื่น ๆ)", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "ลักษณะการสืบสวน (appoint_directors คือ แต่งตั้งกรรมการสืบสวน, secret_investigation คือ สืบสวนทางลับ, other คือ อื่น ๆ)") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "DisciplinaryCaseFault", + table: "DisciplineDisciplinarys", + type: "longtext", + nullable: true, + comment: "กรณีความผิด") + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "DisciplinaryDateAllegation", + table: "DisciplineDisciplinarys", + type: "datetime(6)", + nullable: true, + comment: "วันที่รับทราบข้อกล่าวหา"); + + migrationBuilder.AddColumn( + name: "DisciplinaryDateEvident", + table: "DisciplineDisciplinarys", + type: "datetime(6)", + nullable: true, + comment: "วันที่สรุปพยานหลักฐาน"); + + migrationBuilder.AddColumn( + name: "DisciplinaryFaultLevel", + table: "DisciplineDisciplinarys", + type: "longtext", + nullable: true, + comment: "ระดับโทษความผิด กรณีไม่ร้ายแรง: ภาคทัณฑ์, ตัดเงินเดือน, ลดขั้นเงินเดือน | กรณีร้ายแรง: ปลดออก, ไล่ออก") + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "DisciplinaryInvestigateAt", + table: "DisciplineDisciplinarys", + type: "longtext", + nullable: true, + comment: "สอบสวนที่") + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "DisciplinaryRecordAccuser", + table: "DisciplineDisciplinarys", + type: "longtext", + nullable: true, + comment: "บันทึกถ้อยคำของผู้กล่าวหา") + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "DisciplinaryRefLaw", + table: "DisciplineDisciplinarys", + type: "longtext", + nullable: true, + comment: "อ้างอิงมาตราตามกฎหมาย") + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "DisciplinarySummaryEvidence", + table: "DisciplineDisciplinarys", + type: "longtext", + nullable: true, + comment: "สรุปพยานหลักฐานสนับสนุนข้อกล่าวหา") + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "DisciplinaryWitnesses", + table: "DisciplineDisciplinarys", + type: "longtext", + nullable: true, + comment: "พยานและบันทึกถ้อยคำพยาน") + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "ResultInvestigate", + table: "DisciplineDisciplinarys", + type: "longtext", + nullable: true, + comment: "ผลการตรวจสอบเรื่องสืบสวน") + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "DisciplineDisciplinary_DocOthers", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + CreatedAt = table.Column(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), + CreatedUserId = table.Column(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล") + .Annotation("MySql:CharSet", "utf8mb4"), + LastUpdatedAt = table.Column(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"), + LastUpdateUserId = table.Column(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด") + .Annotation("MySql:CharSet", "utf8mb4"), + CreatedFullName = table.Column(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล") + .Annotation("MySql:CharSet", "utf8mb4"), + LastUpdateFullName = table.Column(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด") + .Annotation("MySql:CharSet", "utf8mb4"), + DocumentId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + DisciplineDisciplinaryId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") + }, + constraints: table => + { + table.PrimaryKey("PK_DisciplineDisciplinary_DocOthers", x => x.Id); + table.ForeignKey( + name: "FK_DisciplineDisciplinary_DocOthers_DisciplineDisciplinarys_Dis~", + column: x => x.DisciplineDisciplinaryId, + principalTable: "DisciplineDisciplinarys", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_DisciplineDisciplinary_DocOthers_Documents_DocumentId", + column: x => x.DocumentId, + principalTable: "Documents", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "DisciplineDisciplinary_DocRecordAccusers", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + CreatedAt = table.Column(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), + CreatedUserId = table.Column(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล") + .Annotation("MySql:CharSet", "utf8mb4"), + LastUpdatedAt = table.Column(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"), + LastUpdateUserId = table.Column(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด") + .Annotation("MySql:CharSet", "utf8mb4"), + CreatedFullName = table.Column(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล") + .Annotation("MySql:CharSet", "utf8mb4"), + LastUpdateFullName = table.Column(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด") + .Annotation("MySql:CharSet", "utf8mb4"), + DocumentId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + DisciplineDisciplinaryId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") + }, + constraints: table => + { + table.PrimaryKey("PK_DisciplineDisciplinary_DocRecordAccusers", x => x.Id); + table.ForeignKey( + name: "FK_DisciplineDisciplinary_DocRecordAccusers_DisciplineDisciplin~", + column: x => x.DisciplineDisciplinaryId, + principalTable: "DisciplineDisciplinarys", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_DisciplineDisciplinary_DocRecordAccusers_Documents_DocumentId", + column: x => x.DocumentId, + principalTable: "Documents", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "DisciplineDisciplinary_DocSummaryEvidences", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + CreatedAt = table.Column(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), + CreatedUserId = table.Column(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล") + .Annotation("MySql:CharSet", "utf8mb4"), + LastUpdatedAt = table.Column(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"), + LastUpdateUserId = table.Column(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด") + .Annotation("MySql:CharSet", "utf8mb4"), + CreatedFullName = table.Column(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล") + .Annotation("MySql:CharSet", "utf8mb4"), + LastUpdateFullName = table.Column(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด") + .Annotation("MySql:CharSet", "utf8mb4"), + DocumentId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + DisciplineDisciplinaryId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") + }, + constraints: table => + { + table.PrimaryKey("PK_DisciplineDisciplinary_DocSummaryEvidences", x => x.Id); + table.ForeignKey( + name: "FK_DisciplineDisciplinary_DocSummaryEvidences_DisciplineDiscipl~", + column: x => x.DisciplineDisciplinaryId, + principalTable: "DisciplineDisciplinarys", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_DisciplineDisciplinary_DocSummaryEvidences_Documents_Documen~", + column: x => x.DocumentId, + principalTable: "Documents", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "DisciplineDisciplinary_DocWitnessess", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), + CreatedAt = table.Column(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), + CreatedUserId = table.Column(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล") + .Annotation("MySql:CharSet", "utf8mb4"), + LastUpdatedAt = table.Column(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"), + LastUpdateUserId = table.Column(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด") + .Annotation("MySql:CharSet", "utf8mb4"), + CreatedFullName = table.Column(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล") + .Annotation("MySql:CharSet", "utf8mb4"), + LastUpdateFullName = table.Column(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด") + .Annotation("MySql:CharSet", "utf8mb4"), + DocumentId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + DisciplineDisciplinaryId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") + }, + constraints: table => + { + table.PrimaryKey("PK_DisciplineDisciplinary_DocWitnessess", x => x.Id); + table.ForeignKey( + name: "FK_DisciplineDisciplinary_DocWitnessess_DisciplineDisciplinarys~", + column: x => x.DisciplineDisciplinaryId, + principalTable: "DisciplineDisciplinarys", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_DisciplineDisciplinary_DocWitnessess_Documents_DocumentId", + column: x => x.DocumentId, + principalTable: "Documents", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineDisciplinary_DocOthers_DisciplineDisciplinaryId", + table: "DisciplineDisciplinary_DocOthers", + column: "DisciplineDisciplinaryId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineDisciplinary_DocOthers_DocumentId", + table: "DisciplineDisciplinary_DocOthers", + column: "DocumentId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineDisciplinary_DocRecordAccusers_DisciplineDisciplin~", + table: "DisciplineDisciplinary_DocRecordAccusers", + column: "DisciplineDisciplinaryId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineDisciplinary_DocRecordAccusers_DocumentId", + table: "DisciplineDisciplinary_DocRecordAccusers", + column: "DocumentId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineDisciplinary_DocSummaryEvidences_DisciplineDiscipl~", + table: "DisciplineDisciplinary_DocSummaryEvidences", + column: "DisciplineDisciplinaryId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineDisciplinary_DocSummaryEvidences_DocumentId", + table: "DisciplineDisciplinary_DocSummaryEvidences", + column: "DocumentId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineDisciplinary_DocWitnessess_DisciplineDisciplinaryId", + table: "DisciplineDisciplinary_DocWitnessess", + column: "DisciplineDisciplinaryId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineDisciplinary_DocWitnessess_DocumentId", + table: "DisciplineDisciplinary_DocWitnessess", + column: "DocumentId"); + + migrationBuilder.AddForeignKey( + name: "FK_DisciplineDisciplinary_DirectorInvestigates_DisciplineDiscip~", + table: "DisciplineDisciplinary_DirectorInvestigates", + column: "DisciplineDisciplinaryId", + principalTable: "DisciplineDisciplinarys", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "FK_DisciplineDisciplinary_DocComplaintInvestigates_DisciplineDi~", + table: "DisciplineDisciplinary_DocComplaintInvestigates", + column: "DisciplineDisciplinaryId", + principalTable: "DisciplineDisciplinarys", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "FK_DisciplineDisciplinary_DocInvestigateRelevants_DisciplineDis~", + table: "DisciplineDisciplinary_DocInvestigateRelevants", + column: "DisciplineDisciplinaryId", + principalTable: "DisciplineDisciplinarys", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "FK_DisciplineDisciplinary_DocInvestigates_DisciplineDisciplinar~", + table: "DisciplineDisciplinary_DocInvestigates", + column: "DisciplineDisciplinaryId", + principalTable: "DisciplineDisciplinarys", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "FK_DisciplineDisciplinary_ProfileComplaintInvestigates_Discipli~", + table: "DisciplineDisciplinary_ProfileComplaintInvestigates", + column: "DisciplineDisciplinaryId", + principalTable: "DisciplineDisciplinarys", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "FK_DisciplineDisciplinarys_DisciplineInvestigates_DisciplineInv~", + table: "DisciplineDisciplinarys", + column: "DisciplineInvestigateId", + principalTable: "DisciplineInvestigates", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_DisciplineDisciplinary_DirectorInvestigates_DisciplineDiscip~", + table: "DisciplineDisciplinary_DirectorInvestigates"); + + migrationBuilder.DropForeignKey( + name: "FK_DisciplineDisciplinary_DocComplaintInvestigates_DisciplineDi~", + table: "DisciplineDisciplinary_DocComplaintInvestigates"); + + migrationBuilder.DropForeignKey( + name: "FK_DisciplineDisciplinary_DocInvestigateRelevants_DisciplineDis~", + table: "DisciplineDisciplinary_DocInvestigateRelevants"); + + migrationBuilder.DropForeignKey( + name: "FK_DisciplineDisciplinary_DocInvestigates_DisciplineDisciplinar~", + table: "DisciplineDisciplinary_DocInvestigates"); + + migrationBuilder.DropForeignKey( + name: "FK_DisciplineDisciplinary_ProfileComplaintInvestigates_Discipli~", + table: "DisciplineDisciplinary_ProfileComplaintInvestigates"); + + migrationBuilder.DropForeignKey( + name: "FK_DisciplineDisciplinarys_DisciplineInvestigates_DisciplineInv~", + table: "DisciplineDisciplinarys"); + + migrationBuilder.DropTable( + name: "DisciplineDisciplinary_DocOthers"); + + migrationBuilder.DropTable( + name: "DisciplineDisciplinary_DocRecordAccusers"); + + migrationBuilder.DropTable( + name: "DisciplineDisciplinary_DocSummaryEvidences"); + + migrationBuilder.DropTable( + name: "DisciplineDisciplinary_DocWitnessess"); + + migrationBuilder.DropColumn( + name: "DisciplinaryCaseFault", + table: "DisciplineDisciplinarys"); + + migrationBuilder.DropColumn( + name: "DisciplinaryDateAllegation", + table: "DisciplineDisciplinarys"); + + migrationBuilder.DropColumn( + name: "DisciplinaryDateEvident", + table: "DisciplineDisciplinarys"); + + migrationBuilder.DropColumn( + name: "DisciplinaryFaultLevel", + table: "DisciplineDisciplinarys"); + + migrationBuilder.DropColumn( + name: "DisciplinaryInvestigateAt", + table: "DisciplineDisciplinarys"); + + migrationBuilder.DropColumn( + name: "DisciplinaryRecordAccuser", + table: "DisciplineDisciplinarys"); + + migrationBuilder.DropColumn( + name: "DisciplinaryRefLaw", + table: "DisciplineDisciplinarys"); + + migrationBuilder.DropColumn( + name: "DisciplinarySummaryEvidence", + table: "DisciplineDisciplinarys"); + + migrationBuilder.DropColumn( + name: "DisciplinaryWitnesses", + table: "DisciplineDisciplinarys"); + + migrationBuilder.DropColumn( + name: "ResultInvestigate", + table: "DisciplineDisciplinarys"); + + migrationBuilder.RenameColumn( + name: "DisciplineInvestigateId", + table: "DisciplineDisciplinarys", + newName: "DisciplineComplaintId"); + + migrationBuilder.RenameIndex( + name: "IX_DisciplineDisciplinarys_DisciplineInvestigateId", + table: "DisciplineDisciplinarys", + newName: "IX_DisciplineDisciplinarys_DisciplineComplaintId"); + + migrationBuilder.RenameColumn( + name: "DisciplineDisciplinaryId", + table: "DisciplineDisciplinary_ProfileComplaintInvestigates", + newName: "DisciplineInvestigateId"); + + migrationBuilder.RenameColumn( + name: "DisciplineDisciplinaryId", + table: "DisciplineDisciplinary_DocInvestigates", + newName: "DisciplineInvestigateId"); + + migrationBuilder.RenameIndex( + name: "IX_DisciplineDisciplinary_DocInvestigates_DisciplineDisciplinar~", + table: "DisciplineDisciplinary_DocInvestigates", + newName: "IX_DisciplineDisciplinary_DocInvestigates_DisciplineInvestigate~"); + + migrationBuilder.RenameColumn( + name: "DisciplineDisciplinaryId", + table: "DisciplineDisciplinary_DocInvestigateRelevants", + newName: "DisciplineInvestigateId"); + + migrationBuilder.RenameIndex( + name: "IX_DisciplineDisciplinary_DocInvestigateRelevants_DisciplineDis~", + table: "DisciplineDisciplinary_DocInvestigateRelevants", + newName: "IX_DisciplineDisciplinary_DocInvestigateRelevants_DisciplineInv~"); + + migrationBuilder.RenameColumn( + name: "DisciplineDisciplinaryId", + table: "DisciplineDisciplinary_DocComplaintInvestigates", + newName: "DisciplineInvestigateId"); + + migrationBuilder.RenameIndex( + name: "IX_DisciplineDisciplinary_DocComplaintInvestigates_DisciplineDi~", + table: "DisciplineDisciplinary_DocComplaintInvestigates", + newName: "IX_DisciplineDisciplinary_DocComplaintInvestigates_DisciplineIn~"); + + migrationBuilder.RenameColumn( + name: "DisciplineDisciplinaryId", + table: "DisciplineDisciplinary_DirectorInvestigates", + newName: "DisciplineInvestigateId"); + + migrationBuilder.RenameIndex( + name: "IX_DisciplineDisciplinary_DirectorInvestigates_DisciplineDiscip~", + table: "DisciplineDisciplinary_DirectorInvestigates", + newName: "IX_DisciplineDisciplinary_DirectorInvestigates_DisciplineInvest~"); + + migrationBuilder.AddColumn( + name: "DisciplineDisciplinaryId", + table: "DisciplineInvestigateRelevant_Docs", + type: "char(36)", + nullable: true, + collation: "ascii_general_ci"); + + migrationBuilder.AddColumn( + name: "DisciplineDisciplinaryId", + table: "DisciplineInvestigate_ProfileComplaints", + type: "char(36)", + nullable: true, + collation: "ascii_general_ci"); + + migrationBuilder.AddColumn( + name: "DisciplineDisciplinaryId", + table: "DisciplineInvestigate_Docs", + type: "char(36)", + nullable: true, + collation: "ascii_general_ci"); + + migrationBuilder.AddColumn( + name: "DisciplineDisciplinaryId", + table: "DisciplineInvestigate_DocComplaints", + type: "char(36)", + nullable: true, + collation: "ascii_general_ci"); + + migrationBuilder.AddColumn( + name: "DisciplineDisciplinaryId", + table: "DisciplineInvestigate_Directors", + type: "char(36)", + nullable: true, + collation: "ascii_general_ci"); + + migrationBuilder.AlterColumn( + name: "InvestigationStatusResult", + table: "DisciplineDisciplinarys", + type: "longtext", + nullable: true, + comment: "สถานะหรือผลการสืบสวน (not_specified คือ ยังไม่ระบุ, have_cause คือ มีมูล, no_cause คือ ไม่มีมูล", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "สถานะหรือผลการสืบสวน (NOT_SPECIFIED คือ ยังไม่ระบุ, HAVE_CAUSE คือ มีมูล, NO_CAUSE คือ ไม่มีมูล") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "InvestigationDetail", + table: "DisciplineDisciplinarys", + type: "longtext", + nullable: true, + comment: "ลักษณะการสืบสวน (appoint_directors คือ แต่งตั้งกรรมการสืบสวน, secret_investigation คือ สืบสวนทางลับ, other คือ อื่น ๆ)", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "ลักษณะการสืบสวน (APPOINT_DIRECTORS คือ แต่งตั้งกรรมการสืบสวน, SECRET_INVESTIGATION คือ สืบสวนทางลับ, OTHER คือ อื่น ๆ)") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineInvestigateRelevant_Docs_DisciplineDisciplinaryId", + table: "DisciplineInvestigateRelevant_Docs", + column: "DisciplineDisciplinaryId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineInvestigate_ProfileComplaints_DisciplineDisciplina~", + table: "DisciplineInvestigate_ProfileComplaints", + column: "DisciplineDisciplinaryId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineInvestigate_Docs_DisciplineDisciplinaryId", + table: "DisciplineInvestigate_Docs", + column: "DisciplineDisciplinaryId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineInvestigate_DocComplaints_DisciplineDisciplinaryId", + table: "DisciplineInvestigate_DocComplaints", + column: "DisciplineDisciplinaryId"); + + migrationBuilder.CreateIndex( + name: "IX_DisciplineInvestigate_Directors_DisciplineDisciplinaryId", + table: "DisciplineInvestigate_Directors", + column: "DisciplineDisciplinaryId"); + + migrationBuilder.AddForeignKey( + name: "FK_DisciplineDisciplinary_DirectorInvestigates_DisciplineInvest~", + table: "DisciplineDisciplinary_DirectorInvestigates", + column: "DisciplineInvestigateId", + principalTable: "DisciplineInvestigates", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "FK_DisciplineDisciplinary_DocComplaintInvestigates_DisciplineIn~", + table: "DisciplineDisciplinary_DocComplaintInvestigates", + column: "DisciplineInvestigateId", + principalTable: "DisciplineInvestigates", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "FK_DisciplineDisciplinary_DocInvestigateRelevants_DisciplineInv~", + table: "DisciplineDisciplinary_DocInvestigateRelevants", + column: "DisciplineInvestigateId", + principalTable: "DisciplineInvestigates", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "FK_DisciplineDisciplinary_DocInvestigates_DisciplineInvestigate~", + table: "DisciplineDisciplinary_DocInvestigates", + column: "DisciplineInvestigateId", + principalTable: "DisciplineInvestigates", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "FK_DisciplineDisciplinary_ProfileComplaintInvestigates_Discipli~", + table: "DisciplineDisciplinary_ProfileComplaintInvestigates", + column: "DisciplineInvestigateId", + principalTable: "DisciplineInvestigates", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "FK_DisciplineDisciplinarys_DisciplineComplaints_DisciplineCompl~", + table: "DisciplineDisciplinarys", + column: "DisciplineComplaintId", + principalTable: "DisciplineComplaints", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "FK_DisciplineInvestigate_Directors_DisciplineDisciplinarys_Disc~", + table: "DisciplineInvestigate_Directors", + column: "DisciplineDisciplinaryId", + principalTable: "DisciplineDisciplinarys", + principalColumn: "Id"); + + migrationBuilder.AddForeignKey( + name: "FK_DisciplineInvestigate_DocComplaints_DisciplineDisciplinarys_~", + table: "DisciplineInvestigate_DocComplaints", + column: "DisciplineDisciplinaryId", + principalTable: "DisciplineDisciplinarys", + principalColumn: "Id"); + + migrationBuilder.AddForeignKey( + name: "FK_DisciplineInvestigate_Docs_DisciplineDisciplinarys_Disciplin~", + table: "DisciplineInvestigate_Docs", + column: "DisciplineDisciplinaryId", + principalTable: "DisciplineDisciplinarys", + principalColumn: "Id"); + + migrationBuilder.AddForeignKey( + name: "FK_DisciplineInvestigate_ProfileComplaints_DisciplineDisciplina~", + table: "DisciplineInvestigate_ProfileComplaints", + column: "DisciplineDisciplinaryId", + principalTable: "DisciplineDisciplinarys", + principalColumn: "Id"); + + migrationBuilder.AddForeignKey( + name: "FK_DisciplineInvestigateRelevant_Docs_DisciplineDisciplinarys_D~", + table: "DisciplineInvestigateRelevant_Docs", + column: "DisciplineDisciplinaryId", + principalTable: "DisciplineDisciplinarys", + principalColumn: "Id"); + } + } +} diff --git a/BMA.EHR.Infrastructure/Migrations/DisciplineDb/20231124032627_add table DisciplineDisciplinary_DocWitnessess.Designer.cs b/BMA.EHR.Infrastructure/Migrations/DisciplineDb/20231124032627_add table DisciplineDisciplinary_DocWitnessess.Designer.cs new file mode 100644 index 00000000..b199280d --- /dev/null +++ b/BMA.EHR.Infrastructure/Migrations/DisciplineDb/20231124032627_add table DisciplineDisciplinary_DocWitnessess.Designer.cs @@ -0,0 +1,10985 @@ +// +using System; +using BMA.EHR.Infrastructure.Persistence; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb +{ + [DbContext(typeof(DisciplineDbContext))] + [Migration("20231124032627_add table DisciplineDisciplinary_DocWitnessess")] + partial class addtableDisciplineDisciplinary_DocWitnessess + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "7.0.9") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("Appellant") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ผู้ร้องเรียน"); + + b.Property("ComplaintFrom") + .IsRequired() + .HasColumnType("longtext") + .HasComment("รับเรื่องร้องเรียนจาก ระบุว่ารับเรื่องมาจากใคร/หน่วยงานไหน (สตง., ปปช., ปปท., จดหมาย, อีเมล, โทรศัพท์, บอกกล่าว)"); + + b.Property("ConsideredAgency") + .HasColumnType("char(36)") + .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("DateConsideration") + .HasColumnType("datetime(6)") + .HasComment("วันที่กำหนดพิจารณา"); + + b.Property("DateNotification") + .HasColumnType("datetime(6)") + .HasComment("วันแจ้งเตือนล่วงหน้า"); + + b.Property("DateReceived") + .HasColumnType("datetime(6)") + .HasComment("วันที่รับเรื่อง เป็นวันที่ถือเป็นจุดเริ่มต้นของวินัยนั้น ๆ"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text") + .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("LevelConsideration") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ระดับการพิจารณา 'ยังไม่ระบุ' (NORMAL คือ ปกติ, URGENT คือ ด่วน, VERY_URGENT คือ ด่วนมาก)"); + + b.Property("OffenseDetails") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ลักษณะความผิดครั้งแรกจะเป็น 'ยังไม่ระบุ' (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง)"); + + b.Property("Organization") + .HasColumnType("char(36)") + .HasComment("กรณีหน่วยงานใส่ id ของหน่วยงาน"); + + b.Property("RespondentType") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ผู้ถูกร้องเรียน (PERSON คือ บุคคล, ORGANIZATION คือ หน่วยงาน, BANGKOK คือ กรุงเทพมหานคร)"); + + b.Property("Result") + .HasColumnType("longtext") + .HasComment("ผลการตรวจสอบ"); + + b.Property("Status") + .IsRequired() + .HasColumnType("longtext") + .HasComment("สถานะเรื่องร้องเรียน มีดังนี้ ใหม่ (NEW), ยุติเรื่อง (STOP), มีมูลส่งไปสืบสวนแล้ว (SEND_INVESTIGATE)"); + + b.Property("Title") + .IsRequired() + .HasColumnType("text") + .HasComment("เรื่องที่ร้องเรียน"); + + b.HasKey("Id"); + + b.ToTable("DisciplineComplaints"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Channel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Name") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ชื่อประเภทการร้องเรียน"); + + b.HasKey("Id"); + + b.ToTable("DisciplineComplaint_Channels"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Doc", 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("DisciplineComplaintId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineComplaintId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineComplaint_Docs"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Profile", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CitizenId") + .HasMaxLength(13) + .HasColumnType("varchar(13)") + .HasComment("รหัสบัตรประชาชน"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineComplaintId") + .HasColumnType("char(36)"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("ชื่อ"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .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("Organization") + .HasColumnType("longtext") + .HasComment("สังกัด"); + + b.Property("PersonId") + .HasColumnType("char(36)") + .HasComment("id อ้างอิง profile"); + + b.Property("PosNo") + .HasColumnType("longtext") + .HasComment("เลขที่ตำแหน่ง"); + + b.Property("Position") + .HasColumnType("longtext") + .HasComment("ตำแหน่ง"); + + b.Property("PositionLevel") + .HasColumnType("longtext") + .HasComment("ระดับ"); + + b.Property("Prefix") + .HasColumnType("longtext") + .HasComment("คำนำหน้า"); + + b.Property("Salary") + .HasColumnType("double") + .HasComment("เงินเดือน"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineComplaintId"); + + b.ToTable("DisciplineComplaint_Profiles"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDirector", 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("Email") + .IsRequired() + .HasColumnType("longtext") + .HasComment("อีเมล"); + + b.Property("FirstName") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ชื่อ"); + + b.Property("LastName") + .IsRequired() + .HasColumnType("longtext") + .HasComment("นามสกุล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Phone") + .IsRequired() + .HasColumnType("longtext") + .HasComment("เบอร์โทรศัพท์"); + + b.Property("Position") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ตำแหน่ง"); + + b.Property("Prefix") + .IsRequired() + .HasColumnType("longtext") + .HasComment("คำนำหน้าชื่อ"); + + b.HasKey("Id"); + + b.ToTable("DisciplineDirectors"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("Appellant") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ผู้ร้องเรียน"); + + b.Property("ComplaintFrom") + .IsRequired() + .HasColumnType("longtext") + .HasComment("รับเรื่องร้องเรียนจาก ระบุว่ารับเรื่องมาจากใคร/หน่วยงานไหน (สตง., ปปช., ปปท., จดหมาย, อีเมล, โทรศัพท์, บอกกล่าว)"); + + b.Property("ConsideredAgency") + .HasColumnType("char(36)") + .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("DateConsideration") + .HasColumnType("datetime(6)") + .HasComment("วันที่กำหนดพิจารณา"); + + b.Property("DateNotification") + .HasColumnType("datetime(6)") + .HasComment("วันแจ้งเตือนล่วงหน้า"); + + b.Property("DateReceived") + .HasColumnType("datetime(6)") + .HasComment("วันที่รับเรื่อง เป็นวันที่ถือเป็นจุดเริ่มต้นของวินัยนั้น ๆ"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text") + .HasComment("รายละเอียดของเรื่องร้องเรียน"); + + b.Property("DisciplinaryCaseFault") + .HasColumnType("longtext") + .HasComment("กรณีความผิด"); + + b.Property("DisciplinaryDateAllegation") + .HasColumnType("datetime(6)") + .HasComment("วันที่รับทราบข้อกล่าวหา"); + + b.Property("DisciplinaryDateEvident") + .HasColumnType("datetime(6)") + .HasComment("วันที่สรุปพยานหลักฐาน"); + + b.Property("DisciplinaryFaultLevel") + .HasColumnType("longtext") + .HasComment("ระดับโทษความผิด กรณีไม่ร้ายแรง: ภาคทัณฑ์, ตัดเงินเดือน, ลดขั้นเงินเดือน | กรณีร้ายแรง: ปลดออก, ไล่ออก"); + + b.Property("DisciplinaryInvestigateAt") + .HasColumnType("longtext") + .HasComment("สอบสวนที่"); + + b.Property("DisciplinaryRecordAccuser") + .HasColumnType("longtext") + .HasComment("บันทึกถ้อยคำของผู้กล่าวหา"); + + b.Property("DisciplinaryRefLaw") + .HasColumnType("longtext") + .HasComment("อ้างอิงมาตราตามกฎหมาย"); + + b.Property("DisciplinarySummaryEvidence") + .HasColumnType("longtext") + .HasComment("สรุปพยานหลักฐานสนับสนุนข้อกล่าวหา"); + + b.Property("DisciplinaryWitnesses") + .HasColumnType("longtext") + .HasComment("พยานและบันทึกถ้อยคำพยาน"); + + b.Property("DisciplineInvestigateId") + .HasColumnType("char(36)"); + + b.Property("InvestigationCauseText") + .HasColumnType("longtext") + .HasComment("กรณีมีมูลต้องเลือกว่า 'ร้ายแรง' หรือ 'ไม่ร้ายแรง'"); + + b.Property("InvestigationDateEnd") + .HasColumnType("datetime(6)") + .HasComment("วันที่สิ้นสุดการสืบสวน"); + + b.Property("InvestigationDateStart") + .HasColumnType("datetime(6)") + .HasComment("วันที่เริ่มการสืบสวน"); + + b.Property("InvestigationDescription") + .HasColumnType("longtext") + .HasComment("รายละเอียดเกี่ยวกับการสืบสวน"); + + b.Property("InvestigationDetail") + .HasColumnType("longtext") + .HasComment("ลักษณะการสืบสวน (APPOINT_DIRECTORS คือ แต่งตั้งกรรมการสืบสวน, SECRET_INVESTIGATION คือ สืบสวนทางลับ, OTHER คือ อื่น ๆ)"); + + b.Property("InvestigationDetailOther") + .HasColumnType("longtext") + .HasComment("ลักษณะการสืบสวนกรณีเลือกอื่นๆ"); + + b.Property("InvestigationStatusResult") + .HasColumnType("longtext") + .HasComment("สถานะหรือผลการสืบสวน (NOT_SPECIFIED คือ ยังไม่ระบุ, HAVE_CAUSE คือ มีมูล, NO_CAUSE คือ ไม่มีมูล"); + + 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("LevelConsideration") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ระดับการพิจารณา 'ยังไม่ระบุ' (NORMAL คือ ปกติ, URGENT คือ ด่วน, VERY_URGENT คือ ด่วนมาก)"); + + b.Property("OffenseDetails") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ลักษณะความผิดครั้งแรกจะเป็น 'ยังไม่ระบุ' (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง)"); + + b.Property("Organization") + .HasColumnType("char(36)") + .HasComment("กรณีหน่วยงานใส่ id ของหน่วยงาน"); + + b.Property("RespondentType") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ผู้ถูกร้องเรียน (PERSON คือ บุคคล, ORGANIZATION คือ หน่วยงาน, BANGKOK คือ กรุงเทพมหานคร)"); + + b.Property("Result") + .HasColumnType("longtext") + .HasComment("ผลการตรวจสอบ"); + + b.Property("ResultComplaint") + .HasColumnType("longtext") + .HasComment("ผลการตรวจสอบเรื่องร้องเรียน"); + + b.Property("ResultInvestigate") + .HasColumnType("longtext") + .HasComment("ผลการตรวจสอบเรื่องสืบสวน"); + + b.Property("Status") + .IsRequired() + .HasColumnType("longtext") + .HasComment("สถานะเรื่องร้องเรียน มีดังนี้ ใหม่ (NEW), ยุติเรื่อง (STOP), มีมูลส่งไปสืบสวนแล้ว (SEND_INVESTIGATE)"); + + b.Property("Title") + .IsRequired() + .HasColumnType("text") + .HasComment("เรื่องที่ร้องเรียน"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineInvestigateId"); + + b.ToTable("DisciplineDisciplinarys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DirectorInvestigate", 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("DisciplineDirectorId") + .HasColumnType("char(36)"); + + b.Property("DisciplineDisciplinaryId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDirectorId"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.ToTable("DisciplineDisciplinary_DirectorInvestigates"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocComplaintInvestigate", 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("DisciplineDisciplinaryId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineDisciplinary_DocComplaintInvestigates"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocInvestigate", 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("DisciplineDisciplinaryId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineDisciplinary_DocInvestigates"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocInvestigateRelevant", 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("DisciplineDisciplinaryId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineDisciplinary_DocInvestigateRelevants"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocOther", 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("DisciplineDisciplinaryId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineDisciplinary_DocOthers"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocRecordAccuser", 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("DisciplineDisciplinaryId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineDisciplinary_DocRecordAccusers"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocSummaryEvidence", 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("DisciplineDisciplinaryId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineDisciplinary_DocSummaryEvidences"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocWitnesses", 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("DisciplineDisciplinaryId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineDisciplinary_DocWitnessess"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_ProfileComplaintInvestigate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CitizenId") + .HasMaxLength(13) + .HasColumnType("varchar(13)") + .HasComment("รหัสบัตรประชาชน"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineDisciplinaryId") + .HasColumnType("char(36)"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("ชื่อ"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .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("Organization") + .HasColumnType("longtext") + .HasComment("สังกัด"); + + b.Property("PersonId") + .HasColumnType("char(36)") + .HasComment("id อ้างอิง profile"); + + b.Property("PosNo") + .HasColumnType("longtext") + .HasComment("เลขที่ตำแหน่ง"); + + b.Property("Position") + .HasColumnType("longtext") + .HasComment("ตำแหน่ง"); + + b.Property("PositionLevel") + .HasColumnType("longtext") + .HasComment("ระดับ"); + + b.Property("Prefix") + .HasColumnType("longtext") + .HasComment("คำนำหน้า"); + + b.Property("Salary") + .HasColumnType("double") + .HasComment("เงินเดือน"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.ToTable("DisciplineDisciplinary_ProfileComplaintInvestigates"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("Appellant") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ผู้ร้องเรียน"); + + b.Property("ComplaintFrom") + .IsRequired() + .HasColumnType("longtext") + .HasComment("รับเรื่องร้องเรียนจาก ระบุว่ารับเรื่องมาจากใคร/หน่วยงานไหน (สตง., ปปช., ปปท., จดหมาย, อีเมล, โทรศัพท์, บอกกล่าว)"); + + b.Property("ConsideredAgency") + .HasColumnType("char(36)") + .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("DateConsideration") + .HasColumnType("datetime(6)") + .HasComment("วันที่กำหนดพิจารณา"); + + b.Property("DateNotification") + .HasColumnType("datetime(6)") + .HasComment("วันแจ้งเตือนล่วงหน้า"); + + b.Property("DateReceived") + .HasColumnType("datetime(6)") + .HasComment("วันที่รับเรื่อง เป็นวันที่ถือเป็นจุดเริ่มต้นของวินัยนั้น ๆ"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text") + .HasComment("รายละเอียดของเรื่องร้องเรียน"); + + b.Property("DisciplineComplaintId") + .HasColumnType("char(36)"); + + b.Property("InvestigationCauseText") + .HasColumnType("longtext") + .HasComment("กรณีมีมูลต้องเลือกว่า 'ร้ายแรง' หรือ 'ไม่ร้ายแรง'"); + + b.Property("InvestigationDateEnd") + .HasColumnType("datetime(6)") + .HasComment("วันที่สิ้นสุดการสืบสวน"); + + b.Property("InvestigationDateStart") + .HasColumnType("datetime(6)") + .HasComment("วันที่เริ่มการสืบสวน"); + + b.Property("InvestigationDescription") + .HasColumnType("longtext") + .HasComment("รายละเอียดเกี่ยวกับการสืบสวน"); + + b.Property("InvestigationDetail") + .HasColumnType("longtext") + .HasComment("ลักษณะการสืบสวน (appoint_directors คือ แต่งตั้งกรรมการสืบสวน, secret_investigation คือ สืบสวนทางลับ, other คือ อื่น ๆ)"); + + b.Property("InvestigationDetailOther") + .HasColumnType("longtext") + .HasComment("ลักษณะการสืบสวนกรณีเลือกอื่นๆ"); + + b.Property("InvestigationStatusResult") + .HasColumnType("longtext") + .HasComment("สถานะหรือผลการสืบสวน (not_specified คือ ยังไม่ระบุ, have_cause คือ มีมูล, no_cause คือ ไม่มีมูล"); + + 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("LevelConsideration") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ระดับการพิจารณา 'ยังไม่ระบุ' (NORMAL คือ ปกติ, URGENT คือ ด่วน, VERY_URGENT คือ ด่วนมาก)"); + + b.Property("OffenseDetails") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ลักษณะความผิดครั้งแรกจะเป็น 'ยังไม่ระบุ' (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง)"); + + b.Property("Organization") + .HasColumnType("char(36)") + .HasComment("กรณีหน่วยงานใส่ id ของหน่วยงาน"); + + b.Property("RespondentType") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ผู้ถูกร้องเรียน (PERSON คือ บุคคล, ORGANIZATION คือ หน่วยงาน, BANGKOK คือ กรุงเทพมหานคร)"); + + b.Property("Result") + .HasColumnType("longtext") + .HasComment("ผลการตรวจสอบ"); + + b.Property("ResultComplaint") + .HasColumnType("longtext") + .HasComment("ผลการตรวจสอบเรื่องร้องเรียน"); + + b.Property("Status") + .IsRequired() + .HasColumnType("longtext") + .HasComment("สถานะเรื่องร้องเรียน มีดังนี้ ใหม่ (NEW), ยุติเรื่อง (STOP), มีมูลส่งไปสืบสวนแล้ว (SEND_INVESTIGATE)"); + + b.Property("Title") + .IsRequired() + .HasColumnType("text") + .HasComment("เรื่องที่ร้องเรียน"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineComplaintId"); + + b.ToTable("DisciplineInvestigates"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigateRelevant_Doc", 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("DisciplineInvestigateId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineInvestigateId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineInvestigateRelevant_Docs"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_Director", 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("DisciplineDirectorId") + .HasColumnType("char(36)"); + + b.Property("DisciplineInvestigateId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDirectorId"); + + b.HasIndex("DisciplineInvestigateId"); + + b.ToTable("DisciplineInvestigate_Directors"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_Doc", 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("DisciplineInvestigateId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineInvestigateId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineInvestigate_Docs"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_DocComplaint", 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("DisciplineInvestigateId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineInvestigateId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineInvestigate_DocComplaints"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_ProfileComplaint", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CitizenId") + .HasMaxLength(13) + .HasColumnType("varchar(13)") + .HasComment("รหัสบัตรประชาชน"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineInvestigateId") + .HasColumnType("char(36)"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("ชื่อ"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .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("Organization") + .HasColumnType("longtext") + .HasComment("สังกัด"); + + b.Property("PersonId") + .HasColumnType("char(36)") + .HasComment("id อ้างอิง profile"); + + b.Property("PosNo") + .HasColumnType("longtext") + .HasComment("เลขที่ตำแหน่ง"); + + b.Property("Position") + .HasColumnType("longtext") + .HasComment("ตำแหน่ง"); + + b.Property("PositionLevel") + .HasColumnType("longtext") + .HasComment("ระดับ"); + + b.Property("Prefix") + .HasColumnType("longtext") + .HasComment("คำนำหน้า"); + + b.Property("Salary") + .HasColumnType("double") + .HasComment("เงินเดือน"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineInvestigateId"); + + b.ToTable("DisciplineInvestigate_ProfileComplaints"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.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.Domain.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("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.LimitLeave", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Name") + .HasColumnType("longtext") + .HasComment("ยังไม่ชัวใช้อะไรเป็นkey"); + + b.HasKey("Id"); + + b.ToTable("LimitLeave"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.LimitTypeLeave", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("LimitLeaveId") + .HasColumnType("char(36)"); + + b.Property("NumLeave") + .HasColumnType("double") + .HasComment("จำนวนที่ลาได้"); + + b.Property("TypeLeaveId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("LimitLeaveId"); + + b.HasIndex("TypeLeaveId"); + + b.ToTable("LimitTypeLeave"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.Profile", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("Ability") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("AvatarId") + .HasColumnType("char(36)"); + + b.Property("AvatarRef") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("BirthDate") + .HasColumnType("datetime(6)") + .HasComment("วันเกิด"); + + b.Property("BloodGroupId") + .HasColumnType("char(36)") + .HasComment("Id กลุ่มเลือด"); + + b.Property("CitizenId") + .HasMaxLength(13) + .HasColumnType("varchar(13)") + .HasComment("รหัสบัตรประชาชน"); + + b.Property("Couple") + .HasColumnType("tinyint(1)") + .HasComment("คู่สมรส"); + + b.Property("CoupleCareer") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("อาชีพคู่สมรส"); + + b.Property("CoupleCitizenId") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("เลขที่บัตรประชาชนคู่สมรส"); + + b.Property("CoupleFirstName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("ชื่อคู่สมรส"); + + b.Property("CoupleLastName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("นามสกุลคู่สมรส"); + + b.Property("CoupleLastNameOld") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("นามสกุลคู่สมรส(เดิม)"); + + b.Property("CoupleLive") + .HasColumnType("tinyint(1)") + .HasComment("มีชีวิตคู่สมรส"); + + b.Property("CouplePrefixId") + .HasColumnType("char(36)") + .HasComment("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("CreatedUser") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("CurrentAddress") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("ที่อยู่ปัจจุบัน"); + + b.Property("CurrentDistrictId") + .HasColumnType("char(36)") + .HasComment("Id เขตปัจจุบัน"); + + b.Property("CurrentProvinceId") + .HasColumnType("char(36)") + .HasComment("Id จังหวัดปัจจุบัน"); + + b.Property("CurrentSubDistrictId") + .HasColumnType("char(36)") + .HasComment("Id แขวงปัจจุบัน"); + + b.Property("CurrentZipCode") + .HasMaxLength(5) + .HasColumnType("varchar(5)") + .HasComment("รหัสไปรษณีย์ปัจจุบัน"); + + b.Property("DateAppoint") + .HasColumnType("datetime(6)"); + + b.Property("DateRetire") + .HasColumnType("datetime(6)"); + + b.Property("DateStart") + .HasColumnType("datetime(6)"); + + b.Property("EmployeeClass") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("ประเภทลูกจ้าง"); + + b.Property("EmployeeMoneyAllowance") + .HasColumnType("double") + .HasComment("เงินช่วยเหลือค่าครองชีพชั่วคราว"); + + b.Property("EmployeeMoneyEmployee") + .HasColumnType("double") + .HasComment("เงินสมทบประกันสังคม(ลูกจ้าง)"); + + b.Property("EmployeeMoneyEmployer") + .HasColumnType("double") + .HasComment("เงินสมทบประกันสังคม(นายจ้าง)"); + + b.Property("EmployeeMoneyIncrease") + .HasColumnType("double") + .HasComment("เงินเพิ่มการครองชีพชั่วคราว"); + + b.Property("EmployeeOc") + .HasColumnType("longtext") + .HasComment("สังกัด"); + + b.Property("EmployeeType") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("ประเภทการจ้าง"); + + b.Property("EmployeeTypeIndividual") + .HasColumnType("longtext") + .HasComment("ประเภทบุคคล"); + + b.Property("EmployeeWage") + .HasColumnType("double") + .HasComment("ค่าจ้าง"); + + b.Property("EntryStatus") + .IsRequired() + .HasMaxLength(5) + .HasColumnType("varchar(5)"); + + b.Property("FatherCareer") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("อาชีพบิดา"); + + b.Property("FatherCitizenId") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("เลขที่บัตรประชาชนบิดา"); + + b.Property("FatherFirstName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("ชื่อบิดา"); + + b.Property("FatherLastName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("นามสกุลบิดา"); + + b.Property("FatherLive") + .HasColumnType("tinyint(1)") + .HasComment("มีชีวิตบิดา"); + + b.Property("FatherPrefixId") + .HasColumnType("char(36)") + .HasComment("Id คำนำหน้าบิดา"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("ชื่อ"); + + b.Property("FirstNameOld") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("ชื่อ(เดิม)"); + + b.Property("GenderId") + .HasColumnType("char(36)"); + + b.Property("GovAgeAbsent") + .HasColumnType("int"); + + b.Property("GovAgePlus") + .HasColumnType("int"); + + b.Property("GovernmentCode") + .HasColumnType("longtext"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("IsLeave") + .HasColumnType("tinyint(1)"); + + b.Property("IsProbation") + .HasColumnType("tinyint(1)"); + + b.Property("IsTransfer") + .HasColumnType("tinyint(1)"); + + b.Property("IsVerified") + .HasColumnType("tinyint(1)"); + + b.Property("KeycloakId") + .HasColumnType("char(36)"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("นามสกุล"); + + b.Property("LastNameOld") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .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("LeaveDate") + .HasColumnType("datetime(6)"); + + b.Property("LeaveDateOrder") + .HasColumnType("datetime(6)"); + + b.Property("LeaveDetail") + .HasColumnType("longtext"); + + b.Property("LeaveNumberOrder") + .HasColumnType("longtext"); + + b.Property("LeaveReason") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("LimitLeaveId") + .HasColumnType("char(36)"); + + b.Property("ModifiedDate") + .HasColumnType("datetime(6)"); + + b.Property("MotherCareer") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("อาชีพมารดา"); + + b.Property("MotherCitizenId") + .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("MotherLive") + .HasColumnType("tinyint(1)") + .HasComment("มีชีวิตมารดา"); + + b.Property("MotherPrefixId") + .HasColumnType("char(36)") + .HasComment("Id คำนำหน้ามารดา"); + + b.Property("Nationality") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("สัญชาติ"); + + b.Property("Oc") + .HasColumnType("longtext") + .HasComment("สังกัด"); + + b.Property("OcId") + .HasColumnType("char(36)") + .HasComment("Id สังกัด"); + + b.Property("OrganizationOrganization") + .HasColumnType("longtext"); + + b.Property("OrganizationOrganizationId") + .HasColumnType("char(36)"); + + b.Property("OrganizationShortName") + .HasColumnType("longtext"); + + b.Property("OrganizationShortNameId") + .HasColumnType("char(36)"); + + b.Property("Physical") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("สถานภาพทางกาย"); + + b.Property("PosNoEmployee") + .HasColumnType("longtext") + .HasComment("เลขที่ตำแหน่งลูกจ้าง"); + + b.Property("PosNoId") + .HasColumnType("char(36)"); + + b.Property("PositionEmployeeGroupId") + .HasColumnType("char(36)"); + + b.Property("PositionEmployeeLevelId") + .HasColumnType("char(36)"); + + b.Property("PositionEmployeeLineId") + .HasColumnType("char(36)"); + + b.Property("PositionEmployeePositionId") + .HasColumnType("char(36)"); + + b.Property("PositionEmployeePositionSideId") + .HasColumnType("char(36)"); + + b.Property("PositionExecutive") + .HasColumnType("longtext") + .HasComment("ตำแหน่งทางการบริหาร"); + + b.Property("PositionExecutiveId") + .HasColumnType("char(36)") + .HasComment("Id ตำแหน่งทางการบริหาร"); + + b.Property("PositionExecutiveSide") + .HasColumnType("longtext") + .HasComment("ด้านทางการบริหาร"); + + b.Property("PositionExecutiveSideId") + .HasColumnType("char(36)") + .HasComment("Id ด้านทางการบริหาร"); + + b.Property("PositionId") + .HasColumnType("char(36)"); + + b.Property("PositionLevelId") + .HasColumnType("char(36)"); + + b.Property("PositionLine") + .HasColumnType("longtext") + .HasComment("สายงาน"); + + b.Property("PositionLineId") + .HasColumnType("char(36)") + .HasComment("Id สายงาน"); + + b.Property("PositionPathSide") + .HasColumnType("longtext") + .HasComment("ด้าน/สาขา"); + + b.Property("PositionPathSideId") + .HasColumnType("char(36)") + .HasComment("Id ด้าน/สาขา"); + + b.Property("PositionTypeId") + .HasColumnType("char(36)"); + + b.Property("PrefixId") + .HasColumnType("char(36)"); + + b.Property("PrefixOldId") + .HasColumnType("char(36)") + .HasComment("Id คำนำหน้า(เดิม)"); + + b.Property("ProfileType") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("Race") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("เชื้อชาติ"); + + b.Property("ReasonSameDate") + .HasColumnType("longtext"); + + b.Property("RegistrationAddress") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("Id แขวงตามทะเบียนบ้าน"); + + b.Property("RegistrationDistrictId") + .HasColumnType("char(36)") + .HasComment("Id เขตตามทะเบียนบ้าน"); + + b.Property("RegistrationProvinceId") + .HasColumnType("char(36)") + .HasComment("Id จังหวัดตามทะเบียนบ้าน"); + + b.Property("RegistrationSame") + .HasColumnType("tinyint(1)") + .HasComment("ที่อยู่ปัจจุบันตรงกับที่อยู่ตามทะเบียนบ้านหรือไม่"); + + b.Property("RegistrationSubDistrictId") + .HasColumnType("char(36)") + .HasComment("แขวงตามทะเบียนบ้าน"); + + b.Property("RegistrationZipCode") + .HasMaxLength(5) + .HasColumnType("varchar(5)") + .HasComment("รหัสไปรษณีย์ตามทะเบียนบ้าน"); + + b.Property("RelationshipId") + .HasColumnType("char(36)") + .HasComment("Id สถานะภาพ"); + + b.Property("ReligionId") + .HasColumnType("char(36)") + .HasComment("Id ศาสนา"); + + b.Property("TelephoneNumber") + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasComment("เบอร์โทร"); + + b.Property("TransferDate") + .HasColumnType("datetime(6)"); + + b.Property("VerifiedDate") + .HasColumnType("datetime(6)"); + + b.Property("VerifiedUser") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.HasKey("Id"); + + b.HasIndex("AvatarId"); + + b.HasIndex("GenderId"); + + b.HasIndex("LimitLeaveId"); + + b.HasIndex("PosNoId"); + + b.HasIndex("PositionEmployeeGroupId"); + + b.HasIndex("PositionEmployeeLevelId"); + + b.HasIndex("PositionEmployeeLineId"); + + b.HasIndex("PositionEmployeePositionId"); + + b.HasIndex("PositionEmployeePositionSideId"); + + b.HasIndex("PositionId"); + + b.HasIndex("PositionLevelId"); + + b.HasIndex("PositionTypeId"); + + b.HasIndex("PrefixId"); + + b.ToTable("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAbility", 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("DateEnd") + .HasColumnType("datetime(6)") + .HasComment("วันที่สิ้นสุด"); + + b.Property("DateStart") + .HasColumnType("datetime(6)") + .HasComment("วันที่เริ่มต้น"); + + b.Property("Detail") + .HasColumnType("longtext") + .HasComment("รายละเอียด"); + + b.Property("Field") + .HasColumnType("longtext") + .HasComment("ด้าน"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.Property("Reference") + .HasColumnType("longtext") + .HasComment("เอกสารอ้างอิง"); + + b.Property("Remark") + .HasColumnType("longtext") + .HasComment("หมายเหตุ"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileAbility"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAbilityHistory", 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("DateEnd") + .HasColumnType("datetime(6)") + .HasComment("วันที่สิ้นสุด"); + + b.Property("DateStart") + .HasColumnType("datetime(6)") + .HasComment("วันที่เริ่มต้น"); + + b.Property("Detail") + .HasColumnType("longtext") + .HasComment("รายละเอียด"); + + b.Property("Field") + .HasColumnType("longtext") + .HasComment("ด้าน"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("ProfileAbilityId") + .HasColumnType("char(36)"); + + b.Property("Reference") + .HasColumnType("longtext") + .HasComment("เอกสารอ้างอิง"); + + b.Property("Remark") + .HasColumnType("longtext") + .HasComment("หมายเหตุ"); + + b.HasKey("Id"); + + b.HasIndex("ProfileAbilityId"); + + b.ToTable("ProfileAbilityHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAddressHistory", 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("CurrentAddress") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("ที่อยู่ปัจจุบัน"); + + b.Property("CurrentDistrict") + .HasColumnType("longtext") + .HasComment("เขตปัจจุบัน"); + + b.Property("CurrentDistrictId") + .HasColumnType("char(36)") + .HasComment("Id เขตปัจจุบัน"); + + b.Property("CurrentProvince") + .HasColumnType("longtext") + .HasComment("จังหวัดปัจจุบัน"); + + b.Property("CurrentProvinceId") + .HasColumnType("char(36)") + .HasComment("Id จังหวัดปัจจุบัน"); + + b.Property("CurrentSubDistrict") + .HasColumnType("longtext") + .HasComment("แขวงปัจจุบัน"); + + b.Property("CurrentSubDistrictId") + .HasColumnType("char(36)") + .HasComment("Id แขวงปัจจุบัน"); + + b.Property("CurrentZipCode") + .HasMaxLength(5) + .HasColumnType("varchar(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("ProfileId") + .HasColumnType("char(36)"); + + b.Property("RegistrationAddress") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("ที่อยู่ตามทะเบียนบ้าน"); + + b.Property("RegistrationDistrict") + .HasColumnType("longtext") + .HasComment("เขตตามทะเบียนบ้าน"); + + b.Property("RegistrationDistrictId") + .HasColumnType("char(36)") + .HasComment("Id เขตตามทะเบียนบ้าน"); + + b.Property("RegistrationProvince") + .HasColumnType("longtext") + .HasComment("จังหวัดตามทะเบียนบ้าน"); + + b.Property("RegistrationProvinceId") + .HasColumnType("char(36)") + .HasComment("Id จังหวัดตามทะเบียนบ้าน"); + + b.Property("RegistrationSame") + .HasColumnType("tinyint(1)") + .HasComment("ที่อยู่ปัจจุบันตรงกับที่อยู่ตามทะเบียนบ้านหรือไม่"); + + b.Property("RegistrationSubDistrict") + .HasColumnType("longtext") + .HasComment("แขวงตามทะเบียนบ้าน"); + + b.Property("RegistrationSubDistrictId") + .HasColumnType("char(36)") + .HasComment("Id แขวงตามทะเบียนบ้าน"); + + b.Property("RegistrationZipCode") + .HasMaxLength(5) + .HasColumnType("varchar(5)") + .HasComment("รหัสไปรษณีย์ตามทะเบียนบ้าน"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileAddressHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAssessment", 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("Date") + .HasColumnType("datetime(6)") + .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") + .HasColumnType("longtext") + .HasComment("ชื่อแบบประเมิน"); + + b.Property("Point1") + .HasColumnType("double") + .HasComment("ผลประเมินส่วนที่1 (คะแนน)"); + + b.Property("Point1Total") + .HasColumnType("double") + .HasComment("ส่วนที่1 (คะแนน)"); + + b.Property("Point2") + .HasColumnType("double") + .HasComment("ผลประเมินส่วนที่2 (คะแนน)"); + + b.Property("Point2Total") + .HasColumnType("double") + .HasComment("ส่วนที่2 (คะแนน)"); + + b.Property("PointSum") + .HasColumnType("double") + .HasComment("ผลประเมินรวม (คะแนน)"); + + b.Property("PointSumTotal") + .HasColumnType("double") + .HasComment("ผลรวม (คะแนน)"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileAssessment"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAssessmentHistory", 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("Date") + .HasColumnType("datetime(6)") + .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") + .HasColumnType("longtext") + .HasComment("ชื่อแบบประเมิน"); + + b.Property("Point1") + .HasColumnType("double") + .HasComment("ผลประเมินส่วนที่1 (คะแนน)"); + + b.Property("Point1Total") + .HasColumnType("double") + .HasComment("ส่วนที่1 (คะแนน)"); + + b.Property("Point2") + .HasColumnType("double") + .HasComment("ผลประเมินส่วนที่2 (คะแนน)"); + + b.Property("Point2Total") + .HasColumnType("double") + .HasComment("ส่วนที่2 (คะแนน)"); + + b.Property("PointSum") + .HasColumnType("double") + .HasComment("ผลประเมินรวม (คะแนน)"); + + b.Property("PointSumTotal") + .HasColumnType("double") + .HasComment("ผลรวม (คะแนน)"); + + b.Property("ProfileAssessmentId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileAssessmentId"); + + b.ToTable("ProfileAssessmentHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAvatarHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("AvatarFileId") + .HasColumnType("char(36)"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("AvatarFileId"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileAvatarHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileCertificate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CertificateNo") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("เลขที่ใบอนุญาต"); + + b.Property("CertificateType") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .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("ExpireDate") + .HasColumnType("datetime(6)") + .HasComment("วันที่หมดอายุ"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("IssueDate") + .HasColumnType("datetime(6)") + .HasComment("วันที่ออกใบอนุญาต"); + + b.Property("Issuer") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .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("ProfileId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileCertificate"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileCertificateHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CertificateNo") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("เลขที่ใบอนุญาต"); + + b.Property("CertificateType") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .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("ExpireDate") + .HasColumnType("datetime(6)") + .HasComment("วันที่หมดอายุ"); + + b.Property("IssueDate") + .HasColumnType("datetime(6)") + .HasComment("วันที่ออกใบอนุญาต"); + + b.Property("Issuer") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .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("ProfileCertificateId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileCertificateId"); + + b.ToTable("ProfileCertificateHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileChangeName", 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("FirstName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("ชื่อ"); + + b.Property("LastName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .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("Prefix") + .HasColumnType("longtext") + .HasComment("คำนำหน้า"); + + b.Property("PrefixId") + .HasColumnType("char(36)") + .HasComment("Id คำนำหน้า"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.Property("Status") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("สถานะ"); + + b.HasKey("Id"); + + b.HasIndex("DocumentId"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileChangeName"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileChangeNameHistory", 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("FirstName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("ชื่อ"); + + b.Property("LastName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .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("Prefix") + .HasColumnType("longtext") + .HasComment("คำนำหน้า"); + + b.Property("PrefixId") + .HasColumnType("char(36)") + .HasComment("Id คำนำหน้า"); + + b.Property("ProfileChangeNameId") + .HasColumnType("char(36)"); + + b.Property("Status") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("สถานะ"); + + b.HasKey("Id"); + + b.HasIndex("DocumentId"); + + b.HasIndex("ProfileChangeNameId"); + + b.ToTable("ProfileChangeNameHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileChildren", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("ChildrenCareer") + .HasColumnType("longtext") + .HasComment("อาชีพบุตร"); + + b.Property("ChildrenFirstName") + .HasColumnType("longtext") + .HasComment("ชื่อบุตร"); + + b.Property("ChildrenLastName") + .HasColumnType("longtext") + .HasComment("นามสกุลบุตร"); + + b.Property("ChildrenPrefix") + .HasColumnType("longtext") + .HasComment("คำนำหน้าบุตร"); + + b.Property("ChildrenPrefixId") + .HasColumnType("char(36)") + .HasComment("Id คำนำหน้าบุตร"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileChildren"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileChildrenHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("ChildrenCareer") + .HasColumnType("longtext") + .HasComment("อาชีพบุตร"); + + b.Property("ChildrenFirstName") + .HasColumnType("longtext") + .HasComment("ชื่อบุตร"); + + b.Property("ChildrenLastName") + .HasColumnType("longtext") + .HasComment("นามสกุลบุตร"); + + b.Property("ChildrenPrefix") + .HasColumnType("longtext") + .HasComment("คำนำหน้าบุตร"); + + b.Property("ChildrenPrefixId") + .HasColumnType("char(36)") + .HasComment("Id คำนำหน้าบุตร"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("ProfileChildrenId") + .HasColumnType("char(36)"); + + b.Property("ProfileFamilyHistoryId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileChildrenId"); + + b.HasIndex("ProfileFamilyHistoryId"); + + b.ToTable("ProfileChildrenHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileCoupleHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasComment("ไม่ใช้"); + + b.Property("Career") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("CreatedDate") + .HasColumnType("datetime(6)"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("Prefix") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileCoupleHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileCurrentAddressHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasComment("ไม่ใช้"); + + b.Property("Address") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("CreatedDate") + .HasColumnType("datetime(6)"); + + b.Property("DistrictId") + .HasColumnType("char(36)"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.Property("ProvinceId") + .HasColumnType("char(36)"); + + b.Property("SubDistrictId") + .HasColumnType("char(36)"); + + b.Property("ZipCode") + .IsRequired() + .HasMaxLength(5) + .HasColumnType("varchar(5)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileCurrentAddressHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileDiscipline", 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("Date") + .HasColumnType("datetime(6)") + .HasComment("วัน เดือน ปี"); + + b.Property("Detail") + .HasColumnType("text") + .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("Level") + .HasColumnType("longtext") + .HasComment("ระดับความผิด"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.Property("RefCommandDate") + .HasColumnType("datetime(6)") + .HasComment("เอกสารอ้างอิง (ลงวันที่)"); + + b.Property("RefCommandNo") + .HasColumnType("longtext") + .HasComment("เอกสารอ้างอิง (เลขที่คำสั่ง)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileDiscipline"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileDisciplineHistory", 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("Date") + .HasColumnType("datetime(6)") + .HasComment("วัน เดือน ปี"); + + b.Property("Detail") + .HasColumnType("text") + .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("Level") + .HasColumnType("longtext") + .HasComment("ระดับความผิด"); + + b.Property("ProfileDisciplineId") + .HasColumnType("char(36)"); + + b.Property("RefCommandDate") + .HasColumnType("datetime(6)") + .HasComment("เอกสารอ้างอิง (ลงวันที่)"); + + b.Property("RefCommandNo") + .HasColumnType("longtext") + .HasComment("เอกสารอ้างอิง (เลขที่คำสั่ง)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileDisciplineId"); + + b.ToTable("ProfileDisciplineHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileDuty", 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("DateEnd") + .HasColumnType("datetime(6)") + .HasComment("สิ้นสุด"); + + b.Property("DateStart") + .HasColumnType("datetime(6)") + .HasComment("เริ่มต้น"); + + b.Property("Detail") + .HasColumnType("longtext") + .HasComment("รายละเอียด"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.Property("Reference") + .HasColumnType("longtext") + .HasComment("เอกสารอ้างอิง"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileDuty"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileDutyHistory", 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("DateEnd") + .HasColumnType("datetime(6)") + .HasComment("สิ้นสุด"); + + b.Property("DateStart") + .HasColumnType("datetime(6)") + .HasComment("เริ่มต้น"); + + b.Property("Detail") + .HasColumnType("longtext") + .HasComment("รายละเอียด"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("ProfileDutyId") + .HasColumnType("char(36)"); + + b.Property("Reference") + .HasColumnType("longtext") + .HasComment("เอกสารอ้างอิง"); + + b.HasKey("Id"); + + b.HasIndex("ProfileDutyId"); + + b.ToTable("ProfileDutyHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileEducation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("Country") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)") + .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("Degree") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("วุฒิการศึกษา"); + + b.Property("Duration") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)") + .HasComment("ระยะเวลา"); + + b.Property("DurationYear") + .HasColumnType("int") + .HasComment("ระยะเวลาหลักสูตร"); + + b.Property("EducationLevel") + .HasColumnType("longtext") + .HasComment("ระดับศึกษา"); + + b.Property("EducationLevelId") + .HasColumnType("char(36)") + .HasComment("Id ระดับศึกษา"); + + b.Property("EndDate") + .HasColumnType("datetime(6)") + .HasComment("ถึง"); + + b.Property("Field") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("สาขาวิชา/ทาง"); + + b.Property("FinishDate") + .HasColumnType("datetime(6)") + .HasComment("วันที่สำเร็จการศึกษา"); + + b.Property("FundName") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)") + .HasComment("ทุน"); + + b.Property("Gpa") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("เกรดเฉลี่ย"); + + b.Property("Institute") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)") + .HasComment("สถานศึกษา"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + 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("Other") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)") + .HasComment("ข้อมูลการติดต่อ"); + + b.Property("PositionPath") + .HasColumnType("longtext") + .HasComment("เป็นวุฒิการศึกษาในตำแหน่ง"); + + b.Property("PositionPathId") + .HasColumnType("char(36)") + .HasComment("Id เป็นวุฒิการศึกษาในตำแหน่ง"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.Property("StartDate") + .HasColumnType("datetime(6)") + .HasComment("ตั้งแต่"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileEducation"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileEducationHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("Country") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)") + .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("Degree") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("วุฒิการศึกษา"); + + b.Property("Duration") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)") + .HasComment("ระยะเวลา"); + + b.Property("DurationYear") + .HasColumnType("int") + .HasComment("ระยะเวลาหลักสูตร"); + + b.Property("EducationLevel") + .HasColumnType("longtext") + .HasComment("ระดับศึกษา"); + + b.Property("EducationLevelId") + .HasColumnType("char(36)") + .HasComment("Id ระดับศึกษา"); + + b.Property("EndDate") + .HasColumnType("datetime(6)") + .HasComment("ถึง"); + + b.Property("Field") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("สาขาวิชา/ทาง"); + + b.Property("FinishDate") + .HasColumnType("datetime(6)") + .HasComment("วันที่สำเร็จการศึกษา"); + + b.Property("FundName") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)") + .HasComment("ทุน"); + + b.Property("Gpa") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("เกรดเฉลี่ย"); + + b.Property("Institute") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)") + .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("Other") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)") + .HasComment("ข้อมูลการติดต่อ"); + + b.Property("PositionPath") + .HasColumnType("longtext") + .HasComment("เป็นวุฒิการศึกษาในตำแหน่ง"); + + b.Property("PositionPathId") + .HasColumnType("char(36)") + .HasComment("Id เป็นวุฒิการศึกษาในตำแหน่ง"); + + b.Property("ProfileEducationId") + .HasColumnType("char(36)"); + + b.Property("StartDate") + .HasColumnType("datetime(6)") + .HasComment("ตั้งแต่"); + + b.HasKey("Id"); + + b.HasIndex("ProfileEducationId"); + + b.ToTable("ProfileEducationHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileEmployment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("Command") + .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("Date") + .HasColumnType("datetime(6)") + .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("ProfileId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileEmployment"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileFamilyHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("Couple") + .HasColumnType("tinyint(1)") + .HasComment("คู่สมรส"); + + b.Property("CoupleCareer") + .HasColumnType("longtext") + .HasComment("อาชีพคู่สมรส"); + + b.Property("CoupleFirstName") + .HasColumnType("longtext") + .HasComment("ชื่อคู่สมรส"); + + b.Property("CoupleLastName") + .HasColumnType("longtext") + .HasComment("นามสกุลคู่สมรส"); + + b.Property("CoupleLastNameOld") + .HasColumnType("longtext") + .HasComment("นามสกุลคู่สมรส(เดิม)"); + + b.Property("CouplePrefix") + .HasColumnType("longtext") + .HasComment("คำนำหน้าคู่สมรส"); + + b.Property("CouplePrefixId") + .HasColumnType("char(36)") + .HasComment("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("FatherCareer") + .HasColumnType("longtext") + .HasComment("อาชีพบิดา"); + + b.Property("FatherFirstName") + .HasColumnType("longtext") + .HasComment("ชื่อบิดา"); + + b.Property("FatherLastName") + .HasColumnType("longtext") + .HasComment("นามสกุลบิดา"); + + b.Property("FatherPrefix") + .HasColumnType("longtext") + .HasComment("คำนำหน้าบิดา"); + + b.Property("FatherPrefixId") + .HasColumnType("char(36)") + .HasComment("Id คำนำหน้าบิดา"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("MotherCareer") + .HasColumnType("longtext") + .HasComment("อาชีพมารดา"); + + b.Property("MotherFirstName") + .HasColumnType("longtext") + .HasComment("ชื่อมารดา"); + + b.Property("MotherLastName") + .HasColumnType("longtext") + .HasComment("นามสกุลมารดา"); + + b.Property("MotherPrefix") + .HasColumnType("longtext") + .HasComment("คำนำหน้ามารดา"); + + b.Property("MotherPrefixId") + .HasColumnType("char(36)") + .HasComment("Id คำนำหน้ามารดา"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileFamilyHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileFatherHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasComment("ไม่ใช้"); + + b.Property("Career") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("CreatedDate") + .HasColumnType("datetime(6)"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("Prefix") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileFatherHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileGovernmentHistory", 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("DateAppoint") + .HasColumnType("datetime(6)") + .HasComment("วันที่สั่งบรรจุ"); + + b.Property("DateStart") + .HasColumnType("datetime(6)") + .HasComment("เริ่มปฎิบัติราชการ"); + + b.Property("GovAge") + .HasColumnType("longtext") + .HasComment("อายุราชการ"); + + b.Property("GovAgeAbsent") + .HasColumnType("int") + .HasComment("ขาดราชการ"); + + b.Property("GovAgePlus") + .HasColumnType("int") + .HasComment("อายุราชการเกื้อกูล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Oc") + .HasColumnType("longtext") + .HasComment("สังกัด"); + + b.Property("OcId") + .HasColumnType("char(36)") + .HasComment("Id สังกัด"); + + b.Property("PosNo") + .HasColumnType("longtext") + .HasComment("เลขที่ตำแหน่ง"); + + b.Property("PosNoId") + .HasColumnType("char(36)") + .HasComment("Id เลขที่ตำแหน่ง"); + + b.Property("Position") + .HasColumnType("longtext") + .HasComment("ตำแหน่ง"); + + b.Property("PositionEmployeeGroup") + .HasColumnType("longtext") + .HasComment("กลุ่มงาน"); + + b.Property("PositionEmployeeLevel") + .HasColumnType("longtext") + .HasComment("ระดับชั้นงาน"); + + b.Property("PositionEmployeePosition") + .HasColumnType("longtext") + .HasComment("ตำแหน่ง"); + + b.Property("PositionEmployeePositionSide") + .HasColumnType("longtext") + .HasComment("ด้านของตำแหน่ง"); + + b.Property("PositionExecutive") + .HasColumnType("longtext") + .HasComment("ตำแหน่งทางการบริหาร"); + + b.Property("PositionId") + .HasColumnType("char(36)") + .HasComment("Id ตำแหน่ง"); + + b.Property("PositionLevel") + .HasColumnType("longtext") + .HasComment("ระดับตำแหน่ง"); + + b.Property("PositionLine") + .HasColumnType("longtext") + .HasComment("สายงาน"); + + b.Property("PositionType") + .HasColumnType("longtext") + .HasComment("ประเภทตำแหน่ง"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.Property("ReasonSameDate") + .HasColumnType("longtext") + .HasComment("เหตุผลกรณีไม่ตรงวัน"); + + b.Property("RetireDate") + .HasColumnType("longtext") + .HasComment("วันเกษียณอายุ"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileGovernmentHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("BirthDate") + .HasColumnType("datetime(6)") + .HasComment("วันเกิด"); + + b.Property("BloodGroup") + .HasColumnType("longtext") + .HasComment("กลุ่มเลือด"); + + b.Property("BloodGroupId") + .HasColumnType("char(36)") + .HasComment("Id กลุ่มเลือด"); + + b.Property("CitizenId") + .HasMaxLength(13) + .HasColumnType("varchar(13)") + .HasComment("รหัสบัตรประชาชน"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("EmployeeClass") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("ประเภทลูกจ้าง"); + + b.Property("EmployeeType") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("ประเภทการจ้าง"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("ชื่อ"); + + b.Property("Gender") + .HasColumnType("longtext") + .HasComment("เพศ"); + + b.Property("GenderId") + .HasColumnType("char(36)") + .HasComment("Id เพศ"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .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("Nationality") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("สัญชาติ"); + + b.Property("Prefix") + .HasColumnType("longtext") + .HasComment("คำนำหน้า"); + + b.Property("PrefixId") + .HasColumnType("char(36)") + .HasComment("Id คำนำหน้า"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.Property("Race") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("เชื้อชาติ"); + + b.Property("Relationship") + .HasColumnType("longtext") + .HasComment("สถานะภาพ"); + + b.Property("RelationshipId") + .HasColumnType("char(36)") + .HasComment("Id สถานะภาพ"); + + b.Property("Religion") + .HasColumnType("longtext") + .HasComment("ศาสนา"); + + b.Property("ReligionId") + .HasColumnType("char(36)") + .HasComment("Id ศาสนา"); + + b.Property("TelephoneNumber") + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasComment("เบอร์โทร"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileHonor", 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") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)") + .HasComment("รายละเอียด"); + + b.Property("IssueDate") + .HasColumnType("datetime(6)") + .HasComment("วันที่ได้รับ"); + + b.Property("Issuer") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .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("ProfileId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileHonor"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileHonorHistory", 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") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)") + .HasComment("รายละเอียด"); + + b.Property("IssueDate") + .HasColumnType("datetime(6)") + .HasComment("วันที่ได้รับ"); + + b.Property("Issuer") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .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("ProfileHonorId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileHonorId"); + + b.ToTable("ProfileHonorHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileInsignia", 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("DateAnnounce") + .HasColumnType("datetime(6)") + .HasComment("วันที่ประกาศในราชกิจจาฯ"); + + b.Property("InsigniaId") + .HasColumnType("char(36)"); + + b.Property("InsigniaType") + .HasColumnType("longtext") + .HasComment("ประเภท"); + + b.Property("Issue") + .HasMaxLength(300) + .HasColumnType("varchar(300)") + .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("No") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("ลำดับที่"); + + b.Property("Page") + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasComment("หน้า"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.Property("ReceiveDate") + .HasColumnType("datetime(6)") + .HasComment("ลงวันที่"); + + b.Property("RefCommandDate") + .HasColumnType("datetime(6)") + .HasComment("เอกสารอ้างอิง (ลงวันที่)"); + + b.Property("RefCommandNo") + .HasColumnType("longtext") + .HasComment("เอกสารอ้างอิง (เลขที่คำสั่ง)"); + + b.Property("Section") + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasComment("ตอน"); + + b.Property("Volume") + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasComment("เล่ม"); + + b.Property("VolumeNo") + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasComment("เล่มที่"); + + b.Property("Year") + .HasColumnType("int") + .HasComment("ปีที่ยื่นขอ"); + + b.HasKey("Id"); + + b.HasIndex("InsigniaId"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileInsignia"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileInsigniaHistory", 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("DateAnnounce") + .HasColumnType("datetime(6)") + .HasComment("วันที่ประกาศในราชกิจจาฯ"); + + b.Property("Insignia") + .HasColumnType("longtext") + .HasComment("ชื่อเครื่องราชฯ"); + + b.Property("InsigniaId") + .HasColumnType("char(36)"); + + b.Property("InsigniaType") + .HasColumnType("longtext") + .HasComment("ประเภท"); + + b.Property("Issue") + .HasMaxLength(300) + .HasColumnType("varchar(300)") + .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("No") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("ลำดับที่"); + + b.Property("Page") + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasComment("หน้า"); + + b.Property("ProfileInsigniaId") + .HasColumnType("char(36)"); + + b.Property("ReceiveDate") + .HasColumnType("datetime(6)") + .HasComment("ลงวันที่"); + + b.Property("Section") + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasComment("ตอน"); + + b.Property("Volume") + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasComment("เล่ม"); + + b.Property("VolumeNo") + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasComment("เล่มที่"); + + b.Property("Year") + .HasColumnType("int") + .HasComment("ปีที่ยื่นขอ"); + + b.HasKey("Id"); + + b.HasIndex("ProfileInsigniaId"); + + b.ToTable("ProfileInsigniaHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileLeave", 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("DateEndLeave") + .HasColumnType("datetime(6)") + .HasComment("วัน เดือน ปี ที่สิ้นสุดลา"); + + b.Property("DateStartLeave") + .HasColumnType("datetime(6)") + .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("NumLeave") + .HasColumnType("double") + .HasComment("ลาครั้งที่"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.Property("Reason") + .HasColumnType("longtext") + .HasComment("เหตุผล"); + + b.Property("Status") + .HasColumnType("longtext") + .HasComment("สถานะ"); + + b.Property("SumLeave") + .HasColumnType("double") + .HasComment("ลามาแล้ว"); + + b.Property("TotalLeave") + .HasColumnType("double") + .HasComment("รวมเป็น"); + + b.Property("TypeLeaveId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.HasIndex("TypeLeaveId"); + + b.ToTable("ProfileLeave"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileLeaveHistory", 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("DateEndLeave") + .HasColumnType("datetime(6)") + .HasComment("วัน เดือน ปี ที่สิ้นสุดลา"); + + b.Property("DateStartLeave") + .HasColumnType("datetime(6)") + .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("NumLeave") + .HasColumnType("double") + .HasComment("ลาครั้งที่"); + + b.Property("ProfileLeaveId") + .HasColumnType("char(36)"); + + b.Property("Reason") + .HasColumnType("longtext") + .HasComment("เหตุผล"); + + b.Property("Status") + .HasColumnType("longtext") + .HasComment("สถานะ"); + + b.Property("SumLeave") + .HasColumnType("double") + .HasComment("ลามาแล้ว"); + + b.Property("TotalLeave") + .HasColumnType("double") + .HasComment("รวมเป็น"); + + b.Property("TypeLeaveId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileLeaveId"); + + b.HasIndex("TypeLeaveId"); + + b.ToTable("ProfileLeaveHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileMotherHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasComment("ไม่ใช้"); + + b.Property("Career") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("CreatedDate") + .HasColumnType("datetime(6)"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("Prefix") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileMotherHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileNopaid", 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("Date") + .HasColumnType("datetime(6)") + .HasComment("วัน เดือน ปี"); + + b.Property("Detail") + .HasColumnType("longtext") + .HasComment("รายละเอียด"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.Property("Reference") + .HasColumnType("longtext") + .HasComment("เอกสารอ้างอิง"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileNopaid"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileNopaidHistory", 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("Date") + .HasColumnType("datetime(6)") + .HasComment("วัน เดือน ปี"); + + b.Property("Detail") + .HasColumnType("longtext") + .HasComment("รายละเอียด"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("ProfileNopaidId") + .HasColumnType("char(36)"); + + b.Property("Reference") + .HasColumnType("longtext") + .HasComment("เอกสารอ้างอิง"); + + b.HasKey("Id"); + + b.HasIndex("ProfileNopaidId"); + + b.ToTable("ProfileNopaidHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileOther", 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("Date") + .HasColumnType("datetime(6)") + .HasComment("วันที่"); + + b.Property("Detail") + .HasColumnType("longtext") + .HasComment("รายละเอียด"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileOther"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileOtherHistory", 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("Date") + .HasColumnType("datetime(6)") + .HasComment("วันที่"); + + b.Property("Detail") + .HasColumnType("longtext") + .HasComment("รายละเอียด"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("ProfileOtherId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileOtherId"); + + b.ToTable("ProfileOtherHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfilePaper", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CategoryName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .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") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasComment("ชื่อไฟล์"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("DocumentId"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfilePaper"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileRegistrationAddressHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasComment("ไม่ใช้"); + + b.Property("Address") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("CreatedDate") + .HasColumnType("datetime(6)"); + + b.Property("DistrictId") + .HasColumnType("char(36)"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.Property("ProvinceId") + .HasColumnType("char(36)"); + + b.Property("SubDistrictId") + .HasColumnType("char(36)"); + + b.Property("ZipCode") + .IsRequired() + .HasMaxLength(5) + .HasColumnType("varchar(5)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileRegistrationAddressHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileSalary", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("Amount") + .HasColumnType("double") + .HasComment("เงินเดือน"); + + b.Property("CommandNo") + .IsRequired() + .HasColumnType("longtext") + .HasComment("เลขที่คำสั่ง"); + + b.Property("CommandTypeName") + .IsRequired() + .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("Date") + .HasColumnType("datetime(6)") + .HasComment("วัน เดือน ปี รับตำแหน่ง"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + 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("MouthSalaryAmount") + .HasColumnType("double") + .HasComment("เงินค่าตอบแทนรายเดือน"); + + b.Property("OcId") + .HasColumnType("char(36)") + .HasComment("Id สังกัด"); + + b.Property("Order") + .HasColumnType("int") + .HasComment("ลำดับ"); + + b.Property("OrganizationShortNameId") + .HasColumnType("char(36)") + .HasComment("Id ชื่อย่อหน่วยงาน"); + + b.Property("PosNoEmployee") + .HasColumnType("longtext") + .HasComment("เลขที่ตำแหน่งลูกจ้าง"); + + b.Property("PosNoId") + .HasColumnType("char(36)") + .HasComment("Id เลขที่ตำแหน่ง"); + + b.Property("PositionEmployeeGroupId") + .HasColumnType("char(36)") + .HasComment("Id กลุ่มงาน"); + + b.Property("PositionEmployeeLevelId") + .HasColumnType("char(36)") + .HasComment(" Id ระดับชั้นงาน"); + + b.Property("PositionEmployeePositionId") + .HasColumnType("char(36)") + .HasComment("Id ตำแหน่ง"); + + b.Property("PositionEmployeePositionSideId") + .HasColumnType("char(36)") + .HasComment("Id ด้านของตำแหน่ง"); + + b.Property("PositionExecutiveId") + .HasColumnType("char(36)") + .HasComment("Id ตำแหน่งทางการบริหาร"); + + b.Property("PositionExecutiveSideId") + .HasColumnType("char(36)") + .HasComment("Id ด้านทางการบริหาร"); + + b.Property("PositionId") + .HasColumnType("char(36)") + .HasComment("Id ตำแหน่ง"); + + b.Property("PositionLevelId") + .HasColumnType("char(36)"); + + b.Property("PositionLineId") + .HasColumnType("char(36)") + .HasComment("Id สายงาน"); + + b.Property("PositionPathSideId") + .HasColumnType("char(36)") + .HasComment("Id ด้าน/สาขา"); + + b.Property("PositionSalaryAmount") + .HasColumnType("double") + .HasComment("เงินประจำตำแหน่ง"); + + b.Property("PositionTypeId") + .HasColumnType("char(36)") + .HasComment("Id ประเภทตำแหน่ง"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.Property("RefCommandNo") + .HasColumnType("longtext") + .HasComment("เอกสารอ้างอิง (เลขที่คำสั่ง)"); + + b.Property("SalaryClass") + .HasColumnType("longtext") + .HasComment("ตำแหน่ง (รายละเอียด)"); + + b.Property("SalaryRef") + .HasColumnType("longtext") + .HasComment("เอกสารอ้างอิง"); + + b.Property("SalaryStatus") + .HasColumnType("longtext") + .HasComment("ประเภทตำแหน่งกรณีพิเศษ"); + + b.HasKey("Id"); + + b.HasIndex("PositionLevelId"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileSalary"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileSalaryHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("Amount") + .HasColumnType("double") + .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("Date") + .HasColumnType("datetime(6)") + .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("MouthSalaryAmount") + .HasColumnType("double") + .HasComment("เงินค่าตอบแทนรายเดือน"); + + b.Property("Oc") + .HasColumnType("longtext") + .HasComment("สังกัด"); + + b.Property("OcId") + .HasColumnType("char(36)") + .HasComment("Id สังกัด"); + + b.Property("OrganizationShortName") + .HasColumnType("longtext"); + + b.Property("OrganizationShortNameId") + .HasColumnType("char(36)"); + + b.Property("PosNo") + .HasColumnType("longtext") + .HasComment("เลขที่ตำแหน่ง"); + + b.Property("PosNoEmployee") + .HasColumnType("longtext") + .HasComment("เลขที่ตำแหน่งลูกจ้าง"); + + b.Property("PosNoId") + .HasColumnType("char(36)") + .HasComment("Id เลขที่ตำแหน่ง"); + + b.Property("Position") + .HasColumnType("longtext") + .HasComment("ตำแหน่ง"); + + b.Property("PositionEmployeeGroup") + .HasColumnType("longtext") + .HasComment("กลุ่มงาน"); + + b.Property("PositionEmployeeGroupId") + .HasColumnType("char(36)") + .HasComment("Id กลุ่มงาน"); + + b.Property("PositionEmployeeLevel") + .HasColumnType("longtext") + .HasComment("ระดับชั้นงาน"); + + b.Property("PositionEmployeeLevelId") + .HasColumnType("char(36)") + .HasComment(" Id ระดับชั้นงาน"); + + b.Property("PositionEmployeePosition") + .HasColumnType("longtext") + .HasComment("ตำแหน่ง"); + + b.Property("PositionEmployeePositionId") + .HasColumnType("char(36)") + .HasComment("Id ตำแหน่ง"); + + b.Property("PositionEmployeePositionSide") + .HasColumnType("longtext") + .HasComment("ด้านของตำแหน่ง"); + + b.Property("PositionEmployeePositionSideId") + .HasColumnType("char(36)") + .HasComment("Id ด้านของตำแหน่ง"); + + b.Property("PositionExecutive") + .HasColumnType("longtext") + .HasComment("ตำแหน่งทางการบริหาร"); + + b.Property("PositionExecutiveId") + .HasColumnType("char(36)") + .HasComment("Id ด้านทางการบริหาร"); + + b.Property("PositionExecutiveSide") + .HasColumnType("longtext") + .HasComment("ด้านทางการบริหาร"); + + b.Property("PositionExecutiveSideId") + .HasColumnType("char(36)") + .HasComment("Id ด้านทางการบริหาร"); + + b.Property("PositionId") + .HasColumnType("char(36)") + .HasComment("Id ตำแหน่ง"); + + b.Property("PositionLevel") + .HasColumnType("longtext") + .HasComment("ระดับ"); + + b.Property("PositionLevelId") + .HasColumnType("char(36)") + .HasComment(" Id ระดับ"); + + b.Property("PositionLine") + .HasColumnType("longtext") + .HasComment("สายงาน"); + + b.Property("PositionLineId") + .HasColumnType("char(36)") + .HasComment("Id สายงาน"); + + b.Property("PositionPathSide") + .HasColumnType("longtext") + .HasComment("ด้าน/สาขา"); + + b.Property("PositionPathSideId") + .HasColumnType("char(36)") + .HasComment("Id ด้าน/สาขา"); + + b.Property("PositionSalaryAmount") + .HasColumnType("double") + .HasComment("เงินประจำตำแหน่ง"); + + b.Property("PositionType") + .HasColumnType("longtext") + .HasComment("ประเภทตำแหน่ง"); + + b.Property("PositionTypeId") + .HasColumnType("char(36)") + .HasComment("Id ประเภทตำแหน่ง"); + + b.Property("ProfileSalaryId") + .HasColumnType("char(36)"); + + b.Property("SalaryClass") + .HasColumnType("longtext") + .HasComment("ตำแหน่ง (รายละเอียด)"); + + b.Property("SalaryRef") + .HasColumnType("longtext") + .HasComment("เอกสารอ้างอิง"); + + b.HasKey("Id"); + + b.HasIndex("ProfileSalaryId"); + + b.ToTable("ProfileSalaryHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileTraining", 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("DateOrder") + .HasColumnType("datetime(6)") + .HasComment("คำสั่งลงวันที่/หนังสืออนุมัติลงวันที่"); + + b.Property("Department") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("หน่วยงานที่รับผิดชอบจัดการฝึกอบรม/ดูงาน"); + + b.Property("Duration") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("รวมระยะเวลาในการฝึกอบรม/ดูงาน"); + + b.Property("EndDate") + .HasColumnType("datetime(6)") + .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") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("ชื่อโครงการ/หลักสูตรการฝึกอบรม"); + + b.Property("NumberOrder") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("เลขที่คำสั่ง/เลขที่หนังสืออนุมัติ"); + + b.Property("Place") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("สถานที่ฝึกอบรม/ดูงาน"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.Property("StartDate") + .HasColumnType("datetime(6)") + .HasComment("วันเริ่มต้นการฝึกอบรม/ดูงาน"); + + b.Property("Topic") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("หัวข้อการฝึกอบรม/ดูงาน"); + + b.Property("Yearly") + .HasMaxLength(200) + .HasColumnType("int") + .HasComment("ปีที่อบรม (พ.ศ.)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfileTraining"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileTrainingHistory", 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("DateOrder") + .HasColumnType("datetime(6)") + .HasComment("คำสั่งลงวันที่/หนังสืออนุมัติลงวันที่"); + + b.Property("Department") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("หน่วยงานที่รับผิดชอบจัดการฝึกอบรม/ดูงาน"); + + b.Property("Duration") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("รวมระยะเวลาในการฝึกอบรม/ดูงาน"); + + b.Property("EndDate") + .HasColumnType("datetime(6)") + .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") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("ชื่อโครงการ/หลักสูตรการฝึกอบรม"); + + b.Property("NumberOrder") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("เลขที่คำสั่ง/เลขที่หนังสืออนุมัติ"); + + b.Property("Place") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("สถานที่ฝึกอบรม/ดูงาน"); + + b.Property("ProfileTrainingId") + .HasColumnType("char(36)"); + + b.Property("StartDate") + .HasColumnType("datetime(6)") + .HasComment("วันเริ่มต้นการฝึกอบรม/ดูงาน"); + + b.Property("Topic") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("หัวข้อการฝึกอบรม/ดูงาน"); + + b.Property("Yearly") + .HasMaxLength(200) + .HasColumnType("int") + .HasComment("ปีที่อบรม (พ.ศ.)"); + + b.HasKey("Id"); + + b.HasIndex("ProfileTrainingId"); + + b.ToTable("ProfileTrainingHistory"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.TypeLeave", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Name") + .HasColumnType("longtext") + .HasComment("ประเภทการลา"); + + b.HasKey("Id"); + + b.ToTable("TypeLeave"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.BloodGroup", 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(2) + .HasColumnType("varchar(2)") + .HasColumnOrder(1) + .HasComment("ชื่อหมู่โลหิต"); + + b.HasKey("Id"); + + b.ToTable("BloodGroups"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.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.Domain.Models.MetaData.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.Domain.Models.MetaData.Gender", 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(20) + .HasColumnType("varchar(20)") + .HasColumnOrder(1) + .HasComment("เพศ"); + + b.HasKey("Id"); + + b.ToTable("Genders"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.Holiday", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("Category") + .IsRequired() + .HasColumnType("longtext") + .HasColumnOrder(6) + .HasComment("ประเภทของวันหยุดสำหรับ ทำงาน 5 วัน=`NORMAL`,ทำงาน 6 วัน=`6DAYS`"); + + 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("HolidayDate") + .HasColumnType("datetime(6)") + .HasColumnOrder(2) + .HasComment("วันหยุด"); + + b.Property("IsSpecial") + .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(250) + .HasColumnType("varchar(250)") + .HasColumnOrder(4) + .HasComment("ชื่อวันหยุด"); + + b.Property("OriginalDate") + .HasColumnType("datetime(6)") + .HasColumnOrder(3) + .HasComment("วันหยุด(Original)"); + + b.Property("Year") + .HasColumnType("int") + .HasColumnOrder(1) + .HasComment("ประจำปี"); + + b.HasKey("Id"); + + b.ToTable("Holidays"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.Insignia", 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("InsigniaTypeId") + .HasColumnType("char(36)"); + + 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("Level") + .HasColumnType("int") + .HasColumnOrder(4) + .HasComment("ลำดับชั้นของเครื่องราช เอาไว้ตรวจสอบเวลาขอว่าต้องได้ชั้นที่สูงกว่าที่เคยได้รับแล้วเท่านั้น"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnOrder(1) + .HasComment("ชื่อเครื่องราช"); + + b.Property("Note") + .IsRequired() + .HasColumnType("longtext") + .HasColumnOrder(5) + .HasComment("หมายเหตุ"); + + b.Property("ShortName") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasColumnOrder(2) + .HasComment("ชื่อย่อเครื่องราช"); + + b.HasKey("Id"); + + b.HasIndex("InsigniaTypeId"); + + b.ToTable("Insignias"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.InsigniaType", 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("InsigniaTypes"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.OrganizationAgency", 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("OrganizationAgencys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.OrganizationFax", 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("OrganizationFaxs"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.OrganizationGovernmentAgency", 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("OrganizationGovernmentAgencys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.OrganizationLevel", 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("OrganizationLevels"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.OrganizationOrganization", 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.Property("Note") + .IsRequired() + .HasColumnType("longtext") + .HasColumnOrder(3) + .HasComment("หมายเหตุ"); + + b.HasKey("Id"); + + b.ToTable("OrganizationOrganizations"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.OrganizationShortName", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("AgencyCode") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnOrder(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("GovernmentCode") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnOrder(2) + .HasComment("ข้อมูลโครงสร้างหน่วยงานชื่อ รหัสส่วนราชการ"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(4) + .HasComment("สถานะการใช้งาน"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnOrder(3) + .HasComment("ข้อมูลโครงสร้างหน่วยงานชื่อ ตัวย่อหน่วยงาน"); + + b.Property("Note") + .IsRequired() + .HasColumnType("longtext") + .HasColumnOrder(5) + .HasComment("หมายเหตุ"); + + b.HasKey("Id"); + + b.ToTable("OrganizationShortNames"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.OrganizationStatus", 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("OrganizationStatuses"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.OrganizationTelExternal", 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("OrganizationTelExternals"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.OrganizationTelInternal", 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("OrganizationTelInternals"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.OrganizationType", 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("OrganizationTypes"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PhysicalStatus", 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("PhysicalStatuses"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.Position", 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("ExecutiveName") + .IsRequired() + .HasMaxLength(300) + .HasColumnType("varchar(300)") + .HasColumnOrder(3) + .HasComment("ชื่อตำแหน่งทางการบริหาร"); + + b.Property("ExecutiveSideId") + .HasColumnType("char(36)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnOrder(9) + .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(300) + .HasColumnType("varchar(300)") + .HasColumnOrder(1) + .HasComment("ชื่อตำแหน่ง"); + + b.Property("PathSideId") + .HasColumnType("char(36)"); + + b.Property("PositionCategory") + .IsRequired() + .HasColumnType("longtext") + .HasColumnOrder(8) + .HasComment("ตำแหน่งสำหรับข้าราชการหรือลูกจ้าง officer/employee"); + + b.Property("PositionLevelId") + .HasColumnType("char(36)"); + + b.Property("PositionPathId") + .HasColumnType("char(36)"); + + b.Property("PositionTypeId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ExecutiveSideId"); + + b.HasIndex("PathSideId"); + + b.HasIndex("PositionLevelId"); + + b.HasIndex("PositionPathId"); + + b.HasIndex("PositionTypeId"); + + b.ToTable("Positions"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PositionEmployeeGroup", 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("PositionEmployeeGroups"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PositionEmployeeLevel", 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(100) + .HasColumnType("varchar(100)") + .HasColumnOrder(2) + .HasComment("ชื่อระดับชั้นงานข้อมูลตำแหน่งของลูกจ้างกรุงเทพ"); + + b.Property("Order") + .HasColumnType("int") + .HasColumnOrder(1) + .HasComment("ลำดับ"); + + b.HasKey("Id"); + + b.ToTable("PositionEmployeeLevels"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PositionEmployeeLine", 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("PositionEmployeeLines"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PositionEmployeePosition", 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.Property("Note") + .IsRequired() + .HasColumnType("longtext") + .HasColumnOrder(3) + .HasComment("หมายเหตุ"); + + b.HasKey("Id"); + + b.ToTable("PositionEmployeePositions"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PositionEmployeePositionSide", 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.Property("Note") + .IsRequired() + .HasColumnType("longtext") + .HasColumnOrder(3) + .HasComment("หมายเหตุ"); + + b.HasKey("Id"); + + b.ToTable("PositionEmployeePositionSides"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PositionEmployeeStatus", 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("PositionEmployeeStatuses"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PositionExecutive", 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("PositionExecutives"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PositionExecutiveSide", 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.Property("Note") + .IsRequired() + .HasColumnType("longtext") + .HasColumnOrder(3) + .HasComment("หมายเหตุ"); + + b.HasKey("Id"); + + b.ToTable("PositionExecutiveSides"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PositionLevel", 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(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("Level") + .HasColumnType("int") + .HasColumnOrder(4) + .HasComment("ลำดับชั้นของระดับตำแหน่ง"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnOrder(2) + .HasComment("ชื่อระดับตำแหน่ง"); + + b.Property("Order") + .HasColumnType("int") + .HasColumnOrder(1) + .HasComment("ลำดับ"); + + b.Property("ShortName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnOrder(3) + .HasComment("ชื่อย่อระดับตำแหน่ง"); + + b.HasKey("Id"); + + b.ToTable("PositionLevels"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PositionLine", 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("PositionLines"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PositionPath", 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.Property("Note") + .IsRequired() + .HasColumnType("longtext") + .HasColumnOrder(3) + .HasComment("หมายเหตุ"); + + b.HasKey("Id"); + + b.ToTable("PositionPaths"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PositionPathSide", 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.Property("Note") + .IsRequired() + .HasColumnType("longtext") + .HasColumnOrder(3) + .HasComment("หมายเหตุ"); + + b.HasKey("Id"); + + b.ToTable("PositionPathSides"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PositionStatus", 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("PositionStatuss"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.PositionType", 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(100) + .HasColumnType("varchar(100)") + .HasColumnOrder(2) + .HasComment("ชื่อประเภทตำแหน่ง"); + + b.Property("Order") + .HasColumnType("int") + .HasColumnOrder(1) + .HasComment("ลำดับ"); + + b.HasKey("Id"); + + b.ToTable("PositionTypes"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.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.Domain.Models.MetaData.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.Domain.Models.MetaData.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.Domain.Models.MetaData.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("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("Religions"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.Royal", 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(100) + .HasColumnType("varchar(100)") + .HasColumnOrder(1) + .HasComment("ชื่อประเภทข้อมูลเหรียญตรา"); + + b.Property("ShortName") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("varchar(10)") + .HasColumnOrder(2) + .HasComment("ชื่อย่อเหรียญตรา"); + + b.HasKey("Id"); + + b.ToTable("Royals"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.RoyalHierarchy", 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("RoyalHierarchys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.RoyalType", 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("RoyalTypes"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.SubDistrict", 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("DistrictId") + .HasColumnType("char(36)"); + + 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(150) + .HasColumnType("varchar(150)") + .HasColumnOrder(1) + .HasComment("เขต/อำเภอ"); + + b.Property("ZipCode") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("varchar(10)") + .HasColumnOrder(2) + .HasComment("รหัสไปรษณีย์"); + + b.HasKey("Id"); + + b.HasIndex("DistrictId"); + + b.ToTable("SubDistricts"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.AvailablePositionLevelEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("PositionLevelId") + .HasColumnType("char(36)"); + + b.Property("PositionMasterId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("PositionLevelId"); + + b.HasIndex("PositionMasterId"); + + b.ToTable("AvailablePositionLevels"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.OrganizationEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("Agency") + .HasColumnType("longtext") + .HasColumnOrder(14) + .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("Department") + .HasColumnType("longtext") + .HasColumnOrder(16) + .HasComment("ฝ่าย/ส่วน"); + + b.Property("Government") + .HasColumnType("longtext") + .HasColumnOrder(15) + .HasComment("ส่วนราชการ"); + + 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("OrganizationAgencyId") + .HasColumnType("char(36)") + .HasColumnOrder(10) + .HasComment("OrganizationAgencyId"); + + b.Property("OrganizationFaxId") + .HasColumnType("char(36)"); + + b.Property("OrganizationGovernmentAgencyId") + .HasColumnType("char(36)") + .HasColumnOrder(11) + .HasComment("OrganizationGovernmentAgencyId"); + + b.Property("OrganizationLevelId") + .HasColumnType("char(36)"); + + b.Property("OrganizationOrder") + .HasColumnType("int") + .HasColumnOrder(12) + .HasComment("OrganizationOrder"); + + b.Property("OrganizationOrganizationId") + .HasColumnType("char(36)"); + + b.Property("OrganizationShortNameId") + .HasColumnType("char(36)"); + + b.Property("OrganizationStatusId") + .HasColumnType("char(36)"); + + b.Property("OrganizationTelExternalId") + .HasColumnType("char(36)"); + + b.Property("OrganizationTelInternalId") + .HasColumnType("char(36)"); + + b.Property("OrganizationTypeId") + .HasColumnType("char(36)"); + + b.Property("OrganizationUserNote") + .HasColumnType("longtext") + .HasColumnOrder(13) + .HasComment("OrganizationUserNote"); + + b.Property("ParentId") + .HasColumnType("char(36)"); + + b.Property("Pile") + .HasColumnType("longtext") + .HasColumnOrder(17) + .HasComment("กอง"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationFaxId"); + + b.HasIndex("OrganizationLevelId"); + + b.HasIndex("OrganizationOrganizationId"); + + b.HasIndex("OrganizationShortNameId"); + + b.HasIndex("OrganizationStatusId"); + + b.HasIndex("OrganizationTelExternalId"); + + b.HasIndex("OrganizationTelInternalId"); + + b.HasIndex("OrganizationTypeId"); + + b.HasIndex("ParentId"); + + b.ToTable("Organizations"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.OrganizationPositionEntity", 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("IsDirector") + .HasColumnType("tinyint(1)") + .HasColumnOrder(3) + .HasComment("Is Director"); + + 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("OrganizationId") + .HasColumnType("char(36)"); + + b.Property("PositionMasterId") + .HasColumnType("char(36)"); + + b.Property("PositionNumberId") + .HasColumnType("char(36)"); + + b.Property("PositionUserNote") + .HasColumnType("longtext") + .HasColumnOrder(4) + .HasComment("positionUserNote"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationId"); + + b.HasIndex("PositionMasterId"); + + b.HasIndex("PositionNumberId"); + + b.ToTable("OrganizationPositions"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.PositionMasterEntity", 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("IsDirector") + .HasColumnType("tinyint(1)") + .HasColumnOrder(14) + .HasComment("IsDirector"); + + 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("PositionCondition") + .HasColumnType("longtext") + .HasColumnOrder(11) + .HasComment("PositionCondition"); + + b.Property("PositionExecutiveId") + .HasColumnType("char(36)"); + + b.Property("PositionExecutiveSideId") + .HasColumnType("char(36)"); + + b.Property("PositionExecutiveSideObject") + .HasColumnType("longtext"); + + b.Property("PositionId") + .HasColumnType("char(36)") + .HasColumnOrder(2) + .HasComment("PositionId"); + + b.Property("PositionLineId") + .HasColumnType("char(36)"); + + b.Property("PositionMasterUserNote") + .HasColumnType("longtext") + .HasColumnOrder(13) + .HasComment("PositionMasterUserNote"); + + b.Property("PositionPathId") + .HasColumnType("char(36)"); + + b.Property("PositionPathSideId") + .HasColumnType("char(36)"); + + b.Property("PositionPathSideObject") + .HasColumnType("longtext"); + + b.Property("PositionStatusId") + .HasColumnType("char(36)"); + + b.Property("PositionTypeId") + .HasColumnType("char(36)"); + + b.Property("Qualification") + .HasColumnType("longtext") + .HasColumnOrder(15) + .HasComment("คุณวุฒิ"); + + b.HasKey("Id"); + + b.HasIndex("PositionExecutiveId"); + + b.HasIndex("PositionExecutiveSideId"); + + b.HasIndex("PositionLineId"); + + b.HasIndex("PositionPathId"); + + b.HasIndex("PositionPathSideId"); + + b.HasIndex("PositionStatusId"); + + b.HasIndex("PositionTypeId"); + + b.ToTable("PositionMasters"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.PositionMasterHistoryEntity", 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("IsDirector") + .HasColumnType("tinyint(1)") + .HasColumnOrder(14) + .HasComment("IsDirector"); + + 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("Position") + .HasColumnType("longtext") + .HasColumnOrder(2) + .HasComment("Position"); + + b.Property("PositionCondition") + .HasColumnType("longtext") + .HasColumnOrder(11) + .HasComment("PositionCondition"); + + b.Property("PositionExecutive") + .HasColumnType("longtext") + .HasColumnOrder(5) + .HasComment("PositionExecutive"); + + b.Property("PositionExecutiveSide") + .HasColumnType("longtext") + .HasColumnOrder(6) + .HasComment("PositionExecutiveSide"); + + b.Property("PositionExecutiveSideObject") + .HasColumnType("longtext"); + + b.Property("PositionLevel") + .HasColumnType("longtext") + .HasColumnOrder(12) + .HasComment("PositionLevel"); + + b.Property("PositionLine") + .HasColumnType("longtext") + .HasColumnOrder(8) + .HasComment("PositionLine"); + + b.Property("PositionMasterEntityId") + .HasColumnType("char(36)"); + + b.Property("PositionMasterUserNote") + .HasColumnType("longtext") + .HasColumnOrder(13) + .HasComment("PositionMasterUserNote"); + + b.Property("PositionPath") + .HasColumnType("longtext") + .HasColumnOrder(3) + .HasComment("PositionPath"); + + b.Property("PositionPathSide") + .HasColumnType("longtext") + .HasColumnOrder(7) + .HasComment("PositionPathSide"); + + b.Property("PositionPathSideObject") + .HasColumnType("longtext"); + + b.Property("PositionStatus") + .HasColumnType("longtext") + .HasColumnOrder(10) + .HasComment("PositionStatus"); + + b.Property("PositionType") + .HasColumnType("longtext") + .HasColumnOrder(4) + .HasComment("PositionType"); + + b.Property("Qualification") + .HasColumnType("longtext") + .HasColumnOrder(15) + .HasComment("คุณวุฒิ"); + + b.HasKey("Id"); + + b.HasIndex("PositionMasterEntityId"); + + b.ToTable("PositionMasterHistoryEntity"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.PositionNumberEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Name") + .HasMaxLength(300) + .HasColumnType("varchar(300)") + .HasColumnOrder(2) + .HasComment("ชื่อ"); + + b.Property("OrganizationShortNameId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationShortNameId"); + + b.ToTable("PositionNumbers"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.ProfilePosition", 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)"); + + b.Property("IsPublished") + .HasColumnType("tinyint(1)"); + + 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("OrganizationPositionId") + .HasColumnType("char(36)"); + + b.Property("ProfileId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationPositionId"); + + b.HasIndex("ProfileId"); + + b.ToTable("ProfilePositions"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Doc", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint", "DisciplineComplaint") + .WithMany("DisciplineComplaint_Docs") + .HasForeignKey("DisciplineComplaintId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineComplaint"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Profile", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint", "DisciplineComplaint") + .WithMany("DisciplineComplaint_Profiles") + .HasForeignKey("DisciplineComplaintId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineComplaint"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate") + .WithMany("DisciplineDisciplinarys") + .HasForeignKey("DisciplineInvestigateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineInvestigate"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DirectorInvestigate", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDirector", "DisciplineDirector") + .WithMany("DisciplineDisciplinary_DirectorInvestigates") + .HasForeignKey("DisciplineDirectorId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DirectorInvestigates") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDirector"); + + b.Navigation("DisciplineDisciplinary"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocComplaintInvestigate", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DocComplaintInvestigates") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocInvestigate", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DocInvestigates") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocInvestigateRelevant", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DocInvestigateRelevants") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocOther", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DocOthers") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocRecordAccuser", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DocRecordAccusers") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocSummaryEvidence", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DocSummaryEvidences") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocWitnesses", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DocWitnessess") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_ProfileComplaintInvestigate", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_ProfileComplaintInvestigates") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint", "DisciplineComplaint") + .WithMany("DisciplineInvestigates") + .HasForeignKey("DisciplineComplaintId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineComplaint"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigateRelevant_Doc", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate") + .WithMany("DisciplineInvestigateRelevant_Docs") + .HasForeignKey("DisciplineInvestigateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineInvestigate"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_Director", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDirector", "DisciplineDirector") + .WithMany("DisciplineInvestigate_Directors") + .HasForeignKey("DisciplineDirectorId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate") + .WithMany("DisciplineInvestigate_Directors") + .HasForeignKey("DisciplineInvestigateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDirector"); + + b.Navigation("DisciplineInvestigate"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_Doc", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate") + .WithMany("DisciplineInvestigate_Docs") + .HasForeignKey("DisciplineInvestigateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineInvestigate"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_DocComplaint", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate") + .WithMany("DisciplineInvestigate_DocComplaints") + .HasForeignKey("DisciplineInvestigateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineInvestigate"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_ProfileComplaint", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate") + .WithMany("DisciplineInvestigate_ProfileComplaints") + .HasForeignKey("DisciplineInvestigateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineInvestigate"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.LimitTypeLeave", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.LimitLeave", "LimitLeave") + .WithMany("LimitTypeLeaves") + .HasForeignKey("LimitLeaveId"); + + b.HasOne("BMA.EHR.Domain.Models.HR.TypeLeave", "TypeLeave") + .WithMany("LimitTypeLeaves") + .HasForeignKey("TypeLeaveId"); + + b.Navigation("LimitLeave"); + + b.Navigation("TypeLeave"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.Profile", b => + { + b.HasOne("BMA.EHR.Domain.Models.Documents.Document", "Avatar") + .WithMany() + .HasForeignKey("AvatarId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.Gender", "Gender") + .WithMany() + .HasForeignKey("GenderId"); + + b.HasOne("BMA.EHR.Domain.Models.HR.LimitLeave", "LimitLeave") + .WithMany("Profiles") + .HasForeignKey("LimitLeaveId"); + + b.HasOne("BMA.EHR.Domain.Models.Organizations.PositionNumberEntity", "PosNo") + .WithMany() + .HasForeignKey("PosNoId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionEmployeeGroup", "PositionEmployeeGroup") + .WithMany() + .HasForeignKey("PositionEmployeeGroupId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionEmployeeLevel", "PositionEmployeeLevel") + .WithMany() + .HasForeignKey("PositionEmployeeLevelId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionEmployeeLine", "PositionEmployeeLine") + .WithMany() + .HasForeignKey("PositionEmployeeLineId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionEmployeePosition", "PositionEmployeePosition") + .WithMany() + .HasForeignKey("PositionEmployeePositionId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionEmployeePositionSide", "PositionEmployeePositionSide") + .WithMany() + .HasForeignKey("PositionEmployeePositionSideId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionPath", "Position") + .WithMany() + .HasForeignKey("PositionId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionLevel", "PositionLevel") + .WithMany() + .HasForeignKey("PositionLevelId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionType", "PositionType") + .WithMany() + .HasForeignKey("PositionTypeId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.Prefix", "Prefix") + .WithMany() + .HasForeignKey("PrefixId"); + + b.Navigation("Avatar"); + + b.Navigation("Gender"); + + b.Navigation("LimitLeave"); + + b.Navigation("PosNo"); + + b.Navigation("Position"); + + b.Navigation("PositionEmployeeGroup"); + + b.Navigation("PositionEmployeeLevel"); + + b.Navigation("PositionEmployeeLine"); + + b.Navigation("PositionEmployeePosition"); + + b.Navigation("PositionEmployeePositionSide"); + + b.Navigation("PositionLevel"); + + b.Navigation("PositionType"); + + b.Navigation("Prefix"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAbility", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("Abilitys") + .HasForeignKey("ProfileId"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAbilityHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.ProfileAbility", "ProfileAbility") + .WithMany("ProfileAbilityHistorys") + .HasForeignKey("ProfileAbilityId"); + + b.Navigation("ProfileAbility"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAddressHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("AddressHistory") + .HasForeignKey("ProfileId"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAssessment", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("Assessments") + .HasForeignKey("ProfileId"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAssessmentHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.ProfileAssessment", "ProfileAssessment") + .WithMany("ProfileAssessmentHistorys") + .HasForeignKey("ProfileAssessmentId"); + + b.Navigation("ProfileAssessment"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAvatarHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.Documents.Document", "AvatarFile") + .WithMany() + .HasForeignKey("AvatarFileId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("AvatarHistory") + .HasForeignKey("ProfileId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("AvatarFile"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileCertificate", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("Certificates") + .HasForeignKey("ProfileId"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileCertificateHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.ProfileCertificate", "ProfileCertificate") + .WithMany("ProfileCertificateHistorys") + .HasForeignKey("ProfileCertificateId"); + + b.Navigation("ProfileCertificate"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileChangeName", b => + { + b.HasOne("BMA.EHR.Domain.Models.Documents.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId"); + + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("ChangeNames") + .HasForeignKey("ProfileId"); + + b.Navigation("Document"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileChangeNameHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.Documents.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId"); + + b.HasOne("BMA.EHR.Domain.Models.HR.ProfileChangeName", "ProfileChangeName") + .WithMany("ProfileChangeNameHistorys") + .HasForeignKey("ProfileChangeNameId"); + + b.Navigation("Document"); + + b.Navigation("ProfileChangeName"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileChildren", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("Childrens") + .HasForeignKey("ProfileId"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileChildrenHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.ProfileChildren", null) + .WithMany("ProfileChildrenHistorys") + .HasForeignKey("ProfileChildrenId"); + + b.HasOne("BMA.EHR.Domain.Models.HR.ProfileFamilyHistory", null) + .WithMany("Childrens") + .HasForeignKey("ProfileFamilyHistoryId"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileCoupleHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("CoupleHistory") + .HasForeignKey("ProfileId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileCurrentAddressHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("CurrentAddressHistory") + .HasForeignKey("ProfileId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileDiscipline", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("Disciplines") + .HasForeignKey("ProfileId"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileDisciplineHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.ProfileDiscipline", "ProfileDiscipline") + .WithMany("ProfileDisciplineHistorys") + .HasForeignKey("ProfileDisciplineId"); + + b.Navigation("ProfileDiscipline"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileDuty", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("Dutys") + .HasForeignKey("ProfileId"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileDutyHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.ProfileDuty", "ProfileDuty") + .WithMany("ProfileDutyHistorys") + .HasForeignKey("ProfileDutyId"); + + b.Navigation("ProfileDuty"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileEducation", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("Educations") + .HasForeignKey("ProfileId"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileEducationHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.ProfileEducation", "ProfileEducation") + .WithMany("ProfileEducationHistorys") + .HasForeignKey("ProfileEducationId"); + + b.Navigation("ProfileEducation"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileEmployment", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("Employments") + .HasForeignKey("ProfileId"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileFamilyHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("FamilyHistory") + .HasForeignKey("ProfileId"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileFatherHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("FatherHistory") + .HasForeignKey("ProfileId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileGovernmentHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("GovernmentHistory") + .HasForeignKey("ProfileId"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("ProfileHistory") + .HasForeignKey("ProfileId"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileHonor", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("Honors") + .HasForeignKey("ProfileId"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileHonorHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.ProfileHonor", "ProfileHonor") + .WithMany("ProfileHonorHistorys") + .HasForeignKey("ProfileHonorId"); + + b.Navigation("ProfileHonor"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileInsignia", b => + { + b.HasOne("BMA.EHR.Domain.Models.MetaData.Insignia", "Insignia") + .WithMany() + .HasForeignKey("InsigniaId"); + + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("Insignias") + .HasForeignKey("ProfileId"); + + b.Navigation("Insignia"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileInsigniaHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.ProfileInsignia", "ProfileInsignia") + .WithMany("ProfileInsigniaHistorys") + .HasForeignKey("ProfileInsigniaId"); + + b.Navigation("ProfileInsignia"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileLeave", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("Leaves") + .HasForeignKey("ProfileId"); + + b.HasOne("BMA.EHR.Domain.Models.HR.TypeLeave", "TypeLeave") + .WithMany() + .HasForeignKey("TypeLeaveId"); + + b.Navigation("Profile"); + + b.Navigation("TypeLeave"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileLeaveHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.ProfileLeave", "ProfileLeave") + .WithMany("ProfileLeaveHistorys") + .HasForeignKey("ProfileLeaveId"); + + b.HasOne("BMA.EHR.Domain.Models.HR.TypeLeave", "TypeLeave") + .WithMany() + .HasForeignKey("TypeLeaveId"); + + b.Navigation("ProfileLeave"); + + b.Navigation("TypeLeave"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileMotherHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("MotherHistory") + .HasForeignKey("ProfileId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileNopaid", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("Nopaids") + .HasForeignKey("ProfileId"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileNopaidHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.ProfileNopaid", "ProfileNopaid") + .WithMany("ProfileNopaidHistorys") + .HasForeignKey("ProfileNopaidId"); + + b.Navigation("ProfileNopaid"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileOther", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("Others") + .HasForeignKey("ProfileId"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileOtherHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.ProfileOther", "ProfileOther") + .WithMany("ProfileOtherHistorys") + .HasForeignKey("ProfileOtherId"); + + b.Navigation("ProfileOther"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfilePaper", b => + { + b.HasOne("BMA.EHR.Domain.Models.Documents.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("Papers") + .HasForeignKey("ProfileId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Document"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileRegistrationAddressHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("RegistrationAddressHistory") + .HasForeignKey("ProfileId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileSalary", b => + { + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionLevel", "PositionLevel") + .WithMany() + .HasForeignKey("PositionLevelId"); + + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("Salaries") + .HasForeignKey("ProfileId"); + + b.Navigation("PositionLevel"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileSalaryHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.ProfileSalary", "ProfileSalary") + .WithMany("ProfileSalaryHistorys") + .HasForeignKey("ProfileSalaryId"); + + b.Navigation("ProfileSalary"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileTraining", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany("Trainings") + .HasForeignKey("ProfileId"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileTrainingHistory", b => + { + b.HasOne("BMA.EHR.Domain.Models.HR.ProfileTraining", "ProfileTraining") + .WithMany("ProfileTrainingHistorys") + .HasForeignKey("ProfileTrainingId"); + + b.Navigation("ProfileTraining"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.District", b => + { + b.HasOne("BMA.EHR.Domain.Models.MetaData.Province", "Province") + .WithMany("Districts") + .HasForeignKey("ProvinceId"); + + b.Navigation("Province"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.Insignia", b => + { + b.HasOne("BMA.EHR.Domain.Models.MetaData.InsigniaType", "InsigniaType") + .WithMany() + .HasForeignKey("InsigniaTypeId"); + + b.Navigation("InsigniaType"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.Position", b => + { + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionExecutiveSide", "ExecutiveSide") + .WithMany() + .HasForeignKey("ExecutiveSideId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionPathSide", "PathSide") + .WithMany() + .HasForeignKey("PathSideId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionLevel", "PositionLevel") + .WithMany() + .HasForeignKey("PositionLevelId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionPath", "PositionPath") + .WithMany() + .HasForeignKey("PositionPathId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionType", "PositionType") + .WithMany() + .HasForeignKey("PositionTypeId"); + + b.Navigation("ExecutiveSide"); + + b.Navigation("PathSide"); + + b.Navigation("PositionLevel"); + + b.Navigation("PositionPath"); + + b.Navigation("PositionType"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.SubDistrict", b => + { + b.HasOne("BMA.EHR.Domain.Models.MetaData.District", "District") + .WithMany("SubDistricts") + .HasForeignKey("DistrictId"); + + b.Navigation("District"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.AvailablePositionLevelEntity", b => + { + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionLevel", "PositionLevel") + .WithMany() + .HasForeignKey("PositionLevelId"); + + b.HasOne("BMA.EHR.Domain.Models.Organizations.PositionMasterEntity", "PositionMaster") + .WithMany() + .HasForeignKey("PositionMasterId"); + + b.Navigation("PositionLevel"); + + b.Navigation("PositionMaster"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.OrganizationEntity", b => + { + b.HasOne("BMA.EHR.Domain.Models.MetaData.OrganizationFax", "OrganizationFax") + .WithMany() + .HasForeignKey("OrganizationFaxId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.OrganizationLevel", "OrganizationLevel") + .WithMany() + .HasForeignKey("OrganizationLevelId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.OrganizationOrganization", "OrganizationOrganization") + .WithMany() + .HasForeignKey("OrganizationOrganizationId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.OrganizationShortName", "OrganizationShortName") + .WithMany() + .HasForeignKey("OrganizationShortNameId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.OrganizationStatus", "OrganizationStatus") + .WithMany() + .HasForeignKey("OrganizationStatusId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.OrganizationTelExternal", "OrganizationTelExternal") + .WithMany() + .HasForeignKey("OrganizationTelExternalId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.OrganizationTelInternal", "OrganizationTelInternal") + .WithMany() + .HasForeignKey("OrganizationTelInternalId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.OrganizationType", "OrganizationType") + .WithMany() + .HasForeignKey("OrganizationTypeId"); + + b.HasOne("BMA.EHR.Domain.Models.Organizations.OrganizationEntity", "Parent") + .WithMany("Organizations") + .HasForeignKey("ParentId"); + + b.Navigation("OrganizationFax"); + + b.Navigation("OrganizationLevel"); + + b.Navigation("OrganizationOrganization"); + + b.Navigation("OrganizationShortName"); + + b.Navigation("OrganizationStatus"); + + b.Navigation("OrganizationTelExternal"); + + b.Navigation("OrganizationTelInternal"); + + b.Navigation("OrganizationType"); + + b.Navigation("Parent"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.OrganizationPositionEntity", b => + { + b.HasOne("BMA.EHR.Domain.Models.Organizations.OrganizationEntity", "Organization") + .WithMany() + .HasForeignKey("OrganizationId"); + + b.HasOne("BMA.EHR.Domain.Models.Organizations.PositionMasterEntity", "PositionMaster") + .WithMany() + .HasForeignKey("PositionMasterId"); + + b.HasOne("BMA.EHR.Domain.Models.Organizations.PositionNumberEntity", "PositionNumber") + .WithMany() + .HasForeignKey("PositionNumberId"); + + b.Navigation("Organization"); + + b.Navigation("PositionMaster"); + + b.Navigation("PositionNumber"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.PositionMasterEntity", b => + { + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionExecutive", "PositionExecutive") + .WithMany() + .HasForeignKey("PositionExecutiveId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionExecutiveSide", "PositionExecutiveSide") + .WithMany() + .HasForeignKey("PositionExecutiveSideId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionLine", "PositionLine") + .WithMany() + .HasForeignKey("PositionLineId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionPath", "PositionPath") + .WithMany() + .HasForeignKey("PositionPathId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionPathSide", "PositionPathSide") + .WithMany() + .HasForeignKey("PositionPathSideId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionStatus", "PositionStatus") + .WithMany() + .HasForeignKey("PositionStatusId"); + + b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionType", "PositionType") + .WithMany() + .HasForeignKey("PositionTypeId"); + + b.Navigation("PositionExecutive"); + + b.Navigation("PositionExecutiveSide"); + + b.Navigation("PositionLine"); + + b.Navigation("PositionPath"); + + b.Navigation("PositionPathSide"); + + b.Navigation("PositionStatus"); + + b.Navigation("PositionType"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.PositionMasterHistoryEntity", b => + { + b.HasOne("BMA.EHR.Domain.Models.Organizations.PositionMasterEntity", "PositionMasterEntity") + .WithMany("PositionMasterHistorys") + .HasForeignKey("PositionMasterEntityId"); + + b.Navigation("PositionMasterEntity"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.PositionNumberEntity", b => + { + b.HasOne("BMA.EHR.Domain.Models.MetaData.OrganizationShortName", "OrganizationShortName") + .WithMany() + .HasForeignKey("OrganizationShortNameId"); + + b.Navigation("OrganizationShortName"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.ProfilePosition", b => + { + b.HasOne("BMA.EHR.Domain.Models.Organizations.OrganizationPositionEntity", "OrganizationPosition") + .WithMany() + .HasForeignKey("OrganizationPositionId"); + + b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile") + .WithMany() + .HasForeignKey("ProfileId"); + + b.Navigation("OrganizationPosition"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint", b => + { + b.Navigation("DisciplineComplaint_Docs"); + + b.Navigation("DisciplineComplaint_Profiles"); + + b.Navigation("DisciplineInvestigates"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDirector", b => + { + b.Navigation("DisciplineDisciplinary_DirectorInvestigates"); + + b.Navigation("DisciplineInvestigate_Directors"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", b => + { + b.Navigation("DisciplineDisciplinary_DirectorInvestigates"); + + b.Navigation("DisciplineDisciplinary_DocComplaintInvestigates"); + + b.Navigation("DisciplineDisciplinary_DocInvestigateRelevants"); + + b.Navigation("DisciplineDisciplinary_DocInvestigates"); + + b.Navigation("DisciplineDisciplinary_DocOthers"); + + b.Navigation("DisciplineDisciplinary_DocRecordAccusers"); + + b.Navigation("DisciplineDisciplinary_DocSummaryEvidences"); + + b.Navigation("DisciplineDisciplinary_DocWitnessess"); + + b.Navigation("DisciplineDisciplinary_ProfileComplaintInvestigates"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", b => + { + b.Navigation("DisciplineDisciplinarys"); + + b.Navigation("DisciplineInvestigateRelevant_Docs"); + + b.Navigation("DisciplineInvestigate_Directors"); + + b.Navigation("DisciplineInvestigate_DocComplaints"); + + b.Navigation("DisciplineInvestigate_Docs"); + + b.Navigation("DisciplineInvestigate_ProfileComplaints"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.LimitLeave", b => + { + b.Navigation("LimitTypeLeaves"); + + b.Navigation("Profiles"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.Profile", b => + { + b.Navigation("Abilitys"); + + b.Navigation("AddressHistory"); + + b.Navigation("Assessments"); + + b.Navigation("AvatarHistory"); + + b.Navigation("Certificates"); + + b.Navigation("ChangeNames"); + + b.Navigation("Childrens"); + + b.Navigation("CoupleHistory"); + + b.Navigation("CurrentAddressHistory"); + + b.Navigation("Disciplines"); + + b.Navigation("Dutys"); + + b.Navigation("Educations"); + + b.Navigation("Employments"); + + b.Navigation("FamilyHistory"); + + b.Navigation("FatherHistory"); + + b.Navigation("GovernmentHistory"); + + b.Navigation("Honors"); + + b.Navigation("Insignias"); + + b.Navigation("Leaves"); + + b.Navigation("MotherHistory"); + + b.Navigation("Nopaids"); + + b.Navigation("Others"); + + b.Navigation("Papers"); + + b.Navigation("ProfileHistory"); + + b.Navigation("RegistrationAddressHistory"); + + b.Navigation("Salaries"); + + b.Navigation("Trainings"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAbility", b => + { + b.Navigation("ProfileAbilityHistorys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileAssessment", b => + { + b.Navigation("ProfileAssessmentHistorys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileCertificate", b => + { + b.Navigation("ProfileCertificateHistorys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileChangeName", b => + { + b.Navigation("ProfileChangeNameHistorys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileChildren", b => + { + b.Navigation("ProfileChildrenHistorys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileDiscipline", b => + { + b.Navigation("ProfileDisciplineHistorys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileDuty", b => + { + b.Navigation("ProfileDutyHistorys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileEducation", b => + { + b.Navigation("ProfileEducationHistorys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileFamilyHistory", b => + { + b.Navigation("Childrens"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileHonor", b => + { + b.Navigation("ProfileHonorHistorys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileInsignia", b => + { + b.Navigation("ProfileInsigniaHistorys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileLeave", b => + { + b.Navigation("ProfileLeaveHistorys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileNopaid", b => + { + b.Navigation("ProfileNopaidHistorys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileOther", b => + { + b.Navigation("ProfileOtherHistorys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileSalary", b => + { + b.Navigation("ProfileSalaryHistorys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileTraining", b => + { + b.Navigation("ProfileTrainingHistorys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.HR.TypeLeave", b => + { + b.Navigation("LimitTypeLeaves"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.District", b => + { + b.Navigation("SubDistricts"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.MetaData.Province", b => + { + b.Navigation("Districts"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.OrganizationEntity", b => + { + b.Navigation("Organizations"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Organizations.PositionMasterEntity", b => + { + b.Navigation("PositionMasterHistorys"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/BMA.EHR.Infrastructure/Migrations/DisciplineDb/20231124032627_add table DisciplineDisciplinary_DocWitnessess.cs b/BMA.EHR.Infrastructure/Migrations/DisciplineDb/20231124032627_add table DisciplineDisciplinary_DocWitnessess.cs new file mode 100644 index 00000000..04933cd6 --- /dev/null +++ b/BMA.EHR.Infrastructure/Migrations/DisciplineDb/20231124032627_add table DisciplineDisciplinary_DocWitnessess.cs @@ -0,0 +1,107 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb +{ + /// + public partial class addtableDisciplineDisciplinary_DocWitnessess : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "InvestigationDateStart", + table: "DisciplineInvestigates", + type: "datetime(6)", + nullable: true, + comment: "วันที่เริ่มการสืบสวน", + oldClrType: typeof(DateTime), + oldType: "datetime(6)", + oldNullable: true, + oldComment: "วันที่เริ่มการสอบสวน"); + + migrationBuilder.AlterColumn( + name: "InvestigationDateEnd", + table: "DisciplineInvestigates", + type: "datetime(6)", + nullable: true, + comment: "วันที่สิ้นสุดการสืบสวน", + oldClrType: typeof(DateTime), + oldType: "datetime(6)", + oldNullable: true, + oldComment: "วันที่สิ้นสุดการสอบสวน"); + + migrationBuilder.AlterColumn( + name: "InvestigationDateStart", + table: "DisciplineDisciplinarys", + type: "datetime(6)", + nullable: true, + comment: "วันที่เริ่มการสืบสวน", + oldClrType: typeof(DateTime), + oldType: "datetime(6)", + oldNullable: true, + oldComment: "วันที่เริ่มการสอบสวน"); + + migrationBuilder.AlterColumn( + name: "InvestigationDateEnd", + table: "DisciplineDisciplinarys", + type: "datetime(6)", + nullable: true, + comment: "วันที่สิ้นสุดการสืบสวน", + oldClrType: typeof(DateTime), + oldType: "datetime(6)", + oldNullable: true, + oldComment: "วันที่สิ้นสุดการสอบสวน"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "InvestigationDateStart", + table: "DisciplineInvestigates", + type: "datetime(6)", + nullable: true, + comment: "วันที่เริ่มการสอบสวน", + oldClrType: typeof(DateTime), + oldType: "datetime(6)", + oldNullable: true, + oldComment: "วันที่เริ่มการสืบสวน"); + + migrationBuilder.AlterColumn( + name: "InvestigationDateEnd", + table: "DisciplineInvestigates", + type: "datetime(6)", + nullable: true, + comment: "วันที่สิ้นสุดการสอบสวน", + oldClrType: typeof(DateTime), + oldType: "datetime(6)", + oldNullable: true, + oldComment: "วันที่สิ้นสุดการสืบสวน"); + + migrationBuilder.AlterColumn( + name: "InvestigationDateStart", + table: "DisciplineDisciplinarys", + type: "datetime(6)", + nullable: true, + comment: "วันที่เริ่มการสอบสวน", + oldClrType: typeof(DateTime), + oldType: "datetime(6)", + oldNullable: true, + oldComment: "วันที่เริ่มการสืบสวน"); + + migrationBuilder.AlterColumn( + name: "InvestigationDateEnd", + table: "DisciplineDisciplinarys", + type: "datetime(6)", + nullable: true, + comment: "วันที่สิ้นสุดการสอบสวน", + oldClrType: typeof(DateTime), + oldType: "datetime(6)", + oldNullable: true, + oldComment: "วันที่สิ้นสุดการสืบสวน"); + } + } +} diff --git a/BMA.EHR.Infrastructure/Migrations/DisciplineDb/DisciplineDbContextModelSnapshot.cs b/BMA.EHR.Infrastructure/Migrations/DisciplineDb/DisciplineDbContextModelSnapshot.cs index ba8541a7..f3aaf7e3 100644 --- a/BMA.EHR.Infrastructure/Migrations/DisciplineDb/DisciplineDbContextModelSnapshot.cs +++ b/BMA.EHR.Infrastructure/Migrations/DisciplineDb/DisciplineDbContextModelSnapshot.cs @@ -438,6 +438,797 @@ namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb b.ToTable("DisciplineDirectors"); }); + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("Appellant") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ผู้ร้องเรียน"); + + b.Property("ComplaintFrom") + .IsRequired() + .HasColumnType("longtext") + .HasComment("รับเรื่องร้องเรียนจาก ระบุว่ารับเรื่องมาจากใคร/หน่วยงานไหน (สตง., ปปช., ปปท., จดหมาย, อีเมล, โทรศัพท์, บอกกล่าว)"); + + b.Property("ConsideredAgency") + .HasColumnType("char(36)") + .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("DateConsideration") + .HasColumnType("datetime(6)") + .HasComment("วันที่กำหนดพิจารณา"); + + b.Property("DateNotification") + .HasColumnType("datetime(6)") + .HasComment("วันแจ้งเตือนล่วงหน้า"); + + b.Property("DateReceived") + .HasColumnType("datetime(6)") + .HasComment("วันที่รับเรื่อง เป็นวันที่ถือเป็นจุดเริ่มต้นของวินัยนั้น ๆ"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text") + .HasComment("รายละเอียดของเรื่องร้องเรียน"); + + b.Property("DisciplinaryCaseFault") + .HasColumnType("longtext") + .HasComment("กรณีความผิด"); + + b.Property("DisciplinaryDateAllegation") + .HasColumnType("datetime(6)") + .HasComment("วันที่รับทราบข้อกล่าวหา"); + + b.Property("DisciplinaryDateEvident") + .HasColumnType("datetime(6)") + .HasComment("วันที่สรุปพยานหลักฐาน"); + + b.Property("DisciplinaryFaultLevel") + .HasColumnType("longtext") + .HasComment("ระดับโทษความผิด กรณีไม่ร้ายแรง: ภาคทัณฑ์, ตัดเงินเดือน, ลดขั้นเงินเดือน | กรณีร้ายแรง: ปลดออก, ไล่ออก"); + + b.Property("DisciplinaryInvestigateAt") + .HasColumnType("longtext") + .HasComment("สอบสวนที่"); + + b.Property("DisciplinaryRecordAccuser") + .HasColumnType("longtext") + .HasComment("บันทึกถ้อยคำของผู้กล่าวหา"); + + b.Property("DisciplinaryRefLaw") + .HasColumnType("longtext") + .HasComment("อ้างอิงมาตราตามกฎหมาย"); + + b.Property("DisciplinarySummaryEvidence") + .HasColumnType("longtext") + .HasComment("สรุปพยานหลักฐานสนับสนุนข้อกล่าวหา"); + + b.Property("DisciplinaryWitnesses") + .HasColumnType("longtext") + .HasComment("พยานและบันทึกถ้อยคำพยาน"); + + b.Property("DisciplineInvestigateId") + .HasColumnType("char(36)"); + + b.Property("InvestigationCauseText") + .HasColumnType("longtext") + .HasComment("กรณีมีมูลต้องเลือกว่า 'ร้ายแรง' หรือ 'ไม่ร้ายแรง'"); + + b.Property("InvestigationDateEnd") + .HasColumnType("datetime(6)") + .HasComment("วันที่สิ้นสุดการสืบสวน"); + + b.Property("InvestigationDateStart") + .HasColumnType("datetime(6)") + .HasComment("วันที่เริ่มการสืบสวน"); + + b.Property("InvestigationDescription") + .HasColumnType("longtext") + .HasComment("รายละเอียดเกี่ยวกับการสืบสวน"); + + b.Property("InvestigationDetail") + .HasColumnType("longtext") + .HasComment("ลักษณะการสืบสวน (APPOINT_DIRECTORS คือ แต่งตั้งกรรมการสืบสวน, SECRET_INVESTIGATION คือ สืบสวนทางลับ, OTHER คือ อื่น ๆ)"); + + b.Property("InvestigationDetailOther") + .HasColumnType("longtext") + .HasComment("ลักษณะการสืบสวนกรณีเลือกอื่นๆ"); + + b.Property("InvestigationStatusResult") + .HasColumnType("longtext") + .HasComment("สถานะหรือผลการสืบสวน (NOT_SPECIFIED คือ ยังไม่ระบุ, HAVE_CAUSE คือ มีมูล, NO_CAUSE คือ ไม่มีมูล"); + + 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("LevelConsideration") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ระดับการพิจารณา 'ยังไม่ระบุ' (NORMAL คือ ปกติ, URGENT คือ ด่วน, VERY_URGENT คือ ด่วนมาก)"); + + b.Property("OffenseDetails") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ลักษณะความผิดครั้งแรกจะเป็น 'ยังไม่ระบุ' (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง)"); + + b.Property("Organization") + .HasColumnType("char(36)") + .HasComment("กรณีหน่วยงานใส่ id ของหน่วยงาน"); + + b.Property("RespondentType") + .IsRequired() + .HasColumnType("longtext") + .HasComment("ผู้ถูกร้องเรียน (PERSON คือ บุคคล, ORGANIZATION คือ หน่วยงาน, BANGKOK คือ กรุงเทพมหานคร)"); + + b.Property("Result") + .HasColumnType("longtext") + .HasComment("ผลการตรวจสอบ"); + + b.Property("ResultComplaint") + .HasColumnType("longtext") + .HasComment("ผลการตรวจสอบเรื่องร้องเรียน"); + + b.Property("ResultInvestigate") + .HasColumnType("longtext") + .HasComment("ผลการตรวจสอบเรื่องสืบสวน"); + + b.Property("Status") + .IsRequired() + .HasColumnType("longtext") + .HasComment("สถานะเรื่องร้องเรียน มีดังนี้ ใหม่ (NEW), ยุติเรื่อง (STOP), มีมูลส่งไปสืบสวนแล้ว (SEND_INVESTIGATE)"); + + b.Property("Title") + .IsRequired() + .HasColumnType("text") + .HasComment("เรื่องที่ร้องเรียน"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineInvestigateId"); + + b.ToTable("DisciplineDisciplinarys"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DirectorInvestigate", 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("DisciplineDirectorId") + .HasColumnType("char(36)"); + + b.Property("DisciplineDisciplinaryId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDirectorId"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.ToTable("DisciplineDisciplinary_DirectorInvestigates"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocComplaintInvestigate", 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("DisciplineDisciplinaryId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineDisciplinary_DocComplaintInvestigates"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocInvestigate", 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("DisciplineDisciplinaryId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineDisciplinary_DocInvestigates"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocInvestigateRelevant", 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("DisciplineDisciplinaryId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineDisciplinary_DocInvestigateRelevants"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocOther", 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("DisciplineDisciplinaryId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineDisciplinary_DocOthers"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocRecordAccuser", 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("DisciplineDisciplinaryId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineDisciplinary_DocRecordAccusers"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocSummaryEvidence", 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("DisciplineDisciplinaryId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineDisciplinary_DocSummaryEvidences"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocWitnesses", 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("DisciplineDisciplinaryId") + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.HasIndex("DocumentId"); + + b.ToTable("DisciplineDisciplinary_DocWitnessess"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_ProfileComplaintInvestigate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CitizenId") + .HasMaxLength(13) + .HasColumnType("varchar(13)") + .HasComment("รหัสบัตรประชาชน"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisciplineDisciplinaryId") + .HasColumnType("char(36)"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("ชื่อ"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .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("Organization") + .HasColumnType("longtext") + .HasComment("สังกัด"); + + b.Property("PersonId") + .HasColumnType("char(36)") + .HasComment("id อ้างอิง profile"); + + b.Property("PosNo") + .HasColumnType("longtext") + .HasComment("เลขที่ตำแหน่ง"); + + b.Property("Position") + .HasColumnType("longtext") + .HasComment("ตำแหน่ง"); + + b.Property("PositionLevel") + .HasColumnType("longtext") + .HasComment("ระดับ"); + + b.Property("Prefix") + .HasColumnType("longtext") + .HasComment("คำนำหน้า"); + + b.Property("Salary") + .HasColumnType("double") + .HasComment("เงินเดือน"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineDisciplinaryId"); + + b.ToTable("DisciplineDisciplinary_ProfileComplaintInvestigates"); + }); + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", b => { b.Property("Id") @@ -506,11 +1297,11 @@ namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb b.Property("InvestigationDateEnd") .HasColumnType("datetime(6)") - .HasComment("วันที่สิ้นสุดการสอบสวน"); + .HasComment("วันที่สิ้นสุดการสืบสวน"); b.Property("InvestigationDateStart") .HasColumnType("datetime(6)") - .HasComment("วันที่เริ่มการสอบสวน"); + .HasComment("วันที่เริ่มการสืบสวน"); b.Property("InvestigationDescription") .HasColumnType("longtext") @@ -839,7 +1630,7 @@ namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb b.ToTable("DisciplineInvestigate_DocComplaints"); }); - modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_Profile", b => + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_ProfileComplaint", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -938,7 +1729,7 @@ namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb b.HasIndex("DisciplineInvestigateId"); - b.ToTable("DisciplineInvestigate_Profiles"); + b.ToTable("DisciplineInvestigate_ProfileComplaints"); }); modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.Document", b => @@ -8920,6 +9711,180 @@ namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb b.Navigation("DisciplineComplaint"); }); + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate") + .WithMany("DisciplineDisciplinarys") + .HasForeignKey("DisciplineInvestigateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineInvestigate"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DirectorInvestigate", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDirector", "DisciplineDirector") + .WithMany("DisciplineDisciplinary_DirectorInvestigates") + .HasForeignKey("DisciplineDirectorId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DirectorInvestigates") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDirector"); + + b.Navigation("DisciplineDisciplinary"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocComplaintInvestigate", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DocComplaintInvestigates") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocInvestigate", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DocInvestigates") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocInvestigateRelevant", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DocInvestigateRelevants") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocOther", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DocOthers") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocRecordAccuser", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DocRecordAccusers") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocSummaryEvidence", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DocSummaryEvidences") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocWitnesses", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_DocWitnessess") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_ProfileComplaintInvestigate", b => + { + b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary") + .WithMany("DisciplineDisciplinary_ProfileComplaintInvestigates") + .HasForeignKey("DisciplineDisciplinaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineDisciplinary"); + }); + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", b => { b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint", "DisciplineComplaint") @@ -9007,10 +9972,10 @@ namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb b.Navigation("Document"); }); - modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_Profile", b => + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_ProfileComplaint", b => { b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate") - .WithMany("DisciplineInvestigate_Profiles") + .WithMany("DisciplineInvestigate_ProfileComplaints") .HasForeignKey("DisciplineInvestigateId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); @@ -9802,11 +10767,36 @@ namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDirector", b => { + b.Navigation("DisciplineDisciplinary_DirectorInvestigates"); + b.Navigation("DisciplineInvestigate_Directors"); }); + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", b => + { + b.Navigation("DisciplineDisciplinary_DirectorInvestigates"); + + b.Navigation("DisciplineDisciplinary_DocComplaintInvestigates"); + + b.Navigation("DisciplineDisciplinary_DocInvestigateRelevants"); + + b.Navigation("DisciplineDisciplinary_DocInvestigates"); + + b.Navigation("DisciplineDisciplinary_DocOthers"); + + b.Navigation("DisciplineDisciplinary_DocRecordAccusers"); + + b.Navigation("DisciplineDisciplinary_DocSummaryEvidences"); + + b.Navigation("DisciplineDisciplinary_DocWitnessess"); + + b.Navigation("DisciplineDisciplinary_ProfileComplaintInvestigates"); + }); + modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", b => { + b.Navigation("DisciplineDisciplinarys"); + b.Navigation("DisciplineInvestigateRelevant_Docs"); b.Navigation("DisciplineInvestigate_Directors"); @@ -9815,7 +10805,7 @@ namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb b.Navigation("DisciplineInvestigate_Docs"); - b.Navigation("DisciplineInvestigate_Profiles"); + b.Navigation("DisciplineInvestigate_ProfileComplaints"); }); modelBuilder.Entity("BMA.EHR.Domain.Models.HR.LimitLeave", b => diff --git a/BMA.EHR.Infrastructure/Persistence/DisciplineDbContext.cs b/BMA.EHR.Infrastructure/Persistence/DisciplineDbContext.cs index 7d82fe5c..3da9db0b 100644 --- a/BMA.EHR.Infrastructure/Persistence/DisciplineDbContext.cs +++ b/BMA.EHR.Infrastructure/Persistence/DisciplineDbContext.cs @@ -21,11 +21,22 @@ namespace BMA.EHR.Infrastructure.Persistence public DbSet DisciplineComplaint_Docs { get; set; } public DbSet DisciplineInvestigates { get; set; } - public DbSet DisciplineInvestigate_Profiles { get; set; } + public DbSet DisciplineInvestigate_ProfileComplaints { get; set; } public DbSet DisciplineInvestigate_DocComplaints { get; set; } public DbSet DisciplineInvestigate_Docs { get; set; } public DbSet DisciplineInvestigate_Directors { get; set; } public DbSet DisciplineInvestigateRelevant_Docs { get; set; } + + public DbSet DisciplineDisciplinarys { get; set; } + public DbSet DisciplineDisciplinary_ProfileComplaintInvestigates { get; set; } + public DbSet DisciplineDisciplinary_DocInvestigateRelevants { get; set; } + public DbSet DisciplineDisciplinary_DocInvestigates { get; set; } + public DbSet DisciplineDisciplinary_DocComplaintInvestigates { get; set; } + public DbSet DisciplineDisciplinary_DirectorInvestigates { get; set; } + public DbSet DisciplineDisciplinary_DocSummaryEvidences { get; set; } + public DbSet DisciplineDisciplinary_DocRecordAccusers { get; set; } + public DbSet DisciplineDisciplinary_DocWitnessess { get; set; } + public DbSet DisciplineDisciplinary_DocOthers { get; set; } public DbSet Documents { get; set; } #endregion