fineract-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vorbur...@apache.org
Subject [fineract] 01/07: Revert "Fineract-614 Changes to comply with Checkstyle rules"
Date Fri, 13 Mar 2020 16:15:53 GMT
This is an automated email from the ASF dual-hosted git repository.

vorburger pushed a commit to branch revert-592-Fineract-614
in repository https://gitbox.apache.org/repos/asf/fineract.git

commit 758c8c49221efd04b0129e8c1a9cdfd852eae7ed
Author: Michael Vorburger ⛑️ <mike@vorburger.ch>
AuthorDate: Fri Mar 13 17:15:42 2020 +0100

    Revert "Fineract-614 Changes to comply with Checkstyle rules"
    
    This reverts commit b9b265b9150fb0ded2f32330281c7b01d16b19b1.
---
 .../loanaccount/api/LoansApiResource.java          | 42 ++++++-------
 .../loanaccount/service/LoanAssembler.java         |  3 +
 .../portfolio/rate/api/RateApiResource.java        | 14 ++---
 .../fineract/portfolio/rate/data/RateData.java     |  3 +-
 .../fineract/portfolio/rate/domain/Rate.java       | 29 +++++----
 .../portfolio/rate/domain/RateAppliesTo.java       | 73 +++++++++++-----------
 .../portfolio/rate/domain/RateRepository.java      | 13 ++--
 .../portfolio/rate/service/RateEnumerations.java   | 33 +++++-----
 .../portfolio/rate/service/RateReadService.java    |  3 +-
 .../rate/service/RateReadServiceImpl.java          | 21 ++++---
 10 files changed, 117 insertions(+), 117 deletions(-)

diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoansApiResource.java
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoansApiResource.java
index 112d830..7b65d8a 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoansApiResource.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoansApiResource.java
@@ -299,27 +299,27 @@ public class LoansApiResource {
 
     @Autowired
     public LoansApiResource(final PlatformSecurityContext context, final LoanReadPlatformService
loanReadPlatformService,
-            final LoanProductReadPlatformService loanProductReadPlatformService,
-            final LoanDropdownReadPlatformService dropdownReadPlatformService, final FundReadPlatformService
fundReadPlatformService,
-            final ChargeReadPlatformService chargeReadPlatformService, final LoanChargeReadPlatformService
loanChargeReadPlatformService,
-            final CollateralReadPlatformService loanCollateralReadPlatformService,
-            final LoanScheduleCalculationPlatformService calculationPlatformService,
-            final GuarantorReadPlatformService guarantorReadPlatformService,
-            final CodeValueReadPlatformService codeValueReadPlatformService, final GroupReadPlatformService
groupReadPlatformService,
-            final DefaultToApiJsonSerializer<LoanAccountData> toApiJsonSerializer,
-            final DefaultToApiJsonSerializer<LoanApprovalData> loanApprovalDataToApiJsonSerializer,
-            final DefaultToApiJsonSerializer<LoanScheduleData> loanScheduleToApiJsonSerializer,
-            final ApiRequestParameterHelper apiRequestParameterHelper, final FromJsonHelper
fromJsonHelper,
-            final PortfolioCommandSourceWritePlatformService commandsSourceWritePlatformService,
-            final CalendarReadPlatformService calendarReadPlatformService, final NoteReadPlatformServiceImpl
noteReadPlatformService,
-            final PortfolioAccountReadPlatformService portfolioAccountReadPlatformServiceImpl,
-            final AccountAssociationsReadPlatformService accountAssociationsReadPlatformService,
-            final LoanScheduleHistoryReadPlatformService loanScheduleHistoryReadPlatformService,
-            final AccountDetailsReadPlatformService accountDetailsReadPlatformService,
-            final EntityDatatableChecksReadService entityDatatableChecksReadService,
-            final BulkImportWorkbookService bulkImportWorkbookService,
-            final BulkImportWorkbookPopulatorService bulkImportWorkbookPopulatorService,
final RateReadService rateReadService,
-            final ConfigurationDomainService configurationDomainService) {
+        final LoanProductReadPlatformService loanProductReadPlatformService,
+        final LoanDropdownReadPlatformService dropdownReadPlatformService, final FundReadPlatformService
fundReadPlatformService,
+        final ChargeReadPlatformService chargeReadPlatformService, final LoanChargeReadPlatformService
loanChargeReadPlatformService,
+        final CollateralReadPlatformService loanCollateralReadPlatformService,
+        final LoanScheduleCalculationPlatformService calculationPlatformService,
+        final GuarantorReadPlatformService guarantorReadPlatformService,
+        final CodeValueReadPlatformService codeValueReadPlatformService, final GroupReadPlatformService
groupReadPlatformService,
+        final DefaultToApiJsonSerializer<LoanAccountData> toApiJsonSerializer,
+        final DefaultToApiJsonSerializer<LoanApprovalData> loanApprovalDataToApiJsonSerializer,
+        final DefaultToApiJsonSerializer<LoanScheduleData> loanScheduleToApiJsonSerializer,
+        final ApiRequestParameterHelper apiRequestParameterHelper, final FromJsonHelper fromJsonHelper,
+        final PortfolioCommandSourceWritePlatformService commandsSourceWritePlatformService,
+        final CalendarReadPlatformService calendarReadPlatformService, final NoteReadPlatformServiceImpl
noteReadPlatformService,
+        final PortfolioAccountReadPlatformService portfolioAccountReadPlatformServiceImpl,
+        final AccountAssociationsReadPlatformService accountAssociationsReadPlatformService,
+        final LoanScheduleHistoryReadPlatformService loanScheduleHistoryReadPlatformService,
+        final AccountDetailsReadPlatformService accountDetailsReadPlatformService,
+        final EntityDatatableChecksReadService entityDatatableChecksReadService,
+        final BulkImportWorkbookService bulkImportWorkbookService,
+        final BulkImportWorkbookPopulatorService bulkImportWorkbookPopulatorService, final
RateReadService rateReadService, 
+        final ConfigurationDomainService configurationDomainService) {
         this.context = context;
         this.loanReadPlatformService = loanReadPlatformService;
         this.loanProductReadPlatformService = loanProductReadPlatformService;
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanAssembler.java
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanAssembler.java
index 6414975..094b2e8 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanAssembler.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanAssembler.java
@@ -25,6 +25,8 @@ import java.util.Arrays;
 import java.util.List;
 import java.util.Locale;
 import java.util.Set;
+
+import com.google.gson.JsonArray;
 import org.apache.fineract.infrastructure.codes.domain.CodeValue;
 import org.apache.fineract.infrastructure.codes.domain.CodeValueRepositoryWrapper;
 import org.apache.fineract.infrastructure.configuration.domain.ConfigurationDomainService;
@@ -71,6 +73,7 @@ import org.apache.fineract.portfolio.loanaccount.exception.MultiDisbursementData
 import org.apache.fineract.portfolio.loanaccount.loanschedule.domain.LoanApplicationTerms;
 import org.apache.fineract.portfolio.loanaccount.loanschedule.domain.LoanScheduleModel;
 import org.apache.fineract.portfolio.loanaccount.loanschedule.service.LoanScheduleAssembler;
+import org.apache.fineract.portfolio.loanproduct.LoanProductConstants;
 import org.apache.fineract.portfolio.loanproduct.domain.LoanProduct;
 import org.apache.fineract.portfolio.loanproduct.domain.LoanProductRelatedDetail;
 import org.apache.fineract.portfolio.loanproduct.domain.LoanProductRepository;
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/api/RateApiResource.java
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/api/RateApiResource.java
index 014891d..8015831 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/api/RateApiResource.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/api/RateApiResource.java
@@ -20,18 +20,9 @@
 package org.apache.fineract.portfolio.rate.api;
 
 import java.util.Arrays;
-import java.util.Collection;
 import java.util.HashSet;
 import java.util.Set;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
 import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.UriInfo;
 import org.apache.fineract.commands.domain.CommandWrapper;
 import org.apache.fineract.commands.service.CommandWrapperBuilder;
@@ -43,10 +34,15 @@ import org.apache.fineract.infrastructure.core.serialization.DefaultToApiJsonSer
 import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext;
 import org.apache.fineract.portfolio.rate.data.RateData;
 import org.apache.fineract.portfolio.rate.service.RateReadService;
+import org.apache.fineract.portfolio.rate.service.RateWriteService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Scope;
 import org.springframework.stereotype.Component;
 
+import javax.ws.rs.*;
+import javax.ws.rs.core.MediaType;
+import java.util.Collection;
+
 /**
  * Bowpi GT Created by Jose on 19/07/2017.
  */
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/data/RateData.java
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/data/RateData.java
index d6fdeb4..e249a1f 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/data/RateData.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/data/RateData.java
@@ -19,9 +19,10 @@
 
 package org.apache.fineract.portfolio.rate.data;
 
+import org.apache.fineract.infrastructure.core.data.EnumOptionData;
+
 import java.io.Serializable;
 import java.math.BigDecimal;
-import org.apache.fineract.infrastructure.core.data.EnumOptionData;
 
 /**
  * Bowpi GT Created by Jose on 19/07/2017.
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/domain/Rate.java
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/domain/Rate.java
index 50d322a..ad808f4 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/domain/Rate.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/domain/Rate.java
@@ -19,20 +19,22 @@
 
 package org.apache.fineract.portfolio.rate.domain;
 
-import java.math.BigDecimal;
+import java.util.ArrayList;
 import java.util.LinkedHashMap;
+import java.util.List;
 import java.util.Map;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.JoinColumn;
-import javax.persistence.ManyToOne;
-import javax.persistence.Table;
-import javax.persistence.UniqueConstraint;
 import org.apache.commons.lang.StringUtils;
 import org.apache.fineract.infrastructure.core.api.JsonCommand;
-import org.apache.fineract.infrastructure.core.domain.AbstractAuditableCustom;
+import org.apache.fineract.infrastructure.core.data.ApiParameterError;
+import org.apache.fineract.infrastructure.core.data.DataValidatorBuilder;
+import org.apache.fineract.infrastructure.core.exception.PlatformApiDataValidationException;
 import org.apache.fineract.portfolio.charge.exception.ChargeParameterUpdateNotSupportedException;
 import org.apache.fineract.useradministration.domain.AppUser;
+import org.apache.fineract.portfolio.rate.domain.RateAppliesTo;
+
+import javax.persistence.*;
+import java.math.BigDecimal;
+import org.apache.fineract.infrastructure.core.domain.AbstractAuditableCustom;
 
 /**
  * Bowpi GT Created by Jose on 19/07/2017.
@@ -131,8 +133,7 @@ public class Rate extends AbstractAuditableCustom<AppUser, Long>
{
         '}';
   }
 
-  public static Rate from(String name, BigDecimal percentage, RateAppliesTo productApply,
-      Boolean active) {
+  public static Rate from(String name, BigDecimal percentage, RateAppliesTo productApply,
Boolean active) {
     return new Rate(name, percentage, productApply, active);
   }
 
@@ -142,9 +143,8 @@ public class Rate extends AbstractAuditableCustom<AppUser, Long>
{
 
     final BigDecimal percentage = command.bigDecimalValueOfParameterNamed("percentage");
 
-    final RateAppliesTo productApply = RateAppliesTo
-        .fromInt(command.integerValueOfParameterNamed("productApply"));
-
+    final RateAppliesTo productApply = RateAppliesTo.fromInt(command.integerValueOfParameterNamed("productApply"));
+    
     final boolean active = command.booleanPrimitiveValueOfParameterNamed("active");
 
     return new Rate(name, percentage, productApply, active, user);
@@ -198,8 +198,7 @@ public class Rate extends AbstractAuditableCustom<AppUser, Long>
{
     return approveUserId;
   }
 
-  public void assembleFrom(String name, BigDecimal percentage, Integer productApply,
-      boolean active) {
+  public void assembleFrom(String name, BigDecimal percentage, Integer productApply, boolean
active){
     this.name = name;
     this.percentage = percentage;
     this.productApply = productApply;
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/domain/RateAppliesTo.java
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/domain/RateAppliesTo.java
index 7115fe9..684e142 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/domain/RateAppliesTo.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/domain/RateAppliesTo.java
@@ -16,52 +16,51 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-
-package org.apache.fineract.portfolio.rate.domain;
+ 
+ package org.apache.fineract.portfolio.rate.domain;
 
 public enum RateAppliesTo {
 
-  INVALID(0, "rateAppliesTo.invalid"),
-  LOAN(1, "rateAppliesTo.loan");
+    INVALID(0, "rateAppliesTo.invalid"), 
+    LOAN(1, "rateAppliesTo.loan");
+    
+    private final Integer value;
+    private final String code;
 
-  private final Integer value;
-  private final String code;
+    private RateAppliesTo(final Integer value, final String code) {
+        this.value = value;
+        this.code = code;
+    }
 
-  private RateAppliesTo(final Integer value, final String code) {
-    this.value = value;
-    this.code = code;
-  }
+    public Integer getValue() {
+        return this.value;
+    }
 
-  public Integer getValue() {
-    return this.value;
-  }
+    public String getCode() {
+        return this.code;
+    }
 
-  public String getCode() {
-    return this.code;
-  }
+    public static RateAppliesTo fromInt(final Integer rateAppliesTo) {
+        RateAppliesTo rateAppliesToType = RateAppliesTo.INVALID;
 
-  public static RateAppliesTo fromInt(final Integer rateAppliesTo) {
-    RateAppliesTo rateAppliesToType = RateAppliesTo.INVALID;
+        if (rateAppliesTo != null) {
+            switch (rateAppliesTo) {
+                case 1:
+                    rateAppliesToType = LOAN;
+                break;
+                default:
+                    rateAppliesToType = INVALID;
+                break;
+            }
+        }
 
-    if (rateAppliesTo != null) {
-      switch (rateAppliesTo) {
-        case 1:
-          rateAppliesToType = LOAN;
-          break;
-        default:
-          rateAppliesToType = INVALID;
-          break;
-      }
+        return rateAppliesToType;
     }
 
-    return rateAppliesToType;
-  }
-
-  public boolean isLoanRate() {
-    return this.value.equals(RateAppliesTo.LOAN.getValue());
-  }
-
-  public static Object[] validValues() {
-    return new Object[]{RateAppliesTo.LOAN.getValue()};
-  }
+    public boolean isLoanRate() {
+        return this.value.equals(RateAppliesTo.LOAN.getValue());
+    }
+    public static Object[] validValues() {
+        return new Object[] { RateAppliesTo.LOAN.getValue() };
+    }
 }
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/domain/RateRepository.java
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/domain/RateRepository.java
index f9210fa..e593ac8 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/domain/RateRepository.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/domain/RateRepository.java
@@ -18,18 +18,19 @@
  */
 package org.apache.fineract.portfolio.rate.domain;
 
-import java.util.List;
 import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
 
+import java.util.List;
+
 /**
- * Bowpi GT Rate repository to save on m_rate table (custom change for Credi Chapin) Created
by Jose
- * on 19/07/2017.
+ * Bowpi GT
+ * Rate repository to save on m_rate table (custom change for Credi Chapin)
+ * Created by Jose on 19/07/2017.
  */
 public interface RateRepository extends JpaRepository<Rate, Long>, JpaSpecificationExecutor<Rate>
{
 
-  Rate findByName(String name);
-
-  List<Rate> findAllByActiveAndProductApply(boolean active, String productApply);
+    Rate findByName(String name);
+    List<Rate> findAllByActiveAndProductApply(boolean active, String productApply);
 
 }
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateEnumerations.java
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateEnumerations.java
index d2cdc22..a1d79a8 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateEnumerations.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateEnumerations.java
@@ -24,25 +24,24 @@ import org.apache.fineract.portfolio.rate.domain.RateAppliesTo;
 
 public class RateEnumerations {
 
-  public static EnumOptionData rateAppliesTo(final int id) {
-    return rateAppliesTo(RateAppliesTo.fromInt(id));
-  }
+    public static EnumOptionData rateAppliesTo(final int id) {
+        return rateAppliesTo(RateAppliesTo.fromInt(id));
+    }
 
-  public static EnumOptionData rateAppliesTo(final RateAppliesTo type) {
-    EnumOptionData optionData = null;
-    switch (type) {
-      case LOAN:
-        optionData = new EnumOptionData(RateAppliesTo.LOAN.getValue().longValue(),
-            RateAppliesTo.LOAN.getCode(), "Loan");
-        break;
-      default:
-        optionData = new EnumOptionData(RateAppliesTo.INVALID.getValue().longValue(),
-            RateAppliesTo.INVALID.getCode(),
-            "Invalid");
-        break;
+    public static EnumOptionData rateAppliesTo(final RateAppliesTo type) {
+        EnumOptionData optionData = null;
+        switch (type) {
+            case LOAN:
+                optionData = new EnumOptionData(RateAppliesTo.LOAN.getValue().longValue(),
RateAppliesTo.LOAN.getCode(), "Loan");
+                break;
+            default:
+                optionData = new EnumOptionData(RateAppliesTo.INVALID.getValue().longValue(),
RateAppliesTo.INVALID.getCode(),
+                        "Invalid");
+                break;
+        }
+        return optionData;
     }
-    return optionData;
-  }
 
+ 
 
 }
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateReadService.java
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateReadService.java
index 81b15d3..7b4b051 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateReadService.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateReadService.java
@@ -18,9 +18,10 @@
  */
 package org.apache.fineract.portfolio.rate.service;
 
+import org.apache.fineract.portfolio.rate.data.RateData;
+
 import java.util.Collection;
 import java.util.List;
-import org.apache.fineract.portfolio.rate.data.RateData;
 
 /**
  * Bowpi GT
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateReadServiceImpl.java
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateReadServiceImpl.java
index 35a0e5b..f3e5e4f 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateReadServiceImpl.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateReadServiceImpl.java
@@ -19,24 +19,26 @@
 
 package org.apache.fineract.portfolio.rate.service;
 
-import java.math.BigDecimal;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.Collection;
-import java.util.List;
 import org.apache.fineract.infrastructure.core.data.EnumOptionData;
 import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
 import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext;
-import org.apache.fineract.portfolio.rate.data.RateData;
-import org.apache.fineract.portfolio.rate.domain.Rate;
+import org.apache.fineract.portfolio.charge.service.ChargeEnumerations;
 import org.apache.fineract.portfolio.rate.domain.RateAppliesTo;
 import org.apache.fineract.portfolio.rate.exception.RateNotFoundException;
+import org.apache.fineract.portfolio.rate.domain.Rate;
+import org.apache.fineract.portfolio.rate.data.RateData;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.dao.EmptyResultDataAccessException;
 import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.jdbc.core.RowMapper;
 import org.springframework.stereotype.Service;
 
+import java.math.BigDecimal;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.Collection;
+import java.util.List;
+
 /**
  * Bowpi GT Created by Jose on 19/07/2017.
  */
@@ -93,7 +95,7 @@ public class RateReadServiceImpl implements RateReadService {
     this.context.authenticatedUser();
     final RateMapper rm = new RateMapper();
     final String sql = "select " + rm.rateSchema() + " where r.active = ? and product_apply=?";
-    return this.jdbcTemplate.query(sql, rm, new Object[]{true, RateAppliesTo.LOAN.getValue()});
+    return this.jdbcTemplate.query(sql, rm, new Object[]{true, RateAppliesTo.LOAN.getValue()
});
   }
 
   @Override
@@ -144,8 +146,7 @@ public class RateReadServiceImpl implements RateReadService {
       final Long id = rateResponse.getId();
       final String name = rateResponse.getName();
       final BigDecimal percentage = rateResponse.getPercentage();
-      final EnumOptionData productApply = RateEnumerations
-          .rateAppliesTo(rateResponse.getProductApply());
+      final EnumOptionData productApply = RateEnumerations.rateAppliesTo(rateResponse.getProductApply());;
       final boolean active = rateResponse.isActive();
       return RateData.instance(id, name, percentage, productApply, active);
     }


Mime
View raw message