using YBEE.EQM.Core;

namespace YBEE.EQM.Application;

/// <summary>
/// 监测学生输出参数
/// </summary>
public class ExamStudentOutput
{
    /// <summary>
    /// 主键
    /// </summary>
    [Required]
    public long Id { get; set; }
    /// <summary>
    /// 监测计划ID
    /// </summary>
    [Required]
    public int ExamPlanId { get; set; }
    /// <summary>
    /// 机构ID
    /// </summary>
    [Required]
    public short SysOrgId { get; set; }
    /// <summary>
    /// 校区ID
    /// </summary>
    public short? SysOrgBranchId { get; set; }
    /// <summary>
    /// 监测年级ID
    /// </summary>
    [Required]
    public short ExamGradeId { get; set; }
    /// <summary>
    /// 年级ID
    /// </summary>
    [Required]
    public short GradeId { get; set; }
    /// <summary>
    /// 班级ID
    /// </summary>
    [Required]
    public long SchoolClassId { get; set; }
    /// <summary>
    /// 班号
    /// </summary>
    [Required]
    public short ClassNumber { get; set; }
    /// <summary>
    /// 高中选科组合ID
    /// </summary>
    public short? NceeCourseCombId { get; set; }

    /// <summary>
    /// 自编监测号
    /// </summary>
    public string ExamNumber { get; set; } = "";
    /// <summary>
    /// 学籍号
    /// </summary>
    public string StudentNumber { get; set; } = "";
    /// <summary>
    /// 考场号
    /// </summary>
    public string RoomNumber { get; set; } = "";
    /// <summary>
    /// 座位号
    /// </summary>
    public string SeatNumber { get; set; } = "";

    /// <summary>
    /// 姓名
    /// </summary>
    [Required]
    public string Name { get; set; }
    /// <summary>
    /// 证件类型
    /// </summary>
    [Required]
    public CertificateType CertificateType { get; set; }
    /// <summary>
    /// 证件号码
    /// </summary>
    public string IdNumber { get; set; } = "";
    /// <summary>
    /// 出生日期
    /// </summary>
    public DateTime? BirthDate { get; set; }
    /// <summary>
    /// 性别
    /// </summary>
    [Required]
    public Gender Gender { get; set; }
    /// <summary>
    /// 备注
    /// </summary>
    public string Remark { get; set; }

    ///// <summary>
    ///// 年级
    ///// </summary>
    //public GradeOutput Grade { get; set; }
    /// <summary>
    /// 班级
    /// </summary>
    public SchoolClassLiteOutput SchoolClass { get; set; }
    /// <summary>
    /// 校区
    /// </summary>
    public SysOrgLiteOutput SysOrgBranch { get; set; }
    /// <summary>
    /// 监测年级
    /// </summary>
    public ExamGradeOutput ExamGrade { get; set; }
}

/// <summary>
/// 监测学生输出参数
/// </summary>
public class ExamStudentOrgOutput: ExamStudentOutput
{
    /// <summary>
    /// 机构
    /// </summary>
    [Required]
    public SysOrgOutput SysOrg { get; set; }
}

/// <summary>
/// 监测学生批量上传行数据类型
/// </summary>
public class UploadExamStudentOutput : UploadExamDataBase
{
    /// <summary>
    /// 年级ID
    /// </summary>
    [Required]
    public short GradeId { get; set; }
    /// <summary>
    /// 班级号
    /// </summary>
    [Required]
    public short ClassNumber { get; set; }
    /// <summary>
    /// 选科组合ID
    /// </summary>
    public short? NceeCourseCombId { get; set; }
    /// <summary>
    /// 选科组合名称
    /// </summary>
    public string NceeCourseCombName { get; set; }
    /// <summary>
    /// 姓名
    /// </summary>
    [Required]
    public string Name { get; set; }
    /// <summary>
    /// 证件类型
    /// </summary>
    [Required]
    public CertificateType CertificateType { get; set; }
    /// <summary>
    /// 证件类型名称
    /// </summary>
    public string CertificateTypeName { get; set; } = "";
    /// <summary>
    /// 证件号码
    /// </summary>
    public string IdNumber { get; set; } = "";
    /// <summary>
    /// 性别
    /// </summary>
    public Gender? Gender { get; set; } = Core.Gender.UNKNOWN;
    /// <summary>
    /// 性别名称
    /// </summary>
    public string GenderName { get; set; } = "";
    /// <summary>
    /// 学籍号
    /// </summary>
    public string StudentNumber { get; set; }
    /// <summary>
    /// 自编监测号
    /// </summary>
    public string ExamNumber { get; set; }
    /// <summary>
    /// 考场号
    /// </summary>
    public string RoomNumber { get; set; } = "";
    /// <summary>
    /// 座位号
    /// </summary>
    public string SeatNumber { get; set; } = "";
    /// <summary>
    /// 备注
    /// </summary>
    public string Remark { get; set; }
}

/// <summary>
/// 监测学生统计输出参数
/// </summary>
public class ExamStudentGradeClassStudentCountOutput
{
    /// <summary>
    /// 班级列表
    /// </summary>
    public List<short> ClassNumberList { get; set; }
    /// <summary>
    /// 统计数据列表
    /// </summary>
    public List<dynamic> Items { get; set; }
    /// <summary>
    /// 总数
    /// </summary>
    public int Total { get; set; }
}

/// <summary>
/// 监测学生各班学生人数统计
/// </summary>
public class ExamStudentCountItem
{
    /// <summary>
    /// 机构ID
    /// </summary>
    [Required]
    public short SysOrgId { get; set; }
    /// <summary>
    /// 机构全称
    /// </summary>
    [Required]
    public string SysOrgFullName { get; set; }
    /// <summary>
    /// 机构名称
    /// </summary>
    [Required]
    public string SysOrgName { get; set; }
    /// <summary>
    /// 机构代码
    /// </summary>
    [Required]
    public string SysOrgCode { get; set; }
    /// <summary>
    /// 校区ID
    /// </summary>
    public short? SysOrgBranchId { get; set; }
    /// <summary>
    /// 校区名称
    /// </summary>
    public string SysOrgBranchName { get; set; }
    /// <summary>
    /// 城乡类型
    /// </summary>
    [Required]
    public UrbanRuralType UrbanRuralType { get; set; }
    /// <summary>
    /// 年级ID
    /// </summary>
    [Required]
    public short GradeId { get; set; }
    /// <summary>
    /// 入学年份
    /// </summary>
    [Required] 
    public short GradeBeginYear { get; set; }
    /// <summary>
    /// 年级号
    /// </summary>
    [Required]
    public short GradeNumber { get; set; }
    /// <summary>
    /// 年级名称
    /// </summary>
    [Required]
    public string GradeName { get; set; }
    /// <summary>
    /// 班级ID
    /// </summary>
    [Required]
    public long SchoolClassId { get; set; }
    /// <summary>
    /// 班级号
    /// </summary>
    [Required]
    public short ClassNumber { get; set; }
    /// <summary>
    /// 年级班级数量
    /// </summary>
    [Required]
    public int ClassCount { get; set; }
    /// <summary>
    /// 班级学生人数
    /// </summary>
    [Required]
    public int StudentCount { get; set; }
    /// <summary>
    /// 年级数量
    /// </summary>
    [Required]
    public int GradeCount { get; set; }
}