diff --git a/BMA.EHR.Command.Service/Controllers/OrderController.cs b/BMA.EHR.Command.Service/Controllers/OrderController.cs
index fd4ffb05..75b6f527 100644
--- a/BMA.EHR.Command.Service/Controllers/OrderController.cs
+++ b/BMA.EHR.Command.Service/Controllers/OrderController.cs
@@ -364,22 +364,27 @@ namespace BMA.EHR.Command.Service.Controllers
}
}
+ #region " Put and Post "
+
+ #region " C-PM-01 "
///
- /// PM7-22 : สร้างข้อมูลรายละเอียดการออกคำสั่ง
+ /// PM7-22 : สร้างข้อมูลรายละเอียดการออกคำสั่ง C-PM-01
///
///
/// เมื่อทำการอ่านข้อมูลจาก Relational Database สำเร็จ
/// ไม่ได้ Login เข้าระบบ
/// เมื่อเกิดข้อผิดพลาดในการทำงาน
- [HttpPost("detail")]
+ [HttpPost("c-pm-01/detail")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
- public async Task> PostAsync([FromBody] CreateCommandRequest req)
+ public async Task> PostType01Async([FromBody] CreateCommandRequest req)
{
try
{
+ var commandType = await _commandTypeRepository.GetByIdAsync(req.orderTypeValue);
+
var inserted = new Domain.Models.Commands.Core.Command
{
CommandNo = req.orderNo,
@@ -391,13 +396,16 @@ namespace BMA.EHR.Command.Service.Controllers
IssuerOrganizationName = req.orderByOrganizationName,
AuthorizedUserFullName = req.signatoryBy,
AuthorizedPosition = req.signatoryPosition,
+
+ CommandAffectDate = req.orderDate,
+ OwnerGovId = OcId,
+
+ // c-pm-01 ถึง c-pm-04
PlacementId = req.examRound,
- ConclusionRegisterNo = req.conclusionRegisterNo,
+ ConclusionRegisterNo = req.conclusionRegisterNo ?? "",
ConclusionRegisterDate = req.conclusionRegisterDate,
ConclusionResultNo = req.conclusionResultNo,
ConclusionResultDate = req.conclusionResultDate,
- CommandAffectDate = req.orderDate,
- OwnerGovId = OcId
};
@@ -412,18 +420,18 @@ namespace BMA.EHR.Command.Service.Controllers
}
///
- /// PM7-23 : แก้ไขข้อมูลรายละเอียดการออกคำสั่ง
+ /// PM7-23 : แก้ไขข้อมูลรายละเอียดการออกคำสั่ง C-PM-01
///
/// Record Id ของคำสั่ง
///
/// เมื่อทำการอ่านข้อมูลจาก Relational Database สำเร็จ
/// ไม่ได้ Login เข้าระบบ
/// เมื่อเกิดข้อผิดพลาดในการทำงาน
- [HttpPut("detail/{orderId}")]
+ [HttpPut("c-pm-01/detail/{orderId}")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
- public async Task> PutAsync(Guid orderId, [FromBody] CreateCommandRequest req)
+ public async Task> PutType01Async(Guid orderId, [FromBody] CreateCommandRequest req)
{
try
{
@@ -431,7 +439,7 @@ namespace BMA.EHR.Command.Service.Controllers
if (order == null)
throw new Exception(GlobalMessages.CommandNotFound);
- var placement = await _placementRepository.GetByIdAsync(req.examRound);
+
var commandType = await _commandTypeRepository.GetByIdAsync(req.orderTypeValue);
var status = await _commandStatusRepository.GetByIdAsync(order.CommandStatusId);
@@ -444,11 +452,632 @@ namespace BMA.EHR.Command.Service.Controllers
order.IssuerOrganizationName = req.orderByOrganizationName;
order.AuthorizedUserFullName = req.signatoryBy;
order.AuthorizedPosition = req.signatoryPosition;
+ order.CommandStatus = status!;
+ order.CommandAffectDate = req.orderDate;
+
+ // c-pm-01 ถึง c-pm-04
+
+ var placement = await _placementRepository.GetByIdAsync(req.examRound);
order.Placement = placement!;
order.ConclusionRegisterNo = req.conclusionRegisterNo;
order.ConclusionRegisterDate = req.conclusionRegisterDate;
order.ConclusionResultNo = req.conclusionResultNo;
order.ConclusionResultDate = req.conclusionResultDate;
+
+ var result = await _repository.UpdateAsync(order);
+
+ return Success(result);
+ }
+ catch
+ {
+ throw;
+ }
+ }
+
+ #endregion
+
+ #region " C-PM-02 "
+
+ ///
+ /// PM7-22 : สร้างข้อมูลรายละเอียดการออกคำสั่ง C-PM-02
+ ///
+ ///
+ /// เมื่อทำการอ่านข้อมูลจาก Relational Database สำเร็จ
+ /// ไม่ได้ Login เข้าระบบ
+ /// เมื่อเกิดข้อผิดพลาดในการทำงาน
+ [HttpPost("c-pm-02/detail")]
+ [ProducesResponseType(StatusCodes.Status200OK)]
+ [ProducesResponseType(StatusCodes.Status401Unauthorized)]
+ [ProducesResponseType(StatusCodes.Status500InternalServerError)]
+ public async Task> PostType02Async([FromBody] CreateCommandRequest req)
+ {
+ try
+ {
+ var commandType = await _commandTypeRepository.GetByIdAsync(req.orderTypeValue);
+
+ var inserted = new Domain.Models.Commands.Core.Command
+ {
+ CommandNo = req.orderNo,
+ CommandYear = req.orderYear.ToString(),
+ CommandSubject = req.orderTitle,
+ PositionName = req.registerPosition,
+ CommandTypeId = req.orderTypeValue,
+ IssuerOrganizationId = req.orderBy,
+ IssuerOrganizationName = req.orderByOrganizationName,
+ AuthorizedUserFullName = req.signatoryBy,
+ AuthorizedPosition = req.signatoryPosition,
+
+ CommandAffectDate = req.orderDate,
+ OwnerGovId = OcId,
+
+ // c-pm-01 ถึง c-pm-04
+ PlacementId = req.examRound,
+ ConclusionRegisterNo = req.conclusionRegisterNo ?? "",
+ ConclusionRegisterDate = req.conclusionRegisterDate,
+ ConclusionResultNo = req.conclusionResultNo,
+ ConclusionResultDate = req.conclusionResultDate,
+
+ };
+
+ var result = await _repository.AddAsync(inserted);
+
+ return Success(result);
+ }
+ catch
+ {
+ throw;
+ }
+ }
+
+ ///
+ /// PM7-23 : แก้ไขข้อมูลรายละเอียดการออกคำสั่ง C-PM-02
+ ///
+ /// Record Id ของคำสั่ง
+ ///
+ /// เมื่อทำการอ่านข้อมูลจาก Relational Database สำเร็จ
+ /// ไม่ได้ Login เข้าระบบ
+ /// เมื่อเกิดข้อผิดพลาดในการทำงาน
+ [HttpPut("c-pm-02/detail/{orderId}")]
+ [ProducesResponseType(StatusCodes.Status200OK)]
+ [ProducesResponseType(StatusCodes.Status401Unauthorized)]
+ [ProducesResponseType(StatusCodes.Status500InternalServerError)]
+ public async Task> PutType02Async(Guid orderId, [FromBody] CreateCommandRequest req)
+ {
+ try
+ {
+ var order = await _repository.GetByIdAsync(orderId);
+ if (order == null)
+ throw new Exception(GlobalMessages.CommandNotFound);
+
+
+ var commandType = await _commandTypeRepository.GetByIdAsync(req.orderTypeValue);
+ var status = await _commandStatusRepository.GetByIdAsync(order.CommandStatusId);
+
+ order.CommandNo = req.orderNo;
+ order.CommandYear = req.orderYear.ToString();
+ order.CommandSubject = req.orderTitle;
+ order.PositionName = req.registerPosition;
+ order.CommandType = commandType!;
+ order.IssuerOrganizationId = req.orderBy;
+ order.IssuerOrganizationName = req.orderByOrganizationName;
+ order.AuthorizedUserFullName = req.signatoryBy;
+ order.AuthorizedPosition = req.signatoryPosition;
+ order.CommandStatus = status!;
+ order.CommandAffectDate = req.orderDate;
+
+ // c-pm-01 ถึง c-pm-04
+
+ var placement = await _placementRepository.GetByIdAsync(req.examRound);
+ order.Placement = placement!;
+ order.ConclusionRegisterNo = req.conclusionRegisterNo;
+ order.ConclusionRegisterDate = req.conclusionRegisterDate;
+ order.ConclusionResultNo = req.conclusionResultNo;
+ order.ConclusionResultDate = req.conclusionResultDate;
+
+ var result = await _repository.UpdateAsync(order);
+
+ return Success(result);
+ }
+ catch
+ {
+ throw;
+ }
+ }
+
+ #endregion
+
+ #region " C-PM-03 "
+
+ ///
+ /// PM7-22 : สร้างข้อมูลรายละเอียดการออกคำสั่ง C-PM-03
+ ///
+ ///
+ /// เมื่อทำการอ่านข้อมูลจาก Relational Database สำเร็จ
+ /// ไม่ได้ Login เข้าระบบ
+ /// เมื่อเกิดข้อผิดพลาดในการทำงาน
+ [HttpPost("c-pm-03/detail")]
+ [ProducesResponseType(StatusCodes.Status200OK)]
+ [ProducesResponseType(StatusCodes.Status401Unauthorized)]
+ [ProducesResponseType(StatusCodes.Status500InternalServerError)]
+ public async Task> PostType03Async([FromBody] CreateCommandRequest req)
+ {
+ try
+ {
+ var commandType = await _commandTypeRepository.GetByIdAsync(req.orderTypeValue);
+
+ var inserted = new Domain.Models.Commands.Core.Command
+ {
+ CommandNo = req.orderNo,
+ CommandYear = req.orderYear.ToString(),
+ CommandSubject = req.orderTitle,
+ PositionName = req.registerPosition,
+ CommandTypeId = req.orderTypeValue,
+ IssuerOrganizationId = req.orderBy,
+ IssuerOrganizationName = req.orderByOrganizationName,
+ AuthorizedUserFullName = req.signatoryBy,
+ AuthorizedPosition = req.signatoryPosition,
+
+ CommandAffectDate = req.orderDate,
+ OwnerGovId = OcId,
+
+ // c-pm-01 ถึง c-pm-04
+ PlacementId = req.examRound,
+ ConclusionRegisterNo = req.conclusionRegisterNo ?? "",
+ ConclusionRegisterDate = req.conclusionRegisterDate,
+ ConclusionResultNo = req.conclusionResultNo,
+ ConclusionResultDate = req.conclusionResultDate,
+
+ };
+
+ var result = await _repository.AddAsync(inserted);
+
+ return Success(result);
+ }
+ catch
+ {
+ throw;
+ }
+ }
+
+ ///
+ /// PM7-23 : แก้ไขข้อมูลรายละเอียดการออกคำสั่ง C-PM-04
+ ///
+ /// Record Id ของคำสั่ง
+ ///
+ /// เมื่อทำการอ่านข้อมูลจาก Relational Database สำเร็จ
+ /// ไม่ได้ Login เข้าระบบ
+ /// เมื่อเกิดข้อผิดพลาดในการทำงาน
+ [HttpPut("c-pm-03/detail/{orderId}")]
+ [ProducesResponseType(StatusCodes.Status200OK)]
+ [ProducesResponseType(StatusCodes.Status401Unauthorized)]
+ [ProducesResponseType(StatusCodes.Status500InternalServerError)]
+ public async Task> PutType03Async(Guid orderId, [FromBody] CreateCommandRequest req)
+ {
+ try
+ {
+ var order = await _repository.GetByIdAsync(orderId);
+ if (order == null)
+ throw new Exception(GlobalMessages.CommandNotFound);
+
+
+ var commandType = await _commandTypeRepository.GetByIdAsync(req.orderTypeValue);
+ var status = await _commandStatusRepository.GetByIdAsync(order.CommandStatusId);
+
+ order.CommandNo = req.orderNo;
+ order.CommandYear = req.orderYear.ToString();
+ order.CommandSubject = req.orderTitle;
+ order.PositionName = req.registerPosition;
+ order.CommandType = commandType!;
+ order.IssuerOrganizationId = req.orderBy;
+ order.IssuerOrganizationName = req.orderByOrganizationName;
+ order.AuthorizedUserFullName = req.signatoryBy;
+ order.AuthorizedPosition = req.signatoryPosition;
+ order.CommandStatus = status!;
+ order.CommandAffectDate = req.orderDate;
+
+ // c-pm-01 ถึง c-pm-04
+
+ var placement = await _placementRepository.GetByIdAsync(req.examRound);
+ order.Placement = placement!;
+ order.ConclusionRegisterNo = req.conclusionRegisterNo;
+ order.ConclusionRegisterDate = req.conclusionRegisterDate;
+ order.ConclusionResultNo = req.conclusionResultNo;
+ order.ConclusionResultDate = req.conclusionResultDate;
+
+ var result = await _repository.UpdateAsync(order);
+
+ return Success(result);
+ }
+ catch
+ {
+ throw;
+ }
+ }
+
+ #endregion
+
+ #region " C-PM-04 "
+
+ ///
+ /// PM7-22 : สร้างข้อมูลรายละเอียดการออกคำสั่ง C-PM-04
+ ///
+ ///
+ /// เมื่อทำการอ่านข้อมูลจาก Relational Database สำเร็จ
+ /// ไม่ได้ Login เข้าระบบ
+ /// เมื่อเกิดข้อผิดพลาดในการทำงาน
+ [HttpPost("c-pm-04/detail")]
+ [ProducesResponseType(StatusCodes.Status200OK)]
+ [ProducesResponseType(StatusCodes.Status401Unauthorized)]
+ [ProducesResponseType(StatusCodes.Status500InternalServerError)]
+ public async Task> PostType04Async([FromBody] CreateCommandRequest req)
+ {
+ try
+ {
+ var commandType = await _commandTypeRepository.GetByIdAsync(req.orderTypeValue);
+
+ var inserted = new Domain.Models.Commands.Core.Command
+ {
+ CommandNo = req.orderNo,
+ CommandYear = req.orderYear.ToString(),
+ CommandSubject = req.orderTitle,
+ PositionName = req.registerPosition,
+ CommandTypeId = req.orderTypeValue,
+ IssuerOrganizationId = req.orderBy,
+ IssuerOrganizationName = req.orderByOrganizationName,
+ AuthorizedUserFullName = req.signatoryBy,
+ AuthorizedPosition = req.signatoryPosition,
+
+ CommandAffectDate = req.orderDate,
+ OwnerGovId = OcId,
+
+ // c-pm-01 ถึง c-pm-04
+ PlacementId = req.examRound,
+ ConclusionRegisterNo = req.conclusionRegisterNo ?? "",
+ ConclusionRegisterDate = req.conclusionRegisterDate,
+ ConclusionResultNo = req.conclusionResultNo,
+ ConclusionResultDate = req.conclusionResultDate,
+
+ };
+
+ var result = await _repository.AddAsync(inserted);
+
+ return Success(result);
+ }
+ catch
+ {
+ throw;
+ }
+ }
+
+ ///
+ /// PM7-23 : แก้ไขข้อมูลรายละเอียดการออกคำสั่ง C-PM-04
+ ///
+ /// Record Id ของคำสั่ง
+ ///
+ /// เมื่อทำการอ่านข้อมูลจาก Relational Database สำเร็จ
+ /// ไม่ได้ Login เข้าระบบ
+ /// เมื่อเกิดข้อผิดพลาดในการทำงาน
+ [HttpPut("c-pm-04/detail/{orderId}")]
+ [ProducesResponseType(StatusCodes.Status200OK)]
+ [ProducesResponseType(StatusCodes.Status401Unauthorized)]
+ [ProducesResponseType(StatusCodes.Status500InternalServerError)]
+ public async Task> PutType04Async(Guid orderId, [FromBody] CreateCommandRequest req)
+ {
+ try
+ {
+ var order = await _repository.GetByIdAsync(orderId);
+ if (order == null)
+ throw new Exception(GlobalMessages.CommandNotFound);
+
+
+ var commandType = await _commandTypeRepository.GetByIdAsync(req.orderTypeValue);
+ var status = await _commandStatusRepository.GetByIdAsync(order.CommandStatusId);
+
+ order.CommandNo = req.orderNo;
+ order.CommandYear = req.orderYear.ToString();
+ order.CommandSubject = req.orderTitle;
+ order.PositionName = req.registerPosition;
+ order.CommandType = commandType!;
+ order.IssuerOrganizationId = req.orderBy;
+ order.IssuerOrganizationName = req.orderByOrganizationName;
+ order.AuthorizedUserFullName = req.signatoryBy;
+ order.AuthorizedPosition = req.signatoryPosition;
+ order.CommandStatus = status!;
+ order.CommandAffectDate = req.orderDate;
+
+ // c-pm-01 ถึง c-pm-04
+
+ var placement = await _placementRepository.GetByIdAsync(req.examRound);
+ order.Placement = placement!;
+ order.ConclusionRegisterNo = req.conclusionRegisterNo;
+ order.ConclusionRegisterDate = req.conclusionRegisterDate;
+ order.ConclusionResultNo = req.conclusionResultNo;
+ order.ConclusionResultDate = req.conclusionResultDate;
+
+ var result = await _repository.UpdateAsync(order);
+
+ return Success(result);
+ }
+ catch
+ {
+ throw;
+ }
+ }
+
+ #endregion
+
+ #region " C-PM-05 "
+
+ ///
+ /// PM7-22 : สร้างข้อมูลรายละเอียดการออกคำสั่ง C-PM-05
+ ///
+ ///
+ /// เมื่อทำการอ่านข้อมูลจาก Relational Database สำเร็จ
+ /// ไม่ได้ Login เข้าระบบ
+ /// เมื่อเกิดข้อผิดพลาดในการทำงาน
+ [HttpPost("c-pm-05/detail")]
+ [ProducesResponseType(StatusCodes.Status200OK)]
+ [ProducesResponseType(StatusCodes.Status401Unauthorized)]
+ [ProducesResponseType(StatusCodes.Status500InternalServerError)]
+ public async Task> PostType05Async([FromBody] CreateCommandGroup2Request req)
+ {
+ try
+ {
+ var commandType = await _commandTypeRepository.GetByIdAsync(req.orderTypeValue);
+
+ var inserted = new Domain.Models.Commands.Core.Command
+ {
+ CommandNo = req.orderNo,
+ CommandYear = req.orderYear.ToString(),
+ CommandSubject = req.orderTitle,
+ CommandTypeId = req.orderTypeValue,
+ IssuerOrganizationId = req.orderBy,
+ IssuerOrganizationName = req.orderByOrganizationName,
+ AuthorizedUserFullName = req.signatoryBy,
+ AuthorizedPosition = req.signatoryPosition,
+
+ CommandAffectDate = req.orderDate,
+ OwnerGovId = OcId,
+
+ ConclusionMeetingNo = req.conclusionMeetingNo,
+ ConclusionMeetingDate = req.conclusionMeetingDate,
+
+ };
+
+ var result = await _repository.AddAsync(inserted);
+
+ return Success(result);
+ }
+ catch
+ {
+ throw;
+ }
+ }
+
+ ///
+ /// PM7-23 : แก้ไขข้อมูลรายละเอียดการออกคำสั่ง C-PM-05
+ ///
+ /// Record Id ของคำสั่ง
+ ///
+ /// เมื่อทำการอ่านข้อมูลจาก Relational Database สำเร็จ
+ /// ไม่ได้ Login เข้าระบบ
+ /// เมื่อเกิดข้อผิดพลาดในการทำงาน
+ [HttpPut("c-pm-05/detail/{orderId}")]
+ [ProducesResponseType(StatusCodes.Status200OK)]
+ [ProducesResponseType(StatusCodes.Status401Unauthorized)]
+ [ProducesResponseType(StatusCodes.Status500InternalServerError)]
+ public async Task> PutType05Async(Guid orderId, [FromBody] CreateCommandGroup2Request req)
+ {
+ try
+ {
+ var order = await _repository.GetByIdAsync(orderId);
+ if (order == null)
+ throw new Exception(GlobalMessages.CommandNotFound);
+
+
+ var commandType = await _commandTypeRepository.GetByIdAsync(req.orderTypeValue);
+ var status = await _commandStatusRepository.GetByIdAsync(order.CommandStatusId);
+
+ order.CommandNo = req.orderNo;
+ order.CommandYear = req.orderYear.ToString();
+ order.CommandSubject = req.orderTitle;
+ order.CommandType = commandType!;
+ order.IssuerOrganizationId = req.orderBy;
+ order.IssuerOrganizationName = req.orderByOrganizationName;
+ order.AuthorizedUserFullName = req.signatoryBy;
+ order.AuthorizedPosition = req.signatoryPosition;
+ order.CommandStatus = status!;
+ order.CommandAffectDate = req.orderDate;
+
+ order.ConclusionMeetingNo = req.conclusionMeetingNo;
+ order.ConclusionMeetingDate = req.conclusionMeetingDate;
+
+ var result = await _repository.UpdateAsync(order);
+
+ return Success(result);
+ }
+ catch
+ {
+ throw;
+ }
+ }
+
+ #endregion
+
+ #region " C-PM-06 "
+
+ ///
+ /// PM7-22 : สร้างข้อมูลรายละเอียดการออกคำสั่ง C-PM-06
+ ///
+ ///
+ /// เมื่อทำการอ่านข้อมูลจาก Relational Database สำเร็จ
+ /// ไม่ได้ Login เข้าระบบ
+ /// เมื่อเกิดข้อผิดพลาดในการทำงาน
+ [HttpPost("c-pm-06/detail")]
+ [ProducesResponseType(StatusCodes.Status200OK)]
+ [ProducesResponseType(StatusCodes.Status401Unauthorized)]
+ [ProducesResponseType(StatusCodes.Status500InternalServerError)]
+ public async Task> PostType06Async([FromBody] CreateCommandGroup2Request req)
+ {
+ try
+ {
+ var commandType = await _commandTypeRepository.GetByIdAsync(req.orderTypeValue);
+
+ var inserted = new Domain.Models.Commands.Core.Command
+ {
+ CommandNo = req.orderNo,
+ CommandYear = req.orderYear.ToString(),
+ CommandSubject = req.orderTitle,
+ CommandTypeId = req.orderTypeValue,
+ IssuerOrganizationId = req.orderBy,
+ IssuerOrganizationName = req.orderByOrganizationName,
+ AuthorizedUserFullName = req.signatoryBy,
+ AuthorizedPosition = req.signatoryPosition,
+
+ CommandAffectDate = req.orderDate,
+ OwnerGovId = OcId,
+
+ ConclusionMeetingNo = req.conclusionMeetingNo,
+ ConclusionMeetingDate = req.conclusionMeetingDate,
+
+ };
+
+ var result = await _repository.AddAsync(inserted);
+
+ return Success(result);
+ }
+ catch
+ {
+ throw;
+ }
+ }
+
+ ///
+ /// PM7-23 : แก้ไขข้อมูลรายละเอียดการออกคำสั่ง C-PM-06
+ ///
+ /// Record Id ของคำสั่ง
+ ///
+ /// เมื่อทำการอ่านข้อมูลจาก Relational Database สำเร็จ
+ /// ไม่ได้ Login เข้าระบบ
+ /// เมื่อเกิดข้อผิดพลาดในการทำงาน
+ [HttpPut("c-pm-06/detail/{orderId}")]
+ [ProducesResponseType(StatusCodes.Status200OK)]
+ [ProducesResponseType(StatusCodes.Status401Unauthorized)]
+ [ProducesResponseType(StatusCodes.Status500InternalServerError)]
+ public async Task> PutType06Async(Guid orderId, [FromBody] CreateCommandGroup2Request req)
+ {
+ try
+ {
+ var order = await _repository.GetByIdAsync(orderId);
+ if (order == null)
+ throw new Exception(GlobalMessages.CommandNotFound);
+
+
+ var commandType = await _commandTypeRepository.GetByIdAsync(req.orderTypeValue);
+ var status = await _commandStatusRepository.GetByIdAsync(order.CommandStatusId);
+
+ order.CommandNo = req.orderNo;
+ order.CommandYear = req.orderYear.ToString();
+ order.CommandSubject = req.orderTitle;
+ order.CommandType = commandType!;
+ order.IssuerOrganizationId = req.orderBy;
+ order.IssuerOrganizationName = req.orderByOrganizationName;
+ order.AuthorizedUserFullName = req.signatoryBy;
+ order.AuthorizedPosition = req.signatoryPosition;
+ order.CommandStatus = status!;
+ order.CommandAffectDate = req.orderDate;
+
+ order.ConclusionMeetingNo = req.conclusionMeetingNo;
+ order.ConclusionMeetingDate = req.conclusionMeetingDate;
+
+ var result = await _repository.UpdateAsync(order);
+
+ return Success(result);
+ }
+ catch
+ {
+ throw;
+ }
+ }
+
+ #endregion
+
+ #region " C-PM-07 "
+
+ ///
+ /// PM7-22 : สร้างข้อมูลรายละเอียดการออกคำสั่ง C-PM-07
+ ///
+ ///
+ /// เมื่อทำการอ่านข้อมูลจาก Relational Database สำเร็จ
+ /// ไม่ได้ Login เข้าระบบ
+ /// เมื่อเกิดข้อผิดพลาดในการทำงาน
+ [HttpPost("c-pm-07/detail")]
+ [ProducesResponseType(StatusCodes.Status200OK)]
+ [ProducesResponseType(StatusCodes.Status401Unauthorized)]
+ [ProducesResponseType(StatusCodes.Status500InternalServerError)]
+ public async Task> PostType07Async([FromBody] CreateCommandGroup3Request req)
+ {
+ try
+ {
+ var commandType = await _commandTypeRepository.GetByIdAsync(req.orderTypeValue);
+
+ var inserted = new Domain.Models.Commands.Core.Command
+ {
+ CommandNo = req.orderNo,
+ CommandYear = req.orderYear.ToString(),
+ CommandSubject = req.orderTitle,
+ CommandTypeId = req.orderTypeValue,
+ IssuerOrganizationId = req.orderBy,
+ IssuerOrganizationName = req.orderByOrganizationName,
+ AuthorizedUserFullName = req.signatoryBy,
+ AuthorizedPosition = req.signatoryPosition,
+
+ CommandAffectDate = req.orderDate,
+ OwnerGovId = OcId,
+ };
+
+ var result = await _repository.AddAsync(inserted);
+
+ return Success(result);
+ }
+ catch
+ {
+ throw;
+ }
+ }
+
+ ///
+ /// PM7-23 : แก้ไขข้อมูลรายละเอียดการออกคำสั่ง C-PM-07
+ ///
+ /// Record Id ของคำสั่ง
+ ///
+ /// เมื่อทำการอ่านข้อมูลจาก Relational Database สำเร็จ
+ /// ไม่ได้ Login เข้าระบบ
+ /// เมื่อเกิดข้อผิดพลาดในการทำงาน
+ [HttpPut("c-pm-07/detail/{orderId}")]
+ [ProducesResponseType(StatusCodes.Status200OK)]
+ [ProducesResponseType(StatusCodes.Status401Unauthorized)]
+ [ProducesResponseType(StatusCodes.Status500InternalServerError)]
+ public async Task> PutType07Async(Guid orderId, [FromBody] CreateCommandGroup3Request req)
+ {
+ try
+ {
+ var order = await _repository.GetByIdAsync(orderId);
+ if (order == null)
+ throw new Exception(GlobalMessages.CommandNotFound);
+
+
+ var commandType = await _commandTypeRepository.GetByIdAsync(req.orderTypeValue);
+ var status = await _commandStatusRepository.GetByIdAsync(order.CommandStatusId);
+
+ order.CommandNo = req.orderNo;
+ order.CommandYear = req.orderYear.ToString();
+ order.CommandSubject = req.orderTitle;
+ order.CommandType = commandType!;
+ order.IssuerOrganizationId = req.orderBy;
+ order.IssuerOrganizationName = req.orderByOrganizationName;
+ order.AuthorizedUserFullName = req.signatoryBy;
+ order.AuthorizedPosition = req.signatoryPosition;
order.CommandStatus = status!;
order.CommandAffectDate = req.orderDate;
@@ -462,6 +1091,211 @@ namespace BMA.EHR.Command.Service.Controllers
}
}
+ #endregion
+
+ #region " C-PM-08 "
+
+ ///
+ /// PM7-22 : สร้างข้อมูลรายละเอียดการออกคำสั่ง C-PM-08
+ ///
+ ///
+ /// เมื่อทำการอ่านข้อมูลจาก Relational Database สำเร็จ
+ /// ไม่ได้ Login เข้าระบบ
+ /// เมื่อเกิดข้อผิดพลาดในการทำงาน
+ [HttpPost("c-pm-08/detail")]
+ [ProducesResponseType(StatusCodes.Status200OK)]
+ [ProducesResponseType(StatusCodes.Status401Unauthorized)]
+ [ProducesResponseType(StatusCodes.Status500InternalServerError)]
+ public async Task> PostType08Async([FromBody] CreateCommandGroup4Request req)
+ {
+ try
+ {
+ var commandType = await _commandTypeRepository.GetByIdAsync(req.orderTypeValue);
+
+ var inserted = new Domain.Models.Commands.Core.Command
+ {
+ CommandNo = req.orderNo,
+ CommandYear = req.orderYear.ToString(),
+ CommandSubject = req.orderTitle,
+ CommandTypeId = req.orderTypeValue,
+ IssuerOrganizationId = req.orderBy,
+ IssuerOrganizationName = req.orderByOrganizationName,
+ AuthorizedUserFullName = req.signatoryBy,
+ AuthorizedPosition = req.signatoryPosition,
+
+ CommandAffectDate = req.orderDate,
+ OwnerGovId = OcId,
+
+ ConclusionReturnNo = req.conclusionReturnNo,
+ ConclusionReturnDate = req.conclusionReturnDate,
+ };
+
+ var result = await _repository.AddAsync(inserted);
+
+ return Success(result);
+ }
+ catch
+ {
+ throw;
+ }
+ }
+
+ ///
+ /// PM7-23 : แก้ไขข้อมูลรายละเอียดการออกคำสั่ง C-PM-08
+ ///
+ /// Record Id ของคำสั่ง
+ ///
+ /// เมื่อทำการอ่านข้อมูลจาก Relational Database สำเร็จ
+ /// ไม่ได้ Login เข้าระบบ
+ /// เมื่อเกิดข้อผิดพลาดในการทำงาน
+ [HttpPut("c-pm-08/detail/{orderId}")]
+ [ProducesResponseType(StatusCodes.Status200OK)]
+ [ProducesResponseType(StatusCodes.Status401Unauthorized)]
+ [ProducesResponseType(StatusCodes.Status500InternalServerError)]
+ public async Task> PutType08Async(Guid orderId, [FromBody] CreateCommandGroup4Request req)
+ {
+ try
+ {
+ var order = await _repository.GetByIdAsync(orderId);
+ if (order == null)
+ throw new Exception(GlobalMessages.CommandNotFound);
+
+
+ var commandType = await _commandTypeRepository.GetByIdAsync(req.orderTypeValue);
+ var status = await _commandStatusRepository.GetByIdAsync(order.CommandStatusId);
+
+ order.CommandNo = req.orderNo;
+ order.CommandYear = req.orderYear.ToString();
+ order.CommandSubject = req.orderTitle;
+ order.CommandType = commandType!;
+ order.IssuerOrganizationId = req.orderBy;
+ order.IssuerOrganizationName = req.orderByOrganizationName;
+ order.AuthorizedUserFullName = req.signatoryBy;
+ order.AuthorizedPosition = req.signatoryPosition;
+ order.CommandStatus = status!;
+ order.CommandAffectDate = req.orderDate;
+
+
+ order.ConclusionReturnNo = req.conclusionReturnNo;
+ order.ConclusionReturnDate = req.conclusionReturnDate;
+
+ var result = await _repository.UpdateAsync(order);
+
+ return Success(result);
+ }
+ catch
+ {
+ throw;
+ }
+ }
+
+ #endregion
+
+ #region " C-PM-09 "
+
+ ///
+ /// PM7-22 : สร้างข้อมูลรายละเอียดการออกคำสั่ง C-PM-09
+ ///
+ ///
+ /// เมื่อทำการอ่านข้อมูลจาก Relational Database สำเร็จ
+ /// ไม่ได้ Login เข้าระบบ
+ /// เมื่อเกิดข้อผิดพลาดในการทำงาน
+ [HttpPost("c-pm-09/detail")]
+ [ProducesResponseType(StatusCodes.Status200OK)]
+ [ProducesResponseType(StatusCodes.Status401Unauthorized)]
+ [ProducesResponseType(StatusCodes.Status500InternalServerError)]
+ public async Task> PostType09Async([FromBody] CreateCommandGroup5Request req)
+ {
+ try
+ {
+ var commandType = await _commandTypeRepository.GetByIdAsync(req.orderTypeValue);
+
+ var inserted = new Domain.Models.Commands.Core.Command
+ {
+ CommandNo = req.orderNo,
+ CommandYear = req.orderYear.ToString(),
+ CommandSubject = req.orderTitle,
+ CommandTypeId = req.orderTypeValue,
+ IssuerOrganizationId = req.orderBy,
+ IssuerOrganizationName = req.orderByOrganizationName,
+ AuthorizedUserFullName = req.signatoryBy,
+ AuthorizedPosition = req.signatoryPosition,
+
+ CommandAffectDate = req.orderDate,
+ OwnerGovId = OcId,
+
+ ConclusionReturnNo = req.conclusionReturnNo,
+ ConclusionReturnDate = req.conclusionReturnDate,
+ SourceOrganizationName = req.sourceOrganizationName,
+ MilitaryCommandNo = req.militaryCommandNo,
+ MilitaryCommanDate = req.militaryCommandDate
+ };
+
+ var result = await _repository.AddAsync(inserted);
+
+ return Success(result);
+ }
+ catch
+ {
+ throw;
+ }
+ }
+
+ ///
+ /// PM7-23 : แก้ไขข้อมูลรายละเอียดการออกคำสั่ง C-PM-09
+ ///
+ /// Record Id ของคำสั่ง
+ ///
+ /// เมื่อทำการอ่านข้อมูลจาก Relational Database สำเร็จ
+ /// ไม่ได้ Login เข้าระบบ
+ /// เมื่อเกิดข้อผิดพลาดในการทำงาน
+ [HttpPut("c-pm-09/detail/{orderId}")]
+ [ProducesResponseType(StatusCodes.Status200OK)]
+ [ProducesResponseType(StatusCodes.Status401Unauthorized)]
+ [ProducesResponseType(StatusCodes.Status500InternalServerError)]
+ public async Task> PutType09Async(Guid orderId, [FromBody] CreateCommandGroup5Request req)
+ {
+ try
+ {
+ var order = await _repository.GetByIdAsync(orderId);
+ if (order == null)
+ throw new Exception(GlobalMessages.CommandNotFound);
+
+
+ var commandType = await _commandTypeRepository.GetByIdAsync(req.orderTypeValue);
+ var status = await _commandStatusRepository.GetByIdAsync(order.CommandStatusId);
+
+ order.CommandNo = req.orderNo;
+ order.CommandYear = req.orderYear.ToString();
+ order.CommandSubject = req.orderTitle;
+ order.CommandType = commandType!;
+ order.IssuerOrganizationId = req.orderBy;
+ order.IssuerOrganizationName = req.orderByOrganizationName;
+ order.AuthorizedUserFullName = req.signatoryBy;
+ order.AuthorizedPosition = req.signatoryPosition;
+ order.CommandStatus = status!;
+ order.CommandAffectDate = req.orderDate;
+
+
+ order.ConclusionReturnNo = req.conclusionReturnNo;
+ order.ConclusionReturnDate = req.conclusionReturnDate;
+ order.SourceOrganizationName = req.sourceOrganizationName;
+ order.MilitaryCommandNo = req.militaryCommandNo;
+ order.MilitaryCommanDate = req.militaryCommandDate;
+
+ var result = await _repository.UpdateAsync(order);
+
+ return Success(result);
+ }
+ catch
+ {
+ throw;
+ }
+ }
+
+ #endregion
+
+ #endregion
///
/// PM7-24 : dropdown รอบการสอบ หน้ารายละเอียดการออกคำสั่ง
@@ -483,11 +1317,11 @@ namespace BMA.EHR.Command.Service.Controllers
var data = rawData.Select(x => new
- {
- examRoundValue = x.Id,
- examRoundName = $"{x.Name} ครั้งที่ {x.Round}/{x.Year.ToThaiYear()}"
+ {
+ examRoundValue = x.Id,
+ examRoundName = $"{x.Name} ครั้งที่ {x.Round}/{x.Year.ToThaiYear()}"
- })
+ })
.ToList();
return Success(data);
diff --git a/BMA.EHR.Command.Service/Requests/CreateCommandGroup2Request.cs b/BMA.EHR.Command.Service/Requests/CreateCommandGroup2Request.cs
new file mode 100644
index 00000000..a214c7be
--- /dev/null
+++ b/BMA.EHR.Command.Service/Requests/CreateCommandGroup2Request.cs
@@ -0,0 +1,27 @@
+namespace BMA.EHR.Command.Service.Requests
+{
+ public class CreateCommandGroup2Request
+ {
+ public Guid orderTypeValue { get; set; }
+
+ public string orderTitle { get; set; } = string.Empty;
+
+ public string orderNo { get; set; } = string.Empty;
+
+ public int orderYear { get; set; }
+
+ public DateTime orderDate { get; set; }
+
+ public Guid orderBy { get; set; }
+
+ public string orderByOrganizationName { get; set; } = string.Empty;
+
+ public string signatoryBy { get; set; } = string.Empty;
+
+ public string signatoryPosition { get; set; } = string.Empty;
+
+ public string conclusionMeetingNo { get; set; } = string.Empty;
+
+ public DateTime conclusionMeetingDate { get; set; }
+ }
+}
diff --git a/BMA.EHR.Command.Service/Requests/CreateCommandGroup3Request.cs b/BMA.EHR.Command.Service/Requests/CreateCommandGroup3Request.cs
new file mode 100644
index 00000000..3c0e3e02
--- /dev/null
+++ b/BMA.EHR.Command.Service/Requests/CreateCommandGroup3Request.cs
@@ -0,0 +1,23 @@
+namespace BMA.EHR.Command.Service.Requests
+{
+ public class CreateCommandGroup3Request
+ {
+ public Guid orderTypeValue { get; set; }
+
+ public string orderTitle { get; set; } = string.Empty;
+
+ public string orderNo { get; set; } = string.Empty;
+
+ public int orderYear { get; set; }
+
+ public DateTime orderDate { get; set; }
+
+ public Guid orderBy { get; set; }
+
+ public string orderByOrganizationName { get; set; } = string.Empty;
+
+ public string signatoryBy { get; set; } = string.Empty;
+
+ public string signatoryPosition { get; set; } = string.Empty;
+ }
+}
diff --git a/BMA.EHR.Command.Service/Requests/CreateCommandGroup4Request.cs b/BMA.EHR.Command.Service/Requests/CreateCommandGroup4Request.cs
new file mode 100644
index 00000000..cb9131d7
--- /dev/null
+++ b/BMA.EHR.Command.Service/Requests/CreateCommandGroup4Request.cs
@@ -0,0 +1,27 @@
+namespace BMA.EHR.Command.Service.Requests
+{
+ public class CreateCommandGroup4Request
+ {
+ public Guid orderTypeValue { get; set; }
+
+ public string orderTitle { get; set; } = string.Empty;
+
+ public string orderNo { get; set; } = string.Empty;
+
+ public int orderYear { get; set; }
+
+ public DateTime orderDate { get; set; }
+
+ public Guid orderBy { get; set; }
+
+ public string orderByOrganizationName { get; set; } = string.Empty;
+
+ public string signatoryBy { get; set; } = string.Empty;
+
+ public string signatoryPosition { get; set; } = string.Empty;
+
+ public string conclusionReturnNo { get; set; } = string.Empty;
+
+ public DateTime conclusionReturnDate { get; set; }
+ }
+}
diff --git a/BMA.EHR.Command.Service/Requests/CreateCommandGroup5Request.cs b/BMA.EHR.Command.Service/Requests/CreateCommandGroup5Request.cs
new file mode 100644
index 00000000..b9128d82
--- /dev/null
+++ b/BMA.EHR.Command.Service/Requests/CreateCommandGroup5Request.cs
@@ -0,0 +1,33 @@
+namespace BMA.EHR.Command.Service.Requests
+{
+ public class CreateCommandGroup5Request
+ {
+ public Guid orderTypeValue { get; set; }
+
+ public string orderTitle { get; set; } = string.Empty;
+
+ public string orderNo { get; set; } = string.Empty;
+
+ public int orderYear { get; set; }
+
+ public DateTime orderDate { get; set; }
+
+ public Guid orderBy { get; set; }
+
+ public string orderByOrganizationName { get; set; } = string.Empty;
+
+ public string signatoryBy { get; set; } = string.Empty;
+
+ public string signatoryPosition { get; set; } = string.Empty;
+
+ public string conclusionReturnNo { get; set; } = string.Empty;
+
+ public DateTime conclusionReturnDate { get; set; }
+
+ public string sourceOrganizationName { get; set; }
+
+ public string militaryCommandNo { get; set; }
+
+ public DateTime militaryCommandDate { get; set; }
+ }
+}
diff --git a/BMA.EHR.Command.Service/Requests/UpdateCommandGroup2Request.cs b/BMA.EHR.Command.Service/Requests/UpdateCommandGroup2Request.cs
new file mode 100644
index 00000000..aa9ee139
--- /dev/null
+++ b/BMA.EHR.Command.Service/Requests/UpdateCommandGroup2Request.cs
@@ -0,0 +1,27 @@
+namespace BMA.EHR.Command.Service.Requests
+{
+ public class UpdateCommandGroup2Request
+ {
+ public Guid orderTypeValue { get; set; }
+
+ public string orderTitle { get; set; } = string.Empty;
+
+ public string orderNo { get; set; } = string.Empty;
+
+ public int orderYear { get; set; }
+
+ public DateTime orderDate { get; set; }
+
+ public Guid orderBy { get; set; }
+
+ public string orderByOrganizationName { get; set; } = string.Empty;
+
+ public string signatoryBy { get; set; } = string.Empty;
+
+ public string signatoryPosition { get; set; } = string.Empty;
+
+ public string conclusionMeetingNo { get; set; } = string.Empty;
+
+ public DateTime conclusionMeetingDate { get; set; }
+ }
+}
diff --git a/BMA.EHR.Domain/Models/Commands/Core/Command.cs b/BMA.EHR.Domain/Models/Commands/Core/Command.cs
index 0f4613c1..0f991980 100644
--- a/BMA.EHR.Domain/Models/Commands/Core/Command.cs
+++ b/BMA.EHR.Domain/Models/Commands/Core/Command.cs
@@ -48,25 +48,58 @@ namespace BMA.EHR.Domain.Models.Commands.Core
#region " For Placement Command "
- [Required, Comment("อ้างอิงรอบการสอบ")]
- public Guid PlacementId { get; set; }
+ [Comment("อ้างอิงรอบการสอบ")]
+ public Guid? PlacementId { get; set; }
public Placement.Placement Placement { get; set; }
- [Required, Comment("ตำแหน่งที่บรรจุ")]
- public string PositionName { get; set; } = string.Empty;
+ [Comment("ตำแหน่งที่บรรจุ")]
+ public string? PositionName { get; set; } = string.Empty;
- [Required, Comment("มติ กก. ครั้งที่ (เรื่อง รับสมัครสอบฯ)")]
- public string ConclusionRegisterNo { get; set; } = string.Empty;
+ [Comment("มติ กก. ครั้งที่ (เรื่อง รับสมัครสอบฯ)")]
+ public string? ConclusionRegisterNo { get; set; } = string.Empty;
- [Required, Comment("ลงวันที่ (เรื่อง รับสมัครสอบฯ)")]
- public DateTime ConclusionRegisterDate { get; set; } = DateTime.Now;
+ [Comment("ลงวันที่ (เรื่อง รับสมัครสอบฯ)")]
+ public DateTime? ConclusionRegisterDate { get; set; } = DateTime.Now;
- [Required, Comment("มติ กก. ครั้งที่ (เรื่อง ผลการสอบแข่งขัน)")]
- public string ConclusionResultNo { get; set; } = string.Empty;
+ [Comment("มติ กก. ครั้งที่ (เรื่อง ผลการสอบแข่งขัน)")]
+ public string? ConclusionResultNo { get; set; } = string.Empty;
- [Required, Comment("ลงวันที่ (เรื่อง ผลการสอบแข่งขัน)")]
- public DateTime ConclusionResultDate { get; set; } = DateTime.Now;
+ [Comment("ลงวันที่ (เรื่อง ผลการสอบแข่งขัน)")]
+ public DateTime? ConclusionResultDate { get; set; } = DateTime.Now;
+
+ #endregion
+
+ #region " คำสั่ง C-PM-05, C-PM-06 "
+
+ [Comment("การประชุม ครั้งที่")]
+ public string? ConclusionMeetingNo { get; set; } = string.Empty;
+
+ [Comment("การประชุม ลงวันที่")]
+ public DateTime? ConclusionMeetingDate { get; set; } = DateTime.Now;
+
+ #endregion
+
+ #region " คำสั่ง C-PM-08, C-PM-09 "
+
+ [Comment("มติ กก. ครั้งที่ (เรื่อง กลับเข้ารับราชการ)")]
+ public string? ConclusionReturnNo { get; set; } = string.Empty;
+
+ [Comment("ลงวันที่ (เรื่อง กลับเข้ารับราชการ)")]
+ public DateTime? ConclusionReturnDate { get; set; } = DateTime.Now;
+
+ #endregion
+
+ #region " คำสั่ง C-PM-09 "
+
+ [Comment("หน่วยงานต้นสังกัด ก่อนรับราชการทหาร")]
+ public string? SourceOrganizationName { get; set; }
+
+ [Comment("คำสั่งที่ (ให้เข้ารับราชการทหาร)")]
+ public string? MilitaryCommandNo { get; set; }
+
+ [Comment("ลงวันที่ (ให้เข้ารับราชการทหาร)")]
+ public DateTime? MilitaryCommanDate { get; set; }
#endregion
diff --git a/BMA.EHR.Infrastructure/Migrations/20230825033101_Add field For CommandType 05-09.Designer.cs b/BMA.EHR.Infrastructure/Migrations/20230825033101_Add field For CommandType 05-09.Designer.cs
new file mode 100644
index 00000000..3ef0a644
--- /dev/null
+++ b/BMA.EHR.Infrastructure/Migrations/20230825033101_Add field For CommandType 05-09.Designer.cs
@@ -0,0 +1,15623 @@
+//
+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
+{
+ [DbContext(typeof(ApplicationDBContext))]
+ [Migration("20230825033101_Add field For CommandType 05-09")]
+ partial class AddfieldForCommandType0509
+ {
+ ///
+ 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.Commands.Core.Command", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("char(36)")
+ .HasColumnOrder(0)
+ .HasComment("PrimaryKey")
+ .HasAnnotation("Relational:JsonPropertyName", "id");
+
+ b.Property("AuthorizedPosition")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasComment("ตำแหน่งผู้มีอำนาจลงนาม");
+
+ b.Property("AuthorizedUserFullName")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasComment("ชื่อผู้มีอำนาจลงนาม");
+
+ b.Property("AuthorizedUserId")
+ .HasColumnType("char(36)")
+ .HasComment("รหัสอ้างอิงผู้มีอำนาจลงนาม");
+
+ b.Property("CommandAffectDate")
+ .HasColumnType("datetime(6)")
+ .HasComment("วันที่คำสั่งมีผล");
+
+ b.Property("CommandExcecuteDate")
+ .HasColumnType("datetime(6)")
+ .HasComment("วันที่ออกคำสั่ง");
+
+ b.Property("CommandNo")
+ .IsRequired()
+ .HasMaxLength(10)
+ .HasColumnType("varchar(10)")
+ .HasComment("เลขที่คำสั่ง");
+
+ b.Property("CommandStatusId")
+ .HasColumnType("char(36)")
+ .HasComment("รหัสอ้างอิงสถานะคำสั่ง");
+
+ b.Property("CommandSubject")
+ .IsRequired()
+ .HasMaxLength(500)
+ .HasColumnType("varchar(500)")
+ .HasComment("คำสั่งเรื่อง");
+
+ b.Property("CommandTypeId")
+ .HasColumnType("char(36)")
+ .HasComment("รหัสอ้างอิงประเภทคำสั่ง");
+
+ b.Property("CommandYear")
+ .IsRequired()
+ .HasMaxLength(4)
+ .HasColumnType("varchar(4)")
+ .HasComment("ปีที่ออกคำสั่ง");
+
+ b.Property("ConclusionMeetingDate")
+ .HasColumnType("datetime(6)")
+ .HasComment("การประชุม ลงวันที่");
+
+ b.Property("ConclusionMeetingNo")
+ .HasColumnType("longtext")
+ .HasComment("การประชุม ครั้งที่");
+
+ b.Property("ConclusionRegisterDate")
+ .HasColumnType("datetime(6)")
+ .HasComment("ลงวันที่ (เรื่อง รับสมัครสอบฯ)");
+
+ b.Property("ConclusionRegisterNo")
+ .HasColumnType("longtext")
+ .HasComment("มติ กก. ครั้งที่ (เรื่อง รับสมัครสอบฯ)");
+
+ b.Property("ConclusionResultDate")
+ .HasColumnType("datetime(6)")
+ .HasComment("ลงวันที่ (เรื่อง ผลการสอบแข่งขัน)");
+
+ b.Property("ConclusionResultNo")
+ .HasColumnType("longtext")
+ .HasComment("มติ กก. ครั้งที่ (เรื่อง ผลการสอบแข่งขัน)");
+
+ b.Property("ConclusionReturnDate")
+ .HasColumnType("datetime(6)")
+ .HasComment("ลงวันที่ (เรื่อง กลับเข้ารับราชการ)");
+
+ b.Property("ConclusionReturnNo")
+ .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("IssuerOrganizationId")
+ .HasColumnType("char(36)")
+ .HasComment("รหัสอ้างอิงหน่วยงานที่ออกคำสั่ง");
+
+ b.Property("IssuerOrganizationName")
+ .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("MilitaryCommanDate")
+ .HasColumnType("datetime(6)")
+ .HasComment("ลงวันที่ (ให้เข้ารับราชการทหาร)");
+
+ b.Property("MilitaryCommandNo")
+ .HasColumnType("longtext")
+ .HasComment("คำสั่งที่ (ให้เข้ารับราชการทหาร)");
+
+ b.Property("OwnerGovId")
+ .HasColumnType("char(36)")
+ .HasComment("รหัสส่วนราชการผู้ออกคำสั่ง");
+
+ b.Property("PlacementId")
+ .HasColumnType("char(36)")
+ .HasComment("อ้างอิงรอบการสอบ");
+
+ b.Property("PositionName")
+ .HasColumnType("longtext")
+ .HasComment("ตำแหน่งที่บรรจุ");
+
+ b.Property("SourceOrganizationName")
+ .HasColumnType("longtext")
+ .HasComment("หน่วยงานต้นสังกัด ก่อนรับราชการทหาร");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CommandStatusId");
+
+ b.HasIndex("CommandTypeId");
+
+ b.HasIndex("PlacementId");
+
+ b.ToTable("Commands");
+ });
+
+ modelBuilder.Entity("BMA.EHR.Domain.Models.Commands.Core.CommandDeployment", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("char(36)")
+ .HasColumnOrder(0)
+ .HasComment("PrimaryKey")
+ .HasAnnotation("Relational:JsonPropertyName", "id");
+
+ b.Property("CitizenId")
+ .IsRequired()
+ .HasMaxLength(13)
+ .HasColumnType("varchar(13)")
+ .HasComment("เลขประจำตัวประชาชน");
+
+ b.Property("CommandId")
+ .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("FirstName")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("varchar(100)")
+ .HasComment("ชื่อ");
+
+ b.Property("IsSendInbox")
+ .HasColumnType("tinyint(1)")
+ .HasComment("ส่งกล่องข้อความหรือไม่?");
+
+ b.Property("IsSendMail")
+ .HasColumnType("tinyint(1)")
+ .HasComment("ส่งอีเมล์หรือไม่?");
+
+ b.Property("IsSendNotification")
+ .HasColumnType("tinyint(1)")
+ .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("OrganizationName")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasComment("ชื่อหน่วยงานของผู้รับสำเนาคำสั่ง");
+
+ b.Property("PositionName")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasComment("ชื่อตำแหน่งของผู้รับสำเนาคำสั่ง");
+
+ b.Property("Prefix")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("varchar(50)")
+ .HasComment("คำนำหน้านาม");
+
+ b.Property("ReceiveUserId")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasComment("รหัสอ้างอิงผู้ใช้งานระบบ");
+
+ b.Property("Sequence")
+ .HasColumnType("int")
+ .HasComment("ลำดับ");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CommandId");
+
+ b.ToTable("CommandDeployments");
+ });
+
+ modelBuilder.Entity("BMA.EHR.Domain.Models.Commands.Core.CommandDocument", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("char(36)")
+ .HasColumnOrder(0)
+ .HasComment("PrimaryKey")
+ .HasAnnotation("Relational:JsonPropertyName", "id");
+
+ b.Property("Category")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasComment("ประเภทเอกสาร");
+
+ b.Property("CommandId")
+ .HasColumnType("char(36)");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(100)
+ .HasComment("สร้างข้อมูลเมื่อ");
+
+ b.Property("CreatedFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(104)
+ .HasComment("ชื่อ User ที่สร้างข้อมูล");
+
+ b.Property("CreatedUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(101)
+ .HasComment("User Id ที่สร้างข้อมูล");
+
+ b.Property("DocumentId")
+ .HasColumnType("char(36)");
+
+ b.Property("LastUpdateFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(105)
+ .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdateUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(103)
+ .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
+
+ b.Property("LastUpdatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(102)
+ .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CommandId");
+
+ b.HasIndex("DocumentId");
+
+ b.ToTable("CommandDocuments");
+ });
+
+ modelBuilder.Entity("BMA.EHR.Domain.Models.Commands.Core.CommandReceiver", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("char(36)")
+ .HasColumnOrder(0)
+ .HasComment("PrimaryKey")
+ .HasAnnotation("Relational:JsonPropertyName", "id");
+
+ b.Property("CitizenId")
+ .IsRequired()
+ .HasMaxLength(13)
+ .HasColumnType("varchar(13)")
+ .HasComment("เลขประจำตัวประชาชน");
+
+ b.Property("CommandId")
+ .HasColumnType("char(36)")
+ .HasComment("รหัสอ้างอิงคำสั่ง");
+
+ b.Property("Comment")
+ .IsRequired()
+ .HasColumnType("text")
+ .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("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("Prefix")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("varchar(50)")
+ .HasComment("คำนำหน้านาม");
+
+ b.Property("RefPlacementProfileId")
+ .HasColumnType("char(36)")
+ .HasComment("รหัสอ้างอิงไปยังข้อมูลผู้บรรจุ");
+
+ b.Property("Sequence")
+ .HasColumnType("int")
+ .HasComment("ลำดับในบัญชีแนบท้าย");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CommandId");
+
+ b.ToTable("CommandReceivers");
+ });
+
+ modelBuilder.Entity("BMA.EHR.Domain.Models.Commands.Core.CommandStatus", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("char(36)")
+ .HasColumnOrder(0)
+ .HasComment("PrimaryKey")
+ .HasAnnotation("Relational:JsonPropertyName", "id");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(100)
+ .HasComment("สร้างข้อมูลเมื่อ");
+
+ b.Property("CreatedFullName")
+ .IsRequired()
+ .HasMaxLength(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()
+ .HasMaxLength(100)
+ .HasColumnType("varchar(100)")
+ .HasComment("สถานะของคำสั่ง");
+
+ b.Property("Sequence")
+ .HasColumnType("int")
+ .HasComment("ลำดับการทำงาน");
+
+ b.HasKey("Id");
+
+ b.ToTable("CommandStatuses");
+ });
+
+ modelBuilder.Entity("BMA.EHR.Domain.Models.Commands.Core.CommandType", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("char(36)")
+ .HasColumnOrder(0)
+ .HasComment("PrimaryKey")
+ .HasAnnotation("Relational:JsonPropertyName", "id");
+
+ b.Property("Category")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("varchar(100)")
+ .HasComment("ประเภทคำสั่ง");
+
+ b.Property("CommandCode")
+ .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("LastUpdateFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(105)
+ .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
+
+ b.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(200)
+ .HasColumnType("varchar(200)")
+ .HasComment("ชื่อคำสั่ง");
+
+ b.HasKey("Id");
+
+ b.ToTable("CommandTypes");
+ });
+
+ modelBuilder.Entity("BMA.EHR.Domain.Models.Commands.Core.DeploymentChannel", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("char(36)")
+ .HasColumnOrder(0)
+ .HasComment("PrimaryKey")
+ .HasAnnotation("Relational:JsonPropertyName", "id");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime(6)")
+ .HasColumnOrder(100)
+ .HasComment("สร้างข้อมูลเมื่อ");
+
+ b.Property("CreatedFullName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("varchar(200)")
+ .HasColumnOrder(104)
+ .HasComment("ชื่อ User ที่สร้างข้อมูล");
+
+ b.Property("CreatedUserId")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasColumnOrder(101)
+ .HasComment("User Id ที่สร้างข้อมูล");
+
+ b.Property("IsSendEmail")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("IsSendInbox")
+ .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.HasKey("Id");
+
+ b.ToTable("DeploymentChannels");
+ });
+
+ 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("Documents");
+ });
+
+ 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("LimitLeaves");
+ });
+
+ 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("LimitTypeLeaves");
+ });
+
+ 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("EmployeeType")
+ .HasMaxLength(20)
+ .HasColumnType("varchar(20)")
+ .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("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)");
+
+ 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