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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]