adamsaghy commented on code in PR #5740:
URL: https://github.com/apache/fineract/pull/5740#discussion_r3123362787


##########
fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/serialization/WorkingCapitalLoanApplicationDataValidator.java:
##########
@@ -592,17 +594,34 @@ private void validateOverridables(final JsonElement 
element, final DataValidator
                         .failWithCode("override.not.allowed.by.product");
             }
         }
+        Long breachId = null;
         if 
(this.fromApiJsonHelper.parameterExists(WorkingCapitalLoanProductConstants.breachIdParamName,
 element)) {
             if (config.isBreach()) {
-                final Long breachId = 
this.fromApiJsonHelper.extractLongNamed(WorkingCapitalLoanProductConstants.breachIdParamName,
-                        element);
+                breachId = 
this.fromApiJsonHelper.extractLongNamed(WorkingCapitalLoanProductConstants.breachIdParamName,
 element);
                 
baseDataValidator.reset().parameter(WorkingCapitalLoanProductConstants.breachIdParamName).value(breachId).ignoreIfNull()
                         .longGreaterThanZero();
             } else {
                 
baseDataValidator.reset().parameter(WorkingCapitalLoanProductConstants.breachIdParamName)
                         .failWithCode("override.not.allowed.by.product");
             }
         }
+        if 
(this.fromApiJsonHelper.parameterExists(WorkingCapitalLoanProductConstants.nearBreachIdParamName,
 element)) {

Review Comment:
   Can you please rework this part? if breach is lifted, near breach should 
also be lifted! We cannot have near breach configured if breach is not 
configured.
   
   Also if breach is changed, we need to validate the near-breach against the 
changes not the original.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to