-
Notifications
You must be signed in to change notification settings - Fork 0
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
SIDM-8901 add caseworkers #377
Conversation
Plan Result
|
247b3ad
to
c9c8e53
Compare
createRequest.setSkills(Collections.emptyList()); | ||
createRequest.setUserType("CTSC"); | ||
createRequest.setUserProfileIdamStatus("ACTIVE"); | ||
createRequest.setStaffAdmin(user.getRoleNames().contains("staff-admin")); |
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.
Would we ever want testing-support-api clients to send us things like roles, user types, regions, locations?
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.
Probably yes, but we don't have a "V2" model for that (yet). I think it's fine to leave these as defaults for now since IDAM is the only user. When we want to expand the usage of this we can discuss a newer input model
); | ||
if (existingCaseWorkerProfile.isEmpty()) { | ||
testingCaseWorkerProfileService.createCaseWorkerProfile(sessionId, idamUser); | ||
} else if (existingCaseWorkerProfile.get().isSuspended() |
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.
Maybe we want them to be always to be the same and otherwise fail? (right now we only fail if caseworker is suspended and idam user is not)
Also - shall we look at "pending" too?
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.
Yeah - so since IDAM is the sole user at the moment we would always expect the entities to be created from scratch. In the event that they aren't being created we do a minimal check that the ids, emails and "status" are all in line, and fail if they aren't. I think we would need to do more with this in the long run, but this is the minimal implementation.
return getUserProfileCategories(user.getRoleNames()); | ||
} | ||
|
||
protected Set<UserProfileCategory> getUserProfileCategories(List<String> roleNames) { |
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.
[minor] Probably belongs to a different class.
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.
yeah, I did think that. If we had an "idam library" then it could all be shared by the bridge.
JIRA link (if applicable)
https://tools.hmcts.net/jira/browse/SIDM-8901
Change description
add caseworkers
Does this PR introduce a breaking change? (check one with "x")