namespace Meezi.Core.Entities;

/// <summary>
/// A café-defined role template that overrides the standard <see cref="Meezi.Core.Enums.EmployeeRole"/>
/// permission set. The owner creates named roles (e.g. "Barista", "Floor Supervisor") and assigns
/// specific <see cref="Meezi.Core.Authorization.Permission"/> values to each one.
/// When an employee has a <see cref="CustomRoleId"/>, their effective permissions come from here
/// instead of the static <see cref="Meezi.Core.Authorization.RolePermissions"/> matrix.
/// </summary>
public class CustomRole : TenantEntity
{
    public string Name { get; set; } = string.Empty;
    public string? Description { get; set; }
    /// <summary>Optional hex color (e.g. "#F59E0B") for badge display in the UI.</summary>
    public string? Color { get; set; }
    /// <summary>JSON array of <see cref="Meezi.Core.Authorization.Permission"/> enum names.</summary>
    public string PermissionsJson { get; set; } = "[]";

    public Cafe Cafe { get; set; } = null!;
    public ICollection<Employee> Employees { get; set; } = [];
}
