fix: validate KYC document file type before upload - #531
Conversation
|
@yourfavebatman is attempting to deploy a commit to the David Dada's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@yourfavebatman 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! 🚀 |
sshdopey
left a comment
There was a problem hiding this comment.
Hey! Thanks for tackling this KYC upload validation issue. Your changes add a solid client-side check for file type and size, which will definitely save bandwidth and improve user feedback. I noticed a small inconsistency between the allowed types in the validator and the types.ts constant (PNG is included in one but not the other), but that's a minor thing we can polish later. Great effort overall, and the manual verification steps you listed are super helpful. Keep up the awesome work! ❤️
|
Approved! 🎉 I couldn't auto-merge this just yet (it may need a rebase or have a check still running). A maintainer can merge it whenever it's ready. |
sshdopey
left a comment
There was a problem hiding this comment.
Hey! Thanks for tackling this KYC validation issue. Your client-side file type and size checks are a great improvement—they'll save bandwidth and give users instant feedback. I noticed a couple of small things like the ALLOWED^DOCUMENT_TYPES typo and the date regex changes that seem unrelated, but these are easy to fix later. The core logic is solid and clearly addresses the issue. Nice work! ❤️
|
Approved! 🎉 I couldn't auto-merge this just yet (it may need a rebase or have a check still running). A maintainer can merge it whenever it's ready. |
sshdopey
left a comment
There was a problem hiding this comment.
Hey! Thanks for tackling the KYC upload validation issue. Your client-side checks for file type and size are a great step toward saving bandwidth and improving UX. I noticed a couple of small typos (like ALLOWED^DOCUMENT_TYPES and the date regex tweaks) that might need a quick look, but the overall approach is solid and clearly addresses the linked issue. Keep up the awesome work! 🚀
|
Approved! 🎉 I couldn't auto-merge this just yet (it may need a rebase or have a check still running). A maintainer can merge it whenever it's ready. |
|
Hi! Thanks for working on this KYC validation issue. I see you've added a validator and types, but I noticed a few things that might need a second look: the diff shows changes to the DOB regex that seem unrelated, and there are some syntax errors like |
sshdopey
left a comment
There was a problem hiding this comment.
Hey! Thanks for tackling the KYC upload validation issue. I can see you've added client-side checks for file type and size, which is exactly what was needed to save bandwidth and give users instant feedback. The new validation module and type additions look like a solid start. I noticed a few small things like a duplicate constant and some formatting changes that might be worth a quick look, but overall this is a great step forward. Keep up the awesome work! ❤️
sshdopey
left a comment
There was a problem hiding this comment.
Hey! Thanks for tackling the KYC upload validation issue. I can see you've added client-side checks for file types and size limits, which is exactly what was needed. The new validation logic and types look like a solid start. I noticed a few small things like a duplicate constant and some formatting changes that might be unintentional, but those are easy to clean up later. Overall, this is a great step toward preventing wasted bandwidth and giving users instant feedback. Keep up the awesome work! ❤️
|
Approved! 🎉 I couldn't auto-merge this just yet (it may need a rebase or have a check still running). A maintainer can merge it whenever it's ready. |
1 similar comment
|
Approved! 🎉 I couldn't auto-merge this just yet (it may need a rebase or have a check still running). A maintainer can merge it whenever it's ready. |
Overview
This PR adds client-side KYC document upload validation to prevent unsupported file types from being sent to the server. It checks that the selected document is an allowed JPG/PDF and within the size limit, saving bandwidth and giving users instant feedback instead of a server-side rejection after upload.
Related Issue
Closes the reported KYC document upload validation issue.
Changes
🛂 KYC Upload Validator
[ADD]
src/lib/kycValidation.tsimage/jpeg,application/pdf,.jpg,.jpeg,.pdf.KycValidationResultwith avalidflag and user-facing error message for invalid files.[MODIFY]
src/types.tsKycDocumentTypeunion type ('jpg' | 'jpeg' | 'pdf') andKycValidationResultinterface.ACCEPTED_KYC_DOCUMENT_TYPESfor reuse in the validator and upload UI.Verification Results
KycValidationResultCloses #347