You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by na...@apache.org on 2016/12/13 11:29:24 UTC

[1/2] incubator-fineract git commit: FIN-260: add ensure client charge date not before client activation date

Repository: incubator-fineract
Updated Branches:
  refs/heads/develop bc93c278c -> d5ac4e04a


FIN-260: add ensure client charge date not before client activation date


Project: http://git-wip-us.apache.org/repos/asf/incubator-fineract/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-fineract/commit/46c0cec8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-fineract/tree/46c0cec8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-fineract/diff/46c0cec8

Branch: refs/heads/develop
Commit: 46c0cec8355145779c73fd7b0014094ce50e92ed
Parents: e9e3326
Author: abdulazizali77 <ab...@acm.org>
Authored: Mon Nov 28 18:53:31 2016 +0800
Committer: abdulazizali77 <ab...@acm.org>
Committed: Mon Nov 28 18:53:31 2016 +0800

----------------------------------------------------------------------
 ...entChargeWritePlatformServiceJpaRepositoryImpl.java | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-fineract/blob/46c0cec8/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientChargeWritePlatformServiceJpaRepositoryImpl.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientChargeWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientChargeWritePlatformServiceJpaRepositoryImpl.java
index 8ba8071..b5043fc 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientChargeWritePlatformServiceJpaRepositoryImpl.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientChargeWritePlatformServiceJpaRepositoryImpl.java
@@ -118,8 +118,19 @@ public class ClientChargeWritePlatformServiceJpaRepositoryImpl implements Client
             }
 
             final ClientCharge clientCharge = ClientCharge.createNew(client, charge, command);
-
             final DateTimeFormatter fmt = DateTimeFormat.forPattern(command.dateFormat());
+            final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
+            final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors)
+                    .resource(ClientApiConstants.CLIENT_CHARGES_RESOURCE_NAME);
+            LocalDate activationDate = client.getActivationLocalDate();
+            LocalDate dueDate = clientCharge.getDueLocalDate();
+            if(dueDate.isBefore(activationDate)){
+                baseDataValidator.reset().parameter(ClientApiConstants.dueAsOfDateParamName).value(dueDate.toString(fmt))
+                .failWithCodeNoParameterAddedToErrorCode("dueDate.before.activationDate");
+
+                if (!dataValidationErrors.isEmpty()) { throw new PlatformApiDataValidationException(dataValidationErrors); }
+            }
+
             validateDueDateOnWorkingDay(clientCharge, fmt);
             this.clientChargeRepository.saveAndFlush(clientCharge);
 


[2/2] incubator-fineract git commit: Merge branch 'FINERACT-260' into develop

Posted by na...@apache.org.
Merge branch 'FINERACT-260' into develop


Project: http://git-wip-us.apache.org/repos/asf/incubator-fineract/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-fineract/commit/d5ac4e04
Tree: http://git-wip-us.apache.org/repos/asf/incubator-fineract/tree/d5ac4e04
Diff: http://git-wip-us.apache.org/repos/asf/incubator-fineract/diff/d5ac4e04

Branch: refs/heads/develop
Commit: d5ac4e04ac35133b8a37c766f17374185c9e2c45
Parents: bc93c27 46c0cec
Author: Nazeer Hussain Shaik <na...@confluxtechnologies.com>
Authored: Tue Dec 13 16:13:57 2016 +0530
Committer: Nazeer Hussain Shaik <na...@confluxtechnologies.com>
Committed: Tue Dec 13 16:13:57 2016 +0530

----------------------------------------------------------------------
 ...entChargeWritePlatformServiceJpaRepositoryImpl.java | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------