cleaning up method signatures in Charge read platform service
This commit is contained in:
+47
-1
@@ -8,6 +8,7 @@ package org.mifosplatform.portfolio.charge.service;
|
|||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
import org.mifosplatform.portfolio.charge.data.ChargeData;
|
import org.mifosplatform.portfolio.charge.data.ChargeData;
|
||||||
|
import org.mifosplatform.portfolio.charge.domain.ChargeTimeType;
|
||||||
|
|
||||||
public interface ChargeReadPlatformService {
|
public interface ChargeReadPlatformService {
|
||||||
|
|
||||||
@@ -19,17 +20,62 @@ public interface ChargeReadPlatformService {
|
|||||||
|
|
||||||
ChargeData retrieveNewChargeDetails();
|
ChargeData retrieveNewChargeDetails();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns all charges applicable for loans
|
||||||
|
*
|
||||||
|
* @param feeChargesOnly
|
||||||
|
* If set to "true", only fees are returned
|
||||||
|
* @param excludeChargeTimes
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
Collection<ChargeData> retrieveLoanApplicableCharges(boolean feeChargesOnly, Integer[] excludeChargeTimes);
|
Collection<ChargeData> retrieveLoanApplicableCharges(boolean feeChargesOnly, Integer[] excludeChargeTimes);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns all Penalties applicable for loans
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
Collection<ChargeData> retrieveLoanApplicablePenalties();
|
Collection<ChargeData> retrieveLoanApplicablePenalties();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns all Charges associated with a given Loan Product
|
||||||
|
*
|
||||||
|
* @param loanProductId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
Collection<ChargeData> retrieveLoanProductCharges(Long loanProductId);
|
Collection<ChargeData> retrieveLoanProductCharges(Long loanProductId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns all charges applicable for a given loan product
|
||||||
|
*
|
||||||
|
* @param loanProductId
|
||||||
|
* @param chargeTime
|
||||||
|
* Filters based on the type of the charge to be returned
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Collection<ChargeData> retrieveLoanProductCharges(Long loanProductId, ChargeTimeType chargeTime);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns all charges applicable for savings
|
||||||
|
*
|
||||||
|
* @param feeChargesOnly
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
Collection<ChargeData> retrieveSavingsAccountApplicableCharges(boolean feeChargesOnly);
|
Collection<ChargeData> retrieveSavingsAccountApplicableCharges(boolean feeChargesOnly);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns all penalties applicable for savings
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
Collection<ChargeData> retrieveSavingsAccountApplicablePenalties();
|
Collection<ChargeData> retrieveSavingsAccountApplicablePenalties();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns all charges applicable for a given savings product
|
||||||
|
*
|
||||||
|
* @param savingsProductId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
Collection<ChargeData> retrieveSavingsProductCharges(Long savingsProductId);
|
Collection<ChargeData> retrieveSavingsProductCharges(Long savingsProductId);
|
||||||
|
|
||||||
Collection<ChargeData> retrieveLoanProductCharges(Long loanProductId, Integer chargeTime);
|
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-2
@@ -19,6 +19,7 @@ import org.mifosplatform.organisation.monetary.data.CurrencyData;
|
|||||||
import org.mifosplatform.organisation.monetary.service.CurrencyReadPlatformService;
|
import org.mifosplatform.organisation.monetary.service.CurrencyReadPlatformService;
|
||||||
import org.mifosplatform.portfolio.charge.data.ChargeData;
|
import org.mifosplatform.portfolio.charge.data.ChargeData;
|
||||||
import org.mifosplatform.portfolio.charge.domain.ChargeAppliesTo;
|
import org.mifosplatform.portfolio.charge.domain.ChargeAppliesTo;
|
||||||
|
import org.mifosplatform.portfolio.charge.domain.ChargeTimeType;
|
||||||
import org.mifosplatform.portfolio.charge.exception.ChargeNotFoundException;
|
import org.mifosplatform.portfolio.charge.exception.ChargeNotFoundException;
|
||||||
import org.mifosplatform.portfolio.common.service.CommonEnumerations;
|
import org.mifosplatform.portfolio.common.service.CommonEnumerations;
|
||||||
import org.mifosplatform.portfolio.common.service.DropdownReadPlatformService;
|
import org.mifosplatform.portfolio.common.service.DropdownReadPlatformService;
|
||||||
@@ -112,14 +113,14 @@ public class ChargeReadPlatformServiceImpl implements ChargeReadPlatformService
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<ChargeData> retrieveLoanProductCharges(final Long loanProductId, final Integer chargeTime) {
|
public Collection<ChargeData> retrieveLoanProductCharges(final Long loanProductId, final ChargeTimeType chargeTime) {
|
||||||
|
|
||||||
final ChargeMapper rm = new ChargeMapper();
|
final ChargeMapper rm = new ChargeMapper();
|
||||||
|
|
||||||
final String sql = "select " + rm.loanProductChargeSchema()
|
final String sql = "select " + rm.loanProductChargeSchema()
|
||||||
+ " where c.is_deleted=0 and c.is_active=1 and plc.product_loan_id=? and c.charge_time_enum=?";
|
+ " where c.is_deleted=0 and c.is_active=1 and plc.product_loan_id=? and c.charge_time_enum=?";
|
||||||
|
|
||||||
return this.jdbcTemplate.query(sql, rm, new Object[] { loanProductId, chargeTime });
|
return this.jdbcTemplate.query(sql, rm, new Object[] { loanProductId, chargeTime.getValue() });
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+1
-1
@@ -470,7 +470,7 @@ public class LoansApiResource {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Collection<ChargeData> overdueCharges = this.chargeReadPlatformService.retrieveLoanProductCharges(loanBasicDetails.loanProductId(),
|
Collection<ChargeData> overdueCharges = this.chargeReadPlatformService.retrieveLoanProductCharges(loanBasicDetails.loanProductId(),
|
||||||
ChargeTimeType.OVERDUE_INSTALLMENT.getValue());
|
ChargeTimeType.OVERDUE_INSTALLMENT);
|
||||||
|
|
||||||
final LoanAccountData loanAccount = LoanAccountData.associationsAndTemplate(loanBasicDetails, repaymentSchedule, loanRepayments,
|
final LoanAccountData loanAccount = LoanAccountData.associationsAndTemplate(loanBasicDetails, repaymentSchedule, loanRepayments,
|
||||||
charges, collateral, guarantors, meeting, productOptions, loanTermFrequencyTypeOptions, repaymentFrequencyTypeOptions,
|
charges, collateral, guarantors, meeting, productOptions, loanTermFrequencyTypeOptions, repaymentFrequencyTypeOptions,
|
||||||
|
|||||||
Reference in New Issue
Block a user