Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: prevent duplicate CPF registration and add findByCpf method #6

Merged
merged 5 commits into from
Feb 25, 2025

Conversation

arakakimath
Copy link
Owner

🛠 What was done?

  • Added findByCpf method to delivery people repositories.
  • Implemented error handling to prevent duplicate CPF registration when creating a new delivery person.
  • Updated tests to cover the new validation logic.

🐛 Why?

Previously, the application allowed registering a delivery person with an already existing CPF, leading to data inconsistency.

✅ How to test?

  1. Try creating a new delivery person with an already registered CPF.
  2. The API should return an appropriate error response.
  3. Run tests with npm test (or your test command) to ensure all test cases pass.

@arakakimath arakakimath merged commit 90d1e14 into main Feb 25, 2025
1 check passed
@arakakimath
Copy link
Owner Author

🎉 This PR is included in version 1.1.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant