QrRapido/Services/IApiRateLimitService.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

24 lines
629 B
C#

using QRRapidoApp.Models;
namespace QRRapidoApp.Services
{
public record RateLimitResult(
bool Allowed,
int PerMinuteLimit,
int PerMinuteUsed,
long ResetUnixTimestamp,
int MonthlyLimit,
int MonthlyUsed,
bool MonthlyExceeded
);
public interface IApiRateLimitService
{
/// <summary>
/// Checks the rate limit for the given API key prefix and plan tier.
/// Increments the counter only if the request is allowed.
/// </summary>
Task<RateLimitResult> CheckAndIncrementAsync(string keyPrefix, ApiPlanTier tier);
}
}