using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel;

namespace DigitalData.UserManager.Domain.Entities
{
    [Table("TBDD_USER_REPRESENTATION", Schema = "dbo")]
    public class UserRep : BaseEntity
    {
        [Required]
        [Column("USER_ID")]
        public int UserId { get; set; }

        [Column("REPR_GROUP")]
        public int? RepGroupId { get; set; }

        [Column("GROUP_ID")]
        public int? GroupId { get; set; } = null;

        [Column("REPR_USER")]
        public int? RepUserId { get; set; }

        [ForeignKey("UserId")]
        public virtual User? User { get; set; }

        [ForeignKey("RepGroupId")]
        public virtual Group? RepGroup { get; set; }

        [ForeignKey("GroupId")]
        public virtual Group? Group { get; set; }

        [ForeignKey("RepUserId")]
        public virtual User? RepUser { get; set; }
    }
}