-- Sample categories
INSERT INTO categories (name, default_arrival_time, default_departure_time, expected_daily_hours_json)
VALUES ('Guru', '08:00', '17:00', '{"1":8,"2":8,"3":8,"4":8,"5":8}')
ON DUPLICATE KEY UPDATE name = name;

INSERT INTO categories (name, default_arrival_time, default_departure_time, expected_daily_hours_json)
VALUES ('Staf', '09:00', '18:00', '{"1":8,"2":8,"3":8,"4":8,"5":8}')
ON DUPLICATE KEY UPDATE name = name;

-- Sample users (non-admin)
INSERT INTO users (name, email, phone, password_hash, role, category_id)
VALUES ('Guru A', 'gurua@example.com', NULL, '$2b$10$u6RzA7b9e9z8bq9vVbY4XOxbE5h5w1bU8UroI1X9qkzS0dQz3w2sC', 'guru', 1)
ON DUPLICATE KEY UPDATE name = name;

INSERT INTO users (name, email, phone, password_hash, role, category_id)
VALUES ('Staf D', 'stafd@example.com', NULL, '$2b$10$u6RzA7b9e9z8bq9vVbY4XOxbE5h5w1bU8UroI1X9qkzS0dQz3w2sC', 'staff', 2)
ON DUPLICATE KEY UPDATE name = name;

-- Assign admin as approver for both
INSERT IGNORE INTO user_approvers (user_id, approver_id)
SELECT u.id, a.id FROM users u CROSS JOIN (SELECT id FROM users WHERE email='admin@example.com' LIMIT 1) a
WHERE u.email IN ('gurua@example.com','stafd@example.com');


