Skip to content

Commit

Permalink
CIRC-2019 Renewal by override, flag block on loan
Browse files Browse the repository at this point in the history
  - For the client (UI) to know up-front to display override modal.

(cherry picked from commit 94196ff)
  • Loading branch information
nielserik committed Apr 23, 2024
1 parent 8e756ce commit 9c0f03b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/main/java/org/folio/circulation/domain/LoanRepresentation.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import static org.folio.circulation.domain.representations.LoanProperties.LOST_ITEM_POLICY;
import static org.folio.circulation.domain.representations.LoanProperties.OVERDUE_FINE_POLICY;
import static org.folio.circulation.domain.representations.LoanProperties.PATRON_GROUP_ID_AT_CHECKOUT;
import static org.folio.circulation.domain.representations.LoanProperties.REMINDERS;

import static org.folio.circulation.support.json.JsonPropertyWriter.write;

import java.lang.invoke.MethodHandles;
Expand Down Expand Up @@ -59,6 +61,15 @@ public JsonObject extendedLoan(Loan loan) {
extendedRepresentation.remove(BORROWER);
}

if (loan.getOverdueFinePolicy().isReminderFeesPolicy()
&& loan.getLastReminderFeeBilledNumber() != null) {
extendedRepresentation.getJsonObject(REMINDERS)
.put("renewalBlocked",
!loan.getOverdueFinePolicy()
.getRemindersPolicy().getAllowRenewalOfItemsWithReminderFees());
}


addPolicy(extendedRepresentation, loan.getLoanPolicy(), LOAN_POLICY);
addPolicy(extendedRepresentation, loan.getOverdueFinePolicy(), OVERDUE_FINE_POLICY);
addPolicy(extendedRepresentation, loan.getLostItemPolicy(), LOST_ITEM_POLICY);
Expand Down

0 comments on commit 9c0f03b

Please sign in to comment.