-- Permissões para o módulo GestorY
INSERT IGNORE INTO permissions (name, description, resource) VALUES
('gestory.read', 'Visualizar catálogo de peças Yamaha', 'gestory'),
('gestory.update', 'Importar e atualizar peças Yamaha', 'gestory'),
('gestory.config', 'Configurar módulo GestorY', 'gestory');

-- Associar permissões à role admin
INSERT IGNORE INTO role_permissions (role_id, permission_id)
SELECT r.id, p.id
FROM roles r
CROSS JOIN permissions p
WHERE r.name = 'admin' AND p.name IN ('gestory.read', 'gestory.update', 'gestory.config');

