-- Create view:financial-details permission
INSERT INTO "permissions" ("id", "name", "description")
VALUES (gen_random_uuid(), 'view:financial-details', 'Permission to view detailed financial information in ROI reports')
ON CONFLICT (name) DO NOTHING;

-- Add the permission to the Admin role
INSERT INTO "role_permissions" ("id", "roleId", "permissionId")
SELECT gen_random_uuid(),
       (SELECT "id" FROM "roles" WHERE "name" = 'Admin'),
       (SELECT "id" FROM "permissions" WHERE "name" = 'view:financial-details')
ON CONFLICT ("roleId", "permissionId") DO NOTHING;