[GSSoC'26] fix: make OTP required in verifyDeliverySchema#756
Conversation
|
@KanishJebaMathewM I have submitted the fix. Please let me know if any changes are needed! |
|
🎉 Thank you for your contribution! Your pull request has been received and will be reviewed shortly. If you enjoy the project, please consider giving the repository a ⭐. You can also follow my GitHub profile to stay updated on future open-source projects. Thanks for being part of the community! 🚀 |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
💤 Files with no reviewable changes (2)
📝 WalkthroughWalkthrough
ChangesOTP Presence Validation Consolidation
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related issues
Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
709fc10 to
f970be4
Compare
Description
.optional()from OTP field inverifyDeliverySchemaso Zod enforces presence with consistent validation errorsif (!otp)guard in handler since schema now handles required-field enforcementFiles Changed
backend/api/src/validation/requestSchemas.js: Removed.optional()from OTP inner schemabackend/api/src/routes/orderRoutes.js: Removed manualif (!otp)check (now handled by Zod)Type of Change
Difficulty & Label Request
Assessed difficulty:
level1Please apply the matching difficulty label for GSSoC '26 scoring.
If applicable, please also apply
gssoc:approvedafter review.Testing & Verification
Commands run: N/A (schema change only, validated by existing Zod validation flow)
Result: Schema now rejects missing OTP with structured error instead of generic 400
Known Limitations
GSSoC 2026 Compliance
This contribution was prepared with AI assistance and manually reviewed before submission.
Closes #742
Summary by CodeRabbit