namespace QRRapidoApp.Models
{
    public enum ApiPlanTier
    {
        Free = 0,
        Starter = 1,
        Pro = 2,
        Business = 3,
        Enterprise = 4
    }

    public static class ApiPlanLimits
    {
        private static readonly Dictionary<ApiPlanTier, (int PerMinute, int PerMonth)> _limits = new()
        {
            { ApiPlanTier.Free,       (10,  500) },
            { ApiPlanTier.Starter,    (50,  10_000) },
            { ApiPlanTier.Pro,        (200, 100_000) },
            { ApiPlanTier.Business,   (500, 500_000) },
            { ApiPlanTier.Enterprise, (int.MaxValue, int.MaxValue) },
        };

        public static (int PerMinute, int PerMonth) GetLimits(ApiPlanTier tier) =>
            _limits.TryGetValue(tier, out var l) ? l : _limits[ApiPlanTier.Free];

        public static string PlanName(ApiPlanTier tier) => tier switch
        {
            ApiPlanTier.Free       => "Free",
            ApiPlanTier.Starter    => "Starter",
            ApiPlanTier.Pro        => "Pro",
            ApiPlanTier.Business   => "Business",
            ApiPlanTier.Enterprise => "Enterprise",
            _                      => "Free"
        };
    }
}
