feat: enforce account usage limits
CI and Deploy / test (push) Successful in 2m39s
CI and Deploy / deploy (push) Successful in 55s

This commit is contained in:
cesnimda
2026-07-30 23:14:42 +02:00
parent 9cd2e5c2e3
commit 158970fa01
7 changed files with 74 additions and 16 deletions
+14
View File
@@ -0,0 +1,14 @@
namespace JobTrackerApi.Models;
public sealed record AccountEntitlements(bool AdvancedAi, bool PremiumThemes, bool Automation, bool Analytics, long StorageBytes, int MonthlyAiCalls);
public static class AccountPlans
{
public static AccountEntitlements ForRoles(IList<string> roles)
{
var premium = roles.Contains("Premium", StringComparer.OrdinalIgnoreCase) || roles.Contains("Admin", StringComparer.OrdinalIgnoreCase);
return premium
? new AccountEntitlements(true, true, true, true, 5_000_000_000, 250)
: new AccountEntitlements(false, false, false, false, 250_000_000, 25);
}
}