-
Notifications
You must be signed in to change notification settings - Fork 21
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
fix(invitedUsers): filter deleted users for invitedUsers endpoint #155
fix(invitedUsers): filter deleted users for invitedUsers endpoint #155
Conversation
44b78f8
to
e0cca89
Compare
invitationStatus.Id, | ||
companyuser.Email | ||
)) | ||
_dbContext.Invitations |
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.
I suggest:
public IAsyncEnumerable<InvitedUserDetail> GetInvitedUserDetailsUntrackedAsync(Guid applicationId) =>
_dbContext.Invitations
.AsNoTracking()
.Where(invitation => invitation.CompanyApplicationId == applicationId && invitation.CompanyUser!.Identity!.UserStatusId != UserStatusId.DELETED)
.Select(invitation => new InvitedUserDetail(
invitation.CompanyUser!.Identity!.UserEntityId,
invitation.InvitationStatusId,
invitation.CompanyUser.Email))
.AsAsyncEnumerable();
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.
adjusted
|
||
var result = await sut.GetInvitedUserDetailsUntrackedAsync(_applicationId).ToListAsync().ConfigureAwait(false); | ||
|
||
result.Should().NotBeNull(); |
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.
I suggest:
result.Should().HaveCount(2)
.And.Satisfy(
x => x.EmailId == "[email protected]" && x.InvitationStatus == InvitationStatusId.CREATED,
x => x.EmailId == "[email protected]" && x.InvitationStatus == InvitationStatusId.CREATED);
(there's no point in asserting 'NotBeNull()' if there are more asserts that implicitly fail if NotBeNull is not satisfied)
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.
adjusted
Refs: CPLP-2986
Refs: CPLP-2986
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
60c9b3a
into
eclipse-tractusx:release/v1.6.0-RC4
Description
Remove the deleted users from the invitedUsers request
Why
Deleted users don't have an userEntityId, therefor the request will fail when keycloak is requested for the user informations
Issue
N/A - Jira Issue: CPLP-2986
Checklist