hrms-api-backend/BMA.EHR.Domain/Models/Commands/Core/Command.cs
2023-08-25 10:32:43 +07:00

115 lines
5.1 KiB
C#

using BMA.EHR.Domain.Models.Base;
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;
namespace BMA.EHR.Domain.Models.Commands.Core
{
public class Command : EntityBase
{
[MaxLength(10), Comment("เลขที่คำสั่ง")]
public string CommandNo { get; set; } = string.Empty;
[MaxLength(4), Comment("ปีที่ออกคำสั่ง")]
public string CommandYear { get; set; } = string.Empty;
[Required, Comment("รหัสอ้างอิงประเภทคำสั่ง")]
public Guid CommandTypeId { get; set; } = Guid.Empty;
public CommandType CommandType { get; set; }
[Required, Comment("รหัสอ้างอิงหน่วยงานที่ออกคำสั่ง")]
public Guid IssuerOrganizationId { get; set; } = Guid.Empty;
[Required, Comment("หน่วยงานที่ออกคำสั่ง")]
public string IssuerOrganizationName { get; set; } = string.Empty;
[Required, Comment("รหัสอ้างอิงสถานะคำสั่ง")]
public Guid CommandStatusId { get; set; } = Guid.Empty;
public CommandStatus CommandStatus { get; set; }
[Comment("รหัสอ้างอิงผู้มีอำนาจลงนาม")]
public Guid AuthorizedUserId { get; set; } = Guid.Empty;
[Comment("ชื่อผู้มีอำนาจลงนาม")]
public string AuthorizedUserFullName { get; set; } = string.Empty;
[Comment("ตำแหน่งผู้มีอำนาจลงนาม")]
public string AuthorizedPosition { get; set; } = string.Empty;
[Comment("วันที่คำสั่งมีผล")]
public DateTime? CommandAffectDate { get; set; }
[Comment("วันที่ออกคำสั่ง")]
public DateTime? CommandExcecuteDate { get; set; }
[Required, MaxLength(500), Comment("คำสั่งเรื่อง")]
public string CommandSubject { get; set; } = string.Empty;
#region " For Placement Command "
[Comment("อ้างอิงรอบการสอบ")]
public Guid? PlacementId { get; set; }
public Placement.Placement Placement { get; set; }
[Comment("ตำแหน่งที่บรรจุ")]
public string? PositionName { get; set; } = string.Empty;
[Comment("มติ กก. ครั้งที่ (เรื่อง รับสมัครสอบฯ)")]
public string? ConclusionRegisterNo { get; set; } = string.Empty;
[Comment("ลงวันที่ (เรื่อง รับสมัครสอบฯ)")]
public DateTime? ConclusionRegisterDate { get; set; } = DateTime.Now;
[Comment("มติ กก. ครั้งที่ (เรื่อง ผลการสอบแข่งขัน)")]
public string? ConclusionResultNo { get; set; } = string.Empty;
[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
public virtual List<CommandDocument> Documents { get; set; } = new();
public virtual List<CommandReceiver> Receivers { get; set; }
public virtual List<CommandDeployment> Deployments { get; set; }
[Required, Comment("รหัสส่วนราชการผู้ออกคำสั่ง")]
public virtual Guid OwnerGovId { get; set; } = Guid.Empty;
}
}