fix: review of phase-2 stage 0 and fronts 5, 6 and 11
All checks were successful
Build and deploy / Publish images (push) Successful in 1m5s
Build and deploy / Validate source (push) Successful in 5s
Build and deploy / Integration suite on a real stack (push) Successful in 5m7s
Build and deploy / Secret scan and release gate (push) Successful in 6s

- A paid treatment adds its 24 h to Arte recebida's acceptable time, on
  the card and in Números (fronts 5 and 11).
- TINY_PRODUCT_TREATMENT is a required Tiny setting once the treatment
  has a price, instead of every treated order failing at the Tiny.
- A quote reads each PDF once: Files caches the header and the DPI.
- A proof made from the parent's final split into parts uses the part
  that holds the finest stroke, not the last one (0.1).
- Prumo report: one format line per item, the time from the claim (kept
  on the finished print file), and the stroke class in customer words.
- The Site says the Prumo checks the art, and a too-tall PNG no longer
  says "Este PDF".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Cauê Faleiros
2026-11-09 10:45:43 -03:00
parent 5a51084c8f
commit 5aafd9ee91
11 changed files with 227 additions and 37 deletions

View File

@@ -10,6 +10,12 @@ from zoneinfo import ZoneInfo
LOCAL = ZoneInfo('America/Sao_Paulo')
MANUAL = {'cdr', 'psd', 'psb', 'tif', 'tiff'}
# The stroke class in the customer's words, without the internal C1/C2/C3 code.
STROKE_SUMMARY = {
'C1': 'Sua arte tem traços muito finos; a impressão foi ajustada para eles.',
'C2': 'Sua arte tem traços médios; a impressão foi ajustada para eles.',
'C3': 'Sua arte tem áreas cheias; a impressão foi ajustada para elas.',
}
def _ext(name):
@@ -64,8 +70,14 @@ def report(order, uploads):
names.append(final)
if original and final and _ext(original) != _ext(final):
lines.append(f'{lead}Chegou {_ext(original).upper()}, era {_ext(final).upper()} por dentro — tratado como {_ext(final).upper()}')
else:
lines.append(f'{lead}Formato detectado: {_ext(final).upper() or "desconhecido"}')
# One format line per item, not one per file: the designer reads what
# the item is, and only the files that changed are named above.
formats = sorted({_ext(name).upper() or 'desconhecido' for name in names})
if len(formats) == 1:
count = f' ({len(names)} arquivos)' if len(names) > 1 else ''
lines.append(f'{lead}Formato detectado: {formats[0]}{count}')
elif formats:
lines.append(f'{lead}Formatos detectados: {", ".join(formats)}')
exts = {_ext(name) for name in names}
row = generated.get(index)
ready = bool(row and row.get('status') == 'ready')
@@ -109,8 +121,10 @@ def report(order, uploads):
sizes = [Decimal(str(p.get('to_cm', 0))) - Decimal(str(p.get('from_cm', 0))) for p in parts]
lines.append(f'{lead}{_m(billed)} m → {len(parts)} partes (' +
' + '.join(_m(size) for size in sizes) + ')')
if ready and row.get('finished_at') and row.get('created_at'):
seconds = (row['finished_at'] - row['created_at']).total_seconds()
# From the claim, not from the queue: the customer waits for the
# generation, not for the file's turn.
if ready and row.get('finished_at') and row.get('claimed_at'):
seconds = (row['finished_at'] - row['claimed_at']).total_seconds()
lines.append(f'{lead}Prumo levou {max(1, round(seconds))} s')
return lines
@@ -127,8 +141,8 @@ def customer_summary(items):
if dots:
lines.append(f'{lead}Há {dots} pontinho{"s" if dots > 1 else ""} solto{"s" if dots > 1 else ""} '
'que você aceitou imprimir.')
if item.get('stroke_class'):
lines.append(f'{lead}O traço mais fino foi medido em {item["stroke_class"]}.')
if item.get('stroke_class') in STROKE_SUMMARY:
lines.append(f'{lead}{STROKE_SUMMARY[item["stroke_class"]]}')
if item.get('stroke_choice') == 'measured':
lines.append(f'{lead}Você escolheu imprimir o traço fino assim mesmo (C1).')
elif item.get('stroke_choice') == 'client_c3':