fix: quota slide_generate pour tier BASIC
Some checks failed
CI / Lint, Unit Tests & Build (push) Successful in 5m43s
CI / Deploy production (on server) (push) Failing after 17s

- Ajoute slide_generate et excalidraw_generate dans TIER_LIMITS
  (BASIC: 3, PRO: 20, BUSINESS: 100, ENTERPRISE: unlimited)
- run-for-note: utilise le bon feature key selon le type d'agent
- slides.tool: incrémente slide_generate (pas reformulate)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Antigravity
2026-05-29 12:10:31 +00:00
parent 9e23c078e9
commit f4208780fd
3 changed files with 13 additions and 4 deletions

View File

@@ -44,9 +44,10 @@ export async function POST(req: NextRequest) {
return NextResponse.json({ error: 'Paramètres invalides' }, { status: 400 })
}
// Quota check — slides/excalidraw generation counts as 'reformulate' credit
// Quota check — feature key depends on generation type
const featureKey = type === 'slide-generator' ? 'slide_generate' : 'excalidraw_generate'
try {
await checkEntitlementOrThrow(userId, 'reformulate')
await checkEntitlementOrThrow(userId, featureKey)
} catch (e) {
if (e instanceof QuotaExceededError) {
return NextResponse.json({ error: e.message }, { status: 402 })