Skip to content

Conversation

alberto-art3ch
Copy link
Contributor

Description

User should be able to configure Interest handling types while doing re-age on Interest bearing loans (both from UI and API)

Options should be

  • Default Behavior
  • Waive Interest
  • Equal Amortization

FINERACT-2364

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.

@alberto-art3ch alberto-art3ch force-pushed the FINERACT-2354/re-aging-for-interest-bearing-products branch from fd295e8 to 2819d71 Compare September 23, 2025 04:22
return Arrays.stream(values()).map(v -> new EnumOptionData((long) (v.ordinal() + 1), v.name(), v.getHumanReadableName())).toList();
}

public EnumOptionData asEnumOptionData() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Use StringEnumOptionData please

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! Type updated

Comment on lines 38 to 43
<changeSet author="fineract" id="3">
<sql>
UPDATE m_loan_reage_parameter SET interest_handling_type = 'DEFAULT'
WHERE interest_handling_type IS NULL
</sql>
</changeSet>
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 need this. default value already set and interest_handling_type is not nullable.

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! XML file updated

@alberto-art3ch alberto-art3ch force-pushed the FINERACT-2354/re-aging-for-interest-bearing-products branch from 2819d71 to fb6aa16 Compare September 24, 2025 16:21
@RequiredArgsConstructor
public enum LoanReAgeInterestHandlingType {

DEFAULT("Default"), //
Copy link
Contributor

Choose a reason for hiding this comment

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

Add "code" field which is String and has the value of "LoanReAgeInterestHandlingType.default", "LoanReAgeInterestHandlingType.waiveInterest", etc.

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! code attribute added

@alberto-art3ch alberto-art3ch force-pushed the FINERACT-2354/re-aging-for-interest-bearing-products branch from fb6aa16 to 47a6570 Compare September 29, 2025 23:00
Comment on lines 928 to 1028
if (reAgeInterestHandling == null) {
reAgeInterestHandling = LoanReAgeInterestHandlingType.DEFAULT.name();
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need this? if not reage interest handling was provided, still the request should be accepted and consider it as "DEFAULT" (as fallback value)

@adamsaghy adamsaghy force-pushed the FINERACT-2354/re-aging-for-interest-bearing-products branch 2 times, most recently from a34eac0 to 81758d5 Compare September 30, 2025 10:26
@alberto-art3ch alberto-art3ch force-pushed the FINERACT-2354/re-aging-for-interest-bearing-products branch from 81758d5 to 181fc02 Compare October 6, 2025 12:44
</changeSet>
<changeSet author="fineract" id="3">
<addColumn tableName="m_loan_reage_parameter">
<column defaultValueComputed="NULL" name="reage_reason_code_value_id" type="BIGINT"/>
Copy link
Contributor

Choose a reason for hiding this comment

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

I was wrong here: since the m_code_value.id is INT, we cannot use different data type in m_loan_reage_parameter and having FK. Unfortunately it must be modified to be INT for now :/

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! XML file updated

@alberto-art3ch alberto-art3ch force-pushed the FINERACT-2354/re-aging-for-interest-bearing-products branch 6 times, most recently from ec74a60 to 0e2905f Compare October 14, 2025 18:21
@adamsaghy adamsaghy force-pushed the FINERACT-2354/re-aging-for-interest-bearing-products branch from 0e2905f to b00712e Compare October 15, 2025 08:20
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.

LGTM

@adamsaghy adamsaghy merged commit b9e6f21 into apache:develop Oct 15, 2025
42 of 43 checks passed
@adamsaghy adamsaghy deleted the FINERACT-2354/re-aging-for-interest-bearing-products branch October 15, 2025 09:38
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