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-2198 Implement the code for the feature UXPROD-5001 #1521

Merged
merged 13 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions ramls/request.json
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,10 @@
"itemLocationCode": {
"description": "Allow specifying item location when creating title-level requests",
"type": "string"
},
"isDcbReRequestCancellation": {
"description": "Indicates whether the request was cancelled during a DCB transaction update",
"type": "boolean"
}
},
"additionalProperties": false,
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/org/folio/circulation/domain/Request.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import static org.folio.circulation.domain.representations.RequestProperties.REQUEST_LEVEL;
import static org.folio.circulation.domain.representations.RequestProperties.REQUEST_TYPE;
import static org.folio.circulation.domain.representations.RequestProperties.STATUS;
import static org.folio.circulation.support.json.JsonPropertyFetcher.getBooleanProperty;
import static org.folio.circulation.support.json.JsonPropertyFetcher.getDateTimeProperty;
import static org.folio.circulation.support.json.JsonPropertyFetcher.getIntegerProperty;
import static org.folio.circulation.support.json.JsonPropertyFetcher.getProperty;
Expand Down Expand Up @@ -427,6 +428,10 @@ public boolean hasLoan() {
return loan != null;
}

public boolean getDcbReRequestCancellationValue() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public boolean getDcbReRequestCancellationValue() {
public boolean isDcbReRequestCancellation() {

return getBooleanProperty(requestRepresentation, "isDcbReRequestCancellation");
}

public enum Operation {
CREATE, REPLACE, MOVE;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,13 @@ public Result<RequestAndRelatedRecords> sendNoticeOnRequestCancelled(
log.debug("sendNoticeOnRequestCancelled:: parameters records: {}", () -> records);
Request request = records.getRequest();

if (request.hasItemId()) {
sendCancellationNoticeForRequestWithItemId(request);
} else {
sendCancellationNoticeForRequestWithoutItemId(request);
// Send the cancellation notice only if the suppressNotification flag is false
AntonAntonich marked this conversation as resolved.
Show resolved Hide resolved
if (!request.getDcbReRequestCancellationValue()) {
if (request.hasItemId()) {
sendCancellationNoticeForRequestWithItemId(request);
} else {
sendCancellationNoticeForRequestWithoutItemId(request);
}
}

return succeeded(records);
Expand Down
Loading