fix: a final that stopped counting is approved again, and a pull onto a machine that does not print the product is refused on the board (DTF-WEB-10, DTF-WEB-12)
All checks were successful
Build and deploy / Validate source (push) Successful in 1m49s
Build and deploy / Integration suite on a real stack (push) Successful in 8m41s
Build and deploy / Secret scan and release gate (push) Successful in 14s
Build and deploy / Publish images (push) Successful in 2m5s

- A generated file, or the customer's correction, that was this item's
  final and stopped counting (Correção, a step back) is turned back on
  when approved again, instead of "Este arquivo já está no pedido";
  other files keep that rule.
- A lane drop, or a machine chosen before, that does not print the
  order's product says "A <máquina> não imprime este produto." on the
  board and the card stays in Arte conferida, as the chooser filters.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Cauê Faleiros
2026-11-19 09:27:10 -03:00
parent 29187e6c9f
commit 662d6f9c41
3 changed files with 41 additions and 5 deletions

View File

@@ -221,6 +221,27 @@ def run():
assert str(remade['upload_id']) != str(made['upload_id']), (made, remade)
print('PASS: a ready file is generated again from Arte conferida, back in Arte recebida to approve')
# The generated file approved, sent to Correção (its final stops counting)
# and back: the same file is approved again, not refused as already in
# the order (Sentry DTF-WEB-10).
redo, redo_row = wait_print(client, paid_order(client, loose_item(upload_bytes(client, artwork(), name='LOCAL-REDO.png')))['id'], 'ready')
finals = [{'item_index': 0, 'upload_id': str(redo_row['upload_id'])}]
v = client.call('/operator/orders/' + redo['id'] + '/final-files',
{'version': redo['version'], 'files': finals, 'note': 'ok'}, operator=True)['version']
def version_of(oid):
with db.connect() as c:
return c.execute('SELECT version FROM dtf_local.orders WHERE id=%s', (oid,)).fetchone()['version']
client.call('/operator/orders/' + redo['id'] + '/move', {'state': 'cor', 'version': v, 'reason': 'Teste'}, operator=True)
client.call('/operator/orders/' + redo['id'] + '/move', {'state': 'rec', 'version': version_of(redo['id']),
'reason': 'Teste'}, operator=True)
client.call('/operator/orders/' + redo['id'] + '/final-files',
{'version': version_of(redo['id']), 'files': finals, 'note': 'de novo'}, operator=True)
with db.connect() as c:
rows = c.execute('''SELECT active FROM dtf_local.order_files WHERE order_id=%s AND kind='final' ''',
(redo['id'],)).fetchall()
assert [r['active'] for r in rows] == [True], rows
print('PASS: a generated final that stopped counting is approved again')
# Item 10: printing, the file goes once into its machine's hot folder for
# its class; Flexi taking it is reported; leaving Imprimindo withdraws
# what Flexi did not take.