You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by "adamsaghy (via GitHub)" <gi...@apache.org> on 2024/09/01 22:44:27 UTC
Re: [PR] FINERACT-2081: Validation error in mandatory loan account parameters [fineract]
adamsaghy commented on code in PR #4042:
URL: https://github.com/apache/fineract/pull/4042#discussion_r1740207119
##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/serialization/LoanApplicationValidator.java:
##########
@@ -2127,4 +2139,25 @@ public static void validateOrThrow(String resource, Consumer<DataValidatorBuilde
dataValidationErrors);
}
}
+
+ private void setOfficeId(Long officeId, Client client, Group group) {
+ if (client != null) {
+ officeId = client.getOffice().getId();
+ }
+ if (group != null) {
+ officeId = group.getOffice().getId();
+ }
+
+ if (officeId == null) {
Review Comment:
I dont really understand why should we throw `clientId` is mandatory if the `officeId` is null. Please review this logic and rewrite to be more straightforward... also setOfficeId method which does not set anything is weird.
Also please be aware if you override the officeId inside this method it does absolutely no any effect outside of this method...
--
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