ENG-104: invite users to organisation #50
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new feature for managing invites within the application. The changes include the addition of new models, repositories, and routes to handle invites, as well as updates to existing models to support the new functionality.
New invite management feature:
backend/app/main.py
: Addedinvites
to the list of imported modules and included the invites router in thecreate_app
function. [1] [2]backend/app/models/invite.py
: Introduced a newInvite
model with relevant fields and relationships.backend/app/repos/invite_repo.py
: Created a new repository for managing invite-related database operations, including methods for creating, retrieving, and deleting invites.backend/app/routes/invites.py
: Added routes for creating, searching, and deleting invites, utilizing the newInviteRepo
.Updates to existing models:
backend/app/models/__init__.py
: Imported the newInvite
model.backend/app/models/organisation.py
: Added a relationship to theInvite
model in theOrganisation
class. [1] [2]backend/app/models/user.py
: Updated theUser
model to include relationships for received and sent invites.backend/app/models/organisation_member.py
: Changed therole
field to use theMemberRole
enum. [1] [2]Additional changes:
backend/app/repos/user_repo.py
: Added a method to get an organisation member by email address.backend/app/routes/slack.py
: Refactored to use a factory method for creating theSlackUserService
. [1] [2] [3] [4] [5]backend/app/routes/users.py
: Updated the user registration route to handle invites and refactored to use theInviteRepo
. [1] [2]backend/app/schemas/actions.py
: Added a new schema for creating invites. [1] [2]