You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by "airajena (via GitHub)" <gi...@apache.org> on 2026/03/01 10:07:38 UTC

[PR] FINERACT-1597: Fix validation error for well-formed term deposit chart slabs [fineract]

airajena opened a new pull request, #5565:
URL: https://github.com/apache/fineract/pull/5565

   ## Summary
   This PR fixes a validation bug where updating/creating term deposit products with valid chart slabs could fail with:
   
   `validation.msg.recurringdeposit.chart.slabs.range.end.incorrect`
   
   The issue appeared for well-formed terminal slabs (for example: `fromPeriod=0`, `toPeriod=3`).
   
   ## Root Cause
   Chart slab validation in `InterestRateChart.validateChartSlabs(...)` treated certain end-range values as invalid even when there was no subsequent slab requiring continuity validation.
   
   ## Changes
   - Removed incorrect end-range validation branches
   - Removed obsolete helper method no longer used by validation
   
   ## Scope
   - No API contract changes
   - No schema/Liquibase changes
   - No behavior changes outside chart slab validation in term deposit interest chart domain
   
   ## Validation
   Executed locally:
   - `./gradlew :fineract-savings:test --tests org.apache.fineract.portfolio.interestratechart.domain.InterestRateChartValidationTest` 
   - `./gradlew spotlessApply spotbugsMain spotbugsTest checkstyleMain checkstyleTest` 
   
   ## Risk
   Low.  
   Changes are localized to chart validation logic + one focused regression test.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-1597: Fix validation error for well-formed term deposit chart slabs [fineract]

Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy merged PR #5565:
URL: https://github.com/apache/fineract/pull/5565


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-1597: Fix validation error for well-formed term deposit chart slabs [fineract]

Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #5565:
URL: https://github.com/apache/fineract/pull/5565#discussion_r2874561187


##########
fineract-savings/src/main/java/org/apache/fineract/portfolio/interestratechart/domain/InterestRateChart.java:
##########
@@ -177,9 +177,6 @@ public void validateChartSlabs(DataValidatorBuilder baseDataValidator) {
 
                     }
                 }
-            } else if (iSlabs.slabFields().isNotProperPriodEnd()) {

Review Comment:
   why is this removed? it was incorrect?



##########
fineract-savings/src/main/java/org/apache/fineract/portfolio/interestratechart/domain/InterestRateChartSlabFields.java:
##########
@@ -247,11 +247,6 @@ public static boolean isNotProperPeriodStart(InterestRateChartSlabFields interes
                 && !(interestRateChartSlabFields.fromPeriod.equals(1) || interestRateChartSlabFields.fromPeriod.equals(0));
     }
 
-    public boolean isNotProperPriodEnd() {

Review Comment:
   why is this removed? was it incorrect?



##########
fineract-savings/src/main/java/org/apache/fineract/portfolio/interestratechart/domain/InterestRateChart.java:
##########
@@ -177,9 +177,6 @@ public void validateChartSlabs(DataValidatorBuilder baseDataValidator) {
 
                     }
                 }
-            } else if (iSlabs.slabFields().isNotProperPriodEnd()) {

Review Comment:
   why is this removed? was it incorrect?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-1597: Fix validation error for well-formed term deposit chart slabs [fineract]

Posted by "airajena (via GitHub)" <gi...@apache.org>.
airajena commented on code in PR #5565:
URL: https://github.com/apache/fineract/pull/5565#discussion_r2881797749


##########
fineract-savings/src/main/java/org/apache/fineract/portfolio/interestratechart/domain/InterestRateChart.java:
##########
@@ -177,9 +177,6 @@ public void validateChartSlabs(DataValidatorBuilder baseDataValidator) {
 
                     }
                 }
-            } else if (iSlabs.slabFields().isNotProperPriodEnd()) {

Review Comment:
   To be clear, I removed that intentionally because that branch effectively became unreachable after we tightened the slab-range validation. Previously, isNotProperPriodEnd() acted as a bit of a fallback safety net. But with the way the validation flow works now, we’re validating period bounds (consistency between fromPeriod and toPeriod) much earlier. On top of that, the slab ordering and continuity checks already catch and reject any invalid end-period combinations. The issue was that keeping that extra check actually started tripping up and rejecting valid edge cases—specifically when toPeriod is open-ended or derived by the chart boundaries. So, the goal was really to get rid of duplicate/conflicting validation rather than relaxing the rules.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org