Esempio n. 1
0
  @Override
  public void initializeClientStates(String clientGlobalNum) {
    ClientBO client = this.customerDao.findClientBySystemId(clientGlobalNum);

    try {
      List<ListElement> savingsStatesList = new ArrayList<ListElement>();
      AccountStateMachines.getInstance().initializeClientStates();

      List<CustomerStatusEntity> statusList =
          AccountStateMachines.getInstance().getClientStatusList(client.getCustomerStatus());
      for (CustomerStatusEntity customerState : statusList) {
        savingsStatesList.add(
            new ListElement(customerState.getId().intValue(), customerState.getName()));
      }
    } catch (StatesInitializationException e) {
      throw new MifosRuntimeException(e);
    }
  }
Esempio n. 2
0
  @Override
  public CustomerStatusDetailDto retrieveCustomerStatusDetails(
      Short newStatusId, Short flagIdValue, Short customerLevelId) {

    CustomerLevel customerLevel = CustomerLevel.getLevel(customerLevelId);
    CustomerStatus customerStatus = CustomerStatus.fromInt(newStatusId);

    CustomerStatusFlag statusFlag = null;
    if (customerStatus.isCustomerCancelledOrClosed()) {
      statusFlag = CustomerStatusFlag.getStatusFlag(flagIdValue);
    }

    String statusName =
        AccountStateMachines.getInstance().getCustomerStatusName(customerStatus, customerLevel);
    String flagName =
        AccountStateMachines.getInstance().getCustomerFlagName(statusFlag, customerLevel);

    return new CustomerStatusDetailDto(statusName, flagName);
  }