feat: Dropstar's new flow: Arte conferida is the queue, Revisão and the Revisor
All checks were successful
Build and deploy / Validate source (push) Successful in 9s
Build and deploy / Integration suite on a real stack (push) Successful in 3m36s
Build and deploy / Secret scan and release gate (push) Successful in 5s
Build and deploy / Publish images (push) Successful in 1m24s

The board Dropstar drew on 2026-10-23: Arte recebida, Arte conferida,
Imprimindo, Correção, Revisão, Finalizado.

- Fila de impressão leaves the board: Arte conferida is the queue. It takes
  an order only with every item's final approved, keeps the finals as
  approved, orders its cards for printing and has the room's "Baixar" and
  the automatic folder. Orders that were in the queue move there once, with
  a line in their history
- Revisão checks the printed sheet, and the new Revisor profile is the only
  one that sends an order to Finalizado (the superadmin too, for support)
- who moves what, from the server (MOVES): the designer the artwork, asking
  for corrections and bringing the new art back; the operator Arte conferida
  to Imprimindo to Revisão; admin and gestão everything else, Correção
  included; a step back belongs to whoever makes the move it undoes
- Tiny: Arte conferida is "Preparando envio" and Finalizado "Pronto para
  envio", for delivery orders too
- Prova OK still comes before Finalizado; the customer's portal shows the
  new steps

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Cauê Faleiros
2026-10-26 12:45:57 -03:00
parent 93cb289940
commit b6f20733fa
26 changed files with 344 additions and 166 deletions

View File

@@ -49,8 +49,9 @@ def run():
def move(state,version):
return customer.call('/operator/orders/'+oid+'/move',{'state':state,'version':version,'reason':'Please replace the artwork' if state=='cor' else ''},operator=True)['version']
version=move('tra',0)
customer.call('/operator/orders/'+oid+'/move',{'state':'fil','version':version},operator=True,expected=409)
# Arte conferida is the print queue (2026-10-23): it takes approved finals only.
version=0
customer.call('/operator/orders/'+oid+'/move',{'state':'tra','version':version},operator=True,expected=409)
final_id=upload_bytes(customer,b'LOCAL FINAL VERSION ONE',order_id=oid)
customer.call('/uploads/'+final_id,expected=404)
body={'version':version,'files':[{'item_index':0,'upload_id':final_id}],'note':'Manually checked final'}
@@ -61,7 +62,7 @@ def run():
link=customer.call('/customer/orders/'+oid+'/files/'+final['id']+'/download')
assert urlopen(link['url']).read()==b'LOCAL FINAL VERSION ONE'
guest=Client();guest.call('/session');guest.call('/customer/orders/'+oid+'/files/'+final['id']+'/download',expected=404)
version=move('fil',version)
version=move('tra',version)
# The print queue's files come named after their order, straight from storage.
queued=customer.call('/operator/queue/finals',operator=True)['files']
mine=[f for f in queued if urlopen(f['url']).read()==b'LOCAL FINAL VERSION ONE']
@@ -81,8 +82,7 @@ def run():
files=customer.call('/operator/orders/'+oid+'/files',operator=True)
assert any(f['kind']=='correction' and f['active'] and f['upload_id']==correction_id for f in files)
assert not any(f['kind']=='final' and f['active'] for f in files), 'new correction kept a stale final active'
version=move('tra',version)
customer.call('/operator/orders/'+oid+'/move',{'state':'fil','version':version},operator=True,expected=409)
customer.call('/operator/orders/'+oid+'/move',{'state':'tra','version':version},operator=True,expected=409)
# The correction itself can be approved as the final of the item it corrects.
version=customer.call('/operator/orders/'+oid+'/final-files',{'version':version,'files':[{'item_index':0,'upload_id':correction_id}],'note':'Correction is print-ready'},operator=True)['version']
files=customer.call('/operator/orders/'+oid+'/files',operator=True)
@@ -90,7 +90,9 @@ def run():
customer.call('/operator/orders/'+oid+'/final-files',{'version':version,'files':[{'item_index':0,'upload_id':correction_id}],'note':'Twice'},operator=True,expected=409)
new_final=upload_bytes(customer,b'LOCAL FINAL VERSION TWO',order_id=oid)
version=customer.call('/operator/orders/'+oid+'/final-files',{'version':version,'files':[{'item_index':0,'upload_id':new_final}],'note':'Checked corrected final'},operator=True)['version']
for state in ('fil','imp','fin'):version=move(state,version)
for state in ('tra','imp','rev','fin'):version=move(state,version)
# In the queue the finals stay as approved.
customer.call('/operator/orders/'+oid+'/final-files',{'version':version,'files':[{'item_index':0,'upload_id':new_final}],'note':'Too late'},operator=True,expected=409)
detail=other.call('/customer/orders/'+oid)
assert detail['state']=='fin'
assert sum(f['active'] and f['kind']=='final' for f in detail['files'])==1