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 " [Required, Comment("อ้างอิงรอบการสอบ")] public Guid PlacementId { get; set; } public Placement.Placement Placement { get; set; } [Required, Comment("ตำแหน่งที่บรรจุ")] public string PositionName { get; set; } = string.Empty; [Required, Comment("มติ กก. ครั้งที่ (เรื่อง รับสมัครสอบฯ)")] public string ConclusionRegisterNo { get; set; } = string.Empty; [Required, Comment("ลงวันที่ (เรื่อง รับสมัครสอบฯ)")] public DateTime ConclusionRegisterDate { get; set; } = DateTime.Now; [Required, Comment("มติ กก. ครั้งที่ (เรื่อง ผลการสอบแข่งขัน)")] public string ConclusionResultNo { get; set; } = string.Empty; [Required, Comment("ลงวันที่ (เรื่อง ผลการสอบแข่งขัน)")] public DateTime ConclusionResultDate { get; set; } = DateTime.Now; #endregion public virtual List Documents { get; set; } = new(); public virtual List Receivers { get; set; } public virtual List Deployments { get; set; } [Required, Comment("รหัสส่วนราชการผู้ออกคำสั่ง")] public virtual Guid OwnerGovId { get; set; } = Guid.Empty; } }