using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Abp.Domain.Entities;
using Abp.Domain.Entities.Auditing;
using JetBrains.Annotations;
using YGNT.QuestionLibrary.Core.CognitiveAbilities;
using YGNT.QuestionLibrary.Core.Disciplines;
using YGNT.QuestionLibrary.Core.Questions;

namespace YGNT.QuestionLibrary.Core.KnowledgePoints
{
    /// <summary>
    /// 知识点
    /// </summary>
    public class KnowledgePoint : Entity<long>, ICreationAudited, IModificationAudited, ISoftDelete
    {

        /// <summary>
        /// 知识点名称
        /// </summary>
        [Required]
        public string Name { get; set; }

        /// <summary>
        /// 父知识点Id
        /// </summary>
        public long? ParentId { get; set; }

        /// <summary>
        /// 所属学科id
        /// </summary>
        [Required]
        public int DisciplineId { get; set; }

        /// <summary>
        /// 认知能力Id
        /// </summary>
        public int? CognitiveAbilityId { get; set; }

        /// <summary>
        /// 排序
        /// </summary>
        [Required]
        [DefaultValue(0)]
        public int Sort { get; set; }

        /// <summary>
        /// 当前知识点下试题
        /// </summary>
        public List<QuestionKnowledgePoint> QuestionKnowledgePoints { get; set; }

        /// <summary>
        /// 认证能力
        /// </summary>
        public CognitiveAbility CognitiveAbility { get; set; }

        /// <summary>
        /// 所属学科
        /// </summary>
        [ForeignKey(nameof(DisciplineId))]
        [Required]
        public Discipline Discipline { get; set; }

        /// <summary>
        /// 父知识点
        /// </summary>
        [ForeignKey(nameof(ParentId))]
        public KnowledgePoint ParentKnowledgePoint { get; set; }

        /// <summary>
        /// 子知识点
        /// </summary>
        public List<KnowledgePoint> ChildKnowledgePoints { get; set; }

        public DateTime CreationTime { get; set; }


        public long? CreatorUserId { get; set; }


        public DateTime? LastModificationTime { get; set; }


        public long? LastModifierUserId { get; set; }


        public bool IsDeleted { get; set; }

        /// <summary>
        /// 一中的知识点ID
        /// </summary>
        public long? KnowledgeId { get; set; }
    }
}