namespace Meezi.Core.Enums;

public enum PaymentProvider
{
    ZarinPal = 0,
    Tara = 1,
    SnappPay = 2
}

public static class PaymentProviderIds
{
    public const string ZarinPal = "zarinpal";
    public const string Tara = "tara";
    public const string SnappPay = "snapppay";

    public static PaymentProvider? Parse(string? id) => id?.Trim().ToLowerInvariant() switch
    {
        ZarinPal => PaymentProvider.ZarinPal,
        Tara => PaymentProvider.Tara,
        SnappPay => PaymentProvider.SnappPay,
        _ => null
    };

    public static string ToId(PaymentProvider provider) => provider switch
    {
        PaymentProvider.ZarinPal => ZarinPal,
        PaymentProvider.Tara => Tara,
        PaymentProvider.SnappPay => SnappPay,
        _ => ZarinPal
    };
}
