feat(input): accept alphanumeric CNPJ in OceanInputType (OR-98)#1088
Conversation
Receita Federal NT 49/2024 introduces alphanumeric CNPJs (letters A-Z in positions 1..12, DVs stay numeric). OceanInputType.CNPJ and CpfCnpj previously filtered to digits-only and forced a numeric keyboard, blocking the new format entirely. Changes: - New helper `sanitizeWithAlphanumeric` on the base interface — keeps `[A-Z0-9]`, upper-cases letters, drops separators. - `CNPJ` now uses `KeyboardType.Ascii` and the alphanumeric sanitiser. Legacy numeric CNPJs keep working unchanged. - `CpfCnpj` switches to `Ascii` and selects between numeric/alpha sanitisation by the presence of letters or length > 11. - POS-friendly: only `KeyboardType.Number` is in `OceanDS.disabledKeyboards`, so the Ascii keyboard is allowed to open even when the numeric virtual keyboard is disabled. CPF remains untouched — still digits-only with the numeric keyboard. Refs: spec Pagnet/blu-mobile-android#3650 (OR-98). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Code ReviewResumoPR implementa suporte ao formato alfanumérico de CNPJ (Receita Federal NT 49/2024) no Apontamentos🔴 BlockersNenhum. 🟡 Warnings
🟢 Suggestions
Cobertura de Testes
VereditoAPPROVED — lógica correta, backward compatible, bem testado. O warning de UX do teclado Ascii em modo CPF é o ponto mais relevante para validar com produto/UX antes do merge nos consumidores (T6/T7). |
Per @gustavoalens' review on PR #1088: code changes do not need explanatory comments — keep them only for genuinely complex logic or accepted temporary solutions. Removes the change-explaining comments from OceanInputType (CNPJ/CpfCnpj) and the verbose class KDoc from OceanInputTypeTest. Behaviour and tests unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
CI `build` was failing on `:app:compileReleaseArtProfile` with `Java heap space`. The baseline-profile ART compilation in the release build needs more than the previous 2 GB. Bumps the daemon heap to 4 GB (+1 GB metaspace), well within the GitHub-hosted runner's memory. Unrelated to the OR-98 input change — pre-existing heap fragility that surfaced on this PR's release build. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|



Summary
OceanInputType.CNPJandOceanInputType.CpfCnpjnow accept the alphanumeric CNPJ format defined by Receita Federal NT 49/2024 ([A-Z]allowed in positions 1..12, DVs stay numeric).KeyboardType.NumbertoKeyboardType.Asciiso the user can actually type letters. On POS hosts that disable the numeric virtual keyboard viaOceanDS.disabledKeyboards, the Ascii keyboard still opens normally (onlyNumberis disabled).sanitizeWithAlphanumericon the baseOceanInputTypeinterface — keeps[A-Z0-9], upper-cases letters, drops separators.Refs spec Pagnet/blu-mobile-android#3650 (OR-98) — delivers task T2 of the execution plan (Ocean DS Android is the first project in the queue, blocks consumer migrations T6/T7).
Test plan
./gradlew :ocean-components:testDebugUnitTest— newOceanInputTypeTest(10+ cases) + existing suite green../gradlew :ocean-components:ktlintCheck— no violations.N960KInputSetupactive (covered by T8 in the spec).Reviewers: @Pagnet/plataformas and mobile devs.
🤖 Generated with Claude Code