SET @admin_role_id := (SELECT `id` FROM ohrm_user_role WHERE `name` = 'Admin');
SET @supervisor_role_id := (SELECT `id` FROM ohrm_user_role WHERE `name` = 'Supervisor');

SET @export_csv_screen_id := (SELECT `id` FROM `ohrm_screen` WHERE `name`='Export Attendance Data to CSV' AND `action_url` = 'viewAttendanceDataExtract');

SET @attendance_records_data_group_id := (SELECT `id` FROM `ohrm_data_group` WHERE `name` ='attendance_records');

INSERT INTO `ohrm_user_role_data_group` (`user_role_id`, `data_group_id`, `can_read`, `can_create`, `can_update`, `can_delete`, `self`) VALUES
(@admin_role_id, @attendance_records_data_group_id, 1, 0, 0, 0, 0),
(@supervisor_role_id, @attendance_records_data_group_id, 1, 0, 0, 0, 0);

INSERT INTO `ohrm_data_group_screen`(`data_group_id`, `screen_id`, `permission`) VALUES
(@attendance_records_data_group_id, @export_csv_screen_id, 1);
