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

namespace YBEE.EQM.Core;

/// <summary>
/// 双向细目表头
/// </summary>
[Comment("双向细目表头")]
public class ExamPaper : DEntityBase
{
    /// <summary>
    /// 监测计划ID
    /// </summary>
    [Comment("监测计划ID")]
    [Required]
    public int ExamPlanId { get; set; }
    /// <summary>
    /// 年级ID
    /// </summary>
    [Comment("年级ID")]
    [Required]
    public short GradeId { get; set; }
    /// <summary>
    /// 年级年份
    /// </summary>
    [Comment("年级年份")]
    [Required]
    public short GradeYear { get; set; }
    /// <summary>
    /// 科目ID
    /// </summary>
    [Comment("科目ID")]
    [Required]
    public short CourseId { get; set; }
    /// <summary>
    /// 名称
    /// </summary>
    [Comment("名称")]
    [Required]
    public string Name { get; set; }
    /// <summary>
    /// 总分
    /// </summary>
    [Comment("总分")]
    [Required, Column(TypeName = "decimal(10, 2)")]
    public decimal Score { get; set; } = 0;
    /// <summary>
    /// 备注
    /// </summary>
    [Comment("备注")]
    [StringLength(200)]
    public string Remark { get; set; } = "";
    /// <summary>
    /// 状态
    /// </summary>
    [Comment("状态")]
    [Required, Column(TypeName = "smallint")]
    public PublishStatus Status { get; set; }
    /// <summary>
    /// 发布时间
    /// </summary>
    [Comment("发布时间")]
    public DateTime? PublishTime { get; set; }

    /// <summary>
    /// 一对一引用（监测信息）
    /// </summary>
    public virtual ExamPlan ExamPlan { get; set; }
    /// <summary>
    /// 一对一引用（年级）
    /// </summary>
    public virtual Grade Grade { get; set; }
    /// <summary>
    /// 一对一引用（科目）
    /// </summary>
    public virtual Course Course { get; set; }
}
