using System;
using System.Collections.Generic;

namespace LHDN.CRM.Models.Models
{
    using System.ComponentModel.DataAnnotations;
    using System.ComponentModel.DataAnnotations.Schema;

    [Table("Usr_Unit")]

    public class Unit
    {

        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int UnitID { get; set; }

        [Required]
        [StringLength(255)]
        public string UnitName { get; set; }

        public int? BranchID { get; set; }
        public string BranchCode { get; set; }
        
        public Nullable<int> ParentUnitID { get; set; }

        //[ForeignKey("ParentUnitID")]
        //public virtual Unit ParentUnit { get; set; }

        [ForeignKey("BranchID")]
        public virtual LookupParam BranchInfo { get; set; }

        public Nullable<int> HierarchyType { get; set; }
        public string ManagerFunctionRoleID { get; set; }
        public Nullable<int> UnitTypeID { get; set; }
        public Nullable<int> TPFileTypeID { get; set; }

        public bool IsActive { get; set; }
        public string AdditionalInfo { get; set; }

        public Nullable<int> SeksyenID { get; set; }
        public Nullable<int> JabatanID { get; set; }
        public Nullable<int> CawanganID { get; set; }


        public virtual ICollection<UserProfile> UserProfile { get; set; }
    }
}
