DeathGun44 commented on code in PR #6050:
URL: https://github.com/apache/fineract/pull/6050#discussion_r3488191311
##########
integration-tests/src/test/java/org/apache/fineract/integrationtests/client/feign/modules/LoanProductTemplates.java:
##########
@@ -350,8 +458,30 @@ default PostLoanProductsRequest create4IProgressive() {
.principalVariationsForBorrowerCycle(List.of())//
.interestRateVariationsForBorrowerCycle(List.of())//
.numberOfRepaymentVariationsForBorrowerCycle(List.of())//
- .accountingRule(1)//
+ .accountingRule(3)//
.canUseForTopup(false)//
+ .fundSourceAccountId(getLiabilityAccountId("fundSource"))//
+ .loanPortfolioAccountId(getAssetAccountId("loansReceivable"))//
+ .transfersInSuspenseAccountId(getAssetAccountId("suspense"))//
+
.interestOnLoanAccountId(getIncomeAccountId("interestIncome"))//
+ .incomeFromFeeAccountId(getIncomeAccountId("feeIncome"))//
+
.incomeFromPenaltyAccountId(getIncomeAccountId("penaltyIncome"))//
+
.incomeFromRecoveryAccountId(getIncomeAccountId("recoveries"))//
+ .writeOffAccountId(getExpenseAccountId("writtenOff"))//
+
.overpaymentLiabilityAccountId(getLiabilityAccountId("overpayment"))//
+
.receivableInterestAccountId(getAssetAccountId("interestReceivable"))//
+ .receivableFeeAccountId(getAssetAccountId("feeReceivable"))//
+
.receivablePenaltyAccountId(getAssetAccountId("penaltyReceivable"))//
+
.goodwillCreditAccountId(getExpenseAccountId("goodwillExpense"))//
+
.incomeFromGoodwillCreditInterestAccountId(getIncomeAccountId("interestIncomeChargeOff"))//
+
.incomeFromGoodwillCreditFeesAccountId(getIncomeAccountId("feeChargeOff"))//
+
.incomeFromGoodwillCreditPenaltyAccountId(getIncomeAccountId("feeChargeOff"))//
Review Comment:
yes i checked again and this is intentional and matches existing test setup
across the codebase (BaseLoanIntegrationTest, LoanPostChargeOffScenariosTest,
LoanChargeOffAccountingTest, etc.): incomeFromGoodwillCreditPenaltyAccountId
maps to feeChargeOff, while incomeFromChargeOffPenaltyAccountId on the next
line correctly uses penaltyChargeOff. Changing it would diverge from
established charge-off/goodwill journal mappings in the other tests.
##########
integration-tests/src/test/java/org/apache/fineract/integrationtests/client/feign/FeignLoanTestBase.java:
##########
@@ -247,6 +416,30 @@ protected void verifyJournalEntriesSequentially(Long
loanId, LoanTestData.Journa
journalHelper.verifyJournalEntriesSequentially(loanId,
expectedEntries);
}
+ protected LoanTestData.Journal journalEntry(double amount, Account
account, String type) {
+ return "DEBIT".equals(type) ?
LoanTestData.Journal.debit(account.getAccountID().longValue(), amount)
+ :
LoanTestData.Journal.credit(account.getAccountID().longValue(), amount);
+ }
+
+ protected GetLoansLoanIdTransactionsTemplateResponse getPrepayAmount(Long
loanId, String date) {
+ return transactionHelper.getPrepaymentAmount(loanId, date,
LoanTestData.DATETIME_PATTERN);
+ }
+
+ protected Long verifyPrepayAmountByRepayment(Long loanId, String date) {
+ GetLoansLoanIdTransactionsTemplateResponse prepayAmount =
getPrepayAmount(loanId, date);
+ Double amountToPrepayLoan = prepayAmount.getAmount();
+ Long repaymentId = null;
+ if (amountToPrepayLoan != null && amountToPrepayLoan > 0) {
+ PostLoansLoanIdTransactionsResponse repayment =
transactionHelper.makeLoanRepayment(loanId, "repayment", date,
+ amountToPrepayLoan);
+ org.junit.jupiter.api.Assertions.assertNotNull(repayment);
Review Comment:
Done!
--
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]