feat: customers buy with a CPF or a CNPJ
All checks were successful
Build and deploy / Validate source (push) Successful in 1m38s
Build and deploy / Integration suite on a real stack (push) Successful in 4m57s
Build and deploy / Secret scan and release gate (push) Successful in 13s
Build and deploy / Publish images (push) Successful in 2m1s
All checks were successful
Build and deploy / Validate source (push) Successful in 1m38s
Build and deploy / Integration suite on a real stack (push) Successful in 4m57s
Build and deploy / Secret scan and release gate (push) Successful in 13s
Build and deploy / Publish images (push) Successful in 2m1s
The cart and the account signup take either document, each with its own mask and check digits. Tiny gets a person (F) for a CPF, Mercado Pago the matching identification type, and only CNPJs go to the company registry. The Kanban, the account page and the alerts show which one it is. Also pins the Correios test's clock: its fake token expired today, so the suite failed from Oct 16 on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -120,11 +120,7 @@ function liga(id,fmt,val,chave,erro,msg){
|
||||
er.textContent = ok? '' : msg;
|
||||
});
|
||||
}
|
||||
liga('fCnpj', v=>{
|
||||
const d=v.replace(/\D/g,'').slice(0,14);
|
||||
return d.replace(/^(\d{2})(\d)/,'$1.$2').replace(/^(\d{2})\.(\d{3})(\d)/,'$1.$2.$3')
|
||||
.replace(/\.(\d{3})(\d)/,'.$1/$2').replace(/(\d{4})(\d)/,'$1-$2');
|
||||
}, cnpjOk, 'cnpj', 'eCnpj', 'CNPJ inválido · confira os números');
|
||||
liga('fCnpj', fmtDoc, docOk, 'cnpj', 'eCnpj', 'CPF ou CNPJ inválido · confira os números');
|
||||
liga('fZap', v=>{
|
||||
const d=v.replace(/\D/g,'').slice(0,11);
|
||||
return d.length>6 ? '('+d.slice(0,2)+') '+d.slice(2,d.length-4)+'-'+d.slice(-4)
|
||||
|
||||
Reference in New Issue
Block a user