adamsaghy commented on code in PR #5590:
URL: https://github.com/apache/fineract/pull/5590#discussion_r2995019444


##########
integration-tests/src/test/java/org/apache/fineract/integrationtests/common/fixeddeposit/FixedDepositAccountHelper.java:
##########
@@ -636,4 +639,23 @@ public FixedDepositAccountHelper 
withCharges(List<HashMap<String, String>> charg
         this.charges = charges;
         return this;
     }
+
+    // TODO: Rewrite to use fineract-client instead!
+    @Deprecated(forRemoval = true)
+    public List<GetFixedDepositAccountsTransactions> 
getFixedDepositTransactions(final Integer fixedDepositAccountId) {
+        LOG.info("-------------------- RETRIEVING FIXED DEPOSIT TRANSACTIONS 
---------------------");
+        return 
Calls.ok(FineractClientHelper.getFineractClient().fixedDepositAccounts.retrieveOne20(fixedDepositAccountId.longValue(),
+                false, "all", "transactions")).getTransactions();
+    }
+
+    // Rewritten to use fineract-client 
(FixedDepositAccountTransactionsApi.adjustTransaction)
+    // which maps to POST 
/v1/fixeddepositaccounts/{accountId}/transactions/{transactionId}?command=undo
+    @Deprecated(forRemoval = true)
+    public Integer undoFixedDepositTransaction(final Integer 
fixedDepositAccountId, final Integer transactionId) {
+        LOG.info("--------------------------------- UNDO FIXED DEPOSIT 
TRANSACTION --------------------------------");
+        String response = 
Calls.ok(FineractClientHelper.getFineractClient().fixedDepositAccountTransactions
+                .adjustTransaction(fixedDepositAccountId.longValue(), 
transactionId.longValue(), "undo", "{}"));
+        return new 
com.google.gson.JsonParser().parse(response).getAsJsonObject().get("resourceId").getAsInt();
+    }

Review Comment:
   Drop this parsing. Return the response object.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to