session step 3 (ObligationAdmission) - [account is active validation] NLP bugfix
This commit is contained in:
parent
e45d499555
commit
c35ac0d44c
1 changed files with 3 additions and 0 deletions
|
|
@ -23,6 +23,9 @@ public class AccountActiveValidationRule implements IValidationRule<ImdgValidati
|
|||
public Optional<EnumMessage> validate(ImdgValidationContext<Registry> context) {
|
||||
Registry validatedObject = context.getValidatedObject();
|
||||
Imdg<Account> accImdg = context.obtainMap(IMDGDistributedNames.Map_Account, Account.class);
|
||||
if (validatedObject.getAccountId() == null) {
|
||||
return of(ClearingError.AccountNotActive, validatedObject.getAccountId());
|
||||
}
|
||||
Account account = accImdg.getSingleObjectByID(validatedObject.getAccountId());
|
||||
if (account == null || (!IEnumKey.contains(account.getStatus(), ServiceStatus.Active, ServiceStatus.Reopened))) {
|
||||
return of(ClearingError.AccountNotActive, validatedObject.getAccountId());
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue