Standardize validation schemas#49
Merged
Merged
Conversation
✅ Deploy Preview for pharmatechadmin ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
andres15alvarez
requested changes
May 18, 2025
andres15alvarez
approved these changes
May 18, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📦 Standardize validation schemas (Dashboard)
✅ Summary
This PR standardizes the validation logic across multiple schemas to improve consistency and maintainability in the dashboard module.
🔐 Password Validation (Min/Max Length Only)
All password-related inputs (
password,newPassword,confirmPassword) now share a consistent validation rule:This change applies to the following schemas:
registerSchemaupdatePasswordSchemaloginSchema📞 Phone Number Validation Update
Phone number inputs no longer require a
+sign.They now only validate that the input contains 8 to 15 numeric digits.
This change applies to:
registerSchemaeditProfileSchema🏷️ Schema Field Key Updates
The following schema has been updated to rename field keys from Spanish to English for consistency:
registerSchemanombre→firstNameapellido→lastNamecedula→documentIdtelefono→phoneNumberfechaNacimiento→birthDategenero→genderAs a result, the following pages were updated accordingly to align with the schema:
src/app/(dashboard)/users/new/page.tsxsrc/app/(dashboard)/users/[id]/edit/page.tsx📂 Modified Schemas
categorySchema.tseditProfileSchema.tsloginSchema.tsnewPresentationSchema.tsregisterSchema.tsupdatePasswordSchema.ts✅ No changes were necessary for the remaining schemas.
Let me know if you'd like this split into separate commits or PRs.