Skip to content

Commit

Permalink
Return user UUID in LookupUser call
Browse files Browse the repository at this point in the history
  • Loading branch information
JanisSaldabols committed Oct 8, 2024
1 parent 125a11c commit 0e6fde5
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/main/java/org/folio/ncip/services/FolioLookupUserService.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
import org.folio.ncip.Constants;
import org.folio.ncip.FolioNcipException;
import org.folio.ncip.FolioRemoteServiceManager;

import java.util.List;
import java.util.Properties;
import java.util.ArrayList;
import java.util.Iterator;
Expand Down Expand Up @@ -120,19 +122,20 @@ private LookupUserResponseData constructResponse(LookupUserInitiationData initDa
LookupUserResponseData responseData = new LookupUserResponseData();
try {

UserId userId = new UserId();
userId.setUserIdentifierValue(userDetails.getString("id"));
responseData.setUserId(userId);

if (responseData.getUserOptionalFields()==null)
responseData.setUserOptionalFields(new UserOptionalFields());

if (initData.getNameInformationDesired()) {
responseData.getUserOptionalFields().setNameInformation(this.retrieveName(userDetails));
}

if (initData.getUserIdDesired())
responseData.setUserId(this.retrieveBarcode(userDetails,requesterAgencyId));
if (initData.getUserIdDesired()) {
responseData.setUserId(this.retrieveBarcode(userDetails, requesterAgencyId));
UserId userUuid = new UserId();
userUuid.setUserIdentifierType(new UserIdentifierType("uuid"));
userUuid.setUserIdentifierValue(userDetails.getString("id"));
responseData.getUserOptionalFields().setUserIds(List.of(userUuid));
}

if (initData.getUserAddressInformationDesired())
responseData.getUserOptionalFields().setUserAddressInformations(this.retrieveAddress(userDetails,requesterAgencyId));
Expand Down

0 comments on commit 0e6fde5

Please sign in to comment.