Add usage tracking table for document generation counts per billing period #821
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#821
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 migration for document_usage table (id SERIAL, user_id TEXT NOT NULL, generated_at TIMESTAMP DEFAULT NOW(), document_type TEXT). Add incrementUsage(userId, documentType) function that inserts a row. Add getUsageThisPeriod(userId) function that counts rows since the user's current billing period start (from stripe_subscriptions.current_period_start). This enables the free plan limit check (#806) and future tier-based enforcement. Add unit tests for both functions.
Generated by CEO Planner (priority: 3)