Skip to content

Add Zod validation for tenants API - #970

Merged
greatest0fallt1me merged 1 commit into
CalloraOrg:mainfrom
Eldren-cmd:grantfox-tenants-validation
Jul 28, 2026
Merged

Add Zod validation for tenants API#970
greatest0fallt1me merged 1 commit into
CalloraOrg:mainfrom
Eldren-cmd:grantfox-tenants-validation

Conversation

@Eldren-cmd

Copy link
Copy Markdown
Contributor

Closes #892

Summary

  • Adds POST /api/tenants and PATCH /api/tenants/:tenantId.
  • Adds strict Zod schemas for tenant create/update requests and route params.
  • Returns standardized structured 400 validation envelopes.
  • Requires auth for tenant writes.
  • Adds structured tenant create/update logging with request and correlation IDs.
  • Documents the visible API contract in docs/tenants-api.md.
  • Fixes the error handler envelope helper reference so validation errors render correctly.

Testing

  • jest src/validators/tenants.test.ts src/routes/tenants.test.ts --runInBand --forceExit --silent
  • Coverage: src/routes/tenants.ts 100% lines/statements, src/validators/tenants.ts 100% lines/statements
  • Touched-file lint passed
  • Filtered typecheck showed no errors in touched files

@drips-wave

drips-wave Bot commented Jul 28, 2026

Copy link
Copy Markdown

@Eldren-cmd 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

@greatest0fallt1me
greatest0fallt1me merged commit 4be1b6d into CalloraOrg:main Jul 28, 2026
1 check failed
@greatest0fallt1me

Copy link
Copy Markdown
Contributor

Nice one — clean, focused change. Merging. 🚀

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.

Add zod input validation for /api/tenants [b#027]

2 participants