diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/api/DepositAccountsApiResource.java b/mifosng-provider/src/main/java/org/mifosng/platform/api/DepositAccountsApiResource.java index 827a0876a..e7d55214a 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/api/DepositAccountsApiResource.java +++ b/mifosng-provider/src/main/java/org/mifosng/platform/api/DepositAccountsApiResource.java @@ -26,7 +26,6 @@ import org.mifosng.platform.api.commands.DepositAccountWithdrawInterestCommand; import org.mifosng.platform.api.commands.DepositAccountWithdrawalCommand; import org.mifosng.platform.api.commands.DepositStateTransitionApprovalCommand; 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.DepositPermissionData; 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.exception.UnrecognizedQueryParamException; import org.mifosplatform.infrastructure.security.service.PlatformSecurityContext; +import org.mifosplatform.portfolio.loanaccount.command.UndoStateTransitionCommand; import org.mifosplatform.portfolio.loanproduct.domain.PeriodFrequencyType; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Scope; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/guarantor/GuarantorReadPlatformServiceImpl.java b/mifosng-provider/src/main/java/org/mifosng/platform/guarantor/GuarantorReadPlatformServiceImpl.java index 9881475f3..39688a536 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/guarantor/GuarantorReadPlatformServiceImpl.java +++ b/mifosng-provider/src/main/java/org/mifosng/platform/guarantor/GuarantorReadPlatformServiceImpl.java @@ -6,12 +6,12 @@ import org.apache.commons.lang.StringUtils; import org.joda.time.LocalDate; import org.mifosng.platform.api.data.GuarantorData; 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.service.ReadWriteNonCoreDataService; 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.stereotype.Service; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/guarantor/GuarantorWritePlatformServiceImpl.java b/mifosng-provider/src/main/java/org/mifosng/platform/guarantor/GuarantorWritePlatformServiceImpl.java index 9fda5f356..c6752098d 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/guarantor/GuarantorWritePlatformServiceImpl.java +++ b/mifosng-provider/src/main/java/org/mifosng/platform/guarantor/GuarantorWritePlatformServiceImpl.java @@ -10,15 +10,15 @@ import java.util.Set; import org.apache.commons.lang.StringUtils; import org.mifosng.platform.api.commands.GuarantorCommand; 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.exception.PlatformApiDataValidationException; import org.mifosplatform.infrastructure.dataqueries.service.ReadWriteNonCoreDataService; import org.mifosplatform.portfolio.client.domain.Client; import org.mifosplatform.portfolio.client.domain.ClientRepository; 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.stereotype.Service; import org.springframework.transaction.annotation.Transactional; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loan/service/CalculationPlatformService.java b/mifosng-provider/src/main/java/org/mifosng/platform/loan/service/CalculationPlatformService.java deleted file mode 100644 index 44ace2893..000000000 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loan/service/CalculationPlatformService.java +++ /dev/null @@ -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); -} diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/saving/service/DepositAccountWritePlatformService.java b/mifosng-provider/src/main/java/org/mifosng/platform/saving/service/DepositAccountWritePlatformService.java index 8e1a78225..d22cdf19e 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/saving/service/DepositAccountWritePlatformService.java +++ b/mifosng-provider/src/main/java/org/mifosng/platform/saving/service/DepositAccountWritePlatformService.java @@ -5,8 +5,8 @@ import org.mifosng.platform.api.commands.DepositAccountWithdrawInterestCommand; import org.mifosng.platform.api.commands.DepositAccountWithdrawalCommand; import org.mifosng.platform.api.commands.DepositStateTransitionApprovalCommand; import org.mifosng.platform.api.commands.DepositStateTransitionCommand; -import org.mifosng.platform.api.commands.UndoStateTransitionCommand; import org.mifosplatform.infrastructure.core.data.EntityIdentifier; +import org.mifosplatform.portfolio.loanaccount.command.UndoStateTransitionCommand; import org.springframework.security.access.prepost.PreAuthorize; public interface DepositAccountWritePlatformService { diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/saving/service/DepositAccountWritePlatformServiceJpaRepositoryImpl.java b/mifosng-provider/src/main/java/org/mifosng/platform/saving/service/DepositAccountWritePlatformServiceJpaRepositoryImpl.java index 1f7035034..93b37081f 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/saving/service/DepositAccountWritePlatformServiceJpaRepositoryImpl.java +++ b/mifosng-provider/src/main/java/org/mifosng/platform/saving/service/DepositAccountWritePlatformServiceJpaRepositoryImpl.java @@ -12,7 +12,6 @@ import org.mifosng.platform.api.commands.DepositAccountWithdrawInterestCommand; import org.mifosng.platform.api.commands.DepositAccountWithdrawalCommand; import org.mifosng.platform.api.commands.DepositStateTransitionApprovalCommand; 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.DepositAccountReopenException; 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.portfolio.client.domain.Note; import org.mifosplatform.portfolio.client.domain.NoteRepository; +import org.mifosplatform.portfolio.loanaccount.command.UndoStateTransitionCommand; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; diff --git a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/api/ApiConstants.java b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/api/ApiConstants.java index 805d59fec..ef7e79a0f 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/api/ApiConstants.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/api/ApiConstants.java @@ -7,4 +7,4 @@ public class ApiConstants { // TODO:Vishwas Need to move these settings to the Database public static final Integer MAX_IMAGE_UPLOAD_SIZE_IN_MB = 1; -} +} \ No newline at end of file diff --git a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/api/ApiParameterHelper.java b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/api/ApiParameterHelper.java index 021357893..a3f2aa01c 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/api/ApiParameterHelper.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/api/ApiParameterHelper.java @@ -63,15 +63,15 @@ public class ApiParameterHelper { return exportCsv; } - public static boolean exportPdf(final MultivaluedMap queryParams) { - boolean exportPDF = false; - if (queryParams.getFirst("exportPDF") != null) { - String exportPdfValue = queryParams.getFirst("exportPDF"); - exportPDF = "true".equalsIgnoreCase(exportPdfValue); - } - return exportPDF; + boolean exportPDF = false; + if (queryParams.getFirst("exportPDF") != null) { + String exportPdfValue = queryParams.getFirst("exportPDF"); + exportPDF = "true".equalsIgnoreCase(exportPdfValue); + } + return exportPDF; } + public static boolean parameterType(final MultivaluedMap queryParams) { boolean parameterType = false; if (queryParams.getFirst("parameterType") != null) { @@ -89,7 +89,7 @@ public class ApiParameterHelper { } return template; } - + public static boolean makerCheckerable(final MultivaluedMap queryParams) { boolean makerCheckerable = false; if (queryParams.getFirst("makerCheckerable") != null) { diff --git a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/api/GoogleGsonPortfolioApiJsonSerializerService.java b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/api/GoogleGsonPortfolioApiJsonSerializerService.java index d369e5a0f..985370e1e 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/api/GoogleGsonPortfolioApiJsonSerializerService.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/api/GoogleGsonPortfolioApiJsonSerializerService.java @@ -11,10 +11,6 @@ import org.mifosng.platform.api.data.DocumentData; import org.mifosng.platform.api.data.GroupAccountSummaryCollectionData; import org.mifosng.platform.api.data.GroupData; 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.SavingProductData; 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.NoteData; 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.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; diff --git a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/api/GoogleGsonSerializerHelper.java b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/api/GoogleGsonSerializerHelper.java index 8f0094acd..2cc486894 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/api/GoogleGsonSerializerHelper.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/api/GoogleGsonSerializerHelper.java @@ -19,54 +19,51 @@ import com.google.gson.GsonBuilder; @Service public class GoogleGsonSerializerHelper { - public Gson createGsonBuilder(final boolean prettyPrint) { - final GsonBuilder builder = new GsonBuilder(); - builder.registerTypeAdapter(LocalDate.class, new JodaLocalDateAdapter()); - builder.registerTypeAdapter(DateTime.class, new JodaDateTimeAdapter()); - if (prettyPrint) { - builder.setPrettyPrinting(); - } - return builder.create(); - } - - public Gson createGsonBuilderWithParameterExclusionSerializationStrategy( - final Set supportedParameters, - final boolean prettyPrint, - final Set responseParameters) { + public Gson createGsonBuilder(final boolean prettyPrint) { + final GsonBuilder builder = new GsonBuilder(); + builder.registerTypeAdapter(LocalDate.class, new JodaLocalDateAdapter()); + builder.registerTypeAdapter(DateTime.class, new JodaDateTimeAdapter()); + if (prettyPrint) { + builder.setPrettyPrinting(); + } + return builder.create(); + } - final Set parameterNamesToSkip = new HashSet(); + public Gson createGsonBuilderWithParameterExclusionSerializationStrategy(final Set supportedParameters, + final boolean prettyPrint, final Set responseParameters) { - if (!responseParameters.isEmpty()) { + final Set parameterNamesToSkip = new HashSet(); - // strip out all known support parameters from expected response to - // see if unsupported parameters requested for response. - final Set differentParametersDetectedSet = new HashSet(responseParameters); - differentParametersDetectedSet.removeAll(supportedParameters); + if (!responseParameters.isEmpty()) { - if (!differentParametersDetectedSet.isEmpty()) { - throw new UnsupportedParameterException(new ArrayList(differentParametersDetectedSet)); - } + // strip out all known support parameters from expected response to + // see if unsupported parameters requested for response. + final Set differentParametersDetectedSet = new HashSet(responseParameters); + differentParametersDetectedSet.removeAll(supportedParameters); - parameterNamesToSkip.addAll(supportedParameters); - parameterNamesToSkip.removeAll(responseParameters); - } + if (!differentParametersDetectedSet.isEmpty()) { throw new UnsupportedParameterException(new ArrayList( + differentParametersDetectedSet)); } - final ExclusionStrategy strategy = new ParameterListExclusionStrategy(parameterNamesToSkip); + parameterNamesToSkip.addAll(supportedParameters); + parameterNamesToSkip.removeAll(responseParameters); + } - final GsonBuilder builder = new GsonBuilder().addSerializationExclusionStrategy(strategy); - builder.registerTypeAdapter(LocalDate.class, new JodaLocalDateAdapter()); - builder.registerTypeAdapter(DateTime.class, new JodaDateTimeAdapter()); - if (prettyPrint) { - builder.setPrettyPrinting(); - } - return builder.create(); - } + final ExclusionStrategy strategy = new ParameterListExclusionStrategy(parameterNamesToSkip); - public String serializedJsonFrom(final Gson serializer, final Object[] dataObjects) { - return serializer.toJson(dataObjects); - } + final GsonBuilder builder = new GsonBuilder().addSerializationExclusionStrategy(strategy); + builder.registerTypeAdapter(LocalDate.class, new JodaLocalDateAdapter()); + builder.registerTypeAdapter(DateTime.class, new JodaDateTimeAdapter()); + if (prettyPrint) { + builder.setPrettyPrinting(); + } + return builder.create(); + } - public String serializedJsonFrom(final Gson serializer, final Object singleDataObject) { - return serializer.toJson(singleDataObject); - } + public String serializedJsonFrom(final Gson serializer, final Object[] dataObjects) { + return serializer.toJson(dataObjects); + } + + public String serializedJsonFrom(final Gson serializer, final Object singleDataObject) { + return serializer.toJson(singleDataObject); + } } \ No newline at end of file diff --git a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/api/JodaDateTimeAdapter.java b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/api/JodaDateTimeAdapter.java index 23b71e79f..6f11ffbbf 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/api/JodaDateTimeAdapter.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/api/JodaDateTimeAdapter.java @@ -10,20 +10,20 @@ import com.google.gson.JsonSerializationContext; 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 { - @SuppressWarnings("unused") - @Override - public JsonElement serialize(DateTime src, Type typeOfSrc, JsonSerializationContext context) { - - JsonElement element = null; - if (src != null) { - element = new JsonPrimitive(src.getMillis()); - } - - return element; - } + @SuppressWarnings("unused") + @Override + public JsonElement serialize(DateTime src, Type typeOfSrc, JsonSerializationContext context) { + JsonElement element = null; + if (src != null) { + element = new JsonPrimitive(src.getMillis()); + } + + return element; + } } diff --git a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/api/JodaLocalDateAdapter.java b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/api/JodaLocalDateAdapter.java index 2f5eae15c..79d892465 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/api/JodaLocalDateAdapter.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/api/JodaLocalDateAdapter.java @@ -11,23 +11,23 @@ import com.google.gson.JsonSerializationContext; 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 { - @SuppressWarnings("unused") - @Override - public JsonElement serialize(LocalDate src, Type typeOfSrc, JsonSerializationContext context) { - - JsonArray array = null; - if (src != null) { - array = new JsonArray(); - array.add(new JsonPrimitive(src.getYearOfEra())); - array.add(new JsonPrimitive(src.getMonthOfYear())); - array.add(new JsonPrimitive(src.getDayOfMonth())); - } - - return array; - } + @SuppressWarnings("unused") + @Override + public JsonElement serialize(LocalDate src, Type typeOfSrc, JsonSerializationContext context) { -} + JsonArray array = null; + if (src != null) { + array = new JsonArray(); + array.add(new JsonPrimitive(src.getYearOfEra())); + array.add(new JsonPrimitive(src.getMonthOfYear())); + array.add(new JsonPrimitive(src.getDayOfMonth())); + } + + return array; + } +} \ No newline at end of file diff --git a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/api/JsonParserHelper.java b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/api/JsonParserHelper.java index d32fc610c..d20faa3da 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/api/JsonParserHelper.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/api/JsonParserHelper.java @@ -74,7 +74,8 @@ public class JsonParserHelper { return stringValue; } - public BigDecimal extractBigDecimalWithLocaleNamed(final String parameterName, final JsonElement element, final Set modifiedParameters) { + public BigDecimal extractBigDecimalWithLocaleNamed(final String parameterName, final JsonElement element, + final Set modifiedParameters) { BigDecimal value = null; if (element.isJsonObject()) { final JsonObject object = element.getAsJsonObject(); @@ -157,7 +158,7 @@ public class JsonParserHelper { } return clientApplicationLocale; } - + public String[] extractArrayNamed(final String parameterName, final JsonElement element, final Set parametersPassedInRequest) { String[] arrayValue = null; if (element.isJsonObject()) { diff --git a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/api/ParameterListExclusionStrategy.java b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/api/ParameterListExclusionStrategy.java index ecc3d6d0a..0e32bae3d 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/api/ParameterListExclusionStrategy.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/api/ParameterListExclusionStrategy.java @@ -11,20 +11,20 @@ import com.google.gson.FieldAttributes; // into account the Object its looking at. public class ParameterListExclusionStrategy implements ExclusionStrategy { - private final Set parameterNamesToSkip; + private final Set parameterNamesToSkip; - public ParameterListExclusionStrategy(final Set parameterNamesToSkip) { - this.parameterNamesToSkip = parameterNamesToSkip; - } + public ParameterListExclusionStrategy(final Set parameterNamesToSkip) { + this.parameterNamesToSkip = parameterNamesToSkip; + } - @Override - public boolean shouldSkipField(FieldAttributes f) { - return parameterNamesToSkip.contains(f.getName()); - } + @Override + public boolean shouldSkipField(FieldAttributes f) { + return parameterNamesToSkip.contains(f.getName()); + } - @SuppressWarnings("unused") - @Override - public boolean shouldSkipClass(Class clazz) { - return false; - } + @SuppressWarnings("unused") + @Override + public boolean shouldSkipClass(Class clazz) { + return false; + } } \ No newline at end of file diff --git a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/api/PortfolioApiDataConversionService.java b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/api/PortfolioApiDataConversionService.java index 6c01775ca..7c3771d73 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/api/PortfolioApiDataConversionService.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/api/PortfolioApiDataConversionService.java @@ -1,6 +1,5 @@ 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.DepositAccountWithdrawInterestCommand; 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.GroupCommand; 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.SavingProductCommand; 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.data.ClientData; 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; public interface PortfolioApiDataConversionService { @@ -65,7 +65,7 @@ public interface PortfolioApiDataConversionService { 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); diff --git a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/api/PortfolioApiDataConversionServiceImpl.java b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/api/PortfolioApiDataConversionServiceImpl.java index aa7ff7efa..ece2f0419 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/api/PortfolioApiDataConversionServiceImpl.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/api/PortfolioApiDataConversionServiceImpl.java @@ -17,7 +17,6 @@ import java.util.Set; import org.apache.commons.lang.StringUtils; import org.joda.time.LocalDate; 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.DepositAccountWithdrawInterestCommand; 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.GroupCommand; 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.SavingProductCommand; 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.data.ClientData; 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.springframework.beans.factory.annotation.Autowired; import org.springframework.format.number.NumberFormatter; @@ -102,7 +102,7 @@ public class PortfolioApiDataConversionServiceImpl implements PortfolioApiDataCo "active")); checkForUnsupportedParameters(requestMap, supportedParams); - + final JsonParserHelper helper = new JsonParserHelper(); JsonParser parser = new JsonParser(); final JsonElement element = parser.parse(json); @@ -112,16 +112,17 @@ public class PortfolioApiDataConversionServiceImpl implements PortfolioApiDataCo final String name = helper.extractStringNamed("name", element, parametersPassedInRequest); final String currencyCode = helper.extractStringNamed("currencyCode", element, parametersPassedInRequest); final BigDecimal amount = helper.extractBigDecimalWithLocaleNamed("amount", element.getAsJsonObject(), parametersPassedInRequest); - + final Integer chargeTimeType = helper.extractIntegerWithLocaleNamed("chargeTimeType", 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 active = helper.extractBooleanNamed("active", element, parametersPassedInRequest); - - return new ChargeDefinitionCommand(parametersPassedInRequest, false, resourceIdentifier, name, amount, currencyCode, chargeTimeType, chargeAppliesTo, - chargeCalculationType, penalty, active); + + return new ChargeDefinitionCommand(parametersPassedInRequest, false, resourceIdentifier, name, amount, currencyCode, + chargeTimeType, chargeAppliesTo, chargeCalculationType, penalty, active); } @Override @@ -548,7 +549,8 @@ public class PortfolioApiDataConversionServiceImpl implements PortfolioApiDataCo final BigDecimal principal = helper.extractBigDecimalWithLocaleNamed("principal", 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 numberOfRepayments = helper.extractIntegerWithLocaleNamed("numberOfRepayments", element, modifiedParameters); final Integer repaymentFrequencyType = helper.extractIntegerWithLocaleNamed("repaymentFrequencyType", element, modifiedParameters); @@ -561,7 +563,8 @@ public class PortfolioApiDataConversionServiceImpl implements PortfolioApiDataCo // final Integer loanTermFrequencyType = // helper.extractIntegerNamed("loanTermFrequencyType", element, // 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 interestType = helper.extractIntegerWithLocaleNamed("interestType", element, modifiedParameters); 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, - currencyCode, digitsAfterDecimal, principal, inArrearsTolerance, numberOfRepayments, repaymentEvery, interestRatePerPeriod, - repaymentFrequencyType, interestRateFrequencyType, amortizationType, interestType, interestCalculationPeriodType, charges); + return new LoanProductCommand(modifiedParameters, false, resourceIdentifier, name, description, fundId, + transactionProcessingStrategyId, currencyCode, digitsAfterDecimal, principal, inArrearsTolerance, numberOfRepayments, + repaymentEvery, interestRatePerPeriod, repaymentFrequencyType, interestRateFrequencyType, amortizationType, interestType, + interestCalculationPeriodType, charges); } @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(); } @@ -617,14 +621,18 @@ public class PortfolioApiDataConversionServiceImpl implements PortfolioApiDataCo parametersPassedInCommand); final String externalId = helper.extractStringNamed("externalId", element, parametersPassedInCommand); final BigDecimal principal = helper.extractBigDecimalWithLocaleNamed("principal", element, parametersPassedInCommand); - final BigDecimal inArrearsToleranceValue = helper.extractBigDecimalWithLocaleNamed("inArrearsTolerance", element, parametersPassedInCommand); - final BigDecimal interestRatePerPeriod = helper.extractBigDecimalWithLocaleNamed("interestRatePerPeriod", element, parametersPassedInCommand); + final BigDecimal inArrearsToleranceValue = helper.extractBigDecimalWithLocaleNamed("inArrearsTolerance", element, + parametersPassedInCommand); + final BigDecimal interestRatePerPeriod = helper.extractBigDecimalWithLocaleNamed("interestRatePerPeriod", element, + parametersPassedInCommand); final Integer repaymentEvery = helper.extractIntegerWithLocaleNamed("repaymentEvery", 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 loanTermFrequencyType = helper.extractIntegerWithLocaleNamed("loanTermFrequencyType", element, parametersPassedInCommand); + final Integer loanTermFrequencyType = helper.extractIntegerWithLocaleNamed("loanTermFrequencyType", element, + parametersPassedInCommand); final Integer interestRateFrequencyType = helper.extractIntegerWithLocaleNamed("interestRateFrequencyType", element, parametersPassedInCommand); final Integer amortizationType = helper.extractIntegerWithLocaleNamed("amortizationType", element, parametersPassedInCommand); @@ -1057,9 +1065,9 @@ public class PortfolioApiDataConversionServiceImpl implements PortfolioApiDataCo /* * private LocalDate convertFrom(final String dateAsString, final String * parameterName, final String dateFormat) { - * + * * if (StringUtils.isBlank(dateFormat)) { - * + * * List dataValidationErrors = new * ArrayList(); String defaultMessage = new * StringBuilder("The parameter '" + parameterName + @@ -1067,11 +1075,11 @@ public class PortfolioApiDataConversionServiceImpl implements PortfolioApiDataCo * ApiParameterError error = ApiParameterError.parameterError( * "validation.msg.missing.dateFormat.parameter", defaultMessage, * parameterName); dataValidationErrors.add(error); - * + * * throw new PlatformApiDataValidationException( * "validation.msg.validation.errors.exist", "Validation errors exist.", * dataValidationErrors); } - * + * * LocalDate eventLocalDate = null; if * (StringUtils.isNotBlank(dateAsString)) { try { Locale locale = * LocaleContextHolder.getLocale(); eventLocalDate = @@ -1084,18 +1092,18 @@ public class PortfolioApiDataConversionServiceImpl implements PortfolioApiDataCo * " is invalid based on the dateFormat provided:" + dateFormat, * parameterName, dateAsString, dateFormat); * dataValidationErrors.add(error); - * + * * throw new PlatformApiDataValidationException( * "validation.msg.validation.errors.exist", "Validation errors exist.", * dataValidationErrors); } } - * + * * return eventLocalDate; } - * + * * private Integer convertToInteger(final String numericalValueFormatted, * final String parameterName, final Locale clientApplicationLocale) { - * + * * if (clientApplicationLocale == null) { - * + * * List dataValidationErrors = new * ArrayList(); String defaultMessage = new * StringBuilder("The parameter '" + parameterName + @@ -1103,41 +1111,41 @@ public class PortfolioApiDataConversionServiceImpl implements PortfolioApiDataCo * ApiParameterError error = * ApiParameterError.parameterError("validation.msg.missing.locale.parameter" * , defaultMessage, parameterName); dataValidationErrors.add(error); - * + * * throw new PlatformApiDataValidationException( * "validation.msg.validation.errors.exist", "Validation errors exist.", * dataValidationErrors); } - * + * * try { Integer number = null; - * + * * if (StringUtils.isNotBlank(numericalValueFormatted)) { - * + * * String source = numericalValueFormatted.trim(); - * + * * NumberFormat format = NumberFormat.getInstance(clientApplicationLocale); * DecimalFormat df = (DecimalFormat) format; DecimalFormatSymbols symbols = * df.getDecimalFormatSymbols(); df.setParseBigDecimal(true); - * + * * // http://bugs.sun.com/view_bug.do?bug_id=4510618 char groupingSeparator * = symbols.getGroupingSeparator(); if (groupingSeparator == '\u00a0') { * source = source.replaceAll(" ", Character.toString('\u00a0')); } - * + * * Number parsedNumber = df.parse(source); - * + * * double parsedNumberDouble = parsedNumber.doubleValue(); int * parsedNumberInteger = parsedNumber.intValue(); - * + * * if (source.contains(Character.toString(symbols.getDecimalSeparator()))) { * throw new ParseException(source, 0); } - * + * * if * (!Double.valueOf(parsedNumberDouble).equals(Double.valueOf(Integer.valueOf * (parsedNumberInteger)))) { throw new ParseException(source, 0); } - * + * * number = parsedNumber.intValue(); } - * + * * return number; } catch (ParseException e) { - * + * * List dataValidationErrors = new * ArrayList(); ApiParameterError error = * ApiParameterError.parameterError( @@ -1147,16 +1155,16 @@ public class PortfolioApiDataConversionServiceImpl implements PortfolioApiDataCo * clientApplicationLocale.toString() + "].", parameterName, * numericalValueFormatted, clientApplicationLocale); * dataValidationErrors.add(error); - * + * * throw new PlatformApiDataValidationException( * "validation.msg.validation.errors.exist", "Validation errors exist.", * dataValidationErrors); } } - * + * * private BigDecimal convertFrom(final String numericalValueFormatted, * final String parameterName, final Locale clientApplicationLocale) { - * + * * if (clientApplicationLocale == null) { - * + * * List dataValidationErrors = new * ArrayList(); String defaultMessage = new * StringBuilder("The parameter '" + parameterName + @@ -1164,17 +1172,17 @@ public class PortfolioApiDataConversionServiceImpl implements PortfolioApiDataCo * ApiParameterError error = * ApiParameterError.parameterError("validation.msg.missing.locale.parameter" * , defaultMessage, parameterName); dataValidationErrors.add(error); - * + * * throw new PlatformApiDataValidationException( * "validation.msg.validation.errors.exist", "Validation errors exist.", * dataValidationErrors); } - * + * * try { BigDecimal number = null; - * + * * if (StringUtils.isNotBlank(numericalValueFormatted)) { - * + * * String source = numericalValueFormatted.trim(); - * + * * NumberFormat format = * NumberFormat.getNumberInstance(clientApplicationLocale); DecimalFormat df * = (DecimalFormat) format; DecimalFormatSymbols symbols = @@ -1182,14 +1190,14 @@ public class PortfolioApiDataConversionServiceImpl implements PortfolioApiDataCo * http://bugs.sun.com/view_bug.do?bug_id=4510618 char groupingSeparator = * symbols.getGroupingSeparator(); if (groupingSeparator == '\u00a0') { * source = source.replaceAll(" ", Character.toString('\u00a0')); } - * + * * NumberFormatter numberFormatter = new NumberFormatter(); Number * parsedNumber = numberFormatter.parse(source, clientApplicationLocale); * number = BigDecimal.valueOf(Double.valueOf(parsedNumber.doubleValue())); * } - * + * * return number; } catch (ParseException e) { - * + * * List dataValidationErrors = new * ArrayList(); ApiParameterError error = * ApiParameterError.parameterError( @@ -1199,7 +1207,7 @@ public class PortfolioApiDataConversionServiceImpl implements PortfolioApiDataCo * clientApplicationLocale.toString() + "].", parameterName, * numericalValueFormatted, clientApplicationLocale); * dataValidationErrors.add(error); - * + * * throw new PlatformApiDataValidationException( * "validation.msg.validation.errors.exist", "Validation errors exist.", * dataValidationErrors); } } @@ -1493,7 +1501,8 @@ public class PortfolioApiDataConversionServiceImpl implements PortfolioApiDataCo } @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(); } Type typeOfMap = new TypeToken>() {}.getType(); @@ -1517,7 +1526,8 @@ public class PortfolioApiDataConversionServiceImpl implements PortfolioApiDataCo 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); } diff --git a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/api/PortfolioApiJsonSerializerService.java b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/api/PortfolioApiJsonSerializerService.java index 793e994af..d44a0a9f4 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/api/PortfolioApiJsonSerializerService.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/api/PortfolioApiJsonSerializerService.java @@ -9,10 +9,6 @@ import org.mifosng.platform.api.data.DocumentData; import org.mifosng.platform.api.data.GroupAccountSummaryCollectionData; import org.mifosng.platform.api.data.GroupData; 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.SavingProductData; 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.NoteData; 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; public interface PortfolioApiJsonSerializerService { diff --git a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/api/PortfolioCommandDeserializerService.java b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/api/PortfolioCommandDeserializerService.java index 07f7604f1..26bb1ea9c 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/api/PortfolioCommandDeserializerService.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/api/PortfolioCommandDeserializerService.java @@ -32,7 +32,7 @@ public interface PortfolioCommandDeserializerService { RolePermissionCommand deserializeRolePermissionCommand(Long roleId, String commandAsJson, boolean makerCheckerApproval); PermissionsCommand deserializePermissionsCommand(String commandAsJson, boolean makerCheckerApproval); - + UserCommand deserializeUserCommand(Long userId, String commandAsJson, boolean makerCheckerApproval); CodeCommand deserializeCodeCommand(Long codeId, String commandAsJson, boolean makerCheckerApproval); @@ -53,5 +53,6 @@ public interface PortfolioCommandDeserializerService { 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); } \ No newline at end of file diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/charge/service/ChargeReadPlatformService.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/charge/service/ChargeReadPlatformService.java index e62f49bef..ef519b9bb 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/charge/service/ChargeReadPlatformService.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/charge/service/ChargeReadPlatformService.java @@ -2,8 +2,8 @@ package org.mifosplatform.portfolio.charge.service; import java.util.Collection; -import org.mifosng.platform.api.data.LoanChargeData; 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 public interface ChargeReadPlatformService { diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/charge/service/ChargeReadPlatformServiceImpl.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/charge/service/ChargeReadPlatformServiceImpl.java index f3305a824..872ce2b3f 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/charge/service/ChargeReadPlatformServiceImpl.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/charge/service/ChargeReadPlatformServiceImpl.java @@ -7,7 +7,6 @@ import java.util.Collection; import java.util.List; import org.joda.time.LocalDate; -import org.mifosng.platform.api.data.LoanChargeData; import org.mifosplatform.infrastructure.configuration.data.CurrencyData; import org.mifosplatform.infrastructure.configuration.service.CurrencyReadPlatformService; 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.domain.ChargeAppliesTo; import org.mifosplatform.portfolio.charge.exception.ChargeNotFoundException; +import org.mifosplatform.portfolio.loanaccount.data.LoanChargeData; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.dao.EmptyResultDataAccessException; import org.springframework.jdbc.core.JdbcTemplate; diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/client/domain/Note.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/client/domain/Note.java index 693e15d29..f2934c634 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/client/domain/Note.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/client/domain/Note.java @@ -6,11 +6,11 @@ import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; 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.mifosplatform.infrastructure.core.domain.AbstractAuditableCustom; import org.mifosplatform.infrastructure.user.domain.AppUser; +import org.mifosplatform.portfolio.loanaccount.domain.Loan; +import org.mifosplatform.portfolio.loanaccount.domain.LoanTransaction; @Entity @Table(name = "m_note") diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/api/LoansApiResource.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/api/LoansApiResource.java similarity index 83% rename from mifosng-provider/src/main/java/org/mifosng/platform/api/LoansApiResource.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/api/LoansApiResource.java index af87479d7..4d9f07e50 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/api/LoansApiResource.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/api/LoansApiResource.java @@ -1,4 +1,4 @@ -package org.mifosng.platform.api; +package org.mifosplatform.portfolio.loanaccount.api; import java.util.Arrays; import java.util.Collection; @@ -20,30 +20,15 @@ import javax.ws.rs.core.UriInfo; import org.apache.commons.lang.StringUtils; 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.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.loan.service.CalculationPlatformService; -import org.mifosng.platform.loan.service.LoanReadPlatformService; -import org.mifosng.platform.loan.service.LoanWritePlatformService; +import org.mifosplatform.commands.service.PortfolioCommandSourceWritePlatformService; import org.mifosplatform.infrastructure.configuration.domain.MonetaryCurrency; import org.mifosplatform.infrastructure.configuration.domain.Money; import org.mifosplatform.infrastructure.core.api.ApiParameterHelper; import org.mifosplatform.infrastructure.core.api.PortfolioApiDataConversionService; 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.EnumOptionData; 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.fund.data.FundData; 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.TransactionProcessingStrategyData; import org.mifosplatform.portfolio.loanproduct.service.LoanDropdownReadPlatformService; @@ -73,44 +75,51 @@ import org.springframework.util.CollectionUtils; @Scope("singleton") public class LoansApiResource { - @Autowired - private LoanReadPlatformService loanReadPlatformService; + // private final String resourceNameForPermissions = "OFFICE"; + + 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 - private LoanWritePlatformService loanWritePlatformService; - - @Autowired - private LoanProductReadPlatformService loanProductReadPlatformService; - - @Autowired - private LoanDropdownReadPlatformService dropdownReadPlatformService; - - @Autowired - private FundReadPlatformService fundReadPlatformService; - - @Autowired - private ChargeReadPlatformService chargeReadPlatformService; - - @Autowired - private CalculationPlatformService calculationPlatformService; - - @Autowired - private PortfolioApiDataConversionService apiDataConversionService; - - @Autowired - private PortfolioApiJsonSerializerService apiJsonSerializerService; - - @Autowired - private StaffReadPlatformService staffReadPlatformService; - - @Autowired - private OfficeReadPlatformService officeReadPlatformService; - - @Autowired - private PlatformSecurityContext context; - - @Autowired - private GuarantorReadPlatformService guarantorReadPlatformService; + public LoansApiResource(final PlatformSecurityContext context, final LoanReadPlatformService loanReadPlatformService, + final LoanWritePlatformService loanWritePlatformService, final LoanProductReadPlatformService loanProductReadPlatformService, + final LoanDropdownReadPlatformService dropdownReadPlatformService, final FundReadPlatformService fundReadPlatformService, + final ChargeReadPlatformService chargeReadPlatformService, final CalculationPlatformService calculationPlatformService, + final StaffReadPlatformService staffReadPlatformService, final OfficeReadPlatformService officeReadPlatformService, + final GuarantorReadPlatformService guarantorReadPlatformService, + final PortfolioApiJsonSerializerService apiJsonSerializerService, + final PortfolioApiDataConversionService apiDataConversionService, + final PortfolioCommandSerializerService commandSerializerService, + final PortfolioCommandSourceWritePlatformService commandsSourceWritePlatformService) { + this.context = context; + this.loanReadPlatformService = loanReadPlatformService; + this.loanWritePlatformService = loanWritePlatformService; + this.loanProductReadPlatformService = loanProductReadPlatformService; + this.dropdownReadPlatformService = dropdownReadPlatformService; + this.fundReadPlatformService = fundReadPlatformService; + this.chargeReadPlatformService = chargeReadPlatformService; + this.calculationPlatformService = calculationPlatformService; + this.staffReadPlatformService = staffReadPlatformService; + this.officeReadPlatformService = officeReadPlatformService; + this.guarantorReadPlatformService = guarantorReadPlatformService; + this.apiJsonSerializerService = apiJsonSerializerService; + this.apiDataConversionService = apiDataConversionService; + this.commandSerializerService = commandSerializerService; + this.commandsSourceWritePlatformService = commandsSourceWritePlatformService; + } @GET @Path("template") @@ -304,7 +313,8 @@ public class LoansApiResource { public String calculateLoanScheduleOrSubmitLoanApplication(@QueryParam("command") final String commandParam, @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")) { CalculateLoanScheduleCommand calculateLoanScheduleCommand = command.toCalculateLoanScheduleCommand(); @@ -332,7 +342,8 @@ public class LoansApiResource { @Produces({ MediaType.APPLICATION_JSON }) 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); @@ -582,7 +593,8 @@ public class LoansApiResource { @Produces({ MediaType.APPLICATION_JSON }) 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); @@ -601,33 +613,42 @@ public class LoansApiResource { final LoanBasicDetailsData loanBasicDetails = this.loanReadPlatformService.retrieveLoanAccountDetails(loanId); - final Collection allowedLoanOfficers = this.staffReadPlatformService.retrieveAllLoanOfficersByOffice(loanBasicDetails.getOfficeId()); + final Collection allowedLoanOfficers = this.staffReadPlatformService.retrieveAllLoanOfficersByOffice(loanBasicDetails + .getOfficeId()); 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); } - + @POST @Path("loanreassignment") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) public Response loanReassignment(final String apiRequestBodyAsJson) { -// final List allowedPermissions = Arrays.asList("ALL_FUNCTIONS", "PORTFOLIO_MANAGEMENT_SUPER_USER", "BULKREASSIGN_LOAN"); -// context.authenticatedUser().validateHasPermissionTo("BULKREASSIGN_LOAN", allowedPermissions); -// -// final EntityIdentifier result = this.commandsSourceWritePlatformService.logCommandSource("BULKREASSIGN_LOAN", "staff", null, -// apiRequestBodyAsJson); -// -// return this.apiJsonSerializerService.serializeEntityIdentifier(result); + // final List allowedPermissions = + // Arrays.asList("ALL_FUNCTIONS", "PORTFOLIO_MANAGEMENT_SUPER_USER", + // "BULKREASSIGN_LOAN"); + // context.authenticatedUser().validateHasPermissionTo("BULKREASSIGN_LOAN", + // allowedPermissions); + // + // 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 @@ -655,8 +676,8 @@ public class LoansApiResource { staffAccountSummaryCollectionData = this.staffReadPlatformService.retrieveLoanOfficerAccountSummary(loanOfficerId); } - final BulkTransferLoanOfficerData loanReassignmentData = BulkTransferLoanOfficerData.templateForBulk(officeId, loanOfficerId, new LocalDate(), - offices, loanOfficers, staffAccountSummaryCollectionData); + final BulkTransferLoanOfficerData loanReassignmentData = BulkTransferLoanOfficerData.templateForBulk(officeId, loanOfficerId, + new LocalDate(), offices, loanOfficers, staffAccountSummaryCollectionData); return this.apiJsonSerializerService.serializeLoanReassignmentDataToJson(prettyPrint, responseParameters, loanReassignmentData); } diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/api/commands/AdjustLoanTransactionCommand.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/command/AdjustLoanTransactionCommand.java similarity index 94% rename from mifosng-provider/src/main/java/org/mifosng/platform/api/commands/AdjustLoanTransactionCommand.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/command/AdjustLoanTransactionCommand.java index 7d5dca396..f7e1b740e 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/api/commands/AdjustLoanTransactionCommand.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/command/AdjustLoanTransactionCommand.java @@ -1,4 +1,4 @@ -package org.mifosng.platform.api.commands; +package org.mifosplatform.portfolio.loanaccount.command; import java.math.BigDecimal; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/api/commands/LoanApplicationCommand.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/command/LoanApplicationCommand.java similarity index 98% rename from mifosng-provider/src/main/java/org/mifosng/platform/api/commands/LoanApplicationCommand.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/command/LoanApplicationCommand.java index 33cb854e6..bf3815a5c 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/api/commands/LoanApplicationCommand.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/command/LoanApplicationCommand.java @@ -1,9 +1,10 @@ -package org.mifosng.platform.api.commands; +package org.mifosplatform.portfolio.loanaccount.command; import java.math.BigDecimal; import java.util.Set; import org.joda.time.LocalDate; +import org.mifosplatform.portfolio.loanaccount.loanschedule.command.CalculateLoanScheduleCommand; import org.mifosplatform.portfolio.loanproduct.command.LoanProductCommand; /** diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/api/commands/LoanChargeCommand.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/command/LoanChargeCommand.java similarity index 97% rename from mifosng-provider/src/main/java/org/mifosng/platform/api/commands/LoanChargeCommand.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/command/LoanChargeCommand.java index c0c98f26b..82525da5a 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/api/commands/LoanChargeCommand.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/command/LoanChargeCommand.java @@ -1,4 +1,4 @@ -package org.mifosng.platform.api.commands; +package org.mifosplatform.portfolio.loanaccount.command; import java.math.BigDecimal; import java.util.HashSet; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/api/commands/LoanStateTransitionCommand.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/command/LoanStateTransitionCommand.java similarity index 91% rename from mifosng-provider/src/main/java/org/mifosng/platform/api/commands/LoanStateTransitionCommand.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/command/LoanStateTransitionCommand.java index 77c763856..eaca07029 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/api/commands/LoanStateTransitionCommand.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/command/LoanStateTransitionCommand.java @@ -1,4 +1,4 @@ -package org.mifosng.platform.api.commands; +package org.mifosplatform.portfolio.loanaccount.command; import org.joda.time.LocalDate; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/api/commands/LoanTransactionCommand.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/command/LoanTransactionCommand.java similarity index 93% rename from mifosng-provider/src/main/java/org/mifosng/platform/api/commands/LoanTransactionCommand.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/command/LoanTransactionCommand.java index 86f298e7d..a91d5fedc 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/api/commands/LoanTransactionCommand.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/command/LoanTransactionCommand.java @@ -1,4 +1,4 @@ -package org.mifosng.platform.api.commands; +package org.mifosplatform.portfolio.loanaccount.command; import java.math.BigDecimal; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/api/commands/UndoStateTransitionCommand.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/command/UndoStateTransitionCommand.java similarity index 87% rename from mifosng-provider/src/main/java/org/mifosng/platform/api/commands/UndoStateTransitionCommand.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/command/UndoStateTransitionCommand.java index 6f321982a..6a5633a38 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/api/commands/UndoStateTransitionCommand.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/command/UndoStateTransitionCommand.java @@ -1,4 +1,4 @@ -package org.mifosng.platform.api.commands; +package org.mifosplatform.portfolio.loanaccount.command; /** * Immutable command for undo'ing a state transition. diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/api/data/DisbursementData.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/data/DisbursementData.java similarity index 94% rename from mifosng-provider/src/main/java/org/mifosng/platform/api/data/DisbursementData.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/data/DisbursementData.java index 9d20402c5..00d3ec2ee 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/api/data/DisbursementData.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/data/DisbursementData.java @@ -1,4 +1,4 @@ -package org.mifosng.platform.api.data; +package org.mifosplatform.portfolio.loanaccount.data; import java.math.BigDecimal; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/api/data/LoanAccountData.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/data/LoanAccountData.java similarity index 98% rename from mifosng-provider/src/main/java/org/mifosng/platform/api/data/LoanAccountData.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/data/LoanAccountData.java index 49bdbccfe..16ac7d25a 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/api/data/LoanAccountData.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/data/LoanAccountData.java @@ -1,9 +1,10 @@ -package org.mifosng.platform.api.data; +package org.mifosplatform.portfolio.loanaccount.data; import java.math.BigDecimal; import java.util.Collection; import org.joda.time.LocalDate; +import org.mifosng.platform.api.data.GuarantorData; import org.mifosplatform.infrastructure.configuration.data.CurrencyData; import org.mifosplatform.infrastructure.core.data.EnumOptionData; import org.mifosplatform.infrastructure.staff.data.StaffData; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/api/data/LoanBasicDetailsData.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/data/LoanBasicDetailsData.java similarity index 99% rename from mifosng-provider/src/main/java/org/mifosng/platform/api/data/LoanBasicDetailsData.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/data/LoanBasicDetailsData.java index a8519f14c..c38bd4b21 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/api/data/LoanBasicDetailsData.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/data/LoanBasicDetailsData.java @@ -1,4 +1,4 @@ -package org.mifosng.platform.api.data; +package org.mifosplatform.portfolio.loanaccount.data; import java.math.BigDecimal; import java.util.ArrayList; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/api/data/LoanChargeData.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/data/LoanChargeData.java similarity index 98% rename from mifosng-provider/src/main/java/org/mifosng/platform/api/data/LoanChargeData.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/data/LoanChargeData.java index 2061ef712..581f02eea 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/api/data/LoanChargeData.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/data/LoanChargeData.java @@ -1,4 +1,4 @@ -package org.mifosng.platform.api.data; +package org.mifosplatform.portfolio.loanaccount.data; import java.math.BigDecimal; import java.util.Collection; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/api/data/LoanConvenienceData.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/data/LoanConvenienceData.java similarity index 96% rename from mifosng-provider/src/main/java/org/mifosng/platform/api/data/LoanConvenienceData.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/data/LoanConvenienceData.java index d0c372649..7e8226138 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/api/data/LoanConvenienceData.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/data/LoanConvenienceData.java @@ -1,4 +1,4 @@ -package org.mifosng.platform.api.data; +package org.mifosplatform.portfolio.loanaccount.data; public class LoanConvenienceData { diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/api/data/LoanPermissionData.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/data/LoanPermissionData.java similarity index 97% rename from mifosng-provider/src/main/java/org/mifosng/platform/api/data/LoanPermissionData.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/data/LoanPermissionData.java index ee3fdc17f..90101cc5a 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/api/data/LoanPermissionData.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/data/LoanPermissionData.java @@ -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. diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/api/data/LoanScheduleData.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/data/LoanScheduleData.java similarity index 99% rename from mifosng-provider/src/main/java/org/mifosng/platform/api/data/LoanScheduleData.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/data/LoanScheduleData.java index 05945774e..323dfda22 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/api/data/LoanScheduleData.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/data/LoanScheduleData.java @@ -1,4 +1,4 @@ -package org.mifosng.platform.api.data; +package org.mifosplatform.portfolio.loanaccount.data; import java.math.BigDecimal; import java.util.Collection; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/api/data/LoanSchedulePeriodData.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/data/LoanSchedulePeriodData.java similarity index 99% rename from mifosng-provider/src/main/java/org/mifosng/platform/api/data/LoanSchedulePeriodData.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/data/LoanSchedulePeriodData.java index 86421077c..e70313429 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/api/data/LoanSchedulePeriodData.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/data/LoanSchedulePeriodData.java @@ -1,4 +1,4 @@ -package org.mifosng.platform.api.data; +package org.mifosplatform.portfolio.loanaccount.data; import java.math.BigDecimal; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/api/data/LoanTransactionData.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/data/LoanTransactionData.java similarity index 96% rename from mifosng-provider/src/main/java/org/mifosng/platform/api/data/LoanTransactionData.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/data/LoanTransactionData.java index 3182cc841..1ac5a71b1 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/api/data/LoanTransactionData.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/data/LoanTransactionData.java @@ -1,4 +1,4 @@ -package org.mifosng.platform.api.data; +package org.mifosplatform.portfolio.loanaccount.data; import java.math.BigDecimal; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/AbstractLoanRepaymentScheduleTransactionProcessor.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/AbstractLoanRepaymentScheduleTransactionProcessor.java similarity index 99% rename from mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/AbstractLoanRepaymentScheduleTransactionProcessor.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/AbstractLoanRepaymentScheduleTransactionProcessor.java index e31b5f3c1..9c3b3f73d 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/AbstractLoanRepaymentScheduleTransactionProcessor.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/AbstractLoanRepaymentScheduleTransactionProcessor.java @@ -1,4 +1,4 @@ -package org.mifosng.platform.loan.domain; +package org.mifosplatform.portfolio.loanaccount.domain; import java.util.List; import java.util.Set; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/CreocoreLoanRepaymentScheduleTransactionProcessor.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/CreocoreLoanRepaymentScheduleTransactionProcessor.java similarity index 98% rename from mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/CreocoreLoanRepaymentScheduleTransactionProcessor.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/CreocoreLoanRepaymentScheduleTransactionProcessor.java index cdbb41bfb..5cd464d53 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/CreocoreLoanRepaymentScheduleTransactionProcessor.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/CreocoreLoanRepaymentScheduleTransactionProcessor.java @@ -1,4 +1,4 @@ -package org.mifosng.platform.loan.domain; +package org.mifosplatform.portfolio.loanaccount.domain; import java.util.List; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/DefaultLoanLifecycleStateMachine.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/DefaultLoanLifecycleStateMachine.java similarity index 98% rename from mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/DefaultLoanLifecycleStateMachine.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/DefaultLoanLifecycleStateMachine.java index bb3535e5c..fc8ed0706 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/DefaultLoanLifecycleStateMachine.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/DefaultLoanLifecycleStateMachine.java @@ -1,4 +1,4 @@ -package org.mifosng.platform.loan.domain; +package org.mifosplatform.portfolio.loanaccount.domain; import java.util.List; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/HeavensFamilyLoanRepaymentScheduleTransactionProcessor.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/HeavensFamilyLoanRepaymentScheduleTransactionProcessor.java similarity index 99% rename from mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/HeavensFamilyLoanRepaymentScheduleTransactionProcessor.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/HeavensFamilyLoanRepaymentScheduleTransactionProcessor.java index b10d53cab..61a6008fb 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/HeavensFamilyLoanRepaymentScheduleTransactionProcessor.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/HeavensFamilyLoanRepaymentScheduleTransactionProcessor.java @@ -1,4 +1,4 @@ -package org.mifosng.platform.loan.domain; +package org.mifosplatform.portfolio.loanaccount.domain; import java.util.List; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/Loan.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/Loan.java similarity index 99% rename from mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/Loan.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/Loan.java index 0c0ba043b..5804644b7 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/Loan.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/Loan.java @@ -1,4 +1,4 @@ -package org.mifosng.platform.loan.domain; +package org.mifosplatform.portfolio.loanaccount.domain; import java.math.BigDecimal; import java.util.ArrayList; @@ -26,13 +26,6 @@ import org.apache.commons.lang.StringUtils; import org.hibernate.annotations.LazyCollection; import org.hibernate.annotations.LazyCollectionOption; 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.mifosplatform.infrastructure.configuration.domain.MonetaryCurrency; 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.client.domain.Client; 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.LoanProductRelatedDetail; import org.mifosplatform.portfolio.loanproduct.domain.LoanTransactionProcessingStrategy; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanCharge.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/LoanCharge.java similarity index 99% rename from mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanCharge.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/LoanCharge.java index 562ab1e77..02784d896 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanCharge.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/LoanCharge.java @@ -1,4 +1,4 @@ -package org.mifosng.platform.loan.domain; +package org.mifosplatform.portfolio.loanaccount.domain; import java.math.BigDecimal; import java.math.MathContext; @@ -16,13 +16,13 @@ import javax.persistence.Temporal; import javax.persistence.TemporalType; 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.Money; import org.mifosplatform.portfolio.charge.domain.Charge; import org.mifosplatform.portfolio.charge.domain.ChargeCalculationType; import org.mifosplatform.portfolio.charge.domain.ChargeTimeType; import org.mifosplatform.portfolio.charge.exception.LoanChargeWithoutMandatoryFieldException; +import org.mifosplatform.portfolio.loanaccount.command.LoanChargeCommand; import org.springframework.data.jpa.domain.AbstractPersistable; @Entity diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanChargeRepository.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/LoanChargeRepository.java similarity index 83% rename from mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanChargeRepository.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/LoanChargeRepository.java index 593356fc0..798b2233a 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanChargeRepository.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/LoanChargeRepository.java @@ -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.JpaSpecificationExecutor; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanEvent.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/LoanEvent.java similarity index 85% rename from mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanEvent.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/LoanEvent.java index 588e4c7cb..12a855e63 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanEvent.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/LoanEvent.java @@ -1,4 +1,4 @@ -package org.mifosng.platform.loan.domain; +package org.mifosplatform.portfolio.loanaccount.domain; /** * diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanLifecycleStateMachine.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/LoanLifecycleStateMachine.java similarity index 66% rename from mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanLifecycleStateMachine.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/LoanLifecycleStateMachine.java index c56097b40..f9a62c660 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanLifecycleStateMachine.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/LoanLifecycleStateMachine.java @@ -1,4 +1,4 @@ -package org.mifosng.platform.loan.domain; +package org.mifosplatform.portfolio.loanaccount.domain; public interface LoanLifecycleStateMachine { diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanOfficerAssignmentHistory.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/LoanOfficerAssignmentHistory.java similarity index 97% rename from mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanOfficerAssignmentHistory.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/LoanOfficerAssignmentHistory.java index 58e27f183..a4020b734 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanOfficerAssignmentHistory.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/LoanOfficerAssignmentHistory.java @@ -1,4 +1,4 @@ -package org.mifosng.platform.loan.domain; +package org.mifosplatform.portfolio.loanaccount.domain; import org.joda.time.LocalDate; import org.mifosplatform.infrastructure.core.domain.AbstractAuditableCustom; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanRepaymentDataComparator.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/LoanRepaymentDataComparator.java similarity index 67% rename from mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanRepaymentDataComparator.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/LoanRepaymentDataComparator.java index d3536f316..fd839d3e1 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanRepaymentDataComparator.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/LoanRepaymentDataComparator.java @@ -1,8 +1,8 @@ -package org.mifosng.platform.loan.domain; +package org.mifosplatform.portfolio.loanaccount.domain; import java.util.Comparator; -import org.mifosng.platform.api.data.LoanTransactionData; +import org.mifosplatform.portfolio.loanaccount.data.LoanTransactionData; public class LoanRepaymentDataComparator implements Comparator { diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanRepaymentScheduleInstallment.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/LoanRepaymentScheduleInstallment.java similarity index 99% rename from mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanRepaymentScheduleInstallment.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/LoanRepaymentScheduleInstallment.java index 876e4f250..b728c62ae 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanRepaymentScheduleInstallment.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/LoanRepaymentScheduleInstallment.java @@ -1,4 +1,4 @@ -package org.mifosng.platform.loan.domain; +package org.mifosplatform.portfolio.loanaccount.domain; import java.math.BigDecimal; import java.util.Date; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanRepaymentScheduleTransactionProcessor.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/LoanRepaymentScheduleTransactionProcessor.java similarity index 93% rename from mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanRepaymentScheduleTransactionProcessor.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/LoanRepaymentScheduleTransactionProcessor.java index 7e85bd87f..61edde43f 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanRepaymentScheduleTransactionProcessor.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/LoanRepaymentScheduleTransactionProcessor.java @@ -1,4 +1,4 @@ -package org.mifosng.platform.loan.domain; +package org.mifosplatform.portfolio.loanaccount.domain; import java.util.List; import java.util.Set; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanRepaymentScheduleTransactionProcessorFactory.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/LoanRepaymentScheduleTransactionProcessorFactory.java similarity index 95% rename from mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanRepaymentScheduleTransactionProcessorFactory.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/LoanRepaymentScheduleTransactionProcessorFactory.java index 3c29132ce..ea6d861fd 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanRepaymentScheduleTransactionProcessorFactory.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/LoanRepaymentScheduleTransactionProcessorFactory.java @@ -1,4 +1,4 @@ -package org.mifosng.platform.loan.domain; +package org.mifosplatform.portfolio.loanaccount.domain; import org.mifosplatform.portfolio.loanproduct.domain.LoanTransactionProcessingStrategy; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanRepository.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/LoanRepository.java similarity index 82% rename from mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanRepository.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/LoanRepository.java index 2b773e68c..f7d380069 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanRepository.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/LoanRepository.java @@ -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.JpaSpecificationExecutor; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanScheduleWrapper.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/LoanScheduleWrapper.java similarity index 98% rename from mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanScheduleWrapper.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/LoanScheduleWrapper.java index 7f1a992fd..7dad8b6ae 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanScheduleWrapper.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/LoanScheduleWrapper.java @@ -1,4 +1,4 @@ -package org.mifosng.platform.loan.domain; +package org.mifosplatform.portfolio.loanaccount.domain; import java.util.List; import java.util.Set; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanStatus.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/LoanStatus.java similarity index 98% rename from mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanStatus.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/LoanStatus.java index 7540d526e..ba677de53 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanStatus.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/LoanStatus.java @@ -1,4 +1,4 @@ -package org.mifosng.platform.loan.domain; +package org.mifosplatform.portfolio.loanaccount.domain; /** * Enum representation of loan status states. diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanTransaction.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/LoanTransaction.java similarity index 98% rename from mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanTransaction.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/LoanTransaction.java index 0cc7f26a5..1d096df02 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanTransaction.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/LoanTransaction.java @@ -1,4 +1,4 @@ -package org.mifosng.platform.loan.domain; +package org.mifosplatform.portfolio.loanaccount.domain; import java.math.BigDecimal; import java.util.Date; @@ -16,13 +16,13 @@ import javax.persistence.Temporal; import javax.persistence.TemporalType; import org.joda.time.LocalDate; -import org.mifosng.platform.api.data.LoanTransactionData; import org.mifosplatform.infrastructure.configuration.data.CurrencyData; import org.mifosplatform.infrastructure.configuration.domain.MonetaryCurrency; import org.mifosplatform.infrastructure.configuration.domain.Money; import org.mifosplatform.infrastructure.core.data.EnumOptionData; import org.mifosplatform.infrastructure.core.domain.AbstractAuditableCustom; import org.mifosplatform.infrastructure.user.domain.AppUser; +import org.mifosplatform.portfolio.loanaccount.data.LoanTransactionData; import org.mifosplatform.portfolio.loanproduct.service.LoanEnumerations; import org.springframework.format.annotation.DateTimeFormat; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanTransactionComparator.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/LoanTransactionComparator.java similarity index 92% rename from mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanTransactionComparator.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/LoanTransactionComparator.java index c90e157d2..960d771ac 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanTransactionComparator.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/LoanTransactionComparator.java @@ -1,4 +1,4 @@ -package org.mifosng.platform.loan.domain; +package org.mifosplatform.portfolio.loanaccount.domain; import java.util.Comparator; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanTransactionProcessingStrategyRepository.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/LoanTransactionProcessingStrategyRepository.java similarity index 88% rename from mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanTransactionProcessingStrategyRepository.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/LoanTransactionProcessingStrategyRepository.java index ebdffe7c4..32098bbf8 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanTransactionProcessingStrategyRepository.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/LoanTransactionProcessingStrategyRepository.java @@ -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.springframework.data.jpa.repository.JpaRepository; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanTransactionRepository.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/LoanTransactionRepository.java similarity index 84% rename from mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanTransactionRepository.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/LoanTransactionRepository.java index cb4c1de13..6ac8a0a1b 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanTransactionRepository.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/LoanTransactionRepository.java @@ -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.JpaSpecificationExecutor; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanTransactionType.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/LoanTransactionType.java similarity index 97% rename from mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanTransactionType.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/LoanTransactionType.java index 7a1312ec8..fd8bfb8bb 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanTransactionType.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/LoanTransactionType.java @@ -1,4 +1,4 @@ -package org.mifosng.platform.loan.domain; +package org.mifosplatform.portfolio.loanaccount.domain; public enum LoanTransactionType { diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/MifosStyleLoanRepaymentScheduleTransactionProcessor.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/MifosStyleLoanRepaymentScheduleTransactionProcessor.java similarity index 98% rename from mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/MifosStyleLoanRepaymentScheduleTransactionProcessor.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/MifosStyleLoanRepaymentScheduleTransactionProcessor.java index b4e34c9e0..a2207eddd 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/MifosStyleLoanRepaymentScheduleTransactionProcessor.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/MifosStyleLoanRepaymentScheduleTransactionProcessor.java @@ -1,4 +1,4 @@ -package org.mifosng.platform.loan.domain; +package org.mifosplatform.portfolio.loanaccount.domain; import java.util.List; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/RBILoanRepaymentScheduleTransactionProcessor.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/RBILoanRepaymentScheduleTransactionProcessor.java similarity index 99% rename from mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/RBILoanRepaymentScheduleTransactionProcessor.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/RBILoanRepaymentScheduleTransactionProcessor.java index d52b1ab7d..280b30caf 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/RBILoanRepaymentScheduleTransactionProcessor.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/RBILoanRepaymentScheduleTransactionProcessor.java @@ -1,4 +1,4 @@ -package org.mifosng.platform.loan.domain; +package org.mifosplatform.portfolio.loanaccount.domain; import java.util.List; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/TransactionProccessingResult.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/TransactionProccessingResult.java similarity index 90% rename from mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/TransactionProccessingResult.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/TransactionProccessingResult.java index 2f93a11bc..3395663e3 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/TransactionProccessingResult.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/TransactionProccessingResult.java @@ -1,4 +1,4 @@ -package org.mifosng.platform.loan.domain; +package org.mifosplatform.portfolio.loanaccount.domain; import org.mifosplatform.infrastructure.configuration.domain.Money; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/exceptions/InvalidLoanStateTransitionException.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/exception/InvalidLoanStateTransitionException.java similarity index 90% rename from mifosng-provider/src/main/java/org/mifosng/platform/exceptions/InvalidLoanStateTransitionException.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/exception/InvalidLoanStateTransitionException.java index 541c75822..0586bea3f 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/exceptions/InvalidLoanStateTransitionException.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/exception/InvalidLoanStateTransitionException.java @@ -1,4 +1,4 @@ -package org.mifosng.platform.exceptions; +package org.mifosplatform.portfolio.loanaccount.exception; import org.mifosplatform.infrastructure.core.exception.AbstractPlatformDomainRuleException; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/exceptions/InvalidLoanTransactionTypeException.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/exception/InvalidLoanTransactionTypeException.java similarity index 90% rename from mifosng-provider/src/main/java/org/mifosng/platform/exceptions/InvalidLoanTransactionTypeException.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/exception/InvalidLoanTransactionTypeException.java index f7a81fb85..3f6749d9f 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/exceptions/InvalidLoanTransactionTypeException.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/exception/InvalidLoanTransactionTypeException.java @@ -1,4 +1,4 @@ -package org.mifosng.platform.exceptions; +package org.mifosplatform.portfolio.loanaccount.exception; import org.mifosplatform.infrastructure.core.exception.AbstractPlatformDomainRuleException; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/exceptions/LoanNotFoundException.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/exception/LoanNotFoundException.java similarity index 87% rename from mifosng-provider/src/main/java/org/mifosng/platform/exceptions/LoanNotFoundException.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/exception/LoanNotFoundException.java index 2058b8524..785460752 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/exceptions/LoanNotFoundException.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/exception/LoanNotFoundException.java @@ -1,4 +1,4 @@ -package org.mifosng.platform.exceptions; +package org.mifosplatform.portfolio.loanaccount.exception; import org.mifosplatform.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/exceptions/LoanNotInSubmittedAndPendingApprovalStateCannotBeDeleted.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/exception/LoanNotInSubmittedAndPendingApprovalStateCannotBeDeleted.java similarity index 90% rename from mifosng-provider/src/main/java/org/mifosng/platform/exceptions/LoanNotInSubmittedAndPendingApprovalStateCannotBeDeleted.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/exception/LoanNotInSubmittedAndPendingApprovalStateCannotBeDeleted.java index c65b15e42..e9398fb5d 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/exceptions/LoanNotInSubmittedAndPendingApprovalStateCannotBeDeleted.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/exception/LoanNotInSubmittedAndPendingApprovalStateCannotBeDeleted.java @@ -1,4 +1,4 @@ -package org.mifosng.platform.exceptions; +package org.mifosplatform.portfolio.loanaccount.exception; import org.mifosplatform.infrastructure.core.exception.AbstractPlatformDomainRuleException; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/exceptions/LoanOfficerAssignmentException.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/exception/LoanOfficerAssignmentException.java similarity index 93% rename from mifosng-provider/src/main/java/org/mifosng/platform/exceptions/LoanOfficerAssignmentException.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/exception/LoanOfficerAssignmentException.java index c9c225ca9..b8264eb70 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/exceptions/LoanOfficerAssignmentException.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/exception/LoanOfficerAssignmentException.java @@ -1,4 +1,4 @@ -package org.mifosng.platform.exceptions; +package org.mifosplatform.portfolio.loanaccount.exception; import org.joda.time.LocalDate; import org.mifosplatform.infrastructure.core.exception.AbstractPlatformDomainRuleException; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/exceptions/LoanTransactionNotFoundException.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/exception/LoanTransactionNotFoundException.java similarity index 91% rename from mifosng-provider/src/main/java/org/mifosng/platform/exceptions/LoanTransactionNotFoundException.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/exception/LoanTransactionNotFoundException.java index e6401a85c..8139b45f2 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/exceptions/LoanTransactionNotFoundException.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/exception/LoanTransactionNotFoundException.java @@ -1,4 +1,4 @@ -package org.mifosng.platform.exceptions; +package org.mifosplatform.portfolio.loanaccount.exception; import org.mifosplatform.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/exceptions/LoanTransactionProcessingStrategyNotFoundException.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/exception/LoanTransactionProcessingStrategyNotFoundException.java similarity index 90% rename from mifosng-provider/src/main/java/org/mifosng/platform/exceptions/LoanTransactionProcessingStrategyNotFoundException.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/exception/LoanTransactionProcessingStrategyNotFoundException.java index 2aba3bf5f..b0bd245a1 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/exceptions/LoanTransactionProcessingStrategyNotFoundException.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/exception/LoanTransactionProcessingStrategyNotFoundException.java @@ -1,4 +1,4 @@ -package org.mifosng.platform.exceptions; +package org.mifosplatform.portfolio.loanaccount.exception; import org.mifosplatform.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/api/commands/CalculateLoanScheduleCommand.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/command/CalculateLoanScheduleCommand.java similarity index 96% rename from mifosng-provider/src/main/java/org/mifosng/platform/api/commands/CalculateLoanScheduleCommand.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/command/CalculateLoanScheduleCommand.java index cd23944da..525258d1e 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/api/commands/CalculateLoanScheduleCommand.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/command/CalculateLoanScheduleCommand.java @@ -1,8 +1,9 @@ -package org.mifosng.platform.api.commands; +package org.mifosplatform.portfolio.loanaccount.loanschedule.command; import java.math.BigDecimal; import org.joda.time.LocalDate; +import org.mifosplatform.portfolio.loanaccount.command.LoanChargeCommand; /** * Immutable command used when auto-calculating loan schedules based on loan terms. diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loanschedule/domain/AmortizationLoanScheduleGenerator.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/domain/AmortizationLoanScheduleGenerator.java similarity index 77% rename from mifosng-provider/src/main/java/org/mifosng/platform/loanschedule/domain/AmortizationLoanScheduleGenerator.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/domain/AmortizationLoanScheduleGenerator.java index 67d14227e..80dac6c89 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loanschedule/domain/AmortizationLoanScheduleGenerator.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/domain/AmortizationLoanScheduleGenerator.java @@ -1,13 +1,13 @@ -package org.mifosng.platform.loanschedule.domain; +package org.mifosplatform.portfolio.loanaccount.loanschedule.domain; import java.math.BigDecimal; import java.util.List; import java.util.Set; 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.portfolio.loanaccount.data.LoanScheduleData; +import org.mifosplatform.portfolio.loanaccount.domain.LoanCharge; import org.mifosplatform.portfolio.loanproduct.domain.LoanProductRelatedDetail; public interface AmortizationLoanScheduleGenerator { diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loanschedule/domain/AmortizationLoanScheduleGeneratorFactory.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/domain/AmortizationLoanScheduleGeneratorFactory.java similarity index 91% rename from mifosng-provider/src/main/java/org/mifosng/platform/loanschedule/domain/AmortizationLoanScheduleGeneratorFactory.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/domain/AmortizationLoanScheduleGeneratorFactory.java index 6a676ecad..c26217731 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loanschedule/domain/AmortizationLoanScheduleGeneratorFactory.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/domain/AmortizationLoanScheduleGeneratorFactory.java @@ -1,4 +1,4 @@ -package org.mifosng.platform.loanschedule.domain; +package org.mifosplatform.portfolio.loanaccount.loanschedule.domain; import org.mifosplatform.portfolio.loanproduct.domain.AmortizationMethod; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loanschedule/domain/AprCalculator.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/domain/AprCalculator.java similarity index 92% rename from mifosng-provider/src/main/java/org/mifosng/platform/loanschedule/domain/AprCalculator.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/domain/AprCalculator.java index a85e5a6ab..cf28a36d9 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loanschedule/domain/AprCalculator.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/domain/AprCalculator.java @@ -1,4 +1,4 @@ -package org.mifosng.platform.loanschedule.domain; +package org.mifosplatform.portfolio.loanaccount.loanschedule.domain; import java.math.BigDecimal; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loanschedule/domain/DecliningBalanceMethodLoanScheduleGenerator.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/domain/DecliningBalanceMethodLoanScheduleGenerator.java similarity index 94% rename from mifosng-provider/src/main/java/org/mifosng/platform/loanschedule/domain/DecliningBalanceMethodLoanScheduleGenerator.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/domain/DecliningBalanceMethodLoanScheduleGenerator.java index ecb91876c..bcaea8900 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loanschedule/domain/DecliningBalanceMethodLoanScheduleGenerator.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/domain/DecliningBalanceMethodLoanScheduleGenerator.java @@ -1,13 +1,13 @@ -package org.mifosng.platform.loanschedule.domain; +package org.mifosplatform.portfolio.loanaccount.loanschedule.domain; import java.math.BigDecimal; import java.util.List; import java.util.Set; 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.portfolio.loanaccount.data.LoanScheduleData; +import org.mifosplatform.portfolio.loanaccount.domain.LoanCharge; import org.mifosplatform.portfolio.loanproduct.domain.AmortizationMethod; import org.mifosplatform.portfolio.loanproduct.domain.LoanProductRelatedDetail; import org.mifosplatform.portfolio.loanproduct.domain.PeriodFrequencyType; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loanschedule/domain/DefaultLoanScheduleGeneratorFactory.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/domain/DefaultLoanScheduleGeneratorFactory.java similarity index 89% rename from mifosng-provider/src/main/java/org/mifosng/platform/loanschedule/domain/DefaultLoanScheduleGeneratorFactory.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/domain/DefaultLoanScheduleGeneratorFactory.java index 12496a009..f0692608d 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loanschedule/domain/DefaultLoanScheduleGeneratorFactory.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/domain/DefaultLoanScheduleGeneratorFactory.java @@ -1,4 +1,4 @@ -package org.mifosng.platform.loanschedule.domain; +package org.mifosplatform.portfolio.loanaccount.loanschedule.domain; import org.mifosplatform.portfolio.loanproduct.domain.InterestMethod; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loanschedule/domain/DefaultPaymentPeriodsInOneYearCalculator.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/domain/DefaultPaymentPeriodsInOneYearCalculator.java similarity index 97% rename from mifosng-provider/src/main/java/org/mifosng/platform/loanschedule/domain/DefaultPaymentPeriodsInOneYearCalculator.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/domain/DefaultPaymentPeriodsInOneYearCalculator.java index 8c4c99b49..631052263 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loanschedule/domain/DefaultPaymentPeriodsInOneYearCalculator.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/domain/DefaultPaymentPeriodsInOneYearCalculator.java @@ -1,4 +1,4 @@ -package org.mifosng.platform.loanschedule.domain; +package org.mifosplatform.portfolio.loanaccount.loanschedule.domain; import java.util.List; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loanschedule/domain/DefaultScheduledDateGenerator.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/domain/DefaultScheduledDateGenerator.java similarity index 97% rename from mifosng-provider/src/main/java/org/mifosng/platform/loanschedule/domain/DefaultScheduledDateGenerator.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/domain/DefaultScheduledDateGenerator.java index e984c0e3d..eca9336a9 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loanschedule/domain/DefaultScheduledDateGenerator.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/domain/DefaultScheduledDateGenerator.java @@ -1,4 +1,4 @@ -package org.mifosng.platform.loanschedule.domain; +package org.mifosplatform.portfolio.loanaccount.loanschedule.domain; import java.util.ArrayList; import java.util.List; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loanschedule/domain/EqualInstallmentsAmortizationLoanScheduleGenerator.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/domain/EqualInstallmentsAmortizationLoanScheduleGenerator.java similarity index 97% rename from mifosng-provider/src/main/java/org/mifosng/platform/loanschedule/domain/EqualInstallmentsAmortizationLoanScheduleGenerator.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/domain/EqualInstallmentsAmortizationLoanScheduleGenerator.java index 8c3b5c008..4ecf18b4e 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loanschedule/domain/EqualInstallmentsAmortizationLoanScheduleGenerator.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/domain/EqualInstallmentsAmortizationLoanScheduleGenerator.java @@ -1,4 +1,4 @@ -package org.mifosng.platform.loanschedule.domain; +package org.mifosplatform.portfolio.loanaccount.loanschedule.domain; import java.math.BigDecimal; import java.util.ArrayList; @@ -8,13 +8,13 @@ import java.util.Set; import org.joda.time.Days; 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.domain.ApplicationCurrency; import org.mifosplatform.infrastructure.configuration.domain.MonetaryCurrency; 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; /** diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loanschedule/domain/EqualPrincipalAmortizationLoanScheduleGenerator.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/domain/EqualPrincipalAmortizationLoanScheduleGenerator.java similarity index 96% rename from mifosng-provider/src/main/java/org/mifosng/platform/loanschedule/domain/EqualPrincipalAmortizationLoanScheduleGenerator.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/domain/EqualPrincipalAmortizationLoanScheduleGenerator.java index b5688b2ea..c269a00dc 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loanschedule/domain/EqualPrincipalAmortizationLoanScheduleGenerator.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/domain/EqualPrincipalAmortizationLoanScheduleGenerator.java @@ -1,4 +1,4 @@ -package org.mifosng.platform.loanschedule.domain; +package org.mifosplatform.portfolio.loanaccount.loanschedule.domain; import java.math.BigDecimal; import java.util.ArrayList; @@ -8,13 +8,13 @@ import java.util.Set; import org.joda.time.Days; 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.domain.ApplicationCurrency; import org.mifosplatform.infrastructure.configuration.domain.MonetaryCurrency; 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; public class EqualPrincipalAmortizationLoanScheduleGenerator implements AmortizationLoanScheduleGenerator { diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loanschedule/domain/FlatMethodLoanScheduleGenerator.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/domain/FlatMethodLoanScheduleGenerator.java similarity index 96% rename from mifosng-provider/src/main/java/org/mifosng/platform/loanschedule/domain/FlatMethodLoanScheduleGenerator.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/domain/FlatMethodLoanScheduleGenerator.java index e394455b7..61af85000 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loanschedule/domain/FlatMethodLoanScheduleGenerator.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/domain/FlatMethodLoanScheduleGenerator.java @@ -1,4 +1,4 @@ -package org.mifosng.platform.loanschedule.domain; +package org.mifosplatform.portfolio.loanaccount.loanschedule.domain; import java.math.BigDecimal; import java.math.MathContext; @@ -10,13 +10,13 @@ import java.util.Set; import org.joda.time.Days; 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.domain.ApplicationCurrency; import org.mifosplatform.infrastructure.configuration.domain.MonetaryCurrency; 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.PeriodFrequencyType; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loanschedule/domain/LoanScheduleGenerator.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/domain/LoanScheduleGenerator.java similarity index 76% rename from mifosng-provider/src/main/java/org/mifosng/platform/loanschedule/domain/LoanScheduleGenerator.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/domain/LoanScheduleGenerator.java index 28f42bdd3..a7a48d259 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loanschedule/domain/LoanScheduleGenerator.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/domain/LoanScheduleGenerator.java @@ -1,11 +1,11 @@ -package org.mifosng.platform.loanschedule.domain; +package org.mifosplatform.portfolio.loanaccount.loanschedule.domain; import java.util.Set; 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.portfolio.loanaccount.data.LoanScheduleData; +import org.mifosplatform.portfolio.loanaccount.domain.LoanCharge; import org.mifosplatform.portfolio.loanproduct.domain.LoanProductRelatedDetail; import org.mifosplatform.portfolio.loanproduct.domain.PeriodFrequencyType; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loanschedule/domain/LoanScheduleGeneratorFactory.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/domain/LoanScheduleGeneratorFactory.java similarity index 73% rename from mifosng-provider/src/main/java/org/mifosng/platform/loanschedule/domain/LoanScheduleGeneratorFactory.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/domain/LoanScheduleGeneratorFactory.java index 87085b9e3..d1d9083a1 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loanschedule/domain/LoanScheduleGeneratorFactory.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/domain/LoanScheduleGeneratorFactory.java @@ -1,4 +1,4 @@ -package org.mifosng.platform.loanschedule.domain; +package org.mifosplatform.portfolio.loanaccount.loanschedule.domain; import org.mifosplatform.portfolio.loanproduct.domain.InterestMethod; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loanschedule/domain/PaymentPeriodsInOneYearCalculator.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/domain/PaymentPeriodsInOneYearCalculator.java similarity index 87% rename from mifosng-provider/src/main/java/org/mifosng/platform/loanschedule/domain/PaymentPeriodsInOneYearCalculator.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/domain/PaymentPeriodsInOneYearCalculator.java index 09b0d77c6..34b9a980a 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loanschedule/domain/PaymentPeriodsInOneYearCalculator.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/domain/PaymentPeriodsInOneYearCalculator.java @@ -1,4 +1,4 @@ -package org.mifosng.platform.loanschedule.domain; +package org.mifosplatform.portfolio.loanaccount.loanschedule.domain; import java.util.List; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loanschedule/domain/PeriodicInterestRateCalculator.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/domain/PeriodicInterestRateCalculator.java similarity index 97% rename from mifosng-provider/src/main/java/org/mifosng/platform/loanschedule/domain/PeriodicInterestRateCalculator.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/domain/PeriodicInterestRateCalculator.java index 5496dc4af..bdf0b06b5 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loanschedule/domain/PeriodicInterestRateCalculator.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/domain/PeriodicInterestRateCalculator.java @@ -1,4 +1,4 @@ -package org.mifosng.platform.loanschedule.domain; +package org.mifosplatform.portfolio.loanaccount.loanschedule.domain; import java.math.BigDecimal; import java.math.MathContext; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loanschedule/domain/PmtCalculator.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/domain/PmtCalculator.java similarity index 98% rename from mifosng-provider/src/main/java/org/mifosng/platform/loanschedule/domain/PmtCalculator.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/domain/PmtCalculator.java index 2165daac5..3845d138f 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loanschedule/domain/PmtCalculator.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/domain/PmtCalculator.java @@ -1,4 +1,4 @@ -package org.mifosng.platform.loanschedule.domain; +package org.mifosplatform.portfolio.loanaccount.loanschedule.domain; import java.math.BigDecimal; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loanschedule/domain/ScheduledDateGenerator.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/domain/ScheduledDateGenerator.java similarity index 89% rename from mifosng-provider/src/main/java/org/mifosng/platform/loanschedule/domain/ScheduledDateGenerator.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/domain/ScheduledDateGenerator.java index aa0979d47..612734c3f 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loanschedule/domain/ScheduledDateGenerator.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/domain/ScheduledDateGenerator.java @@ -1,4 +1,4 @@ -package org.mifosng.platform.loanschedule.domain; +package org.mifosplatform.portfolio.loanaccount.loanschedule.domain; import java.util.List; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loan/service/AdjustLoanTransactionCommandValidator.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/AdjustLoanTransactionCommandValidator.java similarity index 91% rename from mifosng-provider/src/main/java/org/mifosng/platform/loan/service/AdjustLoanTransactionCommandValidator.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/AdjustLoanTransactionCommandValidator.java index ca671af58..4300e666f 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loan/service/AdjustLoanTransactionCommandValidator.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/AdjustLoanTransactionCommandValidator.java @@ -1,12 +1,12 @@ -package org.mifosng.platform.loan.service; +package org.mifosplatform.portfolio.loanaccount.service; import java.util.ArrayList; import java.util.List; -import org.mifosng.platform.api.commands.AdjustLoanTransactionCommand; import org.mifosplatform.infrastructure.core.data.ApiParameterError; import org.mifosplatform.infrastructure.core.data.DataValidatorBuilder; import org.mifosplatform.infrastructure.core.exception.PlatformApiDataValidationException; +import org.mifosplatform.portfolio.loanaccount.command.AdjustLoanTransactionCommand; public class AdjustLoanTransactionCommandValidator { diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loan/service/CalculateLoanScheduleCommandValidator.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/CalculateLoanScheduleCommandValidator.java similarity index 97% rename from mifosng-provider/src/main/java/org/mifosng/platform/loan/service/CalculateLoanScheduleCommandValidator.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/CalculateLoanScheduleCommandValidator.java index 3a68f9bd4..4e5adeedf 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loan/service/CalculateLoanScheduleCommandValidator.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/CalculateLoanScheduleCommandValidator.java @@ -1,12 +1,12 @@ -package org.mifosng.platform.loan.service; +package org.mifosplatform.portfolio.loanaccount.service; import java.util.ArrayList; import java.util.List; -import org.mifosng.platform.api.commands.CalculateLoanScheduleCommand; import org.mifosplatform.infrastructure.core.data.ApiParameterError; import org.mifosplatform.infrastructure.core.data.DataValidatorBuilder; import org.mifosplatform.infrastructure.core.exception.PlatformApiDataValidationException; +import org.mifosplatform.portfolio.loanaccount.loanschedule.command.CalculateLoanScheduleCommand; public class CalculateLoanScheduleCommandValidator { diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/CalculationPlatformService.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/CalculationPlatformService.java new file mode 100644 index 000000000..09fb8da64 --- /dev/null +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/CalculationPlatformService.java @@ -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); +} diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loan/service/CalculationPlatformServiceImpl.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/CalculationPlatformServiceImpl.java similarity index 83% rename from mifosng-provider/src/main/java/org/mifosng/platform/loan/service/CalculationPlatformServiceImpl.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/CalculationPlatformServiceImpl.java index 3a6daa4dc..6432a3dc8 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loan/service/CalculationPlatformServiceImpl.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/CalculationPlatformServiceImpl.java @@ -1,16 +1,16 @@ -package org.mifosng.platform.loan.service; +package org.mifosplatform.portfolio.loanaccount.service; 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.ApplicationCurrencyRepository; 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.LoanProductRelatedDetail; import org.mifosplatform.portfolio.loanproduct.domain.PeriodFrequencyType; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loan/service/LoanApplicationCommandValidator.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/LoanApplicationCommandValidator.java similarity index 91% rename from mifosng-provider/src/main/java/org/mifosng/platform/loan/service/LoanApplicationCommandValidator.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/LoanApplicationCommandValidator.java index 6929e8309..aff2f3af8 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loan/service/LoanApplicationCommandValidator.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/LoanApplicationCommandValidator.java @@ -1,14 +1,14 @@ -package org.mifosng.platform.loan.service; +package org.mifosplatform.portfolio.loanaccount.service; import java.util.ArrayList; 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.DataValidatorBuilder; 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 { diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loan/service/LoanAssembler.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/LoanAssembler.java similarity index 90% rename from mifosng-provider/src/main/java/org/mifosng/platform/loan/service/LoanAssembler.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/LoanAssembler.java index adc0c9711..16ade5d7a 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loan/service/LoanAssembler.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/LoanAssembler.java @@ -1,25 +1,13 @@ -package org.mifosng.platform.loan.service; +package org.mifosplatform.portfolio.loanaccount.service; import java.math.BigDecimal; import java.util.Arrays; import java.util.List; 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.LoanTransactionProcessingStrategyNotFoundException; import org.mifosng.platform.group.domain.Group; 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.staff.domain.Staff; 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.FundRepository; 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.InterestCalculationPeriodMethod; import org.mifosplatform.portfolio.loanproduct.domain.InterestMethod; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loan/service/LoanChargeAssembler.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/LoanChargeAssembler.java similarity index 91% rename from mifosng-provider/src/main/java/org/mifosng/platform/loan/service/LoanChargeAssembler.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/LoanChargeAssembler.java index cd06b5b4e..8308c3730 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loan/service/LoanChargeAssembler.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/LoanChargeAssembler.java @@ -1,17 +1,17 @@ -package org.mifosng.platform.loan.service; +package org.mifosplatform.portfolio.loanaccount.service; import java.math.BigDecimal; import java.util.HashSet; 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.ChargeRepository; import org.mifosplatform.portfolio.charge.exception.ChargeIsNotActiveException; import org.mifosplatform.portfolio.charge.exception.ChargeNotFoundException; 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.stereotype.Service; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loan/service/LoanChargeCommandValidator.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/LoanChargeCommandValidator.java similarity index 95% rename from mifosng-provider/src/main/java/org/mifosng/platform/loan/service/LoanChargeCommandValidator.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/LoanChargeCommandValidator.java index d6bf6e71e..b61b83cb8 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loan/service/LoanChargeCommandValidator.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/LoanChargeCommandValidator.java @@ -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.DataValidatorBuilder; import org.mifosplatform.infrastructure.core.exception.PlatformApiDataValidationException; +import org.mifosplatform.portfolio.loanaccount.command.LoanChargeCommand; import java.util.ArrayList; import java.util.List; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loan/service/LoanProductRelatedDetailAssembler.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/LoanProductRelatedDetailAssembler.java similarity index 93% rename from mifosng-provider/src/main/java/org/mifosng/platform/loan/service/LoanProductRelatedDetailAssembler.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/LoanProductRelatedDetailAssembler.java index 81de116b2..3596c3bd3 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loan/service/LoanProductRelatedDetailAssembler.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/LoanProductRelatedDetailAssembler.java @@ -1,10 +1,10 @@ -package org.mifosng.platform.loan.service; +package org.mifosplatform.portfolio.loanaccount.service; 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.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.InterestCalculationPeriodMethod; import org.mifosplatform.portfolio.loanproduct.domain.InterestMethod; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loan/service/LoanReadPlatformService.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/LoanReadPlatformService.java similarity index 72% rename from mifosng-provider/src/main/java/org/mifosng/platform/loan/service/LoanReadPlatformService.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/LoanReadPlatformService.java index 9cb1de869..30b4902f3 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loan/service/LoanReadPlatformService.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/LoanReadPlatformService.java @@ -1,14 +1,14 @@ -package org.mifosng.platform.loan.service; +package org.mifosplatform.portfolio.loanaccount.service; import java.math.BigDecimal; 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.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 { diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loan/service/LoanReadPlatformServiceImpl.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/LoanReadPlatformServiceImpl.java similarity index 96% rename from mifosng-provider/src/main/java/org/mifosng/platform/loan/service/LoanReadPlatformServiceImpl.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/LoanReadPlatformServiceImpl.java index 1f46971f7..1f35d67d4 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loan/service/LoanReadPlatformServiceImpl.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/LoanReadPlatformServiceImpl.java @@ -1,4 +1,4 @@ -package org.mifosng.platform.loan.service; +package org.mifosplatform.portfolio.loanaccount.service; import java.math.BigDecimal; import java.sql.ResultSet; @@ -7,22 +7,8 @@ import java.util.ArrayList; import java.util.Collection; 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.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.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.domain.ApplicationCurrency; 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.portfolio.client.data.ClientData; 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.service.LoanEnumerations; import org.mifosplatform.portfolio.loanproduct.service.LoanProductReadPlatformService; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loan/service/LoanSchedulePeriodDataWrapper.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/LoanSchedulePeriodDataWrapper.java similarity index 97% rename from mifosng-provider/src/main/java/org/mifosng/platform/loan/service/LoanSchedulePeriodDataWrapper.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/LoanSchedulePeriodDataWrapper.java index b971e8e94..e09fa6d8c 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loan/service/LoanSchedulePeriodDataWrapper.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/LoanSchedulePeriodDataWrapper.java @@ -1,9 +1,9 @@ -package org.mifosng.platform.loan.service; +package org.mifosplatform.portfolio.loanaccount.service; import java.math.BigDecimal; import java.util.Collection; -import org.mifosng.platform.api.data.LoanSchedulePeriodData; +import org.mifosplatform.portfolio.loanaccount.data.LoanSchedulePeriodData; public class LoanSchedulePeriodDataWrapper { diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loan/service/LoanStateTransitionCommandValidator.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/LoanStateTransitionCommandValidator.java similarity index 89% rename from mifosng-provider/src/main/java/org/mifosng/platform/loan/service/LoanStateTransitionCommandValidator.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/LoanStateTransitionCommandValidator.java index 514f16408..6f05ce2a5 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loan/service/LoanStateTransitionCommandValidator.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/LoanStateTransitionCommandValidator.java @@ -1,12 +1,12 @@ -package org.mifosng.platform.loan.service; +package org.mifosplatform.portfolio.loanaccount.service; import java.util.ArrayList; import java.util.List; -import org.mifosng.platform.api.commands.LoanStateTransitionCommand; import org.mifosplatform.infrastructure.core.data.ApiParameterError; import org.mifosplatform.infrastructure.core.data.DataValidatorBuilder; import org.mifosplatform.infrastructure.core.exception.PlatformApiDataValidationException; +import org.mifosplatform.portfolio.loanaccount.command.LoanStateTransitionCommand; public class LoanStateTransitionCommandValidator { diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loan/service/LoanTransactionCommandValidator.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/LoanTransactionCommandValidator.java similarity index 93% rename from mifosng-provider/src/main/java/org/mifosng/platform/loan/service/LoanTransactionCommandValidator.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/LoanTransactionCommandValidator.java index 025958ed4..b2c4bffc7 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loan/service/LoanTransactionCommandValidator.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/LoanTransactionCommandValidator.java @@ -1,12 +1,12 @@ -package org.mifosng.platform.loan.service; +package org.mifosplatform.portfolio.loanaccount.service; import java.util.ArrayList; import java.util.List; -import org.mifosng.platform.api.commands.LoanTransactionCommand; import org.mifosplatform.infrastructure.core.data.ApiParameterError; import org.mifosplatform.infrastructure.core.data.DataValidatorBuilder; import org.mifosplatform.infrastructure.core.exception.PlatformApiDataValidationException; +import org.mifosplatform.portfolio.loanaccount.command.LoanTransactionCommand; public class LoanTransactionCommandValidator { diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loan/service/LoanWritePlatformService.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/LoanWritePlatformService.java similarity index 88% rename from mifosng-provider/src/main/java/org/mifosng/platform/loan/service/LoanWritePlatformService.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/LoanWritePlatformService.java index 750be4902..bfb2ac7ed 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loan/service/LoanWritePlatformService.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/LoanWritePlatformService.java @@ -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.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; public interface LoanWritePlatformService { diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loan/service/LoanWritePlatformServiceJpaRepositoryImpl.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java similarity index 93% rename from mifosng-provider/src/main/java/org/mifosng/platform/loan/service/LoanWritePlatformServiceJpaRepositoryImpl.java rename to mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java index 456ecbf7e..c19f9e100 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loan/service/LoanWritePlatformServiceJpaRepositoryImpl.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java @@ -1,4 +1,4 @@ -package org.mifosng.platform.loan.service; +package org.mifosplatform.portfolio.loanaccount.service; import java.math.BigDecimal; import java.util.ArrayList; @@ -8,29 +8,6 @@ import java.util.Set; import org.apache.commons.lang.StringUtils; 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.LoanScheduleData; -import org.mifosng.platform.api.data.LoanSchedulePeriodData; -import org.mifosng.platform.exceptions.LoanNotFoundException; -import org.mifosng.platform.exceptions.LoanNotInSubmittedAndPendingApprovalStateCannotBeDeleted; -import org.mifosng.platform.exceptions.LoanOfficerAssignmentException; -import org.mifosng.platform.exceptions.LoanTransactionNotFoundException; -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.LoanChargeRepository; -import org.mifosng.platform.loan.domain.LoanLifecycleStateMachine; -import org.mifosng.platform.loan.domain.LoanRepaymentScheduleInstallment; -import org.mifosng.platform.loan.domain.LoanRepository; -import org.mifosng.platform.loan.domain.LoanStatus; -import org.mifosng.platform.loan.domain.LoanTransaction; -import org.mifosng.platform.loan.domain.LoanTransactionRepository; import org.mifosplatform.infrastructure.configuration.domain.MonetaryCurrency; import org.mifosplatform.infrastructure.configuration.domain.Money; import org.mifosplatform.infrastructure.core.data.EntityIdentifier; @@ -51,6 +28,29 @@ import org.mifosplatform.portfolio.client.domain.Note; import org.mifosplatform.portfolio.client.domain.NoteRepository; import org.mifosplatform.portfolio.client.exception.ClientNotFoundException; import org.mifosplatform.portfolio.fund.domain.Fund; +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.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.LoanChargeRepository; +import org.mifosplatform.portfolio.loanaccount.domain.LoanLifecycleStateMachine; +import org.mifosplatform.portfolio.loanaccount.domain.LoanRepaymentScheduleInstallment; +import org.mifosplatform.portfolio.loanaccount.domain.LoanRepository; +import org.mifosplatform.portfolio.loanaccount.domain.LoanStatus; +import org.mifosplatform.portfolio.loanaccount.domain.LoanTransaction; +import org.mifosplatform.portfolio.loanaccount.domain.LoanTransactionRepository; +import org.mifosplatform.portfolio.loanaccount.exception.LoanNotFoundException; +import org.mifosplatform.portfolio.loanaccount.exception.LoanNotInSubmittedAndPendingApprovalStateCannotBeDeleted; +import org.mifosplatform.portfolio.loanaccount.exception.LoanOfficerAssignmentException; +import org.mifosplatform.portfolio.loanaccount.exception.LoanTransactionNotFoundException; +import org.mifosplatform.portfolio.loanaccount.loanschedule.command.CalculateLoanScheduleCommand; import org.mifosplatform.portfolio.loanproduct.domain.LoanProduct; import org.mifosplatform.portfolio.loanproduct.domain.LoanProductRepository; import org.mifosplatform.portfolio.loanproduct.domain.LoanTransactionProcessingStrategy; diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanproduct/domain/LoanProductRelatedDetail.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanproduct/domain/LoanProductRelatedDetail.java index ca135acf4..d96dfdaf5 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanproduct/domain/LoanProductRelatedDetail.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanproduct/domain/LoanProductRelatedDetail.java @@ -8,9 +8,9 @@ import javax.persistence.Embedded; import javax.persistence.EnumType; import javax.persistence.Enumerated; -import org.mifosng.platform.loan.domain.Loan; import org.mifosplatform.infrastructure.configuration.domain.MonetaryCurrency; import org.mifosplatform.infrastructure.configuration.domain.Money; +import org.mifosplatform.portfolio.loanaccount.domain.Loan; import org.mifosplatform.portfolio.loanproduct.command.LoanProductCommand; /** diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanproduct/service/LoanDropdownReadPlatformServiceImpl.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanproduct/service/LoanDropdownReadPlatformServiceImpl.java index f1b70f4b0..4e4483819 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanproduct/service/LoanDropdownReadPlatformServiceImpl.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanproduct/service/LoanDropdownReadPlatformServiceImpl.java @@ -12,8 +12,8 @@ import java.util.Arrays; import java.util.Collection; import java.util.List; -import org.mifosng.platform.loan.domain.LoanTransactionProcessingStrategyRepository; import org.mifosplatform.infrastructure.core.data.EnumOptionData; +import org.mifosplatform.portfolio.loanaccount.domain.LoanTransactionProcessingStrategyRepository; import org.mifosplatform.portfolio.loanproduct.data.TransactionProcessingStrategyData; import org.mifosplatform.portfolio.loanproduct.domain.AmortizationMethod; import org.mifosplatform.portfolio.loanproduct.domain.InterestCalculationPeriodMethod; diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanproduct/service/LoanEnumerations.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanproduct/service/LoanEnumerations.java index 2e9df2299..2e3818200 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanproduct/service/LoanEnumerations.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanproduct/service/LoanEnumerations.java @@ -1,8 +1,8 @@ package org.mifosplatform.portfolio.loanproduct.service; -import org.mifosng.platform.loan.domain.LoanStatus; -import org.mifosng.platform.loan.domain.LoanTransactionType; import org.mifosplatform.infrastructure.core.data.EnumOptionData; +import org.mifosplatform.portfolio.loanaccount.domain.LoanStatus; +import org.mifosplatform.portfolio.loanaccount.domain.LoanTransactionType; import org.mifosplatform.portfolio.loanproduct.domain.AmortizationMethod; import org.mifosplatform.portfolio.loanproduct.domain.InterestCalculationPeriodMethod; import org.mifosplatform.portfolio.loanproduct.domain.InterestMethod; diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanproduct/service/LoanProductWritePlatformServiceJpaRepositoryImpl.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanproduct/service/LoanProductWritePlatformServiceJpaRepositoryImpl.java index 91f77d69c..b336e384d 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanproduct/service/LoanProductWritePlatformServiceJpaRepositoryImpl.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanproduct/service/LoanProductWritePlatformServiceJpaRepositoryImpl.java @@ -4,9 +4,6 @@ import java.math.BigDecimal; import java.util.HashSet; import java.util.Set; -import org.mifosng.platform.exceptions.LoanTransactionProcessingStrategyNotFoundException; -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.service.ConfigurationDomainService; import org.mifosplatform.infrastructure.core.data.EntityIdentifier; @@ -19,6 +16,9 @@ import org.mifosplatform.portfolio.client.service.RollbackTransactionAsCommandIs import org.mifosplatform.portfolio.fund.domain.Fund; import org.mifosplatform.portfolio.fund.domain.FundRepository; import org.mifosplatform.portfolio.fund.exception.FundNotFoundException; +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.command.LoanProductCommand; import org.mifosplatform.portfolio.loanproduct.domain.AmortizationMethod; import org.mifosplatform.portfolio.loanproduct.domain.InterestCalculationPeriodMethod; diff --git a/mifosng-provider/src/test/java/org/mifosng/platform/loan/domain/AdhikarLoanRepaymentScheduleTransactionProcessorTest.java b/mifosng-provider/src/test/java/org/mifosng/platform/loan/domain/AdhikarLoanRepaymentScheduleTransactionProcessorTest.java index 11cacfcb0..99c5adb58 100644 --- a/mifosng-provider/src/test/java/org/mifosng/platform/loan/domain/AdhikarLoanRepaymentScheduleTransactionProcessorTest.java +++ b/mifosng-provider/src/test/java/org/mifosng/platform/loan/domain/AdhikarLoanRepaymentScheduleTransactionProcessorTest.java @@ -11,6 +11,8 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.mifosplatform.infrastructure.configuration.domain.MonetaryCurrency; import org.mifosplatform.infrastructure.configuration.domain.Money; +import org.mifosplatform.portfolio.loanaccount.domain.LoanRepaymentScheduleInstallment; +import org.mifosplatform.portfolio.loanaccount.domain.RBILoanRepaymentScheduleTransactionProcessor; import org.mockito.runners.MockitoJUnitRunner; @SuppressWarnings("unused") diff --git a/mifosng-provider/src/test/java/org/mifosng/platform/loan/domain/HeavensFamilyLoanRepaymentScheduleTransactionProcessorTest.java b/mifosng-provider/src/test/java/org/mifosng/platform/loan/domain/HeavensFamilyLoanRepaymentScheduleTransactionProcessorTest.java index 057851532..c598194d5 100644 --- a/mifosng-provider/src/test/java/org/mifosng/platform/loan/domain/HeavensFamilyLoanRepaymentScheduleTransactionProcessorTest.java +++ b/mifosng-provider/src/test/java/org/mifosng/platform/loan/domain/HeavensFamilyLoanRepaymentScheduleTransactionProcessorTest.java @@ -11,6 +11,8 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.mifosplatform.infrastructure.configuration.domain.MonetaryCurrency; import org.mifosplatform.infrastructure.configuration.domain.Money; +import org.mifosplatform.portfolio.loanaccount.domain.HeavensFamilyLoanRepaymentScheduleTransactionProcessor; +import org.mifosplatform.portfolio.loanaccount.domain.LoanRepaymentScheduleInstallment; import org.mockito.runners.MockitoJUnitRunner; @SuppressWarnings("unused") diff --git a/mifosng-provider/src/test/java/org/mifosng/platform/loan/domain/LoanRepaymentScheduleInstallmentBuilder.java b/mifosng-provider/src/test/java/org/mifosng/platform/loan/domain/LoanRepaymentScheduleInstallmentBuilder.java index 3938cf456..bacc77155 100644 --- a/mifosng-provider/src/test/java/org/mifosng/platform/loan/domain/LoanRepaymentScheduleInstallmentBuilder.java +++ b/mifosng-provider/src/test/java/org/mifosng/platform/loan/domain/LoanRepaymentScheduleInstallmentBuilder.java @@ -3,6 +3,8 @@ package org.mifosng.platform.loan.domain; import org.joda.time.LocalDate; import org.mifosplatform.infrastructure.configuration.domain.MonetaryCurrency; import org.mifosplatform.infrastructure.configuration.domain.Money; +import org.mifosplatform.portfolio.loanaccount.domain.Loan; +import org.mifosplatform.portfolio.loanaccount.domain.LoanRepaymentScheduleInstallment; public class LoanRepaymentScheduleInstallmentBuilder { diff --git a/mifosng-provider/src/test/java/org/mifosng/platform/loan/domain/LoanScheduleTestDataHelper.java b/mifosng-provider/src/test/java/org/mifosng/platform/loan/domain/LoanScheduleTestDataHelper.java index f9599f9e1..60b29c654 100644 --- a/mifosng-provider/src/test/java/org/mifosng/platform/loan/domain/LoanScheduleTestDataHelper.java +++ b/mifosng-provider/src/test/java/org/mifosng/platform/loan/domain/LoanScheduleTestDataHelper.java @@ -5,6 +5,7 @@ import java.util.List; import org.joda.time.LocalDate; import org.mifosplatform.infrastructure.configuration.domain.MonetaryCurrency; +import org.mifosplatform.portfolio.loanaccount.domain.LoanRepaymentScheduleInstallment; /** * Helper class for creating loan schedule data suitable for testing. diff --git a/mifosng-provider/src/test/java/org/mifosng/platform/loan/domain/LoanTransactionBuilder.java b/mifosng-provider/src/test/java/org/mifosng/platform/loan/domain/LoanTransactionBuilder.java index b0ca11fcf..ce771b701 100644 --- a/mifosng-provider/src/test/java/org/mifosng/platform/loan/domain/LoanTransactionBuilder.java +++ b/mifosng-provider/src/test/java/org/mifosng/platform/loan/domain/LoanTransactionBuilder.java @@ -2,6 +2,7 @@ package org.mifosng.platform.loan.domain; import org.joda.time.LocalDate; import org.mifosplatform.infrastructure.configuration.domain.Money; +import org.mifosplatform.portfolio.loanaccount.domain.LoanTransaction; public class LoanTransactionBuilder { diff --git a/mifosng-provider/src/test/java/org/mifosng/platform/loanschedule/domain/DecliningBalanceMethodLoanScheduleGeneratorTest.java b/mifosng-provider/src/test/java/org/mifosng/platform/loanschedule/domain/DecliningBalanceMethodLoanScheduleGeneratorTest.java index 9ae940bd6..8caa72594 100644 --- a/mifosng-provider/src/test/java/org/mifosng/platform/loanschedule/domain/DecliningBalanceMethodLoanScheduleGeneratorTest.java +++ b/mifosng-provider/src/test/java/org/mifosng/platform/loanschedule/domain/DecliningBalanceMethodLoanScheduleGeneratorTest.java @@ -7,6 +7,7 @@ import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mifosplatform.infrastructure.configuration.data.CurrencyData; +import org.mifosplatform.portfolio.loanaccount.loanschedule.domain.DecliningBalanceMethodLoanScheduleGenerator; import org.mifosplatform.portfolio.loanproduct.domain.LoanProductRelatedDetail; import org.mockito.runners.MockitoJUnitRunner; diff --git a/mifosng-provider/src/test/java/org/mifosng/platform/loanschedule/domain/FlatMethodLoanScheduleGeneratorTest.java b/mifosng-provider/src/test/java/org/mifosng/platform/loanschedule/domain/FlatMethodLoanScheduleGeneratorTest.java index dcc32a0a1..045803577 100644 --- a/mifosng-provider/src/test/java/org/mifosng/platform/loanschedule/domain/FlatMethodLoanScheduleGeneratorTest.java +++ b/mifosng-provider/src/test/java/org/mifosng/platform/loanschedule/domain/FlatMethodLoanScheduleGeneratorTest.java @@ -7,6 +7,7 @@ import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mifosplatform.infrastructure.configuration.data.CurrencyData; +import org.mifosplatform.portfolio.loanaccount.loanschedule.domain.FlatMethodLoanScheduleGenerator; import org.mifosplatform.portfolio.loanproduct.domain.LoanProductRelatedDetail; import org.mockito.runners.MockitoJUnitRunner; diff --git a/mifosng-provider/src/test/java/org/mifosng/platform/loanschedule/domain/LoanProductRelatedDetailTestHelper.java b/mifosng-provider/src/test/java/org/mifosng/platform/loanschedule/domain/LoanProductRelatedDetailTestHelper.java index a5835a87b..e3e25fc32 100644 --- a/mifosng-provider/src/test/java/org/mifosng/platform/loanschedule/domain/LoanProductRelatedDetailTestHelper.java +++ b/mifosng-provider/src/test/java/org/mifosng/platform/loanschedule/domain/LoanProductRelatedDetailTestHelper.java @@ -4,6 +4,7 @@ import java.math.BigDecimal; import org.mifosng.platform.loan.domain.MonetaryCurrencyBuilder; import org.mifosplatform.infrastructure.configuration.domain.MonetaryCurrency; +import org.mifosplatform.portfolio.loanaccount.loanschedule.domain.LoanScheduleGenerator; import org.mifosplatform.portfolio.loanproduct.domain.AmortizationMethod; import org.mifosplatform.portfolio.loanproduct.domain.InterestCalculationPeriodMethod; import org.mifosplatform.portfolio.loanproduct.domain.InterestMethod;