From 14968ba2208a1689a475e6ee14b12236aa983db0 Mon Sep 17 00:00:00 2001 From: John Woodlock Date: Tue, 14 May 2013 03:30:08 +0100 Subject: [PATCH 1/6] mifosx-353 datetime column type not andled by runreports api --- .../dataqueries/data/ResultsetColumnHeaderData.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/data/ResultsetColumnHeaderData.java b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/data/ResultsetColumnHeaderData.java index ae1fa104b..fd394c644 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/data/ResultsetColumnHeaderData.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/data/ResultsetColumnHeaderData.java @@ -57,6 +57,8 @@ public final class ResultsetColumnHeaderData { displayType = "INTEGER"; } else if (isDate()) { displayType = "DATE"; + } else if (isDateTime()) { + displayType = "DATETIME"; } else if (isDecimal()) { displayType = "DECIMAL"; } else if (isAnyText()) { @@ -111,6 +113,10 @@ public final class ResultsetColumnHeaderData { private boolean isDate() { return "date".equalsIgnoreCase(this.columnType); } + + private boolean isDateTime() { + return "datetime".equalsIgnoreCase(this.columnType); + } private boolean isString() { return isVarchar() || isChar(); From a11161208dbea21f63343a9b8b923f64e96d7155 Mon Sep 17 00:00:00 2001 From: Keith Woodlock Date: Sun, 19 May 2013 12:07:17 +0100 Subject: [PATCH 2/6] MIFOSX-364: ensure valiation check on loanProductId happens first. --- ...oanApplicationCommandFromApiJsonHelper.java | 14 +++----------- ...nWritePlatformServiceJpaRepositoryImpl.java | 18 +++++++++++++++--- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/serialization/LoanApplicationCommandFromApiJsonHelper.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/serialization/LoanApplicationCommandFromApiJsonHelper.java index 9f6ca5dd3..f31d7b1dd 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/serialization/LoanApplicationCommandFromApiJsonHelper.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/serialization/LoanApplicationCommandFromApiJsonHelper.java @@ -24,7 +24,6 @@ import org.mifosplatform.infrastructure.core.exception.PlatformApiDataValidation import org.mifosplatform.infrastructure.core.serialization.FromJsonHelper; import org.mifosplatform.portfolio.loanaccount.domain.LoanType; import org.mifosplatform.portfolio.loanproduct.domain.LoanProduct; -import org.mifosplatform.portfolio.loanproduct.serialization.LoanProductCommandFromApiJsonDeserializer; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -52,15 +51,12 @@ public final class LoanApplicationCommandFromApiJsonHelper { private final FromJsonHelper fromApiJsonHelper; - private final LoanProductCommandFromApiJsonDeserializer loanProductCommandFromApiJsonDeserializer; - @Autowired - public LoanApplicationCommandFromApiJsonHelper(final FromJsonHelper fromApiJsonHelper, final LoanProductCommandFromApiJsonDeserializer loanProductCommandFromApiJsonDeserializer) { + public LoanApplicationCommandFromApiJsonHelper(final FromJsonHelper fromApiJsonHelper) { this.fromApiJsonHelper = fromApiJsonHelper; - this.loanProductCommandFromApiJsonDeserializer = loanProductCommandFromApiJsonDeserializer; } - public void validateForCreate(final String json, final LoanProduct loanProduct) { + public void validateForCreate(final String json) { if (StringUtils.isBlank(json)) { throw new InvalidJsonException(); } final Type typeOfMap = new TypeToken>() {}.getType(); @@ -70,7 +66,6 @@ public final class LoanApplicationCommandFromApiJsonHelper { final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource("loan"); final JsonElement element = fromApiJsonHelper.parse(json); - final String loanTypeParameterName = "loanType"; final String loanTypeStr = fromApiJsonHelper.extractStringNamed(loanTypeParameterName, element); @@ -296,10 +291,7 @@ public final class LoanApplicationCommandFromApiJsonHelper { } } - loanProductCommandFromApiJsonDeserializer.validateMinMaxConstraints(element, baseDataValidator, loanProduct); - - if (!dataValidationErrors.isEmpty()) { throw new PlatformApiDataValidationException("validation.msg.validation.errors.exist", - "Validation errors exist.", dataValidationErrors); } + if (!dataValidationErrors.isEmpty()) { throw new PlatformApiDataValidationException(dataValidationErrors); } } public void validateForModify(final String json) { diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/LoanApplicationWritePlatformServiceJpaRepositoryImpl.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/LoanApplicationWritePlatformServiceJpaRepositoryImpl.java index bea418086..34f0e8069 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/LoanApplicationWritePlatformServiceJpaRepositoryImpl.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/LoanApplicationWritePlatformServiceJpaRepositoryImpl.java @@ -5,6 +5,7 @@ */ package org.mifosplatform.portfolio.loanaccount.service; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -15,8 +16,10 @@ import org.joda.time.LocalDate; import org.mifosplatform.infrastructure.codes.domain.CodeValue; import org.mifosplatform.infrastructure.core.api.JsonCommand; import org.mifosplatform.infrastructure.core.api.JsonQuery; +import org.mifosplatform.infrastructure.core.data.ApiParameterError; import org.mifosplatform.infrastructure.core.data.CommandProcessingResult; import org.mifosplatform.infrastructure.core.data.CommandProcessingResultBuilder; +import org.mifosplatform.infrastructure.core.data.DataValidatorBuilder; import org.mifosplatform.infrastructure.core.exception.PlatformDataIntegrityException; import org.mifosplatform.infrastructure.core.serialization.FromJsonHelper; import org.mifosplatform.infrastructure.security.service.PlatformSecurityContext; @@ -57,6 +60,7 @@ import org.mifosplatform.portfolio.loanproduct.domain.LoanProduct; import org.mifosplatform.portfolio.loanproduct.domain.LoanProductRepository; import org.mifosplatform.portfolio.loanproduct.domain.LoanTransactionProcessingStrategy; import org.mifosplatform.portfolio.loanproduct.exception.LoanProductNotFoundException; +import org.mifosplatform.portfolio.loanproduct.serialization.LoanProductCommandFromApiJsonDeserializer; import org.mifosplatform.portfolio.note.domain.Note; import org.mifosplatform.portfolio.note.domain.NoteRepository; import org.mifosplatform.useradministration.domain.AppUser; @@ -77,6 +81,7 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa private final PlatformSecurityContext context; private final FromJsonHelper fromJsonHelper; private final LoanApplicationTransitionApiJsonValidator loanApplicationTransitionApiJsonValidator; + private final LoanProductCommandFromApiJsonDeserializer loanProductCommandFromApiJsonDeserializer; private final LoanApplicationCommandFromApiJsonHelper fromApiJsonDeserializer; private final LoanRepository loanRepository; private final NoteRepository noteRepository; @@ -96,7 +101,8 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa @Autowired public LoanApplicationWritePlatformServiceJpaRepositoryImpl(final PlatformSecurityContext context, final FromJsonHelper fromJsonHelper, final LoanApplicationTransitionApiJsonValidator loanApplicationTransitionApiJsonValidator, - final LoanApplicationCommandFromApiJsonHelper fromApiJsonDeserializer, final AprCalculator aprCalculator, + final LoanApplicationCommandFromApiJsonHelper fromApiJsonDeserializer, + final LoanProductCommandFromApiJsonDeserializer loanProductCommandFromApiJsonDeserializer, final AprCalculator aprCalculator, final LoanAssembler loanAssembler, final LoanChargeAssembler loanChargeAssembler, final CollateralAssembler loanCollateralAssembler, final LoanRepository loanRepository, final NoteRepository noteRepository, final LoanScheduleCalculationPlatformService calculationPlatformService, final ClientRepositoryWrapper clientRepository, @@ -108,6 +114,7 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa this.fromJsonHelper = fromJsonHelper; this.loanApplicationTransitionApiJsonValidator = loanApplicationTransitionApiJsonValidator; this.fromApiJsonDeserializer = fromApiJsonDeserializer; + this.loanProductCommandFromApiJsonDeserializer = loanProductCommandFromApiJsonDeserializer; this.aprCalculator = aprCalculator; this.loanAssembler = loanAssembler; this.loanChargeAssembler = loanChargeAssembler; @@ -133,13 +140,18 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa @Override public CommandProcessingResult submitLoanApplication(final JsonCommand command) { - AppUser currentUser = context.authenticatedUser(); + final AppUser currentUser = context.authenticatedUser(); + + this.fromApiJsonDeserializer.validateForCreate(command.json()); + + final List dataValidationErrors = new ArrayList(); + final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource("loan"); final Long productId = fromJsonHelper.extractLongNamed("productId", command.parsedJson()); final LoanProduct loanProduct = this.loanProductRepository.findOne(productId); if (loanProduct == null) { throw new LoanProductNotFoundException(productId); } - this.fromApiJsonDeserializer.validateForCreate(command.json(), loanProduct); + this.loanProductCommandFromApiJsonDeserializer.validateMinMaxConstraints(command.parsedJson(), baseDataValidator, loanProduct); // validate dates against calendar recurring dates // get calendar From 2b5b3249a6500d47539652eee0eb0f3fa4880a59 Mon Sep 17 00:00:00 2001 From: Keith Woodlock Date: Sun, 19 May 2013 12:10:17 +0100 Subject: [PATCH 3/6] update release number to 1.1.2 --- mifosng-provider/gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mifosng-provider/gradle.properties b/mifosng-provider/gradle.properties index 618634b49..aed354c42 100644 --- a/mifosng-provider/gradle.properties +++ b/mifosng-provider/gradle.properties @@ -1 +1 @@ -releaseVersion=1.1.1.RELEASE +releaseVersion=1.1.2.RELEASE From 17c7eb8da4faf8d7d6fed62e218a302af47d7d98 Mon Sep 17 00:00:00 2001 From: Keith Woodlock Date: Sun, 19 May 2013 13:17:28 +0200 Subject: [PATCH 4/6] update readme for 1.1.2 --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e16215f78..395829e13 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ The mifos-platform (project named 'Mifos X') has reached public release versi That means there is a published and stable API. This API is documented in the api-docs under Full API Matrix. -Latest stable release: mifosplatform-1.1.0 +Latest stable release: mifosplatform-1.1.2 License ============= @@ -36,7 +36,7 @@ This project is licensed under the open source MPL V2. See https://github.com/op Mifos Platform API ===================== -API Documentation (Demo Server) +API Documentation (Demo Server) Online Demos From 56d776155433597e4857d7195976b60080c3212d Mon Sep 17 00:00:00 2001 From: Keith Woodlock Date: Sun, 19 May 2013 13:23:36 +0200 Subject: [PATCH 5/6] udpate changelog for 1.1.1 and 1.1.2 releases --- CHANGELOG.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e6fa68b4..d6b15bf5f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ See VERSIONING (https://github.com/openMF/mifosx/blob/master/VERSIONING.md) for Releases =============== +1. 19 May 2013 - 1.1.2.RELEASE +1. 12 May 2013 - 1.1.1.RELEASE 1. 09 May 2013 - 1.1.0.RELEASE 1. 08 May 2013 - 1.0.1.RELEASE 1. 07 May 2013 - 1.0.0.RELEASE @@ -17,6 +19,17 @@ Releases 1. 05 April 2013 - 0.11.1.beta 1. 05 April 2013 - 0.11.0.beta +1.1.2.RELEASE +============= +Bug Release + - MIFOSX-353 - datetime column in custom table report causes violation + - MIFOSX-364 - New loan application save button restriction + +1.1.1.RELEASE +============= +Bug Release + - MIFOSX-348 - General API concepts do not work for paginated endpoints + 1.1.0.RELEASE ============= Feature Release From b859ea3c3ac1fee6d62e4be0fbff56720beeb845 Mon Sep 17 00:00:00 2001 From: Keith Woodlock Date: Sun, 19 May 2013 12:29:29 +0100 Subject: [PATCH 6/6] update api docs to 1.1.2 version. --- api-docs/apiLive.htm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api-docs/apiLive.htm b/api-docs/apiLive.htm index 8de5d816e..88e73924c 100644 --- a/api-docs/apiLive.htm +++ b/api-docs/apiLive.htm @@ -90,7 +90,7 @@
- +

Overview