ObligationAdmission account not active error message fix

This commit is contained in:
ialbert 2025-07-16 16:45:45 +03:00
parent 097f0c649b
commit 4351fc9ca3

View file

@ -24,11 +24,11 @@ public class AccountActiveValidationRule implements IValidationRule<ImdgValidati
Registry validatedObject = context.getValidatedObject();
Imdg<Account> accImdg = context.obtainMap(IMDGDistributedNames.Map_Account, Account.class);
if (validatedObject.getAccountId() == null) {
return of(ClearingError.AccountNotActive, validatedObject.getAccountId());
return of(ClearingError.AccountNotActive, validatedObject.getAccount());
}
Account account = accImdg.getSingleObjectByID(validatedObject.getAccountId());
if (account == null || (!IEnumKey.contains(account.getStatus(), ServiceStatus.Active, ServiceStatus.Reopened))) {
return of(ClearingError.AccountNotActive, validatedObject.getAccountId());
return of(ClearingError.AccountNotActive, validatedObject.getAccount());
}
return empty();
}