using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using AyCode.Interfaces.ServiceProviders;
using AyCode.Interfaces.Users;

namespace AyCode.Entities.Users;

[Table("UserToServiceProvider")]
public abstract class AcUserToCompany<TUser, TCompany> : IAcUserToCompany<TUser, TCompany>
    where TUser : class, IAcUserBase
    where TCompany : class, IAcCompanyBase
{
    [Key, DatabaseGenerated(DatabaseGeneratedOption.None)]
    public Guid Id { get; set; }

    public Guid UserId { get; set; }
    public Guid ServiceProviderId { get; set; }

    public int Permissions { get; set; }

    public virtual TUser User { get; set; }
    [ForeignKey("ServiceProviderId")] //COMPANY_RENAME - J.
    public virtual TCompany Company { get; set; }
    
    public DateTime Created { get; set; }
    public DateTime Modified { get; set; }
}