feat: Dropstar's corrections of 21/10 that need no answer from them
All checks were successful
Build and deploy / Validate source (push) Successful in 1m30s
Build and deploy / Integration suite on a real stack (push) Successful in 4m2s
Build and deploy / Secret scan and release gate (push) Successful in 14s
Build and deploy / Publish images (push) Successful in 1m48s

- the home example priced as the ready sheet it shows (nota 92, R$ 14,90)
- opening hours 7h to 18h, and art sent at any time
- uploads up to 1 GB, every file scanned
- a Designer profile: artwork and corrections on every order, moving only
  among Arte recebida, Arte conferida and Correção
- Números by date range, per machine, and orders apart from passages

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Cauê Faleiros
2026-10-22 10:09:15 -03:00
parent a2382f4834
commit d4494a0654
21 changed files with 279 additions and 89 deletions

View File

@@ -126,6 +126,24 @@ def run():
assert after['daily'][-1]['orders'] == before['daily'][-1]['orders'] + 1
assert after['waiting']['rec']['orders'] == before.get('waiting', {}).get('rec', {}).get('orders', 0) + 1
client.call('/operator/stats?days=3', operator=True, expected=422)
# Or two dates: the same week asked as a range gives the same numbers.
week = client.call(f"/operator/stats?start={after['start']}&end={after['end']}", operator=True)
assert (week['orders'], week['cents'], len(week['daily'])) == (after['orders'], after['cents'], 7), week
one = client.call(f"/operator/stats?start={after['end']}&end={after['end']}", operator=True)
assert len(one['daily']) == 1 and one['daily'][0] == after['daily'][-1]
client.call(f"/operator/stats?start={after['end']}&end={after['start']}", operator=True, expected=422)
client.call(f"/operator/stats?start={after['start']}", operator=True, expected=422)
client.call('/operator/stats?start=2025-01-01&end=2026-12-31', operator=True, expected=422)
assert isinstance(after['machines'], list)
# An order sent back counts once per stage; its passages are counted apart.
with db.connect() as c:
for step, (frm, to) in enumerate((('rec', 'tra'), ('tra', 'cor'), ('cor', 'tra'), ('tra', 'fil'))):
c.execute('''INSERT INTO dtf_local.movements(order_id,from_state,to_state,operator,reason,back,created_at)
VALUES(%s,%s,%s,'kanban-test','',false,now()+%s*interval '1 second')''', (order_id, frm, to, step + 1))
moved = client.call('/operator/stats?days=7', operator=True)
tra_before = after['stages'].get('tra', {'orders': 0, 'passages': 0})
assert moved['stages']['tra']['orders'] == tra_before['orders'] + 1, moved['stages']
assert moved['stages']['tra']['passages'] == tra_before['passages'] + 2, moved['stages']
# The company's name from the registry: on the board, and found by the search.
from app import cnpj as registry
@@ -158,6 +176,7 @@ def run():
'and a backup asked for now')
finally:
with db.connect() as c:
c.execute('DELETE FROM dtf_local.movements WHERE order_id=%s', (order_id,))
c.execute('DELETE FROM dtf_local.orders WHERE id=%s', (order_id,))
c.execute('DELETE FROM dtf_local.quotes WHERE id=ANY(%s)', ([pending, approved, paid],))
c.execute('DELETE FROM dtf_local.upload_thumbnails WHERE upload_id=%s', (uid,))