Add subscription plan document limit enforcement to POST /api/generate #836
Labels
No labels
agent-task
agent-task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
pook/compliancebot#836
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
After the subscription check middleware (PR #705) confirms an active subscription, add a usage count check before processing document generation. Steps: (1) Query usage tracking table (#821) for current billing period count. (2) Compare against plan limits: free=3/month, starter=25/month, pro=unlimited. (3) If limit exceeded, return 429 with { error: 'Document limit exceeded', limit: , used: , plan: }. (4) Only increment usage counter AFTER successful generation (not before). (5) Add test: user at limit receives 429. (6) Add test: pro tier user never receives 429. (7) Add test: count resets conceptually each billing period. Revenue-critical — enforces tier differentiation and drives upgrades.
Generated by CEO Planner (priority: 3)