Skip to content

Standardize validation schemas#49

Merged
andres15alvarez merged 10 commits into
devfrom
refactor/standardize-validation-schemas
May 18, 2025
Merged

Standardize validation schemas#49
andres15alvarez merged 10 commits into
devfrom
refactor/standardize-validation-schemas

Conversation

@gus211
Copy link
Copy Markdown
Contributor

@gus211 gus211 commented May 18, 2025

📦 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:

  • Minimum: 8 characters
  • Maximum: 255 characters

This change applies to the following schemas:

  • registerSchema
  • updatePasswordSchema
  • loginSchema

📞 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:

  • registerSchema
  • editProfileSchema

🏷️ Schema Field Key Updates

The following schema has been updated to rename field keys from Spanish to English for consistency:

  • registerSchema
    • nombrefirstName
    • apellidolastName
    • ceduladocumentId
    • telefonophoneNumber
    • fechaNacimientobirthDate
    • generogender

As a result, the following pages were updated accordingly to align with the schema:

  • src/app/(dashboard)/users/new/page.tsx
  • src/app/(dashboard)/users/[id]/edit/page.tsx

📂 Modified Schemas

  • categorySchema.ts
  • editProfileSchema.ts
  • loginSchema.ts
  • newPresentationSchema.ts
  • registerSchema.ts
  • updatePasswordSchema.ts

✅ No changes were necessary for the remaining schemas.


Let me know if you'd like this split into separate commits or PRs.

@netlify
Copy link
Copy Markdown

netlify Bot commented May 18, 2025

Deploy Preview for pharmatechadmin ready!

Name Link
🔨 Latest commit 26aee11
🔍 Latest deploy log https://app.netlify.com/projects/pharmatechadmin/deploys/682a1ace331af90008177ac5
😎 Deploy Preview https://deploy-preview-49--pharmatechadmin.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@gus211 gus211 self-assigned this May 18, 2025
@gus211 gus211 added the refactor Improve code without changing behavior label May 18, 2025
Comment thread src/lib/validations/updatePasswordSchema.ts
Comment thread src/lib/validations/updatePasswordSchema.ts
Copy link
Copy Markdown
Member

@andres15alvarez andres15alvarez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

falta actualizar el minimo a 8 en el login

Listo

Comment thread src/lib/validations/loginSchema.ts Outdated
@gus211 gus211 marked this pull request as ready for review May 18, 2025 17:45
@andres15alvarez andres15alvarez merged commit 513e0d8 into dev May 18, 2025
5 checks passed
@andres15alvarez andres15alvarez deleted the refactor/standardize-validation-schemas branch May 18, 2025 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Improve code without changing behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants