Skip to content

Commit

Permalink
CIRC-2141 Rebase to latest master
Browse files Browse the repository at this point in the history
  • Loading branch information
JanisSaldabols committed Oct 3, 2024
1 parent 0db519b commit 07d0d4d
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/main/java/org/folio/circulation/domain/Item.java
Original file line number Diff line number Diff line change
Expand Up @@ -417,14 +417,10 @@ public String getDcbItemTitle() {
}

public boolean isAtLocation(String locationCode) {
if (locationCode == null || locationCode.isEmpty()) {
return true;
} else {
return getLocation() != null && (
locationCode.equals(getLocation().getCode()) ||
locationCode.equals(getLocation().getLibrary().getCode()) ||
locationCode.equals(getLocation().getCampus().getCode()) ||
locationCode.equals(getLocation().getInstitution().getCode()));
}
return locationCode != null && getLocation() != null && (
locationCode.equals(getLocation().getCode()) ||
locationCode.equals(getLocation().getLibrary().getCode()) ||
locationCode.equals(getLocation().getCampus().getCode()) ||
locationCode.equals(getLocation().getInstitution().getCode()));
}
}
31 changes: 31 additions & 0 deletions src/test/java/api/support/builders/RequestBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -333,4 +333,35 @@ private static class PatronSummary {
public static class Tags {
private final List<String> tagList;
}

@AllArgsConstructor
@Getter
public static class PrintDetails {
private final Integer printCount;
private final String requesterId;
private final Boolean isPrinted;
private final String printEventDate;

public static PrintDetails fromRepresentation(JsonObject representation) {
JsonObject printDetails = representation.getJsonObject("printDetails");
if (printDetails != null) {
final Integer printCount = printDetails.getInteger("printCount");
final String requesterId = printDetails.getString("requesterId");
final Boolean isPrinted = printDetails.getBoolean("isPrinted");
final String printEventDate = printDetails.getString("printEventDate");
return new PrintDetails(printCount, requesterId, isPrinted,
printEventDate);
}
return null;
}

public JsonObject toJsonObject() {
JsonObject printDetails = new JsonObject();
printDetails.put("printCount", printCount);
printDetails.put("requesterId", requesterId);
printDetails.put("isPrinted", isPrinted);
printDetails.put("printEventDate", printEventDate);
return printDetails;
}
}
}

0 comments on commit 07d0d4d

Please sign in to comment.