feat: the proof card, a child order the seller answers (Dropstar, 30/10 and 03/11)
Some checks failed
Build and deploy / Validate source (push) Successful in 1m8s
Build and deploy / Integration suite on a real stack (push) Failing after 3m14s
Build and deploy / Publish images (push) Has been skipped
Build and deploy / Secret scan and release gate (push) Successful in 9s

An order with a proof (asked for at checkout, or above 10 m) gets a child
card "Prova": an order of its own (orders.parent_id), no sale, with the
film's first 30 cm as DTF-N-item-1-prova.png ("Prova do pedido DTF-N" in its
footer), which follows the flow up to Revisão like any card, hot folder
included. The order waits outside the queue, "Aguardando prova": it is not
pulled to Imprimindo, nor counted in the queue's places.

In Revisão the card is answered by the Vendedor, Gestão or the
Administrador (capability "proof"): Prova OK records who and when and puts
the order in Arte conferida when its finals are approved; Prova reprovada,
with its reason, sends the order back to Arte recebida, its final to be
approved again, and offers "Nova prova". Either way the card closes and
leaves the board. An order from before the cards keeps the old Prova OK.

The card is kept out of Tiny, e-mails, Números, the search, Finalizado and
the customer's account. Deleting an order takes its cards and their rows:
movements, order files and print files now cascade with their order.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Cauê Faleiros
2026-11-03 20:39:52 -03:00
parent 8b7d9f0bdb
commit 5520081184
11 changed files with 311 additions and 27 deletions

View File

@@ -272,10 +272,17 @@ def run():
files=[{'item_index':i,'upload_id':upload_bytes(client,b'LOCAL FINAL FIXTURE '+str(i).encode(),order_id=oid)} for i in range(4)]
result=client.call('/operator/orders/'+oid+'/final-files',{'version':version,'files':files,'note':'Local test manual final-file approval'},operator=True)
version=result['version']
if state=='fin':
# Above 10 m the proof comes first: no Finalizado before Prova OK (app/proof.py).
client.call('/operator/orders/'+oid+'/move',{'state':'fin','version':version},operator=True,expected=409)
version=client.call('/operator/orders/'+oid+'/proof',{},operator=True)['version']
if state=='imp':
# Above 10 m the proof comes first (app/proof.py): the order waits
# outside the queue for Prova OK on its proof card in Revisão.
held=client.call('/operator/orders/'+oid+'/move',{'state':'imp','version':version},operator=True,expected=409)
assert 'Aguardando prova' in held['detail'], held
card=next(o for o in client.call('/operator/board',operator=True)['orders'] if o['id']==oid)['proof_card']
from app.core import db
with db.connect() as c:
c.execute("UPDATE dtf_local.orders SET state='rev' WHERE id=%s",(card['id'],))
client.call('/operator/orders/'+card['id']+'/proof-answer',{'result':'ok'},operator=True)
version+=1
moved=client.call('/operator/orders/'+oid+'/move',{'state':state,'version':version,'reason':'Local test correction' if state=='cor' else ''},operator=True)
version+=1;assert moved['version']==version
client.call('/operator/orders/'+oid+'/move',{'state':'rec','version':0},operator=True,expected=409)