FINERACT-1091: Adding validation for constitution ID (#1189)

Co-authored-by: Michael Vorburger ⛑️ <mike@vorburger.ch>
This commit is contained in:
Petri Tuomola
2020-07-19 15:49:32 +02:00
committed by GitHub
co-authored by Michael Vorburger ⛑️
parent ec9513c3c7
commit 6ee3ff2452
@@ -113,6 +113,11 @@ public class ClientNonPerson extends AbstractPersistableCustom {
final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
validateIncorpValidityTillDate(client, dataValidationErrors);
if (this.constitution == null) {
dataValidationErrors.add(ApiParameterError.parameterError("error.msg.clients.constitutionid.is.null", "Constitution ID may not be null",
ClientApiConstants.constitutionIdParamName));
}
if (!dataValidationErrors.isEmpty()) {
throw new PlatformApiDataValidationException(dataValidationErrors);
}