update file name of loan schedule data class.

This commit is contained in:
Keith Woodlock
2012-09-19 17:25:31 +01:00
parent a6a74a401b
commit ba8b24ac3b
18 changed files with 45 additions and 44 deletions
@@ -14,8 +14,9 @@ import org.mifosng.platform.api.data.LoanSchedulePeriodData;
* <li>repayment schedule - the principal due, outstanding balance and cost of loan items such as interest and charges</li>
* </ul>
*/
// TODO - KW - rename file
@SuppressWarnings("unused")
public class NewLoanScheduleData {
public class LoanScheduleNewData {
private final Integer loanTermInDays;
@@ -95,7 +96,7 @@ public class NewLoanScheduleData {
*/
private final Collection<LoanSchedulePeriodData> periods;
public NewLoanScheduleData() {
public LoanScheduleNewData() {
this.cumulativePrincipalDisbursed = null;
this.cumulativePrincipalPaid = null;
this.cumulativePrincipalDue = null;
@@ -123,7 +124,7 @@ public class NewLoanScheduleData {
this.loanTermInDays = null;
}
public NewLoanScheduleData(
public LoanScheduleNewData(
final CurrencyData currency,
final Collection<LoanSchedulePeriodData> periods,
final Integer loanTermInDays,
@@ -169,7 +170,7 @@ public class NewLoanScheduleData {
/*
* Used when fully populating
*/
public NewLoanScheduleData(final CurrencyData currency, final Collection<LoanSchedulePeriodData> periods,
public LoanScheduleNewData(final CurrencyData currency, final Collection<LoanSchedulePeriodData> periods,
final Integer loanTermInDays,
final BigDecimal cumulativePrincipalDisbursed,
final BigDecimal cumulativePrincipalDue,
@@ -180,7 +180,7 @@ public class LoansApiResource {
int loanRepaymentsCount = 0;
Collection<LoanRepaymentTransactionData> loanRepayments = null;
NewLoanScheduleData repaymentSchedule = null;
LoanScheduleNewData repaymentSchedule = null;
LoanPermissionData permissions = null;
Collection<LoanChargeData> charges = null;
@@ -283,7 +283,7 @@ public class LoansApiResource {
private String calculateLoanSchedule(final UriInfo uriInfo, final CalculateLoanScheduleCommand command) {
final NewLoanScheduleData loanSchedule = this.calculationPlatformService.calculateLoanScheduleNew(command);
final LoanScheduleNewData loanSchedule = this.calculationPlatformService.calculateLoanScheduleNew(command);
final Set<String> typicalLoanScheduleResponseParameters = new HashSet<String>(
Arrays.asList("periods", "cumulativePrincipalDisbursed"));
@@ -4,7 +4,7 @@ import java.math.BigDecimal;
import java.util.Collection;
import org.joda.time.LocalDate;
import org.mifosng.platform.api.NewLoanScheduleData;
import org.mifosng.platform.api.LoanScheduleNewData;
/**
* Immutable data object representing loan account data.
@@ -53,7 +53,7 @@ public class LoanAccountData {
private final LocalDate lifeCycleStatusDate;
// associations
private final NewLoanScheduleData repaymentSchedule;
private final LoanScheduleNewData repaymentSchedule;
private final Collection<LoanRepaymentTransactionData> loanRepayments;
private final Collection<LoanChargeData> charges;
private final LoanPermissionData permissions;
@@ -76,7 +76,7 @@ public class LoanAccountData {
public LoanAccountData(
final LoanBasicDetailsData basicDetails,
final boolean convenienceDataRequired,
final NewLoanScheduleData repaymentSchedule,
final LoanScheduleNewData repaymentSchedule,
final Collection<LoanRepaymentTransactionData> loanRepayments,
final LoanPermissionData permissions,
final Collection<LoanChargeData> charges,
@@ -3,7 +3,7 @@ package org.mifosng.platform.api.infrastructure;
import java.util.Collection;
import java.util.Set;
import org.mifosng.platform.api.NewLoanScheduleData;
import org.mifosng.platform.api.LoanScheduleNewData;
import org.mifosng.platform.api.data.AdditionalFieldsSetData;
import org.mifosng.platform.api.data.AppUserData;
import org.mifosng.platform.api.data.AuthenticatedUserData;
@@ -93,7 +93,7 @@ public interface ApiJsonSerializerService {
String serializeNoteDataToJson(boolean prettyPrint, Set<String> responseParameters, NoteData note);
String serializeLoanScheduleDataToJson(boolean prettyPrint, Set<String> responseParameters, NewLoanScheduleData loanSchedule);
String serializeLoanScheduleDataToJson(boolean prettyPrint, Set<String> responseParameters, LoanScheduleNewData loanSchedule);
String serializeLoanAccountDataToJson(boolean prettyPrint, Set<String> responseParameters, LoanAccountData loanAccount);
@@ -5,7 +5,7 @@ import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
import org.mifosng.platform.api.NewLoanScheduleData;
import org.mifosng.platform.api.LoanScheduleNewData;
import org.mifosng.platform.api.data.AdditionalFieldsSetData;
import org.mifosng.platform.api.data.AppUserData;
import org.mifosng.platform.api.data.AuthenticatedUserData;
@@ -499,7 +499,7 @@ public class GoogleGsonApiJsonSerializerService implements ApiJsonSerializerServ
}
@Override
public String serializeLoanScheduleDataToJson(final boolean prettyPrint, final Set<String> responseParameters, final NewLoanScheduleData loanSchedule) {
public String serializeLoanScheduleDataToJson(final boolean prettyPrint, final Set<String> responseParameters, final LoanScheduleNewData loanSchedule) {
final Gson gsonDeserializer = helper
.createGsonBuilderWithParameterExclusionSerializationStrategy(LOAN_SCHEDULE_DATA_PARAMETERS, prettyPrint, responseParameters);
return helper.serializedJsonFrom(gsonDeserializer, loanSchedule);
@@ -27,7 +27,7 @@ import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;
import org.joda.time.DateTime;
import org.joda.time.LocalDate;
import org.mifosng.platform.api.NewLoanScheduleData;
import org.mifosng.platform.api.LoanScheduleNewData;
import org.mifosng.platform.api.commands.LoanApplicationCommand;
import org.mifosng.platform.api.data.LoanSchedulePeriodData;
import org.mifosng.platform.client.domain.Client;
@@ -243,7 +243,7 @@ public class Loan extends AbstractAuditableCustom<AppUser, Long> {
}
public void modifyLoanApplication(final LoanApplicationCommand command, final Client client, final LoanProduct loanProduct,
final Fund fund, final LoanTransactionProcessingStrategy strategy, final NewLoanScheduleData modifiedLoanSchedule, final Set<LoanCharge> charges,
final Fund fund, final LoanTransactionProcessingStrategy strategy, final LoanScheduleNewData modifiedLoanSchedule, final Set<LoanCharge> charges,
final Staff loanOfficer) {
if (command.isClientChanged()) {
@@ -1,12 +1,12 @@
package org.mifosng.platform.loan.service;
import org.joda.time.LocalDate;
import org.mifosng.platform.api.NewLoanScheduleData;
import org.mifosng.platform.api.LoanScheduleNewData;
import org.mifosng.platform.api.commands.CalculateLoanScheduleCommand;
public interface CalculationPlatformService {
NewLoanScheduleData calculateLoanScheduleNew(CalculateLoanScheduleCommand command);
LoanScheduleNewData calculateLoanScheduleNew(CalculateLoanScheduleCommand command);
/**
* Not used at present from application.
@@ -1,7 +1,7 @@
package org.mifosng.platform.loan.service;
import org.joda.time.LocalDate;
import org.mifosng.platform.api.NewLoanScheduleData;
import org.mifosng.platform.api.LoanScheduleNewData;
import org.mifosng.platform.api.commands.CalculateLoanScheduleCommand;
import org.mifosng.platform.api.data.CurrencyData;
import org.mifosng.platform.api.data.MoneyData;
@@ -45,7 +45,7 @@ public class CalculationPlatformServiceImpl implements CalculationPlatformServic
}
@Override
public NewLoanScheduleData calculateLoanScheduleNew(final CalculateLoanScheduleCommand command) {
public LoanScheduleNewData calculateLoanScheduleNew(final CalculateLoanScheduleCommand command) {
context.authenticatedUser();
@@ -6,7 +6,7 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.mifosng.platform.api.NewLoanScheduleData;
import org.mifosng.platform.api.LoanScheduleNewData;
import org.mifosng.platform.api.commands.LoanApplicationCommand;
import org.mifosng.platform.api.commands.LoanChargeCommand;
import org.mifosng.platform.api.data.LoanSchedulePeriodData;
@@ -109,7 +109,7 @@ public class LoanAssembler {
Loan loan = Loan.createNew(fund,loanOfficer, loanTransactionProcessingStrategy, loanProduct, client, loanRepaymentScheduleDetail, loanCharges);
loan.setExternalId(command.getExternalId());
final NewLoanScheduleData loanSchedule = this.calculationPlatformService.calculateLoanScheduleNew(command.toCalculateLoanScheduleCommand());
final LoanScheduleNewData loanSchedule = this.calculationPlatformService.calculateLoanScheduleNew(command.toCalculateLoanScheduleCommand());
for (LoanSchedulePeriodData scheduledLoanInstallment : loanSchedule.getPeriods()) {
if (scheduledLoanInstallment.isRepaymentPeriod()) {
@@ -2,7 +2,7 @@ package org.mifosng.platform.loan.service;
import java.util.Collection;
import org.mifosng.platform.api.NewLoanScheduleData;
import org.mifosng.platform.api.LoanScheduleNewData;
import org.mifosng.platform.api.data.CurrencyData;
import org.mifosng.platform.api.data.DisbursementData;
import org.mifosng.platform.api.data.LoanBasicDetailsData;
@@ -14,7 +14,7 @@ public interface LoanReadPlatformService {
LoanBasicDetailsData retrieveLoanAccountDetails(Long loanId);
NewLoanScheduleData retrieveRepaymentSchedule(Long loanId, CurrencyData currency, DisbursementData disbursement);
LoanScheduleNewData retrieveRepaymentSchedule(Long loanId, CurrencyData currency, DisbursementData disbursement);
Collection<LoanRepaymentTransactionData> retrieveLoanPayments(Long loanId);
@@ -7,7 +7,7 @@ import java.util.ArrayList;
import java.util.Collection;
import org.joda.time.LocalDate;
import org.mifosng.platform.api.NewLoanScheduleData;
import org.mifosng.platform.api.LoanScheduleNewData;
import org.mifosng.platform.api.data.ClientData;
import org.mifosng.platform.api.data.CurrencyData;
import org.mifosng.platform.api.data.DisbursementData;
@@ -91,7 +91,7 @@ public class LoanReadPlatformServiceImpl implements LoanReadPlatformService {
}
@Override
public NewLoanScheduleData retrieveRepaymentSchedule(final Long loanId, final CurrencyData currency, final DisbursementData disbursement) {
public LoanScheduleNewData retrieveRepaymentSchedule(final Long loanId, final CurrencyData currency, final DisbursementData disbursement) {
try {
context.authenticatedUser();
@@ -129,7 +129,7 @@ public class LoanReadPlatformServiceImpl implements LoanReadPlatformService {
final BigDecimal totalOutstanding = cumulativePrincipalOutstanding.add(cumulativeInterestOutstanding).add(cumulativeChargesOutstanding);
final BigDecimal totalInArrears = null;
return new NewLoanScheduleData(currency, periods, loanTermInDays,
return new LoanScheduleNewData(currency, periods, loanTermInDays,
cumulativePrincipalDisbursed, cumulativePrincipalDue, cumulativePrincipalPaid, cumulativePrincipalOutstanding,
cumulativeInterestExpected, cumulativeInterestPaid, cumulativeInterestWaived, cumulativeInterestOutstanding,
cumulativeChargesToDate, cumulativeChargesPaid, cumulativeChargesOutstanding,
@@ -8,7 +8,7 @@ import java.util.Set;
import org.apache.commons.lang.StringUtils;
import org.joda.time.LocalDate;
import org.mifosng.platform.api.NewLoanScheduleData;
import org.mifosng.platform.api.LoanScheduleNewData;
import org.mifosng.platform.api.commands.AdjustLoanTransactionCommand;
import org.mifosng.platform.api.commands.CalculateLoanScheduleCommand;
import org.mifosng.platform.api.commands.LoanApplicationCommand;
@@ -146,7 +146,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
LoanTransactionProcessingStrategy strategy = this.loanAssembler.findStrategyByIdIfProvided(command.getTransactionProcessingStrategyId());
Set<LoanCharge> charges = this.loanAssembler.assembleSetOfLoanCharges(command.getCharges(), loanProduct.getCharges(), loan.getCurrency().getCode());
final NewLoanScheduleData loanSchedule = this.calculationPlatformService.calculateLoanScheduleNew(command.toCalculateLoanScheduleCommand());
final LoanScheduleNewData loanSchedule = this.calculationPlatformService.calculateLoanScheduleNew(command.toCalculateLoanScheduleCommand());
loan.modifyLoanApplication(command, client, loanProduct, fund, strategy, loanSchedule, charges, loanOfficer);
this.loanRepository.save(loan);
@@ -350,7 +350,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
loanTermFrequency, loanTermFrequencyType,
actualDisbursementDate, repaymentsStartingFromDate, interestCalculatedFromDate);
NewLoanScheduleData loanSchedule = this.calculationPlatformService.calculateLoanScheduleNew(calculateCommand);
LoanScheduleNewData loanSchedule = this.calculationPlatformService.calculateLoanScheduleNew(calculateCommand);
List<LoanRepaymentScheduleInstallment> modifiedLoanRepaymentSchedule = new ArrayList<LoanRepaymentScheduleInstallment>();
@@ -4,13 +4,13 @@ import java.math.BigDecimal;
import java.util.List;
import org.joda.time.LocalDate;
import org.mifosng.platform.api.NewLoanScheduleData;
import org.mifosng.platform.api.LoanScheduleNewData;
import org.mifosng.platform.currency.domain.ApplicationCurrency;
import org.mifosng.platform.loan.domain.LoanProductRelatedDetail;
public interface AmortizationLoanScheduleGenerator {
NewLoanScheduleData generate(
LoanScheduleNewData generate(
ApplicationCurrency applicationCurrency,
LoanProductRelatedDetail loanScheduleInfo,
LocalDate disbursementDate,
@@ -4,7 +4,7 @@ import java.math.BigDecimal;
import java.util.List;
import org.joda.time.LocalDate;
import org.mifosng.platform.api.NewLoanScheduleData;
import org.mifosng.platform.api.LoanScheduleNewData;
import org.mifosng.platform.currency.domain.ApplicationCurrency;
import org.mifosng.platform.loan.domain.AmortizationMethod;
import org.mifosng.platform.loan.domain.LoanProductRelatedDetail;
@@ -34,7 +34,7 @@ public class DecliningBalanceMethodLoanScheduleGenerator implements LoanSchedule
private final AmortizationLoanScheduleGeneratorFactory amortizationLoanScheduleGeneratorFactory = new AmortizationLoanScheduleGeneratorFactory();
@Override
public NewLoanScheduleData generate(
public LoanScheduleNewData generate(
final ApplicationCurrency applicationCurrency,
final LoanProductRelatedDetail loanScheduleInfo,
final Integer loanTermFrequency,
@@ -7,7 +7,7 @@ import java.util.List;
import org.joda.time.Days;
import org.joda.time.LocalDate;
import org.mifosng.platform.api.NewLoanScheduleData;
import org.mifosng.platform.api.LoanScheduleNewData;
import org.mifosng.platform.api.data.CurrencyData;
import org.mifosng.platform.api.data.LoanSchedulePeriodData;
import org.mifosng.platform.currency.domain.ApplicationCurrency;
@@ -25,7 +25,7 @@ public class EqualInstallmentsAmortizationLoanScheduleGenerator implements Amort
private final PmtCalculator pmtCalculator = new PmtCalculator();
@Override
public NewLoanScheduleData generate(
public LoanScheduleNewData generate(
final ApplicationCurrency currency,
final LoanProductRelatedDetail loanScheduleInfo,
final LocalDate disbursementDate,
@@ -137,7 +137,7 @@ public class EqualInstallmentsAmortizationLoanScheduleGenerator implements Amort
currency.getDisplaySymbol(),
currency.getNameCode());
return new NewLoanScheduleData(currencyData, periods, loanTermInDays, cumulativePrincipalDisbursed, cumulativePrincipalDue,
return new LoanScheduleNewData(currencyData, periods, loanTermInDays, cumulativePrincipalDisbursed, cumulativePrincipalDue,
cumulativePrincipalOutstanding, cumulativeInterestExpected, cumulativeChargesToDate, totalExpectedRepayment);
}
}
@@ -7,7 +7,7 @@ import java.util.List;
import org.joda.time.Days;
import org.joda.time.LocalDate;
import org.mifosng.platform.api.NewLoanScheduleData;
import org.mifosng.platform.api.LoanScheduleNewData;
import org.mifosng.platform.api.data.CurrencyData;
import org.mifosng.platform.api.data.LoanSchedulePeriodData;
import org.mifosng.platform.currency.domain.ApplicationCurrency;
@@ -21,7 +21,7 @@ public class EqualPrincipalAmortizationLoanScheduleGenerator implements Amortiza
private final PaymentPeriodsInOneYearCalculator paymentPeriodsInOneYearCalculator = new DefaultPaymentPeriodsInOneYearCalculator();
@Override
public NewLoanScheduleData generate(
public LoanScheduleNewData generate(
ApplicationCurrency currency,
LoanProductRelatedDetail loanScheduleInfo,
LocalDate disbursementDate, LocalDate firstRepaymentDate,
@@ -117,7 +117,7 @@ public class EqualPrincipalAmortizationLoanScheduleGenerator implements Amortiza
currency.getDisplaySymbol(),
currency.getNameCode());
return new NewLoanScheduleData(currencyData, periods, loanTermInDays, cumulativePrincipalDisbursed, cumulativePrincipalDue,
return new LoanScheduleNewData(currencyData, periods, loanTermInDays, cumulativePrincipalDisbursed, cumulativePrincipalDue,
cumulativePrincipalOutstanding, cumulativeInterestExpected, cumulativeChargesToDate, totalExpectedRepayment);
}
}
@@ -9,7 +9,7 @@ import java.util.List;
import org.joda.time.Days;
import org.joda.time.LocalDate;
import org.mifosng.platform.api.NewLoanScheduleData;
import org.mifosng.platform.api.LoanScheduleNewData;
import org.mifosng.platform.api.data.CurrencyData;
import org.mifosng.platform.api.data.LoanSchedulePeriodData;
import org.mifosng.platform.currency.domain.ApplicationCurrency;
@@ -24,7 +24,7 @@ public class FlatMethodLoanScheduleGenerator implements LoanScheduleGenerator {
private final PaymentPeriodsInOneYearCalculator paymentPeriodsInOneYearCalculator = new DefaultPaymentPeriodsInOneYearCalculator();
@Override
public NewLoanScheduleData generate(
public LoanScheduleNewData generate(
final ApplicationCurrency currency,
final LoanProductRelatedDetail loanScheduleInfo,
final Integer loanTermFrequency,
@@ -125,7 +125,7 @@ public class FlatMethodLoanScheduleGenerator implements LoanScheduleGenerator {
currency.getDisplaySymbol(),
currency.getNameCode());
return new NewLoanScheduleData(currencyData, periods, loanTermInDays, cumulativePrincipalDisbursed, cumulativePrincipalDue,
return new LoanScheduleNewData(currencyData, periods, loanTermInDays, cumulativePrincipalDisbursed, cumulativePrincipalDue,
cumulativePrincipalOutstanding, cumulativeInterestExpected, cumulativeChargesToDate, totalExpectedRepayment);
}
}
@@ -1,14 +1,14 @@
package org.mifosng.platform.loanschedule.domain;
import org.joda.time.LocalDate;
import org.mifosng.platform.api.NewLoanScheduleData;
import org.mifosng.platform.api.LoanScheduleNewData;
import org.mifosng.platform.currency.domain.ApplicationCurrency;
import org.mifosng.platform.loan.domain.LoanProductRelatedDetail;
import org.mifosng.platform.loan.domain.PeriodFrequencyType;
public interface LoanScheduleGenerator {
NewLoanScheduleData generate(ApplicationCurrency applicationCurrency,
LoanScheduleNewData generate(ApplicationCurrency applicationCurrency,
LoanProductRelatedDetail loanScheduleInfo,
Integer loanTermFrequency,
PeriodFrequencyType loanTermFrequencyType,