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

CIRC-1933: Implementation for Search Slips API #1391

Merged
merged 8 commits into from
Dec 26, 2023
Prev Previous commit
Next Next commit
CIRC-1933 Address review comments
OleksandrVidinieiev committed Dec 26, 2023

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
commit 1b0318467163a7793a94b0962bc63fccf0d62a26
10 changes: 4 additions & 6 deletions src/main/java/org/folio/circulation/resources/SlipsResource.java
Original file line number Diff line number Diff line change
@@ -103,10 +103,10 @@ private void getMany(RoutingContext routingContext) {

final var userRepository = new UserRepository(clients);
final var itemRepository = new ItemRepository(clients);
final AddressTypeRepository addressTypeRepository = new AddressTypeRepository(clients);
final ServicePointRepository servicePointRepository = new ServicePointRepository(clients);
final PatronGroupRepository patronGroupRepository = new PatronGroupRepository(clients);
final DepartmentRepository departmentRepository = new DepartmentRepository(clients);
final var addressTypeRepository = new AddressTypeRepository(clients);
final var servicePointRepository = new ServicePointRepository(clients);
final var patronGroupRepository = new PatronGroupRepository(clients);
final var departmentRepository = new DepartmentRepository(clients);
final UUID servicePointId = UUID.fromString(
routingContext.request().getParam(SERVICE_POINT_ID_PARAM));

@@ -142,7 +142,6 @@ private CompletableFuture<Result<Collection<Item>>> fetchItemsForLocations(
log.debug("fetchPagedItemsForLocations:: parameters multipleLocations: {}",
() -> multipleRecordsAsString(multipleLocations));
Collection<Location> locations = multipleLocations.getRecords();

Set<String> locationIds = locations.stream()
.map(Location::getId)
.filter(StringUtils::isNoneBlank)
@@ -157,7 +156,6 @@ private CompletableFuture<Result<Collection<Item>>> fetchItemsForLocations(
List<String> itemStatusValues = itemStatuses.stream()
.map(ItemStatus::getValue)
.toList();

Result<CqlQuery> statusQuery = exactMatchAny(STATUS_NAME_KEY, itemStatusValues);

return itemRepository.findByIndexNameAndQuery(locationIds, EFFECTIVE_LOCATION_ID_KEY, statusQuery)