using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Entities.Contracts { [Table("question_groups")] public class QuestionGroup { [Key] [Column("id")] public Guid Id { get; set; } [Column("title")] [MaxLength(255)] public string Title { get; set; } [Required] [Column("description")] [MaxLength(65535)] public string Description { get; set; } [Column("type")] [MaxLength(50)] public string Type { get; set; } [Column("difficulty_level")] [MaxLength(10)] public DifficultyLevel DifficultyLevel { get; set; } [Column("subject_area")] public SubjectAreaEnum SubjectArea { get; set; } [Column("total_questions")] public int TotalQuestions { get; set; } = 0; [Column("parent_question_group")] public Guid? ParentQG { get; set; } [Required] [Column("created_by")] [ForeignKey("Creator")] public Guid CreatedBy { get; set; } [Column("created_at")] public DateTime CreatedAt { get; set; } [Column("updated_at")] public DateTime UpdatedAt { get; set; } [Column("deleted")] public bool IsDeleted { get; set; } [Column("valid_group")] public bool ValidGroup { get; set; } public User Creator { get; set; } public QuestionGroup ParentQuestionGroup { get; set; } public ICollection ChildQuestionGroups { get; set; } public ICollection AssignmentQuestions { get; set; } public ICollection Questions { get; set; } public QuestionGroup() { Id = Guid.NewGuid(); Questions = new HashSet(); CreatedAt = DateTime.UtcNow; UpdatedAt = DateTime.UtcNow; IsDeleted = false; ValidGroup = true; } } }