using Furion.DatabaseAccessor;
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace YBEE.EQM.Core;

/// <summary>
/// 年级
/// </summary>
[Comment("年级")]
[Table("base_grade")]
public class Grade : IEntity
{
    /// <summary>
    /// 主键：1位学段+1位序号
    /// </summary>
    [Comment("主键")]
    [Key, DatabaseGenerated(DatabaseGeneratedOption.None)]
    public short Id { get; set; }
    /// <summary>
    /// 学段
    /// </summary>
    [Comment("学段")]
    [Required]
    public EducationStage EducationStage { get; set; }
    /// <summary>
    /// 年级号
    /// </summary>
    [Comment("年级号")]
    [Required]
    public short GradeNumber { get; set; }
    /// <summary>
    /// 年级号2
    /// </summary>
    [Comment("年级号2")]
    [Required]
    public short GradeNumber2 { get; set; }
    /// <summary>
    /// 名称
    /// </summary>
    [Comment("名称")]
    [Required, StringLength(50)]
    public string Name { get; set; }
    /// <summary>
    /// 名称2
    /// </summary>
    [Comment("名称2")]
    [Required, StringLength(50)]
    public string Name2 { get; set; }
    /// <summary>
    /// 全称
    /// </summary>
    [Comment("全称")]
    [Required, StringLength(100)]
    public string FullName { get; set; }
    /// <summary>
    /// 简称
    /// </summary>
    [Required, StringLength(50)]
    public string ShortName { get; set; }

    /// <summary>
    /// 备注
    /// </summary>
    [Comment("备注")]
    [StringLength(200)]
    public string Remark { get; set; } = "";
    /// <summary>
    /// 状态
    /// </summary>
    [Comment("状态")]
    [Required, Column(TypeName = "smallint")]
    public CommonStatus Status { get; set; }
}
