Skip to content

feat(jobs): add Zod per-type validation to POST /api/jobs/enqueue#390

Merged
1nonlypiece merged 3 commits into
Disciplr-Org:mainfrom
jabir-dev788:feat/jobs-enqueue-validation
May 28, 2026
Merged

feat(jobs): add Zod per-type validation to POST /api/jobs/enqueue#390
1nonlypiece merged 3 commits into
Disciplr-Org:mainfrom
jabir-dev788:feat/jobs-enqueue-validation

Conversation

@jabir-dev788
Copy link
Copy Markdown
Contributor

Closes #331

What this does

Adds strict Zod schema validation to POST /api/jobs/enqueue before jobs enter the queue.

Changes

  • src/routes/jobs.ts: validate request body against per-type schemas
  • src/jobs/types.ts: aligned Zod schemas with existing type definitions
  • src/lib/validation.ts: extended with reusable validation helpers
  • src/tests/enqueueOptions.test.ts: added tests for valid/invalid payloads and bounds

Test coverage

All edge cases covered: invalid payload shape, out-of-bounds maxAttempts/delayMs, unknown job type. 44 tests passing.

Notes

No changes to queue logic or handlers. Validation only at the route boundary.

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 27, 2026

@jabir-dev788 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

@1nonlypiece 1nonlypiece merged commit f14df68 into Disciplr-Org:main May 28, 2026
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 request validation and shared schema to POST /api/jobs/enqueue in src/routes/jobs.ts

2 participants