feat: the Administrador may release orders to Finalizado too
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 3m34s
Build and deploy / Secret scan and release gate (push) Successful in 4s
Build and deploy / Publish images (push) Successful in 1m1s

D-29 keeps the release with the Revisor, so nobody in the room releases
their own print; the Administrador, Dropstar's own login, may release as
well (the user, 2026-10-28). Gestao, Designer and Operador still cannot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Cauê Faleiros
2026-10-28 10:34:24 -03:00
parent ee6344dc74
commit b08a258931
5 changed files with 14 additions and 13 deletions

View File

@@ -28,9 +28,9 @@ class MovesTest(unittest.TestCase):
self.assertFalse(may_move('gestao', *pair), pair)
self.assertTrue(may_move('admin', *pair), pair)
def test_only_the_revisor_releases_to_finalizado(self):
def test_the_revisor_and_the_administrator_release_to_finalizado(self):
for role in ROLES:
self.assertEqual(may_move(role, 'rev', 'fin'), role in ('revisor', 'superadmin'), role)
self.assertEqual(may_move(role, 'rev', 'fin'), role in ('revisor', 'admin', 'superadmin'), role)
def test_a_step_back_belongs_to_whoever_makes_the_move_it_undoes(self):
self.assertTrue(may_move('operador', 'rev', 'imp', back=True))

View File

@@ -155,9 +155,8 @@ def run():
# The seller only views the board (D-30): no order registered by hand either.
assert seller.call('/operator/me')['can'] == ['view']
seller.call(f'/operator/quotes/{uv_q}/register', {'origin': 'atendimento', 'method': 'pix'}, expected=403)
# 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)
# The Revisor releases to Finalizado, and the administrator may too (2026-10-28).
assert ['rev', 'fin'] in admin.call('/operator/me')['moves']
admin.call('/operator/users', {'name': 'Confere', 'email': emails['revisor'], 'role': 'revisor',
'password': PASSWORD})
reviewer = signed_in(emails['revisor'])