using IamService.Domain.SeedWork;

namespace IamService.Domain.AggregatesModel.ComplianceAggregate;

/// <summary>
/// EN: Compliance report type enumeration.
/// VI: Enumeration loại báo cáo tuân thủ.
/// </summary>
public class ComplianceReportType : Enumeration
{
    public static readonly ComplianceReportType GDPR = new(1, nameof(GDPR));
    public static readonly ComplianceReportType SOC2 = new(2, nameof(SOC2));
    public static readonly ComplianceReportType ISO27001 = new(3, nameof(ISO27001));
    public static readonly ComplianceReportType HIPAA = new(4, nameof(HIPAA));
    public static readonly ComplianceReportType AccessReview = new(5, nameof(AccessReview));

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

    public static ComplianceReportType? FromId(int id) => id switch
    {
        1 => GDPR,
        2 => SOC2,
        3 => ISO27001,
        4 => HIPAA,
        5 => AccessReview,
        _ => null
    };
}

/// <summary>
/// EN: Compliance report status enumeration.
/// VI: Enumeration trạng thái báo cáo.
/// </summary>
public class ComplianceReportStatus : Enumeration
{
    public static readonly ComplianceReportStatus Pending = new(1, nameof(Pending));
    public static readonly ComplianceReportStatus Generating = new(2, nameof(Generating));
    public static readonly ComplianceReportStatus Completed = new(3, nameof(Completed));
    public static readonly ComplianceReportStatus Failed = new(4, nameof(Failed));

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

    public static ComplianceReportStatus? FromId(int id) => id switch
    {
        1 => Pending, 2 => Generating, 3 => Completed, 4 => Failed, _ => null
    };
}

/// <summary>
/// EN: Violation severity enumeration.
/// VI: Enumeration mức độ nghiêm trọng vi phạm.
/// </summary>
public class ViolationSeverity : Enumeration
{
    public static readonly ViolationSeverity Low = new(1, nameof(Low));
    public static readonly ViolationSeverity Medium = new(2, nameof(Medium));
    public static readonly ViolationSeverity High = new(3, nameof(High));
    public static readonly ViolationSeverity Critical = new(4, nameof(Critical));

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