feat: the proof's photo or video opens beside Prova OK and from its order, also after the answer
All checks were successful
Build and deploy / Validate source (push) Successful in 5s
Build and deploy / Integration suite on a real stack (push) Successful in 6m43s
Build and deploy / Secret scan and release gate (push) Successful in 6s
Build and deploy / Publish images (push) Successful in 1m11s

Marcus could not reach the review photo of the proof of #30 (card #31):
in Revisão it sat at the end of the card's Pedido tab, away from the
answer, and once the seller answered, the card left the board and the
photo with it.

- The board sends each order's proof card with its photos and videos.
- "Responder a prova" has "Ver foto" / "Ver vídeo" beside Prova OK, or
  says the Revisor has not sent one yet.
- The parent shows a Prova section (the card, its answer, who and when)
  with the same buttons, and "Aguardando prova" offers them too.
- The viewer drops the print-file line for a review photo and reports a
  photo it could not load, in red and to Sentry.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Cauê Faleiros
2026-11-17 10:37:33 -03:00
parent 5d9a78b63c
commit c61ac27ca4
5 changed files with 71 additions and 13 deletions

View File

@@ -294,8 +294,17 @@ def run():
wait_print(client, card['id'], 'ready')
with db.connect() as c:
c.execute("UPDATE dtf_local.orders SET state='rev' WHERE id=%s", (card['id'],))
# The proof's photo, taken in Revisão, stays reachable from its order once
# the answered card leaves the board (the proof of #30, 2026-11-17).
with db.connect() as c:
c.execute('''INSERT INTO dtf_local.order_reviews(order_id,seq,upload_id,kind,width,height,created_by)
VALUES(%s,1,%s,'photo',1600,1200,'Revisor')''', (card['id'], readable))
client.call('/operator/orders/' + card['id'] + '/proof-answer', {'result': 'ok'}, operator=True)
mine = next(o for o in client.call('/operator/board', operator=True)['orders'] if o['id'] == parent['id'])
assert [r['kind'] for r in mine['proof_card']['reviews']] == ['photo'], mine['proof_card']
view = client.call('/operator/orders/' + card['id'] + '/reviews/' + str(mine['proof_card']['reviews'][0]['id'])
+ '/view', operator=True)
assert view['url'] and view['kind'] == 'photo', view
assert mine['state'] == 'tra' and mine['final_items'] == [0], mine
assert mine['proof_ok_at'] and mine['proof_card']['proof_result'] == 'ok', mine
with db.connect() as c: