QrRapido/Models/ApiPlanTier.cs
Ricardo Carneiro 7a0c12f8d2
Some checks failed
Deploy QR Rapido / test (push) Failing after 17s
Deploy QR Rapido / build-and-push (push) Has been skipped
Deploy QR Rapido / deploy-staging (push) Has been skipped
Deploy QR Rapido / deploy-production (push) Has been skipped
feat: api separada do front-end e area do desenvolvedor.
2026-03-08 12:40:51 -03:00

37 lines
1.2 KiB
C#

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"
};
}
}