fix: checkout and the Kanban take layout version 3
All checks were successful
Build and deploy / Validate source (push) Successful in 4s
Build and deploy / Integration suite on a real stack (push) Successful in 3m9s
Build and deploy / Secret scan and release gate (push) Successful in 5s
Build and deploy / Publish images (push) Successful in 1m20s

The layout rule of 2026-10-21 records version 3, but checkout still
refused any item not on version 2, so no order could be quoted (CI's
browser test timed out at the upload), and the Kanban marked new quotes
"Montagem antiga". Both now take versions 2 and 3, as the server does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Cauê Faleiros
2026-10-22 17:05:35 -03:00
parent c8c49ed57e
commit f6bdbe006e
2 changed files with 6 additions and 3 deletions

View File

@@ -311,7 +311,8 @@
uploads.push(await upload(file));
enviaFoto(uploads[index], item.fotos?.[index]);
}
if (item.production?.version!==2 || item.production.sources?.length!==uploads.length)
// Layout versions the server takes: 3 since 2026-10-21, 2 for a cart saved before.
if (![2,3].includes(item.production?.version) || item.production.sources?.length!==uploads.length)
throw new Error('A montagem deste item precisa ser refeita antes da cotação.');
items.push({mode:item.modo, metres:String(item.metros), grade:item.nota, uploads,
production:{...item.production,sources:item.production.sources.map((source,index)=>({

View File

@@ -30,6 +30,8 @@ function outcomeText(outcome){
let board=null;
let tab='board', openOrder=null, openToken=0;
const boardFilter={product:'',machine:'',delivery:'',status:''};
// Layout versions the server takes (app/core/models.py PRODUCTION_VERSIONS).
const LAYOUT_VERSIONS=[2,3];
let quoteKind='pending', pickedQuote=null;
let quoteQuery='', quoteProduct='', quoteLayout='', quoteFlag='', quoteTimer=null;
// Uploads that have an artwork picture (the customer's browser made it). Every
@@ -1448,7 +1450,7 @@ function renderQuotes(){
meta.append(gradePill(lowestGrade(items)),productBadge(items),node('b',metres(quoteMetres(q)),'mtr'),
place(q.draft.destination),node('span',ago(q.created_at),'age'));
const flags=node('div',undefined,'flags');
if(items.some(i=>i.production?.version!==2))flags.append(badge('Montagem antiga','bad','Peça uma nova cotação ao cliente'));
if(items.some(i=>!LAYOUT_VERSIONS.includes(i.production?.version)))flags.append(badge('Montagem antiga','bad','Peça uma nova cotação ao cliente'));
else if(items.some(i=>i.quality_status==='warning'))flags.append(badge('! Ressalva aceita','warn','O cliente aceitou a ressalva de resolução'));
if(!q.approved&&q.review_reason)flags.append(badge('! '+q.review_reason,'warn','Revisão manual: '+q.review_reason));
// Approved by the Site is the rule; only a person's review is worth a line.
@@ -1482,7 +1484,7 @@ function review(quote){
if(quote.approved){const total=node('div',undefined,'qbig');total.append(node('span','Total'),node('b',money(quote.approved.total_cents)));head.append(total);}
const content=node('div',undefined,'content');
const foot=node('div',undefined,'foot');
if(quote.status==='pending_review'&&quote.draft.items.some(item=>item.production?.version!==2)){
if(quote.status==='pending_review'&&quote.draft.items.some(item=>!LAYOUT_VERSIONS.includes(item.production?.version))){
content.append(node('p','Montagem antiga. Solicite uma nova cotação ao cliente.','muted'));
card.append(head,content);return card;
}