public List getProcessSteps()

in service/src/main/java/org/apache/fineract/cn/customer/internal/service/CustomerService.java [203:230]


  public List<ProcessStep> getProcessSteps(final String customerIdentifier) {
    return customerRepository.findByIdentifier(customerIdentifier)
        .map(customerEntity -> {
          final List<ProcessStep> processSteps = new ArrayList<>();

          final Customer.State state = Customer.State.valueOf(customerEntity.getCurrentState());
          switch (state) {
            case PENDING:
              processSteps.add(this.buildProcessStep(customerEntity, Command.Action.ACTIVATE));
              processSteps.add(this.buildProcessStep(customerEntity, Command.Action.CLOSE));
              break;
            case ACTIVE:
              processSteps.add(this.buildProcessStep(customerEntity, Command.Action.LOCK));
              processSteps.add(this.buildProcessStep(customerEntity, Command.Action.CLOSE));
              break;
            case LOCKED:
              processSteps.add(this.buildProcessStep(customerEntity, Command.Action.UNLOCK));
              processSteps.add(this.buildProcessStep(customerEntity, Command.Action.CLOSE));
              break;
            case CLOSED:
              processSteps.add(this.buildProcessStep(customerEntity, Command.Action.REOPEN));
              break;
          }

          return processSteps;
        })
        .orElse(Collections.emptyList());
  }