Introduce Email and CPF Value Objects#89
Open
ericklucioh wants to merge 23 commits intobrunoclz:mainfrom
Open
Conversation
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.
Summary
Refactor of CPF/CNPJ document handling to improve consistency, validation safety, and object-oriented design.
@dataclassin inherited classesDocumentclassget_identifierby relying on constructor validation instead of duplicated checksThis change ensures stronger domain integrity and aligns the implementation with Value Object patterns.
Release metadata
Release note (PT-BR):
Refatoração da validação e modelagem de CPF/CNPJ para garantir integridade dos objetos e melhorar a estrutura orientada a objetos.
Release note (EN):
Refactor of CPF/CNPJ validation and modeling to ensure object integrity and improve object-oriented structure.
Release highlights (PT-BR, bullets with
|):Validação garantida na criação de CPF/CNPJ | Remoção de uso incorreto de dataclass | Código mais consistente e seguro
Release highlights (EN, bullets with
|):Validation enforced at object creation | Removed incorrect dataclass usage | More consistent and safer code
Included pattern IDs (comma-separated, or
none):none
Technical changes (PT-BR, bullets with
|):Remoção de @DataClass em classes herdadas | Uso correto de herança com super().init | Validação movida para construtor | Simplificação da função get_identifier
Technical changes (EN, bullets with
|):Removed @DataClass from inherited classes | Proper inheritance using super().init | Validation moved to constructor | Simplified get_identifier function
Change type (choose one release label from taxonomy):
release:majorrelease:featurerelease:patternsrelease:apirelease:datarelease:privacyrelease:fixrelease:docsrelease:infrarelease:securityBreaking change?
Validation
Public safety and compliance checklist
PUBLIC_MODEbehavior was reviewed (if relevant)docs/release/public_boundary_matrix.csvRisk and rollback
Risks:
Cpf/Cnpjwithout validation may now raise exceptionsRollback plan:
is_validchecks before instantiation in callers