@Override
 public List<EnumOptionData> retrieveApplicableToTypes() {
   final List<EnumOptionData> chargeAppliesToTypes = new ArrayList<EnumOptionData>();
   for (final ChargeAppliesTo chargeAppliesTo : ChargeAppliesTo.values()) {
     if (ChargeAppliesTo.INVALID.equals(chargeAppliesTo)) {
       continue;
     }
     chargeAppliesToTypes.add(ChargeEnumerations.chargeAppliesTo(chargeAppliesTo));
   }
   return chargeAppliesToTypes;
 }
 @Override
 public List<EnumOptionData> retrieveCollectionTimeTypes() {
   final List<EnumOptionData> chargeTimeTypes = new ArrayList<EnumOptionData>();
   for (final ChargeTimeType chargeTimeType : ChargeTimeType.values()) {
     if (ChargeTimeType.INVALID.equals(chargeTimeType)
         || ChargeTimeType.SAVINGS_CLOSURE.equals(chargeTimeType)) {
       continue;
     }
     chargeTimeTypes.add(ChargeEnumerations.chargeTimeType(chargeTimeType));
   }
   return chargeTimeTypes;
 }
    @Override
    public SavingsAccountChargeData mapRow(
        final ResultSet rs, @SuppressWarnings("unused") final int rowNum) throws SQLException {

      final Long id = rs.getLong("id");
      final Long chargeId = rs.getLong("chargeId");
      final Long accountId = rs.getLong("accountId");
      final String name = rs.getString("name");
      final BigDecimal amount = rs.getBigDecimal("amountDue");
      final BigDecimal amountPaid = JdbcSupport.getBigDecimalDefaultToZeroIfNull(rs, "amountPaid");
      final BigDecimal amountWaived =
          JdbcSupport.getBigDecimalDefaultToZeroIfNull(rs, "amountWaived");
      final BigDecimal amountWrittenOff =
          JdbcSupport.getBigDecimalDefaultToZeroIfNull(rs, "amountWrittenOff");
      final BigDecimal amountOutstanding = rs.getBigDecimal("amountOutstanding");

      final BigDecimal percentageOf =
          JdbcSupport.getBigDecimalDefaultToZeroIfNull(rs, "percentageOf");
      final BigDecimal amountPercentageAppliedTo =
          JdbcSupport.getBigDecimalDefaultToZeroIfNull(rs, "amountPercentageAppliedTo");

      final String currencyCode = rs.getString("currencyCode");
      final String currencyName = rs.getString("currencyName");
      final String currencyNameCode = rs.getString("currencyNameCode");
      final String currencyDisplaySymbol = rs.getString("currencyDisplaySymbol");
      final Integer currencyDecimalPlaces = JdbcSupport.getInteger(rs, "currencyDecimalPlaces");
      final Integer inMultiplesOf = JdbcSupport.getInteger(rs, "inMultiplesOf");

      final CurrencyData currency =
          new CurrencyData(
              currencyCode,
              currencyName,
              currencyDecimalPlaces,
              inMultiplesOf,
              currencyDisplaySymbol,
              currencyNameCode);

      final int chargeTime = rs.getInt("chargeTime");
      final EnumOptionData chargeTimeType = ChargeEnumerations.chargeTimeType(chargeTime);

      final LocalDate dueAsOfDate = JdbcSupport.getLocalDate(rs, "dueAsOfDate");
      final Integer feeInterval = JdbcSupport.getInteger(rs, "feeInterval");
      MonthDay feeOnMonthDay = null;
      final Integer feeOnMonth = JdbcSupport.getInteger(rs, "feeOnMonth");
      final Integer feeOnDay = JdbcSupport.getInteger(rs, "feeOnDay");
      if (feeOnDay != null) {
        feeOnMonthDay = new MonthDay(feeOnMonth, feeOnDay);
      }

      final int chargeCalculation = rs.getInt("chargeCalculation");
      final EnumOptionData chargeCalculationType =
          ChargeEnumerations.chargeCalculationType(chargeCalculation);
      final boolean penalty = rs.getBoolean("penalty");

      final Collection<ChargeData> chargeOptions = null;

      return SavingsAccountChargeData.instance(
          id,
          chargeId,
          accountId,
          name,
          currency,
          amount,
          amountPaid,
          amountWaived,
          amountWrittenOff,
          amountOutstanding,
          chargeTimeType,
          dueAsOfDate,
          chargeCalculationType,
          percentageOf,
          amountPercentageAppliedTo,
          chargeOptions,
          penalty,
          feeOnMonthDay,
          feeInterval);
    }