somasorosdpc commented on code in PR #4098:
URL: https://github.com/apache/fineract/pull/4098#discussion_r1800705311


##########
integration-tests/src/test/java/org/apache/fineract/integrationtests/ExternalBusinessEventTest.java:
##########
@@ -149,6 +152,39 @@ public void 
testExternalBusinessEventLoanBalanceChangedBusinessEventOnMultiDisbu
         });
     }
 
+    @Test
+    public void 
verifyInterestRefundPostBusinessEventCreatedForMerchantIssuedRefundWithInterestRefund()
 {
+        AtomicReference<Long> loanIdRef = new AtomicReference<>();
+        enableLoanInterestRefundPstBusinessEvent(true);
+        runAt("1 January 2021", () -> {
+            PostLoanProductsResponse loanProduct = loanProductHelper
+                    
.createLoanProduct(create4IProgressive().daysInMonthType(DaysInMonthType.ACTUAL)
 //
+                            .daysInYearType(DaysInYearType.ACTUAL) //
+                            .supportedInterestRefundTypes(new 
ArrayList<>()).addSupportedInterestRefundTypesItem("MERCHANT_ISSUED_REFUND") //
+                            
.recalculationRestFrequencyType(RecalculationRestFrequencyType.DAILY) //
+            );
+            Long loanId = applyAndApproveProgressiveLoan(client.getClientId(), 
loanProduct.getResourceId(), "1 January 2021", 1000.0, 9.99,
+                    12, null);
+            Assertions.assertNotNull(loanId);
+            loanIdRef.set(loanId);
+            disburseLoan(loanId, BigDecimal.valueOf(1000), "1 January 2021");
+        });
+        runAt("22 January 2021", () -> {
+            Long loanId = loanIdRef.get();
+
+            deleteAllExternalEvents();
+
+            PostLoansLoanIdTransactionsResponse 
postLoansLoanIdTransactionsResponse = loanTransactionHelper
+                    .makeLoanRepayment("MerchantIssuedRefund", "22 January 
2021", 1000F, loanId.intValue());
+            Assertions.assertNotNull(postLoansLoanIdTransactionsResponse);
+            
Assertions.assertNotNull(postLoansLoanIdTransactionsResponse.getResourceId());
+
+            verifyLoanTransactionBusinessEvents(
+                    new 
BusinessEvent("LoanTransactionInterestRefundPostBusinessEvent", "22 January 
2021", null, 1000.0, 0.0));

Review Comment:
   its the disbursed amount and outstanding amounts. By the way I've refactored 
the validation, so now it is more accurate for post transaction business events.



-- 
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