-- Add details column to audit_logs for human-readable descriptions
ALTER TABLE audit_logs ADD COLUMN details TEXT AFTER action;

-- Clear existing logs for a fresh start in development
SET FOREIGN_KEY_CHECKS = 0;
TRUNCATE TABLE audit_logs;
SET FOREIGN_KEY_CHECKS = 1;

-- Insert sample audit data matching the UI design
INSERT INTO audit_logs (id, user_id, action, details, created_at) VALUES 
('a1', 'admin-uuid-1', 'Login', 'Successful login to the system', '2026-02-15 18:22:30'),
('a2', 'admin-uuid-1', 'Logout', 'User logged out of the system', '2026-02-11 04:09:53'),
('a3', 'admin-uuid-1', 'Update Election Status', 'Changed SY 2028 Election status from Preparing to Ongoing', '2026-02-11 04:09:43'),
('a4', 'admin-uuid-1', 'Remove Position', 'Removed position: Position_Name', '2026-02-11 04:08:34'),
('a5', 'admin-uuid-1', 'Add Position', 'Added new position: Position_Name (Uniform)', '2026-02-11 04:08:30'),
('a6', 'admin-uuid-1', 'Add Voter', 'Registered new voter: jay44296@gmail.com for Election ID: 6. User ID: 12-3456', '2026-02-11 04:07:57'),
('a7', 'admin-uuid-1', 'Login', 'Successful login to the system', '2026-02-11 04:03:00'),
('a8', 'admin-uuid-1', 'Logout', 'User logged out of the system', '2026-02-11 04:02:25'),
('a9', 'admin-uuid-1', 'Delete Voter', 'Deleted voter: jay44296@gmail.com (ID: 12-3456)', '2026-02-11 03:58:30'),
('a10', 'admin-uuid-1', 'Login', 'Successful login to the system', '2026-02-11 03:53:37'),
('a11', 'admin-uuid-1', 'Logout', 'User logged out of the system', '2026-02-11 03:49:56'),
('a12', 'admin-uuid-1', 'Add Candidate', 'Added candidate Vanessa Ortega for Board Member. ID: 25-7916', '2026-02-11 03:49:30'),
('a13', 'admin-uuid-1', 'Add Candidate', 'Added candidate Noah Padilla for Board Member. ID: 77-4683', '2026-02-11 03:49:10');
