FINERACT-2455: Working Capital - Delinquency Reset#6104
Conversation
|
ddb4601 to
afed7fd
Compare
galovics
left a comment
There was a problem hiding this comment.
0051_delinquency_reset.xml:
<addColumn tableName="m_wc_loan_delinquency_range_schedule">
<column name="reset" type="BOOLEAN" defaultValue="false"/>
</addColumn>No <constraints nullable="false"/> here, and defaultValue="false" should be defaultValueBoolean="false" for a BOOLEAN column. The sibling reset column added on m_wc_loan_breach_schedule in 0049_wc_loan_breach_reset.xml did this correctly (defaultValueBoolean="false" + nullable="false") - same column name, same module, same PR author's own prior art. The code compensates with Objects.equals(p.getReset(), true) null-safety wrappers throughout instead of just being able to trust false.
Also: the changeset ids in this file (1783674691355-1, 1784032201725-1) are raw IDE-generated timestamps instead of the module's wcl-00NN-N convention used everywhere else.
WorkingCapitalDelinquencyRescheduleStepDef.java:
log.info("Periods: {}", periods);Leftover debug log?
fbf4eda to
b067820
Compare
b067820 to
dee78e7
Compare
| LocalDate resetDate = action.getStartDate(); | ||
| final List<WorkingCapitalLoanDelinquencyRangeSchedule> periods = loanDelinquencyRangeScheduleRepository | ||
| .findByLoanIdOrderByPeriodNumberAsc(loan.getId()); | ||
| periods.stream().filter(p -> !Objects.equals(p.getReset(), true) && p.getToDate().isBefore(action.getStartDate())) |
There was a problem hiding this comment.
Would it make sense to replace the in memory filtering for a dedicated query?
| final List<WorkingCapitalLoanDelinquencyRangeSchedule> periods = loanDelinquencyRangeScheduleRepository | ||
| .findByLoanIdOrderByPeriodNumberAsc(loan.getId()); | ||
| periods.stream() | ||
| .filter(p -> Objects.equals(p.getReset(), true) && p.getToDate().isBefore(action.getStartDate()) |
There was a problem hiding this comment.
Would it make sense to replace the in memory filtering for a dedicated query?
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!
Your assigned reviewer(s) will follow our guidelines for code reviews.