-- E2E Test Data
-- This file creates test users and basic data needed for E2E tests

-- Test Users
INSERT INTO sys_user (workday_id, email, firstname, lastname, is_active)
VALUES ('WD001TEST', 'john.doe@test.com', 'John', 'Doe', TRUE);

INSERT INTO sys_user (workday_id, email, firstname, lastname, is_active)
VALUES ('WD002TEST', 'jane.smith@test.com', 'Jane', 'Smith', TRUE);

INSERT INTO sys_user (workday_id, email, firstname, lastname, is_active)
VALUES ('WD003TEST', 'admin.test@test.com', 'Admin', 'User', TRUE);

-- Assign groups to test users
-- John gets 'super' role for full E2E testing capabilities
-- Jane gets 'super' role
-- Admin gets 'super' and 'right-management' roles
INSERT INTO sys_user_group_mapping (user_id, group_id)
SELECT u.id, g.id FROM sys_user u, sys_group g
WHERE u.email = 'john.doe@test.com' AND g.group_name = 'super';

INSERT INTO sys_user_group_mapping (user_id, group_id)
SELECT u.id, g.id FROM sys_user u, sys_group g
WHERE u.email = 'jane.smith@test.com' AND g.group_name = 'super';

INSERT INTO sys_user_group_mapping (user_id, group_id)
SELECT u.id, g.id FROM sys_user u, sys_group g
WHERE u.email = 'admin.test@test.com' AND g.group_name = 'super';

INSERT INTO sys_user_group_mapping (user_id, group_id)
SELECT u.id, g.id FROM sys_user u, sys_group g
WHERE u.email = 'admin.test@test.com' AND g.group_name = 'right-management';
