Skip to content
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

Bugfix/dp 765 check person not already part of org #826

Merged

Conversation

rmohammed-goaco
Copy link
Collaborator

No description provided.

@rmohammed-goaco rmohammed-goaco marked this pull request as ready for review October 25, 2024 09:16
…github.com:cabinetoffice/GCGS-Central-Digital-Platform into bugfix/DP-765-check-person-not-already-part-of-org
{
throw new PersonAlreadyAddedToOrganisationException(
$"Person {command.createOrganisationJoinRequestCommand.PersonId} already added to organisation {command.organisationId}.");
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All these added lines seem to belong together. They accomplish one thing - guard that the person isn't already added. Why not replace all these lines with a single async GuardPersonIsNotAlreadyAdded(organisation, person)?

CheckPersonAlreadyAdded could be just renamed to GuardPersonIsNotAlreadyAdded and throw exception instead of returning a bool.

Outcome: less code, and code in the public method remains on the same level of abstraction.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jakzal Thanks for the feedback. Done 👍

dbgoaco

This comment was marked as outdated.

Copy link
Collaborator

@dbgoaco dbgoaco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't work for me. I get the following error:
image
When I go back to the users screen I see duplicate user in the list.

@rmohammed-goaco
Copy link
Collaborator Author

@dbgoaco Did you rebuild everything?

@rmohammed-goaco rmohammed-goaco merged commit ff7e247 into main Oct 25, 2024
8 checks passed
@dharmverma dharmverma deleted the bugfix/DP-765-check-person-not-already-part-of-org branch October 30, 2024 13:23
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.

6 participants