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

[MODPATRON-165]-Added POST api for external patron. #140

Merged
merged 10 commits into from
Jun 6, 2024
Merged

Conversation

SinghAdes
Copy link
Contributor

@SinghAdes SinghAdes commented May 28, 2024

https://folio-org.atlassian.net/browse/MODPATRON-166.

Approach:- In scope of this PR we are creating user based on LOC application requirement .

private Set<String> departments;

@Valid
private List<String> proxyFor;
Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove unused fields in this 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.

fixed

}

private CompletableFuture<String> getRemotePatronGroupId(UserRepository userRepository, Map<String, String> okapiHeaders) {
return userRepository.getGroupByGroupName("staff", okapiHeaders)
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use string constant for staff

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

JsonObject addressTypes = new JsonObject();
responseJson.getJsonArray("addressTypes").forEach(item -> {
JsonObject addressType = (JsonObject) item;
if ("Home".equalsIgnoreCase(addressType.getString("addressType"))) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use string constants for home and work keywords

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

return CompletableFuture.completedFuture(
PostPatronAccountResponse.respond403WithTextPlain("User does not belong to the required patron group")
);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Pls check the error response code and error message.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@SinghAdes SinghAdes requested a review from gurleenkaurbp June 3, 2024 08:47
Copy link
Contributor

@gurleenkaurbp gurleenkaurbp left a comment

Choose a reason for hiding this comment

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

Thanks Adesh

Copy link

sonarqubecloud bot commented Jun 6, 2024

@SinghAdes SinghAdes merged commit 9f3a123 into master Jun 6, 2024
6 checks passed
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.

3 participants