Skip to content

Commit

Permalink
FINERACT-2081: Chargeback reverse replay fails fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ruchiD committed May 28, 2024
1 parent 53f4864 commit 662fe05
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -576,10 +576,23 @@ private void processSingleTransaction(LoanTransaction loanTransaction, MonetaryC
newLoanTransaction.getLoanTransactionToRepaymentScheduleMappings());
} else {
createNewTransaction(loanTransaction, newLoanTransaction, changedTransactionDetail);
checkAndUpdateReplayedChargebackRelationWithReplayedTransaction(loanTransaction, newLoanTransaction, ctx);
}
}
}

private void checkAndUpdateReplayedChargebackRelationWithReplayedTransaction(LoanTransaction loanTransaction,
LoanTransaction newLoanTransaction, TransactionCtx ctx) {
// if chargeback is getting reverse-replayed
// find replayed transaction with CHARGEBACK relation with reversed chargeback transaction
// for replayed transaction, add relation to point to new Chargeback transaction
if (loanTransaction.getTypeOf().isChargeback()) {
LoanTransaction originalTransaction = findOriginalTransaction(newLoanTransaction, ctx);
originalTransaction.getLoanTransactionRelations()
.add(LoanTransactionRelation.linkToTransaction(originalTransaction, newLoanTransaction, CHARGEBACK));
}
}

private void processSingleCharge(LoanCharge loanCharge, MonetaryCurrency currency, List<LoanRepaymentScheduleInstallment> installments,
LocalDate disbursementDate) {
loanChargeProcessor.reprocess(currency, disbursementDate, installments, loanCharge);
Expand Down

0 comments on commit 662fe05

Please sign in to comment.