using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using AyCode.Interfaces.Entities;
using AyCode.Interfaces.TimeStampInfo;

namespace TIAM.Entities.Permissions;

[Table("PermissionGroupUserMapping")]
public class PermissionGroupUserMapping : IEntityGuid, ITimeStampInfo
{
    [Key, DatabaseGenerated(DatabaseGeneratedOption.None)]
    public Guid Id { get; set; }
    public Guid SubjectId { get; set; }
    public Guid PermissionGroupId { get; set; }

    public DateTime Created { get; set; }
    public DateTime Modified { get; set; }

    public PermissionGroupUserMapping(Guid subjectId, Guid permissionContextMappingId) : this (Guid.NewGuid(), subjectId, permissionContextMappingId)
    { }

    public PermissionGroupUserMapping(Guid id, Guid subjectId, Guid permissionGroupId)
    {
        Id = id;
        SubjectId = subjectId;
        PermissionGroupId = permissionGroupId;
        Created = DateTime.UtcNow;
        Modified = DateTime.UtcNow;

    }
    
}