Skip to content

FINERACT-2464: Refactor LoanScheduleAssembler logic extraction#5438

Open
Saifulhuq01 wants to merge 1 commit intoapache:developfrom
Saifulhuq01:refactor-loan-schedule-logic-v2
Open

FINERACT-2464: Refactor LoanScheduleAssembler logic extraction#5438
Saifulhuq01 wants to merge 1 commit intoapache:developfrom
Saifulhuq01:refactor-loan-schedule-logic-v2

Conversation

@Saifulhuq01
Copy link
Contributor

@Saifulhuq01 Saifulhuq01 commented Feb 3, 2026

Description

Refactored LoanScheduleAssembler.java to improve code readability and maintainability extracting inline logic into a helper method.

Currently, the assembleLoanScheduleFrom method contains mixed logic for creating the LoanScheduleGenerator and handling "Equal Amortization" updates. This violates the Single Responsibility Principle and increases cogniive load.

Resolves FINERACT-2464.

Changes

  • Extracted the "Equal Amortization" interest update logic into a new private helper method: updateInterestForEqualAmortization.
  • Simplified the conditional flow in assembleLoanScheduleFrom.
  • Removed redundant initialization of loanScheduleGenerator.

Checklist

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

  • Commit message follows guidelines
  • Coding conventions followed
  • Build is passing locally

@Saifulhuq01 Saifulhuq01 force-pushed the refactor-loan-schedule-logic-v2 branch from 436d78e to 328f07e Compare February 3, 2026 08:01

LoanScheduleGenerator loanScheduleGenerator = this.loanScheduleFactory.create(loanApplicationTerms.getLoanScheduleType(),
loanApplicationTerms.getInterestMethod());
// REFACTORED: Removed redundant initialization and extracted logic
Copy link
Contributor

Choose a reason for hiding this comment

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

We dont want such comments. Please remove

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We dont want such comments. Please remove

done @adamsaghy kindly check

@Saifulhuq01 Saifulhuq01 force-pushed the refactor-loan-schedule-logic-v2 branch from 328f07e to ee1e058 Compare February 6, 2026 10:25
@Saifulhuq01 Saifulhuq01 requested a review from adamsaghy February 6, 2026 10:28
@Saifulhuq01 Saifulhuq01 force-pushed the refactor-loan-schedule-logic-v2 branch from ee1e058 to 3ea2678 Compare February 8, 2026 07:44
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.

2 participants