Skip to content

FINERACT-2148: Accrual handling in case of Charged-off loan - #4350

Merged
adamsaghy merged 1 commit into
apache:developfrom
openMF:FINERACT-2333/accrual-handling-in-case-of-charged-off-loan
Mar 3, 2025
Merged

FINERACT-2148: Accrual handling in case of Charged-off loan#4350
adamsaghy merged 1 commit into
apache:developfrom
openMF:FINERACT-2333/accrual-handling-in-case-of-charged-off-loan

Conversation

@mariiaKraievska

Copy link
Copy Markdown
Contributor

Description

Accrual handling in case of Charged-off loan

Checklist

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

  • Write the commit message as per https://github.com/apache/fineract/#pull-requests

  • 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 coding conventions at https://cwiki.apache.org/confluence/display/FINERACT/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

  • Submission is not a "code dump". (Large changes can be made "in repository" via a branch. Ask on the developer mailing list for guidance, if required.)

FYI our guidelines for code reviews are at https://cwiki.apache.org/confluence/display/FINERACT/Code+Review+Guide.

}
}

private BigDecimal getInterestTillChargeOffForPeriod(final Loan loan, final LocalDate chargeOffDate) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This seems not correct for progressive loans...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

loanTransactionValidator.validateLoanRescheduleDate(loan);
}

private void createMissingAccrualTransactionIfNeeded(final BigDecimal newInterest, final Loan loan, final LocalDate chargeOffDate) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Would it make sense to move this into the LoanAccrualProcessingService?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I considered moving this logic into the LoanAccrualProcessingService, but unfortunately, it wasn't feasible. Doing so introduces a circular dependency issue, making it impossible to use the service within the AdvancedPaymentScheduleTransactionProcessor. Therefore, I decided to move it in the AdvancedPaymentScheduleTransactionProcessor.

final List<Long> existingReversedTransactionIds = loan.findExistingReversedTransactionIds();

final LoanChargeOffBehaviour chargeOffBehaviour = loan.getLoanProductRelatedDetail().getChargeOffBehaviour();
if (loan.isProgressiveSchedule()) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This should not be created only for progressive loans... We can create the missing accrual for cumulative loans as well...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

@mariiaKraievska
mariiaKraievska force-pushed the FINERACT-2333/accrual-handling-in-case-of-charged-off-loan branch from 1e3b80d to 9342585 Compare February 24, 2025 10:07
@mariiaKraievska

Copy link
Copy Markdown
Contributor Author

PTAL

@mariiaKraievska
mariiaKraievska force-pushed the FINERACT-2333/accrual-handling-in-case-of-charged-off-loan branch 2 times, most recently from b3d8a39 to fe5e6d6 Compare February 24, 2025 10:56

@somasorosdpc somasorosdpc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@mariiaKraievska
mariiaKraievska force-pushed the FINERACT-2333/accrual-handling-in-case-of-charged-off-loan branch from fe5e6d6 to 73eabd2 Compare February 24, 2025 15:13
@mariiaKraievska

Copy link
Copy Markdown
Contributor Author

Please, consider this PR as a draft, because there are no tests from qa yet.

@adamsaghy
adamsaghy marked this pull request as draft February 25, 2025 16:05
@mariiaKraievska
mariiaKraievska force-pushed the FINERACT-2333/accrual-handling-in-case-of-charged-off-loan branch 4 times, most recently from f1931f6 to 1bf0f24 Compare February 27, 2025 15:04
@peter-kovacs-dpc
peter-kovacs-dpc force-pushed the FINERACT-2333/accrual-handling-in-case-of-charged-off-loan branch from 1bf0f24 to ab5ea03 Compare February 28, 2025 08:48
@adamsaghy
adamsaghy marked this pull request as ready for review February 28, 2025 09:27
@mariiaKraievska
mariiaKraievska force-pushed the FINERACT-2333/accrual-handling-in-case-of-charged-off-loan branch from ab5ea03 to 28eb8c4 Compare February 28, 2025 11:11
@mariiaKraievska
mariiaKraievska force-pushed the FINERACT-2333/accrual-handling-in-case-of-charged-off-loan branch from 28eb8c4 to 9665028 Compare February 28, 2025 15:55
@adamsaghy
adamsaghy merged commit f0cc697 into apache:develop Mar 3, 2025
@adamsaghy
adamsaghy deleted the FINERACT-2333/accrual-handling-in-case-of-charged-off-loan branch March 3, 2025 15:30
@mariiaKraievska mariiaKraievska changed the title FINERACT-2333: Accrual handling in case of Charged-off loan FINERACT-2148: Accrual handling in case of Charged-off loan Mar 3, 2025
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.

3 participants