using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Entities.Contracts
{
    [Table("grades")]
    public class Grade
    {
        [Key]
        [Column("grade_id")]
        public Guid Id { get; set; }

        [Column("school_id")]
        public Guid SchoolId { get; set; }
        public virtual School School { get; set; }

        [Column("grade_name")]
        [MaxLength(20)]
        public string GradeName { get; set; }

        [Column("grade_level")]
        public byte GradeLevel { get; set; }

        [InverseProperty(nameof(Class.Grade))]  
        public virtual ICollection<Class> Classes { get; set; }

        public Grade()
        {
            Id = Guid.NewGuid();
            Classes = new HashSet<Class>();
        }
    }
}
