diff --git a/src/main/java/org/folio/ncip/FolioNcipHelper.java b/src/main/java/org/folio/ncip/FolioNcipHelper.java index 1cb0e20..93ef00f 100644 --- a/src/main/java/org/folio/ncip/FolioNcipHelper.java +++ b/src/main/java/org/folio/ncip/FolioNcipHelper.java @@ -24,6 +24,7 @@ import org.extensiblecatalog.ncip.v2.common.Translator; import org.extensiblecatalog.ncip.v2.common.TranslatorFactory; import org.extensiblecatalog.ncip.v2.service.BibliographicRecordIdentifierCode; +import org.extensiblecatalog.ncip.v2.service.LocationType; import org.extensiblecatalog.ncip.v2.service.NCIPInitiationData; import org.extensiblecatalog.ncip.v2.service.NCIPResponseData; import org.extensiblecatalog.ncip.v2.service.RequestScopeType; @@ -93,10 +94,12 @@ private Future initToolkitDefaults() { } private void setUpMapping(){ - SchemeValuePair.allowNullScheme(RequestType.class.getName(), RequestScopeType.class.getName(), BibliographicRecordIdentifierCode.class.getName()); + SchemeValuePair.allowNullScheme(RequestType.class.getName(), RequestScopeType.class.getName(), + BibliographicRecordIdentifierCode.class.getName(), LocationType.class.getName()); SchemeValuePair.mapBehavior(RequestType.class.getName(), SchemeValueBehavior.ALLOW_ANY); SchemeValuePair.mapBehavior(RequestScopeType.class.getName(), SchemeValueBehavior.ALLOW_ANY); SchemeValuePair.mapBehavior(BibliographicRecordIdentifierCode.class.getName(), SchemeValueBehavior.ALLOW_ANY); + SchemeValuePair.mapBehavior(LocationType.class.getName(), SchemeValueBehavior.ALLOW_ANY); } public InputStream ncipProcess(RoutingContext context) throws Exception { diff --git a/src/main/java/org/folio/ncip/services/FolioRequestItemService.java b/src/main/java/org/folio/ncip/services/FolioRequestItemService.java index 3f3c8ff..0dc3f0c 100644 --- a/src/main/java/org/folio/ncip/services/FolioRequestItemService.java +++ b/src/main/java/org/folio/ncip/services/FolioRequestItemService.java @@ -10,6 +10,7 @@ import org.extensiblecatalog.ncip.v2.service.Location; import org.extensiblecatalog.ncip.v2.service.LocationName; import org.extensiblecatalog.ncip.v2.service.LocationNameInstance; +import org.extensiblecatalog.ncip.v2.service.LocationType; import org.extensiblecatalog.ncip.v2.service.Problem; import org.extensiblecatalog.ncip.v2.service.ProblemType; import org.extensiblecatalog.ncip.v2.service.RequestId; @@ -26,6 +27,7 @@ import org.folio.ncip.FolioNcipException; import org.folio.ncip.FolioRemoteServiceManager; +import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -93,9 +95,12 @@ public RequestItemResponseData performService(RequestItemInitiationData initData ItemIdentifierType itemIdentifierType = new ItemIdentifierType(Constants.SCHEME, Constants.ITEM_BARCODE); RequestIdentifierType requestIdentifierType = new RequestIdentifierType(Constants.SCHEME,Constants.REQUEST_ID); Location location = new Location(); + LocationType locationType = new LocationType(Constants.SCHEME, Constants.ITEM); LocationName locationName = new LocationName(); + locationNameInstance.setLocationNameLevel(BigDecimal.ONE); locationName.setLocationNameInstances(List.of(locationNameInstance)); location.setLocationName(locationName); + location.setLocationType(locationType); ItemOptionalFields itemOptionalFields = new ItemOptionalFields(); itemOptionalFields.setItemDescription(itemDescription); itemOptionalFields.setLocations(List.of(location));