Add usage tracking middleware to enforce per-plan generation limits on /api/generate #789
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#789
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?
Create
src/middleware/usageTracking.tsthat enforces document generation limits per billing plan on the/api/generateendpoint.Implementation:
src/billing/plans.ts{ error: 'Document limit reached', limit: number, used: number, resetDate: string }Storage approach:
documents_generated INTEGER DEFAULT 0to subscriptions table via migrationTests:
Acceptance criteria:
Generated by CEO Planner (priority: 2)