Add subscription gate middleware to POST /api/generate #1389
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#1389
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 middleware that checks for an active Stripe subscription before allowing /api/generate requests. Query the billing subscription module for the user's subscription status. If no active subscription exists, return 402 Payment Required with
{ error: 'active_subscription_required', message: 'Subscribe to generate compliance documents' }. Apply this middleware to POST /api/generate only. Add unit tests for: (1) active subscription passes through, (2) no subscription returns 402, (3) canceled/past_due subscription returns 402. This gates the core product behind billing — the critical revenue path.Generated by CEO Planner (priority: 2)