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

feat(consortium-search): Implement consolidated items/holdings search #586

Merged
merged 24 commits into from
May 30, 2024

Conversation

viacheslavkol
Copy link
Contributor

@viacheslavkol viacheslavkol commented May 22, 2024

Purpose

Implement consolidated items/holdings search

Approach

  • Implement endpoints by id
  • Implement batch endpoints by ids

Changes Checklist

  • API Changes: Document any API paths, methods, request or response bodies changed, added, or removed.
  • Database Schema Changes: Indicate any database schema changes and their impact. Confirm that migration scripts were created.
  • Interface Version Changes: Indicate any changes to interface versions.
  • Interface Dependencies: Document added or removed dependencies.
  • Permissions: Document any changes to permissions.
  • Logging: Confirm that logging is appropriately handled.
  • Unit Testing: Confirm that changed classes were covered by unit tests.
  • Integration Testing: Confirm that changed logic was covered by integration tests.
  • Manual Testing: Confirm that changes were tested on local or dev environment.
  • NEWS: Confirm that the NEWS file is updated with relevant information about the changes made in this pull request.

Related Issues

MSEARCH-759

@viacheslavkol viacheslavkol self-assigned this May 22, 2024
@viacheslavkol viacheslavkol marked this pull request as ready for review May 22, 2024 16:10
@viacheslavkol viacheslavkol requested a review from a team as a code owner May 22, 2024 16:10
descriptors/ModuleDescriptor-template.json Outdated Show resolved Hide resolved
descriptors/ModuleDescriptor-template.json Outdated Show resolved Hide resolved
- Fix permission names in module descriptor
Comment on lines +147 to +153
private String verifyAndGetTenant(String tenantHeader) {
var centralTenant = consortiumTenantService.getCentralTenant(tenantHeader);
if (centralTenant.isEmpty() || !centralTenant.get().equals(tenantHeader)) {
throw new RequestValidationException(REQUEST_NOT_ALLOWED_MSG, XOkapiHeaders.TENANT, tenantHeader);
}
return centralTenant.get();
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't like methods like doSomeAndDoSomeAnd...
May be better way to do something like next

private String getVerifiedTenant(String tenantHeader) {
    verifyTenant(tenantHeader)
    return consortiumTenantService.getCentralTenant(tenantHeader).get();
}

private void verifyTenant(String tenantHeader) {
    var centralTenant = consortiumTenantService.getCentralTenant(tenantHeader);
    if (centralTenant.isEmpty() || !centralTenant.get().equals(tenantHeader)) {
      throw new RequestValidationException(REQUEST_NOT_ALLOWED_MSG, XOkapiHeaders.TENANT, tenantHeader);
    }
}

Copy link

sonarcloud bot commented May 30, 2024

@viacheslavkol viacheslavkol merged commit 088759a into master May 30, 2024
7 checks passed
@viacheslavkol viacheslavkol deleted the MSEARCH-759 branch May 30, 2024 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants