feat: "Gerar de novo" makes a ready print file again for the part size of now (order #36)
Some checks failed
Build and deploy / Validate source (push) Successful in 9s
Build and deploy / Publish images (push) Has been cancelled
Build and deploy / Secret scan and release gate (push) Has been cancelled
Build and deploy / Integration suite on a real stack (push) Has been cancelled

The first film over 15 m (#36) left a 15 m part of 4,8 GB decoded, which
the FlexiPRINT refuses (#30, 12,3 m and 3,9 GB, printed). PRINT_PART_CM
already sets the part size; an order already generated had no way to get
its new parts.

- POST /orders/{id}/print-files/again (produce): in Arte recebida or Arte
  conferida, without a customer correction, the finals that were the
  generated files stop counting, the order is back in Arte recebida (a
  step back recorded as "Arquivo gerado de novo") and every item is
  generated again; one rendering now is left alone.
- The order's "Próximo passo" offers "Gerar de novo" there, with a
  confirmation that the final must be approved again.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Cauê Faleiros
2026-11-17 17:34:23 -03:00
parent e8931c2818
commit 27b26cd1ae
4 changed files with 80 additions and 1 deletions

View File

@@ -169,6 +169,29 @@ def run():
'note': 'again'}, operator=True, expected=409)
print('PASS: generated file approved as final without re-uploading; order queued for printing')
# A ready file generated again for the part size of now (order #36,
# 2026-11-17): refused while printing; from Arte conferida the generated
# final goes, the order steps back to Arte recebida and the file is made
# once more.
client.call('/operator/orders/' + oid + '/print-files/again', {}, operator=True, expected=409)
again_upload = upload_bytes(client, artwork(), name='LOCAL-AGAIN.png')
again, made = wait_print(client, paid_order(client, loose_item(again_upload))['id'], 'ready')
v = client.call('/operator/orders/' + again['id'] + '/final-files',
{'version': again['version'], 'files': [{'item_index': 0, 'upload_id': str(made['upload_id'])}],
'note': 'ok'}, operator=True)['version']
client.call('/operator/orders/' + again['id'] + '/move', {'state': 'tra', 'version': v}, operator=True)
client.call('/operator/orders/' + again['id'] + '/print-files/again', {}, operator=True)
with db.connect() as c:
state = c.execute('SELECT state FROM dtf_local.orders WHERE id=%s', (again['id'],)).fetchone()['state']
finals = c.execute('''SELECT count(*) AS n FROM dtf_local.order_files
WHERE order_id=%s AND kind='final' AND active''', (again['id'],)).fetchone()['n']
back = c.execute('SELECT reason,back FROM dtf_local.movements WHERE order_id=%s ORDER BY id DESC LIMIT 1',
(again['id'],)).fetchone()
assert (state, finals, back['reason'], back['back']) == ('rec', 0, 'Arquivo gerado de novo', True), (state, finals, back)
again, remade = wait_print(client, again['id'], 'ready')
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')
# 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.