using System.ComponentModel.DataAnnotations.Schema;
#if NETFRAMEWORK
using System;
#endif

namespace DigitalData.UserManager.Domain.Entities
{
    [Table("TBDD_USER_REPRESENTATION", Schema = "dbo")]
    public class UserRep : BaseEntity
    {
        [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; }

        [Column("VALID_FROM")]
        public DateTime? ValidFrom { get; set; }

        [Column("VALID_TO")]
        public DateTime? ValidTo { get; set; }

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

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

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

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