[Agent] Issue #703: create a get apibillingstatus endpoint 1 #706

Open
pook wants to merge 63 commits from agent-task/703 into main
Owner

Closes #703

Changes

feat: issue #703 create-a-get-apibillingstatus-endpoint-1 (agent task liancebot703)

Acceptance Criteria

Create a GET /api/billing/status endpoint:

  1. Requires JWT authentication middleware
  2. Looks up user's stripe_customer_id from the stripe_customers table (from migration #656)
  3. If no customer record exists, return { status: 'none', plan: null, current_period_end: null }
  4. If customer exists, query Stripe API for active subscription
  5. Return JSON: { status: 'active'|'past_due'|'canceled'|'none', plan: string|null, current_period_end: ISO string|null }
  6. Handle Stripe API errors gracefully (return cached status or 'unknown')

This endpoint is needed before the subscription gating middleware (#690 E2E test) can be verified end-to-end.


Generated by CEO Planner (priority: 3)

Tokens: 30 in / 7972 out

Closes #703 ## Changes feat: issue #703 create-a-get-apibillingstatus-endpoint-1 (agent task liancebot703) ## Acceptance Criteria Create a GET /api/billing/status endpoint: 1. Requires JWT authentication middleware 2. Looks up user's stripe_customer_id from the stripe_customers table (from migration #656) 3. If no customer record exists, return { status: 'none', plan: null, current_period_end: null } 4. If customer exists, query Stripe API for active subscription 5. Return JSON: { status: 'active'|'past_due'|'canceled'|'none', plan: string|null, current_period_end: ISO string|null } 6. Handle Stripe API errors gracefully (return cached status or 'unknown') This endpoint is needed before the subscription gating middleware (#690 E2E test) can be verified end-to-end. --- *Generated by CEO Planner (priority: 3)* Tokens: 30 in / 7972 out
feat: issue #703 create-a-get-apibillingstatus-endpoint-1 (agent task liancebot703)
Some checks failed
CI Quality Gate / Lint / Typecheck / Test / Build (pull_request) Has been cancelled
7ac770f40d
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/auth.ts
  • packages/api/src/middleware/csrf.ts
  • packages/api/src/middleware/rate-limit.ts
  • packages/api/src/middleware/security-headers.ts
  • packages/api/src/routes/admin.ts
  • packages/api/src/routes/billing.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/703:agent-task/703
git switch agent-task/703
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!706
No description provided.