-- =========================================
-- ROLE-BASED ACCESS CONTROL MIGRATION
-- Run this to ensure all 8 roles exist
-- =========================================

-- Ensure all roles exist with correct initials
INSERT INTO roles (initials, name, description, status)
VALUES ('SADM', 'Super Admin', 'Full access to everything in the system', 1)
ON DUPLICATE KEY UPDATE name = VALUES(name), description = VALUES(description);

INSERT INTO roles (initials, name, description, status)
VALUES ('ADM', 'Admin', 'Access to almost everything in the system', 1)
ON DUPLICATE KEY UPDATE name = VALUES(name), description = VALUES(description);

INSERT INTO roles (initials, name, description, status)
VALUES ('AA', 'Account Agent', 'Company users with limited access', 1)
ON DUPLICATE KEY UPDATE name = VALUES(name), description = VALUES(description);

INSERT INTO roles (initials, name, description, status)
VALUES ('FA', 'Field Agent', 'Company users with limited access', 1)
ON DUPLICATE KEY UPDATE name = VALUES(name), description = VALUES(description);

INSERT INTO roles (initials, name, description, status)
VALUES ('SA', 'Station Agent', 'Company users with limited access', 1)
ON DUPLICATE KEY UPDATE name = VALUES(name), description = VALUES(description);

INSERT INTO roles (initials, name, description, status)
VALUES ('CM', 'Company Manager', 'Client company users with limited access to their company and stations', 1)
ON DUPLICATE KEY UPDATE name = VALUES(name), description = VALUES(description);

INSERT INTO roles (initials, name, description, status)
VALUES ('AM', 'Area Manager', 'Client company users with limited access to their company and stations', 1)
ON DUPLICATE KEY UPDATE name = VALUES(name), description = VALUES(description);

INSERT INTO roles (initials, name, description, status)
VALUES ('SM', 'Station Manager', 'Client company users with limited access to their company and stations', 1)
ON DUPLICATE KEY UPDATE name = VALUES(name), description = VALUES(description);
