-- Permissões adicionais do módulo Financeiro
INSERT IGNORE INTO permissions (name) VALUES
  ('financeiro.approve'),
  ('financeiro.reconcile'),
  ('financeiro.receipt'),
  ('financeiro.notify');

SET @role_id = (SELECT id FROM roles WHERE name = 'admin' LIMIT 1);
SET @p1 = (SELECT id FROM permissions WHERE name = 'financeiro.approve' LIMIT 1);
SET @p2 = (SELECT id FROM permissions WHERE name = 'financeiro.reconcile' LIMIT 1);
SET @p3 = (SELECT id FROM permissions WHERE name = 'financeiro.receipt' LIMIT 1);
SET @p4 = (SELECT id FROM permissions WHERE name = 'financeiro.notify' LIMIT 1);

INSERT IGNORE INTO role_permissions (role_id, permission_id) VALUES
  (@role_id, @p1), (@role_id, @p2), (@role_id, @p3), (@role_id, @p4);