using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Abp.Domain.Entities;
using Abp.Domain.Entities.Auditing;
using YGNT.QuestionLibrary.Core.EducationCategories;
using YGNT.QuestionLibrary.Core.Grades;
using YGNT.QuestionLibrary.Core.Textbooks;

namespace YGNT.QuestionLibrary.Core.Disciplines
{
    /// <summary>
    /// 学科
    /// </summary>
    public class Discipline : Entity, ICreationAudited
    {
        public Discipline()
        {
            UserDisciplines = new List<UserDiscipline>();
            Textbooks = new List<Textbook>();
        }

        /// <summary>
        /// 学科名称
        /// </summary>
        [Required]
        [MaxLength(30)]
        public string Name { get; set; }

        /// <summary>
        /// 年级Id
        /// </summary>
        [Required]
        public int GradeId { get; set; }
        /// <summary>
        /// 课程ID
        /// </summary>
        public int CourseId { get; set; }

        /// <summary>
        /// 年级
        /// </summary>
        [ForeignKey(nameof(GradeId))]
        [Required]
        public Grade Grade { get; set; }


        public List<UserDiscipline> UserDisciplines { get; set; }
        public List<Textbook> Textbooks { get; set; }
        
        public DateTime CreationTime { get; set; }


        public long? CreatorUserId { get; set; }

    }
}