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("assignments")] public class Assignment { [Key] [Column("id")] public Guid Id { get; set; } [Required] [Column("title")] [StringLength(255)] public string Title { get; set; } [Column("description")] public string Description { get; set; } [Column("subject_area")] public SubjectAreaEnum SubjectArea { get; set; } [Required] [Column("due_date")] public DateTime DueDate { get; set; } [Column("total_points")] public byte TotalQuestions { get; set; } [Column("score")] public float Score { get; set; } [Column("created_by")] public Guid CreatorId { get; set; } [Column("created_at")] public DateTime CreatedAt { get; set; } [Column("updated_at")] public DateTime UpdatedAt { get; set; } = DateTime.UtcNow; [Column("deleted")] public bool IsDeleted { get; set; } = false; // Navigation Properties [ForeignKey(nameof(CreatorId))] public User Creator { get; set; } public ICollection AssignmentClasses { get; set; } public AssignmentStruct ExamStruct { get; set; } public ICollection AssignmentAttachments { get; set; } public ICollection Submissions { get; set; } public Assignment() { Id = Guid.NewGuid(); Submissions = new HashSet(); AssignmentClasses = new HashSet(); AssignmentAttachments = new HashSet(); } } }