feat: Dropstar's new flow: Arte conferida is the queue, Revisão and the Revisor
All checks were successful
Build and deploy / Validate source (push) Successful in 9s
Build and deploy / Integration suite on a real stack (push) Successful in 3m36s
Build and deploy / Secret scan and release gate (push) Successful in 5s
Build and deploy / Publish images (push) Successful in 1m24s
All checks were successful
Build and deploy / Validate source (push) Successful in 9s
Build and deploy / Integration suite on a real stack (push) Successful in 3m36s
Build and deploy / Secret scan and release gate (push) Successful in 5s
Build and deploy / Publish images (push) Successful in 1m24s
The board Dropstar drew on 2026-10-23: Arte recebida, Arte conferida, Imprimindo, Correção, Revisão, Finalizado. - Fila de impressão leaves the board: Arte conferida is the queue. It takes an order only with every item's final approved, keeps the finals as approved, orders its cards for printing and has the room's "Baixar" and the automatic folder. Orders that were in the queue move there once, with a line in their history - Revisão checks the printed sheet, and the new Revisor profile is the only one that sends an order to Finalizado (the superadmin too, for support) - who moves what, from the server (MOVES): the designer the artwork, asking for corrections and bringing the new art back; the operator Arte conferida to Imprimindo to Revisão; admin and gestão everything else, Correção included; a step back belongs to whoever makes the move it undoes - Tiny: Arte conferida is "Preparando envio" and Finalizado "Pronto para envio", for delivery orders too - Prova OK still comes before Finalizado; the customer's portal shows the new steps Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -71,7 +71,7 @@ def run():
|
||||
su = Client()
|
||||
su.call('/session')
|
||||
assert su.call('/operator/me', operator=True)['role'] == 'superadmin'
|
||||
emails = {r: f'{r}-{tag}@example.test' for r in ('admin', 'operador', 'vendedor', 'designer')}
|
||||
emails = {r: f'{r}-{tag}@example.test' for r in ('admin', 'operador', 'vendedor', 'designer', 'revisor')}
|
||||
owner = uuid4()
|
||||
machines, made = [], []
|
||||
try:
|
||||
@@ -123,11 +123,20 @@ def run():
|
||||
# On the UV machine of this test, whatever the others carry.
|
||||
su.call(f'/operator/orders/{uv_o}/machine', {'machine_id': uv}, operator=True)
|
||||
|
||||
# The operator of the UV machine sees only its orders, moves them, and nothing more.
|
||||
# The operator of the UV machine sees only its orders and prints them:
|
||||
# Arte conferida to Imprimindo to Revisão, nothing else (Dropstar, 2026-10-23).
|
||||
op = signed_in(emails['operador'])
|
||||
seen = {o['id'] for o in op.call('/operator/board')['orders']}
|
||||
assert str(uv_o) in seen and str(textil_o) not in seen, seen
|
||||
op.call(f'/operator/orders/{uv_o}/move', {'state': 'tra', 'version': 0, 'reason': ''})
|
||||
assert sorted(op.call('/operator/me')['moves']) == [['imp', 'rev'], ['imp', 'tra'], ['rev', 'imp'], ['tra', 'imp']]
|
||||
op.call(f'/operator/orders/{uv_o}/move', {'state': 'tra', 'version': 0, 'reason': ''}, expected=403)
|
||||
with db.connect() as c:
|
||||
c.execute("UPDATE dtf_local.orders SET state='imp' WHERE id=%s", (uv_o,))
|
||||
op.call(f'/operator/orders/{uv_o}/move', {'state': 'cor', 'version': 0, 'reason': 'borrou'}, expected=403)
|
||||
printed = op.call(f'/operator/orders/{uv_o}/move', {'state': 'rev', 'version': 0, 'reason': ''})
|
||||
refused = op.call(f'/operator/orders/{uv_o}/move', {'state': 'fin', 'version': printed['version'], 'reason': ''},
|
||||
expected=403)
|
||||
assert refused['detail'] == 'Só o Revisor manda o pedido para Finalizado.', refused
|
||||
op.call(f'/operator/orders/{uv_o}/cancel', {'note': 'não pode'}, expected=403)
|
||||
op.call('/operator/users', expected=403)
|
||||
op.call('/operator/payment-events', expected=403)
|
||||
@@ -144,6 +153,18 @@ def run():
|
||||
seller.call(f'/operator/orders/{textil_o}/machine', {'machine_id': None}, expected=403)
|
||||
seller.call(f'/operator/orders/{textil_o}/contact', {'waiting': True, 'note': 'Ligar'}, expected=403)
|
||||
assert seller.call('/operator/me')['can'] == ['view']
|
||||
# Only the Revisor releases to Finalizado: not even the administrator.
|
||||
admin.call(f'/operator/orders/{uv_o}/move', {'state': 'fin', 'version': printed['version'], 'reason': ''},
|
||||
expected=403)
|
||||
admin.call('/operator/users', {'name': 'Confere', 'email': emails['revisor'], 'role': 'revisor',
|
||||
'password': PASSWORD})
|
||||
reviewer = signed_in(emails['revisor'])
|
||||
me = reviewer.call('/operator/me')
|
||||
assert me['can'] == ['view'] and sorted(me['moves']) == [['fin', 'rev'], ['rev', 'fin']] and me['reorder'] == ['rev'], me
|
||||
reviewer.call(f'/operator/orders/{textil_o}/move', {'state': 'tra', 'version': 0, 'reason': ''}, expected=403)
|
||||
assert reviewer.call(f'/operator/orders/{uv_o}/move', {'state': 'fin', 'version': printed['version'],
|
||||
'reason': ''})['state'] == 'fin'
|
||||
|
||||
# The designer: every order, whatever its machine; the artwork stages only.
|
||||
admin.call('/operator/users', {'name': 'Arte', 'email': emails['designer'], 'role': 'designer',
|
||||
'password': PASSWORD, 'machines': [uv]})
|
||||
@@ -152,8 +173,17 @@ def run():
|
||||
assert set(designer.call('/operator/me')['can']) == {'view', 'produce'}
|
||||
assert {str(uv_o), str(textil_o)} <= {o['id'] for o in designer.call('/operator/board')['orders']}
|
||||
version = next(o for o in designer.call('/operator/board')['orders'] if o['id'] == str(textil_o))['version']
|
||||
moved = designer.call(f'/operator/orders/{textil_o}/move', {'state': 'tra', 'version': version, 'reason': ''})
|
||||
designer.call(f'/operator/orders/{textil_o}/move', {'state': 'fil', 'version': moved['version'], 'reason': ''},
|
||||
# A correction and back; Arte conferida only with the final approved.
|
||||
moved = designer.call(f'/operator/orders/{textil_o}/move', {'state': 'cor', 'version': version,
|
||||
'reason': 'fundo branco'})
|
||||
moved = designer.call(f'/operator/orders/{textil_o}/move', {'state': 'rec', 'version': moved['version'],
|
||||
'reason': ''})
|
||||
designer.call(f'/operator/orders/{textil_o}/move', {'state': 'tra', 'version': moved['version'], 'reason': ''},
|
||||
expected=409)
|
||||
# In the queue the card is the print room's; the designer only takes it back.
|
||||
with db.connect() as c:
|
||||
c.execute("UPDATE dtf_local.orders SET state='tra' WHERE id=%s", (textil_o,))
|
||||
designer.call(f'/operator/orders/{textil_o}/move', {'state': 'imp', 'version': moved['version'], 'reason': ''},
|
||||
expected=403)
|
||||
designer.call(f'/operator/orders/{textil_o}/move', {'state': 'rec', 'version': moved['version'],
|
||||
'reason': 'arte trocada'})
|
||||
@@ -167,7 +197,7 @@ def run():
|
||||
with db.connect() as c:
|
||||
long_q, long_o = order_fixture(c, owner, 'file', metres='12')
|
||||
made.append((long_q, long_o))
|
||||
c.execute("UPDATE dtf_local.orders SET state='imp' WHERE id=%s", (long_o,))
|
||||
c.execute("UPDATE dtf_local.orders SET state='rev' WHERE id=%s", (long_o,))
|
||||
version = next(o for o in su.call('/operator/board', operator=True)['orders'] if o['id'] == str(long_o))['version']
|
||||
su.call(f'/operator/orders/{long_o}/move', {'state': 'fin', 'version': version, 'reason': ''},
|
||||
operator=True, expected=409)
|
||||
@@ -181,7 +211,7 @@ def run():
|
||||
with db.connect() as c:
|
||||
short_q, short_o = order_fixture(c, owner, 'file', metres='10')
|
||||
made.append((short_q, short_o))
|
||||
c.execute("UPDATE dtf_local.orders SET state='imp' WHERE id=%s", (short_o,))
|
||||
c.execute("UPDATE dtf_local.orders SET state='rev' WHERE id=%s", (short_o,))
|
||||
version = next(o for o in su.call('/operator/board', operator=True)['orders'] if o['id'] == str(short_o))['version']
|
||||
su.call(f'/operator/orders/{short_o}/move', {'state': 'fin', 'version': version, 'reason': ''}, operator=True)
|
||||
# Asked for at checkout: the paid order arrives waiting for the customer's word.
|
||||
|
||||
Reference in New Issue
Block a user