Skip to content

feat: add account_id override to POST /api/notifications#243

Merged
sweetmantech merged 1 commit intotestfrom
feat/notifications-account-id
Feb 25, 2026
Merged

feat: add account_id override to POST /api/notifications#243
sweetmantech merged 1 commit intotestfrom
feat/notifications-account-id

Conversation

@sweetmantech
Copy link
Copy Markdown
Contributor

Summary

  • Add optional account_id body param so org API keys can send notifications on behalf of member accounts
  • Refactor validateCreateNotificationBody to handle auth + body parsing (matches artists pattern)
  • Simplify createNotificationHandler to delegate to the new validate function
  • Add tests for account_id override, auth passthrough, and 403 access denied

Test plan

  • 18/18 notification tests pass (pnpm test lib/notifications/)
  • Verify pnpm build passes in CI

🤖 Generated with Claude Code

Org API keys can now send notifications on behalf of member accounts
by passing account_id in the request body.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Feb 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
recoup-api Building Building Preview Feb 25, 2026 4:44pm

Request Review

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Feb 25, 2026

Warning

Rate limit exceeded

@sweetmantech has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 22 minutes and 59 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 064a133 and 813d0ad.

⛔ Files ignored due to path filters (2)
  • lib/notifications/__tests__/createNotificationHandler.test.ts is excluded by !**/*.test.*, !**/__tests__/** and included by lib/**
  • lib/notifications/__tests__/validateCreateNotificationBody.test.ts is excluded by !**/*.test.*, !**/__tests__/** and included by lib/**
📒 Files selected for processing (3)
  • app/api/notifications/route.ts
  • lib/notifications/createNotificationHandler.ts
  • lib/notifications/validateCreateNotificationBody.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/notifications-account-id

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sweetmantech sweetmantech merged commit feff039 into test Feb 25, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant