User mapping - API Development (Controllers)
On this issue, we will work on creating the controllers that will be used by the improved user mapping to accept or reject an assignment.
Two types of users will interact with the feature: group owners and assigned users.
Initially, group owners will use the User reassignment UI. These actions will be supported by GraphQL endpoints implemented in another issue: #457066 (closed)
Assigned users will receive an email to accept or reject the reassignment.
To support the invitation email actions, we need to create another controller that meets the following criteria:
- All actions should only be accessible to the user assigned to the
Import::SourceUser
- The
Import::SourceUser
should have the statusawaiting_approval
- The controller should implement the following actions:
- GET accept
- GET reject
When using GET accept, the Import::SourceUser status should be changed to complete
. In this case, the reassign worker should be enqueued. If it hasn't been implemented yet, just set the status to complete and leave a placeholder note where the worker should be enqueued.
When using GET reject, the Import::SourceUser status should be changed to rejected
.
Note: The controller should only be available when the feature flag improved_user_mapping
is enabled. The feature flag will need to be created in this issue if not already done