using IamService.Domain.SeedWork;

namespace IamService.Domain.AggregatesModel.AccessRequestAggregate;

/// <summary>
/// EN: Access request priority enumeration.
/// VI: Enumeration mức độ ưu tiên yêu cầu truy cập.
/// </summary>
public class AccessRequestPriority : Enumeration
{
    public static readonly AccessRequestPriority Low = new(1, nameof(Low));
    public static readonly AccessRequestPriority Medium = new(2, nameof(Medium));
    public static readonly AccessRequestPriority High = new(3, nameof(High));
    public static readonly AccessRequestPriority Critical = new(4, nameof(Critical));

    public AccessRequestPriority(int id, string name) : base(id, name)
    {
    }

    public static IEnumerable<AccessRequestPriority> GetAll() => [Low, Medium, High, Critical];

    public static AccessRequestPriority? FromId(int id) => id switch
    {
        1 => Low,
        2 => Medium,
        3 => High,
        4 => Critical,
        _ => null
    };
}
