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


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/DepositAccountDataValidator.java:
##########
@@ -582,6 +604,33 @@ private void validateDepositTermDeatilForUpdate(final 
JsonElement element, final
         }
     }
 
+    private void validateForInterestCalc(final JsonElement element, final 
DataValidatorBuilder baseDataValidator) {
+
+        Long principalAmount = 
this.fromApiJsonHelper.extractLongNamed(principalAmountParamName, element);
+        
baseDataValidator.reset().parameter(principalAmountParamName).value(principalAmount).notNull();

Review Comment:
   You dont need 2 of these validations. You can chain them together:
   ```
   
baseDataValidator.reset().parameter(principalAmountParamName).value(principalAmount).notNull().longGreaterThanZero();
   ```



-- 
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