Skip to content

Commit

Permalink
PR-1861 Add user UUID and fee UUID to response (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
JanisSaldabols authored Aug 5, 2024
1 parent e298ae4 commit 9a31975
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib-ncip-cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.olf.rs</groupId>
<artifactId>lib-ncip-cli</artifactId>
<version>0.23.18</version>
<version>0.23.19</version>
<name>lib-ncip-cli</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
2 changes: 1 addition & 1 deletion lib-ncip-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.olf.rs</groupId>
<artifactId>lib-ncip-client</artifactId>
<version>0.23.18</version>
<version>0.23.19</version>
<name>NCIP Client</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,10 @@ public JSONObject constructResponseNcip2Response(NCIPResponseData responseData)
}
JSONObject returnJson = new JSONObject();
if (transResponseData.getUserId() != null) {
returnJson.put("userId", transResponseData.getUserId().getUserIdentifierValue());
returnJson.put("userUuid", transResponseData.getUserId().getUserIdentifierValue());
}
if (transResponseData.getFiscalTransactionReferenceId() != null) {
returnJson.put("feeUuid", transResponseData.getFiscalTransactionReferenceId().getFiscalTransactionIdentifierValue());
}
return returnJson;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import org.extensiblecatalog.ncip.v2.service.CreateUserFiscalTransactionInitiationData;
import org.extensiblecatalog.ncip.v2.service.CreateUserFiscalTransactionResponseData;
import org.extensiblecatalog.ncip.v2.service.DeleteItemResponseData;
import org.extensiblecatalog.ncip.v2.service.FiscalTransactionReferenceId;
import org.extensiblecatalog.ncip.v2.service.Problem;
import org.extensiblecatalog.ncip.v2.service.ProblemType;
import org.extensiblecatalog.ncip.v2.service.UserId;
Expand All @@ -22,9 +23,13 @@ public void testConstructNcip2Response() {
CreateUserFiscalTransactionResponseData responseData = new CreateUserFiscalTransactionResponseData();
UserId userId = new UserId();
userId.setUserIdentifierValue("123");
FiscalTransactionReferenceId fiscalTransactionReferenceId = new FiscalTransactionReferenceId();
fiscalTransactionReferenceId.setFiscalTransactionIdentifierValue("f123");
responseData.setFiscalTransactionReferenceId(fiscalTransactionReferenceId);
responseData.setUserId(userId);
JSONObject jsonObject = createUserFiscalTransaction.constructResponseNcip2Response(responseData);
assertEquals(jsonObject.getString("userId"), "123");
assertEquals(jsonObject.getString("userUuid"), "123");
assertEquals(jsonObject.getString("feeUuid"), "f123");
}

@Test
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.olf.rs</groupId>
<version>0.23.18</version>
<version>0.23.19</version>
<artifactId>lib-ncip-client-proj</artifactId>
<packaging>pom</packaging>
<name>lib-ncip-client-proj</name>
Expand Down

0 comments on commit 9a31975

Please sign in to comment.