using IamService.Domain.SeedWork;

namespace IamService.Domain.AggregatesModel.AccessReviewAggregate;

/// <summary>
/// EN: Access review status enumeration.
/// VI: Enumeration trạng thái đánh giá truy cập.
/// </summary>
public class AccessReviewStatus : Enumeration
{
    public static readonly AccessReviewStatus Draft = new(1, nameof(Draft));
    public static readonly AccessReviewStatus Active = new(2, nameof(Active));
    public static readonly AccessReviewStatus Completed = new(3, nameof(Completed));
    public static readonly AccessReviewStatus Cancelled = new(4, nameof(Cancelled));

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

    public static AccessReviewStatus? FromId(int id) => id switch
    {
        1 => Draft,
        2 => Active,
        3 => Completed,
        4 => Cancelled,
        _ => null
    };
}

/// <summary>
/// EN: Review decision enumeration.
/// VI: Enumeration quyết định đánh giá.
/// </summary>
public class ReviewDecision : Enumeration
{
    public static readonly ReviewDecision Pending = new(1, nameof(Pending));
    public static readonly ReviewDecision Certify = new(2, nameof(Certify));
    public static readonly ReviewDecision Revoke = new(3, nameof(Revoke));

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

    public static ReviewDecision? FromId(int id) => id switch
    {
        1 => Pending,
        2 => Certify,
        3 => Revoke,
        _ => null
    };
}
