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

namespace YBEE.EQM.Core;

/// <summary>
/// 学期
/// </summary>
[Comment("学期")]
[Table("base_semester")]
public class Semester : DEntityBase<short>
{
    /// <summary>
    /// 主键：2023~2024学年上期：20232，2023~2024学年下期：20241
    /// </summary>
    [Comment("主键：2023~2024学年上期：20232，2023~2024学年下期：20241")]
    [Key, DatabaseGenerated(DatabaseGeneratedOption.None)]
    public override short Id { get; set; }
    /// <summary>
    /// 学期类型
    /// </summary>
    [Comment("学期类型")]
    [Required, Column(TypeName = "smallint")]
    public SemesterType SemesterType { get; set; }
    /// <summary>
    /// 名称，2023至2024学年上学期
    /// </summary>
    [Comment("名称，2023至2024学年上学期")]
    [Required, StringLength(100)]
    public string Name { get; set; }
    /// <summary>
    /// 简称，2023~2024上
    /// </summary>
    [Comment("简称，2023~2024上")]
    [Required, StringLength(100)]
    public string ShortName { get; set; }
    /// <summary>
    /// 别名，2023年秋季
    /// </summary>
    [Comment("别名，2023年秋季")]
    [Required, StringLength(100)]
    public string NickName { get; set; }
    /// <summary>
    /// 别名简称，2023秋
    /// </summary>
    [Comment("别名简称，2023秋")]
    [Required, StringLength(100)]
    public string NickShortName { get; set; }
    /// <summary>
    /// 开始年份
    /// </summary>
    [Comment("开始年份")]
    [Required]
    public short BeginYear { get; set; }
    /// <summary>
    /// 结束年份
    /// </summary>
    [Comment("结束年份")]
    [Required]
    public short EndYear { get; set; }
    /// <summary>
    /// 是否当前学年
    /// </summary>
    [Comment("是否当前学年")]
    [Required]
    public bool IsCurrent { get; set; } = false;
    /// <summary>
    /// 备注
    /// </summary>
    [Comment("备注")]
    [StringLength(200)]
    public string Remark { get; set; }
}
