This is an automated email from the ASF dual-hosted git repository. awasum pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/fineract-cn-reporting.git
commit 3b8eb87fb34a4e6f511d01147457a23bcac69c1d Author: Awasum Yannick <[email protected]> AuthorDate: Mon Aug 28 10:10:04 2017 +0100 Refactor, loan skeleton builders --- .../specification/LoanListReportSpecification.java | 91 ++++++++++++++++++++++ .../LoanListingReportSpecification.java | 51 ------------ ...ion.java => TellerListReportSpecification.java} | 6 +- 3 files changed, 94 insertions(+), 54 deletions(-) diff --git a/service/src/main/java/io/mifos/reporting/service/internal/specification/LoanListReportSpecification.java b/service/src/main/java/io/mifos/reporting/service/internal/specification/LoanListReportSpecification.java new file mode 100644 index 0000000..429f42d --- /dev/null +++ b/service/src/main/java/io/mifos/reporting/service/internal/specification/LoanListReportSpecification.java @@ -0,0 +1,91 @@ +package io.mifos.reporting.service.internal.specification; + +import io.mifos.reporting.api.v1.domain.*; +import io.mifos.reporting.service.ServiceConstants; +import io.mifos.reporting.service.spi.Report; +import io.mifos.reporting.service.spi.ReportSpecification; +import org.slf4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; + +import javax.persistence.EntityManager; +import java.util.HashMap; +import java.util.List; + +@Report(category = "Loan", identifier = "Listing") +public class LoanListReportSpecification implements ReportSpecification { + + private static final String CUSTOMER = "Customer"; + private static final String FIRST_NAME = "First name"; + private static final String MIDDLE_NAME = "Middle name"; + private static final String LAST_NAME = "Last name"; + private static final String EMPLOYEE = "Employee"; + private static final String ACCOUNT_NUMBER = "Account number"; + private static final String ACCOUNT_TYPE = "Account type"; + private static final String STATE = "State"; + private static final String OFFICE = "Office"; + private static final String DATE_RANGE = "Date created"; + + private final Logger logger; + + private final EntityManager entityManager; + + private final HashMap<String, String> customerColumnMapping = new HashMap<>(); + private final HashMap<String, String> loanColumnMapping = new HashMap<>(); + private final HashMap<String, String> officeColumnMapping = new HashMap<>(); + private final HashMap<String, String> employeeColumnMapping = new HashMap<>(); + private final HashMap<String, String> allColumnMapping = new HashMap<>(); + + @Autowired + public LoanListReportSpecification(@Qualifier(ServiceConstants.LOGGER_NAME) final Logger logger, + final EntityManager entityManager) { + super(); + this.logger = logger; + this.entityManager = entityManager; + this.initializeMapping(); + } + + private void initializeMapping() { + } + + @Override + public ReportDefinition getReportDefinition() { + final ReportDefinition reportDefinition = new ReportDefinition(); + reportDefinition.setIdentifier("Listing"); + reportDefinition.setName("Loan Account Listing"); + reportDefinition.setDescription("List of all loan accounts."); + reportDefinition.setQueryParameters(this.buildQueryParameters()); + reportDefinition.setDisplayableFields(this.buildDisplayableFields()); + return reportDefinition; + } + + private List<DisplayableField> buildDisplayableFields() { + return null; + } + + private List<QueryParameter> buildQueryParameters() { + return null; + } + + @Override + public ReportPage generateReport(ReportRequest reportRequest, int pageIndex, int size) { + return null; + } + + @Override + public void validate(ReportRequest reportRequest) throws IllegalArgumentException { + + } + + private String buildCustomerQuery(final ReportRequest reportRequest, int pageIndex, int size){ + return null; + } + + private String buildLoanAccountQuery(final ReportRequest reportRequest, final String customerIdentifier){ + return null; + } + + private String buildOfficeQuery(final ReportRequest reportRequest, final String customerIdentifier){ + return null; + } +} diff --git a/service/src/main/java/io/mifos/reporting/service/internal/specification/LoanListingReportSpecification.java b/service/src/main/java/io/mifos/reporting/service/internal/specification/LoanListingReportSpecification.java deleted file mode 100644 index d90dd75..0000000 --- a/service/src/main/java/io/mifos/reporting/service/internal/specification/LoanListingReportSpecification.java +++ /dev/null @@ -1,51 +0,0 @@ -package io.mifos.reporting.service.internal.specification; - -import io.mifos.reporting.api.v1.domain.ReportDefinition; -import io.mifos.reporting.api.v1.domain.ReportPage; -import io.mifos.reporting.api.v1.domain.ReportRequest; -import io.mifos.reporting.service.ServiceConstants; -import io.mifos.reporting.service.spi.Report; -import io.mifos.reporting.service.spi.ReportSpecification; -import org.slf4j.Logger; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Qualifier; - -import javax.persistence.EntityManager; - -@Report(category = "Loan", identifier = "Listing") -public class LoanListingReportSpecification implements ReportSpecification { - - private static final String TOTAL_CASH_ON_HAND = "Cash on hand"; - - - private final Logger logger; - - private final EntityManager entityManager; - - @Autowired - public LoanListingReportSpecification(@Qualifier(ServiceConstants.LOGGER_NAME) final Logger logger, - final EntityManager entityManager) { - super(); - this.logger = logger; - this.entityManager = entityManager; - this.initializeMapping(); - } - - private void initializeMapping() { - } - - @Override - public ReportDefinition getReportDefinition() { - return null; - } - - @Override - public ReportPage generateReport(ReportRequest reportRequest, int pageIndex, int size) { - return null; - } - - @Override - public void validate(ReportRequest reportRequest) throws IllegalArgumentException { - - } -} diff --git a/service/src/main/java/io/mifos/reporting/service/internal/specification/TellerListingReportSpecification.java b/service/src/main/java/io/mifos/reporting/service/internal/specification/TellerListReportSpecification.java similarity index 95% rename from service/src/main/java/io/mifos/reporting/service/internal/specification/TellerListingReportSpecification.java rename to service/src/main/java/io/mifos/reporting/service/internal/specification/TellerListReportSpecification.java index 34af570..3c51c85 100644 --- a/service/src/main/java/io/mifos/reporting/service/internal/specification/TellerListingReportSpecification.java +++ b/service/src/main/java/io/mifos/reporting/service/internal/specification/TellerListReportSpecification.java @@ -21,7 +21,7 @@ import java.util.List; import java.util.stream.Collectors; @Report(category = "Teller" , identifier = "Listing") -public class TellerListingReportSpecification implements ReportSpecification { +public class TellerListReportSpecification implements ReportSpecification { // private static final String TOTAL_CASH_ON_HAND = "Cash on hand"; // private static final String TOTAL_CASH_RECEIVED = "Cash received"; @@ -43,8 +43,8 @@ public class TellerListingReportSpecification implements ReportSpecification { @Autowired - public TellerListingReportSpecification(@Qualifier(ServiceConstants.LOGGER_NAME) final Logger logger, - final EntityManager entityManager) { + public TellerListReportSpecification(@Qualifier(ServiceConstants.LOGGER_NAME) final Logger logger, + final EntityManager entityManager) { super(); this.logger = logger; this.entityManager = entityManager;
