Implement Alphanumeric CNPJ Generation Feature - #3
Merged
Conversation
Co-authored-by: edenalencar <7075481+edenalencar@users.noreply.github.com>
Co-authored-by: edenalencar <7075481+edenalencar@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Nova Feature
Implement Alphanumeric CNPJ Generation Feature
Sep 4, 2025
edenalencar
approved these changes
Sep 4, 2025
edenalencar
left a comment
Owner
There was a problem hiding this comment.
Implementação do CNPJ Alfanumerico
edenalencar
marked this pull request as ready for review
September 4, 2025 20:20
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.
This PR implements the new Brazilian alphanumeric CNPJ generation feature, allowing users to generate both traditional numeric CNPJs and the new alphanumeric format that includes letters and numbers.
Changes Made
New Alphanumeric CNPJ Class
IdentificacaoCNPJAlfanumerico.csthat supports 33 valid characters (0-9, A-Z excluding I, O, U to avoid confusion with numbers)Enhanced User Interface
Updated Business Logic
IdentificacaoFactoryto support the new alphanumeric CNPJ typeCNPJ_ALFANUMERICOconstant toConstantes.csCNPJPage.xaml.csto handle both numeric and alphanumeric formats seamlesslyTechnical Implementation
The alphanumeric CNPJ uses a 33-character set excluding vowels I, O, U (standard practice to prevent confusion with digits 1, 0). The validation algorithm uses modular arithmetic with base-33 calculations for both check digits, following Brazilian alphanumeric CNPJ standards.
Example outputs:
Compatibility
Fixes #2.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.