INSERT INTO `ohrm_external_async_event_tag` (`name`, `description`, `enabled`) VALUES
('integration', 'This tag is for integration related events', 1);

SET @integration_tag_id = (SELECT id FROM `ohrm_external_async_event_tag` WHERE name = 'integration');

INSERT INTO `ohrm_external_async_event_queue` (`name`, `description`, `enabled`) VALUES
('Queue_For_Integration', 'This queue is for integration related events', 1);

SET @integration_queue_id := (SELECT `id` FROM `ohrm_external_async_event_queue` WHERE `name`='Queue_For_Integration');

INSERT INTO `ohrm_external_data_queue_consumer` (`name`, `description`, `consumer_class`, `enabled`, `queue_id`) VALUES
('Integration queue consumer', 'This queue includes core integrations', 'IntegrationQueueConsumer', 1, @integration_queue_id);

INSERT INTO `ohrm_external_async_event_tag_queue` (`queue_id`, `tag_id`) VALUES
(@integration_queue_id, @integration_tag_id);


SET @employe_added_event_id = (SELECT id FROM `ohrm_async_event` WHERE name = 'employee_added');
INSERT INTO `ohrm_external_async_event_event_tag` (`event_id`, `tag_id`) VALUES
  (@employe_added_event_id, @integration_tag_id);

SET @employe_updated_event_id = (SELECT id FROM `ohrm_async_event` WHERE name = 'employee_updated');
INSERT INTO `ohrm_external_async_event_event_tag` (`event_id`, `tag_id`) VALUES
  (@employe_updated_event_id, @integration_tag_id);

SET @job_history_updated_event_id = (SELECT id FROM `ohrm_async_event` WHERE name = 'pim.save_job_record');
INSERT INTO `ohrm_external_async_event_event_tag` (`event_id`, `tag_id`) VALUES
  (@job_history_updated_event_id, @integration_tag_id);

SET @direct_deposit_updated_event_id = (SELECT id FROM `ohrm_async_event` WHERE name = 'pim.save_direct_deposit_record');
INSERT INTO `ohrm_external_async_event_event_tag` (`event_id`, `tag_id`) VALUES
  (@direct_deposit_updated_event_id, @integration_tag_id);
