feat: the Financeiro profile (Dropstar, 2026-10-30)
All checks were successful
Build and deploy / Validate source (push) Successful in 14s
Build and deploy / Integration suite on a real stack (push) Successful in 4m44s
Build and deploy / Secret scan and release gate (push) Successful in 9s
Build and deploy / Publish images (push) Successful in 1m12s

Financeiro sees the whole board, Pagamentos, Números and Cotações, and
cancels an order with its reason. It moves no card and touches no file;
resolving a payment stays with Gestão and Administração. Two narrower
capabilities carry it: "payments" (the Pagamentos list) and "cancel",
which used to need "manage". The order panel's menu shows each profile
only what it may do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Cauê Faleiros
2026-10-30 12:56:53 -03:00
parent 6a312bec9c
commit 8c053596b7
7 changed files with 44 additions and 13 deletions

View File

@@ -177,6 +177,27 @@ 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)
# Financeiro (Dropstar, 2026-10-30): the board, Pagamentos, Números and
# Cotações, and cancels an order with its reason; moves nothing.
emails['financeiro'] = f'financeiro-{tag}@example.test'
admin.call('/operator/users', {'name': 'Contas', 'email': emails['financeiro'], 'role': 'financeiro',
'password': PASSWORD})
money = signed_in(emails['financeiro'])
me = money.call('/operator/me')
assert me['can'] == ['cancel', 'payments', 'view'] and me['moves'] == [] and me['reorder'] == [], me
money.call('/operator/payment-events')
money.call('/operator/stats?days=7')
assert str(uv_o) in {o['id'] for o in money.call('/operator/board')['orders']}
money.call(f'/operator/orders/{textil_o}/move', {'state': 'tra', 'version': 0, 'reason': ''}, expected=403)
money.call(f'/operator/quotes/{uv_q}/discard', {}, expected=403)
money.call(f'/operator/payment-events/{uuid4()}/resolve', {'note': 'Pago'}, expected=403)
money.call(f'/operator/orders/{textil_o}/machine', {'machine_id': None}, expected=403)
seller.call('/operator/payment-events', expected=403)
with db.connect() as c:
gone_q, gone_o = order_fixture(c, owner, 'file')
made.append((gone_q, gone_o))
seller.call(f'/operator/orders/{gone_o}/cancel', {'note': 'Cliente desistiu'}, expected=403)
money.call(f'/operator/orders/{gone_o}/cancel', {'note': 'Cliente desistiu'})
# 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',