Closed pjmonks closed 1 week ago
Marking this as "Open PR". It does not technically have a pull request, but it signifies that these planning notes are defined and open to review if anyone else has suggestions. However, I believe this covers the planned implementation we want to achieve.
Considering this plan as complete now. The related issues have been added to GitHub to implement this plan.
Problem
The workflow for how researchers get initial user accounts for Mauro and the SDE must be determined. This needs to happen before a researcher is able to carry out any other SDE workflow requests, since all SDE requests are tied to a user account.
Also, the user journey should be for the intended new research user to submit one registration form containing all details - personal details, plus organisation/department to join (or create if they do not exist yet).
This issue will be used to gather notes/requirements and map out the design/implementation of this feature. This is a "living" document and is subject to change.
Requirements
Based on the description taken from the epic #421, the following requirements must be considered:
Out of Scope
Summary
After extensive discussions, we have settled on a multi-request approach to handle the creation of a user account for sign-in and have that user create/join an organisation/department. The SDE already has a detailed request state workflow that covers all the approval, governance and action states that a request might need, including tracking and conversation/history.
As well as creating a user account, there are 3 scenarios identified as being part of registration:
JoinOrganisationRequest
CreateOrganisationRequest
CreateDepartmentRequest
So registration will be a linked pair of requests - a
CreateUserAccountRequest
, followed by one of the requests above. Which secondary request to action is dependent on the state of the registration form in MDE. The requests will be linked by a newRequest.previousRequestId
field, such that requests are chained together, e.g.The
CreateUserAccountRequest
will be submitted straight to theAwait pickup
state so that an SDE administrator can view it immediately. The second, joined request will be submitted to theDraft
state to prevent the SDE administrator from working on that first - the order of requests being actioned is important. The second request will have it's state automatically changed toAwait pickup
once theCreateUserAccountRequest
is changed toComplete
.The key problem in this scenario is that, to register a user, they do not yet have a
UserId
yet - and all SDE requests must have aUserId
attached. To solve this, a special singletonResearchUser
will be created to act as the "anonymous user" (the user ID is irrelevant, so long as one exists). Initially, the pair of requests will be mapped to the "anonymous user", but during the request state transitions, they will eventually be automatically updated within the SDE to swap to the new user. The pair of requests will not be allowed to move to theComplete
state until a valid, non-anonymous user ID is remapped.Sequence of Events
Below is a flowchart of the sequence of events that can happen. Note that, although the Request Status workflow is fully supported, this diagram may only show the "happy path" of all approvals passing for brevity.
This should demonstrate that:
CreateUserAccountRequest
is intended to be created quicker than a full verification/background check on a user/organisation.CreateUserAccountRequest
has been completed can the researcher finally sign-in to the Mauro Data Explorer. They can then at least review the status of the second, linked request and submit further information or answer questions to complete the registration process.Request Status Workflow
The benefits of re-using the SDE request management system are that:
There are some drawbacks too:
CreateUserAccountRequest
is created. There are possibilities to add email notifications into the SDE for a later iteration which may help. For now this drawback is accepted and the compromise for getting a user account as efficiently as possible.Registration Form
The user will be presented with a form to fill in, with the following options:
Personal Details
These details will be used to create their user account in the SDE.
Organisation
Either:
Or, if one must be created:
If creating a new Organisation, the personal details listed above will be used to add this person as the first "approver" member of this Organisation.
Department
Either:
Or, if one must be created:
If creating a new Department, the personal details listed above will be used to add this person as the first member of this Department.