gohorsejobs/backend/internal/core
Tiago Yamamoto 3a26af3df5 fix: global document and phone handling — remove Brazil-specific formatting
Frontend (jobs/new):
- Replace isValidCNPJ (checksum algorithm) with isValidDocument: accepts
  any tax document with 5–30 alphanumeric chars (CNPJ, EIN, VAT, etc.)
- Add cleanPhone(): strips formatting chars (dashes, spaces, parens) and
  keeps only digits + optional leading '+'; replaces cleanDigits+prepend
- Phone sent as '+5511999998888' if user typed '+55...', or '11999998888'
  if no country code was provided — no '+' blindly prepended anymore
- Company document sent stripped of all non-alphanumeric before API call
- Update label placeholder from '00.000.000/0000-00' to 'CNPJ, EIN, VAT...'
- Rename error key invalidCnpj → invalidDocument in all 3 locales (pt, en, es)

Backend (create_company use case):
- Add SanitizePhone() to utils/sanitizer.go: strips all non-digit chars
  except a leading '+'; '(11) 99999-8888' → '11999998888'
- Apply SanitizePhone to input.Phone before persisting to DB

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-22 12:46:54 -06:00
..
domain/entity fix: resolve remaining merge conflicts 2026-02-14 17:21:10 +00:00
dto Align backend company registration and notification routes with frontend 2026-02-15 13:16:37 -03:00
ports feat: atualiza fluxo de cadastro de candidatos com persistência completa de dados e máscara de telefone 2026-01-06 18:19:47 -03:00
usecases fix: global document and phone handling — remove Brazil-specific formatting 2026-02-22 12:46:54 -06:00