Update `Groups::EnterpriseUsers::CreateService` class

What does this MR do and why?

As a part of #385785 (closed) we added Groups::EnterpriseUsers::CreateService service class that receives group and user. It marks the user Enterprise User of the group if they meet the condition.

As per #396384 (closed), we changed the Enterprise User definition in the following MR gitlab-com/www-gitlab-com!121353 (merged). The implementation of the service class should reflect the updated Enterprise User definition, see https://about.gitlab.com/handbook/support/workflows/gitlab-com_overview.html#enterprise-users

As per #396384 (comment 1313453335) added new attributes enterprise_group_id and enterprise_group_associated_at to user_details table and want to mark a user as an enterprise user by using those attributes instead of provisioned_by_group_id and provisioned_by_group_at. This MR updates the service class to use new attributes.

The service class should allow enterprise users of group1 to become enterprise users of group2 in case of moving verified domains from group1 to group2. This MR addresses this too.

Related to #406266 (closed)

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Bogdan Denkovych

Merge request reports

Loading