feat: Gestão only pulls cards back, with a reason (Dropstar's rule D-20)
All checks were successful
Build and deploy / Validate source (push) Successful in 10s
Build and deploy / Integration suite on a real stack (push) Successful in 4m5s
Build and deploy / Secret scan and release gate (push) Successful in 10s
Build and deploy / Publish images (push) Successful in 1m33s

Dropstar's internal rules of 2026-10-26: the coordination pulls back, never
forward, always with a reason. The Gestão profile now sends orders to
Correção from any stage and steps them back, and no longer moves them
forward. Admin, Dropstar's own login, keeps every move but Finalizado, which
stays the Revisor's (D-29).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Cauê Faleiros
2026-10-27 09:16:00 -03:00
parent 19b8b8c509
commit f77de40b7f
4 changed files with 25 additions and 14 deletions

View File

@@ -132,17 +132,21 @@ CAPABILITIES = {
'integrations': {'superadmin'},
}
# Who moves which card (Dropstar's flow, 2026-10-23): the designer the
# artwork, the operator the printing, and only the Revisor (and we, the
# superadmin, for support) to Finalizado, so nobody releases their own print.
# Admin and Gestão make every other move, Correção included. A step back
# undoes a mistaken move: open to whoever may make the move it undoes.
# Who moves which card (Dropstar's flow, 2026-10-23, and their rules of
# 2026-10-26): the designer the artwork, the operator the printing, and only
# the Revisor (and we, the superadmin, for support) to Finalizado, so nobody
# releases their own print (D-29). Gestão, the coordination, pulls back and
# never forward, always with a reason (D-20): a step back, or Correção. Admin,
# Dropstar's own login, makes every other move. A step back undoes a mistaken
# move: open to whoever may make the move it undoes.
MOVES = {
'designer': {('rec', 'tra'), ('rec', 'cor'), ('tra', 'cor'), ('cor', 'rec'), ('cor', 'tra')},
'operador': {('tra', 'imp'), ('imp', 'rev')},
'revisor': {('rev', 'fin')},
}
MANAGERS = ('superadmin', 'admin', 'gestao')
ADMINS = ('superadmin', 'admin')
COORDINATION = ('gestao',)
MANAGERS = ADMINS + COORDINATION
RELEASERS = ('revisor', 'superadmin')
MOVERS = MANAGERS + tuple(MOVES)
@@ -154,7 +158,9 @@ def may_move(role, from_state, to_state, back=False):
return role in MANAGERS or (to_state, from_state) in MOVES.get(role, ())
if to_state == 'fin':
return role in RELEASERS
return role in MANAGERS or (from_state, to_state) in MOVES.get(role, ())
if to_state == 'cor' and role in COORDINATION:
return True
return role in ADMINS or (from_state, to_state) in MOVES.get(role, ())
def may_reorder(role, state):

View File

@@ -416,9 +416,11 @@ what (MOVES): the Designer Arte recebida to Arte conferida, asks for
corrections and brings the new art back to Arte recebida or Arte conferida;
the Operador Arte conferida to Imprimindo to Revisão; only the Revisor (and
the superadmin, for support) Revisão to Finalizado, so nobody releases their
own print; Admin and Gestão every other move, including Imprimindo or
Revisão to Correção and Correção straight to Revisão. A step back belongs to
whoever makes the move it undoes, and to Admin and Gestão. Tiny: Arte
own print; Gestão, the coordination, only pulls back, always with a reason
(rule D-20 of Dropstar's internal rules, 2026-10-26): Correção from any
stage, or a step back; Admin, Dropstar's own login, every other move,
including Correção straight to Revisão. A step back belongs to whoever makes
the move it undoes, and to Admin and Gestão. Tiny: Arte
conferida sets "Preparando envio" and Finalizado "Pronto para envio", for
delivery orders too; nothing for Imprimindo, Correção or Revisão. Prova OK
still comes before Finalizado. The customer's portal shows the same steps.

View File

@@ -21,9 +21,12 @@ class MovesTest(unittest.TestCase):
self.assertEqual(moves('operador'), {('tra', 'imp'), ('imp', 'rev')})
self.assertEqual(moves('revisor'), {('rev', 'fin')})
self.assertEqual(moves('vendedor'), set())
# Gestão sends to Correção and brings back, straight to Revisão too.
for pair in (('imp', 'cor'), ('cor', 'rev'), ('rev', 'cor'), ('tra', 'imp'), ('rec', 'tra')):
self.assertTrue(may_move('gestao', *pair), pair)
# Gestão, the coordination, pulls back and never forward (D-20): Correção
# from any stage, and steps back. Admin, Dropstar's login, moves forward too.
self.assertEqual(moves('gestao'), {('rec', 'cor'), ('tra', 'cor'), ('imp', 'cor'), ('rev', 'cor')})
for pair in (('tra', 'imp'), ('rec', 'tra'), ('cor', 'rev'), ('cor', 'tra'), ('imp', 'rev')):
self.assertFalse(may_move('gestao', *pair), pair)
self.assertTrue(may_move('admin', *pair), pair)
def test_only_the_revisor_releases_to_finalizado(self):
for role in ROLES:

View File

@@ -102,7 +102,7 @@
<section id="tab-users" class="page" hidden>
<div class="pagehead"><h1>Usuários</h1><button class="btn primary" id="new-user" type="button">Novo usuário</button></div>
<p class="faint stats-note">Quem entra no Kanban e o que cada perfil pode fazer. Administrador: tudo, inclusive esta página.
Gestão: tudo, menos usuários; manda o pedido para Correção e traz de volta. Designer: vê todos os pedidos, aprova e recusa o arquivo final, pede correção.
Gestão: tudo, menos usuários; no quadro só puxa para trás, com motivo (Correção ou voltar uma etapa). Designer: vê todos os pedidos, aprova e recusa o arquivo final, pede correção.
Operador: ligado a uma máquina, vê só os pedidos dela; imprime e passa para a Revisão. Revisor: confere a folha impressa e libera; é o único que manda para Finalizado.
Vendedor: só consulta.</p>
<section class="statbox"><table class="log"><thead><tr><th scope="col">Nome</th><th scope="col">Perfil</th><th scope="col">Máquinas</th><th scope="col">Último acesso</th><th scope="col"></th></tr></thead><tbody id="users-list"></tbody></table></section>