Skip to content

Commit

Permalink
Prepare for next development iteration
Browse files Browse the repository at this point in the history
  • Loading branch information
gurleenkaurbp committed Jul 5, 2023
1 parent 491772d commit 5c64736
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 3 deletions.
8 changes: 6 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 23.5.6 2023-07-05

* Pickup notices not sent when another item is Awaiting pickup (CIRC-1832)

## 23.5.5 2023-07-03

* Circulation rules decoupling and timer-based refresh enhancement (CIRC-1783)
Expand All @@ -7,12 +11,12 @@
* Only notify patron for recalls that change due date (CIRC-1747)
* Make "Declare lost" fail when a fee/fine should be charged and fee/fine owner doesn't exist (CIRC-1758)
* Make a TLR recall keep the same item when edited (CIRC-1760)
*
*
## 23.5.3 2023-03-27

* Add required module permissions to fix aged to lost item renewal issue (CIRC-1738)
* Fix TLR recall errors in scenarios where it's placed on the least recalled item (CIRC-1759)

## 23.5.2 2023-03-22

* Fix unexpected error message when attempting to renew loan with non-loanable item (CIRC-1592)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ else if (requestQueue == null) {
}
else if (item.isAwaitingPickup()) {
requestQueue.getRequests().stream()
.filter(Request::hasTopPriority)
.filter(Request::isAwaitingPickup)
.filter(Request::hasChangedStatus)
.findFirst()
Expand Down
61 changes: 61 additions & 0 deletions src/test/java/api/requests/RequestsAPICreationTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -4846,4 +4846,65 @@ private void validateInstanceRepresentation(JsonObject requestInstance) {
assertThat(firstPublication.getString("place"), is("New York"));
assertThat(firstPublication.getString("dateOfPublication"), is("2016"));
}

@Test
void awaitingPickupNoticesShouldBeSentToMultiplePatronsDuringPagedItemsCheckIn() {
configurationsFixture.enableTlrFeature();
NoticePolicyBuilder noticePolicy = new NoticePolicyBuilder()
.withName("Policy with available notice")
.withLoanNotices(Collections.singletonList(new NoticeConfigurationBuilder()
.withTemplateId(UUID.randomUUID())
.withAvailableEvent()
.create()));
use(noticePolicy);

final UUID pickupServicePointId = servicePointsFixture.cd1().getId();
final var patron1 = usersFixture.charlotte();
final var patron2 = usersFixture.jessica();

final var items = itemsFixture.createMultipleItemsForTheSameInstance(2);
final var itemA = items.get(0);
final var itemB = items.get(1);
final UUID instanceId = items.get(0).getInstanceId();


IndividualResource pageTlr1 = requestsClient.create(new RequestBuilder()
.page()
.withNoHoldingsRecordId()
.withNoItemId()
.titleRequestLevel()
.withInstanceId(instanceId)
.withPickupServicePointId(pickupServicePointId)
.withRequesterId(patron1.getId()));

var itemAUpdated = itemsFixture.getById(itemA.getId());
var pagedItem = "Paged".equals(itemAUpdated.getStatusName())
? itemA : itemB;
var notPagedItem = itemA == pagedItem ? itemB : itemA;

assertThat(pageTlr1.getJson().getString("status"), is(OPEN_NOT_YET_FILLED));
assertThat(pageTlr1.getJson().getString("itemId"), is(pagedItem.getId()));
checkInFixture.checkInByBarcode(pagedItem,pickupServicePointId);
var updatedFirstRequest = requestsFixture.getRequests(
exactMatch("itemId", pagedItem.getId().toString()), limit(1), noOffset()).getFirst();
assertThat(updatedFirstRequest.getString("status"), is(OPEN_AWAITING_PICKUP));

IndividualResource pageTlr2 = requestsClient.create(new RequestBuilder()
.page()
.withNoHoldingsRecordId()
.withNoItemId()
.titleRequestLevel()
.withInstanceId(instanceId)
.withPickupServicePointId(pickupServicePointId)
.withRequesterId(patron2.getId()));

assertThat(pageTlr2.getJson().getString("status"), is(OPEN_NOT_YET_FILLED));
assertThat(pageTlr2.getJson().getString("itemId"), is(notPagedItem.getId()));
checkInFixture.checkInByBarcode(notPagedItem,pickupServicePointId);
var updatedSecondRequest = requestsFixture.getRequests(
exactMatch("itemId", notPagedItem.getId().toString()), limit(1), noOffset()).getFirst();
assertThat(updatedSecondRequest.getString("status"), is(OPEN_AWAITING_PICKUP));

verifyNumberOfSentNotices(2);
}
}

0 comments on commit 5c64736

Please sign in to comment.