[Agent] Issue #425: create middleware that checks whether th #434

Open
pook wants to merge 49 commits from agent-task/425 into main
Owner

Closes #425

Changes

feat: issue #425 create-middleware-that-checks-whether-th (agent task liancebot425)

Acceptance Criteria

Create middleware that checks whether the authenticated user has an active Stripe subscription before allowing access to POST /api/generate, POST /api/generate/privacy-policy, POST /api/generate/terms-of-service, and POST /api/generate/cookie-policy. Query the User model's subscriptionStatus field (or call Stripe API if field is stale). Return 403 with JSON body { error: 'Active subscription required' } if subscription is not active. Apply middleware to all /api/generate routes. Add unit tests for active, inactive, and missing subscription states.


Generated by CEO Planner (priority: 4)

Tokens: 17 in / 4502 out

Closes #425 ## Changes feat: issue #425 create-middleware-that-checks-whether-th (agent task liancebot425) ## Acceptance Criteria Create middleware that checks whether the authenticated user has an active Stripe subscription before allowing access to POST /api/generate, POST /api/generate/privacy-policy, POST /api/generate/terms-of-service, and POST /api/generate/cookie-policy. Query the User model's subscriptionStatus field (or call Stripe API if field is stale). Return 403 with JSON body { error: 'Active subscription required' } if subscription is not active. Apply middleware to all /api/generate routes. Add unit tests for active, inactive, and missing subscription states. --- *Generated by CEO Planner (priority: 4)* Tokens: 17 in / 4502 out
feat: issue #425 create-middleware-that-checks-whether-th (agent task liancebot425)
Some checks failed
CI Quality Gate / Lint / Typecheck / Test / Build (pull_request) Has been cancelled
ecca26213b
Some checks failed
CI Quality Gate / Lint / Typecheck / Test / Build (pull_request) Has been cancelled
This pull request has changes conflicting with the target branch.
  • .forgejo/workflows/ci.yml
  • bun.lock
  • package.json
  • packages/api/src/db/schema.ts
  • packages/api/src/index.ts
  • packages/api/src/middleware/rate-limit.ts
  • packages/api/src/middleware/security-headers.ts
  • packages/api/src/routes/generate-tos.ts
  • packages/api/src/routes/generate.ts
  • packages/api/src/routes/health.ts
  • packages/api/src/routes/questionnaire.ts
  • packages/api/src/services/document-generator.ts
  • packages/api/src/services/llm.ts
  • packages/api/src/templates/index.ts
  • packages/api/tsconfig.json
  • packages/shared/src/types.ts
  • packages/web/src/app/questionnaire/page.tsx
  • packages/web/src/components/documents/DocumentList.tsx
  • packages/web/src/components/questionnaire/ReviewStep.tsx
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin agent-task/425:agent-task/425
git switch agent-task/425
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pook/compliancebot!434
No description provided.