Skip to content

Comments

feat(EG-433): create user invite api for onboarding users#71

Merged
zigtan merged 11 commits intomainfrom
feat/EG-433-create_user_invite_api
May 13, 2024
Merged

feat(EG-433): create user invite api for onboarding users#71
zigtan merged 11 commits intomainfrom
feat/EG-433-create_user_invite_api

Conversation

@zigtan
Copy link
Contributor

@zigtan zigtan commented May 13, 2024

This PR adds a new POST /easy-genomics/user/create-user-invite API endpoint for the FE to use when clicking on the Invite Button and supplying the user's email address.

The API expects the CreateUserInvite type with the JSON format:

{
  OrganizationId: string;
  Email: string;
}

The API will:

  • check if the supplied OrganizationId exists
  • check if the supplied Email belongs to an existing User to determine:
    • If the User is new, then it will create a Cognito User account, and then add a new User record and Organization-User access mapping record.
      • NOTE: The created Cognito User Account's Username field is used for the Easy Genomics User's UserId field.
    • Otherwise if the User is existing, then it the User just needs to be added to the Organization by creating a new Organization-User access mapping record.

The logic checks if such a mapping exists first, and if the Organization-User access mapping record’s status is still Invited to allow for re-sending of invitations.

There is added error handling and cleanup if a User record / Organization-User access mapping record failed to be created for any reason.

The sending of email invitations is not implemented yet, and will be done in a separate ticket to add a reusable email-service.

@zigtan zigtan merged commit 9c598da into main May 13, 2024
@zigtan zigtan deleted the feat/EG-433-create_user_invite_api branch May 13, 2024 04:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants