using System;
using System.Collections.Generic;

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

    [Table("Usr_UserProfile")]
    public class UserProfile
    {
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public long UserProfileID { get; set; }

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

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

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

        public int? UnitID { get; set; }

        public bool? IsActive { get; set; }
        public int? HierarchyType {get;set;}
        [ForeignKey("UnitID")]
        public virtual Unit Unit { get; set; }

        public long? ManagerUserProfileID { get; set; }

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

        [Required]
        [Column(TypeName = "datetime2")]
        public DateTime CreatedDateTime { get; set; }

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

        [Required]
        [Column(TypeName = "datetime2")]
        public DateTime LastUpdatedDateTime { get; set; }

        [ForeignKey("ManagerUserProfileID")]
        public virtual UserProfile Manager { get; set; }
        
        //[ForeignKey("UserProfileID")]
        // public virtual UserProfile Manager { get; set; }
        //public DateTime CreatedDatetime { get; set; }
        //public string CreatedBy { get; set; }
        public virtual ICollection<FunctionalRoleMember> FunctionalRoleMembers { get; set; }
        //public virtual ICollection<FunctionalRole> FunctionalRoles { get; set; }
       


    }
}
