MIFOSX-97: move loan packaging.

This commit is contained in:
Keith Woodlock
2012-12-01 15:38:59 +00:00
parent df283eb533
commit 017cc717e5
114 changed files with 497 additions and 453 deletions
@@ -26,7 +26,6 @@ import org.mifosng.platform.api.commands.DepositAccountWithdrawInterestCommand;
import org.mifosng.platform.api.commands.DepositAccountWithdrawalCommand; import org.mifosng.platform.api.commands.DepositAccountWithdrawalCommand;
import org.mifosng.platform.api.commands.DepositStateTransitionApprovalCommand; import org.mifosng.platform.api.commands.DepositStateTransitionApprovalCommand;
import org.mifosng.platform.api.commands.DepositStateTransitionCommand; import org.mifosng.platform.api.commands.DepositStateTransitionCommand;
import org.mifosng.platform.api.commands.UndoStateTransitionCommand;
import org.mifosng.platform.api.data.DepositAccountData; import org.mifosng.platform.api.data.DepositAccountData;
import org.mifosng.platform.api.data.DepositPermissionData; import org.mifosng.platform.api.data.DepositPermissionData;
import org.mifosng.platform.api.data.DepositProductLookup; import org.mifosng.platform.api.data.DepositProductLookup;
@@ -41,6 +40,7 @@ import org.mifosplatform.infrastructure.core.data.EntityIdentifier;
import org.mifosplatform.infrastructure.core.data.EnumOptionData; import org.mifosplatform.infrastructure.core.data.EnumOptionData;
import org.mifosplatform.infrastructure.core.exception.UnrecognizedQueryParamException; import org.mifosplatform.infrastructure.core.exception.UnrecognizedQueryParamException;
import org.mifosplatform.infrastructure.security.service.PlatformSecurityContext; import org.mifosplatform.infrastructure.security.service.PlatformSecurityContext;
import org.mifosplatform.portfolio.loanaccount.command.UndoStateTransitionCommand;
import org.mifosplatform.portfolio.loanproduct.domain.PeriodFrequencyType; import org.mifosplatform.portfolio.loanproduct.domain.PeriodFrequencyType;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope; import org.springframework.context.annotation.Scope;
@@ -6,12 +6,12 @@ import org.apache.commons.lang.StringUtils;
import org.joda.time.LocalDate; import org.joda.time.LocalDate;
import org.mifosng.platform.api.data.GuarantorData; import org.mifosng.platform.api.data.GuarantorData;
import org.mifosng.platform.exceptions.GuarantorNotFoundException; import org.mifosng.platform.exceptions.GuarantorNotFoundException;
import org.mifosng.platform.exceptions.LoanNotFoundException;
import org.mifosng.platform.loan.domain.Loan;
import org.mifosng.platform.loan.domain.LoanRepository;
import org.mifosplatform.infrastructure.dataqueries.data.GenericResultsetData; import org.mifosplatform.infrastructure.dataqueries.data.GenericResultsetData;
import org.mifosplatform.infrastructure.dataqueries.service.ReadWriteNonCoreDataService; import org.mifosplatform.infrastructure.dataqueries.service.ReadWriteNonCoreDataService;
import org.mifosplatform.portfolio.client.domain.Client; import org.mifosplatform.portfolio.client.domain.Client;
import org.mifosplatform.portfolio.loanaccount.domain.Loan;
import org.mifosplatform.portfolio.loanaccount.domain.LoanRepository;
import org.mifosplatform.portfolio.loanaccount.exception.LoanNotFoundException;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@@ -10,15 +10,15 @@ import java.util.Set;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.mifosng.platform.api.commands.GuarantorCommand; import org.mifosng.platform.api.commands.GuarantorCommand;
import org.mifosng.platform.exceptions.InvalidGuarantorException; import org.mifosng.platform.exceptions.InvalidGuarantorException;
import org.mifosng.platform.exceptions.LoanNotFoundException;
import org.mifosng.platform.loan.domain.Loan;
import org.mifosng.platform.loan.domain.LoanRepository;
import org.mifosplatform.infrastructure.core.data.ApiParameterError; import org.mifosplatform.infrastructure.core.data.ApiParameterError;
import org.mifosplatform.infrastructure.core.exception.PlatformApiDataValidationException; import org.mifosplatform.infrastructure.core.exception.PlatformApiDataValidationException;
import org.mifosplatform.infrastructure.dataqueries.service.ReadWriteNonCoreDataService; import org.mifosplatform.infrastructure.dataqueries.service.ReadWriteNonCoreDataService;
import org.mifosplatform.portfolio.client.domain.Client; import org.mifosplatform.portfolio.client.domain.Client;
import org.mifosplatform.portfolio.client.domain.ClientRepository; import org.mifosplatform.portfolio.client.domain.ClientRepository;
import org.mifosplatform.portfolio.client.exception.ClientNotFoundException; import org.mifosplatform.portfolio.client.exception.ClientNotFoundException;
import org.mifosplatform.portfolio.loanaccount.domain.Loan;
import org.mifosplatform.portfolio.loanaccount.domain.LoanRepository;
import org.mifosplatform.portfolio.loanaccount.exception.LoanNotFoundException;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@@ -1,9 +0,0 @@
package org.mifosng.platform.loan.service;
import org.mifosng.platform.api.commands.CalculateLoanScheduleCommand;
import org.mifosng.platform.api.data.LoanScheduleData;
public interface CalculationPlatformService {
LoanScheduleData calculateLoanSchedule(CalculateLoanScheduleCommand command);
}
@@ -5,8 +5,8 @@ import org.mifosng.platform.api.commands.DepositAccountWithdrawInterestCommand;
import org.mifosng.platform.api.commands.DepositAccountWithdrawalCommand; import org.mifosng.platform.api.commands.DepositAccountWithdrawalCommand;
import org.mifosng.platform.api.commands.DepositStateTransitionApprovalCommand; import org.mifosng.platform.api.commands.DepositStateTransitionApprovalCommand;
import org.mifosng.platform.api.commands.DepositStateTransitionCommand; import org.mifosng.platform.api.commands.DepositStateTransitionCommand;
import org.mifosng.platform.api.commands.UndoStateTransitionCommand;
import org.mifosplatform.infrastructure.core.data.EntityIdentifier; import org.mifosplatform.infrastructure.core.data.EntityIdentifier;
import org.mifosplatform.portfolio.loanaccount.command.UndoStateTransitionCommand;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
public interface DepositAccountWritePlatformService { public interface DepositAccountWritePlatformService {
@@ -12,7 +12,6 @@ import org.mifosng.platform.api.commands.DepositAccountWithdrawInterestCommand;
import org.mifosng.platform.api.commands.DepositAccountWithdrawalCommand; import org.mifosng.platform.api.commands.DepositAccountWithdrawalCommand;
import org.mifosng.platform.api.commands.DepositStateTransitionApprovalCommand; import org.mifosng.platform.api.commands.DepositStateTransitionApprovalCommand;
import org.mifosng.platform.api.commands.DepositStateTransitionCommand; import org.mifosng.platform.api.commands.DepositStateTransitionCommand;
import org.mifosng.platform.api.commands.UndoStateTransitionCommand;
import org.mifosng.platform.exceptions.DepositAccountNotFoundException; import org.mifosng.platform.exceptions.DepositAccountNotFoundException;
import org.mifosng.platform.exceptions.DepositAccountReopenException; import org.mifosng.platform.exceptions.DepositAccountReopenException;
import org.mifosng.platform.exceptions.DepositAccountTransactionsException; import org.mifosng.platform.exceptions.DepositAccountTransactionsException;
@@ -29,6 +28,7 @@ import org.mifosplatform.infrastructure.core.exception.PlatformDataIntegrityExce
import org.mifosplatform.infrastructure.security.service.PlatformSecurityContext; import org.mifosplatform.infrastructure.security.service.PlatformSecurityContext;
import org.mifosplatform.portfolio.client.domain.Note; import org.mifosplatform.portfolio.client.domain.Note;
import org.mifosplatform.portfolio.client.domain.NoteRepository; import org.mifosplatform.portfolio.client.domain.NoteRepository;
import org.mifosplatform.portfolio.loanaccount.command.UndoStateTransitionCommand;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@@ -63,15 +63,15 @@ public class ApiParameterHelper {
return exportCsv; return exportCsv;
} }
public static boolean exportPdf(final MultivaluedMap<String, String> queryParams) { public static boolean exportPdf(final MultivaluedMap<String, String> queryParams) {
boolean exportPDF = false; boolean exportPDF = false;
if (queryParams.getFirst("exportPDF") != null) { if (queryParams.getFirst("exportPDF") != null) {
String exportPdfValue = queryParams.getFirst("exportPDF"); String exportPdfValue = queryParams.getFirst("exportPDF");
exportPDF = "true".equalsIgnoreCase(exportPdfValue); exportPDF = "true".equalsIgnoreCase(exportPdfValue);
} }
return exportPDF; return exportPDF;
} }
public static boolean parameterType(final MultivaluedMap<String, String> queryParams) { public static boolean parameterType(final MultivaluedMap<String, String> queryParams) {
boolean parameterType = false; boolean parameterType = false;
if (queryParams.getFirst("parameterType") != null) { if (queryParams.getFirst("parameterType") != null) {
@@ -11,10 +11,6 @@ import org.mifosng.platform.api.data.DocumentData;
import org.mifosng.platform.api.data.GroupAccountSummaryCollectionData; import org.mifosng.platform.api.data.GroupAccountSummaryCollectionData;
import org.mifosng.platform.api.data.GroupData; import org.mifosng.platform.api.data.GroupData;
import org.mifosng.platform.api.data.GuarantorData; import org.mifosng.platform.api.data.GuarantorData;
import org.mifosng.platform.api.data.LoanAccountData;
import org.mifosng.platform.api.data.LoanChargeData;
import org.mifosng.platform.api.data.LoanScheduleData;
import org.mifosng.platform.api.data.LoanTransactionData;
import org.mifosng.platform.api.data.SavingAccountData; import org.mifosng.platform.api.data.SavingAccountData;
import org.mifosng.platform.api.data.SavingProductData; import org.mifosng.platform.api.data.SavingProductData;
import org.mifosplatform.commands.api.data.CommandSourceData; import org.mifosplatform.commands.api.data.CommandSourceData;
@@ -38,6 +34,10 @@ import org.mifosplatform.portfolio.client.data.ClientData;
import org.mifosplatform.portfolio.client.data.ClientIdentifierData; import org.mifosplatform.portfolio.client.data.ClientIdentifierData;
import org.mifosplatform.portfolio.client.data.NoteData; import org.mifosplatform.portfolio.client.data.NoteData;
import org.mifosplatform.portfolio.fund.data.FundData; import org.mifosplatform.portfolio.fund.data.FundData;
import org.mifosplatform.portfolio.loanaccount.data.LoanAccountData;
import org.mifosplatform.portfolio.loanaccount.data.LoanChargeData;
import org.mifosplatform.portfolio.loanaccount.data.LoanScheduleData;
import org.mifosplatform.portfolio.loanaccount.data.LoanTransactionData;
import org.mifosplatform.portfolio.loanproduct.data.LoanProductData; import org.mifosplatform.portfolio.loanproduct.data.LoanProductData;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@@ -19,54 +19,51 @@ import com.google.gson.GsonBuilder;
@Service @Service
public class GoogleGsonSerializerHelper { public class GoogleGsonSerializerHelper {
public Gson createGsonBuilder(final boolean prettyPrint) { public Gson createGsonBuilder(final boolean prettyPrint) {
final GsonBuilder builder = new GsonBuilder(); final GsonBuilder builder = new GsonBuilder();
builder.registerTypeAdapter(LocalDate.class, new JodaLocalDateAdapter()); builder.registerTypeAdapter(LocalDate.class, new JodaLocalDateAdapter());
builder.registerTypeAdapter(DateTime.class, new JodaDateTimeAdapter()); builder.registerTypeAdapter(DateTime.class, new JodaDateTimeAdapter());
if (prettyPrint) { if (prettyPrint) {
builder.setPrettyPrinting(); builder.setPrettyPrinting();
} }
return builder.create(); return builder.create();
} }
public Gson createGsonBuilderWithParameterExclusionSerializationStrategy( public Gson createGsonBuilderWithParameterExclusionSerializationStrategy(final Set<String> supportedParameters,
final Set<String> supportedParameters, final boolean prettyPrint, final Set<String> responseParameters) {
final boolean prettyPrint,
final Set<String> responseParameters) {
final Set<String> parameterNamesToSkip = new HashSet<String>(); final Set<String> parameterNamesToSkip = new HashSet<String>();
if (!responseParameters.isEmpty()) { if (!responseParameters.isEmpty()) {
// strip out all known support parameters from expected response to // strip out all known support parameters from expected response to
// see if unsupported parameters requested for response. // see if unsupported parameters requested for response.
final Set<String> differentParametersDetectedSet = new HashSet<String>(responseParameters); final Set<String> differentParametersDetectedSet = new HashSet<String>(responseParameters);
differentParametersDetectedSet.removeAll(supportedParameters); differentParametersDetectedSet.removeAll(supportedParameters);
if (!differentParametersDetectedSet.isEmpty()) { if (!differentParametersDetectedSet.isEmpty()) { throw new UnsupportedParameterException(new ArrayList<String>(
throw new UnsupportedParameterException(new ArrayList<String>(differentParametersDetectedSet)); differentParametersDetectedSet)); }
}
parameterNamesToSkip.addAll(supportedParameters); parameterNamesToSkip.addAll(supportedParameters);
parameterNamesToSkip.removeAll(responseParameters); parameterNamesToSkip.removeAll(responseParameters);
} }
final ExclusionStrategy strategy = new ParameterListExclusionStrategy(parameterNamesToSkip); final ExclusionStrategy strategy = new ParameterListExclusionStrategy(parameterNamesToSkip);
final GsonBuilder builder = new GsonBuilder().addSerializationExclusionStrategy(strategy); final GsonBuilder builder = new GsonBuilder().addSerializationExclusionStrategy(strategy);
builder.registerTypeAdapter(LocalDate.class, new JodaLocalDateAdapter()); builder.registerTypeAdapter(LocalDate.class, new JodaLocalDateAdapter());
builder.registerTypeAdapter(DateTime.class, new JodaDateTimeAdapter()); builder.registerTypeAdapter(DateTime.class, new JodaDateTimeAdapter());
if (prettyPrint) { if (prettyPrint) {
builder.setPrettyPrinting(); builder.setPrettyPrinting();
} }
return builder.create(); return builder.create();
} }
public String serializedJsonFrom(final Gson serializer, final Object[] dataObjects) { public String serializedJsonFrom(final Gson serializer, final Object[] dataObjects) {
return serializer.toJson(dataObjects); return serializer.toJson(dataObjects);
} }
public String serializedJsonFrom(final Gson serializer, final Object singleDataObject) { public String serializedJsonFrom(final Gson serializer, final Object singleDataObject) {
return serializer.toJson(singleDataObject); return serializer.toJson(singleDataObject);
} }
} }
@@ -10,20 +10,20 @@ import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer; import com.google.gson.JsonSerializer;
/** /**
* Serializer for joda time {@link DateTime} that returns date as long to match previous functionality. * Serializer for joda time {@link DateTime} that returns date as long to match
* previous functionality.
*/ */
public class JodaDateTimeAdapter implements JsonSerializer<DateTime> { public class JodaDateTimeAdapter implements JsonSerializer<DateTime> {
@SuppressWarnings("unused") @SuppressWarnings("unused")
@Override @Override
public JsonElement serialize(DateTime src, Type typeOfSrc, JsonSerializationContext context) { public JsonElement serialize(DateTime src, Type typeOfSrc, JsonSerializationContext context) {
JsonElement element = null; JsonElement element = null;
if (src != null) { if (src != null) {
element = new JsonPrimitive(src.getMillis()); element = new JsonPrimitive(src.getMillis());
} }
return element;
}
return element;
}
} }
@@ -11,23 +11,23 @@ import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer; import com.google.gson.JsonSerializer;
/** /**
* Serializer for joda time {@link LocalDate} that returns date in array format to match previous jackson functionality. * Serializer for joda time {@link LocalDate} that returns date in array format
* to match previous jackson functionality.
*/ */
public class JodaLocalDateAdapter implements JsonSerializer<LocalDate> { public class JodaLocalDateAdapter implements JsonSerializer<LocalDate> {
@SuppressWarnings("unused") @SuppressWarnings("unused")
@Override @Override
public JsonElement serialize(LocalDate src, Type typeOfSrc, JsonSerializationContext context) { public JsonElement serialize(LocalDate src, Type typeOfSrc, JsonSerializationContext context) {
JsonArray array = null; JsonArray array = null;
if (src != null) { if (src != null) {
array = new JsonArray(); array = new JsonArray();
array.add(new JsonPrimitive(src.getYearOfEra())); array.add(new JsonPrimitive(src.getYearOfEra()));
array.add(new JsonPrimitive(src.getMonthOfYear())); array.add(new JsonPrimitive(src.getMonthOfYear()));
array.add(new JsonPrimitive(src.getDayOfMonth())); array.add(new JsonPrimitive(src.getDayOfMonth()));
} }
return array;
}
return array;
}
} }
@@ -74,7 +74,8 @@ public class JsonParserHelper {
return stringValue; return stringValue;
} }
public BigDecimal extractBigDecimalWithLocaleNamed(final String parameterName, final JsonElement element, final Set<String> modifiedParameters) { public BigDecimal extractBigDecimalWithLocaleNamed(final String parameterName, final JsonElement element,
final Set<String> modifiedParameters) {
BigDecimal value = null; BigDecimal value = null;
if (element.isJsonObject()) { if (element.isJsonObject()) {
final JsonObject object = element.getAsJsonObject(); final JsonObject object = element.getAsJsonObject();
@@ -11,20 +11,20 @@ import com.google.gson.FieldAttributes;
// into account the Object its looking at. // into account the Object its looking at.
public class ParameterListExclusionStrategy implements ExclusionStrategy { public class ParameterListExclusionStrategy implements ExclusionStrategy {
private final Set<String> parameterNamesToSkip; private final Set<String> parameterNamesToSkip;
public ParameterListExclusionStrategy(final Set<String> parameterNamesToSkip) { public ParameterListExclusionStrategy(final Set<String> parameterNamesToSkip) {
this.parameterNamesToSkip = parameterNamesToSkip; this.parameterNamesToSkip = parameterNamesToSkip;
} }
@Override @Override
public boolean shouldSkipField(FieldAttributes f) { public boolean shouldSkipField(FieldAttributes f) {
return parameterNamesToSkip.contains(f.getName()); return parameterNamesToSkip.contains(f.getName());
} }
@SuppressWarnings("unused") @SuppressWarnings("unused")
@Override @Override
public boolean shouldSkipClass(Class<?> clazz) { public boolean shouldSkipClass(Class<?> clazz) {
return false; return false;
} }
} }
@@ -1,6 +1,5 @@
package org.mifosplatform.infrastructure.core.api; package org.mifosplatform.infrastructure.core.api;
import org.mifosng.platform.api.commands.AdjustLoanTransactionCommand;
import org.mifosng.platform.api.commands.DepositAccountCommand; import org.mifosng.platform.api.commands.DepositAccountCommand;
import org.mifosng.platform.api.commands.DepositAccountWithdrawInterestCommand; import org.mifosng.platform.api.commands.DepositAccountWithdrawInterestCommand;
import org.mifosng.platform.api.commands.DepositAccountWithdrawalCommand; import org.mifosng.platform.api.commands.DepositAccountWithdrawalCommand;
@@ -9,10 +8,6 @@ import org.mifosng.platform.api.commands.DepositStateTransitionApprovalCommand;
import org.mifosng.platform.api.commands.DepositStateTransitionCommand; import org.mifosng.platform.api.commands.DepositStateTransitionCommand;
import org.mifosng.platform.api.commands.GroupCommand; import org.mifosng.platform.api.commands.GroupCommand;
import org.mifosng.platform.api.commands.GuarantorCommand; import org.mifosng.platform.api.commands.GuarantorCommand;
import org.mifosng.platform.api.commands.LoanApplicationCommand;
import org.mifosng.platform.api.commands.LoanChargeCommand;
import org.mifosng.platform.api.commands.LoanStateTransitionCommand;
import org.mifosng.platform.api.commands.LoanTransactionCommand;
import org.mifosng.platform.api.commands.SavingAccountCommand; import org.mifosng.platform.api.commands.SavingAccountCommand;
import org.mifosng.platform.api.commands.SavingProductCommand; import org.mifosng.platform.api.commands.SavingProductCommand;
import org.mifosplatform.infrastructure.codes.command.CodeCommand; import org.mifosplatform.infrastructure.codes.command.CodeCommand;
@@ -31,6 +26,11 @@ import org.mifosplatform.portfolio.client.command.ClientIdentifierCommand;
import org.mifosplatform.portfolio.client.command.NoteCommand; import org.mifosplatform.portfolio.client.command.NoteCommand;
import org.mifosplatform.portfolio.client.data.ClientData; import org.mifosplatform.portfolio.client.data.ClientData;
import org.mifosplatform.portfolio.fund.command.FundCommand; import org.mifosplatform.portfolio.fund.command.FundCommand;
import org.mifosplatform.portfolio.loanaccount.command.AdjustLoanTransactionCommand;
import org.mifosplatform.portfolio.loanaccount.command.LoanApplicationCommand;
import org.mifosplatform.portfolio.loanaccount.command.LoanChargeCommand;
import org.mifosplatform.portfolio.loanaccount.command.LoanStateTransitionCommand;
import org.mifosplatform.portfolio.loanaccount.command.LoanTransactionCommand;
import org.mifosplatform.portfolio.loanproduct.command.LoanProductCommand; import org.mifosplatform.portfolio.loanproduct.command.LoanProductCommand;
public interface PortfolioApiDataConversionService { public interface PortfolioApiDataConversionService {
@@ -65,7 +65,7 @@ public interface PortfolioApiDataConversionService {
GroupCommand convertJsonToGroupCommand(Long resourceIdentifier, String json); GroupCommand convertJsonToGroupCommand(Long resourceIdentifier, String json);
LoanApplicationCommand convertJsonToLoanApplicationCommand(Long resourceIdentifier, String json); LoanApplicationCommand convertApiRequestJsonToLoanApplicationCommand(Long resourceIdentifier, String json);
LoanChargeCommand convertJsonToLoanChargeCommand(Long loanChargeId, Long loanId, String json); LoanChargeCommand convertJsonToLoanChargeCommand(Long loanChargeId, Long loanId, String json);
@@ -17,7 +17,6 @@ import java.util.Set;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.joda.time.LocalDate; import org.joda.time.LocalDate;
import org.joda.time.format.DateTimeFormat; import org.joda.time.format.DateTimeFormat;
import org.mifosng.platform.api.commands.AdjustLoanTransactionCommand;
import org.mifosng.platform.api.commands.DepositAccountCommand; import org.mifosng.platform.api.commands.DepositAccountCommand;
import org.mifosng.platform.api.commands.DepositAccountWithdrawInterestCommand; import org.mifosng.platform.api.commands.DepositAccountWithdrawInterestCommand;
import org.mifosng.platform.api.commands.DepositAccountWithdrawalCommand; import org.mifosng.platform.api.commands.DepositAccountWithdrawalCommand;
@@ -26,10 +25,6 @@ import org.mifosng.platform.api.commands.DepositStateTransitionApprovalCommand;
import org.mifosng.platform.api.commands.DepositStateTransitionCommand; import org.mifosng.platform.api.commands.DepositStateTransitionCommand;
import org.mifosng.platform.api.commands.GroupCommand; import org.mifosng.platform.api.commands.GroupCommand;
import org.mifosng.platform.api.commands.GuarantorCommand; import org.mifosng.platform.api.commands.GuarantorCommand;
import org.mifosng.platform.api.commands.LoanApplicationCommand;
import org.mifosng.platform.api.commands.LoanChargeCommand;
import org.mifosng.platform.api.commands.LoanStateTransitionCommand;
import org.mifosng.platform.api.commands.LoanTransactionCommand;
import org.mifosng.platform.api.commands.SavingAccountCommand; import org.mifosng.platform.api.commands.SavingAccountCommand;
import org.mifosng.platform.api.commands.SavingProductCommand; import org.mifosng.platform.api.commands.SavingProductCommand;
import org.mifosplatform.infrastructure.codes.command.CodeCommand; import org.mifosplatform.infrastructure.codes.command.CodeCommand;
@@ -52,6 +47,11 @@ import org.mifosplatform.portfolio.client.command.ClientIdentifierCommand;
import org.mifosplatform.portfolio.client.command.NoteCommand; import org.mifosplatform.portfolio.client.command.NoteCommand;
import org.mifosplatform.portfolio.client.data.ClientData; import org.mifosplatform.portfolio.client.data.ClientData;
import org.mifosplatform.portfolio.fund.command.FundCommand; import org.mifosplatform.portfolio.fund.command.FundCommand;
import org.mifosplatform.portfolio.loanaccount.command.AdjustLoanTransactionCommand;
import org.mifosplatform.portfolio.loanaccount.command.LoanApplicationCommand;
import org.mifosplatform.portfolio.loanaccount.command.LoanChargeCommand;
import org.mifosplatform.portfolio.loanaccount.command.LoanStateTransitionCommand;
import org.mifosplatform.portfolio.loanaccount.command.LoanTransactionCommand;
import org.mifosplatform.portfolio.loanproduct.command.LoanProductCommand; import org.mifosplatform.portfolio.loanproduct.command.LoanProductCommand;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.number.NumberFormatter; import org.springframework.format.number.NumberFormatter;
@@ -115,13 +115,14 @@ public class PortfolioApiDataConversionServiceImpl implements PortfolioApiDataCo
final Integer chargeTimeType = helper.extractIntegerWithLocaleNamed("chargeTimeType", element, parametersPassedInRequest); final Integer chargeTimeType = helper.extractIntegerWithLocaleNamed("chargeTimeType", element, parametersPassedInRequest);
final Integer chargeAppliesTo = helper.extractIntegerWithLocaleNamed("chargeAppliesTo", element, parametersPassedInRequest); final Integer chargeAppliesTo = helper.extractIntegerWithLocaleNamed("chargeAppliesTo", element, parametersPassedInRequest);
final Integer chargeCalculationType = helper.extractIntegerWithLocaleNamed("chargeCalculationType", element, parametersPassedInRequest); final Integer chargeCalculationType = helper.extractIntegerWithLocaleNamed("chargeCalculationType", element,
parametersPassedInRequest);
final Boolean penalty = helper.extractBooleanNamed("penalty", element, parametersPassedInRequest); final Boolean penalty = helper.extractBooleanNamed("penalty", element, parametersPassedInRequest);
final Boolean active = helper.extractBooleanNamed("active", element, parametersPassedInRequest); final Boolean active = helper.extractBooleanNamed("active", element, parametersPassedInRequest);
return new ChargeDefinitionCommand(parametersPassedInRequest, false, resourceIdentifier, name, amount, currencyCode, chargeTimeType, chargeAppliesTo, return new ChargeDefinitionCommand(parametersPassedInRequest, false, resourceIdentifier, name, amount, currencyCode,
chargeCalculationType, penalty, active); chargeTimeType, chargeAppliesTo, chargeCalculationType, penalty, active);
} }
@Override @Override
@@ -548,7 +549,8 @@ public class PortfolioApiDataConversionServiceImpl implements PortfolioApiDataCo
final BigDecimal principal = helper.extractBigDecimalWithLocaleNamed("principal", element, modifiedParameters); final BigDecimal principal = helper.extractBigDecimalWithLocaleNamed("principal", element, modifiedParameters);
final BigDecimal inArrearsTolerance = helper.extractBigDecimalWithLocaleNamed("inArrearsTolerance", element, modifiedParameters); final BigDecimal inArrearsTolerance = helper.extractBigDecimalWithLocaleNamed("inArrearsTolerance", element, modifiedParameters);
final BigDecimal interestRatePerPeriod = helper.extractBigDecimalWithLocaleNamed("interestRatePerPeriod", element, modifiedParameters); final BigDecimal interestRatePerPeriod = helper.extractBigDecimalWithLocaleNamed("interestRatePerPeriod", element,
modifiedParameters);
final Integer repaymentEvery = helper.extractIntegerWithLocaleNamed("repaymentEvery", element, modifiedParameters); final Integer repaymentEvery = helper.extractIntegerWithLocaleNamed("repaymentEvery", element, modifiedParameters);
final Integer numberOfRepayments = helper.extractIntegerWithLocaleNamed("numberOfRepayments", element, modifiedParameters); final Integer numberOfRepayments = helper.extractIntegerWithLocaleNamed("numberOfRepayments", element, modifiedParameters);
final Integer repaymentFrequencyType = helper.extractIntegerWithLocaleNamed("repaymentFrequencyType", element, modifiedParameters); final Integer repaymentFrequencyType = helper.extractIntegerWithLocaleNamed("repaymentFrequencyType", element, modifiedParameters);
@@ -561,7 +563,8 @@ public class PortfolioApiDataConversionServiceImpl implements PortfolioApiDataCo
// final Integer loanTermFrequencyType = // final Integer loanTermFrequencyType =
// helper.extractIntegerNamed("loanTermFrequencyType", element, // helper.extractIntegerNamed("loanTermFrequencyType", element,
// modifiedParameters); // modifiedParameters);
final Integer interestRateFrequencyType = helper.extractIntegerWithLocaleNamed("interestRateFrequencyType", element, modifiedParameters); final Integer interestRateFrequencyType = helper.extractIntegerWithLocaleNamed("interestRateFrequencyType", element,
modifiedParameters);
final Integer amortizationType = helper.extractIntegerWithLocaleNamed("amortizationType", element, modifiedParameters); final Integer amortizationType = helper.extractIntegerWithLocaleNamed("amortizationType", element, modifiedParameters);
final Integer interestType = helper.extractIntegerWithLocaleNamed("interestType", element, modifiedParameters); final Integer interestType = helper.extractIntegerWithLocaleNamed("interestType", element, modifiedParameters);
final Integer interestCalculationPeriodType = helper.extractIntegerWithLocaleNamed("interestCalculationPeriodType", element, final Integer interestCalculationPeriodType = helper.extractIntegerWithLocaleNamed("interestCalculationPeriodType", element,
@@ -580,13 +583,14 @@ public class PortfolioApiDataConversionServiceImpl implements PortfolioApiDataCo
} }
} }
return new LoanProductCommand(modifiedParameters, false, resourceIdentifier, name, description, fundId, transactionProcessingStrategyId, return new LoanProductCommand(modifiedParameters, false, resourceIdentifier, name, description, fundId,
currencyCode, digitsAfterDecimal, principal, inArrearsTolerance, numberOfRepayments, repaymentEvery, interestRatePerPeriod, transactionProcessingStrategyId, currencyCode, digitsAfterDecimal, principal, inArrearsTolerance, numberOfRepayments,
repaymentFrequencyType, interestRateFrequencyType, amortizationType, interestType, interestCalculationPeriodType, charges); repaymentEvery, interestRatePerPeriod, repaymentFrequencyType, interestRateFrequencyType, amortizationType, interestType,
interestCalculationPeriodType, charges);
} }
@Override @Override
public LoanApplicationCommand convertJsonToLoanApplicationCommand(final Long resourceIdentifier, final String json) { public LoanApplicationCommand convertApiRequestJsonToLoanApplicationCommand(final Long resourceIdentifier, final String json) {
if (StringUtils.isBlank(json)) { throw new InvalidJsonException(); } if (StringUtils.isBlank(json)) { throw new InvalidJsonException(); }
@@ -617,14 +621,18 @@ public class PortfolioApiDataConversionServiceImpl implements PortfolioApiDataCo
parametersPassedInCommand); parametersPassedInCommand);
final String externalId = helper.extractStringNamed("externalId", element, parametersPassedInCommand); final String externalId = helper.extractStringNamed("externalId", element, parametersPassedInCommand);
final BigDecimal principal = helper.extractBigDecimalWithLocaleNamed("principal", element, parametersPassedInCommand); final BigDecimal principal = helper.extractBigDecimalWithLocaleNamed("principal", element, parametersPassedInCommand);
final BigDecimal inArrearsToleranceValue = helper.extractBigDecimalWithLocaleNamed("inArrearsTolerance", element, parametersPassedInCommand); final BigDecimal inArrearsToleranceValue = helper.extractBigDecimalWithLocaleNamed("inArrearsTolerance", element,
final BigDecimal interestRatePerPeriod = helper.extractBigDecimalWithLocaleNamed("interestRatePerPeriod", element, parametersPassedInCommand); parametersPassedInCommand);
final BigDecimal interestRatePerPeriod = helper.extractBigDecimalWithLocaleNamed("interestRatePerPeriod", element,
parametersPassedInCommand);
final Integer repaymentEvery = helper.extractIntegerWithLocaleNamed("repaymentEvery", element, parametersPassedInCommand); final Integer repaymentEvery = helper.extractIntegerWithLocaleNamed("repaymentEvery", element, parametersPassedInCommand);
final Integer numberOfRepayments = helper.extractIntegerWithLocaleNamed("numberOfRepayments", element, parametersPassedInCommand); final Integer numberOfRepayments = helper.extractIntegerWithLocaleNamed("numberOfRepayments", element, parametersPassedInCommand);
final Integer repaymentFrequencyType = helper.extractIntegerWithLocaleNamed("repaymentFrequencyType", element, parametersPassedInCommand); final Integer repaymentFrequencyType = helper.extractIntegerWithLocaleNamed("repaymentFrequencyType", element,
parametersPassedInCommand);
final Integer loanTermFrequency = helper.extractIntegerWithLocaleNamed("loanTermFrequency", element, parametersPassedInCommand); final Integer loanTermFrequency = helper.extractIntegerWithLocaleNamed("loanTermFrequency", element, parametersPassedInCommand);
final Integer loanTermFrequencyType = helper.extractIntegerWithLocaleNamed("loanTermFrequencyType", element, parametersPassedInCommand); final Integer loanTermFrequencyType = helper.extractIntegerWithLocaleNamed("loanTermFrequencyType", element,
parametersPassedInCommand);
final Integer interestRateFrequencyType = helper.extractIntegerWithLocaleNamed("interestRateFrequencyType", element, final Integer interestRateFrequencyType = helper.extractIntegerWithLocaleNamed("interestRateFrequencyType", element,
parametersPassedInCommand); parametersPassedInCommand);
final Integer amortizationType = helper.extractIntegerWithLocaleNamed("amortizationType", element, parametersPassedInCommand); final Integer amortizationType = helper.extractIntegerWithLocaleNamed("amortizationType", element, parametersPassedInCommand);
@@ -1493,7 +1501,8 @@ public class PortfolioApiDataConversionServiceImpl implements PortfolioApiDataCo
} }
@Override @Override
public ClientIdentifierCommand convertApiRequestJsonToClientIdentifierCommand(final Long resourceIdentifier, final Long clientId, final String json) { public ClientIdentifierCommand convertApiRequestJsonToClientIdentifierCommand(final Long resourceIdentifier, final Long clientId,
final String json) {
if (StringUtils.isBlank(json)) { throw new InvalidJsonException(); } if (StringUtils.isBlank(json)) { throw new InvalidJsonException(); }
Type typeOfMap = new TypeToken<Map<String, String>>() {}.getType(); Type typeOfMap = new TypeToken<Map<String, String>>() {}.getType();
@@ -1517,7 +1526,8 @@ public class PortfolioApiDataConversionServiceImpl implements PortfolioApiDataCo
checkForUnsupportedParameters(requestMap, supportedParams); checkForUnsupportedParameters(requestMap, supportedParams);
// no difference between api request json format and internal command json format. // no difference between api request json format and internal command
// json format.
return this.portfolioCommandDeserializerService.deserializeCodeCommand(resourceIdentifier, json, false); return this.portfolioCommandDeserializerService.deserializeCodeCommand(resourceIdentifier, json, false);
} }
@@ -9,10 +9,6 @@ import org.mifosng.platform.api.data.DocumentData;
import org.mifosng.platform.api.data.GroupAccountSummaryCollectionData; import org.mifosng.platform.api.data.GroupAccountSummaryCollectionData;
import org.mifosng.platform.api.data.GroupData; import org.mifosng.platform.api.data.GroupData;
import org.mifosng.platform.api.data.GuarantorData; import org.mifosng.platform.api.data.GuarantorData;
import org.mifosng.platform.api.data.LoanAccountData;
import org.mifosng.platform.api.data.LoanChargeData;
import org.mifosng.platform.api.data.LoanScheduleData;
import org.mifosng.platform.api.data.LoanTransactionData;
import org.mifosng.platform.api.data.SavingAccountData; import org.mifosng.platform.api.data.SavingAccountData;
import org.mifosng.platform.api.data.SavingProductData; import org.mifosng.platform.api.data.SavingProductData;
import org.mifosplatform.commands.api.data.CommandSourceData; import org.mifosplatform.commands.api.data.CommandSourceData;
@@ -36,6 +32,10 @@ import org.mifosplatform.portfolio.client.data.ClientData;
import org.mifosplatform.portfolio.client.data.ClientIdentifierData; import org.mifosplatform.portfolio.client.data.ClientIdentifierData;
import org.mifosplatform.portfolio.client.data.NoteData; import org.mifosplatform.portfolio.client.data.NoteData;
import org.mifosplatform.portfolio.fund.data.FundData; import org.mifosplatform.portfolio.fund.data.FundData;
import org.mifosplatform.portfolio.loanaccount.data.LoanAccountData;
import org.mifosplatform.portfolio.loanaccount.data.LoanChargeData;
import org.mifosplatform.portfolio.loanaccount.data.LoanScheduleData;
import org.mifosplatform.portfolio.loanaccount.data.LoanTransactionData;
import org.mifosplatform.portfolio.loanproduct.data.LoanProductData; import org.mifosplatform.portfolio.loanproduct.data.LoanProductData;
public interface PortfolioApiJsonSerializerService { public interface PortfolioApiJsonSerializerService {
@@ -53,5 +53,6 @@ public interface PortfolioCommandDeserializerService {
LoanProductCommand deserializeLoanProductCommand(Long loanProductId, String commandAsJson, boolean makerCheckerApproval); LoanProductCommand deserializeLoanProductCommand(Long loanProductId, String commandAsJson, boolean makerCheckerApproval);
ClientIdentifierCommand deserializeClientIdentifierCommand(Long clientIdentifierId, Long clientId, String commandAsJson, boolean makerCheckerApproval); ClientIdentifierCommand deserializeClientIdentifierCommand(Long clientIdentifierId, Long clientId, String commandAsJson,
boolean makerCheckerApproval);
} }
@@ -2,8 +2,8 @@ package org.mifosplatform.portfolio.charge.service;
import java.util.Collection; import java.util.Collection;
import org.mifosng.platform.api.data.LoanChargeData;
import org.mifosplatform.portfolio.charge.data.ChargeData; import org.mifosplatform.portfolio.charge.data.ChargeData;
import org.mifosplatform.portfolio.loanaccount.data.LoanChargeData;
// FIXME - KW - break out methods that belong to product charges and loan charges // FIXME - KW - break out methods that belong to product charges and loan charges
public interface ChargeReadPlatformService { public interface ChargeReadPlatformService {
@@ -7,7 +7,6 @@ import java.util.Collection;
import java.util.List; import java.util.List;
import org.joda.time.LocalDate; import org.joda.time.LocalDate;
import org.mifosng.platform.api.data.LoanChargeData;
import org.mifosplatform.infrastructure.configuration.data.CurrencyData; import org.mifosplatform.infrastructure.configuration.data.CurrencyData;
import org.mifosplatform.infrastructure.configuration.service.CurrencyReadPlatformService; import org.mifosplatform.infrastructure.configuration.service.CurrencyReadPlatformService;
import org.mifosplatform.infrastructure.core.data.EnumOptionData; import org.mifosplatform.infrastructure.core.data.EnumOptionData;
@@ -17,6 +16,7 @@ import org.mifosplatform.infrastructure.security.service.PlatformSecurityContext
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.exception.ChargeNotFoundException; import org.mifosplatform.portfolio.charge.exception.ChargeNotFoundException;
import org.mifosplatform.portfolio.loanaccount.data.LoanChargeData;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.EmptyResultDataAccessException; import org.springframework.dao.EmptyResultDataAccessException;
import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.JdbcTemplate;
@@ -6,11 +6,11 @@ import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne; import javax.persistence.ManyToOne;
import javax.persistence.Table; import javax.persistence.Table;
import org.mifosng.platform.loan.domain.Loan;
import org.mifosng.platform.loan.domain.LoanTransaction;
import org.mifosng.platform.saving.domain.DepositAccount; import org.mifosng.platform.saving.domain.DepositAccount;
import org.mifosplatform.infrastructure.core.domain.AbstractAuditableCustom; import org.mifosplatform.infrastructure.core.domain.AbstractAuditableCustom;
import org.mifosplatform.infrastructure.user.domain.AppUser; import org.mifosplatform.infrastructure.user.domain.AppUser;
import org.mifosplatform.portfolio.loanaccount.domain.Loan;
import org.mifosplatform.portfolio.loanaccount.domain.LoanTransaction;
@Entity @Entity
@Table(name = "m_note") @Table(name = "m_note")
@@ -1,4 +1,4 @@
package org.mifosng.platform.api; package org.mifosplatform.portfolio.loanaccount.api;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collection; import java.util.Collection;
@@ -20,30 +20,15 @@ import javax.ws.rs.core.UriInfo;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.joda.time.LocalDate; import org.joda.time.LocalDate;
import org.mifosng.platform.api.commands.AdjustLoanTransactionCommand;
import org.mifosng.platform.api.commands.CalculateLoanScheduleCommand;
import org.mifosng.platform.api.commands.LoanApplicationCommand;
import org.mifosng.platform.api.commands.LoanChargeCommand;
import org.mifosng.platform.api.commands.LoanStateTransitionCommand;
import org.mifosng.platform.api.commands.LoanTransactionCommand;
import org.mifosng.platform.api.commands.UndoStateTransitionCommand;
import org.mifosng.platform.api.data.DisbursementData;
import org.mifosng.platform.api.data.GuarantorData; import org.mifosng.platform.api.data.GuarantorData;
import org.mifosng.platform.api.data.LoanAccountData;
import org.mifosng.platform.api.data.LoanBasicDetailsData;
import org.mifosng.platform.api.data.LoanChargeData;
import org.mifosng.platform.api.data.LoanPermissionData;
import org.mifosng.platform.api.data.LoanScheduleData;
import org.mifosng.platform.api.data.LoanTransactionData;
import org.mifosng.platform.guarantor.GuarantorReadPlatformService; import org.mifosng.platform.guarantor.GuarantorReadPlatformService;
import org.mifosng.platform.loan.service.CalculationPlatformService; import org.mifosplatform.commands.service.PortfolioCommandSourceWritePlatformService;
import org.mifosng.platform.loan.service.LoanReadPlatformService;
import org.mifosng.platform.loan.service.LoanWritePlatformService;
import org.mifosplatform.infrastructure.configuration.domain.MonetaryCurrency; import org.mifosplatform.infrastructure.configuration.domain.MonetaryCurrency;
import org.mifosplatform.infrastructure.configuration.domain.Money; import org.mifosplatform.infrastructure.configuration.domain.Money;
import org.mifosplatform.infrastructure.core.api.ApiParameterHelper; import org.mifosplatform.infrastructure.core.api.ApiParameterHelper;
import org.mifosplatform.infrastructure.core.api.PortfolioApiDataConversionService; import org.mifosplatform.infrastructure.core.api.PortfolioApiDataConversionService;
import org.mifosplatform.infrastructure.core.api.PortfolioApiJsonSerializerService; import org.mifosplatform.infrastructure.core.api.PortfolioApiJsonSerializerService;
import org.mifosplatform.infrastructure.core.api.PortfolioCommandSerializerService;
import org.mifosplatform.infrastructure.core.data.EntityIdentifier; import org.mifosplatform.infrastructure.core.data.EntityIdentifier;
import org.mifosplatform.infrastructure.core.data.EnumOptionData; import org.mifosplatform.infrastructure.core.data.EnumOptionData;
import org.mifosplatform.infrastructure.core.exception.UnrecognizedQueryParamException; import org.mifosplatform.infrastructure.core.exception.UnrecognizedQueryParamException;
@@ -59,6 +44,23 @@ import org.mifosplatform.portfolio.charge.data.ChargeData;
import org.mifosplatform.portfolio.charge.service.ChargeReadPlatformService; import org.mifosplatform.portfolio.charge.service.ChargeReadPlatformService;
import org.mifosplatform.portfolio.fund.data.FundData; import org.mifosplatform.portfolio.fund.data.FundData;
import org.mifosplatform.portfolio.fund.service.FundReadPlatformService; import org.mifosplatform.portfolio.fund.service.FundReadPlatformService;
import org.mifosplatform.portfolio.loanaccount.command.AdjustLoanTransactionCommand;
import org.mifosplatform.portfolio.loanaccount.command.LoanApplicationCommand;
import org.mifosplatform.portfolio.loanaccount.command.LoanChargeCommand;
import org.mifosplatform.portfolio.loanaccount.command.LoanStateTransitionCommand;
import org.mifosplatform.portfolio.loanaccount.command.LoanTransactionCommand;
import org.mifosplatform.portfolio.loanaccount.command.UndoStateTransitionCommand;
import org.mifosplatform.portfolio.loanaccount.data.DisbursementData;
import org.mifosplatform.portfolio.loanaccount.data.LoanAccountData;
import org.mifosplatform.portfolio.loanaccount.data.LoanBasicDetailsData;
import org.mifosplatform.portfolio.loanaccount.data.LoanChargeData;
import org.mifosplatform.portfolio.loanaccount.data.LoanPermissionData;
import org.mifosplatform.portfolio.loanaccount.data.LoanScheduleData;
import org.mifosplatform.portfolio.loanaccount.data.LoanTransactionData;
import org.mifosplatform.portfolio.loanaccount.loanschedule.command.CalculateLoanScheduleCommand;
import org.mifosplatform.portfolio.loanaccount.service.CalculationPlatformService;
import org.mifosplatform.portfolio.loanaccount.service.LoanReadPlatformService;
import org.mifosplatform.portfolio.loanaccount.service.LoanWritePlatformService;
import org.mifosplatform.portfolio.loanproduct.data.LoanProductData; import org.mifosplatform.portfolio.loanproduct.data.LoanProductData;
import org.mifosplatform.portfolio.loanproduct.data.TransactionProcessingStrategyData; import org.mifosplatform.portfolio.loanproduct.data.TransactionProcessingStrategyData;
import org.mifosplatform.portfolio.loanproduct.service.LoanDropdownReadPlatformService; import org.mifosplatform.portfolio.loanproduct.service.LoanDropdownReadPlatformService;
@@ -73,44 +75,51 @@ import org.springframework.util.CollectionUtils;
@Scope("singleton") @Scope("singleton")
public class LoansApiResource { public class LoansApiResource {
@Autowired // private final String resourceNameForPermissions = "OFFICE";
private LoanReadPlatformService loanReadPlatformService;
private final PlatformSecurityContext context;
private final LoanReadPlatformService loanReadPlatformService;
private final LoanWritePlatformService loanWritePlatformService;
private final LoanProductReadPlatformService loanProductReadPlatformService;
private final LoanDropdownReadPlatformService dropdownReadPlatformService;
private final FundReadPlatformService fundReadPlatformService;
private final ChargeReadPlatformService chargeReadPlatformService;
private final CalculationPlatformService calculationPlatformService;
private final StaffReadPlatformService staffReadPlatformService;
private final OfficeReadPlatformService officeReadPlatformService;
private final GuarantorReadPlatformService guarantorReadPlatformService;
private final PortfolioApiJsonSerializerService apiJsonSerializerService;
private final PortfolioApiDataConversionService apiDataConversionService;
private final PortfolioCommandSerializerService commandSerializerService;
private final PortfolioCommandSourceWritePlatformService commandsSourceWritePlatformService;
@Autowired @Autowired
private LoanWritePlatformService loanWritePlatformService; public LoansApiResource(final PlatformSecurityContext context, final LoanReadPlatformService loanReadPlatformService,
final LoanWritePlatformService loanWritePlatformService, final LoanProductReadPlatformService loanProductReadPlatformService,
@Autowired final LoanDropdownReadPlatformService dropdownReadPlatformService, final FundReadPlatformService fundReadPlatformService,
private LoanProductReadPlatformService loanProductReadPlatformService; final ChargeReadPlatformService chargeReadPlatformService, final CalculationPlatformService calculationPlatformService,
final StaffReadPlatformService staffReadPlatformService, final OfficeReadPlatformService officeReadPlatformService,
@Autowired final GuarantorReadPlatformService guarantorReadPlatformService,
private LoanDropdownReadPlatformService dropdownReadPlatformService; final PortfolioApiJsonSerializerService apiJsonSerializerService,
final PortfolioApiDataConversionService apiDataConversionService,
@Autowired final PortfolioCommandSerializerService commandSerializerService,
private FundReadPlatformService fundReadPlatformService; final PortfolioCommandSourceWritePlatformService commandsSourceWritePlatformService) {
this.context = context;
@Autowired this.loanReadPlatformService = loanReadPlatformService;
private ChargeReadPlatformService chargeReadPlatformService; this.loanWritePlatformService = loanWritePlatformService;
this.loanProductReadPlatformService = loanProductReadPlatformService;
@Autowired this.dropdownReadPlatformService = dropdownReadPlatformService;
private CalculationPlatformService calculationPlatformService; this.fundReadPlatformService = fundReadPlatformService;
this.chargeReadPlatformService = chargeReadPlatformService;
@Autowired this.calculationPlatformService = calculationPlatformService;
private PortfolioApiDataConversionService apiDataConversionService; this.staffReadPlatformService = staffReadPlatformService;
this.officeReadPlatformService = officeReadPlatformService;
@Autowired this.guarantorReadPlatformService = guarantorReadPlatformService;
private PortfolioApiJsonSerializerService apiJsonSerializerService; this.apiJsonSerializerService = apiJsonSerializerService;
this.apiDataConversionService = apiDataConversionService;
@Autowired this.commandSerializerService = commandSerializerService;
private StaffReadPlatformService staffReadPlatformService; this.commandsSourceWritePlatformService = commandsSourceWritePlatformService;
}
@Autowired
private OfficeReadPlatformService officeReadPlatformService;
@Autowired
private PlatformSecurityContext context;
@Autowired
private GuarantorReadPlatformService guarantorReadPlatformService;
@GET @GET
@Path("template") @Path("template")
@@ -304,7 +313,8 @@ public class LoansApiResource {
public String calculateLoanScheduleOrSubmitLoanApplication(@QueryParam("command") final String commandParam, public String calculateLoanScheduleOrSubmitLoanApplication(@QueryParam("command") final String commandParam,
@Context final UriInfo uriInfo, final String jsonRequestBody) { @Context final UriInfo uriInfo, final String jsonRequestBody) {
final LoanApplicationCommand command = this.apiDataConversionService.convertJsonToLoanApplicationCommand(null, jsonRequestBody); final LoanApplicationCommand command = this.apiDataConversionService.convertApiRequestJsonToLoanApplicationCommand(null,
jsonRequestBody);
if (is(commandParam, "calculateLoanSchedule")) { if (is(commandParam, "calculateLoanSchedule")) {
CalculateLoanScheduleCommand calculateLoanScheduleCommand = command.toCalculateLoanScheduleCommand(); CalculateLoanScheduleCommand calculateLoanScheduleCommand = command.toCalculateLoanScheduleCommand();
@@ -332,7 +342,8 @@ public class LoansApiResource {
@Produces({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON })
public String modifyLoanApplication(@PathParam("loanId") final Long loanId, final String jsonRequestBody) { public String modifyLoanApplication(@PathParam("loanId") final Long loanId, final String jsonRequestBody) {
final LoanApplicationCommand command = this.apiDataConversionService.convertJsonToLoanApplicationCommand(loanId, jsonRequestBody); final LoanApplicationCommand command = this.apiDataConversionService.convertApiRequestJsonToLoanApplicationCommand(loanId,
jsonRequestBody);
final EntityIdentifier identifier = this.loanWritePlatformService.modifyLoanApplication(command); final EntityIdentifier identifier = this.loanWritePlatformService.modifyLoanApplication(command);
@@ -582,7 +593,8 @@ public class LoansApiResource {
@Produces({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON })
public Response assignLoanOfficer(@PathParam("loanId") final Long loanId, final String jsonRequestBody) { public Response assignLoanOfficer(@PathParam("loanId") final Long loanId, final String jsonRequestBody) {
final BulkTransferLoanOfficerCommand command = this.apiDataConversionService.convertJsonToLoanReassignmentCommand(loanId, jsonRequestBody); final BulkTransferLoanOfficerCommand command = this.apiDataConversionService.convertJsonToLoanReassignmentCommand(loanId,
jsonRequestBody);
EntityIdentifier identifier = this.loanWritePlatformService.loanReassignment(command); EntityIdentifier identifier = this.loanWritePlatformService.loanReassignment(command);
@@ -601,10 +613,12 @@ public class LoansApiResource {
final LoanBasicDetailsData loanBasicDetails = this.loanReadPlatformService.retrieveLoanAccountDetails(loanId); final LoanBasicDetailsData loanBasicDetails = this.loanReadPlatformService.retrieveLoanAccountDetails(loanId);
final Collection<StaffData> allowedLoanOfficers = this.staffReadPlatformService.retrieveAllLoanOfficersByOffice(loanBasicDetails.getOfficeId()); final Collection<StaffData> allowedLoanOfficers = this.staffReadPlatformService.retrieveAllLoanOfficersByOffice(loanBasicDetails
.getOfficeId());
final Long fromLoanOfficerId = loanBasicDetails.getLoanOfficerId(); final Long fromLoanOfficerId = loanBasicDetails.getLoanOfficerId();
final BulkTransferLoanOfficerData loanReassignmentData = BulkTransferLoanOfficerData.template(fromLoanOfficerId, allowedLoanOfficers, new LocalDate()); final BulkTransferLoanOfficerData loanReassignmentData = BulkTransferLoanOfficerData.template(fromLoanOfficerId,
allowedLoanOfficers, new LocalDate());
return this.apiJsonSerializerService.serializeLoanReassignmentDataToJson(prettyPrint, responseParameters, loanReassignmentData); return this.apiJsonSerializerService.serializeLoanReassignmentDataToJson(prettyPrint, responseParameters, loanReassignmentData);
} }
@@ -615,19 +629,26 @@ public class LoansApiResource {
@Produces({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON })
public Response loanReassignment(final String apiRequestBodyAsJson) { public Response loanReassignment(final String apiRequestBodyAsJson) {
// final List<String> allowedPermissions = Arrays.asList("ALL_FUNCTIONS", "PORTFOLIO_MANAGEMENT_SUPER_USER", "BULKREASSIGN_LOAN"); // final List<String> allowedPermissions =
// context.authenticatedUser().validateHasPermissionTo("BULKREASSIGN_LOAN", allowedPermissions); // Arrays.asList("ALL_FUNCTIONS", "PORTFOLIO_MANAGEMENT_SUPER_USER",
// // "BULKREASSIGN_LOAN");
// final EntityIdentifier result = this.commandsSourceWritePlatformService.logCommandSource("BULKREASSIGN_LOAN", "staff", null, // context.authenticatedUser().validateHasPermissionTo("BULKREASSIGN_LOAN",
// apiRequestBodyAsJson); // allowedPermissions);
// //
// return this.apiJsonSerializerService.serializeEntityIdentifier(result); // final EntityIdentifier result =
// this.commandsSourceWritePlatformService.logCommandSource("BULKREASSIGN_LOAN",
// "staff", null,
// apiRequestBodyAsJson);
//
// return
// this.apiJsonSerializerService.serializeEntityIdentifier(result);
final BulkTransferLoanOfficerCommand command = this.apiDataConversionService.convertJsonToBulkLoanReassignmentCommand(apiRequestBodyAsJson); final BulkTransferLoanOfficerCommand command = this.apiDataConversionService
.convertJsonToBulkLoanReassignmentCommand(apiRequestBodyAsJson);
final EntityIdentifier loanOfficerIdentifier = this.loanWritePlatformService.bulkLoanReassignment(command); final EntityIdentifier loanOfficerIdentifier = this.loanWritePlatformService.bulkLoanReassignment(command);
return Response.ok().entity(loanOfficerIdentifier).build(); return Response.ok().entity(loanOfficerIdentifier).build();
} }
@GET @GET
@@ -655,8 +676,8 @@ public class LoansApiResource {
staffAccountSummaryCollectionData = this.staffReadPlatformService.retrieveLoanOfficerAccountSummary(loanOfficerId); staffAccountSummaryCollectionData = this.staffReadPlatformService.retrieveLoanOfficerAccountSummary(loanOfficerId);
} }
final BulkTransferLoanOfficerData loanReassignmentData = BulkTransferLoanOfficerData.templateForBulk(officeId, loanOfficerId, new LocalDate(), final BulkTransferLoanOfficerData loanReassignmentData = BulkTransferLoanOfficerData.templateForBulk(officeId, loanOfficerId,
offices, loanOfficers, staffAccountSummaryCollectionData); new LocalDate(), offices, loanOfficers, staffAccountSummaryCollectionData);
return this.apiJsonSerializerService.serializeLoanReassignmentDataToJson(prettyPrint, responseParameters, loanReassignmentData); return this.apiJsonSerializerService.serializeLoanReassignmentDataToJson(prettyPrint, responseParameters, loanReassignmentData);
} }
@@ -1,4 +1,4 @@
package org.mifosng.platform.api.commands; package org.mifosplatform.portfolio.loanaccount.command;
import java.math.BigDecimal; import java.math.BigDecimal;
@@ -1,9 +1,10 @@
package org.mifosng.platform.api.commands; package org.mifosplatform.portfolio.loanaccount.command;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Set; import java.util.Set;
import org.joda.time.LocalDate; import org.joda.time.LocalDate;
import org.mifosplatform.portfolio.loanaccount.loanschedule.command.CalculateLoanScheduleCommand;
import org.mifosplatform.portfolio.loanproduct.command.LoanProductCommand; import org.mifosplatform.portfolio.loanproduct.command.LoanProductCommand;
/** /**
@@ -1,4 +1,4 @@
package org.mifosng.platform.api.commands; package org.mifosplatform.portfolio.loanaccount.command;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.HashSet; import java.util.HashSet;
@@ -1,4 +1,4 @@
package org.mifosng.platform.api.commands; package org.mifosplatform.portfolio.loanaccount.command;
import org.joda.time.LocalDate; import org.joda.time.LocalDate;
@@ -1,4 +1,4 @@
package org.mifosng.platform.api.commands; package org.mifosplatform.portfolio.loanaccount.command;
import java.math.BigDecimal; import java.math.BigDecimal;
@@ -1,4 +1,4 @@
package org.mifosng.platform.api.commands; package org.mifosplatform.portfolio.loanaccount.command;
/** /**
* Immutable command for undo'ing a state transition. * Immutable command for undo'ing a state transition.
@@ -1,4 +1,4 @@
package org.mifosng.platform.api.data; package org.mifosplatform.portfolio.loanaccount.data;
import java.math.BigDecimal; import java.math.BigDecimal;
@@ -1,9 +1,10 @@
package org.mifosng.platform.api.data; package org.mifosplatform.portfolio.loanaccount.data;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Collection; import java.util.Collection;
import org.joda.time.LocalDate; import org.joda.time.LocalDate;
import org.mifosng.platform.api.data.GuarantorData;
import org.mifosplatform.infrastructure.configuration.data.CurrencyData; import org.mifosplatform.infrastructure.configuration.data.CurrencyData;
import org.mifosplatform.infrastructure.core.data.EnumOptionData; import org.mifosplatform.infrastructure.core.data.EnumOptionData;
import org.mifosplatform.infrastructure.staff.data.StaffData; import org.mifosplatform.infrastructure.staff.data.StaffData;
@@ -1,4 +1,4 @@
package org.mifosng.platform.api.data; package org.mifosplatform.portfolio.loanaccount.data;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
@@ -1,4 +1,4 @@
package org.mifosng.platform.api.data; package org.mifosplatform.portfolio.loanaccount.data;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Collection; import java.util.Collection;
@@ -1,4 +1,4 @@
package org.mifosng.platform.api.data; package org.mifosplatform.portfolio.loanaccount.data;
public class LoanConvenienceData { public class LoanConvenienceData {
@@ -1,4 +1,4 @@
package org.mifosng.platform.api.data; package org.mifosplatform.portfolio.loanaccount.data;
/** /**
* Immutable data object containing information on permissions allowed on a given loan. * Immutable data object containing information on permissions allowed on a given loan.
@@ -1,4 +1,4 @@
package org.mifosng.platform.api.data; package org.mifosplatform.portfolio.loanaccount.data;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Collection; import java.util.Collection;
@@ -1,4 +1,4 @@
package org.mifosng.platform.api.data; package org.mifosplatform.portfolio.loanaccount.data;
import java.math.BigDecimal; import java.math.BigDecimal;
@@ -1,4 +1,4 @@
package org.mifosng.platform.api.data; package org.mifosplatform.portfolio.loanaccount.data;
import java.math.BigDecimal; import java.math.BigDecimal;
@@ -1,4 +1,4 @@
package org.mifosng.platform.loan.domain; package org.mifosplatform.portfolio.loanaccount.domain;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
@@ -1,4 +1,4 @@
package org.mifosng.platform.loan.domain; package org.mifosplatform.portfolio.loanaccount.domain;
import java.util.List; import java.util.List;
@@ -1,4 +1,4 @@
package org.mifosng.platform.loan.domain; package org.mifosplatform.portfolio.loanaccount.domain;
import java.util.List; import java.util.List;
@@ -1,4 +1,4 @@
package org.mifosng.platform.loan.domain; package org.mifosplatform.portfolio.loanaccount.domain;
import java.util.List; import java.util.List;
@@ -1,4 +1,4 @@
package org.mifosng.platform.loan.domain; package org.mifosplatform.portfolio.loanaccount.domain;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
@@ -26,13 +26,6 @@ import org.apache.commons.lang.StringUtils;
import org.hibernate.annotations.LazyCollection; import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption; import org.hibernate.annotations.LazyCollectionOption;
import org.joda.time.LocalDate; import org.joda.time.LocalDate;
import org.mifosng.platform.api.commands.LoanApplicationCommand;
import org.mifosng.platform.api.commands.LoanChargeCommand;
import org.mifosng.platform.api.data.LoanScheduleData;
import org.mifosng.platform.api.data.LoanSchedulePeriodData;
import org.mifosng.platform.exceptions.InvalidLoanStateTransitionException;
import org.mifosng.platform.exceptions.InvalidLoanTransactionTypeException;
import org.mifosng.platform.exceptions.LoanOfficerAssignmentException;
import org.mifosng.platform.group.domain.Group; import org.mifosng.platform.group.domain.Group;
import org.mifosplatform.infrastructure.configuration.domain.MonetaryCurrency; import org.mifosplatform.infrastructure.configuration.domain.MonetaryCurrency;
import org.mifosplatform.infrastructure.configuration.domain.Money; import org.mifosplatform.infrastructure.configuration.domain.Money;
@@ -42,6 +35,13 @@ import org.mifosplatform.infrastructure.user.domain.AppUser;
import org.mifosplatform.portfolio.charge.exception.LoanChargeCannotBeAddedException; import org.mifosplatform.portfolio.charge.exception.LoanChargeCannotBeAddedException;
import org.mifosplatform.portfolio.client.domain.Client; import org.mifosplatform.portfolio.client.domain.Client;
import org.mifosplatform.portfolio.fund.domain.Fund; import org.mifosplatform.portfolio.fund.domain.Fund;
import org.mifosplatform.portfolio.loanaccount.command.LoanApplicationCommand;
import org.mifosplatform.portfolio.loanaccount.command.LoanChargeCommand;
import org.mifosplatform.portfolio.loanaccount.data.LoanScheduleData;
import org.mifosplatform.portfolio.loanaccount.data.LoanSchedulePeriodData;
import org.mifosplatform.portfolio.loanaccount.exception.InvalidLoanStateTransitionException;
import org.mifosplatform.portfolio.loanaccount.exception.InvalidLoanTransactionTypeException;
import org.mifosplatform.portfolio.loanaccount.exception.LoanOfficerAssignmentException;
import org.mifosplatform.portfolio.loanproduct.domain.LoanProduct; import org.mifosplatform.portfolio.loanproduct.domain.LoanProduct;
import org.mifosplatform.portfolio.loanproduct.domain.LoanProductRelatedDetail; import org.mifosplatform.portfolio.loanproduct.domain.LoanProductRelatedDetail;
import org.mifosplatform.portfolio.loanproduct.domain.LoanTransactionProcessingStrategy; import org.mifosplatform.portfolio.loanproduct.domain.LoanTransactionProcessingStrategy;
@@ -1,4 +1,4 @@
package org.mifosng.platform.loan.domain; package org.mifosplatform.portfolio.loanaccount.domain;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.MathContext; import java.math.MathContext;
@@ -16,13 +16,13 @@ import javax.persistence.Temporal;
import javax.persistence.TemporalType; import javax.persistence.TemporalType;
import org.joda.time.LocalDate; import org.joda.time.LocalDate;
import org.mifosng.platform.api.commands.LoanChargeCommand;
import org.mifosplatform.infrastructure.configuration.domain.MonetaryCurrency; import org.mifosplatform.infrastructure.configuration.domain.MonetaryCurrency;
import org.mifosplatform.infrastructure.configuration.domain.Money; import org.mifosplatform.infrastructure.configuration.domain.Money;
import org.mifosplatform.portfolio.charge.domain.Charge; import org.mifosplatform.portfolio.charge.domain.Charge;
import org.mifosplatform.portfolio.charge.domain.ChargeCalculationType; import org.mifosplatform.portfolio.charge.domain.ChargeCalculationType;
import org.mifosplatform.portfolio.charge.domain.ChargeTimeType; import org.mifosplatform.portfolio.charge.domain.ChargeTimeType;
import org.mifosplatform.portfolio.charge.exception.LoanChargeWithoutMandatoryFieldException; import org.mifosplatform.portfolio.charge.exception.LoanChargeWithoutMandatoryFieldException;
import org.mifosplatform.portfolio.loanaccount.command.LoanChargeCommand;
import org.springframework.data.jpa.domain.AbstractPersistable; import org.springframework.data.jpa.domain.AbstractPersistable;
@Entity @Entity
@@ -1,4 +1,4 @@
package org.mifosng.platform.loan.domain; package org.mifosplatform.portfolio.loanaccount.domain;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor; import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
@@ -1,4 +1,4 @@
package org.mifosng.platform.loan.domain; package org.mifosplatform.portfolio.loanaccount.domain;
/** /**
* *
@@ -1,4 +1,4 @@
package org.mifosng.platform.loan.domain; package org.mifosplatform.portfolio.loanaccount.domain;
public interface LoanLifecycleStateMachine { public interface LoanLifecycleStateMachine {
@@ -1,4 +1,4 @@
package org.mifosng.platform.loan.domain; package org.mifosplatform.portfolio.loanaccount.domain;
import org.joda.time.LocalDate; import org.joda.time.LocalDate;
import org.mifosplatform.infrastructure.core.domain.AbstractAuditableCustom; import org.mifosplatform.infrastructure.core.domain.AbstractAuditableCustom;
@@ -1,8 +1,8 @@
package org.mifosng.platform.loan.domain; package org.mifosplatform.portfolio.loanaccount.domain;
import java.util.Comparator; import java.util.Comparator;
import org.mifosng.platform.api.data.LoanTransactionData; import org.mifosplatform.portfolio.loanaccount.data.LoanTransactionData;
public class LoanRepaymentDataComparator implements Comparator<LoanTransactionData> { public class LoanRepaymentDataComparator implements Comparator<LoanTransactionData> {
@@ -1,4 +1,4 @@
package org.mifosng.platform.loan.domain; package org.mifosplatform.portfolio.loanaccount.domain;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
@@ -1,4 +1,4 @@
package org.mifosng.platform.loan.domain; package org.mifosplatform.portfolio.loanaccount.domain;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
@@ -1,4 +1,4 @@
package org.mifosng.platform.loan.domain; package org.mifosplatform.portfolio.loanaccount.domain;
import org.mifosplatform.portfolio.loanproduct.domain.LoanTransactionProcessingStrategy; import org.mifosplatform.portfolio.loanproduct.domain.LoanTransactionProcessingStrategy;
@@ -1,4 +1,4 @@
package org.mifosng.platform.loan.domain; package org.mifosplatform.portfolio.loanaccount.domain;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor; import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
@@ -1,4 +1,4 @@
package org.mifosng.platform.loan.domain; package org.mifosplatform.portfolio.loanaccount.domain;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
@@ -1,4 +1,4 @@
package org.mifosng.platform.loan.domain; package org.mifosplatform.portfolio.loanaccount.domain;
/** /**
* Enum representation of loan status states. * Enum representation of loan status states.
@@ -1,4 +1,4 @@
package org.mifosng.platform.loan.domain; package org.mifosplatform.portfolio.loanaccount.domain;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
@@ -16,13 +16,13 @@ import javax.persistence.Temporal;
import javax.persistence.TemporalType; import javax.persistence.TemporalType;
import org.joda.time.LocalDate; import org.joda.time.LocalDate;
import org.mifosng.platform.api.data.LoanTransactionData;
import org.mifosplatform.infrastructure.configuration.data.CurrencyData; import org.mifosplatform.infrastructure.configuration.data.CurrencyData;
import org.mifosplatform.infrastructure.configuration.domain.MonetaryCurrency; import org.mifosplatform.infrastructure.configuration.domain.MonetaryCurrency;
import org.mifosplatform.infrastructure.configuration.domain.Money; import org.mifosplatform.infrastructure.configuration.domain.Money;
import org.mifosplatform.infrastructure.core.data.EnumOptionData; import org.mifosplatform.infrastructure.core.data.EnumOptionData;
import org.mifosplatform.infrastructure.core.domain.AbstractAuditableCustom; import org.mifosplatform.infrastructure.core.domain.AbstractAuditableCustom;
import org.mifosplatform.infrastructure.user.domain.AppUser; import org.mifosplatform.infrastructure.user.domain.AppUser;
import org.mifosplatform.portfolio.loanaccount.data.LoanTransactionData;
import org.mifosplatform.portfolio.loanproduct.service.LoanEnumerations; import org.mifosplatform.portfolio.loanproduct.service.LoanEnumerations;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
@@ -1,4 +1,4 @@
package org.mifosng.platform.loan.domain; package org.mifosplatform.portfolio.loanaccount.domain;
import java.util.Comparator; import java.util.Comparator;
@@ -1,4 +1,4 @@
package org.mifosng.platform.loan.domain; package org.mifosplatform.portfolio.loanaccount.domain;
import org.mifosplatform.portfolio.loanproduct.domain.LoanTransactionProcessingStrategy; import org.mifosplatform.portfolio.loanproduct.domain.LoanTransactionProcessingStrategy;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
@@ -1,4 +1,4 @@
package org.mifosng.platform.loan.domain; package org.mifosplatform.portfolio.loanaccount.domain;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor; import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
@@ -1,4 +1,4 @@
package org.mifosng.platform.loan.domain; package org.mifosplatform.portfolio.loanaccount.domain;
public enum LoanTransactionType { public enum LoanTransactionType {
@@ -1,4 +1,4 @@
package org.mifosng.platform.loan.domain; package org.mifosplatform.portfolio.loanaccount.domain;
import java.util.List; import java.util.List;
@@ -1,4 +1,4 @@
package org.mifosng.platform.loan.domain; package org.mifosplatform.portfolio.loanaccount.domain;
import java.util.List; import java.util.List;
@@ -1,4 +1,4 @@
package org.mifosng.platform.loan.domain; package org.mifosplatform.portfolio.loanaccount.domain;
import org.mifosplatform.infrastructure.configuration.domain.Money; import org.mifosplatform.infrastructure.configuration.domain.Money;
@@ -1,4 +1,4 @@
package org.mifosng.platform.exceptions; package org.mifosplatform.portfolio.loanaccount.exception;
import org.mifosplatform.infrastructure.core.exception.AbstractPlatformDomainRuleException; import org.mifosplatform.infrastructure.core.exception.AbstractPlatformDomainRuleException;
@@ -1,4 +1,4 @@
package org.mifosng.platform.exceptions; package org.mifosplatform.portfolio.loanaccount.exception;
import org.mifosplatform.infrastructure.core.exception.AbstractPlatformDomainRuleException; import org.mifosplatform.infrastructure.core.exception.AbstractPlatformDomainRuleException;
@@ -1,4 +1,4 @@
package org.mifosng.platform.exceptions; package org.mifosplatform.portfolio.loanaccount.exception;
import org.mifosplatform.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; import org.mifosplatform.infrastructure.core.exception.AbstractPlatformResourceNotFoundException;
@@ -1,4 +1,4 @@
package org.mifosng.platform.exceptions; package org.mifosplatform.portfolio.loanaccount.exception;
import org.mifosplatform.infrastructure.core.exception.AbstractPlatformDomainRuleException; import org.mifosplatform.infrastructure.core.exception.AbstractPlatformDomainRuleException;
@@ -1,4 +1,4 @@
package org.mifosng.platform.exceptions; package org.mifosplatform.portfolio.loanaccount.exception;
import org.joda.time.LocalDate; import org.joda.time.LocalDate;
import org.mifosplatform.infrastructure.core.exception.AbstractPlatformDomainRuleException; import org.mifosplatform.infrastructure.core.exception.AbstractPlatformDomainRuleException;
@@ -1,4 +1,4 @@
package org.mifosng.platform.exceptions; package org.mifosplatform.portfolio.loanaccount.exception;
import org.mifosplatform.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; import org.mifosplatform.infrastructure.core.exception.AbstractPlatformResourceNotFoundException;
@@ -1,4 +1,4 @@
package org.mifosng.platform.exceptions; package org.mifosplatform.portfolio.loanaccount.exception;
import org.mifosplatform.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; import org.mifosplatform.infrastructure.core.exception.AbstractPlatformResourceNotFoundException;
@@ -1,8 +1,9 @@
package org.mifosng.platform.api.commands; package org.mifosplatform.portfolio.loanaccount.loanschedule.command;
import java.math.BigDecimal; import java.math.BigDecimal;
import org.joda.time.LocalDate; import org.joda.time.LocalDate;
import org.mifosplatform.portfolio.loanaccount.command.LoanChargeCommand;
/** /**
* Immutable command used when auto-calculating loan schedules based on loan terms. * Immutable command used when auto-calculating loan schedules based on loan terms.
@@ -1,13 +1,13 @@
package org.mifosng.platform.loanschedule.domain; package org.mifosplatform.portfolio.loanaccount.loanschedule.domain;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import org.joda.time.LocalDate; import org.joda.time.LocalDate;
import org.mifosng.platform.api.data.LoanScheduleData;
import org.mifosng.platform.loan.domain.LoanCharge;
import org.mifosplatform.infrastructure.configuration.domain.ApplicationCurrency; import org.mifosplatform.infrastructure.configuration.domain.ApplicationCurrency;
import org.mifosplatform.portfolio.loanaccount.data.LoanScheduleData;
import org.mifosplatform.portfolio.loanaccount.domain.LoanCharge;
import org.mifosplatform.portfolio.loanproduct.domain.LoanProductRelatedDetail; import org.mifosplatform.portfolio.loanproduct.domain.LoanProductRelatedDetail;
public interface AmortizationLoanScheduleGenerator { public interface AmortizationLoanScheduleGenerator {
@@ -1,4 +1,4 @@
package org.mifosng.platform.loanschedule.domain; package org.mifosplatform.portfolio.loanaccount.loanschedule.domain;
import org.mifosplatform.portfolio.loanproduct.domain.AmortizationMethod; import org.mifosplatform.portfolio.loanproduct.domain.AmortizationMethod;
@@ -1,4 +1,4 @@
package org.mifosng.platform.loanschedule.domain; package org.mifosplatform.portfolio.loanaccount.loanschedule.domain;
import java.math.BigDecimal; import java.math.BigDecimal;
@@ -1,13 +1,13 @@
package org.mifosng.platform.loanschedule.domain; package org.mifosplatform.portfolio.loanaccount.loanschedule.domain;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import org.joda.time.LocalDate; import org.joda.time.LocalDate;
import org.mifosng.platform.api.data.LoanScheduleData;
import org.mifosng.platform.loan.domain.LoanCharge;
import org.mifosplatform.infrastructure.configuration.domain.ApplicationCurrency; import org.mifosplatform.infrastructure.configuration.domain.ApplicationCurrency;
import org.mifosplatform.portfolio.loanaccount.data.LoanScheduleData;
import org.mifosplatform.portfolio.loanaccount.domain.LoanCharge;
import org.mifosplatform.portfolio.loanproduct.domain.AmortizationMethod; import org.mifosplatform.portfolio.loanproduct.domain.AmortizationMethod;
import org.mifosplatform.portfolio.loanproduct.domain.LoanProductRelatedDetail; import org.mifosplatform.portfolio.loanproduct.domain.LoanProductRelatedDetail;
import org.mifosplatform.portfolio.loanproduct.domain.PeriodFrequencyType; import org.mifosplatform.portfolio.loanproduct.domain.PeriodFrequencyType;
@@ -1,4 +1,4 @@
package org.mifosng.platform.loanschedule.domain; package org.mifosplatform.portfolio.loanaccount.loanschedule.domain;
import org.mifosplatform.portfolio.loanproduct.domain.InterestMethod; import org.mifosplatform.portfolio.loanproduct.domain.InterestMethod;
@@ -1,4 +1,4 @@
package org.mifosng.platform.loanschedule.domain; package org.mifosplatform.portfolio.loanaccount.loanschedule.domain;
import java.util.List; import java.util.List;
@@ -1,4 +1,4 @@
package org.mifosng.platform.loanschedule.domain; package org.mifosplatform.portfolio.loanaccount.loanschedule.domain;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@@ -1,4 +1,4 @@
package org.mifosng.platform.loanschedule.domain; package org.mifosplatform.portfolio.loanaccount.loanschedule.domain;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
@@ -8,13 +8,13 @@ import java.util.Set;
import org.joda.time.Days; import org.joda.time.Days;
import org.joda.time.LocalDate; import org.joda.time.LocalDate;
import org.mifosng.platform.api.data.LoanScheduleData;
import org.mifosng.platform.api.data.LoanSchedulePeriodData;
import org.mifosng.platform.loan.domain.LoanCharge;
import org.mifosplatform.infrastructure.configuration.data.CurrencyData; import org.mifosplatform.infrastructure.configuration.data.CurrencyData;
import org.mifosplatform.infrastructure.configuration.domain.ApplicationCurrency; import org.mifosplatform.infrastructure.configuration.domain.ApplicationCurrency;
import org.mifosplatform.infrastructure.configuration.domain.MonetaryCurrency; import org.mifosplatform.infrastructure.configuration.domain.MonetaryCurrency;
import org.mifosplatform.infrastructure.configuration.domain.Money; import org.mifosplatform.infrastructure.configuration.domain.Money;
import org.mifosplatform.portfolio.loanaccount.data.LoanScheduleData;
import org.mifosplatform.portfolio.loanaccount.data.LoanSchedulePeriodData;
import org.mifosplatform.portfolio.loanaccount.domain.LoanCharge;
import org.mifosplatform.portfolio.loanproduct.domain.LoanProductRelatedDetail; import org.mifosplatform.portfolio.loanproduct.domain.LoanProductRelatedDetail;
/** /**
@@ -1,4 +1,4 @@
package org.mifosng.platform.loanschedule.domain; package org.mifosplatform.portfolio.loanaccount.loanschedule.domain;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
@@ -8,13 +8,13 @@ import java.util.Set;
import org.joda.time.Days; import org.joda.time.Days;
import org.joda.time.LocalDate; import org.joda.time.LocalDate;
import org.mifosng.platform.api.data.LoanScheduleData;
import org.mifosng.platform.api.data.LoanSchedulePeriodData;
import org.mifosng.platform.loan.domain.LoanCharge;
import org.mifosplatform.infrastructure.configuration.data.CurrencyData; import org.mifosplatform.infrastructure.configuration.data.CurrencyData;
import org.mifosplatform.infrastructure.configuration.domain.ApplicationCurrency; import org.mifosplatform.infrastructure.configuration.domain.ApplicationCurrency;
import org.mifosplatform.infrastructure.configuration.domain.MonetaryCurrency; import org.mifosplatform.infrastructure.configuration.domain.MonetaryCurrency;
import org.mifosplatform.infrastructure.configuration.domain.Money; import org.mifosplatform.infrastructure.configuration.domain.Money;
import org.mifosplatform.portfolio.loanaccount.data.LoanScheduleData;
import org.mifosplatform.portfolio.loanaccount.data.LoanSchedulePeriodData;
import org.mifosplatform.portfolio.loanaccount.domain.LoanCharge;
import org.mifosplatform.portfolio.loanproduct.domain.LoanProductRelatedDetail; import org.mifosplatform.portfolio.loanproduct.domain.LoanProductRelatedDetail;
public class EqualPrincipalAmortizationLoanScheduleGenerator implements AmortizationLoanScheduleGenerator { public class EqualPrincipalAmortizationLoanScheduleGenerator implements AmortizationLoanScheduleGenerator {
@@ -1,4 +1,4 @@
package org.mifosng.platform.loanschedule.domain; package org.mifosplatform.portfolio.loanaccount.loanschedule.domain;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.MathContext; import java.math.MathContext;
@@ -10,13 +10,13 @@ import java.util.Set;
import org.joda.time.Days; import org.joda.time.Days;
import org.joda.time.LocalDate; import org.joda.time.LocalDate;
import org.mifosng.platform.api.data.LoanScheduleData;
import org.mifosng.platform.api.data.LoanSchedulePeriodData;
import org.mifosng.platform.loan.domain.LoanCharge;
import org.mifosplatform.infrastructure.configuration.data.CurrencyData; import org.mifosplatform.infrastructure.configuration.data.CurrencyData;
import org.mifosplatform.infrastructure.configuration.domain.ApplicationCurrency; import org.mifosplatform.infrastructure.configuration.domain.ApplicationCurrency;
import org.mifosplatform.infrastructure.configuration.domain.MonetaryCurrency; import org.mifosplatform.infrastructure.configuration.domain.MonetaryCurrency;
import org.mifosplatform.infrastructure.configuration.domain.Money; import org.mifosplatform.infrastructure.configuration.domain.Money;
import org.mifosplatform.portfolio.loanaccount.data.LoanScheduleData;
import org.mifosplatform.portfolio.loanaccount.data.LoanSchedulePeriodData;
import org.mifosplatform.portfolio.loanaccount.domain.LoanCharge;
import org.mifosplatform.portfolio.loanproduct.domain.LoanProductRelatedDetail; import org.mifosplatform.portfolio.loanproduct.domain.LoanProductRelatedDetail;
import org.mifosplatform.portfolio.loanproduct.domain.PeriodFrequencyType; import org.mifosplatform.portfolio.loanproduct.domain.PeriodFrequencyType;
@@ -1,11 +1,11 @@
package org.mifosng.platform.loanschedule.domain; package org.mifosplatform.portfolio.loanaccount.loanschedule.domain;
import java.util.Set; import java.util.Set;
import org.joda.time.LocalDate; import org.joda.time.LocalDate;
import org.mifosng.platform.api.data.LoanScheduleData;
import org.mifosng.platform.loan.domain.LoanCharge;
import org.mifosplatform.infrastructure.configuration.domain.ApplicationCurrency; import org.mifosplatform.infrastructure.configuration.domain.ApplicationCurrency;
import org.mifosplatform.portfolio.loanaccount.data.LoanScheduleData;
import org.mifosplatform.portfolio.loanaccount.domain.LoanCharge;
import org.mifosplatform.portfolio.loanproduct.domain.LoanProductRelatedDetail; import org.mifosplatform.portfolio.loanproduct.domain.LoanProductRelatedDetail;
import org.mifosplatform.portfolio.loanproduct.domain.PeriodFrequencyType; import org.mifosplatform.portfolio.loanproduct.domain.PeriodFrequencyType;
@@ -1,4 +1,4 @@
package org.mifosng.platform.loanschedule.domain; package org.mifosplatform.portfolio.loanaccount.loanschedule.domain;
import org.mifosplatform.portfolio.loanproduct.domain.InterestMethod; import org.mifosplatform.portfolio.loanproduct.domain.InterestMethod;
@@ -1,4 +1,4 @@
package org.mifosng.platform.loanschedule.domain; package org.mifosplatform.portfolio.loanaccount.loanschedule.domain;
import java.util.List; import java.util.List;
@@ -1,4 +1,4 @@
package org.mifosng.platform.loanschedule.domain; package org.mifosplatform.portfolio.loanaccount.loanschedule.domain;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.MathContext; import java.math.MathContext;
@@ -1,4 +1,4 @@
package org.mifosng.platform.loanschedule.domain; package org.mifosplatform.portfolio.loanaccount.loanschedule.domain;
import java.math.BigDecimal; import java.math.BigDecimal;
@@ -1,4 +1,4 @@
package org.mifosng.platform.loanschedule.domain; package org.mifosplatform.portfolio.loanaccount.loanschedule.domain;
import java.util.List; import java.util.List;
@@ -1,12 +1,12 @@
package org.mifosng.platform.loan.service; package org.mifosplatform.portfolio.loanaccount.service;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.mifosng.platform.api.commands.AdjustLoanTransactionCommand;
import org.mifosplatform.infrastructure.core.data.ApiParameterError; import org.mifosplatform.infrastructure.core.data.ApiParameterError;
import org.mifosplatform.infrastructure.core.data.DataValidatorBuilder; import org.mifosplatform.infrastructure.core.data.DataValidatorBuilder;
import org.mifosplatform.infrastructure.core.exception.PlatformApiDataValidationException; import org.mifosplatform.infrastructure.core.exception.PlatformApiDataValidationException;
import org.mifosplatform.portfolio.loanaccount.command.AdjustLoanTransactionCommand;
public class AdjustLoanTransactionCommandValidator { public class AdjustLoanTransactionCommandValidator {
@@ -1,12 +1,12 @@
package org.mifosng.platform.loan.service; package org.mifosplatform.portfolio.loanaccount.service;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.mifosng.platform.api.commands.CalculateLoanScheduleCommand;
import org.mifosplatform.infrastructure.core.data.ApiParameterError; import org.mifosplatform.infrastructure.core.data.ApiParameterError;
import org.mifosplatform.infrastructure.core.data.DataValidatorBuilder; import org.mifosplatform.infrastructure.core.data.DataValidatorBuilder;
import org.mifosplatform.infrastructure.core.exception.PlatformApiDataValidationException; import org.mifosplatform.infrastructure.core.exception.PlatformApiDataValidationException;
import org.mifosplatform.portfolio.loanaccount.loanschedule.command.CalculateLoanScheduleCommand;
public class CalculateLoanScheduleCommandValidator { public class CalculateLoanScheduleCommandValidator {
@@ -0,0 +1,9 @@
package org.mifosplatform.portfolio.loanaccount.service;
import org.mifosplatform.portfolio.loanaccount.data.LoanScheduleData;
import org.mifosplatform.portfolio.loanaccount.loanschedule.command.CalculateLoanScheduleCommand;
public interface CalculationPlatformService {
LoanScheduleData calculateLoanSchedule(CalculateLoanScheduleCommand command);
}
@@ -1,16 +1,16 @@
package org.mifosng.platform.loan.service; package org.mifosplatform.portfolio.loanaccount.service;
import java.util.Set; import java.util.Set;
import org.mifosng.platform.api.commands.CalculateLoanScheduleCommand;
import org.mifosng.platform.api.data.LoanScheduleData;
import org.mifosng.platform.loan.domain.LoanCharge;
import org.mifosng.platform.loanschedule.domain.DefaultLoanScheduleGeneratorFactory;
import org.mifosng.platform.loanschedule.domain.LoanScheduleGenerator;
import org.mifosng.platform.loanschedule.domain.LoanScheduleGeneratorFactory;
import org.mifosplatform.infrastructure.configuration.domain.ApplicationCurrency; import org.mifosplatform.infrastructure.configuration.domain.ApplicationCurrency;
import org.mifosplatform.infrastructure.configuration.domain.ApplicationCurrencyRepository; import org.mifosplatform.infrastructure.configuration.domain.ApplicationCurrencyRepository;
import org.mifosplatform.infrastructure.security.service.PlatformSecurityContext; import org.mifosplatform.infrastructure.security.service.PlatformSecurityContext;
import org.mifosplatform.portfolio.loanaccount.data.LoanScheduleData;
import org.mifosplatform.portfolio.loanaccount.domain.LoanCharge;
import org.mifosplatform.portfolio.loanaccount.loanschedule.command.CalculateLoanScheduleCommand;
import org.mifosplatform.portfolio.loanaccount.loanschedule.domain.DefaultLoanScheduleGeneratorFactory;
import org.mifosplatform.portfolio.loanaccount.loanschedule.domain.LoanScheduleGenerator;
import org.mifosplatform.portfolio.loanaccount.loanschedule.domain.LoanScheduleGeneratorFactory;
import org.mifosplatform.portfolio.loanproduct.domain.InterestMethod; import org.mifosplatform.portfolio.loanproduct.domain.InterestMethod;
import org.mifosplatform.portfolio.loanproduct.domain.LoanProductRelatedDetail; import org.mifosplatform.portfolio.loanproduct.domain.LoanProductRelatedDetail;
import org.mifosplatform.portfolio.loanproduct.domain.PeriodFrequencyType; import org.mifosplatform.portfolio.loanproduct.domain.PeriodFrequencyType;
@@ -1,14 +1,14 @@
package org.mifosng.platform.loan.service; package org.mifosplatform.portfolio.loanaccount.service;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.mifosng.platform.api.commands.CalculateLoanScheduleCommand;
import org.mifosng.platform.api.commands.LoanChargeCommand;
import org.mifosng.platform.api.commands.LoanApplicationCommand;
import org.mifosplatform.infrastructure.core.data.ApiParameterError; import org.mifosplatform.infrastructure.core.data.ApiParameterError;
import org.mifosplatform.infrastructure.core.data.DataValidatorBuilder; import org.mifosplatform.infrastructure.core.data.DataValidatorBuilder;
import org.mifosplatform.infrastructure.core.exception.PlatformApiDataValidationException; import org.mifosplatform.infrastructure.core.exception.PlatformApiDataValidationException;
import org.mifosplatform.portfolio.loanaccount.command.LoanApplicationCommand;
import org.mifosplatform.portfolio.loanaccount.command.LoanChargeCommand;
import org.mifosplatform.portfolio.loanaccount.loanschedule.command.CalculateLoanScheduleCommand;
public class LoanApplicationCommandValidator { public class LoanApplicationCommandValidator {
@@ -1,25 +1,13 @@
package org.mifosng.platform.loan.service; package org.mifosplatform.portfolio.loanaccount.service;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import org.mifosng.platform.api.commands.LoanApplicationCommand;
import org.mifosng.platform.api.data.LoanScheduleData;
import org.mifosng.platform.api.data.LoanSchedulePeriodData;
import org.mifosng.platform.exceptions.GroupNotFoundException; import org.mifosng.platform.exceptions.GroupNotFoundException;
import org.mifosng.platform.exceptions.LoanTransactionProcessingStrategyNotFoundException;
import org.mifosng.platform.group.domain.Group; import org.mifosng.platform.group.domain.Group;
import org.mifosng.platform.group.domain.GroupRepository; import org.mifosng.platform.group.domain.GroupRepository;
import org.mifosng.platform.loan.domain.DefaultLoanLifecycleStateMachine;
import org.mifosng.platform.loan.domain.Loan;
import org.mifosng.platform.loan.domain.LoanCharge;
import org.mifosng.platform.loan.domain.LoanLifecycleStateMachine;
import org.mifosng.platform.loan.domain.LoanRepaymentScheduleInstallment;
import org.mifosng.platform.loan.domain.LoanStatus;
import org.mifosng.platform.loan.domain.LoanTransactionProcessingStrategyRepository;
import org.mifosng.platform.loanschedule.domain.AprCalculator;
import org.mifosplatform.infrastructure.configuration.domain.MonetaryCurrency; import org.mifosplatform.infrastructure.configuration.domain.MonetaryCurrency;
import org.mifosplatform.infrastructure.staff.domain.Staff; import org.mifosplatform.infrastructure.staff.domain.Staff;
import org.mifosplatform.infrastructure.staff.domain.StaffRepository; import org.mifosplatform.infrastructure.staff.domain.StaffRepository;
@@ -31,6 +19,18 @@ import org.mifosplatform.portfolio.client.exception.ClientNotFoundException;
import org.mifosplatform.portfolio.fund.domain.Fund; import org.mifosplatform.portfolio.fund.domain.Fund;
import org.mifosplatform.portfolio.fund.domain.FundRepository; import org.mifosplatform.portfolio.fund.domain.FundRepository;
import org.mifosplatform.portfolio.fund.exception.FundNotFoundException; import org.mifosplatform.portfolio.fund.exception.FundNotFoundException;
import org.mifosplatform.portfolio.loanaccount.command.LoanApplicationCommand;
import org.mifosplatform.portfolio.loanaccount.data.LoanScheduleData;
import org.mifosplatform.portfolio.loanaccount.data.LoanSchedulePeriodData;
import org.mifosplatform.portfolio.loanaccount.domain.DefaultLoanLifecycleStateMachine;
import org.mifosplatform.portfolio.loanaccount.domain.Loan;
import org.mifosplatform.portfolio.loanaccount.domain.LoanCharge;
import org.mifosplatform.portfolio.loanaccount.domain.LoanLifecycleStateMachine;
import org.mifosplatform.portfolio.loanaccount.domain.LoanRepaymentScheduleInstallment;
import org.mifosplatform.portfolio.loanaccount.domain.LoanStatus;
import org.mifosplatform.portfolio.loanaccount.domain.LoanTransactionProcessingStrategyRepository;
import org.mifosplatform.portfolio.loanaccount.exception.LoanTransactionProcessingStrategyNotFoundException;
import org.mifosplatform.portfolio.loanaccount.loanschedule.domain.AprCalculator;
import org.mifosplatform.portfolio.loanproduct.domain.AmortizationMethod; import org.mifosplatform.portfolio.loanproduct.domain.AmortizationMethod;
import org.mifosplatform.portfolio.loanproduct.domain.InterestCalculationPeriodMethod; import org.mifosplatform.portfolio.loanproduct.domain.InterestCalculationPeriodMethod;
import org.mifosplatform.portfolio.loanproduct.domain.InterestMethod; import org.mifosplatform.portfolio.loanproduct.domain.InterestMethod;
@@ -1,17 +1,17 @@
package org.mifosng.platform.loan.service; package org.mifosplatform.portfolio.loanaccount.service;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;
import org.mifosng.platform.api.commands.LoanChargeCommand;
import org.mifosng.platform.loan.domain.LoanCharge;
import org.mifosng.platform.loan.domain.LoanChargeRepository;
import org.mifosplatform.portfolio.charge.domain.Charge; import org.mifosplatform.portfolio.charge.domain.Charge;
import org.mifosplatform.portfolio.charge.domain.ChargeRepository; import org.mifosplatform.portfolio.charge.domain.ChargeRepository;
import org.mifosplatform.portfolio.charge.exception.ChargeIsNotActiveException; import org.mifosplatform.portfolio.charge.exception.ChargeIsNotActiveException;
import org.mifosplatform.portfolio.charge.exception.ChargeNotFoundException; import org.mifosplatform.portfolio.charge.exception.ChargeNotFoundException;
import org.mifosplatform.portfolio.charge.exception.LoanChargeNotFoundException; import org.mifosplatform.portfolio.charge.exception.LoanChargeNotFoundException;
import org.mifosplatform.portfolio.loanaccount.command.LoanChargeCommand;
import org.mifosplatform.portfolio.loanaccount.domain.LoanCharge;
import org.mifosplatform.portfolio.loanaccount.domain.LoanChargeRepository;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@@ -1,9 +1,9 @@
package org.mifosng.platform.loan.service; package org.mifosplatform.portfolio.loanaccount.service;
import org.mifosng.platform.api.commands.LoanChargeCommand;
import org.mifosplatform.infrastructure.core.data.ApiParameterError; import org.mifosplatform.infrastructure.core.data.ApiParameterError;
import org.mifosplatform.infrastructure.core.data.DataValidatorBuilder; import org.mifosplatform.infrastructure.core.data.DataValidatorBuilder;
import org.mifosplatform.infrastructure.core.exception.PlatformApiDataValidationException; import org.mifosplatform.infrastructure.core.exception.PlatformApiDataValidationException;
import org.mifosplatform.portfolio.loanaccount.command.LoanChargeCommand;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@@ -1,10 +1,10 @@
package org.mifosng.platform.loan.service; package org.mifosplatform.portfolio.loanaccount.service;
import java.math.BigDecimal; import java.math.BigDecimal;
import org.mifosng.platform.api.commands.CalculateLoanScheduleCommand;
import org.mifosng.platform.loanschedule.domain.AprCalculator;
import org.mifosplatform.infrastructure.configuration.domain.MonetaryCurrency; import org.mifosplatform.infrastructure.configuration.domain.MonetaryCurrency;
import org.mifosplatform.portfolio.loanaccount.loanschedule.command.CalculateLoanScheduleCommand;
import org.mifosplatform.portfolio.loanaccount.loanschedule.domain.AprCalculator;
import org.mifosplatform.portfolio.loanproduct.domain.AmortizationMethod; import org.mifosplatform.portfolio.loanproduct.domain.AmortizationMethod;
import org.mifosplatform.portfolio.loanproduct.domain.InterestCalculationPeriodMethod; import org.mifosplatform.portfolio.loanproduct.domain.InterestCalculationPeriodMethod;
import org.mifosplatform.portfolio.loanproduct.domain.InterestMethod; import org.mifosplatform.portfolio.loanproduct.domain.InterestMethod;
@@ -1,14 +1,14 @@
package org.mifosng.platform.loan.service; package org.mifosplatform.portfolio.loanaccount.service;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Collection; import java.util.Collection;
import org.mifosng.platform.api.data.DisbursementData;
import org.mifosng.platform.api.data.LoanBasicDetailsData;
import org.mifosng.platform.api.data.LoanPermissionData;
import org.mifosng.platform.api.data.LoanScheduleData;
import org.mifosng.platform.api.data.LoanTransactionData;
import org.mifosplatform.infrastructure.configuration.data.CurrencyData; import org.mifosplatform.infrastructure.configuration.data.CurrencyData;
import org.mifosplatform.portfolio.loanaccount.data.DisbursementData;
import org.mifosplatform.portfolio.loanaccount.data.LoanBasicDetailsData;
import org.mifosplatform.portfolio.loanaccount.data.LoanPermissionData;
import org.mifosplatform.portfolio.loanaccount.data.LoanScheduleData;
import org.mifosplatform.portfolio.loanaccount.data.LoanTransactionData;
public interface LoanReadPlatformService { public interface LoanReadPlatformService {
@@ -1,4 +1,4 @@
package org.mifosng.platform.loan.service; package org.mifosplatform.portfolio.loanaccount.service;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.sql.ResultSet; import java.sql.ResultSet;
@@ -7,22 +7,8 @@ import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import org.joda.time.LocalDate; import org.joda.time.LocalDate;
import org.mifosng.platform.api.data.DisbursementData;
import org.mifosng.platform.api.data.GroupData; import org.mifosng.platform.api.data.GroupData;
import org.mifosng.platform.api.data.LoanBasicDetailsData;
import org.mifosng.platform.api.data.LoanChargeData;
import org.mifosng.platform.api.data.LoanPermissionData;
import org.mifosng.platform.api.data.LoanScheduleData;
import org.mifosng.platform.api.data.LoanSchedulePeriodData;
import org.mifosng.platform.api.data.LoanTransactionData;
import org.mifosng.platform.exceptions.LoanNotFoundException;
import org.mifosng.platform.exceptions.LoanTransactionNotFoundException;
import org.mifosng.platform.group.service.GroupReadPlatformService; import org.mifosng.platform.group.service.GroupReadPlatformService;
import org.mifosng.platform.loan.domain.Loan;
import org.mifosng.platform.loan.domain.LoanRepository;
import org.mifosng.platform.loan.domain.LoanTransaction;
import org.mifosng.platform.loan.domain.LoanTransactionRepository;
import org.mifosng.platform.loan.domain.LoanTransactionType;
import org.mifosplatform.infrastructure.configuration.data.CurrencyData; import org.mifosplatform.infrastructure.configuration.data.CurrencyData;
import org.mifosplatform.infrastructure.configuration.domain.ApplicationCurrency; import org.mifosplatform.infrastructure.configuration.domain.ApplicationCurrency;
import org.mifosplatform.infrastructure.configuration.domain.ApplicationCurrencyRepository; import org.mifosplatform.infrastructure.configuration.domain.ApplicationCurrencyRepository;
@@ -35,6 +21,20 @@ import org.mifosplatform.infrastructure.core.service.TenantAwareRoutingDataSourc
import org.mifosplatform.infrastructure.security.service.PlatformSecurityContext; import org.mifosplatform.infrastructure.security.service.PlatformSecurityContext;
import org.mifosplatform.portfolio.client.data.ClientData; import org.mifosplatform.portfolio.client.data.ClientData;
import org.mifosplatform.portfolio.client.service.ClientReadPlatformService; import org.mifosplatform.portfolio.client.service.ClientReadPlatformService;
import org.mifosplatform.portfolio.loanaccount.data.DisbursementData;
import org.mifosplatform.portfolio.loanaccount.data.LoanBasicDetailsData;
import org.mifosplatform.portfolio.loanaccount.data.LoanChargeData;
import org.mifosplatform.portfolio.loanaccount.data.LoanPermissionData;
import org.mifosplatform.portfolio.loanaccount.data.LoanScheduleData;
import org.mifosplatform.portfolio.loanaccount.data.LoanSchedulePeriodData;
import org.mifosplatform.portfolio.loanaccount.data.LoanTransactionData;
import org.mifosplatform.portfolio.loanaccount.domain.Loan;
import org.mifosplatform.portfolio.loanaccount.domain.LoanRepository;
import org.mifosplatform.portfolio.loanaccount.domain.LoanTransaction;
import org.mifosplatform.portfolio.loanaccount.domain.LoanTransactionRepository;
import org.mifosplatform.portfolio.loanaccount.domain.LoanTransactionType;
import org.mifosplatform.portfolio.loanaccount.exception.LoanNotFoundException;
import org.mifosplatform.portfolio.loanaccount.exception.LoanTransactionNotFoundException;
import org.mifosplatform.portfolio.loanproduct.data.LoanProductData; import org.mifosplatform.portfolio.loanproduct.data.LoanProductData;
import org.mifosplatform.portfolio.loanproduct.service.LoanEnumerations; import org.mifosplatform.portfolio.loanproduct.service.LoanEnumerations;
import org.mifosplatform.portfolio.loanproduct.service.LoanProductReadPlatformService; import org.mifosplatform.portfolio.loanproduct.service.LoanProductReadPlatformService;
@@ -1,9 +1,9 @@
package org.mifosng.platform.loan.service; package org.mifosplatform.portfolio.loanaccount.service;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Collection; import java.util.Collection;
import org.mifosng.platform.api.data.LoanSchedulePeriodData; import org.mifosplatform.portfolio.loanaccount.data.LoanSchedulePeriodData;
public class LoanSchedulePeriodDataWrapper { public class LoanSchedulePeriodDataWrapper {
@@ -1,12 +1,12 @@
package org.mifosng.platform.loan.service; package org.mifosplatform.portfolio.loanaccount.service;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.mifosng.platform.api.commands.LoanStateTransitionCommand;
import org.mifosplatform.infrastructure.core.data.ApiParameterError; import org.mifosplatform.infrastructure.core.data.ApiParameterError;
import org.mifosplatform.infrastructure.core.data.DataValidatorBuilder; import org.mifosplatform.infrastructure.core.data.DataValidatorBuilder;
import org.mifosplatform.infrastructure.core.exception.PlatformApiDataValidationException; import org.mifosplatform.infrastructure.core.exception.PlatformApiDataValidationException;
import org.mifosplatform.portfolio.loanaccount.command.LoanStateTransitionCommand;
public class LoanStateTransitionCommandValidator { public class LoanStateTransitionCommandValidator {
@@ -1,12 +1,12 @@
package org.mifosng.platform.loan.service; package org.mifosplatform.portfolio.loanaccount.service;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.mifosng.platform.api.commands.LoanTransactionCommand;
import org.mifosplatform.infrastructure.core.data.ApiParameterError; import org.mifosplatform.infrastructure.core.data.ApiParameterError;
import org.mifosplatform.infrastructure.core.data.DataValidatorBuilder; import org.mifosplatform.infrastructure.core.data.DataValidatorBuilder;
import org.mifosplatform.infrastructure.core.exception.PlatformApiDataValidationException; import org.mifosplatform.infrastructure.core.exception.PlatformApiDataValidationException;
import org.mifosplatform.portfolio.loanaccount.command.LoanTransactionCommand;
public class LoanTransactionCommandValidator { public class LoanTransactionCommandValidator {
@@ -1,13 +1,13 @@
package org.mifosng.platform.loan.service; package org.mifosplatform.portfolio.loanaccount.service;
import org.mifosng.platform.api.commands.AdjustLoanTransactionCommand;
import org.mifosng.platform.api.commands.LoanChargeCommand;
import org.mifosng.platform.api.commands.LoanStateTransitionCommand;
import org.mifosng.platform.api.commands.LoanTransactionCommand;
import org.mifosng.platform.api.commands.LoanApplicationCommand;
import org.mifosng.platform.api.commands.UndoStateTransitionCommand;
import org.mifosplatform.infrastructure.core.data.EntityIdentifier; import org.mifosplatform.infrastructure.core.data.EntityIdentifier;
import org.mifosplatform.infrastructure.staff.command.BulkTransferLoanOfficerCommand; import org.mifosplatform.infrastructure.staff.command.BulkTransferLoanOfficerCommand;
import org.mifosplatform.portfolio.loanaccount.command.AdjustLoanTransactionCommand;
import org.mifosplatform.portfolio.loanaccount.command.LoanApplicationCommand;
import org.mifosplatform.portfolio.loanaccount.command.LoanChargeCommand;
import org.mifosplatform.portfolio.loanaccount.command.LoanStateTransitionCommand;
import org.mifosplatform.portfolio.loanaccount.command.LoanTransactionCommand;
import org.mifosplatform.portfolio.loanaccount.command.UndoStateTransitionCommand;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
public interface LoanWritePlatformService { public interface LoanWritePlatformService {

Some files were not shown because too many files have changed in this diff Show More