adamsaghy commented on code in PR #3791:
URL: https://github.com/apache/fineract/pull/3791#discussion_r1535297134
##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/DepositAccountDataValidator.java:
##########
@@ -606,9 +606,9 @@ 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();
-
baseDataValidator.reset().parameter(principalAmountParamName).value(principalAmount).longGreaterThanZero();
+ BigDecimal principalAmount =
this.fromApiJsonHelper.extractBigDecimalWithLocaleNamed(principalAmountParamName,
element);
+
baseDataValidator.reset().parameter(principalAmountParamName).value(principalAmount).notNull()
+ .notLessThanMin(BigDecimal.valueOf(0));
Review Comment:
This can be changed to GreaterThanZero or isPositiveAmount. Accepting 0
principal seems not valid.
--
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]