Skip to content

feat: add routes-d billing, wallet, payout, and close endpoints#1083

Closed
HasToBeJames wants to merge 1 commit into
davedumto:mainfrom
HasToBeJames:codex/routes-d-1027-1034-1046-1047
Closed

feat: add routes-d billing, wallet, payout, and close endpoints#1083
HasToBeJames wants to merge 1 commit into
davedumto:mainfrom
HasToBeJames:codex/routes-d-1027-1034-1046-1047

Conversation

@HasToBeJames

Copy link
Copy Markdown
Contributor

Description

Add the missing routes-d endpoints for billing plan lookup, wallet pending balances, payout method defaulting, and account closure with a reason.

Closes #1046
Closes #1027
Closes #1034
Closes #1047

Changes proposed

What were you told to do?

Implement the four routes-d issues in one PR, using the documented paths, auth/ownership checks, structured errors, and unit tests.

What did I do?

Billing and wallet endpoints

  • Added GET /api/routes-d/billing/plan to return the authenticated user's active subscription summary.
  • Added GET /api/routes-d/wallet/pending to return pending invoice totals for the authenticated wallet owner.

Default payout method and account close

  • Added PATCH /api/routes-d/payout-methods/[id]/default to promote a payout method and clear the previous default.
  • Added POST /api/routes-d/account/close to create a pending account closure request with a reason and grace window.

Verification

  • Added route tests for the happy path and key failure cases for all four endpoints.
  • Verified the touched files with ESLint and the new vitest suite.
  • Verified the touched files are clean under TypeScript's no-emit check.

Check List (Check all the applicable boxes)

  • My code follows the code style of this project.
  • This PR does not contain plagiarized content.
  • The title and description of the PR is clear and explains the approach.
  • I am making a pull request against the main branch (left side).
  • My commit messages styles matches our requested structure.
  • My code additions will fail neither code linting checks nor unit test.
  • I am only making changes to files I was requested to.

Screenshots / Testing Evidence

  • node node_modules\\eslint\\bin\\eslint.js passed for the touched route files and tests.
  • npx vitest run tests/api.routes-d.billing-plan.test.ts tests/api.routes-d.wallet-pending.test.ts tests/api.routes-d.payout-methods.default.test.ts tests/api.routes-d.account-close.test.ts passed: 4 files, 16 tests.
  • node node_modules\\typescript\\bin\\tsc --noEmit reported no errors in the touched files.

@vercel

vercel Bot commented Jun 25, 2026

Copy link
Copy Markdown

@HasToBeJames is attempting to deploy a commit to the david's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Jun 25, 2026

Copy link
Copy Markdown

@HasToBeJames Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@HasToBeJames

Copy link
Copy Markdown
Contributor Author

Superseded by #1088 which contains the same work. Closing this duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant