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


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/serialization/LoanApplicationValidator.java:
##########
@@ -466,6 +469,9 @@ private void validateForCreate(final JsonElement element) {
                     
.extractLocalDateNamed(LoanApiConstants.expectedDisbursementDateParameterName, 
element);
             
baseDataValidator.reset().parameter(LoanApiConstants.expectedDisbursementDateParameterName).value(expectedDisbursementDate)
                     .notNull();
+            if (expectedDisbursementDate == null) {

Review Comment:
   Let me join to the conversation. Before the changes there were validations 
all over the place, "randomly" through the lifecycle of an action: 
   - Some validations for repayment when the service was called first steps
   - Some validations in the loan
   - Some validations later in the service call
   etc.
   
   It was started to rearrange for a couple actions (like loan creation, 
approval, disbursal) but seems one of the validations type was just collecting 
"validations issues" in a list and at the end it was evaluated and all errors 
were thrown eith Http 400.
   
   Now all the validations are in one place seems they got mixed and there were 
some validations that were throwing http 403 (domain rule exceptions) and this 
kind of error is immediately thrown, not collected.
   
   To avoid breaking changes our intention was to not change any of the 
"legacy" validations and which exception is to bethrown, but unfortunately 
there was some regression (see Alberto's reply), so now his intention is to 
handle it.
   
   On long run it would be best to have a conversarion on the DEV mail list 
regarding exception handling but for now, we are aiming to fix the regression.
   
   i hope it helps to gain some extra insight.



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