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

namespace YBEE.EQM.Core;

/// <summary>
/// 高中双上线
/// </summary>
public class NceeLineCourse : IEntity
{
    /// <summary>
    /// 主键
    /// </summary>
    [Comment("主键")]
    [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
    public int Id { get; set; }
    /// <summary>
    /// 高中分析计划ID
    /// </summary>
    [Comment("高中分析计划ID")]
    [Required]
    public int NceePlanId { get; set; }
    /// <summary>
    /// 数据范围类型
    /// </summary>
    [Comment("数据范围类型")]
    [Required]
    public NceeDataScopeType Type { get; set; }
    /// <summary>
    /// 机构ID
    /// </summary>
    [Comment("机构ID")]
    public short? SysOrgId { get; set; }
    /// <summary>
    /// 年级ID
    /// </summary>
    public short GradeId { get; set; }
    /// <summary>
    /// 班级号
    /// </summary>
    [Comment("班级号")]
    public short? ClassNumber { get; set; }
    
    /// <summary>
    /// 划线等级
    /// </summary>
    [Comment("划线等级")]
    [Required, Column(TypeName = "smallint")]
    public NceeLineLevel NceeLineLevel { get; set; }
    /// <summary>
    /// 首选科目ID
    /// </summary>
    [Comment("首选科目ID")]
    [Required]
    public short DirectionCourseId { get; set; }
    /// <summary>
    /// 科目ID
    /// </summary>
    [Comment("科目ID")]
    [Required]
    public short CourseId { get; set; }

    /// <summary>
    /// 上线人数
    /// </summary>
    [Comment("上线人数")]
    [Required]
    public int LineCount { get; set; } = 0;
    /// <summary>
    /// 总人数
    /// </summary>
    [Comment("总人数")]
    [Required]
    public int TotalCount { get; set; } = 0;
    /// <summary>
    /// 上线比例
    /// </summary>
    [Comment("上线比例")]
    [Required, Column(TypeName = "decimal(10, 8)")]
    public decimal LineRate { get; set; } = 0;
    /// <summary>
    /// 是否双上线
    /// </summary>
    [Comment("是否双上线")]
    [Required]
    public bool IsDoubleLine { get; set; } = false;
}
