Skip to content

Commit

Permalink
MODNCIP-68 Add callNumber to CheckOutItem response
Browse files Browse the repository at this point in the history
  • Loading branch information
JanisSaldabols committed Sep 25, 2024
1 parent f4ea723 commit 2a0bf5d
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import org.extensiblecatalog.ncip.v2.service.CheckOutItemInitiationData;
import org.extensiblecatalog.ncip.v2.service.CheckOutItemResponseData;
import org.extensiblecatalog.ncip.v2.service.CheckOutItemService;
import org.extensiblecatalog.ncip.v2.service.ItemDescription;
import org.extensiblecatalog.ncip.v2.service.ItemId;
import org.extensiblecatalog.ncip.v2.service.ItemIdentifierType;
import org.extensiblecatalog.ncip.v2.service.ItemOptionalFields;
Expand Down Expand Up @@ -43,6 +44,7 @@ public CheckOutItemResponseData performService(CheckOutItemInitiationData initDa
UserId userId = retrieveUserId(initData);
String dueDate = null;
String loanUuid = null;
String callNumber = null;
try {
validateUserId(userId);
validateItemId(itemId);
Expand Down Expand Up @@ -86,6 +88,10 @@ public CheckOutItemResponseData performService(CheckOutItemInitiationData initDa
JsonObject checkOutItemResponseDetails = ((FolioRemoteServiceManager)serviceManager).checkOut(initData,requesterAgencyId.toLowerCase());
dueDate = checkOutItemResponseDetails.getString("dueDate");
loanUuid = checkOutItemResponseDetails.getString("id");
JsonObject item = checkOutItemResponseDetails.getJsonObject("item");
if (item != null) {
callNumber = item.getString("callNumber");
}
//DUE DATE PARSE STARTED FAILING 11-2020
//SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
Expand Down Expand Up @@ -121,6 +127,11 @@ public CheckOutItemResponseData performService(CheckOutItemInitiationData initDa
loanId.setItemIdentifierValue(loanUuid);
loanId.setItemIdentifierType(Version2ItemIdentifierType.UUID);
responseData.setLoanUuid(loanId);
ItemOptionalFields itemOptionalFields = new ItemOptionalFields();
ItemDescription itemDescription = new ItemDescription();
itemDescription.setCallNumber(callNumber);
itemOptionalFields.setItemDescription(itemDescription);
responseData.setItemOptionalFields(itemOptionalFields);

return responseData;
}
Expand Down

0 comments on commit 2a0bf5d

Please sign in to comment.