feat: time in "Aguardando contato" no longer counts in Números (Dropstar's rule D-38)
All checks were successful
Build and deploy / Validate source (push) Successful in 4s
Build and deploy / Integration suite on a real stack (push) Successful in 3m20s
Build and deploy / Secret scan and release gate (push) Successful in 5s
Build and deploy / Publish images (push) Successful in 1m0s

Dropstar's internal rules (2026-10-26): waiting for a word with the customer
has no deadline and does not enter the time figures.

- each wait is kept, from the mark to "Contato feito" (and from checkout when
  the customer asks for a proof), in a new table; waits open today are
  recorded from their start
- the time in each stage and "Do pagamento ao Finalizado" leave those waits
  out, and the Números page says so

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Cauê Faleiros
2026-10-27 10:45:14 -03:00
parent 6a921415ea
commit 494925dff4
7 changed files with 48 additions and 5 deletions

View File

@@ -63,6 +63,11 @@ def run():
client.call(f'/operator/orders/{paid_order}/contact', {'waiting': False}, operator=True)
cleared = {o['id']: o for o in client.call('/operator/board', operator=True)['orders']}[str(paid_order)]
assert cleared['contact_since'] is None and cleared['contact_note'] is None
# The wait is kept, from mark to clear, for the time figures that leave it out (D-38).
with db.connect() as c:
waits = c.execute('SELECT started_at, ended_at FROM dtf_local.contact_waits WHERE order_id=%s',
(paid_order,)).fetchall()
assert len(waits) == 1 and waits[0]['ended_at'] and waits[0]['ended_at'] >= waits[0]['started_at'], waits
# A paid order is cancelled with a reason, kept, and can no longer move.
# A paid order in progress is not deleted: it is cancelled first.