fix: a cart item takes up to 200 files (Sentry DTF-WEB-1, Dropstar's 66-sheet test)

One item was capped at 20 files, so a real 66-sheet ready-sheet cart was
refused with the generic 'Confira os dados'. The cap is now 200 files per
item; above it the Site and the server say 'Este item tem mais de 200
arquivos. Divida em dois itens.'

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Cauê Faleiros
2026-11-11 16:43:32 -03:00
parent 26ed5cecef
commit ab3ac65b69
3 changed files with 86 additions and 24 deletions

View File

@@ -447,6 +447,11 @@
if (semArquivo) return message(semArquivo+'.','error');
const cart = itensAPagar();
if (!cart.length) return message('Adicione um item ao pedido.','error');
// One item carries at most 200 files (app/core/models.py); a bigger cart
// line is refused here, with the reason, never by the generic 422.
const semCap=cart.flatMap(line=>line.partes?.length?line.partes:[line]);
if (semCap.some(item=>(item.localFiles||[]).length>200))
return message('Este item tem mais de 200 arquivos. Divida em dois itens.','error');
const initialCart=cartSnapshot();
busy = true;
$('bPagar').disabled = true;