FINERACT-2311: Buy Down fees - External business events

- buy down fee reversal fix
- added more listeners for buy down fee amortization on closed loans
This commit is contained in:
adam.magyari
2025-08-06 13:53:04 +02:00
committed by Adam Saghy
parent aa68f251d3
commit 6a198de0cc
17 changed files with 223 additions and 287 deletions
@@ -172,16 +172,15 @@ public final class ErrorMessageHelper {
}
public static String addCapitalizedIncomeUndoFailureTransactionTypeNonReversal() {
return "Only (non-reversed) transactions of type repayment, waiver, accrual, credit balance refund, capitalized income, capitalized income adjustment or buy down fee adjustment can be adjusted.";
return "Only (non-reversed) transactions of type repayment, waiver, accrual, credit balance refund, capitalized income, capitalized income adjustment, buy down fee or buy down fee adjustment can be adjusted.";
}
public static String addCapitalizedIncomeUndoFailureAdjustmentExists() {
return "Capitalized income transaction cannot be reversed when non-reversed adjustment exists for it.";
}
public static String buyDownFeeUndoFailureAdjustmentExists(Long loanId) {
String loanIdStr = String.valueOf(loanId);
return String.format("Undo Loan Transaction: %s is not allowed. Loan transaction has not reversed transaction related", loanIdStr);
public static String buyDownFeeUndoFailureAdjustmentExists() {
return "Buy down fee transaction cannot be reversed when non-reversed adjustment exists for it.";
}
public static String wrongAmountInRepaymentSchedule(int line, BigDecimal actual, BigDecimal expected) {
@@ -539,8 +539,7 @@ public class LoanRepaymentStepDef extends AbstractStepDef {
Response<PostLoansLoanIdTransactionsResponse> transactionUndoResponse = loanTransactionsApi
.adjustLoanTransaction(loanId, targetTransaction.getId(), transactionUndoRequest, "").execute();
if (transactionType.equals("Buy Down Fee")) {
checkMakeTransactionForbidden(transactionUndoResponse, 403,
ErrorMessageHelper.buyDownFeeUndoFailureAdjustmentExists(targetTransaction.getId()));
checkMakeTransactionForbidden(transactionUndoResponse, 403, ErrorMessageHelper.buyDownFeeUndoFailureAdjustmentExists());
} else if (transactionType.equals("Capitalized Income")) {
checkMakeTransactionForbidden(transactionUndoResponse, 403,
ErrorMessageHelper.addCapitalizedIncomeUndoFailureAdjustmentExists());