Skip to content

Commit

Permalink
PR-1776 Return loan id on check out
Browse files Browse the repository at this point in the history
  • Loading branch information
JanisSaldabols committed Jun 3, 2024
1 parent 2c1c484 commit 9edf190
Showing 1 changed file with 6 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.CheckOutItemService;
import org.extensiblecatalog.ncip.v2.service.ItemId;
import org.extensiblecatalog.ncip.v2.service.ItemIdentifierType;
import org.extensiblecatalog.ncip.v2.service.ItemOptionalFields;
import org.extensiblecatalog.ncip.v2.service.Problem;
import org.extensiblecatalog.ncip.v2.service.ProblemType;
import org.extensiblecatalog.ncip.v2.service.RemoteServiceManager;
Expand All @@ -37,6 +38,7 @@ public CheckOutItemResponseData performService(CheckOutItemInitiationData initDa
ItemId itemId = initData.getItemId();
UserId userId = retrieveUserId(initData);
String dueDate = null;
String loanUuid = null;
try {
validateUserId(userId);
validateItemId(itemId);
Expand Down Expand Up @@ -79,6 +81,7 @@ public CheckOutItemResponseData performService(CheckOutItemInitiationData initDa
//THE SERVICE MANAGER CALLS THE OKAPI APIs
JsonObject checkOutItemResponseDetails = ((FolioRemoteServiceManager)serviceManager).checkOut(initData,requesterAgencyId.toLowerCase());
dueDate = checkOutItemResponseDetails.getString("dueDate");
loanUuid = checkOutItemResponseDetails.getString("id");
//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 @@ -110,6 +113,9 @@ public CheckOutItemResponseData performService(CheckOutItemInitiationData initDa
responseData.setDateDue(calendar);
responseData.setItemId(iId);
responseData.setUserId(uId);
ItemOptionalFields o = new ItemOptionalFields();
o.setHoldQueue(loanUuid);
responseData.setItemOptionalFields(o);

return responseData;
}
Expand Down

0 comments on commit 9edf190

Please sign in to comment.