-
Notifications
You must be signed in to change notification settings - Fork 0
CRED-213: Adds next instalment due date to loan accounts data #97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
CRED-213: Adds next instalment due date to loan accounts data #97
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds next installment due date functionality to loan accounts data by implementing a new field that tracks the next unpaid installment date for active loans.
- Adds SQL query logic to calculate the next installment due date for active loans (status 200, 300)
- Introduces a new constant for the next installment date field
- Maps the calculated date to the loan account summary data object
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
CredXAccountDetailsReadPlatformServiceJpaRepositoryImpl.java | Adds SQL query to calculate next installment date and maps it to the account summary data |
AccountDataAdditionalProperties.java | Defines constant for the new next installment date field |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Remove the empty line 187. It adds unnecessary whitespace to the code.
Copilot uses AI. Check for mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
run this command to fix code violations
./gradlew :custom:crediblex:portfolio:accountdetails:spotlessApply
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
.append(" CASE WHEN l.loan_status_id IN (200, 300) THEN ") | ||
.append(" (SELECT MIN(rps.duedate) FROM m_loan_repayment_schedule rps ").append(" WHERE rps.loan_id = l.id ") | ||
.append(" AND (rps.completed_derived = false OR rps.completed_derived IS NULL)) ") | ||
.append(" ELSE NULL END as nextInstalmentDate") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The hardcoded loan status values (200, 300) should be replaced with named constants or enums to improve code maintainability and reduce magic numbers.
Copilot uses AI. Check for mistakes.
public static String IS_FORCED_CLOSURE = "isForcedClosure"; | ||
public static String IS_RESTRUCTURED = "isRestructured"; | ||
public static String DAYS_PAST_DUE = "daysPastDue"; | ||
public static String NEXT_INSTALMENT_DATE = "nextInstalmentDate"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The field should be declared as final
to prevent accidental modification since it's intended to be a constant.
Copilot uses AI. Check for mistakes.
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 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.