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

namespace LSFE.Infrastructure.Entities.Auth
{
    [Table("RoleModulePermissions")]
    public class RoleModulePermission
    {
        [Key]
        public int PermissionId { get; set; }

        [Required]
        public string RoleId { get; set; } = default!;

        [Required]
        public int ModuleId { get; set; }

        public bool CanView { get; set; } = false;

        public bool CanCreate { get; set; } = false;

        public bool CanEdit { get; set; } = false;

        public bool CanDelete { get; set; } = false;

        [MaxLength(500)]
        public string? BadgeQuery { get; set; }

        public DateTime CreatedAt { get; set; } = DateTime.UtcNow;

        public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;

        // Navigation Properties
        [ForeignKey("RoleId")]
        public virtual Role? Role { get; set; }

        [ForeignKey("ModuleId")]
        public virtual Module? Module { get; set; }
    }
}