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("classes")]
	public class Class
	{
		[Key]
		[Column("id")]
		public Guid Id { get; set; }

		[Column("grade")]
		public byte Grade { get; set; }

		[Column("class")]
		public byte Number { get; set; }

		[Column("description")]
		public string Description { get; set; }

		[Column("head_teacher_id")]
		public Guid? HeadTeacherId { get; set; }
		public User HeadTeacher { 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; }

		// Navigation Properties
		public ICollection<ClassTeacher> ClassTeachers { get; set; }
		public ICollection<ClassStudent> ClassStudents { get; set; }
		public ICollection<AssignmentClass> AssignmentClasses { get; set; }

		public Class()
		{
			Id = Guid.NewGuid();
			Grade = 0;
			Number = 0;
			ClassStudents = new HashSet<ClassStudent>();
			ClassTeachers = new HashSet<ClassTeacher>();
			AssignmentClasses = new HashSet<AssignmentClass>();
		}
	}
}
