-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: user invites backend endpoints #896
Conversation
…/user-office-core into SWAP-4336-user-invites
This looks great. I'm quite ignorant about the existing redeem-codes functionality, will this be behind the Yes it will, as it essentially the same feature |
}); | ||
|
||
test('A user can not accept code twice', async () => { | ||
await inviteMutations.accept(dummyUserWithRole, 'code1'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems this test relies on a previous test having already run in order to pass. I think this test should be self-contained.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your feedback! I've now added a beforeEach(() => { ...
to reset the database mocks before each test.
The tests were self-contained but relied on some initial data in the database. I also see your point about starting with an empty database and initializing data within the test for clarity. At the same time I see that in other mock datasources we also use initial data. Let me know where you stand on this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, okay, I was mistaken. This is a very good point and something I think is worth bringing up in the joint-sprint planning. I'd say what you've done is great.
@William-Edwards-STFC I already have some feedback from @Scott-James-Hurley let me know if you have anything more on this before we can merge it. Thank you in advance! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cheers
Description
This PR is first step for a new feature to allow user invites through invite codes.
This feature will be extended to allow invite co-proposers to proposal and will replace existing redeem-codes functionality.
This first PR focuses on adding database structures and backend endpoints for creating, updating and accepting invites. In this PR only role claim is implemented. Check this wiki for terminology (https://github.com/UserOfficeProject/user-office-core/wiki/Invite-Codes-System)
Motivation and Context
This will allow to remove placeholder users which is a step towards completely removing user information management from the User Office. User information will be instead provided by an abstract data source or service.
Changes
How Has This Been Tested?
Added Unit tests and tested endpoints by manually invoking them
Fixes Jira Issue
https://jira.esss.lu.se/browse/SWAP-4336