namespace ERPCore.Domain.Entities;

/// <summary>
/// A grantable sidebar-visibility unit — exactly one of <see cref="NavItemId"/> /
/// <see cref="SubNavItemId"/> is set (enforced in <c>NavSeedService</c>/service layer,
/// not by a DB constraint). One row is seeded per <see cref="NavItem"/>/<see cref="SubNavItem"/>;
/// <see cref="RolePermission"/> grants it to a role.
/// </summary>
public class Permission
{
    public int PermissionId { get; set; }
    public string Code { get; set; } = string.Empty;
    public int? NavItemId { get; set; }
    public int? SubNavItemId { get; set; }

    public NavItem? NavItem { get; set; }
    public SubNavItem? SubNavItem { get; set; }
}
