in service/src/main/java/org/apache/fineract/cn/accounting/service/internal/service/AccountService.java [146:164]
public List<AccountCommand> getActions(final String identifier) {
final AccountEntity accountEntity = this.accountRepository.findByIdentifier(identifier);
final ArrayList<AccountCommand> commands = new ArrayList<>();
final Account.State state = Account.State.valueOf(accountEntity.getState());
switch (state) {
case OPEN:
commands.add(this.buildCommand(AccountCommand.Action.LOCK));
commands.add(this.buildCommand(AccountCommand.Action.CLOSE));
break;
case LOCKED:
commands.add(this.buildCommand(AccountCommand.Action.UNLOCK));
commands.add(this.buildCommand(AccountCommand.Action.CLOSE));
break;
case CLOSED:
commands.add(this.buildCommand(AccountCommand.Action.REOPEN));
break;
}
return commands;
}