Skip to content

Conversation

@mariiaKraievska
Copy link
Contributor

Description

Describe the changes made and why they were made. (Ignore if these details are present on the associated Apache Fineract JIRA ticket.)

Checklist

Please make sure these boxes are checked before submitting your pull request - thanks!

  • Write the commit message as per our guidelines
  • Acknowledge that we will not review PRs that are not passing the build ("green") - it is your responsibility to get a proposed PR to pass the build, not primarily the project's maintainers.
  • Create/update unit or integration tests for verifying the changes made.
  • Follow our coding conventions.
  • Add required Swagger annotation and update API documentation at fineract-provider/src/main/resources/static/legacy-docs/apiLive.htm with details of any API changes
  • This PR must not be a "code dump". Large changes can be made in a branch, with assistance. Ask for help on the developer mailing list.

Your assigned reviewer(s) will follow our guidelines for code reviews.

@mariiaKraievska mariiaKraievska force-pushed the FINERACT-2354/reaging-with-default-behaviour-accrual-and-accrual-activity-handling branch 2 times, most recently from 0c6592e to 9fb0aeb Compare December 24, 2025 14:46
@MarianaDmytrivBinariks MarianaDmytrivBinariks force-pushed the FINERACT-2354/reaging-with-default-behaviour-accrual-and-accrual-activity-handling branch from 9fb0aeb to 7281e99 Compare December 24, 2025 15:13
@adamsaghy adamsaghy marked this pull request as ready for review December 26, 2025 18:23
@adamsaghy
Copy link
Contributor

@mariiaKraievska Please rebase

private void calculateAccrualActivity(LoanTransaction loanTransaction, MonetaryCurrency currency,
List<LoanRepaymentScheduleInstallment> installments) {

private boolean calculateAccrualActivity(LoanTransaction loanTransaction, MonetaryCurrency currency,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function has cognitive complexity of 27, it should be broken down to smaller functions

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@adamsaghy adamsaghy force-pushed the FINERACT-2354/reaging-with-default-behaviour-accrual-and-accrual-activity-handling branch from 7281e99 to 81450a0 Compare January 3, 2026 00:43
@mariiaKraievska mariiaKraievska force-pushed the FINERACT-2354/reaging-with-default-behaviour-accrual-and-accrual-activity-handling branch from 81450a0 to a8762c4 Compare January 5, 2026 08:49
Copy link
Contributor

@Aman-Mittal Aman-Mittal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On Technical Level Seems OK

@mariiaKraievska mariiaKraievska force-pushed the FINERACT-2354/reaging-with-default-behaviour-accrual-and-accrual-activity-handling branch from a8762c4 to 1fd4ade Compare January 8, 2026 09:11
@adamsaghy adamsaghy force-pushed the FINERACT-2354/reaging-with-default-behaviour-accrual-and-accrual-activity-handling branch from 1fd4ade to 98691af Compare January 8, 2026 12:33

@Override
public void recalculateAccrualActivityTransaction(Loan loan, ChangedTransactionDetail changedTransactionDetail) {
public void recalculateAccrualActivityTransaction(Loan loan, ChangedTransactionDetail changedTransactionDetail,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's rework it without loan transactions argument and without reaging handling.
Accrual activities should be compared only with loan installments.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

throw new IllegalStateException("Expected an AdvancedPaymentScheduleTransactionProcessor");
}
if (installment.isAdditional() || installment.isDownPayment() || installment.isReAged()) {
if (installment.isAdditional() || installment.isDownPayment() || (installment.isReAged() && loanReAgeParameter != null
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

//TODO: Remove installment.isReAged() once EQUAL AMORTIZATION is implemented

final LoanTransaction reAgeTransaction = loan.findReAgeTransaction();
final LoanReAgeParameter loanReAgeParameter = reAgeTransaction != null ? reAgeTransaction.getLoanReAgeParameter() : null;

if (installment.isAdditional() || (installment.isReAged() && loanReAgeParameter != null
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

//TODO: Remove installment.isReAged() once EQUAL AMORTIZATION is implemented

Copy link
Contributor

@adamsaghy adamsaghy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kindly see my review!

@mariiaKraievska mariiaKraievska force-pushed the FINERACT-2354/reaging-with-default-behaviour-accrual-and-accrual-activity-handling branch from 98691af to a06684e Compare January 9, 2026 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants