diff --git a/mifosng-data/src/main/java/org/mifosng/data/command/CommonLoanProperties.java b/mifosng-data/src/main/java/org/mifosng/data/command/CommonLoanProperties.java deleted file mode 100644 index 038e2275a..000000000 --- a/mifosng-data/src/main/java/org/mifosng/data/command/CommonLoanProperties.java +++ /dev/null @@ -1,184 +0,0 @@ -package org.mifosng.data.command; - -import java.math.BigDecimal; - -import javax.xml.bind.annotation.XmlRootElement; - -@XmlRootElement -public class CommonLoanProperties { - - private String currencyCode; - private Integer digitsAfterDecimal; - - private BigDecimal principal; - - private Integer repaymentEvery; - private Integer repaymentFrequency; - private Integer numberOfRepayments; - private Integer amortizationMethod; - private BigDecimal inArrearsToleranceAmount; - - private BigDecimal interestRatePerPeriod; - private Integer interestRateFrequencyMethod; - private Integer interestMethod; - private Integer interestCalculationPeriodMethod; - - private boolean flexibleRepaymentSchedule = false; - private boolean interestRebateAllowed = false; - - public CommonLoanProperties() { - // - } - - public CommonLoanProperties(final String currencyCode, - final Integer digitsAfterDecimal, final Number principal, - final Number interestRatePerPeriod, Integer interestRateFrequencyMethod, - final Integer interestMethod, final Integer interestCalculationPeriodMethod, - final Integer repaymentEvery, final Integer repaymentFrequency, final Integer numberOfRepayments, Integer amortizationMethod, final Number toleranceAmount, - final boolean flexibleRepaymentSchedule, - final boolean interestRebateAllowed) { - this.currencyCode = currencyCode; - this.digitsAfterDecimal = digitsAfterDecimal; - if (principal != null) { - this.principal = BigDecimal.valueOf(Double.valueOf(principal.doubleValue())); - } - - if (interestRatePerPeriod != null) { - this.interestRatePerPeriod = BigDecimal.valueOf(Double.valueOf(interestRatePerPeriod.doubleValue())); - } - this.interestRateFrequencyMethod = interestRateFrequencyMethod; - this.interestMethod = interestMethod; - this.interestCalculationPeriodMethod = interestCalculationPeriodMethod; - - this.repaymentEvery = repaymentEvery; - this.repaymentFrequency = repaymentFrequency; - this.numberOfRepayments = numberOfRepayments; - this.amortizationMethod = amortizationMethod; - this.inArrearsToleranceAmount = BigDecimal.valueOf(Double.valueOf(toleranceAmount.toString())); - - this.flexibleRepaymentSchedule = flexibleRepaymentSchedule; - this.interestRebateAllowed = interestRebateAllowed; - } - - public String getCurrencyCode() { - return this.currencyCode; - } - - public void setCurrencyCode(final String currencyCode) { - this.currencyCode = currencyCode; - } - - public Integer getDigitsAfterDecimal() { - return this.digitsAfterDecimal; - } - - public void setDigitsAfterDecimal(final Integer digitsAfterDecimal) { - this.digitsAfterDecimal = digitsAfterDecimal; - } - - public Integer getRepaymentEvery() { - return this.repaymentEvery; - } - - public void setRepaymentEvery(final Integer repaymentEvery) { - this.repaymentEvery = repaymentEvery; - } - - public Integer getRepaymentFrequency() { - return this.repaymentFrequency; - } - - public void setRepaymentFrequency(final Integer repaymentFrequency) { - this.repaymentFrequency = repaymentFrequency; - } - - public boolean isFlexibleRepaymentSchedule() { - return this.flexibleRepaymentSchedule; - } - - public void setFlexibleRepaymentSchedule( - final boolean flexibleRepaymentSchedule) { - this.flexibleRepaymentSchedule = flexibleRepaymentSchedule; - } - - public boolean isInterestRebateAllowed() { - return this.interestRebateAllowed; - } - - public void setInterestRebateAllowed(final boolean interestRebateAllowed) { - this.interestRebateAllowed = interestRebateAllowed; - } - - public BigDecimal getPrincipal() { - return this.principal; - } - - public void setPrincipal(final BigDecimal principal) { - this.principal = principal; - } - -// public Boolean getFlexibleRepaymentSchedule() { -// return this.flexibleRepaymentSchedule; -// } - -// public Boolean getInterestRebateAllowed() { -// return this.interestRebateAllowed; -// } - - public Integer getInterestRateFrequencyMethod() { - return interestRateFrequencyMethod; - } - - public void setInterestRateFrequencyMethod(Integer interestRateFrequencyMethod) { - this.interestRateFrequencyMethod = interestRateFrequencyMethod; - } - - public Integer getInterestMethod() { - return interestMethod; - } - - public void setInterestMethod(Integer interestMethod) { - this.interestMethod = interestMethod; - } - - public Integer getAmortizationMethod() { - return amortizationMethod; - } - - public void setAmortizationMethod(Integer amortizationMethod) { - this.amortizationMethod = amortizationMethod; - } - - public Integer getNumberOfRepayments() { - return numberOfRepayments; - } - - public void setNumberOfRepayments(Integer numberOfRepayments) { - this.numberOfRepayments = numberOfRepayments; - } - - public BigDecimal getInterestRatePerPeriod() { - return interestRatePerPeriod; - } - - public void setInterestRatePerPeriod(BigDecimal interestRatePerPeriod) { - this.interestRatePerPeriod = interestRatePerPeriod; - } - - public BigDecimal getInArrearsToleranceAmount() { - return inArrearsToleranceAmount; - } - - public void setInArrearsToleranceAmount(BigDecimal inArrearsToleranceAmount) { - this.inArrearsToleranceAmount = inArrearsToleranceAmount; - } - - public Integer getInterestCalculationPeriodMethod() { - return interestCalculationPeriodMethod; - } - - public void setInterestCalculationPeriodMethod( - Integer interestCalculationPeriodMethod) { - this.interestCalculationPeriodMethod = interestCalculationPeriodMethod; - } -} \ No newline at end of file diff --git a/mifosng-data/src/main/java/org/mifosng/data/command/LoanProductCommand.java b/mifosng-data/src/main/java/org/mifosng/data/command/LoanProductCommand.java deleted file mode 100644 index 5a18f4e78..000000000 --- a/mifosng-data/src/main/java/org/mifosng/data/command/LoanProductCommand.java +++ /dev/null @@ -1,200 +0,0 @@ -package org.mifosng.data.command; - -import java.math.BigDecimal; - -import javax.xml.bind.annotation.XmlRootElement; - -@XmlRootElement -public class LoanProductCommand { - - private Long id; - private String name; - private String description; - private String externalId; - - private String locale; - private String currencyCode; - private Integer digitsAfterDecimal; - private BigDecimal principal; - private String principalFormatted; - private BigDecimal inArrearsToleranceAmount; - private String inArrearsToleranceAmountFormatted; - - private Integer repaymentEvery; - private Integer repaymentFrequency; - private Integer numberOfRepayments; - - private BigDecimal interestRatePerPeriod; - private String interestRatePerPeriodFormatted; - private Integer interestRateFrequencyMethod; - private Integer amortizationMethod; - private Integer interestMethod; - private Integer interestCalculationPeriodMethod; - - protected LoanProductCommand() { - // - } - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getExternalId() { - return externalId; - } - - public void setExternalId(String externalId) { - this.externalId = externalId; - } - - public String getCurrencyCode() { - return currencyCode; - } - - public void setCurrencyCode(String currencyCode) { - this.currencyCode = currencyCode; - } - - public Integer getDigitsAfterDecimal() { - return digitsAfterDecimal; - } - - public void setDigitsAfterDecimal(Integer digitsAfterDecimal) { - this.digitsAfterDecimal = digitsAfterDecimal; - } - - public BigDecimal getPrincipal() { - return principal; - } - - public void setPrincipal(BigDecimal principal) { - this.principal = principal; - } - - public BigDecimal getInArrearsToleranceAmount() { - return inArrearsToleranceAmount; - } - - public void setInArrearsToleranceAmount(BigDecimal inArrearsToleranceAmount) { - this.inArrearsToleranceAmount = inArrearsToleranceAmount; - } - - public Integer getRepaymentEvery() { - return repaymentEvery; - } - - public void setRepaymentEvery(Integer repaymentEvery) { - this.repaymentEvery = repaymentEvery; - } - - public Integer getRepaymentFrequency() { - return repaymentFrequency; - } - - public void setRepaymentFrequency(Integer repaymentFrequency) { - this.repaymentFrequency = repaymentFrequency; - } - - public Integer getNumberOfRepayments() { - return numberOfRepayments; - } - - public void setNumberOfRepayments(Integer numberOfRepayments) { - this.numberOfRepayments = numberOfRepayments; - } - - public BigDecimal getInterestRatePerPeriod() { - return interestRatePerPeriod; - } - - public void setInterestRatePerPeriod(BigDecimal interestRatePerPeriod) { - this.interestRatePerPeriod = interestRatePerPeriod; - } - - public Integer getInterestRateFrequencyMethod() { - return interestRateFrequencyMethod; - } - - public void setInterestRateFrequencyMethod(Integer interestRateFrequencyMethod) { - this.interestRateFrequencyMethod = interestRateFrequencyMethod; - } - - public Integer getAmortizationMethod() { - return amortizationMethod; - } - - public void setAmortizationMethod(Integer amortizationMethod) { - this.amortizationMethod = amortizationMethod; - } - - public Integer getInterestMethod() { - return interestMethod; - } - - public void setInterestMethod(Integer interestMethod) { - this.interestMethod = interestMethod; - } - - public Integer getInterestCalculationPeriodMethod() { - return interestCalculationPeriodMethod; - } - - public void setInterestCalculationPeriodMethod( - Integer interestCalculationPeriodMethod) { - this.interestCalculationPeriodMethod = interestCalculationPeriodMethod; - } - - public String getPrincipalFormatted() { - return principalFormatted; - } - - public void setPrincipalFormatted(String principalFormatted) { - this.principalFormatted = principalFormatted; - } - - public String getInterestRatePerPeriodFormatted() { - return interestRatePerPeriodFormatted; - } - - public void setInterestRatePerPeriodFormatted( - String interestRatePerPeriodFormatted) { - this.interestRatePerPeriodFormatted = interestRatePerPeriodFormatted; - } - - public String getInArrearsToleranceAmountFormatted() { - return inArrearsToleranceAmountFormatted; - } - - public void setInArrearsToleranceAmountFormatted( - String inArrearsToleranceAmountFormatted) { - this.inArrearsToleranceAmountFormatted = inArrearsToleranceAmountFormatted; - } - - public String getLocale() { - return locale; - } - - public void setLocale(String locale) { - this.locale = locale; - } -} \ No newline at end of file diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/views/administration-view-templates.jsp b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/views/administration-view-templates.jsp index e04a86ba5..cf55bec09 100644 --- a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/views/administration-view-templates.jsp +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/views/administration-view-templates.jsp @@ -58,7 +58,7 @@ - + @@ -66,7 +66,7 @@ - {{#each repaymentFrequencyOptions}} {{#if $ctx.number($parent.parent.data.repaymentPeriodFrequency)===$ctx.number(id)}} @@ -90,9 +90,9 @@ - + - {{#each interestFrequencyOptions}} {{#if $ctx.number($parent.parent.data.interestRatePeriod)===$ctx.number(id)}} @@ -106,7 +106,7 @@ - {{#each possibleAmortizationOptions}} {{#if $ctx.number($parent.parent.data.amortizationMethod)===$ctx.number(id)}} @@ -120,7 +120,7 @@ - {{#each possibleInterestOptions}} {{#if $ctx.number($parent.parent.data.interestMethod)===$ctx.number(id)}} @@ -134,7 +134,7 @@ - {{#each possibleInterestRateCalculatedInPeriodOptions}} {{#if $ctx.number($parent.parent.data.interestRateCalculatedInPeriod)===$ctx.number(id)}} @@ -148,7 +148,7 @@ - + diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/DataValidatorBuilder.java b/mifosng-provider/src/main/java/org/mifosng/platform/DataValidatorBuilder.java index a3459cf48..9ddf6198d 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/DataValidatorBuilder.java +++ b/mifosng-provider/src/main/java/org/mifosng/platform/DataValidatorBuilder.java @@ -1,5 +1,6 @@ package org.mifosng.platform; +import java.math.BigDecimal; import java.util.List; import org.apache.commons.lang.StringUtils; @@ -126,6 +127,23 @@ public class DataValidatorBuilder { return this; } + public DataValidatorBuilder positiveAmount() { + if (value == null && ignoreNullValue) { + return this; + } + + if (value != null) { + BigDecimal number = BigDecimal.valueOf(Double.valueOf(value.toString())); + if (number.compareTo(BigDecimal.ZERO) <= 0) { + StringBuilder validationErrorCode = new StringBuilder("validation.msg.").append(resource).append(".").append(parameter).append(".not.greater.than.zero"); + StringBuilder defaultEnglishMessage = new StringBuilder("The parameter ").append(parameter).append(" must be greater than 0."); + ApiParameterError error = ApiParameterError.parameterError(validationErrorCode.toString(), defaultEnglishMessage.toString(), parameter, number, 0); + dataValidationErrors.add(error); + } + } + return this; + } + public DataValidatorBuilder greaterThanZero() { if (value == null && ignoreNullValue) { return this; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/api/LoanProductApiResource.java b/mifosng-provider/src/main/java/org/mifosng/platform/api/LoanProductApiResource.java index 89f0a5621..f0cb05d0f 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/api/LoanProductApiResource.java +++ b/mifosng-provider/src/main/java/org/mifosng/platform/api/LoanProductApiResource.java @@ -18,7 +18,7 @@ import javax.ws.rs.core.UriInfo; import org.mifosng.data.EntityIdentifier; import org.mifosng.data.LoanProductData; -import org.mifosng.data.command.LoanProductCommand; +import org.mifosng.platform.api.commands.LoanProductCommand; import org.mifosng.platform.api.infrastructure.ApiDataConversionService; import org.mifosng.platform.api.infrastructure.ApiJSONFormattingService; import org.mifosng.platform.loanproduct.service.LoanProductReadPlatformService; @@ -52,6 +52,23 @@ public class LoanProductApiResource { @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) @Produces({ MediaType.APPLICATION_JSON }) public Response createLoanProduct(LoanProductCommand command) { + + Locale clientApplicationLocale = this.apiDataConversionService.localeFromString(command.getLocale()); + + BigDecimal principalValue = this.apiDataConversionService.convertFrom(command.getPrincipal(), "principal", clientApplicationLocale); + BigDecimal inArrearsToleranceValue = this.apiDataConversionService.convertFrom(command.getInArrearsTolerance(), "inArrearsTolerance", clientApplicationLocale); + BigDecimal interestRatePerPeriodValue = this.apiDataConversionService.convertFrom(command.getInterestRatePerPeriod(),"interestRatePerPeriod", clientApplicationLocale); + + Integer digitsAfterDecimalValue = this.apiDataConversionService.convertToInteger(command.getDigitsAfterDecimal(), "digitsAfterDecimal", clientApplicationLocale); + Integer repaymentEveryValue = this.apiDataConversionService.convertToInteger(command.getRepaymentEvery(), "repaymentEvery", clientApplicationLocale); + Integer numberOfRepaymentsValue = this.apiDataConversionService.convertToInteger(command.getNumberOfRepayments(), "numberOfRepayments", clientApplicationLocale); + + command.setPrincipalValue(principalValue); + command.setInArrearsToleranceValue(inArrearsToleranceValue); + command.setInterestRatePerPeriodValue(interestRatePerPeriodValue); + command.setDigitsAfterDecimalValue(digitsAfterDecimalValue); + command.setRepaymentEveryValue(repaymentEveryValue); + command.setNumberOfRepaymentsValue(numberOfRepaymentsValue); EntityIdentifier entityIdentifier = this.loanProductWritePlatformService .createLoanProduct(command); @@ -116,14 +133,21 @@ public class LoanProductApiResource { public Response updateLoanProduct(@PathParam("productId") final Long productId, final LoanProductCommand command) { Locale clientApplicationLocale = this.apiDataConversionService.localeFromString(command.getLocale()); - - BigDecimal principal = this.apiDataConversionService.convertFrom(command.getPrincipalFormatted(), "principalFormatted", clientApplicationLocale); - BigDecimal interestRatePerPeriod = this.apiDataConversionService.convertFrom(command.getInterestRatePerPeriodFormatted(),"interestRatePerPeriodFormatted", clientApplicationLocale); - BigDecimal inArrearsToleranceAmount = this.apiDataConversionService.convertFrom(command.getInArrearsToleranceAmountFormatted(), "inArrearsToleranceAmountFormatted", clientApplicationLocale); - command.setPrincipal(principal); - command.setInterestRatePerPeriod(interestRatePerPeriod); - command.setInArrearsToleranceAmount(inArrearsToleranceAmount); + BigDecimal principalValue = this.apiDataConversionService.convertFrom(command.getPrincipal(), "principal", clientApplicationLocale); + BigDecimal inArrearsToleranceValue = this.apiDataConversionService.convertFrom(command.getInArrearsTolerance(), "inArrearsTolerance", clientApplicationLocale); + BigDecimal interestRatePerPeriodValue = this.apiDataConversionService.convertFrom(command.getInterestRatePerPeriod(),"interestRatePerPeriod", clientApplicationLocale); + + Integer digitsAfterDecimalValue = this.apiDataConversionService.convertToInteger(command.getDigitsAfterDecimal(), "digitsAfterDecimal", clientApplicationLocale); + Integer repaymentEveryValue = this.apiDataConversionService.convertToInteger(command.getRepaymentEvery(), "repaymentEvery", clientApplicationLocale); + Integer numberOfRepaymentsValue = this.apiDataConversionService.convertToInteger(command.getNumberOfRepayments(), "numberOfRepayments", clientApplicationLocale); + + command.setPrincipalValue(principalValue); + command.setInArrearsToleranceValue(inArrearsToleranceValue); + command.setInterestRatePerPeriodValue(interestRatePerPeriodValue); + command.setDigitsAfterDecimalValue(digitsAfterDecimalValue); + command.setRepaymentEveryValue(repaymentEveryValue); + command.setNumberOfRepaymentsValue(numberOfRepaymentsValue); command.setId(productId); EntityIdentifier entityIdentifier = this.loanProductWritePlatformService.updateLoanProduct(command); diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/api/RoleApiResource.java b/mifosng-provider/src/main/java/org/mifosng/platform/api/RoleApiResource.java index b3e96dea7..697043b9c 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/api/RoleApiResource.java +++ b/mifosng-provider/src/main/java/org/mifosng/platform/api/RoleApiResource.java @@ -18,7 +18,7 @@ import javax.ws.rs.core.UriInfo; import org.mifosng.data.EntityIdentifier; import org.mifosng.data.PermissionData; import org.mifosng.data.RoleData; -import org.mifosng.data.command.RoleCommand; +import org.mifosng.platform.api.commands.RoleCommand; import org.mifosng.platform.api.infrastructure.ApiJSONFormattingService; import org.mifosng.platform.user.service.PermissionReadPlatformService; import org.mifosng.platform.user.service.RoleReadPlatformService; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/api/UserApiResource.java b/mifosng-provider/src/main/java/org/mifosng/platform/api/UserApiResource.java index 083fc0ba4..afbc213fe 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/api/UserApiResource.java +++ b/mifosng-provider/src/main/java/org/mifosng/platform/api/UserApiResource.java @@ -17,7 +17,7 @@ import javax.ws.rs.core.UriInfo; import org.mifosng.data.AppUserData; import org.mifosng.data.EntityIdentifier; -import org.mifosng.data.command.UserCommand; +import org.mifosng.platform.api.commands.UserCommand; import org.mifosng.platform.api.infrastructure.ApiJSONFormattingService; import org.mifosng.platform.user.service.AppUserReadPlatformService; import org.mifosng.platform.user.service.AppUserWritePlatformService; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/api/commands/LoanProductCommand.java b/mifosng-provider/src/main/java/org/mifosng/platform/api/commands/LoanProductCommand.java new file mode 100644 index 000000000..4de2a7833 --- /dev/null +++ b/mifosng-provider/src/main/java/org/mifosng/platform/api/commands/LoanProductCommand.java @@ -0,0 +1,226 @@ +package org.mifosng.platform.api.commands; + +import java.math.BigDecimal; + +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement +public class LoanProductCommand { + + private Long id; + private String name; + private String description; + private String externalId; + + private String locale; + private String currencyCode; + private String digitsAfterDecimal; + private Integer digitsAfterDecimalValue; + private BigDecimal principalValue; + private String principal; + private BigDecimal inArrearsToleranceValue; + private String inArrearsTolerance; + + private String numberOfRepayments; + private Integer numberOfRepaymentsValue; + private String repaymentEvery; + private Integer repaymentEveryValue; + + private String interestRatePerPeriod; + private BigDecimal interestRatePerPeriodValue; + + private Integer repaymentFrequencyType; + private Integer interestRateFrequencyType; + private Integer amortizationType; + private Integer interestType; + private Integer interestCalculationPeriodType; + + protected LoanProductCommand() { + // + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getExternalId() { + return externalId; + } + + public void setExternalId(String externalId) { + this.externalId = externalId; + } + + public String getCurrencyCode() { + return currencyCode; + } + + public void setCurrencyCode(String currencyCode) { + this.currencyCode = currencyCode; + } + + public String getLocale() { + return locale; + } + + public void setLocale(String locale) { + this.locale = locale; + } + + public String getDigitsAfterDecimal() { + return digitsAfterDecimal; + } + + public void setDigitsAfterDecimal(String digitsAfterDecimal) { + this.digitsAfterDecimal = digitsAfterDecimal; + } + + public Integer getDigitsAfterDecimalValue() { + return digitsAfterDecimalValue; + } + + public void setDigitsAfterDecimalValue(Integer digitsAfterDecimalValue) { + this.digitsAfterDecimalValue = digitsAfterDecimalValue; + } + + public BigDecimal getPrincipalValue() { + return principalValue; + } + + public void setPrincipalValue(BigDecimal principalValue) { + this.principalValue = principalValue; + } + + public String getPrincipal() { + return principal; + } + + public void setPrincipal(String principal) { + this.principal = principal; + } + + public BigDecimal getInArrearsToleranceValue() { + return inArrearsToleranceValue; + } + + public void setInArrearsToleranceValue(BigDecimal inArrearsToleranceValue) { + this.inArrearsToleranceValue = inArrearsToleranceValue; + } + + public String getInArrearsTolerance() { + return inArrearsTolerance; + } + + public void setInArrearsTolerance(String inArrearsTolerance) { + this.inArrearsTolerance = inArrearsTolerance; + } + + public String getNumberOfRepayments() { + return numberOfRepayments; + } + + public void setNumberOfRepayments(String numberOfRepayments) { + this.numberOfRepayments = numberOfRepayments; + } + + public Integer getNumberOfRepaymentsValue() { + return numberOfRepaymentsValue; + } + + public void setNumberOfRepaymentsValue(Integer numberOfRepaymentsValue) { + this.numberOfRepaymentsValue = numberOfRepaymentsValue; + } + + public String getRepaymentEvery() { + return repaymentEvery; + } + + public void setRepaymentEvery(String repaymentEvery) { + this.repaymentEvery = repaymentEvery; + } + + public Integer getRepaymentEveryValue() { + return repaymentEveryValue; + } + + public void setRepaymentEveryValue(Integer repaymentEveryValue) { + this.repaymentEveryValue = repaymentEveryValue; + } + + public String getInterestRatePerPeriod() { + return interestRatePerPeriod; + } + + public void setInterestRatePerPeriod(String interestRatePerPeriod) { + this.interestRatePerPeriod = interestRatePerPeriod; + } + + public BigDecimal getInterestRatePerPeriodValue() { + return interestRatePerPeriodValue; + } + + public void setInterestRatePerPeriodValue(BigDecimal interestRatePerPeriodValue) { + this.interestRatePerPeriodValue = interestRatePerPeriodValue; + } + + public Integer getRepaymentFrequencyType() { + return repaymentFrequencyType; + } + + public void setRepaymentFrequencyType(Integer repaymentFrequencyType) { + this.repaymentFrequencyType = repaymentFrequencyType; + } + + public Integer getInterestRateFrequencyType() { + return interestRateFrequencyType; + } + + public void setInterestRateFrequencyType(Integer interestRateFrequencyType) { + this.interestRateFrequencyType = interestRateFrequencyType; + } + + public Integer getAmortizationType() { + return amortizationType; + } + + public void setAmortizationType(Integer amortizationType) { + this.amortizationType = amortizationType; + } + + public Integer getInterestType() { + return interestType; + } + + public void setInterestType(Integer interestType) { + this.interestType = interestType; + } + + public Integer getInterestCalculationPeriodType() { + return interestCalculationPeriodType; + } + + public void setInterestCalculationPeriodType( + Integer interestCalculationPeriodType) { + this.interestCalculationPeriodType = interestCalculationPeriodType; + } +} \ No newline at end of file diff --git a/mifosng-data/src/main/java/org/mifosng/data/command/RoleCommand.java b/mifosng-provider/src/main/java/org/mifosng/platform/api/commands/RoleCommand.java similarity index 96% rename from mifosng-data/src/main/java/org/mifosng/data/command/RoleCommand.java rename to mifosng-provider/src/main/java/org/mifosng/platform/api/commands/RoleCommand.java index f8d50749b..42cabe980 100644 --- a/mifosng-data/src/main/java/org/mifosng/data/command/RoleCommand.java +++ b/mifosng-provider/src/main/java/org/mifosng/platform/api/commands/RoleCommand.java @@ -1,4 +1,4 @@ -package org.mifosng.data.command; +package org.mifosng.platform.api.commands; import javax.xml.bind.annotation.XmlRootElement; diff --git a/mifosng-data/src/main/java/org/mifosng/data/command/UserCommand.java b/mifosng-provider/src/main/java/org/mifosng/platform/api/commands/UserCommand.java similarity index 97% rename from mifosng-data/src/main/java/org/mifosng/data/command/UserCommand.java rename to mifosng-provider/src/main/java/org/mifosng/platform/api/commands/UserCommand.java index bd0c25c3d..b20d4a1e8 100644 --- a/mifosng-data/src/main/java/org/mifosng/data/command/UserCommand.java +++ b/mifosng-provider/src/main/java/org/mifosng/platform/api/commands/UserCommand.java @@ -1,4 +1,4 @@ -package org.mifosng.data.command; +package org.mifosng.platform.api.commands; import java.io.Serializable; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/api/infrastructure/ApiDataConversionService.java b/mifosng-provider/src/main/java/org/mifosng/platform/api/infrastructure/ApiDataConversionService.java index ec632b6b2..8ae40a61a 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/api/infrastructure/ApiDataConversionService.java +++ b/mifosng-provider/src/main/java/org/mifosng/platform/api/infrastructure/ApiDataConversionService.java @@ -10,9 +10,10 @@ public interface ApiDataConversionService { LocalDate convertFrom(String dateAsString, String parameterName, String dateFormat); + Integer convertToInteger(String digitsAfterDecimal, String string, Locale clientApplicationLocale); + BigDecimal convertFrom(String principalFormatted, String parameterName, Locale clientApplicationLocale); Locale localeFromString(String locale); - } diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/api/infrastructure/ApiDataConversionServiceImpl.java b/mifosng-provider/src/main/java/org/mifosng/platform/api/infrastructure/ApiDataConversionServiceImpl.java index 7126588bd..d5a2f29c8 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/api/infrastructure/ApiDataConversionServiceImpl.java +++ b/mifosng-provider/src/main/java/org/mifosng/platform/api/infrastructure/ApiDataConversionServiceImpl.java @@ -48,6 +48,36 @@ public class ApiDataConversionServiceImpl implements ApiDataConversionService { return eventLocalDate; } + + @Override + public Integer convertToInteger(String numericalValueFormatted, String parameterName, Locale clientApplicationLocale) { + try { + Integer number = null; + + if (StringUtils.isNotBlank(numericalValueFormatted)) { + String sourceWithoutSpaces = numericalValueFormatted.replaceAll(" ", ""); + NumberFormat format = NumberFormat.getNumberInstance(clientApplicationLocale); + Number parsedNumber = format.parse(sourceWithoutSpaces); + number = parsedNumber.intValue(); + } + + return number; + } catch (ParseException e) { + + List dataValidationErrors = new ArrayList(); + ApiParameterError error = ApiParameterError.parameterError( + "validation.msg.invalid.number.format", "The parameter " + + parameterName + " is invalid for provided locale" + + clientApplicationLocale.toString() + ".", + parameterName, numericalValueFormatted, + clientApplicationLocale); + dataValidationErrors.add(error); + + throw new PlatformApiDataValidationException( + "validation.msg.validation.errors.exist", + "Validation errors exist.", dataValidationErrors); + } + } @Override public BigDecimal convertFrom(String numericalValueFormatted, diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanProduct.java b/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanProduct.java index 17fe044e5..41035d5ef 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanProduct.java +++ b/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanProduct.java @@ -10,7 +10,7 @@ import javax.persistence.ManyToOne; import javax.persistence.Table; import org.apache.commons.lang.StringUtils; -import org.mifosng.data.command.LoanProductCommand; +import org.mifosng.platform.api.commands.LoanProductCommand; import org.mifosng.platform.currency.domain.MonetaryCurrency; import org.mifosng.platform.currency.domain.Money; import org.mifosng.platform.infrastructure.AbstractAuditableCustom; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanProductRelatedDetail.java b/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanProductRelatedDetail.java index 5f4a2fe11..392ac60c0 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanProductRelatedDetail.java +++ b/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanProductRelatedDetail.java @@ -8,7 +8,7 @@ import javax.persistence.Embedded; import javax.persistence.EnumType; import javax.persistence.Enumerated; -import org.mifosng.data.command.LoanProductCommand; +import org.mifosng.platform.api.commands.LoanProductCommand; import org.mifosng.platform.currency.domain.MonetaryCurrency; import org.mifosng.platform.currency.domain.Money; @@ -174,37 +174,37 @@ public class LoanProductRelatedDetail implements public void update(LoanProductCommand command) { if (command.getCurrencyCode() != null && command.getDigitsAfterDecimal() != null) { - this.currency = new MonetaryCurrency(command.getCurrencyCode(), command.getDigitsAfterDecimal()); + this.currency = new MonetaryCurrency(command.getCurrencyCode(), command.getDigitsAfterDecimalValue()); } if (command.getPrincipal() != null) { - this.principal = command.getPrincipal(); + this.principal = command.getPrincipalValue(); } if (command.getRepaymentEvery() != null) { - this.repayEvery = command.getRepaymentEvery(); + this.repayEvery = command.getRepaymentEveryValue(); } - if (command.getRepaymentFrequency() != null) { - this.repaymentPeriodFrequencyType = PeriodFrequencyType.fromInt(command.getRepaymentFrequency()); + if (command.getRepaymentFrequencyType() != null) { + this.repaymentPeriodFrequencyType = PeriodFrequencyType.fromInt(command.getRepaymentFrequencyType()); } if (command.getNumberOfRepayments() != null) { - this.numberOfRepayments = command.getNumberOfRepayments(); + this.numberOfRepayments = command.getNumberOfRepaymentsValue(); } - if (command.getAmortizationMethod() != null) { - this.amortizationMethod = AmortizationMethod.fromInt(command.getAmortizationMethod()); + if (command.getAmortizationType() != null) { + this.amortizationMethod = AmortizationMethod.fromInt(command.getAmortizationType()); } - if (command.getInArrearsToleranceAmount() != null) { - this.inArrearsTolerance = command.getInArrearsToleranceAmount(); + if (command.getInArrearsToleranceValue() != null) { + this.inArrearsTolerance = command.getInArrearsToleranceValue(); } if (command.getInterestRatePerPeriod() != null) { - this.nominalInterestRatePerPeriod = command.getInterestRatePerPeriod(); + this.nominalInterestRatePerPeriod = command.getInterestRatePerPeriodValue(); } - if (command.getInterestRateFrequencyMethod() != null) { - this.interestPeriodFrequencyType = PeriodFrequencyType.fromInt(command.getInterestRateFrequencyMethod()); + if (command.getInterestRateFrequencyType() != null) { + this.interestPeriodFrequencyType = PeriodFrequencyType.fromInt(command.getInterestRateFrequencyType()); } - if (command.getInterestMethod() != null) { - this.interestMethod = InterestMethod.fromInt(command.getInterestMethod()); + if (command.getInterestType() != null) { + this.interestMethod = InterestMethod.fromInt(command.getInterestType()); } - if (command.getInterestCalculationPeriodMethod() != null) { - this.interestCalculationPeriodMethod = InterestCalculationPeriodMethod.fromInt(command.getInterestCalculationPeriodMethod()); + if (command.getInterestCalculationPeriodType() != null) { + this.interestCalculationPeriodMethod = InterestCalculationPeriodMethod.fromInt(command.getInterestCalculationPeriodType()); } } } \ No newline at end of file diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loanproduct/service/LoanProductCommandValidator.java b/mifosng-provider/src/main/java/org/mifosng/platform/loanproduct/service/LoanProductCommandValidator.java index 11e812bee..0dd671fae 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loanproduct/service/LoanProductCommandValidator.java +++ b/mifosng-provider/src/main/java/org/mifosng/platform/loanproduct/service/LoanProductCommandValidator.java @@ -4,8 +4,8 @@ import java.util.ArrayList; import java.util.List; import org.mifosng.data.ApiParameterError; -import org.mifosng.data.command.LoanProductCommand; import org.mifosng.platform.DataValidatorBuilder; +import org.mifosng.platform.api.commands.LoanProductCommand; import org.mifosng.platform.exceptions.PlatformApiDataValidationException; public class LoanProductCommandValidator { @@ -27,25 +27,26 @@ public class LoanProductCommandValidator { baseDataValidator.reset().parameter("description").value(command.getDescription()).ignoreIfNull().notExceedingLengthOf(500); baseDataValidator.reset().parameter("externalId").value(command.getExternalId()).ignoreIfNull().notExceedingLengthOf(100); baseDataValidator.reset().parameter("currencyCode").value(command.getCurrencyCode()).ignoreIfNull().notBlank(); - baseDataValidator.reset().parameter("digitsAfterDecimal").value(command.getDigitsAfterDecimal()).ignoreIfNull().notNull().inMinMaxRange(0, 6); + baseDataValidator.reset().parameter("digitsAfterDecimal").value(command.getDigitsAfterDecimalValue()).ignoreIfNull().notNull().inMinMaxRange(0, 6); - baseDataValidator.reset().parameter("principalFormatted").value(command.getPrincipalFormatted()).ignoreIfNull().notBlank(); - baseDataValidator.reset().parameter("inArrearsToleranceAmountFormatted").value(command.getInArrearsToleranceAmountFormatted()).ignoreIfNull().notBlank(); + baseDataValidator.reset().parameter("principal").value(command.getPrincipalValue()).ignoreIfNull().notNull().positiveAmount(); + baseDataValidator.reset().parameter("inArrearsTolerance").value(command.getInArrearsToleranceValue()).ignoreIfNull().positiveAmount(); - baseDataValidator.reset().parameter("repaymentFrequency").value(command.getRepaymentFrequency()).ignoreIfNull().notNull().inMinMaxRange(0, 3); - baseDataValidator.reset().parameter("repaymentEvery").value(command.getRepaymentEvery()).ignoreIfNull().notNull().greaterThanZero(); - baseDataValidator.reset().parameter("numberOfRepayments").value(command.getNumberOfRepayments()).ignoreIfNull().notNull().greaterThanZero(); + baseDataValidator.reset().parameter("repaymentFrequencyType").value(command.getRepaymentFrequencyType()).ignoreIfNull().notNull().inMinMaxRange(0, 3); - baseDataValidator.reset().parameter("interestRatePerPeriodFormatted").value(command.getInterestRatePerPeriodFormatted()).ignoreIfNull().notBlank(); - baseDataValidator.reset().parameter("interestRateFrequencyMethod").value(command.getInterestRateFrequencyMethod()).ignoreIfNull().notNull().inMinMaxRange(0, 3); + baseDataValidator.reset().parameter("repaymentEvery").value(command.getRepaymentEveryValue()).ignoreIfNull().notNull().greaterThanZero(); + baseDataValidator.reset().parameter("numberOfRepayments").value(command.getNumberOfRepaymentsValue()).ignoreIfNull().notNull().greaterThanZero(); - baseDataValidator.reset().parameter("amortizationMethod").value(command.getAmortizationMethod()).ignoreIfNull().notNull().inMinMaxRange(0, 1); - baseDataValidator.reset().parameter("interestMethod").value(command.getInterestMethod()).ignoreIfNull().notNull().inMinMaxRange(0, 1); - baseDataValidator.reset().parameter("interestCalculationPeriodMethod").value(command.getInterestCalculationPeriodMethod()).ignoreIfNull().notNull().inMinMaxRange(0, 1); + baseDataValidator.reset().parameter("interestRatePerPeriod").value(command.getInterestRatePerPeriodValue()).ignoreIfNull().notBlank(); + baseDataValidator.reset().parameter("interestRateFrequencyType").value(command.getInterestRateFrequencyType()).ignoreIfNull().notNull().inMinMaxRange(0, 3); + + baseDataValidator.reset().parameter("amortizationType").value(command.getAmortizationType()).ignoreIfNull().notNull().inMinMaxRange(0, 1); + baseDataValidator.reset().parameter("interestType").value(command.getInterestType()).ignoreIfNull().notNull().inMinMaxRange(0, 1); + baseDataValidator.reset().parameter("interestCalculationPeriodType").value(command.getInterestCalculationPeriodType()).ignoreIfNull().notNull().inMinMaxRange(0, 1); baseDataValidator.reset().anyOfNotNull(command.getName(), command.getDescription(), command.getExternalId(), command.getCurrencyCode(), command.getDigitsAfterDecimal(), - command.getPrincipalFormatted(), command.getInArrearsToleranceAmountFormatted(), command.getRepaymentFrequency(), command.getRepaymentEvery(), command.getNumberOfRepayments(), - command.getInterestRatePerPeriodFormatted(), command.getInterestRateFrequencyMethod(), command.getAmortizationMethod(), command.getInterestMethod(), command.getInterestCalculationPeriodMethod()); + command.getPrincipal(), command.getInArrearsTolerance(), command.getRepaymentFrequencyType(), command.getRepaymentEvery(), command.getNumberOfRepayments(), + command.getInterestRatePerPeriod(), command.getInterestRateFrequencyType(), command.getAmortizationType(), command.getInterestType(), command.getInterestCalculationPeriodType()); if (!dataValidationErrors.isEmpty()) { throw new PlatformApiDataValidationException("validation.msg.validation.errors.exist", "Validation errors exist.", dataValidationErrors); @@ -62,21 +63,21 @@ public class LoanProductCommandValidator { baseDataValidator.reset().parameter("description").value(command.getDescription()).notExceedingLengthOf(500); baseDataValidator.reset().parameter("externalId").value(command.getExternalId()).notExceedingLengthOf(100); baseDataValidator.reset().parameter("currencyCode").value(command.getCurrencyCode()).notBlank(); - baseDataValidator.reset().parameter("digitsAfterDecimal").value(command.getDigitsAfterDecimal()).notNull().inMinMaxRange(0, 6); + baseDataValidator.reset().parameter("digitsAfterDecimal").value(command.getDigitsAfterDecimalValue()).notNull().inMinMaxRange(0, 6); - baseDataValidator.reset().parameter("principalFormatted").value(command.getPrincipalFormatted()).notBlank(); - baseDataValidator.reset().parameter("inArrearsToleranceAmountFormatted").value(command.getInArrearsToleranceAmountFormatted()).notBlank(); + baseDataValidator.reset().parameter("principal").value(command.getPrincipalValue()).notNull().positiveAmount(); + baseDataValidator.reset().parameter("inArrearsTolerance").value(command.getInArrearsToleranceValue()).positiveAmount(); - baseDataValidator.reset().parameter("repaymentFrequency").value(command.getRepaymentFrequency()).notNull().inMinMaxRange(0, 3); - baseDataValidator.reset().parameter("repaymentEvery").value(command.getRepaymentEvery()).notNull().greaterThanZero(); - baseDataValidator.reset().parameter("numberOfRepayments").value(command.getNumberOfRepayments()).notNull().greaterThanZero(); + baseDataValidator.reset().parameter("repaymentFrequencyType").value(command.getRepaymentFrequencyType()).notNull().inMinMaxRange(0, 3); + baseDataValidator.reset().parameter("repaymentEvery").value(command.getRepaymentEveryValue()).notNull().greaterThanZero(); + baseDataValidator.reset().parameter("numberOfRepayments").value(command.getNumberOfRepaymentsValue()).notNull().greaterThanZero(); - baseDataValidator.reset().parameter("interestRatePerPeriodFormatted").value(command.getInterestRatePerPeriodFormatted()).notBlank(); - baseDataValidator.reset().parameter("interestRateFrequencyMethod").value(command.getInterestRateFrequencyMethod()).notNull().inMinMaxRange(0, 3); + baseDataValidator.reset().parameter("interestRatePerPeriod").value(command.getInterestRatePerPeriodValue()).notNull(); + baseDataValidator.reset().parameter("interestRateFrequencyType").value(command.getInterestRateFrequencyType()).notNull().inMinMaxRange(0, 3); - baseDataValidator.reset().parameter("amortizationMethod").value(command.getAmortizationMethod()).notNull().inMinMaxRange(0, 1); - baseDataValidator.reset().parameter("interestMethod").value(command.getInterestMethod()).notNull().inMinMaxRange(0, 1); - baseDataValidator.reset().parameter("interestCalculationPeriodMethod").value(command.getInterestCalculationPeriodMethod()).notNull().inMinMaxRange(0, 1); + baseDataValidator.reset().parameter("amortizationType").value(command.getAmortizationType()).notNull().inMinMaxRange(0, 1); + baseDataValidator.reset().parameter("interestType").value(command.getInterestType()).notNull().inMinMaxRange(0, 1); + baseDataValidator.reset().parameter("interestCalculationPeriodType").value(command.getInterestCalculationPeriodType()).notNull().inMinMaxRange(0, 1); if (!dataValidationErrors.isEmpty()) { throw new PlatformApiDataValidationException("validation.msg.validation.errors.exist", "Validation errors exist.", dataValidationErrors); diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loanproduct/service/LoanProductWritePlatformService.java b/mifosng-provider/src/main/java/org/mifosng/platform/loanproduct/service/LoanProductWritePlatformService.java index 72bf82598..5aba7d534 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loanproduct/service/LoanProductWritePlatformService.java +++ b/mifosng-provider/src/main/java/org/mifosng/platform/loanproduct/service/LoanProductWritePlatformService.java @@ -1,7 +1,7 @@ package org.mifosng.platform.loanproduct.service; import org.mifosng.data.EntityIdentifier; -import org.mifosng.data.command.LoanProductCommand; +import org.mifosng.platform.api.commands.LoanProductCommand; public interface LoanProductWritePlatformService { diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loanproduct/service/LoanProductWritePlatformServiceJpaRepositoryImpl.java b/mifosng-provider/src/main/java/org/mifosng/platform/loanproduct/service/LoanProductWritePlatformServiceJpaRepositoryImpl.java index 16a200952..79a70e299 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loanproduct/service/LoanProductWritePlatformServiceJpaRepositoryImpl.java +++ b/mifosng-provider/src/main/java/org/mifosng/platform/loanproduct/service/LoanProductWritePlatformServiceJpaRepositoryImpl.java @@ -5,7 +5,7 @@ import static org.mifosng.platform.Specifications.productThatMatches; import java.math.BigDecimal; import org.mifosng.data.EntityIdentifier; -import org.mifosng.data.command.LoanProductCommand; +import org.mifosng.platform.api.commands.LoanProductCommand; import org.mifosng.platform.currency.domain.MonetaryCurrency; import org.mifosng.platform.exceptions.LoanProductNotFoundException; import org.mifosng.platform.loan.domain.AmortizationMethod; @@ -45,25 +45,26 @@ public class LoanProductWritePlatformServiceJpaRepositoryImpl implements LoanPro validator.validateForCreate(); // assemble LoanProduct from data - InterestMethod interestMethod = InterestMethod.fromInt(command.getInterestMethod()); - InterestCalculationPeriodMethod interestCalculationPeriodMethod = InterestCalculationPeriodMethod.fromInt(command.getInterestCalculationPeriodMethod()); + InterestMethod interestMethod = InterestMethod.fromInt(command.getInterestType()); + InterestCalculationPeriodMethod interestCalculationPeriodMethod = InterestCalculationPeriodMethod.fromInt(command.getInterestCalculationPeriodType()); - AmortizationMethod amortizationMethod = AmortizationMethod.fromInt(command.getAmortizationMethod()); + AmortizationMethod amortizationMethod = AmortizationMethod.fromInt(command.getAmortizationType()); PeriodFrequencyType repaymentFrequencyType = PeriodFrequencyType - .fromInt(command.getRepaymentFrequency()); + .fromInt(command.getRepaymentFrequencyType()); PeriodFrequencyType interestFrequencyType = PeriodFrequencyType - .fromInt(command.getInterestRateFrequencyMethod()); + .fromInt(command.getInterestRateFrequencyType()); - MonetaryCurrency currency = new MonetaryCurrency(command.getCurrencyCode(), command.getDigitsAfterDecimal()); + MonetaryCurrency currency = new MonetaryCurrency(command.getCurrencyCode(), command.getDigitsAfterDecimalValue()); - BigDecimal annualInterestRate = this.aprCalculator.calculateFrom(interestFrequencyType, command.getInterestRatePerPeriod()); + BigDecimal annualInterestRate = this.aprCalculator.calculateFrom(interestFrequencyType, command.getInterestRatePerPeriodValue()); LoanProduct loanproduct = new LoanProduct(currentUser.getOrganisation(), command.getName(), command.getDescription(), - currency, command.getPrincipal(), - command.getInterestRatePerPeriod(), interestFrequencyType, annualInterestRate, interestMethod, interestCalculationPeriodMethod, - command.getRepaymentEvery(), repaymentFrequencyType, command.getNumberOfRepayments(), amortizationMethod, command.getInArrearsToleranceAmount()); + currency, command.getPrincipalValue(), + command.getInterestRatePerPeriodValue(), interestFrequencyType, annualInterestRate, interestMethod, interestCalculationPeriodMethod, + command.getRepaymentEveryValue(), repaymentFrequencyType, command.getNumberOfRepaymentsValue(), + amortizationMethod, command.getInArrearsToleranceValue()); this.loanProductRepository.save(loanproduct); diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/user/service/AppUserWritePlatformService.java b/mifosng-provider/src/main/java/org/mifosng/platform/user/service/AppUserWritePlatformService.java index bc9b71209..bc925110c 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/user/service/AppUserWritePlatformService.java +++ b/mifosng-provider/src/main/java/org/mifosng/platform/user/service/AppUserWritePlatformService.java @@ -1,6 +1,6 @@ package org.mifosng.platform.user.service; -import org.mifosng.data.command.UserCommand; +import org.mifosng.platform.api.commands.UserCommand; import org.springframework.security.access.prepost.PreAuthorize; public interface AppUserWritePlatformService { diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/user/service/AppUserWritePlatformServiceJpaRepositoryImpl.java b/mifosng-provider/src/main/java/org/mifosng/platform/user/service/AppUserWritePlatformServiceJpaRepositoryImpl.java index 7a81ffe9c..643c27eea 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/user/service/AppUserWritePlatformServiceJpaRepositoryImpl.java +++ b/mifosng-provider/src/main/java/org/mifosng/platform/user/service/AppUserWritePlatformServiceJpaRepositoryImpl.java @@ -9,7 +9,7 @@ import java.util.Set; import org.apache.commons.lang.StringUtils; import org.mifosng.data.ApiParameterError; -import org.mifosng.data.command.UserCommand; +import org.mifosng.platform.api.commands.UserCommand; import org.mifosng.platform.exceptions.OfficeNotFoundException; import org.mifosng.platform.exceptions.PlatformApiDataValidationException; import org.mifosng.platform.exceptions.PlatformDataIntegrityException; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/user/service/RoleCommandValidator.java b/mifosng-provider/src/main/java/org/mifosng/platform/user/service/RoleCommandValidator.java index 4579a2a0b..815922aa7 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/user/service/RoleCommandValidator.java +++ b/mifosng-provider/src/main/java/org/mifosng/platform/user/service/RoleCommandValidator.java @@ -4,8 +4,8 @@ import java.util.ArrayList; import java.util.List; import org.mifosng.data.ApiParameterError; -import org.mifosng.data.command.RoleCommand; import org.mifosng.platform.DataValidatorBuilder; +import org.mifosng.platform.api.commands.RoleCommand; import org.mifosng.platform.exceptions.PlatformApiDataValidationException; public class RoleCommandValidator { diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/user/service/RoleWritePlatformService.java b/mifosng-provider/src/main/java/org/mifosng/platform/user/service/RoleWritePlatformService.java index 6d62f3dc8..470f4872c 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/user/service/RoleWritePlatformService.java +++ b/mifosng-provider/src/main/java/org/mifosng/platform/user/service/RoleWritePlatformService.java @@ -1,6 +1,6 @@ package org.mifosng.platform.user.service; -import org.mifosng.data.command.RoleCommand; +import org.mifosng.platform.api.commands.RoleCommand; import org.springframework.security.access.prepost.PreAuthorize; public interface RoleWritePlatformService { diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/user/service/RoleWritePlatformServiceJpaRepositoryImpl.java b/mifosng-provider/src/main/java/org/mifosng/platform/user/service/RoleWritePlatformServiceJpaRepositoryImpl.java index 788191fbd..96a12e8a6 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/user/service/RoleWritePlatformServiceJpaRepositoryImpl.java +++ b/mifosng-provider/src/main/java/org/mifosng/platform/user/service/RoleWritePlatformServiceJpaRepositoryImpl.java @@ -6,7 +6,7 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; -import org.mifosng.data.command.RoleCommand; +import org.mifosng.platform.api.commands.RoleCommand; import org.mifosng.platform.exceptions.RoleNotFoundException; import org.mifosng.platform.security.PlatformSecurityContext; import org.mifosng.platform.user.domain.AppUser; diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/user/service/UserCommandValidator.java b/mifosng-provider/src/main/java/org/mifosng/platform/user/service/UserCommandValidator.java index 88cc583aa..75d1d797b 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/user/service/UserCommandValidator.java +++ b/mifosng-provider/src/main/java/org/mifosng/platform/user/service/UserCommandValidator.java @@ -4,8 +4,8 @@ import java.util.ArrayList; import java.util.List; import org.mifosng.data.ApiParameterError; -import org.mifosng.data.command.UserCommand; import org.mifosng.platform.DataValidatorBuilder; +import org.mifosng.platform.api.commands.UserCommand; import org.mifosng.platform.exceptions.PlatformApiDataValidationException; public class UserCommandValidator {