You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by ju...@apache.org on 2019/10/17 07:33:59 UTC

[fineract-cn-cheques] branch develop updated (c9d2107 -> 906131c)

This is an automated email from the ASF dual-hosted git repository.

juhan pushed a change to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-cheques.git.


    from c9d2107  Merge pull request #9 from aasaru/gradle_4.10.3
     new 8350cb6  FINCN-180 remove tenant-specific data source from configuration
     new 6813e10  FINCN-183 send our context path to eureka
     new 906131c  Merge pull request #10 from aasaru/FINCN-180

The 44 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 service/src/main/resources/application.yml | 7 ++-----
 shared.gradle                              | 2 +-
 2 files changed, 3 insertions(+), 6 deletions(-)


[fineract-cn-cheques] 26/44: Merge pull request #3 from myrle-krantz/develop

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juhan pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-cheques.git

commit 32776e221fe242336e7c3f9203b456910f12d05b
Merge: e8ac73f c2c3bbc
Author: Myrle Krantz <my...@apache.org>
AuthorDate: Mon Apr 9 18:22:38 2018 +0200

    Merge pull request #3 from myrle-krantz/develop
    
    Adding rat checks.

 api/build.gradle               | 18 ++++++++++++++++++
 api/settings.gradle            | 17 +++++++++++++++++
 build.gradle                   | 24 ++++++++++++++++++++++++
 component-test/build.gradle    | 18 ++++++++++++++++++
 component-test/settings.gradle | 17 +++++++++++++++++
 service/build.gradle           | 18 ++++++++++++++++++
 service/settings.gradle        | 17 +++++++++++++++++
 settings.gradle                | 17 +++++++++++++++++
 shared.gradle                  | 30 ++++++++++++++++++++++++++++++
 9 files changed, 176 insertions(+)


[fineract-cn-cheques] 30/44: Merge pull request #4 from myrle-krantz/develop

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juhan pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-cheques.git

commit 2556537a51b0b7deb561e656ef51845d5a9d049a
Merge: 32776e2 b3d1e21
Author: Myrle Krantz <my...@apache.org>
AuthorDate: Mon Apr 16 21:24:00 2018 +0200

    Merge pull request #4 from myrle-krantz/develop
    
    Updating package names.

 README.md                                          |  2 -
 .../fineract/cn}/cheque/api/v1/EventConstants.java |  2 +-
 .../cn}/cheque/api/v1/PermittableGroupIds.java     |  2 +-
 .../cn}/cheque/api/v1/client/ChequeManager.java    | 25 ++++----
 .../client/DependingResourceNotValidException.java |  2 +-
 .../v1/client/InvalidChequeNumberException.java    |  2 +-
 .../fineract/cn}/cheque/api/v1/domain/Action.java  |  2 +-
 .../fineract/cn}/cheque/api/v1/domain/Cheque.java  |  2 +-
 .../api/v1/domain/ChequeProcessingCommand.java     |  2 +-
 .../cheque/api/v1/domain/ChequeTransaction.java    |  5 +-
 .../cn}/cheque/api/v1/domain/IssuingCount.java     |  2 +-
 .../fineract/cn}/cheque/api/v1/domain/MICR.java    |  4 +-
 .../cn}/cheque/api/v1/domain/MICRResolution.java   |  2 +-
 .../fineract/cn}/cheque/api/v1/domain/State.java   |  2 +-
 .../fineract/cn}/cheque/AbstractChequeTest.java    | 26 ++++----
 .../apache/fineract/cn}/cheque/Fixture.java        | 11 ++--
 .../fineract/cn}/cheque/SuiteTestEnvironment.java  |  8 +--
 .../apache/fineract/cn}/cheque/TestCheques.java    | 39 ++++++------
 .../fineract/cn}/cheque/TestIssuingCheques.java    | 12 ++--
 .../apache/fineract/cn}/cheque/TestMICR.java       | 45 +++++++-------
 .../apache/fineract/cn}/cheque/TestSuite.java      |  2 +-
 .../cn}/cheque/listener/ChequeEventListener.java   | 10 ++--
 .../listener/ManagementEventMigrationListener.java | 10 ++--
 .../cn}/cheque/service/ChequeApplication.java      |  2 +-
 .../cn}/cheque/service/ChequeConfiguration.java    | 34 +++++------
 .../cn}/cheque/service/ServiceConstants.java       |  2 +-
 .../command/ApproveChequeTransactionCommand.java   |  2 +-
 .../command/CancelChequeTransactionCommand.java    |  2 +-
 .../internal/command/ChequeTransactionCommand.java |  4 +-
 .../internal/command/IssueChequesCommand.java      |  2 +-
 .../service/internal/command/MigrationCommand.java |  2 +-
 .../internal/command/handler/ChequeAggregate.java  | 69 +++++++++++-----------
 .../command/handler/ManagementAggregate.java       | 21 ++++---
 .../cheque/service/internal/format/MICRParser.java |  4 +-
 .../service/internal/mapper/ChequeMapper.java      | 13 ++--
 .../service/internal/repository/ChequeEntity.java  |  9 ++-
 .../internal/repository/ChequeRepository.java      |  2 +-
 .../internal/repository/IssuedChequeEntity.java    |  7 +--
 .../repository/IssuedChequeRepository.java         |  2 +-
 .../specification/ChequeSpecification.java         |  6 +-
 .../service/internal/service/ChequeService.java    | 14 ++---
 .../service/internal/service/MICRService.java      | 26 ++++----
 .../internal/service/helper/AccountingService.java | 35 ++++++-----
 .../internal/service/helper/CustomerService.java   | 13 ++--
 .../internal/service/helper/DepositService.java    | 23 ++++----
 .../service/helper/OrganizationService.java        | 13 ++--
 .../rest/ChequeManagementRestController.java       | 12 ++--
 .../cheque/service/rest/ChequeRestController.java  | 39 ++++++------
 .../rest/ChequeTransactionRestController.java      | 27 ++++-----
 .../cheque/service/rest/MIRCRestController.java    | 16 ++---
 .../service/internal/format/TestMICRParser.java    |  4 +-
 51 files changed, 303 insertions(+), 321 deletions(-)


[fineract-cn-cheques] 20/44: fixing executability of gradlew under linux

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juhan pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-cheques.git

commit 5f49393770fede77e38ad0fa5876175f9c467f18
Author: Myrle Krantz <my...@apache.org>
AuthorDate: Mon Feb 26 17:45:11 2018 +0100

    fixing executability of gradlew under linux
---
 gradlew | 0
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/gradlew b/gradlew
old mode 100644
new mode 100755


[fineract-cn-cheques] 10/44: Merge pull request #4 from markvanveen/develop

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juhan pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-cheques.git

commit d0a2e3e22c7575dc88b54528bd83fb2bd6b3ff3d
Merge: c131c37 960a706
Author: Mark van Veen <30...@users.noreply.github.com>
AuthorDate: Tue Aug 29 13:56:14 2017 +0200

    Merge pull request #4 from markvanveen/develop
    
    Remove NotNull from journalEntryIdentifier

 api/src/main/java/io/mifos/cheque/api/v1/domain/Cheque.java | 1 -
 component-test/build.gradle                                 | 4 ++--
 service/build.gradle                                        | 2 +-
 3 files changed, 3 insertions(+), 4 deletions(-)


[fineract-cn-cheques] 18/44: Merge pull request #8 from markusgeiss/develop

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juhan pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-cheques.git

commit 6efef67d3f49bdc258cf5265c292ced72ee21c15
Merge: d3d477a b0bb0e8
Author: Markus Geiss <ma...@kuelap.io>
AuthorDate: Tue Oct 3 11:32:03 2017 +0200

    Merge pull request #8 from markusgeiss/develop
    
    added ability to handle legacy account numbers

 api/src/main/java/io/mifos/cheque/api/v1/domain/Cheque.java |  1 -
 .../io/mifos/cheque/api/v1/domain/ChequeTransaction.java    |  1 -
 .../src/main/java/io/mifos/cheque/TestCheques.java          | 12 ++++++++----
 component-test/src/main/java/io/mifos/cheque/TestMICR.java  |  7 +++++++
 .../service/internal/command/handler/ChequeAggregate.java   |  4 ++--
 .../service/internal/service/helper/AccountingService.java  | 13 ++++++++++---
 6 files changed, 27 insertions(+), 11 deletions(-)


[fineract-cn-cheques] 16/44: Merge pull request #7 from markusgeiss/develop

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juhan pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-cheques.git

commit d3d477aef19641ad9a24d0f6ecf88e4143e52849
Merge: 97db521 af64ef2
Author: Markus Geiss <ma...@kuelap.io>
AuthorDate: Mon Sep 11 13:44:29 2017 +0200

    Merge pull request #7 from markusgeiss/develop
    
    fixed issue with processing open cheques

 .../src/main/java/io/mifos/cheque/TestCheques.java | 48 +++++++++++++++++++++-
 .../internal/command/handler/ChequeAggregate.java  |  2 +-
 2 files changed, 48 insertions(+), 2 deletions(-)


[fineract-cn-cheques] 11/44: fixed validation error when canceling a cheque

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juhan pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-cheques.git

commit 15545374f70d72b46c092e289ae66acdd9ba6995
Author: mgeiss <mg...@mifos.org>
AuthorDate: Mon Sep 4 20:08:37 2017 +0200

    fixed validation error when canceling a cheque
---
 .../cheque/service/internal/command/handler/ChequeAggregate.java      | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/service/src/main/java/io/mifos/cheque/service/internal/command/handler/ChequeAggregate.java b/service/src/main/java/io/mifos/cheque/service/internal/command/handler/ChequeAggregate.java
index 95fd298..3fa49d8 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/command/handler/ChequeAggregate.java
+++ b/service/src/main/java/io/mifos/cheque/service/internal/command/handler/ChequeAggregate.java
@@ -233,7 +233,7 @@ public class ChequeAggregate {
           journalEntryToReverse.getCreditors().stream().map(creditor -> {
             final Debtor debtor = new Debtor();
             debtor.setAccountNumber(creditor.getAccountNumber());
-            debtor.setAccountNumber(creditor.getAmount());
+            debtor.setAmount(creditor.getAmount());
             return debtor;
           }).collect(Collectors.toSet())
       );
@@ -241,7 +241,7 @@ public class ChequeAggregate {
           journalEntryToReverse.getDebtors().stream().map(debtor -> {
             final Creditor creditor = new Creditor();
             creditor.setAccountNumber(debtor.getAccountNumber());
-            creditor.setAccountNumber(debtor.getAmount());
+            creditor.setAmount(debtor.getAmount());
             return creditor;
           }).collect(Collectors.toSet())
       );


[fineract-cn-cheques] 25/44: Adding rat checks.

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juhan pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-cheques.git

commit c2c3bbc0050d229dae59ba597f80ed9f1072a8d3
Author: Myrle Krantz <my...@apache.org>
AuthorDate: Mon Apr 9 18:00:28 2018 +0200

    Adding rat checks.
---
 api/build.gradle               | 18 ++++++++++++++++++
 api/settings.gradle            | 17 +++++++++++++++++
 build.gradle                   | 24 ++++++++++++++++++++++++
 component-test/build.gradle    | 18 ++++++++++++++++++
 component-test/settings.gradle | 17 +++++++++++++++++
 service/build.gradle           | 18 ++++++++++++++++++
 service/settings.gradle        | 17 +++++++++++++++++
 settings.gradle                | 17 +++++++++++++++++
 shared.gradle                  | 30 ++++++++++++++++++++++++++++++
 9 files changed, 176 insertions(+)

diff --git a/api/build.gradle b/api/build.gradle
index 1ed9d2b..5b9924a 100644
--- a/api/build.gradle
+++ b/api/build.gradle
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 buildscript {
     repositories {
         jcenter()
@@ -10,6 +27,7 @@ buildscript {
 
 plugins {
     id "com.github.hierynomus.license" version "0.13.1"
+    id("org.nosphere.apache.rat") version "0.3.1"
 }
 
 apply from: '../shared.gradle'
diff --git a/api/settings.gradle b/api/settings.gradle
index 7c8e3dc..491f745 100644
--- a/api/settings.gradle
+++ b/api/settings.gradle
@@ -1 +1,18 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 rootProject.name = 'api'
\ No newline at end of file
diff --git a/build.gradle b/build.gradle
index b82a3b2..848847a 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 group 'org.apache.fineract.cn'
 
 task publishApiToMavenLocal {
@@ -34,3 +51,10 @@ task licenseFormat {
     dependsOn gradle.includedBuild('service').task(':licenseFormat')
     dependsOn gradle.includedBuild('component-test').task(':licenseFormat')
 }
+
+task rat {
+    group 'all'
+    dependsOn gradle.includedBuild('api').task(':rat')
+    dependsOn gradle.includedBuild('service').task(':rat')
+    dependsOn gradle.includedBuild('component-test').task(':rat')
+}
diff --git a/component-test/build.gradle b/component-test/build.gradle
index 6eaebfc..74a5e50 100644
--- a/component-test/build.gradle
+++ b/component-test/build.gradle
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 buildscript {
     ext {
         springBootVersion = '1.4.1.RELEASE'
@@ -14,6 +31,7 @@ buildscript {
 
 plugins {
     id "com.github.hierynomus.license" version "0.13.1"
+    id("org.nosphere.apache.rat") version "0.3.1"
 }
 apply from: '../shared.gradle'
 
diff --git a/component-test/settings.gradle b/component-test/settings.gradle
index 07867cb..a07a3bc 100644
--- a/component-test/settings.gradle
+++ b/component-test/settings.gradle
@@ -1 +1,18 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 rootProject.name = 'component-test'
\ No newline at end of file
diff --git a/service/build.gradle b/service/build.gradle
index d353f89..01bcfea 100644
--- a/service/build.gradle
+++ b/service/build.gradle
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 buildscript {
     ext {
         springBootVersion = '1.4.1.RELEASE'
@@ -14,6 +31,7 @@ buildscript {
 
 plugins {
     id "com.github.hierynomus.license" version "0.13.1"
+    id("org.nosphere.apache.rat") version "0.3.1"
 }
 
 apply from: '../shared.gradle'
diff --git a/service/settings.gradle b/service/settings.gradle
index 081feb4..1a4c2fd 100644
--- a/service/settings.gradle
+++ b/service/settings.gradle
@@ -1 +1,18 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 rootProject.name = 'service'
\ No newline at end of file
diff --git a/settings.gradle b/settings.gradle
index 4f44661..b49046b 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 rootProject.name = 'cheques'
 
 includeBuild 'api'
diff --git a/shared.gradle b/shared.gradle
index e63cc75..46edf30 100644
--- a/shared.gradle
+++ b/shared.gradle
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 group 'org.apache.fineract.cn.cheques'
 version '0.1.0-BUILD-SNAPSHOT'
 
@@ -70,3 +87,16 @@ license {
         yaml = 'SCRIPT_STYLE'
     }
 }
+
+rat {
+    // List of exclude directives, defaults to ['**/.gradle/**']
+    excludes = [
+            "**/.idea/**",
+            "**/.gradle/**",
+            "**/gradle/**",
+            "**/build/**",
+            "gradlew",
+            "gradlew.bat",
+            "README.md"
+    ]
+}


[fineract-cn-cheques] 38/44: FINCN-179 gradle to 4.10.3, FINCN-178 make Travis build forks, FINCN-175 remove Netty warnings, set application to unique port

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juhan pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-cheques.git

commit 1cd5b5f6a8f4f484e29fdf683c2159b902a34f6a
Author: Juhan Aasaru <Ju...@nortal.com>
AuthorDate: Mon Sep 30 20:22:40 2019 +0300

    FINCN-179 gradle to 4.10.3, FINCN-178 make Travis build forks, FINCN-175 remove Netty warnings, set application to unique port
---
 api/build.gradle                           |   5 ++++-
 build.gradle                               |   7 +++++++
 component-test/build.gradle                |   7 +++++++
 gradle/wrapper/gradle-wrapper.jar          | Bin 54212 -> 54212 bytes
 gradle/wrapper/gradle-wrapper.properties   |   4 ++--
 service/build.gradle                       |  25 +++++++++++++------------
 service/src/main/resources/application.yml |   2 +-
 shared.gradle                              |   7 +------
 travis.sh                                  |  16 ++++++++++++----
 9 files changed, 47 insertions(+), 26 deletions(-)

diff --git a/api/build.gradle b/api/build.gradle
index a11f487..ef2cc86 100644
--- a/api/build.gradle
+++ b/api/build.gradle
@@ -21,7 +21,7 @@ buildscript {
     }
 
     dependencies {
-        classpath 'io.spring.gradle:dependency-management-plugin:0.6.0.RELEASE'
+        classpath 'io.spring.gradle:dependency-management-plugin:1.0.8.RELEASE'
     }
 }
 
@@ -29,6 +29,9 @@ plugins {
     id "com.github.hierynomus.license" version "0.13.1"
     id("org.nosphere.apache.rat") version "0.3.1"
     id "com.jfrog.artifactory" version "4.9.5"
+    id "io.spring.dependency-management" version "1.0.8.RELEASE"
+    id 'maven-publish'
+    id 'java'
 }
 
 apply from: '../shared.gradle'
diff --git a/build.gradle b/build.gradle
index eeb68fb..b125a56 100644
--- a/build.gradle
+++ b/build.gradle
@@ -53,6 +53,13 @@ task prepareForTest {
     dependsOn gradle.includedBuild('component-test').task(':build')
 }
 
+task clean {
+    group 'all'
+    dependsOn gradle.includedBuild('api').task(':clean')
+    dependsOn gradle.includedBuild('service').task(':clean')
+    dependsOn gradle.includedBuild('component-test').task(':clean')
+}
+
 task licenseFormat {
     group 'all'
     dependsOn gradle.includedBuild('api').task(':licenseFormat')
diff --git a/component-test/build.gradle b/component-test/build.gradle
index 95954e4..84f5516 100644
--- a/component-test/build.gradle
+++ b/component-test/build.gradle
@@ -33,9 +33,16 @@ plugins {
     id "com.github.hierynomus.license" version "0.13.1"
     id("org.nosphere.apache.rat") version "0.3.1"
     id "com.jfrog.artifactory" version "4.9.5"
+    id "org.springframework.boot" version "1.4.3.RELEASE"
+    id 'maven-publish'
+    id 'java'
 }
 apply from: '../shared.gradle'
 
+bootRepackage {
+    enabled = false
+}
+
 dependencies {
     compile(
             [group: 'org.apache.fineract.cn.cheques', name: 'api', version: project.version],
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
index 400f155..29cec40 100644
Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 71e5108..4de3557 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Tue Jul 25 13:05:05 CEST 2017
+#Mon Sep 30 20:21:32 EEST 2019
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-bin.zip
diff --git a/service/build.gradle b/service/build.gradle
index 5320f21..5c8a2be 100644
--- a/service/build.gradle
+++ b/service/build.gradle
@@ -19,28 +19,25 @@ buildscript {
     ext {
         springBootVersion = '1.4.1.RELEASE'
     }
-
     repositories {
         jcenter()
     }
-
-    dependencies {
-        classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
-    }
 }
 
 plugins {
     id "com.github.hierynomus.license" version "0.13.1"
     id("org.nosphere.apache.rat") version "0.3.1"
     id "com.jfrog.artifactory" version "4.9.5"
+    id "org.springframework.boot" version "1.4.3.RELEASE"
+    id 'maven-publish'
+    id 'java'
+    id 'idea'
 }
 
 apply from: '../shared.gradle'
 
-apply plugin: 'spring-boot'
-
-springBoot {
-    executable = true
+bootRepackage {
+    enabled = true
     classifier = 'boot'
 }
 
@@ -62,11 +59,15 @@ dependencies {
             [group: 'org.apache.fineract.cn', name: 'postgresql', version: versions.frameworkpostgresql],
             [group: 'org.apache.fineract.cn', name: 'command', version: versions.frameworkcommand],
             [group: 'org.hibernate', name: 'hibernate-validator', version: versions.validator],
-            [group: 'org.threeten', name: 'threeten-extra', version: '1.2']
+            [group: 'org.threeten', name: 'threeten-extra', version: '1.2'],
+            [group: 'io.netty', name: 'netty-all', version: '4.1.39.Final'],
+            [group: 'io.netty', name: 'netty-transport-native-epoll', version: '4.1.39.Final']
     )
 }
 
-publishToMavenLocal.dependsOn bootRepackage
+tasks.withType(PublishToMavenLocal) { task ->
+    task.dependsOn 'bootRepackage'
+}
 
 publishing {
     publications {
@@ -78,7 +79,7 @@ publishing {
         }
         bootService(MavenPublication) {
             // "boot" jar
-            artifact("$buildDir/libs/$project.name-$version-boot.jar")
+            artifact(file("$buildDir/libs/$project.name-$project.version-${bootRepackage.classifier}.jar"))
             groupId project.group
             artifactId("$project.name-boot")
             version project.findProperty('externalVersion') ?: project.version
diff --git a/service/src/main/resources/application.yml b/service/src/main/resources/application.yml
index 3c3d6ef..d3dda73 100644
--- a/service/src/main/resources/application.yml
+++ b/service/src/main/resources/application.yml
@@ -35,7 +35,7 @@ eureka:
       defaultZone: http://localhost:8761/eureka/
 
 server:
-  port: 8081
+  port: 2030
   contextPath: /cheques/v1
 
 cassandra:
diff --git a/shared.gradle b/shared.gradle
index 93c5914..96307a2 100644
--- a/shared.gradle
+++ b/shared.gradle
@@ -34,11 +34,6 @@ ext.versions = [
         validator           : '5.3.0.Final'
 ]
 
-apply plugin: 'java'
-apply plugin: 'idea'
-apply plugin: 'maven-publish'
-apply plugin: 'io.spring.dependency-management'
-
 tasks.withType(JavaCompile) {
     sourceCompatibility = JavaVersion.VERSION_1_8
     targetCompatibility = JavaVersion.VERSION_1_8
@@ -75,7 +70,7 @@ dependencies {
 }
 
 jar {
-    from sourceSets.main.allSource
+    from sourceSets.main.java
     duplicatesStrategy = DuplicatesStrategy.EXCLUDE
 }
 
diff --git a/travis.sh b/travis.sh
index 03a75ee..d54330d 100755
--- a/travis.sh
+++ b/travis.sh
@@ -36,6 +36,12 @@ function build_pullrequest() {
   ./gradlew publishToMavenLocal rat || EXIT_STATUS=$?
 }
 
+# Builds Forked (non-apache) Repository
+function build_fork() {
+  echo -e "Building branch $TRAVIS_BRANCH of fork $TRAVIS_REPO_SLUG. Won't publish anything to Artifactory."
+  ./gradlew publishToMavenLocal rat || EXIT_STATUS=$?
+}
+
 # For other branches we need to add branch name as prefix
 function build_otherbranch() {
   echo -e "Building a snapshot out of branch [$TRAVIS_BRANCH] and publishing it with prefix '${TRAVIS_BRANCH}-SNAPSHOT'"
@@ -49,17 +55,19 @@ function build_tag() {
 
 }
 
+echo -e "TRAVIS_REPO_SLUG=$TRAVIS_REPO_SLUG"
 echo -e "TRAVIS_BRANCH=$TRAVIS_BRANCH"
 echo -e "TRAVIS_TAG=$TRAVIS_TAG"
 echo -e "TRAVIS_COMMIT=${TRAVIS_COMMIT::7}"
 echo -e "TRAVIS_PULL_REQUEST=$TRAVIS_PULL_REQUEST"
 
-# Build Logic
-if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
+if [[ $TRAVIS_REPO_SLUG != apache* ]]; then
+  build_fork
+elif [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
   build_pullrequest
-elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" != "$BUILD_SNAPSHOTS_BRANCH" ] && [ "$TRAVIS_TAG" == "" ]  ; then
+elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" != "$BUILD_SNAPSHOTS_BRANCH" ] && [ "$TRAVIS_TAG" == "" ]; then
   build_otherbranch
-elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "$BUILD_SNAPSHOTS_BRANCH" ] && [ "$TRAVIS_TAG" == "" ] ; then
+elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "$BUILD_SNAPSHOTS_BRANCH" ] && [ "$TRAVIS_TAG" == "" ]; then
   build_snapshot
 elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" != "" ]; then
   build_tag


[fineract-cn-cheques] 09/44: Remove NotNull from journalEntryIdentifier Change group references in gradle files to use mifos instead of kuelap

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juhan pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-cheques.git

commit 960a706efc6ca3eca5f1733edf992f300cb462df
Author: Mark <ma...@gmail.com>
AuthorDate: Tue Aug 29 13:55:49 2017 +0200

    Remove NotNull from journalEntryIdentifier
    Change group references in gradle files to use mifos instead of kuelap
---
 api/src/main/java/io/mifos/cheque/api/v1/domain/Cheque.java | 1 -
 component-test/build.gradle                                 | 4 ++--
 service/build.gradle                                        | 2 +-
 3 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/api/src/main/java/io/mifos/cheque/api/v1/domain/Cheque.java b/api/src/main/java/io/mifos/cheque/api/v1/domain/Cheque.java
index 2e54522..a14a968 100644
--- a/api/src/main/java/io/mifos/cheque/api/v1/domain/Cheque.java
+++ b/api/src/main/java/io/mifos/cheque/api/v1/domain/Cheque.java
@@ -36,7 +36,6 @@ public class Cheque {
   private String dateIssued;
   private Boolean openCheque;
   private State state;
-  @NotNull
   private String journalEntryIdentifier;
 
   public Cheque() {
diff --git a/component-test/build.gradle b/component-test/build.gradle
index 9e5047e..79d39f7 100644
--- a/component-test/build.gradle
+++ b/component-test/build.gradle
@@ -19,8 +19,8 @@ apply from: '../shared.gradle'
 
 dependencies {
     compile(
-            [group: 'io.kuelap.cheques', name: 'api', version: project.version],
-            [group: 'io.kuelap.cheques', name: 'service', version: project.version],
+            [group: 'io.mifos.cheques', name: 'api', version: project.version],
+            [group: 'io.mifos.cheques', name: 'service', version: project.version],
             [group: 'io.mifos.anubis', name: 'test', version: versions.frameworkanubis],
             [group: 'io.mifos.core', name: 'api', version: versions.frameworkapi],
             [group: 'io.mifos.core', name: 'test', version: versions.frameworktest],
diff --git a/service/build.gradle b/service/build.gradle
index 234e970..3ef885f 100644
--- a/service/build.gradle
+++ b/service/build.gradle
@@ -30,7 +30,7 @@ dependencies {
             [group: 'org.springframework.cloud', name: 'spring-cloud-starter-config'],
             [group: 'org.springframework.cloud', name: 'spring-cloud-starter-eureka'],
             [group: 'org.springframework.boot', name: 'spring-boot-starter-jetty'],
-            [group: 'io.kuelap.cheques', name: 'api', version: project.version],
+            [group: 'io.mifos.cheques', name: 'api', version: project.version],
             [group: 'io.mifos.anubis', name: 'library', version: versions.frameworkanubis],
             [group: 'io.mifos.accounting', name: 'api', version: versions.frameworkaccounting],
             [group: 'io.mifos.deposit-account-management', name: 'api', version: versions.frameworkdeposit],


[fineract-cn-cheques] 36/44: FINCN-170 create multi-stage Docker build (#8)

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juhan pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-cheques.git

commit 82f332b72dc403da8b83b78bd49a1cec4b8f822a
Author: aasaru <aa...@gmail.com>
AuthorDate: Tue Aug 20 16:33:30 2019 +0300

    FINCN-170 create multi-stage Docker build (#8)
    
    * FINCN-170 create multi-stage Docker build
    
    * FINCN-170 rat ignore .dockerignore
    
    * FINCN-170 boot jar path fix
---
 .dockerignore |  7 +++++++
 Dockerfile    | 37 +++++++++++++++++++++++++++++++++++++
 shared.gradle |  3 ++-
 3 files changed, 46 insertions(+), 1 deletion(-)

diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 0000000..c2a2c76
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1,7 @@
+LICENSE
+README.md
+HEADER
+NOTICE.txt
+.git/
+.gradle/
+.gitignore
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..774d062
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,37 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+FROM openjdk:8-jdk-alpine AS builder
+RUN mkdir builddir
+COPY . builddir
+WORKDIR builddir
+RUN ./gradlew publishToMavenLocal
+
+FROM openjdk:8-jdk-alpine AS runner
+
+ARG cheques_port=2030
+
+ENV server.max-http-header-size=16384 \
+    cassandra.clusterName="Test Cluster" \
+    server.port=$cheques_port \
+    system.initialclientid=service-runner
+
+WORKDIR /tmp
+COPY  --from=builder /builddir/service/build/libs/service-0.1.0-BUILD-SNAPSHOT-boot.jar ./cheques-service-boot.jar
+
+CMD ["java", "-jar", "cheques-service-boot.jar"]
diff --git a/shared.gradle b/shared.gradle
index f069304..63d7b45 100644
--- a/shared.gradle
+++ b/shared.gradle
@@ -114,7 +114,8 @@ rat {
             "**/build/**",
             "gradlew",
             "gradlew.bat",
-            "README.md"
+            "README.md",
+            "**/.dockerignore/**"
     ]
     plainOutput = true
 }


[fineract-cn-cheques] 24/44: Merge pull request #2 from Izakey/develop

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juhan pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-cheques.git

commit e8ac73f337d3bf4e1e5038382c6cc36399e81288
Merge: de02aaa dd42981
Author: Myrle Krantz <my...@apache.org>
AuthorDate: Fri Mar 16 11:55:52 2018 +0100

    Merge pull request #2 from Izakey/develop
    
    Updated copyright information in cheques

 HEADER                                             | 25 +++++++++++--------
 NOTICE.txt                                         |  5 ++++
 README.md                                          |  4 +--
 .../io/mifos/cheque/api/v1/EventConstants.java     | 25 +++++++++++--------
 .../mifos/cheque/api/v1/PermittableGroupIds.java   | 25 +++++++++++--------
 .../mifos/cheque/api/v1/client/ChequeManager.java  | 25 +++++++++++--------
 .../client/DependingResourceNotValidException.java | 25 +++++++++++--------
 .../v1/client/InvalidChequeNumberException.java    | 25 +++++++++++--------
 .../java/io/mifos/cheque/api/v1/domain/Action.java | 25 +++++++++++--------
 .../java/io/mifos/cheque/api/v1/domain/Cheque.java | 25 +++++++++++--------
 .../api/v1/domain/ChequeProcessingCommand.java     | 25 +++++++++++--------
 .../cheque/api/v1/domain/ChequeTransaction.java    | 25 +++++++++++--------
 .../mifos/cheque/api/v1/domain/IssuingCount.java   | 25 +++++++++++--------
 .../java/io/mifos/cheque/api/v1/domain/MICR.java   | 25 +++++++++++--------
 .../mifos/cheque/api/v1/domain/MICRResolution.java | 25 +++++++++++--------
 .../java/io/mifos/cheque/api/v1/domain/State.java  | 25 +++++++++++--------
 .../java/io/mifos/cheque/AbstractChequeTest.java   | 25 +++++++++++--------
 .../src/main/java/io/mifos/cheque/Fixture.java     | 25 +++++++++++--------
 .../java/io/mifos/cheque/SuiteTestEnvironment.java | 25 +++++++++++--------
 .../src/main/java/io/mifos/cheque/TestCheques.java | 25 +++++++++++--------
 .../java/io/mifos/cheque/TestIssuingCheques.java   | 25 +++++++++++--------
 .../src/main/java/io/mifos/cheque/TestMICR.java    | 25 +++++++++++--------
 .../src/main/java/io/mifos/cheque/TestSuite.java   | 25 +++++++++++--------
 .../mifos/cheque/listener/ChequeEventListener.java | 25 +++++++++++--------
 .../listener/ManagementEventMigrationListener.java | 25 +++++++++++--------
 component-test/src/main/resources/logback-test.xml | 25 +++++++++++--------
 .../io/mifos/cheque/service/ChequeApplication.java | 25 +++++++++++--------
 .../mifos/cheque/service/ChequeConfiguration.java  | 25 +++++++++++--------
 .../io/mifos/cheque/service/ServiceConstants.java  | 25 +++++++++++--------
 .../command/ApproveChequeTransactionCommand.java   | 25 +++++++++++--------
 .../command/CancelChequeTransactionCommand.java    | 25 +++++++++++--------
 .../internal/command/ChequeTransactionCommand.java | 25 +++++++++++--------
 .../internal/command/IssueChequesCommand.java      | 25 +++++++++++--------
 .../service/internal/command/MigrationCommand.java | 25 +++++++++++--------
 .../internal/command/handler/ChequeAggregate.java  | 25 +++++++++++--------
 .../command/handler/ManagementAggregate.java       | 25 +++++++++++--------
 .../cheque/service/internal/format/MICRParser.java | 25 +++++++++++--------
 .../service/internal/mapper/ChequeMapper.java      | 25 +++++++++++--------
 .../service/internal/repository/ChequeEntity.java  | 25 +++++++++++--------
 .../internal/repository/ChequeRepository.java      | 25 +++++++++++--------
 .../internal/repository/IssuedChequeEntity.java    | 25 +++++++++++--------
 .../repository/IssuedChequeRepository.java         | 25 +++++++++++--------
 .../specification/ChequeSpecification.java         | 25 +++++++++++--------
 .../service/internal/service/ChequeService.java    | 25 +++++++++++--------
 .../service/internal/service/MICRService.java      | 25 +++++++++++--------
 .../internal/service/helper/AccountingService.java | 25 +++++++++++--------
 .../internal/service/helper/CustomerService.java   | 25 +++++++++++--------
 .../internal/service/helper/DepositService.java    | 25 +++++++++++--------
 .../service/helper/OrganizationService.java        | 25 +++++++++++--------
 .../rest/ChequeManagementRestController.java       | 25 +++++++++++--------
 .../cheque/service/rest/ChequeRestController.java  | 25 +++++++++++--------
 .../rest/ChequeTransactionRestController.java      | 25 +++++++++++--------
 .../cheque/service/rest/MIRCRestController.java    | 25 +++++++++++--------
 service/src/main/resources/application.yml         | 25 +++++++++++--------
 service/src/main/resources/bootstrap.yml           | 25 +++++++++++--------
 .../db/migrations/mariadb/V1__initial_setup.sql    | 25 +++++++++++--------
 service/src/main/resources/logback.xml             | 29 ++++++++++++----------
 .../service/internal/format/TestMICRParser.java    | 25 +++++++++++--------
 shared.gradle                                      |  2 --
 59 files changed, 793 insertions(+), 622 deletions(-)


[fineract-cn-cheques] 37/44: Merge pull request #6 from Izakey/FINCN-125

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juhan pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-cheques.git

commit f3ff12d89c960ec9ea0c5e5a40230f526274b556
Merge: 82f332b 81b31cc
Author: Isaac Kamga <ik...@apache.org>
AuthorDate: Mon Sep 2 23:07:38 2019 +0100

    Merge pull request #6 from Izakey/FINCN-125
    
    Migrate cheques service from MariaDB to PostgreSQL

 NOTICE.txt                                         |  2 +-
 .../fineract/cn/cheque/AbstractChequeTest.java     |  2 +-
 .../fineract/cn/cheque/SuiteTestEnvironment.java   |  6 ++---
 service/build.gradle                               |  2 +-
 .../cn/cheque/service/ChequeConfiguration.java     |  4 +--
 .../command/handler/ManagementAggregate.java       |  2 +-
 .../service/internal/repository/ChequeEntity.java  |  2 +-
 .../internal/repository/IssuedChequeEntity.java    |  2 +-
 service/src/main/resources/application.yml         | 15 +++++++----
 .../{mariadb => postgresql}/V1__initial_setup.sql  | 10 +++-----
 shared.gradle                                      | 29 +++++++++++-----------
 11 files changed, 40 insertions(+), 36 deletions(-)



[fineract-cn-cheques] 43/44: FINCN-183 send our context path to eureka

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juhan pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-cheques.git

commit 6813e105f8f7e80221744732149e4c151f88f2e5
Author: Juhan Aasaru <Ju...@nortal.com>
AuthorDate: Thu Oct 17 10:26:56 2019 +0300

    FINCN-183 send our context path to eureka
---
 service/src/main/resources/application.yml | 2 ++
 shared.gradle                              | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/service/src/main/resources/application.yml b/service/src/main/resources/application.yml
index 42cfe64..61dde9c 100644
--- a/service/src/main/resources/application.yml
+++ b/service/src/main/resources/application.yml
@@ -28,6 +28,8 @@ eureka:
   client:
     serviceUrl:
       defaultZone: http://localhost:8761/eureka/
+  instance:
+    homePageUrl: "http://${eureka.hostname}:2030/cheques/v1/"
 
 server:
   port: 2030
diff --git a/shared.gradle b/shared.gradle
index 0285416..612a334 100644
--- a/shared.gradle
+++ b/shared.gradle
@@ -88,7 +88,7 @@ artifactory {
         }
     }
 }
-artifactoryPublish.dependsOn('clean','publishToMavenLocal')
+artifactoryPublish.dependsOn('publishToMavenLocal')
 
 license {
     header rootProject.file('../HEADER')


[fineract-cn-cheques] 04/44: Merge pull request #1 from markusgeiss/develop

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juhan pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-cheques.git

commit 231670678c8e909d853a0d1896a79ab2d2d691a1
Merge: 6828d67 bad4be7
Author: Markus Geiss <ma...@kuelap.io>
AuthorDate: Tue Aug 22 12:02:59 2017 +0200

    Merge pull request #1 from markusgeiss/develop
    
    added MICR resolution for on us cheques

 .../mifos/cheque/api/v1/client/ChequeManager.java  |  19 ++
 .../client/DependingResourceNotValidException.java |  19 ++
 .../v1/client/InvalidChequeNumberException.java    |  19 ++
 .../api/v1/{client => domain}/IssuingCount.java    |   2 +-
 .../mifos/cheque/api/v1/domain/MICRResolution.java |  42 ++++
 .../src/main/java/io/mifos/cheque/TestCheques.java |   3 +-
 .../java/io/mifos/cheque/TestIssuingCheques.java   |   2 +-
 .../src/main/java/io/mifos/cheque/TestMICR.java    | 271 +++++++++++++++++++++
 service/build.gradle                               |   1 +
 .../mifos/cheque/service/ChequeConfiguration.java  |   4 +-
 .../service/internal/service/MICRService.java      |  91 +++++++
 .../internal/service/helper/AccountingService.java |  25 +-
 ...ganizationService.java => CustomerService.java} |  26 +-
 .../internal/service/helper/DepositService.java    |  10 +
 .../service/helper/OrganizationService.java        |  12 +-
 .../cheque/service/rest/ChequeRestController.java  |   2 +-
 .../cheque/service/rest/MIRCRestController.java    |  58 +++++
 shared.gradle                                      |   1 +
 18 files changed, 579 insertions(+), 28 deletions(-)


[fineract-cn-cheques] 32/44: Merge pull request #5 from aasaru/artifactory

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juhan pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-cheques.git

commit 5659d21bcf0a41922ce0ce4c1e2f90b2755e6d19
Merge: 2556537 0d92ba4
Author: Awasum Yannick <aw...@apache.org>
AuthorDate: Tue Apr 30 09:15:35 2019 +0100

    Merge pull request #5 from aasaru/artifactory
    
    FINCN-148 build with travis-ci.com and upload artifacts to Artifactory

 .travis.yml                 | 30 +++++++++++++++++++
 README.md                   |  2 +-
 api/build.gradle            |  3 +-
 build.gradle                |  8 +++++
 component-test/build.gradle |  2 ++
 service/build.gradle        |  5 ++--
 shared.gradle               | 17 +++++++++++
 travis.sh                   | 71 +++++++++++++++++++++++++++++++++++++++++++++
 8 files changed, 134 insertions(+), 4 deletions(-)


[fineract-cn-cheques] 14/44: Merge pull request #6 from markusgeiss/develop

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juhan pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-cheques.git

commit 97db521f93071acfb750a020125046e5b99a2ee3
Merge: 2e269c5 9a4c970
Author: Markus Geiss <ma...@kuelap.io>
AuthorDate: Thu Sep 7 11:27:21 2017 +0200

    Merge pull request #6 from markusgeiss/develop
    
    added cheques receivable account handling

 .../mifos/cheque/api/v1/domain/ChequeTransaction.java  | 13 ++++++++++++-
 .../src/main/java/io/mifos/cheque/TestCheques.java     |  3 +++
 .../src/main/java/io/mifos/cheque/TestMICR.java        |  1 +
 .../internal/command/ChequeTransactionCommand.java     | 18 +++++++++++++-----
 .../internal/command/handler/ChequeAggregate.java      |  6 ++----
 .../service/rest/ChequeTransactionRestController.java  |  2 +-
 6 files changed, 32 insertions(+), 11 deletions(-)


[fineract-cn-cheques] 02/44: ignore proportional charges while issuing cheques

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juhan pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-cheques.git

commit d574660536e02aba76dced6399109d6eda7fb104
Author: mgeiss <mg...@mifos.org>
AuthorDate: Mon Aug 21 16:39:03 2017 +0200

    ignore proportional charges while issuing cheques
---
 .../service/internal/service/helper/AccountingService.java       | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/service/src/main/java/io/mifos/cheque/service/internal/service/helper/AccountingService.java b/service/src/main/java/io/mifos/cheque/service/internal/service/helper/AccountingService.java
index 238e3c4..95ef589 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/service/helper/AccountingService.java
+++ b/service/src/main/java/io/mifos/cheque/service/internal/service/helper/AccountingService.java
@@ -54,7 +54,14 @@ public class AccountingService {
 
   public void bookCharges(final String sourceAccount, final List<Charge> charges) {
 
-    final Double totalCharges = charges.stream().mapToDouble(Charge::getAmount).sum();
+    final Double totalCharges = charges.stream().mapToDouble(charge -> {
+      if (charge.getProportional()) {
+        this.logger.info("Charges for issuing cheques must be fixed.");
+        return 0.00D;
+      } else {
+        return charge.getAmount();
+      }
+    }).sum();
     if (totalCharges == 0.00D) {
       return;
     }


[fineract-cn-cheques] 22/44: Updated copyright information in cheques

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juhan pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-cheques.git

commit ba7c22f2bb10ed0e7774496740153b8d22aec7ad
Author: Isaac Kamga <u2...@gmail.com>
AuthorDate: Fri Mar 2 21:56:11 2018 +0100

    Updated copyright information in cheques
---
 HEADER                                             | 25 +++++++++++--------
 NOTICE.txt                                         |  5 ++++
 README.md                                          |  4 +--
 .../io/mifos/cheque/api/v1/EventConstants.java     | 25 +++++++++++--------
 .../mifos/cheque/api/v1/PermittableGroupIds.java   | 25 +++++++++++--------
 .../mifos/cheque/api/v1/client/ChequeManager.java  | 25 +++++++++++--------
 .../client/DependingResourceNotValidException.java | 25 +++++++++++--------
 .../v1/client/InvalidChequeNumberException.java    | 25 +++++++++++--------
 .../java/io/mifos/cheque/api/v1/domain/Action.java | 25 +++++++++++--------
 .../java/io/mifos/cheque/api/v1/domain/Cheque.java | 25 +++++++++++--------
 .../api/v1/domain/ChequeProcessingCommand.java     | 25 +++++++++++--------
 .../cheque/api/v1/domain/ChequeTransaction.java    | 25 +++++++++++--------
 .../mifos/cheque/api/v1/domain/IssuingCount.java   | 25 +++++++++++--------
 .../java/io/mifos/cheque/api/v1/domain/MICR.java   | 25 +++++++++++--------
 .../mifos/cheque/api/v1/domain/MICRResolution.java | 25 +++++++++++--------
 .../java/io/mifos/cheque/api/v1/domain/State.java  | 25 +++++++++++--------
 .../java/io/mifos/cheque/AbstractChequeTest.java   | 25 +++++++++++--------
 .../src/main/java/io/mifos/cheque/Fixture.java     | 25 +++++++++++--------
 .../java/io/mifos/cheque/SuiteTestEnvironment.java | 25 +++++++++++--------
 .../src/main/java/io/mifos/cheque/TestCheques.java | 25 +++++++++++--------
 .../java/io/mifos/cheque/TestIssuingCheques.java   | 25 +++++++++++--------
 .../src/main/java/io/mifos/cheque/TestMICR.java    | 25 +++++++++++--------
 .../src/main/java/io/mifos/cheque/TestSuite.java   | 25 +++++++++++--------
 .../mifos/cheque/listener/ChequeEventListener.java | 25 +++++++++++--------
 .../listener/ManagementEventMigrationListener.java | 25 +++++++++++--------
 component-test/src/main/resources/logback-test.xml | 25 +++++++++++--------
 .../io/mifos/cheque/service/ChequeApplication.java | 25 +++++++++++--------
 .../mifos/cheque/service/ChequeConfiguration.java  | 25 +++++++++++--------
 .../io/mifos/cheque/service/ServiceConstants.java  | 25 +++++++++++--------
 .../command/ApproveChequeTransactionCommand.java   | 25 +++++++++++--------
 .../command/CancelChequeTransactionCommand.java    | 25 +++++++++++--------
 .../internal/command/ChequeTransactionCommand.java | 25 +++++++++++--------
 .../internal/command/IssueChequesCommand.java      | 25 +++++++++++--------
 .../service/internal/command/MigrationCommand.java | 25 +++++++++++--------
 .../internal/command/handler/ChequeAggregate.java  | 25 +++++++++++--------
 .../command/handler/ManagementAggregate.java       | 25 +++++++++++--------
 .../cheque/service/internal/format/MICRParser.java | 25 +++++++++++--------
 .../service/internal/mapper/ChequeMapper.java      | 25 +++++++++++--------
 .../service/internal/repository/ChequeEntity.java  | 25 +++++++++++--------
 .../internal/repository/ChequeRepository.java      | 25 +++++++++++--------
 .../internal/repository/IssuedChequeEntity.java    | 25 +++++++++++--------
 .../repository/IssuedChequeRepository.java         | 25 +++++++++++--------
 .../specification/ChequeSpecification.java         | 25 +++++++++++--------
 .../service/internal/service/ChequeService.java    | 25 +++++++++++--------
 .../service/internal/service/MICRService.java      | 25 +++++++++++--------
 .../internal/service/helper/AccountingService.java | 25 +++++++++++--------
 .../internal/service/helper/CustomerService.java   | 25 +++++++++++--------
 .../internal/service/helper/DepositService.java    | 25 +++++++++++--------
 .../service/helper/OrganizationService.java        | 25 +++++++++++--------
 .../rest/ChequeManagementRestController.java       | 25 +++++++++++--------
 .../cheque/service/rest/ChequeRestController.java  | 25 +++++++++++--------
 .../rest/ChequeTransactionRestController.java      | 25 +++++++++++--------
 .../cheque/service/rest/MIRCRestController.java    | 25 +++++++++++--------
 service/src/main/resources/application.yml         | 25 +++++++++++--------
 service/src/main/resources/bootstrap.yml           | 25 +++++++++++--------
 .../db/migrations/mariadb/V1__initial_setup.sql    | 25 +++++++++++--------
 service/src/main/resources/logback.xml             | 29 ++++++++++++----------
 .../service/internal/format/TestMICRParser.java    | 25 +++++++++++--------
 shared.gradle                                      |  2 +-
 59 files changed, 794 insertions(+), 621 deletions(-)

diff --git a/HEADER b/HEADER
index 88f1afc..90705e0 100644
--- a/HEADER
+++ b/HEADER
@@ -1,13 +1,16 @@
-Copyright ${year} ${company}.
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
 
-All Rights Reserved.
+  http://www.apache.org/licenses/LICENSE-2.0
 
-NOTICE:  All information contained herein is, and remains
-the property of ${company} and its suppliers, if any.
-The intellectual and technical concepts contained herein
-are proprietary to ${company} and its suppliers and may
-be covered by U.S. and Foreign Patents, patents in process,
-and are protected by trade secret or copyright law.
-Dissemination of this information or reproduction of this material
-is strictly forbidden unless prior written permission is obtained
-${company}.
\ No newline at end of file
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
\ No newline at end of file
diff --git a/NOTICE.txt b/NOTICE.txt
new file mode 100644
index 0000000..de5aeca
--- /dev/null
+++ b/NOTICE.txt
@@ -0,0 +1,5 @@
+Apache Fineract CN Cheques
+Copyright [2017-2018] The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
\ No newline at end of file
diff --git a/README.md b/README.md
index 09d4485..55da002 100644
--- a/README.md
+++ b/README.md
@@ -1,11 +1,11 @@
-# Mifos I/O Cheques Management
+# Apache Fineract CN Cheques Management
 
 [![Join the chat at https://gitter.im/mifos-initiative/mifos.io](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/mifos-initiative/mifos.io?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
 
 This project provides services to issue, validate cheques and execute transactions on them.
 
 ## Abstract
-Mifos I/O is an application framework for digital financial services, a system to support nationwide and cross-national financial transactions and help to level and speed the creation of an inclusive, interconnected digital economy for every nation in the world.
+Apache Fineract CN is an application framework for digital financial services, a system to support nationwide and cross-national financial transactions and help to level and speed the creation of an inclusive, interconnected digital economy for every nation in the world.
 
 ## Versioning
 The version numbers follow the [Semantic Versioning](http://semver.org/) scheme.
diff --git a/api/src/main/java/io/mifos/cheque/api/v1/EventConstants.java b/api/src/main/java/io/mifos/cheque/api/v1/EventConstants.java
index 74573b5..d769670 100644
--- a/api/src/main/java/io/mifos/cheque/api/v1/EventConstants.java
+++ b/api/src/main/java/io/mifos/cheque/api/v1/EventConstants.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 Kuelap, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * All Rights Reserved.
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * NOTICE:  All information contained herein is, and remains
- * the property of Kuelap, Inc and its suppliers, if any.
- * The intellectual and technical concepts contained herein
- * are proprietary to Kuelap, Inc and its suppliers and may
- * be covered by U.S. and Foreign Patents, patents in process,
- * and are protected by trade secret or copyright law.
- * Dissemination of this information or reproduction of this material
- * is strictly forbidden unless prior written permission is obtained
- * Kuelap, Inc.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.cheque.api.v1;
 
diff --git a/api/src/main/java/io/mifos/cheque/api/v1/PermittableGroupIds.java b/api/src/main/java/io/mifos/cheque/api/v1/PermittableGroupIds.java
index 5c9c599..f2ea3cc 100644
--- a/api/src/main/java/io/mifos/cheque/api/v1/PermittableGroupIds.java
+++ b/api/src/main/java/io/mifos/cheque/api/v1/PermittableGroupIds.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 Kuelap, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * All Rights Reserved.
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * NOTICE:  All information contained herein is, and remains
- * the property of Kuelap, Inc and its suppliers, if any.
- * The intellectual and technical concepts contained herein
- * are proprietary to Kuelap, Inc and its suppliers and may
- * be covered by U.S. and Foreign Patents, patents in process,
- * and are protected by trade secret or copyright law.
- * Dissemination of this information or reproduction of this material
- * is strictly forbidden unless prior written permission is obtained
- * Kuelap, Inc.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.cheque.api.v1;
 
diff --git a/api/src/main/java/io/mifos/cheque/api/v1/client/ChequeManager.java b/api/src/main/java/io/mifos/cheque/api/v1/client/ChequeManager.java
index 466d20d..0b8e33a 100644
--- a/api/src/main/java/io/mifos/cheque/api/v1/client/ChequeManager.java
+++ b/api/src/main/java/io/mifos/cheque/api/v1/client/ChequeManager.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 Kuelap, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * All Rights Reserved.
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * NOTICE:  All information contained herein is, and remains
- * the property of Kuelap, Inc and its suppliers, if any.
- * The intellectual and technical concepts contained herein
- * are proprietary to Kuelap, Inc and its suppliers and may
- * be covered by U.S. and Foreign Patents, patents in process,
- * and are protected by trade secret or copyright law.
- * Dissemination of this information or reproduction of this material
- * is strictly forbidden unless prior written permission is obtained
- * Kuelap, Inc.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.cheque.api.v1.client;
 
diff --git a/api/src/main/java/io/mifos/cheque/api/v1/client/DependingResourceNotValidException.java b/api/src/main/java/io/mifos/cheque/api/v1/client/DependingResourceNotValidException.java
index 0c5d945..1d0dd3b 100644
--- a/api/src/main/java/io/mifos/cheque/api/v1/client/DependingResourceNotValidException.java
+++ b/api/src/main/java/io/mifos/cheque/api/v1/client/DependingResourceNotValidException.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 Kuelap, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * All Rights Reserved.
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * NOTICE:  All information contained herein is, and remains
- * the property of Kuelap, Inc and its suppliers, if any.
- * The intellectual and technical concepts contained herein
- * are proprietary to Kuelap, Inc and its suppliers and may
- * be covered by U.S. and Foreign Patents, patents in process,
- * and are protected by trade secret or copyright law.
- * Dissemination of this information or reproduction of this material
- * is strictly forbidden unless prior written permission is obtained
- * Kuelap, Inc.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.cheque.api.v1.client;
 
diff --git a/api/src/main/java/io/mifos/cheque/api/v1/client/InvalidChequeNumberException.java b/api/src/main/java/io/mifos/cheque/api/v1/client/InvalidChequeNumberException.java
index 29084cf..7a5fca8 100644
--- a/api/src/main/java/io/mifos/cheque/api/v1/client/InvalidChequeNumberException.java
+++ b/api/src/main/java/io/mifos/cheque/api/v1/client/InvalidChequeNumberException.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 Kuelap, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * All Rights Reserved.
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * NOTICE:  All information contained herein is, and remains
- * the property of Kuelap, Inc and its suppliers, if any.
- * The intellectual and technical concepts contained herein
- * are proprietary to Kuelap, Inc and its suppliers and may
- * be covered by U.S. and Foreign Patents, patents in process,
- * and are protected by trade secret or copyright law.
- * Dissemination of this information or reproduction of this material
- * is strictly forbidden unless prior written permission is obtained
- * Kuelap, Inc.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.cheque.api.v1.client;
 
diff --git a/api/src/main/java/io/mifos/cheque/api/v1/domain/Action.java b/api/src/main/java/io/mifos/cheque/api/v1/domain/Action.java
index 0c73f44..027898c 100644
--- a/api/src/main/java/io/mifos/cheque/api/v1/domain/Action.java
+++ b/api/src/main/java/io/mifos/cheque/api/v1/domain/Action.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 Kuelap, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * All Rights Reserved.
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * NOTICE:  All information contained herein is, and remains
- * the property of Kuelap, Inc and its suppliers, if any.
- * The intellectual and technical concepts contained herein
- * are proprietary to Kuelap, Inc and its suppliers and may
- * be covered by U.S. and Foreign Patents, patents in process,
- * and are protected by trade secret or copyright law.
- * Dissemination of this information or reproduction of this material
- * is strictly forbidden unless prior written permission is obtained
- * Kuelap, Inc.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.cheque.api.v1.domain;
 
diff --git a/api/src/main/java/io/mifos/cheque/api/v1/domain/Cheque.java b/api/src/main/java/io/mifos/cheque/api/v1/domain/Cheque.java
index e50172b..a162157 100644
--- a/api/src/main/java/io/mifos/cheque/api/v1/domain/Cheque.java
+++ b/api/src/main/java/io/mifos/cheque/api/v1/domain/Cheque.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 Kuelap, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * All Rights Reserved.
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * NOTICE:  All information contained herein is, and remains
- * the property of Kuelap, Inc and its suppliers, if any.
- * The intellectual and technical concepts contained herein
- * are proprietary to Kuelap, Inc and its suppliers and may
- * be covered by U.S. and Foreign Patents, patents in process,
- * and are protected by trade secret or copyright law.
- * Dissemination of this information or reproduction of this material
- * is strictly forbidden unless prior written permission is obtained
- * Kuelap, Inc.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.cheque.api.v1.domain;
 
diff --git a/api/src/main/java/io/mifos/cheque/api/v1/domain/ChequeProcessingCommand.java b/api/src/main/java/io/mifos/cheque/api/v1/domain/ChequeProcessingCommand.java
index 95d57fe..fe3490c 100644
--- a/api/src/main/java/io/mifos/cheque/api/v1/domain/ChequeProcessingCommand.java
+++ b/api/src/main/java/io/mifos/cheque/api/v1/domain/ChequeProcessingCommand.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 Kuelap, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * All Rights Reserved.
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * NOTICE:  All information contained herein is, and remains
- * the property of Kuelap, Inc and its suppliers, if any.
- * The intellectual and technical concepts contained herein
- * are proprietary to Kuelap, Inc and its suppliers and may
- * be covered by U.S. and Foreign Patents, patents in process,
- * and are protected by trade secret or copyright law.
- * Dissemination of this information or reproduction of this material
- * is strictly forbidden unless prior written permission is obtained
- * Kuelap, Inc.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.cheque.api.v1.domain;
 
diff --git a/api/src/main/java/io/mifos/cheque/api/v1/domain/ChequeTransaction.java b/api/src/main/java/io/mifos/cheque/api/v1/domain/ChequeTransaction.java
index 1129613..ae396d9 100644
--- a/api/src/main/java/io/mifos/cheque/api/v1/domain/ChequeTransaction.java
+++ b/api/src/main/java/io/mifos/cheque/api/v1/domain/ChequeTransaction.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 Kuelap, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * All Rights Reserved.
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * NOTICE:  All information contained herein is, and remains
- * the property of Kuelap, Inc and its suppliers, if any.
- * The intellectual and technical concepts contained herein
- * are proprietary to Kuelap, Inc and its suppliers and may
- * be covered by U.S. and Foreign Patents, patents in process,
- * and are protected by trade secret or copyright law.
- * Dissemination of this information or reproduction of this material
- * is strictly forbidden unless prior written permission is obtained
- * Kuelap, Inc.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.cheque.api.v1.domain;
 
diff --git a/api/src/main/java/io/mifos/cheque/api/v1/domain/IssuingCount.java b/api/src/main/java/io/mifos/cheque/api/v1/domain/IssuingCount.java
index 70a4f53..4a46ff3 100644
--- a/api/src/main/java/io/mifos/cheque/api/v1/domain/IssuingCount.java
+++ b/api/src/main/java/io/mifos/cheque/api/v1/domain/IssuingCount.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 Kuelap, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * All Rights Reserved.
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * NOTICE:  All information contained herein is, and remains
- * the property of Kuelap, Inc and its suppliers, if any.
- * The intellectual and technical concepts contained herein
- * are proprietary to Kuelap, Inc and its suppliers and may
- * be covered by U.S. and Foreign Patents, patents in process,
- * and are protected by trade secret or copyright law.
- * Dissemination of this information or reproduction of this material
- * is strictly forbidden unless prior written permission is obtained
- * Kuelap, Inc.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.cheque.api.v1.domain;
 
diff --git a/api/src/main/java/io/mifos/cheque/api/v1/domain/MICR.java b/api/src/main/java/io/mifos/cheque/api/v1/domain/MICR.java
index 05a1a32..d46e95f 100644
--- a/api/src/main/java/io/mifos/cheque/api/v1/domain/MICR.java
+++ b/api/src/main/java/io/mifos/cheque/api/v1/domain/MICR.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 Kuelap, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * All Rights Reserved.
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * NOTICE:  All information contained herein is, and remains
- * the property of Kuelap, Inc and its suppliers, if any.
- * The intellectual and technical concepts contained herein
- * are proprietary to Kuelap, Inc and its suppliers and may
- * be covered by U.S. and Foreign Patents, patents in process,
- * and are protected by trade secret or copyright law.
- * Dissemination of this information or reproduction of this material
- * is strictly forbidden unless prior written permission is obtained
- * Kuelap, Inc.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.cheque.api.v1.domain;
 
diff --git a/api/src/main/java/io/mifos/cheque/api/v1/domain/MICRResolution.java b/api/src/main/java/io/mifos/cheque/api/v1/domain/MICRResolution.java
index 21c2aae..3044183 100644
--- a/api/src/main/java/io/mifos/cheque/api/v1/domain/MICRResolution.java
+++ b/api/src/main/java/io/mifos/cheque/api/v1/domain/MICRResolution.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 Kuelap, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * All Rights Reserved.
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * NOTICE:  All information contained herein is, and remains
- * the property of Kuelap, Inc and its suppliers, if any.
- * The intellectual and technical concepts contained herein
- * are proprietary to Kuelap, Inc and its suppliers and may
- * be covered by U.S. and Foreign Patents, patents in process,
- * and are protected by trade secret or copyright law.
- * Dissemination of this information or reproduction of this material
- * is strictly forbidden unless prior written permission is obtained
- * Kuelap, Inc.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.cheque.api.v1.domain;
 
diff --git a/api/src/main/java/io/mifos/cheque/api/v1/domain/State.java b/api/src/main/java/io/mifos/cheque/api/v1/domain/State.java
index 449344f..ac73548 100644
--- a/api/src/main/java/io/mifos/cheque/api/v1/domain/State.java
+++ b/api/src/main/java/io/mifos/cheque/api/v1/domain/State.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 Kuelap, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * All Rights Reserved.
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * NOTICE:  All information contained herein is, and remains
- * the property of Kuelap, Inc and its suppliers, if any.
- * The intellectual and technical concepts contained herein
- * are proprietary to Kuelap, Inc and its suppliers and may
- * be covered by U.S. and Foreign Patents, patents in process,
- * and are protected by trade secret or copyright law.
- * Dissemination of this information or reproduction of this material
- * is strictly forbidden unless prior written permission is obtained
- * Kuelap, Inc.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.cheque.api.v1.domain;
 
diff --git a/component-test/src/main/java/io/mifos/cheque/AbstractChequeTest.java b/component-test/src/main/java/io/mifos/cheque/AbstractChequeTest.java
index 177df2c..7370b72 100644
--- a/component-test/src/main/java/io/mifos/cheque/AbstractChequeTest.java
+++ b/component-test/src/main/java/io/mifos/cheque/AbstractChequeTest.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 Kuelap, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * All Rights Reserved.
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * NOTICE:  All information contained herein is, and remains
- * the property of Kuelap, Inc and its suppliers, if any.
- * The intellectual and technical concepts contained herein
- * are proprietary to Kuelap, Inc and its suppliers and may
- * be covered by U.S. and Foreign Patents, patents in process,
- * and are protected by trade secret or copyright law.
- * Dissemination of this information or reproduction of this material
- * is strictly forbidden unless prior written permission is obtained
- * Kuelap, Inc.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.cheque;
 
diff --git a/component-test/src/main/java/io/mifos/cheque/Fixture.java b/component-test/src/main/java/io/mifos/cheque/Fixture.java
index 2eda2b5..e8b411a 100644
--- a/component-test/src/main/java/io/mifos/cheque/Fixture.java
+++ b/component-test/src/main/java/io/mifos/cheque/Fixture.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 Kuelap, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * All Rights Reserved.
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * NOTICE:  All information contained herein is, and remains
- * the property of Kuelap, Inc and its suppliers, if any.
- * The intellectual and technical concepts contained herein
- * are proprietary to Kuelap, Inc and its suppliers and may
- * be covered by U.S. and Foreign Patents, patents in process,
- * and are protected by trade secret or copyright law.
- * Dissemination of this information or reproduction of this material
- * is strictly forbidden unless prior written permission is obtained
- * Kuelap, Inc.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.cheque;
 
diff --git a/component-test/src/main/java/io/mifos/cheque/SuiteTestEnvironment.java b/component-test/src/main/java/io/mifos/cheque/SuiteTestEnvironment.java
index 5f73420..4a8fdab 100644
--- a/component-test/src/main/java/io/mifos/cheque/SuiteTestEnvironment.java
+++ b/component-test/src/main/java/io/mifos/cheque/SuiteTestEnvironment.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 Kuelap, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * All Rights Reserved.
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * NOTICE:  All information contained herein is, and remains
- * the property of Kuelap, Inc and its suppliers, if any.
- * The intellectual and technical concepts contained herein
- * are proprietary to Kuelap, Inc and its suppliers and may
- * be covered by U.S. and Foreign Patents, patents in process,
- * and are protected by trade secret or copyright law.
- * Dissemination of this information or reproduction of this material
- * is strictly forbidden unless prior written permission is obtained
- * Kuelap, Inc.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.cheque;
 
diff --git a/component-test/src/main/java/io/mifos/cheque/TestCheques.java b/component-test/src/main/java/io/mifos/cheque/TestCheques.java
index f0b8183..c557408 100644
--- a/component-test/src/main/java/io/mifos/cheque/TestCheques.java
+++ b/component-test/src/main/java/io/mifos/cheque/TestCheques.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 Kuelap, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * All Rights Reserved.
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * NOTICE:  All information contained herein is, and remains
- * the property of Kuelap, Inc and its suppliers, if any.
- * The intellectual and technical concepts contained herein
- * are proprietary to Kuelap, Inc and its suppliers and may
- * be covered by U.S. and Foreign Patents, patents in process,
- * and are protected by trade secret or copyright law.
- * Dissemination of this information or reproduction of this material
- * is strictly forbidden unless prior written permission is obtained
- * Kuelap, Inc.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.cheque;
 
diff --git a/component-test/src/main/java/io/mifos/cheque/TestIssuingCheques.java b/component-test/src/main/java/io/mifos/cheque/TestIssuingCheques.java
index 364636d..158f287 100644
--- a/component-test/src/main/java/io/mifos/cheque/TestIssuingCheques.java
+++ b/component-test/src/main/java/io/mifos/cheque/TestIssuingCheques.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 Kuelap, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * All Rights Reserved.
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * NOTICE:  All information contained herein is, and remains
- * the property of Kuelap, Inc and its suppliers, if any.
- * The intellectual and technical concepts contained herein
- * are proprietary to Kuelap, Inc and its suppliers and may
- * be covered by U.S. and Foreign Patents, patents in process,
- * and are protected by trade secret or copyright law.
- * Dissemination of this information or reproduction of this material
- * is strictly forbidden unless prior written permission is obtained
- * Kuelap, Inc.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.cheque;
 
diff --git a/component-test/src/main/java/io/mifos/cheque/TestMICR.java b/component-test/src/main/java/io/mifos/cheque/TestMICR.java
index ea96c7b..1066aa4 100644
--- a/component-test/src/main/java/io/mifos/cheque/TestMICR.java
+++ b/component-test/src/main/java/io/mifos/cheque/TestMICR.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 Kuelap, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * All Rights Reserved.
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * NOTICE:  All information contained herein is, and remains
- * the property of Kuelap, Inc and its suppliers, if any.
- * The intellectual and technical concepts contained herein
- * are proprietary to Kuelap, Inc and its suppliers and may
- * be covered by U.S. and Foreign Patents, patents in process,
- * and are protected by trade secret or copyright law.
- * Dissemination of this information or reproduction of this material
- * is strictly forbidden unless prior written permission is obtained
- * Kuelap, Inc.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.cheque;
 
diff --git a/component-test/src/main/java/io/mifos/cheque/TestSuite.java b/component-test/src/main/java/io/mifos/cheque/TestSuite.java
index 8dfa201..3a8e9a9 100644
--- a/component-test/src/main/java/io/mifos/cheque/TestSuite.java
+++ b/component-test/src/main/java/io/mifos/cheque/TestSuite.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 Kuelap, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * All Rights Reserved.
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * NOTICE:  All information contained herein is, and remains
- * the property of Kuelap, Inc and its suppliers, if any.
- * The intellectual and technical concepts contained herein
- * are proprietary to Kuelap, Inc and its suppliers and may
- * be covered by U.S. and Foreign Patents, patents in process,
- * and are protected by trade secret or copyright law.
- * Dissemination of this information or reproduction of this material
- * is strictly forbidden unless prior written permission is obtained
- * Kuelap, Inc.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.cheque;
 
diff --git a/component-test/src/main/java/io/mifos/cheque/listener/ChequeEventListener.java b/component-test/src/main/java/io/mifos/cheque/listener/ChequeEventListener.java
index 1432897..69cf012 100644
--- a/component-test/src/main/java/io/mifos/cheque/listener/ChequeEventListener.java
+++ b/component-test/src/main/java/io/mifos/cheque/listener/ChequeEventListener.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 Kuelap, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * All Rights Reserved.
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * NOTICE:  All information contained herein is, and remains
- * the property of Kuelap, Inc and its suppliers, if any.
- * The intellectual and technical concepts contained herein
- * are proprietary to Kuelap, Inc and its suppliers and may
- * be covered by U.S. and Foreign Patents, patents in process,
- * and are protected by trade secret or copyright law.
- * Dissemination of this information or reproduction of this material
- * is strictly forbidden unless prior written permission is obtained
- * Kuelap, Inc.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.cheque.listener;
 
diff --git a/component-test/src/main/java/io/mifos/cheque/listener/ManagementEventMigrationListener.java b/component-test/src/main/java/io/mifos/cheque/listener/ManagementEventMigrationListener.java
index 1afa7ad..7690c6d 100644
--- a/component-test/src/main/java/io/mifos/cheque/listener/ManagementEventMigrationListener.java
+++ b/component-test/src/main/java/io/mifos/cheque/listener/ManagementEventMigrationListener.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 Kuelap, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * All Rights Reserved.
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * NOTICE:  All information contained herein is, and remains
- * the property of Kuelap, Inc and its suppliers, if any.
- * The intellectual and technical concepts contained herein
- * are proprietary to Kuelap, Inc and its suppliers and may
- * be covered by U.S. and Foreign Patents, patents in process,
- * and are protected by trade secret or copyright law.
- * Dissemination of this information or reproduction of this material
- * is strictly forbidden unless prior written permission is obtained
- * Kuelap, Inc.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.cheque.listener;
 
diff --git a/component-test/src/main/resources/logback-test.xml b/component-test/src/main/resources/logback-test.xml
index 321fb42..99091b8 100644
--- a/component-test/src/main/resources/logback-test.xml
+++ b/component-test/src/main/resources/logback-test.xml
@@ -1,18 +1,21 @@
 <!--
 
-    Copyright 2017 Kuelap, Inc.
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
 
-    All Rights Reserved.
+      http://www.apache.org/licenses/LICENSE-2.0
 
-    NOTICE:  All information contained herein is, and remains
-    the property of Kuelap, Inc and its suppliers, if any.
-    The intellectual and technical concepts contained herein
-    are proprietary to Kuelap, Inc and its suppliers and may
-    be covered by U.S. and Foreign Patents, patents in process,
-    and are protected by trade secret or copyright law.
-    Dissemination of this information or reproduction of this material
-    is strictly forbidden unless prior written permission is obtained
-    Kuelap, Inc.
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
 
 -->
 <configuration>
diff --git a/service/src/main/java/io/mifos/cheque/service/ChequeApplication.java b/service/src/main/java/io/mifos/cheque/service/ChequeApplication.java
index 78d9674..32d34e5 100644
--- a/service/src/main/java/io/mifos/cheque/service/ChequeApplication.java
+++ b/service/src/main/java/io/mifos/cheque/service/ChequeApplication.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 Kuelap, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * All Rights Reserved.
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * NOTICE:  All information contained herein is, and remains
- * the property of Kuelap, Inc and its suppliers, if any.
- * The intellectual and technical concepts contained herein
- * are proprietary to Kuelap, Inc and its suppliers and may
- * be covered by U.S. and Foreign Patents, patents in process,
- * and are protected by trade secret or copyright law.
- * Dissemination of this information or reproduction of this material
- * is strictly forbidden unless prior written permission is obtained
- * Kuelap, Inc.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.cheque.service;
 
diff --git a/service/src/main/java/io/mifos/cheque/service/ChequeConfiguration.java b/service/src/main/java/io/mifos/cheque/service/ChequeConfiguration.java
index 9e9919c..45c1d92 100644
--- a/service/src/main/java/io/mifos/cheque/service/ChequeConfiguration.java
+++ b/service/src/main/java/io/mifos/cheque/service/ChequeConfiguration.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 Kuelap, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * All Rights Reserved.
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * NOTICE:  All information contained herein is, and remains
- * the property of Kuelap, Inc and its suppliers, if any.
- * The intellectual and technical concepts contained herein
- * are proprietary to Kuelap, Inc and its suppliers and may
- * be covered by U.S. and Foreign Patents, patents in process,
- * and are protected by trade secret or copyright law.
- * Dissemination of this information or reproduction of this material
- * is strictly forbidden unless prior written permission is obtained
- * Kuelap, Inc.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.cheque.service;
 
diff --git a/service/src/main/java/io/mifos/cheque/service/ServiceConstants.java b/service/src/main/java/io/mifos/cheque/service/ServiceConstants.java
index 88bcca3..909a0b2 100644
--- a/service/src/main/java/io/mifos/cheque/service/ServiceConstants.java
+++ b/service/src/main/java/io/mifos/cheque/service/ServiceConstants.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 Kuelap, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * All Rights Reserved.
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * NOTICE:  All information contained herein is, and remains
- * the property of Kuelap, Inc and its suppliers, if any.
- * The intellectual and technical concepts contained herein
- * are proprietary to Kuelap, Inc and its suppliers and may
- * be covered by U.S. and Foreign Patents, patents in process,
- * and are protected by trade secret or copyright law.
- * Dissemination of this information or reproduction of this material
- * is strictly forbidden unless prior written permission is obtained
- * Kuelap, Inc.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.cheque.service;
 
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/command/ApproveChequeTransactionCommand.java b/service/src/main/java/io/mifos/cheque/service/internal/command/ApproveChequeTransactionCommand.java
index 64dc0f0..85c91e1 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/command/ApproveChequeTransactionCommand.java
+++ b/service/src/main/java/io/mifos/cheque/service/internal/command/ApproveChequeTransactionCommand.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 Kuelap, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * All Rights Reserved.
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * NOTICE:  All information contained herein is, and remains
- * the property of Kuelap, Inc and its suppliers, if any.
- * The intellectual and technical concepts contained herein
- * are proprietary to Kuelap, Inc and its suppliers and may
- * be covered by U.S. and Foreign Patents, patents in process,
- * and are protected by trade secret or copyright law.
- * Dissemination of this information or reproduction of this material
- * is strictly forbidden unless prior written permission is obtained
- * Kuelap, Inc.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.cheque.service.internal.command;
 
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/command/CancelChequeTransactionCommand.java b/service/src/main/java/io/mifos/cheque/service/internal/command/CancelChequeTransactionCommand.java
index 8bec5e3..226829e 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/command/CancelChequeTransactionCommand.java
+++ b/service/src/main/java/io/mifos/cheque/service/internal/command/CancelChequeTransactionCommand.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 Kuelap, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * All Rights Reserved.
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * NOTICE:  All information contained herein is, and remains
- * the property of Kuelap, Inc and its suppliers, if any.
- * The intellectual and technical concepts contained herein
- * are proprietary to Kuelap, Inc and its suppliers and may
- * be covered by U.S. and Foreign Patents, patents in process,
- * and are protected by trade secret or copyright law.
- * Dissemination of this information or reproduction of this material
- * is strictly forbidden unless prior written permission is obtained
- * Kuelap, Inc.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.cheque.service.internal.command;
 
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/command/ChequeTransactionCommand.java b/service/src/main/java/io/mifos/cheque/service/internal/command/ChequeTransactionCommand.java
index 21a5ab3..1b5ff2d 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/command/ChequeTransactionCommand.java
+++ b/service/src/main/java/io/mifos/cheque/service/internal/command/ChequeTransactionCommand.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 Kuelap, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * All Rights Reserved.
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * NOTICE:  All information contained herein is, and remains
- * the property of Kuelap, Inc and its suppliers, if any.
- * The intellectual and technical concepts contained herein
- * are proprietary to Kuelap, Inc and its suppliers and may
- * be covered by U.S. and Foreign Patents, patents in process,
- * and are protected by trade secret or copyright law.
- * Dissemination of this information or reproduction of this material
- * is strictly forbidden unless prior written permission is obtained
- * Kuelap, Inc.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.cheque.service.internal.command;
 
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/command/IssueChequesCommand.java b/service/src/main/java/io/mifos/cheque/service/internal/command/IssueChequesCommand.java
index 68c8de7..e42ca5b 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/command/IssueChequesCommand.java
+++ b/service/src/main/java/io/mifos/cheque/service/internal/command/IssueChequesCommand.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 Kuelap, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * All Rights Reserved.
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * NOTICE:  All information contained herein is, and remains
- * the property of Kuelap, Inc and its suppliers, if any.
- * The intellectual and technical concepts contained herein
- * are proprietary to Kuelap, Inc and its suppliers and may
- * be covered by U.S. and Foreign Patents, patents in process,
- * and are protected by trade secret or copyright law.
- * Dissemination of this information or reproduction of this material
- * is strictly forbidden unless prior written permission is obtained
- * Kuelap, Inc.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.cheque.service.internal.command;
 
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/command/MigrationCommand.java b/service/src/main/java/io/mifos/cheque/service/internal/command/MigrationCommand.java
index fdbf526..8366e8f 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/command/MigrationCommand.java
+++ b/service/src/main/java/io/mifos/cheque/service/internal/command/MigrationCommand.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 Kuelap, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * All Rights Reserved.
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * NOTICE:  All information contained herein is, and remains
- * the property of Kuelap, Inc and its suppliers, if any.
- * The intellectual and technical concepts contained herein
- * are proprietary to Kuelap, Inc and its suppliers and may
- * be covered by U.S. and Foreign Patents, patents in process,
- * and are protected by trade secret or copyright law.
- * Dissemination of this information or reproduction of this material
- * is strictly forbidden unless prior written permission is obtained
- * Kuelap, Inc.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.cheque.service.internal.command;
 
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/command/handler/ChequeAggregate.java b/service/src/main/java/io/mifos/cheque/service/internal/command/handler/ChequeAggregate.java
index 666742f..fc5d327 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/command/handler/ChequeAggregate.java
+++ b/service/src/main/java/io/mifos/cheque/service/internal/command/handler/ChequeAggregate.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 Kuelap, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * All Rights Reserved.
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * NOTICE:  All information contained herein is, and remains
- * the property of Kuelap, Inc and its suppliers, if any.
- * The intellectual and technical concepts contained herein
- * are proprietary to Kuelap, Inc and its suppliers and may
- * be covered by U.S. and Foreign Patents, patents in process,
- * and are protected by trade secret or copyright law.
- * Dissemination of this information or reproduction of this material
- * is strictly forbidden unless prior written permission is obtained
- * Kuelap, Inc.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.cheque.service.internal.command.handler;
 
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/command/handler/ManagementAggregate.java b/service/src/main/java/io/mifos/cheque/service/internal/command/handler/ManagementAggregate.java
index 99cab0f..e20fb8d 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/command/handler/ManagementAggregate.java
+++ b/service/src/main/java/io/mifos/cheque/service/internal/command/handler/ManagementAggregate.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 Kuelap, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * All Rights Reserved.
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * NOTICE:  All information contained herein is, and remains
- * the property of Kuelap, Inc and its suppliers, if any.
- * The intellectual and technical concepts contained herein
- * are proprietary to Kuelap, Inc and its suppliers and may
- * be covered by U.S. and Foreign Patents, patents in process,
- * and are protected by trade secret or copyright law.
- * Dissemination of this information or reproduction of this material
- * is strictly forbidden unless prior written permission is obtained
- * Kuelap, Inc.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.cheque.service.internal.command.handler;
 
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/format/MICRParser.java b/service/src/main/java/io/mifos/cheque/service/internal/format/MICRParser.java
index 46c2af9..3bd0d9e 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/format/MICRParser.java
+++ b/service/src/main/java/io/mifos/cheque/service/internal/format/MICRParser.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 Kuelap, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * All Rights Reserved.
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * NOTICE:  All information contained herein is, and remains
- * the property of Kuelap, Inc and its suppliers, if any.
- * The intellectual and technical concepts contained herein
- * are proprietary to Kuelap, Inc and its suppliers and may
- * be covered by U.S. and Foreign Patents, patents in process,
- * and are protected by trade secret or copyright law.
- * Dissemination of this information or reproduction of this material
- * is strictly forbidden unless prior written permission is obtained
- * Kuelap, Inc.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.cheque.service.internal.format;
 
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/mapper/ChequeMapper.java b/service/src/main/java/io/mifos/cheque/service/internal/mapper/ChequeMapper.java
index 20a24ad..88ddfb6 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/mapper/ChequeMapper.java
+++ b/service/src/main/java/io/mifos/cheque/service/internal/mapper/ChequeMapper.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 Kuelap, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * All Rights Reserved.
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * NOTICE:  All information contained herein is, and remains
- * the property of Kuelap, Inc and its suppliers, if any.
- * The intellectual and technical concepts contained herein
- * are proprietary to Kuelap, Inc and its suppliers and may
- * be covered by U.S. and Foreign Patents, patents in process,
- * and are protected by trade secret or copyright law.
- * Dissemination of this information or reproduction of this material
- * is strictly forbidden unless prior written permission is obtained
- * Kuelap, Inc.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.cheque.service.internal.mapper;
 
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/repository/ChequeEntity.java b/service/src/main/java/io/mifos/cheque/service/internal/repository/ChequeEntity.java
index 91d4545..8169c9d 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/repository/ChequeEntity.java
+++ b/service/src/main/java/io/mifos/cheque/service/internal/repository/ChequeEntity.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 Kuelap, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * All Rights Reserved.
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * NOTICE:  All information contained herein is, and remains
- * the property of Kuelap, Inc and its suppliers, if any.
- * The intellectual and technical concepts contained herein
- * are proprietary to Kuelap, Inc and its suppliers and may
- * be covered by U.S. and Foreign Patents, patents in process,
- * and are protected by trade secret or copyright law.
- * Dissemination of this information or reproduction of this material
- * is strictly forbidden unless prior written permission is obtained
- * Kuelap, Inc.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.cheque.service.internal.repository;
 
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/repository/ChequeRepository.java b/service/src/main/java/io/mifos/cheque/service/internal/repository/ChequeRepository.java
index d6e574d..76a5702 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/repository/ChequeRepository.java
+++ b/service/src/main/java/io/mifos/cheque/service/internal/repository/ChequeRepository.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 Kuelap, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * All Rights Reserved.
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * NOTICE:  All information contained herein is, and remains
- * the property of Kuelap, Inc and its suppliers, if any.
- * The intellectual and technical concepts contained herein
- * are proprietary to Kuelap, Inc and its suppliers and may
- * be covered by U.S. and Foreign Patents, patents in process,
- * and are protected by trade secret or copyright law.
- * Dissemination of this information or reproduction of this material
- * is strictly forbidden unless prior written permission is obtained
- * Kuelap, Inc.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.cheque.service.internal.repository;
 
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/repository/IssuedChequeEntity.java b/service/src/main/java/io/mifos/cheque/service/internal/repository/IssuedChequeEntity.java
index 8a1d463..33deca3 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/repository/IssuedChequeEntity.java
+++ b/service/src/main/java/io/mifos/cheque/service/internal/repository/IssuedChequeEntity.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 Kuelap, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * All Rights Reserved.
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * NOTICE:  All information contained herein is, and remains
- * the property of Kuelap, Inc and its suppliers, if any.
- * The intellectual and technical concepts contained herein
- * are proprietary to Kuelap, Inc and its suppliers and may
- * be covered by U.S. and Foreign Patents, patents in process,
- * and are protected by trade secret or copyright law.
- * Dissemination of this information or reproduction of this material
- * is strictly forbidden unless prior written permission is obtained
- * Kuelap, Inc.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.cheque.service.internal.repository;
 
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/repository/IssuedChequeRepository.java b/service/src/main/java/io/mifos/cheque/service/internal/repository/IssuedChequeRepository.java
index 1e0e349..28be5ac 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/repository/IssuedChequeRepository.java
+++ b/service/src/main/java/io/mifos/cheque/service/internal/repository/IssuedChequeRepository.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 Kuelap, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * All Rights Reserved.
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * NOTICE:  All information contained herein is, and remains
- * the property of Kuelap, Inc and its suppliers, if any.
- * The intellectual and technical concepts contained herein
- * are proprietary to Kuelap, Inc and its suppliers and may
- * be covered by U.S. and Foreign Patents, patents in process,
- * and are protected by trade secret or copyright law.
- * Dissemination of this information or reproduction of this material
- * is strictly forbidden unless prior written permission is obtained
- * Kuelap, Inc.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.cheque.service.internal.repository;
 
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/repository/specification/ChequeSpecification.java b/service/src/main/java/io/mifos/cheque/service/internal/repository/specification/ChequeSpecification.java
index 90d111e..7865ede 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/repository/specification/ChequeSpecification.java
+++ b/service/src/main/java/io/mifos/cheque/service/internal/repository/specification/ChequeSpecification.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 Kuelap, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * All Rights Reserved.
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * NOTICE:  All information contained herein is, and remains
- * the property of Kuelap, Inc and its suppliers, if any.
- * The intellectual and technical concepts contained herein
- * are proprietary to Kuelap, Inc and its suppliers and may
- * be covered by U.S. and Foreign Patents, patents in process,
- * and are protected by trade secret or copyright law.
- * Dissemination of this information or reproduction of this material
- * is strictly forbidden unless prior written permission is obtained
- * Kuelap, Inc.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.cheque.service.internal.repository.specification;
 
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/service/ChequeService.java b/service/src/main/java/io/mifos/cheque/service/internal/service/ChequeService.java
index 75c3269..24898d7 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/service/ChequeService.java
+++ b/service/src/main/java/io/mifos/cheque/service/internal/service/ChequeService.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 Kuelap, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * All Rights Reserved.
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * NOTICE:  All information contained herein is, and remains
- * the property of Kuelap, Inc and its suppliers, if any.
- * The intellectual and technical concepts contained herein
- * are proprietary to Kuelap, Inc and its suppliers and may
- * be covered by U.S. and Foreign Patents, patents in process,
- * and are protected by trade secret or copyright law.
- * Dissemination of this information or reproduction of this material
- * is strictly forbidden unless prior written permission is obtained
- * Kuelap, Inc.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.cheque.service.internal.service;
 
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/service/MICRService.java b/service/src/main/java/io/mifos/cheque/service/internal/service/MICRService.java
index 4bd3351..968165b 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/service/MICRService.java
+++ b/service/src/main/java/io/mifos/cheque/service/internal/service/MICRService.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 Kuelap, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * All Rights Reserved.
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * NOTICE:  All information contained herein is, and remains
- * the property of Kuelap, Inc and its suppliers, if any.
- * The intellectual and technical concepts contained herein
- * are proprietary to Kuelap, Inc and its suppliers and may
- * be covered by U.S. and Foreign Patents, patents in process,
- * and are protected by trade secret or copyright law.
- * Dissemination of this information or reproduction of this material
- * is strictly forbidden unless prior written permission is obtained
- * Kuelap, Inc.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.cheque.service.internal.service;
 
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/service/helper/AccountingService.java b/service/src/main/java/io/mifos/cheque/service/internal/service/helper/AccountingService.java
index 46bb20a..5d2d630 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/service/helper/AccountingService.java
+++ b/service/src/main/java/io/mifos/cheque/service/internal/service/helper/AccountingService.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 Kuelap, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * All Rights Reserved.
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * NOTICE:  All information contained herein is, and remains
- * the property of Kuelap, Inc and its suppliers, if any.
- * The intellectual and technical concepts contained herein
- * are proprietary to Kuelap, Inc and its suppliers and may
- * be covered by U.S. and Foreign Patents, patents in process,
- * and are protected by trade secret or copyright law.
- * Dissemination of this information or reproduction of this material
- * is strictly forbidden unless prior written permission is obtained
- * Kuelap, Inc.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.cheque.service.internal.service.helper;
 
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/service/helper/CustomerService.java b/service/src/main/java/io/mifos/cheque/service/internal/service/helper/CustomerService.java
index 3bfebcd..b90e3a4 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/service/helper/CustomerService.java
+++ b/service/src/main/java/io/mifos/cheque/service/internal/service/helper/CustomerService.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 Kuelap, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * All Rights Reserved.
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * NOTICE:  All information contained herein is, and remains
- * the property of Kuelap, Inc and its suppliers, if any.
- * The intellectual and technical concepts contained herein
- * are proprietary to Kuelap, Inc and its suppliers and may
- * be covered by U.S. and Foreign Patents, patents in process,
- * and are protected by trade secret or copyright law.
- * Dissemination of this information or reproduction of this material
- * is strictly forbidden unless prior written permission is obtained
- * Kuelap, Inc.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.cheque.service.internal.service.helper;
 
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/service/helper/DepositService.java b/service/src/main/java/io/mifos/cheque/service/internal/service/helper/DepositService.java
index 0ff8257..98bcabc 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/service/helper/DepositService.java
+++ b/service/src/main/java/io/mifos/cheque/service/internal/service/helper/DepositService.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 Kuelap, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * All Rights Reserved.
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * NOTICE:  All information contained herein is, and remains
- * the property of Kuelap, Inc and its suppliers, if any.
- * The intellectual and technical concepts contained herein
- * are proprietary to Kuelap, Inc and its suppliers and may
- * be covered by U.S. and Foreign Patents, patents in process,
- * and are protected by trade secret or copyright law.
- * Dissemination of this information or reproduction of this material
- * is strictly forbidden unless prior written permission is obtained
- * Kuelap, Inc.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.cheque.service.internal.service.helper;
 
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/service/helper/OrganizationService.java b/service/src/main/java/io/mifos/cheque/service/internal/service/helper/OrganizationService.java
index 4a11088..26177cd 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/service/helper/OrganizationService.java
+++ b/service/src/main/java/io/mifos/cheque/service/internal/service/helper/OrganizationService.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 Kuelap, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * All Rights Reserved.
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * NOTICE:  All information contained herein is, and remains
- * the property of Kuelap, Inc and its suppliers, if any.
- * The intellectual and technical concepts contained herein
- * are proprietary to Kuelap, Inc and its suppliers and may
- * be covered by U.S. and Foreign Patents, patents in process,
- * and are protected by trade secret or copyright law.
- * Dissemination of this information or reproduction of this material
- * is strictly forbidden unless prior written permission is obtained
- * Kuelap, Inc.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.cheque.service.internal.service.helper;
 
diff --git a/service/src/main/java/io/mifos/cheque/service/rest/ChequeManagementRestController.java b/service/src/main/java/io/mifos/cheque/service/rest/ChequeManagementRestController.java
index 9317c17..facfee4 100644
--- a/service/src/main/java/io/mifos/cheque/service/rest/ChequeManagementRestController.java
+++ b/service/src/main/java/io/mifos/cheque/service/rest/ChequeManagementRestController.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 Kuelap, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * All Rights Reserved.
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * NOTICE:  All information contained herein is, and remains
- * the property of Kuelap, Inc and its suppliers, if any.
- * The intellectual and technical concepts contained herein
- * are proprietary to Kuelap, Inc and its suppliers and may
- * be covered by U.S. and Foreign Patents, patents in process,
- * and are protected by trade secret or copyright law.
- * Dissemination of this information or reproduction of this material
- * is strictly forbidden unless prior written permission is obtained
- * Kuelap, Inc.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.cheque.service.rest;
 
diff --git a/service/src/main/java/io/mifos/cheque/service/rest/ChequeRestController.java b/service/src/main/java/io/mifos/cheque/service/rest/ChequeRestController.java
index 007e383..946c8c0 100644
--- a/service/src/main/java/io/mifos/cheque/service/rest/ChequeRestController.java
+++ b/service/src/main/java/io/mifos/cheque/service/rest/ChequeRestController.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 Kuelap, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * All Rights Reserved.
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * NOTICE:  All information contained herein is, and remains
- * the property of Kuelap, Inc and its suppliers, if any.
- * The intellectual and technical concepts contained herein
- * are proprietary to Kuelap, Inc and its suppliers and may
- * be covered by U.S. and Foreign Patents, patents in process,
- * and are protected by trade secret or copyright law.
- * Dissemination of this information or reproduction of this material
- * is strictly forbidden unless prior written permission is obtained
- * Kuelap, Inc.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.cheque.service.rest;
 
diff --git a/service/src/main/java/io/mifos/cheque/service/rest/ChequeTransactionRestController.java b/service/src/main/java/io/mifos/cheque/service/rest/ChequeTransactionRestController.java
index 2d0018c..9d83275 100644
--- a/service/src/main/java/io/mifos/cheque/service/rest/ChequeTransactionRestController.java
+++ b/service/src/main/java/io/mifos/cheque/service/rest/ChequeTransactionRestController.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 Kuelap, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * All Rights Reserved.
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * NOTICE:  All information contained herein is, and remains
- * the property of Kuelap, Inc and its suppliers, if any.
- * The intellectual and technical concepts contained herein
- * are proprietary to Kuelap, Inc and its suppliers and may
- * be covered by U.S. and Foreign Patents, patents in process,
- * and are protected by trade secret or copyright law.
- * Dissemination of this information or reproduction of this material
- * is strictly forbidden unless prior written permission is obtained
- * Kuelap, Inc.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.cheque.service.rest;
 
diff --git a/service/src/main/java/io/mifos/cheque/service/rest/MIRCRestController.java b/service/src/main/java/io/mifos/cheque/service/rest/MIRCRestController.java
index 4a3a15e..c28eddb 100644
--- a/service/src/main/java/io/mifos/cheque/service/rest/MIRCRestController.java
+++ b/service/src/main/java/io/mifos/cheque/service/rest/MIRCRestController.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 Kuelap, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * All Rights Reserved.
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * NOTICE:  All information contained herein is, and remains
- * the property of Kuelap, Inc and its suppliers, if any.
- * The intellectual and technical concepts contained herein
- * are proprietary to Kuelap, Inc and its suppliers and may
- * be covered by U.S. and Foreign Patents, patents in process,
- * and are protected by trade secret or copyright law.
- * Dissemination of this information or reproduction of this material
- * is strictly forbidden unless prior written permission is obtained
- * Kuelap, Inc.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.cheque.service.rest;
 
diff --git a/service/src/main/resources/application.yml b/service/src/main/resources/application.yml
index c73c1b8..af184b4 100644
--- a/service/src/main/resources/application.yml
+++ b/service/src/main/resources/application.yml
@@ -1,17 +1,20 @@
 #
-# Copyright 2017 Kuelap, Inc.
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
 #
-# All Rights Reserved.
+#   http://www.apache.org/licenses/LICENSE-2.0
 #
-# NOTICE:  All information contained herein is, and remains
-# the property of Kuelap, Inc and its suppliers, if any.
-# The intellectual and technical concepts contained herein
-# are proprietary to Kuelap, Inc and its suppliers and may
-# be covered by U.S. and Foreign Patents, patents in process,
-# and are protected by trade secret or copyright law.
-# Dissemination of this information or reproduction of this material
-# is strictly forbidden unless prior written permission is obtained
-# Kuelap, Inc.
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
 #
 
 spring:
diff --git a/service/src/main/resources/bootstrap.yml b/service/src/main/resources/bootstrap.yml
index 7ab35c9..056b35d 100644
--- a/service/src/main/resources/bootstrap.yml
+++ b/service/src/main/resources/bootstrap.yml
@@ -1,17 +1,20 @@
 #
-# Copyright 2017 Kuelap, Inc.
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
 #
-# All Rights Reserved.
+#   http://www.apache.org/licenses/LICENSE-2.0
 #
-# NOTICE:  All information contained herein is, and remains
-# the property of Kuelap, Inc and its suppliers, if any.
-# The intellectual and technical concepts contained herein
-# are proprietary to Kuelap, Inc and its suppliers and may
-# be covered by U.S. and Foreign Patents, patents in process,
-# and are protected by trade secret or copyright law.
-# Dissemination of this information or reproduction of this material
-# is strictly forbidden unless prior written permission is obtained
-# Kuelap, Inc.
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
 #
 
 spring:
diff --git a/service/src/main/resources/db/migrations/mariadb/V1__initial_setup.sql b/service/src/main/resources/db/migrations/mariadb/V1__initial_setup.sql
index 23bdb44..e1e99ee 100644
--- a/service/src/main/resources/db/migrations/mariadb/V1__initial_setup.sql
+++ b/service/src/main/resources/db/migrations/mariadb/V1__initial_setup.sql
@@ -1,17 +1,20 @@
 --
--- Copyright 2017 Kuelap, Inc.
+-- Licensed to the Apache Software Foundation (ASF) under one
+-- or more contributor license agreements.  See the NOTICE file
+-- distributed with this work for additional information
+-- regarding copyright ownership.  The ASF licenses this file
+-- to you under the Apache License, Version 2.0 (the
+-- "License"); you may not use this file except in compliance
+-- with the License.  You may obtain a copy of the License at
 --
--- All Rights Reserved.
+--   http://www.apache.org/licenses/LICENSE-2.0
 --
--- NOTICE:  All information contained herein is, and remains
--- the property of Kuelap, Inc and its suppliers, if any.
--- The intellectual and technical concepts contained herein
--- are proprietary to Kuelap, Inc and its suppliers and may
--- be covered by U.S. and Foreign Patents, patents in process,
--- and are protected by trade secret or copyright law.
--- Dissemination of this information or reproduction of this material
--- is strictly forbidden unless prior written permission is obtained
--- Kuelap, Inc.
+-- Unless required by applicable law or agreed to in writing,
+-- software distributed under the License is distributed on an
+-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+-- KIND, either express or implied.  See the License for the
+-- specific language governing permissions and limitations
+-- under the License.
 --
 
 CREATE TABLE sopdet_issued_cheques (
diff --git a/service/src/main/resources/logback.xml b/service/src/main/resources/logback.xml
index e68c93a..0388ea1 100644
--- a/service/src/main/resources/logback.xml
+++ b/service/src/main/resources/logback.xml
@@ -1,18 +1,21 @@
 <!--
 
-    Copyright 2017 Kuelap, Inc.
-
-    All Rights Reserved.
-
-    NOTICE:  All information contained herein is, and remains
-    the property of Kuelap, Inc and its suppliers, if any.
-    The intellectual and technical concepts contained herein
-    are proprietary to Kuelap, Inc and its suppliers and may
-    be covered by U.S. and Foreign Patents, patents in process,
-    and are protected by trade secret or copyright law.
-    Dissemination of this information or reproduction of this material
-    is strictly forbidden unless prior written permission is obtained
-    Kuelap, Inc.
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
 
 -->
 <configuration>
diff --git a/service/src/test/java/io/mifos/cheque/service/internal/format/TestMICRParser.java b/service/src/test/java/io/mifos/cheque/service/internal/format/TestMICRParser.java
index c74fa2b..da44743 100644
--- a/service/src/test/java/io/mifos/cheque/service/internal/format/TestMICRParser.java
+++ b/service/src/test/java/io/mifos/cheque/service/internal/format/TestMICRParser.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 Kuelap, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * All Rights Reserved.
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * NOTICE:  All information contained herein is, and remains
- * the property of Kuelap, Inc and its suppliers, if any.
- * The intellectual and technical concepts contained herein
- * are proprietary to Kuelap, Inc and its suppliers and may
- * be covered by U.S. and Foreign Patents, patents in process,
- * and are protected by trade secret or copyright law.
- * Dissemination of this information or reproduction of this material
- * is strictly forbidden unless prior written permission is obtained
- * Kuelap, Inc.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.cheque.service.internal.format;
 
diff --git a/shared.gradle b/shared.gradle
index 603d308..5f94e92 100644
--- a/shared.gradle
+++ b/shared.gradle
@@ -70,5 +70,5 @@ license {
         yaml = 'SCRIPT_STYLE'
     }
     ext.year = Calendar.getInstance().get(Calendar.YEAR)
-    ext.company = 'Kuelap, Inc'
+    ext.company = 'The Apache Software Foundation'
 }


[fineract-cn-cheques] 31/44: FINCN-148 build with travis-ci.com and upload artifacts to Artifactory

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juhan pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-cheques.git

commit 0d92ba4c8e7fe3ae525d427776f59211e6b06735
Author: Juhan Aasaru <Ju...@nortal.com>
AuthorDate: Thu Apr 25 11:51:06 2019 +0300

    FINCN-148 build with travis-ci.com and upload artifacts to Artifactory
---
 .travis.yml                 | 30 +++++++++++++++++++
 README.md                   |  2 +-
 api/build.gradle            |  3 +-
 build.gradle                |  8 +++++
 component-test/build.gradle |  2 ++
 service/build.gradle        |  5 ++--
 shared.gradle               | 17 +++++++++++
 travis.sh                   | 71 +++++++++++++++++++++++++++++++++++++++++++++
 8 files changed, 134 insertions(+), 4 deletions(-)

diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..64e41ff
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,30 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+language: java
+sudo: false
+jdk:
+- openjdk8
+install: true
+script: "./travis.sh"
+env:
+  global:
+    - BUILD_SNAPSHOTS_BRANCH=develop
+    - ARTIFACTORY_URL=https://mifos.jfrog.io/mifos
+    - ARTIFACTORY_USER=travis-ci
+    - secure: "H9DMI6bUesXtE5friHQMFxJaRzyf7qSdjxJRPilM+E0eGXE91o8HKWTu2mx0ybukxkMjB0PWJt9r3NlgjysMSxpZFNErphtX5wQHWSoPwOiyKkh7kfCMmyst0tJvx86N8Furd0dWEMb4FoWMllKt4hsu2kTjvfL8h/vac2SRgLi8TBh41iltufZGEVBQmxQdF2PkCowpXKprMY5QYe8eEysxEKnu4EvZjPgT5u4c7d/ckM2lyEEDGHhUjJh3X556GV9x71dCvCVPVqzVO4jfcUlBB5baiI7sWzdfbBg3dpbFA0jFJNHCOjvipdkUf2yaESf3rCYpDE7ins+jbweLQyCRYjLczyGYZr+kFD73O5026qyMRH7+N+LvklYaN5lxsC5G3nbc5S8XEPrgmtFo7tnslJmtO95KPWPGYBO+aoLHpBbeaIwkGLqqdC4eqEGVy/queLat4TJt2Ta041p/VJbn4XskM [...]
diff --git a/README.md b/README.md
index 2ceb05c..fe88e9b 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# Apache Fineract CN Cheques Management
+# Apache Fineract CN Cheques Management [![Build Status](https://api.travis-ci.com/apache/fineract-cn-cheques.svg?branch=develop)](https://travis-ci.com/apache/fineract-cn-cheques)
 
 This project provides services to issue, validate cheques and execute transactions on them.
 
diff --git a/api/build.gradle b/api/build.gradle
index 5b9924a..a11f487 100644
--- a/api/build.gradle
+++ b/api/build.gradle
@@ -28,6 +28,7 @@ buildscript {
 plugins {
     id "com.github.hierynomus.license" version "0.13.1"
     id("org.nosphere.apache.rat") version "0.3.1"
+    id "com.jfrog.artifactory" version "4.9.5"
 }
 
 apply from: '../shared.gradle'
@@ -51,7 +52,7 @@ publishing {
             from components.java
             groupId project.group
             artifactId project.name
-            version project.version
+            version project.findProperty('externalVersion') ?: project.version
         }
     }
 }
diff --git a/build.gradle b/build.gradle
index 848847a..eeb68fb 100644
--- a/build.gradle
+++ b/build.gradle
@@ -39,6 +39,14 @@ task publishToMavenLocal {
     dependsOn publishComponentTestToMavenLocal
 }
 
+task artifactoryPublish {
+    group 'all'
+    dependsOn publishToMavenLocal
+    dependsOn gradle.includedBuild('api').task(':artifactoryPublish')
+    dependsOn gradle.includedBuild('service').task(':artifactoryPublish')
+    dependsOn gradle.includedBuild('component-test').task(':artifactoryPublish')
+}
+
 task prepareForTest {
     group 'all'
     dependsOn publishToMavenLocal
diff --git a/component-test/build.gradle b/component-test/build.gradle
index 74a5e50..95954e4 100644
--- a/component-test/build.gradle
+++ b/component-test/build.gradle
@@ -32,6 +32,7 @@ buildscript {
 plugins {
     id "com.github.hierynomus.license" version "0.13.1"
     id("org.nosphere.apache.rat") version "0.3.1"
+    id "com.jfrog.artifactory" version "4.9.5"
 }
 apply from: '../shared.gradle'
 
@@ -51,6 +52,7 @@ publishing {
     publications {
         mavenJava(MavenPublication) {
             from components.java
+            version project.findProperty('externalVersion') ?: project.version
         }
     }
 }
diff --git a/service/build.gradle b/service/build.gradle
index 01bcfea..4421b49 100644
--- a/service/build.gradle
+++ b/service/build.gradle
@@ -32,6 +32,7 @@ buildscript {
 plugins {
     id "com.github.hierynomus.license" version "0.13.1"
     id("org.nosphere.apache.rat") version "0.3.1"
+    id "com.jfrog.artifactory" version "4.9.5"
 }
 
 apply from: '../shared.gradle'
@@ -73,14 +74,14 @@ publishing {
             from components.java
             groupId project.group
             artifactId project.name
-            version project.version
+            version project.findProperty('externalVersion') ?: project.version
         }
         bootService(MavenPublication) {
             // "boot" jar
             artifact("$buildDir/libs/$project.name-$version-boot.jar")
             groupId project.group
             artifactId("$project.name-boot")
-            version project.version
+            version project.findProperty('externalVersion') ?: project.version
         }
     }
 }
diff --git a/shared.gradle b/shared.gradle
index 46edf30..37de82e 100644
--- a/shared.gradle
+++ b/shared.gradle
@@ -47,6 +47,7 @@ tasks.withType(JavaCompile) {
 repositories {
     jcenter()
     mavenLocal()
+    maven { url 'https://mifos.jfrog.io/mifos/libs-snapshot/' }
 }
 
 dependencyManagement {
@@ -77,6 +78,22 @@ jar {
     duplicatesStrategy = DuplicatesStrategy.EXCLUDE
 }
 
+artifactory {
+    contextUrl = System.getenv("ARTIFACTORY_URL")
+    publish {
+        repository {
+            repoKey = project.findProperty('artifactoryRepoKey')
+            username = System.getenv("ARTIFACTORY_USER")
+            password = System.getenv("ARTIFACTORY_PASSWORD")
+        }
+
+        defaults {
+            publications ('api', 'componentTest', 'service', 'bootService')
+        }
+    }
+}
+artifactoryPublish.dependsOn('clean','publishToMavenLocal')
+
 license {
     header rootProject.file('../HEADER')
     strictCheck true
diff --git a/travis.sh b/travis.sh
new file mode 100755
index 0000000..03a75ee
--- /dev/null
+++ b/travis.sh
@@ -0,0 +1,71 @@
+#!/usr/bin/env bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+# Documentation: https://cwiki.apache.org/confluence/display/FINERACT/Fineract-CN+Artifactory
+
+#Exit immediately if a command exits with a non-zero status.
+set -e
+EXIT_STATUS=0
+
+# Builds and Publishes a SNAPSHOT
+function build_snapshot() {
+  echo -e "Building and publishing a snapshot out of branch [$TRAVIS_BRANCH]"
+  ./gradlew -PartifactoryRepoKey=libs-snapshot-local -DbuildInfo.build.number=${TRAVIS_COMMIT::7} artifactoryPublish --stacktrace || EXIT_STATUS=$?
+}
+
+# Builds a Pull Request
+function build_pullrequest() {
+  echo -e "Building pull request #$TRAVIS_PULL_REQUEST of branch [$TRAVIS_BRANCH]. Won't publish anything to Artifactory."
+  ./gradlew publishToMavenLocal rat || EXIT_STATUS=$?
+}
+
+# For other branches we need to add branch name as prefix
+function build_otherbranch() {
+  echo -e "Building a snapshot out of branch [$TRAVIS_BRANCH] and publishing it with prefix '${TRAVIS_BRANCH}-SNAPSHOT'"
+  ./gradlew -PartifactoryRepoKey=libs-snapshot-local -DbuildInfo.build.number=${TRAVIS_COMMIT::7} -PexternalVersion=${TRAVIS_BRANCH}-SNAPSHOT artifactoryPublish --stacktrace || EXIT_STATUS=$?
+}
+
+# Builds and Publishes a Tag
+function build_tag() {
+  echo -e "Building tag [$TRAVIS_TAG] and publishing it as a release"
+  ./gradlew -PartifactoryRepoKey=libs-release-local -PexternalVersion=$TRAVIS_TAG artifactoryPublish --stacktrace || EXIT_STATUS=$?
+
+}
+
+echo -e "TRAVIS_BRANCH=$TRAVIS_BRANCH"
+echo -e "TRAVIS_TAG=$TRAVIS_TAG"
+echo -e "TRAVIS_COMMIT=${TRAVIS_COMMIT::7}"
+echo -e "TRAVIS_PULL_REQUEST=$TRAVIS_PULL_REQUEST"
+
+# Build Logic
+if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
+  build_pullrequest
+elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" != "$BUILD_SNAPSHOTS_BRANCH" ] && [ "$TRAVIS_TAG" == "" ]  ; then
+  build_otherbranch
+elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "$BUILD_SNAPSHOTS_BRANCH" ] && [ "$TRAVIS_TAG" == "" ] ; then
+  build_snapshot
+elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" != "" ]; then
+  build_tag
+else
+  echo -e "WARN: Unexpected env variable values => Branch [$TRAVIS_BRANCH], Tag [$TRAVIS_TAG], Pull Request [#$TRAVIS_PULL_REQUEST]"
+  ./gradlew clean build
+fi
+
+exit ${EXIT_STATUS}


[fineract-cn-cheques] 12/44: Merge pull request #5 from markusgeiss/develop

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juhan pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-cheques.git

commit 2e269c592d28da8d26717b260db105efa933c9bc
Merge: d0a2e3e 1554537
Author: Markus Geiss <ma...@kuelap.io>
AuthorDate: Mon Sep 4 20:09:30 2017 +0200

    Merge pull request #5 from markusgeiss/develop
    
    fixed validation error when canceling a cheque

 .../cheque/service/internal/command/handler/ChequeAggregate.java      | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)


[fineract-cn-cheques] 40/44: update rat plugin

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juhan pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-cheques.git

commit 773af6c6aed2df106ac265d3361e5c8be20c35aa
Author: Juhan Aasaru <Ju...@nortal.com>
AuthorDate: Sun Oct 6 21:38:07 2019 +0300

    update rat plugin
---
 api/build.gradle            | 2 +-
 component-test/build.gradle | 2 +-
 service/build.gradle        | 2 +-
 shared.gradle               | 3 ++-
 4 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/api/build.gradle b/api/build.gradle
index ef2cc86..d010481 100644
--- a/api/build.gradle
+++ b/api/build.gradle
@@ -27,7 +27,7 @@ buildscript {
 
 plugins {
     id "com.github.hierynomus.license" version "0.13.1"
-    id("org.nosphere.apache.rat") version "0.3.1"
+    id("org.nosphere.apache.rat") version "0.5.2"
     id "com.jfrog.artifactory" version "4.9.5"
     id "io.spring.dependency-management" version "1.0.8.RELEASE"
     id 'maven-publish'
diff --git a/component-test/build.gradle b/component-test/build.gradle
index 84f5516..1bfc22a 100644
--- a/component-test/build.gradle
+++ b/component-test/build.gradle
@@ -31,7 +31,7 @@ buildscript {
 
 plugins {
     id "com.github.hierynomus.license" version "0.13.1"
-    id("org.nosphere.apache.rat") version "0.3.1"
+    id("org.nosphere.apache.rat") version "0.5.2"
     id "com.jfrog.artifactory" version "4.9.5"
     id "org.springframework.boot" version "1.4.3.RELEASE"
     id 'maven-publish'
diff --git a/service/build.gradle b/service/build.gradle
index 5c8a2be..9f5ce5e 100644
--- a/service/build.gradle
+++ b/service/build.gradle
@@ -26,7 +26,7 @@ buildscript {
 
 plugins {
     id "com.github.hierynomus.license" version "0.13.1"
-    id("org.nosphere.apache.rat") version "0.3.1"
+    id("org.nosphere.apache.rat") version "0.5.2"
     id "com.jfrog.artifactory" version "4.9.5"
     id "org.springframework.boot" version "1.4.3.RELEASE"
     id 'maven-publish'
diff --git a/shared.gradle b/shared.gradle
index 96307a2..0285416 100644
--- a/shared.gradle
+++ b/shared.gradle
@@ -104,6 +104,8 @@ license {
 rat {
     // List of exclude directives, defaults to ['**/.gradle/**']
     excludes = [
+            "**/*.log",
+            "**/banner.txt",
             "**/.idea/**",
             "**/.gradle/**",
             "**/gradle/**",
@@ -113,5 +115,4 @@ rat {
             "README.md",
             "**/.dockerignore/**"
     ]
-    plainOutput = true
 }


[fineract-cn-cheques] 15/44: fixed issue with processing open cheques

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juhan pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-cheques.git

commit af64ef2559252f3f32b80529ab4e520070950879
Author: mgeiss <mg...@mifos.org>
AuthorDate: Mon Sep 11 13:43:43 2017 +0200

    fixed issue with processing open cheques
---
 .../src/main/java/io/mifos/cheque/TestCheques.java | 48 +++++++++++++++++++++-
 .../internal/command/handler/ChequeAggregate.java  |  2 +-
 2 files changed, 48 insertions(+), 2 deletions(-)

diff --git a/component-test/src/main/java/io/mifos/cheque/TestCheques.java b/component-test/src/main/java/io/mifos/cheque/TestCheques.java
index 22cd88e..0acbd3b 100644
--- a/component-test/src/main/java/io/mifos/cheque/TestCheques.java
+++ b/component-test/src/main/java/io/mifos/cheque/TestCheques.java
@@ -35,7 +35,14 @@ import org.junit.Assert;
 import org.junit.Test;
 import org.mockito.Matchers;
 import org.mockito.Mockito;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.mock.mockito.MockBean;
+import org.springframework.validation.AbstractErrors;
+import org.springframework.validation.BeanPropertyBindingResult;
+import org.springframework.validation.BindingResult;
+import org.springframework.validation.Errors;
+import org.springframework.validation.Validator;
+import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean;
 
 import java.util.Collections;
 import java.util.UUID;
@@ -51,6 +58,9 @@ public class TestCheques extends AbstractChequeTest {
   @MockBean
   private AccountingService accountingServiceSpy;
 
+  @Autowired
+  private Validator validator;
+
   public TestCheques() {
     super();
   }
@@ -158,7 +168,6 @@ public class TestCheques extends AbstractChequeTest {
         .doAnswer(invocation -> false)
         .when(this.accountingServiceSpy).accountExists(randomCheque.getMicr().getAccountNumber());
 
-
     final ChequeTransaction chequeTransaction = new ChequeTransaction();
     chequeTransaction.setChequesReceivableAccount(RandomStringUtils.randomAlphabetic(34));
     chequeTransaction.setCheque(randomCheque);
@@ -209,4 +218,41 @@ public class TestCheques extends AbstractChequeTest {
         .verify(this.accountingServiceSpy, Mockito.times(2))
         .processJournalEntry(Matchers.any(JournalEntry.class));
   }
+
+  @Test
+  public void shouldProcessOpenCheque() throws Exception {
+      final Cheque randomCheque = Fixture.createRandomCheque();
+      randomCheque.setOpenCheque(Boolean.TRUE);
+
+      Mockito
+          .doAnswer(invocation -> false)
+          .when(this.organizationServiceSpy).officeExistsByBranchSortCode(randomCheque.getMicr().getBranchSortCode());
+
+      Mockito
+          .doAnswer(invocation -> false)
+          .when(this.accountingServiceSpy).accountExists(randomCheque.getMicr().getAccountNumber());
+
+      Mockito.doAnswer(invocation -> {
+        final JournalEntry journalEntry = invocation.getArgumentAt(0, JournalEntry.class);
+        final BeanPropertyBindingResult bindingResult = new BeanPropertyBindingResult(journalEntry, "journalEntry");
+        this.validator.validate(journalEntry, bindingResult);
+        if (bindingResult.getErrorCount() != 0) {
+          bindingResult.getAllErrors().forEach(objectError -> {
+            System.out.println(objectError.toString());
+          });
+        }
+        return invocation.getMethod().getReturnType();
+      }).when(this.accountingServiceSpy).processJournalEntry(Matchers.any(JournalEntry.class));
+
+      final ChequeTransaction chequeTransaction = new ChequeTransaction();
+      chequeTransaction.setChequesReceivableAccount(RandomStringUtils.randomAlphabetic(34));
+      chequeTransaction.setCheque(randomCheque);
+      chequeTransaction.setCreditorAccountNumber(RandomStringUtils.randomAlphanumeric(34));
+      super.chequeManager.process(chequeTransaction);
+
+      Assert.assertTrue(
+          super.eventRecorder.wait(EventConstants.CHEQUE_TRANSACTION, MICRParser.toIdentifier(randomCheque.getMicr()))
+      );
+
+    }
 }
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/command/handler/ChequeAggregate.java b/service/src/main/java/io/mifos/cheque/service/internal/command/handler/ChequeAggregate.java
index a3b1762..3bb746a 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/command/handler/ChequeAggregate.java
+++ b/service/src/main/java/io/mifos/cheque/service/internal/command/handler/ChequeAggregate.java
@@ -138,7 +138,7 @@ public class ChequeAggregate {
     final JournalEntry journalEntry = new JournalEntry();
     journalEntry.setTransactionIdentifier("chq-tx-" + UUID.randomUUID().toString());
     final String transactionType =
-        chequeEntity.getOpenCheque() != null && chequeEntity.getOpenCheque() ? "OPCQ " : "ORCQ";
+        chequeEntity.getOpenCheque() != null && chequeEntity.getOpenCheque() ? "OPCQ" : "ORCQ";
     journalEntry.setTransactionType(transactionType);
     journalEntry.setTransactionDate(DateConverter.toIsoString(chequeEntity.getCreatedOn()));
     journalEntry.setMessage(transactionType);


[fineract-cn-cheques] 34/44: Adding rat report to After Failure procedure

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juhan pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-cheques.git

commit af012d5d368c16dece1aa474153238b406feec9d
Author: ebenezergraham <eg...@alustudent.com>
AuthorDate: Wed May 29 17:51:20 2019 +0400

    Adding rat report to After Failure procedure
---
 .travis.yml   | 3 +++
 shared.gradle | 1 +
 2 files changed, 4 insertions(+)

diff --git a/.travis.yml b/.travis.yml
index 64e41ff..d7f187e 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -28,3 +28,6 @@ env:
     - ARTIFACTORY_URL=https://mifos.jfrog.io/mifos
     - ARTIFACTORY_USER=travis-ci
     - secure: "H9DMI6bUesXtE5friHQMFxJaRzyf7qSdjxJRPilM+E0eGXE91o8HKWTu2mx0ybukxkMjB0PWJt9r3NlgjysMSxpZFNErphtX5wQHWSoPwOiyKkh7kfCMmyst0tJvx86N8Furd0dWEMb4FoWMllKt4hsu2kTjvfL8h/vac2SRgLi8TBh41iltufZGEVBQmxQdF2PkCowpXKprMY5QYe8eEysxEKnu4EvZjPgT5u4c7d/ckM2lyEEDGHhUjJh3X556GV9x71dCvCVPVqzVO4jfcUlBB5baiI7sWzdfbBg3dpbFA0jFJNHCOjvipdkUf2yaESf3rCYpDE7ins+jbweLQyCRYjLczyGYZr+kFD73O5026qyMRH7+N+LvklYaN5lxsC5G3nbc5S8XEPrgmtFo7tnslJmtO95KPWPGYBO+aoLHpBbeaIwkGLqqdC4eqEGVy/queLat4TJt2Ta041p/VJbn4XskM [...]
+after_failure:
+  - ./gradlew rat
+  - cat api/build/reports/rat/rat-report.txt
diff --git a/shared.gradle b/shared.gradle
index 37de82e..f069304 100644
--- a/shared.gradle
+++ b/shared.gradle
@@ -116,4 +116,5 @@ rat {
             "gradlew.bat",
             "README.md"
     ]
+    plainOutput = true
 }


[fineract-cn-cheques] 28/44: Change package names from mifos to apache fineract.

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juhan pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-cheques.git

commit 4abe7dde474131bb9ddaa2e1825b9214c7a90729
Author: Myrle Krantz <my...@apache.org>
AuthorDate: Mon Apr 16 11:51:08 2018 +0200

    Change package names from mifos to apache fineract.
---
 .../fineract/cn}/cheque/api/v1/EventConstants.java |  2 +-
 .../cn}/cheque/api/v1/PermittableGroupIds.java     |  2 +-
 .../cn}/cheque/api/v1/client/ChequeManager.java    | 12 ++++----
 .../client/DependingResourceNotValidException.java |  2 +-
 .../v1/client/InvalidChequeNumberException.java    |  2 +-
 .../fineract/cn}/cheque/api/v1/domain/Action.java  |  2 +-
 .../fineract/cn}/cheque/api/v1/domain/Cheque.java  |  2 +-
 .../api/v1/domain/ChequeProcessingCommand.java     |  2 +-
 .../cheque/api/v1/domain/ChequeTransaction.java    |  2 +-
 .../cn}/cheque/api/v1/domain/IssuingCount.java     |  2 +-
 .../fineract/cn}/cheque/api/v1/domain/MICR.java    |  2 +-
 .../cn}/cheque/api/v1/domain/MICRResolution.java   |  2 +-
 .../fineract/cn}/cheque/api/v1/domain/State.java   |  2 +-
 .../fineract/cn}/cheque/AbstractChequeTest.java    | 12 ++++----
 .../apache/fineract/cn}/cheque/Fixture.java        |  6 ++--
 .../fineract/cn}/cheque/SuiteTestEnvironment.java  |  2 +-
 .../apache/fineract/cn}/cheque/TestCheques.java    | 24 +++++++--------
 .../fineract/cn}/cheque/TestIssuingCheques.java    | 12 ++++----
 .../apache/fineract/cn}/cheque/TestMICR.java       | 30 +++++++++---------
 .../apache/fineract/cn}/cheque/TestSuite.java      |  2 +-
 .../cn}/cheque/listener/ChequeEventListener.java   |  6 ++--
 .../listener/ManagementEventMigrationListener.java |  6 ++--
 .../cn}/cheque/service/ChequeApplication.java      |  2 +-
 .../cn}/cheque/service/ChequeConfiguration.java    | 12 ++++----
 .../cn}/cheque/service/ServiceConstants.java       |  2 +-
 .../command/ApproveChequeTransactionCommand.java   |  2 +-
 .../command/CancelChequeTransactionCommand.java    |  2 +-
 .../internal/command/ChequeTransactionCommand.java |  4 +--
 .../internal/command/IssueChequesCommand.java      |  2 +-
 .../service/internal/command/MigrationCommand.java |  2 +-
 .../internal/command/handler/ChequeAggregate.java  | 36 +++++++++++-----------
 .../command/handler/ManagementAggregate.java       |  8 ++---
 .../cheque/service/internal/format/MICRParser.java |  4 +--
 .../service/internal/mapper/ChequeMapper.java      |  8 ++---
 .../service/internal/repository/ChequeEntity.java  |  2 +-
 .../internal/repository/ChequeRepository.java      |  2 +-
 .../internal/repository/IssuedChequeEntity.java    |  2 +-
 .../repository/IssuedChequeRepository.java         |  2 +-
 .../specification/ChequeSpecification.java         |  6 ++--
 .../service/internal/service/ChequeService.java    | 14 ++++-----
 .../service/internal/service/MICRService.java      | 18 +++++------
 .../internal/service/helper/AccountingService.java |  4 +--
 .../internal/service/helper/CustomerService.java   |  4 +--
 .../internal/service/helper/DepositService.java    |  4 +--
 .../service/helper/OrganizationService.java        |  4 +--
 .../rest/ChequeManagementRestController.java       |  6 ++--
 .../cheque/service/rest/ChequeRestController.java  | 24 +++++++--------
 .../rest/ChequeTransactionRestController.java      | 16 +++++-----
 .../cheque/service/rest/MIRCRestController.java    | 12 ++++----
 .../service/internal/format/TestMICRParser.java    |  4 +--
 50 files changed, 172 insertions(+), 172 deletions(-)

diff --git a/api/src/main/java/io/mifos/cheque/api/v1/EventConstants.java b/api/src/main/java/org/apache/fineract/cn/cheque/api/v1/EventConstants.java
similarity index 97%
rename from api/src/main/java/io/mifos/cheque/api/v1/EventConstants.java
rename to api/src/main/java/org/apache/fineract/cn/cheque/api/v1/EventConstants.java
index d769670..cdc616c 100644
--- a/api/src/main/java/io/mifos/cheque/api/v1/EventConstants.java
+++ b/api/src/main/java/org/apache/fineract/cn/cheque/api/v1/EventConstants.java
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.cheque.api.v1;
+package org.apache.fineract.cn.cheque.api.v1;
 
 @SuppressWarnings("unused")
 public interface EventConstants {
diff --git a/api/src/main/java/io/mifos/cheque/api/v1/PermittableGroupIds.java b/api/src/main/java/org/apache/fineract/cn/cheque/api/v1/PermittableGroupIds.java
similarity index 95%
rename from api/src/main/java/io/mifos/cheque/api/v1/PermittableGroupIds.java
rename to api/src/main/java/org/apache/fineract/cn/cheque/api/v1/PermittableGroupIds.java
index f2ea3cc..2dbfc45 100644
--- a/api/src/main/java/io/mifos/cheque/api/v1/PermittableGroupIds.java
+++ b/api/src/main/java/org/apache/fineract/cn/cheque/api/v1/PermittableGroupIds.java
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.cheque.api.v1;
+package org.apache.fineract.cn.cheque.api.v1;
 
 @SuppressWarnings("unused")
 public interface PermittableGroupIds {
diff --git a/api/src/main/java/io/mifos/cheque/api/v1/client/ChequeManager.java b/api/src/main/java/org/apache/fineract/cn/cheque/api/v1/client/ChequeManager.java
similarity index 91%
rename from api/src/main/java/io/mifos/cheque/api/v1/client/ChequeManager.java
rename to api/src/main/java/org/apache/fineract/cn/cheque/api/v1/client/ChequeManager.java
index 51a6875..bf27ce5 100644
--- a/api/src/main/java/io/mifos/cheque/api/v1/client/ChequeManager.java
+++ b/api/src/main/java/org/apache/fineract/cn/cheque/api/v1/client/ChequeManager.java
@@ -16,13 +16,13 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.cheque.api.v1.client;
+package org.apache.fineract.cn.cheque.api.v1.client;
 
-import io.mifos.cheque.api.v1.domain.Cheque;
-import io.mifos.cheque.api.v1.domain.ChequeProcessingCommand;
-import io.mifos.cheque.api.v1.domain.ChequeTransaction;
-import io.mifos.cheque.api.v1.domain.IssuingCount;
-import io.mifos.cheque.api.v1.domain.MICRResolution;
+import org.apache.fineract.cn.cheque.api.v1.domain.Cheque;
+import org.apache.fineract.cn.cheque.api.v1.domain.ChequeProcessingCommand;
+import org.apache.fineract.cn.cheque.api.v1.domain.ChequeTransaction;
+import org.apache.fineract.cn.cheque.api.v1.domain.IssuingCount;
+import org.apache.fineract.cn.cheque.api.v1.domain.MICRResolution;
 import java.util.List;
 import javax.validation.Valid;
 import org.apache.fineract.cn.api.annotation.ThrowsException;
diff --git a/api/src/main/java/io/mifos/cheque/api/v1/client/DependingResourceNotValidException.java b/api/src/main/java/org/apache/fineract/cn/cheque/api/v1/client/DependingResourceNotValidException.java
similarity index 94%
rename from api/src/main/java/io/mifos/cheque/api/v1/client/DependingResourceNotValidException.java
rename to api/src/main/java/org/apache/fineract/cn/cheque/api/v1/client/DependingResourceNotValidException.java
index 1d0dd3b..b55ddc0 100644
--- a/api/src/main/java/io/mifos/cheque/api/v1/client/DependingResourceNotValidException.java
+++ b/api/src/main/java/org/apache/fineract/cn/cheque/api/v1/client/DependingResourceNotValidException.java
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.cheque.api.v1.client;
+package org.apache.fineract.cn.cheque.api.v1.client;
 
 public class DependingResourceNotValidException extends RuntimeException {
 }
diff --git a/api/src/main/java/io/mifos/cheque/api/v1/client/InvalidChequeNumberException.java b/api/src/main/java/org/apache/fineract/cn/cheque/api/v1/client/InvalidChequeNumberException.java
similarity index 94%
rename from api/src/main/java/io/mifos/cheque/api/v1/client/InvalidChequeNumberException.java
rename to api/src/main/java/org/apache/fineract/cn/cheque/api/v1/client/InvalidChequeNumberException.java
index 7a5fca8..90018c7 100644
--- a/api/src/main/java/io/mifos/cheque/api/v1/client/InvalidChequeNumberException.java
+++ b/api/src/main/java/org/apache/fineract/cn/cheque/api/v1/client/InvalidChequeNumberException.java
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.cheque.api.v1.client;
+package org.apache.fineract.cn.cheque.api.v1.client;
 
 public class InvalidChequeNumberException extends RuntimeException {
 }
diff --git a/api/src/main/java/io/mifos/cheque/api/v1/domain/Action.java b/api/src/main/java/org/apache/fineract/cn/cheque/api/v1/domain/Action.java
similarity index 94%
rename from api/src/main/java/io/mifos/cheque/api/v1/domain/Action.java
rename to api/src/main/java/org/apache/fineract/cn/cheque/api/v1/domain/Action.java
index 027898c..1859be2 100644
--- a/api/src/main/java/io/mifos/cheque/api/v1/domain/Action.java
+++ b/api/src/main/java/org/apache/fineract/cn/cheque/api/v1/domain/Action.java
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.cheque.api.v1.domain;
+package org.apache.fineract.cn.cheque.api.v1.domain;
 
 public enum Action {
   APPROVE,
diff --git a/api/src/main/java/io/mifos/cheque/api/v1/domain/Cheque.java b/api/src/main/java/org/apache/fineract/cn/cheque/api/v1/domain/Cheque.java
similarity index 98%
rename from api/src/main/java/io/mifos/cheque/api/v1/domain/Cheque.java
rename to api/src/main/java/org/apache/fineract/cn/cheque/api/v1/domain/Cheque.java
index a162157..85b4345 100644
--- a/api/src/main/java/io/mifos/cheque/api/v1/domain/Cheque.java
+++ b/api/src/main/java/org/apache/fineract/cn/cheque/api/v1/domain/Cheque.java
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.cheque.api.v1.domain;
+package org.apache.fineract.cn.cheque.api.v1.domain;
 
 import org.hibernate.validator.constraints.NotEmpty;
 
diff --git a/api/src/main/java/io/mifos/cheque/api/v1/domain/ChequeProcessingCommand.java b/api/src/main/java/org/apache/fineract/cn/cheque/api/v1/domain/ChequeProcessingCommand.java
similarity index 95%
rename from api/src/main/java/io/mifos/cheque/api/v1/domain/ChequeProcessingCommand.java
rename to api/src/main/java/org/apache/fineract/cn/cheque/api/v1/domain/ChequeProcessingCommand.java
index fe3490c..16e7ae7 100644
--- a/api/src/main/java/io/mifos/cheque/api/v1/domain/ChequeProcessingCommand.java
+++ b/api/src/main/java/org/apache/fineract/cn/cheque/api/v1/domain/ChequeProcessingCommand.java
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.cheque.api.v1.domain;
+package org.apache.fineract.cn.cheque.api.v1.domain;
 
 import javax.validation.constraints.NotNull;
 
diff --git a/api/src/main/java/io/mifos/cheque/api/v1/domain/ChequeTransaction.java b/api/src/main/java/org/apache/fineract/cn/cheque/api/v1/domain/ChequeTransaction.java
similarity index 97%
rename from api/src/main/java/io/mifos/cheque/api/v1/domain/ChequeTransaction.java
rename to api/src/main/java/org/apache/fineract/cn/cheque/api/v1/domain/ChequeTransaction.java
index 9663dd4..50cf01f 100644
--- a/api/src/main/java/io/mifos/cheque/api/v1/domain/ChequeTransaction.java
+++ b/api/src/main/java/org/apache/fineract/cn/cheque/api/v1/domain/ChequeTransaction.java
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.cheque.api.v1.domain;
+package org.apache.fineract.cn.cheque.api.v1.domain;
 
 import javax.validation.Valid;
 import javax.validation.constraints.NotNull;
diff --git a/api/src/main/java/io/mifos/cheque/api/v1/domain/IssuingCount.java b/api/src/main/java/org/apache/fineract/cn/cheque/api/v1/domain/IssuingCount.java
similarity index 96%
rename from api/src/main/java/io/mifos/cheque/api/v1/domain/IssuingCount.java
rename to api/src/main/java/org/apache/fineract/cn/cheque/api/v1/domain/IssuingCount.java
index 4a46ff3..577623a 100644
--- a/api/src/main/java/io/mifos/cheque/api/v1/domain/IssuingCount.java
+++ b/api/src/main/java/org/apache/fineract/cn/cheque/api/v1/domain/IssuingCount.java
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.cheque.api.v1.domain;
+package org.apache.fineract.cn.cheque.api.v1.domain;
 
 import javax.validation.constraints.Min;
 import javax.validation.constraints.NotNull;
diff --git a/api/src/main/java/io/mifos/cheque/api/v1/domain/MICR.java b/api/src/main/java/org/apache/fineract/cn/cheque/api/v1/domain/MICR.java
similarity index 96%
rename from api/src/main/java/io/mifos/cheque/api/v1/domain/MICR.java
rename to api/src/main/java/org/apache/fineract/cn/cheque/api/v1/domain/MICR.java
index 230e09c..bef6282 100644
--- a/api/src/main/java/io/mifos/cheque/api/v1/domain/MICR.java
+++ b/api/src/main/java/org/apache/fineract/cn/cheque/api/v1/domain/MICR.java
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.cheque.api.v1.domain;
+package org.apache.fineract.cn.cheque.api.v1.domain;
 
 import org.apache.fineract.cn.lang.validation.constraints.ValidIdentifier;
 
diff --git a/api/src/main/java/io/mifos/cheque/api/v1/domain/MICRResolution.java b/api/src/main/java/org/apache/fineract/cn/cheque/api/v1/domain/MICRResolution.java
similarity index 95%
rename from api/src/main/java/io/mifos/cheque/api/v1/domain/MICRResolution.java
rename to api/src/main/java/org/apache/fineract/cn/cheque/api/v1/domain/MICRResolution.java
index 3044183..473d447 100644
--- a/api/src/main/java/io/mifos/cheque/api/v1/domain/MICRResolution.java
+++ b/api/src/main/java/org/apache/fineract/cn/cheque/api/v1/domain/MICRResolution.java
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.cheque.api.v1.domain;
+package org.apache.fineract.cn.cheque.api.v1.domain;
 
 public class MICRResolution {
 
diff --git a/api/src/main/java/io/mifos/cheque/api/v1/domain/State.java b/api/src/main/java/org/apache/fineract/cn/cheque/api/v1/domain/State.java
similarity index 94%
rename from api/src/main/java/io/mifos/cheque/api/v1/domain/State.java
rename to api/src/main/java/org/apache/fineract/cn/cheque/api/v1/domain/State.java
index ac73548..daec6f3 100644
--- a/api/src/main/java/io/mifos/cheque/api/v1/domain/State.java
+++ b/api/src/main/java/org/apache/fineract/cn/cheque/api/v1/domain/State.java
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.cheque.api.v1.domain;
+package org.apache.fineract.cn.cheque.api.v1.domain;
 
 public enum State {
   PENDING,
diff --git a/component-test/src/main/java/io/mifos/cheque/AbstractChequeTest.java b/component-test/src/main/java/org/apache/fineract/cn/cheque/AbstractChequeTest.java
similarity index 91%
rename from component-test/src/main/java/io/mifos/cheque/AbstractChequeTest.java
rename to component-test/src/main/java/org/apache/fineract/cn/cheque/AbstractChequeTest.java
index 3710d18..e45a167 100644
--- a/component-test/src/main/java/io/mifos/cheque/AbstractChequeTest.java
+++ b/component-test/src/main/java/org/apache/fineract/cn/cheque/AbstractChequeTest.java
@@ -16,11 +16,11 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.cheque;
+package org.apache.fineract.cn.cheque;
 
-import io.mifos.cheque.api.v1.EventConstants;
-import io.mifos.cheque.api.v1.client.ChequeManager;
-import io.mifos.cheque.service.ChequeConfiguration;
+import org.apache.fineract.cn.cheque.api.v1.EventConstants;
+import org.apache.fineract.cn.cheque.api.v1.client.ChequeManager;
+import org.apache.fineract.cn.cheque.service.ChequeConfiguration;
 import org.apache.fineract.cn.anubis.test.v1.TenantApplicationSecurityEnvironmentTestRule;
 import org.apache.fineract.cn.api.context.AutoUserContext;
 import org.apache.fineract.cn.lang.ApplicationName;
@@ -103,10 +103,10 @@ public abstract class AbstractChequeTest extends SuiteTestEnvironment {
 
   @Configuration
   @EnableEventRecording
-  @EnableFeignClients(basePackages = {"io.mifos.cheque.api.v1"})
+  @EnableFeignClients(basePackages = {"org.apache.fineract.cn.cheque.api.v1"})
   @RibbonClient(name = APP_NAME)
   @Import({ChequeConfiguration.class})
-  @ComponentScan("io.mifos.cheque.listener")
+  @ComponentScan("org.apache.fineract.cn.cheque.listener")
   public static class TestConfiguration {
     public TestConfiguration() {
       super();
diff --git a/component-test/src/main/java/io/mifos/cheque/Fixture.java b/component-test/src/main/java/org/apache/fineract/cn/cheque/Fixture.java
similarity index 92%
rename from component-test/src/main/java/io/mifos/cheque/Fixture.java
rename to component-test/src/main/java/org/apache/fineract/cn/cheque/Fixture.java
index a1f519b..4e7a875 100644
--- a/component-test/src/main/java/io/mifos/cheque/Fixture.java
+++ b/component-test/src/main/java/org/apache/fineract/cn/cheque/Fixture.java
@@ -16,10 +16,10 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.cheque;
+package org.apache.fineract.cn.cheque;
 
-import io.mifos.cheque.api.v1.domain.Cheque;
-import io.mifos.cheque.api.v1.domain.MICR;
+import org.apache.fineract.cn.cheque.api.v1.domain.Cheque;
+import org.apache.fineract.cn.cheque.api.v1.domain.MICR;
 import java.time.Clock;
 import java.time.LocalDate;
 import org.apache.commons.lang3.RandomStringUtils;
diff --git a/component-test/src/main/java/io/mifos/cheque/SuiteTestEnvironment.java b/component-test/src/main/java/org/apache/fineract/cn/cheque/SuiteTestEnvironment.java
similarity index 97%
rename from component-test/src/main/java/io/mifos/cheque/SuiteTestEnvironment.java
rename to component-test/src/main/java/org/apache/fineract/cn/cheque/SuiteTestEnvironment.java
index a1b27c1..c2b5fb4 100644
--- a/component-test/src/main/java/io/mifos/cheque/SuiteTestEnvironment.java
+++ b/component-test/src/main/java/org/apache/fineract/cn/cheque/SuiteTestEnvironment.java
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.cheque;
+package org.apache.fineract.cn.cheque;
 
 
 import org.apache.fineract.cn.test.env.TestEnvironment;
diff --git a/component-test/src/main/java/io/mifos/cheque/TestCheques.java b/component-test/src/main/java/org/apache/fineract/cn/cheque/TestCheques.java
similarity index 92%
rename from component-test/src/main/java/io/mifos/cheque/TestCheques.java
rename to component-test/src/main/java/org/apache/fineract/cn/cheque/TestCheques.java
index ed20d64..c312032 100644
--- a/component-test/src/main/java/io/mifos/cheque/TestCheques.java
+++ b/component-test/src/main/java/org/apache/fineract/cn/cheque/TestCheques.java
@@ -16,20 +16,20 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.cheque;
+package org.apache.fineract.cn.cheque;
 
 import com.google.common.collect.Sets;
-import io.mifos.cheque.api.v1.EventConstants;
-import io.mifos.cheque.api.v1.domain.Action;
-import io.mifos.cheque.api.v1.domain.Cheque;
-import io.mifos.cheque.api.v1.domain.ChequeProcessingCommand;
-import io.mifos.cheque.api.v1.domain.ChequeTransaction;
-import io.mifos.cheque.api.v1.domain.IssuingCount;
-import io.mifos.cheque.api.v1.domain.State;
-import io.mifos.cheque.service.internal.format.MICRParser;
-import io.mifos.cheque.service.internal.service.helper.AccountingService;
-import io.mifos.cheque.service.internal.service.helper.DepositService;
-import io.mifos.cheque.service.internal.service.helper.OrganizationService;
+import org.apache.fineract.cn.cheque.api.v1.EventConstants;
+import org.apache.fineract.cn.cheque.api.v1.domain.Action;
+import org.apache.fineract.cn.cheque.api.v1.domain.Cheque;
+import org.apache.fineract.cn.cheque.api.v1.domain.ChequeProcessingCommand;
+import org.apache.fineract.cn.cheque.api.v1.domain.ChequeTransaction;
+import org.apache.fineract.cn.cheque.api.v1.domain.IssuingCount;
+import org.apache.fineract.cn.cheque.api.v1.domain.State;
+import org.apache.fineract.cn.cheque.service.internal.format.MICRParser;
+import org.apache.fineract.cn.cheque.service.internal.service.helper.AccountingService;
+import org.apache.fineract.cn.cheque.service.internal.service.helper.DepositService;
+import org.apache.fineract.cn.cheque.service.internal.service.helper.OrganizationService;
 import java.util.Collections;
 import java.util.Optional;
 import java.util.UUID;
diff --git a/component-test/src/main/java/io/mifos/cheque/TestIssuingCheques.java b/component-test/src/main/java/org/apache/fineract/cn/cheque/TestIssuingCheques.java
similarity index 89%
rename from component-test/src/main/java/io/mifos/cheque/TestIssuingCheques.java
rename to component-test/src/main/java/org/apache/fineract/cn/cheque/TestIssuingCheques.java
index 158f287..0acfc03 100644
--- a/component-test/src/main/java/io/mifos/cheque/TestIssuingCheques.java
+++ b/component-test/src/main/java/org/apache/fineract/cn/cheque/TestIssuingCheques.java
@@ -16,13 +16,13 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.cheque;
+package org.apache.fineract.cn.cheque;
 
-import io.mifos.cheque.api.v1.domain.IssuingCount;
-import io.mifos.cheque.service.internal.repository.IssuedChequeEntity;
-import io.mifos.cheque.service.internal.repository.IssuedChequeRepository;
-import io.mifos.cheque.service.internal.service.helper.AccountingService;
-import io.mifos.cheque.service.internal.service.helper.DepositService;
+import org.apache.fineract.cn.cheque.api.v1.domain.IssuingCount;
+import org.apache.fineract.cn.cheque.service.internal.repository.IssuedChequeEntity;
+import org.apache.fineract.cn.cheque.service.internal.repository.IssuedChequeRepository;
+import org.apache.fineract.cn.cheque.service.internal.service.helper.AccountingService;
+import org.apache.fineract.cn.cheque.service.internal.service.helper.DepositService;
 import org.apache.commons.lang3.RandomStringUtils;
 import org.junit.Assert;
 import org.junit.Test;
diff --git a/component-test/src/main/java/io/mifos/cheque/TestMICR.java b/component-test/src/main/java/org/apache/fineract/cn/cheque/TestMICR.java
similarity index 90%
rename from component-test/src/main/java/io/mifos/cheque/TestMICR.java
rename to component-test/src/main/java/org/apache/fineract/cn/cheque/TestMICR.java
index 0545e60..6cc08d7 100644
--- a/component-test/src/main/java/io/mifos/cheque/TestMICR.java
+++ b/component-test/src/main/java/org/apache/fineract/cn/cheque/TestMICR.java
@@ -16,21 +16,21 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.cheque;
-
-import io.mifos.cheque.api.v1.EventConstants;
-import io.mifos.cheque.api.v1.client.DependingResourceNotValidException;
-import io.mifos.cheque.api.v1.client.InvalidChequeNumberException;
-import io.mifos.cheque.api.v1.domain.Cheque;
-import io.mifos.cheque.api.v1.domain.ChequeTransaction;
-import io.mifos.cheque.api.v1.domain.IssuingCount;
-import io.mifos.cheque.api.v1.domain.MICR;
-import io.mifos.cheque.api.v1.domain.MICRResolution;
-import io.mifos.cheque.service.internal.format.MICRParser;
-import io.mifos.cheque.service.internal.service.helper.AccountingService;
-import io.mifos.cheque.service.internal.service.helper.CustomerService;
-import io.mifos.cheque.service.internal.service.helper.DepositService;
-import io.mifos.cheque.service.internal.service.helper.OrganizationService;
+package org.apache.fineract.cn.cheque;
+
+import org.apache.fineract.cn.cheque.api.v1.EventConstants;
+import org.apache.fineract.cn.cheque.api.v1.client.DependingResourceNotValidException;
+import org.apache.fineract.cn.cheque.api.v1.client.InvalidChequeNumberException;
+import org.apache.fineract.cn.cheque.api.v1.domain.Cheque;
+import org.apache.fineract.cn.cheque.api.v1.domain.ChequeTransaction;
+import org.apache.fineract.cn.cheque.api.v1.domain.IssuingCount;
+import org.apache.fineract.cn.cheque.api.v1.domain.MICR;
+import org.apache.fineract.cn.cheque.api.v1.domain.MICRResolution;
+import org.apache.fineract.cn.cheque.service.internal.format.MICRParser;
+import org.apache.fineract.cn.cheque.service.internal.service.helper.AccountingService;
+import org.apache.fineract.cn.cheque.service.internal.service.helper.CustomerService;
+import org.apache.fineract.cn.cheque.service.internal.service.helper.DepositService;
+import org.apache.fineract.cn.cheque.service.internal.service.helper.OrganizationService;
 import java.util.Collections;
 import java.util.Optional;
 import org.apache.commons.lang3.RandomStringUtils;
diff --git a/component-test/src/main/java/io/mifos/cheque/TestSuite.java b/component-test/src/main/java/org/apache/fineract/cn/cheque/TestSuite.java
similarity index 96%
rename from component-test/src/main/java/io/mifos/cheque/TestSuite.java
rename to component-test/src/main/java/org/apache/fineract/cn/cheque/TestSuite.java
index 3a8e9a9..634539f 100644
--- a/component-test/src/main/java/io/mifos/cheque/TestSuite.java
+++ b/component-test/src/main/java/org/apache/fineract/cn/cheque/TestSuite.java
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.cheque;
+package org.apache.fineract.cn.cheque;
 
 import org.junit.runner.RunWith;
 import org.junit.runners.Suite;
diff --git a/component-test/src/main/java/io/mifos/cheque/listener/ChequeEventListener.java b/component-test/src/main/java/org/apache/fineract/cn/cheque/listener/ChequeEventListener.java
similarity index 95%
rename from component-test/src/main/java/io/mifos/cheque/listener/ChequeEventListener.java
rename to component-test/src/main/java/org/apache/fineract/cn/cheque/listener/ChequeEventListener.java
index c7cf2a0..979bb19 100644
--- a/component-test/src/main/java/io/mifos/cheque/listener/ChequeEventListener.java
+++ b/component-test/src/main/java/org/apache/fineract/cn/cheque/listener/ChequeEventListener.java
@@ -16,10 +16,10 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.cheque.listener;
+package org.apache.fineract.cn.cheque.listener;
 
-import io.mifos.cheque.AbstractChequeTest;
-import io.mifos.cheque.api.v1.EventConstants;
+import org.apache.fineract.cn.cheque.AbstractChequeTest;
+import org.apache.fineract.cn.cheque.api.v1.EventConstants;
 import org.apache.fineract.cn.lang.config.TenantHeaderFilter;
 import org.apache.fineract.cn.test.listener.EventRecorder;
 import org.slf4j.Logger;
diff --git a/component-test/src/main/java/io/mifos/cheque/listener/ManagementEventMigrationListener.java b/component-test/src/main/java/org/apache/fineract/cn/cheque/listener/ManagementEventMigrationListener.java
similarity index 92%
rename from component-test/src/main/java/io/mifos/cheque/listener/ManagementEventMigrationListener.java
rename to component-test/src/main/java/org/apache/fineract/cn/cheque/listener/ManagementEventMigrationListener.java
index d565c72..0e7a95d 100644
--- a/component-test/src/main/java/io/mifos/cheque/listener/ManagementEventMigrationListener.java
+++ b/component-test/src/main/java/org/apache/fineract/cn/cheque/listener/ManagementEventMigrationListener.java
@@ -16,10 +16,10 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.cheque.listener;
+package org.apache.fineract.cn.cheque.listener;
 
-import io.mifos.cheque.AbstractChequeTest;
-import io.mifos.cheque.api.v1.EventConstants;
+import org.apache.fineract.cn.cheque.AbstractChequeTest;
+import org.apache.fineract.cn.cheque.api.v1.EventConstants;
 import org.apache.fineract.cn.lang.config.TenantHeaderFilter;
 import org.apache.fineract.cn.test.listener.EventRecorder;
 import org.slf4j.Logger;
diff --git a/service/src/main/java/io/mifos/cheque/service/ChequeApplication.java b/service/src/main/java/org/apache/fineract/cn/cheque/service/ChequeApplication.java
similarity index 95%
rename from service/src/main/java/io/mifos/cheque/service/ChequeApplication.java
rename to service/src/main/java/org/apache/fineract/cn/cheque/service/ChequeApplication.java
index 32d34e5..950af33 100644
--- a/service/src/main/java/io/mifos/cheque/service/ChequeApplication.java
+++ b/service/src/main/java/org/apache/fineract/cn/cheque/service/ChequeApplication.java
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.cheque.service;
+package org.apache.fineract.cn.cheque.service;
 
 import org.springframework.boot.SpringApplication;
 
diff --git a/service/src/main/java/io/mifos/cheque/service/ChequeConfiguration.java b/service/src/main/java/org/apache/fineract/cn/cheque/service/ChequeConfiguration.java
similarity index 89%
rename from service/src/main/java/io/mifos/cheque/service/ChequeConfiguration.java
rename to service/src/main/java/org/apache/fineract/cn/cheque/service/ChequeConfiguration.java
index 6f6a52c..610f37c 100644
--- a/service/src/main/java/io/mifos/cheque/service/ChequeConfiguration.java
+++ b/service/src/main/java/org/apache/fineract/cn/cheque/service/ChequeConfiguration.java
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.cheque.service;
+package org.apache.fineract.cn.cheque.service;
 
 import org.apache.fineract.cn.accounting.api.v1.client.LedgerManager;
 import org.apache.fineract.cn.anubis.config.EnableAnubis;
@@ -61,13 +61,13 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
     }
 )
 @ComponentScan({
-    "io.mifos.cheque.service.rest",
-    "io.mifos.cheque.service.internal.service",
-    "io.mifos.cheque.service.internal.repository",
-    "io.mifos.cheque.service.internal.command.handler"
+    "org.apache.fineract.cn.cheque.service.rest",
+    "org.apache.fineract.cn.cheque.service.internal.service",
+    "org.apache.fineract.cn.cheque.service.internal.repository",
+    "org.apache.fineract.cn.cheque.service.internal.command.handler"
 })
 @EnableJpaRepositories({
-    "io.mifos.cheque.service.internal.repository"
+    "org.apache.fineract.cn.cheque.service.internal.repository"
 })
 public class ChequeConfiguration extends WebMvcConfigurerAdapter {
 
diff --git a/service/src/main/java/io/mifos/cheque/service/ServiceConstants.java b/service/src/main/java/org/apache/fineract/cn/cheque/service/ServiceConstants.java
similarity index 95%
rename from service/src/main/java/io/mifos/cheque/service/ServiceConstants.java
rename to service/src/main/java/org/apache/fineract/cn/cheque/service/ServiceConstants.java
index 909a0b2..a7d9e6d 100644
--- a/service/src/main/java/io/mifos/cheque/service/ServiceConstants.java
+++ b/service/src/main/java/org/apache/fineract/cn/cheque/service/ServiceConstants.java
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.cheque.service;
+package org.apache.fineract.cn.cheque.service;
 
 public interface ServiceConstants {
   String LOGGER_NAME = "cheques";
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/command/ApproveChequeTransactionCommand.java b/service/src/main/java/org/apache/fineract/cn/cheque/service/internal/command/ApproveChequeTransactionCommand.java
similarity index 94%
rename from service/src/main/java/io/mifos/cheque/service/internal/command/ApproveChequeTransactionCommand.java
rename to service/src/main/java/org/apache/fineract/cn/cheque/service/internal/command/ApproveChequeTransactionCommand.java
index 85c91e1..936069a 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/command/ApproveChequeTransactionCommand.java
+++ b/service/src/main/java/org/apache/fineract/cn/cheque/service/internal/command/ApproveChequeTransactionCommand.java
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.cheque.service.internal.command;
+package org.apache.fineract.cn.cheque.service.internal.command;
 
 public class ApproveChequeTransactionCommand {
   private final String identifier;
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/command/CancelChequeTransactionCommand.java b/service/src/main/java/org/apache/fineract/cn/cheque/service/internal/command/CancelChequeTransactionCommand.java
similarity index 94%
rename from service/src/main/java/io/mifos/cheque/service/internal/command/CancelChequeTransactionCommand.java
rename to service/src/main/java/org/apache/fineract/cn/cheque/service/internal/command/CancelChequeTransactionCommand.java
index 226829e..41c6ba1 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/command/CancelChequeTransactionCommand.java
+++ b/service/src/main/java/org/apache/fineract/cn/cheque/service/internal/command/CancelChequeTransactionCommand.java
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.cheque.service.internal.command;
+package org.apache.fineract.cn.cheque.service.internal.command;
 
 public class CancelChequeTransactionCommand {
   private final String identifier;
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/command/ChequeTransactionCommand.java b/service/src/main/java/org/apache/fineract/cn/cheque/service/internal/command/ChequeTransactionCommand.java
similarity index 92%
rename from service/src/main/java/io/mifos/cheque/service/internal/command/ChequeTransactionCommand.java
rename to service/src/main/java/org/apache/fineract/cn/cheque/service/internal/command/ChequeTransactionCommand.java
index 1b5ff2d..ad7aa10 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/command/ChequeTransactionCommand.java
+++ b/service/src/main/java/org/apache/fineract/cn/cheque/service/internal/command/ChequeTransactionCommand.java
@@ -16,9 +16,9 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.cheque.service.internal.command;
+package org.apache.fineract.cn.cheque.service.internal.command;
 
-import io.mifos.cheque.api.v1.domain.Cheque;
+import org.apache.fineract.cn.cheque.api.v1.domain.Cheque;
 
 public class ChequeTransactionCommand {
   private final Cheque cheque;
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/command/IssueChequesCommand.java b/service/src/main/java/org/apache/fineract/cn/cheque/service/internal/command/IssueChequesCommand.java
similarity index 95%
rename from service/src/main/java/io/mifos/cheque/service/internal/command/IssueChequesCommand.java
rename to service/src/main/java/org/apache/fineract/cn/cheque/service/internal/command/IssueChequesCommand.java
index e42ca5b..4bf621c 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/command/IssueChequesCommand.java
+++ b/service/src/main/java/org/apache/fineract/cn/cheque/service/internal/command/IssueChequesCommand.java
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.cheque.service.internal.command;
+package org.apache.fineract.cn.cheque.service.internal.command;
 
 public class IssueChequesCommand {
 
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/command/MigrationCommand.java b/service/src/main/java/org/apache/fineract/cn/cheque/service/internal/command/MigrationCommand.java
similarity index 93%
rename from service/src/main/java/io/mifos/cheque/service/internal/command/MigrationCommand.java
rename to service/src/main/java/org/apache/fineract/cn/cheque/service/internal/command/MigrationCommand.java
index 8366e8f..2582995 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/command/MigrationCommand.java
+++ b/service/src/main/java/org/apache/fineract/cn/cheque/service/internal/command/MigrationCommand.java
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.cheque.service.internal.command;
+package org.apache.fineract.cn.cheque.service.internal.command;
 
 public class MigrationCommand {
   public MigrationCommand() {
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/command/handler/ChequeAggregate.java b/service/src/main/java/org/apache/fineract/cn/cheque/service/internal/command/handler/ChequeAggregate.java
similarity index 89%
rename from service/src/main/java/io/mifos/cheque/service/internal/command/handler/ChequeAggregate.java
rename to service/src/main/java/org/apache/fineract/cn/cheque/service/internal/command/handler/ChequeAggregate.java
index 8b6a500..2298561 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/command/handler/ChequeAggregate.java
+++ b/service/src/main/java/org/apache/fineract/cn/cheque/service/internal/command/handler/ChequeAggregate.java
@@ -16,26 +16,26 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.cheque.service.internal.command.handler;
+package org.apache.fineract.cn.cheque.service.internal.command.handler;
 
 import com.google.common.collect.Sets;
-import io.mifos.cheque.api.v1.EventConstants;
-import io.mifos.cheque.api.v1.domain.MICR;
-import io.mifos.cheque.api.v1.domain.State;
-import io.mifos.cheque.service.ServiceConstants;
-import io.mifos.cheque.service.internal.command.ApproveChequeTransactionCommand;
-import io.mifos.cheque.service.internal.command.CancelChequeTransactionCommand;
-import io.mifos.cheque.service.internal.command.ChequeTransactionCommand;
-import io.mifos.cheque.service.internal.command.IssueChequesCommand;
-import io.mifos.cheque.service.internal.format.MICRParser;
-import io.mifos.cheque.service.internal.mapper.ChequeMapper;
-import io.mifos.cheque.service.internal.repository.ChequeEntity;
-import io.mifos.cheque.service.internal.repository.ChequeRepository;
-import io.mifos.cheque.service.internal.repository.IssuedChequeEntity;
-import io.mifos.cheque.service.internal.repository.IssuedChequeRepository;
-import io.mifos.cheque.service.internal.service.helper.AccountingService;
-import io.mifos.cheque.service.internal.service.helper.DepositService;
-import io.mifos.cheque.service.internal.service.helper.OrganizationService;
+import org.apache.fineract.cn.cheque.api.v1.EventConstants;
+import org.apache.fineract.cn.cheque.api.v1.domain.MICR;
+import org.apache.fineract.cn.cheque.api.v1.domain.State;
+import org.apache.fineract.cn.cheque.service.ServiceConstants;
+import org.apache.fineract.cn.cheque.service.internal.command.ApproveChequeTransactionCommand;
+import org.apache.fineract.cn.cheque.service.internal.command.CancelChequeTransactionCommand;
+import org.apache.fineract.cn.cheque.service.internal.command.ChequeTransactionCommand;
+import org.apache.fineract.cn.cheque.service.internal.command.IssueChequesCommand;
+import org.apache.fineract.cn.cheque.service.internal.format.MICRParser;
+import org.apache.fineract.cn.cheque.service.internal.mapper.ChequeMapper;
+import org.apache.fineract.cn.cheque.service.internal.repository.ChequeEntity;
+import org.apache.fineract.cn.cheque.service.internal.repository.ChequeRepository;
+import org.apache.fineract.cn.cheque.service.internal.repository.IssuedChequeEntity;
+import org.apache.fineract.cn.cheque.service.internal.repository.IssuedChequeRepository;
+import org.apache.fineract.cn.cheque.service.internal.service.helper.AccountingService;
+import org.apache.fineract.cn.cheque.service.internal.service.helper.DepositService;
+import org.apache.fineract.cn.cheque.service.internal.service.helper.OrganizationService;
 import java.time.Clock;
 import java.time.LocalDateTime;
 import java.util.List;
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/command/handler/ManagementAggregate.java b/service/src/main/java/org/apache/fineract/cn/cheque/service/internal/command/handler/ManagementAggregate.java
similarity index 90%
rename from service/src/main/java/io/mifos/cheque/service/internal/command/handler/ManagementAggregate.java
rename to service/src/main/java/org/apache/fineract/cn/cheque/service/internal/command/handler/ManagementAggregate.java
index d310658..e541246 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/command/handler/ManagementAggregate.java
+++ b/service/src/main/java/org/apache/fineract/cn/cheque/service/internal/command/handler/ManagementAggregate.java
@@ -16,11 +16,11 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.cheque.service.internal.command.handler;
+package org.apache.fineract.cn.cheque.service.internal.command.handler;
 
-import io.mifos.cheque.api.v1.EventConstants;
-import io.mifos.cheque.service.ServiceConstants;
-import io.mifos.cheque.service.internal.command.MigrationCommand;
+import org.apache.fineract.cn.cheque.api.v1.EventConstants;
+import org.apache.fineract.cn.cheque.service.ServiceConstants;
+import org.apache.fineract.cn.cheque.service.internal.command.MigrationCommand;
 import javax.sql.DataSource;
 import org.apache.fineract.cn.command.annotation.Aggregate;
 import org.apache.fineract.cn.command.annotation.CommandHandler;
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/format/MICRParser.java b/service/src/main/java/org/apache/fineract/cn/cheque/service/internal/format/MICRParser.java
similarity index 94%
rename from service/src/main/java/io/mifos/cheque/service/internal/format/MICRParser.java
rename to service/src/main/java/org/apache/fineract/cn/cheque/service/internal/format/MICRParser.java
index 3bd0d9e..7b5972f 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/format/MICRParser.java
+++ b/service/src/main/java/org/apache/fineract/cn/cheque/service/internal/format/MICRParser.java
@@ -16,9 +16,9 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.cheque.service.internal.format;
+package org.apache.fineract.cn.cheque.service.internal.format;
 
-import io.mifos.cheque.api.v1.domain.MICR;
+import org.apache.fineract.cn.cheque.api.v1.domain.MICR;
 
 public class MICRParser {
 
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/mapper/ChequeMapper.java b/service/src/main/java/org/apache/fineract/cn/cheque/service/internal/mapper/ChequeMapper.java
similarity index 91%
rename from service/src/main/java/io/mifos/cheque/service/internal/mapper/ChequeMapper.java
rename to service/src/main/java/org/apache/fineract/cn/cheque/service/internal/mapper/ChequeMapper.java
index 28547a4..4a1dbc6 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/mapper/ChequeMapper.java
+++ b/service/src/main/java/org/apache/fineract/cn/cheque/service/internal/mapper/ChequeMapper.java
@@ -16,11 +16,11 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.cheque.service.internal.mapper;
+package org.apache.fineract.cn.cheque.service.internal.mapper;
 
-import io.mifos.cheque.api.v1.domain.Cheque;
-import io.mifos.cheque.api.v1.domain.MICR;
-import io.mifos.cheque.service.internal.repository.ChequeEntity;
+import org.apache.fineract.cn.cheque.api.v1.domain.Cheque;
+import org.apache.fineract.cn.cheque.api.v1.domain.MICR;
+import org.apache.fineract.cn.cheque.service.internal.repository.ChequeEntity;
 import java.sql.Date;
 import java.time.Clock;
 import java.time.LocalDateTime;
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/repository/ChequeEntity.java b/service/src/main/java/org/apache/fineract/cn/cheque/service/internal/repository/ChequeEntity.java
similarity index 98%
rename from service/src/main/java/io/mifos/cheque/service/internal/repository/ChequeEntity.java
rename to service/src/main/java/org/apache/fineract/cn/cheque/service/internal/repository/ChequeEntity.java
index 14fced8..4b0f248 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/repository/ChequeEntity.java
+++ b/service/src/main/java/org/apache/fineract/cn/cheque/service/internal/repository/ChequeEntity.java
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.cheque.service.internal.repository;
+package org.apache.fineract.cn.cheque.service.internal.repository;
 
 import java.sql.Date;
 import java.time.LocalDateTime;
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/repository/ChequeRepository.java b/service/src/main/java/org/apache/fineract/cn/cheque/service/internal/repository/ChequeRepository.java
similarity index 95%
rename from service/src/main/java/io/mifos/cheque/service/internal/repository/ChequeRepository.java
rename to service/src/main/java/org/apache/fineract/cn/cheque/service/internal/repository/ChequeRepository.java
index 76a5702..446bba8 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/repository/ChequeRepository.java
+++ b/service/src/main/java/org/apache/fineract/cn/cheque/service/internal/repository/ChequeRepository.java
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.cheque.service.internal.repository;
+package org.apache.fineract.cn.cheque.service.internal.repository;
 
 import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/repository/IssuedChequeEntity.java b/service/src/main/java/org/apache/fineract/cn/cheque/service/internal/repository/IssuedChequeEntity.java
similarity index 97%
rename from service/src/main/java/io/mifos/cheque/service/internal/repository/IssuedChequeEntity.java
rename to service/src/main/java/org/apache/fineract/cn/cheque/service/internal/repository/IssuedChequeEntity.java
index fab2c9f..77c2781 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/repository/IssuedChequeEntity.java
+++ b/service/src/main/java/org/apache/fineract/cn/cheque/service/internal/repository/IssuedChequeEntity.java
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.cheque.service.internal.repository;
+package org.apache.fineract.cn.cheque.service.internal.repository;
 
 import java.time.LocalDateTime;
 import javax.persistence.Column;
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/repository/IssuedChequeRepository.java b/service/src/main/java/org/apache/fineract/cn/cheque/service/internal/repository/IssuedChequeRepository.java
similarity index 94%
rename from service/src/main/java/io/mifos/cheque/service/internal/repository/IssuedChequeRepository.java
rename to service/src/main/java/org/apache/fineract/cn/cheque/service/internal/repository/IssuedChequeRepository.java
index 28be5ac..63c3c0b 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/repository/IssuedChequeRepository.java
+++ b/service/src/main/java/org/apache/fineract/cn/cheque/service/internal/repository/IssuedChequeRepository.java
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.cheque.service.internal.repository;
+package org.apache.fineract.cn.cheque.service.internal.repository;
 
 import org.springframework.data.jpa.repository.JpaRepository;
 
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/repository/specification/ChequeSpecification.java b/service/src/main/java/org/apache/fineract/cn/cheque/service/internal/repository/specification/ChequeSpecification.java
similarity index 87%
rename from service/src/main/java/io/mifos/cheque/service/internal/repository/specification/ChequeSpecification.java
rename to service/src/main/java/org/apache/fineract/cn/cheque/service/internal/repository/specification/ChequeSpecification.java
index 7865ede..e17e64e 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/repository/specification/ChequeSpecification.java
+++ b/service/src/main/java/org/apache/fineract/cn/cheque/service/internal/repository/specification/ChequeSpecification.java
@@ -16,10 +16,10 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.cheque.service.internal.repository.specification;
+package org.apache.fineract.cn.cheque.service.internal.repository.specification;
 
-import io.mifos.cheque.api.v1.domain.State;
-import io.mifos.cheque.service.internal.repository.ChequeEntity;
+import org.apache.fineract.cn.cheque.api.v1.domain.State;
+import org.apache.fineract.cn.cheque.service.internal.repository.ChequeEntity;
 import org.springframework.data.jpa.domain.Specification;
 
 import javax.persistence.criteria.Predicate;
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/service/ChequeService.java b/service/src/main/java/org/apache/fineract/cn/cheque/service/internal/service/ChequeService.java
similarity index 82%
rename from service/src/main/java/io/mifos/cheque/service/internal/service/ChequeService.java
rename to service/src/main/java/org/apache/fineract/cn/cheque/service/internal/service/ChequeService.java
index 24898d7..0a0e209 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/service/ChequeService.java
+++ b/service/src/main/java/org/apache/fineract/cn/cheque/service/internal/service/ChequeService.java
@@ -16,14 +16,14 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.cheque.service.internal.service;
+package org.apache.fineract.cn.cheque.service.internal.service;
 
-import io.mifos.cheque.api.v1.domain.Cheque;
-import io.mifos.cheque.api.v1.domain.MICR;
-import io.mifos.cheque.service.ServiceConstants;
-import io.mifos.cheque.service.internal.mapper.ChequeMapper;
-import io.mifos.cheque.service.internal.repository.ChequeRepository;
-import io.mifos.cheque.service.internal.repository.specification.ChequeSpecification;
+import org.apache.fineract.cn.cheque.api.v1.domain.Cheque;
+import org.apache.fineract.cn.cheque.api.v1.domain.MICR;
+import org.apache.fineract.cn.cheque.service.ServiceConstants;
+import org.apache.fineract.cn.cheque.service.internal.mapper.ChequeMapper;
+import org.apache.fineract.cn.cheque.service.internal.repository.ChequeRepository;
+import org.apache.fineract.cn.cheque.service.internal.repository.specification.ChequeSpecification;
 import org.slf4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/service/MICRService.java b/service/src/main/java/org/apache/fineract/cn/cheque/service/internal/service/MICRService.java
similarity index 84%
rename from service/src/main/java/io/mifos/cheque/service/internal/service/MICRService.java
rename to service/src/main/java/org/apache/fineract/cn/cheque/service/internal/service/MICRService.java
index 865ab45..a913f28 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/service/MICRService.java
+++ b/service/src/main/java/org/apache/fineract/cn/cheque/service/internal/service/MICRService.java
@@ -16,16 +16,16 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.cheque.service.internal.service;
+package org.apache.fineract.cn.cheque.service.internal.service;
 
-import io.mifos.cheque.api.v1.domain.MICR;
-import io.mifos.cheque.api.v1.domain.MICRResolution;
-import io.mifos.cheque.service.ServiceConstants;
-import io.mifos.cheque.service.internal.repository.IssuedChequeEntity;
-import io.mifos.cheque.service.internal.repository.IssuedChequeRepository;
-import io.mifos.cheque.service.internal.service.helper.CustomerService;
-import io.mifos.cheque.service.internal.service.helper.DepositService;
-import io.mifos.cheque.service.internal.service.helper.OrganizationService;
+import org.apache.fineract.cn.cheque.api.v1.domain.MICR;
+import org.apache.fineract.cn.cheque.api.v1.domain.MICRResolution;
+import org.apache.fineract.cn.cheque.service.ServiceConstants;
+import org.apache.fineract.cn.cheque.service.internal.repository.IssuedChequeEntity;
+import org.apache.fineract.cn.cheque.service.internal.repository.IssuedChequeRepository;
+import org.apache.fineract.cn.cheque.service.internal.service.helper.CustomerService;
+import org.apache.fineract.cn.cheque.service.internal.service.helper.DepositService;
+import org.apache.fineract.cn.cheque.service.internal.service.helper.OrganizationService;
 import org.apache.fineract.cn.customer.api.v1.domain.Customer;
 import org.apache.fineract.cn.deposit.api.v1.instance.domain.ProductInstance;
 import org.apache.fineract.cn.lang.ServiceException;
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/service/helper/AccountingService.java b/service/src/main/java/org/apache/fineract/cn/cheque/service/internal/service/helper/AccountingService.java
similarity index 97%
rename from service/src/main/java/io/mifos/cheque/service/internal/service/helper/AccountingService.java
rename to service/src/main/java/org/apache/fineract/cn/cheque/service/internal/service/helper/AccountingService.java
index 0eb32cf..892f8db 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/service/helper/AccountingService.java
+++ b/service/src/main/java/org/apache/fineract/cn/cheque/service/internal/service/helper/AccountingService.java
@@ -16,10 +16,10 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.cheque.service.internal.service.helper;
+package org.apache.fineract.cn.cheque.service.internal.service.helper;
 
 import com.google.common.collect.Sets;
-import io.mifos.cheque.service.ServiceConstants;
+import org.apache.fineract.cn.cheque.service.ServiceConstants;
 import java.time.Clock;
 import java.time.LocalDateTime;
 import java.util.List;
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/service/helper/CustomerService.java b/service/src/main/java/org/apache/fineract/cn/cheque/service/internal/service/helper/CustomerService.java
similarity index 93%
rename from service/src/main/java/io/mifos/cheque/service/internal/service/helper/CustomerService.java
rename to service/src/main/java/org/apache/fineract/cn/cheque/service/internal/service/helper/CustomerService.java
index fb82213..f954e55 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/service/helper/CustomerService.java
+++ b/service/src/main/java/org/apache/fineract/cn/cheque/service/internal/service/helper/CustomerService.java
@@ -16,9 +16,9 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.cheque.service.internal.service.helper;
+package org.apache.fineract.cn.cheque.service.internal.service.helper;
 
-import io.mifos.cheque.service.ServiceConstants;
+import org.apache.fineract.cn.cheque.service.ServiceConstants;
 import java.util.Optional;
 import org.apache.fineract.cn.customer.api.v1.client.CustomerManager;
 import org.apache.fineract.cn.customer.api.v1.client.CustomerNotFoundException;
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/service/helper/DepositService.java b/service/src/main/java/org/apache/fineract/cn/cheque/service/internal/service/helper/DepositService.java
similarity index 96%
rename from service/src/main/java/io/mifos/cheque/service/internal/service/helper/DepositService.java
rename to service/src/main/java/org/apache/fineract/cn/cheque/service/internal/service/helper/DepositService.java
index 92e128f..a041e3f 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/service/helper/DepositService.java
+++ b/service/src/main/java/org/apache/fineract/cn/cheque/service/internal/service/helper/DepositService.java
@@ -16,9 +16,9 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.cheque.service.internal.service.helper;
+package org.apache.fineract.cn.cheque.service.internal.service.helper;
 
-import io.mifos.cheque.service.ServiceConstants;
+import org.apache.fineract.cn.cheque.service.ServiceConstants;
 import java.util.List;
 import java.util.Optional;
 import java.util.stream.Collectors;
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/service/helper/OrganizationService.java b/service/src/main/java/org/apache/fineract/cn/cheque/service/internal/service/helper/OrganizationService.java
similarity index 93%
rename from service/src/main/java/io/mifos/cheque/service/internal/service/helper/OrganizationService.java
rename to service/src/main/java/org/apache/fineract/cn/cheque/service/internal/service/helper/OrganizationService.java
index 3af98fd..24b97d0 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/service/helper/OrganizationService.java
+++ b/service/src/main/java/org/apache/fineract/cn/cheque/service/internal/service/helper/OrganizationService.java
@@ -16,9 +16,9 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.cheque.service.internal.service.helper;
+package org.apache.fineract.cn.cheque.service.internal.service.helper;
 
-import io.mifos.cheque.service.ServiceConstants;
+import org.apache.fineract.cn.cheque.service.ServiceConstants;
 import java.util.Optional;
 import org.apache.fineract.cn.office.api.v1.client.NotFoundException;
 import org.apache.fineract.cn.office.api.v1.client.OrganizationManager;
diff --git a/service/src/main/java/io/mifos/cheque/service/rest/ChequeManagementRestController.java b/service/src/main/java/org/apache/fineract/cn/cheque/service/rest/ChequeManagementRestController.java
similarity index 92%
rename from service/src/main/java/io/mifos/cheque/service/rest/ChequeManagementRestController.java
rename to service/src/main/java/org/apache/fineract/cn/cheque/service/rest/ChequeManagementRestController.java
index 47299b9..f680448 100644
--- a/service/src/main/java/io/mifos/cheque/service/rest/ChequeManagementRestController.java
+++ b/service/src/main/java/org/apache/fineract/cn/cheque/service/rest/ChequeManagementRestController.java
@@ -16,10 +16,10 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.cheque.service.rest;
+package org.apache.fineract.cn.cheque.service.rest;
 
-import io.mifos.cheque.service.ServiceConstants;
-import io.mifos.cheque.service.internal.command.MigrationCommand;
+import org.apache.fineract.cn.cheque.service.ServiceConstants;
+import org.apache.fineract.cn.cheque.service.internal.command.MigrationCommand;
 import org.apache.fineract.cn.anubis.annotation.AcceptedTokenType;
 import org.apache.fineract.cn.anubis.annotation.Permittable;
 import org.apache.fineract.cn.command.gateway.CommandGateway;
diff --git a/service/src/main/java/io/mifos/cheque/service/rest/ChequeRestController.java b/service/src/main/java/org/apache/fineract/cn/cheque/service/rest/ChequeRestController.java
similarity index 86%
rename from service/src/main/java/io/mifos/cheque/service/rest/ChequeRestController.java
rename to service/src/main/java/org/apache/fineract/cn/cheque/service/rest/ChequeRestController.java
index fb990be..b181cbf 100644
--- a/service/src/main/java/io/mifos/cheque/service/rest/ChequeRestController.java
+++ b/service/src/main/java/org/apache/fineract/cn/cheque/service/rest/ChequeRestController.java
@@ -16,19 +16,19 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.cheque.service.rest;
+package org.apache.fineract.cn.cheque.service.rest;
 
-import io.mifos.cheque.api.v1.PermittableGroupIds;
-import io.mifos.cheque.api.v1.domain.Action;
-import io.mifos.cheque.api.v1.domain.Cheque;
-import io.mifos.cheque.api.v1.domain.ChequeProcessingCommand;
-import io.mifos.cheque.api.v1.domain.IssuingCount;
-import io.mifos.cheque.service.ServiceConstants;
-import io.mifos.cheque.service.internal.command.ApproveChequeTransactionCommand;
-import io.mifos.cheque.service.internal.command.CancelChequeTransactionCommand;
-import io.mifos.cheque.service.internal.command.IssueChequesCommand;
-import io.mifos.cheque.service.internal.format.MICRParser;
-import io.mifos.cheque.service.internal.service.ChequeService;
+import org.apache.fineract.cn.cheque.api.v1.PermittableGroupIds;
+import org.apache.fineract.cn.cheque.api.v1.domain.Action;
+import org.apache.fineract.cn.cheque.api.v1.domain.Cheque;
+import org.apache.fineract.cn.cheque.api.v1.domain.ChequeProcessingCommand;
+import org.apache.fineract.cn.cheque.api.v1.domain.IssuingCount;
+import org.apache.fineract.cn.cheque.service.ServiceConstants;
+import org.apache.fineract.cn.cheque.service.internal.command.ApproveChequeTransactionCommand;
+import org.apache.fineract.cn.cheque.service.internal.command.CancelChequeTransactionCommand;
+import org.apache.fineract.cn.cheque.service.internal.command.IssueChequesCommand;
+import org.apache.fineract.cn.cheque.service.internal.format.MICRParser;
+import org.apache.fineract.cn.cheque.service.internal.service.ChequeService;
 import java.util.List;
 import javax.validation.Valid;
 import org.apache.fineract.cn.anubis.annotation.AcceptedTokenType;
diff --git a/service/src/main/java/io/mifos/cheque/service/rest/ChequeTransactionRestController.java b/service/src/main/java/org/apache/fineract/cn/cheque/service/rest/ChequeTransactionRestController.java
similarity index 85%
rename from service/src/main/java/io/mifos/cheque/service/rest/ChequeTransactionRestController.java
rename to service/src/main/java/org/apache/fineract/cn/cheque/service/rest/ChequeTransactionRestController.java
index d499ef0..8236fcb 100644
--- a/service/src/main/java/io/mifos/cheque/service/rest/ChequeTransactionRestController.java
+++ b/service/src/main/java/org/apache/fineract/cn/cheque/service/rest/ChequeTransactionRestController.java
@@ -16,15 +16,15 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.cheque.service.rest;
+package org.apache.fineract.cn.cheque.service.rest;
 
-import io.mifos.cheque.api.v1.PermittableGroupIds;
-import io.mifos.cheque.api.v1.domain.Cheque;
-import io.mifos.cheque.api.v1.domain.ChequeTransaction;
-import io.mifos.cheque.service.ServiceConstants;
-import io.mifos.cheque.service.internal.command.ChequeTransactionCommand;
-import io.mifos.cheque.service.internal.format.MICRParser;
-import io.mifos.cheque.service.internal.service.ChequeService;
+import org.apache.fineract.cn.cheque.api.v1.PermittableGroupIds;
+import org.apache.fineract.cn.cheque.api.v1.domain.Cheque;
+import org.apache.fineract.cn.cheque.api.v1.domain.ChequeTransaction;
+import org.apache.fineract.cn.cheque.service.ServiceConstants;
+import org.apache.fineract.cn.cheque.service.internal.command.ChequeTransactionCommand;
+import org.apache.fineract.cn.cheque.service.internal.format.MICRParser;
+import org.apache.fineract.cn.cheque.service.internal.service.ChequeService;
 import javax.validation.Valid;
 import org.apache.fineract.cn.anubis.annotation.AcceptedTokenType;
 import org.apache.fineract.cn.anubis.annotation.Permittable;
diff --git a/service/src/main/java/io/mifos/cheque/service/rest/MIRCRestController.java b/service/src/main/java/org/apache/fineract/cn/cheque/service/rest/MIRCRestController.java
similarity index 85%
rename from service/src/main/java/io/mifos/cheque/service/rest/MIRCRestController.java
rename to service/src/main/java/org/apache/fineract/cn/cheque/service/rest/MIRCRestController.java
index b9d0252..53c4679 100644
--- a/service/src/main/java/io/mifos/cheque/service/rest/MIRCRestController.java
+++ b/service/src/main/java/org/apache/fineract/cn/cheque/service/rest/MIRCRestController.java
@@ -16,13 +16,13 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.cheque.service.rest;
+package org.apache.fineract.cn.cheque.service.rest;
 
-import io.mifos.cheque.api.v1.PermittableGroupIds;
-import io.mifos.cheque.api.v1.domain.MICRResolution;
-import io.mifos.cheque.service.ServiceConstants;
-import io.mifos.cheque.service.internal.format.MICRParser;
-import io.mifos.cheque.service.internal.service.MICRService;
+import org.apache.fineract.cn.cheque.api.v1.PermittableGroupIds;
+import org.apache.fineract.cn.cheque.api.v1.domain.MICRResolution;
+import org.apache.fineract.cn.cheque.service.ServiceConstants;
+import org.apache.fineract.cn.cheque.service.internal.format.MICRParser;
+import org.apache.fineract.cn.cheque.service.internal.service.MICRService;
 import org.apache.fineract.cn.anubis.annotation.AcceptedTokenType;
 import org.apache.fineract.cn.anubis.annotation.Permittable;
 import org.slf4j.Logger;
diff --git a/service/src/test/java/io/mifos/cheque/service/internal/format/TestMICRParser.java b/service/src/test/java/org/apache/fineract/cn/cheque/service/internal/format/TestMICRParser.java
similarity index 97%
rename from service/src/test/java/io/mifos/cheque/service/internal/format/TestMICRParser.java
rename to service/src/test/java/org/apache/fineract/cn/cheque/service/internal/format/TestMICRParser.java
index da44743..ec06856 100644
--- a/service/src/test/java/io/mifos/cheque/service/internal/format/TestMICRParser.java
+++ b/service/src/test/java/org/apache/fineract/cn/cheque/service/internal/format/TestMICRParser.java
@@ -16,9 +16,9 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.cheque.service.internal.format;
+package org.apache.fineract.cn.cheque.service.internal.format;
 
-import io.mifos.cheque.api.v1.domain.MICR;
+import org.apache.fineract.cn.cheque.api.v1.domain.MICR;
 import org.junit.Assert;
 import org.junit.Test;
 


[fineract-cn-cheques] 17/44: added ability to handle legacy account numbers

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juhan pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-cheques.git

commit b0bb0e8269578f3e9f6dfe7d883d7d6f1f03d4da
Author: mgeiss <mg...@mifos.org>
AuthorDate: Tue Oct 3 11:15:45 2017 +0200

    added ability to handle legacy account numbers
---
 api/src/main/java/io/mifos/cheque/api/v1/domain/Cheque.java |  1 -
 .../io/mifos/cheque/api/v1/domain/ChequeTransaction.java    |  1 -
 .../src/main/java/io/mifos/cheque/TestCheques.java          | 12 ++++++++----
 component-test/src/main/java/io/mifos/cheque/TestMICR.java  |  7 +++++++
 .../service/internal/command/handler/ChequeAggregate.java   |  4 ++--
 .../service/internal/service/helper/AccountingService.java  | 13 ++++++++++---
 6 files changed, 27 insertions(+), 11 deletions(-)

diff --git a/api/src/main/java/io/mifos/cheque/api/v1/domain/Cheque.java b/api/src/main/java/io/mifos/cheque/api/v1/domain/Cheque.java
index a14a968..e50172b 100644
--- a/api/src/main/java/io/mifos/cheque/api/v1/domain/Cheque.java
+++ b/api/src/main/java/io/mifos/cheque/api/v1/domain/Cheque.java
@@ -18,7 +18,6 @@ package io.mifos.cheque.api.v1.domain;
 import org.hibernate.validator.constraints.NotEmpty;
 
 import javax.validation.Valid;
-import javax.validation.constraints.NotNull;
 
 public class Cheque {
 
diff --git a/api/src/main/java/io/mifos/cheque/api/v1/domain/ChequeTransaction.java b/api/src/main/java/io/mifos/cheque/api/v1/domain/ChequeTransaction.java
index 43507bb..1129613 100644
--- a/api/src/main/java/io/mifos/cheque/api/v1/domain/ChequeTransaction.java
+++ b/api/src/main/java/io/mifos/cheque/api/v1/domain/ChequeTransaction.java
@@ -16,7 +16,6 @@
 package io.mifos.cheque.api.v1.domain;
 
 import io.mifos.core.lang.validation.constraints.ValidIdentifier;
-import org.hibernate.validator.constraints.NotEmpty;
 
 import javax.validation.Valid;
 import javax.validation.constraints.NotNull;
diff --git a/component-test/src/main/java/io/mifos/cheque/TestCheques.java b/component-test/src/main/java/io/mifos/cheque/TestCheques.java
index 0acbd3b..f0b8183 100644
--- a/component-test/src/main/java/io/mifos/cheque/TestCheques.java
+++ b/component-test/src/main/java/io/mifos/cheque/TestCheques.java
@@ -16,6 +16,7 @@
 package io.mifos.cheque;
 
 import com.google.common.collect.Sets;
+import io.mifos.accounting.api.v1.domain.Account;
 import io.mifos.accounting.api.v1.domain.Creditor;
 import io.mifos.accounting.api.v1.domain.Debtor;
 import io.mifos.accounting.api.v1.domain.JournalEntry;
@@ -37,14 +38,11 @@ import org.mockito.Matchers;
 import org.mockito.Mockito;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.mock.mockito.MockBean;
-import org.springframework.validation.AbstractErrors;
 import org.springframework.validation.BeanPropertyBindingResult;
-import org.springframework.validation.BindingResult;
-import org.springframework.validation.Errors;
 import org.springframework.validation.Validator;
-import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean;
 
 import java.util.Collections;
+import java.util.Optional;
 import java.util.UUID;
 
 public class TestCheques extends AbstractChequeTest {
@@ -91,6 +89,12 @@ public class TestCheques extends AbstractChequeTest {
         .doAnswer(invocation -> true)
         .when(this.accountingServiceSpy).accountExists(randomCheque.getMicr().getAccountNumber());
 
+    final Account mockedAccount = new Account();
+    mockedAccount.setIdentifier(randomCheque.getMicr().getAccountNumber());
+    Mockito
+        .doAnswer(invocation -> Optional.of(mockedAccount))
+        .when(this.accountingServiceSpy).findAccount(randomCheque.getMicr().getAccountNumber());
+
     final ChequeTransaction chequeTransaction = new ChequeTransaction();
     chequeTransaction.setCheque(randomCheque);
     chequeTransaction.setChequesReceivableAccount(RandomStringUtils.randomAlphabetic(34));
diff --git a/component-test/src/main/java/io/mifos/cheque/TestMICR.java b/component-test/src/main/java/io/mifos/cheque/TestMICR.java
index 197c235..ea96c7b 100644
--- a/component-test/src/main/java/io/mifos/cheque/TestMICR.java
+++ b/component-test/src/main/java/io/mifos/cheque/TestMICR.java
@@ -15,6 +15,7 @@
  */
 package io.mifos.cheque;
 
+import io.mifos.accounting.api.v1.domain.Account;
 import io.mifos.cheque.api.v1.EventConstants;
 import io.mifos.cheque.api.v1.client.DependingResourceNotValidException;
 import io.mifos.cheque.api.v1.client.InvalidChequeNumberException;
@@ -150,6 +151,12 @@ public class TestMICR extends AbstractChequeTest {
         .doAnswer(invocation -> true)
         .when(this.accountingServiceSpy).accountExists(randomCheque.getMicr().getAccountNumber());
 
+    final Account mockedAccount = new Account();
+    mockedAccount.setIdentifier(randomCheque.getMicr().getAccountNumber());
+    Mockito
+        .doAnswer(invocation -> Optional.of(mockedAccount))
+        .when(this.accountingServiceSpy).findAccount(randomCheque.getMicr().getAccountNumber());
+
     final ChequeTransaction chequeTransaction = new ChequeTransaction();
     chequeTransaction.setCheque(randomCheque);
     chequeTransaction.setCreditorAccountNumber(RandomStringUtils.randomAlphanumeric(34));
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/command/handler/ChequeAggregate.java b/service/src/main/java/io/mifos/cheque/service/internal/command/handler/ChequeAggregate.java
index 3bb746a..666742f 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/command/handler/ChequeAggregate.java
+++ b/service/src/main/java/io/mifos/cheque/service/internal/command/handler/ChequeAggregate.java
@@ -158,8 +158,8 @@ public class ChequeAggregate {
       } else {
         throw ServiceException.conflict("Account {0} never issued cheques.", micr.getAccountNumber());
       }
-
-      debtor.setAccountNumber(micr.getAccountNumber());
+      this.accountingService.findAccount(micr.getAccountNumber())
+          .ifPresent(account -> debtor.setAccountNumber(account.getIdentifier()));
       chequeEntity.setState(State.PROCESSED.name());
     } else {
       debtor.setAccountNumber(chequeTransactionCommand.chequesReceivableAccount());
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/service/helper/AccountingService.java b/service/src/main/java/io/mifos/cheque/service/internal/service/helper/AccountingService.java
index 4667c04..46bb20a 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/service/helper/AccountingService.java
+++ b/service/src/main/java/io/mifos/cheque/service/internal/service/helper/AccountingService.java
@@ -19,6 +19,7 @@ import com.google.common.collect.Sets;
 import io.mifos.accounting.api.v1.client.AccountNotFoundException;
 import io.mifos.accounting.api.v1.client.LedgerManager;
 import io.mifos.accounting.api.v1.domain.Account;
+import io.mifos.accounting.api.v1.domain.AccountPage;
 import io.mifos.accounting.api.v1.domain.Creditor;
 import io.mifos.accounting.api.v1.domain.Debtor;
 import io.mifos.accounting.api.v1.domain.JournalEntry;
@@ -67,7 +68,7 @@ public class AccountingService {
       return;
     }
 
-    final Account account = this.ledgerManager.findAccount(sourceAccount);
+    final Account account = this.findAccount(sourceAccount).orElseThrow(AccountNotFoundException::new);
     if (account.getBalance() < totalCharges) {
       throw ServiceException.conflict("Insufficient account balance.");
     }
@@ -80,7 +81,7 @@ public class AccountingService {
     journalEntry.setClerk(UserContextHolder.checkedGetUser());
 
     final Debtor debtor = new Debtor();
-    debtor.setAccountNumber(sourceAccount);
+    debtor.setAccountNumber(account.getIdentifier());
     debtor.setAmount(totalCharges.toString());
     journalEntry.setDebtors(Sets.newHashSet(debtor));
 
@@ -115,7 +116,13 @@ public class AccountingService {
     try {
       return Optional.of(this.ledgerManager.findAccount(accountNumber));
     } catch (final AccountNotFoundException anfex) {
-      return Optional.empty();
+      final AccountPage accountPage = this.ledgerManager.fetchAccounts(true, accountNumber, null, true,
+          0, 10, null, null);
+
+      return accountPage.getAccounts()
+          .stream()
+          .filter(account -> account.getAlternativeAccountNumber().equals(accountNumber))
+          .findFirst();
     }
   }
 }


[fineract-cn-cheques] 27/44: Adjusting to package name changes in upstream repositories.

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juhan pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-cheques.git

commit 95a948bd94f8a4cf6c60391ad3368a1368db7813
Author: Myrle Krantz <my...@apache.org>
AuthorDate: Mon Apr 16 11:46:10 2018 +0200

    Adjusting to package name changes in upstream repositories.
---
 .../mifos/cheque/api/v1/client/ChequeManager.java  | 13 ++++-----
 .../cheque/api/v1/domain/ChequeTransaction.java    |  3 +-
 .../java/io/mifos/cheque/api/v1/domain/MICR.java   |  2 +-
 .../java/io/mifos/cheque/AbstractChequeTest.java   | 12 ++++----
 .../src/main/java/io/mifos/cheque/Fixture.java     |  5 ++--
 .../java/io/mifos/cheque/SuiteTestEnvironment.java |  6 ++--
 .../src/main/java/io/mifos/cheque/TestCheques.java | 15 +++++-----
 .../src/main/java/io/mifos/cheque/TestMICR.java    | 15 +++++-----
 .../mifos/cheque/listener/ChequeEventListener.java |  4 +--
 .../listener/ManagementEventMigrationListener.java |  4 +--
 .../mifos/cheque/service/ChequeConfiguration.java  | 22 +++++++--------
 .../internal/command/handler/ChequeAggregate.java  | 33 +++++++++++-----------
 .../command/handler/ManagementAggregate.java       | 13 ++++-----
 .../service/internal/mapper/ChequeMapper.java      |  5 ++--
 .../service/internal/repository/ChequeEntity.java  |  7 ++---
 .../internal/repository/IssuedChequeEntity.java    |  5 ++--
 .../service/internal/service/MICRService.java      |  8 +++---
 .../internal/service/helper/AccountingService.java | 31 ++++++++++----------
 .../internal/service/helper/CustomerService.java   |  9 +++---
 .../internal/service/helper/DepositService.java    | 19 ++++++-------
 .../service/helper/OrganizationService.java        |  9 +++---
 .../rest/ChequeManagementRestController.java       |  6 ++--
 .../cheque/service/rest/ChequeRestController.java  | 15 +++++-----
 .../rest/ChequeTransactionRestController.java      | 11 ++++----
 .../cheque/service/rest/MIRCRestController.java    |  4 +--
 25 files changed, 130 insertions(+), 146 deletions(-)

diff --git a/api/src/main/java/io/mifos/cheque/api/v1/client/ChequeManager.java b/api/src/main/java/io/mifos/cheque/api/v1/client/ChequeManager.java
index 0b8e33a..51a6875 100644
--- a/api/src/main/java/io/mifos/cheque/api/v1/client/ChequeManager.java
+++ b/api/src/main/java/io/mifos/cheque/api/v1/client/ChequeManager.java
@@ -23,10 +23,12 @@ import io.mifos.cheque.api.v1.domain.ChequeProcessingCommand;
 import io.mifos.cheque.api.v1.domain.ChequeTransaction;
 import io.mifos.cheque.api.v1.domain.IssuingCount;
 import io.mifos.cheque.api.v1.domain.MICRResolution;
-import io.mifos.core.api.annotation.ThrowsException;
-import io.mifos.core.api.annotation.ThrowsExceptions;
-import io.mifos.core.api.util.CustomFeignClientsConfiguration;
-import io.mifos.core.api.util.NotFoundException;
+import java.util.List;
+import javax.validation.Valid;
+import org.apache.fineract.cn.api.annotation.ThrowsException;
+import org.apache.fineract.cn.api.annotation.ThrowsExceptions;
+import org.apache.fineract.cn.api.util.CustomFeignClientsConfiguration;
+import org.apache.fineract.cn.api.util.NotFoundException;
 import org.springframework.cloud.netflix.feign.FeignClient;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.MediaType;
@@ -36,9 +38,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestParam;
 
-import javax.validation.Valid;
-import java.util.List;
-
 @SuppressWarnings("unused")
 @FeignClient(value = "cheques-v1", path = "/cheques/v1", configuration = CustomFeignClientsConfiguration.class)
 public interface ChequeManager {
diff --git a/api/src/main/java/io/mifos/cheque/api/v1/domain/ChequeTransaction.java b/api/src/main/java/io/mifos/cheque/api/v1/domain/ChequeTransaction.java
index ae396d9..9663dd4 100644
--- a/api/src/main/java/io/mifos/cheque/api/v1/domain/ChequeTransaction.java
+++ b/api/src/main/java/io/mifos/cheque/api/v1/domain/ChequeTransaction.java
@@ -18,10 +18,9 @@
  */
 package io.mifos.cheque.api.v1.domain;
 
-import io.mifos.core.lang.validation.constraints.ValidIdentifier;
-
 import javax.validation.Valid;
 import javax.validation.constraints.NotNull;
+import org.apache.fineract.cn.lang.validation.constraints.ValidIdentifier;
 
 public class ChequeTransaction {
 
diff --git a/api/src/main/java/io/mifos/cheque/api/v1/domain/MICR.java b/api/src/main/java/io/mifos/cheque/api/v1/domain/MICR.java
index d46e95f..230e09c 100644
--- a/api/src/main/java/io/mifos/cheque/api/v1/domain/MICR.java
+++ b/api/src/main/java/io/mifos/cheque/api/v1/domain/MICR.java
@@ -18,7 +18,7 @@
  */
 package io.mifos.cheque.api.v1.domain;
 
-import io.mifos.core.lang.validation.constraints.ValidIdentifier;
+import org.apache.fineract.cn.lang.validation.constraints.ValidIdentifier;
 
 public class MICR {
 
diff --git a/component-test/src/main/java/io/mifos/cheque/AbstractChequeTest.java b/component-test/src/main/java/io/mifos/cheque/AbstractChequeTest.java
index 7370b72..3710d18 100644
--- a/component-test/src/main/java/io/mifos/cheque/AbstractChequeTest.java
+++ b/component-test/src/main/java/io/mifos/cheque/AbstractChequeTest.java
@@ -18,15 +18,15 @@
  */
 package io.mifos.cheque;
 
-import io.mifos.anubis.test.v1.TenantApplicationSecurityEnvironmentTestRule;
 import io.mifos.cheque.api.v1.EventConstants;
 import io.mifos.cheque.api.v1.client.ChequeManager;
 import io.mifos.cheque.service.ChequeConfiguration;
-import io.mifos.core.api.context.AutoUserContext;
-import io.mifos.core.lang.ApplicationName;
-import io.mifos.core.test.fixture.TenantDataStoreContextTestRule;
-import io.mifos.core.test.listener.EnableEventRecording;
-import io.mifos.core.test.listener.EventRecorder;
+import org.apache.fineract.cn.anubis.test.v1.TenantApplicationSecurityEnvironmentTestRule;
+import org.apache.fineract.cn.api.context.AutoUserContext;
+import org.apache.fineract.cn.lang.ApplicationName;
+import org.apache.fineract.cn.test.fixture.TenantDataStoreContextTestRule;
+import org.apache.fineract.cn.test.listener.EnableEventRecording;
+import org.apache.fineract.cn.test.listener.EventRecorder;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.ClassRule;
diff --git a/component-test/src/main/java/io/mifos/cheque/Fixture.java b/component-test/src/main/java/io/mifos/cheque/Fixture.java
index e8b411a..a1f519b 100644
--- a/component-test/src/main/java/io/mifos/cheque/Fixture.java
+++ b/component-test/src/main/java/io/mifos/cheque/Fixture.java
@@ -20,11 +20,10 @@ package io.mifos.cheque;
 
 import io.mifos.cheque.api.v1.domain.Cheque;
 import io.mifos.cheque.api.v1.domain.MICR;
-import io.mifos.core.lang.DateConverter;
-import org.apache.commons.lang3.RandomStringUtils;
-
 import java.time.Clock;
 import java.time.LocalDate;
+import org.apache.commons.lang3.RandomStringUtils;
+import org.apache.fineract.cn.lang.DateConverter;
 
 public class Fixture {
 
diff --git a/component-test/src/main/java/io/mifos/cheque/SuiteTestEnvironment.java b/component-test/src/main/java/io/mifos/cheque/SuiteTestEnvironment.java
index 4a8fdab..a1b27c1 100644
--- a/component-test/src/main/java/io/mifos/cheque/SuiteTestEnvironment.java
+++ b/component-test/src/main/java/io/mifos/cheque/SuiteTestEnvironment.java
@@ -19,9 +19,9 @@
 package io.mifos.cheque;
 
 
-import io.mifos.core.test.env.TestEnvironment;
-import io.mifos.core.test.fixture.cassandra.CassandraInitializer;
-import io.mifos.core.test.fixture.mariadb.MariaDBInitializer;
+import org.apache.fineract.cn.test.env.TestEnvironment;
+import org.apache.fineract.cn.test.fixture.cassandra.CassandraInitializer;
+import org.apache.fineract.cn.test.fixture.mariadb.MariaDBInitializer;
 import org.junit.ClassRule;
 import org.junit.rules.RuleChain;
 import org.junit.rules.RunExternalResourceOnce;
diff --git a/component-test/src/main/java/io/mifos/cheque/TestCheques.java b/component-test/src/main/java/io/mifos/cheque/TestCheques.java
index c557408..ed20d64 100644
--- a/component-test/src/main/java/io/mifos/cheque/TestCheques.java
+++ b/component-test/src/main/java/io/mifos/cheque/TestCheques.java
@@ -19,10 +19,6 @@
 package io.mifos.cheque;
 
 import com.google.common.collect.Sets;
-import io.mifos.accounting.api.v1.domain.Account;
-import io.mifos.accounting.api.v1.domain.Creditor;
-import io.mifos.accounting.api.v1.domain.Debtor;
-import io.mifos.accounting.api.v1.domain.JournalEntry;
 import io.mifos.cheque.api.v1.EventConstants;
 import io.mifos.cheque.api.v1.domain.Action;
 import io.mifos.cheque.api.v1.domain.Cheque;
@@ -34,7 +30,14 @@ import io.mifos.cheque.service.internal.format.MICRParser;
 import io.mifos.cheque.service.internal.service.helper.AccountingService;
 import io.mifos.cheque.service.internal.service.helper.DepositService;
 import io.mifos.cheque.service.internal.service.helper.OrganizationService;
+import java.util.Collections;
+import java.util.Optional;
+import java.util.UUID;
 import org.apache.commons.lang3.RandomStringUtils;
+import org.apache.fineract.cn.accounting.api.v1.domain.Account;
+import org.apache.fineract.cn.accounting.api.v1.domain.Creditor;
+import org.apache.fineract.cn.accounting.api.v1.domain.Debtor;
+import org.apache.fineract.cn.accounting.api.v1.domain.JournalEntry;
 import org.junit.Assert;
 import org.junit.Test;
 import org.mockito.Matchers;
@@ -44,10 +47,6 @@ import org.springframework.boot.test.mock.mockito.MockBean;
 import org.springframework.validation.BeanPropertyBindingResult;
 import org.springframework.validation.Validator;
 
-import java.util.Collections;
-import java.util.Optional;
-import java.util.UUID;
-
 public class TestCheques extends AbstractChequeTest {
 
   @MockBean
diff --git a/component-test/src/main/java/io/mifos/cheque/TestMICR.java b/component-test/src/main/java/io/mifos/cheque/TestMICR.java
index 1066aa4..0545e60 100644
--- a/component-test/src/main/java/io/mifos/cheque/TestMICR.java
+++ b/component-test/src/main/java/io/mifos/cheque/TestMICR.java
@@ -18,7 +18,6 @@
  */
 package io.mifos.cheque;
 
-import io.mifos.accounting.api.v1.domain.Account;
 import io.mifos.cheque.api.v1.EventConstants;
 import io.mifos.cheque.api.v1.client.DependingResourceNotValidException;
 import io.mifos.cheque.api.v1.client.InvalidChequeNumberException;
@@ -32,20 +31,20 @@ import io.mifos.cheque.service.internal.service.helper.AccountingService;
 import io.mifos.cheque.service.internal.service.helper.CustomerService;
 import io.mifos.cheque.service.internal.service.helper.DepositService;
 import io.mifos.cheque.service.internal.service.helper.OrganizationService;
-import io.mifos.core.api.util.NotFoundException;
-import io.mifos.customer.api.v1.domain.Customer;
-import io.mifos.deposit.api.v1.instance.domain.ProductInstance;
-import io.mifos.office.api.v1.domain.Office;
+import java.util.Collections;
+import java.util.Optional;
 import org.apache.commons.lang3.RandomStringUtils;
+import org.apache.fineract.cn.accounting.api.v1.domain.Account;
+import org.apache.fineract.cn.api.util.NotFoundException;
+import org.apache.fineract.cn.customer.api.v1.domain.Customer;
+import org.apache.fineract.cn.deposit.api.v1.instance.domain.ProductInstance;
+import org.apache.fineract.cn.office.api.v1.domain.Office;
 import org.junit.Assert;
 import org.junit.Test;
 import org.mockito.Mockito;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.mock.mockito.MockBean;
 
-import java.util.Collections;
-import java.util.Optional;
-
 public class TestMICR extends AbstractChequeTest {
 
   private static final String OFFICE_NAME = "Money Bin";
diff --git a/component-test/src/main/java/io/mifos/cheque/listener/ChequeEventListener.java b/component-test/src/main/java/io/mifos/cheque/listener/ChequeEventListener.java
index 69cf012..c7cf2a0 100644
--- a/component-test/src/main/java/io/mifos/cheque/listener/ChequeEventListener.java
+++ b/component-test/src/main/java/io/mifos/cheque/listener/ChequeEventListener.java
@@ -20,8 +20,8 @@ package io.mifos.cheque.listener;
 
 import io.mifos.cheque.AbstractChequeTest;
 import io.mifos.cheque.api.v1.EventConstants;
-import io.mifos.core.lang.config.TenantHeaderFilter;
-import io.mifos.core.test.listener.EventRecorder;
+import org.apache.fineract.cn.lang.config.TenantHeaderFilter;
+import org.apache.fineract.cn.test.listener.EventRecorder;
 import org.slf4j.Logger;
 import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.jms.annotation.JmsListener;
diff --git a/component-test/src/main/java/io/mifos/cheque/listener/ManagementEventMigrationListener.java b/component-test/src/main/java/io/mifos/cheque/listener/ManagementEventMigrationListener.java
index 7690c6d..d565c72 100644
--- a/component-test/src/main/java/io/mifos/cheque/listener/ManagementEventMigrationListener.java
+++ b/component-test/src/main/java/io/mifos/cheque/listener/ManagementEventMigrationListener.java
@@ -20,8 +20,8 @@ package io.mifos.cheque.listener;
 
 import io.mifos.cheque.AbstractChequeTest;
 import io.mifos.cheque.api.v1.EventConstants;
-import io.mifos.core.lang.config.TenantHeaderFilter;
-import io.mifos.core.test.listener.EventRecorder;
+import org.apache.fineract.cn.lang.config.TenantHeaderFilter;
+import org.apache.fineract.cn.test.listener.EventRecorder;
 import org.slf4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
diff --git a/service/src/main/java/io/mifos/cheque/service/ChequeConfiguration.java b/service/src/main/java/io/mifos/cheque/service/ChequeConfiguration.java
index 45c1d92..6f6a52c 100644
--- a/service/src/main/java/io/mifos/cheque/service/ChequeConfiguration.java
+++ b/service/src/main/java/io/mifos/cheque/service/ChequeConfiguration.java
@@ -18,17 +18,17 @@
  */
 package io.mifos.cheque.service;
 
-import io.mifos.accounting.api.v1.client.LedgerManager;
-import io.mifos.anubis.config.EnableAnubis;
-import io.mifos.core.async.config.EnableAsync;
-import io.mifos.core.cassandra.config.EnableCassandra;
-import io.mifos.core.command.config.EnableCommandProcessing;
-import io.mifos.core.lang.config.EnableServiceException;
-import io.mifos.core.lang.config.EnableTenantContext;
-import io.mifos.core.mariadb.config.EnableMariaDB;
-import io.mifos.customer.api.v1.client.CustomerManager;
-import io.mifos.deposit.api.v1.client.DepositAccountManager;
-import io.mifos.office.api.v1.client.OrganizationManager;
+import org.apache.fineract.cn.accounting.api.v1.client.LedgerManager;
+import org.apache.fineract.cn.anubis.config.EnableAnubis;
+import org.apache.fineract.cn.async.config.EnableAsync;
+import org.apache.fineract.cn.cassandra.config.EnableCassandra;
+import org.apache.fineract.cn.command.config.EnableCommandProcessing;
+import org.apache.fineract.cn.customer.api.v1.client.CustomerManager;
+import org.apache.fineract.cn.deposit.api.v1.client.DepositAccountManager;
+import org.apache.fineract.cn.lang.config.EnableServiceException;
+import org.apache.fineract.cn.lang.config.EnableTenantContext;
+import org.apache.fineract.cn.mariadb.config.EnableMariaDB;
+import org.apache.fineract.cn.office.api.v1.client.OrganizationManager;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/command/handler/ChequeAggregate.java b/service/src/main/java/io/mifos/cheque/service/internal/command/handler/ChequeAggregate.java
index fc5d327..8b6a500 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/command/handler/ChequeAggregate.java
+++ b/service/src/main/java/io/mifos/cheque/service/internal/command/handler/ChequeAggregate.java
@@ -19,10 +19,6 @@
 package io.mifos.cheque.service.internal.command.handler;
 
 import com.google.common.collect.Sets;
-import io.mifos.accounting.api.v1.client.AccountNotFoundException;
-import io.mifos.accounting.api.v1.domain.Creditor;
-import io.mifos.accounting.api.v1.domain.Debtor;
-import io.mifos.accounting.api.v1.domain.JournalEntry;
 import io.mifos.cheque.api.v1.EventConstants;
 import io.mifos.cheque.api.v1.domain.MICR;
 import io.mifos.cheque.api.v1.domain.State;
@@ -40,25 +36,28 @@ import io.mifos.cheque.service.internal.repository.IssuedChequeRepository;
 import io.mifos.cheque.service.internal.service.helper.AccountingService;
 import io.mifos.cheque.service.internal.service.helper.DepositService;
 import io.mifos.cheque.service.internal.service.helper.OrganizationService;
-import io.mifos.core.api.util.UserContextHolder;
-import io.mifos.core.command.annotation.Aggregate;
-import io.mifos.core.command.annotation.CommandHandler;
-import io.mifos.core.command.annotation.EventEmitter;
-import io.mifos.core.lang.DateConverter;
-import io.mifos.core.lang.ServiceException;
-import io.mifos.deposit.api.v1.definition.domain.Charge;
-import io.mifos.deposit.api.v1.instance.ProductInstanceNotFoundException;
-import org.slf4j.Logger;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-
-import javax.transaction.Transactional;
 import java.time.Clock;
 import java.time.LocalDateTime;
 import java.util.List;
 import java.util.Optional;
 import java.util.UUID;
 import java.util.stream.Collectors;
+import javax.transaction.Transactional;
+import org.apache.fineract.cn.accounting.api.v1.client.AccountNotFoundException;
+import org.apache.fineract.cn.accounting.api.v1.domain.Creditor;
+import org.apache.fineract.cn.accounting.api.v1.domain.Debtor;
+import org.apache.fineract.cn.accounting.api.v1.domain.JournalEntry;
+import org.apache.fineract.cn.api.util.UserContextHolder;
+import org.apache.fineract.cn.command.annotation.Aggregate;
+import org.apache.fineract.cn.command.annotation.CommandHandler;
+import org.apache.fineract.cn.command.annotation.EventEmitter;
+import org.apache.fineract.cn.deposit.api.v1.definition.domain.Charge;
+import org.apache.fineract.cn.deposit.api.v1.instance.ProductInstanceNotFoundException;
+import org.apache.fineract.cn.lang.DateConverter;
+import org.apache.fineract.cn.lang.ServiceException;
+import org.slf4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
 
 @Aggregate
 public class ChequeAggregate {
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/command/handler/ManagementAggregate.java b/service/src/main/java/io/mifos/cheque/service/internal/command/handler/ManagementAggregate.java
index e20fb8d..d310658 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/command/handler/ManagementAggregate.java
+++ b/service/src/main/java/io/mifos/cheque/service/internal/command/handler/ManagementAggregate.java
@@ -21,18 +21,17 @@ package io.mifos.cheque.service.internal.command.handler;
 import io.mifos.cheque.api.v1.EventConstants;
 import io.mifos.cheque.service.ServiceConstants;
 import io.mifos.cheque.service.internal.command.MigrationCommand;
-import io.mifos.core.command.annotation.Aggregate;
-import io.mifos.core.command.annotation.CommandHandler;
-import io.mifos.core.command.annotation.EventEmitter;
-import io.mifos.core.lang.ApplicationName;
-import io.mifos.core.mariadb.domain.FlywayFactoryBean;
+import javax.sql.DataSource;
+import org.apache.fineract.cn.command.annotation.Aggregate;
+import org.apache.fineract.cn.command.annotation.CommandHandler;
+import org.apache.fineract.cn.command.annotation.EventEmitter;
+import org.apache.fineract.cn.lang.ApplicationName;
+import org.apache.fineract.cn.mariadb.domain.FlywayFactoryBean;
 import org.slf4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.transaction.annotation.Transactional;
 
-import javax.sql.DataSource;
-
 @Aggregate
 public class ManagementAggregate {
 
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/mapper/ChequeMapper.java b/service/src/main/java/io/mifos/cheque/service/internal/mapper/ChequeMapper.java
index 88ddfb6..28547a4 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/mapper/ChequeMapper.java
+++ b/service/src/main/java/io/mifos/cheque/service/internal/mapper/ChequeMapper.java
@@ -21,12 +21,11 @@ package io.mifos.cheque.service.internal.mapper;
 import io.mifos.cheque.api.v1.domain.Cheque;
 import io.mifos.cheque.api.v1.domain.MICR;
 import io.mifos.cheque.service.internal.repository.ChequeEntity;
-import io.mifos.core.api.util.UserContextHolder;
-import io.mifos.core.lang.DateConverter;
-
 import java.sql.Date;
 import java.time.Clock;
 import java.time.LocalDateTime;
+import org.apache.fineract.cn.api.util.UserContextHolder;
+import org.apache.fineract.cn.lang.DateConverter;
 
 public class ChequeMapper {
 
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/repository/ChequeEntity.java b/service/src/main/java/io/mifos/cheque/service/internal/repository/ChequeEntity.java
index 8169c9d..14fced8 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/repository/ChequeEntity.java
+++ b/service/src/main/java/io/mifos/cheque/service/internal/repository/ChequeEntity.java
@@ -18,8 +18,8 @@
  */
 package io.mifos.cheque.service.internal.repository;
 
-import io.mifos.core.mariadb.util.LocalDateTimeConverter;
-
+import java.sql.Date;
+import java.time.LocalDateTime;
 import javax.persistence.Column;
 import javax.persistence.Convert;
 import javax.persistence.Entity;
@@ -27,8 +27,7 @@ import javax.persistence.GeneratedValue;
 import javax.persistence.GenerationType;
 import javax.persistence.Id;
 import javax.persistence.Table;
-import java.sql.Date;
-import java.time.LocalDateTime;
+import org.apache.fineract.cn.mariadb.util.LocalDateTimeConverter;
 
 @Entity
 @Table(name = "sopdet_cheques")
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/repository/IssuedChequeEntity.java b/service/src/main/java/io/mifos/cheque/service/internal/repository/IssuedChequeEntity.java
index 33deca3..fab2c9f 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/repository/IssuedChequeEntity.java
+++ b/service/src/main/java/io/mifos/cheque/service/internal/repository/IssuedChequeEntity.java
@@ -18,8 +18,7 @@
  */
 package io.mifos.cheque.service.internal.repository;
 
-import io.mifos.core.mariadb.util.LocalDateTimeConverter;
-
+import java.time.LocalDateTime;
 import javax.persistence.Column;
 import javax.persistence.Convert;
 import javax.persistence.Entity;
@@ -27,7 +26,7 @@ import javax.persistence.GeneratedValue;
 import javax.persistence.GenerationType;
 import javax.persistence.Id;
 import javax.persistence.Table;
-import java.time.LocalDateTime;
+import org.apache.fineract.cn.mariadb.util.LocalDateTimeConverter;
 
 @Entity
 @Table(name = "sopdet_issued_cheques")
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/service/MICRService.java b/service/src/main/java/io/mifos/cheque/service/internal/service/MICRService.java
index 968165b..865ab45 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/service/MICRService.java
+++ b/service/src/main/java/io/mifos/cheque/service/internal/service/MICRService.java
@@ -26,10 +26,10 @@ import io.mifos.cheque.service.internal.repository.IssuedChequeRepository;
 import io.mifos.cheque.service.internal.service.helper.CustomerService;
 import io.mifos.cheque.service.internal.service.helper.DepositService;
 import io.mifos.cheque.service.internal.service.helper.OrganizationService;
-import io.mifos.core.lang.ServiceException;
-import io.mifos.customer.api.v1.domain.Customer;
-import io.mifos.deposit.api.v1.instance.domain.ProductInstance;
-import io.mifos.office.api.v1.domain.Office;
+import org.apache.fineract.cn.customer.api.v1.domain.Customer;
+import org.apache.fineract.cn.deposit.api.v1.instance.domain.ProductInstance;
+import org.apache.fineract.cn.lang.ServiceException;
+import org.apache.fineract.cn.office.api.v1.domain.Office;
 import org.slf4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/service/helper/AccountingService.java b/service/src/main/java/io/mifos/cheque/service/internal/service/helper/AccountingService.java
index 5d2d630..0eb32cf 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/service/helper/AccountingService.java
+++ b/service/src/main/java/io/mifos/cheque/service/internal/service/helper/AccountingService.java
@@ -19,29 +19,28 @@
 package io.mifos.cheque.service.internal.service.helper;
 
 import com.google.common.collect.Sets;
-import io.mifos.accounting.api.v1.client.AccountNotFoundException;
-import io.mifos.accounting.api.v1.client.LedgerManager;
-import io.mifos.accounting.api.v1.domain.Account;
-import io.mifos.accounting.api.v1.domain.AccountPage;
-import io.mifos.accounting.api.v1.domain.Creditor;
-import io.mifos.accounting.api.v1.domain.Debtor;
-import io.mifos.accounting.api.v1.domain.JournalEntry;
 import io.mifos.cheque.service.ServiceConstants;
-import io.mifos.core.api.util.UserContextHolder;
-import io.mifos.core.lang.DateConverter;
-import io.mifos.core.lang.ServiceException;
-import io.mifos.deposit.api.v1.definition.domain.Charge;
-import org.slf4j.Logger;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.stereotype.Service;
-
 import java.time.Clock;
 import java.time.LocalDateTime;
 import java.util.List;
 import java.util.Optional;
 import java.util.UUID;
 import java.util.stream.Collectors;
+import org.apache.fineract.cn.accounting.api.v1.client.AccountNotFoundException;
+import org.apache.fineract.cn.accounting.api.v1.client.LedgerManager;
+import org.apache.fineract.cn.accounting.api.v1.domain.Account;
+import org.apache.fineract.cn.accounting.api.v1.domain.AccountPage;
+import org.apache.fineract.cn.accounting.api.v1.domain.Creditor;
+import org.apache.fineract.cn.accounting.api.v1.domain.Debtor;
+import org.apache.fineract.cn.accounting.api.v1.domain.JournalEntry;
+import org.apache.fineract.cn.api.util.UserContextHolder;
+import org.apache.fineract.cn.deposit.api.v1.definition.domain.Charge;
+import org.apache.fineract.cn.lang.DateConverter;
+import org.apache.fineract.cn.lang.ServiceException;
+import org.slf4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.stereotype.Service;
 
 @Service
 public class AccountingService {
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/service/helper/CustomerService.java b/service/src/main/java/io/mifos/cheque/service/internal/service/helper/CustomerService.java
index b90e3a4..fb82213 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/service/helper/CustomerService.java
+++ b/service/src/main/java/io/mifos/cheque/service/internal/service/helper/CustomerService.java
@@ -19,16 +19,15 @@
 package io.mifos.cheque.service.internal.service.helper;
 
 import io.mifos.cheque.service.ServiceConstants;
-import io.mifos.customer.api.v1.client.CustomerManager;
-import io.mifos.customer.api.v1.client.CustomerNotFoundException;
-import io.mifos.customer.api.v1.domain.Customer;
+import java.util.Optional;
+import org.apache.fineract.cn.customer.api.v1.client.CustomerManager;
+import org.apache.fineract.cn.customer.api.v1.client.CustomerNotFoundException;
+import org.apache.fineract.cn.customer.api.v1.domain.Customer;
 import org.slf4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.stereotype.Service;
 
-import java.util.Optional;
-
 @Service
 public class CustomerService {
 
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/service/helper/DepositService.java b/service/src/main/java/io/mifos/cheque/service/internal/service/helper/DepositService.java
index 98bcabc..92e128f 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/service/helper/DepositService.java
+++ b/service/src/main/java/io/mifos/cheque/service/internal/service/helper/DepositService.java
@@ -19,21 +19,20 @@
 package io.mifos.cheque.service.internal.service.helper;
 
 import io.mifos.cheque.service.ServiceConstants;
-import io.mifos.deposit.api.v1.client.DepositAccountManager;
-import io.mifos.deposit.api.v1.definition.domain.Action;
-import io.mifos.deposit.api.v1.definition.domain.Charge;
-import io.mifos.deposit.api.v1.definition.domain.ProductDefinition;
-import io.mifos.deposit.api.v1.instance.ProductInstanceNotFoundException;
-import io.mifos.deposit.api.v1.instance.domain.ProductInstance;
+import java.util.List;
+import java.util.Optional;
+import java.util.stream.Collectors;
+import org.apache.fineract.cn.deposit.api.v1.client.DepositAccountManager;
+import org.apache.fineract.cn.deposit.api.v1.definition.domain.Action;
+import org.apache.fineract.cn.deposit.api.v1.definition.domain.Charge;
+import org.apache.fineract.cn.deposit.api.v1.definition.domain.ProductDefinition;
+import org.apache.fineract.cn.deposit.api.v1.instance.ProductInstanceNotFoundException;
+import org.apache.fineract.cn.deposit.api.v1.instance.domain.ProductInstance;
 import org.slf4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.stereotype.Service;
 
-import java.util.List;
-import java.util.Optional;
-import java.util.stream.Collectors;
-
 @Service
 public class DepositService {
 
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/service/helper/OrganizationService.java b/service/src/main/java/io/mifos/cheque/service/internal/service/helper/OrganizationService.java
index 26177cd..3af98fd 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/service/helper/OrganizationService.java
+++ b/service/src/main/java/io/mifos/cheque/service/internal/service/helper/OrganizationService.java
@@ -19,16 +19,15 @@
 package io.mifos.cheque.service.internal.service.helper;
 
 import io.mifos.cheque.service.ServiceConstants;
-import io.mifos.office.api.v1.client.NotFoundException;
-import io.mifos.office.api.v1.client.OrganizationManager;
-import io.mifos.office.api.v1.domain.Office;
+import java.util.Optional;
+import org.apache.fineract.cn.office.api.v1.client.NotFoundException;
+import org.apache.fineract.cn.office.api.v1.client.OrganizationManager;
+import org.apache.fineract.cn.office.api.v1.domain.Office;
 import org.slf4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.stereotype.Service;
 
-import java.util.Optional;
-
 @Service
 public class OrganizationService {
 
diff --git a/service/src/main/java/io/mifos/cheque/service/rest/ChequeManagementRestController.java b/service/src/main/java/io/mifos/cheque/service/rest/ChequeManagementRestController.java
index facfee4..47299b9 100644
--- a/service/src/main/java/io/mifos/cheque/service/rest/ChequeManagementRestController.java
+++ b/service/src/main/java/io/mifos/cheque/service/rest/ChequeManagementRestController.java
@@ -18,11 +18,11 @@
  */
 package io.mifos.cheque.service.rest;
 
-import io.mifos.anubis.annotation.AcceptedTokenType;
-import io.mifos.anubis.annotation.Permittable;
 import io.mifos.cheque.service.ServiceConstants;
 import io.mifos.cheque.service.internal.command.MigrationCommand;
-import io.mifos.core.command.gateway.CommandGateway;
+import org.apache.fineract.cn.anubis.annotation.AcceptedTokenType;
+import org.apache.fineract.cn.anubis.annotation.Permittable;
+import org.apache.fineract.cn.command.gateway.CommandGateway;
 import org.slf4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
diff --git a/service/src/main/java/io/mifos/cheque/service/rest/ChequeRestController.java b/service/src/main/java/io/mifos/cheque/service/rest/ChequeRestController.java
index 946c8c0..fb990be 100644
--- a/service/src/main/java/io/mifos/cheque/service/rest/ChequeRestController.java
+++ b/service/src/main/java/io/mifos/cheque/service/rest/ChequeRestController.java
@@ -18,8 +18,6 @@
  */
 package io.mifos.cheque.service.rest;
 
-import io.mifos.anubis.annotation.AcceptedTokenType;
-import io.mifos.anubis.annotation.Permittable;
 import io.mifos.cheque.api.v1.PermittableGroupIds;
 import io.mifos.cheque.api.v1.domain.Action;
 import io.mifos.cheque.api.v1.domain.Cheque;
@@ -31,9 +29,13 @@ import io.mifos.cheque.service.internal.command.CancelChequeTransactionCommand;
 import io.mifos.cheque.service.internal.command.IssueChequesCommand;
 import io.mifos.cheque.service.internal.format.MICRParser;
 import io.mifos.cheque.service.internal.service.ChequeService;
-import io.mifos.core.command.domain.CommandCallback;
-import io.mifos.core.command.gateway.CommandGateway;
-import io.mifos.core.lang.ServiceException;
+import java.util.List;
+import javax.validation.Valid;
+import org.apache.fineract.cn.anubis.annotation.AcceptedTokenType;
+import org.apache.fineract.cn.anubis.annotation.Permittable;
+import org.apache.fineract.cn.command.domain.CommandCallback;
+import org.apache.fineract.cn.command.gateway.CommandGateway;
+import org.apache.fineract.cn.lang.ServiceException;
 import org.slf4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
@@ -47,9 +49,6 @@ import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.bind.annotation.RestController;
 
-import javax.validation.Valid;
-import java.util.List;
-
 @RestController
 @RequestMapping("/cheques")
 public class ChequeRestController {
diff --git a/service/src/main/java/io/mifos/cheque/service/rest/ChequeTransactionRestController.java b/service/src/main/java/io/mifos/cheque/service/rest/ChequeTransactionRestController.java
index 9d83275..d499ef0 100644
--- a/service/src/main/java/io/mifos/cheque/service/rest/ChequeTransactionRestController.java
+++ b/service/src/main/java/io/mifos/cheque/service/rest/ChequeTransactionRestController.java
@@ -18,8 +18,6 @@
  */
 package io.mifos.cheque.service.rest;
 
-import io.mifos.anubis.annotation.AcceptedTokenType;
-import io.mifos.anubis.annotation.Permittable;
 import io.mifos.cheque.api.v1.PermittableGroupIds;
 import io.mifos.cheque.api.v1.domain.Cheque;
 import io.mifos.cheque.api.v1.domain.ChequeTransaction;
@@ -27,8 +25,11 @@ import io.mifos.cheque.service.ServiceConstants;
 import io.mifos.cheque.service.internal.command.ChequeTransactionCommand;
 import io.mifos.cheque.service.internal.format.MICRParser;
 import io.mifos.cheque.service.internal.service.ChequeService;
-import io.mifos.core.command.gateway.CommandGateway;
-import io.mifos.core.lang.ServiceException;
+import javax.validation.Valid;
+import org.apache.fineract.cn.anubis.annotation.AcceptedTokenType;
+import org.apache.fineract.cn.anubis.annotation.Permittable;
+import org.apache.fineract.cn.command.gateway.CommandGateway;
+import org.apache.fineract.cn.lang.ServiceException;
 import org.slf4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
@@ -40,8 +41,6 @@ import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.bind.annotation.RestController;
 
-import javax.validation.Valid;
-
 @RestController
 @RequestMapping("/transactions")
 public class ChequeTransactionRestController {
diff --git a/service/src/main/java/io/mifos/cheque/service/rest/MIRCRestController.java b/service/src/main/java/io/mifos/cheque/service/rest/MIRCRestController.java
index c28eddb..b9d0252 100644
--- a/service/src/main/java/io/mifos/cheque/service/rest/MIRCRestController.java
+++ b/service/src/main/java/io/mifos/cheque/service/rest/MIRCRestController.java
@@ -18,13 +18,13 @@
  */
 package io.mifos.cheque.service.rest;
 
-import io.mifos.anubis.annotation.AcceptedTokenType;
-import io.mifos.anubis.annotation.Permittable;
 import io.mifos.cheque.api.v1.PermittableGroupIds;
 import io.mifos.cheque.api.v1.domain.MICRResolution;
 import io.mifos.cheque.service.ServiceConstants;
 import io.mifos.cheque.service.internal.format.MICRParser;
 import io.mifos.cheque.service.internal.service.MICRService;
+import org.apache.fineract.cn.anubis.annotation.AcceptedTokenType;
+import org.apache.fineract.cn.anubis.annotation.Permittable;
 import org.slf4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;


[fineract-cn-cheques] 42/44: FINCN-180 remove tenant-specific data source from configuration

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juhan pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-cheques.git

commit 8350cb6a9d9b462c732a284338d8957c3340f8cb
Author: Juhan Aasaru <Ju...@nortal.com>
AuthorDate: Sat Oct 12 16:47:11 2019 +0300

    FINCN-180 remove tenant-specific data source from configuration
---
 service/src/main/resources/application.yml | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/service/src/main/resources/application.yml b/service/src/main/resources/application.yml
index d3dda73..42cfe64 100644
--- a/service/src/main/resources/application.yml
+++ b/service/src/main/resources/application.yml
@@ -23,11 +23,6 @@ spring:
       enabled: false
     config:
       enabled: false
-  datasource:
-    driver-class-name: org.postgresql.Driver
-    url: jdbc:postgresql://localhost:5432/playground
-    username: postgres
-    password: postgres
 
 eureka:
   client:


[fineract-cn-cheques] 01/44: initial commit

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juhan pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-cheques.git

commit 6828d67961e46261fd42b34df55fa1aae7e6fd98
Author: mgeiss <mg...@mifos.org>
AuthorDate: Mon Aug 21 16:06:55 2017 +0200

    initial commit
---
 .gitignore                                         |  17 ++
 HEADER                                             |  13 +
 README.md                                          |  30 +++
 api/build.gradle                                   |  39 +++
 api/settings.gradle                                |   1 +
 .../io/mifos/cheque/api/v1/EventConstants.java     |  35 +++
 .../mifos/cheque/api/v1/PermittableGroupIds.java   |  22 ++
 .../mifos/cheque/api/v1/client/ChequeManager.java  |  87 +++++++
 .../mifos/cheque/api/v1/client/IssuingCount.java   |  56 +++++
 .../java/io/mifos/cheque/api/v1/domain/Action.java |  21 ++
 .../java/io/mifos/cheque/api/v1/domain/Cheque.java | 117 +++++++++
 .../api/v1/domain/ChequeProcessingCommand.java     |  36 +++
 .../cheque/api/v1/domain/ChequeTransaction.java    |  50 ++++
 .../java/io/mifos/cheque/api/v1/domain/MICR.java   |  56 +++++
 .../java/io/mifos/cheque/api/v1/domain/State.java  |  22 ++
 build.gradle                                       |  36 +++
 component-test/build.gradle                        |  38 +++
 component-test/settings.gradle                     |   1 +
 .../java/io/mifos/cheque/AbstractChequeTest.java   | 118 +++++++++
 .../src/main/java/io/mifos/cheque/Fixture.java     |  49 ++++
 .../java/io/mifos/cheque/SuiteTestEnvironment.java |  41 ++++
 .../src/main/java/io/mifos/cheque/TestCheques.java | 210 ++++++++++++++++
 .../java/io/mifos/cheque/TestIssuingCheques.java   |  99 ++++++++
 .../src/main/java/io/mifos/cheque/TestSuite.java   |  30 +++
 .../mifos/cheque/listener/ChequeEventListener.java |  84 +++++++
 .../listener/ManagementEventMigrationListener.java |  53 +++++
 component-test/src/main/resources/logback-test.xml |  32 +++
 gradle/wrapper/gradle-wrapper.jar                  | Bin 0 -> 54212 bytes
 gradle/wrapper/gradle-wrapper.properties           |   6 +
 gradlew                                            | 172 +++++++++++++
 gradlew.bat                                        |  84 +++++++
 service/build.gradle                               |  67 ++++++
 service/settings.gradle                            |   1 +
 .../io/mifos/cheque/service/ChequeApplication.java |  29 +++
 .../mifos/cheque/service/ChequeConfiguration.java  |  82 +++++++
 .../io/mifos/cheque/service/ServiceConstants.java  |  22 ++
 .../command/ApproveChequeTransactionCommand.java   |  29 +++
 .../command/CancelChequeTransactionCommand.java    |  29 +++
 .../internal/command/ChequeTransactionCommand.java |  37 +++
 .../internal/command/IssueChequesCommand.java      |  42 ++++
 .../service/internal/command/MigrationCommand.java |  22 ++
 .../internal/command/handler/ChequeAggregate.java  | 265 +++++++++++++++++++++
 .../command/handler/ManagementAggregate.java       |  63 +++++
 .../cheque/service/internal/format/MICRParser.java |  60 +++++
 .../service/internal/mapper/ChequeMapper.java      |  70 ++++++
 .../service/internal/repository/ChequeEntity.java  | 202 ++++++++++++++++
 .../internal/repository/ChequeRepository.java      |  30 +++
 .../internal/repository/IssuedChequeEntity.java    | 111 +++++++++
 .../repository/IssuedChequeRepository.java         |  25 ++
 .../specification/ChequeSpecification.java         |  45 ++++
 .../service/internal/service/ChequeService.java    |  67 ++++++
 .../internal/service/helper/AccountingService.java | 110 +++++++++
 .../internal/service/helper/DepositService.java    |  78 ++++++
 .../service/helper/OrganizationService.java        |  48 ++++
 .../rest/ChequeManagementRestController.java       |  61 +++++
 .../cheque/service/rest/ChequeRestController.java  | 150 ++++++++++++
 .../rest/ChequeTransactionRestController.java      |  81 +++++++
 service/src/main/resources/application.yml         |  66 +++++
 service/src/main/resources/bootstrap.yml           |  19 ++
 .../db/migrations/mariadb/V1__initial_setup.sql    |  48 ++++
 service/src/main/resources/logback.xml             |  55 +++++
 .../service/internal/format/TestMICRParser.java    | 125 ++++++++++
 settings.gradle                                    |   6 +
 shared.gradle                                      |  73 ++++++
 64 files changed, 3873 insertions(+)

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..1d62734
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,17 @@
+.gradle
+.idea
+build/
+target/
+out/
+
+# Ignore Gradle GUI config
+gradle-app.setting
+
+# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
+!gradle-wrapper.jar
+
+*.iml
+
+*.log
+
+*.toDelete
diff --git a/HEADER b/HEADER
new file mode 100644
index 0000000..88f1afc
--- /dev/null
+++ b/HEADER
@@ -0,0 +1,13 @@
+Copyright ${year} ${company}.
+
+All Rights Reserved.
+
+NOTICE:  All information contained herein is, and remains
+the property of ${company} and its suppliers, if any.
+The intellectual and technical concepts contained herein
+are proprietary to ${company} and its suppliers and may
+be covered by U.S. and Foreign Patents, patents in process,
+and are protected by trade secret or copyright law.
+Dissemination of this information or reproduction of this material
+is strictly forbidden unless prior written permission is obtained
+${company}.
\ No newline at end of file
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..8ac2e2b
--- /dev/null
+++ b/README.md
@@ -0,0 +1,30 @@
+# Mifos I/O Deposit Account Management
+
+[![Join the chat at https://gitter.im/mifos-initiative/mifos.io](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/mifos-initiative/mifos.io?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
+
+This project provides a services to create deposit accounts, e.g. checking, savings, and shares.
+
+## Abstract
+Mifos I/O is an application framework for digital financial services, a system to support nationwide and cross-national financial transactions and help to level and speed the creation of an inclusive, interconnected digital economy for every nation in the world.
+
+## Versioning
+The version numbers follow the [Semantic Versioning](http://semver.org/) scheme.
+
+In addition to MAJOR.MINOR.PATCH the following postfixes are used to indicate the development state.
+
+* BUILD-SNAPSHOT - A release currently in development. 
+* M - A _milestone_ release include specific sets of functions and are released as soon as the functionality is complete.
+* RC - A _release candidate_ is a version with potential to be a final product, considered _code complete_.
+* RELEASE - _General availability_ indicates that this release is the best available version and is recommended for all usage.
+
+The versioning layout is {MAJOR}.{MINOR}.{PATCH}-{INDICATOR}[.{PATCH}]. Only milestones and release candidates can  have patch versions. Some examples:
+
+1.2.3.BUILD-SNAPSHOT  
+1.3.5.M.1  
+1.5.7.RC.2  
+2.0.0.RELEASE
+
+## License
+Copyright 2017 Kuelap, Inc.
+
+All Rights Reserved.
diff --git a/api/build.gradle b/api/build.gradle
new file mode 100644
index 0000000..17c6648
--- /dev/null
+++ b/api/build.gradle
@@ -0,0 +1,39 @@
+buildscript {
+    repositories {
+        jcenter()
+    }
+
+    dependencies {
+        classpath 'io.spring.gradle:dependency-management-plugin:0.6.0.RELEASE'
+    }
+}
+
+plugins {
+    id "com.github.hierynomus.license" version "0.13.1"
+}
+
+apply from: '../shared.gradle'
+
+dependencies {
+    compile(
+            [group: 'org.springframework.cloud', name: 'spring-cloud-starter-feign'],
+            [group: 'io.mifos.core', name: 'api', version: versions.frameworkapi],
+            [group: 'org.hibernate', name: 'hibernate-validator', version: versions.validator],
+            [group: 'org.hibernate', name: 'hibernate-validator-annotation-processor', version: versions.validator]
+    )
+
+    testCompile(
+            [group: 'io.mifos.core', name: 'test', version: versions.frameworktest],
+    )
+}
+
+publishing {
+    publications {
+        api(MavenPublication) {
+            from components.java
+            groupId project.group
+            artifactId project.name
+            version project.version
+        }
+    }
+}
diff --git a/api/settings.gradle b/api/settings.gradle
new file mode 100644
index 0000000..7c8e3dc
--- /dev/null
+++ b/api/settings.gradle
@@ -0,0 +1 @@
+rootProject.name = 'api'
\ No newline at end of file
diff --git a/api/src/main/java/io/mifos/cheque/api/v1/EventConstants.java b/api/src/main/java/io/mifos/cheque/api/v1/EventConstants.java
new file mode 100644
index 0000000..74573b5
--- /dev/null
+++ b/api/src/main/java/io/mifos/cheque/api/v1/EventConstants.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2017 Kuelap, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * NOTICE:  All information contained herein is, and remains
+ * the property of Kuelap, Inc and its suppliers, if any.
+ * The intellectual and technical concepts contained herein
+ * are proprietary to Kuelap, Inc and its suppliers and may
+ * be covered by U.S. and Foreign Patents, patents in process,
+ * and are protected by trade secret or copyright law.
+ * Dissemination of this information or reproduction of this material
+ * is strictly forbidden unless prior written permission is obtained
+ * Kuelap, Inc.
+ */
+package io.mifos.cheque.api.v1;
+
+@SuppressWarnings("unused")
+public interface EventConstants {
+
+  String DESTINATION = "cheques-v1";
+  String SELECTOR_NAME = "action";
+
+  String INITIALIZE = "initialize";
+  String SELECTOR_INITIALIZE = SELECTOR_NAME + " = '" + INITIALIZE + "'";
+
+  String ISSUE_CHEQUES = "issue-cheques";
+  String SELECTOR_ISSUE_CHEQUES = SELECTOR_NAME + " = '" + ISSUE_CHEQUES + "'";
+  String CHEQUE_TRANSACTION = "cheque-transaction";
+  String SELECTOR_CHEQUE_TRANSACTION = SELECTOR_NAME + " = '" + CHEQUE_TRANSACTION + "'";
+  String CHEQUE_TRANSACTION_APPROVED = "cheque-transaction-approved";
+  String SELECTOR_CHEQUE_TRANSACTION_APPROVED = SELECTOR_NAME + " = '" + CHEQUE_TRANSACTION_APPROVED + "'";
+  String CHEQUE_TRANSACTION_CANCELED = "cheque-transaction-canceled";
+  String SELECTOR_CHEQUE_TRANSACTION_CANCELED = SELECTOR_NAME + " = '" + CHEQUE_TRANSACTION_CANCELED + "'";
+}
diff --git a/api/src/main/java/io/mifos/cheque/api/v1/PermittableGroupIds.java b/api/src/main/java/io/mifos/cheque/api/v1/PermittableGroupIds.java
new file mode 100644
index 0000000..5c9c599
--- /dev/null
+++ b/api/src/main/java/io/mifos/cheque/api/v1/PermittableGroupIds.java
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2017 Kuelap, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * NOTICE:  All information contained herein is, and remains
+ * the property of Kuelap, Inc and its suppliers, if any.
+ * The intellectual and technical concepts contained herein
+ * are proprietary to Kuelap, Inc and its suppliers and may
+ * be covered by U.S. and Foreign Patents, patents in process,
+ * and are protected by trade secret or copyright law.
+ * Dissemination of this information or reproduction of this material
+ * is strictly forbidden unless prior written permission is obtained
+ * Kuelap, Inc.
+ */
+package io.mifos.cheque.api.v1;
+
+@SuppressWarnings("unused")
+public interface PermittableGroupIds {
+  String CHEQUE_MANAGEMENT = "cheques__v1__management";
+  String CHEQUE_TRANSACTION = "cheques__v1__transaction";
+}
diff --git a/api/src/main/java/io/mifos/cheque/api/v1/client/ChequeManager.java b/api/src/main/java/io/mifos/cheque/api/v1/client/ChequeManager.java
new file mode 100644
index 0000000..781793a
--- /dev/null
+++ b/api/src/main/java/io/mifos/cheque/api/v1/client/ChequeManager.java
@@ -0,0 +1,87 @@
+/*
+ * Copyright 2017 Kuelap, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * NOTICE:  All information contained herein is, and remains
+ * the property of Kuelap, Inc and its suppliers, if any.
+ * The intellectual and technical concepts contained herein
+ * are proprietary to Kuelap, Inc and its suppliers and may
+ * be covered by U.S. and Foreign Patents, patents in process,
+ * and are protected by trade secret or copyright law.
+ * Dissemination of this information or reproduction of this material
+ * is strictly forbidden unless prior written permission is obtained
+ * Kuelap, Inc.
+ */
+package io.mifos.cheque.api.v1.client;
+
+import io.mifos.cheque.api.v1.domain.Cheque;
+import io.mifos.cheque.api.v1.domain.ChequeProcessingCommand;
+import io.mifos.cheque.api.v1.domain.ChequeTransaction;
+import io.mifos.core.api.util.CustomFeignClientsConfiguration;
+import org.springframework.cloud.netflix.feign.FeignClient;
+import org.springframework.http.MediaType;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import javax.validation.Valid;
+import java.util.List;
+
+@SuppressWarnings("unused")
+@FeignClient(value = "cheques-v1", path = "/cheques/v1", configuration = CustomFeignClientsConfiguration.class)
+public interface ChequeManager {
+
+  @RequestMapping(
+      value = "/cheques/",
+      method = RequestMethod.POST,
+      produces = {MediaType.APPLICATION_JSON_VALUE},
+      consumes = {MediaType.APPLICATION_JSON_VALUE}
+  )
+  String issue(@RequestBody @Valid final IssuingCount issuingCount);
+
+  @RequestMapping(
+      value = "/cheques/",
+      method = RequestMethod.GET,
+      produces = {MediaType.ALL_VALUE},
+      consumes = {MediaType.APPLICATION_JSON_VALUE}
+  )
+  List<Cheque> fetch(@RequestParam(value = "state", required = false, defaultValue = "ALL") final String state,
+                     @RequestParam(value = "account", required = false) final String accountIdentifier);
+
+  /**
+   * The identifier is created by concatenating the MICR parts with the character <code>~</code>.
+   * Sample:<br/>
+   * &nbsp;&nbsp;{cheque-no}~{branch-sort-code}~{account-no}<br/>
+   * &nbsp;&nbsp;246~13579~20030011<br/>
+   *
+   * @param identifier concatenated MICR
+   * @return
+   */
+  @RequestMapping(
+      value = "/cheques/{identifier}",
+      method = RequestMethod.GET,
+      produces = {MediaType.ALL_VALUE},
+      consumes = {MediaType.APPLICATION_JSON_VALUE}
+  )
+  Cheque get(@PathVariable("identifier") final String identifier);
+
+  @RequestMapping(
+      value = "/cheques/{identifier}/commands",
+      method = RequestMethod.POST,
+      produces = {MediaType.ALL_VALUE},
+      consumes = {MediaType.APPLICATION_JSON_VALUE}
+  )
+  void process(@PathVariable("identifier") final String identifier,
+               @RequestBody @Valid final ChequeProcessingCommand chequeProcessingCommand);
+
+  @RequestMapping(
+      value = "/transactions/",
+      method = RequestMethod.POST,
+      produces = {MediaType.ALL_VALUE},
+      consumes = {MediaType.APPLICATION_JSON_VALUE}
+  )
+  void process(@RequestBody @Valid final ChequeTransaction chequeTransaction);
+}
diff --git a/api/src/main/java/io/mifos/cheque/api/v1/client/IssuingCount.java b/api/src/main/java/io/mifos/cheque/api/v1/client/IssuingCount.java
new file mode 100644
index 0000000..af37b0d
--- /dev/null
+++ b/api/src/main/java/io/mifos/cheque/api/v1/client/IssuingCount.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2017 Kuelap, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * NOTICE:  All information contained herein is, and remains
+ * the property of Kuelap, Inc and its suppliers, if any.
+ * The intellectual and technical concepts contained herein
+ * are proprietary to Kuelap, Inc and its suppliers and may
+ * be covered by U.S. and Foreign Patents, patents in process,
+ * and are protected by trade secret or copyright law.
+ * Dissemination of this information or reproduction of this material
+ * is strictly forbidden unless prior written permission is obtained
+ * Kuelap, Inc.
+ */
+package io.mifos.cheque.api.v1.client;
+
+import javax.validation.constraints.Min;
+import javax.validation.constraints.NotNull;
+
+public class IssuingCount {
+
+  private String accountIdentifier;
+  private Integer start;
+  @NotNull
+  @Min(1)
+  private Integer amount;
+
+  public IssuingCount() {
+    super();
+  }
+
+  public String getAccountIdentifier() {
+    return this.accountIdentifier;
+  }
+
+  public void setAccountIdentifier(final String accountIdentifier) {
+    this.accountIdentifier = accountIdentifier;
+  }
+
+  public Integer getStart() {
+    return this.start;
+  }
+
+  public void setStart(final Integer start) {
+    this.start = start;
+  }
+
+  public Integer getAmount() {
+    return this.amount;
+  }
+
+  public void setAmount(final Integer amount) {
+    this.amount = amount;
+  }
+}
diff --git a/api/src/main/java/io/mifos/cheque/api/v1/domain/Action.java b/api/src/main/java/io/mifos/cheque/api/v1/domain/Action.java
new file mode 100644
index 0000000..0c73f44
--- /dev/null
+++ b/api/src/main/java/io/mifos/cheque/api/v1/domain/Action.java
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2017 Kuelap, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * NOTICE:  All information contained herein is, and remains
+ * the property of Kuelap, Inc and its suppliers, if any.
+ * The intellectual and technical concepts contained herein
+ * are proprietary to Kuelap, Inc and its suppliers and may
+ * be covered by U.S. and Foreign Patents, patents in process,
+ * and are protected by trade secret or copyright law.
+ * Dissemination of this information or reproduction of this material
+ * is strictly forbidden unless prior written permission is obtained
+ * Kuelap, Inc.
+ */
+package io.mifos.cheque.api.v1.domain;
+
+public enum Action {
+  APPROVE,
+  CANCEL
+}
diff --git a/api/src/main/java/io/mifos/cheque/api/v1/domain/Cheque.java b/api/src/main/java/io/mifos/cheque/api/v1/domain/Cheque.java
new file mode 100644
index 0000000..2e54522
--- /dev/null
+++ b/api/src/main/java/io/mifos/cheque/api/v1/domain/Cheque.java
@@ -0,0 +1,117 @@
+/*
+ * Copyright 2017 Kuelap, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * NOTICE:  All information contained herein is, and remains
+ * the property of Kuelap, Inc and its suppliers, if any.
+ * The intellectual and technical concepts contained herein
+ * are proprietary to Kuelap, Inc and its suppliers and may
+ * be covered by U.S. and Foreign Patents, patents in process,
+ * and are protected by trade secret or copyright law.
+ * Dissemination of this information or reproduction of this material
+ * is strictly forbidden unless prior written permission is obtained
+ * Kuelap, Inc.
+ */
+package io.mifos.cheque.api.v1.domain;
+
+import org.hibernate.validator.constraints.NotEmpty;
+
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+
+public class Cheque {
+
+  @Valid
+  private MICR micr;
+  @NotEmpty
+  private String drawee;
+  @NotEmpty
+  private String drawer;
+  @NotEmpty
+  private String payee;
+  @NotEmpty
+  private String amount;
+  @NotEmpty
+  private String dateIssued;
+  private Boolean openCheque;
+  private State state;
+  @NotNull
+  private String journalEntryIdentifier;
+
+  public Cheque() {
+    super();
+  }
+
+  public MICR getMicr() {
+    return this.micr;
+  }
+
+  public void setMicr(final MICR micr) {
+    this.micr = micr;
+  }
+
+  public String getDrawee() {
+    return this.drawee;
+  }
+
+  public void setDrawee(final String drawee) {
+    this.drawee = drawee;
+  }
+
+  public String getDrawer() {
+    return this.drawer;
+  }
+
+  public void setDrawer(final String drawer) {
+    this.drawer = drawer;
+  }
+
+  public String getPayee() {
+    return this.payee;
+  }
+
+  public void setPayee(final String payee) {
+    this.payee = payee;
+  }
+
+  public String getAmount() {
+    return this.amount;
+  }
+
+  public void setAmount(final String amount) {
+    this.amount = amount;
+  }
+
+  public String getDateIssued() {
+    return this.dateIssued;
+  }
+
+  public void setDateIssued(final String dateIssued) {
+    this.dateIssued = dateIssued;
+  }
+
+  public Boolean isOpenCheque() {
+    return this.openCheque;
+  }
+
+  public void setOpenCheque(final Boolean openCheque) {
+    this.openCheque = openCheque;
+  }
+
+  public String getState() {
+    return this.state != null ? this.state.name() : null;
+  }
+
+  public void setState(final String state) {
+    this.state = State.valueOf(state);
+  }
+
+  public String getJournalEntryIdentifier() {
+    return this.journalEntryIdentifier;
+  }
+
+  public void setJournalEntryIdentifier(final String journalEntryIdentifier) {
+    this.journalEntryIdentifier = journalEntryIdentifier;
+  }
+}
diff --git a/api/src/main/java/io/mifos/cheque/api/v1/domain/ChequeProcessingCommand.java b/api/src/main/java/io/mifos/cheque/api/v1/domain/ChequeProcessingCommand.java
new file mode 100644
index 0000000..95d57fe
--- /dev/null
+++ b/api/src/main/java/io/mifos/cheque/api/v1/domain/ChequeProcessingCommand.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2017 Kuelap, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * NOTICE:  All information contained herein is, and remains
+ * the property of Kuelap, Inc and its suppliers, if any.
+ * The intellectual and technical concepts contained herein
+ * are proprietary to Kuelap, Inc and its suppliers and may
+ * be covered by U.S. and Foreign Patents, patents in process,
+ * and are protected by trade secret or copyright law.
+ * Dissemination of this information or reproduction of this material
+ * is strictly forbidden unless prior written permission is obtained
+ * Kuelap, Inc.
+ */
+package io.mifos.cheque.api.v1.domain;
+
+import javax.validation.constraints.NotNull;
+
+public class ChequeProcessingCommand {
+
+  @NotNull
+  private Action action;
+
+  public ChequeProcessingCommand() {
+    super();
+  }
+
+  public String getAction() {
+    return this.action.name();
+  }
+
+  public void setAction(final String action) {
+    this.action = Action.valueOf(action);
+  }
+}
diff --git a/api/src/main/java/io/mifos/cheque/api/v1/domain/ChequeTransaction.java b/api/src/main/java/io/mifos/cheque/api/v1/domain/ChequeTransaction.java
new file mode 100644
index 0000000..bcdc5e0
--- /dev/null
+++ b/api/src/main/java/io/mifos/cheque/api/v1/domain/ChequeTransaction.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2017 Kuelap, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * NOTICE:  All information contained herein is, and remains
+ * the property of Kuelap, Inc and its suppliers, if any.
+ * The intellectual and technical concepts contained herein
+ * are proprietary to Kuelap, Inc and its suppliers and may
+ * be covered by U.S. and Foreign Patents, patents in process,
+ * and are protected by trade secret or copyright law.
+ * Dissemination of this information or reproduction of this material
+ * is strictly forbidden unless prior written permission is obtained
+ * Kuelap, Inc.
+ */
+package io.mifos.cheque.api.v1.domain;
+
+import org.hibernate.validator.constraints.NotEmpty;
+
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+
+public class ChequeTransaction {
+
+  @NotNull
+  @Valid
+  private Cheque cheque;
+  @NotEmpty
+  private String creditorAccountNumber;
+
+  public ChequeTransaction() {
+    super();
+  }
+
+  public Cheque getCheque() {
+    return this.cheque;
+  }
+
+  public void setCheque(final Cheque cheque) {
+    this.cheque = cheque;
+  }
+
+  public String getCreditorAccountNumber() {
+    return this.creditorAccountNumber;
+  }
+
+  public void setCreditorAccountNumber(final String creditorAccountNumber) {
+    this.creditorAccountNumber = creditorAccountNumber;
+  }
+}
diff --git a/api/src/main/java/io/mifos/cheque/api/v1/domain/MICR.java b/api/src/main/java/io/mifos/cheque/api/v1/domain/MICR.java
new file mode 100644
index 0000000..05a1a32
--- /dev/null
+++ b/api/src/main/java/io/mifos/cheque/api/v1/domain/MICR.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2017 Kuelap, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * NOTICE:  All information contained herein is, and remains
+ * the property of Kuelap, Inc and its suppliers, if any.
+ * The intellectual and technical concepts contained herein
+ * are proprietary to Kuelap, Inc and its suppliers and may
+ * be covered by U.S. and Foreign Patents, patents in process,
+ * and are protected by trade secret or copyright law.
+ * Dissemination of this information or reproduction of this material
+ * is strictly forbidden unless prior written permission is obtained
+ * Kuelap, Inc.
+ */
+package io.mifos.cheque.api.v1.domain;
+
+import io.mifos.core.lang.validation.constraints.ValidIdentifier;
+
+public class MICR {
+
+  @ValidIdentifier(maxLength = 8)
+  private String chequeNumber;
+  @ValidIdentifier(maxLength = 11)
+  private String branchSortCode;
+  @ValidIdentifier(maxLength = 34)
+  private String accountNumber;
+
+  public MICR() {
+    super();
+  }
+
+  public String getChequeNumber() {
+    return this.chequeNumber;
+  }
+
+  public void setChequeNumber(final String chequeNumber) {
+    this.chequeNumber = chequeNumber;
+  }
+
+  public String getBranchSortCode() {
+    return this.branchSortCode;
+  }
+
+  public void setBranchSortCode(final String branchSortCode) {
+    this.branchSortCode = branchSortCode;
+  }
+
+  public String getAccountNumber() {
+    return this.accountNumber;
+  }
+
+  public void setAccountNumber(final String accountNumber) {
+    this.accountNumber = accountNumber;
+  }
+}
diff --git a/api/src/main/java/io/mifos/cheque/api/v1/domain/State.java b/api/src/main/java/io/mifos/cheque/api/v1/domain/State.java
new file mode 100644
index 0000000..449344f
--- /dev/null
+++ b/api/src/main/java/io/mifos/cheque/api/v1/domain/State.java
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2017 Kuelap, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * NOTICE:  All information contained herein is, and remains
+ * the property of Kuelap, Inc and its suppliers, if any.
+ * The intellectual and technical concepts contained herein
+ * are proprietary to Kuelap, Inc and its suppliers and may
+ * be covered by U.S. and Foreign Patents, patents in process,
+ * and are protected by trade secret or copyright law.
+ * Dissemination of this information or reproduction of this material
+ * is strictly forbidden unless prior written permission is obtained
+ * Kuelap, Inc.
+ */
+package io.mifos.cheque.api.v1.domain;
+
+public enum State {
+  PENDING,
+  PROCESSED,
+  CANCELED
+}
diff --git a/build.gradle b/build.gradle
new file mode 100644
index 0000000..b30bd55
--- /dev/null
+++ b/build.gradle
@@ -0,0 +1,36 @@
+group 'io.mifos'
+
+task publishApiToMavenLocal {
+    dependsOn gradle.includedBuild('api').task(':publishToMavenLocal')
+}
+
+task publishServiceToMavenLocal {
+    mustRunAfter publishApiToMavenLocal
+    dependsOn gradle.includedBuild('service').task(':publishToMavenLocal')
+}
+
+task publishComponentTestToMavenLocal {
+    mustRunAfter publishApiToMavenLocal
+    mustRunAfter publishServiceToMavenLocal
+    dependsOn gradle.includedBuild('component-test').task(':publishToMavenLocal')
+}
+
+task publishToMavenLocal {
+    group 'all'
+    dependsOn publishApiToMavenLocal
+    dependsOn publishServiceToMavenLocal
+    dependsOn publishComponentTestToMavenLocal
+}
+
+task prepareForTest {
+    group 'all'
+    dependsOn publishToMavenLocal
+    dependsOn gradle.includedBuild('component-test').task(':build')
+}
+
+task licenseFormat {
+    group 'all'
+    dependsOn gradle.includedBuild('api').task(':licenseFormat')
+    dependsOn gradle.includedBuild('service').task(':licenseFormat')
+    dependsOn gradle.includedBuild('component-test').task(':licenseFormat')
+}
diff --git a/component-test/build.gradle b/component-test/build.gradle
new file mode 100644
index 0000000..9e5047e
--- /dev/null
+++ b/component-test/build.gradle
@@ -0,0 +1,38 @@
+buildscript {
+    ext {
+        springBootVersion = '1.4.1.RELEASE'
+    }
+
+    repositories {
+        jcenter()
+    }
+
+    dependencies {
+        classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
+    }
+}
+
+plugins {
+    id "com.github.hierynomus.license" version "0.13.1"
+}
+apply from: '../shared.gradle'
+
+dependencies {
+    compile(
+            [group: 'io.kuelap.cheques', name: 'api', version: project.version],
+            [group: 'io.kuelap.cheques', name: 'service', version: project.version],
+            [group: 'io.mifos.anubis', name: 'test', version: versions.frameworkanubis],
+            [group: 'io.mifos.core', name: 'api', version: versions.frameworkapi],
+            [group: 'io.mifos.core', name: 'test', version: versions.frameworktest],
+            [group: 'io.mifos.core', name: 'lang', version: versions.frameworklang],
+            [group: 'org.springframework.boot', name: 'spring-boot-starter-test']
+    )
+}
+
+publishing {
+    publications {
+        mavenJava(MavenPublication) {
+            from components.java
+        }
+    }
+}
diff --git a/component-test/settings.gradle b/component-test/settings.gradle
new file mode 100644
index 0000000..07867cb
--- /dev/null
+++ b/component-test/settings.gradle
@@ -0,0 +1 @@
+rootProject.name = 'component-test'
\ No newline at end of file
diff --git a/component-test/src/main/java/io/mifos/cheque/AbstractChequeTest.java b/component-test/src/main/java/io/mifos/cheque/AbstractChequeTest.java
new file mode 100644
index 0000000..177df2c
--- /dev/null
+++ b/component-test/src/main/java/io/mifos/cheque/AbstractChequeTest.java
@@ -0,0 +1,118 @@
+/*
+ * Copyright 2017 Kuelap, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * NOTICE:  All information contained herein is, and remains
+ * the property of Kuelap, Inc and its suppliers, if any.
+ * The intellectual and technical concepts contained herein
+ * are proprietary to Kuelap, Inc and its suppliers and may
+ * be covered by U.S. and Foreign Patents, patents in process,
+ * and are protected by trade secret or copyright law.
+ * Dissemination of this information or reproduction of this material
+ * is strictly forbidden unless prior written permission is obtained
+ * Kuelap, Inc.
+ */
+package io.mifos.cheque;
+
+import io.mifos.anubis.test.v1.TenantApplicationSecurityEnvironmentTestRule;
+import io.mifos.cheque.api.v1.EventConstants;
+import io.mifos.cheque.api.v1.client.ChequeManager;
+import io.mifos.cheque.service.ChequeConfiguration;
+import io.mifos.core.api.context.AutoUserContext;
+import io.mifos.core.lang.ApplicationName;
+import io.mifos.core.test.fixture.TenantDataStoreContextTestRule;
+import io.mifos.core.test.listener.EnableEventRecording;
+import io.mifos.core.test.listener.EventRecorder;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.ClassRule;
+import org.junit.Rule;
+import org.junit.runner.RunWith;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.cloud.netflix.feign.EnableFeignClients;
+import org.springframework.cloud.netflix.ribbon.RibbonClient;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Import;
+import org.springframework.test.context.junit4.SpringRunner;
+
+@RunWith(SpringRunner.class)
+@SpringBootTest(
+    webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT,
+    classes = {AbstractChequeTest.TestConfiguration.class}
+)
+public abstract class AbstractChequeTest extends SuiteTestEnvironment {
+  private static final String TEST_USER = "shed";
+  public static final String TEST_LOGGER = "test-logger";
+
+  @ClassRule
+  public final static TenantDataStoreContextTestRule tenantDataStoreContext =
+      TenantDataStoreContextTestRule.forRandomTenantName(cassandraInitializer, mariaDBInitializer);
+
+  @Rule
+  public final TenantApplicationSecurityEnvironmentTestRule tenantApplicationSecurityEnvironment
+      = new TenantApplicationSecurityEnvironmentTestRule(testEnvironment, this::waitForInitialize);
+
+  @Autowired
+  @Qualifier(TEST_LOGGER)
+  protected Logger logger;
+
+  @Autowired
+  ChequeManager chequeManager;
+
+  @Autowired
+  private ApplicationName applicationName;
+
+  @Autowired
+  EventRecorder eventRecorder;
+
+  private AutoUserContext autoUserContext;
+
+  AbstractChequeTest() {
+    super();
+  }
+
+  @Before
+  public void prepTest() throws Exception {
+    this.autoUserContext = this.tenantApplicationSecurityEnvironment.createAutoUserContext(AbstractChequeTest.TEST_USER);
+  }
+
+  @After
+  public void cleanTest() throws Exception {
+    this.autoUserContext.close();
+  }
+
+  public boolean waitForInitialize() {
+    try {
+      final String version = this.applicationName.getVersionString();
+      this.logger.info("Waiting on initialize event for version: {}.", version);
+      return this.eventRecorder.wait(EventConstants.INITIALIZE, version);
+    } catch (final InterruptedException e) {
+      throw new IllegalStateException(e);
+    }
+  }
+
+  @Configuration
+  @EnableEventRecording
+  @EnableFeignClients(basePackages = {"io.mifos.cheque.api.v1"})
+  @RibbonClient(name = APP_NAME)
+  @Import({ChequeConfiguration.class})
+  @ComponentScan("io.mifos.cheque.listener")
+  public static class TestConfiguration {
+    public TestConfiguration() {
+      super();
+    }
+
+    @Bean(name= TEST_LOGGER)
+    public Logger logger() {
+      return LoggerFactory.getLogger(TEST_LOGGER);
+    }
+  }
+}
+
diff --git a/component-test/src/main/java/io/mifos/cheque/Fixture.java b/component-test/src/main/java/io/mifos/cheque/Fixture.java
new file mode 100644
index 0000000..2eda2b5
--- /dev/null
+++ b/component-test/src/main/java/io/mifos/cheque/Fixture.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2017 Kuelap, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * NOTICE:  All information contained herein is, and remains
+ * the property of Kuelap, Inc and its suppliers, if any.
+ * The intellectual and technical concepts contained herein
+ * are proprietary to Kuelap, Inc and its suppliers and may
+ * be covered by U.S. and Foreign Patents, patents in process,
+ * and are protected by trade secret or copyright law.
+ * Dissemination of this information or reproduction of this material
+ * is strictly forbidden unless prior written permission is obtained
+ * Kuelap, Inc.
+ */
+package io.mifos.cheque;
+
+import io.mifos.cheque.api.v1.domain.Cheque;
+import io.mifos.cheque.api.v1.domain.MICR;
+import io.mifos.core.lang.DateConverter;
+import org.apache.commons.lang3.RandomStringUtils;
+
+import java.time.Clock;
+import java.time.LocalDate;
+
+public class Fixture {
+
+  private Fixture() {
+    super();
+  }
+
+  public static Cheque createRandomCheque() {
+    final MICR micr = new MICR();
+    micr.setChequeNumber(RandomStringUtils.randomNumeric(2));
+    micr.setBranchSortCode(RandomStringUtils.randomAlphanumeric(11));
+    micr.setAccountNumber(RandomStringUtils.randomAlphanumeric(34));
+
+    final Cheque cheque = new Cheque();
+    cheque.setMicr(micr);
+    cheque.setDrawee(RandomStringUtils.randomAlphanumeric(2048));
+    cheque.setDrawer(RandomStringUtils.randomAlphanumeric(256));
+    cheque.setPayee(RandomStringUtils.randomAlphanumeric(256));
+    cheque.setAmount(Double.valueOf(5000.00).toString());
+    cheque.setDateIssued(DateConverter.toIsoString(LocalDate.now(Clock.systemUTC())));
+    cheque.setJournalEntryIdentifier(RandomStringUtils.randomAlphanumeric(2200));
+
+    return cheque;
+  }
+}
diff --git a/component-test/src/main/java/io/mifos/cheque/SuiteTestEnvironment.java b/component-test/src/main/java/io/mifos/cheque/SuiteTestEnvironment.java
new file mode 100644
index 0000000..5f73420
--- /dev/null
+++ b/component-test/src/main/java/io/mifos/cheque/SuiteTestEnvironment.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2017 Kuelap, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * NOTICE:  All information contained herein is, and remains
+ * the property of Kuelap, Inc and its suppliers, if any.
+ * The intellectual and technical concepts contained herein
+ * are proprietary to Kuelap, Inc and its suppliers and may
+ * be covered by U.S. and Foreign Patents, patents in process,
+ * and are protected by trade secret or copyright law.
+ * Dissemination of this information or reproduction of this material
+ * is strictly forbidden unless prior written permission is obtained
+ * Kuelap, Inc.
+ */
+package io.mifos.cheque;
+
+
+import io.mifos.core.test.env.TestEnvironment;
+import io.mifos.core.test.fixture.cassandra.CassandraInitializer;
+import io.mifos.core.test.fixture.mariadb.MariaDBInitializer;
+import org.junit.ClassRule;
+import org.junit.rules.RuleChain;
+import org.junit.rules.RunExternalResourceOnce;
+import org.junit.rules.TestRule;
+
+/**
+ * @author Myrle Krantz
+ */
+public class SuiteTestEnvironment {
+  static final String APP_NAME = "cheques-v1";
+  static final TestEnvironment testEnvironment = new TestEnvironment(APP_NAME);
+  static final CassandraInitializer cassandraInitializer = new CassandraInitializer();
+  static final MariaDBInitializer mariaDBInitializer = new MariaDBInitializer();
+
+  @ClassRule
+  public static TestRule orderClassRules = RuleChain
+      .outerRule(new RunExternalResourceOnce(testEnvironment))
+      .around(new RunExternalResourceOnce(cassandraInitializer))
+      .around(new RunExternalResourceOnce(mariaDBInitializer));
+}
diff --git a/component-test/src/main/java/io/mifos/cheque/TestCheques.java b/component-test/src/main/java/io/mifos/cheque/TestCheques.java
new file mode 100644
index 0000000..78fd545
--- /dev/null
+++ b/component-test/src/main/java/io/mifos/cheque/TestCheques.java
@@ -0,0 +1,210 @@
+/*
+ * Copyright 2017 Kuelap, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * NOTICE:  All information contained herein is, and remains
+ * the property of Kuelap, Inc and its suppliers, if any.
+ * The intellectual and technical concepts contained herein
+ * are proprietary to Kuelap, Inc and its suppliers and may
+ * be covered by U.S. and Foreign Patents, patents in process,
+ * and are protected by trade secret or copyright law.
+ * Dissemination of this information or reproduction of this material
+ * is strictly forbidden unless prior written permission is obtained
+ * Kuelap, Inc.
+ */
+package io.mifos.cheque;
+
+import com.google.common.collect.Sets;
+import io.mifos.accounting.api.v1.domain.Creditor;
+import io.mifos.accounting.api.v1.domain.Debtor;
+import io.mifos.accounting.api.v1.domain.JournalEntry;
+import io.mifos.cheque.api.v1.EventConstants;
+import io.mifos.cheque.api.v1.client.IssuingCount;
+import io.mifos.cheque.api.v1.domain.Action;
+import io.mifos.cheque.api.v1.domain.Cheque;
+import io.mifos.cheque.api.v1.domain.ChequeProcessingCommand;
+import io.mifos.cheque.api.v1.domain.ChequeTransaction;
+import io.mifos.cheque.api.v1.domain.State;
+import io.mifos.cheque.service.internal.format.MICRParser;
+import io.mifos.cheque.service.internal.service.helper.AccountingService;
+import io.mifos.cheque.service.internal.service.helper.DepositService;
+import io.mifos.cheque.service.internal.service.helper.OrganizationService;
+import org.apache.commons.lang3.RandomStringUtils;
+import org.junit.Assert;
+import org.junit.Test;
+import org.mockito.Matchers;
+import org.mockito.Mockito;
+import org.springframework.boot.test.mock.mockito.MockBean;
+
+import java.util.Collections;
+import java.util.UUID;
+
+public class TestCheques extends AbstractChequeTest {
+
+  @MockBean
+  private OrganizationService organizationServiceSpy;
+
+  @MockBean
+  private DepositService depositServiceSpy;
+
+  @MockBean
+  private AccountingService accountingServiceSpy;
+
+  public TestCheques() {
+    super();
+  }
+
+  @Test
+  public void shouldProcessChequeOnUs() throws Exception {
+    final Cheque randomCheque = Fixture.createRandomCheque();
+
+    final IssuingCount issuingCount = new IssuingCount();
+    issuingCount.setAccountIdentifier(randomCheque.getMicr().getAccountNumber());
+    issuingCount.setAmount(100);
+
+    Mockito
+        .doAnswer(invocation -> Collections.emptyList())
+        .when(this.depositServiceSpy).getIssueChequeCharges(randomCheque.getMicr().getAccountNumber());
+
+    super.chequeManager.issue(issuingCount);
+
+    Assert.assertTrue(
+        super.eventRecorder.wait(EventConstants.ISSUE_CHEQUES, randomCheque.getMicr().getAccountNumber())
+    );
+
+    Mockito
+        .doAnswer(invocation -> true)
+        .when(this.organizationServiceSpy).officeExistsByBranchSortCode(randomCheque.getMicr().getBranchSortCode());
+
+    Mockito
+        .doAnswer(invocation -> true)
+        .when(this.accountingServiceSpy).accountExists(randomCheque.getMicr().getAccountNumber());
+
+
+    final ChequeTransaction chequeTransaction = new ChequeTransaction();
+    chequeTransaction.setCheque(randomCheque);
+    chequeTransaction.setCreditorAccountNumber(RandomStringUtils.randomAlphanumeric(34));
+    super.chequeManager.process(chequeTransaction);
+
+    Assert.assertTrue(
+      super.eventRecorder.wait(EventConstants.CHEQUE_TRANSACTION, MICRParser.toIdentifier(randomCheque.getMicr()))
+    );
+
+    final Cheque fetchedCheque = super.chequeManager.get(MICRParser.toIdentifier(randomCheque.getMicr()));
+    Assert.assertNotNull(fetchedCheque);
+    Assert.assertEquals(State.PROCESSED.name(), fetchedCheque.getState());
+
+    Mockito
+        .verify(this.accountingServiceSpy, Mockito.times(1))
+        .processJournalEntry(Matchers.any(JournalEntry.class));
+  }
+
+  @Test
+  public void shouldApproveChequeNotOnUs() throws Exception {
+    final Cheque randomCheque = Fixture.createRandomCheque();
+
+    Mockito
+        .doAnswer(invocation -> false)
+        .when(this.organizationServiceSpy).officeExistsByBranchSortCode(randomCheque.getMicr().getBranchSortCode());
+
+    Mockito
+        .doAnswer(invocation -> false)
+        .when(this.accountingServiceSpy).accountExists(randomCheque.getMicr().getAccountNumber());
+
+
+    final ChequeTransaction chequeTransaction = new ChequeTransaction();
+    chequeTransaction.setCheque(randomCheque);
+    chequeTransaction.setCreditorAccountNumber(RandomStringUtils.randomAlphanumeric(34));
+    super.chequeManager.process(chequeTransaction);
+
+    Assert.assertTrue(
+        super.eventRecorder.wait(EventConstants.CHEQUE_TRANSACTION, MICRParser.toIdentifier(randomCheque.getMicr()))
+    );
+
+    final Cheque fetchedCheque = super.chequeManager.get(MICRParser.toIdentifier(randomCheque.getMicr()));
+    Assert.assertNotNull(fetchedCheque);
+    Assert.assertEquals(State.PENDING.name(), fetchedCheque.getState());
+
+    final ChequeProcessingCommand chequeProcessingCommand = new ChequeProcessingCommand();
+    chequeProcessingCommand.setAction(Action.APPROVE.name());
+
+    super.chequeManager.process(MICRParser.toIdentifier(fetchedCheque.getMicr()), chequeProcessingCommand);
+
+    Assert.assertTrue(
+        super.eventRecorder.wait(EventConstants.CHEQUE_TRANSACTION_APPROVED,
+            MICRParser.toIdentifier(fetchedCheque.getMicr()))
+    );
+
+    final Cheque approvedCheque = super.chequeManager.get(MICRParser.toIdentifier(randomCheque.getMicr()));
+    Assert.assertNotNull(approvedCheque);
+    Assert.assertEquals(State.PROCESSED.name(), approvedCheque.getState());
+
+    Mockito
+        .verify(this.accountingServiceSpy, Mockito.times(1))
+        .processJournalEntry(Matchers.any(JournalEntry.class));
+  }
+
+  @Test
+  public void shouldCancelChequeNotOnUs() throws Exception {
+    final Cheque randomCheque = Fixture.createRandomCheque();
+
+    Mockito
+        .doAnswer(invocation -> false)
+        .when(this.organizationServiceSpy).officeExistsByBranchSortCode(randomCheque.getMicr().getBranchSortCode());
+
+    Mockito
+        .doAnswer(invocation -> false)
+        .when(this.accountingServiceSpy).accountExists(randomCheque.getMicr().getAccountNumber());
+
+
+    final ChequeTransaction chequeTransaction = new ChequeTransaction();
+    chequeTransaction.setCheque(randomCheque);
+    chequeTransaction.setCreditorAccountNumber(RandomStringUtils.randomAlphanumeric(34));
+    super.chequeManager.process(chequeTransaction);
+
+    Assert.assertTrue(
+        super.eventRecorder.wait(EventConstants.CHEQUE_TRANSACTION, MICRParser.toIdentifier(randomCheque.getMicr()))
+    );
+
+    final Cheque fetchedCheque = super.chequeManager.get(MICRParser.toIdentifier(randomCheque.getMicr()));
+    Assert.assertNotNull(fetchedCheque);
+    Assert.assertEquals(State.PENDING.name(), fetchedCheque.getState());
+
+    final ChequeProcessingCommand chequeProcessingCommand = new ChequeProcessingCommand();
+    chequeProcessingCommand.setAction(Action.CANCEL.name());
+
+    Mockito
+        .doAnswer(invocation -> {
+          final JournalEntry journalEntry = new JournalEntry();
+          journalEntry.setTransactionIdentifier(UUID.randomUUID().toString());
+
+          final Debtor debtor = new Debtor();
+          debtor.setAccountNumber(RandomStringUtils.randomAlphanumeric(34));
+          debtor.setAmount("100.00");
+          journalEntry.setDebtors(Sets.newHashSet(debtor));
+
+          final Creditor creditor = new Creditor();
+          creditor.setAccountNumber(RandomStringUtils.randomAlphanumeric(34));
+          creditor.setAmount("100.00");
+          journalEntry.setCreditors(Sets.newHashSet(creditor));
+          return journalEntry;
+        })
+        .when(this.accountingServiceSpy).findJournalEntry(Matchers.anyString());
+
+    super.chequeManager.process(MICRParser.toIdentifier(fetchedCheque.getMicr()), chequeProcessingCommand);
+
+    Assert.assertTrue(
+        super.eventRecorder.wait(EventConstants.CHEQUE_TRANSACTION_CANCELED,
+            MICRParser.toIdentifier(fetchedCheque.getMicr()))
+    );
+
+    final Cheque canceledCheque = super.chequeManager.get(MICRParser.toIdentifier(randomCheque.getMicr()));
+    Assert.assertNotNull(canceledCheque);
+    Assert.assertEquals(State.CANCELED.name(), canceledCheque.getState());
+
+    Mockito
+        .verify(this.accountingServiceSpy, Mockito.times(2))
+        .processJournalEntry(Matchers.any(JournalEntry.class));
+  }
+}
diff --git a/component-test/src/main/java/io/mifos/cheque/TestIssuingCheques.java b/component-test/src/main/java/io/mifos/cheque/TestIssuingCheques.java
new file mode 100644
index 0000000..474ad4b
--- /dev/null
+++ b/component-test/src/main/java/io/mifos/cheque/TestIssuingCheques.java
@@ -0,0 +1,99 @@
+/*
+ * Copyright 2017 Kuelap, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * NOTICE:  All information contained herein is, and remains
+ * the property of Kuelap, Inc and its suppliers, if any.
+ * The intellectual and technical concepts contained herein
+ * are proprietary to Kuelap, Inc and its suppliers and may
+ * be covered by U.S. and Foreign Patents, patents in process,
+ * and are protected by trade secret or copyright law.
+ * Dissemination of this information or reproduction of this material
+ * is strictly forbidden unless prior written permission is obtained
+ * Kuelap, Inc.
+ */
+package io.mifos.cheque;
+
+import io.mifos.cheque.api.v1.client.IssuingCount;
+import io.mifos.cheque.service.internal.repository.IssuedChequeEntity;
+import io.mifos.cheque.service.internal.repository.IssuedChequeRepository;
+import io.mifos.cheque.service.internal.service.helper.AccountingService;
+import io.mifos.cheque.service.internal.service.helper.DepositService;
+import org.apache.commons.lang3.RandomStringUtils;
+import org.junit.Assert;
+import org.junit.Test;
+import org.mockito.Mockito;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.mock.mockito.MockBean;
+
+import java.util.Collections;
+import java.util.Optional;
+
+public class TestIssuingCheques extends AbstractChequeTest {
+
+  @MockBean
+  private DepositService depositServiceSpy;
+
+  @MockBean
+  private AccountingService accountingServiceSpy;
+
+  @Autowired
+  private IssuedChequeRepository issuedChequeRepository;
+
+  public TestIssuingCheques() {
+    super();
+  }
+
+  @Test
+  public void shouldIssueChequesWithGivenStartSequence() throws Exception {
+    final IssuingCount issuingCount = new IssuingCount();
+    issuingCount.setAccountIdentifier(RandomStringUtils.randomAlphanumeric(34));
+    issuingCount.setStart(201);
+    issuingCount.setAmount(10);
+
+    Mockito
+        .doAnswer(invocation -> Collections.emptyList())
+        .when(this.depositServiceSpy).getIssueChequeCharges(issuingCount.getAccountIdentifier());
+
+    final String accountIdentifier = super.chequeManager.issue(issuingCount);
+    Assert.assertEquals(issuingCount.getAccountIdentifier(), accountIdentifier);
+
+    final Optional<IssuedChequeEntity> optionalIssuedCheque =
+        this.issuedChequeRepository.findByAccountIdentifier(accountIdentifier);
+
+    Assert.assertTrue(optionalIssuedCheque.isPresent());
+    Assert.assertEquals(Integer.valueOf(210), optionalIssuedCheque.get().getLastIssuedNumber());
+  }
+
+  @Test
+  public void shouldIssueChequesForNextIssuing() throws Exception {
+    final IssuingCount issuingCount = new IssuingCount();
+    issuingCount.setAccountIdentifier(RandomStringUtils.randomAlphanumeric(34));
+    issuingCount.setAmount(50);
+
+    Mockito
+        .doAnswer(invocation -> Collections.emptyList())
+        .when(this.depositServiceSpy).getIssueChequeCharges(issuingCount.getAccountIdentifier());
+
+    final String accountIdentifier = super.chequeManager.issue(issuingCount);
+    Assert.assertEquals(issuingCount.getAccountIdentifier(), accountIdentifier);
+
+    final Optional<IssuedChequeEntity> optionalIssuedCheque =
+        this.issuedChequeRepository.findByAccountIdentifier(accountIdentifier);
+
+    Assert.assertTrue(optionalIssuedCheque.isPresent());
+    Assert.assertEquals(Integer.valueOf(50), optionalIssuedCheque.get().getLastIssuedNumber());
+
+    issuingCount.setAmount(50);
+
+    final String nextFetchedAccountIdentifier = super.chequeManager.issue(issuingCount);
+    Assert.assertEquals(issuingCount.getAccountIdentifier(), nextFetchedAccountIdentifier);
+
+    final Optional<IssuedChequeEntity> nextOptionalIssuedCheque =
+        this.issuedChequeRepository.findByAccountIdentifier(nextFetchedAccountIdentifier);
+
+    Assert.assertTrue(nextOptionalIssuedCheque.isPresent());
+    Assert.assertEquals(Integer.valueOf(100), nextOptionalIssuedCheque.get().getLastIssuedNumber());
+  }
+}
diff --git a/component-test/src/main/java/io/mifos/cheque/TestSuite.java b/component-test/src/main/java/io/mifos/cheque/TestSuite.java
new file mode 100644
index 0000000..8dfa201
--- /dev/null
+++ b/component-test/src/main/java/io/mifos/cheque/TestSuite.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2017 Kuelap, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * NOTICE:  All information contained herein is, and remains
+ * the property of Kuelap, Inc and its suppliers, if any.
+ * The intellectual and technical concepts contained herein
+ * are proprietary to Kuelap, Inc and its suppliers and may
+ * be covered by U.S. and Foreign Patents, patents in process,
+ * and are protected by trade secret or copyright law.
+ * Dissemination of this information or reproduction of this material
+ * is strictly forbidden unless prior written permission is obtained
+ * Kuelap, Inc.
+ */
+package io.mifos.cheque;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+/**
+ * @author Myrle Krantz
+ */
+@RunWith(Suite.class)
+@Suite.SuiteClasses({
+    TestIssuingCheques.class,
+    TestCheques.class
+})
+public class TestSuite extends SuiteTestEnvironment {
+}
diff --git a/component-test/src/main/java/io/mifos/cheque/listener/ChequeEventListener.java b/component-test/src/main/java/io/mifos/cheque/listener/ChequeEventListener.java
new file mode 100644
index 0000000..1432897
--- /dev/null
+++ b/component-test/src/main/java/io/mifos/cheque/listener/ChequeEventListener.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright 2017 Kuelap, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * NOTICE:  All information contained herein is, and remains
+ * the property of Kuelap, Inc and its suppliers, if any.
+ * The intellectual and technical concepts contained herein
+ * are proprietary to Kuelap, Inc and its suppliers and may
+ * be covered by U.S. and Foreign Patents, patents in process,
+ * and are protected by trade secret or copyright law.
+ * Dissemination of this information or reproduction of this material
+ * is strictly forbidden unless prior written permission is obtained
+ * Kuelap, Inc.
+ */
+package io.mifos.cheque.listener;
+
+import io.mifos.cheque.AbstractChequeTest;
+import io.mifos.cheque.api.v1.EventConstants;
+import io.mifos.core.lang.config.TenantHeaderFilter;
+import io.mifos.core.test.listener.EventRecorder;
+import org.slf4j.Logger;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.jms.annotation.JmsListener;
+import org.springframework.messaging.handler.annotation.Header;
+import org.springframework.stereotype.Component;
+
+@Component
+public class ChequeEventListener {
+
+  private final Logger logger;
+  private final EventRecorder eventRecorder;
+
+  public ChequeEventListener(@Qualifier(AbstractChequeTest.TEST_LOGGER) final Logger logger,
+                             final EventRecorder eventRecorder) {
+    super();
+    this.logger = logger;
+    this.eventRecorder = eventRecorder;
+  }
+
+  @JmsListener(
+      destination = EventConstants.DESTINATION,
+      selector = EventConstants.SELECTOR_ISSUE_CHEQUES,
+      subscription = EventConstants.DESTINATION
+  )
+  public void onIssueCheques(@Header(TenantHeaderFilter.TENANT_HEADER) final String tenant,
+                             final String payload) {
+    this.logger.debug("Cheques issued.");
+    this.eventRecorder.event(tenant, EventConstants.ISSUE_CHEQUES, payload, String.class);
+  }
+
+  @JmsListener(
+      destination = EventConstants.DESTINATION,
+      selector = EventConstants.SELECTOR_CHEQUE_TRANSACTION,
+      subscription = EventConstants.DESTINATION
+  )
+  public void onChequeTransaction(@Header(TenantHeaderFilter.TENANT_HEADER) final String tenant,
+                                  final String payload) {
+    this.logger.debug("Cheque transaction processed.");
+    this.eventRecorder.event(tenant, EventConstants.CHEQUE_TRANSACTION, payload, String.class);
+  }
+
+  @JmsListener(
+      destination = EventConstants.DESTINATION,
+      selector = EventConstants.SELECTOR_CHEQUE_TRANSACTION_APPROVED,
+      subscription = EventConstants.DESTINATION
+  )
+  public void onChequeApproved(@Header(TenantHeaderFilter.TENANT_HEADER) final String tenant,
+                               final String payload) {
+    this.logger.debug("Cheque transaction approved.");
+    this.eventRecorder.event(tenant, EventConstants.CHEQUE_TRANSACTION_APPROVED, payload, String.class);
+  }
+
+  @JmsListener(
+      destination = EventConstants.DESTINATION,
+      selector = EventConstants.SELECTOR_CHEQUE_TRANSACTION_CANCELED,
+      subscription = EventConstants.DESTINATION
+  )
+  public void onChequeCanceled(@Header(TenantHeaderFilter.TENANT_HEADER) final String tenant,
+                               final String payload) {
+    this.logger.debug("Cheque transaction canceled.");
+    this.eventRecorder.event(tenant, EventConstants.CHEQUE_TRANSACTION_CANCELED, payload, String.class);
+  }
+}
diff --git a/component-test/src/main/java/io/mifos/cheque/listener/ManagementEventMigrationListener.java b/component-test/src/main/java/io/mifos/cheque/listener/ManagementEventMigrationListener.java
new file mode 100644
index 0000000..1afa7ad
--- /dev/null
+++ b/component-test/src/main/java/io/mifos/cheque/listener/ManagementEventMigrationListener.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2017 Kuelap, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * NOTICE:  All information contained herein is, and remains
+ * the property of Kuelap, Inc and its suppliers, if any.
+ * The intellectual and technical concepts contained herein
+ * are proprietary to Kuelap, Inc and its suppliers and may
+ * be covered by U.S. and Foreign Patents, patents in process,
+ * and are protected by trade secret or copyright law.
+ * Dissemination of this information or reproduction of this material
+ * is strictly forbidden unless prior written permission is obtained
+ * Kuelap, Inc.
+ */
+package io.mifos.cheque.listener;
+
+import io.mifos.cheque.AbstractChequeTest;
+import io.mifos.cheque.api.v1.EventConstants;
+import io.mifos.core.lang.config.TenantHeaderFilter;
+import io.mifos.core.test.listener.EventRecorder;
+import org.slf4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.jms.annotation.JmsListener;
+import org.springframework.messaging.handler.annotation.Header;
+import org.springframework.stereotype.Component;
+
+@Component
+public class ManagementEventMigrationListener {
+
+  private final Logger logger;
+  private final EventRecorder eventRecorder;
+
+  @Autowired
+  public ManagementEventMigrationListener(@Qualifier(AbstractChequeTest.TEST_LOGGER) final Logger logger,
+                                          final EventRecorder eventRecorder) {
+    super();
+    this.logger = logger;
+    this.eventRecorder = eventRecorder;
+  }
+
+  @JmsListener(
+      destination = EventConstants.DESTINATION,
+      selector = EventConstants.SELECTOR_INITIALIZE,
+      subscription = EventConstants.DESTINATION
+  )
+  public void onInitialize(@Header(TenantHeaderFilter.TENANT_HEADER) final String tenant,
+                           final String payload) {
+    this.logger.debug("Service initialized.");
+    this.eventRecorder.event(tenant, EventConstants.INITIALIZE, payload, String.class);
+  }
+}
diff --git a/component-test/src/main/resources/logback-test.xml b/component-test/src/main/resources/logback-test.xml
new file mode 100644
index 0000000..321fb42
--- /dev/null
+++ b/component-test/src/main/resources/logback-test.xml
@@ -0,0 +1,32 @@
+<!--
+
+    Copyright 2017 Kuelap, Inc.
+
+    All Rights Reserved.
+
+    NOTICE:  All information contained herein is, and remains
+    the property of Kuelap, Inc and its suppliers, if any.
+    The intellectual and technical concepts contained herein
+    are proprietary to Kuelap, Inc and its suppliers and may
+    be covered by U.S. and Foreign Patents, patents in process,
+    and are protected by trade secret or copyright law.
+    Dissemination of this information or reproduction of this material
+    is strictly forbidden unless prior written permission is obtained
+    Kuelap, Inc.
+
+-->
+<configuration>
+    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+        <encoder>
+            <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
+        </encoder>
+    </appender>
+
+    <logger name="org" level="INFO"/>
+    <logger name="com" level="INFO"/>
+    <logger name="ch" level="OFF"/>
+
+    <root level="DEBUG">
+        <appender-ref ref="STDOUT"/>
+    </root>
+</configuration>
\ No newline at end of file
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..400f155
Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..71e5108
--- /dev/null
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Tue Jul 25 13:05:05 CEST 2017
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-all.zip
diff --git a/gradlew b/gradlew
new file mode 100644
index 0000000..4453cce
--- /dev/null
+++ b/gradlew
@@ -0,0 +1,172 @@
+#!/usr/bin/env sh
+
+##############################################################################
+##
+##  Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+    ls=`ls -ld "$PRG"`
+    link=`expr "$ls" : '.*-> \(.*\)$'`
+    if expr "$link" : '/.*' > /dev/null; then
+        PRG="$link"
+    else
+        PRG=`dirname "$PRG"`"/$link"
+    fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn ( ) {
+    echo "$*"
+}
+
+die ( ) {
+    echo
+    echo "$*"
+    echo
+    exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+  CYGWIN* )
+    cygwin=true
+    ;;
+  Darwin* )
+    darwin=true
+    ;;
+  MINGW* )
+    msys=true
+    ;;
+  NONSTOP* )
+    nonstop=true
+    ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+        # IBM's JDK on AIX uses strange locations for the executables
+        JAVACMD="$JAVA_HOME/jre/sh/java"
+    else
+        JAVACMD="$JAVA_HOME/bin/java"
+    fi
+    if [ ! -x "$JAVACMD" ] ; then
+        die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+    fi
+else
+    JAVACMD="java"
+    which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+    MAX_FD_LIMIT=`ulimit -H -n`
+    if [ $? -eq 0 ] ; then
+        if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+            MAX_FD="$MAX_FD_LIMIT"
+        fi
+        ulimit -n $MAX_FD
+        if [ $? -ne 0 ] ; then
+            warn "Could not set maximum file descriptor limit: $MAX_FD"
+        fi
+    else
+        warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+    fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+    GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+    APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+    CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+    JAVACMD=`cygpath --unix "$JAVACMD"`
+
+    # We build the pattern for arguments to be converted via cygpath
+    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+    SEP=""
+    for dir in $ROOTDIRSRAW ; do
+        ROOTDIRS="$ROOTDIRS$SEP$dir"
+        SEP="|"
+    done
+    OURCYGPATTERN="(^($ROOTDIRS))"
+    # Add a user-defined pattern to the cygpath arguments
+    if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+        OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+    fi
+    # Now convert the arguments - kludge to limit ourselves to /bin/sh
+    i=0
+    for arg in "$@" ; do
+        CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+        CHECK2=`echo "$arg"|egrep -c "^-"`                                 ### Determine if an option
+
+        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition
+            eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+        else
+            eval `echo args$i`="\"$arg\""
+        fi
+        i=$((i+1))
+    done
+    case $i in
+        (0) set -- ;;
+        (1) set -- "$args0" ;;
+        (2) set -- "$args0" "$args1" ;;
+        (3) set -- "$args0" "$args1" "$args2" ;;
+        (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+        (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+        (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+        (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+        (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+        (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+    esac
+fi
+
+# Escape application args
+save ( ) {
+    for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+    echo " "
+}
+APP_ARGS=$(save "$@")
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+  cd "$(dirname "$0")"
+fi
+
+exec "$JAVACMD" "$@"
diff --git a/gradlew.bat b/gradlew.bat
new file mode 100644
index 0000000..f955316
--- /dev/null
+++ b/gradlew.bat
@@ -0,0 +1,84 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem  Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/service/build.gradle b/service/build.gradle
new file mode 100644
index 0000000..af26fc0
--- /dev/null
+++ b/service/build.gradle
@@ -0,0 +1,67 @@
+buildscript {
+    ext {
+        springBootVersion = '1.4.1.RELEASE'
+    }
+
+    repositories {
+        jcenter()
+    }
+
+    dependencies {
+        classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
+    }
+}
+
+plugins {
+    id "com.github.hierynomus.license" version "0.13.1"
+}
+
+apply from: '../shared.gradle'
+
+apply plugin: 'spring-boot'
+
+springBoot {
+    executable = true
+    classifier = 'boot'
+}
+
+dependencies {
+    compile(
+            [group: 'org.springframework.cloud', name: 'spring-cloud-starter-config'],
+            [group: 'org.springframework.cloud', name: 'spring-cloud-starter-eureka'],
+            [group: 'org.springframework.boot', name: 'spring-boot-starter-jetty'],
+            [group: 'io.kuelap.cheques', name: 'api', version: project.version],
+            [group: 'io.mifos.anubis', name: 'library', version: versions.frameworkanubis],
+            [group: 'io.mifos.accounting', name: 'api', version: versions.frameworkaccounting],
+            [group: 'io.mifos.deposit-account-management', name: 'api', version: versions.frameworkdeposit],
+            [group: 'io.mifos.office', name: 'api', version: versions.frameworkoffice],
+            [group: 'com.google.code.gson', name: 'gson'],
+            [group: 'io.mifos.core', name: 'lang', version: versions.frameworklang],
+            [group: 'io.mifos.core', name: 'async', version: versions.frameworkasync],
+            [group: 'io.mifos.core', name: 'cassandra', version: versions.frameworkcassandra],
+            [group: 'io.mifos.core', name: 'mariadb', version: versions.frameworkmariadb],
+            [group: 'io.mifos.core', name: 'command', version: versions.frameworkcommand],
+            [group: 'org.hibernate', name: 'hibernate-validator', version: versions.validator],
+            [group: 'org.threeten', name: 'threeten-extra', version: '1.2']
+    )
+}
+
+publishToMavenLocal.dependsOn bootRepackage
+
+publishing {
+    publications {
+        service(MavenPublication) {
+            from components.java
+            groupId project.group
+            artifactId project.name
+            version project.version
+        }
+        bootService(MavenPublication) {
+            // "boot" jar
+            artifact("$buildDir/libs/$project.name-$version-boot.jar")
+            groupId project.group
+            artifactId("$project.name-boot")
+            version project.version
+        }
+    }
+}
diff --git a/service/settings.gradle b/service/settings.gradle
new file mode 100644
index 0000000..081feb4
--- /dev/null
+++ b/service/settings.gradle
@@ -0,0 +1 @@
+rootProject.name = 'service'
\ No newline at end of file
diff --git a/service/src/main/java/io/mifos/cheque/service/ChequeApplication.java b/service/src/main/java/io/mifos/cheque/service/ChequeApplication.java
new file mode 100644
index 0000000..78d9674
--- /dev/null
+++ b/service/src/main/java/io/mifos/cheque/service/ChequeApplication.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2017 Kuelap, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * NOTICE:  All information contained herein is, and remains
+ * the property of Kuelap, Inc and its suppliers, if any.
+ * The intellectual and technical concepts contained herein
+ * are proprietary to Kuelap, Inc and its suppliers and may
+ * be covered by U.S. and Foreign Patents, patents in process,
+ * and are protected by trade secret or copyright law.
+ * Dissemination of this information or reproduction of this material
+ * is strictly forbidden unless prior written permission is obtained
+ * Kuelap, Inc.
+ */
+package io.mifos.cheque.service;
+
+import org.springframework.boot.SpringApplication;
+
+public class ChequeApplication {
+
+  public ChequeApplication() {
+    super();
+  }
+
+  public static void main(String[] args) {
+    SpringApplication.run(ChequeConfiguration.class, args);
+  }
+}
diff --git a/service/src/main/java/io/mifos/cheque/service/ChequeConfiguration.java b/service/src/main/java/io/mifos/cheque/service/ChequeConfiguration.java
new file mode 100644
index 0000000..f1f0570
--- /dev/null
+++ b/service/src/main/java/io/mifos/cheque/service/ChequeConfiguration.java
@@ -0,0 +1,82 @@
+/*
+ * Copyright 2017 Kuelap, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * NOTICE:  All information contained herein is, and remains
+ * the property of Kuelap, Inc and its suppliers, if any.
+ * The intellectual and technical concepts contained herein
+ * are proprietary to Kuelap, Inc and its suppliers and may
+ * be covered by U.S. and Foreign Patents, patents in process,
+ * and are protected by trade secret or copyright law.
+ * Dissemination of this information or reproduction of this material
+ * is strictly forbidden unless prior written permission is obtained
+ * Kuelap, Inc.
+ */
+package io.mifos.cheque.service;
+
+import io.mifos.accounting.api.v1.client.LedgerManager;
+import io.mifos.anubis.config.EnableAnubis;
+import io.mifos.core.async.config.EnableAsync;
+import io.mifos.core.cassandra.config.EnableCassandra;
+import io.mifos.core.command.config.EnableCommandProcessing;
+import io.mifos.core.lang.config.EnableServiceException;
+import io.mifos.core.lang.config.EnableTenantContext;
+import io.mifos.core.mariadb.config.EnableMariaDB;
+import io.mifos.deposit.api.v1.client.DepositAccountManager;
+import io.mifos.office.api.v1.client.OrganizationManager;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
+import org.springframework.cloud.netflix.feign.EnableFeignClients;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
+import org.springframework.web.servlet.config.annotation.PathMatchConfigurer;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
+
+@SuppressWarnings("WeakerAccess")
+@Configuration
+@EnableAutoConfiguration
+@EnableDiscoveryClient
+@EnableAsync
+@EnableTenantContext
+@EnableCassandra
+@EnableMariaDB
+@EnableCommandProcessing
+@EnableAnubis
+@EnableServiceException
+@EnableFeignClients(
+    clients = {
+        LedgerManager.class,
+        DepositAccountManager.class,
+        OrganizationManager.class
+    }
+)
+@ComponentScan({
+    "io.mifos.cheque.service.rest",
+    "io.mifos.cheque.service.internal.service",
+    "io.mifos.cheque.service.internal.repository",
+    "io.mifos.cheque.service.internal.command.handler"
+})
+@EnableJpaRepositories({
+    "io.mifos.cheque.service.internal.repository"
+})
+public class ChequeConfiguration extends WebMvcConfigurerAdapter {
+
+  public ChequeConfiguration() {
+    super();
+  }
+
+  @Bean(name = ServiceConstants.LOGGER_NAME)
+  public Logger logger() {
+    return LoggerFactory.getLogger(ServiceConstants.LOGGER_NAME);
+  }
+
+  @Override
+  public void configurePathMatch(final PathMatchConfigurer configurer) {
+    configurer.setUseSuffixPatternMatch(Boolean.FALSE);
+  }
+}
diff --git a/service/src/main/java/io/mifos/cheque/service/ServiceConstants.java b/service/src/main/java/io/mifos/cheque/service/ServiceConstants.java
new file mode 100644
index 0000000..88bcca3
--- /dev/null
+++ b/service/src/main/java/io/mifos/cheque/service/ServiceConstants.java
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2017 Kuelap, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * NOTICE:  All information contained herein is, and remains
+ * the property of Kuelap, Inc and its suppliers, if any.
+ * The intellectual and technical concepts contained herein
+ * are proprietary to Kuelap, Inc and its suppliers and may
+ * be covered by U.S. and Foreign Patents, patents in process,
+ * and are protected by trade secret or copyright law.
+ * Dissemination of this information or reproduction of this material
+ * is strictly forbidden unless prior written permission is obtained
+ * Kuelap, Inc.
+ */
+package io.mifos.cheque.service;
+
+public interface ServiceConstants {
+  String LOGGER_NAME = "cheques";
+
+  String TX_ISSUE_CHEQUES = "ICHQ";
+}
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/command/ApproveChequeTransactionCommand.java b/service/src/main/java/io/mifos/cheque/service/internal/command/ApproveChequeTransactionCommand.java
new file mode 100644
index 0000000..64dc0f0
--- /dev/null
+++ b/service/src/main/java/io/mifos/cheque/service/internal/command/ApproveChequeTransactionCommand.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2017 Kuelap, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * NOTICE:  All information contained herein is, and remains
+ * the property of Kuelap, Inc and its suppliers, if any.
+ * The intellectual and technical concepts contained herein
+ * are proprietary to Kuelap, Inc and its suppliers and may
+ * be covered by U.S. and Foreign Patents, patents in process,
+ * and are protected by trade secret or copyright law.
+ * Dissemination of this information or reproduction of this material
+ * is strictly forbidden unless prior written permission is obtained
+ * Kuelap, Inc.
+ */
+package io.mifos.cheque.service.internal.command;
+
+public class ApproveChequeTransactionCommand {
+  private final String identifier;
+
+  public ApproveChequeTransactionCommand(final String identifier) {
+    super();
+    this.identifier = identifier;
+  }
+
+  public String identifier() {
+    return this.identifier;
+  }
+}
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/command/CancelChequeTransactionCommand.java b/service/src/main/java/io/mifos/cheque/service/internal/command/CancelChequeTransactionCommand.java
new file mode 100644
index 0000000..8bec5e3
--- /dev/null
+++ b/service/src/main/java/io/mifos/cheque/service/internal/command/CancelChequeTransactionCommand.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2017 Kuelap, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * NOTICE:  All information contained herein is, and remains
+ * the property of Kuelap, Inc and its suppliers, if any.
+ * The intellectual and technical concepts contained herein
+ * are proprietary to Kuelap, Inc and its suppliers and may
+ * be covered by U.S. and Foreign Patents, patents in process,
+ * and are protected by trade secret or copyright law.
+ * Dissemination of this information or reproduction of this material
+ * is strictly forbidden unless prior written permission is obtained
+ * Kuelap, Inc.
+ */
+package io.mifos.cheque.service.internal.command;
+
+public class CancelChequeTransactionCommand {
+  private final String identifier;
+
+  public CancelChequeTransactionCommand(final String identifier) {
+    super();
+    this.identifier = identifier;
+  }
+
+  public String identifier() {
+    return this.identifier;
+  }
+}
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/command/ChequeTransactionCommand.java b/service/src/main/java/io/mifos/cheque/service/internal/command/ChequeTransactionCommand.java
new file mode 100644
index 0000000..81c46e6
--- /dev/null
+++ b/service/src/main/java/io/mifos/cheque/service/internal/command/ChequeTransactionCommand.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2017 Kuelap, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * NOTICE:  All information contained herein is, and remains
+ * the property of Kuelap, Inc and its suppliers, if any.
+ * The intellectual and technical concepts contained herein
+ * are proprietary to Kuelap, Inc and its suppliers and may
+ * be covered by U.S. and Foreign Patents, patents in process,
+ * and are protected by trade secret or copyright law.
+ * Dissemination of this information or reproduction of this material
+ * is strictly forbidden unless prior written permission is obtained
+ * Kuelap, Inc.
+ */
+package io.mifos.cheque.service.internal.command;
+
+import io.mifos.cheque.api.v1.domain.Cheque;
+
+public class ChequeTransactionCommand {
+  private final Cheque cheque;
+  private final String creditorAccountNumber;
+
+  public ChequeTransactionCommand(final Cheque cheque, final String creditorAccountNumber) {
+    super();
+    this.cheque = cheque;
+    this.creditorAccountNumber = creditorAccountNumber;
+  }
+
+  public Cheque cheque() {
+    return this.cheque;
+  }
+
+  public String creditorAccountNumber() {
+    return this.creditorAccountNumber;
+  }
+}
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/command/IssueChequesCommand.java b/service/src/main/java/io/mifos/cheque/service/internal/command/IssueChequesCommand.java
new file mode 100644
index 0000000..68c8de7
--- /dev/null
+++ b/service/src/main/java/io/mifos/cheque/service/internal/command/IssueChequesCommand.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2017 Kuelap, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * NOTICE:  All information contained herein is, and remains
+ * the property of Kuelap, Inc and its suppliers, if any.
+ * The intellectual and technical concepts contained herein
+ * are proprietary to Kuelap, Inc and its suppliers and may
+ * be covered by U.S. and Foreign Patents, patents in process,
+ * and are protected by trade secret or copyright law.
+ * Dissemination of this information or reproduction of this material
+ * is strictly forbidden unless prior written permission is obtained
+ * Kuelap, Inc.
+ */
+package io.mifos.cheque.service.internal.command;
+
+public class IssueChequesCommand {
+
+  private final String accountIdentifer;
+  private final Integer startSequence;
+  private final Integer issueCount;
+
+  public IssueChequesCommand(final String accountIdentifer, final Integer startSequence, final Integer issueCount) {
+    super();
+    this.accountIdentifer = accountIdentifer;
+    this.startSequence = startSequence;
+    this.issueCount = issueCount;
+  }
+
+  public String accountIdentifer() {
+    return this.accountIdentifer;
+  }
+
+  public Integer startSequence() {
+    return this.startSequence;
+  }
+
+  public Integer issueCount() {
+    return this.issueCount;
+  }
+}
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/command/MigrationCommand.java b/service/src/main/java/io/mifos/cheque/service/internal/command/MigrationCommand.java
new file mode 100644
index 0000000..fdbf526
--- /dev/null
+++ b/service/src/main/java/io/mifos/cheque/service/internal/command/MigrationCommand.java
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2017 Kuelap, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * NOTICE:  All information contained herein is, and remains
+ * the property of Kuelap, Inc and its suppliers, if any.
+ * The intellectual and technical concepts contained herein
+ * are proprietary to Kuelap, Inc and its suppliers and may
+ * be covered by U.S. and Foreign Patents, patents in process,
+ * and are protected by trade secret or copyright law.
+ * Dissemination of this information or reproduction of this material
+ * is strictly forbidden unless prior written permission is obtained
+ * Kuelap, Inc.
+ */
+package io.mifos.cheque.service.internal.command;
+
+public class MigrationCommand {
+  public MigrationCommand() {
+    super();
+  }
+}
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/command/handler/ChequeAggregate.java b/service/src/main/java/io/mifos/cheque/service/internal/command/handler/ChequeAggregate.java
new file mode 100644
index 0000000..95fd298
--- /dev/null
+++ b/service/src/main/java/io/mifos/cheque/service/internal/command/handler/ChequeAggregate.java
@@ -0,0 +1,265 @@
+/*
+ * Copyright 2017 Kuelap, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * NOTICE:  All information contained herein is, and remains
+ * the property of Kuelap, Inc and its suppliers, if any.
+ * The intellectual and technical concepts contained herein
+ * are proprietary to Kuelap, Inc and its suppliers and may
+ * be covered by U.S. and Foreign Patents, patents in process,
+ * and are protected by trade secret or copyright law.
+ * Dissemination of this information or reproduction of this material
+ * is strictly forbidden unless prior written permission is obtained
+ * Kuelap, Inc.
+ */
+package io.mifos.cheque.service.internal.command.handler;
+
+import com.google.common.collect.Sets;
+import io.mifos.accounting.api.v1.client.AccountNotFoundException;
+import io.mifos.accounting.api.v1.domain.Creditor;
+import io.mifos.accounting.api.v1.domain.Debtor;
+import io.mifos.accounting.api.v1.domain.JournalEntry;
+import io.mifos.cheque.api.v1.EventConstants;
+import io.mifos.cheque.api.v1.domain.MICR;
+import io.mifos.cheque.api.v1.domain.State;
+import io.mifos.cheque.service.ServiceConstants;
+import io.mifos.cheque.service.internal.command.ApproveChequeTransactionCommand;
+import io.mifos.cheque.service.internal.command.CancelChequeTransactionCommand;
+import io.mifos.cheque.service.internal.command.ChequeTransactionCommand;
+import io.mifos.cheque.service.internal.command.IssueChequesCommand;
+import io.mifos.cheque.service.internal.format.MICRParser;
+import io.mifos.cheque.service.internal.mapper.ChequeMapper;
+import io.mifos.cheque.service.internal.repository.ChequeEntity;
+import io.mifos.cheque.service.internal.repository.ChequeRepository;
+import io.mifos.cheque.service.internal.repository.IssuedChequeEntity;
+import io.mifos.cheque.service.internal.repository.IssuedChequeRepository;
+import io.mifos.cheque.service.internal.service.helper.AccountingService;
+import io.mifos.cheque.service.internal.service.helper.DepositService;
+import io.mifos.cheque.service.internal.service.helper.OrganizationService;
+import io.mifos.core.api.util.UserContextHolder;
+import io.mifos.core.command.annotation.Aggregate;
+import io.mifos.core.command.annotation.CommandHandler;
+import io.mifos.core.command.annotation.EventEmitter;
+import io.mifos.core.lang.DateConverter;
+import io.mifos.core.lang.ServiceException;
+import io.mifos.deposit.api.v1.definition.domain.Charge;
+import io.mifos.deposit.api.v1.instance.ProductInstanceNotFoundException;
+import org.slf4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+
+import javax.transaction.Transactional;
+import java.time.Clock;
+import java.time.LocalDateTime;
+import java.util.List;
+import java.util.Optional;
+import java.util.UUID;
+import java.util.stream.Collectors;
+
+@Aggregate
+public class ChequeAggregate {
+
+  private final Logger logger;
+  private final DepositService depositService;
+  private final OrganizationService organizationService;
+  private final AccountingService accountingService;
+  private final IssuedChequeRepository issuedChequeRepository;
+  private final ChequeRepository chequeRepository;
+
+  @Autowired
+  public ChequeAggregate(@Qualifier(ServiceConstants.LOGGER_NAME) final Logger logger,
+                         final DepositService depositService,
+                         final OrganizationService organizationService,
+                         final AccountingService accountingService,
+                         final IssuedChequeRepository issuedChequeRepository,
+                         final ChequeRepository chequeRepository) {
+    super();
+    this.logger = logger;
+    this.depositService = depositService;
+    this.organizationService = organizationService;
+    this.accountingService = accountingService;
+    this.issuedChequeRepository = issuedChequeRepository;
+    this.chequeRepository = chequeRepository;
+  }
+
+  @Transactional
+  @CommandHandler
+  @EventEmitter(selectorName = EventConstants.SELECTOR_NAME, selectorValue = EventConstants.ISSUE_CHEQUES)
+  public String process(final IssueChequesCommand issueChequesCommand) {
+
+    final Optional<IssuedChequeEntity> optionalIssuedCheque =
+        this.issuedChequeRepository.findByAccountIdentifier(issueChequesCommand.accountIdentifer());
+
+    final IssuedChequeEntity issuedChequeEntity = optionalIssuedCheque.orElseGet(() -> {
+      final IssuedChequeEntity toCreate = new IssuedChequeEntity();
+      toCreate.setAccountIdentifier(issueChequesCommand.accountIdentifer());
+      toCreate.setCreatedBy(UserContextHolder.checkedGetUser());
+      toCreate.setCreatedOn(LocalDateTime.now(Clock.systemUTC()));
+      return toCreate;
+    });
+
+    final Integer lastIssuedNumber;
+    if (issuedChequeEntity.getLastIssuedNumber() == null) {
+      lastIssuedNumber = issueChequesCommand.startSequence() != null
+          ? (issueChequesCommand.startSequence() - 1) + issueChequesCommand.issueCount()
+          : issueChequesCommand.issueCount();
+    } else {
+      lastIssuedNumber = issuedChequeEntity.getLastIssuedNumber() + issueChequesCommand.issueCount();
+    }
+
+    issuedChequeEntity.setLastIssuedNumber(lastIssuedNumber);
+    issuedChequeEntity.setLastModifiedBy(UserContextHolder.checkedGetUser());
+    issuedChequeEntity.setLastModifiedOn(LocalDateTime.now(Clock.systemUTC()));
+
+    this.issuedChequeRepository.save(issuedChequeEntity);
+
+    try {
+      final List<Charge> issueChequeCharges =
+          this.depositService.getIssueChequeCharges(issueChequesCommand.accountIdentifer());
+      if (!issueChequeCharges.isEmpty()) {
+        this.accountingService.bookCharges(issueChequesCommand.accountIdentifer(), issueChequeCharges);
+      }
+    } catch (final ProductInstanceNotFoundException | AccountNotFoundException ex) {
+      throw ServiceException.notFound("Account {0} not found", issueChequesCommand.accountIdentifer());
+    }
+
+    return issueChequesCommand.accountIdentifer();
+  }
+
+  @Transactional
+  @CommandHandler
+  @EventEmitter(selectorName = EventConstants.SELECTOR_NAME, selectorValue = EventConstants.CHEQUE_TRANSACTION)
+  public String process(final ChequeTransactionCommand chequeTransactionCommand) {
+    final ChequeEntity chequeEntity = ChequeMapper.map(chequeTransactionCommand.cheque());
+
+    final MICR micr = chequeTransactionCommand.cheque().getMicr();
+
+    final JournalEntry journalEntry = new JournalEntry();
+    journalEntry.setTransactionIdentifier("chq-tx-" + UUID.randomUUID().toString());
+    final String transactionType =
+        chequeEntity.getOpenCheque() != null && chequeEntity.getOpenCheque() ? "OPCQ " : "ORCQ";
+    journalEntry.setTransactionType(transactionType);
+    journalEntry.setTransactionDate(DateConverter.toIsoString(chequeEntity.getCreatedOn()));
+    journalEntry.setMessage(transactionType);
+    journalEntry.setClerk(UserContextHolder.checkedGetUser());
+
+    final Debtor debtor = new Debtor();
+    debtor.setAmount(chequeEntity.getAmount().toString());
+    if (this.onUs(micr)) {
+      final Optional<IssuedChequeEntity> optionalIssuedCheque =
+          this.issuedChequeRepository.findByAccountIdentifier(micr.getAccountNumber());
+
+      if (optionalIssuedCheque.isPresent()) {
+        final Integer lastIssuedNumber = optionalIssuedCheque.get().getLastIssuedNumber();
+        if (Integer.valueOf(chequeEntity.getChequeNumber()) > lastIssuedNumber) {
+          throw ServiceException.conflict("Unknown cheque {0}.", MICRParser.toIdentifier(micr));
+        }
+      } else {
+        throw ServiceException.conflict("Account {0} never issued cheques.", micr.getAccountNumber());
+      }
+
+      debtor.setAccountNumber(micr.getAccountNumber());
+      chequeEntity.setState(State.PROCESSED.name());
+    } else {
+      debtor.setAccountNumber(
+          this.depositService.getCashAccountForProduct(chequeTransactionCommand.creditorAccountNumber())
+      );
+      chequeEntity.setState(State.PENDING.name());
+    }
+    journalEntry.setDebtors(Sets.newHashSet(debtor));
+
+    final Creditor creditor = new Creditor();
+    creditor.setAmount(chequeEntity.getAmount().toString());
+    creditor.setAccountNumber(chequeTransactionCommand.creditorAccountNumber());
+    journalEntry.setCreditors(Sets.newHashSet(creditor));
+
+    this.accountingService.processJournalEntry(journalEntry);
+
+    chequeEntity.setJournalEntryIdentifier(journalEntry.getTransactionIdentifier());
+
+    this.chequeRepository.save(chequeEntity);
+
+    return MICRParser.toIdentifier(micr);
+  }
+
+  @Transactional
+  @CommandHandler
+  @EventEmitter(selectorName = EventConstants.SELECTOR_NAME, selectorValue = EventConstants.CHEQUE_TRANSACTION_APPROVED)
+  public String process(final ApproveChequeTransactionCommand approveChequeTransactionCommand) {
+    final MICR micr = MICRParser.fromIdentifier(approveChequeTransactionCommand.identifier());
+    final Optional<ChequeEntity> optionalCheque = this.chequeRepository.findByChequeNumberAndBranchSortCodeAndAccountNumber(
+        micr.getChequeNumber(), micr.getBranchSortCode(), micr.getAccountNumber()
+    );
+
+    if (optionalCheque.isPresent()) {
+      final ChequeEntity chequeEntity = optionalCheque.get();
+      chequeEntity.setState(State.PROCESSED.name());
+      chequeEntity.setLastModifiedBy(UserContextHolder.checkedGetUser());
+      chequeEntity.setLastModifiedOn(LocalDateTime.now(Clock.systemUTC()));
+      this.chequeRepository.save(chequeEntity);
+      return approveChequeTransactionCommand.identifier();
+    } else {
+      throw ServiceException.notFound("Cheque {0} not found.", approveChequeTransactionCommand.identifier());
+    }
+  }
+
+  @Transactional
+  @CommandHandler
+  @EventEmitter(selectorName = EventConstants.SELECTOR_NAME, selectorValue = EventConstants.CHEQUE_TRANSACTION_CANCELED)
+  public String process(final CancelChequeTransactionCommand cancelChequeTransactionCommand) {
+    final MICR micr = MICRParser.fromIdentifier(cancelChequeTransactionCommand.identifier());
+    final Optional<ChequeEntity> optionalCheque = this.chequeRepository.findByChequeNumberAndBranchSortCodeAndAccountNumber(
+        micr.getChequeNumber(), micr.getBranchSortCode(), micr.getAccountNumber()
+    );
+
+    if (optionalCheque.isPresent()) {
+
+      final ChequeEntity chequeEntity = optionalCheque.get();
+
+      final JournalEntry journalEntryToReverse =
+          this.accountingService.findJournalEntry(chequeEntity.getJournalEntryIdentifier());
+
+      final LocalDateTime now = LocalDateTime.now(Clock.systemUTC());
+
+      final JournalEntry journalEntry = new JournalEntry();
+      journalEntry.setTransactionIdentifier("chq-cnl-" + UUID.randomUUID().toString());
+      journalEntry.setTransactionDate(DateConverter.toIsoString(now));
+      journalEntry.setTransactionType("CQRV");
+      journalEntry.setMessage("CQRV");
+      journalEntry.setNote("Cheque canceled, reversed transaction: " + journalEntryToReverse.getTransactionIdentifier() + ".");
+      journalEntry.setClerk(UserContextHolder.checkedGetUser());
+      journalEntry.setDebtors(
+          journalEntryToReverse.getCreditors().stream().map(creditor -> {
+            final Debtor debtor = new Debtor();
+            debtor.setAccountNumber(creditor.getAccountNumber());
+            debtor.setAccountNumber(creditor.getAmount());
+            return debtor;
+          }).collect(Collectors.toSet())
+      );
+      journalEntry.setCreditors(
+          journalEntryToReverse.getDebtors().stream().map(debtor -> {
+            final Creditor creditor = new Creditor();
+            creditor.setAccountNumber(debtor.getAccountNumber());
+            creditor.setAccountNumber(debtor.getAmount());
+            return creditor;
+          }).collect(Collectors.toSet())
+      );
+
+      this.accountingService.processJournalEntry(journalEntry);
+
+      chequeEntity.setState(State.CANCELED.name());
+      chequeEntity.setLastModifiedBy(UserContextHolder.checkedGetUser());
+      chequeEntity.setLastModifiedOn(now);
+      this.chequeRepository.save(chequeEntity);
+      return cancelChequeTransactionCommand.identifier();
+    } else {
+      throw ServiceException.notFound("Cheque {0} not found.", cancelChequeTransactionCommand.identifier());
+    }
+  }
+
+  private boolean onUs(final MICR micr) {
+    return this.organizationService.officeExistsByBranchSortCode(micr.getBranchSortCode())
+        && this.accountingService.accountExists(micr.getAccountNumber());
+  }
+}
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/command/handler/ManagementAggregate.java b/service/src/main/java/io/mifos/cheque/service/internal/command/handler/ManagementAggregate.java
new file mode 100644
index 0000000..99cab0f
--- /dev/null
+++ b/service/src/main/java/io/mifos/cheque/service/internal/command/handler/ManagementAggregate.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2017 Kuelap, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * NOTICE:  All information contained herein is, and remains
+ * the property of Kuelap, Inc and its suppliers, if any.
+ * The intellectual and technical concepts contained herein
+ * are proprietary to Kuelap, Inc and its suppliers and may
+ * be covered by U.S. and Foreign Patents, patents in process,
+ * and are protected by trade secret or copyright law.
+ * Dissemination of this information or reproduction of this material
+ * is strictly forbidden unless prior written permission is obtained
+ * Kuelap, Inc.
+ */
+package io.mifos.cheque.service.internal.command.handler;
+
+import io.mifos.cheque.api.v1.EventConstants;
+import io.mifos.cheque.service.ServiceConstants;
+import io.mifos.cheque.service.internal.command.MigrationCommand;
+import io.mifos.core.command.annotation.Aggregate;
+import io.mifos.core.command.annotation.CommandHandler;
+import io.mifos.core.command.annotation.EventEmitter;
+import io.mifos.core.lang.ApplicationName;
+import io.mifos.core.mariadb.domain.FlywayFactoryBean;
+import org.slf4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.sql.DataSource;
+
+@Aggregate
+public class ManagementAggregate {
+
+  private final Logger logger;
+  private final DataSource dataSource;
+  private final FlywayFactoryBean flywayFactoryBean;
+  private final ApplicationName applicationName;
+
+  @Autowired
+  public ManagementAggregate(@Qualifier(ServiceConstants.LOGGER_NAME) final Logger logger,
+                             final DataSource dataSource,
+                             final FlywayFactoryBean flywayFactoryBean,
+                             final ApplicationName applicationName) {
+    super();
+    this.logger = logger;
+    this.dataSource = dataSource;
+    this.flywayFactoryBean = flywayFactoryBean;
+    this.applicationName = applicationName;
+  }
+
+  @Transactional
+  @CommandHandler
+  @EventEmitter(selectorName = EventConstants.SELECTOR_NAME, selectorValue = EventConstants.INITIALIZE)
+  public String process(final MigrationCommand migrationCommand) {
+    this.logger.info("Starting migration for cheques version: {}.", applicationName.getVersionString());
+    this.flywayFactoryBean.create(this.dataSource).migrate();
+
+    this.logger.info("Migration finished.");
+    return this.applicationName.getVersionString();
+  }
+}
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/format/MICRParser.java b/service/src/main/java/io/mifos/cheque/service/internal/format/MICRParser.java
new file mode 100644
index 0000000..46c2af9
--- /dev/null
+++ b/service/src/main/java/io/mifos/cheque/service/internal/format/MICRParser.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2017 Kuelap, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * NOTICE:  All information contained herein is, and remains
+ * the property of Kuelap, Inc and its suppliers, if any.
+ * The intellectual and technical concepts contained herein
+ * are proprietary to Kuelap, Inc and its suppliers and may
+ * be covered by U.S. and Foreign Patents, patents in process,
+ * and are protected by trade secret or copyright law.
+ * Dissemination of this information or reproduction of this material
+ * is strictly forbidden unless prior written permission is obtained
+ * Kuelap, Inc.
+ */
+package io.mifos.cheque.service.internal.format;
+
+import io.mifos.cheque.api.v1.domain.MICR;
+
+public class MICRParser {
+
+  private static final String DELIMITER = "~";
+
+  private MICRParser() {
+    super();
+  }
+
+  public static String toIdentifier(final MICR micr) {
+    if (micr == null
+        || micr.getChequeNumber() == null || micr.getChequeNumber().isEmpty()
+        || micr.getBranchSortCode() == null || micr.getBranchSortCode().isEmpty()
+        || micr.getAccountNumber() == null || micr.getAccountNumber().isEmpty()) {
+      throw new IllegalArgumentException("MICR must be given and all values need to be set.");
+    }
+
+    return micr.getChequeNumber()
+        + MICRParser.DELIMITER
+        + micr.getBranchSortCode()
+        + MICRParser.DELIMITER
+        + micr.getAccountNumber();
+  }
+
+  public static MICR fromIdentifier(final String identifier) {
+    if (identifier == null || identifier.isEmpty()) {
+      throw new IllegalArgumentException("Identifier must be given.");
+    }
+
+    final String[] micrParts = identifier.split(MICRParser.DELIMITER);
+
+    if (micrParts.length != 3) {
+      throw new IllegalArgumentException("Identifier must contain 3 parts delimited by " + MICRParser.DELIMITER + ".");
+    }
+
+    final MICR micr = new MICR();
+    micr.setChequeNumber(micrParts[0]);
+    micr.setBranchSortCode(micrParts[1]);
+    micr.setAccountNumber(micrParts[2]);
+    return micr;
+  }
+}
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/mapper/ChequeMapper.java b/service/src/main/java/io/mifos/cheque/service/internal/mapper/ChequeMapper.java
new file mode 100644
index 0000000..20a24ad
--- /dev/null
+++ b/service/src/main/java/io/mifos/cheque/service/internal/mapper/ChequeMapper.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2017 Kuelap, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * NOTICE:  All information contained herein is, and remains
+ * the property of Kuelap, Inc and its suppliers, if any.
+ * The intellectual and technical concepts contained herein
+ * are proprietary to Kuelap, Inc and its suppliers and may
+ * be covered by U.S. and Foreign Patents, patents in process,
+ * and are protected by trade secret or copyright law.
+ * Dissemination of this information or reproduction of this material
+ * is strictly forbidden unless prior written permission is obtained
+ * Kuelap, Inc.
+ */
+package io.mifos.cheque.service.internal.mapper;
+
+import io.mifos.cheque.api.v1.domain.Cheque;
+import io.mifos.cheque.api.v1.domain.MICR;
+import io.mifos.cheque.service.internal.repository.ChequeEntity;
+import io.mifos.core.api.util.UserContextHolder;
+import io.mifos.core.lang.DateConverter;
+
+import java.sql.Date;
+import java.time.Clock;
+import java.time.LocalDateTime;
+
+public class ChequeMapper {
+
+  private ChequeMapper() {
+    super();
+  }
+
+  public static ChequeEntity map(final Cheque cheque) {
+    final ChequeEntity chequeEntity = new ChequeEntity();
+    chequeEntity.setChequeNumber(cheque.getMicr().getChequeNumber());
+    chequeEntity.setBranchSortCode(cheque.getMicr().getBranchSortCode());
+    chequeEntity.setAccountNumber(cheque.getMicr().getAccountNumber());
+    chequeEntity.setDrawee(cheque.getDrawee());
+    chequeEntity.setDrawer(cheque.getDrawer());
+    chequeEntity.setPayee(cheque.getPayee());
+    chequeEntity.setAmount(Double.valueOf(cheque.getAmount()));
+    final Date dateIssued = Date.valueOf(DateConverter.dateFromIsoString(cheque.getDateIssued()));
+    chequeEntity.setDateIssued(dateIssued);
+    chequeEntity.setOpenCheque(cheque.isOpenCheque());
+    chequeEntity.setJournalEntryIdentifier(cheque.getJournalEntryIdentifier());
+    chequeEntity.setCreatedBy(UserContextHolder.checkedGetUser());
+    chequeEntity.setCreatedOn(LocalDateTime.now(Clock.systemUTC()));
+    return chequeEntity;
+  }
+
+  public static Cheque map(final ChequeEntity chequeEntity) {
+    final MICR micr = new MICR();
+    micr.setChequeNumber(chequeEntity.getChequeNumber());
+    micr.setBranchSortCode(chequeEntity.getBranchSortCode());
+    micr.setAccountNumber(chequeEntity.getAccountNumber());
+
+    final Cheque cheque = new Cheque();
+    cheque.setMicr(micr);
+    cheque.setDrawee(chequeEntity.getDrawee());
+    cheque.setDrawer(chequeEntity.getDrawer());
+    cheque.setPayee(chequeEntity.getPayee());
+    cheque.setAmount(chequeEntity.getAmount().toString());
+    cheque.setDateIssued(DateConverter.toIsoString(chequeEntity.getDateIssued().toLocalDate()));
+    cheque.setOpenCheque(chequeEntity.getOpenCheque());
+    cheque.setState(chequeEntity.getState());
+    cheque.setJournalEntryIdentifier(chequeEntity.getJournalEntryIdentifier());
+    return cheque;
+  }
+}
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/repository/ChequeEntity.java b/service/src/main/java/io/mifos/cheque/service/internal/repository/ChequeEntity.java
new file mode 100644
index 0000000..91d4545
--- /dev/null
+++ b/service/src/main/java/io/mifos/cheque/service/internal/repository/ChequeEntity.java
@@ -0,0 +1,202 @@
+/*
+ * Copyright 2017 Kuelap, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * NOTICE:  All information contained herein is, and remains
+ * the property of Kuelap, Inc and its suppliers, if any.
+ * The intellectual and technical concepts contained herein
+ * are proprietary to Kuelap, Inc and its suppliers and may
+ * be covered by U.S. and Foreign Patents, patents in process,
+ * and are protected by trade secret or copyright law.
+ * Dissemination of this information or reproduction of this material
+ * is strictly forbidden unless prior written permission is obtained
+ * Kuelap, Inc.
+ */
+package io.mifos.cheque.service.internal.repository;
+
+import io.mifos.core.mariadb.util.LocalDateTimeConverter;
+
+import javax.persistence.Column;
+import javax.persistence.Convert;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import java.sql.Date;
+import java.time.LocalDateTime;
+
+@Entity
+@Table(name = "sopdet_cheques")
+public class ChequeEntity {
+
+  @Id
+  @GeneratedValue(strategy = GenerationType.IDENTITY)
+  @Column(name = "id")
+  private Long id;
+  @Column(name = "cheque_number", nullable = false, length = 8)
+  private String chequeNumber;
+  @Column(name = "branch_sort_code", nullable = false, length = 11)
+  private String branchSortCode;
+  @Column(name = "account_number", nullable = false, length = 34)
+  private String accountNumber;
+  @Column(name = "drawee", nullable = false, length = 2048)
+  private String drawee;
+  @Column(name = "drawer", nullable = false, length = 256)
+  private String drawer;
+  @Column(name = "payee", nullable = false, length = 256)
+  private String payee;
+  @Column(name = "amount", nullable = false)
+  private Double amount;
+  @Column(name = "date_issued", nullable = false)
+  private Date dateIssued;
+  @Column(name = "open_cheque", nullable = true)
+  private Boolean openCheque;
+  @Column(name = "state", nullable = false)
+  private String state;
+  @Column(name = "journal_entry_identifier", nullable = false, length = 2200)
+  private String journalEntryIdentifier;
+  @Column(name = "created_by", nullable = false)
+  private String createdBy;
+  @Column(name = "created_on", nullable = false)
+  @Convert(converter = LocalDateTimeConverter.class)
+  private LocalDateTime createdOn;
+  @Column(name = "last_modified_by", nullable = true)
+  private String lastModifiedBy;
+  @Column(name = "last_modified_on")
+  @Convert(converter = LocalDateTimeConverter.class)
+  private LocalDateTime lastModifiedOn;
+
+  public ChequeEntity() {
+    super();
+  }
+
+  public Long getId() {
+    return this.id;
+  }
+
+  public void setId(final Long id) {
+    this.id = id;
+  }
+
+  public String getChequeNumber() {
+    return this.chequeNumber;
+  }
+
+  public void setChequeNumber(final String chequeNumber) {
+    this.chequeNumber = chequeNumber;
+  }
+
+  public String getBranchSortCode() {
+    return this.branchSortCode;
+  }
+
+  public void setBranchSortCode(final String branchSortCode) {
+    this.branchSortCode = branchSortCode;
+  }
+
+  public String getAccountNumber() {
+    return this.accountNumber;
+  }
+
+  public void setAccountNumber(final String accountNumber) {
+    this.accountNumber = accountNumber;
+  }
+
+  public String getDrawee() {
+    return this.drawee;
+  }
+
+  public void setDrawee(final String drawee) {
+    this.drawee = drawee;
+  }
+
+  public String getDrawer() {
+    return this.drawer;
+  }
+
+  public void setDrawer(final String drawer) {
+    this.drawer = drawer;
+  }
+
+  public String getPayee() {
+    return this.payee;
+  }
+
+  public void setPayee(final String payee) {
+    this.payee = payee;
+  }
+
+  public Double getAmount() {
+    return this.amount;
+  }
+
+  public void setAmount(final Double amount) {
+    this.amount = amount;
+  }
+
+  public Date getDateIssued() {
+    return this.dateIssued;
+  }
+
+  public void setDateIssued(final Date dateIssued) {
+    this.dateIssued = dateIssued;
+  }
+
+  public Boolean getOpenCheque() {
+    return this.openCheque;
+  }
+
+  public void setOpenCheque(final Boolean openCheque) {
+    this.openCheque = openCheque;
+  }
+
+  public String getState() {
+    return this.state;
+  }
+
+  public void setState(final String state) {
+    this.state = state;
+  }
+
+  public String getJournalEntryIdentifier() {
+    return this.journalEntryIdentifier;
+  }
+
+  public void setJournalEntryIdentifier(final String journalEntryIdentifier) {
+    this.journalEntryIdentifier = journalEntryIdentifier;
+  }
+
+  public String getCreatedBy() {
+    return this.createdBy;
+  }
+
+  public void setCreatedBy(final String createdBy) {
+    this.createdBy = createdBy;
+  }
+
+  public LocalDateTime getCreatedOn() {
+    return this.createdOn;
+  }
+
+  public void setCreatedOn(final LocalDateTime createdOn) {
+    this.createdOn = createdOn;
+  }
+
+  public String getLastModifiedBy() {
+    return this.lastModifiedBy;
+  }
+
+  public void setLastModifiedBy(final String lastModifiedBy) {
+    this.lastModifiedBy = lastModifiedBy;
+  }
+
+  public LocalDateTime getLastModifiedOn() {
+    return this.lastModifiedOn;
+  }
+
+  public void setLastModifiedOn(final LocalDateTime lastModifiedOn) {
+    this.lastModifiedOn = lastModifiedOn;
+  }
+}
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/repository/ChequeRepository.java b/service/src/main/java/io/mifos/cheque/service/internal/repository/ChequeRepository.java
new file mode 100644
index 0000000..d6e574d
--- /dev/null
+++ b/service/src/main/java/io/mifos/cheque/service/internal/repository/ChequeRepository.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2017 Kuelap, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * NOTICE:  All information contained herein is, and remains
+ * the property of Kuelap, Inc and its suppliers, if any.
+ * The intellectual and technical concepts contained herein
+ * are proprietary to Kuelap, Inc and its suppliers and may
+ * be covered by U.S. and Foreign Patents, patents in process,
+ * and are protected by trade secret or copyright law.
+ * Dissemination of this information or reproduction of this material
+ * is strictly forbidden unless prior written permission is obtained
+ * Kuelap, Inc.
+ */
+package io.mifos.cheque.service.internal.repository;
+
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.stereotype.Repository;
+
+import java.util.Optional;
+
+@Repository
+public interface ChequeRepository extends JpaRepository<ChequeEntity, Long>, JpaSpecificationExecutor<ChequeEntity> {
+
+  Optional<ChequeEntity> findByChequeNumberAndBranchSortCodeAndAccountNumber(final String chequeNumber,
+                                                                             final String branchSortCode,
+                                                                             final String accountNumber);
+}
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/repository/IssuedChequeEntity.java b/service/src/main/java/io/mifos/cheque/service/internal/repository/IssuedChequeEntity.java
new file mode 100644
index 0000000..8a1d463
--- /dev/null
+++ b/service/src/main/java/io/mifos/cheque/service/internal/repository/IssuedChequeEntity.java
@@ -0,0 +1,111 @@
+/*
+ * Copyright 2017 Kuelap, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * NOTICE:  All information contained herein is, and remains
+ * the property of Kuelap, Inc and its suppliers, if any.
+ * The intellectual and technical concepts contained herein
+ * are proprietary to Kuelap, Inc and its suppliers and may
+ * be covered by U.S. and Foreign Patents, patents in process,
+ * and are protected by trade secret or copyright law.
+ * Dissemination of this information or reproduction of this material
+ * is strictly forbidden unless prior written permission is obtained
+ * Kuelap, Inc.
+ */
+package io.mifos.cheque.service.internal.repository;
+
+import io.mifos.core.mariadb.util.LocalDateTimeConverter;
+
+import javax.persistence.Column;
+import javax.persistence.Convert;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import java.time.LocalDateTime;
+
+@Entity
+@Table(name = "sopdet_issued_cheques")
+public class IssuedChequeEntity {
+
+  @Id
+  @GeneratedValue(strategy = GenerationType.IDENTITY)
+  @Column(name = "id", nullable = false)
+  private Long id;
+  @Column(name = "account_identifier", nullable = false, length = 34)
+  private String accountIdentifier;
+  @Column(name = "last_issued_number", nullable = false, length = 8)
+  private Integer lastIssuedNumber;
+  @Column(name = "created_by", nullable = false)
+  private String createdBy;
+  @Column(name = "created_on", nullable = false)
+  @Convert(converter = LocalDateTimeConverter.class)
+  private LocalDateTime createdOn;
+  @Column(name = "last_modified_by", nullable = true)
+  private String lastModifiedBy;
+  @Column(name = "last_modified_on")
+  @Convert(converter = LocalDateTimeConverter.class)
+  private LocalDateTime lastModifiedOn;
+
+  public IssuedChequeEntity() {
+    super();
+  }
+
+  public Long getId() {
+    return this.id;
+  }
+
+  public void setId(final Long id) {
+    this.id = id;
+  }
+
+  public String getAccountIdentifier() {
+    return this.accountIdentifier;
+  }
+
+  public void setAccountIdentifier(final String accountIdentifier) {
+    this.accountIdentifier = accountIdentifier;
+  }
+
+  public Integer getLastIssuedNumber() {
+    return this.lastIssuedNumber;
+  }
+
+  public void setLastIssuedNumber(final Integer lastIssuedNumber) {
+    this.lastIssuedNumber = lastIssuedNumber;
+  }
+
+  public String getCreatedBy() {
+    return this.createdBy;
+  }
+
+  public void setCreatedBy(final String createdBy) {
+    this.createdBy = createdBy;
+  }
+
+  public LocalDateTime getCreatedOn() {
+    return this.createdOn;
+  }
+
+  public void setCreatedOn(final LocalDateTime createdOn) {
+    this.createdOn = createdOn;
+  }
+
+  public String getLastModifiedBy() {
+    return this.lastModifiedBy;
+  }
+
+  public void setLastModifiedBy(final String lastModifiedBy) {
+    this.lastModifiedBy = lastModifiedBy;
+  }
+
+  public LocalDateTime getLastModifiedOn() {
+    return this.lastModifiedOn;
+  }
+
+  public void setLastModifiedOn(final LocalDateTime lastModifiedOn) {
+    this.lastModifiedOn = lastModifiedOn;
+  }
+}
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/repository/IssuedChequeRepository.java b/service/src/main/java/io/mifos/cheque/service/internal/repository/IssuedChequeRepository.java
new file mode 100644
index 0000000..1e0e349
--- /dev/null
+++ b/service/src/main/java/io/mifos/cheque/service/internal/repository/IssuedChequeRepository.java
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2017 Kuelap, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * NOTICE:  All information contained herein is, and remains
+ * the property of Kuelap, Inc and its suppliers, if any.
+ * The intellectual and technical concepts contained herein
+ * are proprietary to Kuelap, Inc and its suppliers and may
+ * be covered by U.S. and Foreign Patents, patents in process,
+ * and are protected by trade secret or copyright law.
+ * Dissemination of this information or reproduction of this material
+ * is strictly forbidden unless prior written permission is obtained
+ * Kuelap, Inc.
+ */
+package io.mifos.cheque.service.internal.repository;
+
+import org.springframework.data.jpa.repository.JpaRepository;
+
+import java.util.Optional;
+
+public interface IssuedChequeRepository extends JpaRepository<IssuedChequeEntity, Long> {
+
+  Optional<IssuedChequeEntity> findByAccountIdentifier(final String accountIdentifier);
+}
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/repository/specification/ChequeSpecification.java b/service/src/main/java/io/mifos/cheque/service/internal/repository/specification/ChequeSpecification.java
new file mode 100644
index 0000000..90d111e
--- /dev/null
+++ b/service/src/main/java/io/mifos/cheque/service/internal/repository/specification/ChequeSpecification.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2017 Kuelap, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * NOTICE:  All information contained herein is, and remains
+ * the property of Kuelap, Inc and its suppliers, if any.
+ * The intellectual and technical concepts contained herein
+ * are proprietary to Kuelap, Inc and its suppliers and may
+ * be covered by U.S. and Foreign Patents, patents in process,
+ * and are protected by trade secret or copyright law.
+ * Dissemination of this information or reproduction of this material
+ * is strictly forbidden unless prior written permission is obtained
+ * Kuelap, Inc.
+ */
+package io.mifos.cheque.service.internal.repository.specification;
+
+import io.mifos.cheque.api.v1.domain.State;
+import io.mifos.cheque.service.internal.repository.ChequeEntity;
+import org.springframework.data.jpa.domain.Specification;
+
+import javax.persistence.criteria.Predicate;
+import java.util.ArrayList;
+
+public class ChequeSpecification {
+
+  public static Specification<ChequeEntity> createListSpecification(
+      final String state, final String account) {
+
+    return (root, query, cb) -> {
+
+      final ArrayList<Predicate> predicates = new ArrayList<>();
+
+      if (!state.equalsIgnoreCase("ALL")) {
+        predicates.add(cb.equal(root.get("state"), State.valueOf(state.toUpperCase()).name()));
+      }
+
+      if (account != null && ! account.isEmpty()) {
+        predicates.add(cb.equal(root.get("accountNumber"), account));
+      }
+
+      return cb.and(predicates.toArray(new Predicate[predicates.size()]));
+    };
+  }
+}
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/service/ChequeService.java b/service/src/main/java/io/mifos/cheque/service/internal/service/ChequeService.java
new file mode 100644
index 0000000..75c3269
--- /dev/null
+++ b/service/src/main/java/io/mifos/cheque/service/internal/service/ChequeService.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2017 Kuelap, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * NOTICE:  All information contained herein is, and remains
+ * the property of Kuelap, Inc and its suppliers, if any.
+ * The intellectual and technical concepts contained herein
+ * are proprietary to Kuelap, Inc and its suppliers and may
+ * be covered by U.S. and Foreign Patents, patents in process,
+ * and are protected by trade secret or copyright law.
+ * Dissemination of this information or reproduction of this material
+ * is strictly forbidden unless prior written permission is obtained
+ * Kuelap, Inc.
+ */
+package io.mifos.cheque.service.internal.service;
+
+import io.mifos.cheque.api.v1.domain.Cheque;
+import io.mifos.cheque.api.v1.domain.MICR;
+import io.mifos.cheque.service.ServiceConstants;
+import io.mifos.cheque.service.internal.mapper.ChequeMapper;
+import io.mifos.cheque.service.internal.repository.ChequeRepository;
+import io.mifos.cheque.service.internal.repository.specification.ChequeSpecification;
+import org.slf4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.Optional;
+import java.util.stream.Collectors;
+
+@Service
+public class ChequeService {
+
+  private final Logger logger;
+  private final ChequeRepository chequeRepository;
+
+  @Autowired
+  public ChequeService(@Qualifier(ServiceConstants.LOGGER_NAME) final Logger logger,
+                       final ChequeRepository chequeRepository) {
+    super();
+    this.logger = logger;
+    this.chequeRepository = chequeRepository;
+  }
+
+  public boolean chequeExists(final Cheque cheque) {
+    final MICR micr = cheque.getMicr();
+    return this.chequeRepository.findByChequeNumberAndBranchSortCodeAndAccountNumber(
+        micr.getChequeNumber(), micr.getBranchSortCode(), micr.getAccountNumber()
+    ).isPresent();
+  }
+
+  public List<Cheque> fetchCheques(final String state, final String accountIdentifier) {
+    return this.chequeRepository.findAll(ChequeSpecification.createListSpecification(state, accountIdentifier))
+        .stream()
+        .map(ChequeMapper::map)
+        .collect(Collectors.toList());
+  }
+
+  public Optional<Cheque> findBy(final MICR micr) {
+    return
+        this.chequeRepository.findByChequeNumberAndBranchSortCodeAndAccountNumber(
+            micr.getChequeNumber(), micr.getBranchSortCode(), micr.getAccountNumber())
+            .map(ChequeMapper::map);
+  }
+}
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/service/helper/AccountingService.java b/service/src/main/java/io/mifos/cheque/service/internal/service/helper/AccountingService.java
new file mode 100644
index 0000000..238e3c4
--- /dev/null
+++ b/service/src/main/java/io/mifos/cheque/service/internal/service/helper/AccountingService.java
@@ -0,0 +1,110 @@
+/*
+ * Copyright 2017 Kuelap, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * NOTICE:  All information contained herein is, and remains
+ * the property of Kuelap, Inc and its suppliers, if any.
+ * The intellectual and technical concepts contained herein
+ * are proprietary to Kuelap, Inc and its suppliers and may
+ * be covered by U.S. and Foreign Patents, patents in process,
+ * and are protected by trade secret or copyright law.
+ * Dissemination of this information or reproduction of this material
+ * is strictly forbidden unless prior written permission is obtained
+ * Kuelap, Inc.
+ */
+package io.mifos.cheque.service.internal.service.helper;
+
+import com.google.common.collect.Sets;
+import io.mifos.accounting.api.v1.client.AccountNotFoundException;
+import io.mifos.accounting.api.v1.client.LedgerManager;
+import io.mifos.accounting.api.v1.domain.Account;
+import io.mifos.accounting.api.v1.domain.Creditor;
+import io.mifos.accounting.api.v1.domain.Debtor;
+import io.mifos.accounting.api.v1.domain.JournalEntry;
+import io.mifos.cheque.service.ServiceConstants;
+import io.mifos.core.api.util.UserContextHolder;
+import io.mifos.core.lang.DateConverter;
+import io.mifos.core.lang.ServiceException;
+import io.mifos.deposit.api.v1.definition.domain.Charge;
+import org.slf4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.stereotype.Service;
+
+import java.time.Clock;
+import java.time.LocalDateTime;
+import java.util.List;
+import java.util.UUID;
+import java.util.stream.Collectors;
+
+@Service
+public class AccountingService {
+
+  private final Logger logger;
+  private final LedgerManager ledgerManager;
+
+  @Autowired
+  public AccountingService(@Qualifier(ServiceConstants.LOGGER_NAME) final Logger logger,
+                           final LedgerManager ledgerManager) {
+    super();
+    this.logger = logger;
+    this.ledgerManager = ledgerManager;
+  }
+
+  public void bookCharges(final String sourceAccount, final List<Charge> charges) {
+
+    final Double totalCharges = charges.stream().mapToDouble(Charge::getAmount).sum();
+    if (totalCharges == 0.00D) {
+      return;
+    }
+
+    final Account account = this.ledgerManager.findAccount(sourceAccount);
+    if (account.getBalance() < totalCharges) {
+      throw ServiceException.conflict("Insufficient account balance.");
+    }
+
+    final JournalEntry journalEntry = new JournalEntry();
+    journalEntry.setTransactionIdentifier("chq-iss-" + UUID.randomUUID().toString());
+    journalEntry.setTransactionDate(DateConverter.toIsoString(LocalDateTime.now(Clock.systemUTC())));
+    journalEntry.setTransactionType(ServiceConstants.TX_ISSUE_CHEQUES);
+    journalEntry.setMessage(ServiceConstants.TX_ISSUE_CHEQUES);
+    journalEntry.setClerk(UserContextHolder.checkedGetUser());
+
+    final Debtor debtor = new Debtor();
+    debtor.setAccountNumber(sourceAccount);
+    debtor.setAmount(totalCharges.toString());
+    journalEntry.setDebtors(Sets.newHashSet(debtor));
+
+    journalEntry.setCreditors(
+        charges
+            .stream()
+            .map(charge -> {
+              final Creditor creditor = new Creditor();
+              creditor.setAccountNumber(charge.getIncomeAccountIdentifier());
+              creditor.setAmount(charge.getAmount().toString());
+              return creditor;
+            })
+            .collect(Collectors.toSet())
+    );
+
+    this.ledgerManager.createJournalEntry(journalEntry);
+  }
+
+  public boolean accountExists(final String accountIdentifier) {
+    try {
+      this.ledgerManager.findAccount(accountIdentifier);
+      return true;
+    } catch (final AccountNotFoundException anfex) {
+      return false;
+    }
+  }
+
+  public JournalEntry findJournalEntry(final String identifier) {
+    return this.ledgerManager.findJournalEntry(identifier);
+  }
+
+  public void processJournalEntry(final JournalEntry journalEntry) {
+    this.ledgerManager.createJournalEntry(journalEntry);
+  }
+}
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/service/helper/DepositService.java b/service/src/main/java/io/mifos/cheque/service/internal/service/helper/DepositService.java
new file mode 100644
index 0000000..7047bf8
--- /dev/null
+++ b/service/src/main/java/io/mifos/cheque/service/internal/service/helper/DepositService.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2017 Kuelap, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * NOTICE:  All information contained herein is, and remains
+ * the property of Kuelap, Inc and its suppliers, if any.
+ * The intellectual and technical concepts contained herein
+ * are proprietary to Kuelap, Inc and its suppliers and may
+ * be covered by U.S. and Foreign Patents, patents in process,
+ * and are protected by trade secret or copyright law.
+ * Dissemination of this information or reproduction of this material
+ * is strictly forbidden unless prior written permission is obtained
+ * Kuelap, Inc.
+ */
+package io.mifos.cheque.service.internal.service.helper;
+
+import io.mifos.cheque.service.ServiceConstants;
+import io.mifos.deposit.api.v1.client.DepositAccountManager;
+import io.mifos.deposit.api.v1.definition.domain.Action;
+import io.mifos.deposit.api.v1.definition.domain.Charge;
+import io.mifos.deposit.api.v1.definition.domain.ProductDefinition;
+import io.mifos.deposit.api.v1.instance.domain.ProductInstance;
+import org.slf4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+@Service
+public class DepositService {
+
+  private final Logger logger;
+  private final DepositAccountManager depositAccountManager;
+
+  @Autowired
+  public DepositService(@Qualifier(ServiceConstants.LOGGER_NAME) final Logger logger,
+                        final DepositAccountManager depositAccountManager) {
+    super();
+    this.logger = logger;
+    this.depositAccountManager = depositAccountManager;
+  }
+
+  public List<Charge> getIssueChequeCharges(final String accountIdentifier) {
+
+    final List<Action> actions = this.depositAccountManager.fetchActions();
+
+    final List<String> issueChequeActions =
+        actions
+            .stream()
+            .filter(action -> action.getTransactionType().equals(ServiceConstants.TX_ISSUE_CHEQUES))
+            .map(Action::getIdentifier)
+            .collect(Collectors.toList());
+
+    final ProductInstance productInstance =
+        this.depositAccountManager.findProductInstance(accountIdentifier);
+
+    final ProductDefinition productDefinition =
+        this.depositAccountManager.findProductDefinition(productInstance.getProductIdentifier());
+
+    return productDefinition.getCharges()
+        .stream()
+        .filter(charge -> issueChequeActions.contains(charge.getActionIdentifier()))
+        .collect(Collectors.toList());
+  }
+
+  public String getCashAccountForProduct(final String accountIdentifier) {
+    final ProductInstance productInstance =
+        this.depositAccountManager.findProductInstance(accountIdentifier);
+
+    final ProductDefinition productDefinition =
+        this.depositAccountManager.findProductDefinition(productInstance.getProductIdentifier());
+
+    return productDefinition.getCashAccountIdentifier();
+  }
+}
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/service/helper/OrganizationService.java b/service/src/main/java/io/mifos/cheque/service/internal/service/helper/OrganizationService.java
new file mode 100644
index 0000000..f8e857a
--- /dev/null
+++ b/service/src/main/java/io/mifos/cheque/service/internal/service/helper/OrganizationService.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2017 Kuelap, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * NOTICE:  All information contained herein is, and remains
+ * the property of Kuelap, Inc and its suppliers, if any.
+ * The intellectual and technical concepts contained herein
+ * are proprietary to Kuelap, Inc and its suppliers and may
+ * be covered by U.S. and Foreign Patents, patents in process,
+ * and are protected by trade secret or copyright law.
+ * Dissemination of this information or reproduction of this material
+ * is strictly forbidden unless prior written permission is obtained
+ * Kuelap, Inc.
+ */
+package io.mifos.cheque.service.internal.service.helper;
+
+import io.mifos.cheque.service.ServiceConstants;
+import io.mifos.office.api.v1.client.NotFoundException;
+import io.mifos.office.api.v1.client.OrganizationManager;
+import org.slf4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.stereotype.Service;
+
+@Service
+public class OrganizationService {
+
+  private final Logger logger;
+  private final OrganizationManager organizationManager;
+
+  @Autowired
+  public OrganizationService(@Qualifier(ServiceConstants.LOGGER_NAME) final Logger logger,
+                             final OrganizationManager organizationManager) {
+    super();
+    this.logger = logger;
+    this.organizationManager = organizationManager;
+  }
+
+  public boolean officeExistsByBranchSortCode(final String branchSortCode) {
+    try {
+      this.organizationManager.findOfficeByIdentifier(branchSortCode);
+      return true;
+    } catch (final NotFoundException nfex) {
+      return false;
+    }
+  }
+}
diff --git a/service/src/main/java/io/mifos/cheque/service/rest/ChequeManagementRestController.java b/service/src/main/java/io/mifos/cheque/service/rest/ChequeManagementRestController.java
new file mode 100644
index 0000000..9317c17
--- /dev/null
+++ b/service/src/main/java/io/mifos/cheque/service/rest/ChequeManagementRestController.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2017 Kuelap, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * NOTICE:  All information contained herein is, and remains
+ * the property of Kuelap, Inc and its suppliers, if any.
+ * The intellectual and technical concepts contained herein
+ * are proprietary to Kuelap, Inc and its suppliers and may
+ * be covered by U.S. and Foreign Patents, patents in process,
+ * and are protected by trade secret or copyright law.
+ * Dissemination of this information or reproduction of this material
+ * is strictly forbidden unless prior written permission is obtained
+ * Kuelap, Inc.
+ */
+package io.mifos.cheque.service.rest;
+
+import io.mifos.anubis.annotation.AcceptedTokenType;
+import io.mifos.anubis.annotation.Permittable;
+import io.mifos.cheque.service.ServiceConstants;
+import io.mifos.cheque.service.internal.command.MigrationCommand;
+import io.mifos.core.command.gateway.CommandGateway;
+import org.slf4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/")
+public class ChequeManagementRestController {
+
+  private final Logger logger;
+  private final CommandGateway commandGateway;
+
+  @Autowired
+  public ChequeManagementRestController(@Qualifier(ServiceConstants.LOGGER_NAME) final Logger logger,
+                                        final CommandGateway commandGateway) {
+    super();
+    this.logger = logger;
+    this.commandGateway = commandGateway;
+  }
+
+  @Permittable(value = AcceptedTokenType.SYSTEM)
+  @RequestMapping(
+      value = "/initialize",
+      method = RequestMethod.POST,
+      consumes = MediaType.ALL_VALUE,
+      produces = MediaType.APPLICATION_JSON_VALUE
+  )
+  public
+  @ResponseBody
+  ResponseEntity<Void> initialize() {
+    this.commandGateway.process(new MigrationCommand());
+    return ResponseEntity.accepted().build();
+  }
+}
diff --git a/service/src/main/java/io/mifos/cheque/service/rest/ChequeRestController.java b/service/src/main/java/io/mifos/cheque/service/rest/ChequeRestController.java
new file mode 100644
index 0000000..7f9414f
--- /dev/null
+++ b/service/src/main/java/io/mifos/cheque/service/rest/ChequeRestController.java
@@ -0,0 +1,150 @@
+/*
+ * Copyright 2017 Kuelap, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * NOTICE:  All information contained herein is, and remains
+ * the property of Kuelap, Inc and its suppliers, if any.
+ * The intellectual and technical concepts contained herein
+ * are proprietary to Kuelap, Inc and its suppliers and may
+ * be covered by U.S. and Foreign Patents, patents in process,
+ * and are protected by trade secret or copyright law.
+ * Dissemination of this information or reproduction of this material
+ * is strictly forbidden unless prior written permission is obtained
+ * Kuelap, Inc.
+ */
+package io.mifos.cheque.service.rest;
+
+import io.mifos.anubis.annotation.AcceptedTokenType;
+import io.mifos.anubis.annotation.Permittable;
+import io.mifos.cheque.api.v1.PermittableGroupIds;
+import io.mifos.cheque.api.v1.client.IssuingCount;
+import io.mifos.cheque.api.v1.domain.Action;
+import io.mifos.cheque.api.v1.domain.Cheque;
+import io.mifos.cheque.api.v1.domain.ChequeProcessingCommand;
+import io.mifos.cheque.service.ServiceConstants;
+import io.mifos.cheque.service.internal.command.ApproveChequeTransactionCommand;
+import io.mifos.cheque.service.internal.command.CancelChequeTransactionCommand;
+import io.mifos.cheque.service.internal.command.IssueChequesCommand;
+import io.mifos.cheque.service.internal.format.MICRParser;
+import io.mifos.cheque.service.internal.service.ChequeService;
+import io.mifos.core.command.domain.CommandCallback;
+import io.mifos.core.command.gateway.CommandGateway;
+import io.mifos.core.lang.ServiceException;
+import org.slf4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.validation.Valid;
+import java.util.List;
+
+@RestController
+@RequestMapping("/cheques")
+public class ChequeRestController {
+
+  private final Logger logger;
+  private final CommandGateway commandGateway;
+  private final ChequeService chequeService;
+
+  @Autowired
+  public ChequeRestController(@Qualifier(ServiceConstants.LOGGER_NAME) final Logger logger,
+                              final CommandGateway commandGateway,
+                              final ChequeService chequeService) {
+    super();
+    this.logger = logger;
+    this.commandGateway = commandGateway;
+    this.chequeService = chequeService;
+  }
+
+  @Permittable(value = AcceptedTokenType.TENANT, groupId = PermittableGroupIds.CHEQUE_MANAGEMENT)
+  @RequestMapping(
+      value = "/",
+      method = RequestMethod.POST,
+      produces = {MediaType.APPLICATION_JSON_VALUE},
+      consumes = {MediaType.APPLICATION_JSON_VALUE}
+  )
+  @ResponseBody
+  ResponseEntity<String> issue(@RequestBody @Valid final IssuingCount issuingCount) {
+
+    try {
+      final CommandCallback<String> callback = this.commandGateway.process(
+          new IssueChequesCommand(
+              issuingCount.getAccountIdentifier(), issuingCount.getStart(), issuingCount.getAmount()),
+          String.class
+      );
+
+      return ResponseEntity.ok(callback.get());
+    } catch (final ServiceException ex) {
+      throw ex;
+    } catch (final Exception ex) {
+      throw ServiceException.internalError(ex.getMessage());
+    }
+  }
+
+  @Permittable(value = AcceptedTokenType.TENANT, groupId = PermittableGroupIds.CHEQUE_MANAGEMENT)
+  @RequestMapping(
+      value = "/",
+      method = RequestMethod.GET,
+      produces = {MediaType.APPLICATION_JSON_VALUE},
+      consumes = {MediaType.ALL_VALUE}
+  )
+  @ResponseBody
+  ResponseEntity<List<Cheque>> fetch(
+      @RequestParam(value = "state", required = false, defaultValue = "ALL") final String state,
+      @RequestParam(value = "account", required = false) final String accountIdentifier) {
+    return ResponseEntity.ok(this.chequeService.fetchCheques(state, accountIdentifier));
+  }
+
+  @Permittable(value = AcceptedTokenType.TENANT, groupId = PermittableGroupIds.CHEQUE_MANAGEMENT)
+  @RequestMapping(
+      value = "/{identifier}",
+      method = RequestMethod.GET,
+      produces = {MediaType.APPLICATION_JSON_VALUE},
+      consumes = {MediaType.ALL_VALUE}
+  )
+  @ResponseBody
+  ResponseEntity<Cheque> get(@PathVariable("identifier") final String identifier) {
+    return ResponseEntity.ok(
+        this.chequeService.findBy(MICRParser.fromIdentifier(identifier))
+            .orElseThrow(() -> ServiceException.notFound("Cheque {0} not found.", identifier))
+    );
+  }
+
+  @Permittable(value = AcceptedTokenType.TENANT, groupId = PermittableGroupIds.CHEQUE_MANAGEMENT)
+  @RequestMapping(
+      value = "/{identifier}/commands",
+      method = RequestMethod.POST,
+      produces = {MediaType.APPLICATION_JSON_VALUE},
+      consumes = {MediaType.APPLICATION_JSON_VALUE}
+  )
+  @ResponseBody
+  ResponseEntity<Void> process(@PathVariable("identifier") final String identifier,
+                               @RequestBody @Valid final ChequeProcessingCommand chequeProcessingCommand) {
+
+    if (!this.chequeService.findBy(MICRParser.fromIdentifier(identifier)).isPresent()) {
+      throw ServiceException.notFound("Cheque {0} not found.", identifier);
+    }
+
+    switch (Action.valueOf(chequeProcessingCommand.getAction())) {
+      case APPROVE:
+        this.commandGateway.process(new ApproveChequeTransactionCommand(identifier));
+        break;
+      case CANCEL:
+        this.commandGateway.process(new CancelChequeTransactionCommand(identifier));
+        break;
+      default:
+        throw ServiceException.badRequest("Unknown cheque command {0}.", chequeProcessingCommand.getAction());
+    }
+
+    return ResponseEntity.accepted().build();
+  }
+}
diff --git a/service/src/main/java/io/mifos/cheque/service/rest/ChequeTransactionRestController.java b/service/src/main/java/io/mifos/cheque/service/rest/ChequeTransactionRestController.java
new file mode 100644
index 0000000..b07d957
--- /dev/null
+++ b/service/src/main/java/io/mifos/cheque/service/rest/ChequeTransactionRestController.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright 2017 Kuelap, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * NOTICE:  All information contained herein is, and remains
+ * the property of Kuelap, Inc and its suppliers, if any.
+ * The intellectual and technical concepts contained herein
+ * are proprietary to Kuelap, Inc and its suppliers and may
+ * be covered by U.S. and Foreign Patents, patents in process,
+ * and are protected by trade secret or copyright law.
+ * Dissemination of this information or reproduction of this material
+ * is strictly forbidden unless prior written permission is obtained
+ * Kuelap, Inc.
+ */
+package io.mifos.cheque.service.rest;
+
+import io.mifos.anubis.annotation.AcceptedTokenType;
+import io.mifos.anubis.annotation.Permittable;
+import io.mifos.cheque.api.v1.PermittableGroupIds;
+import io.mifos.cheque.api.v1.domain.Cheque;
+import io.mifos.cheque.api.v1.domain.ChequeTransaction;
+import io.mifos.cheque.service.ServiceConstants;
+import io.mifos.cheque.service.internal.command.ChequeTransactionCommand;
+import io.mifos.cheque.service.internal.format.MICRParser;
+import io.mifos.cheque.service.internal.service.ChequeService;
+import io.mifos.core.command.gateway.CommandGateway;
+import io.mifos.core.lang.ServiceException;
+import org.slf4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.validation.Valid;
+
+@RestController
+@RequestMapping("/transactions")
+public class ChequeTransactionRestController {
+
+  private final Logger logger;
+  private final CommandGateway commandGateway;
+  private final ChequeService chequeService;
+
+  @Autowired
+  public ChequeTransactionRestController(@Qualifier(ServiceConstants.LOGGER_NAME) final Logger logger,
+                                         final CommandGateway commandGateway,
+                                         final ChequeService chequeService) {
+    super();
+    this.logger = logger;
+    this.commandGateway = commandGateway;
+    this.chequeService = chequeService;
+  }
+
+  @Permittable(value = AcceptedTokenType.TENANT, groupId = PermittableGroupIds.CHEQUE_TRANSACTION)
+  @RequestMapping(
+      value = "/",
+      method = RequestMethod.POST,
+      produces = {MediaType.APPLICATION_JSON_VALUE},
+      consumes = {MediaType.APPLICATION_JSON_VALUE}
+  )
+  @ResponseBody
+  ResponseEntity<Void> process(@RequestBody @Valid final ChequeTransaction chequeTransaction) {
+
+    final Cheque cheque = chequeTransaction.getCheque();
+
+    if (this.chequeService.chequeExists(chequeTransaction.getCheque())) {
+      throw ServiceException.conflict("Cheque {0} already used.",
+          MICRParser.toIdentifier(chequeTransaction.getCheque().getMicr()));
+    }
+
+    this.commandGateway.process(new ChequeTransactionCommand(cheque, chequeTransaction.getCreditorAccountNumber()));
+
+    return ResponseEntity.accepted().build();
+  }
+}
diff --git a/service/src/main/resources/application.yml b/service/src/main/resources/application.yml
new file mode 100644
index 0000000..c73c1b8
--- /dev/null
+++ b/service/src/main/resources/application.yml
@@ -0,0 +1,66 @@
+#
+# Copyright 2017 Kuelap, Inc.
+#
+# All Rights Reserved.
+#
+# NOTICE:  All information contained herein is, and remains
+# the property of Kuelap, Inc and its suppliers, if any.
+# The intellectual and technical concepts contained herein
+# are proprietary to Kuelap, Inc and its suppliers and may
+# be covered by U.S. and Foreign Patents, patents in process,
+# and are protected by trade secret or copyright law.
+# Dissemination of this information or reproduction of this material
+# is strictly forbidden unless prior written permission is obtained
+# Kuelap, Inc.
+#
+
+spring:
+  cloud:
+    discovery:
+      enabled: false
+    config:
+      enabled: false
+
+eureka:
+  client:
+    serviceUrl:
+      defaultZone: http://localhost:8761/eureka/
+
+server:
+  port: 8081
+  contextPath: /cheques/v1
+
+cassandra:
+  clusterName: staging_cluster
+  contactPoints: 127.0.0.1:9042,127.0.0.2:9042,127.0.0.3:9042
+  keyspace: seshat
+  cl:
+    read: LOCAL_QUORUM
+    write: LOCAL_QUORUM
+    delete: LOCAL_QUORUM
+
+mariadb:
+  driverClass: org.mariadb.jdbc.Driver
+  database: seshat
+  host: localhost
+  port: 3306
+  user: root
+  password: mysql
+
+bonecp:
+  idleMaxAgeInMinutes: 240
+  idleConnectionTestPeriodInMinutes: 60
+  maxConnectionsPerPartition: 10
+  minConnectionsPerPartition: 1
+  partitionCount: 2
+  acquireIncrement: 5
+  statementsCacheSize: 100
+
+async:
+  corePoolSize: 32
+  maxPoolSize: 16384
+  queueCapacity: 0
+  threadName: async-processor-
+
+flyway:
+  enabled: false
diff --git a/service/src/main/resources/bootstrap.yml b/service/src/main/resources/bootstrap.yml
new file mode 100644
index 0000000..7ab35c9
--- /dev/null
+++ b/service/src/main/resources/bootstrap.yml
@@ -0,0 +1,19 @@
+#
+# Copyright 2017 Kuelap, Inc.
+#
+# All Rights Reserved.
+#
+# NOTICE:  All information contained herein is, and remains
+# the property of Kuelap, Inc and its suppliers, if any.
+# The intellectual and technical concepts contained herein
+# are proprietary to Kuelap, Inc and its suppliers and may
+# be covered by U.S. and Foreign Patents, patents in process,
+# and are protected by trade secret or copyright law.
+# Dissemination of this information or reproduction of this material
+# is strictly forbidden unless prior written permission is obtained
+# Kuelap, Inc.
+#
+
+spring:
+    application:
+        name: cheques-v1
diff --git a/service/src/main/resources/db/migrations/mariadb/V1__initial_setup.sql b/service/src/main/resources/db/migrations/mariadb/V1__initial_setup.sql
new file mode 100644
index 0000000..23bdb44
--- /dev/null
+++ b/service/src/main/resources/db/migrations/mariadb/V1__initial_setup.sql
@@ -0,0 +1,48 @@
+--
+-- Copyright 2017 Kuelap, Inc.
+--
+-- All Rights Reserved.
+--
+-- NOTICE:  All information contained herein is, and remains
+-- the property of Kuelap, Inc and its suppliers, if any.
+-- The intellectual and technical concepts contained herein
+-- are proprietary to Kuelap, Inc and its suppliers and may
+-- be covered by U.S. and Foreign Patents, patents in process,
+-- and are protected by trade secret or copyright law.
+-- Dissemination of this information or reproduction of this material
+-- is strictly forbidden unless prior written permission is obtained
+-- Kuelap, Inc.
+--
+
+CREATE TABLE sopdet_issued_cheques (
+  id                         BIGINT         NOT NULL AUTO_INCREMENT,
+  account_identifier         VARCHAR(34)    NOT NULL,
+  last_issued_number         NUMERIC(8)     NOT NULL,
+  created_on                 TIMESTAMP(3)   NOT NULL,
+  created_by                 VARCHAR(32)    NOT NULL,
+  last_modified_on           TIMESTAMP(3)   NULL,
+  last_modified_by           VARCHAR(32)    NULL,
+  CONSTRAINT sopdet_issued_cheques_pk PRIMARY KEY (id),
+  CONSTRAINT sopdet_issued_cheques_uq UNIQUE (account_identifier)
+);
+
+CREATE TABLE sopdet_cheques (
+  id                         BIGINT         NOT NULL AUTO_INCREMENT,
+  cheque_number              VARCHAR(8)     NOT NULL,
+  branch_sort_code           VARCHAR(11)    NOT NULL,
+  account_number             VARCHAR(34)    NOT NULL,
+  drawee                     VARCHAR(2048)  NOT NULL,
+  drawer                     VARCHAR(256)   NOT NULL,
+  payee                      VARCHAR(256)   NOT NULL,
+  amount                     NUMERIC(15,5)  NOT NULL,
+  date_issued                DATE           NOT NULL,
+  open_cheque                BOOLEAN        NULL,
+  state                      VARCHAR(32)    NOT NULL,
+  journal_entry_identifier   VARCHAR(2200)  NOT NULL,
+  created_on                 TIMESTAMP(3)   NOT NULL,
+  created_by                 VARCHAR(32)    NOT NULL,
+  last_modified_on           TIMESTAMP(3)   NULL,
+  last_modified_by           VARCHAR(32)    NULL,
+  CONSTRAINT sopdet_cheques_pk PRIMARY KEY (id),
+  CONSTRAINT sopdet_cheques_uq UNIQUE (cheque_number, branch_sort_code, account_number)
+);
diff --git a/service/src/main/resources/logback.xml b/service/src/main/resources/logback.xml
new file mode 100644
index 0000000..e68c93a
--- /dev/null
+++ b/service/src/main/resources/logback.xml
@@ -0,0 +1,55 @@
+<!--
+
+    Copyright 2017 Kuelap, Inc.
+
+    All Rights Reserved.
+
+    NOTICE:  All information contained herein is, and remains
+    the property of Kuelap, Inc and its suppliers, if any.
+    The intellectual and technical concepts contained herein
+    are proprietary to Kuelap, Inc and its suppliers and may
+    be covered by U.S. and Foreign Patents, patents in process,
+    and are protected by trade secret or copyright law.
+    Dissemination of this information or reproduction of this material
+    is strictly forbidden unless prior written permission is obtained
+    Kuelap, Inc.
+
+-->
+<configuration>
+    <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <file>logs/cheques.log</file>
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <fileNamePattern>logs/archive/cheques.%d{yyyy-MM-dd}.log</fileNamePattern>
+            <maxHistory>7</maxHistory>
+            <totalSizeCap>2GB</totalSizeCap>
+        </rollingPolicy>
+        <encoder>
+            <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
+        </encoder>
+    </appender>
+    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+        <encoder>
+            <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
+        </encoder>
+    </appender>
+
+    <logger name="com" level="INFO">
+        <appender-ref ref="STDOUT" />
+    </logger>
+
+    <logger name="org" level="INFO">
+        <appender-ref ref="STDOUT" />
+    </logger>
+
+    <logger name="io" level="INFO">
+        <appender-ref ref="STDOUT" />
+    </logger>
+
+    <logger name="net" level="INFO">
+        <appender-ref ref="STDOUT" />
+    </logger>
+
+    <root level="DEBUG">
+        <appender-ref ref="FILE"/>
+    </root>
+</configuration>
\ No newline at end of file
diff --git a/service/src/test/java/io/mifos/cheque/service/internal/format/TestMICRParser.java b/service/src/test/java/io/mifos/cheque/service/internal/format/TestMICRParser.java
new file mode 100644
index 0000000..c74fa2b
--- /dev/null
+++ b/service/src/test/java/io/mifos/cheque/service/internal/format/TestMICRParser.java
@@ -0,0 +1,125 @@
+/*
+ * Copyright 2017 Kuelap, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * NOTICE:  All information contained herein is, and remains
+ * the property of Kuelap, Inc and its suppliers, if any.
+ * The intellectual and technical concepts contained herein
+ * are proprietary to Kuelap, Inc and its suppliers and may
+ * be covered by U.S. and Foreign Patents, patents in process,
+ * and are protected by trade secret or copyright law.
+ * Dissemination of this information or reproduction of this material
+ * is strictly forbidden unless prior written permission is obtained
+ * Kuelap, Inc.
+ */
+package io.mifos.cheque.service.internal.format;
+
+import io.mifos.cheque.api.v1.domain.MICR;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class TestMICRParser {
+
+  @Test
+  public void shouldParseIdentifier() throws Exception {
+    final String identifier = "1357~2468~1470";
+
+    final MICR micr = MICRParser.fromIdentifier(identifier);
+    Assert.assertEquals("1357", micr.getChequeNumber());
+    Assert.assertEquals("2468", micr.getBranchSortCode());
+    Assert.assertEquals("1470", micr.getAccountNumber());
+  }
+
+  @Test
+  public void shouldParseMIRC() throws Exception {
+    final MICR micr = new MICR();
+    micr.setChequeNumber("1357");
+    micr.setBranchSortCode("2468");
+    micr.setAccountNumber("1470");
+
+    final String identifier = MICRParser.toIdentifier(micr);
+    Assert.assertEquals("1357~2468~1470", identifier);
+  }
+
+  @Test(expected = IllegalArgumentException.class)
+  public void shouldFailIdentifierNull() throws Exception {
+    MICRParser.fromIdentifier(null);
+  }
+
+  @Test(expected = IllegalArgumentException.class)
+  public void shouldFailIdentifierEmpty() throws Exception {
+    MICRParser.fromIdentifier("");
+  }
+
+  @Test(expected = IllegalArgumentException.class)
+  public void shouldFailIdentifierLessParts() throws Exception {
+    MICRParser.fromIdentifier("1357~2468");
+  }
+
+  @Test(expected = IllegalArgumentException.class)
+  public void shouldFailIdentifierManyParts() throws Exception {
+    MICRParser.fromIdentifier("1357~2468~1470~1");
+  }
+
+  @Test(expected = IllegalArgumentException.class)
+  public void shouldFailMICRNull() throws Exception {
+    MICRParser.toIdentifier(null);
+  }
+
+  @Test(expected = IllegalArgumentException.class)
+  public void shouldFailChequeNumberNull() throws Exception {
+    final MICR micr = new MICR();
+    micr.setBranchSortCode("2468");
+    micr.setAccountNumber("1470");
+
+    MICRParser.toIdentifier(micr);
+  }
+  @Test(expected = IllegalArgumentException.class)
+  public void shouldFailChequeNumberMissing() throws Exception {
+    final MICR micr = new MICR();
+    micr.setChequeNumber("");
+    micr.setBranchSortCode("2468");
+    micr.setAccountNumber("1470");
+
+    MICRParser.toIdentifier(micr);
+  }
+
+  @Test(expected = IllegalArgumentException.class)
+  public void shouldFailBranchSortCodeNull() throws Exception {
+    final MICR micr = new MICR();
+    micr.setChequeNumber("1357");
+    micr.setAccountNumber("1470");
+
+    MICRParser.toIdentifier(micr);
+  }
+
+  @Test(expected = IllegalArgumentException.class)
+  public void shouldFailBranchSortCodeMissing() throws Exception {
+    final MICR micr = new MICR();
+    micr.setChequeNumber("1357");
+    micr.setBranchSortCode("");
+    micr.setAccountNumber("1470");
+
+    MICRParser.toIdentifier(micr);
+  }
+
+  @Test(expected = IllegalArgumentException.class)
+  public void shouldFailAccountNumberNull() throws Exception {
+    final MICR micr = new MICR();
+    micr.setChequeNumber("1357");
+    micr.setBranchSortCode("2468");
+
+    MICRParser.toIdentifier(micr);
+  }
+
+  @Test(expected = IllegalArgumentException.class)
+  public void shouldFailAccountNumberMissing() throws Exception {
+    final MICR micr = new MICR();
+    micr.setChequeNumber("1357");
+    micr.setBranchSortCode("2468");
+    micr.setAccountNumber("");
+
+    MICRParser.toIdentifier(micr);
+  }
+}
diff --git a/settings.gradle b/settings.gradle
new file mode 100644
index 0000000..4f44661
--- /dev/null
+++ b/settings.gradle
@@ -0,0 +1,6 @@
+rootProject.name = 'cheques'
+
+includeBuild 'api'
+includeBuild 'service'
+includeBuild 'component-test'
+
diff --git a/shared.gradle b/shared.gradle
new file mode 100644
index 0000000..53a6aa4
--- /dev/null
+++ b/shared.gradle
@@ -0,0 +1,73 @@
+group 'io.kuelap.cheques'
+version '0.1.0-BUILD-SNAPSHOT'
+
+ext.versions = [
+        frameworkapi       : '0.1.0-BUILD-SNAPSHOT',
+        frameworklang      : '0.1.0-BUILD-SNAPSHOT',
+        frameworkasync     : '0.1.0-BUILD-SNAPSHOT',
+        frameworkcassandra : '0.1.0-BUILD-SNAPSHOT',
+        frameworkmariadb   : '0.1.0-BUILD-SNAPSHOT',
+        frameworkcommand   : '0.1.0-BUILD-SNAPSHOT',
+        frameworktest      : '0.1.0-BUILD-SNAPSHOT',
+        frameworkanubis    : '0.1.0-BUILD-SNAPSHOT',
+        frameworkoffice    : '0.1.0-BUILD-SNAPSHOT',
+        frameworkaccounting: '0.1.0-BUILD-SNAPSHOT',
+        frameworkdeposit   : '0.1.0-BUILD-SNAPSHOT',
+        validator          : '5.3.0.Final'
+]
+
+apply plugin: 'java'
+apply plugin: 'idea'
+apply plugin: 'maven-publish'
+apply plugin: 'io.spring.dependency-management'
+
+tasks.withType(JavaCompile) {
+    sourceCompatibility = JavaVersion.VERSION_1_8
+    targetCompatibility = JavaVersion.VERSION_1_8
+}
+
+repositories {
+    jcenter()
+    mavenLocal()
+}
+
+dependencyManagement {
+    imports {
+        mavenBom 'io.spring.platform:platform-bom:Athens-RELEASE'
+        mavenBom 'org.springframework.cloud:spring-cloud-dependencies:Camden.SR1'
+    }
+}
+
+// override certain dependency provided by Spring platform using newer releases
+ext['cassandra.version'] = '3.6'
+ext['cassandra-driver.version'] = '3.1.2'
+ext['activemq.version'] = '5.13.2'
+ext['spring-data-releasetrain.version'] = 'Gosling-SR2A'
+
+dependencies {
+    compile(
+            [group: 'com.google.code.findbugs', name: 'jsr305']
+    )
+
+    testCompile(
+            [group: 'org.springframework.boot', name: 'spring-boot-starter-test']
+    )
+}
+
+jar {
+    from sourceSets.main.allSource
+    duplicatesStrategy = DuplicatesStrategy.EXCLUDE
+}
+
+license {
+    header rootProject.file('../HEADER')
+    strictCheck true
+    mapping {
+        java = 'SLASHSTAR_STYLE'
+        xml = 'XML_STYLE'
+        yml = 'SCRIPT_STYLE'
+        yaml = 'SCRIPT_STYLE'
+    }
+    ext.year = Calendar.getInstance().get(Calendar.YEAR)
+    ext.company = 'Kuelap, Inc'
+}
\ No newline at end of file


[fineract-cn-cheques] 03/44: added MICR resolution for on us cheques

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juhan pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-cheques.git

commit bad4be7333d76621370b669e3fd0261fe2ca7932
Author: mgeiss <mg...@mifos.org>
AuthorDate: Tue Aug 22 12:01:46 2017 +0200

    added MICR resolution for on us cheques
---
 .../mifos/cheque/api/v1/client/ChequeManager.java  |  19 ++
 .../client/DependingResourceNotValidException.java |  19 ++
 .../v1/client/InvalidChequeNumberException.java    |  19 ++
 .../api/v1/{client => domain}/IssuingCount.java    |   2 +-
 .../mifos/cheque/api/v1/domain/MICRResolution.java |  42 ++++
 .../src/main/java/io/mifos/cheque/TestCheques.java |   3 +-
 .../java/io/mifos/cheque/TestIssuingCheques.java   |   2 +-
 .../src/main/java/io/mifos/cheque/TestMICR.java    | 271 +++++++++++++++++++++
 service/build.gradle                               |   1 +
 .../mifos/cheque/service/ChequeConfiguration.java  |   4 +-
 .../service/internal/service/MICRService.java      |  91 +++++++
 .../internal/service/helper/AccountingService.java |  16 +-
 ...ganizationService.java => CustomerService.java} |  26 +-
 .../internal/service/helper/DepositService.java    |  10 +
 .../service/helper/OrganizationService.java        |  12 +-
 .../cheque/service/rest/ChequeRestController.java  |   2 +-
 .../cheque/service/rest/MIRCRestController.java    |  58 +++++
 shared.gradle                                      |   1 +
 18 files changed, 571 insertions(+), 27 deletions(-)

diff --git a/api/src/main/java/io/mifos/cheque/api/v1/client/ChequeManager.java b/api/src/main/java/io/mifos/cheque/api/v1/client/ChequeManager.java
index 781793a..466d20d 100644
--- a/api/src/main/java/io/mifos/cheque/api/v1/client/ChequeManager.java
+++ b/api/src/main/java/io/mifos/cheque/api/v1/client/ChequeManager.java
@@ -18,8 +18,14 @@ package io.mifos.cheque.api.v1.client;
 import io.mifos.cheque.api.v1.domain.Cheque;
 import io.mifos.cheque.api.v1.domain.ChequeProcessingCommand;
 import io.mifos.cheque.api.v1.domain.ChequeTransaction;
+import io.mifos.cheque.api.v1.domain.IssuingCount;
+import io.mifos.cheque.api.v1.domain.MICRResolution;
+import io.mifos.core.api.annotation.ThrowsException;
+import io.mifos.core.api.annotation.ThrowsExceptions;
 import io.mifos.core.api.util.CustomFeignClientsConfiguration;
+import io.mifos.core.api.util.NotFoundException;
 import org.springframework.cloud.netflix.feign.FeignClient;
+import org.springframework.http.HttpStatus;
 import org.springframework.http.MediaType;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -84,4 +90,17 @@ public interface ChequeManager {
       consumes = {MediaType.APPLICATION_JSON_VALUE}
   )
   void process(@RequestBody @Valid final ChequeTransaction chequeTransaction);
+
+  @RequestMapping(
+      value = "/micr/{identifier}",
+      method = RequestMethod.GET,
+      produces = {MediaType.ALL_VALUE},
+      consumes = {MediaType.APPLICATION_JSON_VALUE}
+  )
+  @ThrowsExceptions({
+      @ThrowsException(status = HttpStatus.NOT_FOUND, exception = NotFoundException.class),
+      @ThrowsException(status = HttpStatus.CONFLICT, exception = InvalidChequeNumberException.class),
+      @ThrowsException(status = HttpStatus.BAD_REQUEST, exception = DependingResourceNotValidException.class)
+  })
+  MICRResolution expandMicr(@PathVariable("identifier") final String identifier);
 }
diff --git a/api/src/main/java/io/mifos/cheque/api/v1/client/DependingResourceNotValidException.java b/api/src/main/java/io/mifos/cheque/api/v1/client/DependingResourceNotValidException.java
new file mode 100644
index 0000000..0c5d945
--- /dev/null
+++ b/api/src/main/java/io/mifos/cheque/api/v1/client/DependingResourceNotValidException.java
@@ -0,0 +1,19 @@
+/*
+ * Copyright 2017 Kuelap, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * NOTICE:  All information contained herein is, and remains
+ * the property of Kuelap, Inc and its suppliers, if any.
+ * The intellectual and technical concepts contained herein
+ * are proprietary to Kuelap, Inc and its suppliers and may
+ * be covered by U.S. and Foreign Patents, patents in process,
+ * and are protected by trade secret or copyright law.
+ * Dissemination of this information or reproduction of this material
+ * is strictly forbidden unless prior written permission is obtained
+ * Kuelap, Inc.
+ */
+package io.mifos.cheque.api.v1.client;
+
+public class DependingResourceNotValidException extends RuntimeException {
+}
diff --git a/api/src/main/java/io/mifos/cheque/api/v1/client/InvalidChequeNumberException.java b/api/src/main/java/io/mifos/cheque/api/v1/client/InvalidChequeNumberException.java
new file mode 100644
index 0000000..29084cf
--- /dev/null
+++ b/api/src/main/java/io/mifos/cheque/api/v1/client/InvalidChequeNumberException.java
@@ -0,0 +1,19 @@
+/*
+ * Copyright 2017 Kuelap, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * NOTICE:  All information contained herein is, and remains
+ * the property of Kuelap, Inc and its suppliers, if any.
+ * The intellectual and technical concepts contained herein
+ * are proprietary to Kuelap, Inc and its suppliers and may
+ * be covered by U.S. and Foreign Patents, patents in process,
+ * and are protected by trade secret or copyright law.
+ * Dissemination of this information or reproduction of this material
+ * is strictly forbidden unless prior written permission is obtained
+ * Kuelap, Inc.
+ */
+package io.mifos.cheque.api.v1.client;
+
+public class InvalidChequeNumberException extends RuntimeException {
+}
diff --git a/api/src/main/java/io/mifos/cheque/api/v1/client/IssuingCount.java b/api/src/main/java/io/mifos/cheque/api/v1/domain/IssuingCount.java
similarity index 97%
rename from api/src/main/java/io/mifos/cheque/api/v1/client/IssuingCount.java
rename to api/src/main/java/io/mifos/cheque/api/v1/domain/IssuingCount.java
index af37b0d..70a4f53 100644
--- a/api/src/main/java/io/mifos/cheque/api/v1/client/IssuingCount.java
+++ b/api/src/main/java/io/mifos/cheque/api/v1/domain/IssuingCount.java
@@ -13,7 +13,7 @@
  * is strictly forbidden unless prior written permission is obtained
  * Kuelap, Inc.
  */
-package io.mifos.cheque.api.v1.client;
+package io.mifos.cheque.api.v1.domain;
 
 import javax.validation.constraints.Min;
 import javax.validation.constraints.NotNull;
diff --git a/api/src/main/java/io/mifos/cheque/api/v1/domain/MICRResolution.java b/api/src/main/java/io/mifos/cheque/api/v1/domain/MICRResolution.java
new file mode 100644
index 0000000..21c2aae
--- /dev/null
+++ b/api/src/main/java/io/mifos/cheque/api/v1/domain/MICRResolution.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2017 Kuelap, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * NOTICE:  All information contained herein is, and remains
+ * the property of Kuelap, Inc and its suppliers, if any.
+ * The intellectual and technical concepts contained herein
+ * are proprietary to Kuelap, Inc and its suppliers and may
+ * be covered by U.S. and Foreign Patents, patents in process,
+ * and are protected by trade secret or copyright law.
+ * Dissemination of this information or reproduction of this material
+ * is strictly forbidden unless prior written permission is obtained
+ * Kuelap, Inc.
+ */
+package io.mifos.cheque.api.v1.domain;
+
+public class MICRResolution {
+
+  private String office;
+  private String customer;
+
+  public MICRResolution() {
+    super();
+  }
+
+  public String getOffice() {
+    return this.office;
+  }
+
+  public void setOffice(final String office) {
+    this.office = office;
+  }
+
+  public String getCustomer() {
+    return this.customer;
+  }
+
+  public void setCustomer(final String customer) {
+    this.customer = customer;
+  }
+}
diff --git a/component-test/src/main/java/io/mifos/cheque/TestCheques.java b/component-test/src/main/java/io/mifos/cheque/TestCheques.java
index 78fd545..5ed5c14 100644
--- a/component-test/src/main/java/io/mifos/cheque/TestCheques.java
+++ b/component-test/src/main/java/io/mifos/cheque/TestCheques.java
@@ -20,11 +20,11 @@ import io.mifos.accounting.api.v1.domain.Creditor;
 import io.mifos.accounting.api.v1.domain.Debtor;
 import io.mifos.accounting.api.v1.domain.JournalEntry;
 import io.mifos.cheque.api.v1.EventConstants;
-import io.mifos.cheque.api.v1.client.IssuingCount;
 import io.mifos.cheque.api.v1.domain.Action;
 import io.mifos.cheque.api.v1.domain.Cheque;
 import io.mifos.cheque.api.v1.domain.ChequeProcessingCommand;
 import io.mifos.cheque.api.v1.domain.ChequeTransaction;
+import io.mifos.cheque.api.v1.domain.IssuingCount;
 import io.mifos.cheque.api.v1.domain.State;
 import io.mifos.cheque.service.internal.format.MICRParser;
 import io.mifos.cheque.service.internal.service.helper.AccountingService;
@@ -81,7 +81,6 @@ public class TestCheques extends AbstractChequeTest {
         .doAnswer(invocation -> true)
         .when(this.accountingServiceSpy).accountExists(randomCheque.getMicr().getAccountNumber());
 
-
     final ChequeTransaction chequeTransaction = new ChequeTransaction();
     chequeTransaction.setCheque(randomCheque);
     chequeTransaction.setCreditorAccountNumber(RandomStringUtils.randomAlphanumeric(34));
diff --git a/component-test/src/main/java/io/mifos/cheque/TestIssuingCheques.java b/component-test/src/main/java/io/mifos/cheque/TestIssuingCheques.java
index 474ad4b..364636d 100644
--- a/component-test/src/main/java/io/mifos/cheque/TestIssuingCheques.java
+++ b/component-test/src/main/java/io/mifos/cheque/TestIssuingCheques.java
@@ -15,7 +15,7 @@
  */
 package io.mifos.cheque;
 
-import io.mifos.cheque.api.v1.client.IssuingCount;
+import io.mifos.cheque.api.v1.domain.IssuingCount;
 import io.mifos.cheque.service.internal.repository.IssuedChequeEntity;
 import io.mifos.cheque.service.internal.repository.IssuedChequeRepository;
 import io.mifos.cheque.service.internal.service.helper.AccountingService;
diff --git a/component-test/src/main/java/io/mifos/cheque/TestMICR.java b/component-test/src/main/java/io/mifos/cheque/TestMICR.java
new file mode 100644
index 0000000..cc50bae
--- /dev/null
+++ b/component-test/src/main/java/io/mifos/cheque/TestMICR.java
@@ -0,0 +1,271 @@
+/*
+ * Copyright 2017 Kuelap, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * NOTICE:  All information contained herein is, and remains
+ * the property of Kuelap, Inc and its suppliers, if any.
+ * The intellectual and technical concepts contained herein
+ * are proprietary to Kuelap, Inc and its suppliers and may
+ * be covered by U.S. and Foreign Patents, patents in process,
+ * and are protected by trade secret or copyright law.
+ * Dissemination of this information or reproduction of this material
+ * is strictly forbidden unless prior written permission is obtained
+ * Kuelap, Inc.
+ */
+package io.mifos.cheque;
+
+import io.mifos.cheque.api.v1.EventConstants;
+import io.mifos.cheque.api.v1.client.DependingResourceNotValidException;
+import io.mifos.cheque.api.v1.client.InvalidChequeNumberException;
+import io.mifos.cheque.api.v1.domain.Cheque;
+import io.mifos.cheque.api.v1.domain.ChequeTransaction;
+import io.mifos.cheque.api.v1.domain.IssuingCount;
+import io.mifos.cheque.api.v1.domain.MICR;
+import io.mifos.cheque.api.v1.domain.MICRResolution;
+import io.mifos.cheque.service.internal.format.MICRParser;
+import io.mifos.cheque.service.internal.service.helper.AccountingService;
+import io.mifos.cheque.service.internal.service.helper.CustomerService;
+import io.mifos.cheque.service.internal.service.helper.DepositService;
+import io.mifos.cheque.service.internal.service.helper.OrganizationService;
+import io.mifos.core.api.util.NotFoundException;
+import io.mifos.customer.api.v1.domain.Customer;
+import io.mifos.deposit.api.v1.instance.domain.ProductInstance;
+import io.mifos.office.api.v1.domain.Office;
+import org.apache.commons.lang3.RandomStringUtils;
+import org.junit.Assert;
+import org.junit.Test;
+import org.mockito.Mockito;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.mock.mockito.MockBean;
+
+import java.util.Collections;
+import java.util.Optional;
+
+public class TestMICR extends AbstractChequeTest {
+
+  private static final String OFFICE_NAME = "Money Bin";
+  private static final String CUSTOMER_IDENTIFIER = "scrooge.mcduck";
+  private static final String GIVEN_NAME = "Scrooge";
+  private static final String SURNAME = "Mc Duck";
+
+  @MockBean
+  private OrganizationService organizationServiceSpy;
+
+  @MockBean
+  private DepositService depositServiceSpy;
+
+  @MockBean
+  private AccountingService accountingServiceSpy;
+
+  @MockBean
+  private CustomerService customerServiceSpy;
+
+  @Autowired
+  public TestMICR() {
+    super();
+  }
+
+  @Test
+  public void shouldReturnResolution() throws Exception {
+
+    final MICR micr = Fixture.createRandomCheque().getMicr();
+
+    Mockito
+        .doAnswer(invocation -> {
+          final Office mockedOffice = new Office();
+          mockedOffice.setName(TestMICR.OFFICE_NAME);
+          return Optional.of(mockedOffice);
+        })
+        .when(this.organizationServiceSpy).findOffice(micr.getBranchSortCode());
+
+    Mockito
+        .doAnswer(invocation -> {
+          final ProductInstance mockedProductInstance = new ProductInstance();
+          mockedProductInstance.setCustomerIdentifier(TestMICR.CUSTOMER_IDENTIFIER);
+          return Optional.of(mockedProductInstance);
+        })
+        .when(this.depositServiceSpy).findProductInstance(micr.getAccountNumber());
+
+    Mockito
+        .doAnswer(invocation -> Collections.emptyList())
+        .when(this.depositServiceSpy).getIssueChequeCharges(micr.getAccountNumber());
+
+    Mockito
+        .doAnswer(invocation -> {
+          final Customer mockedCustomer = new Customer();
+          mockedCustomer.setGivenName(TestMICR.GIVEN_NAME);
+          mockedCustomer.setSurname(TestMICR.SURNAME);
+          return Optional.of(mockedCustomer);
+        })
+        .when(this.customerServiceSpy).findCustomer(TestMICR.CUSTOMER_IDENTIFIER);
+
+    final IssuingCount issuingCount = new IssuingCount();
+    issuingCount.setAccountIdentifier(micr.getAccountNumber());
+    issuingCount.setAmount(100);
+
+    super.chequeManager.issue(issuingCount);
+
+    Assert.assertTrue(
+        super.eventRecorder.wait(EventConstants.ISSUE_CHEQUES, micr.getAccountNumber())
+    );
+
+    final MICRResolution micrResolution = super.chequeManager.expandMicr(MICRParser.toIdentifier(micr));
+    Assert.assertNotNull(micrResolution);
+    Assert.assertEquals(OFFICE_NAME, micrResolution.getOffice());
+    Assert.assertEquals(GIVEN_NAME + " " + SURNAME, micrResolution.getCustomer());
+  }
+
+  @Test(expected = NotFoundException.class)
+  public void shouldNotReturnResolutionNotOnUs() throws Exception {
+    final MICR micr = Fixture.createRandomCheque().getMicr();
+
+    Mockito
+        .doAnswer(invocation -> Optional.empty())
+        .when(this.organizationServiceSpy).findOffice(micr.getBranchSortCode());
+
+    super.chequeManager.expandMicr(MICRParser.toIdentifier(micr));
+  }
+
+  @Test(expected = InvalidChequeNumberException.class)
+  public void shouldNotReturnResolutionChequeAlreadyUsed() throws Exception {
+    final Cheque randomCheque = Fixture.createRandomCheque();
+    final MICR micr = randomCheque.getMicr();
+
+    final IssuingCount issuingCount = new IssuingCount();
+    issuingCount.setAccountIdentifier(micr.getAccountNumber());
+    issuingCount.setAmount(100);
+
+    super.chequeManager.issue(issuingCount);
+
+    Assert.assertTrue(
+        super.eventRecorder.wait(EventConstants.ISSUE_CHEQUES, micr.getAccountNumber())
+    );
+
+    Mockito
+        .doAnswer(invocation -> true)
+        .when(this.organizationServiceSpy).officeExistsByBranchSortCode(randomCheque.getMicr().getBranchSortCode());
+
+    Mockito
+        .doAnswer(invocation -> true)
+        .when(this.accountingServiceSpy).accountExists(randomCheque.getMicr().getAccountNumber());
+
+    final ChequeTransaction chequeTransaction = new ChequeTransaction();
+    chequeTransaction.setCheque(randomCheque);
+    chequeTransaction.setCreditorAccountNumber(RandomStringUtils.randomAlphanumeric(34));
+    super.chequeManager.process(chequeTransaction);
+
+    Assert.assertTrue(
+        super.eventRecorder.wait(EventConstants.CHEQUE_TRANSACTION, MICRParser.toIdentifier(randomCheque.getMicr()))
+    );
+
+    super.chequeManager.expandMicr(MICRParser.toIdentifier(micr));
+  }
+
+  @Test(expected = InvalidChequeNumberException.class)
+  public void shouldNotReturnResolutionChequeNotIssued() throws Exception {
+    final MICR micr = Fixture.createRandomCheque().getMicr();
+
+    Mockito
+        .doAnswer(invocation -> {
+          final Office mockedOffice = new Office();
+          mockedOffice.setName(TestMICR.OFFICE_NAME);
+          return Optional.of(mockedOffice);
+        })
+        .when(this.organizationServiceSpy).findOffice(micr.getBranchSortCode());
+
+    super.chequeManager.expandMicr(MICRParser.toIdentifier(micr));
+  }
+
+  @Test(expected = InvalidChequeNumberException.class)
+  public void shouldNotReturnResolutionUnknownChequeNumber() throws Exception {
+    final MICR micr = Fixture.createRandomCheque().getMicr();
+    micr.setChequeNumber("0815");
+
+    final IssuingCount issuingCount = new IssuingCount();
+    issuingCount.setAccountIdentifier(micr.getAccountNumber());
+    issuingCount.setAmount(100);
+
+    super.chequeManager.issue(issuingCount);
+
+    Assert.assertTrue(
+        super.eventRecorder.wait(EventConstants.ISSUE_CHEQUES, micr.getAccountNumber())
+    );
+
+    Mockito
+        .doAnswer(invocation -> {
+          final Office mockedOffice = new Office();
+          mockedOffice.setName(TestMICR.OFFICE_NAME);
+          return Optional.of(mockedOffice);
+        })
+        .when(this.organizationServiceSpy).findOffice(micr.getBranchSortCode());
+
+    super.chequeManager.expandMicr(MICRParser.toIdentifier(micr));
+  }
+
+  @Test(expected = DependingResourceNotValidException.class)
+  public void shouldNotReturnResolutionUnknownAccount() throws Exception {
+    final MICR micr = Fixture.createRandomCheque().getMicr();
+
+    Mockito
+        .doAnswer(invocation -> {
+          final Office mockedOffice = new Office();
+          mockedOffice.setName(TestMICR.OFFICE_NAME);
+          return Optional.of(mockedOffice);
+        })
+        .when(this.organizationServiceSpy).findOffice(micr.getBranchSortCode());
+
+    Mockito
+        .doAnswer(invocation -> Optional.empty())
+        .when(this.depositServiceSpy).findProductInstance(micr.getAccountNumber());
+
+    final IssuingCount issuingCount = new IssuingCount();
+    issuingCount.setAccountIdentifier(micr.getAccountNumber());
+    issuingCount.setAmount(100);
+
+    super.chequeManager.issue(issuingCount);
+
+    Assert.assertTrue(
+        super.eventRecorder.wait(EventConstants.ISSUE_CHEQUES, micr.getAccountNumber())
+    );
+
+    super.chequeManager.expandMicr(MICRParser.toIdentifier(micr));
+  }
+
+  @Test(expected = DependingResourceNotValidException.class)
+  public void shouldNotReturnResolutionUnknownCustomer() throws Exception {
+    final MICR micr = Fixture.createRandomCheque().getMicr();
+
+    Mockito
+        .doAnswer(invocation -> {
+          final Office mockedOffice = new Office();
+          mockedOffice.setName(TestMICR.OFFICE_NAME);
+          return Optional.of(mockedOffice);
+        })
+        .when(this.organizationServiceSpy).findOffice(micr.getBranchSortCode());
+
+    Mockito
+        .doAnswer(invocation -> {
+          final ProductInstance mockedProductInstance = new ProductInstance();
+          mockedProductInstance.setCustomerIdentifier(TestMICR.CUSTOMER_IDENTIFIER);
+          return Optional.of(mockedProductInstance);
+        })
+        .when(this.depositServiceSpy).findProductInstance(micr.getAccountNumber());
+
+    Mockito
+        .doAnswer(invocation -> Optional.empty())
+        .when(this.customerServiceSpy).findCustomer(TestMICR.CUSTOMER_IDENTIFIER);
+
+    final IssuingCount issuingCount = new IssuingCount();
+    issuingCount.setAccountIdentifier(micr.getAccountNumber());
+    issuingCount.setAmount(100);
+
+    super.chequeManager.issue(issuingCount);
+
+    Assert.assertTrue(
+        super.eventRecorder.wait(EventConstants.ISSUE_CHEQUES, micr.getAccountNumber())
+    );
+
+    super.chequeManager.expandMicr(MICRParser.toIdentifier(micr));
+  }
+}
diff --git a/service/build.gradle b/service/build.gradle
index af26fc0..234e970 100644
--- a/service/build.gradle
+++ b/service/build.gradle
@@ -35,6 +35,7 @@ dependencies {
             [group: 'io.mifos.accounting', name: 'api', version: versions.frameworkaccounting],
             [group: 'io.mifos.deposit-account-management', name: 'api', version: versions.frameworkdeposit],
             [group: 'io.mifos.office', name: 'api', version: versions.frameworkoffice],
+            [group: 'io.mifos.customer', name: 'api', version: versions.frameworkcustomer],
             [group: 'com.google.code.gson', name: 'gson'],
             [group: 'io.mifos.core', name: 'lang', version: versions.frameworklang],
             [group: 'io.mifos.core', name: 'async', version: versions.frameworkasync],
diff --git a/service/src/main/java/io/mifos/cheque/service/ChequeConfiguration.java b/service/src/main/java/io/mifos/cheque/service/ChequeConfiguration.java
index f1f0570..9e9919c 100644
--- a/service/src/main/java/io/mifos/cheque/service/ChequeConfiguration.java
+++ b/service/src/main/java/io/mifos/cheque/service/ChequeConfiguration.java
@@ -23,6 +23,7 @@ import io.mifos.core.command.config.EnableCommandProcessing;
 import io.mifos.core.lang.config.EnableServiceException;
 import io.mifos.core.lang.config.EnableTenantContext;
 import io.mifos.core.mariadb.config.EnableMariaDB;
+import io.mifos.customer.api.v1.client.CustomerManager;
 import io.mifos.deposit.api.v1.client.DepositAccountManager;
 import io.mifos.office.api.v1.client.OrganizationManager;
 import org.slf4j.Logger;
@@ -52,7 +53,8 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
     clients = {
         LedgerManager.class,
         DepositAccountManager.class,
-        OrganizationManager.class
+        OrganizationManager.class,
+        CustomerManager.class
     }
 )
 @ComponentScan({
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/service/MICRService.java b/service/src/main/java/io/mifos/cheque/service/internal/service/MICRService.java
new file mode 100644
index 0000000..4bd3351
--- /dev/null
+++ b/service/src/main/java/io/mifos/cheque/service/internal/service/MICRService.java
@@ -0,0 +1,91 @@
+/*
+ * Copyright 2017 Kuelap, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * NOTICE:  All information contained herein is, and remains
+ * the property of Kuelap, Inc and its suppliers, if any.
+ * The intellectual and technical concepts contained herein
+ * are proprietary to Kuelap, Inc and its suppliers and may
+ * be covered by U.S. and Foreign Patents, patents in process,
+ * and are protected by trade secret or copyright law.
+ * Dissemination of this information or reproduction of this material
+ * is strictly forbidden unless prior written permission is obtained
+ * Kuelap, Inc.
+ */
+package io.mifos.cheque.service.internal.service;
+
+import io.mifos.cheque.api.v1.domain.MICR;
+import io.mifos.cheque.api.v1.domain.MICRResolution;
+import io.mifos.cheque.service.ServiceConstants;
+import io.mifos.cheque.service.internal.repository.IssuedChequeEntity;
+import io.mifos.cheque.service.internal.repository.IssuedChequeRepository;
+import io.mifos.cheque.service.internal.service.helper.CustomerService;
+import io.mifos.cheque.service.internal.service.helper.DepositService;
+import io.mifos.cheque.service.internal.service.helper.OrganizationService;
+import io.mifos.core.lang.ServiceException;
+import io.mifos.customer.api.v1.domain.Customer;
+import io.mifos.deposit.api.v1.instance.domain.ProductInstance;
+import io.mifos.office.api.v1.domain.Office;
+import org.slf4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.stereotype.Service;
+
+@Service
+public class MICRService {
+
+  private final Logger logger;
+  private final ChequeService chequeService;
+  private final OrganizationService organizationService;
+  private final DepositService depositService;
+  private final CustomerService customerService;
+  private final IssuedChequeRepository issuedChequeRepository;
+
+  @Autowired
+  public MICRService(@Qualifier(ServiceConstants.LOGGER_NAME) final Logger logger,
+                     final ChequeService chequeService,
+                     final OrganizationService organizationService,
+                     final DepositService depositService,
+                     final CustomerService customerService,
+                     final IssuedChequeRepository issuedChequeRepository) {
+    super();
+    this.logger = logger;
+    this.chequeService = chequeService;
+    this.organizationService = organizationService;
+    this.depositService = depositService;
+    this.customerService = customerService;
+    this.issuedChequeRepository = issuedChequeRepository;
+  }
+
+  public MICRResolution expand(final MICR micr) {
+
+    if (this.chequeService.findBy(micr).isPresent()) {
+      throw ServiceException.conflict("Cheque already used.");
+    }
+
+    final Office office =
+        this.organizationService.findOffice(micr.getBranchSortCode())
+            .orElseThrow(() -> ServiceException.notFound("Given MICR is unknown."));
+
+    final IssuedChequeEntity issuedChequeEntity =
+        this.issuedChequeRepository.findByAccountIdentifier(micr.getAccountNumber())
+            .orElseThrow(() -> ServiceException.conflict("Cheque was never issued."));
+    if (Integer.valueOf(micr.getChequeNumber()) > issuedChequeEntity.getLastIssuedNumber()) {
+      throw ServiceException.conflict("Cheque number invalid.");
+    }
+
+    final ProductInstance productInstance =
+        this.depositService.findProductInstance(micr.getAccountNumber())
+            .orElseThrow(() -> ServiceException.badRequest("Given account not valid."));
+
+    final Customer customer =
+        this.customerService.findCustomer(productInstance.getCustomerIdentifier())
+            .orElseThrow(() -> ServiceException.badRequest("Given customer not valid."));
+
+    final MICRResolution micrResolution = new MICRResolution();
+    micrResolution.setOffice(office.getName());
+    micrResolution.setCustomer(customer.getGivenName() + " " + customer.getSurname());
+    return micrResolution;
+  }
+}
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/service/helper/AccountingService.java b/service/src/main/java/io/mifos/cheque/service/internal/service/helper/AccountingService.java
index 95ef589..4667c04 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/service/helper/AccountingService.java
+++ b/service/src/main/java/io/mifos/cheque/service/internal/service/helper/AccountingService.java
@@ -35,6 +35,7 @@ import org.springframework.stereotype.Service;
 import java.time.Clock;
 import java.time.LocalDateTime;
 import java.util.List;
+import java.util.Optional;
 import java.util.UUID;
 import java.util.stream.Collectors;
 
@@ -99,12 +100,7 @@ public class AccountingService {
   }
 
   public boolean accountExists(final String accountIdentifier) {
-    try {
-      this.ledgerManager.findAccount(accountIdentifier);
-      return true;
-    } catch (final AccountNotFoundException anfex) {
-      return false;
-    }
+    return this.findAccount(accountIdentifier).isPresent();
   }
 
   public JournalEntry findJournalEntry(final String identifier) {
@@ -114,4 +110,12 @@ public class AccountingService {
   public void processJournalEntry(final JournalEntry journalEntry) {
     this.ledgerManager.createJournalEntry(journalEntry);
   }
+
+  public Optional<Account> findAccount(final String accountNumber) {
+    try {
+      return Optional.of(this.ledgerManager.findAccount(accountNumber));
+    } catch (final AccountNotFoundException anfex) {
+      return Optional.empty();
+    }
+  }
 }
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/service/helper/OrganizationService.java b/service/src/main/java/io/mifos/cheque/service/internal/service/helper/CustomerService.java
similarity index 58%
copy from service/src/main/java/io/mifos/cheque/service/internal/service/helper/OrganizationService.java
copy to service/src/main/java/io/mifos/cheque/service/internal/service/helper/CustomerService.java
index f8e857a..3bfebcd 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/service/helper/OrganizationService.java
+++ b/service/src/main/java/io/mifos/cheque/service/internal/service/helper/CustomerService.java
@@ -16,33 +16,35 @@
 package io.mifos.cheque.service.internal.service.helper;
 
 import io.mifos.cheque.service.ServiceConstants;
-import io.mifos.office.api.v1.client.NotFoundException;
-import io.mifos.office.api.v1.client.OrganizationManager;
+import io.mifos.customer.api.v1.client.CustomerManager;
+import io.mifos.customer.api.v1.client.CustomerNotFoundException;
+import io.mifos.customer.api.v1.domain.Customer;
 import org.slf4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.stereotype.Service;
 
+import java.util.Optional;
+
 @Service
-public class OrganizationService {
+public class CustomerService {
 
   private final Logger logger;
-  private final OrganizationManager organizationManager;
+  private final CustomerManager customerManager;
 
   @Autowired
-  public OrganizationService(@Qualifier(ServiceConstants.LOGGER_NAME) final Logger logger,
-                             final OrganizationManager organizationManager) {
+  public CustomerService(@Qualifier(ServiceConstants.LOGGER_NAME) final Logger logger,
+                         final CustomerManager customerManager) {
     super();
     this.logger = logger;
-    this.organizationManager = organizationManager;
+    this.customerManager = customerManager;
   }
 
-  public boolean officeExistsByBranchSortCode(final String branchSortCode) {
+  public Optional<Customer> findCustomer(final String identifier) {
     try {
-      this.organizationManager.findOfficeByIdentifier(branchSortCode);
-      return true;
-    } catch (final NotFoundException nfex) {
-      return false;
+      return Optional.of(this.customerManager.findCustomer(identifier));
+    } catch (final CustomerNotFoundException cnfex) {
+      return Optional.empty();
     }
   }
 }
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/service/helper/DepositService.java b/service/src/main/java/io/mifos/cheque/service/internal/service/helper/DepositService.java
index 7047bf8..0ff8257 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/service/helper/DepositService.java
+++ b/service/src/main/java/io/mifos/cheque/service/internal/service/helper/DepositService.java
@@ -20,6 +20,7 @@ import io.mifos.deposit.api.v1.client.DepositAccountManager;
 import io.mifos.deposit.api.v1.definition.domain.Action;
 import io.mifos.deposit.api.v1.definition.domain.Charge;
 import io.mifos.deposit.api.v1.definition.domain.ProductDefinition;
+import io.mifos.deposit.api.v1.instance.ProductInstanceNotFoundException;
 import io.mifos.deposit.api.v1.instance.domain.ProductInstance;
 import org.slf4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -27,6 +28,7 @@ import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.stereotype.Service;
 
 import java.util.List;
+import java.util.Optional;
 import java.util.stream.Collectors;
 
 @Service
@@ -75,4 +77,12 @@ public class DepositService {
 
     return productDefinition.getCashAccountIdentifier();
   }
+
+  public Optional<ProductInstance> findProductInstance(final String accountNumber) {
+    try {
+      return Optional.of(this.depositAccountManager.findProductInstance(accountNumber));
+    } catch (final ProductInstanceNotFoundException pinfex) {
+      return Optional.empty();
+    }
+  }
 }
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/service/helper/OrganizationService.java b/service/src/main/java/io/mifos/cheque/service/internal/service/helper/OrganizationService.java
index f8e857a..4a11088 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/service/helper/OrganizationService.java
+++ b/service/src/main/java/io/mifos/cheque/service/internal/service/helper/OrganizationService.java
@@ -18,11 +18,14 @@ package io.mifos.cheque.service.internal.service.helper;
 import io.mifos.cheque.service.ServiceConstants;
 import io.mifos.office.api.v1.client.NotFoundException;
 import io.mifos.office.api.v1.client.OrganizationManager;
+import io.mifos.office.api.v1.domain.Office;
 import org.slf4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.stereotype.Service;
 
+import java.util.Optional;
+
 @Service
 public class OrganizationService {
 
@@ -38,11 +41,14 @@ public class OrganizationService {
   }
 
   public boolean officeExistsByBranchSortCode(final String branchSortCode) {
+    return this.findOffice(branchSortCode).isPresent();
+  }
+
+  public Optional<Office> findOffice(final String branchSortCode) {
     try {
-      this.organizationManager.findOfficeByIdentifier(branchSortCode);
-      return true;
+      return Optional.of(this.organizationManager.findOfficeByIdentifier(branchSortCode));
     } catch (final NotFoundException nfex) {
-      return false;
+      return Optional.empty();
     }
   }
 }
diff --git a/service/src/main/java/io/mifos/cheque/service/rest/ChequeRestController.java b/service/src/main/java/io/mifos/cheque/service/rest/ChequeRestController.java
index 7f9414f..007e383 100644
--- a/service/src/main/java/io/mifos/cheque/service/rest/ChequeRestController.java
+++ b/service/src/main/java/io/mifos/cheque/service/rest/ChequeRestController.java
@@ -18,10 +18,10 @@ package io.mifos.cheque.service.rest;
 import io.mifos.anubis.annotation.AcceptedTokenType;
 import io.mifos.anubis.annotation.Permittable;
 import io.mifos.cheque.api.v1.PermittableGroupIds;
-import io.mifos.cheque.api.v1.client.IssuingCount;
 import io.mifos.cheque.api.v1.domain.Action;
 import io.mifos.cheque.api.v1.domain.Cheque;
 import io.mifos.cheque.api.v1.domain.ChequeProcessingCommand;
+import io.mifos.cheque.api.v1.domain.IssuingCount;
 import io.mifos.cheque.service.ServiceConstants;
 import io.mifos.cheque.service.internal.command.ApproveChequeTransactionCommand;
 import io.mifos.cheque.service.internal.command.CancelChequeTransactionCommand;
diff --git a/service/src/main/java/io/mifos/cheque/service/rest/MIRCRestController.java b/service/src/main/java/io/mifos/cheque/service/rest/MIRCRestController.java
new file mode 100644
index 0000000..8b56e73
--- /dev/null
+++ b/service/src/main/java/io/mifos/cheque/service/rest/MIRCRestController.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2017 Kuelap, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * NOTICE:  All information contained herein is, and remains
+ * the property of Kuelap, Inc and its suppliers, if any.
+ * The intellectual and technical concepts contained herein
+ * are proprietary to Kuelap, Inc and its suppliers and may
+ * be covered by U.S. and Foreign Patents, patents in process,
+ * and are protected by trade secret or copyright law.
+ * Dissemination of this information or reproduction of this material
+ * is strictly forbidden unless prior written permission is obtained
+ * Kuelap, Inc.
+ */
+package io.mifos.cheque.service.rest;
+
+import io.mifos.cheque.api.v1.domain.MICRResolution;
+import io.mifos.cheque.service.ServiceConstants;
+import io.mifos.cheque.service.internal.format.MICRParser;
+import io.mifos.cheque.service.internal.service.MICRService;
+import org.slf4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/micr")
+public class MIRCRestController {
+
+  private final Logger logger;
+  private final MICRService micrService;
+
+  @Autowired
+  public MIRCRestController(@Qualifier(ServiceConstants.LOGGER_NAME) final Logger logger,
+                            final MICRService micrService) {
+    super();
+    this.logger = logger;
+    this.micrService = micrService;
+  }
+
+  @RequestMapping(
+      value = "/{identifier}",
+      method = RequestMethod.GET,
+      produces = {MediaType.APPLICATION_JSON_VALUE},
+      consumes = {MediaType.ALL_VALUE}
+  )
+  @ResponseBody
+  ResponseEntity<MICRResolution> expandMicr(@PathVariable("identifier") final String identifier) {
+    return ResponseEntity.ok(this.micrService.expand(MICRParser.fromIdentifier(identifier)));
+  }
+}
diff --git a/shared.gradle b/shared.gradle
index 53a6aa4..bddedf5 100644
--- a/shared.gradle
+++ b/shared.gradle
@@ -13,6 +13,7 @@ ext.versions = [
         frameworkoffice    : '0.1.0-BUILD-SNAPSHOT',
         frameworkaccounting: '0.1.0-BUILD-SNAPSHOT',
         frameworkdeposit   : '0.1.0-BUILD-SNAPSHOT',
+        frameworkcustomer  : '0.1.0-BUILD-SNAPSHOT',
         validator          : '5.3.0.Final'
 ]
 


[fineract-cn-cheques] 29/44: Removing last references to mifos.

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juhan pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-cheques.git

commit b3d1e2177804a24c2319f112976e2dc14965a235
Author: Myrle Krantz <my...@apache.org>
AuthorDate: Mon Apr 16 11:52:08 2018 +0200

    Removing last references to mifos.
---
 README.md | 2 --
 1 file changed, 2 deletions(-)

diff --git a/README.md b/README.md
index 55da002..2ceb05c 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,5 @@
 # Apache Fineract CN Cheques Management
 
-[![Join the chat at https://gitter.im/mifos-initiative/mifos.io](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/mifos-initiative/mifos.io?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
-
 This project provides services to issue, validate cheques and execute transactions on them.
 
 ## Abstract


[fineract-cn-cheques] 21/44: Merge pull request #1 from myrle-krantz/develop

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juhan pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-cheques.git

commit de02aaa34dfd550511268b95e5f8ffc887971bfd
Merge: 6efef67 5f49393
Author: Myrle Krantz <my...@apache.org>
AuthorDate: Mon Feb 26 18:27:37 2018 +0100

    Merge pull request #1 from myrle-krantz/develop
    
     updating artifact ids to apache fineract from mifos io

 api/build.gradle            |  4 ++--
 build.gradle                |  2 +-
 component-test/build.gradle | 12 ++++++------
 gradlew                     |  0
 service/build.gradle        | 22 +++++++++++-----------
 shared.gradle               |  4 ++--
 6 files changed, 22 insertions(+), 22 deletions(-)


[fineract-cn-cheques] 19/44: updating artifact ids to apache fineract from mifos io

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juhan pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-cheques.git

commit a7e5349a8b33ac1c26b8d371c0b5ca8716738154
Author: Myrle Krantz <my...@apache.org>
AuthorDate: Mon Feb 26 17:44:51 2018 +0100

    updating artifact ids to apache fineract from mifos io
---
 api/build.gradle            |  4 ++--
 build.gradle                |  2 +-
 component-test/build.gradle | 12 ++++++------
 service/build.gradle        | 22 +++++++++++-----------
 shared.gradle               |  4 ++--
 5 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/api/build.gradle b/api/build.gradle
index 17c6648..1ed9d2b 100644
--- a/api/build.gradle
+++ b/api/build.gradle
@@ -17,13 +17,13 @@ apply from: '../shared.gradle'
 dependencies {
     compile(
             [group: 'org.springframework.cloud', name: 'spring-cloud-starter-feign'],
-            [group: 'io.mifos.core', name: 'api', version: versions.frameworkapi],
+            [group: 'org.apache.fineract.cn', name: 'api', version: versions.frameworkapi],
             [group: 'org.hibernate', name: 'hibernate-validator', version: versions.validator],
             [group: 'org.hibernate', name: 'hibernate-validator-annotation-processor', version: versions.validator]
     )
 
     testCompile(
-            [group: 'io.mifos.core', name: 'test', version: versions.frameworktest],
+            [group: 'org.apache.fineract.cn', name: 'test', version: versions.frameworktest],
     )
 }
 
diff --git a/build.gradle b/build.gradle
index b30bd55..b82a3b2 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,4 +1,4 @@
-group 'io.mifos'
+group 'org.apache.fineract.cn'
 
 task publishApiToMavenLocal {
     dependsOn gradle.includedBuild('api').task(':publishToMavenLocal')
diff --git a/component-test/build.gradle b/component-test/build.gradle
index 79d39f7..6eaebfc 100644
--- a/component-test/build.gradle
+++ b/component-test/build.gradle
@@ -19,12 +19,12 @@ apply from: '../shared.gradle'
 
 dependencies {
     compile(
-            [group: 'io.mifos.cheques', name: 'api', version: project.version],
-            [group: 'io.mifos.cheques', name: 'service', version: project.version],
-            [group: 'io.mifos.anubis', name: 'test', version: versions.frameworkanubis],
-            [group: 'io.mifos.core', name: 'api', version: versions.frameworkapi],
-            [group: 'io.mifos.core', name: 'test', version: versions.frameworktest],
-            [group: 'io.mifos.core', name: 'lang', version: versions.frameworklang],
+            [group: 'org.apache.fineract.cn.cheques', name: 'api', version: project.version],
+            [group: 'org.apache.fineract.cn.cheques', name: 'service', version: project.version],
+            [group: 'org.apache.fineract.cn.anubis', name: 'test', version: versions.frameworkanubis],
+            [group: 'org.apache.fineract.cn', name: 'api', version: versions.frameworkapi],
+            [group: 'org.apache.fineract.cn', name: 'test', version: versions.frameworktest],
+            [group: 'org.apache.fineract.cn', name: 'lang', version: versions.frameworklang],
             [group: 'org.springframework.boot', name: 'spring-boot-starter-test']
     )
 }
diff --git a/service/build.gradle b/service/build.gradle
index 3ef885f..d353f89 100644
--- a/service/build.gradle
+++ b/service/build.gradle
@@ -30,18 +30,18 @@ dependencies {
             [group: 'org.springframework.cloud', name: 'spring-cloud-starter-config'],
             [group: 'org.springframework.cloud', name: 'spring-cloud-starter-eureka'],
             [group: 'org.springframework.boot', name: 'spring-boot-starter-jetty'],
-            [group: 'io.mifos.cheques', name: 'api', version: project.version],
-            [group: 'io.mifos.anubis', name: 'library', version: versions.frameworkanubis],
-            [group: 'io.mifos.accounting', name: 'api', version: versions.frameworkaccounting],
-            [group: 'io.mifos.deposit-account-management', name: 'api', version: versions.frameworkdeposit],
-            [group: 'io.mifos.office', name: 'api', version: versions.frameworkoffice],
-            [group: 'io.mifos.customer', name: 'api', version: versions.frameworkcustomer],
+            [group: 'org.apache.fineract.cn.cheques', name: 'api', version: project.version],
+            [group: 'org.apache.fineract.cn.anubis', name: 'library', version: versions.frameworkanubis],
+            [group: 'org.apache.fineract.cn.accounting', name: 'api', version: versions.frameworkaccounting],
+            [group: 'org.apache.fineract.cn.deposit-account-management', name: 'api', version: versions.frameworkdeposit],
+            [group: 'org.apache.fineract.cn.office', name: 'api', version: versions.frameworkoffice],
+            [group: 'org.apache.fineract.cn.customer', name: 'api', version: versions.frameworkcustomer],
             [group: 'com.google.code.gson', name: 'gson'],
-            [group: 'io.mifos.core', name: 'lang', version: versions.frameworklang],
-            [group: 'io.mifos.core', name: 'async', version: versions.frameworkasync],
-            [group: 'io.mifos.core', name: 'cassandra', version: versions.frameworkcassandra],
-            [group: 'io.mifos.core', name: 'mariadb', version: versions.frameworkmariadb],
-            [group: 'io.mifos.core', name: 'command', version: versions.frameworkcommand],
+            [group: 'org.apache.fineract.cn', name: 'lang', version: versions.frameworklang],
+            [group: 'org.apache.fineract.cn', name: 'async', version: versions.frameworkasync],
+            [group: 'org.apache.fineract.cn', name: 'cassandra', version: versions.frameworkcassandra],
+            [group: 'org.apache.fineract.cn', name: 'mariadb', version: versions.frameworkmariadb],
+            [group: 'org.apache.fineract.cn', name: 'command', version: versions.frameworkcommand],
             [group: 'org.hibernate', name: 'hibernate-validator', version: versions.validator],
             [group: 'org.threeten', name: 'threeten-extra', version: '1.2']
     )
diff --git a/shared.gradle b/shared.gradle
index e9c3ef2..603d308 100644
--- a/shared.gradle
+++ b/shared.gradle
@@ -1,4 +1,4 @@
-group 'io.mifos.cheques'
+group 'org.apache.fineract.cn.cheques'
 version '0.1.0-BUILD-SNAPSHOT'
 
 ext.versions = [
@@ -71,4 +71,4 @@ license {
     }
     ext.year = Calendar.getInstance().get(Calendar.YEAR)
     ext.company = 'Kuelap, Inc'
-}
\ No newline at end of file
+}


[fineract-cn-cheques] 41/44: Merge pull request #9 from aasaru/gradle_4.10.3

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juhan pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-cheques.git

commit c9d2107adfd7f6c2a20bec355108b1577f7ec429
Merge: f3ff12d 773af6c
Author: aasaru <aa...@gmail.com>
AuthorDate: Wed Oct 9 10:39:10 2019 +0300

    Merge pull request #9 from aasaru/gradle_4.10.3
    
    FINCN-179 gradle to 4.10.3, FINCN-178 make Travis build forks…

 README.md                                  |   3 ++-
 api/build.gradle                           |   7 +++++--
 build.gradle                               |   7 +++++++
 component-test/build.gradle                |   9 ++++++++-
 gradle/wrapper/gradle-wrapper.jar          | Bin 54212 -> 54212 bytes
 gradle/wrapper/gradle-wrapper.properties   |   4 ++--
 service/build.gradle                       |  27 ++++++++++++++-------------
 service/src/main/resources/application.yml |   2 +-
 service/src/main/resources/banner.txt      |  11 +++++++++++
 shared.gradle                              |  10 +++-------
 travis.sh                                  |  16 ++++++++++++----
 11 files changed, 65 insertions(+), 31 deletions(-)


[fineract-cn-cheques] 06/44: Merge pull request #2 from markvanveen/develop

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juhan pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-cheques.git

commit e9da6609d874860c836f267cc93ba75ad04c3a29
Merge: 2316706 8b05cb8
Author: Mark van Veen <30...@users.noreply.github.com>
AuthorDate: Fri Aug 25 17:03:10 2017 +0200

    Merge pull request #2 from markvanveen/develop
    
    Change package to io.mifos

 README.md     | 4 ++--
 shared.gradle | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)


[fineract-cn-cheques] 33/44: Migrate cheques service from MariaDB to PostgreSQL

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juhan pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-cheques.git

commit 81b31ccc4825e9082874e4eb3efce08dad8babaf
Author: Isaac Kamga <u2...@gmail.com>
AuthorDate: Thu May 9 04:01:58 2019 +0100

    Migrate cheques service from MariaDB to PostgreSQL
---
 NOTICE.txt                                         |  2 +-
 .../fineract/cn/cheque/AbstractChequeTest.java     |  2 +-
 .../fineract/cn/cheque/SuiteTestEnvironment.java   |  6 ++---
 service/build.gradle                               |  2 +-
 .../cn/cheque/service/ChequeConfiguration.java     |  4 +--
 .../command/handler/ManagementAggregate.java       |  2 +-
 .../service/internal/repository/ChequeEntity.java  |  2 +-
 .../internal/repository/IssuedChequeEntity.java    |  2 +-
 service/src/main/resources/application.yml         | 15 +++++++----
 .../{mariadb => postgresql}/V1__initial_setup.sql  | 10 +++-----
 shared.gradle                                      | 29 +++++++++++-----------
 11 files changed, 40 insertions(+), 36 deletions(-)

diff --git a/NOTICE.txt b/NOTICE.txt
index de5aeca..4bc39ba 100644
--- a/NOTICE.txt
+++ b/NOTICE.txt
@@ -1,5 +1,5 @@
 Apache Fineract CN Cheques
-Copyright [2017-2018] The Apache Software Foundation
+Copyright [2017-2019] The Apache Software Foundation
 
 This product includes software developed at
 The Apache Software Foundation (http://www.apache.org/).
\ No newline at end of file
diff --git a/component-test/src/main/java/org/apache/fineract/cn/cheque/AbstractChequeTest.java b/component-test/src/main/java/org/apache/fineract/cn/cheque/AbstractChequeTest.java
index e45a167..61c0aa9 100644
--- a/component-test/src/main/java/org/apache/fineract/cn/cheque/AbstractChequeTest.java
+++ b/component-test/src/main/java/org/apache/fineract/cn/cheque/AbstractChequeTest.java
@@ -56,7 +56,7 @@ public abstract class AbstractChequeTest extends SuiteTestEnvironment {
 
   @ClassRule
   public final static TenantDataStoreContextTestRule tenantDataStoreContext =
-      TenantDataStoreContextTestRule.forRandomTenantName(cassandraInitializer, mariaDBInitializer);
+      TenantDataStoreContextTestRule.forRandomTenantName(cassandraInitializer, postgreSQLInitializer);
 
   @Rule
   public final TenantApplicationSecurityEnvironmentTestRule tenantApplicationSecurityEnvironment
diff --git a/component-test/src/main/java/org/apache/fineract/cn/cheque/SuiteTestEnvironment.java b/component-test/src/main/java/org/apache/fineract/cn/cheque/SuiteTestEnvironment.java
index c2b5fb4..39834d9 100644
--- a/component-test/src/main/java/org/apache/fineract/cn/cheque/SuiteTestEnvironment.java
+++ b/component-test/src/main/java/org/apache/fineract/cn/cheque/SuiteTestEnvironment.java
@@ -21,7 +21,7 @@ package org.apache.fineract.cn.cheque;
 
 import org.apache.fineract.cn.test.env.TestEnvironment;
 import org.apache.fineract.cn.test.fixture.cassandra.CassandraInitializer;
-import org.apache.fineract.cn.test.fixture.mariadb.MariaDBInitializer;
+import org.apache.fineract.cn.test.fixture.postgresql.PostgreSQLInitializer;
 import org.junit.ClassRule;
 import org.junit.rules.RuleChain;
 import org.junit.rules.RunExternalResourceOnce;
@@ -34,11 +34,11 @@ public class SuiteTestEnvironment {
   static final String APP_NAME = "cheques-v1";
   static final TestEnvironment testEnvironment = new TestEnvironment(APP_NAME);
   static final CassandraInitializer cassandraInitializer = new CassandraInitializer();
-  static final MariaDBInitializer mariaDBInitializer = new MariaDBInitializer();
+  static final PostgreSQLInitializer postgreSQLInitializer = new PostgreSQLInitializer();
 
   @ClassRule
   public static TestRule orderClassRules = RuleChain
       .outerRule(new RunExternalResourceOnce(testEnvironment))
       .around(new RunExternalResourceOnce(cassandraInitializer))
-      .around(new RunExternalResourceOnce(mariaDBInitializer));
+      .around(new RunExternalResourceOnce(postgreSQLInitializer));
 }
diff --git a/service/build.gradle b/service/build.gradle
index 01bcfea..cc63a59 100644
--- a/service/build.gradle
+++ b/service/build.gradle
@@ -58,7 +58,7 @@ dependencies {
             [group: 'org.apache.fineract.cn', name: 'lang', version: versions.frameworklang],
             [group: 'org.apache.fineract.cn', name: 'async', version: versions.frameworkasync],
             [group: 'org.apache.fineract.cn', name: 'cassandra', version: versions.frameworkcassandra],
-            [group: 'org.apache.fineract.cn', name: 'mariadb', version: versions.frameworkmariadb],
+            [group: 'org.apache.fineract.cn', name: 'postgresql', version: versions.frameworkpostgresql],
             [group: 'org.apache.fineract.cn', name: 'command', version: versions.frameworkcommand],
             [group: 'org.hibernate', name: 'hibernate-validator', version: versions.validator],
             [group: 'org.threeten', name: 'threeten-extra', version: '1.2']
diff --git a/service/src/main/java/org/apache/fineract/cn/cheque/service/ChequeConfiguration.java b/service/src/main/java/org/apache/fineract/cn/cheque/service/ChequeConfiguration.java
index 610f37c..c1bf239 100644
--- a/service/src/main/java/org/apache/fineract/cn/cheque/service/ChequeConfiguration.java
+++ b/service/src/main/java/org/apache/fineract/cn/cheque/service/ChequeConfiguration.java
@@ -27,7 +27,7 @@ import org.apache.fineract.cn.customer.api.v1.client.CustomerManager;
 import org.apache.fineract.cn.deposit.api.v1.client.DepositAccountManager;
 import org.apache.fineract.cn.lang.config.EnableServiceException;
 import org.apache.fineract.cn.lang.config.EnableTenantContext;
-import org.apache.fineract.cn.mariadb.config.EnableMariaDB;
+import org.apache.fineract.cn.postgresql.config.EnablePostgreSQL;
 import org.apache.fineract.cn.office.api.v1.client.OrganizationManager;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -48,7 +48,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
 @EnableAsync
 @EnableTenantContext
 @EnableCassandra
-@EnableMariaDB
+@EnablePostgreSQL
 @EnableCommandProcessing
 @EnableAnubis
 @EnableServiceException
diff --git a/service/src/main/java/org/apache/fineract/cn/cheque/service/internal/command/handler/ManagementAggregate.java b/service/src/main/java/org/apache/fineract/cn/cheque/service/internal/command/handler/ManagementAggregate.java
index e541246..777b281 100644
--- a/service/src/main/java/org/apache/fineract/cn/cheque/service/internal/command/handler/ManagementAggregate.java
+++ b/service/src/main/java/org/apache/fineract/cn/cheque/service/internal/command/handler/ManagementAggregate.java
@@ -26,7 +26,7 @@ import org.apache.fineract.cn.command.annotation.Aggregate;
 import org.apache.fineract.cn.command.annotation.CommandHandler;
 import org.apache.fineract.cn.command.annotation.EventEmitter;
 import org.apache.fineract.cn.lang.ApplicationName;
-import org.apache.fineract.cn.mariadb.domain.FlywayFactoryBean;
+import org.apache.fineract.cn.postgresql.domain.FlywayFactoryBean;
 import org.slf4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
diff --git a/service/src/main/java/org/apache/fineract/cn/cheque/service/internal/repository/ChequeEntity.java b/service/src/main/java/org/apache/fineract/cn/cheque/service/internal/repository/ChequeEntity.java
index 4b0f248..40298a4 100644
--- a/service/src/main/java/org/apache/fineract/cn/cheque/service/internal/repository/ChequeEntity.java
+++ b/service/src/main/java/org/apache/fineract/cn/cheque/service/internal/repository/ChequeEntity.java
@@ -27,7 +27,7 @@ import javax.persistence.GeneratedValue;
 import javax.persistence.GenerationType;
 import javax.persistence.Id;
 import javax.persistence.Table;
-import org.apache.fineract.cn.mariadb.util.LocalDateTimeConverter;
+import org.apache.fineract.cn.postgresql.util.LocalDateTimeConverter;
 
 @Entity
 @Table(name = "sopdet_cheques")
diff --git a/service/src/main/java/org/apache/fineract/cn/cheque/service/internal/repository/IssuedChequeEntity.java b/service/src/main/java/org/apache/fineract/cn/cheque/service/internal/repository/IssuedChequeEntity.java
index 77c2781..ee3eedf 100644
--- a/service/src/main/java/org/apache/fineract/cn/cheque/service/internal/repository/IssuedChequeEntity.java
+++ b/service/src/main/java/org/apache/fineract/cn/cheque/service/internal/repository/IssuedChequeEntity.java
@@ -26,7 +26,7 @@ import javax.persistence.GeneratedValue;
 import javax.persistence.GenerationType;
 import javax.persistence.Id;
 import javax.persistence.Table;
-import org.apache.fineract.cn.mariadb.util.LocalDateTimeConverter;
+import org.apache.fineract.cn.postgresql.util.LocalDateTimeConverter;
 
 @Entity
 @Table(name = "sopdet_issued_cheques")
diff --git a/service/src/main/resources/application.yml b/service/src/main/resources/application.yml
index af184b4..3c3d6ef 100644
--- a/service/src/main/resources/application.yml
+++ b/service/src/main/resources/application.yml
@@ -23,6 +23,11 @@ spring:
       enabled: false
     config:
       enabled: false
+  datasource:
+    driver-class-name: org.postgresql.Driver
+    url: jdbc:postgresql://localhost:5432/playground
+    username: postgres
+    password: postgres
 
 eureka:
   client:
@@ -42,13 +47,13 @@ cassandra:
     write: LOCAL_QUORUM
     delete: LOCAL_QUORUM
 
-mariadb:
-  driverClass: org.mariadb.jdbc.Driver
+postgresql:
+  driverClass: org.postgresql.Driver
   database: seshat
   host: localhost
-  port: 3306
-  user: root
-  password: mysql
+  port: 5432
+  user: postgres
+  password: postgres
 
 bonecp:
   idleMaxAgeInMinutes: 240
diff --git a/service/src/main/resources/db/migrations/mariadb/V1__initial_setup.sql b/service/src/main/resources/db/migrations/postgresql/V1__initial_setup.sql
similarity index 92%
rename from service/src/main/resources/db/migrations/mariadb/V1__initial_setup.sql
rename to service/src/main/resources/db/migrations/postgresql/V1__initial_setup.sql
index e1e99ee..c65c84b 100644
--- a/service/src/main/resources/db/migrations/mariadb/V1__initial_setup.sql
+++ b/service/src/main/resources/db/migrations/postgresql/V1__initial_setup.sql
@@ -18,7 +18,7 @@
 --
 
 CREATE TABLE sopdet_issued_cheques (
-  id                         BIGINT         NOT NULL AUTO_INCREMENT,
+  id                         BIGSERIAL      NOT NULL,
   account_identifier         VARCHAR(34)    NOT NULL,
   last_issued_number         NUMERIC(8)     NOT NULL,
   created_on                 TIMESTAMP(3)   NOT NULL,
@@ -26,11 +26,10 @@ CREATE TABLE sopdet_issued_cheques (
   last_modified_on           TIMESTAMP(3)   NULL,
   last_modified_by           VARCHAR(32)    NULL,
   CONSTRAINT sopdet_issued_cheques_pk PRIMARY KEY (id),
-  CONSTRAINT sopdet_issued_cheques_uq UNIQUE (account_identifier)
-);
+  CONSTRAINT sopdet_issued_cheques_uq UNIQUE (account_identifier) );
 
 CREATE TABLE sopdet_cheques (
-  id                         BIGINT         NOT NULL AUTO_INCREMENT,
+  id                         BIGSERIAL      NOT NULL,
   cheque_number              VARCHAR(8)     NOT NULL,
   branch_sort_code           VARCHAR(11)    NOT NULL,
   account_number             VARCHAR(34)    NOT NULL,
@@ -47,5 +46,4 @@ CREATE TABLE sopdet_cheques (
   last_modified_on           TIMESTAMP(3)   NULL,
   last_modified_by           VARCHAR(32)    NULL,
   CONSTRAINT sopdet_cheques_pk PRIMARY KEY (id),
-  CONSTRAINT sopdet_cheques_uq UNIQUE (cheque_number, branch_sort_code, account_number)
-);
+  CONSTRAINT sopdet_cheques_uq UNIQUE (cheque_number, branch_sort_code, account_number) );
diff --git a/shared.gradle b/shared.gradle
index 46edf30..459e4ba 100644
--- a/shared.gradle
+++ b/shared.gradle
@@ -19,19 +19,19 @@ group 'org.apache.fineract.cn.cheques'
 version '0.1.0-BUILD-SNAPSHOT'
 
 ext.versions = [
-        frameworkapi       : '0.1.0-BUILD-SNAPSHOT',
-        frameworklang      : '0.1.0-BUILD-SNAPSHOT',
-        frameworkasync     : '0.1.0-BUILD-SNAPSHOT',
-        frameworkcassandra : '0.1.0-BUILD-SNAPSHOT',
-        frameworkmariadb   : '0.1.0-BUILD-SNAPSHOT',
-        frameworkcommand   : '0.1.0-BUILD-SNAPSHOT',
-        frameworktest      : '0.1.0-BUILD-SNAPSHOT',
-        frameworkanubis    : '0.1.0-BUILD-SNAPSHOT',
-        frameworkoffice    : '0.1.0-BUILD-SNAPSHOT',
-        frameworkaccounting: '0.1.0-BUILD-SNAPSHOT',
-        frameworkdeposit   : '0.1.0-BUILD-SNAPSHOT',
-        frameworkcustomer  : '0.1.0-BUILD-SNAPSHOT',
-        validator          : '5.3.0.Final'
+        frameworkapi        : '0.1.0-BUILD-SNAPSHOT',
+        frameworklang       : '0.1.0-BUILD-SNAPSHOT',
+        frameworkasync      : '0.1.0-BUILD-SNAPSHOT',
+        frameworkcassandra  : '0.1.0-BUILD-SNAPSHOT',
+        frameworkpostgresql : '0.1.0-BUILD-SNAPSHOT',
+        frameworkcommand    : '0.1.0-BUILD-SNAPSHOT',
+        frameworktest       : '0.1.0-BUILD-SNAPSHOT',
+        frameworkanubis     : '0.1.0-BUILD-SNAPSHOT',
+        frameworkoffice     : '0.1.0-BUILD-SNAPSHOT',
+        frameworkaccounting : '0.1.0-BUILD-SNAPSHOT',
+        frameworkdeposit    : '0.1.0-BUILD-SNAPSHOT',
+        frameworkcustomer   : '0.1.0-BUILD-SNAPSHOT',
+        validator           : '5.3.0.Final'
 ]
 
 apply plugin: 'java'
@@ -68,7 +68,8 @@ dependencies {
     )
 
     testCompile(
-            [group: 'org.springframework.boot', name: 'spring-boot-starter-test']
+            [group: 'org.springframework.boot', name: 'spring-boot-starter-test'],
+            [group: 'org.apache.fineract.cn', name: 'postgresql', version: versions.frameworkpostgresql]
     )
 }
 


[fineract-cn-cheques] 13/44: added cheques receivable account handling

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juhan pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-cheques.git

commit 9a4c9708a7de3ebd173aa79bde577be2451a5884
Author: mgeiss <mg...@mifos.org>
AuthorDate: Thu Sep 7 11:24:05 2017 +0200

    added cheques receivable account handling
---
 .../mifos/cheque/api/v1/domain/ChequeTransaction.java  | 13 ++++++++++++-
 .../src/main/java/io/mifos/cheque/TestCheques.java     |  3 +++
 .../src/main/java/io/mifos/cheque/TestMICR.java        |  1 +
 .../internal/command/ChequeTransactionCommand.java     | 18 +++++++++++++-----
 .../internal/command/handler/ChequeAggregate.java      |  6 ++----
 .../service/rest/ChequeTransactionRestController.java  |  2 +-
 6 files changed, 32 insertions(+), 11 deletions(-)

diff --git a/api/src/main/java/io/mifos/cheque/api/v1/domain/ChequeTransaction.java b/api/src/main/java/io/mifos/cheque/api/v1/domain/ChequeTransaction.java
index bcdc5e0..43507bb 100644
--- a/api/src/main/java/io/mifos/cheque/api/v1/domain/ChequeTransaction.java
+++ b/api/src/main/java/io/mifos/cheque/api/v1/domain/ChequeTransaction.java
@@ -15,6 +15,7 @@
  */
 package io.mifos.cheque.api.v1.domain;
 
+import io.mifos.core.lang.validation.constraints.ValidIdentifier;
 import org.hibernate.validator.constraints.NotEmpty;
 
 import javax.validation.Valid;
@@ -25,7 +26,9 @@ public class ChequeTransaction {
   @NotNull
   @Valid
   private Cheque cheque;
-  @NotEmpty
+  @ValidIdentifier(maxLength = 34)
+  private String chequesReceivableAccount;
+  @ValidIdentifier(maxLength = 34)
   private String creditorAccountNumber;
 
   public ChequeTransaction() {
@@ -40,6 +43,14 @@ public class ChequeTransaction {
     this.cheque = cheque;
   }
 
+  public String getChequesReceivableAccount() {
+    return this.chequesReceivableAccount;
+  }
+
+  public void setChequesReceivableAccount(final String chequesReceivableAccount) {
+    this.chequesReceivableAccount = chequesReceivableAccount;
+  }
+
   public String getCreditorAccountNumber() {
     return this.creditorAccountNumber;
   }
diff --git a/component-test/src/main/java/io/mifos/cheque/TestCheques.java b/component-test/src/main/java/io/mifos/cheque/TestCheques.java
index 5ed5c14..22cd88e 100644
--- a/component-test/src/main/java/io/mifos/cheque/TestCheques.java
+++ b/component-test/src/main/java/io/mifos/cheque/TestCheques.java
@@ -83,6 +83,7 @@ public class TestCheques extends AbstractChequeTest {
 
     final ChequeTransaction chequeTransaction = new ChequeTransaction();
     chequeTransaction.setCheque(randomCheque);
+    chequeTransaction.setChequesReceivableAccount(RandomStringUtils.randomAlphabetic(34));
     chequeTransaction.setCreditorAccountNumber(RandomStringUtils.randomAlphanumeric(34));
     super.chequeManager.process(chequeTransaction);
 
@@ -114,6 +115,7 @@ public class TestCheques extends AbstractChequeTest {
 
     final ChequeTransaction chequeTransaction = new ChequeTransaction();
     chequeTransaction.setCheque(randomCheque);
+    chequeTransaction.setChequesReceivableAccount(RandomStringUtils.randomAlphabetic(34));
     chequeTransaction.setCreditorAccountNumber(RandomStringUtils.randomAlphanumeric(34));
     super.chequeManager.process(chequeTransaction);
 
@@ -158,6 +160,7 @@ public class TestCheques extends AbstractChequeTest {
 
 
     final ChequeTransaction chequeTransaction = new ChequeTransaction();
+    chequeTransaction.setChequesReceivableAccount(RandomStringUtils.randomAlphabetic(34));
     chequeTransaction.setCheque(randomCheque);
     chequeTransaction.setCreditorAccountNumber(RandomStringUtils.randomAlphanumeric(34));
     super.chequeManager.process(chequeTransaction);
diff --git a/component-test/src/main/java/io/mifos/cheque/TestMICR.java b/component-test/src/main/java/io/mifos/cheque/TestMICR.java
index cc50bae..197c235 100644
--- a/component-test/src/main/java/io/mifos/cheque/TestMICR.java
+++ b/component-test/src/main/java/io/mifos/cheque/TestMICR.java
@@ -153,6 +153,7 @@ public class TestMICR extends AbstractChequeTest {
     final ChequeTransaction chequeTransaction = new ChequeTransaction();
     chequeTransaction.setCheque(randomCheque);
     chequeTransaction.setCreditorAccountNumber(RandomStringUtils.randomAlphanumeric(34));
+    chequeTransaction.setChequesReceivableAccount(RandomStringUtils.randomAlphanumeric(34));
     super.chequeManager.process(chequeTransaction);
 
     Assert.assertTrue(
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/command/ChequeTransactionCommand.java b/service/src/main/java/io/mifos/cheque/service/internal/command/ChequeTransactionCommand.java
index 81c46e6..21a5ab3 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/command/ChequeTransactionCommand.java
+++ b/service/src/main/java/io/mifos/cheque/service/internal/command/ChequeTransactionCommand.java
@@ -19,19 +19,27 @@ import io.mifos.cheque.api.v1.domain.Cheque;
 
 public class ChequeTransactionCommand {
   private final Cheque cheque;
-  private final String creditorAccountNumber;
+  private final String chequesReceivableAccount;
+  private final String creditorAccount;
 
-  public ChequeTransactionCommand(final Cheque cheque, final String creditorAccountNumber) {
+  public ChequeTransactionCommand(final Cheque cheque,
+                                  final String chequesReceivableAccount,
+                                  final String creditorAccount) {
     super();
     this.cheque = cheque;
-    this.creditorAccountNumber = creditorAccountNumber;
+    this.chequesReceivableAccount = chequesReceivableAccount;
+    this.creditorAccount = creditorAccount;
   }
 
   public Cheque cheque() {
     return this.cheque;
   }
 
-  public String creditorAccountNumber() {
-    return this.creditorAccountNumber;
+  public String chequesReceivableAccount() {
+    return this.chequesReceivableAccount;
+  }
+
+  public String creditorAccount() {
+    return this.creditorAccount;
   }
 }
diff --git a/service/src/main/java/io/mifos/cheque/service/internal/command/handler/ChequeAggregate.java b/service/src/main/java/io/mifos/cheque/service/internal/command/handler/ChequeAggregate.java
index 3fa49d8..a3b1762 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/command/handler/ChequeAggregate.java
+++ b/service/src/main/java/io/mifos/cheque/service/internal/command/handler/ChequeAggregate.java
@@ -162,16 +162,14 @@ public class ChequeAggregate {
       debtor.setAccountNumber(micr.getAccountNumber());
       chequeEntity.setState(State.PROCESSED.name());
     } else {
-      debtor.setAccountNumber(
-          this.depositService.getCashAccountForProduct(chequeTransactionCommand.creditorAccountNumber())
-      );
+      debtor.setAccountNumber(chequeTransactionCommand.chequesReceivableAccount());
       chequeEntity.setState(State.PENDING.name());
     }
     journalEntry.setDebtors(Sets.newHashSet(debtor));
 
     final Creditor creditor = new Creditor();
     creditor.setAmount(chequeEntity.getAmount().toString());
-    creditor.setAccountNumber(chequeTransactionCommand.creditorAccountNumber());
+    creditor.setAccountNumber(chequeTransactionCommand.creditorAccount());
     journalEntry.setCreditors(Sets.newHashSet(creditor));
 
     this.accountingService.processJournalEntry(journalEntry);
diff --git a/service/src/main/java/io/mifos/cheque/service/rest/ChequeTransactionRestController.java b/service/src/main/java/io/mifos/cheque/service/rest/ChequeTransactionRestController.java
index b07d957..2d0018c 100644
--- a/service/src/main/java/io/mifos/cheque/service/rest/ChequeTransactionRestController.java
+++ b/service/src/main/java/io/mifos/cheque/service/rest/ChequeTransactionRestController.java
@@ -74,7 +74,7 @@ public class ChequeTransactionRestController {
           MICRParser.toIdentifier(chequeTransaction.getCheque().getMicr()));
     }
 
-    this.commandGateway.process(new ChequeTransactionCommand(cheque, chequeTransaction.getCreditorAccountNumber()));
+    this.commandGateway.process(new ChequeTransactionCommand(cheque, chequeTransaction.getChequesReceivableAccount(),  chequeTransaction.getCreditorAccountNumber()));
 
     return ResponseEntity.accepted().build();
   }


[fineract-cn-cheques] 39/44: add app-specific startup banner, point to wiki, add docker hub build shield

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juhan pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-cheques.git

commit ed3c0b876d697a627359460d6c4d75882ef58d71
Author: Juhan Aasaru <Ju...@nortal.com>
AuthorDate: Fri Oct 4 13:41:26 2019 +0300

    add app-specific startup banner, point to wiki, add docker hub build shield
---
 README.md                             |  3 ++-
 service/src/main/resources/banner.txt | 11 +++++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index fe88e9b..f96b3c0 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,7 @@
-# Apache Fineract CN Cheques Management [![Build Status](https://api.travis-ci.com/apache/fineract-cn-cheques.svg?branch=develop)](https://travis-ci.com/apache/fineract-cn-cheques)
+# Apache Fineract CN Cheques Management [![Build Status](https://api.travis-ci.com/apache/fineract-cn-cheques.svg?branch=develop)](https://travis-ci.com/apache/fineract-cn-cheques) [![Docker Cloud Build Status](https://img.shields.io/docker/cloud/build/apache/fineract-cn-cheques)](https://hub.docker.com/r/apache/fineract-cn-cheques/builds)
 
 This project provides services to issue, validate cheques and execute transactions on them.
+[Read more](https://cwiki.apache.org/confluence/display/FINERACT/Fineract+CN+Project+Structure#FineractCNProjectStructure-cheques).
 
 ## Abstract
 Apache Fineract CN is an application framework for digital financial services, a system to support nationwide and cross-national financial transactions and help to level and speed the creation of an inclusive, interconnected digital economy for every nation in the world.
diff --git a/service/src/main/resources/banner.txt b/service/src/main/resources/banner.txt
new file mode 100644
index 0000000..bdfcfa6
--- /dev/null
+++ b/service/src/main/resources/banner.txt
@@ -0,0 +1,11 @@
+  _____ _                           _         ____ _   _
+ |  ___(_)_ __   ___ _ __ __ _  ___| |_      / ___| \ | |
+ | |_  | | '_ \ / _ \ '__/ _` |/ __| __|____| |   |  \| |
+ |  _| | | | | |  __/ | | (_| | (__| ||_____| |___| |\  |
+ |_|   |_|_| |_|\___|_|  \__,_|\___|\__|     \____|_| \_|
+   ____ _
+  / ___| |__   ___  __ _ _   _  ___  ___
+ | |   | '_ \ / _ \/ _` | | | |/ _ \/ __|
+ | |___| | | |  __/ (_| | |_| |  __/\__ \
+  \____|_| |_|\___|\__, |\__,_|\___||___/
+                      |_|


[fineract-cn-cheques] 35/44: Merge pull request #7 from ebenezergraham/FINCN-157

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juhan pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-cheques.git

commit 81015a553280e4a605787aa5337c685cb6d93964
Merge: 5659d21 af012d5
Author: Awasum Yannick <aw...@apache.org>
AuthorDate: Mon Jun 3 20:54:44 2019 +0100

    Merge pull request #7 from ebenezergraham/FINCN-157
    
    Adding rat report to After Failure procedure

 .travis.yml   | 3 +++
 shared.gradle | 1 +
 2 files changed, 4 insertions(+)


[fineract-cn-cheques] 05/44: Change package to io.mifos Change description in README

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juhan pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-cheques.git

commit 8b05cb81f79abab70d9581fdb9dd74581144c0a7
Author: Mark <ma...@gmail.com>
AuthorDate: Fri Aug 25 17:02:29 2017 +0200

    Change package to io.mifos
    Change description in README
---
 README.md     | 4 ++--
 shared.gradle | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/README.md b/README.md
index 8ac2e2b..09d4485 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,8 @@
-# Mifos I/O Deposit Account Management
+# Mifos I/O Cheques Management
 
 [![Join the chat at https://gitter.im/mifos-initiative/mifos.io](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/mifos-initiative/mifos.io?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
 
-This project provides a services to create deposit accounts, e.g. checking, savings, and shares.
+This project provides services to issue, validate cheques and execute transactions on them.
 
 ## Abstract
 Mifos I/O is an application framework for digital financial services, a system to support nationwide and cross-national financial transactions and help to level and speed the creation of an inclusive, interconnected digital economy for every nation in the world.
diff --git a/shared.gradle b/shared.gradle
index bddedf5..e9c3ef2 100644
--- a/shared.gradle
+++ b/shared.gradle
@@ -1,4 +1,4 @@
-group 'io.kuelap.cheques'
+group 'io.mifos.cheques'
 version '0.1.0-BUILD-SNAPSHOT'
 
 ext.versions = [


[fineract-cn-cheques] 44/44: Merge pull request #10 from aasaru/FINCN-180

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juhan pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-cheques.git

commit 906131c94eafb6c36c6eb6e4756400292c550574
Merge: c9d2107 6813e10
Author: aasaru <aa...@gmail.com>
AuthorDate: Thu Oct 17 10:33:51 2019 +0300

    Merge pull request #10 from aasaru/FINCN-180
    
    FINCN-180 remove tenant-specific data source from configuration

 service/src/main/resources/application.yml | 7 ++-----
 shared.gradle                              | 2 +-
 2 files changed, 3 insertions(+), 6 deletions(-)


[fineract-cn-cheques] 08/44: Merge pull request #3 from markvanveen/develop

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juhan pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-cheques.git

commit c131c372c61c431c9558df5dea9ce621b3695c50
Merge: e9da660 9eea583
Author: Mark van Veen <30...@users.noreply.github.com>
AuthorDate: Mon Aug 28 21:31:47 2017 +0200

    Merge pull request #3 from markvanveen/develop
    
    Add missing permittable group

 .../main/java/io/mifos/cheque/service/rest/MIRCRestController.java    | 4 ++++
 1 file changed, 4 insertions(+)


[fineract-cn-cheques] 23/44: Removed unused year and name variables

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juhan pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-cheques.git

commit dd42981a86c370606caedd7d664de1616d98dcfc
Author: Isaac Kamga <u2...@gmail.com>
AuthorDate: Mon Mar 5 21:15:16 2018 +0100

    Removed unused year and name variables
---
 shared.gradle | 2 --
 1 file changed, 2 deletions(-)

diff --git a/shared.gradle b/shared.gradle
index 5f94e92..e63cc75 100644
--- a/shared.gradle
+++ b/shared.gradle
@@ -69,6 +69,4 @@ license {
         yml = 'SCRIPT_STYLE'
         yaml = 'SCRIPT_STYLE'
     }
-    ext.year = Calendar.getInstance().get(Calendar.YEAR)
-    ext.company = 'The Apache Software Foundation'
 }


[fineract-cn-cheques] 07/44: Add missing permittable group

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juhan pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-cheques.git

commit 9eea58334ed69e7cca6b0df145a30fe33dfa7626
Author: Mark <ma...@gmail.com>
AuthorDate: Mon Aug 28 20:59:06 2017 +0200

    Add missing permittable group
---
 .../main/java/io/mifos/cheque/service/rest/MIRCRestController.java    | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/service/src/main/java/io/mifos/cheque/service/rest/MIRCRestController.java b/service/src/main/java/io/mifos/cheque/service/rest/MIRCRestController.java
index 8b56e73..4a3a15e 100644
--- a/service/src/main/java/io/mifos/cheque/service/rest/MIRCRestController.java
+++ b/service/src/main/java/io/mifos/cheque/service/rest/MIRCRestController.java
@@ -15,6 +15,9 @@
  */
 package io.mifos.cheque.service.rest;
 
+import io.mifos.anubis.annotation.AcceptedTokenType;
+import io.mifos.anubis.annotation.Permittable;
+import io.mifos.cheque.api.v1.PermittableGroupIds;
 import io.mifos.cheque.api.v1.domain.MICRResolution;
 import io.mifos.cheque.service.ServiceConstants;
 import io.mifos.cheque.service.internal.format.MICRParser;
@@ -45,6 +48,7 @@ public class MIRCRestController {
     this.micrService = micrService;
   }
 
+  @Permittable(value = AcceptedTokenType.TENANT, groupId = PermittableGroupIds.CHEQUE_TRANSACTION)
   @RequestMapping(
       value = "/{identifier}",
       method = RequestMethod.GET,