From d22d472e176b82472ddfa209a6d40d011261e078 Mon Sep 17 00:00:00 2001 From: Roman_Barannyk Date: Tue, 2 Apr 2024 15:28:40 +0300 Subject: [PATCH] CIRC-2050 incorporating review comments --- .../folio/circulation/domain/AllowedServicePointsRequest.java | 1 + .../storage/requests/RequestPolicyRepository.java | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/main/java/org/folio/circulation/domain/AllowedServicePointsRequest.java b/src/main/java/org/folio/circulation/domain/AllowedServicePointsRequest.java index 75de70f03e..1f2a13854c 100644 --- a/src/main/java/org/folio/circulation/domain/AllowedServicePointsRequest.java +++ b/src/main/java/org/folio/circulation/domain/AllowedServicePointsRequest.java @@ -25,6 +25,7 @@ public class AllowedServicePointsRequest { public boolean isForTitleLevelRequest() { return instanceId != null; } + public boolean isForItemLevelRequest() { return itemId != null; } diff --git a/src/main/java/org/folio/circulation/infrastructure/storage/requests/RequestPolicyRepository.java b/src/main/java/org/folio/circulation/infrastructure/storage/requests/RequestPolicyRepository.java index dba2a735cf..7df5c56de1 100644 --- a/src/main/java/org/folio/circulation/infrastructure/storage/requests/RequestPolicyRepository.java +++ b/src/main/java/org/folio/circulation/infrastructure/storage/requests/RequestPolicyRepository.java @@ -97,6 +97,8 @@ public CompletableFuture>>> lookupRequestPol } public CompletableFuture> lookupRequestPolicy(User user) { + // Circulation rules need to be executed with the patron group parameter only. + // All the item-related parameters should be random UUIDs. return lookupRequestPolicyId(UUID.randomUUID().toString(), user.getPatronGroupId(), UUID.randomUUID().toString(), UUID.randomUUID().toString()) .thenCompose(r -> r.after(this::lookupRequestPolicy))