Github user angelboxes commented on a diff in the pull request:

    https://github.com/apache/fineract/pull/465#discussion_r207365498
  
    --- Diff: 
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanUtilService.java
 ---
    @@ -325,4 +332,35 @@ private LocalDate 
generateCalculatedRepaymentStartDate(final CalendarHistoryData
             return disbursementDatas;
         }
     
    +    public List<Rate> fetchRateData(final JsonArray element) {
    +        List<Rate> rates = new ArrayList<>();
    +
    +        if (element != null) {
    +            for (JsonElement jsonElement : element) {
    +                final JsonObject rateElement = 
jsonElement.getAsJsonObject();
    +                if (rateElement.has("id")) {
    +                    final Long rateId = 
this.fromApiJsonHelper.extractLongNamed("id", rateElement);
    +                    Rate rate = findRateByIdIfProvided(rateId);
    +                    rates.add(rate);
    +                }
    +            }
    +        }else{
    +            System.out.println("");
    +        }
    +
    +        return rates;
    +    }
    +
    +    public Rate findRateByIdIfProvided(final Long rateId) {
    +        Rate rate = null;
    +        if (rateId != null) {
    +            rate = this.rateRepository.findOne(rateId);
    --- End diff --
    
    I'll use a wrapper class, I just noticed that it is used for the Loan 
repository but there are some others that don't make use of it so it was a bit 
misleading.


---

Reply via email to