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

SIDM-8901 add caseworkers #377

Merged
merged 8 commits into from
Oct 13, 2023
Merged

SIDM-8901 add caseworkers #377

merged 8 commits into from
Oct 13, 2023

Conversation

jburke-idam
Copy link
Contributor

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")

[ ] Yes
[X] No

@hmcts-jenkins-d-to-i
Copy link
Contributor

Plan Result

No changes. Your infrastructure matches the configuration.

@jburke-idam jburke-idam enabled auto-merge October 12, 2023 14:53
createRequest.setSkills(Collections.emptyList());
createRequest.setUserType("CTSC");
createRequest.setUserProfileIdamStatus("ACTIVE");
createRequest.setStaffAdmin(user.getRoleNames().contains("staff-admin"));
Copy link
Contributor

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?

Copy link
Contributor Author

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()
Copy link
Contributor

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?

Copy link
Contributor Author

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) {
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@jburke-idam jburke-idam merged commit 1a41021 into master Oct 13, 2023
@jburke-idam jburke-idam deleted the SIDM-8901-caseworkers branch October 13, 2023 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants