From 49c3450bedc3bd828d7949f3fc4d9cc4b723db26 Mon Sep 17 00:00:00 2001 From: Manthan Surkar <42006277+thesmallstar@users.noreply.github.com> Date: Tue, 3 Mar 2020 01:27:35 +0530 Subject: [PATCH 01/37] FINERACT-80: Include Group loans in resultset (#717) --- .../loanaccount/service/LoanReadPlatformServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanReadPlatformServiceImpl.java index c3758930480..c1eadc7e87f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanReadPlatformServiceImpl.java @@ -292,7 +292,7 @@ public Page retrieveAll(final SearchParameters searchParameters // to support senario where loan has group_id only OR client_id will // probably require a UNION query // but that at present is an edge case - sqlBuilder.append(" join m_office o on o.id = c.office_id"); + sqlBuilder.append(" join m_office o on (o.id = c.office_id or o.id = g.office_id) "); sqlBuilder.append(" left join m_office transferToOffice on transferToOffice.id = c.transfer_to_office_id "); sqlBuilder.append(" where ( o.hierarchy like ? or transferToOffice.hierarchy like ?)"); From 867579d3214bb547a5e59059ce52ad244b8ef305 Mon Sep 17 00:00:00 2001 From: Manthan Surkar <42006277+thesmallstar@users.noreply.github.com> Date: Tue, 3 Mar 2020 01:31:01 +0530 Subject: [PATCH 02/37] FINERACT-557: Readme Improvement (#718) --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 54da6c09405..b947916459e 100644 --- a/README.md +++ b/README.md @@ -159,6 +159,7 @@ Please refer to for technical details to get started. +Please visit to open or find issues. Roadmap ============ From d4002f22a855f58f924901c58b7f1a2f7f6252fc Mon Sep 17 00:00:00 2001 From: Awasum Yannick Date: Thu, 5 Mar 2020 09:40:13 +0100 Subject: [PATCH 03/37] FINERACT-802-restrict-client-to-have-single-self-service-user (#664) --- .../UserAdministrationTest.java | 23 +++++++++++++++++++ .../useradministration/users/UserHelper.java | 12 ++++++++++ ...WritePlatformServiceJpaRepositoryImpl.java | 4 ++++ ...4__self_service_user_unique_for_client.sql | 20 ++++++++++++++++ 4 files changed, 59 insertions(+) create mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V354__self_service_user_unique_for_client.sql diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/UserAdministrationTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/UserAdministrationTest.java index ef899dec097..715dc159631 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/UserAdministrationTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/UserAdministrationTest.java @@ -27,6 +27,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; +import org.apache.fineract.integrationtests.common.ClientHelper; import org.apache.fineract.integrationtests.common.Utils; import org.apache.fineract.integrationtests.common.organisation.StaffHelper; import org.apache.fineract.integrationtests.useradministration.roles.RolesHelper; @@ -36,6 +37,7 @@ import org.junit.Before; import org.junit.Test; + public class UserAdministrationTest { private ResponseSpecification responseSpec; @@ -64,6 +66,7 @@ public void tearDown() { @Test public void testCreateNewUserBlocksDuplicateUsername() { + final Integer roleId = RolesHelper.createRole(this.requestSpec, this.responseSpec); Assert.assertNotNull(roleId); @@ -122,5 +125,25 @@ public void testUpdateUserBlockDuplicateUsername() { Assert.assertEquals("User with username alphabet already exists.", reason.get("defaultUserMessage")); Assert.assertEquals("error.msg.user.duplicate.username", reason.get("userMessageGlobalisationCode")); } + @Test + public void testCreateNewUserBlocksDuplicateClientId() { + final Integer roleId = RolesHelper.createRole(this.requestSpec, this.responseSpec); + Assert.assertNotNull(roleId); + + final Integer staffId = StaffHelper.createStaff(this.requestSpec, this.responseSpec); + Assert.assertNotNull(staffId); + + final Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec); + Assert.assertNotNull(clientId); + + final Integer userId = (Integer) UserHelper.createUserForSelfService(this.requestSpec, this.responseSpec, roleId, staffId, clientId, "resourceId"); + Assert.assertNotNull(userId); + this.transientUsers.add(userId); + + final List errors = (List) UserHelper.createUserForSelfService(this.requestSpec, expectStatusCode(403), roleId, staffId, clientId, "errors"); + Map reason = (Map) errors.get(0); + + Assert.assertEquals("Self Service User Id is already created. Go to Admin->Users to edit or delete the self-service user.", reason.get("defaultUserMessage")); + } } diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/useradministration/users/UserHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/useradministration/users/UserHelper.java index 2dc586c615d..3550434c32c 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/useradministration/users/UserHelper.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/useradministration/users/UserHelper.java @@ -34,6 +34,9 @@ public static Integer createUser(final RequestSpecification requestSpec, final R public static Object createUser(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, int roleId, int staffId, String username, String attribute) { return Utils.performServerPost(requestSpec, responseSpec, CREATE_USER_URL, getTestCreateUserAsJSON(roleId, staffId, username), attribute); } + public static Object createUserForSelfService(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, int roleId, int staffId, int clientId, String attribute) { + return Utils.performServerPost(requestSpec, responseSpec, CREATE_USER_URL, getTestCreateUserAsJSONForSelfService(roleId, staffId, clientId), attribute); + } public static String getTestCreateUserAsJSON(int roleId, int staffId) { return "{ \"username\": \"" + Utils.randomNameGenerator("User_Name_", 3) @@ -56,6 +59,15 @@ private static String getTestUpdateUserAsJSON(String username) { + "\", \"firstname\": \"Test\", \"lastname\": \"User\", \"email\": \"whatever@mifos.org\"," + " \"officeId\": \"1\"}"; } + public static String getTestCreateUserAsJSONForSelfService(int roleId, int staffId, int clientId) { + return "{ \"username\": \"" + Utils.randomNameGenerator("User_Name_", 3) + + "\", \"firstname\": \"Test\", \"lastname\": \"User\", \"email\": \"whatever@mifos.org\"," + + " \"officeId\": \"1\", \"staffId\": " + "\"" + + staffId +"\",\"roles\": [\"" + + roleId + "\"], \"sendPasswordToEmail\": false," + +"\"isSelfServiceUser\" : true," + +"\"clients\" : [\""+clientId+"\"]}"; + } public static Integer deleteUser(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final Integer userId) { return Utils.performServerDelete(requestSpec, responseSpec, createRoleOperationURL(userId), "resourceId"); diff --git a/fineract-provider/src/main/java/org/apache/fineract/useradministration/service/AppUserWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/useradministration/service/AppUserWritePlatformServiceJpaRepositoryImpl.java index 88d0310386e..d6a0ef7c498 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/useradministration/service/AppUserWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/useradministration/service/AppUserWritePlatformServiceJpaRepositoryImpl.java @@ -347,6 +347,10 @@ private void handleDataIntegrityIssues(final JsonCommand command, final Throwabl username); } + if (realCause.getMessage().contains("'unique_self_client'")) { + throw new PlatformDataIntegrityException("error.msg.user.self.service.user.already.exist", "Self Service User Id is already created. Go to Admin->Users to edit or delete the self-service user."); + } + logger.error(dve.getMessage(), dve); throw new PlatformDataIntegrityException("error.msg.unknown.data.integrity.issue", "Unknown data integrity issue with resource."); } diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V354__self_service_user_unique_for_client.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V354__self_service_user_unique_for_client.sql new file mode 100644 index 00000000000..afb06d8b3e4 --- /dev/null +++ b/fineract-provider/src/main/resources/sql/migrations/core_db/V354__self_service_user_unique_for_client.sql @@ -0,0 +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. +-- + +ALTER TABLE `m_selfservice_user_client_mapping` ADD CONSTRAINT `unique_self_client` UNIQUE (`client_id`); \ No newline at end of file From 51f23613ad9dbeb716baa6676173db0a744ed3eb Mon Sep 17 00:00:00 2001 From: Awasum Yannick Date: Thu, 5 Mar 2020 12:02:39 +0100 Subject: [PATCH 04/37] Fix checkstyle problem in UserAdministrationTest --- .../apache/fineract/integrationtests/UserAdministrationTest.java | 1 - 1 file changed, 1 deletion(-) diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/UserAdministrationTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/UserAdministrationTest.java index 715dc159631..5932afa802b 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/UserAdministrationTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/UserAdministrationTest.java @@ -142,7 +142,6 @@ public void testCreateNewUserBlocksDuplicateClientId() { final List errors = (List) UserHelper.createUserForSelfService(this.requestSpec, expectStatusCode(403), roleId, staffId, clientId, "errors"); Map reason = (Map) errors.get(0); - Assert.assertEquals("Self Service User Id is already created. Go to Admin->Users to edit or delete the self-service user.", reason.get("defaultUserMessage")); } From a7ebef478129516c6aa6d437fc2ec15268ab4776 Mon Sep 17 00:00:00 2001 From: xurror Date: Fri, 14 Feb 2020 08:54:22 -0500 Subject: [PATCH 05/37] FINERACT-807 change mifosplatform-tenants and mifostenant-default to fineract_tenants and fineract_default respectively closes https://issues.apache.org/jira/projects/FINERACT/issues/FINERACT-807?filter=allopenissues --- .gitpod.yml | 4 +- .travis.yml | 4 +- Dockerfile | 2 +- README.md | 8 +- docker-compose.yml | 2 +- docker/server.xml | 2 +- fineract-db/docker/01-databases.sql | 4 +- ...fospltaform-tenants-first-time-install.sql | 4 +- .../0001-mifos-platform-shared-tenants.sql | 4 +- .../bare-bones-demo/bk_bare_bones_demo.sql | 2 +- .../bk_mifostenant_default.sql | 2 +- .../default-demo/bk_mifostenant-default.sql | 2 +- .../latam-demo/bk_latam.sql | 2 +- fineract-provider/build.gradle | 4 +- .../core/boot/db/DataSourceProperties.java | 2 +- .../core/boot/db/MariaDB4jSetupService.java | 4 +- .../db/TenantDataSourcePortFixService.java | 10 +- .../main/resources/META-INF/spring/jndi.xml | 2 +- .../V1__mifos-platform-shared-tenants.sql | 4 +- .../migrations/sample_data/barebones_db.sql | 744 +++++++++--------- .../src/main/webapp/META-INF/context.xml | 2 +- .../src/test/resources/META-INF/context.xml | 4 +- 22 files changed, 409 insertions(+), 409 deletions(-) diff --git a/.gitpod.yml b/.gitpod.yml index 2dd49fa9912..ecff3c67869 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -37,6 +37,6 @@ tasks: # NB MySQL on GitPod.io is currently quite slow. # similar to .travis.yml, but using authentication_string= instead of password= due to mysql major version difference mysql -e "USE mysql;\nUPDATE user SET authentication_string=PASSWORD('mysql') WHERE user='root';\nFLUSH PRIVILEGES;\n" - ./gradlew createDB -PdbName=mifosplatform-tenants - ./gradlew createDB -PdbName=mifostenant-default + ./gradlew createDB -PdbName=fineract_tenants + ./gradlew createDB -PdbName=fineract_default ./gradlew build -x test diff --git a/.travis.yml b/.travis.yml index 3a0f0a10837..955add4a8f7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,8 +36,8 @@ addons: before_install: - echo "USE mysql;\nUPDATE user SET password=PASSWORD('mysql') WHERE user='root';\nFLUSH PRIVILEGES;\n" | mysql -u root - - mysql -u root -pmysql -e 'CREATE DATABASE IF NOT EXISTS `mifosplatform-tenants`;' - - mysql -u root -pmysql -e 'CREATE DATABASE IF NOT EXISTS `mifostenant-default`;' + - mysql -u root -pmysql -e 'CREATE DATABASE IF NOT EXISTS `fineract_tenants`;' + - mysql -u root -pmysql -e 'CREATE DATABASE IF NOT EXISTS `fineract_default`;' # Hardcoding the time zone is a temporary fix for https://issues.apache.org/jira/browse/FINERACT-723 - export TZ=Asia/Kolkata diff --git a/Dockerfile b/Dockerfile index 26a238ec9de..14de81c0c1e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -51,6 +51,6 @@ COPY ./docker/server.xml /opt/bitnami/tomcat/conf RUN chmod 664 /opt/bitnami/tomcat/conf/server.xml WORKDIR /opt/bitnami/tomcat/lib -# org.drizzle.jdbc.DrizzleDriver is used in docker/server.xml for jdbc/mifosplatform-tenants DataSource +# org.drizzle.jdbc.DrizzleDriver is used in docker/server.xml for jdbc/fineract_tenants DataSource # (But note that connections to individual tenant DBs may use another driver...) RUN wget https://repo1.maven.org/maven2/org/drizzle/jdbc/drizzle-jdbc/1.4/drizzle-jdbc-1.4.jar diff --git a/README.md b/README.md index b947916459e..d51ac20a702 100644 --- a/README.md +++ b/README.md @@ -36,8 +36,8 @@ Instructions how to run for local development ============ Run the following commands: -1. `./gradlew createDB -PdbName=mifosplatform-tenants` -1. `./gradlew createDB -PdbName=mifostenant-default` +1. `./gradlew createDB -PdbName=fineract_tenants` +1. `./gradlew createDB -PdbName=fineract_default` 1. `./gradlew tomcatRunWAR` @@ -71,8 +71,8 @@ Instructions to execute Integration tests > Note that if this is the first time to access MySQL DB, then you may need to reset your password. Run the following commands, very similarly to how [.travis.yml](.travis.yml) does: -1. `./gradlew createDB -PdbName=mifosplatform-tenants` -1. `./gradlew createDB -PdbName=mifostenant-default` +1. `./gradlew createDB -PdbName=fineract_tenants` +1. `./gradlew createDB -PdbName=fineract_default` 1. `./gradlew clean integrationTest` diff --git a/docker-compose.yml b/docker-compose.yml index 0e7ef2359f3..e74b99620fc 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -43,7 +43,7 @@ services: depends_on: - fineractmysql environment: - - JAVA_OPTS=-Dfineract_tenants_url=jdbc:mysql:thin://fineractmysql:3306/mifosplatform-tenants -Dfineract_tenants_driver=org.drizzle.jdbc.DrizzleDriver -Dfineract_tenants_uid=root -Dfineract_tenants_pwd=skdcnwauicn2ucnaecasdsajdnizucawencascdca -Djava.awt.headless=true -XX:+UseG1GC -Dfile.encoding=UTF-8 + - JAVA_OPTS=-Dfineract_tenants_url=jdbc:mysql:thin://fineractmysql:3306/fineract_tenants -Dfineract_tenants_driver=org.drizzle.jdbc.DrizzleDriver -Dfineract_tenants_uid=root -Dfineract_tenants_pwd=skdcnwauicn2ucnaecasdsajdnizucawencascdca -Djava.awt.headless=true -XX:+UseG1GC -Dfile.encoding=UTF-8 - FINERACT_DEFAULT_TENANTDB_HOSTNAME=fineractmysql - FINERACT_DEFAULT_TENANTDB_PORT=3306 - FINERACT_DEFAULT_TENANTDB_UID=root diff --git a/docker/server.xml b/docker/server.xml index 954609c3bbc..a509a661b34 100644 --- a/docker/server.xml +++ b/docker/server.xml @@ -39,7 +39,7 @@ UserDatabaseRealm to authenticate users --> - diff --git a/fineract-provider/src/main/resources/sql/migrations/list_db/V1__mifos-platform-shared-tenants.sql b/fineract-provider/src/main/resources/sql/migrations/list_db/V1__mifos-platform-shared-tenants.sql index 9c6adc4fdeb..d1256609469 100644 --- a/fineract-provider/src/main/resources/sql/migrations/list_db/V1__mifos-platform-shared-tenants.sql +++ b/fineract-provider/src/main/resources/sql/migrations/list_db/V1__mifos-platform-shared-tenants.sql @@ -19,7 +19,7 @@ -- MySQL dump 10.13 Distrib 5.1.60, for Win32 (ia32) -- --- Host: localhost Database: mifosplatform-tenants +-- Host: localhost Database: fineract_tenants -- ------------------------------------------------------ -- Server version 5.1.60-community @@ -66,7 +66,7 @@ CREATE TABLE `tenants` ( LOCK TABLES `tenants` WRITE; /*!40000 ALTER TABLE `tenants` DISABLE KEYS */; -INSERT INTO `tenants` VALUES (1,'default','Default Demo Tenant','mifostenant-default','Asia/Kolkata',NULL,NULL,NULL,NULL,'${fineract_default_tenantdb_hostname}','${fineract_default_tenantdb_port}','${fineract_default_tenantdb_uid}','${fineract_default_tenantdb_pwd}',1); +INSERT INTO `tenants` VALUES (1,'default','Default Demo Tenant','fineract_default','Asia/Kolkata',NULL,NULL,NULL,NULL,'${fineract_default_tenantdb_hostname}','${fineract_default_tenantdb_port}','${fineract_default_tenantdb_uid}','${fineract_default_tenantdb_pwd}',1); -- Add tenants to support interoperation multi-tenancy -- INSERT INTO `tenants` VALUES (2,'tn01','Buffalo','tn01','Africa/Bujumbura',NULL,NULL,NULL,NULL,'localhost','3306','root','mysql',1); -- INSERT INTO `tenants` VALUES (3,'tn02','Lion','tn02','Africa/Bujumbura',NULL,NULL,NULL,NULL,'localhost','3306','root','mysql',1); diff --git a/fineract-provider/src/main/resources/sql/migrations/sample_data/barebones_db.sql b/fineract-provider/src/main/resources/sql/migrations/sample_data/barebones_db.sql index 830e3df108e..c41b4001fbf 100644 --- a/fineract-provider/src/main/resources/sql/migrations/sample_data/barebones_db.sql +++ b/fineract-provider/src/main/resources/sql/migrations/sample_data/barebones_db.sql @@ -29,7 +29,7 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; --- Dumping structure for table mifostenant-default.acc_accounting_rule +-- Dumping structure for table fineract_default.acc_accounting_rule DROP TABLE IF EXISTS `acc_accounting_rule`; CREATE TABLE IF NOT EXISTS `acc_accounting_rule` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -51,12 +51,12 @@ CREATE TABLE IF NOT EXISTS `acc_accounting_rule` ( CONSTRAINT `FK_acc_accounting_rule_m_office` FOREIGN KEY (`office_id`) REFERENCES `m_office` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.acc_accounting_rule: ~0 rows (approximately) +-- Dumping data for table fineract_default.acc_accounting_rule: ~0 rows (approximately) /*!40000 ALTER TABLE `acc_accounting_rule` DISABLE KEYS */; /*!40000 ALTER TABLE `acc_accounting_rule` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.acc_gl_account +-- Dumping structure for table fineract_default.acc_gl_account DROP TABLE IF EXISTS `acc_gl_account`; CREATE TABLE IF NOT EXISTS `acc_gl_account` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -78,12 +78,12 @@ CREATE TABLE IF NOT EXISTS `acc_gl_account` ( CONSTRAINT `FK_ACC_0000000001` FOREIGN KEY (`parent_id`) REFERENCES `acc_gl_account` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.acc_gl_account: ~0 rows (approximately) +-- Dumping data for table fineract_default.acc_gl_account: ~0 rows (approximately) /*!40000 ALTER TABLE `acc_gl_account` DISABLE KEYS */; /*!40000 ALTER TABLE `acc_gl_account` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.acc_gl_closure +-- Dumping structure for table fineract_default.acc_gl_closure DROP TABLE IF EXISTS `acc_gl_closure`; CREATE TABLE IF NOT EXISTS `acc_gl_closure` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -105,12 +105,12 @@ CREATE TABLE IF NOT EXISTS `acc_gl_closure` ( CONSTRAINT `FK_acc_gl_closure_m_office` FOREIGN KEY (`office_id`) REFERENCES `m_office` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.acc_gl_closure: ~0 rows (approximately) +-- Dumping data for table fineract_default.acc_gl_closure: ~0 rows (approximately) /*!40000 ALTER TABLE `acc_gl_closure` DISABLE KEYS */; /*!40000 ALTER TABLE `acc_gl_closure` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.acc_gl_financial_activity_account +-- Dumping structure for table fineract_default.acc_gl_financial_activity_account DROP TABLE IF EXISTS `acc_gl_financial_activity_account`; CREATE TABLE IF NOT EXISTS `acc_gl_financial_activity_account` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -122,12 +122,12 @@ CREATE TABLE IF NOT EXISTS `acc_gl_financial_activity_account` ( CONSTRAINT `FK_office_mapping_acc_gl_account` FOREIGN KEY (`gl_account_id`) REFERENCES `acc_gl_account` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.acc_gl_financial_activity_account: ~0 rows (approximately) +-- Dumping data for table fineract_default.acc_gl_financial_activity_account: ~0 rows (approximately) /*!40000 ALTER TABLE `acc_gl_financial_activity_account` DISABLE KEYS */; /*!40000 ALTER TABLE `acc_gl_financial_activity_account` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.acc_gl_journal_entry +-- Dumping structure for table fineract_default.acc_gl_journal_entry DROP TABLE IF EXISTS `acc_gl_journal_entry`; CREATE TABLE IF NOT EXISTS `acc_gl_journal_entry` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -180,12 +180,12 @@ CREATE TABLE IF NOT EXISTS `acc_gl_journal_entry` ( CONSTRAINT `FK_acc_gl_journal_entry_m_share_account_transaction` FOREIGN KEY (`share_transaction_id`) REFERENCES `m_share_account_transactions` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.acc_gl_journal_entry: ~0 rows (approximately) +-- Dumping data for table fineract_default.acc_gl_journal_entry: ~0 rows (approximately) /*!40000 ALTER TABLE `acc_gl_journal_entry` DISABLE KEYS */; /*!40000 ALTER TABLE `acc_gl_journal_entry` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.acc_product_mapping +-- Dumping structure for table fineract_default.acc_product_mapping DROP TABLE IF EXISTS `acc_product_mapping`; CREATE TABLE IF NOT EXISTS `acc_product_mapping` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -202,12 +202,12 @@ CREATE TABLE IF NOT EXISTS `acc_product_mapping` ( CONSTRAINT `FK_acc_product_mapping_m_payment_type` FOREIGN KEY (`payment_type`) REFERENCES `m_payment_type` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.acc_product_mapping: ~0 rows (approximately) +-- Dumping data for table fineract_default.acc_product_mapping: ~0 rows (approximately) /*!40000 ALTER TABLE `acc_product_mapping` DISABLE KEYS */; /*!40000 ALTER TABLE `acc_product_mapping` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.acc_rule_tags +-- Dumping structure for table fineract_default.acc_rule_tags DROP TABLE IF EXISTS `acc_rule_tags`; CREATE TABLE IF NOT EXISTS `acc_rule_tags` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -222,12 +222,12 @@ CREATE TABLE IF NOT EXISTS `acc_rule_tags` ( CONSTRAINT `FK_m_code_value_id` FOREIGN KEY (`tag_id`) REFERENCES `m_code_value` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.acc_rule_tags: ~0 rows (approximately) +-- Dumping data for table fineract_default.acc_rule_tags: ~0 rows (approximately) /*!40000 ALTER TABLE `acc_rule_tags` DISABLE KEYS */; /*!40000 ALTER TABLE `acc_rule_tags` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.c_account_number_format +-- Dumping structure for table fineract_default.c_account_number_format DROP TABLE IF EXISTS `c_account_number_format`; CREATE TABLE IF NOT EXISTS `c_account_number_format` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -237,12 +237,12 @@ CREATE TABLE IF NOT EXISTS `c_account_number_format` ( UNIQUE KEY `account_type_enum` (`account_type_enum`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.c_account_number_format: ~0 rows (approximately) +-- Dumping data for table fineract_default.c_account_number_format: ~0 rows (approximately) /*!40000 ALTER TABLE `c_account_number_format` DISABLE KEYS */; /*!40000 ALTER TABLE `c_account_number_format` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.c_cache +-- Dumping structure for table fineract_default.c_cache DROP TABLE IF EXISTS `c_cache`; CREATE TABLE IF NOT EXISTS `c_cache` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -250,14 +250,14 @@ CREATE TABLE IF NOT EXISTS `c_cache` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.c_cache: ~0 rows (approximately) +-- Dumping data for table fineract_default.c_cache: ~0 rows (approximately) /*!40000 ALTER TABLE `c_cache` DISABLE KEYS */; INSERT INTO `c_cache` (`id`, `cache_type_enum`) VALUES (1, 1); /*!40000 ALTER TABLE `c_cache` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.c_configuration +-- Dumping structure for table fineract_default.c_configuration DROP TABLE IF EXISTS `c_configuration`; CREATE TABLE IF NOT EXISTS `c_configuration` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -271,7 +271,7 @@ CREATE TABLE IF NOT EXISTS `c_configuration` ( UNIQUE KEY `name_UNIQUE` (`name`) ) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.c_configuration: ~27 rows (approximately) +-- Dumping data for table fineract_default.c_configuration: ~27 rows (approximately) /*!40000 ALTER TABLE `c_configuration` DISABLE KEYS */; INSERT INTO `c_configuration` (`id`, `name`, `value`, `date_value`, `enabled`, `is_trap_door`, `description`) VALUES (1, 'maker-checker', NULL, NULL, 0, 0, NULL), @@ -304,7 +304,7 @@ INSERT INTO `c_configuration` (`id`, `name`, `value`, `date_value`, `enabled`, ` /*!40000 ALTER TABLE `c_configuration` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.c_external_service +-- Dumping structure for table fineract_default.c_external_service DROP TABLE IF EXISTS `c_external_service`; CREATE TABLE IF NOT EXISTS `c_external_service` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -313,7 +313,7 @@ CREATE TABLE IF NOT EXISTS `c_external_service` ( UNIQUE KEY `name_UNIQUE` (`name`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.c_external_service: ~3 rows (approximately) +-- Dumping data for table fineract_default.c_external_service: ~3 rows (approximately) /*!40000 ALTER TABLE `c_external_service` DISABLE KEYS */; INSERT INTO `c_external_service` (`id`, `name`) VALUES (3, 'MESSAGE_GATEWAY'), @@ -322,7 +322,7 @@ INSERT INTO `c_external_service` (`id`, `name`) VALUES /*!40000 ALTER TABLE `c_external_service` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.c_external_service_properties +-- Dumping structure for table fineract_default.c_external_service_properties DROP TABLE IF EXISTS `c_external_service_properties`; CREATE TABLE IF NOT EXISTS `c_external_service_properties` ( `name` varchar(150) NOT NULL, @@ -332,7 +332,7 @@ CREATE TABLE IF NOT EXISTS `c_external_service_properties` ( CONSTRAINT `FK_c_external_service_properties_c_external_service` FOREIGN KEY (`external_service_id`) REFERENCES `c_external_service` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.c_external_service_properties: ~12 rows (approximately) +-- Dumping data for table fineract_default.c_external_service_properties: ~12 rows (approximately) /*!40000 ALTER TABLE `c_external_service_properties` DISABLE KEYS */; INSERT INTO `c_external_service_properties` (`name`, `value`, `external_service_id`) VALUES ('s3_access_key', NULL, 1), @@ -350,7 +350,7 @@ INSERT INTO `c_external_service_properties` (`name`, `value`, `external_service_ /*!40000 ALTER TABLE `c_external_service_properties` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.job +-- Dumping structure for table fineract_default.job DROP TABLE IF EXISTS `job`; CREATE TABLE IF NOT EXISTS `job` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -372,7 +372,7 @@ CREATE TABLE IF NOT EXISTS `job` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.job: ~26 rows (approximately) +-- Dumping data for table fineract_default.job: ~26 rows (approximately) /*!40000 ALTER TABLE `job` DISABLE KEYS */; INSERT INTO `job` (`id`, `name`, `display_name`, `cron_expression`, `create_time`, `task_priority`, `group_name`, `previous_run_start_time`, `next_run_time`, `job_key`, `initializing_errorlog`, `is_active`, `currently_running`, `updates_allowed`, `scheduler_group`, `is_misfired`) VALUES (1, 'Update loan Summary', 'Update loan Summary', '0 0 22 1/1 * ? *', '2015-06-03 02:56:57', 5, NULL, NULL, '2017-02-24 22:00:00', 'Update loan SummaryJobDetail1 _ DEFAULT', NULL, 1, 0, 1, 0, 0), @@ -404,7 +404,7 @@ INSERT INTO `job` (`id`, `name`, `display_name`, `cron_expression`, `create_time /*!40000 ALTER TABLE `job` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.job_run_history +-- Dumping structure for table fineract_default.job_run_history DROP TABLE IF EXISTS `job_run_history`; CREATE TABLE IF NOT EXISTS `job_run_history` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -421,12 +421,12 @@ CREATE TABLE IF NOT EXISTS `job_run_history` ( CONSTRAINT `scheduledjobsFK` FOREIGN KEY (`job_id`) REFERENCES `job` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.job_run_history: ~0 rows (approximately) +-- Dumping data for table fineract_default.job_run_history: ~0 rows (approximately) /*!40000 ALTER TABLE `job_run_history` DISABLE KEYS */; /*!40000 ALTER TABLE `job_run_history` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.mix_taxonomy +-- Dumping structure for table fineract_default.mix_taxonomy DROP TABLE IF EXISTS `mix_taxonomy`; CREATE TABLE IF NOT EXISTS `mix_taxonomy` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, @@ -439,7 +439,7 @@ CREATE TABLE IF NOT EXISTS `mix_taxonomy` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=49 DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.mix_taxonomy: ~48 rows (approximately) +-- Dumping data for table fineract_default.mix_taxonomy: ~48 rows (approximately) /*!40000 ALTER TABLE `mix_taxonomy` DISABLE KEYS */; INSERT INTO `mix_taxonomy` (`id`, `name`, `namespace_id`, `dimension`, `type`, `description`, `need_mapping`) VALUES (1, 'AdministrativeExpense', 1, NULL, 3, NULL, 1), @@ -493,7 +493,7 @@ INSERT INTO `mix_taxonomy` (`id`, `name`, `namespace_id`, `dimension`, `type`, ` /*!40000 ALTER TABLE `mix_taxonomy` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.mix_taxonomy_mapping +-- Dumping structure for table fineract_default.mix_taxonomy_mapping DROP TABLE IF EXISTS `mix_taxonomy_mapping`; CREATE TABLE IF NOT EXISTS `mix_taxonomy_mapping` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, @@ -504,14 +504,14 @@ CREATE TABLE IF NOT EXISTS `mix_taxonomy_mapping` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.mix_taxonomy_mapping: ~0 rows (approximately) +-- Dumping data for table fineract_default.mix_taxonomy_mapping: ~0 rows (approximately) /*!40000 ALTER TABLE `mix_taxonomy_mapping` DISABLE KEYS */; INSERT INTO `mix_taxonomy_mapping` (`id`, `identifier`, `config`, `last_update_date`, `currency`) VALUES (1, 'default', NULL, NULL, ''); /*!40000 ALTER TABLE `mix_taxonomy_mapping` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.mix_xbrl_namespace +-- Dumping structure for table fineract_default.mix_xbrl_namespace DROP TABLE IF EXISTS `mix_xbrl_namespace`; CREATE TABLE IF NOT EXISTS `mix_xbrl_namespace` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, @@ -521,7 +521,7 @@ CREATE TABLE IF NOT EXISTS `mix_xbrl_namespace` ( UNIQUE KEY `UNQUE` (`prefix`) ) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.mix_xbrl_namespace: ~7 rows (approximately) +-- Dumping data for table fineract_default.mix_xbrl_namespace: ~7 rows (approximately) /*!40000 ALTER TABLE `mix_xbrl_namespace` DISABLE KEYS */; INSERT INTO `mix_xbrl_namespace` (`id`, `prefix`, `url`) VALUES (1, 'ifrs', 'http://xbrl.iasb.org/taxonomy/2009-04-01/ifrs'), @@ -534,7 +534,7 @@ INSERT INTO `mix_xbrl_namespace` (`id`, `prefix`, `url`) VALUES /*!40000 ALTER TABLE `mix_xbrl_namespace` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_account_transfer_details +-- Dumping structure for table fineract_default.m_account_transfer_details DROP TABLE IF EXISTS `m_account_transfer_details`; CREATE TABLE IF NOT EXISTS `m_account_transfer_details` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -566,12 +566,12 @@ CREATE TABLE IF NOT EXISTS `m_account_transfer_details` ( CONSTRAINT `FK_m_account_transfer_details_to_savings_account` FOREIGN KEY (`to_savings_account_id`) REFERENCES `m_savings_account` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_account_transfer_details: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_account_transfer_details: ~0 rows (approximately) /*!40000 ALTER TABLE `m_account_transfer_details` DISABLE KEYS */; /*!40000 ALTER TABLE `m_account_transfer_details` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_account_transfer_standing_instructions +-- Dumping structure for table fineract_default.m_account_transfer_standing_instructions DROP TABLE IF EXISTS `m_account_transfer_standing_instructions`; CREATE TABLE IF NOT EXISTS `m_account_transfer_standing_instructions` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -595,12 +595,12 @@ CREATE TABLE IF NOT EXISTS `m_account_transfer_standing_instructions` ( CONSTRAINT `FK_m_standing_instructions_account_transfer_details` FOREIGN KEY (`account_transfer_details_id`) REFERENCES `m_account_transfer_details` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_account_transfer_standing_instructions: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_account_transfer_standing_instructions: ~0 rows (approximately) /*!40000 ALTER TABLE `m_account_transfer_standing_instructions` DISABLE KEYS */; /*!40000 ALTER TABLE `m_account_transfer_standing_instructions` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_account_transfer_standing_instructions_history +-- Dumping structure for table fineract_default.m_account_transfer_standing_instructions_history DROP TABLE IF EXISTS `m_account_transfer_standing_instructions_history`; CREATE TABLE IF NOT EXISTS `m_account_transfer_standing_instructions_history` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -614,12 +614,12 @@ CREATE TABLE IF NOT EXISTS `m_account_transfer_standing_instructions_history` ( CONSTRAINT `FK_m_account_transfer_standing_instructions_m_history` FOREIGN KEY (`standing_instruction_id`) REFERENCES `m_account_transfer_standing_instructions` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_account_transfer_standing_instructions_history: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_account_transfer_standing_instructions_history: ~0 rows (approximately) /*!40000 ALTER TABLE `m_account_transfer_standing_instructions_history` DISABLE KEYS */; /*!40000 ALTER TABLE `m_account_transfer_standing_instructions_history` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_account_transfer_transaction +-- Dumping structure for table fineract_default.m_account_transfer_transaction DROP TABLE IF EXISTS `m_account_transfer_transaction`; CREATE TABLE IF NOT EXISTS `m_account_transfer_transaction` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -648,12 +648,12 @@ CREATE TABLE IF NOT EXISTS `m_account_transfer_transaction` ( CONSTRAINT `FK_m_account_transfer_transaction_to_m_savings_transaction` FOREIGN KEY (`to_savings_transaction_id`) REFERENCES `m_savings_account_transaction` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_account_transfer_transaction: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_account_transfer_transaction: ~0 rows (approximately) /*!40000 ALTER TABLE `m_account_transfer_transaction` DISABLE KEYS */; /*!40000 ALTER TABLE `m_account_transfer_transaction` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_address +-- Dumping structure for table fineract_default.m_address DROP TABLE IF EXISTS `m_address`; CREATE TABLE IF NOT EXISTS `m_address` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -680,12 +680,12 @@ CREATE TABLE IF NOT EXISTS `m_address` ( CONSTRAINT `address_fields_codefk2` FOREIGN KEY (`country_id`) REFERENCES `m_code_value` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_address: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_address: ~0 rows (approximately) /*!40000 ALTER TABLE `m_address` DISABLE KEYS */; /*!40000 ALTER TABLE `m_address` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_appuser +-- Dumping structure for table fineract_default.m_appuser DROP TABLE IF EXISTS `m_appuser`; CREATE TABLE IF NOT EXISTS `m_appuser` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -714,7 +714,7 @@ CREATE TABLE IF NOT EXISTS `m_appuser` ( CONSTRAINT `fk_m_appuser_002` FOREIGN KEY (`staff_id`) REFERENCES `m_staff` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_appuser: ~2 rows (approximately) +-- Dumping data for table fineract_default.m_appuser: ~2 rows (approximately) /*!40000 ALTER TABLE `m_appuser` DISABLE KEYS */; INSERT INTO `m_appuser` (`id`, `is_deleted`, `office_id`, `staff_id`, `username`, `firstname`, `lastname`, `password`, `email`, `firsttime_login_remaining`, `nonexpired`, `nonlocked`, `nonexpired_credentials`, `enabled`, `last_time_password_updated`, `password_never_expires`, `is_self_service_user`) VALUES (1, 0, 1, NULL, 'mifos', 'App', 'Administrator', '5787039480429368bf94732aacc771cd0a3ea02bcf504ffe1185ab94213bc63a', 'demomfi@mifos.org', b'0', b'1', b'1', b'1', b'1', '2015-06-03', 0, b'0'), @@ -722,7 +722,7 @@ INSERT INTO `m_appuser` (`id`, `is_deleted`, `office_id`, `staff_id`, `username` /*!40000 ALTER TABLE `m_appuser` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_appuser_previous_password +-- Dumping structure for table fineract_default.m_appuser_previous_password DROP TABLE IF EXISTS `m_appuser_previous_password`; CREATE TABLE IF NOT EXISTS `m_appuser_previous_password` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -734,12 +734,12 @@ CREATE TABLE IF NOT EXISTS `m_appuser_previous_password` ( CONSTRAINT `m_appuser_previous_password_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `m_appuser` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; --- Dumping data for table mifostenant-default.m_appuser_previous_password: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_appuser_previous_password: ~0 rows (approximately) /*!40000 ALTER TABLE `m_appuser_previous_password` DISABLE KEYS */; /*!40000 ALTER TABLE `m_appuser_previous_password` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_appuser_role +-- Dumping structure for table fineract_default.m_appuser_role DROP TABLE IF EXISTS `m_appuser_role`; CREATE TABLE IF NOT EXISTS `m_appuser_role` ( `appuser_id` bigint(20) NOT NULL, @@ -751,14 +751,14 @@ CREATE TABLE IF NOT EXISTS `m_appuser_role` ( CONSTRAINT `FK7662CE59B4100309` FOREIGN KEY (`appuser_id`) REFERENCES `m_appuser` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_appuser_role: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_appuser_role: ~0 rows (approximately) /*!40000 ALTER TABLE `m_appuser_role` DISABLE KEYS */; INSERT INTO `m_appuser_role` (`appuser_id`, `role_id`) VALUES (1, 1); /*!40000 ALTER TABLE `m_appuser_role` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_calendar +-- Dumping structure for table fineract_default.m_calendar DROP TABLE IF EXISTS `m_calendar`; CREATE TABLE IF NOT EXISTS `m_calendar` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -782,12 +782,12 @@ CREATE TABLE IF NOT EXISTS `m_calendar` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_calendar: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_calendar: ~0 rows (approximately) /*!40000 ALTER TABLE `m_calendar` DISABLE KEYS */; /*!40000 ALTER TABLE `m_calendar` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_calendar_history +-- Dumping structure for table fineract_default.m_calendar_history DROP TABLE IF EXISTS `m_calendar_history`; CREATE TABLE IF NOT EXISTS `m_calendar_history` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -809,12 +809,12 @@ CREATE TABLE IF NOT EXISTS `m_calendar_history` ( CONSTRAINT `FK_m_calendar_m_calendar_history` FOREIGN KEY (`calendar_id`) REFERENCES `m_calendar` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_calendar_history: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_calendar_history: ~0 rows (approximately) /*!40000 ALTER TABLE `m_calendar_history` DISABLE KEYS */; /*!40000 ALTER TABLE `m_calendar_history` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_calendar_instance +-- Dumping structure for table fineract_default.m_calendar_instance DROP TABLE IF EXISTS `m_calendar_instance`; CREATE TABLE IF NOT EXISTS `m_calendar_instance` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -826,12 +826,12 @@ CREATE TABLE IF NOT EXISTS `m_calendar_instance` ( CONSTRAINT `FK_m_calendar_m_calendar_instance` FOREIGN KEY (`calendar_id`) REFERENCES `m_calendar` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_calendar_instance: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_calendar_instance: ~0 rows (approximately) /*!40000 ALTER TABLE `m_calendar_instance` DISABLE KEYS */; /*!40000 ALTER TABLE `m_calendar_instance` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_cashiers +-- Dumping structure for table fineract_default.m_cashiers DROP TABLE IF EXISTS `m_cashiers`; CREATE TABLE IF NOT EXISTS `m_cashiers` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -850,12 +850,12 @@ CREATE TABLE IF NOT EXISTS `m_cashiers` ( CONSTRAINT `FK_m_cashiers_m_teller` FOREIGN KEY (`teller_id`) REFERENCES `m_tellers` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_cashiers: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_cashiers: ~0 rows (approximately) /*!40000 ALTER TABLE `m_cashiers` DISABLE KEYS */; /*!40000 ALTER TABLE `m_cashiers` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_cashier_transactions +-- Dumping structure for table fineract_default.m_cashier_transactions DROP TABLE IF EXISTS `m_cashier_transactions`; CREATE TABLE IF NOT EXISTS `m_cashier_transactions` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -873,12 +873,12 @@ CREATE TABLE IF NOT EXISTS `m_cashier_transactions` ( CONSTRAINT `FK_m_teller_transactions_m_cashiers` FOREIGN KEY (`cashier_id`) REFERENCES `m_cashiers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_cashier_transactions: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_cashier_transactions: ~0 rows (approximately) /*!40000 ALTER TABLE `m_cashier_transactions` DISABLE KEYS */; /*!40000 ALTER TABLE `m_cashier_transactions` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_charge +-- Dumping structure for table fineract_default.m_charge DROP TABLE IF EXISTS `m_charge`; CREATE TABLE IF NOT EXISTS `m_charge` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -908,12 +908,12 @@ CREATE TABLE IF NOT EXISTS `m_charge` ( CONSTRAINT `FK_m_charge_m_tax_group` FOREIGN KEY (`tax_group_id`) REFERENCES `m_tax_group` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_charge: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_charge: ~0 rows (approximately) /*!40000 ALTER TABLE `m_charge` DISABLE KEYS */; /*!40000 ALTER TABLE `m_charge` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_client +-- Dumping structure for table fineract_default.m_client DROP TABLE IF EXISTS `m_client`; CREATE TABLE IF NOT EXISTS `m_client` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -990,12 +990,12 @@ CREATE TABLE IF NOT EXISTS `m_client` ( CONSTRAINT `FK_m_client_type_mcode_value_reject` FOREIGN KEY (`reject_reason_cv_id`) REFERENCES `m_code_value` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_client: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_client: ~0 rows (approximately) /*!40000 ALTER TABLE `m_client` DISABLE KEYS */; /*!40000 ALTER TABLE `m_client` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_client_address +-- Dumping structure for table fineract_default.m_client_address DROP TABLE IF EXISTS `m_client_address`; CREATE TABLE IF NOT EXISTS `m_client_address` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -1011,12 +1011,12 @@ CREATE TABLE IF NOT EXISTS `m_client_address` ( CONSTRAINT `clientaddressfk` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_client_address: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_client_address: ~0 rows (approximately) /*!40000 ALTER TABLE `m_client_address` DISABLE KEYS */; /*!40000 ALTER TABLE `m_client_address` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_client_attendance +-- Dumping structure for table fineract_default.m_client_attendance DROP TABLE IF EXISTS `m_client_attendance`; CREATE TABLE IF NOT EXISTS `m_client_attendance` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -1030,12 +1030,12 @@ CREATE TABLE IF NOT EXISTS `m_client_attendance` ( CONSTRAINT `FK_m_meeting_m_client_attendance` FOREIGN KEY (`meeting_id`) REFERENCES `m_meeting` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_client_attendance: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_client_attendance: ~0 rows (approximately) /*!40000 ALTER TABLE `m_client_attendance` DISABLE KEYS */; /*!40000 ALTER TABLE `m_client_attendance` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_client_charge +-- Dumping structure for table fineract_default.m_client_charge DROP TABLE IF EXISTS `m_client_charge`; CREATE TABLE IF NOT EXISTS `m_client_charge` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -1061,12 +1061,12 @@ CREATE TABLE IF NOT EXISTS `m_client_charge` ( CONSTRAINT `FK_m_client_charge_m_client` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_client_charge: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_client_charge: ~0 rows (approximately) /*!40000 ALTER TABLE `m_client_charge` DISABLE KEYS */; /*!40000 ALTER TABLE `m_client_charge` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_client_charge_paid_by +-- Dumping structure for table fineract_default.m_client_charge_paid_by DROP TABLE IF EXISTS `m_client_charge_paid_by`; CREATE TABLE IF NOT EXISTS `m_client_charge_paid_by` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -1080,12 +1080,12 @@ CREATE TABLE IF NOT EXISTS `m_client_charge_paid_by` ( CONSTRAINT `FK_m_client_charge_paid_by_m_client_transaction` FOREIGN KEY (`client_transaction_id`) REFERENCES `m_client_transaction` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_client_charge_paid_by: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_client_charge_paid_by: ~0 rows (approximately) /*!40000 ALTER TABLE `m_client_charge_paid_by` DISABLE KEYS */; /*!40000 ALTER TABLE `m_client_charge_paid_by` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_client_identifier +-- Dumping structure for table fineract_default.m_client_identifier DROP TABLE IF EXISTS `m_client_identifier`; CREATE TABLE IF NOT EXISTS `m_client_identifier` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -1108,12 +1108,12 @@ CREATE TABLE IF NOT EXISTS `m_client_identifier` ( CONSTRAINT `FK_m_client_document_m_code_value` FOREIGN KEY (`document_type_id`) REFERENCES `m_code_value` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_client_identifier: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_client_identifier: ~0 rows (approximately) /*!40000 ALTER TABLE `m_client_identifier` DISABLE KEYS */; /*!40000 ALTER TABLE `m_client_identifier` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_client_non_person +-- Dumping structure for table fineract_default.m_client_non_person DROP TABLE IF EXISTS `m_client_non_person`; CREATE TABLE IF NOT EXISTS `m_client_non_person` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -1129,12 +1129,12 @@ CREATE TABLE IF NOT EXISTS `m_client_non_person` ( CONSTRAINT `FK_client_id` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_client_non_person: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_client_non_person: ~0 rows (approximately) /*!40000 ALTER TABLE `m_client_non_person` DISABLE KEYS */; /*!40000 ALTER TABLE `m_client_non_person` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_client_transaction +-- Dumping structure for table fineract_default.m_client_transaction DROP TABLE IF EXISTS `m_client_transaction`; CREATE TABLE IF NOT EXISTS `m_client_transaction` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -1157,12 +1157,12 @@ CREATE TABLE IF NOT EXISTS `m_client_transaction` ( CONSTRAINT `FK_m_client_transaction_m_client` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_client_transaction: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_client_transaction: ~0 rows (approximately) /*!40000 ALTER TABLE `m_client_transaction` DISABLE KEYS */; /*!40000 ALTER TABLE `m_client_transaction` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_code +-- Dumping structure for table fineract_default.m_code DROP TABLE IF EXISTS `m_code`; CREATE TABLE IF NOT EXISTS `m_code` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -1172,7 +1172,7 @@ CREATE TABLE IF NOT EXISTS `m_code` ( UNIQUE KEY `code_name` (`code_name`) ) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_code: ~28 rows (approximately) +-- Dumping data for table fineract_default.m_code: ~28 rows (approximately) /*!40000 ALTER TABLE `m_code` DISABLE KEYS */; INSERT INTO `m_code` (`id`, `code_name`, `is_system_defined`) VALUES (1, 'Customer Identifier', 1), @@ -1206,7 +1206,7 @@ INSERT INTO `m_code` (`id`, `code_name`, `is_system_defined`) VALUES /*!40000 ALTER TABLE `m_code` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_code_value +-- Dumping structure for table fineract_default.m_code_value DROP TABLE IF EXISTS `m_code_value`; CREATE TABLE IF NOT EXISTS `m_code_value` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -1223,7 +1223,7 @@ CREATE TABLE IF NOT EXISTS `m_code_value` ( CONSTRAINT `FKCFCEA42640BE071Z` FOREIGN KEY (`code_id`) REFERENCES `m_code` (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_code_value: ~13 rows (approximately) +-- Dumping data for table fineract_default.m_code_value: ~13 rows (approximately) /*!40000 ALTER TABLE `m_code_value` DISABLE KEYS */; INSERT INTO `m_code_value` (`id`, `code_id`, `code_value`, `code_description`, `order_position`, `code_score`, `is_active`, `is_mandatory`) VALUES (1, 1, 'Passport', NULL, 1, NULL, 1, 0), @@ -1242,7 +1242,7 @@ INSERT INTO `m_code_value` (`id`, `code_id`, `code_value`, `code_description`, ` /*!40000 ALTER TABLE `m_code_value` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_currency +-- Dumping structure for table fineract_default.m_currency DROP TABLE IF EXISTS `m_currency`; CREATE TABLE IF NOT EXISTS `m_currency` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -1256,7 +1256,7 @@ CREATE TABLE IF NOT EXISTS `m_currency` ( UNIQUE KEY `code` (`code`) ) ENGINE=InnoDB AUTO_INCREMENT=164 DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_currency: ~163 rows (approximately) +-- Dumping data for table fineract_default.m_currency: ~163 rows (approximately) /*!40000 ALTER TABLE `m_currency` DISABLE KEYS */; INSERT INTO `m_currency` (`id`, `code`, `decimal_places`, `currency_multiplesof`, `display_symbol`, `name`, `internationalized_name_code`) VALUES (1, 'AED', 2, NULL, NULL, 'UAE Dirham', 'currency.AED'), @@ -1425,7 +1425,7 @@ INSERT INTO `m_currency` (`id`, `code`, `decimal_places`, `currency_multiplesof` /*!40000 ALTER TABLE `m_currency` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_deposit_account_on_hold_transaction +-- Dumping structure for table fineract_default.m_deposit_account_on_hold_transaction DROP TABLE IF EXISTS `m_deposit_account_on_hold_transaction`; CREATE TABLE IF NOT EXISTS `m_deposit_account_on_hold_transaction` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -1440,12 +1440,12 @@ CREATE TABLE IF NOT EXISTS `m_deposit_account_on_hold_transaction` ( CONSTRAINT `FK_deposit_on_hold_transaction_m_savings_account` FOREIGN KEY (`savings_account_id`) REFERENCES `m_savings_account` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_deposit_account_on_hold_transaction: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_deposit_account_on_hold_transaction: ~0 rows (approximately) /*!40000 ALTER TABLE `m_deposit_account_on_hold_transaction` DISABLE KEYS */; /*!40000 ALTER TABLE `m_deposit_account_on_hold_transaction` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_deposit_account_recurring_detail +-- Dumping structure for table fineract_default.m_deposit_account_recurring_detail DROP TABLE IF EXISTS `m_deposit_account_recurring_detail`; CREATE TABLE IF NOT EXISTS `m_deposit_account_recurring_detail` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -1462,12 +1462,12 @@ CREATE TABLE IF NOT EXISTS `m_deposit_account_recurring_detail` ( CONSTRAINT `FKDARD00000000000001` FOREIGN KEY (`savings_account_id`) REFERENCES `m_savings_account` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_deposit_account_recurring_detail: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_deposit_account_recurring_detail: ~0 rows (approximately) /*!40000 ALTER TABLE `m_deposit_account_recurring_detail` DISABLE KEYS */; /*!40000 ALTER TABLE `m_deposit_account_recurring_detail` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_deposit_account_term_and_preclosure +-- Dumping structure for table fineract_default.m_deposit_account_term_and_preclosure DROP TABLE IF EXISTS `m_deposit_account_term_and_preclosure`; CREATE TABLE IF NOT EXISTS `m_deposit_account_term_and_preclosure` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -1494,12 +1494,12 @@ CREATE TABLE IF NOT EXISTS `m_deposit_account_term_and_preclosure` ( CONSTRAINT `FKDATP00000000000001` FOREIGN KEY (`savings_account_id`) REFERENCES `m_savings_account` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_deposit_account_term_and_preclosure: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_deposit_account_term_and_preclosure: ~0 rows (approximately) /*!40000 ALTER TABLE `m_deposit_account_term_and_preclosure` DISABLE KEYS */; /*!40000 ALTER TABLE `m_deposit_account_term_and_preclosure` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_deposit_product_interest_rate_chart +-- Dumping structure for table fineract_default.m_deposit_product_interest_rate_chart DROP TABLE IF EXISTS `m_deposit_product_interest_rate_chart`; CREATE TABLE IF NOT EXISTS `m_deposit_product_interest_rate_chart` ( `deposit_product_id` bigint(20) NOT NULL, @@ -1510,12 +1510,12 @@ CREATE TABLE IF NOT EXISTS `m_deposit_product_interest_rate_chart` ( CONSTRAINT `FKDPIRC00000000000002` FOREIGN KEY (`interest_rate_chart_id`) REFERENCES `m_interest_rate_chart` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_deposit_product_interest_rate_chart: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_deposit_product_interest_rate_chart: ~0 rows (approximately) /*!40000 ALTER TABLE `m_deposit_product_interest_rate_chart` DISABLE KEYS */; /*!40000 ALTER TABLE `m_deposit_product_interest_rate_chart` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_deposit_product_recurring_detail +-- Dumping structure for table fineract_default.m_deposit_product_recurring_detail DROP TABLE IF EXISTS `m_deposit_product_recurring_detail`; CREATE TABLE IF NOT EXISTS `m_deposit_product_recurring_detail` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -1528,12 +1528,12 @@ CREATE TABLE IF NOT EXISTS `m_deposit_product_recurring_detail` ( CONSTRAINT `FKDPRD00000000000001` FOREIGN KEY (`savings_product_id`) REFERENCES `m_savings_product` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_deposit_product_recurring_detail: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_deposit_product_recurring_detail: ~0 rows (approximately) /*!40000 ALTER TABLE `m_deposit_product_recurring_detail` DISABLE KEYS */; /*!40000 ALTER TABLE `m_deposit_product_recurring_detail` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_deposit_product_term_and_preclosure +-- Dumping structure for table fineract_default.m_deposit_product_term_and_preclosure DROP TABLE IF EXISTS `m_deposit_product_term_and_preclosure`; CREATE TABLE IF NOT EXISTS `m_deposit_product_term_and_preclosure` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -1555,12 +1555,12 @@ CREATE TABLE IF NOT EXISTS `m_deposit_product_term_and_preclosure` ( CONSTRAINT `FKDPTP00000000000001` FOREIGN KEY (`savings_product_id`) REFERENCES `m_savings_product` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_deposit_product_term_and_preclosure: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_deposit_product_term_and_preclosure: ~0 rows (approximately) /*!40000 ALTER TABLE `m_deposit_product_term_and_preclosure` DISABLE KEYS */; /*!40000 ALTER TABLE `m_deposit_product_term_and_preclosure` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_document +-- Dumping structure for table fineract_default.m_document DROP TABLE IF EXISTS `m_document`; CREATE TABLE IF NOT EXISTS `m_document` ( `id` int(20) NOT NULL AUTO_INCREMENT, @@ -1576,12 +1576,12 @@ CREATE TABLE IF NOT EXISTS `m_document` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_document: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_document: ~0 rows (approximately) /*!40000 ALTER TABLE `m_document` DISABLE KEYS */; /*!40000 ALTER TABLE `m_document` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_entity_datatable_check +-- Dumping structure for table fineract_default.m_entity_datatable_check DROP TABLE IF EXISTS `m_entity_datatable_check`; CREATE TABLE IF NOT EXISTS `m_entity_datatable_check` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -1597,12 +1597,12 @@ CREATE TABLE IF NOT EXISTS `m_entity_datatable_check` ( CONSTRAINT `m_entity_datatable_check_ibfk_1` FOREIGN KEY (`x_registered_table_name`) REFERENCES `x_registered_table` (`registered_table_name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_entity_datatable_check: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_entity_datatable_check: ~0 rows (approximately) /*!40000 ALTER TABLE `m_entity_datatable_check` DISABLE KEYS */; /*!40000 ALTER TABLE `m_entity_datatable_check` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_entity_relation +-- Dumping structure for table fineract_default.m_entity_relation DROP TABLE IF EXISTS `m_entity_relation`; CREATE TABLE IF NOT EXISTS `m_entity_relation` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -1613,7 +1613,7 @@ CREATE TABLE IF NOT EXISTS `m_entity_relation` ( UNIQUE KEY `from_entity_type_to_entity_type_code_name` (`from_entity_type`,`to_entity_type`,`code_name`) ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_entity_relation: ~5 rows (approximately) +-- Dumping data for table fineract_default.m_entity_relation: ~5 rows (approximately) /*!40000 ALTER TABLE `m_entity_relation` DISABLE KEYS */; INSERT INTO `m_entity_relation` (`id`, `from_entity_type`, `to_entity_type`, `code_name`) VALUES (1, 1, 2, 'office_access_to_loan_products'), @@ -1624,7 +1624,7 @@ INSERT INTO `m_entity_relation` (`id`, `from_entity_type`, `to_entity_type`, `co /*!40000 ALTER TABLE `m_entity_relation` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_entity_to_entity_access +-- Dumping structure for table fineract_default.m_entity_to_entity_access DROP TABLE IF EXISTS `m_entity_to_entity_access`; CREATE TABLE IF NOT EXISTS `m_entity_to_entity_access` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -1640,12 +1640,12 @@ CREATE TABLE IF NOT EXISTS `m_entity_to_entity_access` ( CONSTRAINT `FK_access_type_code_m_code_value` FOREIGN KEY (`access_type_code_value_id`) REFERENCES `m_code_value` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_entity_to_entity_access: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_entity_to_entity_access: ~0 rows (approximately) /*!40000 ALTER TABLE `m_entity_to_entity_access` DISABLE KEYS */; /*!40000 ALTER TABLE `m_entity_to_entity_access` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_entity_to_entity_mapping +-- Dumping structure for table fineract_default.m_entity_to_entity_mapping DROP TABLE IF EXISTS `m_entity_to_entity_mapping`; CREATE TABLE IF NOT EXISTS `m_entity_to_entity_mapping` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -1659,12 +1659,12 @@ CREATE TABLE IF NOT EXISTS `m_entity_to_entity_mapping` ( CONSTRAINT `FK__rel_id_m_entity_relation_id` FOREIGN KEY (`rel_id`) REFERENCES `m_entity_relation` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_entity_to_entity_mapping: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_entity_to_entity_mapping: ~0 rows (approximately) /*!40000 ALTER TABLE `m_entity_to_entity_mapping` DISABLE KEYS */; /*!40000 ALTER TABLE `m_entity_to_entity_mapping` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_field_configuration +-- Dumping structure for table fineract_default.m_field_configuration DROP TABLE IF EXISTS `m_field_configuration`; CREATE TABLE IF NOT EXISTS `m_field_configuration` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -1677,7 +1677,7 @@ CREATE TABLE IF NOT EXISTS `m_field_configuration` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_field_configuration: ~18 rows (approximately) +-- Dumping data for table fineract_default.m_field_configuration: ~18 rows (approximately) /*!40000 ALTER TABLE `m_field_configuration` DISABLE KEYS */; INSERT INTO `m_field_configuration` (`id`, `entity`, `subentity`, `field`, `is_enabled`, `is_mandatory`, `validation_regex`) VALUES (1, 'ADDRESS', 'CLIENT', 'addressType', 1, 0, ''), @@ -1701,7 +1701,7 @@ INSERT INTO `m_field_configuration` (`id`, `entity`, `subentity`, `field`, `is_e /*!40000 ALTER TABLE `m_field_configuration` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_floating_rates +-- Dumping structure for table fineract_default.m_floating_rates DROP TABLE IF EXISTS `m_floating_rates`; CREATE TABLE IF NOT EXISTS `m_floating_rates` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -1716,12 +1716,12 @@ CREATE TABLE IF NOT EXISTS `m_floating_rates` ( UNIQUE KEY `unq_name` (`name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_floating_rates: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_floating_rates: ~0 rows (approximately) /*!40000 ALTER TABLE `m_floating_rates` DISABLE KEYS */; /*!40000 ALTER TABLE `m_floating_rates` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_floating_rates_periods +-- Dumping structure for table fineract_default.m_floating_rates_periods DROP TABLE IF EXISTS `m_floating_rates_periods`; CREATE TABLE IF NOT EXISTS `m_floating_rates_periods` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -1739,12 +1739,12 @@ CREATE TABLE IF NOT EXISTS `m_floating_rates_periods` ( CONSTRAINT `FK_mappings_m_floating_rates` FOREIGN KEY (`floating_rates_id`) REFERENCES `m_floating_rates` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_floating_rates_periods: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_floating_rates_periods: ~0 rows (approximately) /*!40000 ALTER TABLE `m_floating_rates_periods` DISABLE KEYS */; /*!40000 ALTER TABLE `m_floating_rates_periods` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_fund +-- Dumping structure for table fineract_default.m_fund DROP TABLE IF EXISTS `m_fund`; CREATE TABLE IF NOT EXISTS `m_fund` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -1755,12 +1755,12 @@ CREATE TABLE IF NOT EXISTS `m_fund` ( UNIQUE KEY `fund_externalid_org` (`external_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_fund: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_fund: ~0 rows (approximately) /*!40000 ALTER TABLE `m_fund` DISABLE KEYS */; /*!40000 ALTER TABLE `m_fund` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_group +-- Dumping structure for table fineract_default.m_group DROP TABLE IF EXISTS `m_group`; CREATE TABLE IF NOT EXISTS `m_group` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -1796,12 +1796,12 @@ CREATE TABLE IF NOT EXISTS `m_group` ( CONSTRAINT `m_group_ibfk_1` FOREIGN KEY (`office_id`) REFERENCES `m_office` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_group: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_group: ~0 rows (approximately) /*!40000 ALTER TABLE `m_group` DISABLE KEYS */; /*!40000 ALTER TABLE `m_group` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_group_client +-- Dumping structure for table fineract_default.m_group_client DROP TABLE IF EXISTS `m_group_client`; CREATE TABLE IF NOT EXISTS `m_group_client` ( `group_id` bigint(20) NOT NULL, @@ -1812,12 +1812,12 @@ CREATE TABLE IF NOT EXISTS `m_group_client` ( CONSTRAINT `m_group_client_ibfk_2` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_group_client: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_group_client: ~0 rows (approximately) /*!40000 ALTER TABLE `m_group_client` DISABLE KEYS */; /*!40000 ALTER TABLE `m_group_client` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_group_level +-- Dumping structure for table fineract_default.m_group_level DROP TABLE IF EXISTS `m_group_level`; CREATE TABLE IF NOT EXISTS `m_group_level` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -1831,7 +1831,7 @@ CREATE TABLE IF NOT EXISTS `m_group_level` ( CONSTRAINT `Parent_levelId_reference` FOREIGN KEY (`parent_id`) REFERENCES `m_group_level` (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_group_level: ~2 rows (approximately) +-- Dumping data for table fineract_default.m_group_level: ~2 rows (approximately) /*!40000 ALTER TABLE `m_group_level` DISABLE KEYS */; INSERT INTO `m_group_level` (`id`, `parent_id`, `super_parent`, `level_name`, `recursable`, `can_have_clients`) VALUES (1, NULL, 1, 'Center', 1, 0), @@ -1839,7 +1839,7 @@ INSERT INTO `m_group_level` (`id`, `parent_id`, `super_parent`, `level_name`, `r /*!40000 ALTER TABLE `m_group_level` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_group_roles +-- Dumping structure for table fineract_default.m_group_roles DROP TABLE IF EXISTS `m_group_roles`; CREATE TABLE IF NOT EXISTS `m_group_roles` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -1856,12 +1856,12 @@ CREATE TABLE IF NOT EXISTS `m_group_roles` ( CONSTRAINT `FK_grouprole_m_codevalue` FOREIGN KEY (`role_cv_id`) REFERENCES `m_code_value` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_group_roles: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_group_roles: ~0 rows (approximately) /*!40000 ALTER TABLE `m_group_roles` DISABLE KEYS */; /*!40000 ALTER TABLE `m_group_roles` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_guarantor +-- Dumping structure for table fineract_default.m_guarantor DROP TABLE IF EXISTS `m_guarantor`; CREATE TABLE IF NOT EXISTS `m_guarantor` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -1889,12 +1889,12 @@ CREATE TABLE IF NOT EXISTS `m_guarantor` ( CONSTRAINT `FK_m_guarantor_m_loan` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_guarantor: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_guarantor: ~0 rows (approximately) /*!40000 ALTER TABLE `m_guarantor` DISABLE KEYS */; /*!40000 ALTER TABLE `m_guarantor` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_guarantor_funding_details +-- Dumping structure for table fineract_default.m_guarantor_funding_details DROP TABLE IF EXISTS `m_guarantor_funding_details`; CREATE TABLE IF NOT EXISTS `m_guarantor_funding_details` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -1912,12 +1912,12 @@ CREATE TABLE IF NOT EXISTS `m_guarantor_funding_details` ( CONSTRAINT `FK_m_guarantor_fund_details_m_guarantor` FOREIGN KEY (`guarantor_id`) REFERENCES `m_guarantor` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_guarantor_funding_details: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_guarantor_funding_details: ~0 rows (approximately) /*!40000 ALTER TABLE `m_guarantor_funding_details` DISABLE KEYS */; /*!40000 ALTER TABLE `m_guarantor_funding_details` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_guarantor_transaction +-- Dumping structure for table fineract_default.m_guarantor_transaction DROP TABLE IF EXISTS `m_guarantor_transaction`; CREATE TABLE IF NOT EXISTS `m_guarantor_transaction` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -1934,12 +1934,12 @@ CREATE TABLE IF NOT EXISTS `m_guarantor_transaction` ( CONSTRAINT `FK_guarantor_transaction_m_loan_transaction` FOREIGN KEY (`loan_transaction_id`) REFERENCES `m_loan_transaction` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_guarantor_transaction: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_guarantor_transaction: ~0 rows (approximately) /*!40000 ALTER TABLE `m_guarantor_transaction` DISABLE KEYS */; /*!40000 ALTER TABLE `m_guarantor_transaction` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_holiday +-- Dumping structure for table fineract_default.m_holiday DROP TABLE IF EXISTS `m_holiday`; CREATE TABLE IF NOT EXISTS `m_holiday` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -1954,12 +1954,12 @@ CREATE TABLE IF NOT EXISTS `m_holiday` ( UNIQUE KEY `holiday_name` (`name`,`from_date`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_holiday: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_holiday: ~0 rows (approximately) /*!40000 ALTER TABLE `m_holiday` DISABLE KEYS */; /*!40000 ALTER TABLE `m_holiday` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_holiday_office +-- Dumping structure for table fineract_default.m_holiday_office DROP TABLE IF EXISTS `m_holiday_office`; CREATE TABLE IF NOT EXISTS `m_holiday_office` ( `holiday_id` bigint(20) NOT NULL, @@ -1971,12 +1971,12 @@ CREATE TABLE IF NOT EXISTS `m_holiday_office` ( CONSTRAINT `m_office_id_ibfk_2` FOREIGN KEY (`office_id`) REFERENCES `m_office` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_holiday_office: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_holiday_office: ~0 rows (approximately) /*!40000 ALTER TABLE `m_holiday_office` DISABLE KEYS */; /*!40000 ALTER TABLE `m_holiday_office` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_hook +-- Dumping structure for table fineract_default.m_hook DROP TABLE IF EXISTS `m_hook`; CREATE TABLE IF NOT EXISTS `m_hook` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -1995,12 +1995,12 @@ CREATE TABLE IF NOT EXISTS `m_hook` ( CONSTRAINT `fk_ugd_template_id` FOREIGN KEY (`ugd_template_id`) REFERENCES `m_template` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_hook: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_hook: ~0 rows (approximately) /*!40000 ALTER TABLE `m_hook` DISABLE KEYS */; /*!40000 ALTER TABLE `m_hook` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_hook_configuration +-- Dumping structure for table fineract_default.m_hook_configuration DROP TABLE IF EXISTS `m_hook_configuration`; CREATE TABLE IF NOT EXISTS `m_hook_configuration` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -2013,12 +2013,12 @@ CREATE TABLE IF NOT EXISTS `m_hook_configuration` ( CONSTRAINT `fk_hook_id_cfg` FOREIGN KEY (`hook_id`) REFERENCES `m_hook` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_hook_configuration: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_hook_configuration: ~0 rows (approximately) /*!40000 ALTER TABLE `m_hook_configuration` DISABLE KEYS */; /*!40000 ALTER TABLE `m_hook_configuration` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_hook_registered_events +-- Dumping structure for table fineract_default.m_hook_registered_events DROP TABLE IF EXISTS `m_hook_registered_events`; CREATE TABLE IF NOT EXISTS `m_hook_registered_events` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -2030,12 +2030,12 @@ CREATE TABLE IF NOT EXISTS `m_hook_registered_events` ( CONSTRAINT `fk_hook_idc` FOREIGN KEY (`hook_id`) REFERENCES `m_hook` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_hook_registered_events: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_hook_registered_events: ~0 rows (approximately) /*!40000 ALTER TABLE `m_hook_registered_events` DISABLE KEYS */; /*!40000 ALTER TABLE `m_hook_registered_events` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_hook_schema +-- Dumping structure for table fineract_default.m_hook_schema DROP TABLE IF EXISTS `m_hook_schema`; CREATE TABLE IF NOT EXISTS `m_hook_schema` ( `id` smallint(6) NOT NULL AUTO_INCREMENT, @@ -2049,7 +2049,7 @@ CREATE TABLE IF NOT EXISTS `m_hook_schema` ( CONSTRAINT `fk_hook_template_id` FOREIGN KEY (`hook_template_id`) REFERENCES `m_hook_templates` (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_hook_schema: ~7 rows (approximately) +-- Dumping data for table fineract_default.m_hook_schema: ~7 rows (approximately) /*!40000 ALTER TABLE `m_hook_schema` DISABLE KEYS */; INSERT INTO `m_hook_schema` (`id`, `hook_template_id`, `field_type`, `field_name`, `placeholder`, `optional`) VALUES (1, 1, 'string', 'Payload URL', NULL, 0), @@ -2062,7 +2062,7 @@ INSERT INTO `m_hook_schema` (`id`, `hook_template_id`, `field_type`, `field_name /*!40000 ALTER TABLE `m_hook_schema` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_hook_templates +-- Dumping structure for table fineract_default.m_hook_templates DROP TABLE IF EXISTS `m_hook_templates`; CREATE TABLE IF NOT EXISTS `m_hook_templates` ( `id` smallint(6) NOT NULL AUTO_INCREMENT, @@ -2070,7 +2070,7 @@ CREATE TABLE IF NOT EXISTS `m_hook_templates` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_hook_templates: ~2 rows (approximately) +-- Dumping data for table fineract_default.m_hook_templates: ~2 rows (approximately) /*!40000 ALTER TABLE `m_hook_templates` DISABLE KEYS */; INSERT INTO `m_hook_templates` (`id`, `name`) VALUES (1, 'Web'), @@ -2078,7 +2078,7 @@ INSERT INTO `m_hook_templates` (`id`, `name`) VALUES /*!40000 ALTER TABLE `m_hook_templates` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_image +-- Dumping structure for table fineract_default.m_image DROP TABLE IF EXISTS `m_image`; CREATE TABLE IF NOT EXISTS `m_image` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -2087,12 +2087,12 @@ CREATE TABLE IF NOT EXISTS `m_image` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_image: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_image: ~0 rows (approximately) /*!40000 ALTER TABLE `m_image` DISABLE KEYS */; /*!40000 ALTER TABLE `m_image` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_interest_incentives +-- Dumping structure for table fineract_default.m_interest_incentives DROP TABLE IF EXISTS `m_interest_incentives`; CREATE TABLE IF NOT EXISTS `m_interest_incentives` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -2108,12 +2108,12 @@ CREATE TABLE IF NOT EXISTS `m_interest_incentives` ( CONSTRAINT `FK_m_interest_incentives_m_interest_rate_slab` FOREIGN KEY (`interest_rate_slab_id`) REFERENCES `m_interest_rate_slab` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_interest_incentives: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_interest_incentives: ~0 rows (approximately) /*!40000 ALTER TABLE `m_interest_incentives` DISABLE KEYS */; /*!40000 ALTER TABLE `m_interest_incentives` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_interest_rate_chart +-- Dumping structure for table fineract_default.m_interest_rate_chart DROP TABLE IF EXISTS `m_interest_rate_chart`; CREATE TABLE IF NOT EXISTS `m_interest_rate_chart` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -2125,12 +2125,12 @@ CREATE TABLE IF NOT EXISTS `m_interest_rate_chart` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_interest_rate_chart: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_interest_rate_chart: ~0 rows (approximately) /*!40000 ALTER TABLE `m_interest_rate_chart` DISABLE KEYS */; /*!40000 ALTER TABLE `m_interest_rate_chart` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_interest_rate_slab +-- Dumping structure for table fineract_default.m_interest_rate_slab DROP TABLE IF EXISTS `m_interest_rate_slab`; CREATE TABLE IF NOT EXISTS `m_interest_rate_slab` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -2148,12 +2148,12 @@ CREATE TABLE IF NOT EXISTS `m_interest_rate_slab` ( CONSTRAINT `FKIRS00000000000001` FOREIGN KEY (`interest_rate_chart_id`) REFERENCES `m_interest_rate_chart` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_interest_rate_slab: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_interest_rate_slab: ~0 rows (approximately) /*!40000 ALTER TABLE `m_interest_rate_slab` DISABLE KEYS */; /*!40000 ALTER TABLE `m_interest_rate_slab` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_loan +-- Dumping structure for table fineract_default.m_loan DROP TABLE IF EXISTS `m_loan`; CREATE TABLE IF NOT EXISTS `m_loan` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -2294,12 +2294,12 @@ CREATE TABLE IF NOT EXISTS `m_loan` ( CONSTRAINT `m_loan_ibfk_1` FOREIGN KEY (`group_id`) REFERENCES `m_group` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_loan: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_loan: ~0 rows (approximately) /*!40000 ALTER TABLE `m_loan` DISABLE KEYS */; /*!40000 ALTER TABLE `m_loan` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_loanproduct_provisioning_entry +-- Dumping structure for table fineract_default.m_loanproduct_provisioning_entry DROP TABLE IF EXISTS `m_loanproduct_provisioning_entry`; CREATE TABLE IF NOT EXISTS `m_loanproduct_provisioning_entry` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -2332,12 +2332,12 @@ CREATE TABLE IF NOT EXISTS `m_loanproduct_provisioning_entry` ( CONSTRAINT `m_loanproduct_provisioning_entry_ibfk_8` FOREIGN KEY (`expense_account`) REFERENCES `acc_gl_account` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_loanproduct_provisioning_entry: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_loanproduct_provisioning_entry: ~0 rows (approximately) /*!40000 ALTER TABLE `m_loanproduct_provisioning_entry` DISABLE KEYS */; /*!40000 ALTER TABLE `m_loanproduct_provisioning_entry` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_loanproduct_provisioning_mapping +-- Dumping structure for table fineract_default.m_loanproduct_provisioning_mapping DROP TABLE IF EXISTS `m_loanproduct_provisioning_mapping`; CREATE TABLE IF NOT EXISTS `m_loanproduct_provisioning_mapping` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -2350,12 +2350,12 @@ CREATE TABLE IF NOT EXISTS `m_loanproduct_provisioning_mapping` ( CONSTRAINT `m_loanproduct_provisioning_mapping_ibfk_2` FOREIGN KEY (`criteria_id`) REFERENCES `m_provisioning_criteria` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_loanproduct_provisioning_mapping: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_loanproduct_provisioning_mapping: ~0 rows (approximately) /*!40000 ALTER TABLE `m_loanproduct_provisioning_mapping` DISABLE KEYS */; /*!40000 ALTER TABLE `m_loanproduct_provisioning_mapping` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_loan_arrears_aging +-- Dumping structure for table fineract_default.m_loan_arrears_aging DROP TABLE IF EXISTS `m_loan_arrears_aging`; CREATE TABLE IF NOT EXISTS `m_loan_arrears_aging` ( `loan_id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -2369,12 +2369,12 @@ CREATE TABLE IF NOT EXISTS `m_loan_arrears_aging` ( CONSTRAINT `m_loan_arrears_aging_ibfk_1` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_loan_arrears_aging: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_loan_arrears_aging: ~0 rows (approximately) /*!40000 ALTER TABLE `m_loan_arrears_aging` DISABLE KEYS */; /*!40000 ALTER TABLE `m_loan_arrears_aging` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_loan_charge +-- Dumping structure for table fineract_default.m_loan_charge DROP TABLE IF EXISTS `m_loan_charge`; CREATE TABLE IF NOT EXISTS `m_loan_charge` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -2405,12 +2405,12 @@ CREATE TABLE IF NOT EXISTS `m_loan_charge` ( CONSTRAINT `m_loan_charge_ibfk_2` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_loan_charge: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_loan_charge: ~0 rows (approximately) /*!40000 ALTER TABLE `m_loan_charge` DISABLE KEYS */; /*!40000 ALTER TABLE `m_loan_charge` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_loan_charge_paid_by +-- Dumping structure for table fineract_default.m_loan_charge_paid_by DROP TABLE IF EXISTS `m_loan_charge_paid_by`; CREATE TABLE IF NOT EXISTS `m_loan_charge_paid_by` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -2425,12 +2425,12 @@ CREATE TABLE IF NOT EXISTS `m_loan_charge_paid_by` ( CONSTRAINT `FK__m_loan_transaction` FOREIGN KEY (`loan_transaction_id`) REFERENCES `m_loan_transaction` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_loan_charge_paid_by: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_loan_charge_paid_by: ~0 rows (approximately) /*!40000 ALTER TABLE `m_loan_charge_paid_by` DISABLE KEYS */; /*!40000 ALTER TABLE `m_loan_charge_paid_by` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_loan_collateral +-- Dumping structure for table fineract_default.m_loan_collateral DROP TABLE IF EXISTS `m_loan_collateral`; CREATE TABLE IF NOT EXISTS `m_loan_collateral` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -2445,12 +2445,12 @@ CREATE TABLE IF NOT EXISTS `m_loan_collateral` ( CONSTRAINT `FK_collateral_m_loan` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_loan_collateral: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_loan_collateral: ~0 rows (approximately) /*!40000 ALTER TABLE `m_loan_collateral` DISABLE KEYS */; /*!40000 ALTER TABLE `m_loan_collateral` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_loan_disbursement_detail +-- Dumping structure for table fineract_default.m_loan_disbursement_detail DROP TABLE IF EXISTS `m_loan_disbursement_detail`; CREATE TABLE IF NOT EXISTS `m_loan_disbursement_detail` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -2463,12 +2463,12 @@ CREATE TABLE IF NOT EXISTS `m_loan_disbursement_detail` ( CONSTRAINT `FK_loan_disbursement_detail_loan_id` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_loan_disbursement_detail: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_loan_disbursement_detail: ~0 rows (approximately) /*!40000 ALTER TABLE `m_loan_disbursement_detail` DISABLE KEYS */; /*!40000 ALTER TABLE `m_loan_disbursement_detail` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_loan_installment_charge +-- Dumping structure for table fineract_default.m_loan_installment_charge DROP TABLE IF EXISTS `m_loan_installment_charge`; CREATE TABLE IF NOT EXISTS `m_loan_installment_charge` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -2490,12 +2490,12 @@ CREATE TABLE IF NOT EXISTS `m_loan_installment_charge` ( CONSTRAINT `FK_loan_schedule_id_charge_schedule` FOREIGN KEY (`loan_schedule_id`) REFERENCES `m_loan_repayment_schedule` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_loan_installment_charge: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_loan_installment_charge: ~0 rows (approximately) /*!40000 ALTER TABLE `m_loan_installment_charge` DISABLE KEYS */; /*!40000 ALTER TABLE `m_loan_installment_charge` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_loan_interest_recalculation_additional_details +-- Dumping structure for table fineract_default.m_loan_interest_recalculation_additional_details DROP TABLE IF EXISTS `m_loan_interest_recalculation_additional_details`; CREATE TABLE IF NOT EXISTS `m_loan_interest_recalculation_additional_details` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -2507,12 +2507,12 @@ CREATE TABLE IF NOT EXISTS `m_loan_interest_recalculation_additional_details` ( CONSTRAINT `FK_additional_details_repayment_schedule_id` FOREIGN KEY (`loan_repayment_schedule_id`) REFERENCES `m_loan_repayment_schedule` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_loan_interest_recalculation_additional_details: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_loan_interest_recalculation_additional_details: ~0 rows (approximately) /*!40000 ALTER TABLE `m_loan_interest_recalculation_additional_details` DISABLE KEYS */; /*!40000 ALTER TABLE `m_loan_interest_recalculation_additional_details` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_loan_officer_assignment_history +-- Dumping structure for table fineract_default.m_loan_officer_assignment_history DROP TABLE IF EXISTS `m_loan_officer_assignment_history`; CREATE TABLE IF NOT EXISTS `m_loan_officer_assignment_history` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -2531,12 +2531,12 @@ CREATE TABLE IF NOT EXISTS `m_loan_officer_assignment_history` ( CONSTRAINT `fk_m_loan_officer_assignment_history_0002` FOREIGN KEY (`loan_officer_id`) REFERENCES `m_staff` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_loan_officer_assignment_history: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_loan_officer_assignment_history: ~0 rows (approximately) /*!40000 ALTER TABLE `m_loan_officer_assignment_history` DISABLE KEYS */; /*!40000 ALTER TABLE `m_loan_officer_assignment_history` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_loan_overdue_installment_charge +-- Dumping structure for table fineract_default.m_loan_overdue_installment_charge DROP TABLE IF EXISTS `m_loan_overdue_installment_charge`; CREATE TABLE IF NOT EXISTS `m_loan_overdue_installment_charge` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -2550,12 +2550,12 @@ CREATE TABLE IF NOT EXISTS `m_loan_overdue_installment_charge` ( CONSTRAINT `FK_m_loan_overdue_installment_charge_m_loan_repayment_schedule` FOREIGN KEY (`loan_schedule_id`) REFERENCES `m_loan_repayment_schedule` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_loan_overdue_installment_charge: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_loan_overdue_installment_charge: ~0 rows (approximately) /*!40000 ALTER TABLE `m_loan_overdue_installment_charge` DISABLE KEYS */; /*!40000 ALTER TABLE `m_loan_overdue_installment_charge` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_loan_paid_in_advance +-- Dumping structure for table fineract_default.m_loan_paid_in_advance DROP TABLE IF EXISTS `m_loan_paid_in_advance`; CREATE TABLE IF NOT EXISTS `m_loan_paid_in_advance` ( `loan_id` bigint(20) NOT NULL, @@ -2568,12 +2568,12 @@ CREATE TABLE IF NOT EXISTS `m_loan_paid_in_advance` ( CONSTRAINT `m_loan_paid_in_advance_ibfk_1` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_loan_paid_in_advance: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_loan_paid_in_advance: ~0 rows (approximately) /*!40000 ALTER TABLE `m_loan_paid_in_advance` DISABLE KEYS */; /*!40000 ALTER TABLE `m_loan_paid_in_advance` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_loan_recalculation_details +-- Dumping structure for table fineract_default.m_loan_recalculation_details DROP TABLE IF EXISTS `m_loan_recalculation_details`; CREATE TABLE IF NOT EXISTS `m_loan_recalculation_details` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -2597,12 +2597,12 @@ CREATE TABLE IF NOT EXISTS `m_loan_recalculation_details` ( CONSTRAINT `FK_m_loan_m_loan_recalculation_details` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; --- Dumping data for table mifostenant-default.m_loan_recalculation_details: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_loan_recalculation_details: ~0 rows (approximately) /*!40000 ALTER TABLE `m_loan_recalculation_details` DISABLE KEYS */; /*!40000 ALTER TABLE `m_loan_recalculation_details` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_loan_repayment_schedule +-- Dumping structure for table fineract_default.m_loan_repayment_schedule DROP TABLE IF EXISTS `m_loan_repayment_schedule`; CREATE TABLE IF NOT EXISTS `m_loan_repayment_schedule` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -2642,12 +2642,12 @@ CREATE TABLE IF NOT EXISTS `m_loan_repayment_schedule` ( CONSTRAINT `FK488B92AA40BE0710` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_loan_repayment_schedule: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_loan_repayment_schedule: ~0 rows (approximately) /*!40000 ALTER TABLE `m_loan_repayment_schedule` DISABLE KEYS */; /*!40000 ALTER TABLE `m_loan_repayment_schedule` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_loan_repayment_schedule_history +-- Dumping structure for table fineract_default.m_loan_repayment_schedule_history DROP TABLE IF EXISTS `m_loan_repayment_schedule_history`; CREATE TABLE IF NOT EXISTS `m_loan_repayment_schedule_history` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -2672,12 +2672,12 @@ CREATE TABLE IF NOT EXISTS `m_loan_repayment_schedule_history` ( CONSTRAINT `m_loan_repayment_schedule_history_ibfk_2` FOREIGN KEY (`loan_reschedule_request_id`) REFERENCES `m_loan_reschedule_request` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_loan_repayment_schedule_history: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_loan_repayment_schedule_history: ~0 rows (approximately) /*!40000 ALTER TABLE `m_loan_repayment_schedule_history` DISABLE KEYS */; /*!40000 ALTER TABLE `m_loan_repayment_schedule_history` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_loan_reschedule_request +-- Dumping structure for table fineract_default.m_loan_reschedule_request DROP TABLE IF EXISTS `m_loan_reschedule_request`; CREATE TABLE IF NOT EXISTS `m_loan_reschedule_request` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -2707,12 +2707,12 @@ CREATE TABLE IF NOT EXISTS `m_loan_reschedule_request` ( CONSTRAINT `m_loan_reschedule_request_ibfk_5` FOREIGN KEY (`rejected_by_user_id`) REFERENCES `m_appuser` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_loan_reschedule_request: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_loan_reschedule_request: ~0 rows (approximately) /*!40000 ALTER TABLE `m_loan_reschedule_request` DISABLE KEYS */; /*!40000 ALTER TABLE `m_loan_reschedule_request` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_loan_reschedule_request_term_variations_mapping +-- Dumping structure for table fineract_default.m_loan_reschedule_request_term_variations_mapping DROP TABLE IF EXISTS `m_loan_reschedule_request_term_variations_mapping`; CREATE TABLE IF NOT EXISTS `m_loan_reschedule_request_term_variations_mapping` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -2725,12 +2725,12 @@ CREATE TABLE IF NOT EXISTS `m_loan_reschedule_request_term_variations_mapping` ( CONSTRAINT `FK__m_loan_term_variations` FOREIGN KEY (`loan_term_variations_id`) REFERENCES `m_loan_term_variations` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_loan_reschedule_request_term_variations_mapping: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_loan_reschedule_request_term_variations_mapping: ~0 rows (approximately) /*!40000 ALTER TABLE `m_loan_reschedule_request_term_variations_mapping` DISABLE KEYS */; /*!40000 ALTER TABLE `m_loan_reschedule_request_term_variations_mapping` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_loan_term_variations +-- Dumping structure for table fineract_default.m_loan_term_variations DROP TABLE IF EXISTS `m_loan_term_variations`; CREATE TABLE IF NOT EXISTS `m_loan_term_variations` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -2748,12 +2748,12 @@ CREATE TABLE IF NOT EXISTS `m_loan_term_variations` ( CONSTRAINT `FK_loan_id_m_loan_id` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_loan_term_variations: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_loan_term_variations: ~0 rows (approximately) /*!40000 ALTER TABLE `m_loan_term_variations` DISABLE KEYS */; /*!40000 ALTER TABLE `m_loan_term_variations` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_loan_topup +-- Dumping structure for table fineract_default.m_loan_topup DROP TABLE IF EXISTS `m_loan_topup`; CREATE TABLE IF NOT EXISTS `m_loan_topup` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -2770,12 +2770,12 @@ CREATE TABLE IF NOT EXISTS `m_loan_topup` ( CONSTRAINT `m_loan_topup_FK_loan_id` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_loan_topup: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_loan_topup: ~0 rows (approximately) /*!40000 ALTER TABLE `m_loan_topup` DISABLE KEYS */; /*!40000 ALTER TABLE `m_loan_topup` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_loan_tranche_charges +-- Dumping structure for table fineract_default.m_loan_tranche_charges DROP TABLE IF EXISTS `m_loan_tranche_charges`; CREATE TABLE IF NOT EXISTS `m_loan_tranche_charges` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -2788,12 +2788,12 @@ CREATE TABLE IF NOT EXISTS `m_loan_tranche_charges` ( CONSTRAINT `FK_m_loan_tranche_charges_m_loan` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_loan_tranche_charges: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_loan_tranche_charges: ~0 rows (approximately) /*!40000 ALTER TABLE `m_loan_tranche_charges` DISABLE KEYS */; /*!40000 ALTER TABLE `m_loan_tranche_charges` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_loan_tranche_disbursement_charge +-- Dumping structure for table fineract_default.m_loan_tranche_disbursement_charge DROP TABLE IF EXISTS `m_loan_tranche_disbursement_charge`; CREATE TABLE IF NOT EXISTS `m_loan_tranche_disbursement_charge` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -2806,12 +2806,12 @@ CREATE TABLE IF NOT EXISTS `m_loan_tranche_disbursement_charge` ( CONSTRAINT `FK_m_loan_tranche_disbursement_charge_m_loan_disbursement_detail` FOREIGN KEY (`disbursement_detail_id`) REFERENCES `m_loan_disbursement_detail` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_loan_tranche_disbursement_charge: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_loan_tranche_disbursement_charge: ~0 rows (approximately) /*!40000 ALTER TABLE `m_loan_tranche_disbursement_charge` DISABLE KEYS */; /*!40000 ALTER TABLE `m_loan_tranche_disbursement_charge` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_loan_transaction +-- Dumping structure for table fineract_default.m_loan_transaction DROP TABLE IF EXISTS `m_loan_transaction`; CREATE TABLE IF NOT EXISTS `m_loan_transaction` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -2844,12 +2844,12 @@ CREATE TABLE IF NOT EXISTS `m_loan_transaction` ( CONSTRAINT `FK_m_loan_transaction_m_payment_detail` FOREIGN KEY (`payment_detail_id`) REFERENCES `m_payment_detail` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_loan_transaction: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_loan_transaction: ~0 rows (approximately) /*!40000 ALTER TABLE `m_loan_transaction` DISABLE KEYS */; /*!40000 ALTER TABLE `m_loan_transaction` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_loan_transaction_repayment_schedule_mapping +-- Dumping structure for table fineract_default.m_loan_transaction_repayment_schedule_mapping DROP TABLE IF EXISTS `m_loan_transaction_repayment_schedule_mapping`; CREATE TABLE IF NOT EXISTS `m_loan_transaction_repayment_schedule_mapping` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -2867,12 +2867,12 @@ CREATE TABLE IF NOT EXISTS `m_loan_transaction_repayment_schedule_mapping` ( CONSTRAINT `FK_mappings_m_loan_transaction` FOREIGN KEY (`loan_transaction_id`) REFERENCES `m_loan_transaction` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_loan_transaction_repayment_schedule_mapping: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_loan_transaction_repayment_schedule_mapping: ~0 rows (approximately) /*!40000 ALTER TABLE `m_loan_transaction_repayment_schedule_mapping` DISABLE KEYS */; /*!40000 ALTER TABLE `m_loan_transaction_repayment_schedule_mapping` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_mandatory_savings_schedule +-- Dumping structure for table fineract_default.m_mandatory_savings_schedule DROP TABLE IF EXISTS `m_mandatory_savings_schedule`; CREATE TABLE IF NOT EXISTS `m_mandatory_savings_schedule` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -2895,12 +2895,12 @@ CREATE TABLE IF NOT EXISTS `m_mandatory_savings_schedule` ( CONSTRAINT `FKMSS0000000001` FOREIGN KEY (`savings_account_id`) REFERENCES `m_savings_account` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_mandatory_savings_schedule: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_mandatory_savings_schedule: ~0 rows (approximately) /*!40000 ALTER TABLE `m_mandatory_savings_schedule` DISABLE KEYS */; /*!40000 ALTER TABLE `m_mandatory_savings_schedule` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_meeting +-- Dumping structure for table fineract_default.m_meeting DROP TABLE IF EXISTS `m_meeting`; CREATE TABLE IF NOT EXISTS `m_meeting` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -2911,12 +2911,12 @@ CREATE TABLE IF NOT EXISTS `m_meeting` ( CONSTRAINT `FK_m_calendar_instance_m_meeting` FOREIGN KEY (`calendar_instance_id`) REFERENCES `m_calendar_instance` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; --- Dumping data for table mifostenant-default.m_meeting: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_meeting: ~0 rows (approximately) /*!40000 ALTER TABLE `m_meeting` DISABLE KEYS */; /*!40000 ALTER TABLE `m_meeting` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_note +-- Dumping structure for table fineract_default.m_note DROP TABLE IF EXISTS `m_note`; CREATE TABLE IF NOT EXISTS `m_note` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -2950,12 +2950,12 @@ CREATE TABLE IF NOT EXISTS `m_note` ( CONSTRAINT `FK_savings_account_id` FOREIGN KEY (`savings_account_id`) REFERENCES `m_savings_account` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_note: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_note: ~0 rows (approximately) /*!40000 ALTER TABLE `m_note` DISABLE KEYS */; /*!40000 ALTER TABLE `m_note` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_office +-- Dumping structure for table fineract_default.m_office DROP TABLE IF EXISTS `m_office`; CREATE TABLE IF NOT EXISTS `m_office` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -2971,14 +2971,14 @@ CREATE TABLE IF NOT EXISTS `m_office` ( CONSTRAINT `FK2291C477E2551DCC` FOREIGN KEY (`parent_id`) REFERENCES `m_office` (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_office: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_office: ~0 rows (approximately) /*!40000 ALTER TABLE `m_office` DISABLE KEYS */; INSERT INTO `m_office` (`id`, `parent_id`, `hierarchy`, `external_id`, `name`, `opening_date`) VALUES (1, NULL, '.', '1', 'Head Office', '2009-01-01'); /*!40000 ALTER TABLE `m_office` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_office_transaction +-- Dumping structure for table fineract_default.m_office_transaction DROP TABLE IF EXISTS `m_office_transaction`; CREATE TABLE IF NOT EXISTS `m_office_transaction` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -2996,12 +2996,12 @@ CREATE TABLE IF NOT EXISTS `m_office_transaction` ( CONSTRAINT `FK1E37728B93C6C1B6` FOREIGN KEY (`to_office_id`) REFERENCES `m_office` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_office_transaction: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_office_transaction: ~0 rows (approximately) /*!40000 ALTER TABLE `m_office_transaction` DISABLE KEYS */; /*!40000 ALTER TABLE `m_office_transaction` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_organisation_currency +-- Dumping structure for table fineract_default.m_organisation_currency DROP TABLE IF EXISTS `m_organisation_currency`; CREATE TABLE IF NOT EXISTS `m_organisation_currency` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -3014,14 +3014,14 @@ CREATE TABLE IF NOT EXISTS `m_organisation_currency` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_organisation_currency: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_organisation_currency: ~0 rows (approximately) /*!40000 ALTER TABLE `m_organisation_currency` DISABLE KEYS */; INSERT INTO `m_organisation_currency` (`id`, `code`, `decimal_places`, `currency_multiplesof`, `name`, `display_symbol`, `internationalized_name_code`) VALUES (21, 'USD', 2, NULL, 'US Dollar', '$', 'currency.USD'); /*!40000 ALTER TABLE `m_organisation_currency` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_password_validation_policy +-- Dumping structure for table fineract_default.m_password_validation_policy DROP TABLE IF EXISTS `m_password_validation_policy`; CREATE TABLE IF NOT EXISTS `m_password_validation_policy` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -3032,7 +3032,7 @@ CREATE TABLE IF NOT EXISTS `m_password_validation_policy` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_password_validation_policy: ~2 rows (approximately) +-- Dumping data for table fineract_default.m_password_validation_policy: ~2 rows (approximately) /*!40000 ALTER TABLE `m_password_validation_policy` DISABLE KEYS */; INSERT INTO `m_password_validation_policy` (`id`, `regex`, `description`, `active`, `key`) VALUES (1, '^.{1,50}$', 'Password most be at least 1 character and not more that 50 characters long', 1, 'simple'), @@ -3040,7 +3040,7 @@ INSERT INTO `m_password_validation_policy` (`id`, `regex`, `description`, `activ /*!40000 ALTER TABLE `m_password_validation_policy` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_payment_detail +-- Dumping structure for table fineract_default.m_payment_detail DROP TABLE IF EXISTS `m_payment_detail`; CREATE TABLE IF NOT EXISTS `m_payment_detail` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -3055,12 +3055,12 @@ CREATE TABLE IF NOT EXISTS `m_payment_detail` ( CONSTRAINT `FK_m_payment_detail_m_payment_type` FOREIGN KEY (`payment_type_id`) REFERENCES `m_payment_type` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_payment_detail: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_payment_detail: ~0 rows (approximately) /*!40000 ALTER TABLE `m_payment_detail` DISABLE KEYS */; /*!40000 ALTER TABLE `m_payment_detail` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_payment_type +-- Dumping structure for table fineract_default.m_payment_type DROP TABLE IF EXISTS `m_payment_type`; CREATE TABLE IF NOT EXISTS `m_payment_type` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -3071,12 +3071,12 @@ CREATE TABLE IF NOT EXISTS `m_payment_type` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_payment_type: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_payment_type: ~0 rows (approximately) /*!40000 ALTER TABLE `m_payment_type` DISABLE KEYS */; /*!40000 ALTER TABLE `m_payment_type` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_permission +-- Dumping structure for table fineract_default.m_permission DROP TABLE IF EXISTS `m_permission`; CREATE TABLE IF NOT EXISTS `m_permission` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -3089,7 +3089,7 @@ CREATE TABLE IF NOT EXISTS `m_permission` ( UNIQUE KEY `code` (`code`) ) ENGINE=InnoDB AUTO_INCREMENT=767 DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_permission: ~744 rows (approximately) +-- Dumping data for table fineract_default.m_permission: ~744 rows (approximately) /*!40000 ALTER TABLE `m_permission` DISABLE KEYS */; INSERT INTO `m_permission` (`id`, `grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES (1, 'special', 'ALL_FUNCTIONS', NULL, NULL, 0), @@ -3839,7 +3839,7 @@ INSERT INTO `m_permission` (`id`, `grouping`, `code`, `entity_name`, `action_nam /*!40000 ALTER TABLE `m_permission` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_portfolio_account_associations +-- Dumping structure for table fineract_default.m_portfolio_account_associations DROP TABLE IF EXISTS `m_portfolio_account_associations`; CREATE TABLE IF NOT EXISTS `m_portfolio_account_associations` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -3860,12 +3860,12 @@ CREATE TABLE IF NOT EXISTS `m_portfolio_account_associations` ( CONSTRAINT `linked_savings_fk` FOREIGN KEY (`linked_savings_account_id`) REFERENCES `m_savings_account` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_portfolio_account_associations: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_portfolio_account_associations: ~0 rows (approximately) /*!40000 ALTER TABLE `m_portfolio_account_associations` DISABLE KEYS */; /*!40000 ALTER TABLE `m_portfolio_account_associations` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_portfolio_command_source +-- Dumping structure for table fineract_default.m_portfolio_command_source DROP TABLE IF EXISTS `m_portfolio_command_source`; CREATE TABLE IF NOT EXISTS `m_portfolio_command_source` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -3903,12 +3903,12 @@ CREATE TABLE IF NOT EXISTS `m_portfolio_command_source` ( CONSTRAINT `FK_m_maker_m_appuser` FOREIGN KEY (`maker_id`) REFERENCES `m_appuser` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_portfolio_command_source: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_portfolio_command_source: ~0 rows (approximately) /*!40000 ALTER TABLE `m_portfolio_command_source` DISABLE KEYS */; /*!40000 ALTER TABLE `m_portfolio_command_source` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_product_loan +-- Dumping structure for table fineract_default.m_product_loan DROP TABLE IF EXISTS `m_product_loan`; CREATE TABLE IF NOT EXISTS `m_product_loan` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -3976,12 +3976,12 @@ CREATE TABLE IF NOT EXISTS `m_product_loan` ( CONSTRAINT `FK_ltp_strategy` FOREIGN KEY (`loan_transaction_strategy_id`) REFERENCES `ref_loan_transaction_processing_strategy` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_product_loan: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_product_loan: ~0 rows (approximately) /*!40000 ALTER TABLE `m_product_loan` DISABLE KEYS */; /*!40000 ALTER TABLE `m_product_loan` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_product_loan_charge +-- Dumping structure for table fineract_default.m_product_loan_charge DROP TABLE IF EXISTS `m_product_loan_charge`; CREATE TABLE IF NOT EXISTS `m_product_loan_charge` ( `product_loan_id` bigint(20) NOT NULL, @@ -3992,12 +3992,12 @@ CREATE TABLE IF NOT EXISTS `m_product_loan_charge` ( CONSTRAINT `m_product_loan_charge_ibfk_2` FOREIGN KEY (`product_loan_id`) REFERENCES `m_product_loan` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_product_loan_charge: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_product_loan_charge: ~0 rows (approximately) /*!40000 ALTER TABLE `m_product_loan_charge` DISABLE KEYS */; /*!40000 ALTER TABLE `m_product_loan_charge` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_product_loan_configurable_attributes +-- Dumping structure for table fineract_default.m_product_loan_configurable_attributes DROP TABLE IF EXISTS `m_product_loan_configurable_attributes`; CREATE TABLE IF NOT EXISTS `m_product_loan_configurable_attributes` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -4015,12 +4015,12 @@ CREATE TABLE IF NOT EXISTS `m_product_loan_configurable_attributes` ( CONSTRAINT `fk_m_product_loan_configurable_attributes_0001` FOREIGN KEY (`loan_product_id`) REFERENCES `m_product_loan` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_product_loan_configurable_attributes: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_product_loan_configurable_attributes: ~0 rows (approximately) /*!40000 ALTER TABLE `m_product_loan_configurable_attributes` DISABLE KEYS */; /*!40000 ALTER TABLE `m_product_loan_configurable_attributes` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_product_loan_floating_rates +-- Dumping structure for table fineract_default.m_product_loan_floating_rates DROP TABLE IF EXISTS `m_product_loan_floating_rates`; CREATE TABLE IF NOT EXISTS `m_product_loan_floating_rates` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -4038,12 +4038,12 @@ CREATE TABLE IF NOT EXISTS `m_product_loan_floating_rates` ( CONSTRAINT `FK_mappings_m_product_loan_id` FOREIGN KEY (`loan_product_id`) REFERENCES `m_product_loan` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_product_loan_floating_rates: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_product_loan_floating_rates: ~0 rows (approximately) /*!40000 ALTER TABLE `m_product_loan_floating_rates` DISABLE KEYS */; /*!40000 ALTER TABLE `m_product_loan_floating_rates` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_product_loan_guarantee_details +-- Dumping structure for table fineract_default.m_product_loan_guarantee_details DROP TABLE IF EXISTS `m_product_loan_guarantee_details`; CREATE TABLE IF NOT EXISTS `m_product_loan_guarantee_details` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -4056,12 +4056,12 @@ CREATE TABLE IF NOT EXISTS `m_product_loan_guarantee_details` ( CONSTRAINT `FK_guarantee_details_loan_product` FOREIGN KEY (`loan_product_id`) REFERENCES `m_product_loan` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_product_loan_guarantee_details: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_product_loan_guarantee_details: ~0 rows (approximately) /*!40000 ALTER TABLE `m_product_loan_guarantee_details` DISABLE KEYS */; /*!40000 ALTER TABLE `m_product_loan_guarantee_details` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_product_loan_recalculation_details +-- Dumping structure for table fineract_default.m_product_loan_recalculation_details DROP TABLE IF EXISTS `m_product_loan_recalculation_details`; CREATE TABLE IF NOT EXISTS `m_product_loan_recalculation_details` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -4087,12 +4087,12 @@ CREATE TABLE IF NOT EXISTS `m_product_loan_recalculation_details` ( CONSTRAINT `FK_m_product_loan_m_product_loan_recalculation_details` FOREIGN KEY (`product_id`) REFERENCES `m_product_loan` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; --- Dumping data for table mifostenant-default.m_product_loan_recalculation_details: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_product_loan_recalculation_details: ~0 rows (approximately) /*!40000 ALTER TABLE `m_product_loan_recalculation_details` DISABLE KEYS */; /*!40000 ALTER TABLE `m_product_loan_recalculation_details` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_product_loan_variable_installment_config +-- Dumping structure for table fineract_default.m_product_loan_variable_installment_config DROP TABLE IF EXISTS `m_product_loan_variable_installment_config`; CREATE TABLE IF NOT EXISTS `m_product_loan_variable_installment_config` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -4104,12 +4104,12 @@ CREATE TABLE IF NOT EXISTS `m_product_loan_variable_installment_config` ( CONSTRAINT `FK_mappings_m_variable_product_loan_id` FOREIGN KEY (`loan_product_id`) REFERENCES `m_product_loan` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_product_loan_variable_installment_config: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_product_loan_variable_installment_config: ~0 rows (approximately) /*!40000 ALTER TABLE `m_product_loan_variable_installment_config` DISABLE KEYS */; /*!40000 ALTER TABLE `m_product_loan_variable_installment_config` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_product_loan_variations_borrower_cycle +-- Dumping structure for table fineract_default.m_product_loan_variations_borrower_cycle DROP TABLE IF EXISTS `m_product_loan_variations_borrower_cycle`; CREATE TABLE IF NOT EXISTS `m_product_loan_variations_borrower_cycle` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -4125,12 +4125,12 @@ CREATE TABLE IF NOT EXISTS `m_product_loan_variations_borrower_cycle` ( CONSTRAINT `borrower_cycle_loan_product_FK` FOREIGN KEY (`loan_product_id`) REFERENCES `m_product_loan` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_product_loan_variations_borrower_cycle: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_product_loan_variations_borrower_cycle: ~0 rows (approximately) /*!40000 ALTER TABLE `m_product_loan_variations_borrower_cycle` DISABLE KEYS */; /*!40000 ALTER TABLE `m_product_loan_variations_borrower_cycle` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_product_mix +-- Dumping structure for table fineract_default.m_product_mix DROP TABLE IF EXISTS `m_product_mix`; CREATE TABLE IF NOT EXISTS `m_product_mix` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -4143,12 +4143,12 @@ CREATE TABLE IF NOT EXISTS `m_product_mix` ( CONSTRAINT `FK_m_product_mix_restricted_product_id_to_m_product_loan` FOREIGN KEY (`restricted_product_id`) REFERENCES `m_product_loan` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_product_mix: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_product_mix: ~0 rows (approximately) /*!40000 ALTER TABLE `m_product_mix` DISABLE KEYS */; /*!40000 ALTER TABLE `m_product_mix` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_provisioning_criteria +-- Dumping structure for table fineract_default.m_provisioning_criteria DROP TABLE IF EXISTS `m_provisioning_criteria`; CREATE TABLE IF NOT EXISTS `m_provisioning_criteria` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -4165,12 +4165,12 @@ CREATE TABLE IF NOT EXISTS `m_provisioning_criteria` ( CONSTRAINT `m_provisioning_criteria_ibfk_2` FOREIGN KEY (`lastmodifiedby_id`) REFERENCES `m_appuser` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_provisioning_criteria: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_provisioning_criteria: ~0 rows (approximately) /*!40000 ALTER TABLE `m_provisioning_criteria` DISABLE KEYS */; /*!40000 ALTER TABLE `m_provisioning_criteria` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_provisioning_criteria_definition +-- Dumping structure for table fineract_default.m_provisioning_criteria_definition DROP TABLE IF EXISTS `m_provisioning_criteria_definition`; CREATE TABLE IF NOT EXISTS `m_provisioning_criteria_definition` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -4192,12 +4192,12 @@ CREATE TABLE IF NOT EXISTS `m_provisioning_criteria_definition` ( CONSTRAINT `m_provisioning_criteria_definition_ibfk_4` FOREIGN KEY (`expense_account`) REFERENCES `acc_gl_account` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_provisioning_criteria_definition: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_provisioning_criteria_definition: ~0 rows (approximately) /*!40000 ALTER TABLE `m_provisioning_criteria_definition` DISABLE KEYS */; /*!40000 ALTER TABLE `m_provisioning_criteria_definition` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_provisioning_history +-- Dumping structure for table fineract_default.m_provisioning_history DROP TABLE IF EXISTS `m_provisioning_history`; CREATE TABLE IF NOT EXISTS `m_provisioning_history` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -4213,12 +4213,12 @@ CREATE TABLE IF NOT EXISTS `m_provisioning_history` ( CONSTRAINT `m_provisioning_history_ibfk_2` FOREIGN KEY (`lastmodifiedby_id`) REFERENCES `m_appuser` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_provisioning_history: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_provisioning_history: ~0 rows (approximately) /*!40000 ALTER TABLE `m_provisioning_history` DISABLE KEYS */; /*!40000 ALTER TABLE `m_provisioning_history` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_provision_category +-- Dumping structure for table fineract_default.m_provision_category DROP TABLE IF EXISTS `m_provision_category`; CREATE TABLE IF NOT EXISTS `m_provision_category` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -4228,7 +4228,7 @@ CREATE TABLE IF NOT EXISTS `m_provision_category` ( UNIQUE KEY `category_name` (`category_name`) ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_provision_category: ~4 rows (approximately) +-- Dumping data for table fineract_default.m_provision_category: ~4 rows (approximately) /*!40000 ALTER TABLE `m_provision_category` DISABLE KEYS */; INSERT INTO `m_provision_category` (`id`, `category_name`, `description`) VALUES (1, 'STANDARD', 'Punctual Payment without any dues'), @@ -4238,7 +4238,7 @@ INSERT INTO `m_provision_category` (`id`, `category_name`, `description`) VALUES /*!40000 ALTER TABLE `m_provision_category` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_report_mailing_job +-- Dumping structure for table fineract_default.m_report_mailing_job DROP TABLE IF EXISTS `m_report_mailing_job`; CREATE TABLE IF NOT EXISTS `m_report_mailing_job` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -4277,12 +4277,12 @@ CREATE TABLE IF NOT EXISTS `m_report_mailing_job` ( CONSTRAINT `m_report_mailing_job_ibfk_4` FOREIGN KEY (`run_as_userid`) REFERENCES `m_appuser` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_report_mailing_job: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_report_mailing_job: ~0 rows (approximately) /*!40000 ALTER TABLE `m_report_mailing_job` DISABLE KEYS */; /*!40000 ALTER TABLE `m_report_mailing_job` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_report_mailing_job_configuration +-- Dumping structure for table fineract_default.m_report_mailing_job_configuration DROP TABLE IF EXISTS `m_report_mailing_job_configuration`; CREATE TABLE IF NOT EXISTS `m_report_mailing_job_configuration` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -4292,7 +4292,7 @@ CREATE TABLE IF NOT EXISTS `m_report_mailing_job_configuration` ( UNIQUE KEY `unique_name` (`name`) ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_report_mailing_job_configuration: ~4 rows (approximately) +-- Dumping data for table fineract_default.m_report_mailing_job_configuration: ~4 rows (approximately) /*!40000 ALTER TABLE `m_report_mailing_job_configuration` DISABLE KEYS */; INSERT INTO `m_report_mailing_job_configuration` (`id`, `name`, `value`) VALUES (1, 'GMAIL_SMTP_SERVER', 'smtp.gmail.com'), @@ -4302,7 +4302,7 @@ INSERT INTO `m_report_mailing_job_configuration` (`id`, `name`, `value`) VALUES /*!40000 ALTER TABLE `m_report_mailing_job_configuration` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_report_mailing_job_run_history +-- Dumping structure for table fineract_default.m_report_mailing_job_run_history DROP TABLE IF EXISTS `m_report_mailing_job_run_history`; CREATE TABLE IF NOT EXISTS `m_report_mailing_job_run_history` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -4317,12 +4317,12 @@ CREATE TABLE IF NOT EXISTS `m_report_mailing_job_run_history` ( CONSTRAINT `m_report_mailing_job_run_history_ibfk_1` FOREIGN KEY (`job_id`) REFERENCES `m_report_mailing_job` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_report_mailing_job_run_history: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_report_mailing_job_run_history: ~0 rows (approximately) /*!40000 ALTER TABLE `m_report_mailing_job_run_history` DISABLE KEYS */; /*!40000 ALTER TABLE `m_report_mailing_job_run_history` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_role +-- Dumping structure for table fineract_default.m_role DROP TABLE IF EXISTS `m_role`; CREATE TABLE IF NOT EXISTS `m_role` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -4333,14 +4333,14 @@ CREATE TABLE IF NOT EXISTS `m_role` ( UNIQUE KEY `unq_name` (`name`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_role: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_role: ~0 rows (approximately) /*!40000 ALTER TABLE `m_role` DISABLE KEYS */; INSERT INTO `m_role` (`id`, `name`, `description`, `is_disabled`) VALUES (1, 'Super user', 'This role provides all application permissions.', 0); /*!40000 ALTER TABLE `m_role` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_role_permission +-- Dumping structure for table fineract_default.m_role_permission DROP TABLE IF EXISTS `m_role_permission`; CREATE TABLE IF NOT EXISTS `m_role_permission` ( `role_id` bigint(20) NOT NULL, @@ -4352,14 +4352,14 @@ CREATE TABLE IF NOT EXISTS `m_role_permission` ( CONSTRAINT `FK8DEDB04815CEC7AB` FOREIGN KEY (`role_id`) REFERENCES `m_role` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_role_permission: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_role_permission: ~0 rows (approximately) /*!40000 ALTER TABLE `m_role_permission` DISABLE KEYS */; INSERT INTO `m_role_permission` (`role_id`, `permission_id`) VALUES (1, 1); /*!40000 ALTER TABLE `m_role_permission` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_savings_account +-- Dumping structure for table fineract_default.m_savings_account DROP TABLE IF EXISTS `m_savings_account`; CREATE TABLE IF NOT EXISTS `m_savings_account` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -4435,12 +4435,12 @@ CREATE TABLE IF NOT EXISTS `m_savings_account` ( CONSTRAINT `FK_savings_account_tax_group` FOREIGN KEY (`tax_group_id`) REFERENCES `m_tax_group` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_savings_account: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_savings_account: ~0 rows (approximately) /*!40000 ALTER TABLE `m_savings_account` DISABLE KEYS */; /*!40000 ALTER TABLE `m_savings_account` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_savings_account_charge +-- Dumping structure for table fineract_default.m_savings_account_charge DROP TABLE IF EXISTS `m_savings_account_charge`; CREATE TABLE IF NOT EXISTS `m_savings_account_charge` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -4471,12 +4471,12 @@ CREATE TABLE IF NOT EXISTS `m_savings_account_charge` ( CONSTRAINT `m_savings_account_charge_ibfk_2` FOREIGN KEY (`savings_account_id`) REFERENCES `m_savings_account` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_savings_account_charge: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_savings_account_charge: ~0 rows (approximately) /*!40000 ALTER TABLE `m_savings_account_charge` DISABLE KEYS */; /*!40000 ALTER TABLE `m_savings_account_charge` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_savings_account_charge_paid_by +-- Dumping structure for table fineract_default.m_savings_account_charge_paid_by DROP TABLE IF EXISTS `m_savings_account_charge_paid_by`; CREATE TABLE IF NOT EXISTS `m_savings_account_charge_paid_by` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -4490,12 +4490,12 @@ CREATE TABLE IF NOT EXISTS `m_savings_account_charge_paid_by` ( CONSTRAINT `FK__m_savings_account_transaction` FOREIGN KEY (`savings_account_transaction_id`) REFERENCES `m_savings_account_transaction` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_savings_account_charge_paid_by: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_savings_account_charge_paid_by: ~0 rows (approximately) /*!40000 ALTER TABLE `m_savings_account_charge_paid_by` DISABLE KEYS */; /*!40000 ALTER TABLE `m_savings_account_charge_paid_by` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_savings_account_interest_rate_chart +-- Dumping structure for table fineract_default.m_savings_account_interest_rate_chart DROP TABLE IF EXISTS `m_savings_account_interest_rate_chart`; CREATE TABLE IF NOT EXISTS `m_savings_account_interest_rate_chart` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -4510,12 +4510,12 @@ CREATE TABLE IF NOT EXISTS `m_savings_account_interest_rate_chart` ( CONSTRAINT `FKSAIRC00000000000001` FOREIGN KEY (`savings_account_id`) REFERENCES `m_savings_account` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_savings_account_interest_rate_chart: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_savings_account_interest_rate_chart: ~0 rows (approximately) /*!40000 ALTER TABLE `m_savings_account_interest_rate_chart` DISABLE KEYS */; /*!40000 ALTER TABLE `m_savings_account_interest_rate_chart` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_savings_account_interest_rate_slab +-- Dumping structure for table fineract_default.m_savings_account_interest_rate_slab DROP TABLE IF EXISTS `m_savings_account_interest_rate_slab`; CREATE TABLE IF NOT EXISTS `m_savings_account_interest_rate_slab` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -4533,12 +4533,12 @@ CREATE TABLE IF NOT EXISTS `m_savings_account_interest_rate_slab` ( CONSTRAINT `FKSAIRS00000000000001` FOREIGN KEY (`savings_account_interest_rate_chart_id`) REFERENCES `m_savings_account_interest_rate_chart` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_savings_account_interest_rate_slab: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_savings_account_interest_rate_slab: ~0 rows (approximately) /*!40000 ALTER TABLE `m_savings_account_interest_rate_slab` DISABLE KEYS */; /*!40000 ALTER TABLE `m_savings_account_interest_rate_slab` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_savings_account_transaction +-- Dumping structure for table fineract_default.m_savings_account_transaction DROP TABLE IF EXISTS `m_savings_account_transaction`; CREATE TABLE IF NOT EXISTS `m_savings_account_transaction` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -4566,12 +4566,12 @@ CREATE TABLE IF NOT EXISTS `m_savings_account_transaction` ( CONSTRAINT `FK_m_savings_account_transaction_m_payment_detail` FOREIGN KEY (`payment_detail_id`) REFERENCES `m_payment_detail` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_savings_account_transaction: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_savings_account_transaction: ~0 rows (approximately) /*!40000 ALTER TABLE `m_savings_account_transaction` DISABLE KEYS */; /*!40000 ALTER TABLE `m_savings_account_transaction` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_savings_account_transaction_tax_details +-- Dumping structure for table fineract_default.m_savings_account_transaction_tax_details DROP TABLE IF EXISTS `m_savings_account_transaction_tax_details`; CREATE TABLE IF NOT EXISTS `m_savings_account_transaction_tax_details` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -4585,12 +4585,12 @@ CREATE TABLE IF NOT EXISTS `m_savings_account_transaction_tax_details` ( CONSTRAINT `FK_savings_account_transaction_tax_details_tax_component` FOREIGN KEY (`tax_component_id`) REFERENCES `m_tax_component` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_savings_account_transaction_tax_details: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_savings_account_transaction_tax_details: ~0 rows (approximately) /*!40000 ALTER TABLE `m_savings_account_transaction_tax_details` DISABLE KEYS */; /*!40000 ALTER TABLE `m_savings_account_transaction_tax_details` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_savings_interest_incentives +-- Dumping structure for table fineract_default.m_savings_interest_incentives DROP TABLE IF EXISTS `m_savings_interest_incentives`; CREATE TABLE IF NOT EXISTS `m_savings_interest_incentives` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -4606,12 +4606,12 @@ CREATE TABLE IF NOT EXISTS `m_savings_interest_incentives` ( CONSTRAINT `FK_m_savings_interest_incentives_m_savings_interest_rate_slab` FOREIGN KEY (`deposit_account_interest_rate_slab_id`) REFERENCES `m_savings_account_interest_rate_slab` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_savings_interest_incentives: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_savings_interest_incentives: ~0 rows (approximately) /*!40000 ALTER TABLE `m_savings_interest_incentives` DISABLE KEYS */; /*!40000 ALTER TABLE `m_savings_interest_incentives` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_savings_officer_assignment_history +-- Dumping structure for table fineract_default.m_savings_officer_assignment_history DROP TABLE IF EXISTS `m_savings_officer_assignment_history`; CREATE TABLE IF NOT EXISTS `m_savings_officer_assignment_history` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -4630,12 +4630,12 @@ CREATE TABLE IF NOT EXISTS `m_savings_officer_assignment_history` ( CONSTRAINT `fk_m_savings_officer_assignment_history_0002` FOREIGN KEY (`savings_officer_id`) REFERENCES `m_staff` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_savings_officer_assignment_history: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_savings_officer_assignment_history: ~0 rows (approximately) /*!40000 ALTER TABLE `m_savings_officer_assignment_history` DISABLE KEYS */; /*!40000 ALTER TABLE `m_savings_officer_assignment_history` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_savings_product +-- Dumping structure for table fineract_default.m_savings_product DROP TABLE IF EXISTS `m_savings_product`; CREATE TABLE IF NOT EXISTS `m_savings_product` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -4678,12 +4678,12 @@ CREATE TABLE IF NOT EXISTS `m_savings_product` ( CONSTRAINT `FK_savings_product_tax_group` FOREIGN KEY (`tax_group_id`) REFERENCES `m_tax_group` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_savings_product: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_savings_product: ~0 rows (approximately) /*!40000 ALTER TABLE `m_savings_product` DISABLE KEYS */; /*!40000 ALTER TABLE `m_savings_product` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_savings_product_charge +-- Dumping structure for table fineract_default.m_savings_product_charge DROP TABLE IF EXISTS `m_savings_product_charge`; CREATE TABLE IF NOT EXISTS `m_savings_product_charge` ( `savings_product_id` bigint(20) NOT NULL, @@ -4694,12 +4694,12 @@ CREATE TABLE IF NOT EXISTS `m_savings_product_charge` ( CONSTRAINT `m_savings_product_charge_ibfk_2` FOREIGN KEY (`savings_product_id`) REFERENCES `m_savings_product` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_savings_product_charge: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_savings_product_charge: ~0 rows (approximately) /*!40000 ALTER TABLE `m_savings_product_charge` DISABLE KEYS */; /*!40000 ALTER TABLE `m_savings_product_charge` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_selfservice_beneficiaries_tpt +-- Dumping structure for table fineract_default.m_selfservice_beneficiaries_tpt DROP TABLE IF EXISTS `m_selfservice_beneficiaries_tpt`; CREATE TABLE IF NOT EXISTS `m_selfservice_beneficiaries_tpt` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -4715,12 +4715,12 @@ CREATE TABLE IF NOT EXISTS `m_selfservice_beneficiaries_tpt` ( UNIQUE KEY `name` (`name`,`app_user_id`,`is_active`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_selfservice_beneficiaries_tpt: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_selfservice_beneficiaries_tpt: ~0 rows (approximately) /*!40000 ALTER TABLE `m_selfservice_beneficiaries_tpt` DISABLE KEYS */; /*!40000 ALTER TABLE `m_selfservice_beneficiaries_tpt` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_selfservice_user_client_mapping +-- Dumping structure for table fineract_default.m_selfservice_user_client_mapping DROP TABLE IF EXISTS `m_selfservice_user_client_mapping`; CREATE TABLE IF NOT EXISTS `m_selfservice_user_client_mapping` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -4733,12 +4733,12 @@ CREATE TABLE IF NOT EXISTS `m_selfservice_user_client_mapping` ( CONSTRAINT `m_selfservice_client_id` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_selfservice_user_client_mapping: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_selfservice_user_client_mapping: ~0 rows (approximately) /*!40000 ALTER TABLE `m_selfservice_user_client_mapping` DISABLE KEYS */; /*!40000 ALTER TABLE `m_selfservice_user_client_mapping` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_share_account +-- Dumping structure for table fineract_default.m_share_account DROP TABLE IF EXISTS `m_share_account`; CREATE TABLE IF NOT EXISTS `m_share_account` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -4792,12 +4792,12 @@ CREATE TABLE IF NOT EXISTS `m_share_account` ( CONSTRAINT `m_share_account_ibfk_9` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_share_account: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_share_account: ~0 rows (approximately) /*!40000 ALTER TABLE `m_share_account` DISABLE KEYS */; /*!40000 ALTER TABLE `m_share_account` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_share_account_charge +-- Dumping structure for table fineract_default.m_share_account_charge DROP TABLE IF EXISTS `m_share_account_charge`; CREATE TABLE IF NOT EXISTS `m_share_account_charge` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -4826,12 +4826,12 @@ CREATE TABLE IF NOT EXISTS `m_share_account_charge` ( CONSTRAINT `m_share_account_charge_ibfk_2` FOREIGN KEY (`account_id`) REFERENCES `m_share_account` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_share_account_charge: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_share_account_charge: ~0 rows (approximately) /*!40000 ALTER TABLE `m_share_account_charge` DISABLE KEYS */; /*!40000 ALTER TABLE `m_share_account_charge` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_share_account_charge_paid_by +-- Dumping structure for table fineract_default.m_share_account_charge_paid_by DROP TABLE IF EXISTS `m_share_account_charge_paid_by`; CREATE TABLE IF NOT EXISTS `m_share_account_charge_paid_by` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -4845,12 +4845,12 @@ CREATE TABLE IF NOT EXISTS `m_share_account_charge_paid_by` ( CONSTRAINT `m_share_account_transactions_charge_mapping_ibfk2` FOREIGN KEY (`charge_transaction_id`) REFERENCES `m_share_account_charge` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_share_account_charge_paid_by: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_share_account_charge_paid_by: ~0 rows (approximately) /*!40000 ALTER TABLE `m_share_account_charge_paid_by` DISABLE KEYS */; /*!40000 ALTER TABLE `m_share_account_charge_paid_by` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_share_account_dividend_details +-- Dumping structure for table fineract_default.m_share_account_dividend_details DROP TABLE IF EXISTS `m_share_account_dividend_details`; CREATE TABLE IF NOT EXISTS `m_share_account_dividend_details` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -4866,12 +4866,12 @@ CREATE TABLE IF NOT EXISTS `m_share_account_dividend_details` ( CONSTRAINT `FK_m_share_account_dividend_details_dividend_pay_out_id` FOREIGN KEY (`dividend_pay_out_id`) REFERENCES `m_share_product_dividend_pay_out` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_share_account_dividend_details: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_share_account_dividend_details: ~0 rows (approximately) /*!40000 ALTER TABLE `m_share_account_dividend_details` DISABLE KEYS */; /*!40000 ALTER TABLE `m_share_account_dividend_details` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_share_account_transactions +-- Dumping structure for table fineract_default.m_share_account_transactions DROP TABLE IF EXISTS `m_share_account_transactions`; CREATE TABLE IF NOT EXISTS `m_share_account_transactions` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -4890,12 +4890,12 @@ CREATE TABLE IF NOT EXISTS `m_share_account_transactions` ( CONSTRAINT `m_share_account_purchased_shares_ibfk_1` FOREIGN KEY (`account_id`) REFERENCES `m_share_account` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_share_account_transactions: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_share_account_transactions: ~0 rows (approximately) /*!40000 ALTER TABLE `m_share_account_transactions` DISABLE KEYS */; /*!40000 ALTER TABLE `m_share_account_transactions` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_share_product +-- Dumping structure for table fineract_default.m_share_product DROP TABLE IF EXISTS `m_share_product`; CREATE TABLE IF NOT EXISTS `m_share_product` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -4934,12 +4934,12 @@ CREATE TABLE IF NOT EXISTS `m_share_product` ( CONSTRAINT `m_share_product_ibfk_2` FOREIGN KEY (`lastmodifiedby_id`) REFERENCES `m_appuser` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_share_product: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_share_product: ~0 rows (approximately) /*!40000 ALTER TABLE `m_share_product` DISABLE KEYS */; /*!40000 ALTER TABLE `m_share_product` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_share_product_charge +-- Dumping structure for table fineract_default.m_share_product_charge DROP TABLE IF EXISTS `m_share_product_charge`; CREATE TABLE IF NOT EXISTS `m_share_product_charge` ( `product_id` bigint(20) NOT NULL, @@ -4950,12 +4950,12 @@ CREATE TABLE IF NOT EXISTS `m_share_product_charge` ( CONSTRAINT `m_share_product_charge_ibfk_2` FOREIGN KEY (`product_id`) REFERENCES `m_share_product` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_share_product_charge: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_share_product_charge: ~0 rows (approximately) /*!40000 ALTER TABLE `m_share_product_charge` DISABLE KEYS */; /*!40000 ALTER TABLE `m_share_product_charge` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_share_product_dividend_pay_out +-- Dumping structure for table fineract_default.m_share_product_dividend_pay_out DROP TABLE IF EXISTS `m_share_product_dividend_pay_out`; CREATE TABLE IF NOT EXISTS `m_share_product_dividend_pay_out` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -4977,12 +4977,12 @@ CREATE TABLE IF NOT EXISTS `m_share_product_dividend_pay_out` ( CONSTRAINT `FK_m_share_product_dividend_pay_out_product_id` FOREIGN KEY (`product_id`) REFERENCES `m_share_product` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_share_product_dividend_pay_out: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_share_product_dividend_pay_out: ~0 rows (approximately) /*!40000 ALTER TABLE `m_share_product_dividend_pay_out` DISABLE KEYS */; /*!40000 ALTER TABLE `m_share_product_dividend_pay_out` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_share_product_market_price +-- Dumping structure for table fineract_default.m_share_product_market_price DROP TABLE IF EXISTS `m_share_product_market_price`; CREATE TABLE IF NOT EXISTS `m_share_product_market_price` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -4994,12 +4994,12 @@ CREATE TABLE IF NOT EXISTS `m_share_product_market_price` ( CONSTRAINT `m_share_product_market_price_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `m_share_product` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_share_product_market_price: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_share_product_market_price: ~0 rows (approximately) /*!40000 ALTER TABLE `m_share_product_market_price` DISABLE KEYS */; /*!40000 ALTER TABLE `m_share_product_market_price` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_staff +-- Dumping structure for table fineract_default.m_staff DROP TABLE IF EXISTS `m_staff`; CREATE TABLE IF NOT EXISTS `m_staff` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -5025,12 +5025,12 @@ CREATE TABLE IF NOT EXISTS `m_staff` ( CONSTRAINT `FK_m_staff_m_office` FOREIGN KEY (`office_id`) REFERENCES `m_office` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_staff: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_staff: ~0 rows (approximately) /*!40000 ALTER TABLE `m_staff` DISABLE KEYS */; /*!40000 ALTER TABLE `m_staff` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_staff_assignment_history +-- Dumping structure for table fineract_default.m_staff_assignment_history DROP TABLE IF EXISTS `m_staff_assignment_history`; CREATE TABLE IF NOT EXISTS `m_staff_assignment_history` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -5049,12 +5049,12 @@ CREATE TABLE IF NOT EXISTS `m_staff_assignment_history` ( CONSTRAINT `FK_m_staff_assignment_history_m_staff` FOREIGN KEY (`staff_id`) REFERENCES `m_staff` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_staff_assignment_history: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_staff_assignment_history: ~0 rows (approximately) /*!40000 ALTER TABLE `m_staff_assignment_history` DISABLE KEYS */; /*!40000 ALTER TABLE `m_staff_assignment_history` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_surveys +-- Dumping structure for table fineract_default.m_surveys DROP TABLE IF EXISTS `m_surveys`; CREATE TABLE IF NOT EXISTS `m_surveys` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -5067,12 +5067,12 @@ CREATE TABLE IF NOT EXISTS `m_surveys` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_surveys: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_surveys: ~0 rows (approximately) /*!40000 ALTER TABLE `m_surveys` DISABLE KEYS */; /*!40000 ALTER TABLE `m_surveys` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_survey_components +-- Dumping structure for table fineract_default.m_survey_components DROP TABLE IF EXISTS `m_survey_components`; CREATE TABLE IF NOT EXISTS `m_survey_components` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -5086,12 +5086,12 @@ CREATE TABLE IF NOT EXISTS `m_survey_components` ( CONSTRAINT `m_survey_components_ibfk_1` FOREIGN KEY (`survey_id`) REFERENCES `m_surveys` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_survey_components: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_survey_components: ~0 rows (approximately) /*!40000 ALTER TABLE `m_survey_components` DISABLE KEYS */; /*!40000 ALTER TABLE `m_survey_components` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_survey_lookup_tables +-- Dumping structure for table fineract_default.m_survey_lookup_tables DROP TABLE IF EXISTS `m_survey_lookup_tables`; CREATE TABLE IF NOT EXISTS `m_survey_lookup_tables` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -5106,12 +5106,12 @@ CREATE TABLE IF NOT EXISTS `m_survey_lookup_tables` ( CONSTRAINT `m_survey_lookup_tables_ibfk_1` FOREIGN KEY (`survey_id`) REFERENCES `m_surveys` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_survey_lookup_tables: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_survey_lookup_tables: ~0 rows (approximately) /*!40000 ALTER TABLE `m_survey_lookup_tables` DISABLE KEYS */; /*!40000 ALTER TABLE `m_survey_lookup_tables` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_survey_questions +-- Dumping structure for table fineract_default.m_survey_questions DROP TABLE IF EXISTS `m_survey_questions`; CREATE TABLE IF NOT EXISTS `m_survey_questions` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -5126,12 +5126,12 @@ CREATE TABLE IF NOT EXISTS `m_survey_questions` ( CONSTRAINT `m_survey_questions_ibfk_1` FOREIGN KEY (`survey_id`) REFERENCES `m_surveys` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_survey_questions: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_survey_questions: ~0 rows (approximately) /*!40000 ALTER TABLE `m_survey_questions` DISABLE KEYS */; /*!40000 ALTER TABLE `m_survey_questions` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_survey_responses +-- Dumping structure for table fineract_default.m_survey_responses DROP TABLE IF EXISTS `m_survey_responses`; CREATE TABLE IF NOT EXISTS `m_survey_responses` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -5144,12 +5144,12 @@ CREATE TABLE IF NOT EXISTS `m_survey_responses` ( CONSTRAINT `m_survey_responses_ibfk_1` FOREIGN KEY (`question_id`) REFERENCES `m_survey_questions` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_survey_responses: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_survey_responses: ~0 rows (approximately) /*!40000 ALTER TABLE `m_survey_responses` DISABLE KEYS */; /*!40000 ALTER TABLE `m_survey_responses` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_survey_scorecards +-- Dumping structure for table fineract_default.m_survey_scorecards DROP TABLE IF EXISTS `m_survey_scorecards`; CREATE TABLE IF NOT EXISTS `m_survey_scorecards` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -5173,12 +5173,12 @@ CREATE TABLE IF NOT EXISTS `m_survey_scorecards` ( CONSTRAINT `m_survey_scorecards_ibfk_5` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_survey_scorecards: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_survey_scorecards: ~0 rows (approximately) /*!40000 ALTER TABLE `m_survey_scorecards` DISABLE KEYS */; /*!40000 ALTER TABLE `m_survey_scorecards` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_tax_component +-- Dumping structure for table fineract_default.m_tax_component DROP TABLE IF EXISTS `m_tax_component`; CREATE TABLE IF NOT EXISTS `m_tax_component` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -5204,12 +5204,12 @@ CREATE TABLE IF NOT EXISTS `m_tax_component` ( CONSTRAINT `FK_tax_component_lastmodifiedby` FOREIGN KEY (`lastmodifiedby_id`) REFERENCES `m_appuser` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_tax_component: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_tax_component: ~0 rows (approximately) /*!40000 ALTER TABLE `m_tax_component` DISABLE KEYS */; /*!40000 ALTER TABLE `m_tax_component` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_tax_component_history +-- Dumping structure for table fineract_default.m_tax_component_history DROP TABLE IF EXISTS `m_tax_component_history`; CREATE TABLE IF NOT EXISTS `m_tax_component_history` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -5230,12 +5230,12 @@ CREATE TABLE IF NOT EXISTS `m_tax_component_history` ( CONSTRAINT `FK_tax_component_history_tax_component_id` FOREIGN KEY (`tax_component_id`) REFERENCES `m_tax_component` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_tax_component_history: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_tax_component_history: ~0 rows (approximately) /*!40000 ALTER TABLE `m_tax_component_history` DISABLE KEYS */; /*!40000 ALTER TABLE `m_tax_component_history` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_tax_group +-- Dumping structure for table fineract_default.m_tax_group DROP TABLE IF EXISTS `m_tax_group`; CREATE TABLE IF NOT EXISTS `m_tax_group` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -5251,12 +5251,12 @@ CREATE TABLE IF NOT EXISTS `m_tax_group` ( CONSTRAINT `FK_tax_group_lastmodifiedby` FOREIGN KEY (`lastmodifiedby_id`) REFERENCES `m_appuser` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_tax_group: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_tax_group: ~0 rows (approximately) /*!40000 ALTER TABLE `m_tax_group` DISABLE KEYS */; /*!40000 ALTER TABLE `m_tax_group` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_tax_group_mappings +-- Dumping structure for table fineract_default.m_tax_group_mappings DROP TABLE IF EXISTS `m_tax_group_mappings`; CREATE TABLE IF NOT EXISTS `m_tax_group_mappings` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -5279,12 +5279,12 @@ CREATE TABLE IF NOT EXISTS `m_tax_group_mappings` ( CONSTRAINT `FK_tax_group_mappings_tax_group` FOREIGN KEY (`tax_group_id`) REFERENCES `m_tax_group` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_tax_group_mappings: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_tax_group_mappings: ~0 rows (approximately) /*!40000 ALTER TABLE `m_tax_group_mappings` DISABLE KEYS */; /*!40000 ALTER TABLE `m_tax_group_mappings` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_tellers +-- Dumping structure for table fineract_default.m_tellers DROP TABLE IF EXISTS `m_tellers`; CREATE TABLE IF NOT EXISTS `m_tellers` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -5306,12 +5306,12 @@ CREATE TABLE IF NOT EXISTS `m_tellers` ( CONSTRAINT `FK_m_tellers_m_office` FOREIGN KEY (`office_id`) REFERENCES `m_office` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_tellers: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_tellers: ~0 rows (approximately) /*!40000 ALTER TABLE `m_tellers` DISABLE KEYS */; /*!40000 ALTER TABLE `m_tellers` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_template +-- Dumping structure for table fineract_default.m_template DROP TABLE IF EXISTS `m_template`; CREATE TABLE IF NOT EXISTS `m_template` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -5323,12 +5323,12 @@ CREATE TABLE IF NOT EXISTS `m_template` ( UNIQUE KEY `unq_name` (`name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_template: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_template: ~0 rows (approximately) /*!40000 ALTER TABLE `m_template` DISABLE KEYS */; /*!40000 ALTER TABLE `m_template` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_templatemappers +-- Dumping structure for table fineract_default.m_templatemappers DROP TABLE IF EXISTS `m_templatemappers`; CREATE TABLE IF NOT EXISTS `m_templatemappers` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -5338,12 +5338,12 @@ CREATE TABLE IF NOT EXISTS `m_templatemappers` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_templatemappers: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_templatemappers: ~0 rows (approximately) /*!40000 ALTER TABLE `m_templatemappers` DISABLE KEYS */; /*!40000 ALTER TABLE `m_templatemappers` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_template_m_templatemappers +-- Dumping structure for table fineract_default.m_template_m_templatemappers DROP TABLE IF EXISTS `m_template_m_templatemappers`; CREATE TABLE IF NOT EXISTS `m_template_m_templatemappers` ( `m_template_id` bigint(20) NOT NULL, @@ -5353,12 +5353,12 @@ CREATE TABLE IF NOT EXISTS `m_template_m_templatemappers` ( KEY `m_template_id` (`m_template_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_template_m_templatemappers: ~0 rows (approximately) +-- Dumping data for table fineract_default.m_template_m_templatemappers: ~0 rows (approximately) /*!40000 ALTER TABLE `m_template_m_templatemappers` DISABLE KEYS */; /*!40000 ALTER TABLE `m_template_m_templatemappers` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.m_working_days +-- Dumping structure for table fineract_default.m_working_days DROP TABLE IF EXISTS `m_working_days`; CREATE TABLE IF NOT EXISTS `m_working_days` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -5369,14 +5369,14 @@ CREATE TABLE IF NOT EXISTS `m_working_days` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.m_working_days: ~1 rows (approximately) +-- Dumping data for table fineract_default.m_working_days: ~1 rows (approximately) /*!40000 ALTER TABLE `m_working_days` DISABLE KEYS */; INSERT INTO `m_working_days` (`id`, `recurrence`, `repayment_rescheduling_enum`, `extend_term_daily_repayments`, `extend_term_holiday_repayment`) VALUES (1, 'FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR,SA,SU', 2, 0, 0); /*!40000 ALTER TABLE `m_working_days` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.oauth_access_token +-- Dumping structure for table fineract_default.oauth_access_token DROP TABLE IF EXISTS `oauth_access_token`; CREATE TABLE IF NOT EXISTS `oauth_access_token` ( `token_id` varchar(256) DEFAULT NULL, @@ -5388,12 +5388,12 @@ CREATE TABLE IF NOT EXISTS `oauth_access_token` ( `refresh_token` varchar(256) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.oauth_access_token: ~0 rows (approximately) +-- Dumping data for table fineract_default.oauth_access_token: ~0 rows (approximately) /*!40000 ALTER TABLE `oauth_access_token` DISABLE KEYS */; /*!40000 ALTER TABLE `oauth_access_token` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.oauth_client_details +-- Dumping structure for table fineract_default.oauth_client_details DROP TABLE IF EXISTS `oauth_client_details`; CREATE TABLE IF NOT EXISTS `oauth_client_details` ( `client_id` varchar(128) NOT NULL, @@ -5410,14 +5410,14 @@ CREATE TABLE IF NOT EXISTS `oauth_client_details` ( PRIMARY KEY (`client_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.oauth_client_details: ~0 rows (approximately) +-- Dumping data for table fineract_default.oauth_client_details: ~0 rows (approximately) /*!40000 ALTER TABLE `oauth_client_details` DISABLE KEYS */; INSERT INTO `oauth_client_details` (`client_id`, `resource_ids`, `client_secret`, `scope`, `authorized_grant_types`, `web_server_redirect_uri`, `authorities`, `access_token_validity`, `refresh_token_validity`, `additional_information`, `autoapprove`) VALUES ('community-app', NULL, '123', 'all', 'password,refresh_token', NULL, NULL, NULL, NULL, NULL, NULL); /*!40000 ALTER TABLE `oauth_client_details` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.oauth_refresh_token +-- Dumping structure for table fineract_default.oauth_refresh_token DROP TABLE IF EXISTS `oauth_refresh_token`; CREATE TABLE IF NOT EXISTS `oauth_refresh_token` ( `token_id` varchar(256) DEFAULT NULL, @@ -5425,12 +5425,12 @@ CREATE TABLE IF NOT EXISTS `oauth_refresh_token` ( `authentication` blob ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.oauth_refresh_token: ~0 rows (approximately) +-- Dumping data for table fineract_default.oauth_refresh_token: ~0 rows (approximately) /*!40000 ALTER TABLE `oauth_refresh_token` DISABLE KEYS */; /*!40000 ALTER TABLE `oauth_refresh_token` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.ppi_likelihoods +-- Dumping structure for table fineract_default.ppi_likelihoods DROP TABLE IF EXISTS `ppi_likelihoods`; CREATE TABLE IF NOT EXISTS `ppi_likelihoods` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -5439,12 +5439,12 @@ CREATE TABLE IF NOT EXISTS `ppi_likelihoods` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.ppi_likelihoods: ~0 rows (approximately) +-- Dumping data for table fineract_default.ppi_likelihoods: ~0 rows (approximately) /*!40000 ALTER TABLE `ppi_likelihoods` DISABLE KEYS */; /*!40000 ALTER TABLE `ppi_likelihoods` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.ppi_likelihoods_ppi +-- Dumping structure for table fineract_default.ppi_likelihoods_ppi DROP TABLE IF EXISTS `ppi_likelihoods_ppi`; CREATE TABLE IF NOT EXISTS `ppi_likelihoods_ppi` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -5454,12 +5454,12 @@ CREATE TABLE IF NOT EXISTS `ppi_likelihoods_ppi` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.ppi_likelihoods_ppi: ~0 rows (approximately) +-- Dumping data for table fineract_default.ppi_likelihoods_ppi: ~0 rows (approximately) /*!40000 ALTER TABLE `ppi_likelihoods_ppi` DISABLE KEYS */; /*!40000 ALTER TABLE `ppi_likelihoods_ppi` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.ppi_scores +-- Dumping structure for table fineract_default.ppi_scores DROP TABLE IF EXISTS `ppi_scores`; CREATE TABLE IF NOT EXISTS `ppi_scores` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -5468,7 +5468,7 @@ CREATE TABLE IF NOT EXISTS `ppi_scores` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.ppi_scores: ~20 rows (approximately) +-- Dumping data for table fineract_default.ppi_scores: ~20 rows (approximately) /*!40000 ALTER TABLE `ppi_scores` DISABLE KEYS */; INSERT INTO `ppi_scores` (`id`, `score_from`, `score_to`) VALUES (1, 0, 4), @@ -5494,7 +5494,7 @@ INSERT INTO `ppi_scores` (`id`, `score_from`, `score_to`) VALUES /*!40000 ALTER TABLE `ppi_scores` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.ref_loan_transaction_processing_strategy +-- Dumping structure for table fineract_default.ref_loan_transaction_processing_strategy DROP TABLE IF EXISTS `ref_loan_transaction_processing_strategy`; CREATE TABLE IF NOT EXISTS `ref_loan_transaction_processing_strategy` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -5505,7 +5505,7 @@ CREATE TABLE IF NOT EXISTS `ref_loan_transaction_processing_strategy` ( UNIQUE KEY `ltp_strategy_code` (`code`) ) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.ref_loan_transaction_processing_strategy: ~7 rows (approximately) +-- Dumping data for table fineract_default.ref_loan_transaction_processing_strategy: ~7 rows (approximately) /*!40000 ALTER TABLE `ref_loan_transaction_processing_strategy` DISABLE KEYS */; INSERT INTO `ref_loan_transaction_processing_strategy` (`id`, `code`, `name`, `sort_order`) VALUES (1, 'mifos-standard-strategy', 'Penalties, Fees, Interest, Principal order', 1), @@ -5518,19 +5518,19 @@ INSERT INTO `ref_loan_transaction_processing_strategy` (`id`, `code`, `name`, `s /*!40000 ALTER TABLE `ref_loan_transaction_processing_strategy` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.rpt_sequence +-- Dumping structure for table fineract_default.rpt_sequence DROP TABLE IF EXISTS `rpt_sequence`; CREATE TABLE IF NOT EXISTS `rpt_sequence` ( `id` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.rpt_sequence: ~0 rows (approximately) +-- Dumping data for table fineract_default.rpt_sequence: ~0 rows (approximately) /*!40000 ALTER TABLE `rpt_sequence` DISABLE KEYS */; /*!40000 ALTER TABLE `rpt_sequence` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.r_enum_value +-- Dumping structure for table fineract_default.r_enum_value DROP TABLE IF EXISTS `r_enum_value`; CREATE TABLE IF NOT EXISTS `r_enum_value` ( `enum_name` varchar(100) NOT NULL, @@ -5543,7 +5543,7 @@ CREATE TABLE IF NOT EXISTS `r_enum_value` ( UNIQUE KEY `enum_value` (`enum_name`,`enum_value`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.r_enum_value: ~159 rows (approximately) +-- Dumping data for table fineract_default.r_enum_value: ~159 rows (approximately) /*!40000 ALTER TABLE `r_enum_value` DISABLE KEYS */; INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('account_type_type_enum', 0, 'INVALID', 'INVALID', 0), @@ -5708,7 +5708,7 @@ INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `en /*!40000 ALTER TABLE `r_enum_value` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.scheduler_detail +-- Dumping structure for table fineract_default.scheduler_detail DROP TABLE IF EXISTS `scheduler_detail`; CREATE TABLE IF NOT EXISTS `scheduler_detail` ( `id` smallint(2) NOT NULL AUTO_INCREMENT, @@ -5718,14 +5718,14 @@ CREATE TABLE IF NOT EXISTS `scheduler_detail` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.scheduler_detail: ~0 rows (approximately) +-- Dumping data for table fineract_default.scheduler_detail: ~0 rows (approximately) /*!40000 ALTER TABLE `scheduler_detail` DISABLE KEYS */; INSERT INTO `scheduler_detail` (`id`, `is_suspended`, `execute_misfired_jobs`, `reset_scheduler_on_bootup`) VALUES (1, 0, 1, 1); /*!40000 ALTER TABLE `scheduler_detail` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.schema_version +-- Dumping structure for table fineract_default.schema_version DROP TABLE IF EXISTS `schema_version`; CREATE TABLE IF NOT EXISTS `schema_version` ( `version_rank` int(11) NOT NULL, @@ -5745,7 +5745,7 @@ CREATE TABLE IF NOT EXISTS `schema_version` ( KEY `schema_version_s_idx` (`success`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.schema_version: ~337 rows (approximately) +-- Dumping data for table fineract_default.schema_version: ~337 rows (approximately) /*!40000 ALTER TABLE `schema_version` DISABLE KEYS */; INSERT INTO `schema_version` (`version_rank`, `installed_rank`, `version`, `description`, `type`, `script`, `checksum`, `installed_by`, `installed_on`, `execution_time`, `success`) VALUES (1, 1, '1', 'mifosplatform-core-ddl-latest', 'SQL', 'V1__mifosplatform-core-ddl-latest.sql', 1800446512, 'root', '2015-06-03 15:26:50', 919, 1), @@ -6088,7 +6088,7 @@ INSERT INTO `schema_version` (`version_rank`, `installed_rank`, `version`, `desc /*!40000 ALTER TABLE `schema_version` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.sms_campaign +-- Dumping structure for table fineract_default.sms_campaign DROP TABLE IF EXISTS `sms_campaign`; CREATE TABLE IF NOT EXISTS `sms_campaign` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -6116,12 +6116,12 @@ CREATE TABLE IF NOT EXISTS `sms_campaign` ( CONSTRAINT `sms_campaign_ibfk_1` FOREIGN KEY (`report_id`) REFERENCES `stretchy_report` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.sms_campaign: ~0 rows (approximately) +-- Dumping data for table fineract_default.sms_campaign: ~0 rows (approximately) /*!40000 ALTER TABLE `sms_campaign` DISABLE KEYS */; /*!40000 ALTER TABLE `sms_campaign` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.sms_messages_outbound +-- Dumping structure for table fineract_default.sms_messages_outbound DROP TABLE IF EXISTS `sms_messages_outbound`; CREATE TABLE IF NOT EXISTS `sms_messages_outbound` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -6146,12 +6146,12 @@ CREATE TABLE IF NOT EXISTS `sms_messages_outbound` ( CONSTRAINT `FKSTAFF000000001` FOREIGN KEY (`staff_id`) REFERENCES `m_staff` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.sms_messages_outbound: ~0 rows (approximately) +-- Dumping data for table fineract_default.sms_messages_outbound: ~0 rows (approximately) /*!40000 ALTER TABLE `sms_messages_outbound` DISABLE KEYS */; /*!40000 ALTER TABLE `sms_messages_outbound` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.stretchy_parameter +-- Dumping structure for table fineract_default.stretchy_parameter DROP TABLE IF EXISTS `stretchy_parameter`; CREATE TABLE IF NOT EXISTS `stretchy_parameter` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -6172,7 +6172,7 @@ CREATE TABLE IF NOT EXISTS `stretchy_parameter` ( CONSTRAINT `fk_stretchy_parameter_001` FOREIGN KEY (`parent_id`) REFERENCES `stretchy_parameter` (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=1023 DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.stretchy_parameter: ~32 rows (approximately) +-- Dumping data for table fineract_default.stretchy_parameter: ~32 rows (approximately) /*!40000 ALTER TABLE `stretchy_parameter` DISABLE KEYS */; INSERT INTO `stretchy_parameter` (`id`, `parameter_name`, `parameter_variable`, `parameter_label`, `parameter_displayType`, `parameter_FormatType`, `parameter_default`, `special`, `selectOne`, `selectAll`, `parameter_sql`, `parent_id`) VALUES (1, 'startDateSelect', 'startDate', 'startDate', 'date', 'date', 'today', NULL, NULL, NULL, NULL, NULL), @@ -6210,7 +6210,7 @@ INSERT INTO `stretchy_parameter` (`id`, `parameter_name`, `parameter_variable`, /*!40000 ALTER TABLE `stretchy_parameter` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.stretchy_report +-- Dumping structure for table fineract_default.stretchy_report DROP TABLE IF EXISTS `stretchy_report`; CREATE TABLE IF NOT EXISTS `stretchy_report` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -6226,7 +6226,7 @@ CREATE TABLE IF NOT EXISTS `stretchy_report` ( UNIQUE KEY `report_name_UNIQUE` (`report_name`) ) ENGINE=InnoDB AUTO_INCREMENT=188 DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.stretchy_report: ~115 rows (approximately) +-- Dumping data for table fineract_default.stretchy_report: ~115 rows (approximately) /*!40000 ALTER TABLE `stretchy_report` DISABLE KEYS */; INSERT INTO `stretchy_report` (`id`, `report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES (1, 'Client Listing', 'Table', NULL, 'Client', 'select\nconcat(repeat("..",\n ((LENGTH(ounder.`hierarchy`) - LENGTH(REPLACE(ounder.`hierarchy`, \'.\', \'\')) - 1))), ounder.`name`) as "Office/Branch",\n c.account_no as "Client Account No.",\nc.display_name as "Name",\nr.enum_message_property as "Status",\nc.activation_date as "Activation", c.external_id as "External Id"\nfrom m_office o\njoin m_office ounder on ounder.hierarchy like concat(o.hierarchy, \'%\')\nand ounder.hierarchy like concat(\'${currentUserHierarchy}\', \'%\')\njoin m_client c on c.office_id = ounder.id\nleft join r_enum_value r on r.enum_name = \'status_enum\' and r.enum_id = c.status_enum\nwhere o.id = ${officeId}\norder by ounder.hierarchy, c.account_no', 'Individual Client Report\r\n\r\nLists the small number of defined fields on the client table. Would expect to copy this \n\nreport and add any \'one to one\' additional data for specific tenant needs.\r\n\r\nCan be run for any size MFI but you\'d expect it only to be run within a branch for \n\nlarger ones. Depending on how many columns are displayed, there is probably is a limit of about 20/50k clients returned for html display (export to excel doesn\'t \n\nhave that client browser/memory impact).', 1, 1), @@ -6347,7 +6347,7 @@ INSERT INTO `stretchy_report` (`id`, `report_name`, `report_type`, `report_subty /*!40000 ALTER TABLE `stretchy_report` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.stretchy_report_parameter +-- Dumping structure for table fineract_default.stretchy_report_parameter DROP TABLE IF EXISTS `stretchy_report_parameter`; CREATE TABLE IF NOT EXISTS `stretchy_report_parameter` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -6362,7 +6362,7 @@ CREATE TABLE IF NOT EXISTS `stretchy_report_parameter` ( CONSTRAINT `fk_report_parameter_002` FOREIGN KEY (`parameter_id`) REFERENCES `stretchy_parameter` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE=InnoDB AUTO_INCREMENT=522 DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.stretchy_report_parameter: ~415 rows (approximately) +-- Dumping data for table fineract_default.stretchy_report_parameter: ~415 rows (approximately) /*!40000 ALTER TABLE `stretchy_report_parameter` DISABLE KEYS */; INSERT INTO `stretchy_report_parameter` (`id`, `report_id`, `parameter_id`, `report_parameter_name`) VALUES (1, 1, 5, NULL), @@ -6783,7 +6783,7 @@ INSERT INTO `stretchy_report_parameter` (`id`, `report_id`, `parameter_id`, `rep /*!40000 ALTER TABLE `stretchy_report_parameter` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.x_registered_table +-- Dumping structure for table fineract_default.x_registered_table DROP TABLE IF EXISTS `x_registered_table`; CREATE TABLE IF NOT EXISTS `x_registered_table` ( `registered_table_name` varchar(50) NOT NULL, @@ -6792,12 +6792,12 @@ CREATE TABLE IF NOT EXISTS `x_registered_table` ( PRIMARY KEY (`registered_table_name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.x_registered_table: ~0 rows (approximately) +-- Dumping data for table fineract_default.x_registered_table: ~0 rows (approximately) /*!40000 ALTER TABLE `x_registered_table` DISABLE KEYS */; /*!40000 ALTER TABLE `x_registered_table` ENABLE KEYS */; --- Dumping structure for table mifostenant-default.x_table_column_code_mappings +-- Dumping structure for table fineract_default.x_table_column_code_mappings DROP TABLE IF EXISTS `x_table_column_code_mappings`; CREATE TABLE IF NOT EXISTS `x_table_column_code_mappings` ( `column_alias_name` varchar(50) NOT NULL, @@ -6807,7 +6807,7 @@ CREATE TABLE IF NOT EXISTS `x_table_column_code_mappings` ( CONSTRAINT `FK_x_code_id` FOREIGN KEY (`code_id`) REFERENCES `m_code` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table mifostenant-default.x_table_column_code_mappings: ~0 rows (approximately) +-- Dumping data for table fineract_default.x_table_column_code_mappings: ~0 rows (approximately) /*!40000 ALTER TABLE `x_table_column_code_mappings` DISABLE KEYS */; /*!40000 ALTER TABLE `x_table_column_code_mappings` ENABLE KEYS */; /*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */; diff --git a/fineract-provider/src/main/webapp/META-INF/context.xml b/fineract-provider/src/main/webapp/META-INF/context.xml index 598510aed08..381cc5bd47e 100644 --- a/fineract-provider/src/main/webapp/META-INF/context.xml +++ b/fineract-provider/src/main/webapp/META-INF/context.xml @@ -22,6 +22,6 @@ - \ No newline at end of file diff --git a/fineract-provider/src/test/resources/META-INF/context.xml b/fineract-provider/src/test/resources/META-INF/context.xml index f5f1ba2ed08..d567d54c43a 100644 --- a/fineract-provider/src/test/resources/META-INF/context.xml +++ b/fineract-provider/src/test/resources/META-INF/context.xml @@ -22,8 +22,8 @@ - \ No newline at end of file From 753554e2819f23fbfe2918dc75acb1d4bc95df6c Mon Sep 17 00:00:00 2001 From: Michael Vorburger Date: Sun, 8 Mar 2020 18:17:16 +0100 Subject: [PATCH 06/37] Fix audit trails filter (FINERACT-808) As per the great analysis by Manthan Surkar (@thesmallstar) in the original PR https://github.com/apache/fineract/pull/723, the cause of the FINERACT-808 bug was that "the backend would treat "UPDATE" and similar strings as SQL injection". The root cause of that was that (IMHO..) how Fineract does SQL injection is more of a workaround (blacklisting some keywords and some heuristic checks) then how this really should be done (by using JDBC Prepared statements with arguments for all external data, instead inlined SQL). This also lays the foundation for more like this in FINERACT-854. --- .../commands/api/AuditsApiResource.java | 81 +++-------- .../api/MakercheckersApiResource.java | 61 +++------ .../service/AuditReadPlatformService.java | 7 +- .../service/AuditReadPlatformServiceImpl.java | 59 +++----- .../security/utils/SQLBuilder.java | 126 ++++++++++++++++++ .../security/utils/SQLBuilderTest.java | 86 ++++++++++++ 6 files changed, 269 insertions(+), 151 deletions(-) create mode 100644 fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/utils/SQLBuilder.java create mode 100644 fineract-provider/src/test/java/org/apache/fineract/infrastructure/security/utils/SQLBuilderTest.java diff --git a/fineract-provider/src/main/java/org/apache/fineract/commands/api/AuditsApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/commands/api/AuditsApiResource.java index 79d1b81418b..b1f7f4e8ed4 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/commands/api/AuditsApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/commands/api/AuditsApiResource.java @@ -38,17 +38,16 @@ import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.UriInfo; -import org.apache.commons.lang.StringUtils; import org.apache.fineract.commands.data.AuditData; import org.apache.fineract.commands.data.AuditSearchData; import org.apache.fineract.commands.service.AuditReadPlatformService; -import org.apache.fineract.infrastructure.core.api.ApiParameterHelper; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.data.PaginationParameters; import org.apache.fineract.infrastructure.core.serialization.ApiRequestJsonSerializationSettings; import org.apache.fineract.infrastructure.core.serialization.DefaultToApiJsonSerializer; import org.apache.fineract.infrastructure.core.service.Page; import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext; +import org.apache.fineract.infrastructure.security.utils.SQLBuilder; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Component; @@ -104,7 +103,7 @@ public String retrieveAuditEntries(@Context final UriInfo uriInfo, @QueryParam(" this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions); final PaginationParameters parameters = PaginationParameters.instance(paged, offset, limit, orderBy, sortOrder); - final String extraCriteria = getExtraCriteria(actionName, entityName, resourceId, makerId, makerDateTimeFrom, makerDateTimeTo, + final SQLBuilder extraCriteria = getExtraCriteria(actionName, entityName, resourceId, makerId, makerDateTimeFrom, makerDateTimeTo, checkerId, checkerDateTimeFrom, checkerDateTimeTo, processingResult, officeId, groupId, clientId, loanId, savingsAccountId); final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters()); @@ -157,69 +156,29 @@ public String retrieveAuditSearchTemplate(@Context final UriInfo uriInfo) { return this.toApiJsonSerializerSearchTemplate.serialize(settings, auditSearchData, RESPONSE_DATA_PARAMETERS_SEARCH_TEMPLATE); } - private String getExtraCriteria(final String actionName, final String entityName, final Long resourceId, final Long makerId, + private SQLBuilder getExtraCriteria(final String actionName, final String entityName, final Long resourceId, final Long makerId, final String makerDateTimeFrom, final String makerDateTimeTo, final Long checkerId, final String checkerDateTimeFrom, final String checkerDateTimeTo, final Integer processingResult, final Integer officeId, final Integer groupId, final Integer clientId, final Integer loanId, final Integer savingsAccountId) { - String extraCriteria = ""; - - if (actionName != null) { - extraCriteria += " and aud.action_name = " + ApiParameterHelper.sqlEncodeString(actionName); - } + SQLBuilder extraCriteria = new SQLBuilder(); + extraCriteria.addNonNullCriteria("aud.action_name = ", actionName); if (entityName != null) { - extraCriteria += " and aud.entity_name like " + ApiParameterHelper.sqlEncodeString(entityName + "%"); - } - - if (resourceId != null) { - extraCriteria += " and aud.resource_id = " + resourceId; - } - if (makerId != null) { - extraCriteria += " and aud.maker_id = " + makerId; - } - if (checkerId != null) { - extraCriteria += " and aud.checker_id = " + checkerId; - } - if (makerDateTimeFrom != null) { - extraCriteria += " and aud.made_on_date >= " + ApiParameterHelper.sqlEncodeString(makerDateTimeFrom); - } - if (makerDateTimeTo != null) { - extraCriteria += " and aud.made_on_date <= " + ApiParameterHelper.sqlEncodeString(makerDateTimeTo); - } - if (checkerDateTimeFrom != null) { - extraCriteria += " and aud.checked_on_date >= " + ApiParameterHelper.sqlEncodeString(checkerDateTimeFrom); - } - if (checkerDateTimeTo != null) { - extraCriteria += " and aud.checked_on_date <= " + ApiParameterHelper.sqlEncodeString(checkerDateTimeTo); - } - - if (processingResult != null) { - extraCriteria += " and aud.processing_result_enum = " + processingResult; - } - - if (officeId != null) { - extraCriteria += " and aud.office_id = " + officeId; - } - - if (groupId != null) { - extraCriteria += " and aud.group_id = " + groupId; - } - - if (clientId != null) { - extraCriteria += " and aud.client_id = " + clientId; - } - - if (loanId != null) { - extraCriteria += " and aud.loan_id = " + loanId; - } - - if (savingsAccountId != null) { - extraCriteria += " and aud.savings_account_id = " + savingsAccountId; - } - - if (StringUtils.isNotBlank(extraCriteria)) { - extraCriteria = extraCriteria.substring(4); - } + extraCriteria.addCriteria("aud.entity_name like", entityName + "%"); + } + extraCriteria.addNonNullCriteria("aud.resource_id = ", resourceId); + extraCriteria.addNonNullCriteria("aud.maker_id = ", makerId); + extraCriteria.addNonNullCriteria("aud.checker_id = ", checkerId); + extraCriteria.addNonNullCriteria("aud.made_on_date >= ", makerDateTimeFrom); + extraCriteria.addNonNullCriteria("aud.made_on_date <= ", makerDateTimeTo); + extraCriteria.addNonNullCriteria("aud.checked_on_date >= ", checkerDateTimeFrom); + extraCriteria.addNonNullCriteria("aud.checked_on_date <= ", checkerDateTimeTo); + extraCriteria.addNonNullCriteria("aud.processing_result_enum = ", processingResult); + extraCriteria.addNonNullCriteria("aud.office_id = ", officeId); + extraCriteria.addNonNullCriteria("aud.group_id = ", groupId); + extraCriteria.addNonNullCriteria("aud.client_id = ", clientId); + extraCriteria.addNonNullCriteria("aud.loan_id = ", loanId); + extraCriteria.addNonNullCriteria("aud.savings_account_id = ", savingsAccountId); return extraCriteria; } diff --git a/fineract-provider/src/main/java/org/apache/fineract/commands/api/MakercheckersApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/commands/api/MakercheckersApiResource.java index c7147227000..efe7547d20d 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/commands/api/MakercheckersApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/commands/api/MakercheckersApiResource.java @@ -45,12 +45,12 @@ import org.apache.fineract.commands.data.AuditSearchData; import org.apache.fineract.commands.service.AuditReadPlatformService; import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; -import org.apache.fineract.infrastructure.core.api.ApiParameterHelper; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.exception.UnrecognizedQueryParamException; import org.apache.fineract.infrastructure.core.serialization.ApiRequestJsonSerializationSettings; import org.apache.fineract.infrastructure.core.serialization.DefaultToApiJsonSerializer; +import org.apache.fineract.infrastructure.security.utils.SQLBuilder; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Component; @@ -98,7 +98,7 @@ public String retrieveCommands(@Context final UriInfo uriInfo, @QueryParam("acti @QueryParam("groupId") @ApiParam(value = "groupId") final Integer groupId, @QueryParam("clientId") @ApiParam(value = "clientId") final Integer clientId, @QueryParam("loanid") @ApiParam(value = "loanid") final Integer loanId, @QueryParam("savingsAccountId") @ApiParam(value = "savingsAccountId") final Integer savingsAccountId) { - final String extraCriteria = getExtraCriteria(actionName, entityName, resourceId, makerId, makerDateTimeFrom, makerDateTimeTo, + final SQLBuilder extraCriteria = getExtraCriteria(actionName, entityName, resourceId, makerId, makerDateTimeFrom, makerDateTimeTo, officeId, groupId, clientId, loanId, savingsAccountId); final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters()); @@ -164,55 +164,24 @@ public String deleteMakerCheckerEntry(@PathParam("auditId") @ApiParam(value = "a return this.toApiJsonSerializerAudit.serialize(CommandProcessingResult.commandOnlyResult(id)); } - private String getExtraCriteria(final String actionName, final String entityName, final Long resourceId, final Long makerId, + private SQLBuilder getExtraCriteria(final String actionName, final String entityName, final Long resourceId, final Long makerId, final String makerDateTimeFrom, final String makerDateTimeTo, final Integer officeId, final Integer groupId, final Integer clientId, final Integer loanId, final Integer savingsAccountId) { - String extraCriteria = ""; - - if (actionName != null) { - extraCriteria += " and aud.action_name = " + ApiParameterHelper.sqlEncodeString(actionName); - } + SQLBuilder extraCriteria = new SQLBuilder(); + extraCriteria.addNonNullCriteria("aud.action_name = ", actionName); if (entityName != null) { - extraCriteria += " and aud.entity_name like " + ApiParameterHelper.sqlEncodeString(entityName + "%"); - } - - if (resourceId != null) { - extraCriteria += " and aud.resource_id = " + resourceId; - } - if (makerId != null) { - extraCriteria += " and aud.maker_id = " + makerId; - } - if (makerDateTimeFrom != null) { - extraCriteria += " and aud.made_on_date >= " + ApiParameterHelper.sqlEncodeString(makerDateTimeFrom); - } - if (makerDateTimeTo != null) { - extraCriteria += " and aud.made_on_date <= " + ApiParameterHelper.sqlEncodeString(makerDateTimeTo); - } - - if (officeId != null) { - extraCriteria += " and aud.office_id = " + officeId; - } - - if (groupId != null) { - extraCriteria += " and aud.group_id = " + groupId; - } - - if (clientId != null) { - extraCriteria += " and aud.client_id = " + clientId; - } - - if (loanId != null) { - extraCriteria += " and aud.loan_id = " + loanId; - } - - if (savingsAccountId != null) { - extraCriteria += " and aud.savings_account_id = " + savingsAccountId; - } - - if (StringUtils.isNotBlank(extraCriteria)) { - extraCriteria = extraCriteria.substring(4); + extraCriteria.addCriteria("aud.entity_name like ", entityName + "%"); } + extraCriteria.addNonNullCriteria("aud.resource_id = ", resourceId); + extraCriteria.addNonNullCriteria("aud.maker_id = ", makerId); + extraCriteria.addNonNullCriteria("aud.made_on_date >= ", makerDateTimeFrom); + extraCriteria.addNonNullCriteria("aud.made_on_date <= ", makerDateTimeTo); + extraCriteria.addNonNullCriteria("aud.office_id = ", officeId); + extraCriteria.addNonNullCriteria("aud.group_id = ", groupId); + extraCriteria.addNonNullCriteria("aud.client_id = ", clientId); + extraCriteria.addNonNullCriteria("aud.loan_id = ", loanId); + extraCriteria.addNonNullCriteria("aud.savings_account_id = ", savingsAccountId); return extraCriteria; } diff --git a/fineract-provider/src/main/java/org/apache/fineract/commands/service/AuditReadPlatformService.java b/fineract-provider/src/main/java/org/apache/fineract/commands/service/AuditReadPlatformService.java index ef71553b061..c3d71c5a67f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/commands/service/AuditReadPlatformService.java +++ b/fineract-provider/src/main/java/org/apache/fineract/commands/service/AuditReadPlatformService.java @@ -23,14 +23,15 @@ import org.apache.fineract.commands.data.AuditSearchData; import org.apache.fineract.infrastructure.core.data.PaginationParameters; import org.apache.fineract.infrastructure.core.service.Page; +import org.apache.fineract.infrastructure.security.utils.SQLBuilder; public interface AuditReadPlatformService { - Collection retrieveAuditEntries(String extraCriteria, boolean includeJson); + Collection retrieveAuditEntries(SQLBuilder extraCriteria, boolean includeJson); - Page retrievePaginatedAuditEntries(String extraCriteria, boolean includeJson, PaginationParameters parameters); + Page retrievePaginatedAuditEntries(SQLBuilder extraCriteria, boolean includeJson, PaginationParameters parameters); - Collection retrieveAllEntriesToBeChecked(String extraCriteria, boolean includeJson); + Collection retrieveAllEntriesToBeChecked(SQLBuilder extraCriteria, boolean includeJson); AuditData retrieveAuditEntry(Long auditId); diff --git a/fineract-provider/src/main/java/org/apache/fineract/commands/service/AuditReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/commands/service/AuditReadPlatformServiceImpl.java index 6988ba5da6a..41b48ab1967 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/commands/service/AuditReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/commands/service/AuditReadPlatformServiceImpl.java @@ -44,6 +44,7 @@ import org.apache.fineract.infrastructure.core.service.RoutingDataSource; import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext; import org.apache.fineract.infrastructure.security.utils.ColumnValidator; +import org.apache.fineract.infrastructure.security.utils.SQLBuilder; import org.apache.fineract.organisation.office.data.OfficeData; import org.apache.fineract.organisation.office.service.OfficeReadPlatformService; import org.apache.fineract.organisation.staff.data.StaffData; @@ -184,36 +185,23 @@ public AuditData mapRow(final ResultSet rs, @SuppressWarnings("unused") final in } @Override - public Collection retrieveAuditEntries(final String extraCriteria, final boolean includeJson) { - - String updatedExtraCriteria = ""; - if (StringUtils.isNotBlank(extraCriteria)) { - updatedExtraCriteria = " where (" + extraCriteria + ")"; - } - - updatedExtraCriteria += " order by aud.id DESC limit " + PaginationParameters.getCheckedLimit(null); - return retrieveEntries("audit", updatedExtraCriteria, includeJson, StringUtils.isNotBlank(extraCriteria)); + public Collection retrieveAuditEntries(final SQLBuilder extraCriteria, final boolean includeJson) { + return retrieveEntries("audit", extraCriteria, " order by aud.id DESC limit " + PaginationParameters.getCheckedLimit(null), includeJson); } @Override - public Page retrievePaginatedAuditEntries(final String extraCriteria, final boolean includeJson, + public Page retrievePaginatedAuditEntries(final SQLBuilder extraCriteria, final boolean includeJson, final PaginationParameters parameters) { this.paginationParametersDataValidator.validateParameterValues(parameters, supportedOrderByValues, "audits"); final AppUser currentUser = this.context.authenticatedUser(); final String hierarchy = currentUser.getOffice().getHierarchy(); - String updatedExtraCriteria = ""; - if (StringUtils.isNotBlank(extraCriteria)) { - updatedExtraCriteria = " where (" + extraCriteria + ")"; - } - final AuditMapper rm = new AuditMapper(); final StringBuilder sqlBuilder = new StringBuilder(200); sqlBuilder.append("select SQL_CALC_FOUND_ROWS "); sqlBuilder.append(rm.schema(includeJson, hierarchy)); - sqlBuilder.append(' ').append(updatedExtraCriteria); - this.columnValidator.validateSqlInjection(sqlBuilder.toString(), extraCriteria); + sqlBuilder.append(' ').append(extraCriteria.getSQLTemplate()); if (parameters.isOrderByRequested()) { sqlBuilder.append(' ').append(parameters.orderBySql()); this.columnValidator.validateSqlInjection(sqlBuilder.toString(), parameters.orderBySql()); @@ -229,27 +217,18 @@ public Page retrievePaginatedAuditEntries(final String extraCriteria, logger.info("sql: " + sqlBuilder.toString()); final String sqlCountRows = "SELECT FOUND_ROWS()"; - return this.paginationHelper.fetchPage(this.jdbcTemplate, sqlCountRows, sqlBuilder.toString(), new Object[] {}, rm); + return this.paginationHelper.fetchPage(this.jdbcTemplate, sqlCountRows, sqlBuilder.toString(), extraCriteria.getArguments(), rm); } @Override - public Collection retrieveAllEntriesToBeChecked(final String extraCriteria, final boolean includeJson) { - - String updatedExtraCriteria = ""; - if (StringUtils.isNotBlank(extraCriteria)) { - updatedExtraCriteria = " where (" + extraCriteria + ")" + " and aud.processing_result_enum = 2"; - } else { - updatedExtraCriteria = " where aud.processing_result_enum = 2"; - } - - updatedExtraCriteria += " group by aud.id order by aud.id"; - - return retrieveEntries("makerchecker", updatedExtraCriteria, includeJson, StringUtils.isNotBlank(extraCriteria)); + public Collection retrieveAllEntriesToBeChecked(final SQLBuilder extraCriteria, final boolean includeJson) { + extraCriteria.addCriteria("aud.processing_result_enum = ", 2); + return retrieveEntries("makerchecker", extraCriteria, " group by aud.id order by aud.id", includeJson); } - public Collection retrieveEntries(final String useType, final String extraCriteria, final boolean includeJson, boolean isExtraCritereaIncluded) { + private Collection retrieveEntries(final String useType, final SQLBuilder extraCriteria, final String groupAndOrderBySQL, final boolean includeJson) { - if (!(useType.equals("audit") || useType.equals("makerchecker"))) { throw new PlatformDataIntegrityException( + if ((!useType.equals("audit") && !useType.equals("makerchecker"))) { throw new PlatformDataIntegrityException( "error.msg.invalid.auditSearchTemplate.useType", "Invalid Audit Search Template UseType: " + useType); } final AppUser currentUser = this.context.authenticatedUser(); @@ -270,13 +249,11 @@ public Collection retrieveEntries(final String useType, final String + " join m_role_permission rp on rp.permission_id = p.id" + " join m_role r on r.id = rp.role_id " + " join m_appuser_role ur on ur.role_id = r.id and ur.appuser_id = " + currentUser.getId(); } - sql += extraCriteria; - if(isExtraCritereaIncluded){ - this.columnValidator.validateSqlInjection(sql, extraCriteria); - } + sql += extraCriteria.getSQLTemplate(); + sql += groupAndOrderBySQL; logger.info("sql: " + sql); - return this.jdbcTemplate.query(sql, rm, new Object[] {}); + return this.jdbcTemplate.query(sql, rm, extraCriteria.getArguments()); } @Override @@ -289,7 +266,7 @@ public AuditData retrieveAuditEntry(final Long auditId) { final String sql = "select " + rm.schema(true, hierarchy) + " where aud.id = ? "; - final AuditData auditResult = this.jdbcTemplate.queryForObject(sql, rm, new Object[] {auditId}); + final AuditData auditResult = this.jdbcTemplate.queryForObject(sql, rm, auditId); return replaceIdsOnAuditData(auditResult); } @@ -461,18 +438,18 @@ public AuditSearchData retrieveSearchTemplate(final String useType) { sql += makercheckerCapabilityOnly(useType, currentUser); sql += " order by if(action_name in ('CREATE', 'DELETE', 'UPDATE'), action_name, 'ZZZ'), action_name"; final ActionNamesMapper mapper = new ActionNamesMapper(); - final List actionNames = this.jdbcTemplate.query(sql, mapper, new Object[] {}); + final List actionNames = this.jdbcTemplate.query(sql, mapper); sql = " select distinct(entity_name) as entityName from m_permission p "; sql += makercheckerCapabilityOnly(useType, currentUser); sql += " order by if(grouping = 'datatable', 'ZZZ', entity_name), entity_name"; final EntityNamesMapper mapper2 = new EntityNamesMapper(); - final List entityNames = this.jdbcTemplate.query(sql, mapper2, new Object[] {}); + final List entityNames = this.jdbcTemplate.query(sql, mapper2); Collection processingResults = null; if (useType.equals("audit")) { final ProcessingResultsMapper mapper3 = new ProcessingResultsMapper(); - processingResults = this.jdbcTemplate.query(mapper3.schema(), mapper3, new Object[] {}); + processingResults = this.jdbcTemplate.query(mapper3.schema(), mapper3); } return new AuditSearchData(appUsers, actionNames, entityNames, processingResults); diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/utils/SQLBuilder.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/utils/SQLBuilder.java new file mode 100644 index 00000000000..98f4735e2bb --- /dev/null +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/utils/SQLBuilder.java @@ -0,0 +1,126 @@ +/** + * 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. + */ +package org.apache.fineract.infrastructure.security.utils; + +import java.sql.PreparedStatement; +import java.util.ArrayList; +import java.util.List; +import java.util.Locale; +import java.util.regex.Pattern; + +/** + * Utility to assemble the WHERE clause of an SQL query without the risk of SQL injection. + * + *

When using this utility instead of manually assembling SQL queries, then + * {@link SQLInjectionValidator} should not be required anymore. (Correctly using + * this means only ever passing completely fixed String literals to .) + * + * @author Michael Vorburger + */ +public class SQLBuilder { + + private final static Pattern ATOZ = Pattern.compile("[a-z]+"); + + // This holds the query string, with the '?' placeholders, but no argument values + private final StringBuilder sb = new StringBuilder(); + + // This holds the arguments, in the order of the '?' placeholders in sb + private final List args = new ArrayList<>(); + + /** + * Adds a criteria for a SQL WHERE clause. + * All criteria are appended by AND (support for OR, or nesting, can be added when needed). + * @param criteria The name of the column to be filtered, and an operator; e.g. "name =" or "age >" (but without '?' placeholder) + * @param argument The argument to be filtered on (e.g. "Michael" or 123). The null value is explicitly permitted. + */ + public void addCriteria(String criteria, Object argument) { + if (criteria == null || criteria.trim().isEmpty()) { + throw new IllegalArgumentException("criteria cannot be null"); + } + String trimmedCriteria = criteria.trim(); + if (trimmedCriteria.isEmpty()) { + throw new IllegalArgumentException("criteria cannot be null"); + } + if (trimmedCriteria.contains("?")) { + throw new IllegalArgumentException("criteria cannot contain a '?' (that is automatically added at the end): " + trimmedCriteria); + } + int columnOperatorIndex = trimmedCriteria.indexOf(' '); + if (columnOperatorIndex == -1) { + throw new IllegalArgumentException("criteria missing operator: " + trimmedCriteria); + } + String columnName = trimmedCriteria.substring(0, columnOperatorIndex).trim().toLowerCase(Locale.ROOT); + if (!ATOZ.matcher(columnName).matches()) { + throw new IllegalArgumentException("criteria column name must match [a-z]: " + trimmedCriteria); + } + String operator = trimmedCriteria.substring(columnOperatorIndex).trim(); + if (operator.indexOf(' ') > -1) { + throw new IllegalArgumentException("criteria cannot contain more than 1 space (between column name and operator): " + trimmedCriteria); + } + if (!operator.equals("=") && !operator.equals("<") && !operator.equals(">") + && !operator.equals("<=") && !operator.equals(">=") && !operator.equals("<>") + && !operator.equals("LIKE") && !operator.equals("like")) { + // add support for SQL's BETWEEN and IN, if/when ever needed.. (it's a little more than just adding above, as it can have multiple arguments) + throw new IllegalArgumentException("criteria must end with valid SQL operator for WHERE: " + trimmedCriteria); + } + + if (sb.length() > 0) { + sb.append(" AND "); + } + sb.append(trimmedCriteria); + sb.append(" ?"); + args.add(argument); + } + + /** + * Delegates to {@link #addCriteria(String, Object)} if argument is not null, otherwise does nothing. + */ + public void addNonNullCriteria(String criteria, Object argument) { + if (argument != null) { + addCriteria(criteria, argument); + } + } + + /** + * Returns a SQL WHERE clause, created from the {@link #addCriteria(String, Object)}, with '?' placeholders. + * @return SQL WHERE clause, almost always starting with " WHERE ..." (unless no criteria, then empty) + */ + public String getSQLTemplate() { + if (sb.length() > 0) { + return " WHERE " + sb.toString(); + } + return ""; + } + + /** + * Returns the arguments for the WHERE clause. + * @return Object array suitable for use with Spring Framework JdbcTemplate (or plain JDBC {@link PreparedStatement}) + */ + public Object[] getArguments() { + return args.toArray(); + } + + /* + * Returns a String representation suitable for debugging and log output. + * This is ONLY intended for debugging in logs, and NEVER for passing to a JDBC database. + @Override + public String toString() { + return "SQLBuilder{..."; // TODO implement this... + } + */ +} diff --git a/fineract-provider/src/test/java/org/apache/fineract/infrastructure/security/utils/SQLBuilderTest.java b/fineract-provider/src/test/java/org/apache/fineract/infrastructure/security/utils/SQLBuilderTest.java new file mode 100644 index 00000000000..34358a69fde --- /dev/null +++ b/fineract-provider/src/test/java/org/apache/fineract/infrastructure/security/utils/SQLBuilderTest.java @@ -0,0 +1,86 @@ +/** + * 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. + */ +package org.apache.fineract.infrastructure.security.utils; + +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThrows; + +import org.junit.Test; + +/** + * Unit Test for {@link SQLBuilder}. + * + * @author Michael Vorburger + */ +public class SQLBuilderTest { + + @Test + public void testEmpty() { + SQLBuilder sqlBuilder = new SQLBuilder(); + assertEquals("", sqlBuilder.getSQLTemplate()); + assertArrayEquals(new Object[] {}, sqlBuilder.getArguments()); + // TODO assertEquals("SQLBuilder{}", sqlBuilder.toString()); + } + + @Test + public void testUsage() { + SQLBuilder sqlBuilder = new SQLBuilder(); + sqlBuilder.addCriteria("name =", "Michael"); + sqlBuilder.addCriteria("hobby LIKE ", "Mifos/Apache Fineract"); + sqlBuilder.addCriteria("age < ", 123); + assertEquals(" WHERE name = ? AND hobby LIKE ? AND age < ?", sqlBuilder.getSQLTemplate()); + assertArrayEquals(new Object[] { "Michael", "Mifos/Apache Fineract", 123}, sqlBuilder.getArguments()); + // TODO assertEquals("SQLBuilder{ WHERE name = ['Michael'] AND hobby = ['Mifos/Apache Fineract'] AND age < [123]}", sqlBuilder.toString()); + } + + @Test + public void testNullArgument() { + SQLBuilder sqlBuilder = new SQLBuilder(); + sqlBuilder.addCriteria("ref =", null); + assertEquals(" WHERE ref = ?", sqlBuilder.getSQLTemplate()); + assertArrayEquals(new Object[] { null }, sqlBuilder.getArguments()); + // TODO assertEquals("SQLBuilder{ WHERE ref = [null] }", sqlBuilder.toString()); + } + + @Test + public void testLowerAndUpperCaseOperators() { + SQLBuilder sqlBuilder = new SQLBuilder(); + sqlBuilder.addCriteria("hobby LIKE ", "Mifos/Apache Fineract"); + sqlBuilder.addCriteria("hobby like ", "Mifos/Apache Fineract"); + } + + @Test + public void testAddIllegalArguments() { + assertThrows("space between column and operator", IllegalArgumentException.class, () -> new SQLBuilder().addCriteria("age<", 123)); + assertThrows("null Criteria Fragment", IllegalArgumentException.class, () -> new SQLBuilder().addCriteria(null, "argument")); + assertThrows("empty Criteria Fragment", IllegalArgumentException.class, () -> new SQLBuilder().addCriteria("", "argument")); + assertThrows("space only Criteria Fragment", IllegalArgumentException.class, () -> new SQLBuilder().addCriteria(" ", "argument")); + assertThrows("Criteria Fragment with ?", IllegalArgumentException.class, () -> new SQLBuilder().addCriteria("age = ?", 123)); + assertThrows("Criteria Fragment missing operator", IllegalArgumentException.class, () -> new SQLBuilder().addCriteria("age", 123)); + assertThrows("Criteria starts with AND", IllegalArgumentException.class, () -> new SQLBuilder().addCriteria("and age = ?", 123)); + assertThrows("Criteria ends with AND", IllegalArgumentException.class, () -> new SQLBuilder().addCriteria("age = ? and", 123)); + assertThrows("Criteria starts with OR", IllegalArgumentException.class, () -> new SQLBuilder().addCriteria("or age =", 123)); + assertThrows("Criteria ends with OR", IllegalArgumentException.class, () -> new SQLBuilder().addCriteria("age = ? or", 123)); + assertThrows("Criteria contains opening parentheis", IllegalArgumentException.class, () -> new SQLBuilder().addCriteria("(age =", 123)); + assertThrows("Criteria contains closing parentheis", IllegalArgumentException.class, () -> new SQLBuilder().addCriteria("age = ?)", 123)); + assertThrows("Offset corner case", IllegalArgumentException.class, () -> new SQLBuilder().addCriteria("age< = ?)", 123)); + + } +} From a34742b59ae403bc708776f3cbf462d238d20916 Mon Sep 17 00:00:00 2001 From: thesmallstar Date: Mon, 9 Mar 2020 22:52:15 +0530 Subject: [PATCH 07/37] Made SQL builder ColumnName regex more general --- .../fineract/infrastructure/security/utils/SQLBuilder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/utils/SQLBuilder.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/utils/SQLBuilder.java index 98f4735e2bb..63052fbb624 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/utils/SQLBuilder.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/utils/SQLBuilder.java @@ -35,7 +35,7 @@ */ public class SQLBuilder { - private final static Pattern ATOZ = Pattern.compile("[a-z]+"); + private final static Pattern ATOZ = Pattern.compile("([a-zA-Z_][a-zA-Z0-9_-]*\\.)?[a-zA-Z_-][a-zA-Z0-9_-]*"); // This holds the query string, with the '?' placeholders, but no argument values private final StringBuilder sb = new StringBuilder(); From 0c9273a11bfba688c76d28521dddcff8c69daa07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vorburger=20=E2=9B=91=EF=B8=8F?= Date: Tue, 10 Mar 2020 12:29:07 +0100 Subject: [PATCH 08/37] throw exception with details in InteropServiceImpl (FINERACT-860) (#728) instead of the NoSuchElementException from Optional.get(), we're now throwing an UnsupportedOperationException which includes the details of the missing object. (This kind of detailed exception was already thrown in two existing places in the same code after a null check, but it never reached there, because the Optional.get() failed earlier. Another option would have been to return null for an absent Optional, but this is better.) The other unrelated changes are automatic clean up actions (in Eclipse). --- .../service/InteropServiceImpl.java | 95 +++++++++++-------- 1 file changed, 53 insertions(+), 42 deletions(-) diff --git a/fineract-provider/src/main/java/org/apache/fineract/interoperation/service/InteropServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/interoperation/service/InteropServiceImpl.java index d1fc665ed3a..cc066150a14 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/interoperation/service/InteropServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/interoperation/service/InteropServiceImpl.java @@ -108,21 +108,19 @@ public class InteropServiceImpl implements InteropService { private final SavingsAccountTransactionSummaryWrapper savingsAccountTransactionSummaryWrapper; private final SavingsAccountDomainService savingsAccountService; - private final PaymentDetailWritePlatformService paymentDetailService; - @Autowired public InteropServiceImpl(PlatformSecurityContext securityContext, - InteropDataValidator interopDataValidator, - SavingsAccountRepository savingsAccountRepository, - SavingsAccountTransactionRepository savingsAccountTransactionRepository, - ApplicationCurrencyRepository applicationCurrencyRepository, - NoteRepository noteRepository, - PaymentTypeRepository paymentTypeRepository, - InteropIdentifierRepository identifierRepository, - SavingsHelper savingsHelper, - SavingsAccountTransactionSummaryWrapper savingsAccountTransactionSummaryWrapper, - SavingsAccountDomainService savingsAccountService, - PaymentDetailWritePlatformService paymentDetailWritePlatformService) { + InteropDataValidator interopDataValidator, + SavingsAccountRepository savingsAccountRepository, + SavingsAccountTransactionRepository savingsAccountTransactionRepository, + ApplicationCurrencyRepository applicationCurrencyRepository, + NoteRepository noteRepository, + PaymentTypeRepository paymentTypeRepository, + InteropIdentifierRepository identifierRepository, + SavingsHelper savingsHelper, + SavingsAccountTransactionSummaryWrapper savingsAccountTransactionSummaryWrapper, + SavingsAccountDomainService savingsAccountService, + PaymentDetailWritePlatformService paymentDetailWritePlatformService) { this.securityContext = securityContext; this.dataValidator = interopDataValidator; this.savingsAccountRepository = savingsAccountRepository; @@ -134,7 +132,6 @@ public InteropServiceImpl(PlatformSecurityContext securityContext, this.savingsHelper = savingsHelper; this.savingsAccountTransactionSummaryWrapper = savingsAccountTransactionSummaryWrapper; this.savingsAccountService = savingsAccountService; - this.paymentDetailService = paymentDetailWritePlatformService; } @NotNull @@ -153,11 +150,13 @@ public InteropTransactionsData getAccountTransactions(@NotNull String accountId, ZoneId zoneId = ZoneId.of(ThreadLocalContextUtil.getTenant().getTimezoneId()); Predicate transFilter = t -> { SavingsAccountTransactionType transactionType = SavingsAccountTransactionType.fromInt(t.getTypeOf()); - if (debit != transactionType.isDebit() && credit != transactionType.isCredit()) + if (debit != transactionType.isDebit() && credit != transactionType.isCredit()) { return false; + } - if (transactionsFrom == null && transactionsTo == null) + if (transactionsFrom == null && transactionsTo == null) { return true; + } java.time.LocalDateTime transactionDate = t.getTransactionLocalDate().toDateTimeAtStartOfDay().toDate().toInstant().atZone(zoneId).toLocalDateTime(); return (transactionsTo == null || transactionsTo.compareTo(transactionDate) > 0) @@ -175,19 +174,18 @@ public InteropIdentifiersResponseData getAccountIdentifiers(@NotNull String acco } @NotNull + @Override @Transactional public InteropIdentifierAccountResponseData getAccountByIdentifier(@NotNull InteropIdentifierType idType, @NotNull String idValue, String subIdOrType) { InteropIdentifier identifier = findIdentifier(idType, idValue, subIdOrType); - if (identifier == null) - throw new UnsupportedOperationException("Account not found for identifier " + idType + "/" + idValue + (subIdOrType == null ? "" : ("/" + subIdOrType))); - return InteropIdentifierAccountResponseData.build(identifier.getAccount().getExternalId()); } @NotNull + @Override @Transactional(propagation = Propagation.MANDATORY) public InteropIdentifierAccountResponseData registerAccountIdentifier(@NotNull InteropIdentifierType idType, @NotNull String idValue, - String subIdOrType, @NotNull JsonCommand command) { + String subIdOrType, @NotNull JsonCommand command) { InteropIdentifierRequestData request = dataValidator.validateAndParseCreateIdentifier(idType, idValue, subIdOrType, command); //TODO: error handling SavingsAccount savingsAccount = validateAndGetSavingAccount(request.getAccountId()); @@ -202,13 +200,12 @@ public InteropIdentifierAccountResponseData registerAccountIdentifier(@NotNull I return InteropIdentifierAccountResponseData.build(savingsAccount.getExternalId()); } + @Override @NotNull @Transactional(propagation = Propagation.MANDATORY) public InteropIdentifierAccountResponseData deleteAccountIdentifier(@NotNull InteropIdentifierType idType, @NotNull String idValue, - String subIdOrType) { + String subIdOrType) { InteropIdentifier identifier = findIdentifier(idType, idValue, subIdOrType); - if (identifier == null) - throw new UnsupportedOperationException("Account not found for identifier " + idType + "/" + idValue + (subIdOrType == null ? "" : ("/" + subIdOrType))); String accountId = identifier.getAccount().getExternalId(); @@ -230,8 +227,7 @@ public InteropTransactionRequestResponseData createTransactionRequest(@NotNull J // only when Payee request transaction from Payer, so here role must be always Payer InteropTransactionRequestData request = dataValidator.validateAndParseCreateRequest(command); - //TODO: error handling - SavingsAccount savingsAccount = validateAndGetSavingAccount(request); + validateAndGetSavingAccount(request); return InteropTransactionRequestResponseData.build(command.commandId(), request.getTransactionCode(), InteropActionState.ACCEPTED, request.getExpiration(), request.getExtensionList(), request.getRequestCode()); @@ -282,8 +278,9 @@ public InteropTransferResponseData prepareTransfer(@NotNull JsonCommand command) if (MathUtil.isLessThan(savingsAccount.getWithdrawableBalance(), total)) { throw new UnsupportedOperationException(); } - if (findTransaction(savingsAccount, transferCode, SavingsAccountTransactionType.AMOUNT_HOLD) != null) + if (findTransaction(savingsAccount, transferCode, SavingsAccountTransactionType.AMOUNT_HOLD) != null) { throw new UnsupportedOperationException("Transfer amount was already put on hold " + transferCode); + } PaymentDetail paymentDetail = PaymentDetail.instance(findPaymentType(), savingsAccount.getExternalId(), null, getRoutingCode(), transferCode, null); AppUser appUser = getLoginUser(); @@ -316,8 +313,9 @@ public InteropTransferResponseData commitTransfer(@NotNull JsonCommand command) validateTransfer(request, savingsAccount); String transferCode = request.getTransferCode(); - if (findTransaction(savingsAccount, transferCode, debit ? SavingsAccountTransactionType.WITHDRAWAL : SavingsAccountTransactionType.DEPOSIT) != null) + if (findTransaction(savingsAccount, transferCode, debit ? SavingsAccountTransactionType.WITHDRAWAL : SavingsAccountTransactionType.DEPOSIT) != null) { throw new UnsupportedOperationException("Transfer was already committed " + transferCode); + } PaymentDetail paymentDetail = PaymentDetail.instance(findPaymentType(), savingsAccount.getExternalId(), null, getRoutingCode(), transferCode, null); @@ -366,8 +364,9 @@ public InteropTransferResponseData commitTransfer(@NotNull JsonCommand command) private SavingsAccount validateAndGetSavingAccount(String accountId) { SavingsAccount savingsAccount = savingsAccountRepository.findByExternalId(accountId); - if (savingsAccount == null) + if (savingsAccount == null) { throw new SavingsAccountNotFoundException(accountId); + } return savingsAccount; } @@ -377,16 +376,19 @@ private SavingsAccount validateAndGetSavingAccount(@NotNull InteropRequestData r savingsAccount.setHelpers(savingsAccountTransactionSummaryWrapper, savingsHelper); ApplicationCurrency currency = currencyRepository.findOneByCode(request.getAmount().getCurrency()); - if (!savingsAccount.getCurrency().getCode().equals(currency.getCode())) + if (!savingsAccount.getCurrency().getCode().equals(currency.getCode())) { throw new UnsupportedOperationException(); + } SavingsAccountTransactionType transactionType = request.getTransactionRole().getTransactionType(); - if (!savingsAccount.isTransactionAllowed(transactionType, request.getExpirationLocalDate())) + if (!savingsAccount.isTransactionAllowed(transactionType, request.getExpirationLocalDate())) { throw new UnsupportedOperationException(); + } request.normalizeAmounts(savingsAccount.getCurrency()); - if (transactionType.isDebit() && MathUtil.isLessThan(savingsAccount.getWithdrawableBalance(), request.getAmount().getAmount())) + if (transactionType.isDebit() && MathUtil.isLessThan(savingsAccount.getWithdrawableBalance(), request.getAmount().getAmount())) { throw new UnsupportedOperationException(); + } return savingsAccount; } @@ -398,15 +400,17 @@ private BigDecimal validateTransfer(@NotNull InteropTransferRequestData request, BigDecimal total = transactionType.isDebit() ? amount : MathUtil.negate(amount); MoneyData fspFee = request.getFspFee(); if (fspFee != null) { - if (!savingsAccount.getCurrency().getCode().equals(fspFee.getCurrency())) + if (!savingsAccount.getCurrency().getCode().equals(fspFee.getCurrency())) { throw new UnsupportedOperationException(); + } //TODO: compare with calculated quote fee total = MathUtil.add(total, fspFee.getAmount()); } MoneyData fspCommission = request.getFspCommission(); if (fspCommission != null) { - if (!savingsAccount.getCurrency().getCode().equals(fspCommission.getCurrency())) + if (!savingsAccount.getCurrency().getCode().equals(fspCommission.getCurrency())) { throw new UnsupportedOperationException(); + } //TODO: compare with calculated quote commission total = MathUtil.subtractToZero(total, fspCommission.getAmount()); } @@ -415,11 +419,13 @@ private BigDecimal validateTransfer(@NotNull InteropTransferRequestData request, private DateTimeFormatter getDateTimeFormatter(@NotNull JsonCommand command) { Locale locale = command.extractLocale(); - if (locale == null) + if (locale == null) { locale = DEFAULT_LOCALE; + } String dateFormat = command.dateFormat(); - if (StringUtils.isEmpty(dateFormat)) + if (StringUtils.isEmpty(dateFormat)) { dateFormat = "yyyy-MM-dd HH:mm:ss.SSS"; + } return DateTimeFormat.forPattern(dateFormat).withLocale(locale); } @@ -427,11 +433,12 @@ private DateTimeFormatter getDateTimeFormatter(@NotNull JsonCommand command) { PaymentType findPaymentType() { List paymentTypes = paymentTypeRepository.findAll(); for (PaymentType paymentType : paymentTypes) { - if (!paymentType.isCashPayment()) + if (!paymentType.isCashPayment()) { return paymentType; - //TODO: for now first not cash is retured: - // 1. must be added as initial setup, - // 2. if more than one non-cashe type added then update this code + //TODO: for now first not cash is retured: + // 1. must be added as initial setup, + // 2. if more than one non-cashe type added then update this code + } } return null; } @@ -439,18 +446,22 @@ PaymentType findPaymentType() { SavingsAccountTransaction findTransaction(@NotNull SavingsAccount savingsAccount, @NotNull String transactionCode, SavingsAccountTransactionType transactionType) { String routingCode = getRoutingCode(); for (SavingsAccountTransaction transaction : savingsAccount.getTransactions()) { - if (transactionType != null && !transactionType.getValue().equals(transaction.getTypeOf())) + if (transactionType != null && !transactionType.getValue().equals(transaction.getTypeOf())) { continue; + } PaymentDetail detail = transaction.getPaymentDetail(); - if (detail != null && routingCode.equals(detail.getRoutingCode()) && transactionCode.equals(detail.getReceiptNumber())) + if (detail != null && routingCode.equals(detail.getRoutingCode()) && transactionCode.equals(detail.getReceiptNumber())) { return transaction; + } } return null; } public InteropIdentifier findIdentifier(@NotNull InteropIdentifierType idType, @NotNull String idValue, String subIdOrType) { - return identifierRepository.findOne(where(idTypeEqual(idType)).and(idValueEqual(idValue)).and(subIdOrTypeEqual(subIdOrType))).get(); + return identifierRepository.findOne(where(idTypeEqual(idType)).and(idValueEqual(idValue)).and(subIdOrTypeEqual(subIdOrType))) + .orElseThrow(() -> new UnsupportedOperationException( + "Account not found for identifier " + idType + "/" + idValue + (subIdOrType == null ? "" : ("/" + subIdOrType)))); } public static Specification idTypeEqual(@NotNull InteropIdentifierType idType) { From 1b1e80b6b1e084d30c19fa339fe7342366c43c76 Mon Sep 17 00:00:00 2001 From: Michael Vorburger Date: Mon, 9 Mar 2020 00:29:18 +0100 Subject: [PATCH 09/37] Log errors from cron jobs individually and with cause (FINERACT-858) instead of current huge JobExecutionException message (without cause) --- ...ualAccountingWritePlatformServiceImpl.java | 8 +- .../core/exception/MultiException.java | 45 +++++ .../jobs/annotation/CronTarget.java | 2 - .../jobs/exception/JobExecutionException.java | 8 +- .../infrastructure/jobs/service/JobName.java | 42 ++--- ...ngInstructionWritePlatformServiceImpl.java | 45 +++-- .../domain/LoanAccountDomainServiceJpa.java | 40 +++-- .../service/LoanAccrualPlatformService.java | 5 +- .../LoanAccrualPlatformServiceImpl.java | 53 +++--- .../service/LoanSchedularService.java | 4 - .../service/LoanSchedularServiceImpl.java | 155 +++++++---------- ...WritePlatformServiceJpaRepositoryImpl.java | 162 +++++++++--------- .../service/RecalculateInterestPoster.java | 78 ++------- ...WritePlatformServiceJpaRepositoryImpl.java | 37 ++-- .../service/SavingsSchedularServiceImpl.java | 40 ++--- .../ScheduledJobRunnerServiceImpl.java | 119 ++++++------- 16 files changed, 398 insertions(+), 445 deletions(-) create mode 100644 fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/MultiException.java diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/accrual/service/AccrualAccountingWritePlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/accrual/service/AccrualAccountingWritePlatformServiceImpl.java index 7f42124a761..a7458408a7e 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/accrual/service/AccrualAccountingWritePlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/accrual/service/AccrualAccountingWritePlatformServiceImpl.java @@ -29,6 +29,7 @@ import org.apache.fineract.infrastructure.core.data.ApiParameterError; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.data.DataValidatorBuilder; +import org.apache.fineract.infrastructure.core.exception.MultiException; import org.apache.fineract.infrastructure.core.exception.PlatformApiDataValidationException; import org.apache.fineract.portfolio.loanaccount.service.LoanAccrualPlatformService; import org.joda.time.LocalDate; @@ -52,12 +53,13 @@ public AccrualAccountingWritePlatformServiceImpl(final LoanAccrualPlatformServic public CommandProcessingResult executeLoansPeriodicAccrual(JsonCommand command) { this.accountingDataValidator.validateLoanPeriodicAccrualData(command.json()); LocalDate tilldate = command.localDateValueOfParameterNamed(accrueTillParamName); - String errorlog = this.loanAccrualPlatformService.addPeriodicAccruals(tilldate); - if (errorlog.length() > 0) { + try { + this.loanAccrualPlatformService.addPeriodicAccruals(tilldate); + } catch (MultiException e) { final List dataValidationErrors = new ArrayList<>(); final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors) .resource(PERIODIC_ACCRUAL_ACCOUNTING_RESOURCE_NAME); - baseDataValidator.reset().failWithCodeNoParameterAddedToErrorCode(PERIODIC_ACCRUAL_ACCOUNTING_EXECUTION_ERROR_CODE, errorlog); + baseDataValidator.reset().failWithCodeNoParameterAddedToErrorCode(PERIODIC_ACCRUAL_ACCOUNTING_EXECUTION_ERROR_CODE, e.getMessage()); throw new PlatformApiDataValidationException(dataValidationErrors); } return CommandProcessingResult.empty(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/MultiException.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/MultiException.java new file mode 100644 index 00000000000..79ba28bef3f --- /dev/null +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/MultiException.java @@ -0,0 +1,45 @@ +/** + * 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. + */ +package org.apache.fineract.infrastructure.core.exception; + +/** + * Exception with multiple root causes. + * + * Intended to be used in places where N operations are performed in a loop over something, + * each of which could fail, but where we don't want to fail immediately but continue, and + * then fail at end. + * + *

The failures MUST each be logged within the loop, as they occur; this exception is + * only thrown to propagate the failure, but will not contain and re-log the details. + * + * @author Michael Vorburger.ch + */ +public class MultiException extends Exception { + + private final int n; + + public MultiException(int n) { + super(n + "x failures occured here (details have been previously logged"); + this.n = n; + } + + public int getCausesSize() { + return n; + } +} diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/annotation/CronTarget.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/annotation/CronTarget.java index 1d5596dad41..16aba6e8bbe 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/annotation/CronTarget.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/annotation/CronTarget.java @@ -26,9 +26,7 @@ /** * Annotation that marks a method to be picked while scheduling a cron jobs. - * */ - @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) public @interface CronTarget { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/exception/JobExecutionException.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/exception/JobExecutionException.java index 3ebc87bd74a..c66b9d61247 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/exception/JobExecutionException.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/exception/JobExecutionException.java @@ -18,9 +18,11 @@ */ package org.apache.fineract.infrastructure.jobs.exception; -public class JobExecutionException extends Exception { +import org.apache.fineract.infrastructure.core.exception.MultiException; - public JobExecutionException(final String msg) { - super(msg); +public class JobExecutionException extends MultiException { + + public JobExecutionException(int n) { + super(n); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/JobName.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/JobName.java index 999e296138e..cebba455907 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/JobName.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/JobName.java @@ -20,27 +20,27 @@ public enum JobName { - UPDATE_LOAN_SUMMARY("Update loan Summary"), // - UPDATE_LOAN_ARREARS_AGEING("Update Loan Arrears Ageing"), // - UPDATE_LOAN_PAID_IN_ADVANCE("Update Loan Paid In Advance"), // - APPLY_ANNUAL_FEE_FOR_SAVINGS("Apply Annual Fee For Savings"), // - APPLY_HOLIDAYS_TO_LOANS("Apply Holidays To Loans"), // - POST_INTEREST_FOR_SAVINGS("Post Interest For Savings"), // - TRANSFER_FEE_CHARGE_FOR_LOANS("Transfer Fee For Loans From Savings"), // - ACCOUNTING_RUNNING_BALANCE_UPDATE("Update Accounting Running Balances"), // - PAY_DUE_SAVINGS_CHARGES("Pay Due Savings Charges"), // - APPLY_CHARGE_TO_OVERDUE_LOAN_INSTALLMENT("Apply penalty to overdue loans"), // - EXECUTE_STANDING_INSTRUCTIONS("Execute Standing Instruction"), // - ADD_ACCRUAL_ENTRIES("Add Accrual Transactions"), // - UPDATE_NPA("Update Non Performing Assets"), // - UPDATE_DEPOSITS_ACCOUNT_MATURITY_DETAILS("Update Deposit Accounts Maturity details"), // - TRANSFER_INTEREST_TO_SAVINGS("Transfer Interest To Savings"), // - ADD_PERIODIC_ACCRUAL_ENTRIES("Add Periodic Accrual Transactions"), // - RECALCULATE_INTEREST_FOR_LOAN("Recalculate Interest For Loans"), // - GENERATE_RD_SCEHDULE("Generate Mandatory Savings Schedule"), // - GENERATE_LOANLOSS_PROVISIONING("Generate Loan Loss Provisioning"), // - POST_DIVIDENTS_FOR_SHARES("Post Dividends For Shares"), // - UPDATE_SAVINGS_DORMANT_ACCOUNTS("Update Savings Dormant Accounts"), // + UPDATE_LOAN_SUMMARY("Update loan Summary"), + UPDATE_LOAN_ARREARS_AGEING("Update Loan Arrears Ageing"), + UPDATE_LOAN_PAID_IN_ADVANCE("Update Loan Paid In Advance"), + APPLY_ANNUAL_FEE_FOR_SAVINGS("Apply Annual Fee For Savings"), + APPLY_HOLIDAYS_TO_LOANS("Apply Holidays To Loans"), + POST_INTEREST_FOR_SAVINGS("Post Interest For Savings"), + TRANSFER_FEE_CHARGE_FOR_LOANS("Transfer Fee For Loans From Savings"), + ACCOUNTING_RUNNING_BALANCE_UPDATE("Update Accounting Running Balances"), + PAY_DUE_SAVINGS_CHARGES("Pay Due Savings Charges"), + APPLY_CHARGE_TO_OVERDUE_LOAN_INSTALLMENT("Apply penalty to overdue loans"), + EXECUTE_STANDING_INSTRUCTIONS("Execute Standing Instruction"), + ADD_ACCRUAL_ENTRIES("Add Accrual Transactions"), + UPDATE_NPA("Update Non Performing Assets"), + UPDATE_DEPOSITS_ACCOUNT_MATURITY_DETAILS("Update Deposit Accounts Maturity details"), + TRANSFER_INTEREST_TO_SAVINGS("Transfer Interest To Savings"), + ADD_PERIODIC_ACCRUAL_ENTRIES("Add Periodic Accrual Transactions"), + RECALCULATE_INTEREST_FOR_LOAN("Recalculate Interest For Loans"), + GENERATE_RD_SCEHDULE("Generate Mandatory Savings Schedule"), + GENERATE_LOANLOSS_PROVISIONING("Generate Loan Loss Provisioning"), + POST_DIVIDENTS_FOR_SHARES("Post Dividends For Shares"), + UPDATE_SAVINGS_DORMANT_ACCOUNTS("Update Savings Dormant Accounts"), ADD_PERIODIC_ACCRUAL_ENTRIES_FOR_LOANS_WITH_INCOME_POSTED_AS_TRANSACTIONS("Add Accrual Transactions For Loans With Income Posted As Transactions"), EXECUTE_REPORT_MAILING_JOBS("Execute Report Mailing Jobs"), UPDATE_SMS_OUTBOUND_WITH_CAMPAIGN_MESSAGE("Update SMS Outbound with Campaign Message"), diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/service/StandingInstructionWritePlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/service/StandingInstructionWritePlatformServiceImpl.java index 657e26d36a5..dac87a23ef4 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/service/StandingInstructionWritePlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/service/StandingInstructionWritePlatformServiceImpl.java @@ -167,10 +167,10 @@ public CommandProcessingResult update(final Long id, final JsonCommand command) AccountTransferStandingInstruction standingInstructionsForUpdate = this.standingInstructionRepository.findById(id) .orElseThrow(() -> new StandingInstructionNotFoundException(id)); final Map actualChanges = standingInstructionsForUpdate.update(command); - return new CommandProcessingResultBuilder() // - .withCommandId(command.commandId()) // - .withEntityId(id) // - .with(actualChanges) // + return new CommandProcessingResultBuilder() + .withCommandId(command.commandId()) + .withEntityId(id) + .with(actualChanges) .build(); } @@ -182,9 +182,9 @@ public CommandProcessingResult delete(final Long id) { final Map actualChanges = new HashMap<>(); actualChanges.put(statusParamName, StandingInstructionStatus.DELETED.getValue()); - return new CommandProcessingResultBuilder() // - .withEntityId(id) // - .with(actualChanges) // + return new CommandProcessingResultBuilder() + .withEntityId(id) + .with(actualChanges) .build(); } @@ -237,8 +237,8 @@ public void executeStandingInstructions() throws JobExecutionException { final boolean isExceptionForBalanceCheck = false; AccountTransferDTO accountTransferDTO = new AccountTransferDTO(transactionDate, transactionAmount, data.fromAccountType(), data.toAccountType(), data.fromAccount().accountId(), data.toAccount().accountId(), data.name() - + " Standing instruction trasfer ", null, null, null, null, data.toTransferType(), null, null, data - .transferType().getValue(), null, null, null, null, null, fromSavingsAccount, + + " Standing instruction trasfer ", null, null, null, null, data.toTransferType(), null, null, data + .transferType().getValue(), null, null, null, null, null, fromSavingsAccount, isRegularTransaction, isExceptionForBalanceCheck); final boolean transferCompleted = transferAmount(sb, accountTransferDTO, data.getId()); @@ -249,14 +249,13 @@ public void executeStandingInstructions() throws JobExecutionException { } } - if (sb.length() > 0) { throw new JobExecutionException(sb.toString()); } - + if (sb.length() > 0) { + logger.error("executeStandingInstructions (transferAmount) encountered failure/s: {}", sb.toString()); + // This is a bit of a hack (related to https://issues.apache.org/jira/browse/FINERACT-858) and could be improved.. + throw new JobExecutionException(123456789); + } } - /** - * @param sb - * @param accountTransferDTO - */ private boolean transferAmount(final StringBuilder sb, final AccountTransferDTO accountTransferDTO, final Long instructionId) { boolean transferCompleted = true; StringBuffer errorLog = new StringBuffer(); @@ -266,23 +265,23 @@ private boolean transferAmount(final StringBuilder sb, final AccountTransferDTO this.accountTransfersWritePlatformService.transferFunds(accountTransferDTO); } catch (final PlatformApiDataValidationException e) { sb.append("Validation exception while trasfering funds for standing Instruction id").append(instructionId).append(" from ") - .append(accountTransferDTO.getFromAccountId()).append(" to ").append(accountTransferDTO.getToAccountId()) - .append("--------"); + .append(accountTransferDTO.getFromAccountId()).append(" to ").append(accountTransferDTO.getToAccountId()) + .append("--------"); errorLog.append("Validation exception while trasfering funds " + e.getDefaultUserMessage()); } catch (final InsufficientAccountBalanceException e) { sb.append("InsufficientAccountBalance Exception while trasfering funds for standing Instruction id").append(instructionId) - .append(" from ").append(accountTransferDTO.getFromAccountId()).append(" to ") - .append(accountTransferDTO.getToAccountId()).append("--------"); + .append(" from ").append(accountTransferDTO.getFromAccountId()).append(" to ") + .append(accountTransferDTO.getToAccountId()).append("--------"); errorLog.append("InsufficientAccountBalance Exception "); } catch (final AbstractPlatformServiceUnavailableException e) { sb.append("Platform exception while trasfering funds for standing Instruction id").append(instructionId).append(" from ") - .append(accountTransferDTO.getFromAccountId()).append(" to ").append(accountTransferDTO.getToAccountId()) - .append("--------"); + .append(accountTransferDTO.getFromAccountId()).append(" to ").append(accountTransferDTO.getToAccountId()) + .append("--------"); errorLog.append("Platform exception while trasfering funds " + e.getDefaultUserMessage()); } catch (Exception e) { sb.append("Exception while trasfering funds for standing Instruction id").append(instructionId).append(" from ") - .append(accountTransferDTO.getFromAccountId()).append(" to ").append(accountTransferDTO.getToAccountId()) - .append("--------"); + .append(accountTransferDTO.getFromAccountId()).append(" to ").append(accountTransferDTO.getToAccountId()) + .append("--------"); errorLog.append("Exception while trasfering funds " + e.getMessage()); } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanAccountDomainServiceJpa.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanAccountDomainServiceJpa.java index af4eb326073..f288b6d2c81 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanAccountDomainServiceJpa.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanAccountDomainServiceJpa.java @@ -35,6 +35,7 @@ import org.apache.fineract.infrastructure.core.data.CommandProcessingResultBuilder; import org.apache.fineract.infrastructure.core.data.DataValidatorBuilder; import org.apache.fineract.infrastructure.core.exception.GeneralPlatformDomainRuleException; +import org.apache.fineract.infrastructure.core.exception.MultiException; import org.apache.fineract.infrastructure.core.exception.PlatformApiDataValidationException; import org.apache.fineract.infrastructure.core.service.DateUtils; import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext; @@ -227,10 +228,10 @@ public LoanTransaction makeRepayment(final Loan loan, final CommandProcessingRes // disable all active standing orders linked to this loan if status changes to closed disableStandingInstructionsLinkedToClosedLoan(loan); - builderResult.withEntityId(newRepaymentTransaction.getId()) // - .withOfficeId(loan.getOfficeId()) // - .withClientId(loan.getClientId()) // - .withGroupId(loan.getGroupId()); // + builderResult.withEntityId(newRepaymentTransaction.getId()) + .withOfficeId(loan.getOfficeId()) + .withClientId(loan.getClientId()) + .withGroupId(loan.getGroupId()); return newRepaymentTransaction; } @@ -244,7 +245,7 @@ private void saveLoanTransactionWithDataIntegrityViolationChecks(LoanTransaction final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource("loan.transaction"); if (realCause.getMessage().toLowerCase().contains("external_id_unique")) { baseDataValidator.reset().parameter("externalId").value(newRepaymentTransaction.getExternalId()) - .failWithCode("value.must.be.unique"); + .failWithCode("value.must.be.unique"); } if (!dataValidationErrors.isEmpty()) { throw new PlatformApiDataValidationException("validation.msg.validation.errors.exist", "Validation errors exist.", dataValidationErrors); } @@ -412,10 +413,10 @@ public LoanTransaction makeRefund(final Long accountId, final CommandProcessingR postJournalEntries(loan, existingTransactionIds, existingReversedTransactionIds, isAccountTransfer); this.businessEventNotifierService.notifyBusinessEventWasExecuted(BUSINESS_EVENTS.LOAN_REFUND, constructEntityMap(BUSINESS_ENTITY.LOAN_TRANSACTION, newRefundTransaction)); - builderResult.withEntityId(newRefundTransaction.getId()) // - .withOfficeId(loan.getOfficeId()) // - .withClientId(loan.getClientId()) // - .withGroupId(loan.getGroupId()); // + builderResult.withEntityId(newRefundTransaction.getId()) + .withOfficeId(loan.getOfficeId()) + .withClientId(loan.getClientId()) + .withGroupId(loan.getGroupId()); return newRefundTransaction; } @@ -509,10 +510,11 @@ public void recalculateAccruals(Loan loan, boolean isInterestCalcualtionHappened } if (!loanScheduleAccrualDatas.isEmpty()) { - String error = this.loanAccrualPlatformService.addPeriodicAccruals(accruedTill, loanScheduleAccrualDatas); - if (error.length() > 0) { + try { + this.loanAccrualPlatformService.addPeriodicAccruals(accruedTill, loanScheduleAccrualDatas); + } catch (MultiException e) { String globalisationMessageCode = "error.msg.accrual.exception"; - throw new GeneralPlatformDomainRuleException(globalisationMessageCode, error, error); + throw new GeneralPlatformDomainRuleException(globalisationMessageCode, e.getMessage()); } } } @@ -543,10 +545,10 @@ private void generateLoanScheduleAccrualData(final LocalDate accruedTill, final LoanScheduleAccrualData accrualData = new LoanScheduleAccrualData(loanId, officeId, installment.getInstallmentNumber(), accrualStartDate, repaymentFrequency, repayEvery, installment.getDueDate(), installment.getFromDate(), installment.getId(), loanProductId, installment.getInterestCharged(currency).getAmount(), installment - .getFeeChargesCharged(currency).getAmount(), installment.getPenaltyChargesCharged(currency).getAmount(), + .getFeeChargesCharged(currency).getAmount(), installment.getPenaltyChargesCharged(currency).getAmount(), installment.getInterestAccrued(currency).getAmount(), installment.getFeeAccrued(currency).getAmount(), installment - .getPenaltyAccrued(currency).getAmount(), currencyData, interestCalculatedFrom, installment - .getInterestWaived(currency).getAmount()); + .getPenaltyAccrued(currency).getAmount(), currencyData, interestCalculatedFrom, installment + .getInterestWaived(currency).getAmount()); loanScheduleAccrualDatas.add(accrualData); } @@ -604,10 +606,10 @@ public LoanTransaction makeRefundForActiveLoan(Long accountId, CommandProcessing this.businessEventNotifierService.notifyBusinessEventWasExecuted(BUSINESS_EVENTS.LOAN_REFUND, constructEntityMap(BUSINESS_ENTITY.LOAN_TRANSACTION, newRefundTransaction)); - builderResult.withEntityId(newRefundTransaction.getId()) // - .withOfficeId(loan.getOfficeId()) // - .withClientId(loan.getClientId()) // - .withGroupId(loan.getGroupId()); // + builderResult.withEntityId(newRefundTransaction.getId()) + .withOfficeId(loan.getOfficeId()) + .withClientId(loan.getClientId()) + .withGroupId(loan.getGroupId()); return newRefundTransaction; } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanAccrualPlatformService.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanAccrualPlatformService.java index d3311f0c875..edcbf940222 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanAccrualPlatformService.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanAccrualPlatformService.java @@ -19,15 +19,16 @@ package org.apache.fineract.portfolio.loanaccount.service; import java.util.Collection; +import org.apache.fineract.infrastructure.core.exception.MultiException; import org.apache.fineract.infrastructure.jobs.exception.JobExecutionException; import org.apache.fineract.portfolio.loanaccount.data.LoanScheduleAccrualData; import org.joda.time.LocalDate; public interface LoanAccrualPlatformService { - String addPeriodicAccruals(LocalDate tilldate); + void addPeriodicAccruals(LocalDate tilldate) throws MultiException; - String addPeriodicAccruals(LocalDate tilldate, Collection loanScheduleAccrualDatas); + void addPeriodicAccruals(LocalDate tilldate, Collection loanScheduleAccrualDatas) throws MultiException; void addAccrualAccounting() throws JobExecutionException; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanAccrualPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanAccrualPlatformServiceImpl.java index af990cabacd..284b692c0b1 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanAccrualPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanAccrualPlatformServiceImpl.java @@ -22,17 +22,22 @@ import java.util.Collection; import java.util.HashMap; import java.util.Map; +import org.apache.fineract.infrastructure.core.exception.MultiException; import org.apache.fineract.infrastructure.jobs.annotation.CronTarget; import org.apache.fineract.infrastructure.jobs.exception.JobExecutionException; import org.apache.fineract.infrastructure.jobs.service.JobName; import org.apache.fineract.portfolio.loanaccount.data.LoanScheduleAccrualData; import org.joda.time.LocalDate; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @Service public class LoanAccrualPlatformServiceImpl implements LoanAccrualPlatformService { + private final static Logger LOG = LoggerFactory.getLogger(LoanAccrualPlatformServiceImpl.class); + private final LoanReadPlatformService loanReadPlatformService; private final LoanAccrualWritePlatformService loanAccrualWritePlatformService; @@ -47,7 +52,6 @@ public LoanAccrualPlatformServiceImpl(final LoanReadPlatformService loanReadPlat @CronTarget(jobName = JobName.ADD_ACCRUAL_ENTRIES) public void addAccrualAccounting() throws JobExecutionException { Collection loanScheduleAccrualDatas = this.loanReadPlatformService.retriveScheduleAccrualData(); - StringBuilder sb = new StringBuilder(); Map> loanDataMap = new HashMap<>(); for (final LoanScheduleAccrualData accrualData : loanScheduleAccrualDatas) { if (loanDataMap.containsKey(accrualData.getLoanId())) { @@ -59,37 +63,36 @@ public void addAccrualAccounting() throws JobExecutionException { } } + int errors = 0; for (Map.Entry> mapEntry : loanDataMap.entrySet()) { try { this.loanAccrualWritePlatformService.addAccrualAccounting(mapEntry.getKey(), mapEntry.getValue()); } catch (Exception e) { - Throwable realCause = e; - if (e.getCause() != null) { - realCause = e.getCause(); - } - sb.append("failed to add accural transaction for loan " + mapEntry.getKey() + " with message " + realCause.getMessage()); + LOG.error("Failed to add accural transaction for loan {}", mapEntry.getKey(), e); + ++errors; } } - - if (sb.length() > 0) { throw new JobExecutionException(sb.toString()); } + if (errors > 0) { throw new JobExecutionException(errors); } } @Override @CronTarget(jobName = JobName.ADD_PERIODIC_ACCRUAL_ENTRIES) public void addPeriodicAccruals() throws JobExecutionException { - String errors = addPeriodicAccruals(LocalDate.now()); - if (errors.length() > 0) { throw new JobExecutionException(errors); } + try { + addPeriodicAccruals(LocalDate.now()); + } catch (MultiException e) { + throw new JobExecutionException(e.getCausesSize()); + } } @Override - public String addPeriodicAccruals(final LocalDate tilldate) { + public void addPeriodicAccruals(final LocalDate tilldate) throws MultiException { Collection loanScheduleAccrualDatas = this.loanReadPlatformService.retrivePeriodicAccrualData(tilldate); - return addPeriodicAccruals(tilldate, loanScheduleAccrualDatas); + addPeriodicAccruals(tilldate, loanScheduleAccrualDatas); } @Override - public String addPeriodicAccruals(final LocalDate tilldate, Collection loanScheduleAccrualDatas) { - StringBuilder sb = new StringBuilder(); + public void addPeriodicAccruals(final LocalDate tilldate, Collection loanScheduleAccrualDatas) throws MultiException { Map> loanDataMap = new HashMap<>(); for (final LoanScheduleAccrualData accrualData : loanScheduleAccrualDatas) { if (loanDataMap.containsKey(accrualData.getLoanId())) { @@ -101,19 +104,16 @@ public String addPeriodicAccruals(final LocalDate tilldate, Collection> mapEntry : loanDataMap.entrySet()) { try { this.loanAccrualWritePlatformService.addPeriodicAccruals(tilldate, mapEntry.getKey(), mapEntry.getValue()); } catch (Exception e) { - Throwable realCause = e; - if (e.getCause() != null) { - realCause = e.getCause(); - } - sb.append("failed to add accural transaction for loan " + mapEntry.getKey() + " with message " + realCause.getMessage()); + LOG.error("Failed to add accural transaction for loan {}", mapEntry.getKey(), e); + ++errors; } } - - return sb.toString(); + if (errors > 0) { throw new MultiException(errors); } } @Override @@ -121,19 +121,16 @@ public String addPeriodicAccruals(final LocalDate tilldate, Collection loanIds = this.loanReadPlatformService.retrieveLoanIdsWithPendingIncomePostingTransactions(); if(loanIds != null && loanIds.size() > 0){ - StringBuilder sb = new StringBuilder(); + int errors = 0; for (Long loanId : loanIds) { try { this.loanAccrualWritePlatformService.addIncomeAndAccrualTransactions(loanId); } catch (Exception e) { - Throwable realCause = e; - if (e.getCause() != null) { - realCause = e.getCause(); - } - sb.append("failed to add income and accrual transaction for loan " + loanId + " with message " + realCause.getMessage()); + LOG.error("Failed to add income and accrual transaction for loan {}", loanId, e); + ++errors; } } - if (sb.length() > 0) { throw new JobExecutionException(sb.toString()); } + if (errors > 0) { throw new JobExecutionException(errors); } } } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanSchedularService.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanSchedularService.java index 25b1728cf71..b6bfa2943bc 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanSchedularService.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanSchedularService.java @@ -20,7 +20,6 @@ import java.util.Map; import org.apache.fineract.infrastructure.jobs.exception.JobExecutionException; -import org.apache.fineract.organisation.office.data.OfficeData; public interface LoanSchedularService { @@ -29,8 +28,5 @@ public interface LoanSchedularService { void recalculateInterest() throws JobExecutionException; - void recalculateInterest(final OfficeData office, final int threadPoolSize, final int batchSize); - void recalculateInterest(@SuppressWarnings("unused") final Map jobParameters); - } \ No newline at end of file diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanSchedularServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanSchedularServiceImpl.java index f56bdedc552..b8d36f61965 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanSchedularServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanSchedularServiceImpl.java @@ -55,6 +55,7 @@ public class LoanSchedularServiceImpl implements LoanSchedularService { private final static Logger logger = LoggerFactory.getLogger(LoanSchedularServiceImpl.class); + private final ConfigurationDomainService configurationDomainService; private final LoanReadPlatformService loanReadPlatformService; private final LoanWritePlatformService loanWritePlatformService; @@ -63,9 +64,9 @@ public class LoanSchedularServiceImpl implements LoanSchedularService { @Autowired public LoanSchedularServiceImpl(final ConfigurationDomainService configurationDomainService, - final LoanReadPlatformService loanReadPlatformService, final LoanWritePlatformService loanWritePlatformService, - final OfficeReadPlatformService officeReadPlatformService, - final ApplicationContext applicationContext) { + final LoanReadPlatformService loanReadPlatformService, final LoanWritePlatformService loanWritePlatformService, + final OfficeReadPlatformService officeReadPlatformService, + final ApplicationContext applicationContext) { this.configurationDomainService = configurationDomainService; this.loanReadPlatformService = loanReadPlatformService; this.loanWritePlatformService = loanWritePlatformService; @@ -83,7 +84,6 @@ public void applyChargeForOverdueLoans() throws JobExecutionException { .retrieveAllLoansWithOverdueInstallments(penaltyWaitPeriodValue,backdatePenalties); if (!overdueLoanScheduledInstallments.isEmpty()) { - final StringBuilder sb = new StringBuilder(); final Map> overdueScheduleData = new HashMap<>(); for (final OverdueLoanScheduleData overdueInstallment : overdueLoanScheduledInstallments) { if (overdueScheduleData.containsKey(overdueInstallment.getLoanId())) { @@ -95,6 +95,7 @@ public void applyChargeForOverdueLoans() throws JobExecutionException { } } + int numberOfErrors = 0; for (final Long loanId : overdueScheduleData.keySet()) { try { this.loanWritePlatformService.applyOverdueChargesForLoan(loanId, overdueScheduleData.get(loanId)); @@ -102,28 +103,18 @@ public void applyChargeForOverdueLoans() throws JobExecutionException { } catch (final PlatformApiDataValidationException e) { final List errors = e.getErrors(); for (final ApiParameterError error : errors) { - logger.error("Apply Charges due for overdue loans failed for account:" + loanId + " with message " - + error.getDeveloperMessage()); - sb.append("Apply Charges due for overdue loans failed for account:").append(loanId).append(" with message ") - .append(error.getDeveloperMessage()); + logger.error("Apply Charges due for overdue loans failed for account {} with message: {}", loanId, error.getDeveloperMessage(), e); + ++numberOfErrors; } - } catch (final AbstractPlatformDomainRuleException ex) { - logger.error("Apply Charges due for overdue loans failed for account:" + loanId + " with message " - + ex.getDefaultUserMessage()); - sb.append("Apply Charges due for overdue loans failed for account:").append(loanId).append(" with message ") - .append(ex.getDefaultUserMessage()); + } catch (final AbstractPlatformDomainRuleException e) { + logger.error("Apply Charges due for overdue loans failed for account {} with message: {}", loanId, e.getDefaultUserMessage(), e); + ++numberOfErrors; } catch (Exception e) { - Throwable realCause = e; - if (e.getCause() != null) { - realCause = e.getCause(); - } - logger.error("Apply Charges due for overdue loans failed for account:" + loanId + " with message " - + realCause.getMessage()); - sb.append("Apply Charges due for overdue loans failed for account:").append(loanId).append(" with message ") - .append(realCause.getMessage()); + logger.error("Apply Charges due for overdue loans failed for account {}", loanId, e); + ++numberOfErrors; } } - if (sb.length() > 0) { throw new JobExecutionException(sb.toString()); } + if (numberOfErrors > 0) { throw new JobExecutionException(numberOfErrors); } } } @@ -138,64 +129,44 @@ public void recalculateInterest() throws JobExecutionException { .fetchLoansForInterestRecalculation(); int i = 0; if (!loanIds.isEmpty()) { - final StringBuilder sb = new StringBuilder(); + int errors = 0; for (Long loanId : loanIds) { - logger.info("Loan ID " + loanId); + logger.info("recalculateInterest: Loan ID = {}", loanId); Integer numberOfRetries = 0; while (numberOfRetries <= maxNumberOfRetries) { try { - this.loanWritePlatformService - .recalculateInterest(loanId); + this.loanWritePlatformService.recalculateInterest(loanId); numberOfRetries = maxNumberOfRetries + 1; } catch (CannotAcquireLockException | ObjectOptimisticLockingFailureException exception) { - logger.info("Recalulate interest job has been retried " - + numberOfRetries + " time(s)"); - /*** - * Fail if the transaction has been retired for - * maxNumberOfRetries - **/ + logger.info("Recalulate interest job has been retried {} time(s)", numberOfRetries); + // Fail if the transaction has been retried for maxNumberOfRetries if (numberOfRetries >= maxNumberOfRetries) { - logger.warn("Recalulate interest job has been retried for the max allowed attempts of " - + numberOfRetries - + " and will be rolled back"); - sb.append("Recalulate interest job has been retried for the max allowed attempts of " - + numberOfRetries - + " and will be rolled back"); + logger.error("Recalulate interest job has been retried for the max allowed attempts of {} and will be rolled back", numberOfRetries); + ++errors; break; } - /*** - * Else sleep for a random time (between 1 to 10 - * seconds) and continue - **/ + // Else sleep for a random time (between 1 to 10 seconds) and continue try { Random random = new Random(); - int randomNum = random - .nextInt(maxIntervalBetweenRetries + 1); + int randomNum = random.nextInt(maxIntervalBetweenRetries + 1); Thread.sleep(1000 + (randomNum * 1000)); numberOfRetries = numberOfRetries + 1; } catch (InterruptedException e) { - sb.append("Interest recalculation for loans failed " + exception.getMessage()) ; + logger.error("Interest recalculation for loans retry failed due to InterruptedException", e) ; + ++errors; break; } } catch (Exception e) { - Throwable realCause = e; - if (e.getCause() != null) { - realCause = e.getCause(); - } - logger.error("Interest recalculation for loans failed for account:" + loanId + " with message " - + realCause.getMessage()); - sb.append("Interest recalculation for loans failed for account:").append(loanId).append(" with message ") - .append(realCause.getMessage()); + logger.error("Interest recalculation for loans failed for account {}", loanId, e); numberOfRetries = maxNumberOfRetries + 1; + ++errors; } i++; } - logger.info("Loans count " + i); - } - if (sb.length() > 0) { - throw new JobExecutionException(sb.toString()); + logger.info("recalculateInterest: Loans count {}", i); } + if (errors > 0) { throw new JobExecutionException(errors); } } } @@ -203,64 +174,63 @@ public void recalculateInterest() throws JobExecutionException { @Override @CronTarget(jobName = JobName.RECALCULATE_INTEREST_FOR_LOAN) public void recalculateInterest(Map jobParameters) { - //gets the officeId + // gets the officeId final String officeId = jobParameters.get("officeId"); - logger.info(officeId); - Long officeIdLong=Long.valueOf(officeId); - //gets the Office object + logger.info("recalculateInterest: officeId={}", officeId); + Long officeIdLong = Long.valueOf(officeId); + + // gets the Office object final OfficeData office = this.officeReadPlatformService.retrieveOffice(officeIdLong); - if(office == null) + if(office == null) { throw new OfficeNotFoundException(officeIdLong); + } final int threadPoolSize=Integer.parseInt(jobParameters.get("thread-pool-size")); final int batchSize=Integer.parseInt(jobParameters.get("batch-size")); recalculateInterest(office,threadPoolSize,batchSize); } - @Override - public void recalculateInterest(OfficeData office, int threadPoolSize, int batchSize) { + private void recalculateInterest(OfficeData office, int threadPoolSize, int batchSize) { final int pageSize = batchSize * threadPoolSize; - //initialise the executor service with fetched configurations + // initialise the executor service with fetched configurations final ExecutorService executorService = Executors.newFixedThreadPool(threadPoolSize); Long maxLoanIdInList = 0L; final String officeHierarchy = office.getHierarchy() + "%"; - //Get the loanIds from service + // get the loanIds from service List loanIds = Collections.synchronizedList(this.loanReadPlatformService .fetchLoansForInterestRecalculation(pageSize, maxLoanIdInList, officeHierarchy)); - // gets the loanIds data set iteratively and call addAccuruals for that paginated dataset do { int totalFilteredRecords = loanIds.size(); logger.info("Starting accrual - total filtered records - " + totalFilteredRecords); - recalculateInterest(loanIds, threadPoolSize, batchSize, - executorService); + recalculateInterest(loanIds, threadPoolSize, batchSize, executorService); maxLoanIdInList+= pageSize+1; loanIds = Collections.synchronizedList(this.loanReadPlatformService .fetchLoansForInterestRecalculation(pageSize, maxLoanIdInList, officeHierarchy)); } while (!CollectionUtils.isEmpty(loanIds)); - //shutdown the executor when done + // shutdown the executor when done executorService.shutdownNow(); } private void recalculateInterest(List loanIds, - int threadPoolSize, int batchSize, final ExecutorService executorService) { - //StringBuilder sb = new StringBuilder(); + int threadPoolSize, int batchSize, final ExecutorService executorService) { - List> posters = new ArrayList>(); + List> posters = new ArrayList<>(); int fromIndex = 0; // get the size of current paginated dataset int size = loanIds.size(); - //calculate the batch size - double toGetCeilValue = (double) (size / threadPoolSize); + // calculate the batch size + double toGetCeilValue = size / threadPoolSize; batchSize = (int) Math.ceil(toGetCeilValue); - if(batchSize == 0) + if(batchSize == 0) { return; + } int toIndex = (batchSize > size - 1)? size : batchSize ; while(toIndex < size && loanIds.get(toIndex - 1).equals(loanIds.get(toIndex))) { @@ -274,27 +244,30 @@ private void recalculateInterest(List loanIds, RecalculateInterestPoster poster = (RecalculateInterestPoster) this.applicationContext.getBean("recalculateInterestPoster"); poster.setLoanIds(subList); poster.setLoanWritePlatformService(loanWritePlatformService); - posters.add(Executors.callable(poster)); - if(lastBatch) + posters.add(poster); + if(lastBatch) { break; - if(toIndex + batchSize > size - 1) + } + if(toIndex + batchSize > size - 1) { lastBatch = true; + } fromIndex = fromIndex + (toIndex - fromIndex); toIndex = (toIndex + batchSize > size - 1)? size : toIndex + batchSize; while(toIndex < size && loanIds.get(toIndex - 1).equals(loanIds.get(toIndex))) { - toIndex ++; + toIndex++; } } try { - List> responses = executorService.invokeAll(posters); + List> responses = executorService.invokeAll(posters); checkCompletion(responses); } catch (InterruptedException e1) { logger.error("Interrupted while recalculateInterest", e1); } } - //break the lists into sub lists - public List safeSubList(List list, int fromIndex, int toIndex) { + + // break the lists into sub lists + private List safeSubList(List list, int fromIndex, int toIndex) { int size = list.size(); if (fromIndex >= size || toIndex <= 0 || fromIndex >= toIndex) { return Collections.emptyList(); @@ -305,30 +278,28 @@ public List safeSubList(List list, int fromIndex, int toIndex) { return list.subList(fromIndex, toIndex); } - //checks the execution of task by each thread in the executor service - private void checkCompletion(List> responses) { + + // checks the execution of task by each thread in the executor service + private void checkCompletion(List> responses) { try { - for(Future f : responses) { + for(Future f : responses) { f.get(); } boolean allThreadsExecuted = false; int noOfThreadsExecuted = 0; - for (Future future : responses) { + for (Future future : responses) { if (future.isDone()) { noOfThreadsExecuted++; } } allThreadsExecuted = noOfThreadsExecuted == responses.size(); - if(!allThreadsExecuted) + if(!allThreadsExecuted) { logger.error("All threads could not execute."); + } } catch (InterruptedException e1) { logger.error("Interrupted while posting IR entries", e1); } catch (ExecutionException e2) { logger.error("Execution exception while posting IR entries", e2); } } - - - - } \ No newline at end of file diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java index d8bf85c0a89..94cb93b2b55 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java @@ -194,7 +194,7 @@ @Service public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatformService { - private final static Logger logger = LoggerFactory.getLogger(LoanWritePlatformServiceJpaRepositoryImpl.class); + private final static Logger LOG = LoggerFactory.getLogger(LoanWritePlatformServiceJpaRepositoryImpl.class); private final PlatformSecurityContext context; private final LoanEventApiJsonValidator loanEventApiJsonValidator; @@ -393,11 +393,11 @@ public CommandProcessingResult disburseLoan(final Long loanId, final JsonCommand throw new GeneralPlatformDomainRuleException( "error.msg.loan.disbursal.date.should.be.after.last.transaction.date.of.loan.to.be.closed", "Disbursal date of this loan application "+loan.getDisbursementDate() - +" should be after last transaction date of loan to be closed "+ lastUserTransactionOnLoanToClose); + +" should be after last transaction date of loan to be closed "+ lastUserTransactionOnLoanToClose); } BigDecimal loanOutstanding = this.loanReadPlatformService.retrieveLoanPrePaymentTemplate(loanIdToClose, - actualDisbursementDate).getAmount(); + actualDisbursementDate).getAmount(); final BigDecimal firstDisbursalAmount = loan.getFirstDisbursalAmount(); if(loanOutstanding.compareTo(firstDisbursalAmount) > 0){ throw new GeneralPlatformDomainRuleException("error.msg.loan.amount.less.than.outstanding.of.loan.to.be.closed", @@ -621,9 +621,7 @@ public Map bulkLoanDisbursal(final JsonCommand command, final Co final LocalDate nextPossibleRepaymentDate = null; final Date rescheduledRepaymentDate = null; - for (int i = 0; i < disbursalCommand.length; i++) { - final SingleDisbursalCommand singleLoanDisbursalCommand = disbursalCommand[i]; - + for (final SingleDisbursalCommand singleLoanDisbursalCommand : disbursalCommand) { final Loan loan = this.loanAssembler.assembleFrom(singleLoanDisbursalCommand.getLoanId()); final LocalDate actualDisbursementDate = command.localDateValueOfParameterNamed("actualDisbursementDate"); @@ -896,7 +894,7 @@ public CommandProcessingResult adjustLoanTransaction(final Long loanId, final Lo constructEntityMap(BUSINESS_ENTITY.LOAN_ADJUSTED_TRANSACTION, transactionToAdjust)); if (this.accountTransfersReadPlatformService.isAccountTransfer(transactionId, PortfolioAccountType.LOAN)) { throw new PlatformServiceUnavailableException( "error.msg.loan.transfer.transaction.update.not.allowed", "Loan transaction:" + transactionId - + " update not allowed as it involves in account transfer", transactionId); } + + " update not allowed as it involves in account transfer", transactionId); } if (loan.isClosedWrittenOff()) { throw new PlatformServiceUnavailableException("error.msg.loan.written.off.update.not.allowed", "Loan transaction:" + transactionId + " update not allowed as loan status is written off", transactionId); } @@ -995,7 +993,7 @@ public CommandProcessingResult adjustLoanTransaction(final Long loanId, final Lo if (!transactionIds.isEmpty()) { this.accountTransfersWritePlatformService - .reverseTransfersWithFromAccountTransactions(transactionIds, PortfolioAccountType.LOAN); + .reverseTransfersWithFromAccountTransactions(transactionIds, PortfolioAccountType.LOAN); loan.updateLoanSummarAndStatus(); } @@ -1008,14 +1006,14 @@ public CommandProcessingResult adjustLoanTransaction(final Long loanId, final Lo } this.businessEventNotifierService.notifyBusinessEventWasExecuted(BUSINESS_EVENTS.LOAN_ADJUST_TRANSACTION, entityMap); - return new CommandProcessingResultBuilder() // - .withCommandId(command.commandId()) // - .withEntityId(transactionId) // - .withOfficeId(loan.getOfficeId()) // - .withClientId(loan.getClientId()) // - .withGroupId(loan.getGroupId()) // - .withLoanId(loanId) // - .with(changes) // + return new CommandProcessingResultBuilder() + .withCommandId(command.commandId()) + .withEntityId(transactionId) + .withOfficeId(loan.getOfficeId()) + .withClientId(loan.getClientId()) + .withGroupId(loan.getGroupId()) + .withLoanId(loanId) + .with(changes) .build(); } @@ -1095,14 +1093,14 @@ public CommandProcessingResult waiveInterestOnLoan(final Long loanId, final Json this.loanAccountDomainService.recalculateAccruals(loan); this.businessEventNotifierService.notifyBusinessEventWasExecuted(BUSINESS_EVENTS.LOAN_WAIVE_INTEREST, constructEntityMap(BUSINESS_ENTITY.LOAN_TRANSACTION, waiveInterestTransaction)); - return new CommandProcessingResultBuilder() // - .withCommandId(command.commandId()) // - .withEntityId(waiveInterestTransaction.getId()) // - .withOfficeId(loan.getOfficeId()) // - .withClientId(loan.getClientId()) // - .withGroupId(loan.getGroupId()) // - .withLoanId(loanId) // - .with(changes) // + return new CommandProcessingResultBuilder() + .withCommandId(command.commandId()) + .withEntityId(waiveInterestTransaction.getId()) + .withOfficeId(loan.getOfficeId()) + .withClientId(loan.getClientId()) + .withGroupId(loan.getGroupId()) + .withLoanId(loanId) + .with(changes) .build(); } @@ -1165,14 +1163,14 @@ public CommandProcessingResult writeOff(final Long loanId, final JsonCommand com this.loanAccountDomainService.recalculateAccruals(loan); this.businessEventNotifierService.notifyBusinessEventWasExecuted(BUSINESS_EVENTS.LOAN_WRITTEN_OFF, constructEntityMap(BUSINESS_ENTITY.LOAN_TRANSACTION, writeoff)); - return new CommandProcessingResultBuilder() // - .withCommandId(command.commandId()) // - .withEntityId(writeoff.getId()) // - .withOfficeId(loan.getOfficeId()) // - .withClientId(loan.getClientId()) // - .withGroupId(loan.getGroupId()) // - .withLoanId(loanId) // - .with(changes) // + return new CommandProcessingResultBuilder() + .withCommandId(command.commandId()) + .withEntityId(writeoff.getId()) + .withOfficeId(loan.getOfficeId()) + .withClientId(loan.getClientId()) + .withGroupId(loan.getGroupId()) + .withLoanId(loanId) + .with(changes) .build(); } @@ -1237,24 +1235,24 @@ public CommandProcessingResult closeLoan(final Long loanId, final JsonCommand co CommandProcessingResult result = null; if (possibleClosingTransaction != null) { - result = new CommandProcessingResultBuilder() // - .withCommandId(command.commandId()) // - .withEntityId(possibleClosingTransaction.getId()) // - .withOfficeId(loan.getOfficeId()) // - .withClientId(loan.getClientId()) // - .withGroupId(loan.getGroupId()) // - .withLoanId(loanId) // - .with(changes) // + result = new CommandProcessingResultBuilder() + .withCommandId(command.commandId()) + .withEntityId(possibleClosingTransaction.getId()) + .withOfficeId(loan.getOfficeId()) + .withClientId(loan.getClientId()) + .withGroupId(loan.getGroupId()) + .withLoanId(loanId) + .with(changes) .build(); } else { - result = new CommandProcessingResultBuilder() // - .withCommandId(command.commandId()) // - .withEntityId(loanId) // - .withOfficeId(loan.getOfficeId()) // - .withClientId(loan.getClientId()) // - .withGroupId(loan.getGroupId()) // - .withLoanId(loanId) // - .with(changes) // + result = new CommandProcessingResultBuilder() + .withCommandId(command.commandId()) + .withEntityId(loanId) + .withOfficeId(loan.getOfficeId()) + .withClientId(loan.getClientId()) + .withGroupId(loan.getGroupId()) + .withLoanId(loanId) + .with(changes) .build(); } @@ -1332,14 +1330,8 @@ public CommandProcessingResult addLoanCharge(final Long loanId, final JsonComman final Charge chargeDefinition = this.chargeRepository.findOneWithNotFoundDetection(chargeDefinitionId); if (loan.isDisbursed() && chargeDefinition.isDisbursementCharge()) { - validateAddingNewChargeAllowed(loanDisburseDetails); // validates - // whether any - // pending - // disbursements - // are - // available to - // apply this - // charge + // validates whether any pending disbursements are available to apply this charge + validateAddingNewChargeAllowed(loanDisburseDetails); } final List existingTransactionIds = new ArrayList<>(loan.findExistingTransactionIds()); final List existingReversedTransactionIds = new ArrayList<>(loan.findExistingReversedTransactionIds()); @@ -1410,13 +1402,13 @@ public CommandProcessingResult addLoanCharge(final Long loanId, final JsonComman } this.businessEventNotifierService.notifyBusinessEventWasExecuted(BUSINESS_EVENTS.LOAN_ADD_CHARGE, constructEntityMap(BUSINESS_ENTITY.LOAN_CHARGE, loanCharge)); - return new CommandProcessingResultBuilder() // - .withCommandId(command.commandId()) // - .withEntityId(loanCharge.getId()) // - .withOfficeId(loan.getOfficeId()) // - .withClientId(loan.getClientId()) // - .withGroupId(loan.getGroupId()) // - .withLoanId(loanId) // + return new CommandProcessingResultBuilder() + .withCommandId(command.commandId()) + .withEntityId(loanCharge.getId()) + .withOfficeId(loan.getOfficeId()) + .withClientId(loan.getClientId()) + .withGroupId(loan.getGroupId()) + .withLoanId(loanId) .build(); } @@ -1782,7 +1774,7 @@ public void transferFeeCharges() throws JobExecutionException { final Collection chargeDatas = this.loanChargeReadPlatformService.retrieveLoanChargesForFeePayment( ChargePaymentMode.ACCOUNT_TRANSFER.getValue(), LoanStatus.ACTIVE.getValue()); final boolean isRegularTransaction = true; - final StringBuilder sb = new StringBuilder(); + int errors = 0; if (chargeDatas != null) { for (final LoanChargeData chargeData : chargeDatas) { if (chargeData.isInstallmentFee()) { @@ -1803,7 +1795,9 @@ public void transferFeeCharges() throws JobExecutionException { null, LoanTransactionType.CHARGE_PAYMENT.getValue(), chargeData.getId(), installmentChargeData.getInstallmentNumber(), AccountTransferType.CHARGE_PAYMENT.getValue(), null, null, null, null, null, fromSavingsAccount, isRegularTransaction, isExceptionForBalanceCheck); - transferFeeCharge(sb, accountTransferDTO); + if (!transferFeeCharge(accountTransferDTO)) { + ++errors; + } } } } else if (chargeData.getDueDate() != null && !chargeData.getDueDate().isAfter(DateUtils.getLocalDateOfTenant())) { @@ -1817,27 +1811,25 @@ public void transferFeeCharges() throws JobExecutionException { LoanTransactionType.CHARGE_PAYMENT.getValue(), chargeData.getId(), null, AccountTransferType.CHARGE_PAYMENT.getValue(), null, null, null, null, null, fromSavingsAccount, isRegularTransaction, isExceptionForBalanceCheck); - transferFeeCharge(sb, accountTransferDTO); + if (!transferFeeCharge(accountTransferDTO)) { + ++errors; + } } } } - if (sb.length() > 0) { throw new JobExecutionException(sb.toString()); } + if (errors > 0) { throw new JobExecutionException(errors); } } - /** - * @param sb - * @param accountTransferDTO - */ - private void transferFeeCharge(final StringBuilder sb, final AccountTransferDTO accountTransferDTO) { + private boolean transferFeeCharge(final AccountTransferDTO accountTransferDTO) { try { this.accountTransfersWritePlatformService.transferFunds(accountTransferDTO); + return true; } catch (final PlatformApiDataValidationException e) { - sb.append("Validation exception while paying charge ").append(accountTransferDTO.getChargeId()).append(" for loan id:") - .append(accountTransferDTO.getToAccountId()).append("--------"); + LOG.error("Validation exception while paying charge {} for loan id {}", accountTransferDTO.getChargeId(), accountTransferDTO.getToAccountId(), e); + return false; } catch (final InsufficientAccountBalanceException e) { - sb.append("InsufficientAccountBalance Exception while paying charge ").append(accountTransferDTO.getChargeId()) - .append("for loan id:").append(accountTransferDTO.getToAccountId()).append("--------"); - + LOG.error("InsufficientAccountBalanceException while paying charge {} for loan id {}", accountTransferDTO.getChargeId(), accountTransferDTO.getToAccountId(), e); + return false; } } @@ -2517,7 +2509,7 @@ public CommandProcessingResult undoWriteOff(Long loanId) { final List existingReversedTransactionIds = new ArrayList<>(); if (!loan.isClosedWrittenOff()) { throw new PlatformServiceUnavailableException( "error.msg.loan.status.not.written.off.update.not.allowed", "Loan :" + loanId - + " update not allowed as loan status is not written off", loanId); } + + " update not allowed as loan status is not written off", loanId); } LocalDate recalculateFrom = null; LoanTransaction writeOffTransaction = loan.findWriteOffTransaction(); this.businessEventNotifierService.notifyBusinessEventToBeExecuted(BUSINESS_EVENTS.LOAN_UNDO_WRITTEN_OFF, @@ -2883,7 +2875,9 @@ private void checkIfLoanIsPaidInAdvance(final Long loanId, final BigDecimal tran BigDecimal overpaid = this.loanReadPlatformService.retrieveTotalPaidInAdvance(loanId).getPaidInAdvance(); if (overpaid == null || overpaid.equals(new BigDecimal(0)) || transactionAmount.floatValue() > overpaid.floatValue()) { - if (overpaid == null) overpaid = BigDecimal.ZERO; + if (overpaid == null) { + overpaid = BigDecimal.ZERO; + } throw new InvalidPaidInAdvanceAmountException(overpaid.toPlainString()); } } @@ -3005,12 +2999,12 @@ private void validateIsMultiDisbursalLoanAndDisbursedMoreThanOneTranche(Loan loa } private void syncExpectedDateWithActualDisbursementDate(final Loan loan, LocalDate actualDisbursementDate){ - if(!loan.getExpectedDisbursedOnLocalDate().equals(actualDisbursementDate)){ - throw new DateMismatchException(actualDisbursementDate, - loan.getExpectedDisbursedOnLocalDate()); - } + if(!loan.getExpectedDisbursedOnLocalDate().equals(actualDisbursementDate)){ + throw new DateMismatchException(actualDisbursementDate, + loan.getExpectedDisbursedOnLocalDate()); + } - } + } private void validateTransactionsForTransfer(final Loan loan, final LocalDate transferDate) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/RecalculateInterestPoster.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/RecalculateInterestPoster.java index f3dfab87575..b084c6060a2 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/RecalculateInterestPoster.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/RecalculateInterestPoster.java @@ -20,6 +20,7 @@ import java.util.Collection; import java.util.Random; +import java.util.concurrent.Callable; import org.apache.fineract.infrastructure.core.service.ThreadLocalContextUtil; import org.apache.fineract.infrastructure.jobs.exception.JobExecutionException; import org.slf4j.Logger; @@ -29,41 +30,25 @@ import org.springframework.orm.ObjectOptimisticLockingFailureException; import org.springframework.stereotype.Component; - @Component - @Scope("prototype") +public class RecalculateInterestPoster implements Callable { -public class RecalculateInterestPoster implements Runnable { - - - - private final static Logger logger = LoggerFactory.getLogger(" recalculate interest poster"); + private final static Logger logger = LoggerFactory.getLogger(RecalculateInterestPoster.class); private Collection loanIds; - private LoanWritePlatformService loanWritePlatformService; - public void setLoanIds(final Collection loanIds) { - this.loanIds = loanIds; - } - - public void setLoanWritePlatformService(final LoanWritePlatformService loanWritePlatformService) { - this.loanWritePlatformService = loanWritePlatformService; - } - - @Override - public void run() { - + public Void call() throws JobExecutionException { Integer maxNumberOfRetries = ThreadLocalContextUtil.getTenant() .getConnection().getMaxRetriesOnDeadlock(); Integer maxIntervalBetweenRetries = ThreadLocalContextUtil.getTenant() @@ -71,72 +56,45 @@ public void run() { int i = 0; if (!loanIds.isEmpty()) { - final StringBuilder sb = new StringBuilder(); + int errors = 0; for (Long loanId : loanIds) { logger.info("Loan ID " + loanId); Integer numberOfRetries = 0; while (numberOfRetries <= maxNumberOfRetries) { try { - this.loanWritePlatformService - .recalculateInterest(loanId); + this.loanWritePlatformService.recalculateInterest(loanId); numberOfRetries = maxNumberOfRetries + 1; } catch (CannotAcquireLockException | ObjectOptimisticLockingFailureException exception) { - logger.info("Recalulate interest job has been retried " - + numberOfRetries + " time(s)"); - /*** - * Fail if the transaction has been retired for - * maxNumberOfRetries - **/ + logger.info("Recalulate interest job has been retried time(s)", numberOfRetries); + // Fail if the transaction has been retired for maxNumberOfRetries if (numberOfRetries >= maxNumberOfRetries) { - logger.warn("Recalulate interest job has been retried for the max allowed attempts of " - + numberOfRetries - + " and will be rolled back"); - sb.append("Recalulate interest job has been retried for the max allowed attempts of " - + numberOfRetries - + " and will be rolled back"); + logger.error("Recalulate interest job has been retried for the max allowed attempts of {} and will be rolled back", numberOfRetries); + ++errors; break; } - /*** - * Else sleep for a random time (between 1 to 10 - * seconds) and continue - **/ + // Else sleep for a random time (between 1 to 10 seconds) and continue try { Random random = new Random(); - int randomNum = random - .nextInt(maxIntervalBetweenRetries + 1); + int randomNum = random.nextInt(maxIntervalBetweenRetries + 1); Thread.sleep(1000 + (randomNum * 1000)); numberOfRetries = numberOfRetries + 1; } catch (InterruptedException e) { - sb.append("Interest recalculation for loans failed " + exception.getMessage()) ; + logger.error("Interest recalculation for loans retry failed due to InterruptedException", e) ; + ++errors; break; } } catch (Exception e) { - Throwable realCause = e; - if (e.getCause() != null) { - realCause = e.getCause(); - } - logger.error("Interest recalculation for loans failed for account:" + loanId + " with message " + realCause.getMessage(), e); - sb.append("Interest recalculation for loans failed for account:").append(loanId).append(" with message ") - .append(realCause.getMessage()); + logger.error("Interest recalculation for loans failed for account {}", loanId, e); numberOfRetries = maxNumberOfRetries + 1; + ++errors; } i++; } logger.info("Loans count " + i); } - if (sb.length() > 0) { - try { - throw new JobExecutionException(sb.toString()); - } catch (JobExecutionException e) { - logger.info("JobExecutionException occured :", e); - } - } + if (errors > 0) { throw new JobExecutionException(errors); } } - - + return null; } - - - } \ No newline at end of file diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/DepositAccountWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/DepositAccountWritePlatformServiceJpaRepositoryImpl.java index 23841e2fae5..d5c23eb195f 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/DepositAccountWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/DepositAccountWritePlatformServiceJpaRepositoryImpl.java @@ -112,6 +112,8 @@ import org.joda.time.LocalDate; import org.joda.time.format.DateTimeFormat; import org.joda.time.format.DateTimeFormatter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -119,6 +121,8 @@ @Service public class DepositAccountWritePlatformServiceJpaRepositoryImpl implements DepositAccountWritePlatformService { + private final static Logger LOG = LoggerFactory.getLogger(DepositAccountWritePlatformServiceJpaRepositoryImpl.class); + private final PlatformSecurityContext context; private final SavingsAccountRepositoryWrapper savingAccountRepositoryWrapper; private final SavingsAccountTransactionRepository savingsAccountTransactionRepository; @@ -571,21 +575,20 @@ private void postInterest(final SavingsAccount account) { @Override @CronTarget(jobName = JobName.TRANSFER_INTEREST_TO_SAVINGS) public void transferInterestToSavings() throws JobExecutionException { + int errors = 0; Collection accountTrasferData = this.depositAccountReadPlatformService.retrieveDataForInterestTransfer(); - StringBuilder sb = new StringBuilder(200); for (AccountTransferDTO accountTransferDTO : accountTrasferData) { try { this.accountTransfersWritePlatformService.transferFunds(accountTransferDTO); } catch (final PlatformApiDataValidationException e) { - sb.append("Validation exception while trasfering Interest form ").append(accountTransferDTO.getFromAccountId()) - .append(" to ").append(accountTransferDTO.getToAccountId()).append("--------"); + LOG.error("Validation exception while trasfering Interest from {} to {}", accountTransferDTO.getFromAccountId(), accountTransferDTO.getToAccountId(), e); + ++errors; } catch (final InsufficientAccountBalanceException e) { - sb.append("InsufficientAccountBalance Exception while trasfering Interest form ") - .append(accountTransferDTO.getFromAccountId()).append(" to ").append(accountTransferDTO.getToAccountId()) - .append("--------"); + LOG.error("InsufficientAccountBalanceException while trasfering Interest from {} to {} ", accountTransferDTO.getFromAccountId(), accountTransferDTO.getToAccountId(), e); + ++errors; } } - if (sb.length() > 0) { throw new JobExecutionException(sb.toString()); } + if (errors > 0) { throw new JobExecutionException(errors); } } @Override @@ -615,8 +618,8 @@ public CommandProcessingResult undoRDTransaction(final Long savingsId, final Lon if (!allowAccountTransferModification && this.accountTransfersReadPlatformService.isAccountTransfer(transactionId, PortfolioAccountType.SAVINGS)) { throw new PlatformServiceUnavailableException( - "error.msg.recurring.deposit.account.transfer.transaction.update.not.allowed", "Recurring deposit account transaction:" - + transactionId + " update not allowed as it involves in account transfer", transactionId); } + "error.msg.recurring.deposit.account.transfer.transaction.update.not.allowed", "Recurring deposit account transaction:" + + transactionId + " update not allowed as it involves in account transfer", transactionId); } final LocalDate today = DateUtils.getLocalDateOfTenant(); final MathContext mc = MathContext.DECIMAL64; @@ -689,12 +692,12 @@ public CommandProcessingResult adjustRDTransaction(final Long savingsId, final L .findOneByIdAndSavingsAccountId(transactionId, savingsId); if (savingsAccountTransaction == null) { throw new SavingsAccountTransactionNotFoundException(savingsId, transactionId); } - if (!(savingsAccountTransaction.isDeposit() || savingsAccountTransaction.isWithdrawal()) || savingsAccountTransaction.isReversed()) { throw new TransactionUpdateNotAllowedException( + if ((!savingsAccountTransaction.isDeposit() && !savingsAccountTransaction.isWithdrawal()) || savingsAccountTransaction.isReversed()) { throw new TransactionUpdateNotAllowedException( savingsId, transactionId); } if (this.accountTransfersReadPlatformService.isAccountTransfer(transactionId, PortfolioAccountType.SAVINGS)) { throw new PlatformServiceUnavailableException( "error.msg.saving.account.transfer.transaction.update.not.allowed", "Deposit account transaction:" + transactionId - + " update not allowed as it involves in account transfer", transactionId); } + + " update not allowed as it involves in account transfer", transactionId); } final LocalDate today = DateUtils.getLocalDateOfTenant(); @@ -1071,14 +1074,14 @@ public CommandProcessingResult addSavingsAccountCharge(final JsonCommand command if (!this.configurationDomainService.allowTransactionsOnHolidayEnabled() && this.holidayRepository.isHoliday(savingsAccount.officeId(), savingsAccountCharge.getDueLocalDate())) { baseDataValidator.reset().parameter(dueAsOfDateParamName).value(savingsAccountCharge.getDueLocalDate().toString(fmt)) - .failWithCodeNoParameterAddedToErrorCode("charge.due.date.is.on.holiday"); + .failWithCodeNoParameterAddedToErrorCode("charge.due.date.is.on.holiday"); if (!dataValidationErrors.isEmpty()) { throw new PlatformApiDataValidationException(dataValidationErrors); } } if (!this.configurationDomainService.allowTransactionsOnNonWorkingDayEnabled() && !this.workingDaysRepository.isWorkingDay(savingsAccountCharge.getDueLocalDate())) { baseDataValidator.reset().parameter(dueAsOfDateParamName).value(savingsAccountCharge.getDueLocalDate().toString(fmt)) - .failWithCodeNoParameterAddedToErrorCode("charge.due.date.is.a.nonworking.day"); + .failWithCodeNoParameterAddedToErrorCode("charge.due.date.is.a.nonworking.day"); if (!dataValidationErrors.isEmpty()) { throw new PlatformApiDataValidationException(dataValidationErrors); } } } @@ -1126,14 +1129,14 @@ public CommandProcessingResult updateSavingsAccountCharge(final JsonCommand comm if (!this.configurationDomainService.allowTransactionsOnHolidayEnabled() && this.holidayRepository.isHoliday(savingsAccount.officeId(), savingsAccountCharge.getDueLocalDate())) { baseDataValidator.reset().parameter(dueAsOfDateParamName).value(savingsAccountCharge.getDueLocalDate().toString(fmt)) - .failWithCodeNoParameterAddedToErrorCode("charge.due.date.is.on.holiday"); + .failWithCodeNoParameterAddedToErrorCode("charge.due.date.is.on.holiday"); if (!dataValidationErrors.isEmpty()) { throw new PlatformApiDataValidationException(dataValidationErrors); } } if (!this.configurationDomainService.allowTransactionsOnNonWorkingDayEnabled() && !this.workingDaysRepository.isWorkingDay(savingsAccountCharge.getDueLocalDate())) { baseDataValidator.reset().parameter(dueAsOfDateParamName).value(savingsAccountCharge.getDueLocalDate().toString(fmt)) - .failWithCodeNoParameterAddedToErrorCode("charge.due.date.is.a.nonworking.day"); + .failWithCodeNoParameterAddedToErrorCode("charge.due.date.is.a.nonworking.day"); if (!dataValidationErrors.isEmpty()) { throw new PlatformApiDataValidationException(dataValidationErrors); } } } @@ -1253,14 +1256,14 @@ public CommandProcessingResult payCharge(final Long savingsAccountId, final Long if (!this.configurationDomainService.allowTransactionsOnHolidayEnabled() && this.holidayRepository.isHoliday(savingsAccountCharge.savingsAccount().officeId(), transactionDate)) { baseDataValidator.reset().parameter(dueAsOfDateParamName).value(transactionDate.toString(fmt)) - .failWithCodeNoParameterAddedToErrorCode("transaction.not.allowed.transaction.date.is.on.holiday"); + .failWithCodeNoParameterAddedToErrorCode("transaction.not.allowed.transaction.date.is.on.holiday"); if (!dataValidationErrors.isEmpty()) { throw new PlatformApiDataValidationException(dataValidationErrors); } } if (!this.configurationDomainService.allowTransactionsOnNonWorkingDayEnabled() && !this.workingDaysRepository.isWorkingDay(transactionDate)) { baseDataValidator.reset().parameter(dueAsOfDateParamName).value(transactionDate.toString(fmt)) - .failWithCodeNoParameterAddedToErrorCode("transaction.not.allowed.transaction.date.is.a.nonworking.day"); + .failWithCodeNoParameterAddedToErrorCode("transaction.not.allowed.transaction.date.is.a.nonworking.day"); if (!dataValidationErrors.isEmpty()) { throw new PlatformApiDataValidationException(dataValidationErrors); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsSchedularServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsSchedularServiceImpl.java index 6b624f112aa..0e3cc7f44b1 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsSchedularServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsSchedularServiceImpl.java @@ -18,6 +18,8 @@ */ package org.apache.fineract.portfolio.savings.service; +import static org.apache.fineract.portfolio.savings.domain.SavingsAccountStatusType.ACTIVE; + import java.util.List; import org.apache.fineract.infrastructure.core.service.DateUtils; import org.apache.fineract.infrastructure.jobs.annotation.CronTarget; @@ -26,8 +28,9 @@ import org.apache.fineract.portfolio.savings.domain.SavingsAccount; import org.apache.fineract.portfolio.savings.domain.SavingsAccountAssembler; import org.apache.fineract.portfolio.savings.domain.SavingsAccountRepositoryWrapper; -import org.apache.fineract.portfolio.savings.domain.SavingsAccountStatusType; import org.joda.time.LocalDate; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageRequest; @@ -36,6 +39,8 @@ @Service public class SavingsSchedularServiceImpl implements SavingsSchedularService { + private final static Logger LOG = LoggerFactory.getLogger(SavingsSchedularServiceImpl.class); + private final SavingsAccountAssembler savingAccountAssembler; private final SavingsAccountWritePlatformService savingsAccountWritePlatformService; private final SavingsAccountReadPlatformService savingAccountReadPlatformService; @@ -51,63 +56,54 @@ public SavingsSchedularServiceImpl(final SavingsAccountAssembler savingAccountAs this.savingsAccountRepository = savingsAccountRepository; } - @CronTarget(jobName = JobName.POST_INTEREST_FOR_SAVINGS) @Override + @CronTarget(jobName = JobName.POST_INTEREST_FOR_SAVINGS) public void postInterestForAccounts() throws JobExecutionException { int page = 0; Integer initialSize = 500; Integer totalPageSize = 0; - StringBuffer sb = new StringBuffer(); + int errors = 0; do { PageRequest pageRequest = PageRequest.of(page, initialSize); - Page savingsAccounts = this.savingsAccountRepository.findByStatus(SavingsAccountStatusType.ACTIVE.getValue(), - pageRequest); + Page savingsAccounts = this.savingsAccountRepository.findByStatus(ACTIVE.getValue(), pageRequest); for (SavingsAccount savingsAccount : savingsAccounts.getContent()) { try { this.savingAccountAssembler.assignSavingAccountHelpers(savingsAccount); boolean postInterestAsOn = false; LocalDate transactionDate = null; - this.savingsAccountWritePlatformService.postInterest(savingsAccount, postInterestAsOn, - transactionDate); + this.savingsAccountWritePlatformService.postInterest(savingsAccount, postInterestAsOn, transactionDate); } catch (Exception e) { - Throwable realCause = e; - if (e.getCause() != null) { - realCause = e.getCause(); - } - sb.append("failed to post interest for Savings with id " + savingsAccount.getId() + " with message " - + realCause.getMessage()); + LOG.error("Failed to post interest for Savings with id {}", savingsAccount.getId(), e); + ++errors; } } page++; totalPageSize = savingsAccounts.getTotalPages(); } while (page < totalPageSize); - if (sb.length() > 0) { throw new JobExecutionException(sb.toString()); } + if (errors > 0) { throw new JobExecutionException(errors); } } - @CronTarget(jobName = JobName.UPDATE_SAVINGS_DORMANT_ACCOUNTS) @Override + @CronTarget(jobName = JobName.UPDATE_SAVINGS_DORMANT_ACCOUNTS) public void updateSavingsDormancyStatus() throws JobExecutionException { - final LocalDate tenantLocalDate = DateUtils.getLocalDateOfTenant(); + LocalDate tenantLocalDate = DateUtils.getLocalDateOfTenant(); - final List savingsPendingInactive = this.savingAccountReadPlatformService - .retrieveSavingsIdsPendingInactive(tenantLocalDate); + List savingsPendingInactive = savingAccountReadPlatformService.retrieveSavingsIdsPendingInactive(tenantLocalDate); if(null != savingsPendingInactive && savingsPendingInactive.size() > 0){ for(Long savingsId : savingsPendingInactive){ this.savingsAccountWritePlatformService.setSubStatusInactive(savingsId); } } - final List savingsPendingDormant = this.savingAccountReadPlatformService - .retrieveSavingsIdsPendingDormant(tenantLocalDate); + List savingsPendingDormant = savingAccountReadPlatformService.retrieveSavingsIdsPendingDormant(tenantLocalDate); if(null != savingsPendingDormant && savingsPendingDormant.size() > 0){ for(Long savingsId : savingsPendingDormant){ this.savingsAccountWritePlatformService.setSubStatusDormant(savingsId); } } - final List savingsPendingEscheat = this.savingAccountReadPlatformService - .retrieveSavingsIdsPendingEscheat(tenantLocalDate); + List savingsPendingEscheat = savingAccountReadPlatformService.retrieveSavingsIdsPendingEscheat(tenantLocalDate); if(null != savingsPendingEscheat && savingsPendingEscheat.size() > 0){ for(Long savingsId : savingsPendingEscheat){ this.savingsAccountWritePlatformService.escheat(savingsId); diff --git a/fineract-provider/src/main/java/org/apache/fineract/scheduledjobs/service/ScheduledJobRunnerServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/scheduledjobs/service/ScheduledJobRunnerServiceImpl.java index 036ab7b65d4..3f9f60d1205 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/scheduledjobs/service/ScheduledJobRunnerServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/scheduledjobs/service/ScheduledJobRunnerServiceImpl.java @@ -62,6 +62,7 @@ public class ScheduledJobRunnerServiceImpl implements ScheduledJobRunnerService { private final static Logger logger = LoggerFactory.getLogger(ScheduledJobRunnerServiceImpl.class); + private final DateTimeFormatter formatter = DateTimeFormat.forPattern("yyyy-MM-dd"); private final DateTimeFormatter formatterWithTime = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss"); @@ -111,9 +112,9 @@ public void updateLoanSummaryDetails() { updateSqlBuilder.append("SUM(IFNULL(mr.interest_waived_derived,0)) as interest_waived_derived,"); updateSqlBuilder.append("SUM(IFNULL(mr.interest_writtenoff_derived,0)) as interest_writtenoff_derived,"); updateSqlBuilder - .append("SUM(IFNULL(mr.fee_charges_amount,0)) + IFNULL((select SUM(lc.amount) from m_loan_charge lc where lc.loan_id=ml.id and lc.is_active=1 and lc.charge_time_enum=1),0) as fee_charges_charged_derived,"); + .append("SUM(IFNULL(mr.fee_charges_amount,0)) + IFNULL((select SUM(lc.amount) from m_loan_charge lc where lc.loan_id=ml.id and lc.is_active=1 and lc.charge_time_enum=1),0) as fee_charges_charged_derived,"); updateSqlBuilder - .append("SUM(IFNULL(mr.fee_charges_completed_derived,0)) + IFNULL((select SUM(lc.amount_paid_derived) from m_loan_charge lc where lc.loan_id=ml.id and lc.is_active=1 and lc.charge_time_enum=1),0) as fee_charges_repaid_derived,"); + .append("SUM(IFNULL(mr.fee_charges_completed_derived,0)) + IFNULL((select SUM(lc.amount_paid_derived) from m_loan_charge lc where lc.loan_id=ml.id and lc.is_active=1 and lc.charge_time_enum=1),0) as fee_charges_repaid_derived,"); updateSqlBuilder.append("SUM(IFNULL(mr.fee_charges_waived_derived,0)) as fee_charges_waived_derived,"); updateSqlBuilder.append("SUM(IFNULL(mr.fee_charges_writtenoff_derived,0)) as fee_charges_writtenoff_derived,"); updateSqlBuilder.append("SUM(IFNULL(mr.penalty_charges_amount,0)) as penalty_charges_charged_derived,"); @@ -130,45 +131,45 @@ public void updateLoanSummaryDetails() { updateSqlBuilder.append("m_loan.principal_repaid_derived = x.principal_repaid_derived,"); updateSqlBuilder.append("m_loan.principal_writtenoff_derived = x.principal_writtenoff_derived,"); updateSqlBuilder - .append("m_loan.principal_outstanding_derived = (x.principal_disbursed_derived - (x.principal_repaid_derived + x.principal_writtenoff_derived)),"); + .append("m_loan.principal_outstanding_derived = (x.principal_disbursed_derived - (x.principal_repaid_derived + x.principal_writtenoff_derived)),"); updateSqlBuilder.append("m_loan.interest_charged_derived = x.interest_charged_derived,"); updateSqlBuilder.append("m_loan.interest_repaid_derived = x.interest_repaid_derived,"); updateSqlBuilder.append("m_loan.interest_waived_derived = x.interest_waived_derived,"); updateSqlBuilder.append("m_loan.interest_writtenoff_derived = x.interest_writtenoff_derived,"); updateSqlBuilder - .append("m_loan.interest_outstanding_derived = (x.interest_charged_derived - (x.interest_repaid_derived + x.interest_waived_derived + x.interest_writtenoff_derived)),"); + .append("m_loan.interest_outstanding_derived = (x.interest_charged_derived - (x.interest_repaid_derived + x.interest_waived_derived + x.interest_writtenoff_derived)),"); updateSqlBuilder.append("m_loan.fee_charges_charged_derived = x.fee_charges_charged_derived,"); updateSqlBuilder.append("m_loan.fee_charges_repaid_derived = x.fee_charges_repaid_derived,"); updateSqlBuilder.append("m_loan.fee_charges_waived_derived = x.fee_charges_waived_derived,"); updateSqlBuilder.append("m_loan.fee_charges_writtenoff_derived = x.fee_charges_writtenoff_derived,"); updateSqlBuilder - .append("m_loan.fee_charges_outstanding_derived = (x.fee_charges_charged_derived - (x.fee_charges_repaid_derived + x.fee_charges_waived_derived + x.fee_charges_writtenoff_derived)),"); + .append("m_loan.fee_charges_outstanding_derived = (x.fee_charges_charged_derived - (x.fee_charges_repaid_derived + x.fee_charges_waived_derived + x.fee_charges_writtenoff_derived)),"); updateSqlBuilder.append("m_loan.penalty_charges_charged_derived = x.penalty_charges_charged_derived,"); updateSqlBuilder.append("m_loan.penalty_charges_repaid_derived = x.penalty_charges_repaid_derived,"); updateSqlBuilder.append("m_loan.penalty_charges_waived_derived = x.penalty_charges_waived_derived,"); updateSqlBuilder.append("m_loan.penalty_charges_writtenoff_derived = x.penalty_charges_writtenoff_derived,"); updateSqlBuilder - .append("m_loan.penalty_charges_outstanding_derived = (x.penalty_charges_charged_derived - (x.penalty_charges_repaid_derived + x.penalty_charges_waived_derived + x.penalty_charges_writtenoff_derived)),"); + .append("m_loan.penalty_charges_outstanding_derived = (x.penalty_charges_charged_derived - (x.penalty_charges_repaid_derived + x.penalty_charges_waived_derived + x.penalty_charges_writtenoff_derived)),"); updateSqlBuilder - .append("m_loan.total_expected_repayment_derived = (x.principal_disbursed_derived + x.interest_charged_derived + x.fee_charges_charged_derived + x.penalty_charges_charged_derived),"); + .append("m_loan.total_expected_repayment_derived = (x.principal_disbursed_derived + x.interest_charged_derived + x.fee_charges_charged_derived + x.penalty_charges_charged_derived),"); updateSqlBuilder - .append("m_loan.total_repayment_derived = (x.principal_repaid_derived + x.interest_repaid_derived + x.fee_charges_repaid_derived + x.penalty_charges_repaid_derived),"); + .append("m_loan.total_repayment_derived = (x.principal_repaid_derived + x.interest_repaid_derived + x.fee_charges_repaid_derived + x.penalty_charges_repaid_derived),"); updateSqlBuilder - .append("m_loan.total_expected_costofloan_derived = (x.interest_charged_derived + x.fee_charges_charged_derived + x.penalty_charges_charged_derived),"); + .append("m_loan.total_expected_costofloan_derived = (x.interest_charged_derived + x.fee_charges_charged_derived + x.penalty_charges_charged_derived),"); updateSqlBuilder - .append("m_loan.total_costofloan_derived = (x.interest_repaid_derived + x.fee_charges_repaid_derived + x.penalty_charges_repaid_derived),"); + .append("m_loan.total_costofloan_derived = (x.interest_repaid_derived + x.fee_charges_repaid_derived + x.penalty_charges_repaid_derived),"); updateSqlBuilder - .append("m_loan.total_waived_derived = (x.interest_waived_derived + x.fee_charges_waived_derived + x.penalty_charges_waived_derived),"); + .append("m_loan.total_waived_derived = (x.interest_waived_derived + x.fee_charges_waived_derived + x.penalty_charges_waived_derived),"); updateSqlBuilder - .append("m_loan.total_writtenoff_derived = (x.interest_writtenoff_derived + x.fee_charges_writtenoff_derived + x.penalty_charges_writtenoff_derived),"); + .append("m_loan.total_writtenoff_derived = (x.interest_writtenoff_derived + x.fee_charges_writtenoff_derived + x.penalty_charges_writtenoff_derived),"); updateSqlBuilder.append("m_loan.total_outstanding_derived="); updateSqlBuilder.append(" (x.principal_disbursed_derived - (x.principal_repaid_derived + x.principal_writtenoff_derived)) + "); updateSqlBuilder - .append(" (x.interest_charged_derived - (x.interest_repaid_derived + x.interest_waived_derived + x.interest_writtenoff_derived)) +"); + .append(" (x.interest_charged_derived - (x.interest_repaid_derived + x.interest_waived_derived + x.interest_writtenoff_derived)) +"); updateSqlBuilder - .append(" (x.fee_charges_charged_derived - (x.fee_charges_repaid_derived + x.fee_charges_waived_derived + x.fee_charges_writtenoff_derived)) +"); + .append(" (x.fee_charges_charged_derived - (x.fee_charges_repaid_derived + x.fee_charges_waived_derived + x.fee_charges_writtenoff_derived)) +"); updateSqlBuilder - .append(" (x.penalty_charges_charged_derived - (x.penalty_charges_repaid_derived + x.penalty_charges_waived_derived + x.penalty_charges_writtenoff_derived))"); + .append(" (x.penalty_charges_charged_derived - (x.penalty_charges_repaid_derived + x.penalty_charges_waived_derived + x.penalty_charges_writtenoff_derived))"); final int result = jdbcTemplate.update(updateSqlBuilder.toString()); @@ -187,23 +188,23 @@ public void updateLoanPaidInAdvance() { final StringBuilder updateSqlBuilder = new StringBuilder(900); updateSqlBuilder - .append("INSERT INTO m_loan_paid_in_advance(loan_id, principal_in_advance_derived, interest_in_advance_derived, fee_charges_in_advance_derived, penalty_charges_in_advance_derived, total_in_advance_derived)"); + .append("INSERT INTO m_loan_paid_in_advance(loan_id, principal_in_advance_derived, interest_in_advance_derived, fee_charges_in_advance_derived, penalty_charges_in_advance_derived, total_in_advance_derived)"); updateSqlBuilder.append(" select ml.id as loanId,"); updateSqlBuilder.append(" SUM(ifnull(mr.principal_completed_derived, 0)) as principal_in_advance_derived,"); updateSqlBuilder.append(" SUM(ifnull(mr.interest_completed_derived, 0)) as interest_in_advance_derived,"); updateSqlBuilder.append(" SUM(ifnull(mr.fee_charges_completed_derived, 0)) as fee_charges_in_advance_derived,"); updateSqlBuilder.append(" SUM(ifnull(mr.penalty_charges_completed_derived, 0)) as penalty_charges_in_advance_derived,"); updateSqlBuilder - .append(" (SUM(ifnull(mr.principal_completed_derived, 0)) + SUM(ifnull(mr.interest_completed_derived, 0)) + SUM(ifnull(mr.fee_charges_completed_derived, 0)) + SUM(ifnull(mr.penalty_charges_completed_derived, 0))) as total_in_advance_derived"); + .append(" (SUM(ifnull(mr.principal_completed_derived, 0)) + SUM(ifnull(mr.interest_completed_derived, 0)) + SUM(ifnull(mr.fee_charges_completed_derived, 0)) + SUM(ifnull(mr.penalty_charges_completed_derived, 0))) as total_in_advance_derived"); updateSqlBuilder.append(" FROM m_loan ml "); updateSqlBuilder.append(" INNER JOIN m_loan_repayment_schedule mr on mr.loan_id = ml.id "); updateSqlBuilder.append(" WHERE ml.loan_status_id = 300 "); updateSqlBuilder.append(" and mr.duedate >= CURDATE() "); updateSqlBuilder.append(" GROUP BY ml.id"); updateSqlBuilder - .append(" HAVING (SUM(ifnull(mr.principal_completed_derived, 0)) + SUM(ifnull(mr.interest_completed_derived, 0)) +"); + .append(" HAVING (SUM(ifnull(mr.principal_completed_derived, 0)) + SUM(ifnull(mr.interest_completed_derived, 0)) +"); updateSqlBuilder - .append(" SUM(ifnull(mr.fee_charges_completed_derived, 0)) + SUM(ifnull(mr.penalty_charges_completed_derived, 0))) > 0.0"); + .append(" SUM(ifnull(mr.fee_charges_completed_derived, 0)) + SUM(ifnull(mr.penalty_charges_completed_derived, 0))) > 0.0"); final int result = jdbcTemplate.update(updateSqlBuilder.toString()); @@ -238,31 +239,21 @@ public void applyAnnualFeeForSavings() { @Override @CronTarget(jobName = JobName.PAY_DUE_SAVINGS_CHARGES) public void applyDueChargesForSavings() throws JobExecutionException { - final Collection chargesDueData = this.savingsAccountChargeReadPlatformService - .retrieveChargesWithDue(); - final StringBuilder errorMsg = new StringBuilder(); - + final Collection chargesDueData = this.savingsAccountChargeReadPlatformService.retrieveChargesWithDue(); + int numberOfErrors = 0; for (final SavingsAccountAnnualFeeData savingsAccountReference : chargesDueData) { try { - this.savingsAccountWritePlatformService.applyChargeDue(savingsAccountReference.getId(), - savingsAccountReference.getAccountId()); + this.savingsAccountWritePlatformService.applyChargeDue(savingsAccountReference.getId(), savingsAccountReference.getAccountId()); } catch (final PlatformApiDataValidationException e) { final List errors = e.getErrors(); for (final ApiParameterError error : errors) { - logger.error("Apply Charges due for savings failed for account:" + savingsAccountReference.getAccountNo() - + " with message " + error.getDeveloperMessage()); - errorMsg.append("Apply Charges due for savings failed for account:").append(savingsAccountReference.getAccountNo()) - .append(" with message ").append(error.getDeveloperMessage()); + logger.error("Apply Charges due for savings failed for account {} with message: {}", savingsAccountReference.getAccountNo(), error.getDeveloperMessage(), e); + ++numberOfErrors; } } } - - logger.info(ThreadLocalContextUtil.getTenant().getName() + ": Savings accounts affected by update: " + chargesDueData.size()); - - /* - * throw exception if any charge payment fails. - */ - if (errorMsg.length() > 0) { throw new JobExecutionException(errorMsg.toString()); } + logger.info("{}: Savings accounts affected by update: {}", ThreadLocalContextUtil.getTenant().getName(), chargesDueData.size()); + if (numberOfErrors > 0) { throw new JobExecutionException(numberOfErrors); } } @Transactional @@ -279,7 +270,7 @@ public void updateNPA() { resetNPASqlBuilder.append("set loan.is_npa = 0 "); resetNPASqlBuilder.append("where loan.loan_status_id = 300 and mpl.account_moves_out_of_npa_only_on_arrears_completion = 0 "); resetNPASqlBuilder - .append("or (mpl.account_moves_out_of_npa_only_on_arrears_completion = 1 and laa.overdue_since_date_derived is null)"); + .append("or (mpl.account_moves_out_of_npa_only_on_arrears_completion = 1 and laa.overdue_since_date_derived is null)"); jdbcTemplate.update(resetNPASqlBuilder.toString()); @@ -383,65 +374,62 @@ public void generateRDSchedule() { @Override @CronTarget(jobName = JobName.POST_DIVIDENTS_FOR_SHARES) public void postDividends() throws JobExecutionException { + int numberOfErrors = 0; List> dividendDetails = this.shareAccountDividendReadPlatformService.retriveDividendDetailsForPostDividents(); - StringBuilder errorMsg = new StringBuilder(); for (Map dividendMap : dividendDetails) { Long id = null ; Long savingsId = null ; - if(dividendMap.get("id") instanceof BigInteger) { //Drizzle is returning BigInteger - id = ((BigInteger)dividendMap.get("id")).longValue() ; - savingsId = ((BigInteger)dividendMap.get("savingsAccountId")).longValue() ; - }else { //MySQL connector is returning Long - id = (Long) dividendMap.get("id") ; - savingsId = (Long) dividendMap.get("savingsAccountId") ; + if (dividendMap.get("id") instanceof BigInteger) { + // Drizzle is returningBigInteger + id = ((BigInteger) dividendMap.get("id")).longValue(); + savingsId = ((BigInteger) dividendMap.get("savingsAccountId")).longValue(); + } else { // MySQL connector is returning Long + id = (Long) dividendMap.get("id"); + savingsId = (Long) dividendMap.get("savingsAccountId"); } try { this.shareAccountSchedularService.postDividend(id, savingsId); } catch (final PlatformApiDataValidationException e) { final List errors = e.getErrors(); for (final ApiParameterError error : errors) { - logger.error("Post Dividends to savings failed for Divident detail Id:" + id + " and savings Id: " + savingsId - + " with message " + error.getDeveloperMessage()); - errorMsg.append("Post Dividends to savings failed for Divident detail Id:").append(id).append(" and savings Id:") - .append(savingsId).append(" with message ").append(error.getDeveloperMessage()); + logger.error("Post Dividends to savings failed due to ApiParameterError for Divident detail Id: {} and savings Id: {} with message: ", id, savingsId, error.getDeveloperMessage(), e); + ++numberOfErrors; } } catch (final Exception e) { - logger.error("Post Dividends to savings failed for Divident detail Id:" + id + " and savings Id: " + savingsId - + " with message " + e.getLocalizedMessage()); - errorMsg.append("Post Dividends to savings failed for Divident detail Id:").append(id).append(" and savings Id:") - .append(savingsId).append(" with message ").append(e.getLocalizedMessage()); + logger.error("Post Dividends to savings failed for Divident detail Id: {} and savings Id: {}", id, savingsId, e); + ++numberOfErrors; } } - if (errorMsg.length() > 0) { throw new JobExecutionException(errorMsg.toString()); } + if (numberOfErrors > 0) { throw new JobExecutionException(numberOfErrors); } } + @Override @CronTarget(jobName = JobName.UPDATE_TRAIL_BALANCE_DETAILS) public void updateTrialBalanceDetails() throws JobExecutionException { final JdbcTemplate jdbcTemplate = new JdbcTemplate(this.dataSourceServiceFactory.determineDataSourceService().retrieveDataSource()); final StringBuilder tbGapSqlBuilder = new StringBuilder(500); tbGapSqlBuilder.append("select distinct(je.transaction_date) ") - .append("from acc_gl_journal_entry je ") - .append("where je.transaction_date > (select IFNULL(MAX(created_date),'2010-01-01') from m_trial_balance)"); + .append("from acc_gl_journal_entry je ") + .append("where je.transaction_date > (select IFNULL(MAX(created_date),'2010-01-01') from m_trial_balance)"); final List tbGaps = jdbcTemplate.queryForList(tbGapSqlBuilder.toString(), Date.class); for(Date tbGap : tbGaps) { LocalDate convDate = new DateTime(tbGap).toLocalDate(); int days = Days.daysBetween(convDate, DateUtils.getLocalDateOfTenant()).getDays(); - if(days < 1) + if(days < 1) { continue; + } final String formattedDate = new SimpleDateFormat("yyyy-MM-dd").format(tbGap); final StringBuilder sqlBuilder = new StringBuilder(600); sqlBuilder.append("Insert Into m_trial_balance(office_id, account_id, Amount, entry_date, created_date,closing_balance) ") - .append("Select je.office_id, je.account_id, sum(if(je.type_enum=1, (-1) * je.amount, je.amount)) ") - .append("as Amount, Date(je.entry_date) as 'Entry_Date', je.transaction_date as 'Created_Date',sum(je.amount) as closing_balance ") - .append("from acc_gl_journal_entry je WHERE je.transaction_date = ? ") - .append("group by je.account_id, je.office_id, je.transaction_date, Date(je.entry_date)"); - - final int result = jdbcTemplate.update(sqlBuilder.toString(), new Object[] { - formattedDate - }); + .append("Select je.office_id, je.account_id, sum(if(je.type_enum=1, (-1) * je.amount, je.amount)) ") + .append("as Amount, Date(je.entry_date) as 'Entry_Date', je.transaction_date as 'Created_Date',sum(je.amount) as closing_balance ") + .append("from acc_gl_journal_entry je WHERE je.transaction_date = ? ") + .append("group by je.account_id, je.office_id, je.transaction_date, Date(je.entry_date)"); + + final int result = jdbcTemplate.update(sqlBuilder.toString(), formattedDate); logger.info(ThreadLocalContextUtil.getTenant().getName() + ": Results affected by update: " + result); } @@ -459,8 +447,9 @@ public void updateTrialBalanceDetails() throws JobExecutionException { List closingBalanceData = jdbcTemplate.queryForList(closingBalanceQuery, new Object[] {officeId, accountId}, BigDecimal.class); List tbRows = this.trialBalanceRepositoryWrapper.findNewByOfficeAndAccount(officeId, accountId); BigDecimal closingBalance = null; - if(!CollectionUtils.isEmpty(closingBalanceData)) + if(!CollectionUtils.isEmpty(closingBalanceData)) { closingBalance = closingBalanceData.get(0); + } if(CollectionUtils.isEmpty(closingBalanceData)) { closingBalance = BigDecimal.ZERO; for(TrialBalance row : tbRows) { From 93d171663078ad883d1e1242a8c35c02b8230741 Mon Sep 17 00:00:00 2001 From: thesmallstar Date: Tue, 10 Mar 2020 16:45:25 +0530 Subject: [PATCH 10/37] Added: SQL builder toString function --- .../security/utils/SQLBuilder.java | 36 +++++++++++++++++-- .../security/utils/SQLBuilderTest.java | 6 ++-- 2 files changed, 37 insertions(+), 5 deletions(-) diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/utils/SQLBuilder.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/utils/SQLBuilder.java index 63052fbb624..0a22bd29c24 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/utils/SQLBuilder.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/utils/SQLBuilder.java @@ -43,6 +43,8 @@ public class SQLBuilder { // This holds the arguments, in the order of the '?' placeholders in sb private final List args = new ArrayList<>(); + // This holds the criterias, where nth element corresponds to nth element in args + private final ArrayList crts = new ArrayList(); /** * Adds a criteria for a SQL WHERE clause. * All criteria are appended by AND (support for OR, or nesting, can be added when needed). @@ -84,6 +86,7 @@ public void addCriteria(String criteria, Object argument) { } sb.append(trimmedCriteria); sb.append(" ?"); + crts.add(trimmedCriteria); args.add(argument); } @@ -118,9 +121,38 @@ public Object[] getArguments() { /* * Returns a String representation suitable for debugging and log output. * This is ONLY intended for debugging in logs, and NEVER for passing to a JDBC database. + */ @Override public String toString() { - return "SQLBuilder{..."; // TODO implement this... + StringBuilder whereClause = new StringBuilder("SQLBuilder{"); + for (int i=0;i Date: Tue, 10 Mar 2020 21:43:19 +0530 Subject: [PATCH 11/37] FINERACT-83 Made interestIncome variable null-safe --- .../service/LoanAccrualWritePlatformServiceImpl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanAccrualWritePlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanAccrualWritePlatformServiceImpl.java index e9513bf3c9e..f8da103ed83 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanAccrualWritePlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanAccrualWritePlatformServiceImpl.java @@ -430,7 +430,10 @@ private void updateInterestIncome(final LoanScheduleAccrualData accrualData, final Collection loanWaiverTansactions, final Collection loanSchedulePeriodDatas, final LocalDate tilldate) { - BigDecimal interestIncome = accrualData.getInterestIncome(); + BigDecimal interestIncome = BigDecimal.ZERO; + if(accrualData.getInterestIncome() != null) { + interestIncome = accrualData.getInterestIncome(); + } if (accrualData.getWaivedInterestIncome() != null) { BigDecimal recognized = BigDecimal.ZERO; BigDecimal unrecognized = BigDecimal.ZERO; From f484f884a073108a8847751c5bbd197aa356759a Mon Sep 17 00:00:00 2001 From: xurror Date: Mon, 2 Mar 2020 11:31:25 -0500 Subject: [PATCH 12/37] FINERACT-696 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit add spotbug bug-pattern plugin. Apply suggestions from code review closes https://issues.apache.org/jira/browse/FINERACT-696 Co-Authored-By: Michael Vorburger ⛑️ --- fineract-provider/build.gradle | 11 ++--- fineract-provider/dependencies.gradle | 3 ++ fineract-provider/dev-dependencies.gradle | 3 ++ .../integrationtests/common/Utils.java | 4 +- .../interoperation/InteropHelper.java | 42 +++++++++---------- .../interoperation/InteropTest.java | 10 ++--- ...WritePlatformServiceJpaRepositoryImpl.java | 2 +- ...tivityAccountWritePlatformServiceImpl.java | 2 +- ...WritePlatformServiceJpaRepositoryImpl.java | 2 +- ...lEntryRunningBalanceUpdateServiceImpl.java | 2 +- ...WritePlatformServiceJpaRepositoryImpl.java | 2 +- ...WritePlatformServiceJpaRepositoryImpl.java | 2 +- .../AdHocScheduledJobRunnerServiceImpl.java | 7 ++-- ...WritePlatformServiceJpaRepositoryImpl.java | 2 +- .../provider/CommandHandlerProvider.java | 4 +- .../service/AuditReadPlatformServiceImpl.java | 6 +-- ...CommandSourceWritePlatformServiceImpl.java | 6 +-- ...WritePlatformServiceJpaRepositoryImpl.java | 2 +- ...mpaignWritePlatformCommandHandlerImpl.java | 2 +- ...WritePlatformServiceJpaRepositoryImpl.java | 2 +- .../service/SmsCampaignDomainServiceImpl.java | 8 ++-- ...msCampaignWritePlatformServiceJpaImpl.java | 19 +++++---- ...WritePlatformServiceJpaRepositoryImpl.java | 4 +- ...WritePlatformServiceJpaRepositoryImpl.java | 2 +- ...WritePlatformServiceJpaRepositoryImpl.java | 2 +- .../core/boot/db/DataSourceConfiguration.java | 2 +- .../db/TenantDataSourcePortFixService.java | 8 ++-- ...tatableChecksWritePlatformServiceImpl.java | 8 ++-- .../service/ReadReportingServiceImpl.java | 22 +++++----- .../ReadWriteNonCoreDataServiceImpl.java | 12 +++--- .../ReportWritePlatformServiceImpl.java | 2 +- .../FileSystemContentRepository.java | 2 +- .../S3ContentRepository.java | 14 +++---- .../documentmanagement/data/FileData.java | 2 +- .../documentmanagement/data/ImageData.java | 14 +++---- ...WritePlatformServiceJpaRepositoryImpl.java | 6 +-- .../FineractEntityAccessReadServiceImpl.java | 7 ++-- .../FineractEntityAccessWriteServiceImpl.java | 2 +- .../hooks/processor/ProcessorHelper.java | 5 +-- .../jobs/service/JobRegisterServiceImpl.java | 10 ++--- .../service/SchedulerTriggerListener.java | 2 +- .../ReportingProcessServiceProvider.java | 4 +- ...ortMailingJobWritePlatformServiceImpl.java | 2 +- .../TenantAwareBasicAuthenticationFilter.java | 2 +- .../TenantAwareTenantIdentifierFilter.java | 2 +- .../CustomAuthenticationFailureHandler.java | 4 +- .../SmsMessageScheduledJobServiceImpl.java | 15 ++++--- ...WritePlatformServiceJpaRepositoryImpl.java | 2 +- .../service/WriteLikelihoodServiceImpl.java | 4 +- .../config/MessagingConfiguration.java | 3 +- ...WritePlatformServiceJpaRepositoryImpl.java | 2 +- ...WritePlatformServiceJpaRepositoryImpl.java | 2 +- ...WritePlatformServiceJpaRepositoryImpl.java | 5 +-- ...WritePlatformServiceJpaRepositoryImpl.java | 2 +- ...WritePlatformServiceJpaRepositoryImpl.java | 2 +- .../TellerWritePlatformServiceJpaImpl.java | 2 +- ...ngInstructionWritePlatformServiceImpl.java | 2 +- ...WritePlatformServiceJpaRepositoryImpl.java | 2 +- ...WritePlatformServiceJpaRepositoryImpl.java | 2 +- ...WritePlatformServiceJpaRepositoryImpl.java | 2 +- ...WritePlatformServiceJpaRepositoryImpl.java | 4 +- ...WritePlatformServiceJpaRepositoryImpl.java | 2 +- .../FloatingRateWritePlatformServiceImpl.java | 2 +- ...WritePlatformServiceJpaRepositoryImpl.java | 2 +- ...WritePlatformServiceJpaRepositoryImpl.java | 2 +- ...WritePlatformServiceJpaRepositoryImpl.java | 4 +- ...ritePlatformServiceJpaRepositoryIImpl.java | 2 +- ...heduleRequestWritePlatformServiceImpl.java | 2 +- ...WritePlatformServiceJpaRepositoryImpl.java | 2 +- .../service/LoanArrearsAgingServiceImpl.java | 5 +-- .../service/LoanSchedularServiceImpl.java | 2 +- .../service/RecalculateInterestPoster.java | 6 +-- ...WritePlatformServiceJpaRepositoryImpl.java | 2 +- ...WritePlatformServiceJpaRepositoryImpl.java | 2 +- ...WritePlatformServiceJpaRepositoryImpl.java | 2 +- ...WritePlatformServiceJpaRepositoryImpl.java | 2 +- ...WritePlatformServiceJpaRepositoryImpl.java | 2 +- ...WritePlatformServiceJpaRepositoryImpl.java | 2 +- ...WritePlatformServiceJpaRepositoryImpl.java | 2 +- ...eficiariesTPTWritePlatformServiceImpl.java | 2 +- .../ScheduledJobRunnerServiceImpl.java | 21 +++++----- .../useradministration/domain/AppUser.java | 2 +- ...WritePlatformServiceJpaRepositoryImpl.java | 2 +- ...WritePlatformServiceJpaRepositoryImpl.java | 2 +- .../PermissionReadPlatformServiceImpl.java | 8 ++-- ...WritePlatformServiceJpaRepositoryImpl.java | 2 +- 86 files changed, 209 insertions(+), 209 deletions(-) diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index f69bace64a9..66bff2cfbf8 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -39,14 +39,14 @@ buildscript { 'nl.javadude.gradle.plugins:license-gradle-plugin:0.11.0', 'org.zeroturnaround:gradle-jrebel-plugin:1.1.2', 'org.springframework.boot:spring-boot-gradle-plugin:2.2.4.RELEASE' - // below + // below classpath "org.apache.openjpa:openjpa:$openJPAVersion" classpath 'com.radcortez.gradle:openjpa-gradle-plugin:3.1.0' classpath 'gradle.plugin.org.nosphere.apache:creadur-rat-gradle:0.2.2' - classpath "com.github.spotbugs:spotbugs-gradle-plugin:2.0.1" - // Use Guava version 23+ as a workaround to spotbug intergration. - // See: https://github.com/spotbugs/spotbugs-gradle-plugin/issues/128#issuecomment-535864882 - classpath 'com.google.guava:guava:28.1-jre' + classpath "com.github.spotbugs:spotbugs-gradle-plugin:2.0.1" + // Use Guava version 23+ as a workaround to spotbug intergration. + // See: https://github.com/spotbugs/spotbugs-gradle-plugin/issues/128#issuecomment-535864882 + classpath 'com.google.guava:guava:28.1-jre' } } @@ -103,6 +103,7 @@ dependencyManagement { //dependency 'junit:junit-dep:4.11' dependency 'org.mockito:mockito-core:+' dependency 'com.jayway.restassured:rest-assured:2.3.3' + dependency 'org.slf4j:slf4j-simple:1.7.30' dependency 'com.mockrunner:mockrunner-jms:2.0.1' dependency 'com.mockrunner:mockrunner-jdbc:2.0.1' diff --git a/fineract-provider/dependencies.gradle b/fineract-provider/dependencies.gradle index 04eb3a4f003..9bd2aee175d 100644 --- a/fineract-provider/dependencies.gradle +++ b/fineract-provider/dependencies.gradle @@ -25,6 +25,8 @@ dependencies { tomcat "org.apache.tomcat:tomcat-dbcp" providedRuntime("org.springframework.boot:spring-boot-starter-tomcat") + + spotbugsPlugins "jp.skypencil.findbugs.slf4j:bug-pattern:1.4.2@jar" compile ("org.springframework.boot:spring-boot-starter-data-jpa") { exclude group: 'com.zaxxer', module: 'HikariCP' @@ -109,6 +111,7 @@ dependencies { testCompile 'junit:junit', //'junit:junit-dep', 'org.mockito:mockito-core', + 'org.slf4j:slf4j-simple', 'com.jayway.restassured:rest-assured', 'com.mockrunner:mockrunner-jms', 'com.google.code.gson:gson', diff --git a/fineract-provider/dev-dependencies.gradle b/fineract-provider/dev-dependencies.gradle index 70b26f69e59..73b02e59a8a 100644 --- a/fineract-provider/dev-dependencies.gradle +++ b/fineract-provider/dev-dependencies.gradle @@ -26,6 +26,8 @@ dependencies { providedRuntime("org.springframework.boot:spring-boot-starter-tomcat") + spotbugsPlugins "jp.skypencil.findbugs.slf4j:bug-pattern:1.4.2@jar" + api( 'com.google.code.gson:gson', 'org.quartz-scheduler:quartz', @@ -109,6 +111,7 @@ dependencies { testCompile 'junit:junit:4.11', //'junit:junit-dep:4.11', 'org.mockito:mockito-core', + 'org.slf4j:slf4j-simple', 'com.jayway.restassured:rest-assured', 'com.mockrunner:mockrunner-jms', 'com.google.code.gson:gson', diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/Utils.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/Utils.java index 2530b442a78..ee7afa36079 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/Utils.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/Utils.java @@ -86,7 +86,7 @@ private static void awaitSpringBootActuatorHealthyUp() { sleep(3); } } catch (Exception e) { - logger.info("{} caused {}, going to wait and retry (attempt {})", HEALTH_URL, new Object[] { e.getMessage(), attempt++ }); + logger.info("{} caused {}, going to wait and retry (attempt {})", new Object[] { HEALTH_URL, e.getMessage(), attempt++ }); lastException = e; sleep(3); } @@ -96,7 +96,7 @@ private static void awaitSpringBootActuatorHealthyUp() { logger.error("{} still not reachable, giving up", HEALTH_URL, lastException); throw new AssertionError(HEALTH_URL + " not reachable", lastException); } else { - logger.error("{} still has not returned HTTP 200, giving up; (last) body: ", HEALTH_URL, response.prettyPrint()); + logger.error("{} still has not returned HTTP 200, giving up (last) body: {}", HEALTH_URL, response.prettyPrint()); fail(HEALTH_URL + " returned " + response.prettyPrint()); } } diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/interoperation/InteropHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/interoperation/InteropHelper.java index 8838bd83d60..c7510199358 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/interoperation/InteropHelper.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/interoperation/InteropHelper.java @@ -39,7 +39,7 @@ @SuppressWarnings({ "rawtypes" }) public class InteropHelper { - private final static Logger log = LoggerFactory.getLogger(InteropTest.class); + private final static Logger log = LoggerFactory.getLogger(InteropHelper.class); private static final String BASE_URL = "/fineract-provider/api/v1/interoperation"; private static final String HEALTH_URL = BASE_URL + "/health"; @@ -135,10 +135,10 @@ private String buildUrl(String url) { */ public String getHealth() { String url = buildUrl(HEALTH_URL); - log.debug("Calling Interoperable GET Health: " + url); + log.debug("Calling Interoperable GET Health: {}", url); String response = Utils.performServerGet(requestSpec, responseSpec, url, null); - log.debug("Response Interoperable GET Health: " + response); + log.debug("Response Interoperable GET Health: {}", response); return response; } @@ -147,10 +147,10 @@ public String getHealth() { */ public String getParty(InteropIdentifierType idType, String idValue) { String url = buildUrl(PARTIES_URL + '/' + idType + '/' + idValue); - log.debug("Calling Interoperable GET Party: " + url); + log.debug("Calling Interoperable GET Party: {}", url); String response = Utils.performServerGet(requestSpec, responseSpec, url, null); - log.debug("Response Interoperable GET Party: " + response); + log.debug("Response Interoperable GET Party: {}", response); return getJsonAttribute(response, InteropUtil.PARAM_ACCOUNT_ID); } @@ -160,10 +160,10 @@ public String getParty(InteropIdentifierType idType, String idValue) { public String postParty(InteropIdentifierType idType, String idValue) { String url = buildUrl(PARTIES_URL + '/' + idType + '/' + idValue); String request = buildPartiesJson(); - log.debug("Calling Interoperable POST Party: " + url + ", body: " + request); + log.debug("Calling Interoperable POST Party: {}, body: {}", url, request); String response = Utils.performServerPost(requestSpec, responseSpec, url, request, null); - log.debug("Response Interoperable POST Party: " + response); + log.debug("Response Interoperable POST Party: {}", response); return getJsonAttribute(response, InteropUtil.PARAM_ACCOUNT_ID); } @@ -173,10 +173,10 @@ public String postParty(InteropIdentifierType idType, String idValue) { public String deleteParty(InteropIdentifierType idType, String idValue) { String url = buildUrl(PARTIES_URL + '/' + idType + '/' + idValue); String request = buildPartiesJson(); - log.debug("Calling Interoperable DELETE Party: " + url + ", body: " + request); + log.debug("Calling Interoperable DELETE Party: {}, body: {}", url, request); String response = Utils.performServerDelete(requestSpec, responseSpec, url, request, null); - log.debug("Response Interoperable DELETE Party: " + response); + log.debug("Response Interoperable DELETE Party: {}", response); return getJsonAttribute(response, InteropUtil.PARAM_ACCOUNT_ID); } @@ -191,10 +191,10 @@ private String buildPartiesJson() { */ public String getTransactionRequest(String requestCode) { String url = buildUrl(TRANSACTIONS_URL + '/' + transactionCode + '/' + REQUESTS_URL_PARAM + '/' + requestCode); - log.debug("Calling Interoperable GET Request: " + url); + log.debug("Calling Interoperable GET Request: {}", url); String response = Utils.performServerGet(requestSpec, responseSpec, url, null); - log.debug("Response Interoperable GET Request: " + response); + log.debug("Response Interoperable GET Request: {}", response); return getJsonAttribute(response, InteropUtil.PARAM_REQUEST_CODE); } @@ -205,10 +205,10 @@ public String getTransactionRequest(String requestCode) { public String postTransactionRequest(String requestCode, InteropTransactionRole role) { String url = buildUrl(REQUESTS_URL); String request = buildTransactionRequestJson(requestCode, role); - log.debug("Calling Interoperable POST Request: " + url + ", body: " + request); + log.debug("Calling Interoperable POST Request: {}, body: {}", url, request); String response = Utils.performServerPost(requestSpec, responseSpec, url, request, null); - log.debug("Response Interoperable POST Request: " + response); + log.debug("Response Interoperable POST Request: {}", response); return response; } @@ -238,10 +238,10 @@ private String buildTransactionRequestJson(String requestCode, InteropTransactio */ public String getQuote(String quoteCode) { String url = buildUrl(TRANSACTIONS_URL + '/' + transactionCode + '/' + QUOTES_URL_PARAM + '/' + quoteCode); - log.debug("Calling Interoperable GET Quote: " + url); + log.debug("Calling Interoperable GET Quote: {}", url); String response = Utils.performServerGet(requestSpec, responseSpec, url, null); - log.debug("Response Interoperable GET Quote: " + response); + log.debug("Response Interoperable GET Quote: {}", response); return getJsonAttribute(response, InteropUtil.PARAM_QUOTE_CODE); } @@ -251,10 +251,10 @@ public String getQuote(String quoteCode) { public String postQuote(String quoteCode, InteropTransactionRole role) { String url = buildUrl(QUOTES_URL); String request = buildQuoteJson(quoteCode, role); - log.debug("Calling Interoperable POST Quote: " + url + ", body: " + request); + log.debug("Calling Interoperable POST Quote: {}, body: {}", url, request); String response = Utils.performServerPost(requestSpec, responseSpec, url, request, null); - log.debug("Response Interoperable POST Quote: " + response); + log.debug("Response Interoperable POST Quote: {}", response); return response; } @@ -286,10 +286,10 @@ private String buildQuoteJson(String quoteCode, InteropTransactionRole role) { */ public String getTransfer(String transferCode) { String url = buildUrl(TRANSACTIONS_URL + '/' + transactionCode + '/' + TRANSFERS_URL_PARAM + '/' + transferCode); - log.debug("Calling Interoperable GET Transfer: " + url); + log.debug("Calling Interoperable GET Transfer: {}", url); String response = Utils.performServerGet(requestSpec, responseSpec, url, null); - log.debug("Response Interoperable GET Transfer: " + response); + log.debug("Response Interoperable GET Transfer: {}", response); return getJsonAttribute(response, InteropUtil.PARAM_TRANSFER_CODE); } @@ -313,10 +313,10 @@ public String createTransfer(String transferCode, InteropTransactionRole role) { public String postTransfer(String transferCode, InteropTransferActionType action, InteropTransactionRole role) { String url = buildUrl(TRANSFERS_URL) + '&' + PARAM_TRANSFER_ACTION + '=' + action; String request = buildTransferJson(transferCode, role); - log.debug("Calling Interoperable POST Transfer: " + url + ", body: " + request); + log.debug("Calling Interoperable POST Transfer: {}, body: {}", url, request); String response = Utils.performServerPost(requestSpec, responseSpec, url, request, null); - log.debug("Response Interoperable POST Transfer: " + response); + log.debug("Response Interoperable POST Transfer: {}", response); return response; } diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/interoperation/InteropTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/interoperation/InteropTest.java index 35dbb3c5d61..7b155618495 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/interoperation/InteropTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/interoperation/InteropTest.java @@ -140,7 +140,7 @@ private void createSavingsProduct() { savingsProductId = SavingsProductHelper.createSavingsProduct(savingsProductJSON, requestSpec, responseSpec); Assert.assertNotNull(savingsProductId); - log.debug("Sucessfully created Interoperable Saving Product (id: " + savingsProductId + ")"); + log.debug("Sucessfully created Interoperable Saving Product (id: {})", savingsProductId); } private void createCharge() { @@ -167,7 +167,7 @@ private void openSavingsAccount() { savingsAccountHelper.addChargesForSavings(savingsId, chargeId, false, interopHelper.getFee()); } - log.debug("Sucessfully created Interoperable Saving Account (id: " + savingsId + ")"); + log.debug("Sucessfully created Interoperable Saving Account (id: {})", savingsId); } private void testParties() { @@ -245,7 +245,7 @@ private void testTransfers() { // prepare savings = (String) savingsAccountHelper.getSavingsAccountDetail(savingsId, null); - log.debug("Response Interoperable GET Saving: " + savings); + log.debug("Response Interoperable GET Saving: {}", savings); savingsJson = JsonPath.from(savings); BigDecimal onHold2 = ObjectConverter.convertObjectTo(savingsJson.get(SavingsApiConstants.savingsAmountOnHold), BigDecimal.class); BigDecimal balance2 = ObjectConverter.convertObjectTo(savingsJson.get(PARAM_ACCOUNT_BALANCE), BigDecimal.class); @@ -263,7 +263,7 @@ private void testTransfers() { Assert.assertEquals(InteropActionState.ACCEPTED.toString(), json.getString(InteropHelper.PARAM_ACTION_STATE)); savings = (String) savingsAccountHelper.getSavingsAccountDetail(savingsId, null); - log.debug("Response Interoperable GET Saving: " + savings); + log.debug("Response Interoperable GET Saving: {}", savings); savingsJson = JsonPath.from(savings); BigDecimal onHold3 = ObjectConverter.convertObjectTo(savingsJson.get(SavingsApiConstants.savingsAmountOnHold), BigDecimal.class); BigDecimal balance3 = ObjectConverter.convertObjectTo(savingsJson.get(PARAM_ACCOUNT_BALANCE), BigDecimal.class); @@ -277,7 +277,7 @@ private void testTransfers() { Assert.assertEquals(InteropActionState.ACCEPTED.toString(), json.getString(InteropHelper.PARAM_ACTION_STATE)); savings = (String) savingsAccountHelper.getSavingsAccountDetail(savingsId, null); - log.debug("Response Interoperable GET Saving: " + savings); + log.debug("Response Interoperable GET Saving: {}", savings); savingsJson = JsonPath.from(savings); BigDecimal onHold4 = ObjectConverter.convertObjectTo(savingsJson.get(SavingsApiConstants.savingsAmountOnHold), BigDecimal.class); BigDecimal balance4 = ObjectConverter.convertObjectTo(savingsJson.get(PARAM_ACCOUNT_BALANCE), BigDecimal.class); diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/service/GLClosureWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/service/GLClosureWritePlatformServiceJpaRepositoryImpl.java index 74c92a78e9d..a600689e70f 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/service/GLClosureWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/service/GLClosureWritePlatformServiceJpaRepositoryImpl.java @@ -144,7 +144,7 @@ private void handleGLClosureIntegrityIssues(final JsonCommand command, final Dat command.longValueOfParameterNamed(GLClosureJsonInputParams.OFFICE_ID.getValue()), new LocalDate( command.DateValueOfParameterNamed(GLClosureJsonInputParams.CLOSING_DATE.getValue()))); } - logger.error(dve.getMessage(), dve); + logger.error("Error occured.", dve); throw new PlatformDataIntegrityException("error.msg.glClosure.unknown.data.integrity.issue", "Unknown data integrity issue with resource GL Closure: " + realCause.getMessage()); } diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/service/FinancialActivityAccountWritePlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/service/FinancialActivityAccountWritePlatformServiceImpl.java index e9c23edce23..6fc41359c8c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/service/FinancialActivityAccountWritePlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/service/FinancialActivityAccountWritePlatformServiceImpl.java @@ -154,7 +154,7 @@ private void handleFinancialActivityAccountDataIntegrityIssues(final JsonCommand throw new DuplicateFinancialActivityAccountFoundException(financialActivityId); } - logger.error(dve.getMessage(), dve); + logger.error("Error occured.", dve); throw new PlatformDataIntegrityException("error.msg.glAccount.unknown.data.integrity.issue", "Unknown data integrity issue with resource GL Account: " + realCause.getMessage()); } diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/service/GLAccountWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/service/GLAccountWritePlatformServiceJpaRepositoryImpl.java index de32ad12d62..f585245455d 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/service/GLAccountWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/service/GLAccountWritePlatformServiceJpaRepositoryImpl.java @@ -232,7 +232,7 @@ private void handleGLAccountDataIntegrityIssues(final JsonCommand command, final throw new GLAccountDuplicateException(glCode); } - logger.error(dve.getMessage(), dve); + logger.error("Error occured.", dve); throw new PlatformDataIntegrityException("error.msg.glAccount.unknown.data.integrity.issue", "Unknown data integrity issue with resource GL Account: " + realCause.getMessage()); } diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/JournalEntryRunningBalanceUpdateServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/JournalEntryRunningBalanceUpdateServiceImpl.java index 96ce8b7eac1..ee512b68b42 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/JournalEntryRunningBalanceUpdateServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/JournalEntryRunningBalanceUpdateServiceImpl.java @@ -124,7 +124,7 @@ public CommandProcessingResult updateOfficeRunningBalance(JsonCommand command) { Date entityDate = this.jdbcTemplate.queryForObject(dateFinder, Date.class, officeId); updateRunningBalance(officeId, entityDate); } catch (EmptyResultDataAccessException e) { - logger.debug("No results found for updation of office running balance with office id:" + officeId); + logger.debug("No results found for updation of office running balance with office id: {}", officeId); } commandProcessingResultBuilder.withOfficeId(officeId); } diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/JournalEntryWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/JournalEntryWritePlatformServiceJpaRepositoryImpl.java index 4ea4951877a..1a835d9116a 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/JournalEntryWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/JournalEntryWritePlatformServiceJpaRepositoryImpl.java @@ -639,7 +639,7 @@ private String generateTransactionId(final Long officeId) { private void handleJournalEntryDataIntegrityIssues(final DataIntegrityViolationException dve) { final Throwable realCause = dve.getMostSpecificCause(); - logger.error(dve.getMessage(), dve); + logger.error("Error occured.", dve); throw new PlatformDataIntegrityException("error.msg.glJournalEntry.unknown.data.integrity.issue", "Unknown data integrity issue with resource Journal Entry: " + realCause.getMessage()); } diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/rule/service/AccountingRuleWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/rule/service/AccountingRuleWritePlatformServiceJpaRepositoryImpl.java index 2372cbf36b3..966ca7d7410 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/rule/service/AccountingRuleWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/rule/service/AccountingRuleWritePlatformServiceJpaRepositoryImpl.java @@ -89,7 +89,7 @@ private void handleAccountingRuleIntegrityIssues(final JsonCommand command, fina throw new AccountingRuleDuplicateException(command.stringValueOfParameterNamed(AccountingRuleJsonInputParams.NAME.getValue())); } else if (realCause.getMessage().contains("UNIQUE_ACCOUNT_RULE_TAGS")) { throw new AccountingRuleDuplicateException(); } - logger.error(dve.getMessage(), dve); + logger.error("Error occured.", dve); throw new PlatformDataIntegrityException("error.msg.accounting.rule.unknown.data.integrity.issue", "Unknown data integrity issue with resource Accounting Rule: " + realCause.getMessage()); } diff --git a/fineract-provider/src/main/java/org/apache/fineract/adhocquery/service/AdHocScheduledJobRunnerServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/adhocquery/service/AdHocScheduledJobRunnerServiceImpl.java index 52352d1440c..a2ab24e9dec 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/adhocquery/service/AdHocScheduledJobRunnerServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/adhocquery/service/AdHocScheduledJobRunnerServiceImpl.java @@ -105,16 +105,17 @@ public void generateClientSchedule() { .append(adhoc.getQuery()); if (insertSqlBuilder.length() > 0) { final int result = this.jdbcTemplate.update(insertSqlBuilder.toString()); - logger.info(ThreadLocalContextUtil.getTenant().getName() + ": Results affected by inserted: " + result); + logger.info("{}: Results affected by inserted: {}", ThreadLocalContextUtil.getTenant().getName(), result); this.jdbcTemplate.update("UPDATE m_adhoc SET last_run=? WHERE id=?", new Date(), adhoc.getId()); } } else { - logger.info(ThreadLocalContextUtil.getTenant().getName() + ": Skipping execution of " + adhoc.getName() + ", scheduled for execution on " + next); + logger.info("{}: Skipping execution of {}, scheduled for execution on {}", + new Object[] { ThreadLocalContextUtil.getTenant().getName(), adhoc.getName(), next }); } }); }else{ - logger.info(ThreadLocalContextUtil.getTenant().getName() + "Nothing to update "); + logger.info("{} Nothing to update", ThreadLocalContextUtil.getTenant().getName()); } diff --git a/fineract-provider/src/main/java/org/apache/fineract/adhocquery/service/AdHocWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/adhocquery/service/AdHocWritePlatformServiceJpaRepositoryImpl.java index b48ceba16a7..3d476548bf7 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/adhocquery/service/AdHocWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/adhocquery/service/AdHocWritePlatformServiceJpaRepositoryImpl.java @@ -93,7 +93,7 @@ private void handleDataIntegrityIssues(final JsonCommand command, final DataInte } private void logAsErrorUnexpectedDataIntegrityException(final DataIntegrityViolationException dve) { - logger.error(dve.getMessage(), dve); + logger.error("Error occured.", dve); } @Transactional diff --git a/fineract-provider/src/main/java/org/apache/fineract/commands/provider/CommandHandlerProvider.java b/fineract-provider/src/main/java/org/apache/fineract/commands/provider/CommandHandlerProvider.java index 9b914db531c..58d452ebf16 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/commands/provider/CommandHandlerProvider.java +++ b/fineract-provider/src/main/java/org/apache/fineract/commands/provider/CommandHandlerProvider.java @@ -85,12 +85,12 @@ private void initializeHandlerRegistry() { final String[] commandHandlerBeans = this.applicationContext.getBeanNamesForAnnotation(CommandType.class); if (ArrayUtils.isNotEmpty(commandHandlerBeans)) { for (final String commandHandlerName : commandHandlerBeans) { - LOGGER.info("Register command handler '" + commandHandlerName + "' ..."); + LOGGER.info("Register command handler '{}' ...", commandHandlerName); final CommandType commandType = this.applicationContext.findAnnotationOnBean(commandHandlerName, CommandType.class); try { this.registeredHandlers.put(commandType.entity() + "|" + commandType.action(), commandHandlerName); } catch (final Throwable th) { - LOGGER.error("Unable to register command handler '" + commandHandlerName + "'!", th); + LOGGER.error("Unable to register command handler '{}'!", commandHandlerName, th); } } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/commands/service/AuditReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/commands/service/AuditReadPlatformServiceImpl.java index 41b48ab1967..d28482a8f53 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/commands/service/AuditReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/commands/service/AuditReadPlatformServiceImpl.java @@ -214,7 +214,7 @@ public Page retrievePaginatedAuditEntries(final SQLBuilder extraCrite this.columnValidator.validateSqlInjection(sqlBuilder.toString(), parameters.limitSql()); } - logger.info("sql: " + sqlBuilder.toString()); + logger.info("sql: {}", sqlBuilder); final String sqlCountRows = "SELECT FOUND_ROWS()"; return this.paginationHelper.fetchPage(this.jdbcTemplate, sqlCountRows, sqlBuilder.toString(), extraCriteria.getArguments(), rm); @@ -251,7 +251,7 @@ private Collection retrieveEntries(final String useType, final SQLBui } sql += extraCriteria.getSQLTemplate(); sql += groupAndOrderBySQL; - logger.info("sql: " + sql); + logger.info("sql: {}", sql); return this.jdbcTemplate.query(sql, rm, extraCriteria.getArguments()); } @@ -511,4 +511,4 @@ public String schema() { } } -} \ No newline at end of file +} diff --git a/fineract-provider/src/main/java/org/apache/fineract/commands/service/PortfolioCommandSourceWritePlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/commands/service/PortfolioCommandSourceWritePlatformServiceImpl.java index d6750324c4d..335d69496ce 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/commands/service/PortfolioCommandSourceWritePlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/commands/service/PortfolioCommandSourceWritePlatformServiceImpl.java @@ -96,14 +96,14 @@ public CommandProcessingResult logCommandSource(final CommandWrapper wrapper) { result = this.processAndLogCommandService.processAndLogCommand(wrapper, command, isApprovedByChecker); numberOfRetries = maxNumberOfRetries + 1; } catch (CannotAcquireLockException | ObjectOptimisticLockingFailureException exception) { - logger.info("The following command " + command.json() + " has been retried " + numberOfRetries + " time(s)"); + logger.info("The following command {} has been retried {} time(s)", command.json(), numberOfRetries); /*** * Fail if the transaction has been retired for * maxNumberOfRetries **/ if (numberOfRetries >= maxNumberOfRetries) { - logger.warn("The following command " + command.json() + " has been retried for the max allowed attempts of " - + numberOfRetries + " and will be rolled back"); + logger.warn("The following command {} has been retried for the max allowed attempts of {} and will be rolled back", + command.json(), numberOfRetries); throw (exception); } /*** diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/service/AccountNumberFormatWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/service/AccountNumberFormatWritePlatformServiceJpaRepositoryImpl.java index 8885641cf06..57ed40d4d55 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/service/AccountNumberFormatWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/service/AccountNumberFormatWritePlatformServiceJpaRepositoryImpl.java @@ -149,7 +149,7 @@ private void handleDataIntegrityIssues(final JsonCommand command, final Throwabl "Account Format preferences for Account type `" + entityAccountType.getCode() + "` already exists", "externalId", entityAccountType.getValue(), entityAccountType.getCode()); } - logger.error(dve.getMessage(), dve); + logger.error("Error occured.", dve); throw new PlatformDataIntegrityException("error.msg.account.number.format.unknown.data.integrity.issue", "Unknown data integrity issue with resource."); } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailCampaignWritePlatformCommandHandlerImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailCampaignWritePlatformCommandHandlerImpl.java index 574a0449a5b..46774e6aded 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailCampaignWritePlatformCommandHandlerImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailCampaignWritePlatformCommandHandlerImpl.java @@ -293,7 +293,7 @@ public void storeTemplateMessageIntoEmailOutBoundTable() throws JobExecutionExce LocalDateTime tenantDateNow = tenantDateTime(); LocalDateTime nextTriggerDate = emailCampaignData.getNextTriggerDate().toLocalDateTime(); - logger.info("tenant time " + tenantDateNow.toString() + " trigger time " + nextTriggerDate.toString()); + logger.info("tenant time {} trigger time {}", tenantDateNow, nextTriggerDate); if (nextTriggerDate.isBefore(tenantDateNow)) { insertDirectCampaignIntoEmailOutboundTable(emailCampaignData.getParamValue(), emailCampaignData.getEmailSubject(), emailCampaignData.getMessage(), emailCampaignData.getCampaignName(), emailCampaignData.getId()); diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailWritePlatformServiceJpaRepositoryImpl.java index 924218d032d..8ff34fbfdc0 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailWritePlatformServiceJpaRepositoryImpl.java @@ -126,7 +126,7 @@ private void handleDataIntegrityIssues(@SuppressWarnings("unused") final JsonCom if (realCause.getMessage().contains("email_address")) { throw new PlatformDataIntegrityException("error.msg.email.no.email.address.exists", "The group, client or staff provided has no email address.", "id"); } - logger.error(dve.getMessage(), dve); + logger.error("Error occured.", dve); throw new PlatformDataIntegrityException("error.msg.email.unknown.data.integrity.issue", "Unknown data integrity issue with resource: " + realCause.getMessage()); } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/service/SmsCampaignDomainServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/service/SmsCampaignDomainServiceImpl.java index 20e860d43b4..2ccf6e44a85 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/service/SmsCampaignDomainServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/service/SmsCampaignDomainServiceImpl.java @@ -235,9 +235,9 @@ private void sendSmsForLoanRepayment(LoanTransaction loanTransaction) { } } } catch (final IOException e) { - logger.error("smsParams does not contain the key: " + e.getMessage()); + logger.error("smsParams does not contain the key: ", e); } catch (final RuntimeException e) { - logger.debug("Client Office Id and SMS Campaign Office id doesn't match"); + logger.debug("Client Office Id and SMS Campaign Office id doesn't match ", e); } } } @@ -293,9 +293,9 @@ private void sendSmsForSavingsTransaction(final SavingsAccountTransaction saving this.smsMessageScheduledJobService.sendTriggeredMessages(smsDataMap); } } catch (final IOException e) { - logger.error("smsParams does not contain the key: " + e.getMessage()); + logger.error("smsParams does not contain the key: ", e); } catch (final RuntimeException e) { - logger.debug("Client Office Id and SMS Campaign Office id doesn't match"); + logger.debug("Client Office Id and SMS Campaign Office id doesn't match ", e); } } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/service/SmsCampaignWritePlatformServiceJpaImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/service/SmsCampaignWritePlatformServiceJpaImpl.java index 7ff5220fa81..9ec5d927850 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/service/SmsCampaignWritePlatformServiceJpaImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/service/SmsCampaignWritePlatformServiceJpaImpl.java @@ -240,7 +240,7 @@ private void insertDirectCampaignIntoSmsOutboundTable(SmsCampaign smsCampaign) { } } } catch (final IOException e) { - logger.error(e.getMessage()); + logger.error("Error occured.", e) ; } } @@ -302,9 +302,9 @@ public void insertDirectCampaignIntoSmsOutboundTable(final Loan loan, final SmsC } } } catch (final IOException e) { - logger.error(e.getMessage()) ; + logger.error("Error occured.", e) ; } catch (final RuntimeException e) { - logger.error(e.getMessage()) ; + logger.error("Error occured.", e) ; } } @@ -347,9 +347,9 @@ public void insertDirectCampaignIntoSmsOutboundTable(final Client client, final } } } catch (final IOException e) { - logger.error(e.getMessage()) ; + logger.error("Error occured.", e) ; } catch (final RuntimeException e) { - logger.error(e.getMessage()) ; + logger.error("Error occured.", e) ; } } @@ -391,9 +391,9 @@ public void insertDirectCampaignIntoSmsOutboundTable(final SavingsAccount saving } } } catch (final IOException e) { - logger.error(e.getMessage()) ; + logger.error("Error occured.", e) ; } catch (final RuntimeException e) { - logger.error(e.getMessage()) ; + logger.error("Error occured.", e) ; } } @@ -537,7 +537,7 @@ private List> getRunReportByServiceImpl(final String rep final String response = this.genericDataService.generateJsonFromGenericResultsetData(results); resultList = new ObjectMapper().readValue(response, new TypeReference>>() {}); } catch (JsonParseException e) { - logger.info("Conversion of report query results to JSON failed: " + e.getMessage() + " - Location: " + e.getLocation()); + logger.info("Conversion of report query results to JSON failed", e); return resultList; } // loop changes array date to string date @@ -656,7 +656,8 @@ public void storeTemplateMessageIntoSmsOutBoundTable() throws JobExecutionExcept LocalDateTime tenantDateNow = tenantDateTime(); LocalDateTime nextTriggerDate = smsCampaign.getNextTriggerDate(); - logger.info("tenant time " + tenantDateNow.toString() + " trigger time " + nextTriggerDate.toString() + JobName.UPDATE_SMS_OUTBOUND_WITH_CAMPAIGN_MESSAGE.name()); + logger.info("tenant time {} trigger time {} {}", + new Object[] { tenantDateNow, nextTriggerDate, JobName.UPDATE_SMS_OUTBOUND_WITH_CAMPAIGN_MESSAGE.name() }); if (nextTriggerDate.isBefore(tenantDateNow)) { insertDirectCampaignIntoSmsOutboundTable(smsCampaign); this.updateTriggerDates(smsCampaign.getId()); diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/service/CodeValueWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/service/CodeValueWritePlatformServiceJpaRepositoryImpl.java index e738ccf2308..a2e3928e560 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/service/CodeValueWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/service/CodeValueWritePlatformServiceJpaRepositoryImpl.java @@ -102,7 +102,7 @@ private void handleCodeValueDataIntegrityIssues(final JsonCommand command, final + "' already exists", "name", name); } - logger.error(dve.getMessage(), dve); + logger.error("Error occured.", dve); throw new PlatformDataIntegrityException("error.msg.code.value.unknown.data.integrity.issue", "Unknown data integrity issue with resource: " + realCause.getMessage()); } @@ -161,7 +161,7 @@ public CommandProcessingResult deleteCodeValue(final Long codeId, final Long cod .withSubEntityId(codeValueId)// .build(); } catch (final DataIntegrityViolationException dve) { - logger.error(dve.getMessage(), dve); + logger.error("Error occured.", dve); final Throwable realCause = dve.getMostSpecificCause(); if (realCause.getMessage().contains("code_value")) { throw new PlatformDataIntegrityException("error.msg.codeValue.in.use", "This code value is in use", codeValueId); } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/service/CodeWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/service/CodeWritePlatformServiceJpaRepositoryImpl.java index df94214fc27..c1f2be4ebda 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/service/CodeWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/service/CodeWritePlatformServiceJpaRepositoryImpl.java @@ -148,7 +148,7 @@ private void handleCodeDataIntegrityIssues(final JsonCommand command, final Thro "name", name); } - logger.error(dve.getMessage(), dve); + logger.error("Error occured.", dve); throw new PlatformDataIntegrityException("error.msg.cund.unknown.data.integrity.issue", "Unknown data integrity issue with resource: " + realCause.getMessage()); } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/service/GlobalConfigurationWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/service/GlobalConfigurationWritePlatformServiceJpaRepositoryImpl.java index e25432b1cca..4de1e74978d 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/service/GlobalConfigurationWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/service/GlobalConfigurationWritePlatformServiceJpaRepositoryImpl.java @@ -107,7 +107,7 @@ public void addSurveyConfig(final String name) private void handleDataIntegrityIssues(final DataIntegrityViolationException dve) { final Throwable realCause = dve.getMostSpecificCause(); - logger.error(dve.getMessage(), dve); + logger.error("Error occured.", dve); throw new PlatformDataIntegrityException("error.msg.globalConfiguration.unknown.data.integrity.issue", "Unknown data integrity issue with resource: " + realCause.getMessage()); } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/boot/db/DataSourceConfiguration.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/boot/db/DataSourceConfiguration.java index 39d8f0047b7..9dfccd1d4cb 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/boot/db/DataSourceConfiguration.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/boot/db/DataSourceConfiguration.java @@ -46,7 +46,7 @@ public DataSourceProperties dataSourceProperties() { public DataSource tenantDataSourceJndi() { PoolConfiguration p = getProperties(); org.apache.tomcat.jdbc.pool.DataSource ds = new org.apache.tomcat.jdbc.pool.DataSource(p); - logger.info("Created new DataSource; url=" + p.getUrl()); + logger.info("Created new DataSource; url={}", p.getUrl()); return ds; } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/boot/db/TenantDataSourcePortFixService.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/boot/db/TenantDataSourcePortFixService.java index 904d7d9845f..c5a7e869a33 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/boot/db/TenantDataSourcePortFixService.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/boot/db/TenantDataSourcePortFixService.java @@ -72,7 +72,7 @@ public TenantDataSourcePortFixService(@Qualifier("tenantDataSourceJndi") final D public void fixUpTenantsSchemaServerPort() { if (!enabled) { - logger.info("No schema_server_port UPDATE made to tenant_server_connections table of the fineract_tenants schema, because " + ENABLED + " = false"); + logger.info("No schema_server_port UPDATE made to tenant_server_connections table of the fineract_tenants schema, because {} = false", ENABLED); return; } if (dsp == null) { @@ -86,10 +86,8 @@ public void fixUpTenantsSchemaServerPort() { if ( r == 0 ) logger.warn("UPDATE tenant_server_connections SET ... did not update ANY rows - something is probably wrong"); else - logger.info("Upated " - + r - + " rows in the tenant_server_connections table of the fineract_tenants schema to the real current host: " - + dsp.getHost() + ", port: " + dsp.getPort()); + logger.info("Upated {} rows in the tenant_server_connections table of the fineract_tenants schema to the real current host: {}, port: {}", + new Object[] { r, dsp.getHost(), dsp.getPort() }); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/EntityDatatableChecksWritePlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/EntityDatatableChecksWritePlatformServiceImpl.java index 92ca32a68c3..c053f82f4a2 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/EntityDatatableChecksWritePlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/EntityDatatableChecksWritePlatformServiceImpl.java @@ -105,7 +105,7 @@ public CommandProcessingResult createCheck(final JsonCommand command) { final String foreignKeyColumnName = EntityTables.getForeignKeyColumnNameOnDatatable(entity); final boolean columnExist = datatableData.hasColumn(foreignKeyColumnName); - logger.info(datatableData.getRegisteredTableName() + "has column " + foreignKeyColumnName + " ? " + columnExist); + logger.info("{} has column {} ? {}", new Object[] { datatableData.getRegisteredTableName(), foreignKeyColumnName, columnExist }); if (!columnExist) { throw new EntityDatatableCheckNotSupportedException(datatableData.getRegisteredTableName(), entity); } @@ -163,7 +163,7 @@ public void runTheCheck(final Long entityId, final String entityName, final Long final String datatableName = t.getDatatableName(); final Long countEntries = readWriteNonCoreDataService.countDatatableEntries(datatableName, entityId, foreignKeyColumn); - logger.info("The are " + countEntries + " entries in the table " + datatableName); + logger.info("The are {} entries in the table {}", countEntries, datatableName); if (countEntries.intValue() == 0) { reqDatatables.add(datatableName); } @@ -189,7 +189,7 @@ public void runTheCheckForProduct(final Long entityId, final String entityName, final String datatableName = t.getDatatableName(); final Long countEntries = readWriteNonCoreDataService.countDatatableEntries(datatableName, entityId, foreignKeyColumn); - logger.info("The are " + countEntries + " entries in the table " + datatableName); + logger.info("The are {} entries in the table {}", countEntries, datatableName); if (countEntries.intValue() == 0) { reqDatatables.add(datatableName); } @@ -289,7 +289,7 @@ private void handleReportDataIntegrityIssues(final JsonCommand command, final Th throw new EntityDatatableCheckAlreadyExistsException(entity, status, datatableName, productId); } - logger.error(dae.getMessage(), dae); + logger.error("Error occured.", dae); throw new PlatformDataIntegrityException("error.msg.report.unknown.data.integrity.issue", "Unknown data integrity issue with resource: " + realCause.getMessage()); } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/ReadReportingServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/ReadReportingServiceImpl.java index 7ea472a3d06..d1a08444697 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/ReadReportingServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/ReadReportingServiceImpl.java @@ -126,7 +126,7 @@ private StringBuffer generateCsvFileBuffer(final GenericResultsetData result) { final StringBuffer writer = new StringBuffer(); final List columnHeaders = result.getColumnHeaders(); - logger.info("NO. of Columns: " + columnHeaders.size()); + logger.info("NO. of Columns: {}", columnHeaders.size()); final Integer chSize = columnHeaders.size(); for (int i = 0; i < chSize; i++) { writer.append('"' + columnHeaders.get(i).getColumnName() + '"'); @@ -144,7 +144,7 @@ private StringBuffer generateCsvFileBuffer(final GenericResultsetData result) { String currVal; final String doubleQuote = "\""; final String twoDoubleQuotes = doubleQuote + doubleQuote; - logger.info("NO. of Rows: " + data.size()); + logger.info("NO. of Rows: {}", data.size()); for (int i = 0; i < data.size(); i++) { row = data.get(i).getRow(); rSize = row.size(); @@ -176,14 +176,14 @@ public GenericResultsetData retrieveGenericResultset(final String name, final St final Map queryParams, final boolean isSelfServiceUserReport) { final long startTime = System.currentTimeMillis(); - logger.info("STARTING REPORT: " + name + " Type: " + type); + logger.info("STARTING REPORT: {} Type: {}", name, type); final String sql = getSQLtoRun(name, type, queryParams, isSelfServiceUserReport); final GenericResultsetData result = this.genericDataService.fillGenericResultSet(sql); final long elapsed = System.currentTimeMillis() - startTime; - logger.info("FINISHING Report/Request Name: " + name + " - " + type + " Elapsed Time: " + elapsed); + logger.info("FINISHING Report/Request Name: {} - {} Elapsed Time: {}", new Object[] { name, type, elapsed }); return result; } @@ -195,7 +195,7 @@ private String getSQLtoRun(final String name, final String type, final Map keys = queryParams.keySet(); for (final String key : keys) { final String pValue = queryParams.get(key); - // logger.info("(" + key + " : " + pValue + ")"); + // logger.info("({} : {})", key, pValue); sql = this.genericDataService.replace(sql, key, pValue); } @@ -263,7 +263,7 @@ public String retrieveReportPDF(final String reportName, final String type, fina final List data = result.getData(); List row; - logger.info("NO. of Columns: " + columnHeaders.size()); + logger.info("NO. of Columns: {}", columnHeaders.size()); final Integer chSize = columnHeaders.size(); final Document document = new Document(PageSize.B0.rotate()); @@ -284,7 +284,7 @@ public String retrieveReportPDF(final String reportName, final String type, fina Integer rSize; String currColType; String currVal; - logger.info("NO. of Rows: " + data.size()); + logger.info("NO. of Rows: {}", data.size()); for (int i = 0; i < data.size(); i++) { row = data.get(i).getRow(); rSize = row.size(); @@ -307,7 +307,7 @@ public String retrieveReportPDF(final String reportName, final String type, fina document.close(); return genaratePdf; } catch (final Exception e) { - logger.error("error.msg.reporting.error:" + e.getMessage()); + logger.error("error.msg.reporting.error:", e); throw new PlatformDataIntegrityException("error.msg.exception.error", e.getMessage()); } } @@ -506,14 +506,14 @@ public ReportParameterData mapRow(final ResultSet rs, final int rowNum) throws S @Override public GenericResultsetData retrieveGenericResultSetForSmsEmailCampaign(String name, String type, Map queryParams) { final long startTime = System.currentTimeMillis(); - logger.info("STARTING REPORT: " + name + " Type: " + type); + logger.info("STARTING REPORT: {} Type: {}", name, type); final String sql = sqlToRunForSmsEmailCampaign(name, type, queryParams); final GenericResultsetData result = this.genericDataService.fillGenericResultSet(sql); final long elapsed = System.currentTimeMillis() - startTime; - logger.info("FINISHING Report/Request Name: " + name + " - " + type + " Elapsed Time: " + elapsed); + logger.info("FINISHING Report/Request Name: {} - {} Elapsed Time: {}", new Object[] { name, type, elapsed }); return result; } @@ -553,7 +553,7 @@ public ByteArrayOutputStream generatePentahoReportAsOutputStream(final String re final String reportPath = FileSystemContentRepository.FINERACT_BASE_DIR + File.separator + "pentahoReports" + File.separator + reportName + ".prpt"; - logger.info("Report path: " + reportPath); + logger.info("Report path: {}", reportPath); // load report definition final ResourceManager manager = new ResourceManager(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/ReadWriteNonCoreDataServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/ReadWriteNonCoreDataServiceImpl.java index 2c379351d8b..4672e619af2 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/ReadWriteNonCoreDataServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/ReadWriteNonCoreDataServiceImpl.java @@ -206,7 +206,7 @@ public DatatableData retrieveDatatable(final String datatable) { } private void logAsErrorUnexpectedDataIntegrityException(final Exception dve) { - logger.error(dve.getMessage(), dve); + logger.error("Error occured.", dve); } @Transactional @@ -749,7 +749,7 @@ private int getCodeIdForColumn(final String dataTableNameAlias, final String nam try { codeId = this.jdbcTemplate.queryForObject(checkColumnCodeMapping.toString(), Integer.class); } catch (final EmptyResultDataAccessException e) { - logger.info(e.getMessage()); + logger.info("Error occured.", e); } return ObjectUtils.defaultIfNull(codeId, 0); } @@ -1133,7 +1133,7 @@ private CommandProcessingResult updateDatatableEntry(final String dataTableName, pkValue = datatableId; } final String sql = getUpdateSql(grs.getColumnHeaders(), dataTableName, pkName, pkValue, changes); - logger.info("Update sql: " + sql); + logger.info("Update sql: {}", sql); if (StringUtils.isNotBlank(sql)) { this.jdbcTemplate.update(sql); changes.put("locale", dataParams.get("locale")); @@ -1240,7 +1240,7 @@ private GenericResultsetData retrieveDataTableGenericResultSetForUpdate(final St private CommandProcessingResult checkMainResourceExistsWithinScope(final String appTable, final Long appTableId) { final String sql = dataScopedSQL(appTable, appTableId); - logger.info("data scoped sql: " + sql); + logger.info("data scoped sql: {}", sql); final SqlRowSet rs = this.jdbcTemplate.queryForRowSet(sql); if (!rs.next()) { throw new DatatableNotFoundException(appTable, appTableId); } @@ -1432,7 +1432,7 @@ private String getAddSql(final List columnHeaders, fi addSql = "insert into `" + datatable + "` (`" + fkName + "` " + insertColumns + ")" + " select " + appTableId + " as id" + selectColumns; - logger.info(addSql); + logger.info("{}", addSql); return addSql; } @@ -1483,7 +1483,7 @@ public String getAddSqlWithScore(final List columnHea + " as id" + selectColumns + " , ( SELECT SUM( code_score ) FROM m_code_value WHERE m_code_value.id IN (" + scoresId + " ) ) as score"; - logger.info(vaddSql); + logger.info("{}", vaddSql); return vaddSql; } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/ReportWritePlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/ReportWritePlatformServiceImpl.java index 5e2d7b4f6ab..a824568be04 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/ReportWritePlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/ReportWritePlatformServiceImpl.java @@ -185,7 +185,7 @@ private void handleReportDataIntegrityIssues(final JsonCommand command, final Th "name", name); } - logger.error(dve.getMessage(), dve); + logger.error("Error occured.", dve); throw new PlatformDataIntegrityException("error.msg.report.unknown.data.integrity.issue", "Unknown data integrity issue with resource: " + realCause.getMessage()); } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/FileSystemContentRepository.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/FileSystemContentRepository.java index 028b8ccbc90..c52272cb235 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/FileSystemContentRepository.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/FileSystemContentRepository.java @@ -93,7 +93,7 @@ public void deleteImage(final Long resourceId, final String location) { final boolean fileDeleted = deleteFile(location); if (!fileDeleted) { // no need to throw an Error, simply log a warning - logger.warn("Unable to delete image associated with clients with Id " + resourceId); + logger.warn("Unable to delete image associated with clients with Id {}", resourceId); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/S3ContentRepository.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/S3ContentRepository.java index 592a3dcc03a..3ba4f1c29ac 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/S3ContentRepository.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/S3ContentRepository.java @@ -107,10 +107,10 @@ public void deleteImage(final Long resourceId, final String location) { deleteObjectFromS3(location); } catch (final AmazonServiceException ase) { deleteObjectAmazonServiceExceptionMessage(ase); - logger.warn("Unable to delete image associated with clients with Id " + resourceId); + logger.warn("Unable to delete image associated with clients with Id {}", resourceId); } catch (final AmazonClientException ace) { deleteObjectAmazonClientExceptionMessage(ace); - logger.warn("Unable to delete image associated with clients with Id " + resourceId); + logger.warn("Unable to delete image associated with clients with Id {}", resourceId); } } @@ -128,7 +128,7 @@ public FileData fetchFile(final DocumentData documentData) throws DocumentNotFou final S3Object s3object = this.s3Client.getObject(new GetObjectRequest(this.s3BucketName, documentData.fileLocation())); fileData = new FileData(s3object.getObjectContent(), fileName, documentData.contentType()); } catch (final AmazonClientException ace) { - logger.error(ace.getMessage()); + logger.error("Error occured.", ace); throw new DocumentNotFoundException(documentData.getParentEntityType(), documentData.getParentEntityId(), documentData.getId()); } return fileData; @@ -140,21 +140,21 @@ public ImageData fetchImage(final ImageData imageData) { final S3Object s3object = this.s3Client.getObject(new GetObjectRequest(this.s3BucketName, imageData.location())); imageData.updateContent(s3object.getObjectContent()); }catch(AmazonS3Exception e) { - logger.error(e.getMessage()); + logger.error("Error occured.", e); } return imageData; } private void deleteObjectAmazonClientExceptionMessage(final AmazonClientException ace) { final String message = "Caught an AmazonClientException." + "Error Message: " + ace.getMessage(); - logger.error(message); + logger.error("{}", message); } private void deleteObjectAmazonServiceExceptionMessage(final AmazonServiceException ase) { final String message = "Caught an AmazonServiceException." + "Error Message: " + ase.getMessage() + "HTTP Status Code: " + ase.getStatusCode() + "AWS Error Code: " + ase.getErrorCode() + "Error Type: " + ase.getErrorType() + "Request ID: " + ase.getRequestId(); - logger.error(message); + logger.error("{}", message); } private String generateFileParentDirectory(final String entityType, final Long entityId) { @@ -173,7 +173,7 @@ private void deleteObjectFromS3(final String location) { private void uploadDocument(final String filename, final InputStream inputStream, final String s3UploadLocation) throws ContentManagementException { try { - logger.info("Uploading a new object to S3 from a file to " + s3UploadLocation); + logger.info("Uploading a new object to S3 from a file to {}", s3UploadLocation); this.s3Client.putObject(new PutObjectRequest(this.s3BucketName, s3UploadLocation, inputStream, new ObjectMetadata())); } catch (final AmazonClientException ace) { final String message = ace.getMessage(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/data/FileData.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/data/FileData.java index 9b06ac6ee4b..e0a6049871b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/data/FileData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/data/FileData.java @@ -61,7 +61,7 @@ public InputStream file() { if (this.inputStream == null) { return new FileInputStream(this.file); } return this.inputStream; } catch (final FileNotFoundException e) { - logger.error(e.toString()); + logger.error("Error occured.", e); return null; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/data/ImageData.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/data/ImageData.java index 85b5daef655..8144b1aca62 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/data/ImageData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/data/ImageData.java @@ -67,7 +67,7 @@ public byte[] getContent() { return IOUtils.toByteArray(fileInputStream); } } catch (IOException e) { - logger.error(e.getMessage()); + logger.error("Error occured.", e); } return null; } @@ -112,7 +112,7 @@ public byte[] getContentOfSize(Integer maxWidth, Integer maxHeight) { out = resizeImage(this.inputStream, maxWidth != null ? maxWidth : Integer.MAX_VALUE, maxHeight != null ? maxHeight : Integer.MAX_VALUE); } catch (IOException e) { - logger.error(e.getMessage()); + logger.error("Error occured.", e); } } else if (this.storageType.equals(StorageType.FILE_SYSTEM.getValue()) && this.file != null) { FileInputStream fis = null; @@ -120,13 +120,13 @@ public byte[] getContentOfSize(Integer maxWidth, Integer maxHeight) { fis = new FileInputStream(this.file); out = resizeImage(fis, maxWidth != null ? maxWidth : Integer.MAX_VALUE, maxHeight != null ? maxHeight : Integer.MAX_VALUE); } catch (IOException ex) { - logger.error(ex.getMessage()); + logger.error("Error occured.", ex); } finally { if (fis != null) { try { fis.close(); } catch (IOException ex) { - logger.error(ex.getMessage()); + logger.error("Error occured.", ex); } } } @@ -181,7 +181,7 @@ public boolean available() { try { available = this.inputStream.available(); } catch (IOException e) { - logger.error(e.getMessage()); + logger.error("Error occured.", e); } } else if (this.storageType.equals(StorageType.FILE_SYSTEM.getValue()) && this.file != null) { FileInputStream fileInputStream = null; @@ -190,9 +190,9 @@ public boolean available() { available = fileInputStream.available(); fileInputStream.close(); } catch (FileNotFoundException e) { - logger.error(e.getMessage()); + logger.error("Error occured.", e); } catch (IOException e) { - logger.error(e.getMessage()); + logger.error("Error occured.", e); } finally { if (fileInputStream != null) { try { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/service/DocumentWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/service/DocumentWritePlatformServiceJpaRepositoryImpl.java index 320996d9a2c..f9a13098e3c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/service/DocumentWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/service/DocumentWritePlatformServiceJpaRepositoryImpl.java @@ -80,7 +80,7 @@ public Long createDocument(final DocumentCommand documentCommand, final InputStr return document.getId(); } catch (final DataIntegrityViolationException dve) { - logger.error(dve.getMessage(), dve); + logger.error("Error occured.", dve); throw new PlatformDataIntegrityException("error.msg.document.unknown.data.integrity.issue", "Unknown data integrity issue with resource."); } @@ -136,11 +136,11 @@ public CommandProcessingResult updateDocument(final DocumentCommand documentComm return new CommandProcessingResult(documentForUpdate.getId()); } catch (final DataIntegrityViolationException dve) { - logger.error(dve.getMessage(), dve); + logger.error("Error occured.", dve); throw new PlatformDataIntegrityException("error.msg.document.unknown.data.integrity.issue", "Unknown data integrity issue with resource."); } catch (final ContentManagementException cme) { - logger.error(cme.getMessage(), cme); + logger.error("Error occured.", cme); throw new ContentManagementException(documentCommand.getName(), cme.getMessage()); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/service/FineractEntityAccessReadServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/service/FineractEntityAccessReadServiceImpl.java index 3eb0614daae..44127541739 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/service/FineractEntityAccessReadServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/service/FineractEntityAccessReadServiceImpl.java @@ -23,7 +23,6 @@ import java.util.Collection; import java.util.Date; import org.apache.fineract.infrastructure.core.service.RoutingDataSource; -import org.apache.fineract.infrastructure.dataqueries.service.GenericDataServiceImpl; import org.apache.fineract.infrastructure.entityaccess.data.FineractEntityAccessData; import org.apache.fineract.infrastructure.entityaccess.data.FineractEntityRelationData; import org.apache.fineract.infrastructure.entityaccess.data.FineractEntityToEntityMappingData; @@ -47,7 +46,7 @@ public class FineractEntityAccessReadServiceImpl implements FineractEntityAccess private final PlatformSecurityContext context; private final JdbcTemplate jdbcTemplate; - private final static Logger logger = LoggerFactory.getLogger(GenericDataServiceImpl.class); + private final static Logger logger = LoggerFactory.getLogger(FineractEntityAccessReadServiceImpl.class); private final FineractEntityRelationRepositoryWrapper fineractEntityRelationRepository; @Autowired @@ -107,7 +106,7 @@ public String getSQLQueryInClause_WithListOfIDsForEntityAccess( FineractEntityTy if (accessListCSVStrBuf != null) { returnIdListStr = accessListCSVStrBuf.toString(); } - logger.debug("List of IDs applicable:" + returnIdListStr); + logger.debug("List of IDs applicable: {}", returnIdListStr); return returnIdListStr; } @@ -144,7 +143,7 @@ private String getSQLForRetriveEntityAccessFor() { str.append("from m_entity_to_entity_mapping eem "); str.append("where eem.rel_id = ? "); str.append("and eem.from_id = ? "); - logger.debug(str.toString()); + logger.debug("{}", str); return str.toString(); } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/service/FineractEntityAccessWriteServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/service/FineractEntityAccessWriteServiceImpl.java index 02847688b8e..7e6dfefdc05 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/service/FineractEntityAccessWriteServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/service/FineractEntityAccessWriteServiceImpl.java @@ -178,7 +178,7 @@ private void handleDataIntegrityIssues(final JsonCommand command, final Throwabl } private void logAsErrorUnexpectedDataIntegrityException(final Exception dve) { - logger.error(dve.getMessage(), dve); + logger.error("Error occured.", dve); } /* diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/hooks/processor/ProcessorHelper.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/hooks/processor/ProcessorHelper.java index 4adf96becea..c6688fc1286 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/hooks/processor/ProcessorHelper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/hooks/processor/ProcessorHelper.java @@ -95,13 +95,12 @@ public static Callback createCallback(final String url) { return new Callback() { @Override public void success(final Object o, final Response response) { - logger.info("URL : " + url + "\tStatus : " - + response.getStatus()); + logger.info("URL: {}\tStatus: {}", url, response.getStatus()); } @Override public void failure(final RetrofitError retrofitError) { - logger.info(retrofitError.getMessage()); + logger.info("Error occured.", retrofitError); } }; } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/JobRegisterServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/JobRegisterServiceImpl.java index cb7bcacacfc..be9a6844c07 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/JobRegisterServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/JobRegisterServiceImpl.java @@ -164,7 +164,7 @@ public void executeJob(final ScheduledJobDetail scheduledJobDetail, String trigg } catch (final Exception e) { final String msg = "Job execution failed for job with id:" + scheduledJobDetail.getId(); - logger.error(msg, e); + logger.error("{}", msg, e); throw new PlatformInternalServerException("error.msg.sheduler.job.execution.failed", msg, scheduledJobDetail.getId()); } @@ -223,7 +223,7 @@ public void startScheduler() { } } } catch (final SchedulerException e) { - logger.error(e.getMessage(), e); + logger.error("Error occured.", e); } } jobDetail.updateTriggerMisfired(false); @@ -281,7 +281,7 @@ private void scheduleJob(final ScheduledJobDetail scheduledJobDetails) { scheduledJobDetails.updateNextRunTime(null); final String stackTrace = getStackTraceAsString(throwable); scheduledJobDetails.updateErrorLog(stackTrace); - logger.error("Could not schedule job: " + scheduledJobDetails.getJobName(), throwable); + logger.error("Could not schedule job: {}", scheduledJobDetails.getJobName(), throwable); } scheduledJobDetails.updateCurrentlyRunningStatus(false); } @@ -292,7 +292,7 @@ public void stopAllSchedulers() { try { scheduler.shutdown(); } catch (final SchedulerException e) { - logger.error(e.getMessage(), e); + logger.error("Error occured.", e); } } } @@ -317,7 +317,7 @@ public void stopScheduler(final String name) { try { scheduler.shutdown(); } catch (final SchedulerException e) { - logger.error(e.getMessage(), e); + logger.error("Error occured.", e); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/SchedulerTriggerListener.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/SchedulerTriggerListener.java index f6dc792f33e..c27adab186f 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/SchedulerTriggerListener.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/SchedulerTriggerListener.java @@ -82,7 +82,7 @@ public boolean vetoJobExecution(final Trigger trigger, final JobExecutionContext proceedJob = this.schedularService.processJobDetailForExecution(jobKey, triggerType); numberOfRetries = maxNumberOfRetries + 1; } catch (Exception exception) { //Adding generic exception as it depends on JPA provider - logger.debug("Not able to acquire the lock to update job running status for JobKey: " + jobKey); + logger.debug("Not able to acquire the lock to update job running status for JobKey: {}", jobKey); try { Random random = new Random(); int randomNum = random.nextInt(maxIntervalBetweenRetries + 1); diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/report/provider/ReportingProcessServiceProvider.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/report/provider/ReportingProcessServiceProvider.java index 6d90321c393..f151db9b400 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/report/provider/ReportingProcessServiceProvider.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/report/provider/ReportingProcessServiceProvider.java @@ -70,12 +70,12 @@ private void initializeRegistry() { final String[] reportServiceBeans = this.applicationContext.getBeanNamesForAnnotation(ReportService.class); if (ArrayUtils.isNotEmpty(reportServiceBeans)) { for (final String reportName : reportServiceBeans) { - LOGGER.info("Register report service '" + reportName + "' ..."); + LOGGER.info("Register report service '{}' ...", reportName); final ReportService service = this.applicationContext.findAnnotationOnBean(reportName, ReportService.class); try { this.reportingProcessServices.put(service.type(), reportName); } catch (final Throwable th) { - LOGGER.error("Unable to register reporting service '" + reportName + "'!", th); + LOGGER.error("Unable to register reporting service '{}'!", reportName, th); } } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/service/ReportMailingJobWritePlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/service/ReportMailingJobWritePlatformServiceImpl.java index f4ae33e4f60..daa9363a412 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/service/ReportMailingJobWritePlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/service/ReportMailingJobWritePlatformServiceImpl.java @@ -399,7 +399,7 @@ private void handleDataIntegrityIssues(final JsonCommand jsonCommand, final Data ReportMailingJobConstants.NAME_PARAM_NAME, name); } - logger.error(dve.getMessage(), dve); + logger.error("Error occured.", dve); throw new PlatformDataIntegrityException("error.msg.charge.unknown.data.integrity.issue", "Unknown data integrity issue with resource: " + realCause.getMessage()); diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/filter/TenantAwareBasicAuthenticationFilter.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/filter/TenantAwareBasicAuthenticationFilter.java index c5dc2d0692f..44fc9a00ee7 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/filter/TenantAwareBasicAuthenticationFilter.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/filter/TenantAwareBasicAuthenticationFilter.java @@ -152,7 +152,7 @@ protected void doFilterInternal(HttpServletRequest request, HttpServletResponse } finally { task.stop(); final PlatformRequestLog log = PlatformRequestLog.from(task, request); - logger.debug(this.toApiJsonSerializer.serialize(log)); + logger.debug("{}", this.toApiJsonSerializer.serialize(log)); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/filter/TenantAwareTenantIdentifierFilter.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/filter/TenantAwareTenantIdentifierFilter.java index 971cd7c2620..0c66cf4c58c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/filter/TenantAwareTenantIdentifierFilter.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/filter/TenantAwareTenantIdentifierFilter.java @@ -152,7 +152,7 @@ public void doFilter(final ServletRequest req, final ServletResponse res, final } finally { task.stop(); final PlatformRequestLog log = PlatformRequestLog.from(task, request); - logger.info(this.toApiJsonSerializer.serialize(log)); + logger.info("{}", this.toApiJsonSerializer.serialize(log)); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/service/CustomAuthenticationFailureHandler.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/service/CustomAuthenticationFailureHandler.java index 8f1111580b1..24641809fce 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/service/CustomAuthenticationFailureHandler.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/service/CustomAuthenticationFailureHandler.java @@ -63,11 +63,11 @@ public void onAuthenticationFailure(final HttpServletRequest request, final Http saveException(request, exception); if (this.forwardToDestination) { - this.logger.debug("Forwarding to " + this.defaultFailureUrl); + this.logger.debug("Forwarding to {}", this.defaultFailureUrl); request.getRequestDispatcher(this.defaultFailureUrl).forward(request, response); } else { - this.logger.debug("Redirecting to " + this.defaultFailureUrl); + this.logger.debug("Redirecting to {}", this.defaultFailureUrl); final String oauthToken = request.getParameter("oauth_token"); request.setAttribute("oauth_token", oauthToken); diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/sms/scheduler/SmsMessageScheduledJobServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/sms/scheduler/SmsMessageScheduledJobServiceImpl.java index 5109f71c962..75807eb02bf 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/sms/scheduler/SmsMessageScheduledJobServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/sms/scheduler/SmsMessageScheduledJobServiceImpl.java @@ -181,7 +181,7 @@ private void connectAndSendToIntermediateServer(Collection> smsDa } } } catch (Exception e) { - logger.error(e.getMessage(), e); + logger.error("Error occured.", e); } } @@ -242,11 +242,11 @@ public void sendTriggeredMessage(Collection smsMessages, long provid } this.smsMessageRepository.saveAll(smsMessages); request.append(SmsMessageApiQueueResourceData.toJsonString(apiQueueResourceDatas)); - logger.info("Sending triggered SMS to specific provider with request - " + request.toString()); + logger.info("Sending triggered SMS to specific provider with request - {}", request); this.triggeredExecutorService.execute(new SmsTask(ThreadLocalContextUtil.getTenant(), apiQueueResourceDatas)); } catch (Exception e) { - logger.error(e.getMessage(), e); + logger.error("Error occured.", e); } } @@ -320,20 +320,19 @@ public void getDeliveryReports() { this.smsMessageRepository.save(smsMessage); if (statusChanged) { - logger.info("Status of SMS message id: " + smsMessage.getId() + " successfully changed to " + statusType); + logger.info("Status of SMS message id: {} successfully changed to {}", smsMessage.getId(), statusType); } } } if (smsMessageDeliveryReportDatas.size() > 0) { - logger.info(smsMessageDeliveryReportDatas.size() + " " - + "delivery report(s) successfully received from the intermediate gateway - sms"); + logger.info("{} delivery report(s) successfully received from the intermediate gateway - sms", smsMessageDeliveryReportDatas.size()); } } } catch (Exception e) { - logger.error(e.getMessage(), e); + logger.error("Error occured.", e); } page ++; totalRecords = smsMessageInternalIds.getTotalFilteredRecords(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/sms/service/SmsWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/sms/service/SmsWritePlatformServiceJpaRepositoryImpl.java index b888ceb5b76..6f5a25b20a2 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/sms/service/SmsWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/sms/service/SmsWritePlatformServiceJpaRepositoryImpl.java @@ -126,7 +126,7 @@ private void handleDataIntegrityIssues(@SuppressWarnings("unused") final JsonCom if (realCause.getMessage().contains("mobile_no")) { throw new PlatformDataIntegrityException("error.msg.sms.no.mobile.no.exists", "The group, client or staff provided has no mobile no.", "id"); } - logger.error(dve.getMessage(), dve); + logger.error("Error occured.", dve); throw new PlatformDataIntegrityException("error.msg.sms.unknown.data.integrity.issue", "Unknown data integrity issue with resource: " + realCause.getMessage()); } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/survey/service/WriteLikelihoodServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/survey/service/WriteLikelihoodServiceImpl.java index 9accc71de47..a4a9596bbbc 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/survey/service/WriteLikelihoodServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/survey/service/WriteLikelihoodServiceImpl.java @@ -39,7 +39,7 @@ @Service public class WriteLikelihoodServiceImpl implements WriteLikelihoodService { - private final static Logger logger = LoggerFactory.getLogger(PovertyLineService.class); + private final static Logger logger = LoggerFactory.getLogger(WriteLikelihoodServiceImpl.class); private final PlatformSecurityContext context; private final LikelihoodDataValidator likelihoodDataValidator; private final LikelihoodRepository repository; @@ -95,7 +95,7 @@ public CommandProcessingResult update(Long likelihoodId, JsonCommand command) { private void handleDataIntegrityIssues(final DataIntegrityViolationException dve) { final Throwable realCause = dve.getMostSpecificCause(); - logger.error(dve.getMessage(), dve); + logger.error("Error occured.", dve); throw new PlatformDataIntegrityException("error.msg.likelihood.unknown.data.integrity.issue", "Unknown data integrity issue with resource: " + realCause.getMessage()); } diff --git a/fineract-provider/src/main/java/org/apache/fineract/notification/config/MessagingConfiguration.java b/fineract-provider/src/main/java/org/apache/fineract/notification/config/MessagingConfiguration.java index 1a872bd073e..f1f7137bf50 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/notification/config/MessagingConfiguration.java +++ b/fineract-provider/src/main/java/org/apache/fineract/notification/config/MessagingConfiguration.java @@ -21,7 +21,6 @@ import javax.jms.ExceptionListener; import javax.jms.JMSException; import org.apache.activemq.ActiveMQConnectionFactory; -import org.apache.fineract.infrastructure.core.boot.db.TenantDataSourcePortFixService; import org.apache.fineract.notification.eventandlistener.NotificationEventListener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -43,7 +42,7 @@ public class MessagingConfiguration { private NotificationEventListener notificationEventListener; @Bean - public Logger loggerBean() { return LoggerFactory.getLogger(TenantDataSourcePortFixService.class); } + public Logger loggerBean() { return LoggerFactory.getLogger(MessagingConfiguration.class); } private static final String DEFAULT_BROKER_URL = "tcp://localhost:61616"; diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/holiday/service/HolidayWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/holiday/service/HolidayWritePlatformServiceJpaRepositoryImpl.java index b7818b8b53e..0e9d2a709ec 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/holiday/service/HolidayWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/holiday/service/HolidayWritePlatformServiceJpaRepositoryImpl.java @@ -183,7 +183,7 @@ private void handleDataIntegrityIssues(final JsonCommand command, final Throwabl "name", name); } - logger.error(dve.getMessage(), dve); + logger.error("Error occured.", dve); throw new PlatformDataIntegrityException("error.msg.office.unknown.data.integrity.issue", "Unknown data integrity issue with resource."); } diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/office/service/OfficeWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/office/service/OfficeWritePlatformServiceJpaRepositoryImpl.java index eb7b0128370..cdcca853649 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/office/service/OfficeWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/office/service/OfficeWritePlatformServiceJpaRepositoryImpl.java @@ -239,7 +239,7 @@ private void handleOfficeDataIntegrityIssues(final JsonCommand command, final Th "name", name); } - logger.error(dve.getMessage(), dve); + logger.error("Error occured.", dve); throw new PlatformDataIntegrityException("error.msg.office.unknown.data.integrity.issue", "Unknown data integrity issue with resource."); } diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/service/ProvisioningCategoryWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/service/ProvisioningCategoryWritePlatformServiceJpaRepositoryImpl.java index ec3843207fd..8b4b0cbc438 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/service/ProvisioningCategoryWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/service/ProvisioningCategoryWritePlatformServiceJpaRepositoryImpl.java @@ -31,7 +31,6 @@ import org.apache.fineract.organisation.provisioning.exception.ProvisioningCategoryCannotBeDeletedException; import org.apache.fineract.organisation.provisioning.exception.ProvisioningCategoryNotFoundException; import org.apache.fineract.organisation.provisioning.serialization.ProvisioningCategoryDefinitionJsonDeserializer; -import org.apache.fineract.portfolio.charge.service.ChargeWritePlatformServiceJpaRepositoryImpl; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -42,7 +41,7 @@ @Service public class ProvisioningCategoryWritePlatformServiceJpaRepositoryImpl implements ProvisioningCategoryWritePlatformService { - private final static Logger logger = LoggerFactory.getLogger(ChargeWritePlatformServiceJpaRepositoryImpl.class); + private final static Logger logger = LoggerFactory.getLogger(ProvisioningCategoryWritePlatformServiceJpaRepositoryImpl.class); private final ProvisioningCategoryRepository provisioningCategoryRepository; @@ -126,7 +125,7 @@ private void handleDataIntegrityIssues(final JsonCommand command, final Throwabl throw new PlatformDataIntegrityException("error.msg.provisioning.duplicate.categoryname", "Provisioning Cateory with name `" + name + "` already exists", "category name", name); } - logger.error(dve.getMessage(), dve); + logger.error("Error occured.", dve); throw new PlatformDataIntegrityException("error.msg.charge.unknown.data.integrity.issue", "Unknown data integrity issue with resource: " + realCause.getMessage()); } diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/service/ProvisioningCriteriaWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/service/ProvisioningCriteriaWritePlatformServiceJpaRepositoryImpl.java index cae247d66ab..67debc5920f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/service/ProvisioningCriteriaWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/service/ProvisioningCriteriaWritePlatformServiceJpaRepositoryImpl.java @@ -169,7 +169,7 @@ private void handleDataIntegrityIssues(final JsonCommand command, final Throwabl "error.msg.provisioning.product.id(s).already.associated.existing.criteria", "The selected products already associated with another Provisioning Criteria"); } - logger.error(dve.getMessage(), dve); + logger.error("Error occured.", dve); throw new PlatformDataIntegrityException("error.msg.provisioning.unknown.data.integrity.issue", "Unknown data integrity issue with resource: " + realCause.getMessage()); } diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/staff/service/StaffWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/staff/service/StaffWritePlatformServiceJpaRepositoryImpl.java index 9c2c7efb821..fa9d6368af4 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/staff/service/StaffWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/staff/service/StaffWritePlatformServiceJpaRepositoryImpl.java @@ -139,7 +139,7 @@ private void handleStaffDataIntegrityIssues(final JsonCommand command, final Thr + displayName + "' already exists", "displayName", displayName); } - logger.error(dve.getMessage(), dve); + logger.error("Error occured.", dve); throw new PlatformDataIntegrityException("error.msg.staff.unknown.data.integrity.issue", "Unknown data integrity issue with resource: " + realCause.getMessage()); } diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/service/TellerWritePlatformServiceJpaImpl.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/service/TellerWritePlatformServiceJpaImpl.java index a7b205e5ddc..1fb005b9f46 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/service/TellerWritePlatformServiceJpaImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/service/TellerWritePlatformServiceJpaImpl.java @@ -211,7 +211,7 @@ private void handleTellerDataIntegrityIssues(final JsonCommand command, final Th "name", name); } - logger.error(dve.getMessage(), dve); + logger.error("Error occured.", dve); throw new PlatformDataIntegrityException("error.msg.teller.unknown.data.integrity.issue", "Unknown data integrity issue with resource."); } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/service/StandingInstructionWritePlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/service/StandingInstructionWritePlatformServiceImpl.java index dac87a23ef4..02fcd9a75e5 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/service/StandingInstructionWritePlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/service/StandingInstructionWritePlatformServiceImpl.java @@ -144,7 +144,7 @@ private void handleDataIntegrityIssues(final JsonCommand command, final DataInte throw new PlatformDataIntegrityException("error.msg.standinginstruction.duplicate.name", "Standinginstruction with name `" + name + "` already exists", "name", name); } - logger.error(dve.getMessage(), dve); + logger.error("Error occured.", dve); throw new PlatformDataIntegrityException("error.msg.client.unknown.data.integrity.issue", "Unknown data integrity issue with resource."); } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/service/ChargeWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/service/ChargeWritePlatformServiceJpaRepositoryImpl.java index 37ca0b4993d..6df93003486 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/service/ChargeWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/service/ChargeWritePlatformServiceJpaRepositoryImpl.java @@ -233,7 +233,7 @@ private void handleDataIntegrityIssues(final JsonCommand command, final Throwabl "name", name); } - logger.error(dve.getMessage(), dve); + logger.error("Error occured.", dve); throw new PlatformDataIntegrityException("error.msg.charge.unknown.data.integrity.issue", "Unknown data integrity issue with resource: " + realCause.getMessage()); } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientChargeWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientChargeWritePlatformServiceJpaRepositoryImpl.java index 97850bdf186..8a01ded1ee4 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientChargeWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientChargeWritePlatformServiceJpaRepositoryImpl.java @@ -438,7 +438,7 @@ private void handleDataIntegrityIssues(@SuppressWarnings("unused") final Long cl "Client charge with id `" + clientChargeId + "` cannot be deleted as transactions have been made on the same", "clientChargeId", clientChargeId); } - logger.error(dve.getMessage(), dve); + logger.error("Error occured.", dve); throw new PlatformDataIntegrityException("error.msg.client.charges.unknown.data.integrity.issue", "Unknown data integrity issue with resource."); } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientIdentifierWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientIdentifierWritePlatformServiceJpaRepositoryImpl.java index bcac38f846b..ad15ed496e7 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientIdentifierWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientIdentifierWritePlatformServiceJpaRepositoryImpl.java @@ -200,6 +200,6 @@ private void handleClientIdentifierDataIntegrityViolation(final String documentT } private void logAsErrorUnexpectedDataIntegrityException(final Exception dve) { - logger.error(dve.getMessage(), dve); + logger.error("Error occured.", dve); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientWritePlatformServiceJpaRepositoryImpl.java index f94d3468054..db75e7d7ee8 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientWritePlatformServiceJpaRepositoryImpl.java @@ -182,7 +182,7 @@ public CommandProcessingResult deleteClient(final Long clientId) { .build(); } catch (DataIntegrityViolationException dve) { Throwable throwable = ExceptionUtils.getRootCause(dve.getCause()) ; - logger.error(throwable.getMessage()); + logger.error("Error occured.", throwable); throw new PlatformDataIntegrityException("error.msg.client.unknown.data.integrity.issue", "Unknown data integrity issue with resource."); } @@ -615,7 +615,7 @@ private CommandProcessingResult openSavingsAccount(final Client client, final Da } private void logAsErrorUnexpectedDataIntegrityException(final Exception dve) { - logger.error(dve.getMessage(), dve); + logger.error("Error occured.", dve); } @Transactional diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/service/CollateralWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/service/CollateralWritePlatformServiceJpaRepositoryImpl.java index c14bdb3a643..cffb18bba3c 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/service/CollateralWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/service/CollateralWritePlatformServiceJpaRepositoryImpl.java @@ -177,7 +177,7 @@ private void handleCollateralDataIntegrityViolation(final DataIntegrityViolation } private void logAsErrorUnexpectedDataIntegrityException(final DataIntegrityViolationException dve) { - logger.error(dve.getMessage(), dve); + logger.error("Error occured.", dve); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/floatingrates/service/FloatingRateWritePlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/floatingrates/service/FloatingRateWritePlatformServiceImpl.java index 25632e1f243..8cfe8dbb97f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/floatingrates/service/FloatingRateWritePlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/floatingrates/service/FloatingRateWritePlatformServiceImpl.java @@ -138,7 +138,7 @@ private void handleDataIntegrityIssues(final JsonCommand command, final Throwabl private void logAsErrorUnexpectedDataIntegrityException( Exception dve) { - logger.error(dve.getMessage(), dve); + logger.error("Error occured.", dve); } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/fund/service/FundWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/fund/service/FundWritePlatformServiceJpaRepositoryImpl.java index 5a733494b3a..545015e528f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/fund/service/FundWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/fund/service/FundWritePlatformServiceJpaRepositoryImpl.java @@ -124,7 +124,7 @@ private void handleFundDataIntegrityIssues(final JsonCommand command, final Thr "name", name); } - logger.error(dve.getMessage(), dve); + logger.error("Error occured.", dve); throw new PlatformDataIntegrityException("error.msg.fund.unknown.data.integrity.issue", "Unknown data integrity issue with resource: " + realCause.getMessage()); } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/service/GroupRolesWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/service/GroupRolesWritePlatformServiceJpaRepositoryImpl.java index a496984d350..beddf449823 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/service/GroupRolesWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/service/GroupRolesWritePlatformServiceJpaRepositoryImpl.java @@ -106,7 +106,7 @@ private void handleGroupDataIntegrityIssues(final JsonCommand command, final Dat GroupingTypesApiConstants.clientIdParamName, roleId, clientId, command.getGroupId()); } - logger.error(dve.getMessage(), dve); + logger.error("Error occured.", dve); throw new PlatformDataIntegrityException("error.msg.group.unknown.data.integrity.issue", "Unknown data integrity issue with resource."); } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/service/GroupingTypesWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/service/GroupingTypesWritePlatformServiceJpaRepositoryImpl.java index cf43fa6c0a5..cfa6e389c9c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/service/GroupingTypesWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/service/GroupingTypesWritePlatformServiceJpaRepositoryImpl.java @@ -603,7 +603,7 @@ public CommandProcessingResult deleteGroup(final Long groupId) { .build(); } catch (DataIntegrityViolationException dve) { Throwable throwable = ExceptionUtils.getRootCause(dve.getCause()); - logger.error(throwable.getMessage()); + logger.error("Error occured.", throwable); throw new PlatformDataIntegrityException("error.msg.group.unknown.data.integrity.issue", "Unknown data integrity issue with resource."); } @@ -798,7 +798,7 @@ private void handleGroupDataIntegrityIssues(final JsonCommand command, final Thr name); } - logger.error(dve.getMessage(), dve); + logger.error("Error occured.", dve); throw new PlatformDataIntegrityException("error.msg.group.unknown.data.integrity.issue", "Unknown data integrity issue with resource."); } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/guarantor/service/GuarantorWritePlatformServiceJpaRepositoryIImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/guarantor/service/GuarantorWritePlatformServiceJpaRepositoryIImpl.java index 6d028cededc..757ab11eee0 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/guarantor/service/GuarantorWritePlatformServiceJpaRepositoryIImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/guarantor/service/GuarantorWritePlatformServiceJpaRepositoryIImpl.java @@ -334,7 +334,7 @@ private void validateLoanStatus(Loan loan) { private void handleGuarantorDataIntegrityIssues(final DataIntegrityViolationException dve) { final Throwable realCause = dve.getMostSpecificCause(); - logger.error(dve.getMessage(), dve); + logger.error("Error occured.", dve); throw new PlatformDataIntegrityException("error.msg.guarantor.unknown.data.integrity.issue", "Unknown data integrity issue with resource Guarantor: " + realCause.getMessage()); } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/service/LoanRescheduleRequestWritePlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/service/LoanRescheduleRequestWritePlatformServiceImpl.java index babe08559ae..dd70facb1e1 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/service/LoanRescheduleRequestWritePlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/service/LoanRescheduleRequestWritePlatformServiceImpl.java @@ -586,7 +586,7 @@ public CommandProcessingResult reject(JsonCommand jsonCommand) { **/ private void handleDataIntegrityViolation(final DataIntegrityViolationException dve) { - logger.error(dve.getMessage(), dve); + logger.error("Error occured.", dve); throw new PlatformDataIntegrityException("error.msg.loan.reschedule.unknown.data.integrity.issue", "Unknown data integrity issue with resource."); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanApplicationWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanApplicationWritePlatformServiceJpaRepositoryImpl.java index c32ef448f28..b068558c4a9 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanApplicationWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanApplicationWritePlatformServiceJpaRepositoryImpl.java @@ -1079,7 +1079,7 @@ private void handleDataIntegrityIssues(final JsonCommand command, final Throwabl } private void logAsErrorUnexpectedDataIntegrityException(final Exception dve) { - logger.error(dve.getMessage(), dve); + logger.error("Error occured.", dve); } @Transactional diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanArrearsAgingServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanArrearsAgingServiceImpl.java index 82c3b2a2504..edf91a84962 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanArrearsAgingServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanArrearsAgingServiceImpl.java @@ -41,7 +41,6 @@ import org.apache.fineract.portfolio.loanaccount.domain.LoanSummary; import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction; import org.apache.fineract.portfolio.loanaccount.loanschedule.data.LoanSchedulePeriodData; -import org.apache.fineract.scheduledjobs.service.ScheduledJobRunnerServiceImpl; import org.joda.time.LocalDate; import org.joda.time.format.DateTimeFormat; import org.joda.time.format.DateTimeFormatter; @@ -57,7 +56,7 @@ @Service public class LoanArrearsAgingServiceImpl implements LoanArrearsAgingService, BusinessEventListner { - private final static Logger logger = LoggerFactory.getLogger(ScheduledJobRunnerServiceImpl.class); + private final static Logger logger = LoggerFactory.getLogger(LoanArrearsAgingServiceImpl.class); private final BusinessEventNotifierService businessEventNotifierService; private final DateTimeFormatter formatter = DateTimeFormat.forPattern("yyyy-MM-dd"); private final JdbcTemplate jdbcTemplate; @@ -126,7 +125,7 @@ public void updateLoanArrearsAgeingDetails() { result += i; } - logger.info(ThreadLocalContextUtil.getTenant().getName() + ": Results affected by update: " + result); + logger.info("{}: Results affected by update: {}", ThreadLocalContextUtil.getTenant().getName(), result); } @Override diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanSchedularServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanSchedularServiceImpl.java index b8d36f61965..b785700f548 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanSchedularServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanSchedularServiceImpl.java @@ -206,7 +206,7 @@ private void recalculateInterest(OfficeData office, int threadPoolSize, int batc // gets the loanIds data set iteratively and call addAccuruals for that paginated dataset do { int totalFilteredRecords = loanIds.size(); - logger.info("Starting accrual - total filtered records - " + totalFilteredRecords); + logger.info("Starting accrual - total filtered records - {}", totalFilteredRecords); recalculateInterest(loanIds, threadPoolSize, batchSize, executorService); maxLoanIdInList+= pageSize+1; loanIds = Collections.synchronizedList(this.loanReadPlatformService diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/RecalculateInterestPoster.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/RecalculateInterestPoster.java index b084c6060a2..93f6d9819dc 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/RecalculateInterestPoster.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/RecalculateInterestPoster.java @@ -58,7 +58,7 @@ public Void call() throws JobExecutionException { if (!loanIds.isEmpty()) { int errors = 0; for (Long loanId : loanIds) { - logger.info("Loan ID " + loanId); + logger.info("Loan ID {}", loanId); Integer numberOfRetries = 0; while (numberOfRetries <= maxNumberOfRetries) { try { @@ -66,7 +66,7 @@ public Void call() throws JobExecutionException { numberOfRetries = maxNumberOfRetries + 1; } catch (CannotAcquireLockException | ObjectOptimisticLockingFailureException exception) { - logger.info("Recalulate interest job has been retried time(s)", numberOfRetries); + logger.info("Recalulate interest job has been retried {} time(s)", numberOfRetries); // Fail if the transaction has been retired for maxNumberOfRetries if (numberOfRetries >= maxNumberOfRetries) { logger.error("Recalulate interest job has been retried for the max allowed attempts of {} and will be rolled back", numberOfRetries); @@ -91,7 +91,7 @@ public Void call() throws JobExecutionException { } i++; } - logger.info("Loans count " + i); + logger.info("Loans count {}", i); } if (errors > 0) { throw new JobExecutionException(errors); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/productmix/service/ProductMixWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/productmix/service/ProductMixWritePlatformServiceJpaRepositoryImpl.java index 40ab5362d51..75061803e7b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/productmix/service/ProductMixWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/productmix/service/ProductMixWritePlatformServiceJpaRepositoryImpl.java @@ -194,7 +194,7 @@ private void handleDataIntegrityIssues(final DataIntegrityViolationException dve } private void logAsErrorUnexpectedDataIntegrityException(final DataIntegrityViolationException dve) { - logger.error(dve.getMessage(), dve); + logger.error("Error occured.", dve); } private List updateRestrictedIds(final Set restrictedIds, final List existedProductMixes) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/service/LoanProductWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/service/LoanProductWritePlatformServiceJpaRepositoryImpl.java index 8d924d49e94..c37087b327e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/service/LoanProductWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/service/LoanProductWritePlatformServiceJpaRepositoryImpl.java @@ -341,7 +341,7 @@ private void validateInputDates(final JsonCommand command) { } private void logAsErrorUnexpectedDataIntegrityException(final Exception dve) { - logger.error(dve.getMessage(), dve); + logger.error("Error occured.", dve); } private Map constructEntityMap(final BusinessEventNotificationConstants.BUSINESS_ENTITY entityEvent, Object entity) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/DepositApplicationProcessWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/DepositApplicationProcessWritePlatformServiceJpaRepositoryImpl.java index e1efe315501..44db88020dd 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/DepositApplicationProcessWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/DepositApplicationProcessWritePlatformServiceJpaRepositoryImpl.java @@ -187,7 +187,7 @@ private void handleDataIntegrityIssues(final JsonCommand command, final Throwabl } errorCodeBuilder.append(".unknown.data.integrity.issue"); - logger.error(dve.getMessage(), dve); + logger.error("Error occured.", dve); throw new PlatformDataIntegrityException(errorCodeBuilder.toString(), "Unknown data integrity issue with savings account."); } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/FixedDepositProductWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/FixedDepositProductWritePlatformServiceJpaRepositoryImpl.java index 70eed1e81c5..f3a29b77dfc 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/FixedDepositProductWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/FixedDepositProductWritePlatformServiceJpaRepositoryImpl.java @@ -207,6 +207,6 @@ private void handleDataIntegrityIssues(final JsonCommand command, final Throwabl } private void logAsErrorUnexpectedDataIntegrityException(final Exception dae) { - this.logger.error(dae.getMessage(), dae); + this.logger.error("Error occured.", dae); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/RecurringDepositProductWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/RecurringDepositProductWritePlatformServiceJpaRepositoryImpl.java index 47b6dcd724b..2b406a7eb82 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/RecurringDepositProductWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/RecurringDepositProductWritePlatformServiceJpaRepositoryImpl.java @@ -207,6 +207,6 @@ private void handleDataIntegrityIssues(final JsonCommand command, final Throwabl } private void logAsErrorUnexpectedDataIntegrityException(final Exception dae) { - this.logger.error(dae.getMessage(), dae); + this.logger.error("Error occured.", dae); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsApplicationProcessWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsApplicationProcessWritePlatformServiceJpaRepositoryImpl.java index 3f39dc7caad..b3efece9662 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsApplicationProcessWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsApplicationProcessWritePlatformServiceJpaRepositoryImpl.java @@ -166,7 +166,7 @@ private void handleDataIntegrityIssues(final JsonCommand command, final Throwabl } errorCodeBuilder.append(".unknown.data.integrity.issue"); - logger.error(dve.getMessage(), dve); + logger.error("Error occured.", dve); throw new PlatformDataIntegrityException(errorCodeBuilder.toString(), "Unknown data integrity issue with savings account."); } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsProductWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsProductWritePlatformServiceJpaRepositoryImpl.java index 04d56741ac2..d3a9e697d04 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsProductWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsProductWritePlatformServiceJpaRepositoryImpl.java @@ -105,7 +105,7 @@ private void handleDataIntegrityIssues(final JsonCommand command, final Throwabl } private void logAsErrorUnexpectedDataIntegrityException(final Exception dae) { - this.logger.error(dae.getMessage(), dae); + this.logger.error("Error occured.", dae); } @Transactional diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/account/service/SelfBeneficiariesTPTWritePlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/account/service/SelfBeneficiariesTPTWritePlatformServiceImpl.java index 5561668ca70..741dfc2dab8 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/account/service/SelfBeneficiariesTPTWritePlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/account/service/SelfBeneficiariesTPTWritePlatformServiceImpl.java @@ -200,7 +200,7 @@ private void handleDataIntegrityIssues(final JsonCommand command, NAME_PARAM_NAME, name); } - this.logger.error(dae.getMessage(), dae); + this.logger.error("Error occured.", dae); throw new PlatformDataIntegrityException( "error.msg.beneficiary.unknown.data.integrity.issue", "Unknown data integrity issue with resource."); diff --git a/fineract-provider/src/main/java/org/apache/fineract/scheduledjobs/service/ScheduledJobRunnerServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/scheduledjobs/service/ScheduledJobRunnerServiceImpl.java index 3f9f60d1205..20e3fc66a9b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/scheduledjobs/service/ScheduledJobRunnerServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/scheduledjobs/service/ScheduledJobRunnerServiceImpl.java @@ -173,7 +173,7 @@ public void updateLoanSummaryDetails() { final int result = jdbcTemplate.update(updateSqlBuilder.toString()); - logger.info(ThreadLocalContextUtil.getTenant().getName() + ": Results affected by update: " + result); + logger.info("{}: Results affected by update: {}", ThreadLocalContextUtil.getTenant().getName(), result); } @Transactional @@ -208,7 +208,7 @@ public void updateLoanPaidInAdvance() { final int result = jdbcTemplate.update(updateSqlBuilder.toString()); - logger.info(ThreadLocalContextUtil.getTenant().getName() + ": Results affected by update: " + result); + logger.info("{}: Results affected by update: {}", ThreadLocalContextUtil.getTenant().getName(), result); } @Override @@ -225,15 +225,14 @@ public void applyAnnualFeeForSavings() { } catch (final PlatformApiDataValidationException e) { final List errors = e.getErrors(); for (final ApiParameterError error : errors) { - logger.error("Apply annual fee failed for account:" + savingsAccountReference.getAccountNo() + " with message " - + error.getDeveloperMessage()); + logger.error("Apply annual fee failed for account: {} with message {}", savingsAccountReference.getAccountNo(), error); } } catch (final Exception ex) { // need to handle this scenario } } - logger.info(ThreadLocalContextUtil.getTenant().getName() + ": Savings accounts affected by update: " + annualFeeData.size()); + logger.info("{}: Savings accounts affected by update: {}", ThreadLocalContextUtil.getTenant().getName(), annualFeeData.size()); } @Override @@ -288,7 +287,7 @@ public void updateNPA() { final int result = jdbcTemplate.update(updateSqlBuilder.toString()); - logger.info(ThreadLocalContextUtil.getTenant().getName() + ": Results affected by update: " + result); + logger.info("{} : Results affected by update: {}", ThreadLocalContextUtil.getTenant().getName(), result); } @Override @@ -304,15 +303,14 @@ public void updateMaturityDetailsOfDepositAccounts() { } catch (final PlatformApiDataValidationException e) { final List errors = e.getErrors(); for (final ApiParameterError error : errors) { - logger.error("Update maturity details failed for account:" + depositAccount.accountNo() + " with message " - + error.getDeveloperMessage()); + logger.error("Update maturity details failed for account: {} with message {}", depositAccount.accountNo(), error.getDeveloperMessage()); } } catch (final Exception ex) { // need to handle this scenario } } - logger.info(ThreadLocalContextUtil.getTenant().getName() + ": Deposit accounts affected by update: " + depositAccounts.size()); + logger.info("{}: Deposit accounts affected by update: {}", ThreadLocalContextUtil.getTenant().getName(), depositAccounts.size()); } @Override @@ -392,7 +390,8 @@ public void postDividends() throws JobExecutionException { } catch (final PlatformApiDataValidationException e) { final List errors = e.getErrors(); for (final ApiParameterError error : errors) { - logger.error("Post Dividends to savings failed due to ApiParameterError for Divident detail Id: {} and savings Id: {} with message: ", id, savingsId, error.getDeveloperMessage(), e); + logger.error("Post Dividends to savings failed due to ApiParameterError for Divident detail Id: {} and savings Id: {} with message: {}", + new Object[] { id, savingsId, error.getDeveloperMessage(), e }); ++numberOfErrors; } } catch (final Exception e) { @@ -430,7 +429,7 @@ public void updateTrialBalanceDetails() throws JobExecutionException { .append("group by je.account_id, je.office_id, je.transaction_date, Date(je.entry_date)"); final int result = jdbcTemplate.update(sqlBuilder.toString(), formattedDate); - logger.info(ThreadLocalContextUtil.getTenant().getName() + ": Results affected by update: " + result); + logger.info("{}: Results affected by update: {}", ThreadLocalContextUtil.getTenant().getName(), result); } // Updating closing balance diff --git a/fineract-provider/src/main/java/org/apache/fineract/useradministration/domain/AppUser.java b/fineract-provider/src/main/java/org/apache/fineract/useradministration/domain/AppUser.java index 5d5c3af585c..9d864b25b70 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/useradministration/domain/AppUser.java +++ b/fineract-provider/src/main/java/org/apache/fineract/useradministration/domain/AppUser.java @@ -575,7 +575,7 @@ public void validateHasPermissionTo(final String function, final List al public void validateHasPermissionTo(final String function) { if (hasNotPermissionTo(function)) { final String authorizationMessage = "User has no authority to: " + function; - logger.info("Unauthorized access: userId: " + getId() + " action: " + function + " allowed: " + getAuthorities()); + logger.info("Unauthorized access: userId: {} action: {} allowed: {}", new Object[] { getId(), function, getAuthorities() }); throw new NoAuthorizationException(authorizationMessage); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/useradministration/service/AppUserWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/useradministration/service/AppUserWritePlatformServiceJpaRepositoryImpl.java index d6a0ef7c498..3a93e831665 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/useradministration/service/AppUserWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/useradministration/service/AppUserWritePlatformServiceJpaRepositoryImpl.java @@ -351,7 +351,7 @@ private void handleDataIntegrityIssues(final JsonCommand command, final Throwabl throw new PlatformDataIntegrityException("error.msg.user.self.service.user.already.exist", "Self Service User Id is already created. Go to Admin->Users to edit or delete the self-service user."); } - logger.error(dve.getMessage(), dve); + logger.error("Error occured.", dve); throw new PlatformDataIntegrityException("error.msg.unknown.data.integrity.issue", "Unknown data integrity issue with resource."); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/useradministration/service/PasswordPreferencesWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/useradministration/service/PasswordPreferencesWritePlatformServiceJpaRepositoryImpl.java index 584c250ce2f..f388e6fd67d 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/useradministration/service/PasswordPreferencesWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/useradministration/service/PasswordPreferencesWritePlatformServiceJpaRepositoryImpl.java @@ -88,7 +88,7 @@ public CommandProcessingResult updatePreferences(final JsonCommand command) { .with(changes) // .build(); } catch (final DataIntegrityViolationException dve) { - logger.error(dve.getMessage(), dve); + logger.error("Error occured.", dve); throw new PlatformDataIntegrityException("error.msg.password.validation.policy.unknown.data.integrity.issue", "Unknown data integrity issue with resource."); } diff --git a/fineract-provider/src/main/java/org/apache/fineract/useradministration/service/PermissionReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/useradministration/service/PermissionReadPlatformServiceImpl.java index 6d60e68f29f..e0510e90bfd 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/useradministration/service/PermissionReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/useradministration/service/PermissionReadPlatformServiceImpl.java @@ -34,7 +34,7 @@ @Service public class PermissionReadPlatformServiceImpl implements PermissionReadPlatformService { - private final static Logger logger = LoggerFactory.getLogger(PermissionReadPlatformService.class); + private final static Logger logger = LoggerFactory.getLogger(PermissionReadPlatformServiceImpl.class); private final JdbcTemplate jdbcTemplate; private final PlatformSecurityContext context; @@ -52,7 +52,7 @@ public Collection retrieveAllPermissions() { final PermissionUsageDataMapper mapper = new PermissionUsageDataMapper(); final String sql = mapper.permissionSchema(); - logger.info("retrieveAllPermissions: " + sql); + logger.info("retrieveAllPermissions: {}", sql); return this.jdbcTemplate.query(sql, mapper, new Object[] {}); } @@ -63,7 +63,7 @@ public Collection retrieveAllMakerCheckerablePermissions() { final PermissionUsageDataMapper mapper = new PermissionUsageDataMapper(); final String sql = mapper.makerCheckerablePermissionSchema(); - logger.info("retrieveAllMakerCheckerablePermissions: " + sql); + logger.info("retrieveAllMakerCheckerablePermissions: {}", sql); return this.jdbcTemplate.query(sql, mapper, new Object[] {}); } @@ -73,7 +73,7 @@ public Collection retrieveAllRolePermissions(final Long roleId) final PermissionUsageDataMapper mapper = new PermissionUsageDataMapper(); final String sql = mapper.rolePermissionSchema(); - logger.info("retrieveAllRolePermissions: " + sql); + logger.info("retrieveAllRolePermissions: {}", sql); return this.jdbcTemplate.query(sql, mapper, new Object[] { roleId }); } diff --git a/fineract-provider/src/main/java/org/apache/fineract/useradministration/service/RoleWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/useradministration/service/RoleWritePlatformServiceJpaRepositoryImpl.java index c322f040c94..012cc6118f4 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/useradministration/service/RoleWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/useradministration/service/RoleWritePlatformServiceJpaRepositoryImpl.java @@ -118,7 +118,7 @@ private void handleDataIntegrityIssues(final JsonCommand command, final Throwabl } private void logAsErrorUnexpectedDataIntegrityException(final Exception dve) { - logger.error(dve.getMessage(), dve); + logger.error("Error occured.", dve); } @Caching(evict = { @CacheEvict(value = "users", allEntries = true), @CacheEvict(value = "usersByUsername", allEntries = true) }) From a7d4c83e9258ca1865d42750dd4c5ad496a05f44 Mon Sep 17 00:00:00 2001 From: Angel Cajas Date: Mon, 30 Jul 2018 16:52:17 -0600 Subject: [PATCH 13/37] A new rates module was added to define new rates that can be used to set min and max nominal interest rate, when a new loan account is created they can be used to determine which rates may be applicable for the loan account. --- .../service/CommandWrapperBuilder.java | 17 ++ .../domain/ConfigurationDomainService.java | 2 + .../domain/ConfigurationDomainServiceJpa.java | 11 + .../api/LoanTransactionsApiResource.java | 6 +- .../loanaccount/api/LoansApiResource.java | 63 +++--- .../loanaccount/data/LoanAccountData.java | 71 +++++-- .../data/LoanChargePaidByData.java | 15 ++ .../loanaccount/data/LoanTransactionData.java | 10 + .../portfolio/loanaccount/domain/Loan.java | 38 +++- ...ateLoanScheduleQueryFromApiJsonHelper.java | 3 +- ...anApplicationCommandFromApiJsonHelper.java | 2 +- ...WritePlatformServiceJpaRepositoryImpl.java | 13 +- .../loanaccount/service/LoanAssembler.java | 18 +- .../LoanChargePaidByReadPlatformService.java | 27 +++ ...anChargePaidByReadPlatformServiceImpl.java | 82 +++++++ .../loanproduct/LoanProductConstants.java | 1 + .../api/LoanProductsApiResource.java | 24 ++- .../loanproduct/data/LoanProductData.java | 43 +++- .../loanproduct/domain/LoanProduct.java | 51 ++++- .../domain/LoanProductMinMaxConstraints.java | 8 + .../domain/LoanProductRelatedDetail.java | 3 + .../LoanProductDataValidator.java | 3 +- .../LoanProductReadPlatformServiceImpl.java | 22 +- ...WritePlatformServiceJpaRepositoryImpl.java | 40 +++- .../portfolio/rate/api/RateApiConstants.java | 29 +++ .../portfolio/rate/api/RateApiResource.java | 137 ++++++++++++ .../portfolio/rate/data/RateData.java | 53 +++++ .../fineract/portfolio/rate/domain/Rate.java | 201 ++++++++++++++++++ .../portfolio/rate/domain/RateRepository.java | 36 ++++ .../rate/domain/RateRepositoryWrapper.java | 70 ++++++ .../exception/RateAlreadyExistException.java | 30 +++ .../rate/exception/RateNotFoundException.java | 35 +++ .../handler/CreateRateCommandHandler.java | 48 +++++ .../handler/UpdateRateCommandHandler.java | 51 +++++ ...initionCommandFromApiJsonDeserializer.java | 129 +++++++++++ .../portfolio/rate/service/RateAssembler.java | 80 +++++++ .../rate/service/RateReadService.java | 44 ++++ .../rate/service/RateReadServiceImpl.java | 150 +++++++++++++ .../rate/service/RateWriteService.java | 34 +++ .../rate/service/RateWriteServiceImpl.java | 157 ++++++++++++++ .../sql/migrations/core_db/V352__rates.sql | 67 ++++++ 41 files changed, 1841 insertions(+), 83 deletions(-) create mode 100644 fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanChargePaidByReadPlatformService.java create mode 100644 fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanChargePaidByReadPlatformServiceImpl.java create mode 100644 fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/api/RateApiConstants.java create mode 100644 fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/api/RateApiResource.java create mode 100644 fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/data/RateData.java create mode 100644 fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/domain/Rate.java create mode 100644 fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/domain/RateRepository.java create mode 100644 fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/domain/RateRepositoryWrapper.java create mode 100644 fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/exception/RateAlreadyExistException.java create mode 100644 fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/exception/RateNotFoundException.java create mode 100644 fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/handler/CreateRateCommandHandler.java create mode 100644 fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/handler/UpdateRateCommandHandler.java create mode 100644 fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/serialization/RateDefinitionCommandFromApiJsonDeserializer.java create mode 100644 fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateAssembler.java create mode 100644 fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateReadService.java create mode 100644 fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateReadServiceImpl.java create mode 100644 fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateWriteService.java create mode 100644 fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateWriteServiceImpl.java create mode 100644 fineract-provider/src/main/resources/sql/migrations/core_db/V352__rates.sql diff --git a/fineract-provider/src/main/java/org/apache/fineract/commands/service/CommandWrapperBuilder.java b/fineract-provider/src/main/java/org/apache/fineract/commands/service/CommandWrapperBuilder.java index 72bb97ac929..f713c1beb20 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/commands/service/CommandWrapperBuilder.java +++ b/fineract-provider/src/main/java/org/apache/fineract/commands/service/CommandWrapperBuilder.java @@ -3147,4 +3147,21 @@ public CommandWrapperBuilder delinkAccountsFromPocket() { this.href = "/self/pocket?command="+PocketApiConstants.delinkAccountsFromPocketCommandParam; return this; } + + public CommandWrapperBuilder createRate() { + this.actionName = "CREATE"; + this.entityName = "RATE"; + this.entityId = null; + this.href = "/rates/template"; + return this; + } + + public CommandWrapperBuilder updateRate(final Long rateId) { + this.actionName = "UPDATE"; + this.entityName = "RATE"; + this.entityId = rateId; + this.href = "/rates/" + rateId; + return this; + } + } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/domain/ConfigurationDomainService.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/domain/ConfigurationDomainService.java index 13f83de3e7e..7c66561bb4b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/domain/ConfigurationDomainService.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/domain/ConfigurationDomainService.java @@ -92,4 +92,6 @@ public interface ConfigurationDomainService { Integer retrieveOTPCharacterLength(); Integer retrieveOTPLiveTime(); + + boolean isSubRatesEnabled(); } \ No newline at end of file diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/domain/ConfigurationDomainServiceJpa.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/domain/ConfigurationDomainServiceJpa.java index b534a1b3782..54a955f9331 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/domain/ConfigurationDomainServiceJpa.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/domain/ConfigurationDomainServiceJpa.java @@ -332,4 +332,15 @@ private GlobalConfigurationPropertyData getGlobalConfigurationPropertyData(final } return configurations.get(key); } + + @Override + public boolean isSubRatesEnabled() { + GlobalConfigurationPropertyData configuration = getGlobalConfigurationPropertyData("sub-rates"); + if (configuration==null){ + return false; + }else{ + return configuration.isEnabled(); + } + } + } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoanTransactionsApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoanTransactionsApiResource.java index 187fdf19d8a..fd88a67c35d 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoanTransactionsApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoanTransactionsApiResource.java @@ -54,6 +54,7 @@ import org.apache.fineract.infrastructure.core.service.DateUtils; import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext; import org.apache.fineract.portfolio.loanaccount.data.LoanTransactionData; +import org.apache.fineract.portfolio.loanaccount.service.LoanChargePaidByReadPlatformService; import org.apache.fineract.portfolio.loanaccount.service.LoanReadPlatformService; import org.apache.fineract.portfolio.paymenttype.data.PaymentTypeData; import org.apache.fineract.portfolio.paymenttype.service.PaymentTypeReadPlatformService; @@ -82,19 +83,21 @@ public class LoanTransactionsApiResource { private final DefaultToApiJsonSerializer toApiJsonSerializer; private final PortfolioCommandSourceWritePlatformService commandsSourceWritePlatformService; private final PaymentTypeReadPlatformService paymentTypeReadPlatformService; + private final LoanChargePaidByReadPlatformService loanChargePaidByReadPlatformService; @Autowired public LoanTransactionsApiResource(final PlatformSecurityContext context, final LoanReadPlatformService loanReadPlatformService, final ApiRequestParameterHelper apiRequestParameterHelper, final DefaultToApiJsonSerializer toApiJsonSerializer, final PortfolioCommandSourceWritePlatformService commandsSourceWritePlatformService, - PaymentTypeReadPlatformService paymentTypeReadPlatformService) { + PaymentTypeReadPlatformService paymentTypeReadPlatformService, LoanChargePaidByReadPlatformService loanChargePaidByReadPlatformService) { this.context = context; this.loanReadPlatformService = loanReadPlatformService; this.apiRequestParameterHelper = apiRequestParameterHelper; this.toApiJsonSerializer = toApiJsonSerializer; this.commandsSourceWritePlatformService = commandsSourceWritePlatformService; this.paymentTypeReadPlatformService = paymentTypeReadPlatformService; + this.loanChargePaidByReadPlatformService = loanChargePaidByReadPlatformService; } private boolean is(final String commandParam, final String commandValue) { @@ -170,6 +173,7 @@ public String retrieveTransaction(@PathParam("loanId") @ApiParam(value = "loanId this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions); LoanTransactionData transactionData = this.loanReadPlatformService.retrieveLoanTransaction(loanId, transactionId); + transactionData.setLoanChargePaidByList(this.loanChargePaidByReadPlatformService.getLoanChargesPaidByTransactionId(transactionId)); final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters()); if (settings.isTemplate()) { final Collection paymentTypeOptions = this.paymentTypeReadPlatformService.retrieveAllPaymentTypes(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoansApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoansApiResource.java index 8e6a77faf0c..7b65d8a48cd 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoansApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoansApiResource.java @@ -64,6 +64,7 @@ import org.apache.fineract.infrastructure.bulkimport.service.BulkImportWorkbookService; import org.apache.fineract.infrastructure.codes.data.CodeValueData; import org.apache.fineract.infrastructure.codes.service.CodeValueReadPlatformService; +import org.apache.fineract.infrastructure.configuration.domain.ConfigurationDomainService; import org.apache.fineract.infrastructure.core.api.ApiParameterHelper; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.api.JsonQuery; @@ -131,6 +132,8 @@ import org.apache.fineract.portfolio.note.data.NoteData; import org.apache.fineract.portfolio.note.domain.NoteType; import org.apache.fineract.portfolio.note.service.NoteReadPlatformServiceImpl; +import org.apache.fineract.portfolio.rate.data.RateData; +import org.apache.fineract.portfolio.rate.service.RateReadService; import org.apache.fineract.portfolio.savings.DepositAccountType; import org.apache.fineract.portfolio.savings.domain.SavingsAccountStatusType; import org.springframework.beans.factory.annotation.Autowired; @@ -259,7 +262,7 @@ public class LoansApiResource { "syncDisbursementWithMeeting", "loanCounter", "loanProductCounter", "notes", "accountLinkingOptions", "linkedAccount", "interestRateDifferential", "isFloatingInterestRate", "interestRatesPeriods", LoanApiConstants.canUseForTopup, LoanApiConstants.isTopup, LoanApiConstants.loanIdToClose, LoanApiConstants.topupAmount, LoanApiConstants.clientActiveLoanOptions, - LoanApiConstants.datatables)); + LoanApiConstants.datatables, LoanProductConstants.ratesParamName)); private final Set LOAN_APPROVAL_DATA_PARAMETERS = new HashSet<>(Arrays.asList("approvalDate", "approvalAmount")); private final String resourceNameForPermissions = "LOAN"; @@ -291,30 +294,32 @@ public class LoansApiResource { private final EntityDatatableChecksReadService entityDatatableChecksReadService; private final BulkImportWorkbookService bulkImportWorkbookService; private final BulkImportWorkbookPopulatorService bulkImportWorkbookPopulatorService; - + private final RateReadService rateReadService; + private final ConfigurationDomainService configurationDomainService; @Autowired public LoansApiResource(final PlatformSecurityContext context, final LoanReadPlatformService loanReadPlatformService, - final LoanProductReadPlatformService loanProductReadPlatformService, - final LoanDropdownReadPlatformService dropdownReadPlatformService, final FundReadPlatformService fundReadPlatformService, - final ChargeReadPlatformService chargeReadPlatformService, final LoanChargeReadPlatformService loanChargeReadPlatformService, - final CollateralReadPlatformService loanCollateralReadPlatformService, - final LoanScheduleCalculationPlatformService calculationPlatformService, - final GuarantorReadPlatformService guarantorReadPlatformService, - final CodeValueReadPlatformService codeValueReadPlatformService, final GroupReadPlatformService groupReadPlatformService, - final DefaultToApiJsonSerializer toApiJsonSerializer, - final DefaultToApiJsonSerializer loanApprovalDataToApiJsonSerializer, - final DefaultToApiJsonSerializer loanScheduleToApiJsonSerializer, - final ApiRequestParameterHelper apiRequestParameterHelper, final FromJsonHelper fromJsonHelper, - final PortfolioCommandSourceWritePlatformService commandsSourceWritePlatformService, - final CalendarReadPlatformService calendarReadPlatformService, final NoteReadPlatformServiceImpl noteReadPlatformService, - final PortfolioAccountReadPlatformService portfolioAccountReadPlatformServiceImpl, - final AccountAssociationsReadPlatformService accountAssociationsReadPlatformService, - final LoanScheduleHistoryReadPlatformService loanScheduleHistoryReadPlatformService, - final AccountDetailsReadPlatformService accountDetailsReadPlatformService, - final EntityDatatableChecksReadService entityDatatableChecksReadService, - final BulkImportWorkbookService bulkImportWorkbookService, - final BulkImportWorkbookPopulatorService bulkImportWorkbookPopulatorService) { + final LoanProductReadPlatformService loanProductReadPlatformService, + final LoanDropdownReadPlatformService dropdownReadPlatformService, final FundReadPlatformService fundReadPlatformService, + final ChargeReadPlatformService chargeReadPlatformService, final LoanChargeReadPlatformService loanChargeReadPlatformService, + final CollateralReadPlatformService loanCollateralReadPlatformService, + final LoanScheduleCalculationPlatformService calculationPlatformService, + final GuarantorReadPlatformService guarantorReadPlatformService, + final CodeValueReadPlatformService codeValueReadPlatformService, final GroupReadPlatformService groupReadPlatformService, + final DefaultToApiJsonSerializer toApiJsonSerializer, + final DefaultToApiJsonSerializer loanApprovalDataToApiJsonSerializer, + final DefaultToApiJsonSerializer loanScheduleToApiJsonSerializer, + final ApiRequestParameterHelper apiRequestParameterHelper, final FromJsonHelper fromJsonHelper, + final PortfolioCommandSourceWritePlatformService commandsSourceWritePlatformService, + final CalendarReadPlatformService calendarReadPlatformService, final NoteReadPlatformServiceImpl noteReadPlatformService, + final PortfolioAccountReadPlatformService portfolioAccountReadPlatformServiceImpl, + final AccountAssociationsReadPlatformService accountAssociationsReadPlatformService, + final LoanScheduleHistoryReadPlatformService loanScheduleHistoryReadPlatformService, + final AccountDetailsReadPlatformService accountDetailsReadPlatformService, + final EntityDatatableChecksReadService entityDatatableChecksReadService, + final BulkImportWorkbookService bulkImportWorkbookService, + final BulkImportWorkbookPopulatorService bulkImportWorkbookPopulatorService, final RateReadService rateReadService, + final ConfigurationDomainService configurationDomainService) { this.context = context; this.loanReadPlatformService = loanReadPlatformService; this.loanProductReadPlatformService = loanProductReadPlatformService; @@ -340,8 +345,10 @@ public LoansApiResource(final PlatformSecurityContext context, final LoanReadPla this.loanScheduleHistoryReadPlatformService = loanScheduleHistoryReadPlatformService; this.accountDetailsReadPlatformService = accountDetailsReadPlatformService; this.entityDatatableChecksReadService = entityDatatableChecksReadService; + this.rateReadService = rateReadService; this.bulkImportWorkbookService=bulkImportWorkbookService; this.bulkImportWorkbookPopulatorService=bulkImportWorkbookPopulatorService; + this.configurationDomainService = configurationDomainService; } /* @@ -397,6 +404,7 @@ public String template(@QueryParam("clientId") @ApiParam(value = "clientId") fin LoanAccountData newLoanAccount = null; Long officeId = null; Collection accountLinkingOptions = null; + boolean isRatesEnabled = this.configurationDomainService.isSubRatesEnabled(); if (productId != null) { newLoanAccount = this.loanReadPlatformService.retrieveLoanProductDetailsTemplate(productId, clientId, groupId); @@ -474,7 +482,7 @@ public String template(@QueryParam("clientId") @ApiParam(value = "clientId") fin // add product options, allowed loan officers and calendar options // (calendar options will be null in individual loan) newLoanAccount = LoanAccountData.associationsAndTemplate(newLoanAccount, productOptions, allowedLoanOfficers, calendarOptions, - accountLinkingOptions); + accountLinkingOptions, isRatesEnabled); } final List datatableTemplates = this.entityDatatableChecksReadService .retrieveTemplates(StatusEnum.CREATE.getCode().longValue(), EntityTables.LOAN.getName(), productId); @@ -736,13 +744,20 @@ public String retrieveLoan(@PathParam("loanId") @ApiParam(value = "loanId") fina paidInAdvanceTemplate = this.loanReadPlatformService.retrieveTotalPaidInAdvance(loanId); + //Get rates from Loan + boolean isRatesEnabled = this.configurationDomainService.isSubRatesEnabled(); + List rates = null; + if (isRatesEnabled){ + rates = this.rateReadService.retrieveLoanRates(loanId); + } + final LoanAccountData loanAccount = LoanAccountData.associationsAndTemplate(loanBasicDetails, repaymentSchedule, loanRepayments, charges, collateral, guarantors, meeting, productOptions, loanTermFrequencyTypeOptions, repaymentFrequencyTypeOptions, repaymentFrequencyNthDayTypeOptions, repaymentFrequencyDayOfWeekTypeOptions, repaymentStrategyOptions, interestRateFrequencyTypeOptions, amortizationTypeOptions, interestTypeOptions, interestCalculationPeriodTypeOptions, fundOptions, chargeOptions, chargeTemplate, allowedLoanOfficers, loanPurposeOptions, loanCollateralOptions, calendarOptions, notes, accountLinkingOptions, linkedAccount, disbursementData, emiAmountVariations, - overdueCharges, paidInAdvanceTemplate, interestRatesPeriods, clientActiveLoanOptions); + overdueCharges, paidInAdvanceTemplate, interestRatesPeriods, clientActiveLoanOptions, rates, isRatesEnabled); final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters(), mandatoryResponseParameters); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/data/LoanAccountData.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/data/LoanAccountData.java index d5291ff6e8b..052efe09bbb 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/data/LoanAccountData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/data/LoanAccountData.java @@ -50,6 +50,7 @@ import org.apache.fineract.portfolio.loanproduct.domain.LoanProductConfigurableAttributes; import org.apache.fineract.portfolio.loanproduct.domain.LoanProductValueConditionType; import org.apache.fineract.portfolio.note.data.NoteData; +import org.apache.fineract.portfolio.rate.data.RateData; import org.joda.time.LocalDate; import org.springframework.util.CollectionUtils; @@ -219,6 +220,10 @@ public class LoanAccountData { private List datatables = null; private final Boolean isEqualAmortization; + //Rate + private final List rates; + private final Boolean isRatesEnabled; + //import fields private String dateFormat; private String locale; @@ -311,6 +316,7 @@ private LoanAccountData(EnumOptionData loanType,Long clientId,Long productId,Lon this.groupId=groupId; this.expectedDisbursementDate=expectedDisbursementDate; this.charges = charges; + this.rates=null; this.id = null; this.accountNo = null; @@ -418,6 +424,7 @@ private LoanAccountData(EnumOptionData loanType,Long clientId,Long productId,Lon this.minimumGap = null; this.maximumGap = null; this.isEqualAmortization = null; + this.isRatesEnabled = false; } @@ -580,6 +587,9 @@ public static LoanAccountData collateralTemplate(final Collection final String closureLoanAccountNo = null; final BigDecimal topupAmount = null; final boolean isEqualAmortization = false; + final List rates = null; + final Boolean isRatesEnabled = false; + return new LoanAccountData(id, accountNo, status, externalId, clientId, clientAccountNo, clientName, clientOfficeId, group, loanType, loanProductId, loanProductName, loanProductDescription, isLoanProductLinkedToFloatingRate, fundId, fundName, loanPurposeId, loanPurposeName, loanOfficerId, loanOfficerName, currencyData, proposedPrincipal, principal, principal, @@ -598,7 +608,7 @@ public static LoanAccountData collateralTemplate(final Collection maxOutstandingLoanBalance, emiAmountVariations, memberVariations, product, inArrears, graceOnArrearsAgeing, overdueCharges, isNPA, daysInMonthType, daysInYearType, isInterestRecalculationEnabled, interestRecalculationData, originalSchedule, createStandingInstructionAtDisbursement, paidInAdvance, interestRatesPeriods, isVariableInstallmentsAllowed, minimumGap, - maximumGap, subStatus, canUseForTopup, clientActiveLoanOptions, isTopup, closureLoanId, closureLoanAccountNo, topupAmount, isEqualAmortization); + maximumGap, subStatus, canUseForTopup, clientActiveLoanOptions, isTopup, closureLoanId, closureLoanAccountNo, topupAmount, isEqualAmortization, rates, isRatesEnabled); } @@ -720,6 +730,9 @@ public static LoanAccountData clientDefaults(final Long clientId, final String c final String closureLoanAccountNo = null; final BigDecimal topupAmount = null; final boolean isEqualAmortization = false; + final List rates = null; + final Boolean isRatesEnabled = false; + return new LoanAccountData(id, accountNo, status, externalId, clientId, clientAccountNo, clientName, clientOfficeId, group, loanType, loanProductId, loanProductName, loanProductDescription, isLoanProductLinkedToFloatingRate, fundId, fundName, loanPurposeId, loanPurposeName, loanOfficerId, loanOfficerName, currencyData, proposedPrincipal, principal, principal, @@ -738,7 +751,8 @@ public static LoanAccountData clientDefaults(final Long clientId, final String c maxOutstandingLoanBalance, emiAmountVariations, memberVariations, product, inArrears, graceOnArrearsAgeing, overdueCharges, isNPA, daysInMonthType, daysInYearType, isInterestRecalculationEnabled, interestRecalculationData, originalSchedule, createStandingInstructionAtDisbursement, paidInAdvance, interestRatesPeriods, isVariableInstallmentsAllowed, minimumGap, - maximumGap, subStatus, canUseForTopup, clientActiveLoanOptions, isTopup, closureLoanId, closureLoanAccountNo, topupAmount, isEqualAmortization); + maximumGap, subStatus, canUseForTopup, clientActiveLoanOptions, isTopup, closureLoanId, closureLoanAccountNo, topupAmount, isEqualAmortization, + rates, isRatesEnabled); } @@ -768,7 +782,8 @@ public static LoanAccountData populateClientDefaults(final LoanAccountData acc, acc.isInterestRecalculationEnabled, acc.interestRecalculationData, acc.originalSchedule, acc.createStandingInstructionAtDisbursement, acc.paidInAdvance, acc.interestRatesPeriods, acc.isVariableInstallmentsAllowed, acc.minimumGap, acc.maximumGap, acc.subStatus, acc.canUseForTopup, - acc.clientActiveLoanOptions, acc.isTopup, acc.closureLoanId, acc.closureLoanAccountNo, acc.topupAmount, acc.isEqualAmortization); + acc.clientActiveLoanOptions, acc.isTopup, acc.closureLoanId, acc.closureLoanAccountNo, acc.topupAmount, acc.isEqualAmortization, + acc.rates, acc.isRatesEnabled); } /** @@ -891,6 +906,9 @@ public static LoanAccountData groupDefaults(final GroupGeneralData group, final final String closureLoanAccountNo = null; final BigDecimal topupAmount = null; final boolean isEqualAmortization = false; + final List rates = null; + final Boolean isRatesEnabled = false; + return new LoanAccountData(id, accountNo, status, externalId, clientId, clientAccountNo, clientName, clientOfficeId, group, loanType, loanProductId, loanProductName, loanProductDescription, isLoanProductLinkedToFloatingRate, fundId, fundName, loanPurposeId, loanPurposeName, loanOfficerId, loanOfficerName, currencyData, proposedPrincipal, principal, principal, @@ -909,7 +927,8 @@ public static LoanAccountData groupDefaults(final GroupGeneralData group, final maxOutstandingBalance, emiAmountVariations, memberVariations, product, inArrears, graceOnArrearsAgeing, overdueCharges, isNPA, daysInMonthType, daysInYearType, isInterestRecalculationEnabled, interestRecalculationData, originalSchedule, createStandingInstructionAtDisbursement, paidInAdvance, interestRatesPeriods, isVariableInstallmentsAllowed, minimumGap, - maximumGap, subStatus, canUseForTopup, clientActiveLoanOptions, isTopup, closureLoanId, closureLoanAccountNo, topupAmount, isEqualAmortization); + maximumGap, subStatus, canUseForTopup, clientActiveLoanOptions, isTopup, closureLoanId, closureLoanAccountNo, topupAmount, isEqualAmortization, + rates, isRatesEnabled); } @@ -939,7 +958,8 @@ public static LoanAccountData populateGroupDefaults(final LoanAccountData acc, f acc.isInterestRecalculationEnabled, acc.interestRecalculationData, acc.originalSchedule, acc.createStandingInstructionAtDisbursement, acc.paidInAdvance, acc.interestRatesPeriods, acc.isVariableInstallmentsAllowed, acc.minimumGap, acc.maximumGap, acc.subStatus, acc.canUseForTopup, - acc.clientActiveLoanOptions, acc.isTopup, acc.closureLoanId, acc.closureLoanAccountNo, acc.topupAmount, acc.isEqualAmortization); + acc.clientActiveLoanOptions, acc.isTopup, acc.closureLoanId, acc.closureLoanAccountNo, acc.topupAmount, acc.isEqualAmortization, + acc.rates, acc.isRatesEnabled); } @@ -1069,6 +1089,9 @@ public static LoanAccountData loanProductWithTemplateDefaults(final LoanProductD final Long closureLoanId = null; final String closureLoanAccountNo = null; final BigDecimal topupAmount = null; + final List rates = null; + final Boolean isRatesEnabled = false; + return new LoanAccountData(id, accountNo, status, externalId, clientId, clientAccountNo, clientName, clientOfficeId, group, loanType, product.getId(), product.getName(), product.getDescription(), product.isLinkedToFloatingInterestRates(), product.getFundId(), product.getFundName(), loanPurposeId, loanPurposeName, loanOfficerId, loanOfficerName, @@ -1093,7 +1116,7 @@ public static LoanAccountData loanProductWithTemplateDefaults(final LoanProductD originalSchedule, createStandingInstructionAtDisbursement, paidInAdvance, interestRatesPeriods, product.isVariableInstallmentsAllowed(), product.getMinimumGapBetweenInstallments(), product.getMaximumGapBetweenInstallments(), subStatus, canUseForTopup, clientActiveLoanOptions, isTopup, closureLoanId, - closureLoanAccountNo, topupAmount, product.isEqualAmortization()); + closureLoanAccountNo, topupAmount, product.isEqualAmortization(),rates, isRatesEnabled); } public static LoanAccountData populateLoanProductDefaults(final LoanAccountData acc, final LoanProductData product) { @@ -1153,7 +1176,8 @@ public static LoanAccountData populateLoanProductDefaults(final LoanAccountData product.toLoanInterestRecalculationData(), acc.originalSchedule, acc.createStandingInstructionAtDisbursement, paidInAdvance, acc.interestRatesPeriods, product.isVariableInstallmentsAllowed(), product.getMinimumGapBetweenInstallments(), product.getMaximumGapBetweenInstallments(), acc.subStatus, acc.canUseForTopup, - acc.clientActiveLoanOptions, acc.isTopup, acc.closureLoanId, acc.closureLoanAccountNo, acc.topupAmount, product.isEqualAmortization()); + acc.clientActiveLoanOptions, acc.isTopup, acc.closureLoanId, acc.closureLoanAccountNo, acc.topupAmount, product.isEqualAmortization(), acc.rates, + acc.isRatesEnabled); } @@ -1222,6 +1246,8 @@ public static LoanAccountData basicLoanDetails(final Long id, final String accou final PaidInAdvanceData paidInAdvance = null; final Collection interestRatesPeriods = null; final Collection clientActiveLoanOptions = null; + final List rates = null; + final Boolean isRatesEnabled = false; return new LoanAccountData(id, accountNo, status, externalId, clientId, clientAccountNo, clientName, clientOfficeId, group, loanType, loanProductId, loanProductName, loanProductDescription, isLoanProductLinkedToFloatingRate, fundId, fundName, @@ -1241,7 +1267,8 @@ public static LoanAccountData basicLoanDetails(final Long id, final String accou outstandingLoanBalance, emiAmountVariations, memberVariations, product, inArrears, graceOnArrearsAgeing, overdueCharges, isNPA, daysInMonthType, daysInYearType, isInterestRecalculationEnabled, interestRecalculationData, originalSchedule, createStandingInstructionAtDisbursement, paidInAdvance, interestRatesPeriods, isVariableInstallmentsAllowed, minimumGap, - maximumGap, subStatus, canUseForTopup, clientActiveLoanOptions, isTopup, closureLoanId, closureLoanAccountNo, topupAmount, isEqualAmortization); + maximumGap, subStatus, canUseForTopup, clientActiveLoanOptions, isTopup, closureLoanId, closureLoanAccountNo, topupAmount, isEqualAmortization, + rates, isRatesEnabled); } /* @@ -1265,7 +1292,7 @@ public static LoanAccountData associationsAndTemplate(final LoanAccountData acc, final PortfolioAccountData linkedAccount, final Collection disbursementDetails, final Collection emiAmountVariations, final Collection overdueCharges, final PaidInAdvanceData paidInAdvance, Collection interestRatesPeriods, - final Collection clientActiveLoanOptions) { + final Collection clientActiveLoanOptions,final List rates, final Boolean isRatesEnabled) { LoanProductConfigurableAttributes loanProductConfigurableAttributes = null; if (acc.product != null) { loanProductConfigurableAttributes = acc.product.getloanProductConfigurableAttributes(); @@ -1294,12 +1321,12 @@ public static LoanAccountData associationsAndTemplate(final LoanAccountData acc, acc.isInterestRecalculationEnabled, acc.interestRecalculationData, acc.originalSchedule, acc.createStandingInstructionAtDisbursement, paidInAdvance, interestRatesPeriods, acc.isVariableInstallmentsAllowed, acc.minimumGap, acc.maximumGap, acc.subStatus, acc.canUseForTopup, clientActiveLoanOptions, acc.isTopup, - acc.closureLoanId, acc.closureLoanAccountNo, acc.topupAmount, acc.isEqualAmortization); + acc.closureLoanId, acc.closureLoanAccountNo, acc.topupAmount, acc.isEqualAmortization, rates, isRatesEnabled); } public static LoanAccountData associationsAndTemplate(final LoanAccountData acc, final Collection productOptions, final Collection allowedLoanOfficers, final Collection calendarOptions, - final Collection accountLinkingOptions) { + final Collection accountLinkingOptions, final Boolean isRatesEnabled) { return associationsAndTemplate(acc, acc.repaymentSchedule, acc.transactions, acc.charges, acc.collateral, acc.guarantors, acc.meeting, productOptions, acc.termFrequencyTypeOptions, acc.repaymentFrequencyTypeOptions, acc.repaymentFrequencyNthDayTypeOptions, acc.repaymentFrequencyDaysOfWeekTypeOptions, @@ -1307,7 +1334,7 @@ public static LoanAccountData associationsAndTemplate(final LoanAccountData acc, acc.interestTypeOptions, acc.interestCalculationPeriodTypeOptions, acc.fundOptions, acc.chargeOptions, null, allowedLoanOfficers, acc.loanPurposeOptions, acc.loanCollateralOptions, calendarOptions, acc.notes, accountLinkingOptions, acc.linkedAccount, acc.disbursementDetails, acc.emiAmountVariations, acc.overdueCharges, acc.paidInAdvance, - acc.interestRatesPeriods, acc.clientActiveLoanOptions); + acc.interestRatesPeriods, acc.clientActiveLoanOptions,acc.rates, isRatesEnabled); } public static LoanAccountData associateGroup(final LoanAccountData acc, final GroupGeneralData group) { @@ -1336,7 +1363,8 @@ public static LoanAccountData associateGroup(final LoanAccountData acc, final Gr acc.isInterestRecalculationEnabled, acc.interestRecalculationData, acc.originalSchedule, acc.createStandingInstructionAtDisbursement, acc.paidInAdvance, acc.interestRatesPeriods, acc.isVariableInstallmentsAllowed, acc.minimumGap, acc.maximumGap, acc.subStatus, acc.canUseForTopup, - acc.clientActiveLoanOptions, acc.isTopup, acc.closureLoanId, acc.closureLoanAccountNo, acc.topupAmount, acc.isEqualAmortization); + acc.clientActiveLoanOptions, acc.isTopup, acc.closureLoanId, acc.closureLoanAccountNo, acc.topupAmount, acc.isEqualAmortization, acc.rates, + acc.isRatesEnabled); } public static LoanAccountData associateMemberVariations(final LoanAccountData acc, final Map memberLoanCycle) { @@ -1401,7 +1429,8 @@ public static LoanAccountData associateMemberVariations(final LoanAccountData ac acc.isInterestRecalculationEnabled, acc.interestRecalculationData, acc.originalSchedule, acc.createStandingInstructionAtDisbursement, acc.paidInAdvance, acc.interestRatesPeriods, acc.isVariableInstallmentsAllowed, acc.minimumGap, acc.maximumGap, acc.subStatus, acc.canUseForTopup, - acc.clientActiveLoanOptions, acc.isTopup, acc.closureLoanId, acc.closureLoanAccountNo, acc.topupAmount, acc.isEqualAmortization); + acc.clientActiveLoanOptions, acc.isTopup, acc.closureLoanId, acc.closureLoanAccountNo, acc.topupAmount, acc.isEqualAmortization, acc.rates, + acc.isRatesEnabled); } @@ -1435,7 +1464,8 @@ public static LoanAccountData withInterestRecalculationCalendarData(final LoanAc acc.isInterestRecalculationEnabled, interestRecalculationData, acc.originalSchedule, acc.createStandingInstructionAtDisbursement, acc.paidInAdvance, acc.interestRatesPeriods, acc.isVariableInstallmentsAllowed, acc.minimumGap, acc.maximumGap, acc.subStatus, acc.canUseForTopup, - acc.clientActiveLoanOptions, acc.isTopup, acc.closureLoanId, acc.closureLoanAccountNo, acc.topupAmount, acc.isEqualAmortization); + acc.clientActiveLoanOptions, acc.isTopup, acc.closureLoanId, acc.closureLoanAccountNo, acc.topupAmount, acc.isEqualAmortization, acc.rates, + acc.isRatesEnabled); } public static LoanAccountData withLoanCalendarData(final LoanAccountData acc, final CalendarData calendarData) { @@ -1463,7 +1493,8 @@ public static LoanAccountData withLoanCalendarData(final LoanAccountData acc, fi acc.isNPA, acc.daysInMonthType, acc.daysInYearType, acc.isInterestRecalculationEnabled, acc.interestRecalculationData, acc.originalSchedule, acc.createStandingInstructionAtDisbursement, acc.paidInAdvance, acc.interestRatesPeriods, acc.isVariableInstallmentsAllowed, acc.minimumGap, acc.maximumGap, acc.subStatus, acc.canUseForTopup, - acc.clientActiveLoanOptions, acc.isTopup, acc.closureLoanId, acc.closureLoanAccountNo, acc.topupAmount, acc.isEqualAmortization); + acc.clientActiveLoanOptions, acc.isTopup, acc.closureLoanId, acc.closureLoanAccountNo, acc.topupAmount, acc.isEqualAmortization, + acc.rates, acc.isRatesEnabled); } public static LoanAccountData withOriginalSchedule(final LoanAccountData acc, final LoanScheduleData originalSchedule) { @@ -1492,7 +1523,8 @@ public static LoanAccountData withOriginalSchedule(final LoanAccountData acc, fi acc.isInterestRecalculationEnabled, acc.interestRecalculationData, originalSchedule, acc.createStandingInstructionAtDisbursement, acc.paidInAdvance, acc.interestRatesPeriods, acc.isVariableInstallmentsAllowed, acc.minimumGap, acc.maximumGap, acc.subStatus, acc.canUseForTopup, - acc.clientActiveLoanOptions, acc.isTopup, acc.closureLoanId, acc.closureLoanAccountNo, acc.topupAmount, acc.isEqualAmortization); + acc.clientActiveLoanOptions, acc.isTopup, acc.closureLoanId, acc.closureLoanAccountNo, acc.topupAmount, acc.isEqualAmortization, + acc.rates, acc.isRatesEnabled); } private LoanAccountData(final Long id, // @@ -1542,7 +1574,8 @@ private LoanAccountData(final Long id, // final Collection interestRatesPeriods, final Boolean isVariableInstallmentsAllowed, final Integer minimumGap, final Integer maximumGap, final EnumOptionData subStatus, final Boolean canUseForTopup, final Collection clientActiveLoanOptions, final boolean isTopup, - final Long closureLoanId, final String closureLoanAccountNo, final BigDecimal topupAmount, final boolean isEqualAmortization) { + final Long closureLoanId, final String closureLoanAccountNo, final BigDecimal topupAmount, final boolean isEqualAmortization, + final List rates, final Boolean isRatesEnabled) { this.id = id; this.accountNo = accountNo; @@ -1622,6 +1655,7 @@ private LoanAccountData(final Long id, // this.amortizationTypeOptions = amortizationTypeOptions; this.interestTypeOptions = interestTypeOptions; this.interestCalculationPeriodTypeOptions = interestCalculationPeriodTypeOptions; + this.isRatesEnabled = isRatesEnabled; if (CollectionUtils.isEmpty(transactionProcessingStrategyOptions)) { this.transactionProcessingStrategyOptions = null; @@ -1725,6 +1759,7 @@ private LoanAccountData(final Long id, // this.closureLoanAccountNo = closureLoanAccountNo; this.topupAmount = topupAmount; this.isEqualAmortization = isEqualAmortization; + this.rates = rates; } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/data/LoanChargePaidByData.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/data/LoanChargePaidByData.java index 9978bcd5e73..3545b6cfbd9 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/data/LoanChargePaidByData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/data/LoanChargePaidByData.java @@ -27,6 +27,17 @@ public class LoanChargePaidByData { private final Integer installmentNumber; private final Long chargeId; private final Long transactionId; + private final String name; + + public LoanChargePaidByData(final Long id, final BigDecimal amount, final Integer installmentNumber, final Long chargeId, + final Long transactionId, String name) { + this.id = id; + this.amount = amount; + this.installmentNumber = installmentNumber; + this.chargeId = chargeId; + this.transactionId = transactionId; + this.name=name; + } public LoanChargePaidByData(final Long id, final BigDecimal amount, final Integer installmentNumber, final Long chargeId, final Long transactionId) { @@ -35,6 +46,7 @@ public LoanChargePaidByData(final Long id, final BigDecimal amount, final Intege this.installmentNumber = installmentNumber; this.chargeId = chargeId; this.transactionId = transactionId; + this.name=null; } public Long getId() { @@ -57,4 +69,7 @@ public Long getTransactionId() { return this.transactionId; } + public String getName() { + return name; + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/data/LoanTransactionData.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/data/LoanTransactionData.java index b986b34a115..fc157d125b8 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/data/LoanTransactionData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/data/LoanTransactionData.java @@ -59,6 +59,8 @@ public class LoanTransactionData { private final boolean manuallyReversed; private final LocalDate possibleNextRepaymentDate; + private Collection loanChargePaidByList; + // templates final Collection paymentTypeOptions; @@ -339,4 +341,12 @@ public BigDecimal getInterestPortion() { public void setWriteOffReasonOptions(Collection writeOffReasonOptions){ this.writeOffReasonOptions =writeOffReasonOptions; } + + public Collection getLoanChargePaidByList() { + return loanChargePaidByList; + } + + public void setLoanChargePaidByList(Collection loanChargePaidByList) { + this.loanChargePaidByList = loanChargePaidByList; + } } \ No newline at end of file diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java index b44aa416390..201d7715b28 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java @@ -133,6 +133,7 @@ import org.apache.fineract.portfolio.loanproduct.domain.RecalculationFrequencyType; import org.apache.fineract.portfolio.loanproduct.service.LoanEnumerations; import org.apache.fineract.portfolio.paymentdetail.domain.PaymentDetail; +import org.apache.fineract.portfolio.rate.domain.Rate; import org.apache.fineract.useradministration.domain.AppUser; import org.joda.time.Days; import org.joda.time.LocalDate; @@ -388,20 +389,24 @@ public class Loan extends AbstractPersistableCustom { @OneToOne(cascade = CascadeType.ALL, mappedBy = "loan", optional = true, orphanRemoval = true, fetch=FetchType.EAGER) private LoanTopupDetails loanTopupDetails; + @OneToMany(fetch = FetchType.LAZY) + @JoinTable(name = "m_loan_rate", joinColumns = @JoinColumn(name = "loan_id"), inverseJoinColumns = @JoinColumn(name = "rate_id")) + private List rates; + public static Loan newIndividualLoanApplication(final String accountNo, final Client client, final Integer loanType, final LoanProduct loanProduct, final Fund fund, final Staff officer, final CodeValue loanPurpose, final LoanTransactionProcessingStrategy transactionProcessingStrategy, final LoanProductRelatedDetail loanRepaymentScheduleDetail, final Set loanCharges, final Set collateral, final BigDecimal fixedEmiAmount, final List disbursementDetails, final BigDecimal maxOutstandingLoanBalance, final Boolean createStandingInstructionAtDisbursement, - final Boolean isFloatingInterestRate, final BigDecimal interestRateDifferential) { + final Boolean isFloatingInterestRate, final BigDecimal interestRateDifferential, final List rates) { final LoanStatus status = null; final Group group = null; final Boolean syncDisbursementWithMeeting = null; return new Loan(accountNo, client, group, loanType, fund, officer, loanPurpose, transactionProcessingStrategy, loanProduct, loanRepaymentScheduleDetail, status, loanCharges, collateral, syncDisbursementWithMeeting, fixedEmiAmount, disbursementDetails, maxOutstandingLoanBalance, createStandingInstructionAtDisbursement, isFloatingInterestRate, - interestRateDifferential); + interestRateDifferential, rates); } public static Loan newGroupLoanApplication(final String accountNo, final Group group, final Integer loanType, @@ -411,13 +416,13 @@ public static Loan newGroupLoanApplication(final String accountNo, final Group g final Set collateral, final Boolean syncDisbursementWithMeeting, final BigDecimal fixedEmiAmount, final List disbursementDetails, final BigDecimal maxOutstandingLoanBalance, final Boolean createStandingInstructionAtDisbursement, final Boolean isFloatingInterestRate, - final BigDecimal interestRateDifferential) { + final BigDecimal interestRateDifferential, final List rates) { final LoanStatus status = null; final Client client = null; return new Loan(accountNo, client, group, loanType, fund, officer, loanPurpose, transactionProcessingStrategy, loanProduct, loanRepaymentScheduleDetail, status, loanCharges, collateral, syncDisbursementWithMeeting, fixedEmiAmount, disbursementDetails, maxOutstandingLoanBalance, createStandingInstructionAtDisbursement, isFloatingInterestRate, - interestRateDifferential); + interestRateDifferential, rates); } public static Loan newIndividualLoanApplicationFromGroup(final String accountNo, final Client client, final Group group, @@ -427,12 +432,12 @@ public static Loan newIndividualLoanApplicationFromGroup(final String accountNo, final Set collateral, final Boolean syncDisbursementWithMeeting, final BigDecimal fixedEmiAmount, final List disbursementDetails, final BigDecimal maxOutstandingLoanBalance, final Boolean createStandingInstructionAtDisbursement, final Boolean isFloatingInterestRate, - final BigDecimal interestRateDifferential) { + final BigDecimal interestRateDifferential, final List rates) { final LoanStatus status = null; return new Loan(accountNo, client, group, loanType, fund, officer, loanPurpose, transactionProcessingStrategy, loanProduct, loanRepaymentScheduleDetail, status, loanCharges, collateral, syncDisbursementWithMeeting, fixedEmiAmount, disbursementDetails, maxOutstandingLoanBalance, createStandingInstructionAtDisbursement, isFloatingInterestRate, - interestRateDifferential); + interestRateDifferential,rates); } protected Loan() { @@ -445,7 +450,7 @@ private Loan(final String accountNo, final Client client, final Group group, fin final Set loanCharges, final Set collateral, final Boolean syncDisbursementWithMeeting, final BigDecimal fixedEmiAmount, final List disbursementDetails, final BigDecimal maxOutstandingLoanBalance, final Boolean createStandingInstructionAtDisbursement, - final Boolean isFloatingInterestRate, final BigDecimal interestRateDifferential) { + final Boolean isFloatingInterestRate, final BigDecimal interestRateDifferential, final List rates) { this.loanRepaymentScheduleDetail = loanRepaymentScheduleDetail; this.loanRepaymentScheduleDetail.validateRepaymentPeriodWithGraceSettings(); @@ -503,6 +508,9 @@ private Loan(final String accountNo, final Client client, final Group group, fin this.proposedPrincipal = this.loanRepaymentScheduleDetail.getPrincipal().getAmount(); + //rates added here + this.rates = rates; + } private LoanSummary updateSummaryWithTotalFeeChargesDueAtDisbursement(final BigDecimal feeChargesDueAtDisbursement) { @@ -1166,6 +1174,14 @@ public void updateLoanCollateral(final Set loanCollateral) { this.collateral.addAll(associateWithThisLoan(loanCollateral)); } + public void updateLoanRates(final List loanRates) { + if (this.rates == null) { + this.rates = new ArrayList<>(); + } + this.rates.clear(); + this.rates.addAll(loanRates); + } + public void updateLoanSchedule(final LoanScheduleModel modifiedLoanSchedule, AppUser currentUser) { this.repaymentScheduleInstallments.clear(); for (final LoanScheduleModelPeriod scheduledLoanInstallment : modifiedLoanSchedule.getPeriods()) { @@ -6533,4 +6549,12 @@ public boolean hasInvalidLoanType() { } public boolean isIndividualLoan(){return AccountType.fromInt(this.loanType).isIndividualAccount();} + + public void setRates(List rates) { + this.rates = rates; + } + + public List getRates() { + return rates; + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/serialization/CalculateLoanScheduleQueryFromApiJsonHelper.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/serialization/CalculateLoanScheduleQueryFromApiJsonHelper.java index 8c85637fcbb..34789897148 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/serialization/CalculateLoanScheduleQueryFromApiJsonHelper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/serialization/CalculateLoanScheduleQueryFromApiJsonHelper.java @@ -67,7 +67,8 @@ public final class CalculateLoanScheduleQueryFromApiJsonHelper { LoanProductConstants.graceOnArrearsAgeingParameterName, LoanApiConstants.createStandingInstructionAtDisbursementParameterName, LoanApiConstants.isFloatingInterestRateParameterName, LoanApiConstants.interestRateDifferentialParameterName, LoanApiConstants.repaymentFrequencyNthDayTypeParameterName, LoanApiConstants.repaymentFrequencyDayOfWeekTypeParameterName, - LoanApiConstants.isTopup, LoanApiConstants.loanIdToClose, LoanApiConstants.datatables, LoanApiConstants.isEqualAmortizationParam)); + LoanApiConstants.isTopup, LoanApiConstants.loanIdToClose, LoanApiConstants.datatables, LoanApiConstants.isEqualAmortizationParam, + LoanProductConstants.ratesParamName)); private final FromJsonHelper fromApiJsonHelper; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/serialization/LoanApplicationCommandFromApiJsonHelper.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/serialization/LoanApplicationCommandFromApiJsonHelper.java index 0d36e4ba5ee..24992bc1cc9 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/serialization/LoanApplicationCommandFromApiJsonHelper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/serialization/LoanApplicationCommandFromApiJsonHelper.java @@ -91,7 +91,7 @@ public final class LoanApplicationCommandFromApiJsonHelper { LoanApiConstants.linkAccountIdParameterName, LoanApiConstants.disbursementDataParameterName, LoanApiConstants.emiAmountParameterName, LoanApiConstants.maxOutstandingBalanceParameterName, LoanProductConstants.graceOnArrearsAgeingParameterName, LoanApiConstants.createStandingInstructionAtDisbursementParameterName, - LoanApiConstants.isTopup, LoanApiConstants.loanIdToClose, LoanApiConstants.datatables, LoanApiConstants.isEqualAmortizationParam)); + LoanApiConstants.isTopup, LoanApiConstants.loanIdToClose, LoanApiConstants.datatables, LoanApiConstants.isEqualAmortizationParam, LoanProductConstants.ratesParamName)); private final FromJsonHelper fromApiJsonHelper; private final CalculateLoanScheduleQueryFromApiJsonHelper apiJsonHelper; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanApplicationWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanApplicationWritePlatformServiceJpaRepositoryImpl.java index b068558c4a9..9995a39c7d4 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanApplicationWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanApplicationWritePlatformServiceJpaRepositoryImpl.java @@ -126,6 +126,7 @@ import org.apache.fineract.portfolio.loanproduct.service.LoanProductReadPlatformService; import org.apache.fineract.portfolio.note.domain.Note; import org.apache.fineract.portfolio.note.domain.NoteRepository; +import org.apache.fineract.portfolio.rate.service.RateAssembler; import org.apache.fineract.portfolio.savings.domain.SavingsAccount; import org.apache.fineract.portfolio.savings.domain.SavingsAccountAssembler; import org.apache.fineract.useradministration.domain.AppUser; @@ -178,6 +179,7 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa private final FineractEntityToEntityMappingRepository repository; private final FineractEntityRelationRepository fineractEntityRelationRepository; private final LoanProductReadPlatformService loanProductReadPlatformService; + private final RateAssembler rateAssembler; @Autowired public LoanApplicationWritePlatformServiceJpaRepositoryImpl(final PlatformSecurityContext context, final FromJsonHelper fromJsonHelper, @@ -200,7 +202,8 @@ public LoanApplicationWritePlatformServiceJpaRepositoryImpl(final PlatformSecuri final LoanScheduleAssembler loanScheduleAssembler, final LoanUtilService loanUtilService, final CalendarReadPlatformService calendarReadPlatformService, final GlobalConfigurationRepositoryWrapper globalConfigurationRepository, final FineractEntityToEntityMappingRepository repository, final FineractEntityRelationRepository fineractEntityRelationRepository, - final EntityDatatableChecksWritePlatformService entityDatatableChecksWritePlatformService, final LoanProductReadPlatformService loanProductReadPlatformService) { + final EntityDatatableChecksWritePlatformService entityDatatableChecksWritePlatformService, final LoanProductReadPlatformService loanProductReadPlatformService, + final RateAssembler rateAssembler) { this.context = context; this.fromJsonHelper = fromJsonHelper; this.loanApplicationTransitionApiJsonValidator = loanApplicationTransitionApiJsonValidator; @@ -236,7 +239,7 @@ public LoanApplicationWritePlatformServiceJpaRepositoryImpl(final PlatformSecuri this.repository = repository; this.fineractEntityRelationRepository = fineractEntityRelationRepository; this.loanProductReadPlatformService = loanProductReadPlatformService; - + this.rateAssembler = rateAssembler; } private LoanLifecycleStateMachine defaultLoanLifecycleStateMachine() { @@ -858,6 +861,12 @@ public CommandProcessingResult modifyApplication(final Long loanId, final JsonCo existingLoanApplication.recalculateAllCharges(); } + //Changes to modify loan rates. + if (command.hasParameter(LoanProductConstants.ratesParamName)) { + existingLoanApplication.updateLoanRates(rateAssembler.fromParsedJson(command.parsedJson())); + } + + this.fromApiJsonDeserializer.validateLoanTermAndRepaidEveryValues(existingLoanApplication.getTermFrequency(), existingLoanApplication.getTermPeriodFrequencyType(), productRelatedDetail.getNumberOfRepayments(), productRelatedDetail.getRepayEvery(), productRelatedDetail.getRepaymentPeriodFrequencyType().getValue(), diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanAssembler.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanAssembler.java index 1892efe71b9..094b2e88fa7 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanAssembler.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanAssembler.java @@ -25,6 +25,8 @@ import java.util.List; import java.util.Locale; import java.util.Set; + +import com.google.gson.JsonArray; import org.apache.fineract.infrastructure.codes.domain.CodeValue; import org.apache.fineract.infrastructure.codes.domain.CodeValueRepositoryWrapper; import org.apache.fineract.infrastructure.configuration.domain.ConfigurationDomainService; @@ -71,6 +73,7 @@ import org.apache.fineract.portfolio.loanaccount.loanschedule.domain.LoanApplicationTerms; import org.apache.fineract.portfolio.loanaccount.loanschedule.domain.LoanScheduleModel; import org.apache.fineract.portfolio.loanaccount.loanschedule.service.LoanScheduleAssembler; +import org.apache.fineract.portfolio.loanproduct.LoanProductConstants; import org.apache.fineract.portfolio.loanproduct.domain.LoanProduct; import org.apache.fineract.portfolio.loanproduct.domain.LoanProductRelatedDetail; import org.apache.fineract.portfolio.loanproduct.domain.LoanProductRepository; @@ -78,6 +81,8 @@ import org.apache.fineract.portfolio.loanproduct.exception.InvalidCurrencyException; import org.apache.fineract.portfolio.loanproduct.exception.LinkedAccountRequiredException; import org.apache.fineract.portfolio.loanproduct.exception.LoanProductNotFoundException; +import org.apache.fineract.portfolio.rate.domain.Rate; +import org.apache.fineract.portfolio.rate.service.RateAssembler; import org.apache.fineract.useradministration.domain.AppUser; import org.joda.time.LocalDate; import org.springframework.beans.factory.annotation.Autowired; @@ -104,6 +109,7 @@ public class LoanAssembler { private final ConfigurationDomainService configurationDomainService; private final WorkingDaysRepositoryWrapper workingDaysRepository; private final LoanUtilService loanUtilService; + private final RateAssembler rateAssembler; @Autowired public LoanAssembler(final FromJsonHelper fromApiJsonHelper, final LoanRepositoryWrapper loanRepository, @@ -115,7 +121,7 @@ public LoanAssembler(final FromJsonHelper fromApiJsonHelper, final LoanRepositor final CollateralAssembler loanCollateralAssembler, final LoanSummaryWrapper loanSummaryWrapper, final LoanRepaymentScheduleTransactionProcessorFactory loanRepaymentScheduleTransactionProcessorFactory, final HolidayRepository holidayRepository, final ConfigurationDomainService configurationDomainService, - final WorkingDaysRepositoryWrapper workingDaysRepository, final LoanUtilService loanUtilService) { + final WorkingDaysRepositoryWrapper workingDaysRepository, final LoanUtilService loanUtilService, RateAssembler rateAssembler) { this.fromApiJsonHelper = fromApiJsonHelper; this.loanRepository = loanRepository; this.loanProductRepository = loanProductRepository; @@ -134,6 +140,7 @@ public LoanAssembler(final FromJsonHelper fromApiJsonHelper, final LoanRepositor this.configurationDomainService = configurationDomainService; this.workingDaysRepository = workingDaysRepository; this.loanUtilService = loanUtilService; + this.rateAssembler = rateAssembler; } public Loan assembleFrom(final Long accountId) { @@ -222,6 +229,9 @@ private Loan assembleApplication(final JsonElement element, final Long clientId, Client client = null; Group group = null; + //Here we add Rates to LoanApplication + final List rates = this.rateAssembler.fromParsedJson(element); + final LoanProductRelatedDetail loanProductRelatedDetail = this.loanScheduleAssembler.assembleLoanProductRelatedDetail(element); final BigDecimal interestRateDifferential = this.fromApiJsonHelper.extractBigDecimalWithLocaleNamed(LoanApiConstants.interestRateDifferentialParameterName, element); @@ -250,21 +260,21 @@ private Loan assembleApplication(final JsonElement element, final Long clientId, loanApplication = Loan.newIndividualLoanApplicationFromGroup(accountNo, client, group, loanType.getId().intValue(), loanProduct, fund, loanOfficer, loanPurpose, loanTransactionProcessingStrategy, loanProductRelatedDetail, loanCharges, collateral, syncDisbursementWithMeeting, fixedEmiAmount, disbursementDetails, maxOutstandingLoanBalance, - createStandingInstructionAtDisbursement, isFloatingInterestRate, interestRateDifferential); + createStandingInstructionAtDisbursement, isFloatingInterestRate, interestRateDifferential, rates); } else if (group != null) { loanApplication = Loan.newGroupLoanApplication(accountNo, group, loanType.getId().intValue(), loanProduct, fund, loanOfficer, loanPurpose, loanTransactionProcessingStrategy, loanProductRelatedDetail, loanCharges, collateral, syncDisbursementWithMeeting, fixedEmiAmount, disbursementDetails, maxOutstandingLoanBalance, - createStandingInstructionAtDisbursement,isFloatingInterestRate, interestRateDifferential); + createStandingInstructionAtDisbursement,isFloatingInterestRate, interestRateDifferential, rates); } else if (client != null) { loanApplication = Loan.newIndividualLoanApplication(accountNo, client, loanType.getId().intValue(), loanProduct, fund, loanOfficer, loanPurpose, loanTransactionProcessingStrategy, loanProductRelatedDetail, loanCharges, collateral, fixedEmiAmount, disbursementDetails, maxOutstandingLoanBalance, createStandingInstructionAtDisbursement, - isFloatingInterestRate, interestRateDifferential); + isFloatingInterestRate, interestRateDifferential, rates); } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanChargePaidByReadPlatformService.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanChargePaidByReadPlatformService.java new file mode 100644 index 00000000000..1ca6dc1728a --- /dev/null +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanChargePaidByReadPlatformService.java @@ -0,0 +1,27 @@ +/** + * 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. + */ +package org.apache.fineract.portfolio.loanaccount.service; + +import java.util.List; +import org.apache.fineract.portfolio.loanaccount.data.LoanChargePaidByData; + +public interface LoanChargePaidByReadPlatformService { + + List getLoanChargesPaidByTransactionId(Long id); +} diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanChargePaidByReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanChargePaidByReadPlatformServiceImpl.java new file mode 100644 index 00000000000..60cafe089c0 --- /dev/null +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanChargePaidByReadPlatformServiceImpl.java @@ -0,0 +1,82 @@ +/** + * 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. + */ + +package org.apache.fineract.portfolio.loanaccount.service; + +import java.math.BigDecimal; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.List; +import org.apache.fineract.infrastructure.core.service.RoutingDataSource; +import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext; +import org.apache.fineract.portfolio.loanaccount.data.LoanChargePaidByData; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.jdbc.core.JdbcTemplate; +import org.springframework.jdbc.core.RowMapper; +import org.springframework.stereotype.Service; + +@Service +public class LoanChargePaidByReadPlatformServiceImpl implements + LoanChargePaidByReadPlatformService { + + private final JdbcTemplate jdbcTemplate; + private final PlatformSecurityContext context; + + @Autowired + public LoanChargePaidByReadPlatformServiceImpl(final PlatformSecurityContext context, + final RoutingDataSource dataSource) { + this.context = context; + this.jdbcTemplate = new JdbcTemplate(dataSource); + + } + + @Override + public List getLoanChargesPaidByTransactionId(Long transactionId) { + this.context.authenticatedUser(); + final LoanChargePaidByMapper rm = new LoanChargePaidByMapper(); + final String sql = "select " + rm.loanChargePaidBySchema() + " where lcpd.loan_transaction_id = ?"; + return this.jdbcTemplate.query(sql, rm, new Object[]{transactionId}); + } + + private static final class LoanChargePaidByMapper implements RowMapper { + + public String loanChargePaidBySchema() { + return "lcpd.id as id, lcpd.amount as amount, lcpd.installment_number as installmentNumber," + + " lcpd.loan_charge_id as chargeId, lcpd.loan_transaction_id as transactionId, " + + " c.name as chargeName" + + " from m_loan_charge_paid_by lcpd" + + " join m_loan_charge lc on lc.id=lcpd.loan_charge_Id" + + " join m_charge c on c.id=lc.charge_id"; + } + + @Override + public LoanChargePaidByData mapRow(ResultSet rs, @SuppressWarnings("unused") int rowNum) + throws SQLException { + final Long id = rs.getLong("id"); + final BigDecimal amount = rs.getBigDecimal("amount"); + final Integer installmentNumber = rs.getInt("installmentNumber"); + final Long chargeId = rs.getLong("chargeId"); + final Long transactionId = rs.getLong("transactionId"); + final String chargeName = rs.getString("chargeName"); + return new LoanChargePaidByData(id, amount, installmentNumber, chargeId, transactionId, chargeName); + } + + } + +} diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/LoanProductConstants.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/LoanProductConstants.java index 471d4f963b3..068ee9e25a1 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/LoanProductConstants.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/LoanProductConstants.java @@ -134,5 +134,6 @@ public interface LoanProductConstants { public static final String isEqualAmortizationParam = "isEqualAmortization"; + public static final String ratesParamName = "rates"; } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/api/LoanProductsApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/api/LoanProductsApiResource.java index 376ea36b10e..7d792465c45 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/api/LoanProductsApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/api/LoanProductsApiResource.java @@ -52,6 +52,7 @@ import org.apache.fineract.commands.domain.CommandWrapper; import org.apache.fineract.commands.service.CommandWrapperBuilder; import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; +import org.apache.fineract.infrastructure.configuration.domain.ConfigurationDomainService; import org.apache.fineract.infrastructure.core.api.ApiParameterHelper; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; @@ -77,6 +78,8 @@ import org.apache.fineract.portfolio.loanproduct.service.LoanProductReadPlatformService; import org.apache.fineract.portfolio.paymenttype.data.PaymentTypeData; import org.apache.fineract.portfolio.paymenttype.service.PaymentTypeReadPlatformService; +import org.apache.fineract.portfolio.rate.data.RateData; +import org.apache.fineract.portfolio.rate.service.RateReadService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Component; @@ -102,7 +105,8 @@ public class LoanProductsApiResource { "interestCalculationPeriodTypeOptions", "transactionProcessingStrategyOptions", "chargeOptions", "accountingOptions", "accountingRuleOptions", "accountingMappingOptions", "floatingRateOptions", "isLinkedToFloatingInterestRates", "floatingRatesId", "interestRateDifferential", "minDifferentialLendingRate", "defaultDifferentialLendingRate", - "maxDifferentialLendingRate", "isFloatingInterestRateCalculationAllowed", LoanProductConstants.canUseForTopup, LoanProductConstants.isEqualAmortizationParam)); + "maxDifferentialLendingRate", "isFloatingInterestRateCalculationAllowed", LoanProductConstants.canUseForTopup, LoanProductConstants.isEqualAmortizationParam, + LoanProductConstants.ratesParamName)); private final Set PRODUCT_MIX_DATA_PARAMETERS = new HashSet<>(Arrays.asList("productId", "productName", "restrictedProducts", "allowedProducts", "productOptions")); @@ -125,6 +129,9 @@ public class LoanProductsApiResource { private final DropdownReadPlatformService commonDropdownReadPlatformService; private final PaymentTypeReadPlatformService paymentTypeReadPlatformService; private final FloatingRatesReadPlatformService floatingRateReadPlatformService; + private final RateReadService rateReadService; + private final ConfigurationDomainService configurationDomainService; + @Autowired public LoanProductsApiResource(final PlatformSecurityContext context, final LoanProductReadPlatformService readPlatformService, @@ -139,7 +146,8 @@ public LoanProductsApiResource(final PlatformSecurityContext context, final Loan final ProductMixReadPlatformService productMixReadPlatformService, final DropdownReadPlatformService commonDropdownReadPlatformService, PaymentTypeReadPlatformService paymentTypeReadPlatformService, - final FloatingRatesReadPlatformService floatingRateReadPlatformService) { + final FloatingRatesReadPlatformService floatingRateReadPlatformService, final RateReadService rateReadService, + final ConfigurationDomainService configurationDomainService) { this.context = context; this.loanProductReadPlatformService = readPlatformService; this.chargeReadPlatformService = chargeReadPlatformService; @@ -156,6 +164,8 @@ public LoanProductsApiResource(final PlatformSecurityContext context, final Loan this.commonDropdownReadPlatformService = commonDropdownReadPlatformService; this.paymentTypeReadPlatformService = paymentTypeReadPlatformService; this.floatingRateReadPlatformService = floatingRateReadPlatformService; + this.rateReadService = rateReadService; + this.configurationDomainService = configurationDomainService; } @POST @@ -288,6 +298,12 @@ private LoanProductData handleTemplate(final LoanProductData productData) { penaltyOptions = null; } + boolean isRatesEnabled = this.configurationDomainService.isSubRatesEnabled(); + Collection rateOptions = this.rateReadService.retrieveLoanApplicableRates(); + if(rateOptions.isEmpty()){ + rateOptions = null; + } + final Collection currencyOptions = this.currencyReadPlatformService.retrieveAllowedCurrencies(); final List amortizationTypeOptions = this.dropdownReadPlatformService.retrieveLoanAmortizationTypeOptions(); final List interestTypeOptions = this.dropdownReadPlatformService.retrieveLoanInterestTypeOptions(); @@ -331,11 +347,11 @@ private LoanProductData handleTemplate(final LoanProductData productData) { return new LoanProductData(productData, chargeOptions, penaltyOptions, paymentTypeOptions, currencyOptions, amortizationTypeOptions, interestTypeOptions, interestCalculationPeriodTypeOptions, repaymentFrequencyTypeOptions, - interestRateFrequencyTypeOptions, fundOptions, transactionProcessingStrategyOptions, accountOptions, + interestRateFrequencyTypeOptions, fundOptions, transactionProcessingStrategyOptions, rateOptions, accountOptions, accountingRuleTypeOptions, loanCycleValueConditionTypeOptions, daysInMonthTypeOptions, daysInYearTypeOptions, interestRecalculationCompoundingTypeOptions, rescheduleStrategyTypeOptions, interestRecalculationFrequencyTypeOptions, preCloseInterestCalculationStrategyOptions, floatingRateOptions, interestRecalculationNthDayTypeOptions, - interestRecalculationDayOfWeekTypeOptions); + interestRecalculationDayOfWeekTypeOptions, isRatesEnabled); } } \ No newline at end of file diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/data/LoanProductData.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/data/LoanProductData.java index 92e4b5a8311..dd9b83fd5c8 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/data/LoanProductData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/data/LoanProductData.java @@ -47,6 +47,7 @@ import org.apache.fineract.portfolio.loanproduct.domain.LoanProductConfigurableAttributes; import org.apache.fineract.portfolio.loanproduct.service.LoanEnumerations; import org.apache.fineract.portfolio.paymenttype.data.PaymentTypeData; +import org.apache.fineract.portfolio.rate.data.RateData; import org.joda.time.LocalDate; import org.springframework.util.CollectionUtils; @@ -133,6 +134,10 @@ public class LoanProductData implements Serializable { private Collection feeToIncomeAccountMappings; private Collection penaltyToIncomeAccountMappings; + // rates + private final boolean isRatesEnabled; + private final Collection rates; + // template related private final Collection fundOptions; @SuppressWarnings("unused") @@ -146,6 +151,7 @@ public class LoanProductData implements Serializable { private final List interestCalculationPeriodTypeOptions; private final Collection transactionProcessingStrategyOptions; private final Collection chargeOptions; + private final Collection rateOptions; @SuppressWarnings("unused") private final Collection penaltyOptions; @SuppressWarnings("unused") @@ -261,6 +267,9 @@ public static LoanProductData lookup(final Long id, final String name, final Boo final boolean syncExpectedWithDisbursementDate = false; final boolean canUseForTopup = false; final boolean isEqualAmortization = false; + final Collection rateOptions = null; + final Collection rates = null; + final boolean isRatesEnabled= false; return new LoanProductData(id, name, shortName, description, currency, principal, minPrincipal, maxPrincipal, tolerance, numberOfRepayments, minNumberOfRepayments, maxNumberOfRepayments, repaymentEvery, interestRatePerPeriod, minInterestRatePerPeriod, maxInterestRatePerPeriod, annualInterestRate, repaymentFrequencyType, interestRateFrequencyType, @@ -275,7 +284,7 @@ public static LoanProductData lookup(final Long id, final String name, final Boo loanProductConfigurableAttributes, isLinkedToFloatingInterestRates, floatingRateId, floatingRateName, interestRateDifferential, minDifferentialLendingRate, defaultDifferentialLendingRate, maxDifferentialLendingRate, isFloatingInterestRateCalculationAllowed, isVariableInstallmentsAllowed, minimumGap, maximumGap, - syncExpectedWithDisbursementDate, canUseForTopup, isEqualAmortization); + syncExpectedWithDisbursementDate, canUseForTopup, isEqualAmortization, rateOptions, rates, isRatesEnabled); } @@ -353,6 +362,9 @@ public static LoanProductData lookupWithCurrency(final Long id, final String nam final boolean syncExpectedWithDisbursementDate = false; final boolean canUseForTopup = false; final boolean isEqualAmortization = false; + final Collection rateOptions = null; + final Collection rates = null; + final boolean isRatesEnabled = false; return new LoanProductData(id, name, shortName, description, currency, principal, minPrincipal, maxPrincipal, tolerance, numberOfRepayments, minNumberOfRepayments, maxNumberOfRepayments, repaymentEvery, interestRatePerPeriod, @@ -368,7 +380,7 @@ public static LoanProductData lookupWithCurrency(final Long id, final String nam loanProductConfigurableAttributes, isLinkedToFloatingInterestRates, floatingRateId, floatingRateName, interestRateDifferential, minDifferentialLendingRate, defaultDifferentialLendingRate, maxDifferentialLendingRate, isFloatingInterestRateCalculationAllowed, isVariableInstallmentsAllowed, minimumGap, maximumGap, - syncExpectedWithDisbursementDate, canUseForTopup, isEqualAmortization); + syncExpectedWithDisbursementDate, canUseForTopup, isEqualAmortization, rateOptions, rates, isRatesEnabled); } @@ -453,6 +465,9 @@ public static LoanProductData sensibleDefaultsForNewLoanProductCreation() { final boolean syncExpectedWithDisbursementDate = false; final boolean canUseForTopup = false; final boolean isEqualAmortization = false; + final Collection rateOptions = null; + final Collection rates = null; + final boolean isRatesEnabled = false; return new LoanProductData(id, name, shortName, description, currency, principal, minPrincipal, maxPrincipal, tolerance, numberOfRepayments, minNumberOfRepayments, maxNumberOfRepayments, repaymentEvery, interestRatePerPeriod, @@ -468,7 +483,7 @@ public static LoanProductData sensibleDefaultsForNewLoanProductCreation() { installmentAmountInMultiplesOf, loanProductConfigurableAttributes, isLinkedToFloatingInterestRates, floatingRateId, floatingRateName, interestRateDifferential, minDifferentialLendingRate, defaultDifferentialLendingRate, maxDifferentialLendingRate, isFloatingInterestRateCalculationAllowed, isVariableInstallmentsAllowed, minimumGap, maximumGap, - syncExpectedWithDisbursementDate, canUseForTopup, isEqualAmortization); + syncExpectedWithDisbursementDate, canUseForTopup, isEqualAmortization, rateOptions, rates, isRatesEnabled); } @@ -547,6 +562,9 @@ public static LoanProductData loanProductWithFloatingRates(final Long id, final final boolean syncExpectedWithDisbursementDate = false; final boolean canUseForTopup = false; final boolean isEqualAmortization = false; + final Collection rateOptions = null; + final Collection rates = null; + final boolean isRatesEnabled = false; return new LoanProductData(id, name, shortName, description, currency, principal, minPrincipal, maxPrincipal, tolerance, numberOfRepayments, minNumberOfRepayments, maxNumberOfRepayments, repaymentEvery, interestRatePerPeriod, @@ -562,7 +580,7 @@ public static LoanProductData loanProductWithFloatingRates(final Long id, final installmentAmountInMultiplesOf, loanProductConfigurableAttributes, isLinkedToFloatingInterestRates, floatingRateId, floatingRateName, interestRateDifferential, minDifferentialLendingRate, defaultDifferentialLendingRate, maxDifferentialLendingRate, isFloatingInterestRateCalculationAllowed, isVariableInstallmentsAllowed, minimumGap, maximumGap, - syncExpectedWithDisbursementDate, canUseForTopup, isEqualAmortization); + syncExpectedWithDisbursementDate, canUseForTopup, isEqualAmortization, rateOptions, rates, isRatesEnabled); } @@ -601,7 +619,8 @@ public LoanProductData(final Long id, final String name, final String shortName, BigDecimal minDifferentialLendingRate, BigDecimal defaultDifferentialLendingRate, BigDecimal maxDifferentialLendingRate, boolean isFloatingInterestRateCalculationAllowed, final boolean isVariableInstallmentsAllowed, final Integer minimumGapBetweenInstallments, final Integer maximumGapBetweenInstallments, - final boolean syncExpectedWithDisbursementDate, final boolean canUseForTopup, final boolean isEqualAmortization) { + final boolean syncExpectedWithDisbursementDate, final boolean canUseForTopup, final boolean isEqualAmortization, Collection rateOptions, Collection rates, + final boolean isRatesEnabled) { this.id = id; this.name = name; this.shortName = shortName; @@ -653,6 +672,9 @@ public LoanProductData(final Long id, final String name, final String shortName, this.status = status; this.externalId = externalId; this.minimumDaysBetweenDisbursalAndFirstRepayment = minimumDaysBetweenDisbursalAndFirstRepayment; + this.rateOptions = rateOptions; + this.rates = rates; + this.isRatesEnabled = isRatesEnabled; this.chargeOptions = null; this.penaltyOptions = null; @@ -715,7 +737,7 @@ public LoanProductData(final LoanProductData productData, final Collection interestTypeOptions, final List interestCalculationPeriodTypeOptions, final List repaymentFrequencyTypeOptions, final List interestRateFrequencyTypeOptions, final Collection fundOptions, final Collection transactionStrategyOptions, - final Map> accountingMappingOptions, final List accountingRuleOptions, + final Collection rateOptions, final Map> accountingMappingOptions, final List accountingRuleOptions, final List valueConditionTypeOptions, final List daysInMonthTypeOptions, final List daysInYearTypeOptions, final List interestRecalculationCompoundingTypeOptions, final List rescheduleStrategyTypeOptions, final List interestRecalculationFrequencyTypeOptions, @@ -780,6 +802,7 @@ public LoanProductData(final LoanProductData productData, final Collection listOfOptions = new ArrayList<>(this.transactionProcessingStrategyOptions); @@ -843,6 +866,8 @@ public LoanProductData(final LoanProductData productData, final Collection nullIfEmpty(final Collection charges) { @@ -1198,9 +1223,9 @@ public boolean syncExpectedWithDisbursementDate() { return syncExpectedWithDisbursementDate; } - public boolean canUseForTopup() { - return this.canUseForTopup; - } + public boolean canUseForTopup() { + return this.canUseForTopup; + } public BigDecimal getInterestRateDifferential() { return this.interestRateDifferential; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProduct.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProduct.java index 8aaaa2d9163..d64dd567123 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProduct.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProduct.java @@ -61,6 +61,7 @@ import org.apache.fineract.portfolio.fund.domain.Fund; import org.apache.fineract.portfolio.loanaccount.loanschedule.domain.AprCalculator; import org.apache.fineract.portfolio.loanproduct.LoanProductConstants; +import org.apache.fineract.portfolio.rate.domain.Rate; import org.joda.time.LocalDate; /** @@ -99,6 +100,10 @@ public class LoanProduct extends AbstractPersistableCustom { @JoinTable(name = "m_product_loan_charge", joinColumns = @JoinColumn(name = "product_loan_id"), inverseJoinColumns = @JoinColumn(name = "charge_id")) private List charges; + @ManyToMany(fetch = FetchType.LAZY) + @JoinTable(name = "m_product_loan_rate", joinColumns = @JoinColumn(name = "product_loan_id"), inverseJoinColumns = @JoinColumn(name = "rate_id")) + private List rates; + @Embedded private LoanProductRelatedDetail loanProductRelatedDetail; @@ -184,7 +189,8 @@ public class LoanProduct extends AbstractPersistableCustom { private boolean isEqualAmortization = false; public static LoanProduct assembleFromJson(final Fund fund, final LoanTransactionProcessingStrategy loanTransactionProcessingStrategy, - final List productCharges, final JsonCommand command, final AprCalculator aprCalculator, FloatingRate floatingRate) { + final List productCharges, final JsonCommand command, final AprCalculator aprCalculator, FloatingRate floatingRate, + final List productRates) { final String name = command.stringValueOfParameterNamed("name"); final String shortName = command.stringValueOfParameterNamed(LoanProductConstants.shortName); @@ -350,7 +356,7 @@ public static LoanProduct assembleFromJson(final Fund fund, final LoanTransactio installmentAmountInMultiplesOf, loanConfigurableAttributes, isLinkedToFloatingInterestRates, floatingRate, interestRateDifferential, minDifferentialLendingRate, maxDifferentialLendingRate, defaultDifferentialLendingRate, isFloatingInterestRateCalculationAllowed, isVariableInstallmentsAllowed, minimumGapBetweenInstallments, - maximumGapBetweenInstallments, syncExpectedWithDisbursementDate, canUseForTopup, isEqualAmortization); + maximumGapBetweenInstallments, syncExpectedWithDisbursementDate, canUseForTopup, isEqualAmortization, productRates); } @@ -580,7 +586,7 @@ public LoanProduct(final Fund fund, final LoanTransactionProcessingStrategy tran BigDecimal minDifferentialLendingRate, BigDecimal maxDifferentialLendingRate, BigDecimal defaultDifferentialLendingRate, Boolean isFloatingInterestRateCalculationAllowed, final Boolean isVariableInstallmentsAllowed, final Integer minimumGapBetweenInstallments, final Integer maximumGapBetweenInstallments, - final boolean syncExpectedWithDisbursementDate, final boolean canUseForTopup, final boolean isEqualAmortization) { + final boolean syncExpectedWithDisbursementDate, final boolean canUseForTopup, final boolean isEqualAmortization, final List rates) { this.fund = fund; this.transactionProcessingStrategy = transactionProcessingStrategy; this.name = name.trim(); @@ -658,6 +664,10 @@ public LoanProduct(final Fund fund, final LoanTransactionProcessingStrategy tran syncExpectedWithDisbursementDate; this.canUseForTopup = canUseForTopup; this.isEqualAmortization = isEqualAmortization; + + if(rates != null){ + this.rates = rates; + } } public MonetaryCurrency getCurrency() { @@ -699,6 +709,25 @@ public boolean update(final List newProductCharges) { return updated; } + public boolean updateRates(final List newProductRates) { + if (newProductRates == null) { return false; } + + boolean updated = false; + if (this.rates != null) { + final Set currentSetOfCharges = new HashSet<>(this.rates); + final Set newSetOfCharges = new HashSet<>(newProductRates); + + if (!currentSetOfCharges.equals(newSetOfCharges)) { + updated = true; + this.rates = newProductRates; + } + } else { + updated = true; + this.rates = newProductRates; + } + return updated; + } + public Integer getAccountingType() { return this.accountingRule; } @@ -1043,6 +1072,13 @@ public Map update(final JsonCommand command, final AprCalculator this.canUseForTopup = newValue; } + if (command.hasParameter(LoanProductConstants.ratesParamName)) { + final JsonArray jsonArray = command.arrayOfParameterNamed(LoanProductConstants.ratesParamName); + if (jsonArray != null) { + actualChanges.put(LoanProductConstants.ratesParamName, command.jsonFragment(LoanProductConstants.ratesParamName)); + } + } + return actualChanges; } @@ -1379,4 +1415,13 @@ public void setEqualAmortization(boolean isEqualAmortization) { this.isEqualAmortization = isEqualAmortization; } + + public List getRates() { + return rates; + } + + public void setRates(List rates) { + this.rates = rates; + } + } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProductMinMaxConstraints.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProductMinMaxConstraints.java index 73a239fe269..1e8ece97b1e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProductMinMaxConstraints.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProductMinMaxConstraints.java @@ -163,4 +163,12 @@ public void updateForFloatingInterestRates() { this.maxNominalInterestRatePerPeriod = null; } + + public void setMinNominalInterestRatePerPeriod(BigDecimal minNominalInterestRatePerPeriod) { + this.minNominalInterestRatePerPeriod = minNominalInterestRatePerPeriod; + } + + public void setMaxNominalInterestRatePerPeriod(BigDecimal maxNominalInterestRatePerPeriod) { + this.maxNominalInterestRatePerPeriod = maxNominalInterestRatePerPeriod; + } } \ No newline at end of file diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProductRelatedDetail.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProductRelatedDetail.java index cc0860a64a0..5846f728dd6 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProductRelatedDetail.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProductRelatedDetail.java @@ -666,4 +666,7 @@ public void setEqualAmortization(boolean isEqualAmortization) { this.isEqualAmortization = isEqualAmortization; } + public void setNominalInterestRatePerPeriod(BigDecimal nominalInterestRatePerPeriod) { + this.nominalInterestRatePerPeriod = nominalInterestRatePerPeriod; + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/serialization/LoanProductDataValidator.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/serialization/LoanProductDataValidator.java index 479429870d7..d676f9aa306 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/serialization/LoanProductDataValidator.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/serialization/LoanProductDataValidator.java @@ -106,7 +106,8 @@ public final class LoanProductDataValidator { LoanProductConstants.recalculationRestFrequencyWeekdayParamName, LoanProductConstants.recalculationRestFrequencyNthDayParamName, LoanProductConstants.recalculationRestFrequencyOnDayParamName, LoanProductConstants.isCompoundingToBePostedAsTransactionParamName, LoanProductConstants.allowCompoundingOnEodParamName, - LoanProductConstants.canUseForTopup, LoanProductConstants.isEqualAmortizationParam)); + LoanProductConstants.canUseForTopup, LoanProductConstants.isEqualAmortizationParam, + LoanProductConstants.ratesParamName)); private static final String[] supportedloanConfigurableAttributes = {LoanProductConstants.amortizationTypeParamName, LoanProductConstants.interestTypeParamName, LoanProductConstants.transactionProcessingStrategyIdParamName, diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/service/LoanProductReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/service/LoanProductReadPlatformServiceImpl.java index cb6283954df..36a8c4c7b7e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/service/LoanProductReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/service/LoanProductReadPlatformServiceImpl.java @@ -42,6 +42,8 @@ import org.apache.fineract.portfolio.loanproduct.domain.LoanProductConfigurableAttributes; import org.apache.fineract.portfolio.loanproduct.domain.LoanProductParamType; import org.apache.fineract.portfolio.loanproduct.exception.LoanProductNotFoundException; +import org.apache.fineract.portfolio.rate.data.RateData; +import org.apache.fineract.portfolio.rate.service.RateReadService; import org.joda.time.LocalDate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.dao.EmptyResultDataAccessException; @@ -55,16 +57,18 @@ public class LoanProductReadPlatformServiceImpl implements LoanProductReadPlatfo private final PlatformSecurityContext context; private final JdbcTemplate jdbcTemplate; private final ChargeReadPlatformService chargeReadPlatformService; + private final RateReadService rateReadService; private final FineractEntityAccessUtil fineractEntityAccessUtil; @Autowired public LoanProductReadPlatformServiceImpl(final PlatformSecurityContext context, final ChargeReadPlatformService chargeReadPlatformService, final RoutingDataSource dataSource, - final FineractEntityAccessUtil fineractEntityAccessUtil) { + final FineractEntityAccessUtil fineractEntityAccessUtil, final RateReadService rateReadService) { this.context = context; this.chargeReadPlatformService = chargeReadPlatformService; this.jdbcTemplate = new JdbcTemplate(dataSource); this.fineractEntityAccessUtil = fineractEntityAccessUtil; + this.rateReadService=rateReadService; } @Override @@ -72,8 +76,9 @@ public LoanProductData retrieveLoanProduct(final Long loanProductId) { try { final Collection charges = this.chargeReadPlatformService.retrieveLoanProductCharges(loanProductId); + final Collection rates = this.rateReadService.retrieveProductLoanRates(loanProductId); final Collection borrowerCycleVariationDatas = retrieveLoanProductBorrowerCycleVariations(loanProductId); - final LoanProductMapper rm = new LoanProductMapper(charges, borrowerCycleVariationDatas); + final LoanProductMapper rm = new LoanProductMapper(charges, borrowerCycleVariationDatas, rates); final String sql = "select " + rm.loanProductSchema() + " where lp.id = ?"; return this.jdbcTemplate.queryForObject(sql, rm, new Object[] { loanProductId }); @@ -95,7 +100,7 @@ public Collection retrieveAllLoanProducts() { this.context.authenticatedUser(); - final LoanProductMapper rm = new LoanProductMapper(null, null); + final LoanProductMapper rm = new LoanProductMapper(null, null, null); String sql = "select " + rm.loanProductSchema(); @@ -172,10 +177,13 @@ private static final class LoanProductMapper implements RowMapper borrowerCycleVariationDatas; + private final Collection rates; + public LoanProductMapper(final Collection charges, - final Collection borrowerCycleVariationDatas) { + final Collection borrowerCycleVariationDatas, final Collection rates) { this.charges = charges; this.borrowerCycleVariationDatas = borrowerCycleVariationDatas; + this.rates = rates; } public String loanProductSchema() { @@ -448,6 +456,8 @@ public LoanProductData mapRow(final ResultSet rs, @SuppressWarnings("unused") fi final boolean syncExpectedWithDisbursementDate = rs.getBoolean("syncExpectedWithDisbursementDate"); final boolean canUseForTopup = rs.getBoolean("canUseForTopup"); + final Collection rateOptions= null; + final boolean isRatesEnabled = false; return new LoanProductData(id, name, shortName, description, currency, principal, minPrincipal, maxPrincipal, tolerance, numberOfRepayments, minNumberOfRepayments, maxNumberOfRepayments, repaymentEvery, interestRatePerPeriod, @@ -464,7 +474,7 @@ public LoanProductData mapRow(final ResultSet rs, @SuppressWarnings("unused") fi installmentAmountInMultiplesOf, allowAttributeOverrides, isLinkedToFloatingInterestRates, floatingRateId, floatingRateName, interestRateDifferential, minDifferentialLendingRate, defaultDifferentialLendingRate, maxDifferentialLendingRate, isFloatingInterestRateCalculationAllowed, isVariableIntallmentsAllowed, minimumGap, - maximumGap, syncExpectedWithDisbursementDate, canUseForTopup, isEqualAmortization); + maximumGap, syncExpectedWithDisbursementDate, canUseForTopup, isEqualAmortization, rateOptions, this.rates, isRatesEnabled); } } @@ -534,7 +544,7 @@ public LoanProductBorrowerCycleVariationData mapRow(final ResultSet rs, @Suppres public Collection retrieveAllLoanProductsForCurrency(String currencyCode) { this.context.authenticatedUser(); - final LoanProductMapper rm = new LoanProductMapper(null, null); + final LoanProductMapper rm = new LoanProductMapper(null, null, null); String sql = "select " + rm.loanProductSchema() + " where lp.currency_code= ? "; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/service/LoanProductWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/service/LoanProductWritePlatformServiceJpaRepositoryImpl.java index c37087b327e..17e00a69a0e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/service/LoanProductWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/service/LoanProductWritePlatformServiceJpaRepositoryImpl.java @@ -49,6 +49,7 @@ import org.apache.fineract.portfolio.loanaccount.domain.LoanTransactionProcessingStrategyRepository; import org.apache.fineract.portfolio.loanaccount.exception.LoanTransactionProcessingStrategyNotFoundException; import org.apache.fineract.portfolio.loanaccount.loanschedule.domain.AprCalculator; +import org.apache.fineract.portfolio.loanproduct.LoanProductConstants; import org.apache.fineract.portfolio.loanproduct.domain.LoanProduct; import org.apache.fineract.portfolio.loanproduct.domain.LoanProductRepository; import org.apache.fineract.portfolio.loanproduct.domain.LoanTransactionProcessingStrategy; @@ -57,6 +58,8 @@ import org.apache.fineract.portfolio.loanproduct.exception.LoanProductDateException; import org.apache.fineract.portfolio.loanproduct.exception.LoanProductNotFoundException; import org.apache.fineract.portfolio.loanproduct.serialization.LoanProductDataValidator; +import org.apache.fineract.portfolio.rate.domain.Rate; +import org.apache.fineract.portfolio.rate.domain.RateRepositoryWrapper; import org.joda.time.LocalDate; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -76,6 +79,7 @@ public class LoanProductWritePlatformServiceJpaRepositoryImpl implements LoanPro private final FundRepository fundRepository; private final LoanTransactionProcessingStrategyRepository loanTransactionProcessingStrategyRepository; private final ChargeRepositoryWrapper chargeRepository; + private final RateRepositoryWrapper rateRepository; private final ProductToGLAccountMappingWritePlatformService accountMappingWritePlatformService; private final FineractEntityAccessUtil fineractEntityAccessUtil; private final FloatingRateRepositoryWrapper floatingRateRepository; @@ -87,7 +91,7 @@ public LoanProductWritePlatformServiceJpaRepositoryImpl(final PlatformSecurityCo final LoanProductDataValidator fromApiJsonDeserializer, final LoanProductRepository loanProductRepository, final AprCalculator aprCalculator, final FundRepository fundRepository, final LoanTransactionProcessingStrategyRepository loanTransactionProcessingStrategyRepository, - final ChargeRepositoryWrapper chargeRepository, + final ChargeRepositoryWrapper chargeRepository, final RateRepositoryWrapper rateRepository, final ProductToGLAccountMappingWritePlatformService accountMappingWritePlatformService, final FineractEntityAccessUtil fineractEntityAccessUtil, final FloatingRateRepositoryWrapper floatingRateRepository, @@ -100,6 +104,7 @@ public LoanProductWritePlatformServiceJpaRepositoryImpl(final PlatformSecurityCo this.fundRepository = fundRepository; this.loanTransactionProcessingStrategyRepository = loanTransactionProcessingStrategyRepository; this.chargeRepository = chargeRepository; + this.rateRepository = rateRepository; this.accountMappingWritePlatformService = accountMappingWritePlatformService; this.fineractEntityAccessUtil = fineractEntityAccessUtil; this.floatingRateRepository = floatingRateRepository; @@ -125,6 +130,7 @@ public CommandProcessingResult createLoanProduct(final JsonCommand command) { final String currencyCode = command.stringValueOfParameterNamed("currencyCode"); final List charges = assembleListOfProductCharges(command, currencyCode); + final List rates = assembleListOfProductRates(command); FloatingRate floatingRate = null; if(command.parameterExists("floatingRatesId")){ @@ -132,7 +138,7 @@ public CommandProcessingResult createLoanProduct(final JsonCommand command) { .findOneWithNotFoundDetection(command.longValueOfParameterNamed("floatingRatesId")); } final LoanProduct loanproduct = LoanProduct.assembleFromJson(fund, loanTransactionProcessingStrategy, charges, command, - this.aprCalculator, floatingRate); + this.aprCalculator, floatingRate, rates); loanproduct.updateLoanProductInRelatedClasses(); this.loanProductRepository.save(loanproduct); @@ -237,6 +243,14 @@ public CommandProcessingResult updateLoanProduct(final Long loanProductId, final .updateLoanProductToGLAccountMapping(product.getId(), command, accountingTypeChanged, product.getAccountingType()); changes.putAll(accountingMappingChanges); + if (changes.containsKey(LoanProductConstants.ratesParamName)) { + final List productRates = assembleListOfProductRates(command); + final boolean updated = product.updateRates(productRates); + if (!updated) { + changes.remove(LoanProductConstants.ratesParamName); + } + } + if (!changes.isEmpty()) { this.loanProductRepository.saveAndFlush(product); } @@ -299,6 +313,28 @@ private List assembleListOfProductCharges(final JsonCommand command, fin return charges; } + private List assembleListOfProductRates(final JsonCommand command) { + + final List rates = new ArrayList<>(); + + if (command.parameterExists("rates")) { + final JsonArray ratesArray = command.arrayOfParameterNamed("rates"); + if (ratesArray != null) { + List idList = new ArrayList<>(); + for (int i = 0; i < ratesArray.size(); i++) { + + final JsonObject jsonObject = ratesArray.get(i).getAsJsonObject(); + if (jsonObject.has("id")) { + idList.add(jsonObject.get("id").getAsLong()); + } + } + rates.addAll(this.rateRepository.findMultipleWithNotFoundDetection(idList)); + } + } + + return rates; + } + /* * Guaranteed to throw an exception no matter what the data integrity issue * is. diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/api/RateApiConstants.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/api/RateApiConstants.java new file mode 100644 index 00000000000..20d64d651ad --- /dev/null +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/api/RateApiConstants.java @@ -0,0 +1,29 @@ +/** + * 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. + */ +package org.apache.fineract.portfolio.rate.api; + +public class RateApiConstants { + + public static final String approveUserIdParamName = "approveUserId"; + public static final String rate = "rate"; + public static final String rateName = "name"; + public static final String ratePercentage = "percentage"; + public static final String rateProductApply = "productApply"; + +} diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/api/RateApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/api/RateApiResource.java new file mode 100644 index 00000000000..801583163ba --- /dev/null +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/api/RateApiResource.java @@ -0,0 +1,137 @@ +/** + * 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. + */ + +package org.apache.fineract.portfolio.rate.api; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.UriInfo; +import org.apache.fineract.commands.domain.CommandWrapper; +import org.apache.fineract.commands.service.CommandWrapperBuilder; +import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; +import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; +import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; +import org.apache.fineract.infrastructure.core.serialization.ApiRequestJsonSerializationSettings; +import org.apache.fineract.infrastructure.core.serialization.DefaultToApiJsonSerializer; +import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext; +import org.apache.fineract.portfolio.rate.data.RateData; +import org.apache.fineract.portfolio.rate.service.RateReadService; +import org.apache.fineract.portfolio.rate.service.RateWriteService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Component; + +import javax.ws.rs.*; +import javax.ws.rs.core.MediaType; +import java.util.Collection; + +/** + * Bowpi GT Created by Jose on 19/07/2017. + */ + +@Path("/rates") +@Component +@Scope("singleton") +public class RateApiResource { + + private final Set RESPONSE_DATA_PARAMETERS = new HashSet<>( + Arrays.asList("id", "name", "percentage", "productApply", "active")); + private final String resourceNameForPermissions = "RATE"; + private final PlatformSecurityContext context; + private final RateReadService readPlatformService; + private final DefaultToApiJsonSerializer toApiJsonSerializer; + private final ApiRequestParameterHelper apiRequestParameterHelper; + private final PortfolioCommandSourceWritePlatformService commandsSourceWritePlatformService; + + @Autowired + public RateApiResource(final PlatformSecurityContext context, + final RateReadService rateReadService, + final DefaultToApiJsonSerializer toApiJsonSerializer, + final ApiRequestParameterHelper apiRequestParameterHelper, + final PortfolioCommandSourceWritePlatformService commandsSourceWritePlatformService) { + this.context = context; + this.readPlatformService = rateReadService; + this.toApiJsonSerializer = toApiJsonSerializer; + this.apiRequestParameterHelper = apiRequestParameterHelper; + this.commandsSourceWritePlatformService = commandsSourceWritePlatformService; + } + + @GET + @Path("{rateId}") + @Consumes({MediaType.APPLICATION_JSON}) + @Produces({MediaType.APPLICATION_JSON}) + public String retrieveRate(@PathParam("rateId") Long rateId, @Context final UriInfo uriInfo) { + + this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions); + + final RateData rate = this.readPlatformService.retrieveOne(rateId); + + final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper + .process(uriInfo.getQueryParameters()); + + return this.toApiJsonSerializer.serialize(settings, rate, this.RESPONSE_DATA_PARAMETERS); + } + + @POST + @Consumes({MediaType.APPLICATION_JSON}) + @Produces({MediaType.APPLICATION_JSON}) + public String createRate(final String apiRequestBodyAsJson) { + final CommandWrapper commandRequest = new CommandWrapperBuilder().createRate() + .withJson(apiRequestBodyAsJson).build(); + + final CommandProcessingResult result = this.commandsSourceWritePlatformService + .logCommandSource(commandRequest); + + return this.toApiJsonSerializer.serialize(result); + + } + + @GET + @Consumes({MediaType.APPLICATION_JSON}) + @Produces({MediaType.APPLICATION_JSON}) + public String getAllRates(@Context final UriInfo uriInfo) { + + this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions); + + Collection rates = this.readPlatformService.retrieveAllRates(); + + final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper + .process(uriInfo.getQueryParameters()); + + return this.toApiJsonSerializer.serialize(settings, rates, this.RESPONSE_DATA_PARAMETERS); + } + + @PUT + @Path("{rateId}") + @Consumes({MediaType.APPLICATION_JSON}) + @Produces({MediaType.APPLICATION_JSON}) + public String updateRate(@PathParam("rateId") Long rateId, final String apiRequestBodyAsJson) { + final CommandWrapper commandRequest = new CommandWrapperBuilder().updateRate(rateId) + .withJson(apiRequestBodyAsJson).build(); + + final CommandProcessingResult result = this.commandsSourceWritePlatformService + .logCommandSource(commandRequest); + + return this.toApiJsonSerializer.serialize(result); + } + + +} diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/data/RateData.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/data/RateData.java new file mode 100644 index 00000000000..d60c8dd76dd --- /dev/null +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/data/RateData.java @@ -0,0 +1,53 @@ +/** + * 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. + */ + +package org.apache.fineract.portfolio.rate.data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * Bowpi GT Created by Jose on 19/07/2017. + */ +public class RateData implements Serializable { + + private Long id; + + private String name; + + private BigDecimal percentage; + + private String productApply; + + private boolean active; + + public static RateData instance(final Long id, final String name, final BigDecimal percentage, + final String productApply, final boolean active) { + return new RateData(id, name, percentage, productApply, active); + } + + private RateData(final Long id, final String name, final BigDecimal percentage, + final String productApply, final boolean active) { + this.id = id; + this.name = name; + this.percentage = percentage; + this.productApply = productApply; + this.active = active; + } +} diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/domain/Rate.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/domain/Rate.java new file mode 100644 index 00000000000..3d0803b2297 --- /dev/null +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/domain/Rate.java @@ -0,0 +1,201 @@ +/** + * 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. + */ + +package org.apache.fineract.portfolio.rate.domain; + +import java.util.LinkedHashMap; +import java.util.Map; +import org.apache.commons.lang.StringUtils; +import org.apache.fineract.infrastructure.core.api.JsonCommand; +import org.apache.fineract.useradministration.domain.AppUser; + +import javax.persistence.*; +import java.math.BigDecimal; +import org.apache.fineract.infrastructure.core.domain.AbstractAuditableCustom; + +/** + * Bowpi GT Created by Jose on 19/07/2017. + */ + +@Entity +@Table(name = "m_rate", uniqueConstraints = { + @UniqueConstraint(columnNames = {"name"}, name = "name")}) +public class Rate extends AbstractAuditableCustom { + + @Column(name = "name", length = 250, unique = true) + private String name; + + @Column(name = "percentage", scale = 10, precision = 2, nullable = false) + private BigDecimal percentage; + + @Column(name = "product_apply", length = 100) + private String productApply; + + @Column(name = "active", nullable = false) + private boolean active; + + @ManyToOne + @JoinColumn(name = "approve_user", nullable = true) + private AppUser approveUser; + + + public Rate() { + } + + + public Rate(String name, BigDecimal percentage, String productApply, boolean active, + AppUser approveUser) { + this.name = name; + this.percentage = percentage; + this.productApply = productApply; + this.active = active; + this.approveUser = approveUser; + } + + public Rate(String name, BigDecimal percentage, String productApply, boolean active) { + this.name = name; + this.percentage = percentage; + this.productApply = productApply; + this.active = active; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public BigDecimal getPercentage() { + return percentage; + } + + public void setPercentage(BigDecimal percentage) { + this.percentage = percentage; + } + + public boolean isActive() { + return active; + } + + public void setActive(boolean active) { + this.active = active; + } + + public AppUser getApproveUser() { + return approveUser; + } + + public void setApproveUser(AppUser approveUser) { + this.approveUser = approveUser; + } + + public String getProductApply() { + return productApply; + } + + public void setProductApply(String productApply) { + this.productApply = productApply; + } + + @Override + public String toString() { + return "Rate{" + + "name='" + name + '\'' + + ", percentage=" + percentage + + ", productApply='" + productApply + '\'' + + ", active=" + active + + ", approveUser=" + approveUser + + '}'; + } + + public static Rate from(String name, BigDecimal percentage, String productApply, Boolean active) { + return new Rate(name, percentage, productApply, active); + } + + public static Rate fromJson(final JsonCommand command, AppUser user) { + + final String name = command.stringValueOfParameterNamed("name"); + + final BigDecimal percentage = command.bigDecimalValueOfParameterNamed("percentage"); + + final String productApply = command.stringValueOfParameterNamed("productApply"); + + final boolean active = command.booleanPrimitiveValueOfParameterNamed("active"); + + return new Rate(name, percentage, productApply, active, user); + } + + public Map update(final JsonCommand command) { + + final Map actualChanges = new LinkedHashMap<>(7); + + final String nameParamName = "name"; + if (command.isChangeInStringParameterNamed(nameParamName, this.name)) { + final String newValue = command.stringValueOfParameterNamed(nameParamName); + actualChanges.put(nameParamName, newValue); + this.name = StringUtils.defaultIfEmpty(newValue, null); + } + + final String percentageParamName = "percentage"; + if (command.isChangeInBigDecimalParameterNamed(percentageParamName, this.percentage)) { + final BigDecimal newValue = command.bigDecimalValueOfParameterNamed(percentageParamName); + actualChanges.put(percentageParamName, newValue); + this.percentage = newValue; + } + + final String productApplyParamName = "productApply"; + if (command.isChangeInStringParameterNamed(productApplyParamName, this.productApply)) { + final String newValue = command.stringValueOfParameterNamed(productApplyParamName); + actualChanges.put(productApplyParamName, newValue); + this.productApply = StringUtils.defaultIfEmpty(newValue, null); + } + + final String activeParamName = "active"; + if (command.isChangeInBooleanParameterNamed(activeParamName, this.active)) { + final boolean newValue = command.booleanPrimitiveValueOfParameterNamed(activeParamName); + actualChanges.put(activeParamName, newValue); + this.active = newValue; + } + + final String approveUserParamName = "approveUserId"; + if (command.isChangeInLongParameterNamed(approveUserParamName, getApproveUserId())) { + final Long newValue = command.longValueOfParameterNamed(approveUserParamName); + actualChanges.put(approveUserParamName, newValue); + } + + return actualChanges; + } + + private Long getApproveUserId() { + Long approveUserId = null; + if (this.approveUser != null) { + approveUserId = this.approveUser.getId(); + } + return approveUserId; + } + + public void assembleFrom(String name, BigDecimal percentage, String productApply, boolean active){ + this.name = name; + this.percentage = percentage; + this.productApply = productApply; + this.active = active; + } +} diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/domain/RateRepository.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/domain/RateRepository.java new file mode 100644 index 00000000000..e593ac82a91 --- /dev/null +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/domain/RateRepository.java @@ -0,0 +1,36 @@ +/** + * 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. + */ +package org.apache.fineract.portfolio.rate.domain; + +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; + +import java.util.List; + +/** + * Bowpi GT + * Rate repository to save on m_rate table (custom change for Credi Chapin) + * Created by Jose on 19/07/2017. + */ +public interface RateRepository extends JpaRepository, JpaSpecificationExecutor { + + Rate findByName(String name); + List findAllByActiveAndProductApply(boolean active, String productApply); + +} diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/domain/RateRepositoryWrapper.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/domain/RateRepositoryWrapper.java new file mode 100644 index 00000000000..7604a11561d --- /dev/null +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/domain/RateRepositoryWrapper.java @@ -0,0 +1,70 @@ +/** + * 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. + */ +package org.apache.fineract.portfolio.rate.domain; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import org.apache.fineract.portfolio.rate.exception.RateNotFoundException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service +public class RateRepositoryWrapper { + + private final RateRepository repository; + + @Autowired + public RateRepositoryWrapper(final RateRepository repository) { + this.repository = repository; + } + + public Rate findOneWithNotFoundDetection(final Long rateId) { + + final Rate rate = this.repository.findOne(rateId); + if (rate == null) { + throw new RateNotFoundException(rateId); + } + + return rate; + } + + public List findMultipleWithNotFoundDetection(final List rateIds) { + List rates = new ArrayList<>(); + if (rateIds != null && !rateIds.isEmpty()) { + final List foundRates = this.repository.findAll(rateIds); + for (Long rateId : rateIds) { + Boolean found = false; + for (Rate foundRate : foundRates) { + if (Objects.equals(foundRate.getId(), + rateId)) { + found = true; + break; + } + } + if (!found) { + throw new RateNotFoundException(rateId); + } + } + rates.addAll(foundRates); + } + return rates; + } + +} diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/exception/RateAlreadyExistException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/exception/RateAlreadyExistException.java new file mode 100644 index 00000000000..f0a844e8885 --- /dev/null +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/exception/RateAlreadyExistException.java @@ -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. + */ +package org.apache.fineract.portfolio.rate.exception; + +/** + * Bowpi GT + * Created by Jose on 24/07/2017. + */ +public class RateAlreadyExistException extends Exception{ + + public RateAlreadyExistException(String s) { + super(s); + } +} diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/exception/RateNotFoundException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/exception/RateNotFoundException.java new file mode 100644 index 00000000000..48cf904fbe9 --- /dev/null +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/exception/RateNotFoundException.java @@ -0,0 +1,35 @@ +/** + * 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. + */ + +package org.apache.fineract.portfolio.rate.exception; + +import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; + +public class RateNotFoundException extends AbstractPlatformResourceNotFoundException { + + + public RateNotFoundException(final Long id) { + super("error.msg.rate.id.invalid", "Rate with identifier " + id + " does not exist", id); + } + + public RateNotFoundException(final String name) { + super("error.msg.rate.id.invalid", "Rate with name " + name + " does not exist", name); + } + +} diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/handler/CreateRateCommandHandler.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/handler/CreateRateCommandHandler.java new file mode 100644 index 00000000000..87945404775 --- /dev/null +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/handler/CreateRateCommandHandler.java @@ -0,0 +1,48 @@ +/** + * 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. + */ +package org.apache.fineract.portfolio.rate.handler; + +import org.apache.fineract.commands.annotation.CommandType; +import org.apache.fineract.commands.handler.NewCommandSourceHandler; +import org.apache.fineract.infrastructure.core.api.JsonCommand; +import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; +import org.apache.fineract.portfolio.rate.service.RateWriteService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * Bowpi GT + * Created by Jose on 19/07/2017. + */ +@Service +@CommandType(entity = "RATE", action = "CREATE") +public class CreateRateCommandHandler implements NewCommandSourceHandler { + + private final RateWriteService writePlatformService; + + @Autowired + public CreateRateCommandHandler(final RateWriteService writePlatformService) { + this.writePlatformService = writePlatformService; + } + + @Override + public CommandProcessingResult processCommand(final JsonCommand command) { + return this.writePlatformService.createRate(command); + } +} diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/handler/UpdateRateCommandHandler.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/handler/UpdateRateCommandHandler.java new file mode 100644 index 00000000000..cc22e53dc2b --- /dev/null +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/handler/UpdateRateCommandHandler.java @@ -0,0 +1,51 @@ +/** + * 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. + */ +package org.apache.fineract.portfolio.rate.handler; + +import org.apache.fineract.commands.annotation.CommandType; +import org.apache.fineract.commands.handler.NewCommandSourceHandler; +import org.apache.fineract.infrastructure.core.api.JsonCommand; +import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; +import org.apache.fineract.portfolio.rate.service.RateWriteService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * Bowpi GT + * Created by Jose on 19/07/2017. + */ +@Service +@CommandType(entity = "RATE", action = "UPDATE") +public class UpdateRateCommandHandler implements NewCommandSourceHandler { + + private final RateWriteService writePlatformService; + + @Autowired + public UpdateRateCommandHandler(final RateWriteService writePlatformService) { + this.writePlatformService = writePlatformService; + } + + @Transactional + @Override + public CommandProcessingResult processCommand(final JsonCommand command) { + + return this.writePlatformService.updateRate(command.entityId(), command); + } +} diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/serialization/RateDefinitionCommandFromApiJsonDeserializer.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/serialization/RateDefinitionCommandFromApiJsonDeserializer.java new file mode 100644 index 00000000000..acfbc72bfbb --- /dev/null +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/serialization/RateDefinitionCommandFromApiJsonDeserializer.java @@ -0,0 +1,129 @@ +/** + * 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. + */ +package org.apache.fineract.portfolio.rate.serialization; + +import com.google.gson.JsonElement; +import com.google.gson.reflect.TypeToken; +import java.lang.reflect.Type; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import org.apache.commons.lang.StringUtils; +import org.apache.fineract.infrastructure.core.data.ApiParameterError; +import org.apache.fineract.infrastructure.core.data.DataValidatorBuilder; +import org.apache.fineract.infrastructure.core.exception.InvalidJsonException; +import org.apache.fineract.infrastructure.core.exception.PlatformApiDataValidationException; +import org.apache.fineract.infrastructure.core.serialization.FromJsonHelper; +import org.apache.fineract.portfolio.rate.api.RateApiConstants; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +@Component +public class RateDefinitionCommandFromApiJsonDeserializer { + + /** + * The parameters supported for this command. + */ + private final Set supportedParameters = new HashSet<>( + Arrays.asList("id", "name", "percentage", "productApply", "active", "approveUser", "locale")); + + private final FromJsonHelper fromApiJsonHelper; + + @Autowired + public RateDefinitionCommandFromApiJsonDeserializer(final FromJsonHelper fromApiJsonHelper) { + this.fromApiJsonHelper = fromApiJsonHelper; + } + + public void validateForCreate(final String json) { + if (StringUtils.isBlank(json)) { + throw new InvalidJsonException(); + } + + final Type typeOfMap = new TypeToken>() { + }.getType(); + + this.fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, json, this.supportedParameters); + + final List dataValidationErrors = new ArrayList<>(); + + final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors) + .resource(RateApiConstants.rateName); + + final JsonElement element = this.fromApiJsonHelper.parse(json); + + final String name = this.fromApiJsonHelper.extractStringNamed(RateApiConstants.rateName, element); + baseDataValidator.reset().parameter(RateApiConstants.rateName).value(name).notBlank().notExceedingLengthOf(250); + + final BigDecimal percentage = this.fromApiJsonHelper + .extractBigDecimalWithLocaleNamed(RateApiConstants.ratePercentage, element); + baseDataValidator.reset().parameter(RateApiConstants.ratePercentage).value(percentage).notBlank(); + + final String productApply = this.fromApiJsonHelper.extractStringNamed(RateApiConstants.rateProductApply, element); + baseDataValidator.reset().parameter(RateApiConstants.rateProductApply).value(productApply).notBlank() + .notExceedingLengthOf(100); + + throwExceptionIfValidationWarningsExist(dataValidationErrors); + } + + public void validateForUpdate(final String json) { + if (StringUtils.isBlank(json)) { + throw new InvalidJsonException(); + } + + final Type typeOfMap = new TypeToken>() { + }.getType(); + this.fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, json, this.supportedParameters); + + final List dataValidationErrors = new ArrayList<>(); + final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors) + .resource(RateApiConstants.rate); + + final JsonElement element = this.fromApiJsonHelper.parse(json); + + if (this.fromApiJsonHelper.parameterExists(RateApiConstants.rateName, element)) { + final String name = this.fromApiJsonHelper.extractStringNamed(RateApiConstants.rateName, element); + baseDataValidator.reset().parameter(RateApiConstants.rateName).value(name).notBlank().notExceedingLengthOf(250); + } + + if (this.fromApiJsonHelper.parameterExists(RateApiConstants.ratePercentage, element)) { + final BigDecimal percentage = this.fromApiJsonHelper + .extractBigDecimalWithLocaleNamed(RateApiConstants.ratePercentage, element); + baseDataValidator.reset().parameter(RateApiConstants.ratePercentage).value(percentage).notBlank(); + } + + if (this.fromApiJsonHelper.parameterExists(RateApiConstants.rateProductApply, element)) { + final String productApply = this.fromApiJsonHelper.extractStringNamed(RateApiConstants.rateProductApply, element); + baseDataValidator.reset().parameter(RateApiConstants.rateProductApply).value(productApply).notBlank(); + } + + throwExceptionIfValidationWarningsExist(dataValidationErrors); + } + + private void throwExceptionIfValidationWarningsExist( + final List dataValidationErrors) { + if (!dataValidationErrors.isEmpty()) { + throw new PlatformApiDataValidationException(dataValidationErrors); + } + } + +} diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateAssembler.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateAssembler.java new file mode 100644 index 00000000000..9b2d6f9a646 --- /dev/null +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateAssembler.java @@ -0,0 +1,80 @@ +/** + * 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. + */ +package org.apache.fineract.portfolio.rate.service; + +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import java.util.ArrayList; +import java.util.List; +import java.util.Locale; +import org.apache.fineract.infrastructure.core.serialization.FromJsonHelper; +import org.apache.fineract.portfolio.loanproduct.LoanProductConstants; +import org.apache.fineract.portfolio.rate.domain.Rate; +import org.apache.fineract.portfolio.rate.domain.RateRepositoryWrapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service +public class RateAssembler { + + private final FromJsonHelper fromApiJsonHelper; + private final RateRepositoryWrapper rateRepository; + + @Autowired + public RateAssembler(final FromJsonHelper fromApiJsonHelper, + final RateRepositoryWrapper rateRepository) { + this.fromApiJsonHelper = fromApiJsonHelper; + this.rateRepository = rateRepository; + } + + public List fromParsedJson(final JsonElement element) { + + final List rateItems = new ArrayList<>(); + + if (element.isJsonObject()) { + final JsonObject topLevelJsonElement = element.getAsJsonObject(); + final Locale locale = this.fromApiJsonHelper.extractLocaleParameter(topLevelJsonElement); + + if (topLevelJsonElement.has(LoanProductConstants.ratesParamName) && topLevelJsonElement + .get(LoanProductConstants.ratesParamName) + .isJsonArray()) { + final JsonArray array = topLevelJsonElement.get(LoanProductConstants.ratesParamName) + .getAsJsonArray(); + List idList = new ArrayList<>(); + + for (int i = 0; i < array.size(); i++) { + + final JsonObject rateElement = array.get(i).getAsJsonObject(); + + final Long id = this.fromApiJsonHelper.extractLongNamed("id", rateElement); + + if (id != null) { + final Long rateId = this.fromApiJsonHelper.extractLongNamed("id", rateElement); + idList.add(rateId); + } + } + rateItems.addAll(rateRepository.findMultipleWithNotFoundDetection(idList)); + } + } + + return rateItems; + } + +} diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateReadService.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateReadService.java new file mode 100644 index 00000000000..7b4b0512129 --- /dev/null +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateReadService.java @@ -0,0 +1,44 @@ +/** + * 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. + */ +package org.apache.fineract.portfolio.rate.service; + +import org.apache.fineract.portfolio.rate.data.RateData; + +import java.util.Collection; +import java.util.List; + +/** + * Bowpi GT + * Created by Jose on 19/07/2017. + */ +public interface RateReadService { + + Collection retrieveAllRates(); + + Collection retrieveLoanApplicableRates(); + + RateData retrieveOne(Long rateId); + + RateData retrieveByName(String name); + + List retrieveProductLoanRates(Long loanId); + + List retrieveLoanRates(Long loanId); + +} diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateReadServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateReadServiceImpl.java new file mode 100644 index 00000000000..44682ded60d --- /dev/null +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateReadServiceImpl.java @@ -0,0 +1,150 @@ +/** + * 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. + */ + +package org.apache.fineract.portfolio.rate.service; + +import org.apache.fineract.infrastructure.core.service.RoutingDataSource; +import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext; +import org.apache.fineract.portfolio.rate.exception.RateNotFoundException; +import org.apache.fineract.portfolio.rate.domain.Rate; +import org.apache.fineract.portfolio.rate.data.RateData; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.dao.EmptyResultDataAccessException; +import org.springframework.jdbc.core.JdbcTemplate; +import org.springframework.jdbc.core.RowMapper; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.Collection; +import java.util.List; + +/** + * Bowpi GT Created by Jose on 19/07/2017. + */ +@Service +public class RateReadServiceImpl implements RateReadService { + + private final JdbcTemplate jdbcTemplate; + private final PlatformSecurityContext context; + + @Autowired + public RateReadServiceImpl(PlatformSecurityContext context, final RoutingDataSource dataSource) { + this.context = context; + this.jdbcTemplate = new JdbcTemplate(dataSource); + } + + @Override + public Collection retrieveAllRates() { + this.context.authenticatedUser(); + final RateMapper rm = new RateMapper(); + final String sql = "select " + rm.rateSchema(); + return this.jdbcTemplate.query(sql, rm, new Object[]{}); + } + + @Override + public RateData retrieveOne(Long rateId) { + try { + this.context.authenticatedUser(); + final RateMapper rm = new RateMapper(); + final String sql = "select " + rm.rateSchema() + " where r.id = ?"; + final RateData selectedRate = this.jdbcTemplate.queryForObject(sql, rm, new Object[]{rateId}); + return selectedRate; + + } catch (final EmptyResultDataAccessException e) { + throw new RateNotFoundException(rateId); + } + } + + @Override + public RateData retrieveByName(String name) { + try { + this.context.authenticatedUser(); + final RateMapper rm = new RateMapper(); + final String sql = "select " + rm.rateSchema() + " where r.name = ?"; + final RateData selectedRate = this.jdbcTemplate.queryForObject(sql, rm, new Object[]{name}); + return selectedRate; + + } catch (final EmptyResultDataAccessException e) { + throw new RateNotFoundException(name); + } + } + + @Override + public Collection retrieveLoanApplicableRates() { + this.context.authenticatedUser(); + final RateMapper rm = new RateMapper(); + final String sql = "select " + rm.rateSchema() + " where r.active = ? and product_apply=?"; + return this.jdbcTemplate.query(sql, rm, new Object[]{true, "m_loan"}); + } + + @Override + public List retrieveLoanRates(Long loanId) { + final RateMapper rm = new RateMapper(); + final String sql = "select " + rm.loanRateSchema() + " where lr.loan_id = ?"; + return this.jdbcTemplate.query(sql, rm, new Object[]{loanId}); + } + + @Override + public List retrieveProductLoanRates(Long loanId) { + final RateMapper rm = new RateMapper(); + final String sql = "select " + rm.productLoanRateSchema() + " where lr.product_loan_id = ?"; + return this.jdbcTemplate.query(sql, rm, new Object[]{loanId}); + } + + private static final class RateMapper implements RowMapper { + + + public String rateSchema() { + return " r.id as id, r.name as name, r.percentage as percentage, " + + "r.product_apply as productApply, r.active as active from m_rate r "; + } + + public String loanRateSchema() { + return rateSchema() + " join m_loan_rate lr on lr.rate_id = r.id"; + } + + public String productLoanRateSchema() { + return rateSchema() + " join m_product_loan_rate lr on lr.rate_id = r.id"; + } + + public RateMapper() { + } + + @Override + public RateData mapRow(ResultSet resultSet, int i) throws SQLException { + final Long id = resultSet.getLong("id"); + final String name = resultSet.getString("name"); + final BigDecimal percentage = resultSet.getBigDecimal("percentage"); + final String productApply = resultSet.getString("productApply"); + final boolean active = resultSet.getBoolean("active"); + return RateData.instance(id, name, percentage, productApply, active); + } + + public RateData mapRow(Rate rateResponse, int i) { + final Long id = rateResponse.getId(); + final String name = rateResponse.getName(); + final BigDecimal percentage = rateResponse.getPercentage(); + final String productApply = rateResponse.getProductApply(); + final boolean active = rateResponse.isActive(); + return RateData.instance(id, name, percentage, productApply, active); + } + } +} diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateWriteService.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateWriteService.java new file mode 100644 index 00000000000..0cd7dfea57b --- /dev/null +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateWriteService.java @@ -0,0 +1,34 @@ +/** + * 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. + */ +package org.apache.fineract.portfolio.rate.service; + +import org.apache.fineract.infrastructure.core.api.JsonCommand; +import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; + +/** + * Bowpi GT + * Created by Jose on 19/07/2017. + */ +public interface RateWriteService { + + CommandProcessingResult createRate(final JsonCommand command); + + CommandProcessingResult updateRate(Long rateId, JsonCommand command); + +} diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateWriteServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateWriteServiceImpl.java new file mode 100644 index 00000000000..51f97b4e8b2 --- /dev/null +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateWriteServiceImpl.java @@ -0,0 +1,157 @@ +/** + * 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. + */ +package org.apache.fineract.portfolio.rate.service; + +import static org.apache.fineract.portfolio.rate.api.RateApiConstants.approveUserIdParamName; + +import java.util.Map; +import javax.persistence.PersistenceException; +import org.apache.commons.lang.exception.ExceptionUtils; +import org.apache.fineract.infrastructure.core.api.JsonCommand; +import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; +import org.apache.fineract.infrastructure.core.data.CommandProcessingResultBuilder; +import org.apache.fineract.infrastructure.core.exception.PlatformDataIntegrityException; +import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext; +import org.apache.fineract.portfolio.rate.domain.Rate; +import org.apache.fineract.portfolio.rate.domain.RateRepository; +import org.apache.fineract.portfolio.rate.exception.RateNotFoundException; +import org.apache.fineract.portfolio.rate.serialization.RateDefinitionCommandFromApiJsonDeserializer; +import org.apache.fineract.useradministration.domain.AppUser; +import org.apache.fineract.useradministration.domain.AppUserRepository; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.dao.DataIntegrityViolationException; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * Bowpi GT Created by Jose on 19/07/2017. + */ +@Service +public class RateWriteServiceImpl implements RateWriteService { + + private final static Logger logger = LoggerFactory + .getLogger(RateWriteServiceImpl.class); + private final RateRepository rateRepository; + private final AppUserRepository appUserRepository; + private final PlatformSecurityContext context; + private final RateDefinitionCommandFromApiJsonDeserializer fromApiJsonDeserializer; + + @Autowired + public RateWriteServiceImpl(RateRepository rateRepository, AppUserRepository appUserRepository, + final RateDefinitionCommandFromApiJsonDeserializer fromApiJsonDeserializer, + PlatformSecurityContext context) { + this.rateRepository = rateRepository; + this.appUserRepository = appUserRepository; + this.context = context; + this.fromApiJsonDeserializer = fromApiJsonDeserializer; + } + + @Override + public CommandProcessingResult createRate(JsonCommand command) { + try { + this.context.authenticatedUser(); + this.fromApiJsonDeserializer.validateForCreate(command.json()); + + final Long approveUserId = command.longValueOfParameterNamed(approveUserIdParamName); + AppUser approveUser = null; + if (approveUserId != null) { + approveUser = this.appUserRepository.findOne(approveUserId); + } + final Rate rate = Rate.fromJson(command, approveUser); + + this.rateRepository.save(rate); + + return new CommandProcessingResultBuilder().withCommandId(command.commandId()) + .withEntityId(rate.getId()).build(); + + } catch (final DataIntegrityViolationException dve) { + handleRateDataIntegrityIssues(command, dve.getMostSpecificCause(), dve); + return CommandProcessingResult.empty(); + } catch (final PersistenceException dve) { + Throwable throwable = ExceptionUtils.getRootCause(dve.getCause()); + handleRateDataIntegrityIssues(command, throwable, dve); + return CommandProcessingResult.empty(); + } + } + + @Transactional + @Override + public CommandProcessingResult updateRate(final Long rateId, final JsonCommand command) { + try { + this.context.authenticatedUser(); + + final Rate rateToUpdate = this.rateRepository.findOne(rateId); + if (rateToUpdate == null) { + throw new RateNotFoundException(rateId); + } + + final Map changes = rateToUpdate.update(command); + + this.fromApiJsonDeserializer.validateForUpdate(command.json()); + + if (changes.containsKey(approveUserIdParamName)) { + final Long newValue = (Long) changes.get(approveUserIdParamName); + AppUser newApproveUser = null; + if (newValue != null) { + newApproveUser = this.appUserRepository.findOne(newValue); + } + rateToUpdate.setApproveUser(newApproveUser); + } + if (!changes.isEmpty()) { + this.rateRepository.saveAndFlush(rateToUpdate); + } + + return new CommandProcessingResultBuilder() // + .withCommandId(command.commandId()) // + .withEntityId(rateId) // + .with(changes) // + .build(); + + } catch (final DataIntegrityViolationException dve) { + handleRateDataIntegrityIssues(command, dve.getMostSpecificCause(), dve); + return new CommandProcessingResult(Long.valueOf(-1)); + } catch (final PersistenceException dve) { + Throwable throwable = ExceptionUtils.getRootCause(dve.getCause()); + handleRateDataIntegrityIssues(command, throwable, dve); + return CommandProcessingResult.empty(); + } + + } + + /* + * Guaranteed to throw an exception no matter what the data integrity issue + * is. + */ + private void handleRateDataIntegrityIssues(final JsonCommand command, final Throwable realCause, + final Exception dve) { + if (realCause.getMessage().contains("rate_name_org")) { + final String name = command.stringValueOfParameterNamed("name"); + throw new PlatformDataIntegrityException("error.msg.fund.duplicate.externalId", + "A rate with name '" + name + + "' already exists", "name", name); + } + + logger.error(dve.getMessage(), dve); + throw new PlatformDataIntegrityException("error.msg.fund.unknown.data.integrity.issue", + "Unknown data integrity issue with resource: " + realCause.getMessage()); + } + +} diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V352__rates.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V352__rates.sql new file mode 100644 index 00000000000..1ca09865648 --- /dev/null +++ b/fineract-provider/src/main/resources/sql/migrations/core_db/V352__rates.sql @@ -0,0 +1,67 @@ +-- +-- 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. +-- + +CREATE TABLE IF NOT EXISTS `m_rate` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `name` varchar(250) NOT NULL, + `percentage` decimal(10,2) NOT NULL, + `active` tinyint(1) DEFAULT '0', + `product_apply` varchar(100) NOT NULL, + `created_date` datetime NULL DEFAULT NULL, + `createdby_id` bigint(20) NOT NULL, + `lastmodifiedby_id` bigint(20) NOT NULL, + `lastmodified_date` datetime NULL DEFAULT NULL, + `approve_user` bigint(20) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `FK_M_RATE_CREATE_USER` (`createdby_id`), + KEY `FK_M_RATE_APPROVE_USER` (`approve_user`), + CONSTRAINT `FK_M_RATE_APPROVE_USER` FOREIGN KEY (`approve_user`) REFERENCES `m_appuser` (`id`), + CONSTRAINT `FK_M_RATE_CREATE_USER` FOREIGN KEY (`createdby_id`) REFERENCES `m_appuser` (`id`) +); + + +CREATE TABLE IF NOT EXISTS `m_loan_rate` ( + `loan_id` bigint(20) NOT NULL, + `rate_id` bigint(20) NOT NULL, + PRIMARY KEY (`loan_id`,`rate_id`), + KEY `FK_M_LOAN_RATE_RATE` (`rate_id`), + CONSTRAINT `FK_M_LOAN_RATE_LOAN` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`), + CONSTRAINT `FK_M_LOAN_RATE_RATE` FOREIGN KEY (`rate_id`) REFERENCES `m_rate` (`id`) +); + + +CREATE TABLE IF NOT EXISTS `m_product_loan_rate` ( + `product_loan_id` bigint(20) NOT NULL, + `rate_id` bigint(20) NOT NULL, + PRIMARY KEY (`product_loan_id`,`rate_id`), + KEY `FK_M_PRODUCT_LOAN_RATE_RATE` (`rate_id`), + CONSTRAINT `FK_M_PRODUCT_LOAN_RATE_LOAN` FOREIGN KEY (`product_loan_id`) REFERENCES `m_product_loan` (`id`), + CONSTRAINT `FK_M_PRODUCT_LOAN_RATE_RATE` FOREIGN KEY (`rate_id`) REFERENCES `m_rate` (`id`) +); + + +INSERT INTO `m_permission` +(`grouping`,`code`,`entity_name`,`action_name`,`can_maker_checker`) VALUES + ('organisation', 'CREATE_RATE', 'RATE', 'CREATE', '1'), + ('organisation', 'UPDATE_RATE', 'RATE', 'UPDATE', '1'); + +INSERT INTO `c_configuration` +(`name`, `value`, `enabled`, `is_trap_door`, `description`) VALUES +('vat-tax', 12, 0, 0, 'VAT tax'), +('sub-rates', 12, 0, 0, 'Enable Rates Module');; From c342f5b43d228b01b1fca2bc4a8a54b82f188093 Mon Sep 17 00:00:00 2001 From: Angel Cajas Date: Mon, 27 May 2019 09:35:15 -0600 Subject: [PATCH 14/37] FINERACT-737: Updated Api Docs to include loan charges paid by FINERACT-736: Api Docs were updated to include rates documentation FINERACT-735: Integration test were created for rates creation, retrieval and update Missing permission READ_RATE --- api-docs/apiLive.htm | 227 +++++++++++++++++- .../fineract/integrationtests/RatesTest.java | 71 ++++++ .../common/rates/RatesHelper.java | 91 +++++++ .../portfolio/rate/data/RateData.java | 8 +- .../fineract/portfolio/rate/domain/Rate.java | 36 +-- .../portfolio/rate/domain/RateAppliesTo.java | 66 +++++ .../rate/service/RateEnumerations.java | 47 ++++ .../rate/service/RateReadServiceImpl.java | 12 +- .../sql/migrations/core_db/V352__rates.sql | 6 +- 9 files changed, 535 insertions(+), 29 deletions(-) create mode 100644 fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/RatesTest.java create mode 100644 fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/rates/RatesHelper.java create mode 100644 fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/domain/RateAppliesTo.java create mode 100644 fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateEnumerations.java diff --git a/api-docs/apiLive.htm b/api-docs/apiLive.htm index 3d544b5ec37..b9e93afef04 100644 --- a/api-docs/apiLive.htm +++ b/api-docs/apiLive.htm @@ -2546,6 +2546,24 @@

Org

+ + Rates + rates + Create Rate + List Rates + + + + + + + rates/{rateId} + + Retrieve Rate + Update Rate + + + @@ -12142,7 +12160,17 @@

Retrieve a Transaction Details

"displayLabel": "US Dollar ($)" }, "amount": 559.88, - "interestPortion": 559.88 + "interestPortion": 559.88, + "loanChargePaidByList": [ + { + "id": 29, + "amount": 138.700000, + "installmentNumber": 0, + "chargeId": 7, + "transactionId": 35, + "name": "Late Penalty Charge" + } + ] } @@ -16174,7 +16202,7 @@

Create a Loan Product

numberOfRepaymentVariationsForBorrowerCycle, interestRateVariationsForBorrowerCycle, multiDisburseLoan,maxTrancheCount, - outstandingLoanBalance,overdueDaysForNPA,holdGuaranteeFunds, principalThresholdForLastInstalment, accountMovesOutOfNPAOnlyOnArrearsCompletion, canDefineInstallmentAmount, installmentAmountInMultiplesOf, allowAttributeOverrides, allowPartialPeriodInterestCalcualtion + outstandingLoanBalance,overdueDaysForNPA,holdGuaranteeFunds, principalThresholdForLastInstalment, accountMovesOutOfNPAOnlyOnArrearsCompletion, canDefineInstallmentAmount, installmentAmountInMultiplesOf, allowAttributeOverrides, allowPartialPeriodInterestCalcualtion, rates @@ -43279,7 +43307,198 @@

Update Tax Group

- + +   +
+
+

Rates

+

This defines the Rates

+ + + + + + + + + + + + + + + + + + + + + + +
+
Field Descriptions
+
name
Name of Rate +
productApply
+ Enum value that defines to which entity the rate will be applicable. + Available options are: + 1=Loans + + Once a rate definition is created, this attribute cannot be changed at any point +
Active
+ Flag indicating if the rate is currently active +
+
+
+   +
+
+

Create a new Rate

+

Creates a new Rate

+ + + + + + + + + + + + + + + + +
+
Mandatory Fields
+
name
percentage
productApply
active
+
+
+ + POST https://DomainName/api/v1/rates + + + POST rates + Content-Type: application/json + Request Body: + { + "productApply":1, + "name":"Loan rate", + "percentage":"12", + "active":true, + "locale":"en" + } + + + { + "resourceId": 1 + } + +
+
+   +
+
+

List Rates

+

List Rates

+
+
+ + GET https://DomainName/api/v1/rates + + + GET rates + Content-Type: application/json + + + [ + { + "id":1, + "name":"Loan Rate", + "percentage":12.00, + "productApply":1, + "active":true + }, + { + "id":2, + "name":"Public Rate", + "percentage":30.00, + "productApply":1, + "active":true + }, + { + "id":3, + "name":"Private Rate", + "percentage":14.00, + "productApply":1, + "active":true + } + ] + +
+
+   +
+
+

Retrieve a Rate

+

Return the details of an existing Rate

+
+
+ + GET https://DomainName/api/v1/rates/{rateId} + + + GET rates/1 + Content-Type: application/json + + + { + "id":1, + "name":"Loan Rate", + "percentage":12.00, + "productApply":1, + "active":true + } + +
+
+   +
+
+

Update a Rate

+

Updates an existing Rate

+
+
+ + POST https://DomainName/api/v1/rates/{rateId} + + + POST rates/3 + Content-Type: application/json + Request Body: + { + "percentage":"17", + } + + + { + "resourceId":3, + "changes": + { + "percentage":17 + } + } + +
+
+ + +  
@@ -46751,7 +46970,7 @@

Retrieve a Loan Transaction Details

}, "amount": 559.88, "interestPortion": 559.88 -} + }
diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/RatesTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/RatesTest.java new file mode 100644 index 00000000000..0feb6487981 --- /dev/null +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/RatesTest.java @@ -0,0 +1,71 @@ +/** + * 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. + */ +package org.apache.fineract.integrationtests; + +import com.jayway.restassured.builder.RequestSpecBuilder; +import com.jayway.restassured.builder.ResponseSpecBuilder; +import com.jayway.restassured.http.ContentType; +import com.jayway.restassured.specification.RequestSpecification; +import com.jayway.restassured.specification.ResponseSpecification; +import org.apache.fineract.integrationtests.common.Utils; +import org.apache.fineract.integrationtests.common.rates.RatesHelper; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import java.util.ArrayList; +import java.util.HashMap; + +@SuppressWarnings({"rawtypes"}) +public class RatesTest { + + private ResponseSpecification responseSpec; + private RequestSpecification requestSpec; + + @Before + public void setup() { + Utils.initializeRESTAssured(); + this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); + this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey()); + this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build(); + } + + @Test + public void testRatesForLoans() { + + // Retrieving all Rates + ArrayList allRatesData = RatesHelper.getRates(this.requestSpec, this.responseSpec); + Assert.assertNotNull(allRatesData); + + // Testing Creation and Update of Loan Rate + final Integer loanRateId = RatesHelper.createRates(this.requestSpec, this.responseSpec, + RatesHelper.getLoanRateJSON()); + Assert.assertNotNull(loanRateId); + + //Update Rate percentage + HashMap changes = RatesHelper.updateRates(this.requestSpec, this.responseSpec, loanRateId, + RatesHelper.getModifyRateJSON()); + + HashMap rateDataAfterChanges = RatesHelper.getRateById(this.requestSpec, this.responseSpec, loanRateId); + Assert.assertEquals("Verifying Rate after modification", rateDataAfterChanges.get("percentage"), changes.get("percentage")); + + } + + +} diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/rates/RatesHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/rates/RatesHelper.java new file mode 100644 index 00000000000..43fd0d7dc42 --- /dev/null +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/rates/RatesHelper.java @@ -0,0 +1,91 @@ +/** + * 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. + */ +package org.apache.fineract.integrationtests.common.rates; + +import com.google.gson.Gson; +import com.jayway.restassured.specification.RequestSpecification; +import com.jayway.restassured.specification.ResponseSpecification; +import org.apache.fineract.integrationtests.common.CommonConstants; +import org.apache.fineract.integrationtests.common.Utils; + +import java.util.ArrayList; +import java.util.HashMap; + +@SuppressWarnings({ "rawtypes", "unchecked" }) +public class RatesHelper { + + private static final String RATES_URL = "/fineract-provider/api/v1/rates"; + private static final String CREATE_RATES_URL = RATES_URL + "?" + Utils.TENANT_IDENTIFIER; + private final static String PERCENTAGE = "10"; + private final static Integer PRODUCT_APPLY_LOAN = 1; + private final static Boolean ACTIVE = true; + + public static ArrayList getRates(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) { + return (ArrayList) Utils.performServerGet(requestSpec, responseSpec, RATES_URL + "?" + Utils.TENANT_IDENTIFIER, ""); + } + + + public static Integer createRates(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, + final String request) { + return Utils.performServerPost(requestSpec, responseSpec, CREATE_RATES_URL, request, "resourceId"); + } + + public static HashMap getRateById(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, + final Integer rateId) { + return Utils.performServerGet(requestSpec, responseSpec, RATES_URL + "/" + rateId + "?" + Utils.TENANT_IDENTIFIER, ""); + } + + public static HashMap updateRates(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, + final Integer rateId, final String request) { + return Utils.performServerPut(requestSpec, responseSpec, RATES_URL + "/" + rateId + "?" + Utils.TENANT_IDENTIFIER, request, + CommonConstants.RESPONSE_CHANGES); + } + + public static String getLoanRateJSON() { + return getLoanRateJSON(RatesHelper.PRODUCT_APPLY_LOAN, RatesHelper.PERCENTAGE); + } + + public static String getLoanRateJSON(final Integer productApply, final String percentage) { + final HashMap map = populateDefaultsForLoan(); + map.put("percentage", percentage); + map.put("productApply", productApply); + String crateRateJSON = new Gson().toJson(map); + return crateRateJSON; + } + + public static HashMap populateDefaultsForLoan() { + final HashMap map = new HashMap<>(); + map.put("active", RatesHelper.ACTIVE); + map.put("percentage", RatesHelper.PERCENTAGE); + map.put("locale", "en"); + map.put("productApply", RatesHelper.PRODUCT_APPLY_LOAN); + map.put("name", Utils.randomNameGenerator("Rate_Loans_", 6)); + return map; + } + + public static String getModifyRateJSON() { + final HashMap map = new HashMap<>(); + map.put("percentage", "15.0"); + map.put("locale", "en"); + String json = new Gson().toJson(map); + return json; + } + +} + diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/data/RateData.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/data/RateData.java index d60c8dd76dd..e249a1f1eb4 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/data/RateData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/data/RateData.java @@ -19,6 +19,8 @@ package org.apache.fineract.portfolio.rate.data; +import org.apache.fineract.infrastructure.core.data.EnumOptionData; + import java.io.Serializable; import java.math.BigDecimal; @@ -33,17 +35,17 @@ public class RateData implements Serializable { private BigDecimal percentage; - private String productApply; + private EnumOptionData productApply; private boolean active; public static RateData instance(final Long id, final String name, final BigDecimal percentage, - final String productApply, final boolean active) { + final EnumOptionData productApply, final boolean active) { return new RateData(id, name, percentage, productApply, active); } private RateData(final Long id, final String name, final BigDecimal percentage, - final String productApply, final boolean active) { + final EnumOptionData productApply, final boolean active) { this.id = id; this.name = name; this.percentage = percentage; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/domain/Rate.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/domain/Rate.java index 3d0803b2297..ad808f4cb3f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/domain/Rate.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/domain/Rate.java @@ -19,11 +19,18 @@ package org.apache.fineract.portfolio.rate.domain; +import java.util.ArrayList; import java.util.LinkedHashMap; +import java.util.List; import java.util.Map; import org.apache.commons.lang.StringUtils; import org.apache.fineract.infrastructure.core.api.JsonCommand; +import org.apache.fineract.infrastructure.core.data.ApiParameterError; +import org.apache.fineract.infrastructure.core.data.DataValidatorBuilder; +import org.apache.fineract.infrastructure.core.exception.PlatformApiDataValidationException; +import org.apache.fineract.portfolio.charge.exception.ChargeParameterUpdateNotSupportedException; import org.apache.fineract.useradministration.domain.AppUser; +import org.apache.fineract.portfolio.rate.domain.RateAppliesTo; import javax.persistence.*; import java.math.BigDecimal; @@ -45,7 +52,7 @@ public class Rate extends AbstractAuditableCustom { private BigDecimal percentage; @Column(name = "product_apply", length = 100) - private String productApply; + private Integer productApply; @Column(name = "active", nullable = false) private boolean active; @@ -59,19 +66,19 @@ public Rate() { } - public Rate(String name, BigDecimal percentage, String productApply, boolean active, + public Rate(String name, BigDecimal percentage, RateAppliesTo productApply, boolean active, AppUser approveUser) { this.name = name; this.percentage = percentage; - this.productApply = productApply; + this.productApply = productApply.getValue(); this.active = active; this.approveUser = approveUser; } - public Rate(String name, BigDecimal percentage, String productApply, boolean active) { + public Rate(String name, BigDecimal percentage, RateAppliesTo productApply, boolean active) { this.name = name; this.percentage = percentage; - this.productApply = productApply; + this.productApply = productApply.getValue(); this.active = active; } @@ -107,11 +114,11 @@ public void setApproveUser(AppUser approveUser) { this.approveUser = approveUser; } - public String getProductApply() { + public Integer getProductApply() { return productApply; } - public void setProductApply(String productApply) { + public void setProductApply(Integer productApply) { this.productApply = productApply; } @@ -126,7 +133,7 @@ public String toString() { '}'; } - public static Rate from(String name, BigDecimal percentage, String productApply, Boolean active) { + public static Rate from(String name, BigDecimal percentage, RateAppliesTo productApply, Boolean active) { return new Rate(name, percentage, productApply, active); } @@ -136,8 +143,8 @@ public static Rate fromJson(final JsonCommand command, AppUser user) { final BigDecimal percentage = command.bigDecimalValueOfParameterNamed("percentage"); - final String productApply = command.stringValueOfParameterNamed("productApply"); - + final RateAppliesTo productApply = RateAppliesTo.fromInt(command.integerValueOfParameterNamed("productApply")); + final boolean active = command.booleanPrimitiveValueOfParameterNamed("active"); return new Rate(name, percentage, productApply, active, user); @@ -162,10 +169,9 @@ public Map update(final JsonCommand command) { } final String productApplyParamName = "productApply"; - if (command.isChangeInStringParameterNamed(productApplyParamName, this.productApply)) { - final String newValue = command.stringValueOfParameterNamed(productApplyParamName); - actualChanges.put(productApplyParamName, newValue); - this.productApply = StringUtils.defaultIfEmpty(newValue, null); + if (command.isChangeInIntegerParameterNamed(productApplyParamName, this.productApply)) { + final String errorMessage = "Update of Rate applies to is not supported"; + throw new ChargeParameterUpdateNotSupportedException("rate.applies.to", errorMessage); } final String activeParamName = "active"; @@ -192,7 +198,7 @@ private Long getApproveUserId() { return approveUserId; } - public void assembleFrom(String name, BigDecimal percentage, String productApply, boolean active){ + public void assembleFrom(String name, BigDecimal percentage, Integer productApply, boolean active){ this.name = name; this.percentage = percentage; this.productApply = productApply; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/domain/RateAppliesTo.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/domain/RateAppliesTo.java new file mode 100644 index 00000000000..684e1423630 --- /dev/null +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/domain/RateAppliesTo.java @@ -0,0 +1,66 @@ +/** + * 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. + */ + + package org.apache.fineract.portfolio.rate.domain; + +public enum RateAppliesTo { + + INVALID(0, "rateAppliesTo.invalid"), + LOAN(1, "rateAppliesTo.loan"); + + private final Integer value; + private final String code; + + private RateAppliesTo(final Integer value, final String code) { + this.value = value; + this.code = code; + } + + public Integer getValue() { + return this.value; + } + + public String getCode() { + return this.code; + } + + public static RateAppliesTo fromInt(final Integer rateAppliesTo) { + RateAppliesTo rateAppliesToType = RateAppliesTo.INVALID; + + if (rateAppliesTo != null) { + switch (rateAppliesTo) { + case 1: + rateAppliesToType = LOAN; + break; + default: + rateAppliesToType = INVALID; + break; + } + } + + return rateAppliesToType; + } + + public boolean isLoanRate() { + return this.value.equals(RateAppliesTo.LOAN.getValue()); + } + public static Object[] validValues() { + return new Object[] { RateAppliesTo.LOAN.getValue() }; + } +} diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateEnumerations.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateEnumerations.java new file mode 100644 index 00000000000..a1d79a8e5bd --- /dev/null +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateEnumerations.java @@ -0,0 +1,47 @@ +/** + * 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. + */ + +package org.apache.fineract.portfolio.rate.service; + +import org.apache.fineract.infrastructure.core.data.EnumOptionData; +import org.apache.fineract.portfolio.rate.domain.RateAppliesTo; + +public class RateEnumerations { + + public static EnumOptionData rateAppliesTo(final int id) { + return rateAppliesTo(RateAppliesTo.fromInt(id)); + } + + public static EnumOptionData rateAppliesTo(final RateAppliesTo type) { + EnumOptionData optionData = null; + switch (type) { + case LOAN: + optionData = new EnumOptionData(RateAppliesTo.LOAN.getValue().longValue(), RateAppliesTo.LOAN.getCode(), "Loan"); + break; + default: + optionData = new EnumOptionData(RateAppliesTo.INVALID.getValue().longValue(), RateAppliesTo.INVALID.getCode(), + "Invalid"); + break; + } + return optionData; + } + + + +} diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateReadServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateReadServiceImpl.java index 44682ded60d..f3e5e4faf25 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateReadServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateReadServiceImpl.java @@ -19,8 +19,11 @@ package org.apache.fineract.portfolio.rate.service; +import org.apache.fineract.infrastructure.core.data.EnumOptionData; import org.apache.fineract.infrastructure.core.service.RoutingDataSource; import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext; +import org.apache.fineract.portfolio.charge.service.ChargeEnumerations; +import org.apache.fineract.portfolio.rate.domain.RateAppliesTo; import org.apache.fineract.portfolio.rate.exception.RateNotFoundException; import org.apache.fineract.portfolio.rate.domain.Rate; import org.apache.fineract.portfolio.rate.data.RateData; @@ -92,7 +95,7 @@ public Collection retrieveLoanApplicableRates() { this.context.authenticatedUser(); final RateMapper rm = new RateMapper(); final String sql = "select " + rm.rateSchema() + " where r.active = ? and product_apply=?"; - return this.jdbcTemplate.query(sql, rm, new Object[]{true, "m_loan"}); + return this.jdbcTemplate.query(sql, rm, new Object[]{true, RateAppliesTo.LOAN.getValue() }); } @Override @@ -133,16 +136,17 @@ public RateData mapRow(ResultSet resultSet, int i) throws SQLException { final Long id = resultSet.getLong("id"); final String name = resultSet.getString("name"); final BigDecimal percentage = resultSet.getBigDecimal("percentage"); - final String productApply = resultSet.getString("productApply"); + final Integer productApply = resultSet.getInt("productApply"); + final EnumOptionData productAppliesTo = RateEnumerations.rateAppliesTo(productApply); final boolean active = resultSet.getBoolean("active"); - return RateData.instance(id, name, percentage, productApply, active); + return RateData.instance(id, name, percentage, productAppliesTo, active); } public RateData mapRow(Rate rateResponse, int i) { final Long id = rateResponse.getId(); final String name = rateResponse.getName(); final BigDecimal percentage = rateResponse.getPercentage(); - final String productApply = rateResponse.getProductApply(); + final EnumOptionData productApply = RateEnumerations.rateAppliesTo(rateResponse.getProductApply());; final boolean active = rateResponse.isActive(); return RateData.instance(id, name, percentage, productApply, active); } diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V352__rates.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V352__rates.sql index 1ca09865648..8f35ce8d549 100644 --- a/fineract-provider/src/main/resources/sql/migrations/core_db/V352__rates.sql +++ b/fineract-provider/src/main/resources/sql/migrations/core_db/V352__rates.sql @@ -22,7 +22,7 @@ CREATE TABLE IF NOT EXISTS `m_rate` ( `name` varchar(250) NOT NULL, `percentage` decimal(10,2) NOT NULL, `active` tinyint(1) DEFAULT '0', - `product_apply` varchar(100) NOT NULL, + `product_apply` smallint(5) NOT NULL, `created_date` datetime NULL DEFAULT NULL, `createdby_id` bigint(20) NOT NULL, `lastmodifiedby_id` bigint(20) NOT NULL, @@ -58,10 +58,10 @@ CREATE TABLE IF NOT EXISTS `m_product_loan_rate` ( INSERT INTO `m_permission` (`grouping`,`code`,`entity_name`,`action_name`,`can_maker_checker`) VALUES + ('organisation', 'READ_RATE', 'RATE', 'CREATE', '1'), ('organisation', 'CREATE_RATE', 'RATE', 'CREATE', '1'), ('organisation', 'UPDATE_RATE', 'RATE', 'UPDATE', '1'); INSERT INTO `c_configuration` (`name`, `value`, `enabled`, `is_trap_door`, `description`) VALUES -('vat-tax', 12, 0, 0, 'VAT tax'), -('sub-rates', 12, 0, 0, 'Enable Rates Module');; +('sub-rates', 0, 0, 0, 'Enable Rates Module'); From e2f5c950349d713663c101e67345a9734f40d6d3 Mon Sep 17 00:00:00 2001 From: Angel Cajas Date: Mon, 13 Jan 2020 15:04:25 -0600 Subject: [PATCH 15/37] Fixing some code to be compatible with Spring update --- .../rate/domain/RateRepositoryWrapper.java | 9 ++------- .../rate/service/RateWriteServiceImpl.java | 14 ++++++-------- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/domain/RateRepositoryWrapper.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/domain/RateRepositoryWrapper.java index 7604a11561d..679c2d798c1 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/domain/RateRepositoryWrapper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/domain/RateRepositoryWrapper.java @@ -36,19 +36,14 @@ public RateRepositoryWrapper(final RateRepository repository) { } public Rate findOneWithNotFoundDetection(final Long rateId) { - - final Rate rate = this.repository.findOne(rateId); - if (rate == null) { - throw new RateNotFoundException(rateId); - } - + final Rate rate = this.repository.findById(rateId).orElseThrow(() -> new RateNotFoundException(rateId)); return rate; } public List findMultipleWithNotFoundDetection(final List rateIds) { List rates = new ArrayList<>(); if (rateIds != null && !rateIds.isEmpty()) { - final List foundRates = this.repository.findAll(rateIds); + final List foundRates = this.repository.findAllById(rateIds); for (Long rateId : rateIds) { Boolean found = false; for (Rate foundRate : foundRates) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateWriteServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateWriteServiceImpl.java index 51f97b4e8b2..b7f7c3d9cff 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateWriteServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateWriteServiceImpl.java @@ -34,6 +34,7 @@ import org.apache.fineract.portfolio.rate.serialization.RateDefinitionCommandFromApiJsonDeserializer; import org.apache.fineract.useradministration.domain.AppUser; import org.apache.fineract.useradministration.domain.AppUserRepository; +import org.apache.fineract.useradministration.exception.UserNotFoundException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -73,7 +74,7 @@ public CommandProcessingResult createRate(JsonCommand command) { final Long approveUserId = command.longValueOfParameterNamed(approveUserIdParamName); AppUser approveUser = null; if (approveUserId != null) { - approveUser = this.appUserRepository.findOne(approveUserId); + approveUser = this.appUserRepository.findById(approveUserId).orElseThrow(() -> new UserNotFoundException(approveUserId)); } final Rate rate = Rate.fromJson(command, approveUser); @@ -98,20 +99,17 @@ public CommandProcessingResult updateRate(final Long rateId, final JsonCommand c try { this.context.authenticatedUser(); - final Rate rateToUpdate = this.rateRepository.findOne(rateId); - if (rateToUpdate == null) { - throw new RateNotFoundException(rateId); - } + final Rate rateToUpdate = this.rateRepository.findById(rateId).orElseThrow(() -> new RateNotFoundException(rateId)); final Map changes = rateToUpdate.update(command); this.fromApiJsonDeserializer.validateForUpdate(command.json()); if (changes.containsKey(approveUserIdParamName)) { - final Long newValue = (Long) changes.get(approveUserIdParamName); + final Long newApproveUserId = (Long) changes.get(approveUserIdParamName); AppUser newApproveUser = null; - if (newValue != null) { - newApproveUser = this.appUserRepository.findOne(newValue); + if (newApproveUserId != null) { + newApproveUser = this.appUserRepository.findById(newApproveUserId).orElseThrow(() -> new UserNotFoundException(newApproveUserId)); } rateToUpdate.setApproveUser(newApproveUser); } From 3a1a90d15e864fe42eac02ad697d31ec746744e9 Mon Sep 17 00:00:00 2001 From: Angel Cajas Date: Mon, 13 Jan 2020 16:40:38 -0600 Subject: [PATCH 16/37] Fineract-614: Renaming SQL file for a higher version number --- .../sql/migrations/core_db/{V352__rates.sql => V354__rates.sql} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename fineract-provider/src/main/resources/sql/migrations/core_db/{V352__rates.sql => V354__rates.sql} (100%) diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V352__rates.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V354__rates.sql similarity index 100% rename from fineract-provider/src/main/resources/sql/migrations/core_db/V352__rates.sql rename to fineract-provider/src/main/resources/sql/migrations/core_db/V354__rates.sql From 15a4a7695ac28e4e92ef64b3a47250a1110db30d Mon Sep 17 00:00:00 2001 From: Angel Cajas Date: Wed, 5 Feb 2020 09:27:37 -0600 Subject: [PATCH 17/37] Fineract-614: Updating Global Configurations Fixing some rebase conflicts --- .../common/GlobalConfigurationHelper.java | 12 ++++++++++-- .../fineract/portfolio/loanaccount/domain/Loan.java | 1 + .../portfolio/loanproduct/data/LoanProductData.java | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/GlobalConfigurationHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/GlobalConfigurationHelper.java index 59cdbedcb99..c76a6ef74db 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/GlobalConfigurationHelper.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/GlobalConfigurationHelper.java @@ -79,8 +79,8 @@ public static void verifyAllDefaultGlobalConfigurations(final RequestSpecificati ArrayList actualGlobalConfigurations = getAllGlobalConfigurations(requestSpec, responseSpec); // There are currently 27 global configurations. - Assert.assertEquals(27, expectedGlobalConfigurations.size()); - Assert.assertEquals(27, actualGlobalConfigurations.size()); + Assert.assertEquals(28, expectedGlobalConfigurations.size()); + Assert.assertEquals(28, actualGlobalConfigurations.size()); for (int i = 0; i < expectedGlobalConfigurations.size(); i++) { @@ -324,6 +324,14 @@ private static ArrayList getAllDefaultGlobalConfigurations() { enableAddressDefault.put("trapDoor", false); defaults.add(enableAddressDefault); + HashMap enableSubRatesDefault = new HashMap<>(); + enableSubRatesDefault.put("id", 32); + enableSubRatesDefault.put("name", "sub-rates"); + enableSubRatesDefault.put("value", 0); + enableSubRatesDefault.put("enabled", false); + enableSubRatesDefault.put("trapDoor", false); + defaults.add(enableSubRatesDefault); + return defaults; } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java index 201d7715b28..5a979c8fd8b 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java @@ -45,6 +45,7 @@ import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.JoinColumn; +import javax.persistence.JoinTable; import javax.persistence.ManyToOne; import javax.persistence.OneToMany; import javax.persistence.OneToOne; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/data/LoanProductData.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/data/LoanProductData.java index dd9b83fd5c8..677c3cabf6b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/data/LoanProductData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/data/LoanProductData.java @@ -743,7 +743,7 @@ public LoanProductData(final LoanProductData productData, final Collection rescheduleStrategyTypeOptions, final List interestRecalculationFrequencyTypeOptions, final List preCloseInterestCalculationStrategyOptions, final List floatingRateOptions, final List interestRecalculationNthDayTypeOptions, - final List interestRecalculationDayOfWeekTypeOptions) { + final List interestRecalculationDayOfWeekTypeOptions, final boolean isRatesEnabled) { this.id = productData.id; this.name = productData.name; this.shortName = productData.shortName; From 8df44af628a171c2708997cc7125460d4f601f74 Mon Sep 17 00:00:00 2001 From: Angel Cajas Date: Wed, 5 Feb 2020 14:28:38 -0600 Subject: [PATCH 18/37] Fineract-614: Updating Global Configurations Fixing some rebase conflicts Change to imports on IntegrationTest for CheckStyle --- .../fineract/integrationtests/RatesTest.java | 58 +++++----- .../common/rates/RatesHelper.java | 109 ++++++++++-------- 2 files changed, 88 insertions(+), 79 deletions(-) diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/RatesTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/RatesTest.java index 0feb6487981..25c2600b1df 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/RatesTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/RatesTest.java @@ -23,49 +23,51 @@ import com.jayway.restassured.http.ContentType; import com.jayway.restassured.specification.RequestSpecification; import com.jayway.restassured.specification.ResponseSpecification; +import java.util.ArrayList; +import java.util.HashMap; import org.apache.fineract.integrationtests.common.Utils; import org.apache.fineract.integrationtests.common.rates.RatesHelper; import org.junit.Assert; import org.junit.Before; import org.junit.Test; -import java.util.ArrayList; -import java.util.HashMap; - @SuppressWarnings({"rawtypes"}) public class RatesTest { - private ResponseSpecification responseSpec; - private RequestSpecification requestSpec; + private ResponseSpecification responseSpec; + private RequestSpecification requestSpec; + + @Before + public void setup() { + Utils.initializeRESTAssured(); + this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); + this.requestSpec.header("Authorization", + "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey()); + this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build(); + } - @Before - public void setup() { - Utils.initializeRESTAssured(); - this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); - this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey()); - this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build(); - } + @Test + public void testRatesForLoans() { - @Test - public void testRatesForLoans() { + // Retrieving all Rates + ArrayList allRatesData = RatesHelper.getRates(this.requestSpec, this.responseSpec); + Assert.assertNotNull(allRatesData); - // Retrieving all Rates - ArrayList allRatesData = RatesHelper.getRates(this.requestSpec, this.responseSpec); - Assert.assertNotNull(allRatesData); + // Testing Creation and Update of Loan Rate + final Integer loanRateId = RatesHelper.createRates(this.requestSpec, this.responseSpec, + RatesHelper.getLoanRateJSON()); + Assert.assertNotNull(loanRateId); - // Testing Creation and Update of Loan Rate - final Integer loanRateId = RatesHelper.createRates(this.requestSpec, this.responseSpec, - RatesHelper.getLoanRateJSON()); - Assert.assertNotNull(loanRateId); + //Update Rate percentage + HashMap changes = RatesHelper.updateRates(this.requestSpec, this.responseSpec, loanRateId, + RatesHelper.getModifyRateJSON()); - //Update Rate percentage - HashMap changes = RatesHelper.updateRates(this.requestSpec, this.responseSpec, loanRateId, - RatesHelper.getModifyRateJSON()); + HashMap rateDataAfterChanges = RatesHelper + .getRateById(this.requestSpec, this.responseSpec, loanRateId); + Assert.assertEquals("Verifying Rate after modification", rateDataAfterChanges.get("percentage"), + changes.get("percentage")); - HashMap rateDataAfterChanges = RatesHelper.getRateById(this.requestSpec, this.responseSpec, loanRateId); - Assert.assertEquals("Verifying Rate after modification", rateDataAfterChanges.get("percentage"), changes.get("percentage")); + } - } - } diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/rates/RatesHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/rates/RatesHelper.java index 43fd0d7dc42..01688b5feab 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/rates/RatesHelper.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/rates/RatesHelper.java @@ -21,71 +21,78 @@ import com.google.gson.Gson; import com.jayway.restassured.specification.RequestSpecification; import com.jayway.restassured.specification.ResponseSpecification; -import org.apache.fineract.integrationtests.common.CommonConstants; -import org.apache.fineract.integrationtests.common.Utils; - import java.util.ArrayList; import java.util.HashMap; +import org.apache.fineract.integrationtests.common.CommonConstants; +import org.apache.fineract.integrationtests.common.Utils; -@SuppressWarnings({ "rawtypes", "unchecked" }) +@SuppressWarnings({"rawtypes", "unchecked"}) public class RatesHelper { - private static final String RATES_URL = "/fineract-provider/api/v1/rates"; - private static final String CREATE_RATES_URL = RATES_URL + "?" + Utils.TENANT_IDENTIFIER; - private final static String PERCENTAGE = "10"; - private final static Integer PRODUCT_APPLY_LOAN = 1; - private final static Boolean ACTIVE = true; + private static final String RATES_URL = "/fineract-provider/api/v1/rates"; + private static final String CREATE_RATES_URL = RATES_URL + "?" + Utils.TENANT_IDENTIFIER; + private final static String PERCENTAGE = "10"; + private final static Integer PRODUCT_APPLY_LOAN = 1; + private final static Boolean ACTIVE = true; - public static ArrayList getRates(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) { - return (ArrayList) Utils.performServerGet(requestSpec, responseSpec, RATES_URL + "?" + Utils.TENANT_IDENTIFIER, ""); - } + public static ArrayList getRates(final RequestSpecification requestSpec, + final ResponseSpecification responseSpec) { + return (ArrayList) Utils + .performServerGet(requestSpec, responseSpec, RATES_URL + "?" + Utils.TENANT_IDENTIFIER, ""); + } - public static Integer createRates(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, - final String request) { - return Utils.performServerPost(requestSpec, responseSpec, CREATE_RATES_URL, request, "resourceId"); - } + public static Integer createRates(final RequestSpecification requestSpec, + final ResponseSpecification responseSpec, + final String request) { + return Utils + .performServerPost(requestSpec, responseSpec, CREATE_RATES_URL, request, "resourceId"); + } - public static HashMap getRateById(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, - final Integer rateId) { - return Utils.performServerGet(requestSpec, responseSpec, RATES_URL + "/" + rateId + "?" + Utils.TENANT_IDENTIFIER, ""); - } + public static HashMap getRateById(final RequestSpecification requestSpec, + final ResponseSpecification responseSpec, + final Integer rateId) { + return Utils.performServerGet(requestSpec, responseSpec, + RATES_URL + "/" + rateId + "?" + Utils.TENANT_IDENTIFIER, ""); + } - public static HashMap updateRates(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, - final Integer rateId, final String request) { - return Utils.performServerPut(requestSpec, responseSpec, RATES_URL + "/" + rateId + "?" + Utils.TENANT_IDENTIFIER, request, - CommonConstants.RESPONSE_CHANGES); - } + public static HashMap updateRates(final RequestSpecification requestSpec, + final ResponseSpecification responseSpec, + final Integer rateId, final String request) { + return Utils.performServerPut(requestSpec, responseSpec, + RATES_URL + "/" + rateId + "?" + Utils.TENANT_IDENTIFIER, request, + CommonConstants.RESPONSE_CHANGES); + } - public static String getLoanRateJSON() { - return getLoanRateJSON(RatesHelper.PRODUCT_APPLY_LOAN, RatesHelper.PERCENTAGE); - } + public static String getLoanRateJSON() { + return getLoanRateJSON(RatesHelper.PRODUCT_APPLY_LOAN, RatesHelper.PERCENTAGE); + } - public static String getLoanRateJSON(final Integer productApply, final String percentage) { - final HashMap map = populateDefaultsForLoan(); - map.put("percentage", percentage); - map.put("productApply", productApply); - String crateRateJSON = new Gson().toJson(map); - return crateRateJSON; - } + public static String getLoanRateJSON(final Integer productApply, final String percentage) { + final HashMap map = populateDefaultsForLoan(); + map.put("percentage", percentage); + map.put("productApply", productApply); + String crateRateJSON = new Gson().toJson(map); + return crateRateJSON; + } - public static HashMap populateDefaultsForLoan() { - final HashMap map = new HashMap<>(); - map.put("active", RatesHelper.ACTIVE); - map.put("percentage", RatesHelper.PERCENTAGE); - map.put("locale", "en"); - map.put("productApply", RatesHelper.PRODUCT_APPLY_LOAN); - map.put("name", Utils.randomNameGenerator("Rate_Loans_", 6)); - return map; - } + public static HashMap populateDefaultsForLoan() { + final HashMap map = new HashMap<>(); + map.put("active", RatesHelper.ACTIVE); + map.put("percentage", RatesHelper.PERCENTAGE); + map.put("locale", "en"); + map.put("productApply", RatesHelper.PRODUCT_APPLY_LOAN); + map.put("name", Utils.randomNameGenerator("Rate_Loans_", 6)); + return map; + } - public static String getModifyRateJSON() { - final HashMap map = new HashMap<>(); - map.put("percentage", "15.0"); - map.put("locale", "en"); - String json = new Gson().toJson(map); - return json; - } + public static String getModifyRateJSON() { + final HashMap map = new HashMap<>(); + map.put("percentage", "15.0"); + map.put("locale", "en"); + String json = new Gson().toJson(map); + return json; + } } From b9b265b9150fb0ded2f32330281c7b01d16b19b1 Mon Sep 17 00:00:00 2001 From: Angel Cajas Date: Wed, 26 Feb 2020 16:41:48 -0600 Subject: [PATCH 19/37] Fineract-614 Changes to comply with Checkstyle rules --- .../loanaccount/api/LoansApiResource.java | 42 +++++------ .../loanaccount/service/LoanAssembler.java | 3 - .../portfolio/rate/api/RateApiResource.java | 14 ++-- .../portfolio/rate/data/RateData.java | 3 +- .../fineract/portfolio/rate/domain/Rate.java | 29 ++++---- .../portfolio/rate/domain/RateAppliesTo.java | 73 ++++++++++--------- .../portfolio/rate/domain/RateRepository.java | 13 ++-- .../rate/service/RateEnumerations.java | 33 +++++---- .../rate/service/RateReadService.java | 3 +- .../rate/service/RateReadServiceImpl.java | 21 +++--- 10 files changed, 117 insertions(+), 117 deletions(-) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoansApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoansApiResource.java index 7b65d8a48cd..112d830cf64 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoansApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoansApiResource.java @@ -299,27 +299,27 @@ public class LoansApiResource { @Autowired public LoansApiResource(final PlatformSecurityContext context, final LoanReadPlatformService loanReadPlatformService, - final LoanProductReadPlatformService loanProductReadPlatformService, - final LoanDropdownReadPlatformService dropdownReadPlatformService, final FundReadPlatformService fundReadPlatformService, - final ChargeReadPlatformService chargeReadPlatformService, final LoanChargeReadPlatformService loanChargeReadPlatformService, - final CollateralReadPlatformService loanCollateralReadPlatformService, - final LoanScheduleCalculationPlatformService calculationPlatformService, - final GuarantorReadPlatformService guarantorReadPlatformService, - final CodeValueReadPlatformService codeValueReadPlatformService, final GroupReadPlatformService groupReadPlatformService, - final DefaultToApiJsonSerializer toApiJsonSerializer, - final DefaultToApiJsonSerializer loanApprovalDataToApiJsonSerializer, - final DefaultToApiJsonSerializer loanScheduleToApiJsonSerializer, - final ApiRequestParameterHelper apiRequestParameterHelper, final FromJsonHelper fromJsonHelper, - final PortfolioCommandSourceWritePlatformService commandsSourceWritePlatformService, - final CalendarReadPlatformService calendarReadPlatformService, final NoteReadPlatformServiceImpl noteReadPlatformService, - final PortfolioAccountReadPlatformService portfolioAccountReadPlatformServiceImpl, - final AccountAssociationsReadPlatformService accountAssociationsReadPlatformService, - final LoanScheduleHistoryReadPlatformService loanScheduleHistoryReadPlatformService, - final AccountDetailsReadPlatformService accountDetailsReadPlatformService, - final EntityDatatableChecksReadService entityDatatableChecksReadService, - final BulkImportWorkbookService bulkImportWorkbookService, - final BulkImportWorkbookPopulatorService bulkImportWorkbookPopulatorService, final RateReadService rateReadService, - final ConfigurationDomainService configurationDomainService) { + final LoanProductReadPlatformService loanProductReadPlatformService, + final LoanDropdownReadPlatformService dropdownReadPlatformService, final FundReadPlatformService fundReadPlatformService, + final ChargeReadPlatformService chargeReadPlatformService, final LoanChargeReadPlatformService loanChargeReadPlatformService, + final CollateralReadPlatformService loanCollateralReadPlatformService, + final LoanScheduleCalculationPlatformService calculationPlatformService, + final GuarantorReadPlatformService guarantorReadPlatformService, + final CodeValueReadPlatformService codeValueReadPlatformService, final GroupReadPlatformService groupReadPlatformService, + final DefaultToApiJsonSerializer toApiJsonSerializer, + final DefaultToApiJsonSerializer loanApprovalDataToApiJsonSerializer, + final DefaultToApiJsonSerializer loanScheduleToApiJsonSerializer, + final ApiRequestParameterHelper apiRequestParameterHelper, final FromJsonHelper fromJsonHelper, + final PortfolioCommandSourceWritePlatformService commandsSourceWritePlatformService, + final CalendarReadPlatformService calendarReadPlatformService, final NoteReadPlatformServiceImpl noteReadPlatformService, + final PortfolioAccountReadPlatformService portfolioAccountReadPlatformServiceImpl, + final AccountAssociationsReadPlatformService accountAssociationsReadPlatformService, + final LoanScheduleHistoryReadPlatformService loanScheduleHistoryReadPlatformService, + final AccountDetailsReadPlatformService accountDetailsReadPlatformService, + final EntityDatatableChecksReadService entityDatatableChecksReadService, + final BulkImportWorkbookService bulkImportWorkbookService, + final BulkImportWorkbookPopulatorService bulkImportWorkbookPopulatorService, final RateReadService rateReadService, + final ConfigurationDomainService configurationDomainService) { this.context = context; this.loanReadPlatformService = loanReadPlatformService; this.loanProductReadPlatformService = loanProductReadPlatformService; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanAssembler.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanAssembler.java index 094b2e88fa7..6414975693f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanAssembler.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanAssembler.java @@ -25,8 +25,6 @@ import java.util.List; import java.util.Locale; import java.util.Set; - -import com.google.gson.JsonArray; import org.apache.fineract.infrastructure.codes.domain.CodeValue; import org.apache.fineract.infrastructure.codes.domain.CodeValueRepositoryWrapper; import org.apache.fineract.infrastructure.configuration.domain.ConfigurationDomainService; @@ -73,7 +71,6 @@ import org.apache.fineract.portfolio.loanaccount.loanschedule.domain.LoanApplicationTerms; import org.apache.fineract.portfolio.loanaccount.loanschedule.domain.LoanScheduleModel; import org.apache.fineract.portfolio.loanaccount.loanschedule.service.LoanScheduleAssembler; -import org.apache.fineract.portfolio.loanproduct.LoanProductConstants; import org.apache.fineract.portfolio.loanproduct.domain.LoanProduct; import org.apache.fineract.portfolio.loanproduct.domain.LoanProductRelatedDetail; import org.apache.fineract.portfolio.loanproduct.domain.LoanProductRepository; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/api/RateApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/api/RateApiResource.java index 801583163ba..014891dc22c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/api/RateApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/api/RateApiResource.java @@ -20,9 +20,18 @@ package org.apache.fineract.portfolio.rate.api; import java.util.Arrays; +import java.util.Collection; import java.util.HashSet; import java.util.Set; +import javax.ws.rs.Consumes; +import javax.ws.rs.GET; +import javax.ws.rs.POST; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; import javax.ws.rs.core.Context; +import javax.ws.rs.core.MediaType; import javax.ws.rs.core.UriInfo; import org.apache.fineract.commands.domain.CommandWrapper; import org.apache.fineract.commands.service.CommandWrapperBuilder; @@ -34,15 +43,10 @@ import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext; import org.apache.fineract.portfolio.rate.data.RateData; import org.apache.fineract.portfolio.rate.service.RateReadService; -import org.apache.fineract.portfolio.rate.service.RateWriteService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Component; -import javax.ws.rs.*; -import javax.ws.rs.core.MediaType; -import java.util.Collection; - /** * Bowpi GT Created by Jose on 19/07/2017. */ diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/data/RateData.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/data/RateData.java index e249a1f1eb4..d6fdeb4f818 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/data/RateData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/data/RateData.java @@ -19,10 +19,9 @@ package org.apache.fineract.portfolio.rate.data; -import org.apache.fineract.infrastructure.core.data.EnumOptionData; - import java.io.Serializable; import java.math.BigDecimal; +import org.apache.fineract.infrastructure.core.data.EnumOptionData; /** * Bowpi GT Created by Jose on 19/07/2017. diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/domain/Rate.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/domain/Rate.java index ad808f4cb3f..50d322a5e0a 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/domain/Rate.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/domain/Rate.java @@ -19,22 +19,20 @@ package org.apache.fineract.portfolio.rate.domain; -import java.util.ArrayList; +import java.math.BigDecimal; import java.util.LinkedHashMap; -import java.util.List; import java.util.Map; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.UniqueConstraint; import org.apache.commons.lang.StringUtils; import org.apache.fineract.infrastructure.core.api.JsonCommand; -import org.apache.fineract.infrastructure.core.data.ApiParameterError; -import org.apache.fineract.infrastructure.core.data.DataValidatorBuilder; -import org.apache.fineract.infrastructure.core.exception.PlatformApiDataValidationException; +import org.apache.fineract.infrastructure.core.domain.AbstractAuditableCustom; import org.apache.fineract.portfolio.charge.exception.ChargeParameterUpdateNotSupportedException; import org.apache.fineract.useradministration.domain.AppUser; -import org.apache.fineract.portfolio.rate.domain.RateAppliesTo; - -import javax.persistence.*; -import java.math.BigDecimal; -import org.apache.fineract.infrastructure.core.domain.AbstractAuditableCustom; /** * Bowpi GT Created by Jose on 19/07/2017. @@ -133,7 +131,8 @@ public String toString() { '}'; } - public static Rate from(String name, BigDecimal percentage, RateAppliesTo productApply, Boolean active) { + public static Rate from(String name, BigDecimal percentage, RateAppliesTo productApply, + Boolean active) { return new Rate(name, percentage, productApply, active); } @@ -143,8 +142,9 @@ public static Rate fromJson(final JsonCommand command, AppUser user) { final BigDecimal percentage = command.bigDecimalValueOfParameterNamed("percentage"); - final RateAppliesTo productApply = RateAppliesTo.fromInt(command.integerValueOfParameterNamed("productApply")); - + final RateAppliesTo productApply = RateAppliesTo + .fromInt(command.integerValueOfParameterNamed("productApply")); + final boolean active = command.booleanPrimitiveValueOfParameterNamed("active"); return new Rate(name, percentage, productApply, active, user); @@ -198,7 +198,8 @@ private Long getApproveUserId() { return approveUserId; } - public void assembleFrom(String name, BigDecimal percentage, Integer productApply, boolean active){ + public void assembleFrom(String name, BigDecimal percentage, Integer productApply, + boolean active) { this.name = name; this.percentage = percentage; this.productApply = productApply; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/domain/RateAppliesTo.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/domain/RateAppliesTo.java index 684e1423630..7115fe93939 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/domain/RateAppliesTo.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/domain/RateAppliesTo.java @@ -16,51 +16,52 @@ * specific language governing permissions and limitations * under the License. */ - - package org.apache.fineract.portfolio.rate.domain; + +package org.apache.fineract.portfolio.rate.domain; public enum RateAppliesTo { - INVALID(0, "rateAppliesTo.invalid"), - LOAN(1, "rateAppliesTo.loan"); - - private final Integer value; - private final String code; + INVALID(0, "rateAppliesTo.invalid"), + LOAN(1, "rateAppliesTo.loan"); - private RateAppliesTo(final Integer value, final String code) { - this.value = value; - this.code = code; - } + private final Integer value; + private final String code; - public Integer getValue() { - return this.value; - } + private RateAppliesTo(final Integer value, final String code) { + this.value = value; + this.code = code; + } - public String getCode() { - return this.code; - } + public Integer getValue() { + return this.value; + } - public static RateAppliesTo fromInt(final Integer rateAppliesTo) { - RateAppliesTo rateAppliesToType = RateAppliesTo.INVALID; + public String getCode() { + return this.code; + } - if (rateAppliesTo != null) { - switch (rateAppliesTo) { - case 1: - rateAppliesToType = LOAN; - break; - default: - rateAppliesToType = INVALID; - break; - } - } + public static RateAppliesTo fromInt(final Integer rateAppliesTo) { + RateAppliesTo rateAppliesToType = RateAppliesTo.INVALID; - return rateAppliesToType; + if (rateAppliesTo != null) { + switch (rateAppliesTo) { + case 1: + rateAppliesToType = LOAN; + break; + default: + rateAppliesToType = INVALID; + break; + } } - public boolean isLoanRate() { - return this.value.equals(RateAppliesTo.LOAN.getValue()); - } - public static Object[] validValues() { - return new Object[] { RateAppliesTo.LOAN.getValue() }; - } + return rateAppliesToType; + } + + public boolean isLoanRate() { + return this.value.equals(RateAppliesTo.LOAN.getValue()); + } + + public static Object[] validValues() { + return new Object[]{RateAppliesTo.LOAN.getValue()}; + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/domain/RateRepository.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/domain/RateRepository.java index e593ac82a91..f9210fa44fa 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/domain/RateRepository.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/domain/RateRepository.java @@ -18,19 +18,18 @@ */ package org.apache.fineract.portfolio.rate.domain; +import java.util.List; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaSpecificationExecutor; -import java.util.List; - /** - * Bowpi GT - * Rate repository to save on m_rate table (custom change for Credi Chapin) - * Created by Jose on 19/07/2017. + * Bowpi GT Rate repository to save on m_rate table (custom change for Credi Chapin) Created by Jose + * on 19/07/2017. */ public interface RateRepository extends JpaRepository, JpaSpecificationExecutor { - Rate findByName(String name); - List findAllByActiveAndProductApply(boolean active, String productApply); + Rate findByName(String name); + + List findAllByActiveAndProductApply(boolean active, String productApply); } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateEnumerations.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateEnumerations.java index a1d79a8e5bd..d2cdc226e42 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateEnumerations.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateEnumerations.java @@ -24,24 +24,25 @@ public class RateEnumerations { - public static EnumOptionData rateAppliesTo(final int id) { - return rateAppliesTo(RateAppliesTo.fromInt(id)); - } + public static EnumOptionData rateAppliesTo(final int id) { + return rateAppliesTo(RateAppliesTo.fromInt(id)); + } - public static EnumOptionData rateAppliesTo(final RateAppliesTo type) { - EnumOptionData optionData = null; - switch (type) { - case LOAN: - optionData = new EnumOptionData(RateAppliesTo.LOAN.getValue().longValue(), RateAppliesTo.LOAN.getCode(), "Loan"); - break; - default: - optionData = new EnumOptionData(RateAppliesTo.INVALID.getValue().longValue(), RateAppliesTo.INVALID.getCode(), - "Invalid"); - break; - } - return optionData; + public static EnumOptionData rateAppliesTo(final RateAppliesTo type) { + EnumOptionData optionData = null; + switch (type) { + case LOAN: + optionData = new EnumOptionData(RateAppliesTo.LOAN.getValue().longValue(), + RateAppliesTo.LOAN.getCode(), "Loan"); + break; + default: + optionData = new EnumOptionData(RateAppliesTo.INVALID.getValue().longValue(), + RateAppliesTo.INVALID.getCode(), + "Invalid"); + break; } + return optionData; + } - } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateReadService.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateReadService.java index 7b4b0512129..81b15d31df1 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateReadService.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateReadService.java @@ -18,10 +18,9 @@ */ package org.apache.fineract.portfolio.rate.service; -import org.apache.fineract.portfolio.rate.data.RateData; - import java.util.Collection; import java.util.List; +import org.apache.fineract.portfolio.rate.data.RateData; /** * Bowpi GT diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateReadServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateReadServiceImpl.java index f3e5e4faf25..35a0e5befc2 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateReadServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateReadServiceImpl.java @@ -19,26 +19,24 @@ package org.apache.fineract.portfolio.rate.service; +import java.math.BigDecimal; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.Collection; +import java.util.List; import org.apache.fineract.infrastructure.core.data.EnumOptionData; import org.apache.fineract.infrastructure.core.service.RoutingDataSource; import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext; -import org.apache.fineract.portfolio.charge.service.ChargeEnumerations; +import org.apache.fineract.portfolio.rate.data.RateData; +import org.apache.fineract.portfolio.rate.domain.Rate; import org.apache.fineract.portfolio.rate.domain.RateAppliesTo; import org.apache.fineract.portfolio.rate.exception.RateNotFoundException; -import org.apache.fineract.portfolio.rate.domain.Rate; -import org.apache.fineract.portfolio.rate.data.RateData; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.dao.EmptyResultDataAccessException; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.RowMapper; import org.springframework.stereotype.Service; -import java.math.BigDecimal; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.Collection; -import java.util.List; - /** * Bowpi GT Created by Jose on 19/07/2017. */ @@ -95,7 +93,7 @@ public Collection retrieveLoanApplicableRates() { this.context.authenticatedUser(); final RateMapper rm = new RateMapper(); final String sql = "select " + rm.rateSchema() + " where r.active = ? and product_apply=?"; - return this.jdbcTemplate.query(sql, rm, new Object[]{true, RateAppliesTo.LOAN.getValue() }); + return this.jdbcTemplate.query(sql, rm, new Object[]{true, RateAppliesTo.LOAN.getValue()}); } @Override @@ -146,7 +144,8 @@ public RateData mapRow(Rate rateResponse, int i) { final Long id = rateResponse.getId(); final String name = rateResponse.getName(); final BigDecimal percentage = rateResponse.getPercentage(); - final EnumOptionData productApply = RateEnumerations.rateAppliesTo(rateResponse.getProductApply());; + final EnumOptionData productApply = RateEnumerations + .rateAppliesTo(rateResponse.getProductApply()); final boolean active = rateResponse.isActive(); return RateData.instance(id, name, percentage, productApply, active); } From b1eb62f2212963670365811b2109074b72bd25aa Mon Sep 17 00:00:00 2001 From: Michael Vorburger Date: Fri, 13 Mar 2020 17:40:11 +0100 Subject: [PATCH 20/37] fix broken build due to small logging error detected by SpotBugs significant reformatting due to Eclipse auto-save action (someone really needs to finish the Checkstyle uniform formatting) see https://github.com/apache/fineract/pull/592 --- .../rate/service/RateWriteServiceImpl.java | 190 +++++++++--------- 1 file changed, 94 insertions(+), 96 deletions(-) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateWriteServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateWriteServiceImpl.java index b7f7c3d9cff..bc820da4c7e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateWriteServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/service/RateWriteServiceImpl.java @@ -48,108 +48,106 @@ @Service public class RateWriteServiceImpl implements RateWriteService { - private final static Logger logger = LoggerFactory - .getLogger(RateWriteServiceImpl.class); - private final RateRepository rateRepository; - private final AppUserRepository appUserRepository; - private final PlatformSecurityContext context; - private final RateDefinitionCommandFromApiJsonDeserializer fromApiJsonDeserializer; - - @Autowired - public RateWriteServiceImpl(RateRepository rateRepository, AppUserRepository appUserRepository, - final RateDefinitionCommandFromApiJsonDeserializer fromApiJsonDeserializer, - PlatformSecurityContext context) { - this.rateRepository = rateRepository; - this.appUserRepository = appUserRepository; - this.context = context; - this.fromApiJsonDeserializer = fromApiJsonDeserializer; - } - - @Override - public CommandProcessingResult createRate(JsonCommand command) { - try { - this.context.authenticatedUser(); - this.fromApiJsonDeserializer.validateForCreate(command.json()); - - final Long approveUserId = command.longValueOfParameterNamed(approveUserIdParamName); - AppUser approveUser = null; - if (approveUserId != null) { - approveUser = this.appUserRepository.findById(approveUserId).orElseThrow(() -> new UserNotFoundException(approveUserId)); - } - final Rate rate = Rate.fromJson(command, approveUser); - - this.rateRepository.save(rate); - - return new CommandProcessingResultBuilder().withCommandId(command.commandId()) - .withEntityId(rate.getId()).build(); - - } catch (final DataIntegrityViolationException dve) { - handleRateDataIntegrityIssues(command, dve.getMostSpecificCause(), dve); - return CommandProcessingResult.empty(); - } catch (final PersistenceException dve) { - Throwable throwable = ExceptionUtils.getRootCause(dve.getCause()); - handleRateDataIntegrityIssues(command, throwable, dve); - return CommandProcessingResult.empty(); + private final static Logger logger = LoggerFactory.getLogger(RateWriteServiceImpl.class); + + private final RateRepository rateRepository; + private final AppUserRepository appUserRepository; + private final PlatformSecurityContext context; + private final RateDefinitionCommandFromApiJsonDeserializer fromApiJsonDeserializer; + + @Autowired + public RateWriteServiceImpl(RateRepository rateRepository, AppUserRepository appUserRepository, + final RateDefinitionCommandFromApiJsonDeserializer fromApiJsonDeserializer, + PlatformSecurityContext context) { + this.rateRepository = rateRepository; + this.appUserRepository = appUserRepository; + this.context = context; + this.fromApiJsonDeserializer = fromApiJsonDeserializer; } - } - @Transactional - @Override - public CommandProcessingResult updateRate(final Long rateId, final JsonCommand command) { - try { - this.context.authenticatedUser(); - - final Rate rateToUpdate = this.rateRepository.findById(rateId).orElseThrow(() -> new RateNotFoundException(rateId)); - - final Map changes = rateToUpdate.update(command); - - this.fromApiJsonDeserializer.validateForUpdate(command.json()); - - if (changes.containsKey(approveUserIdParamName)) { - final Long newApproveUserId = (Long) changes.get(approveUserIdParamName); - AppUser newApproveUser = null; - if (newApproveUserId != null) { - newApproveUser = this.appUserRepository.findById(newApproveUserId).orElseThrow(() -> new UserNotFoundException(newApproveUserId)); + @Override + public CommandProcessingResult createRate(JsonCommand command) { + try { + this.context.authenticatedUser(); + this.fromApiJsonDeserializer.validateForCreate(command.json()); + + final Long approveUserId = command.longValueOfParameterNamed(approveUserIdParamName); + AppUser approveUser = null; + if (approveUserId != null) { + approveUser = this.appUserRepository.findById(approveUserId).orElseThrow(() -> new UserNotFoundException(approveUserId)); + } + final Rate rate = Rate.fromJson(command, approveUser); + + this.rateRepository.save(rate); + + return new CommandProcessingResultBuilder().withCommandId(command.commandId()) + .withEntityId(rate.getId()).build(); + + } catch (final DataIntegrityViolationException dve) { + handleRateDataIntegrityIssues(command, dve.getMostSpecificCause(), dve); + return CommandProcessingResult.empty(); + } catch (final PersistenceException dve) { + Throwable throwable = ExceptionUtils.getRootCause(dve.getCause()); + handleRateDataIntegrityIssues(command, throwable, dve); + return CommandProcessingResult.empty(); } - rateToUpdate.setApproveUser(newApproveUser); - } - if (!changes.isEmpty()) { - this.rateRepository.saveAndFlush(rateToUpdate); - } - - return new CommandProcessingResultBuilder() // - .withCommandId(command.commandId()) // - .withEntityId(rateId) // - .with(changes) // - .build(); - - } catch (final DataIntegrityViolationException dve) { - handleRateDataIntegrityIssues(command, dve.getMostSpecificCause(), dve); - return new CommandProcessingResult(Long.valueOf(-1)); - } catch (final PersistenceException dve) { - Throwable throwable = ExceptionUtils.getRootCause(dve.getCause()); - handleRateDataIntegrityIssues(command, throwable, dve); - return CommandProcessingResult.empty(); } - } - - /* - * Guaranteed to throw an exception no matter what the data integrity issue - * is. - */ - private void handleRateDataIntegrityIssues(final JsonCommand command, final Throwable realCause, - final Exception dve) { - if (realCause.getMessage().contains("rate_name_org")) { - final String name = command.stringValueOfParameterNamed("name"); - throw new PlatformDataIntegrityException("error.msg.fund.duplicate.externalId", - "A rate with name '" + name - + "' already exists", "name", name); + @Transactional + @Override + public CommandProcessingResult updateRate(final Long rateId, final JsonCommand command) { + try { + this.context.authenticatedUser(); + + final Rate rateToUpdate = this.rateRepository.findById(rateId).orElseThrow(() -> new RateNotFoundException(rateId)); + + final Map changes = rateToUpdate.update(command); + + this.fromApiJsonDeserializer.validateForUpdate(command.json()); + + if (changes.containsKey(approveUserIdParamName)) { + final Long newApproveUserId = (Long) changes.get(approveUserIdParamName); + AppUser newApproveUser = null; + if (newApproveUserId != null) { + newApproveUser = this.appUserRepository.findById(newApproveUserId).orElseThrow(() -> new UserNotFoundException(newApproveUserId)); + } + rateToUpdate.setApproveUser(newApproveUser); + } + if (!changes.isEmpty()) { + this.rateRepository.saveAndFlush(rateToUpdate); + } + + return new CommandProcessingResultBuilder() // + .withCommandId(command.commandId()) // + .withEntityId(rateId) // + .with(changes) // + .build(); + + } catch (final DataIntegrityViolationException dve) { + handleRateDataIntegrityIssues(command, dve.getMostSpecificCause(), dve); + return new CommandProcessingResult((long) -1); + } catch (final PersistenceException dve) { + Throwable throwable = ExceptionUtils.getRootCause(dve.getCause()); + handleRateDataIntegrityIssues(command, throwable, dve); + return CommandProcessingResult.empty(); + } } - logger.error(dve.getMessage(), dve); - throw new PlatformDataIntegrityException("error.msg.fund.unknown.data.integrity.issue", - "Unknown data integrity issue with resource: " + realCause.getMessage()); - } + /* + * Guaranteed to throw an exception no matter what the data integrity issue + * is. + */ + private void handleRateDataIntegrityIssues(final JsonCommand command, final Throwable realCause, + final Exception dve) { + if (realCause.getMessage().contains("rate_name_org")) { + final String name = command.stringValueOfParameterNamed("name"); + throw new PlatformDataIntegrityException("error.msg.fund.duplicate.externalId", + "A rate with name '" + name + + "' already exists", "name", name); + } + logger.error("Error due to Exception", dve); + throw new PlatformDataIntegrityException("error.msg.fund.unknown.data.integrity.issue", + "Unknown data integrity issue with resource: " + realCause.getMessage()); + } } From 3f11dc51a9d666a372e5c73f6d1736d5c5d88afd Mon Sep 17 00:00:00 2001 From: thesmallstar Date: Sun, 15 Mar 2020 14:55:16 +0530 Subject: [PATCH 21/37] Fix: Duplicate migration version --- .../sql/migrations/core_db/{V354__rates.sql => V355__rates.sql} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename fineract-provider/src/main/resources/sql/migrations/core_db/{V354__rates.sql => V355__rates.sql} (100%) diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V354__rates.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V355__rates.sql similarity index 100% rename from fineract-provider/src/main/resources/sql/migrations/core_db/V354__rates.sql rename to fineract-provider/src/main/resources/sql/migrations/core_db/V355__rates.sql From ef5bba4d5228bd03169ea0d90535b2c92af89f1a Mon Sep 17 00:00:00 2001 From: percyashu Date: Tue, 17 Mar 2020 01:48:10 +0100 Subject: [PATCH 22/37] Minor Typo fix --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d51ac20a702..3b5d610a43b 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Fineract is a mature platform with open APIs that provides a reliable, robust, a [![Code Now! (Gitpod)](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/apache/fineract) to start contributing to this project in the online web-based IDE GitPod.io right away! (You may initially have to press F1 to Find Command and run "Java: Start Language Server".) -It's of course also possible to contribute with a "traditional" loca ldevelopment environment (see below). +It's of course also possible to contribute with a "traditional" local development environment (see below). Community ========= From 2e620b4de879ce7b99a5686f8ac48059c16a75e9 Mon Sep 17 00:00:00 2001 From: percyashu Date: Sat, 29 Feb 2020 22:02:23 +0100 Subject: [PATCH 23/37] FINERACT-823 Gradle modernizer fixing violations --- fineract-provider/build.gradle | 27 +++++++++- .../AccountingScenarioIntegrationTest.java | 4 +- .../integrationtests/FixedDepositTest.java | 52 +++++++++--------- .../FundsIntegrationTest.java | 2 +- .../RecurringDepositTest.java | 54 +++++++++---------- .../SchedulerJobsTestResults.java | 2 +- ...bleInstallmentsDecliningBalanceHelper.java | 4 +- .../VariableInstallmentsFlatHelper.java | 2 +- .../VariableInstallmentsIntegrationTest.java | 4 +- .../data/ClientTransactionDTO.java | 2 +- ...sioningEntriesReadPlatformServiceImpl.java | 4 +- .../importhandler/ImportHandlerUtils.java | 6 +-- .../constants/SmsCampaignEnumerations.java | 2 +- .../codes/domain/CodeValue.java | 4 +- .../core/data/PaginationParameters.java | 6 +-- .../service/GenericDataServiceImpl.java | 6 +-- .../service/ReadReportingServiceImpl.java | 9 ++-- .../FineractEntityAccessReadServiceImpl.java | 12 ++--- .../infrastructure/gcm/domain/Sender.java | 2 +- .../hooks/processor/TwilioHookProcessor.java | 2 +- .../jobs/service/JobRegisterServiceImpl.java | 4 +- .../jobs/service/SchedulerJobListener.java | 2 +- .../service/StaffReadPlatformServiceImpl.java | 4 +- ...llerManagementReadPlatformServiceImpl.java | 6 +-- ...ngInstructionWritePlatformServiceImpl.java | 4 +- .../data/ShareAccountSummaryData.java | 4 +- ...sReadPlatformServiceJpaRepositoryImpl.java | 4 +- .../portfolio/calendar/data/CalendarData.java | 8 +-- .../portfolio/calendar/domain/Calendar.java | 2 +- .../CalendarReadPlatformServiceImpl.java | 6 +-- ...ollectionSheetReadPlatformServiceImpl.java | 6 +-- .../CenterReadPlatformServiceImpl.java | 2 +- .../service/GroupReadPlatformServiceImpl.java | 2 +- .../loanproduct/service/LoanEnumerations.java | 4 +- ...SavingsAccountReadPlatformServiceImpl.java | 4 +- .../SearchReadPlatformServiceImpl.java | 8 +-- .../SelfAccountTransferReadServiceImpl.java | 2 +- .../shareaccounts/domain/ShareAccount.java | 6 +-- .../ShareAccountDataSerializer.java | 12 ++--- ...urchasedSharesReadPlatformServiceImpl.java | 2 +- ...eAccountChargeReadPlatformServiceImpl.java | 2 +- .../ShareAccountReadPlatformServiceImpl.java | 6 +-- ...WritePlatformServiceJpaRepositoryImpl.java | 6 +-- .../shareproducts/domain/ShareProduct.java | 2 +- .../ShareProductReadPlatformServiceImpl.java | 4 +- .../spm/api/LookupTableApiResource.java | 2 +- .../fineract/spm/util/LookupTableMapper.java | 2 +- .../fineract/notification/StorageTest.java | 2 +- .../fineract/notification/TopicTest.java | 4 +- .../template/TemplateMergeServiceTest.java | 6 +-- 50 files changed, 179 insertions(+), 155 deletions(-) diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index 66bff2cfbf8..1cc419fa84e 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -44,9 +44,10 @@ buildscript { classpath 'com.radcortez.gradle:openjpa-gradle-plugin:3.1.0' classpath 'gradle.plugin.org.nosphere.apache:creadur-rat-gradle:0.2.2' classpath "com.github.spotbugs:spotbugs-gradle-plugin:2.0.1" - // Use Guava version 23+ as a workaround to spotbug intergration. - // See: https://github.com/spotbugs/spotbugs-gradle-plugin/issues/128#issuecomment-535864882 + // Use Guava version 23+ as a workaround to spotbug intergration. + // See: https://github.com/spotbugs/spotbugs-gradle-plugin/issues/128#issuecomment-535864882 classpath 'com.google.guava:guava:28.1-jre' + classpath "gradle.plugin.com.github.andygoossens:gradle-modernizer-plugin:1.3.0" } } @@ -64,6 +65,7 @@ apply plugin: 'java-library' apply plugin: 'openjpa' apply plugin: "com.github.spotbugs" apply plugin: 'checkstyle' +apply plugin: 'com.github.andygoossens.gradle-modernizer-plugin' // apply plugin: 'pmd' dependencyManagement { @@ -299,6 +301,27 @@ if (project.hasProperty('security') && project.getProperty('security') == 'oauth } } +modernizer { + includeTestClasses = true + failOnViolations = true + + violationLogLevel="error" + + javaVersion = project.targetCompatibility + + ignorePackages = [] + ignoreClassNamePatterns = [ + '.*AbstractPersistableCustom' + ] + ignoreGeneratedClasses = true + + exclusions = [] + exclusionPatterns = [ +// To be removed when https://issues.apache.org/jira/browse/FINERACT-826 is fixed + 'org/joda/time/.*' + ] +} + task dist(type:Zip){ baseName = 'fineractplatform' version = qualifyVersionIfNecessary(releaseVersion) diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/AccountingScenarioIntegrationTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/AccountingScenarioIntegrationTest.java index be751449000..2b4d60b3d98 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/AccountingScenarioIntegrationTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/AccountingScenarioIntegrationTest.java @@ -362,7 +362,7 @@ public void testFixedDepositAccountingFlow() { final String APPROVED_ON_DATE = dateFormat.format(todaysDate.getTime()); final String ACTIVATION_DATE = dateFormat.format(todaysDate.getTime()); - Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime())); + Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime())); Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE); Integer numberOfDaysLeft = (daysInMonth - currentDate) + 1; todaysDate.add(Calendar.DATE, numberOfDaysLeft); @@ -445,7 +445,7 @@ public void testRecurringDepositAccountingFlow() { final String ACTIVATION_DATE = dateFormat.format(todaysDate.getTime()); final String EXPECTED_FIRST_DEPOSIT_ON_DATE = dateFormat.format(todaysDate.getTime()); - Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime())); + Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime())); Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE); Integer numberOfDaysLeft = (daysInMonth - currentDate) + 1; todaysDate.add(Calendar.DATE, numberOfDaysLeft); diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/FixedDepositTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/FixedDepositTest.java index dd37deffc50..3b254d5cc8d 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/FixedDepositTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/FixedDepositTest.java @@ -147,7 +147,7 @@ public void testFixedDepositAccountWithPrematureClosureTypeWithdrawal() { final String ACTIVATION_DATE = dateFormat.format(todaysDate.getTime()); final String MONTH_DAY = monthDayFormat.format(todaysDate.getTime()); - Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime())); + Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime())); Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE); Integer numberOfDaysLeft = (daysInMonth - currentDate) + 1; todaysDate.add(Calendar.DATE, numberOfDaysLeft); @@ -286,7 +286,7 @@ public void testFixedDepositAccountWithPrematureClosureTypeWithdrawal_WITH_HOLD_ final String ACTIVATION_DATE = dateFormat.format(todaysDate.getTime()); final String MONTH_DAY = monthDayFormat.format(todaysDate.getTime()); - Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime())); + Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime())); Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE); Integer numberOfDaysLeft = (daysInMonth - currentDate) + 1; todaysDate.add(Calendar.DATE, numberOfDaysLeft); @@ -433,7 +433,7 @@ public void testFixedDepositAccountClosureTypeWithdrawal_WITH_HOLD_TAX() throws final String ACTIVATION_DATE = dateFormat.format(todaysDate.getTime()); final String MONTH_DAY = monthDayFormat.format(todaysDate.getTime()); - Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime())); + Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime())); Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE); Integer numberOfDaysLeft = (daysInMonth - currentDate) + 1; todaysDate.add(Calendar.DATE, numberOfDaysLeft); @@ -725,7 +725,7 @@ public void testFixedDepositAccountWithPrematureClosureTypeTransferToSavings() { final String ACTIVATION_DATE = dateFormat.format(todaysDate.getTime()); final String MONTH_DAY = monthDayFormat.format(todaysDate.getTime()); - Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime())); + Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime())); Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE); Integer numberOfDaysLeft = (daysInMonth - currentDate) + 1; todaysDate.add(Calendar.DATE, numberOfDaysLeft); @@ -896,7 +896,7 @@ public void testFixedDepositAccountWithPrematureClosureTypeReinvest() { final String ACTIVATION_DATE = dateFormat.format(todaysDate.getTime()); final String MONTH_DAY = monthDayFormat.format(todaysDate.getTime()); - Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime())); + Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime())); Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE); Integer numberOfDaysLeft = (daysInMonth - currentDate) + 1; todaysDate.add(Calendar.DATE, numberOfDaysLeft); @@ -1191,7 +1191,7 @@ public void testMaturityAmountForMonthlyCompoundingAndMonthlyPosting_With_365_Da todaysDate = Calendar.getInstance(); todaysDate.add(Calendar.MONTH, -1); - Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime())); + Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime())); todaysDate.add(Calendar.DATE, -(currentDate - 1)); final String SUBMITTED_ON_DATE = dateFormat.format(todaysDate.getTime()); final String APPROVED_ON_DATE = dateFormat.format(todaysDate.getTime()); @@ -1261,7 +1261,7 @@ public void testMaturityAmountForMonthlyCompoundingAndMonthlyPosting_With_360_Da todaysDate = Calendar.getInstance(); todaysDate.add(Calendar.MONTH, -1); - Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime())); + Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime())); todaysDate.add(Calendar.DATE, -(currentDate - 1)); final String SUBMITTED_ON_DATE = dateFormat.format(todaysDate.getTime()); final String APPROVED_ON_DATE = dateFormat.format(todaysDate.getTime()); @@ -1385,7 +1385,7 @@ public void testPrematureClosureAmountWithPenalInterestForWholeTerm_With_365() { todaysDate.add(Calendar.MONTH, -1); todaysDate.add(Calendar.DAY_OF_MONTH, -1); - Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime())); + Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime())); Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE); daysInMonth = (daysInMonth - currentDate) + 1; Float interestPerMonth = (float) (interestPerDay * principal * daysInMonth); @@ -1493,7 +1493,7 @@ public void testPrematureClosureAmountWithPenalInterestForWholeTerm_With_360() { todaysDate.add(Calendar.MONTH, -1); todaysDate.add(Calendar.DAY_OF_MONTH, -1); - Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime())); + Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime())); Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE); daysInMonth = (daysInMonth - currentDate) + 1; Float interestPerMonth = (float) (interestPerDay * principal * daysInMonth); @@ -1606,7 +1606,7 @@ public void testPrematureClosureAmountWithPenalInterestTillPrematureWithdrawal_W todaysDate.add(Calendar.MONTH, -1); todaysDate.add(Calendar.DAY_OF_MONTH, -1); - Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime())); + Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime())); Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE); daysInMonth = (daysInMonth - currentDate) + 1; Float interestPerMonth = (float) (interestPerDay * principal * daysInMonth); @@ -1722,7 +1722,7 @@ public void testPrematureClosureAmountWithPenalInterestTillPrematureWithdrawal_W todaysDate.add(Calendar.MONTH, -1); todaysDate.add(Calendar.DAY_OF_MONTH, -1); - Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime())); + Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime())); Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE); daysInMonth = (daysInMonth - currentDate) + 1; Float interestPerMonth = (float) (interestPerDay * principal * daysInMonth); @@ -1774,7 +1774,7 @@ public void testMaturityAmountForDailyCompoundingAndMonthlyPosting_With_365_Days todaysDate = Calendar.getInstance(); todaysDate.add(Calendar.MONTH, -1); - Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime())); + Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime())); todaysDate.add(Calendar.DATE, -(currentDate - 1)); final String SUBMITTED_ON_DATE = dateFormat.format(todaysDate.getTime()); final String APPROVED_ON_DATE = dateFormat.format(todaysDate.getTime()); @@ -1850,7 +1850,7 @@ public void testMaturityAmountForDailyCompoundingAndMonthlyPosting_With_360_Days todaysDate = Calendar.getInstance(); //todaysDate.add(Calendar.MONTH, -1); - Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime())); + Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime())); todaysDate.add(Calendar.DATE, -(currentDate - 1)); final String SUBMITTED_ON_DATE = dateFormat.format(todaysDate.getTime()); final String APPROVED_ON_DATE = dateFormat.format(todaysDate.getTime()); @@ -1921,10 +1921,10 @@ public void testMaturityAmountForDailyCompoundingAndAnnuallyPosting_With_365_Day Calendar todaysDate = Calendar.getInstance(); todaysDate.add(Calendar.YEAR, -1); - Integer currentMonth = new Integer(currentMonthFormat.format(todaysDate.getTime())); + Integer currentMonth = Integer.valueOf(currentMonthFormat.format(todaysDate.getTime())); Integer numberOfMonths = 12 - currentMonth; todaysDate.add(Calendar.MONTH, numberOfMonths); - Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime())); + Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime())); Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE); Integer daysLeft = daysInMonth - currentDate; todaysDate.add(Calendar.DATE, (daysLeft + 1)); @@ -2005,10 +2005,10 @@ public void testMaturityAmountDailyCompoundingAndAnnuallyPostingWith_360_Days() Calendar todaysDate = Calendar.getInstance(); todaysDate.add(Calendar.YEAR, -1); - Integer currentMonth = new Integer(currentMonthFormat.format(todaysDate.getTime())); + Integer currentMonth = Integer.valueOf(currentMonthFormat.format(todaysDate.getTime())); Integer numberOfMonths = 12 - currentMonth; todaysDate.add(Calendar.MONTH, numberOfMonths); - Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime())); + Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime())); Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE); Integer daysLeft = daysInMonth - currentDate; todaysDate.add(Calendar.DATE, (daysLeft + 1)); @@ -2090,10 +2090,10 @@ public void testFixedDepositWithBi_AnnualCompoundingAndPosting_365_Days() { Calendar todaysDate = Calendar.getInstance(); todaysDate.add(Calendar.YEAR, -1); - Integer currentMonth = new Integer(currentMonthFormat.format(todaysDate.getTime())); + Integer currentMonth = Integer.valueOf(currentMonthFormat.format(todaysDate.getTime())); Integer numberOfMonths = 12 - currentMonth; todaysDate.add(Calendar.MONTH, numberOfMonths); - Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime())); + Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime())); Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE); Integer daysLeft = daysInMonth - currentDate; todaysDate.add(Calendar.DATE, (daysLeft + 1)); @@ -2172,10 +2172,10 @@ public void testFixedDepositWithBi_AnnualCompoundingAndPosting_360_Days() { Calendar todaysDate = Calendar.getInstance(); todaysDate.add(Calendar.YEAR, -1); - Integer currentMonth = new Integer(currentMonthFormat.format(todaysDate.getTime())); + Integer currentMonth = Integer.valueOf(currentMonthFormat.format(todaysDate.getTime())); Integer numberOfMonths = 12 - currentMonth; todaysDate.add(Calendar.MONTH, numberOfMonths); - Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime())); + Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime())); Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE); Integer daysLeft = daysInMonth - currentDate; todaysDate.add(Calendar.DATE, (daysLeft + 1)); @@ -2254,10 +2254,10 @@ public void testFixedDepositWithQuarterlyCompoundingAndQuarterlyPosting_365_Days Calendar todaysDate = Calendar.getInstance(); todaysDate.add(Calendar.YEAR, -1); - Integer currentMonth = new Integer(currentMonthFormat.format(todaysDate.getTime())); + Integer currentMonth = Integer.valueOf(currentMonthFormat.format(todaysDate.getTime())); Integer numberOfMonths = 12 - currentMonth; todaysDate.add(Calendar.MONTH, numberOfMonths); - Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime())); + Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime())); Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE); Integer daysLeft = daysInMonth - currentDate; todaysDate.add(Calendar.DATE, (daysLeft + 1)); @@ -2335,10 +2335,10 @@ public void testFixedDepositWithQuarterlyCompoundingAndQuarterlyPosting_360_Days Calendar todaysDate = Calendar.getInstance(); todaysDate.add(Calendar.YEAR, -1); - Integer currentMonth = new Integer(currentMonthFormat.format(todaysDate.getTime())); + Integer currentMonth = Integer.valueOf(currentMonthFormat.format(todaysDate.getTime())); Integer numberOfMonths = 12 - currentMonth; todaysDate.add(Calendar.MONTH, numberOfMonths); - Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime())); + Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime())); Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE); Integer daysLeft = daysInMonth - currentDate; todaysDate.add(Calendar.DATE, (daysLeft + 1)); @@ -2576,4 +2576,4 @@ public void tearDown() { Assert.assertEquals(financialActivityAccountId, deletedFinancialActivityAccountId); } } -} \ No newline at end of file +} diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/FundsIntegrationTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/FundsIntegrationTest.java index 7dbd9b07c98..52fc430323b 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/FundsIntegrationTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/FundsIntegrationTest.java @@ -340,7 +340,7 @@ private Long createFund(final String fundJSON, return null; } - return new Long(fundId); + return Long.valueOf(fundId); } } diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/RecurringDepositTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/RecurringDepositTest.java index b88f20b9504..33b8fe42b54 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/RecurringDepositTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/RecurringDepositTest.java @@ -148,7 +148,7 @@ public void testRecurringDepositAccountWithPrematureClosureTypeWithdrawal() { final String EXPECTED_FIRST_DEPOSIT_ON_DATE = dateFormat.format(todaysDate.getTime()); final String MONTH_DAY = monthDayFormat.format(todaysDate.getTime()); - Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime())); + Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime())); Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE); Integer numberOfDaysLeft = (daysInMonth - currentDate) + 1; todaysDate.add(Calendar.DATE, numberOfDaysLeft); @@ -300,7 +300,7 @@ public void testRecurringDepositAccountWithPrematureClosureTypeTransferToSavings final String EXPECTED_FIRST_DEPOSIT_ON_DATE = dateFormat.format(todaysDate.getTime()); final String MONTH_DAY = monthDayFormat.format(todaysDate.getTime()); - Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime())); + Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime())); Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE); Integer numberOfDaysLeft = (daysInMonth - currentDate) + 1; todaysDate.add(Calendar.DATE, numberOfDaysLeft); @@ -505,7 +505,7 @@ public void testRecurringDepositAccountWithPrematureClosureTypeTransferToSavings final String EXPECTED_FIRST_DEPOSIT_ON_DATE = dateFormat.format(todaysDate.getTime()); final String MONTH_DAY = monthDayFormat.format(todaysDate.getTime()); - Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime())); + Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime())); Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE); Integer numberOfDaysLeft = (daysInMonth - currentDate) + 1; todaysDate.add(Calendar.DATE, numberOfDaysLeft); @@ -721,7 +721,7 @@ public void testRecurringDepositAccountWithClosureTypeTransferToSavings_WITH_HOL final String EXPECTED_FIRST_DEPOSIT_ON_DATE = dateFormat.format(todaysDate.getTime()); final String MONTH_DAY = monthDayFormat.format(todaysDate.getTime()); - Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime())); + Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime())); Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE); Integer numberOfDaysLeft = (daysInMonth - currentDate) + 1; todaysDate.add(Calendar.DATE, numberOfDaysLeft); @@ -888,7 +888,7 @@ public void testRecurringDepositAccountWithPrematureClosureTypeReinvest() { final String EXPECTED_FIRST_DEPOSIT_ON_DATE = dateFormat.format(todaysDate.getTime()); final String MONTH_DAY = monthDayFormat.format(todaysDate.getTime()); - Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime())); + Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime())); Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE); Integer numberOfDaysLeft = (daysInMonth - currentDate) + 1; todaysDate.add(Calendar.DATE, numberOfDaysLeft); @@ -1374,7 +1374,7 @@ public void testMaturityAmountForMonthlyCompoundingAndMonthlyPosting_With_365_Da todaysDate = Calendar.getInstance(); todaysDate.add(Calendar.MONTH, -1); - Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime())); + Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime())); todaysDate.add(Calendar.DATE, -(currentDate - 1)); final String SUBMITTED_ON_DATE = dateFormat.format(todaysDate.getTime()); final String APPROVED_ON_DATE = dateFormat.format(todaysDate.getTime()); @@ -1454,7 +1454,7 @@ public void testMaturityAmountForMonthlyCompoundingAndMonthlyPosting_With_360_Da todaysDate = Calendar.getInstance(); todaysDate.add(Calendar.MONTH, -1); - Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime())); + Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime())); todaysDate.add(Calendar.DATE, -(currentDate - 1)); final String SUBMITTED_ON_DATE = dateFormat.format(todaysDate.getTime()); final String APPROVED_ON_DATE = dateFormat.format(todaysDate.getTime()); @@ -1591,7 +1591,7 @@ public void testPostInterestForRecurringDeposit() { DecimalFormat decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US)); decimalFormat.applyPattern("."); - Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime())); + Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime())); Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE); daysInMonth = (daysInMonth - currentDate) + 1; Float interestToBePosted = new Float(decimalFormat.format(interestPerDay * principal * daysInMonth)); @@ -1698,7 +1698,7 @@ public void testPrematureClosureAmountWithPenalInterestForWholeTerm_With_365_Day Calendar calendar = Calendar.getInstance(); calendar.add(Calendar.MONTH, -1); - Integer currentDate = new Integer(currentDateFormat.format(calendar.getTime())); + Integer currentDate = Integer.valueOf(currentDateFormat.format(calendar.getTime())); Integer daysInMonth = calendar.getActualMaximum(Calendar.DATE); daysInMonth = (daysInMonth - currentDate) + 1; Float interestPerMonth = (float) (interestPerDay * principal * daysInMonth); @@ -1830,7 +1830,7 @@ public void testPrematureClosureAmountWithPenalInterestForWholeTerm_With_360_Day Calendar calendar = Calendar.getInstance(); calendar.add(Calendar.MONTH, -1); - Integer currentDate = new Integer(currentDateFormat.format(calendar.getTime())); + Integer currentDate = Integer.valueOf(currentDateFormat.format(calendar.getTime())); Integer daysInMonth = calendar.getActualMaximum(Calendar.DATE); daysInMonth = (daysInMonth - currentDate) + 1; Float interestPerMonth = (float) (interestPerDay * principal * daysInMonth); @@ -1970,7 +1970,7 @@ public void testPrematureClosureAmountWithPenalInterestTillPrematureWithdrawal_W Calendar calendar = Calendar.getInstance(); calendar.add(Calendar.MONTH, -1); calendar.add(Calendar.DAY_OF_MONTH, -1); - Integer currentDate = new Integer(currentDateFormat.format(calendar.getTime())); + Integer currentDate = Integer.valueOf(currentDateFormat.format(calendar.getTime())); Integer daysInMonth = calendar.getActualMaximum(Calendar.DATE); daysInMonth = (daysInMonth - currentDate) + 1; Float interestPerMonth = (float) (interestPerDay * principal * daysInMonth); @@ -2115,7 +2115,7 @@ public void testPrematureClosureAmountWithPenalInterestTillPrematureWithdrawal_W Calendar calendar = Calendar.getInstance(); calendar.add(Calendar.MONTH, -1); calendar.add(Calendar.DAY_OF_MONTH, -1); - Integer currentDate = new Integer(currentDateFormat.format(calendar.getTime())); + Integer currentDate = Integer.valueOf(currentDateFormat.format(calendar.getTime())); Integer daysInMonth = calendar.getActualMaximum(Calendar.DATE); daysInMonth = (daysInMonth - currentDate) + 1; Float interestPerMonth = (float) (interestPerDay * principal * daysInMonth); @@ -2178,7 +2178,7 @@ public void testMaturityAmountForDailyCompoundingAndMonthlyPosting_With_365_Days todaysDate = Calendar.getInstance(); todaysDate.add(Calendar.MONTH, -1); - Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime())); + Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime())); todaysDate.add(Calendar.DATE, -(currentDate - 1)); final String SUBMITTED_ON_DATE = dateFormat.format(todaysDate.getTime()); final String APPROVED_ON_DATE = dateFormat.format(todaysDate.getTime()); @@ -2262,7 +2262,7 @@ public void testMaturityAmountForDailyCompoundingAndMonthlyPosting_With_360_Days todaysDate = Calendar.getInstance(); todaysDate.add(Calendar.MONTH, -1); - Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime())); + Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime())); todaysDate.add(Calendar.DATE, -(currentDate - 1)); final String SUBMITTED_ON_DATE = dateFormat.format(todaysDate.getTime()); final String APPROVED_ON_DATE = dateFormat.format(todaysDate.getTime()); @@ -2344,10 +2344,10 @@ public void testRecurringDepositWithBi_AnnualCompoundingAndPosting_365_Days() { Calendar todaysDate = Calendar.getInstance(); todaysDate.add(Calendar.YEAR, -1); - Integer currentMonth = new Integer(currentMonthFormat.format(todaysDate.getTime())); + Integer currentMonth = Integer.valueOf(currentMonthFormat.format(todaysDate.getTime())); Integer numberOfMonths = 12 - currentMonth; todaysDate.add(Calendar.MONTH, numberOfMonths); - Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime())); + Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime())); Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE); Integer daysLeft = daysInMonth - currentDate; todaysDate.add(Calendar.DATE, (daysLeft + 1)); @@ -2435,10 +2435,10 @@ public void testRecurringDepositWithBi_AnnualCompoundingAndPosting_360_Days() { Calendar todaysDate = Calendar.getInstance(); todaysDate.add(Calendar.YEAR, -1); - Integer currentMonth = new Integer(currentMonthFormat.format(todaysDate.getTime())); + Integer currentMonth = Integer.valueOf(currentMonthFormat.format(todaysDate.getTime())); Integer numberOfMonths = 12 - currentMonth; todaysDate.add(Calendar.MONTH, numberOfMonths); - Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime())); + Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime())); Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE); Integer daysLeft = daysInMonth - currentDate; todaysDate.add(Calendar.DATE, (daysLeft + 1)); @@ -2525,10 +2525,10 @@ public void testMaturityAmountForDailyCompoundingAndAnnuallyPosting_With_365_Day Calendar todaysDate = Calendar.getInstance(); todaysDate.add(Calendar.YEAR, -1); - Integer currentMonth = new Integer(currentMonthFormat.format(todaysDate.getTime())); + Integer currentMonth = Integer.valueOf(currentMonthFormat.format(todaysDate.getTime())); Integer numberOfMonths = 12 - currentMonth; todaysDate.add(Calendar.MONTH, numberOfMonths); - Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime())); + Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime())); Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE); Integer daysLeft = daysInMonth - currentDate; todaysDate.add(Calendar.DATE, (daysLeft + 1)); @@ -2616,10 +2616,10 @@ public void testMaturityAmountForDailyCompoundingAndAnnuallyPosting_With_360_Day Calendar todaysDate = Calendar.getInstance(); todaysDate.add(Calendar.YEAR, -1); - Integer currentMonth = new Integer(currentMonthFormat.format(todaysDate.getTime())); + Integer currentMonth = Integer.valueOf(currentMonthFormat.format(todaysDate.getTime())); Integer numberOfMonths = 12 - currentMonth; todaysDate.add(Calendar.MONTH, numberOfMonths); - Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime())); + Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime())); Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE); Integer daysLeft = daysInMonth - currentDate; todaysDate.add(Calendar.DATE, (daysLeft + 1)); @@ -2708,10 +2708,10 @@ public void testRecurringDepositQuarterlyCompoundingAndQuarterlyPosting_365_Days Calendar todaysDate = Calendar.getInstance(); todaysDate.add(Calendar.YEAR, -1); - Integer currentMonth = new Integer(currentMonthFormat.format(todaysDate.getTime())); + Integer currentMonth = Integer.valueOf(currentMonthFormat.format(todaysDate.getTime())); Integer numberOfMonths = 12 - currentMonth; todaysDate.add(Calendar.MONTH, numberOfMonths); - Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime())); + Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime())); Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE); Integer daysLeft = daysInMonth - currentDate; todaysDate.add(Calendar.DATE, (daysLeft + 1)); @@ -2799,10 +2799,10 @@ public void testRecurringDepositQuarterlyCompoundingAndQuarterlyPosting_360_Days Calendar todaysDate = Calendar.getInstance(); todaysDate.add(Calendar.YEAR, -1); - Integer currentMonth = new Integer(currentMonthFormat.format(todaysDate.getTime())); + Integer currentMonth = Integer.valueOf(currentMonthFormat.format(todaysDate.getTime())); Integer numberOfMonths = 12 - currentMonth; todaysDate.add(Calendar.MONTH, numberOfMonths); - Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime())); + Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime())); Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE); Integer daysLeft = daysInMonth - currentDate; todaysDate.add(Calendar.DATE, (daysLeft + 1)); @@ -3206,4 +3206,4 @@ public void tearDown() { Assert.assertEquals(financialActivityAccountId, deletedFinancialActivityAccountId); } } -} \ No newline at end of file +} diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/SchedulerJobsTestResults.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/SchedulerJobsTestResults.java index 2700d148b3b..8192150a899 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/SchedulerJobsTestResults.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/SchedulerJobsTestResults.java @@ -425,7 +425,7 @@ public void testUpdateAccountingRunningBalancesJobOutcome() throws InterruptedEx this.schedulerJobHelper.executeJob(JobName); final HashMap runningBalanceAfter = this.accountHelper.getAccountingWithRunningBalanceById(accountID.toString()); - final Integer INT_BALANCE = new Integer(MINIMUM_OPENING_BALANCE); + final Integer INT_BALANCE = Integer.valueOf(MINIMUM_OPENING_BALANCE); Assert.assertEquals("Verifying Account Running Balance after running Update Accounting Running Balances Scheduler Job", INT_BALANCE, runningBalanceAfter.get("organizationRunningBalance")); diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/variableinstallments/VariableInstallmentsDecliningBalanceHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/variableinstallments/VariableInstallmentsDecliningBalanceHelper.java index cfdb9bcca82..1a3b8575966 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/variableinstallments/VariableInstallmentsDecliningBalanceHelper.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/variableinstallments/VariableInstallmentsDecliningBalanceHelper.java @@ -63,7 +63,7 @@ public static String createLoanProductWithVaribleConfig(final boolean multiDisbu .withInterestTypeAsDecliningBalance() // .withTranches(multiDisburseLoan) // .withInterestCalculationPeriodTypeAsRepaymentPeriod(true)// - .withVariableInstallmentsConfig(Boolean.TRUE, new Integer(5), new Integer(90))// + .withVariableInstallmentsConfig(Boolean.TRUE, Integer.valueOf(5), Integer.valueOf(90))// .withAccounting(accountingRule, accounts).build(null); return loanProductJSON ; } @@ -81,7 +81,7 @@ public static String createLoanProductWithVaribleConfigwithEqualPrincipal(final .withInterestTypeAsDecliningBalance() // .withTranches(multiDisburseLoan) // .withInterestCalculationPeriodTypeAsRepaymentPeriod(true)// - .withVariableInstallmentsConfig(Boolean.TRUE, new Integer(5), new Integer(90))// + .withVariableInstallmentsConfig(Boolean.TRUE, Integer.valueOf(5), Integer.valueOf(90))// .withAccounting(accountingRule, accounts).build(null); return loanProductJSON ; } diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/variableinstallments/VariableInstallmentsFlatHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/variableinstallments/VariableInstallmentsFlatHelper.java index e39f6f1b5ef..95533b126a7 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/variableinstallments/VariableInstallmentsFlatHelper.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/variableinstallments/VariableInstallmentsFlatHelper.java @@ -46,7 +46,7 @@ public static String createLoanProductWithVaribleConfig(final boolean multiDisbu .withInterestTypeAsFlat() // .withTranches(multiDisburseLoan) // .withInterestCalculationPeriodTypeAsRepaymentPeriod(true)// - .withVariableInstallmentsConfig(Boolean.TRUE, new Integer(5), new Integer(90))// + .withVariableInstallmentsConfig(Boolean.TRUE, Integer.valueOf(5), Integer.valueOf(90))// .withAccounting(accountingRule, accounts).build(null); return loanProductJSON ; } diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/variableinstallments/VariableInstallmentsIntegrationTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/variableinstallments/VariableInstallmentsIntegrationTest.java index 89ac2f24524..dc6a1646f92 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/variableinstallments/VariableInstallmentsIntegrationTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/variableinstallments/VariableInstallmentsIntegrationTest.java @@ -59,8 +59,8 @@ public void testVariableLoanProductCreation() { System.out.println("------------------------------RETRIEVING CREATED LOAN PRODUCT DETAILS ---------------------------------------"); Map loanProduct = (Map)loanTransactionHelper.getLoanProductDetail(requestSpec, responseSpec, loanProductID, "") ; Assert.assertTrue((Boolean)loanProduct.get("allowVariableInstallments")) ; - Assert.assertEquals(new Integer(5), loanProduct.get("minimumGap")) ; - Assert.assertEquals(new Integer(90), loanProduct.get("maximumGap")) ; + Assert.assertEquals(Integer.valueOf(5), loanProduct.get("minimumGap")) ; + Assert.assertEquals(Integer.valueOf(90), loanProduct.get("maximumGap")) ; } diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/data/ClientTransactionDTO.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/data/ClientTransactionDTO.java index 5e5bfc1409d..cff96790bdc 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/data/ClientTransactionDTO.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/data/ClientTransactionDTO.java @@ -86,7 +86,7 @@ public EnumOptionData getTransactionType() { } public boolean isChargePayment() { - return ClientTransactionType.PAY_CHARGE.getValue().equals(new Integer(this.transactionType.getId().intValue())); + return ClientTransactionType.PAY_CHARGE.getValue().equals(Integer.valueOf(this.transactionType.getId().intValue())); } public String getCurrencyCode() { diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/provisioning/service/ProvisioningEntriesReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/provisioning/service/ProvisioningEntriesReadPlatformServiceImpl.java index b4e9ddf6aa9..100d3f687ff 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/provisioning/service/ProvisioningEntriesReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/provisioning/service/ProvisioningEntriesReadPlatformServiceImpl.java @@ -281,7 +281,7 @@ public ProvisioningEntryData retrieveExistingProvisioningIdDateWithJournals() { private static final class ProvisioningEntryIdDateRowMapper implements RowMapper { - StringBuffer buff = new StringBuffer().append("select history1.id, history1.created_date from m_provisioning_history history1 ") + StringBuilder buff = new StringBuilder().append("select history1.id, history1.created_date from m_provisioning_history history1 ") .append("where history1.created_date = (select max(history2.created_date) from m_provisioning_history history2 ") .append("where history2.journal_entry_created='1')"); @@ -348,4 +348,4 @@ public Page retrieveProvisioningEntries(Search whereClauseItemsitems, mapper); } -} \ No newline at end of file +} diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/ImportHandlerUtils.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/ImportHandlerUtils.java index 53c0773ccd6..bdadfeb761c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/ImportHandlerUtils.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/ImportHandlerUtils.java @@ -229,14 +229,14 @@ public static CellStyle getCellStyle(Workbook workbook, IndexedColors color) { } public static String getDefaultUserMessages(List ApiParameterErrorList){ - StringBuffer defaultUserMessages=new StringBuffer(); + StringBuilder defaultUserMessages=new StringBuilder(); for (ApiParameterError error:ApiParameterErrorList) { defaultUserMessages=defaultUserMessages.append(error.getDefaultUserMessage()+'\t'); } return defaultUserMessages.toString(); } public static String getErrorList(List errorList){ - StringBuffer errors=new StringBuffer(); + StringBuilder errors=new StringBuilder(); for (String error: errorList) { errors=errors.append(error); } @@ -380,4 +380,4 @@ else if (repeatsOnDay.equalsIgnoreCase(TemplatePopulateImportConstants.SUNDAY)) return null; } } -} \ No newline at end of file +} diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/constants/SmsCampaignEnumerations.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/constants/SmsCampaignEnumerations.java index 2e3afcd1530..9691becca82 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/constants/SmsCampaignEnumerations.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/constants/SmsCampaignEnumerations.java @@ -68,7 +68,7 @@ public static EnumOptionData smscampaignType(final CampaignType type) { } public static EnumOptionData calendarMonthType(final Month entityType) { - final EnumOptionData optionData = new EnumOptionData(new Long(entityType.getValue()), entityType.name(), entityType.name()); + final EnumOptionData optionData = new EnumOptionData(Long.valueOf(entityType.getValue()), entityType.name(), entityType.name()); return optionData; } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/domain/CodeValue.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/domain/CodeValue.java index 2cc1b0d8a0b..3857ff14824 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/domain/CodeValue.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/domain/CodeValue.java @@ -93,7 +93,7 @@ public static CodeValue fromJson(final Code code, final JsonCommand command) { isActive = isActiveObj; } if (position == null) { - position = new Integer(0); + position = Integer.valueOf(0); } Boolean mandatory = command.booleanPrimitiveValueOfParameterNamed( @@ -145,4 +145,4 @@ public Map update(final JsonCommand command) { public CodeValueData toData() { return CodeValueData.instance(getId(), this.label, this.position, this.isActive, this.mandatory); } -} \ No newline at end of file +} diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/data/PaginationParameters.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/data/PaginationParameters.java index e12ce574365..5e6b87c503d 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/data/PaginationParameters.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/data/PaginationParameters.java @@ -104,7 +104,7 @@ public boolean isOffset() { } public String orderBySql() { - final StringBuffer sql = new StringBuffer(); + final StringBuilder sql = new StringBuilder(); if (this.isOrderByRequested()) { sql.append(" order by ").append(this.getOrderBy()); @@ -116,7 +116,7 @@ public String orderBySql() { } public String limitSql() { - final StringBuffer sql = new StringBuffer(); + final StringBuilder sql = new StringBuilder(); if (this.isLimited()) { sql.append(" limit ").append(this.getLimit()); if (this.isOffset()) { @@ -137,4 +137,4 @@ public String paginationSql(){ return sqlBuilder.toString(); } -} \ No newline at end of file +} diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/GenericDataServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/GenericDataServiceImpl.java index fdb6b22e342..46b2958ef4c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/GenericDataServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/GenericDataServiceImpl.java @@ -97,7 +97,7 @@ public String replace(final String str, final String pattern, final String repla // apache one to be about the same then this can be removed. int s = 0; int e = 0; - final StringBuffer result = new StringBuffer(); + final StringBuilder result = new StringBuilder(); while ((e = str.indexOf(pattern, s)) >= 0) { result.append(str.substring(s, e)); @@ -122,7 +122,7 @@ public String wrapSQL(final String sql) { @Override public String generateJsonFromGenericResultsetData(final GenericResultsetData grs) { - final StringBuffer writer = new StringBuffer(); + final StringBuilder writer = new StringBuilder(); writer.append("["); @@ -316,4 +316,4 @@ private SqlRowSet getDatatableCodeData(final String datatable, final String colu return rsValues; } -} \ No newline at end of file +} diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/ReadReportingServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/ReadReportingServiceImpl.java index d1a08444697..9808c61afcb 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/ReadReportingServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/ReadReportingServiceImpl.java @@ -28,6 +28,7 @@ import java.io.FileOutputStream; import java.io.InputStream; import java.io.OutputStream; +import java.nio.charset.StandardCharsets; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; @@ -100,9 +101,9 @@ public void write(final OutputStream out) { try { final GenericResultsetData result = retrieveGenericResultset(name, type, queryParams, isSelfServiceUserReport); - final StringBuffer sb = generateCsvFileBuffer(result); + final StringBuilder sb = generateCsvFileBuffer(result); - final InputStream in = new ByteArrayInputStream(sb.toString().getBytes("UTF-8")); + final InputStream in = new ByteArrayInputStream(sb.toString().getBytes(StandardCharsets.UTF_8)); final byte[] outputByte = new byte[4096]; Integer readLen = in.read(outputByte, 0, 4096); @@ -122,8 +123,8 @@ public void write(final OutputStream out) { } - private StringBuffer generateCsvFileBuffer(final GenericResultsetData result) { - final StringBuffer writer = new StringBuffer(); + private StringBuilder generateCsvFileBuffer(final GenericResultsetData result) { + final StringBuilder writer = new StringBuilder(); final List columnHeaders = result.getColumnHeaders(); logger.info("NO. of Columns: {}", columnHeaders.size()); diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/service/FineractEntityAccessReadServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/service/FineractEntityAccessReadServiceImpl.java index 44127541739..db50b3f17c5 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/service/FineractEntityAccessReadServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/service/FineractEntityAccessReadServiceImpl.java @@ -78,7 +78,7 @@ public String getSQLQueryInClause_WithListOfIDsForEntityAccess( FineractEntityTy Collection accesslist = retrieveEntityAccessFor(firstEntityType, relId, fromEntityId, includeAllOffices); String returnIdListStr = null; - StringBuffer accessListCSVStrBuf = null; + StringBuilder accessListCSVStrBuf = null; if ((accesslist != null) && (accesslist.size() > 0)) { for(FineractEntityToEntityMappingData accessData: accesslist){ if (accessData == null) { @@ -86,7 +86,7 @@ public String getSQLQueryInClause_WithListOfIDsForEntityAccess( FineractEntityTy } if(accessListCSVStrBuf == null){ - accessListCSVStrBuf = new StringBuffer() ; + accessListCSVStrBuf = new StringBuilder() ; }else{ accessListCSVStrBuf.append(","); } @@ -99,7 +99,7 @@ public String getSQLQueryInClause_WithListOfIDsForEntityAccess( FineractEntityTy } else { - accessListCSVStrBuf = new StringBuffer(); + accessListCSVStrBuf = new StringBuilder(); accessListCSVStrBuf.append("false"); // Append false so that no rows // will be returned } @@ -138,7 +138,7 @@ public Collection retrieveEntityAccessFor(Fin } private String getSQLForRetriveEntityAccessFor() { - StringBuffer str = new StringBuffer("select eem.rel_id as relId,eem.from_id as fromId, "); + StringBuilder str = new StringBuilder("select eem.rel_id as relId,eem.from_id as fromId, "); str.append("eem.to_id as toId, eem.start_date as startDate, eem.end_date as endDate "); str.append("from m_entity_to_entity_mapping eem "); str.append("where eem.rel_id = ? "); @@ -268,7 +268,7 @@ private static final class GetOneEntityMapper implements RowMapper retrieveAllStaff(final String extraCriteria, Long private String getStaffCriteria(final String sqlSearch, final Long officeId, final boolean loanOfficersOnly, final String status) { - final StringBuffer extraCriteria = new StringBuffer(200); + final StringBuilder extraCriteria = new StringBuilder(200); if (sqlSearch != null) { extraCriteria.append(" and (").append(sqlSearch).append(")"); @@ -310,4 +310,4 @@ public Object[] hasAssociatedItems(final Long staffId){ return params.toArray(); } -} \ No newline at end of file +} diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/service/TellerManagementReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/service/TellerManagementReadPlatformServiceImpl.java index 0959bcf4c6f..5d6f8129995 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/service/TellerManagementReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/service/TellerManagementReadPlatformServiceImpl.java @@ -245,7 +245,7 @@ private Collection retrieveAllTeller(final String extraCriteria, fin private String getTellerCriteria(final String sqlSearch, final Long officeId, final String status) { - final StringBuffer extraCriteria = new StringBuffer(200); + final StringBuilder extraCriteria = new StringBuilder(200); if (sqlSearch != null) { extraCriteria.append(" and (").append(sqlSearch).append(")"); @@ -291,7 +291,7 @@ public Collection retrieveCashiersForTellers(final String sqlSearch private String getTellerCriteria(final String sqlSearch, final Long tellerId) { - final StringBuffer extraCriteria = new StringBuffer(200); + final StringBuilder extraCriteria = new StringBuilder(200); if (sqlSearch != null) { extraCriteria.append(" and (").append(sqlSearch).append(")"); @@ -918,4 +918,4 @@ public CashierTransactionTypeTotalsData mapRow(final ResultSet rs, final int row } } -} \ No newline at end of file +} diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/service/StandingInstructionWritePlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/service/StandingInstructionWritePlatformServiceImpl.java index 02fcd9a75e5..a65bfec1b7d 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/service/StandingInstructionWritePlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/service/StandingInstructionWritePlatformServiceImpl.java @@ -258,8 +258,8 @@ public void executeStandingInstructions() throws JobExecutionException { private boolean transferAmount(final StringBuilder sb, final AccountTransferDTO accountTransferDTO, final Long instructionId) { boolean transferCompleted = true; - StringBuffer errorLog = new StringBuffer(); - StringBuffer updateQuery = new StringBuffer( + StringBuilder errorLog = new StringBuilder(); + StringBuilder updateQuery = new StringBuilder( "INSERT INTO `m_account_transfer_standing_instructions_history` (`standing_instruction_id`, `status`, `amount`,`execution_time`, `error_log`) VALUES ("); try { this.accountTransfersWritePlatformService.transferFunds(accountTransferDTO); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/accountdetails/data/ShareAccountSummaryData.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/accountdetails/data/ShareAccountSummaryData.java index c6248773407..fab68f5cc78 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/accountdetails/data/ShareAccountSummaryData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/accountdetails/data/ShareAccountSummaryData.java @@ -49,12 +49,12 @@ public ShareAccountSummaryData(final Long id, final String accountNo, this.accountNo = accountNo; this.externalId = externalId; if(approvedShares == null) { - this.totalApprovedShares = new Long(0) ; + this.totalApprovedShares = Long.valueOf(0) ; }else { this.totalApprovedShares = approvedShares; } if(pendingForApprovalShares == null) { - this.totalPendingForApprovalShares = new Long(0) ; + this.totalPendingForApprovalShares = Long.valueOf(0) ; }else { this.totalPendingForApprovalShares = pendingForApprovalShares; } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/accountdetails/service/AccountDetailsReadPlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/accountdetails/service/AccountDetailsReadPlatformServiceJpaRepositoryImpl.java index 65deea99b3b..b9cd852ef67 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/accountdetails/service/AccountDetailsReadPlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/accountdetails/service/AccountDetailsReadPlatformServiceJpaRepositoryImpl.java @@ -168,7 +168,7 @@ private final static class ShareAccountSummaryDataMapper implements RowMapper recurringDates = null; final Collection nextTenRecurringDates = null; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/domain/Calendar.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/domain/Calendar.java index 7d009c0aafa..dd67d649758 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/domain/Calendar.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/domain/Calendar.java @@ -640,7 +640,7 @@ public boolean isValidRecurringDate(final LocalDate compareDate, Boolean isSkipR public void updateStartAndEndDate(final LocalDate startDate, final LocalDate endDate) { final CalendarFrequencyType frequencyType = CalendarUtils.getFrequency(this.recurrence); - final Integer interval = new Integer(CalendarUtils.getInterval(this.recurrence)); + final Integer interval = Integer.valueOf(CalendarUtils.getInterval(this.recurrence)); final String newRecurrence = Calendar.constructRecurrence(frequencyType, interval, startDate.getDayOfWeek(), null); this.recurrence = newRecurrence; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/service/CalendarReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/service/CalendarReadPlatformServiceImpl.java index 68b1991727d..b3ae7cce43d 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/service/CalendarReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/service/CalendarReadPlatformServiceImpl.java @@ -86,7 +86,7 @@ public CalendarData mapRow(final ResultSet rs, @SuppressWarnings("unused") final final boolean repeating = rs.getBoolean("repeating"); final String recurrence = rs.getString("recurrence"); final EnumOptionData frequency = CalendarEnumerations.calendarFrequencyType(CalendarUtils.getFrequency(recurrence)); - final Integer interval = new Integer(CalendarUtils.getInterval(recurrence)); + final Integer interval = Integer.valueOf(CalendarUtils.getInterval(recurrence)); final EnumOptionData repeatsOnDay = CalendarEnumerations.calendarWeekDaysType(CalendarUtils.getRepeatsOnDay(recurrence)); final EnumOptionData repeatsOnNthDayOfMonth = CalendarEnumerations.calendarFrequencyNthDayType(CalendarUtils.getRepeatsOnNthDayOfMonth(recurrence)); final Integer remindById = rs.getInt("remindById"); @@ -477,7 +477,7 @@ public CalendarData mapRow(final ResultSet rs, @SuppressWarnings("unused") final final boolean repeating = rs.getBoolean("repeating"); final String recurrence = rs.getString("recurrence"); final EnumOptionData frequency = CalendarEnumerations.calendarFrequencyType(CalendarUtils.getFrequency(recurrence)); - final Integer interval = new Integer(CalendarUtils.getInterval(recurrence)); + final Integer interval = Integer.valueOf(CalendarUtils.getInterval(recurrence)); final EnumOptionData repeatsOnDay = CalendarEnumerations.calendarWeekDaysType(CalendarUtils.getRepeatsOnDay(recurrence)); final EnumOptionData repeatsOnNthDayOfMonth = CalendarEnumerations.calendarFrequencyNthDayType(CalendarUtils .getRepeatsOnNthDayOfMonth(recurrence)); @@ -510,4 +510,4 @@ public CalendarData mapRow(final ResultSet rs, @SuppressWarnings("unused") final } -} \ No newline at end of file +} diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collectionsheet/service/CollectionSheetReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collectionsheet/service/CollectionSheetReadPlatformServiceImpl.java index f831a85b28c..f04ddb0e972 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collectionsheet/service/CollectionSheetReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collectionsheet/service/CollectionSheetReadPlatformServiceImpl.java @@ -215,7 +215,7 @@ private JLGCollectionSheetData buildJLGCollectionSheet(final LocalDate dueDate, private static final class JLGCollectionSheetFaltDataMapper implements RowMapper { public String collectionSheetSchema(final boolean isCenterCollection) { - StringBuffer sql = new StringBuffer(400); + StringBuilder sql = new StringBuilder(400); sql.append("SELECT loandata.*, sum(lc.amount_outstanding_derived) as chargesDue from ") .append("(SELECT gp.display_name As groupName, ") .append("gp.id As groupId, ") @@ -498,7 +498,7 @@ private static final class MandatorySavingsCollectionsheetExtractor implements R public String collectionSheetSchema(final boolean isCenterCollection) { - final StringBuffer sql = new StringBuffer(400); + final StringBuilder sql = new StringBuilder(400); sql.append("SELECT gp.display_name As groupName, ") .append("gp.id As groupId, ") .append("cl.display_name As clientName, ") @@ -820,7 +820,7 @@ private static final class IndividualMandatorySavingsCollectionsheetExtractor im public IndividualMandatorySavingsCollectionsheetExtractor(final boolean checkForOfficeId, final boolean checkforStaffId) { - final StringBuffer sb = new StringBuffer(400); + final StringBuilder sb = new StringBuilder(400); sb.append("SELECT if(sa.deposit_type_enum=100,'Saving Deposit',if(sa.deposit_type_enum=300,'Recurring Deposit','Current Deposit')) as depositAccountType, cl.display_name As clientName, cl.id As clientId, "); sb.append("sa.id As savingsId, sa.account_no As accountId, sa.status_enum As accountStatusId, "); sb.append("sp.short_name As productShortName, sp.id As productId, "); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/service/CenterReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/service/CenterReadPlatformServiceImpl.java index 0fbddc8f7e5..b2a63639598 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/service/CenterReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/service/CenterReadPlatformServiceImpl.java @@ -123,7 +123,7 @@ public CenterReadPlatformServiceImpl(final PlatformSecurityContext context, fina // caused by the same name of columns in m_office and m_group tables private String getCenterExtraCriteria(String schemaSl, List paramList,final SearchParameters searchCriteria) { - StringBuffer extraCriteria = new StringBuffer(200); + StringBuilder extraCriteria = new StringBuilder(200); extraCriteria.append(" and g.level_id = " + GroupTypes.CENTER.getId()); if (searchCriteria!=null) { String sqlQueryCriteria = searchCriteria.getSqlSearch(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/service/GroupReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/service/GroupReadPlatformServiceImpl.java index ecb8cb38fab..9d15bc05cc1 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/service/GroupReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/service/GroupReadPlatformServiceImpl.java @@ -215,7 +215,7 @@ public Collection retrieveAll(SearchParameters searchParameter // caused by the same name of columns in m_office and m_group tables private String getGroupExtraCriteria(String schemaSql, List paramList, final SearchParameters searchCriteria) { - StringBuffer extraCriteria = new StringBuffer(200); + StringBuilder extraCriteria = new StringBuilder(200); extraCriteria.append(" and g.level_Id = ").append(GroupTypes.GROUP.getId()); String sqlSearch = searchCriteria.getSqlSearch(); if (sqlSearch != null) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/service/LoanEnumerations.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/service/LoanEnumerations.java index 9a3f984c425..9e4f4e0484f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/service/LoanEnumerations.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/service/LoanEnumerations.java @@ -176,7 +176,7 @@ public static EnumOptionData repaymentFrequencyNthDayType(final NthDayType type) optionData = new EnumOptionData(nthDayValue, codePrefix + type.getCode(), "last"); break; default: - optionData = new EnumOptionData(new Integer(0).longValue(), codePrefix + type.getCode(), "invalid"); + optionData = new EnumOptionData(Integer.valueOf(0).longValue(), codePrefix + type.getCode(), "invalid"); break; } @@ -633,7 +633,7 @@ public static EnumOptionData interestRecalculationCompoundingNthDayType(final Nt optionData = new EnumOptionData(nthDayValue, codePrefix + type.getCode(), "last"); break; default: - optionData = new EnumOptionData(new Integer(0).longValue(), codePrefix + type.getCode(), "invalid"); + optionData = new EnumOptionData(Integer.valueOf(0).longValue(), codePrefix + type.getCode(), "invalid"); break; } return optionData; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsAccountReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsAccountReadPlatformServiceImpl.java index 7a5dd9ae66b..dd4b0c87e40 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsAccountReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsAccountReadPlatformServiceImpl.java @@ -1211,7 +1211,7 @@ public List retrieveSavingsIdsPendingEscheat( public boolean isAccountBelongsToClient(final Long clientId, final Long accountId, final DepositAccountType depositAccountType, final String currencyCode) { try { - final StringBuffer buff = new StringBuffer("select count(*) from m_savings_account sa ") ; + final StringBuilder buff = new StringBuilder("select count(*) from m_savings_account sa ") ; buff.append(" where sa.id = ? and sa.client_id = ? and sa.deposit_type_enum = ? and sa.currency_code = ? and sa.status_enum = 300"); return this.jdbcTemplate.queryForObject(buff.toString(), new Object[] { accountId, clientId, depositAccountType.getValue(), currencyCode }, Integer.class) > 0; @@ -1257,4 +1257,4 @@ public String retrieveAccountNumberByAccountId(Long accountId) { throw new SavingsAccountNotFoundException(accountId); } } -} \ No newline at end of file +} diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/search/service/SearchReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/search/service/SearchReadPlatformServiceImpl.java index 0f315f6e141..a8d5a761a8d 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/search/service/SearchReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/search/service/SearchReadPlatformServiceImpl.java @@ -113,7 +113,7 @@ public String searchSchema(final SearchConditions searchConditions) { final String groupMatchSql = " (select IF(g.level_id=1,'CENTER','GROUP') as entityType, g.id as entityId, g.display_name as entityName, g.external_id as entityExternalId, g.account_no as entityAccountNo " + " , g.office_id as parentId, o.name as parentName, null as entityMobileNo, g.status_enum as entityStatusEnum, null as parentType " + " from m_group g join m_office o on o.id = g.office_id where o.hierarchy like :hierarchy and (g.account_no like :search or g.display_name like :search or g.external_id like :search or g.id like :search )) "; - final StringBuffer sql = new StringBuffer(); + final StringBuilder sql = new StringBuilder(); if (searchConditions.isClientSearch()) { sql.append(clientMatchSql).append(union); @@ -211,7 +211,7 @@ private static final class AdHocQuerySearchMapper implements RowMapper retrieveSelfAccountTemplateData( AppUser user) { SelfAccountTemplateMapper mapper = new SelfAccountTemplateMapper(); - StringBuffer sql = new StringBuffer() + StringBuilder sql = new StringBuilder() .append("select s.id as accountId, ") .append("s.account_no as accountNo, ") .append("2 as accountType, ") diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/domain/ShareAccount.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/domain/ShareAccount.java index 2b4d8eff34c..e54cd7a7059 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/domain/ShareAccount.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/domain/ShareAccount.java @@ -420,7 +420,7 @@ public void undoApprove() { this.closedDate = null; this.closedBy = null; this.totalSharesApproved = null; - Long tempTotalShares = new Long(0); + Long tempTotalShares = Long.valueOf(0); for (ShareAccountTransaction transaction : this.shareAccountTransactions) { if(transaction.isPurchasTransaction()) { transaction.undoApprove(); @@ -540,8 +540,8 @@ public void removeTransactions() { for(ShareAccountTransaction transaction: this.shareAccountTransactions) { transaction.setActive(false); } - this.totalSharesApproved = new Long(0) ; - this.totalSharesPending = new Long(0) ; + this.totalSharesApproved = Long.valueOf(0) ; + this.totalSharesPending = Long.valueOf(0) ; } public void removeCharges() { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/serialization/ShareAccountDataSerializer.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/serialization/ShareAccountDataSerializer.java index 368856ffb7d..2dc3b842a0a 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/serialization/ShareAccountDataSerializer.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/serialization/ShareAccountDataSerializer.java @@ -479,13 +479,13 @@ public Map validateAndApprove(JsonCommand jsonCommand, ShareAcco private void validateTotalSubsribedShares(final ShareAccount account, final ShareAccountTransaction transaction, final DataValidatorBuilder baseDataValidator) { Long totalSubsribedShares = account.getShareProduct().getSubscribedShares() ; - Long requested = new Long(0) ; + Long requested = Long.valueOf(0) ; if(transaction.isActive() && transaction.isPendingForApprovalTransaction()) { requested +=transaction.getTotalShares() ; } Long totalSharesIssuable = account.getShareProduct().getSharesIssued() ; if(totalSharesIssuable == null) totalSharesIssuable = account.getShareProduct().getTotalShares() ; - if(totalSubsribedShares == null) totalSubsribedShares = new Long(0) ; + if(totalSubsribedShares == null) totalSubsribedShares = Long.valueOf(0) ; if((totalSubsribedShares+requested) > totalSharesIssuable) { baseDataValidator.reset().parameter(ShareAccountApiConstants.requestedshares_paramname).value(requested) .failWithCodeNoParameterAddedToErrorCode("shares.requested.can.not.be.approved.exceeding.totalshares.issuable"); @@ -737,7 +737,7 @@ public Map validateAndApproveAddtionalShares(JsonCommand jsonCom purchasedShares.add(purchasedSharesId); } if (totalShares > 0) { - account.updateApprovedShares(new Long(totalShares)); + account.updateApprovedShares(Long.valueOf(totalShares)); } } if (!dataValidationErrors.isEmpty()) { throw new PlatformApiDataValidationException(dataValidationErrors); } @@ -783,7 +783,7 @@ public Map validateAndRejectAddtionalShares(JsonCommand jsonComm purchasedShares.add(purchasedSharesId); } if (totalShares > 0) { - account.removePendingShares(new Long(totalShares)); + account.removePendingShares(Long.valueOf(totalShares)); } } actualChanges.put(ShareAccountApiConstants.requestedshares_paramname, purchasedShares); @@ -862,8 +862,8 @@ private void validateRedeemRequest(final ShareAccount account, ShareAccountTrans final Integer lockinPeriod = account.getLockinPeriodFrequency(); final PeriodFrequencyType periodType = account.getLockinPeriodFrequencyType(); if (lockinPeriod == null && periodType == null) { return; } - Long totalSharesCanBeRedeemed = new Long(0); - Long totalSharesPurchasedBeforeRedeem = new Long(0) ; + Long totalSharesCanBeRedeemed = Long.valueOf(0); + Long totalSharesPurchasedBeforeRedeem = Long.valueOf(0) ; boolean isPurchaseTransactionExist = false ; Set transactions = account.getShareAccountTransactions(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/service/PurchasedSharesReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/service/PurchasedSharesReadPlatformServiceImpl.java index fa5edde39d7..927b8fb0e5e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/service/PurchasedSharesReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/service/PurchasedSharesReadPlatformServiceImpl.java @@ -55,7 +55,7 @@ private final static class PurchasedSharesDataRowMapper implements RowMapper public ShareAccountMapper(final Collection charges, final Collection purchasedShares) { this.charges = charges; this.purchasedShares = purchasedShares; - StringBuffer buff = new StringBuffer() + StringBuilder buff = new StringBuilder() .append("sa.id as id, sa.external_id as externalId, sa.status_enum as statusEnum, ") .append("sa.savings_account_id, msa.account_no as savingsAccNo, ") .append("c.id as clientId, c.display_name as clientName, ") @@ -443,7 +443,7 @@ private final static class PurchasedSharesDataRowMapper implements RowMapper transactions = account.getShareAccountTransactions(); Set journalTransactions = new HashSet<>(); - Long totalSubsribedShares = new Long(0) ; + Long totalSubsribedShares = Long.valueOf(0) ; for (ShareAccountTransaction transaction : transactions) { if (transaction.isActive() && transaction.isPurchasTransaction()) { @@ -401,7 +401,7 @@ public CommandProcessingResult approveAdditionalShares(Long accountId, JsonComma if (!changes.isEmpty()) { this.shareAccountRepository.save(account); ArrayList transactionIds = (ArrayList) changes.get(ShareAccountApiConstants.requestedshares_paramname); - Long totalSubscribedShares = new Long(0) ; + Long totalSubscribedShares = Long.valueOf(0) ; if (transactionIds != null) { Set transactions = new HashSet<>(); for (Long id : transactionIds) { @@ -411,7 +411,7 @@ public CommandProcessingResult approveAdditionalShares(Long accountId, JsonComma } this.journalEntryWritePlatformService.createJournalEntriesForShares(populateJournalEntries(account, transactions)); } - if(!totalSubscribedShares.equals(new Long(0))) { + if(!totalSubscribedShares.equals(Long.valueOf(0))) { ShareProduct shareProduct = account.getShareProduct() ; shareProduct.addSubscribedShares(totalSubscribedShares); this.shareProductRepository.save(shareProduct); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareproducts/domain/ShareProduct.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareproducts/domain/ShareProduct.java index 4fe9de86a4b..d2745047a08 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareproducts/domain/ShareProduct.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareproducts/domain/ShareProduct.java @@ -416,7 +416,7 @@ public BigDecimal deriveMarketPrice(final Date currentDate) { public void addSubscribedShares(final Long subscribedShares) { if(this.totalSubscribedShares == null) { - this.totalSubscribedShares = new Long(0) ; + this.totalSubscribedShares = Long.valueOf(0) ; } this.totalSubscribedShares += subscribedShares ; } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareproducts/service/ShareProductReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareproducts/service/ShareProductReadPlatformServiceImpl.java index 90b12377c3d..21ae1ef641f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareproducts/service/ShareProductReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareproducts/service/ShareProductReadPlatformServiceImpl.java @@ -204,7 +204,7 @@ private final static class ShareProductRowMapper implements RowMapper shareMarketCollection; Collection charges; - private StringBuffer buff = new StringBuffer(); + private StringBuilder buff = new StringBuilder(); ShareProductRowMapper(Collection shareMarketCollection, Collection charges) { this.shareMarketCollection = shareMarketCollection; @@ -284,4 +284,4 @@ public String schema() { return this.buff.toString(); } } -} \ No newline at end of file +} diff --git a/fineract-provider/src/main/java/org/apache/fineract/spm/api/LookupTableApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/spm/api/LookupTableApiResource.java index 1f60e80cf80..b39ea6f7b21 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/spm/api/LookupTableApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/spm/api/LookupTableApiResource.java @@ -88,7 +88,7 @@ public List fetchLookupTables(@PathParam("surveyId") @ApiParam( return LookupTableMapper.map(lookupTables); } - return Collections.EMPTY_LIST; + return Collections.emptyList(); } @GET diff --git a/fineract-provider/src/main/java/org/apache/fineract/spm/util/LookupTableMapper.java b/fineract-provider/src/main/java/org/apache/fineract/spm/util/LookupTableMapper.java index 872132d889f..60e1fe41c80 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/spm/util/LookupTableMapper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/spm/util/LookupTableMapper.java @@ -53,7 +53,7 @@ public static List map(final List lookupTables) { return new ArrayList<>(lookupTableDataMap.values()); } - return Collections.EMPTY_LIST; + return Collections.emptyList(); } public static List map(final LookupTableData lookupTableData, final Survey survey) { diff --git a/fineract-provider/src/test/java/org/apache/fineract/notification/StorageTest.java b/fineract-provider/src/test/java/org/apache/fineract/notification/StorageTest.java index bf9a1530c4b..d60b585e23c 100644 --- a/fineract-provider/src/test/java/org/apache/fineract/notification/StorageTest.java +++ b/fineract-provider/src/test/java/org/apache/fineract/notification/StorageTest.java @@ -125,7 +125,7 @@ public void testNotificationStorage() { verify(this.notificationGeneratorWritePlatformService, times(1)).create(refEq(notification)); verify(this.notificationMapperWritePlatformService, times(1)).create(refEq(notificationMapper)); verify(this.notificationGeneratorReadRepositoryWrapper, times(1)).findById(1L); - assertEquals(actualGeneratedNotificationId, new Long(1)); + assertEquals(actualGeneratedNotificationId, Long.valueOf(1)); } private String getCurrentDateTime() { diff --git a/fineract-provider/src/test/java/org/apache/fineract/notification/TopicTest.java b/fineract-provider/src/test/java/org/apache/fineract/notification/TopicTest.java index 10939eb02e5..aab72caa69a 100644 --- a/fineract-provider/src/test/java/org/apache/fineract/notification/TopicTest.java +++ b/fineract-provider/src/test/java/org/apache/fineract/notification/TopicTest.java @@ -79,7 +79,7 @@ public void testTopicStorage() { verify(this.roleRepository, times(1)).save(role); verify(this.topicWritePltfService, times(1)).create(refEq(topic)); - assertEquals(topicId, new Long(1)); + assertEquals(topicId, Long.valueOf(1)); } @@ -97,7 +97,7 @@ public void testTopicSubscriberStorage() { Long subscriberId = this.topicSubscriberWritePltfService.create(topicSubscriber); verify(this.topicSubscriberWritePltfService, times(1)).create(refEq(topicSubscriber)); - assertEquals(subscriberId, new Long(1)); + assertEquals(subscriberId, Long.valueOf(1)); } diff --git a/fineract-provider/src/test/java/org/apache/fineract/template/TemplateMergeServiceTest.java b/fineract-provider/src/test/java/org/apache/fineract/template/TemplateMergeServiceTest.java index 42c632655a5..68f31e50711 100644 --- a/fineract-provider/src/test/java/org/apache/fineract/template/TemplateMergeServiceTest.java +++ b/fineract-provider/src/test/java/org/apache/fineract/template/TemplateMergeServiceTest.java @@ -20,7 +20,6 @@ import static org.junit.Assert.assertEquals; -import com.google.common.base.Charsets; import com.google.common.io.Resources; import com.google.common.reflect.TypeToken; import com.google.gson.Gson; @@ -32,6 +31,7 @@ import java.lang.reflect.Type; import java.math.RoundingMode; import java.net.MalformedURLException; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -83,8 +83,8 @@ public void compileLoanSummary() throws IOException { Map scopes = new HashMap<>(); scopes.put("installments", installments); - String templateText = Resources.toString(Resources.getResource("template.mustache"), Charsets.UTF_8); - String expectedOutput = Resources.toString(Resources.getResource("template-expected.html"), Charsets.UTF_8); + String templateText = Resources.toString(Resources.getResource("template.mustache"), StandardCharsets.UTF_8); + String expectedOutput = Resources.toString(Resources.getResource("template-expected.html"), StandardCharsets.UTF_8); String output = compileTemplateText(templateText, scopes); assertEquals(expectedOutput, output); From 3475c0cfb7344c3707b32f3c26b23d15ff7bdd03 Mon Sep 17 00:00:00 2001 From: xurror Date: Thu, 5 Mar 2020 23:17:57 +0100 Subject: [PATCH 24/37] FINERACT-796 Use Hikari instead of Tomcat Connection Pool - Created hikari connection pool bean - Configured connection parameters to match hikari - Removed tomcat-jdbc and dbcp - Remove unused classes - Add Hikari to logback - update hikaridatasource bean closes https://issues.apache.org/jira/browse/FINERACT-796 remove hikaricp import from gradle files more specific bean config - Set up datasource properties - Cleanup unused classes - Add hikari to logback --- docker/server.xml | 29 ---- fineract-provider/build.gradle | 8 +- fineract-provider/dependencies.gradle | 13 +- fineract-provider/dev-dependencies.gradle | 9 +- .../boot/WarWebApplicationInitializer.java | 2 +- .../core/boot/db/DataSourceConfiguration.java | 56 ------- .../core/boot/db/DataSourceProperties.java | 156 ------------------ .../db/TenantDataSourcePortFixService.java | 93 ----------- .../core/service/DataSourceForTenants.java | 2 +- .../service/TenantDatabaseUpgradeService.java | 8 +- .../TomcatJdbcDataSourcePerTenantService.java | 58 ++----- .../BasicAuthTenantDetailsServiceJdbc.java | 2 +- .../service/JdbcTenantDetailsService.java | 2 +- .../META-INF/spring/hikariDataSource.xml | 64 +++++++ .../resources/META-INF/spring/jdbc.properties | 7 +- .../main/resources/META-INF/spring/jndi.xml | 34 ---- .../src/main/resources/logback.xml | 1 + .../src/main/webapp/META-INF/context.xml | 27 --- ...WithoutDatabaseAndNoJobsConfiguration.java | 4 +- .../src/test/resources/META-INF/context.xml | 29 ---- 20 files changed, 104 insertions(+), 500 deletions(-) delete mode 100644 fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/boot/db/DataSourceConfiguration.java delete mode 100644 fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/boot/db/DataSourceProperties.java delete mode 100644 fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/boot/db/TenantDataSourcePortFixService.java create mode 100644 fineract-provider/src/main/resources/META-INF/spring/hikariDataSource.xml delete mode 100644 fineract-provider/src/main/resources/META-INF/spring/jndi.xml delete mode 100644 fineract-provider/src/main/webapp/META-INF/context.xml delete mode 100644 fineract-provider/src/test/resources/META-INF/context.xml diff --git a/docker/server.xml b/docker/server.xml index a509a661b34..58887b59fc4 100644 --- a/docker/server.xml +++ b/docker/server.xml @@ -31,35 +31,6 @@ - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + true + 250 + 2048 + true + true + + true + true + true + true + true + + + + diff --git a/fineract-provider/src/main/resources/META-INF/spring/jdbc.properties b/fineract-provider/src/main/resources/META-INF/spring/jdbc.properties index 8d64dc515ea..625774edee8 100644 --- a/fineract-provider/src/main/resources/META-INF/spring/jdbc.properties +++ b/fineract-provider/src/main/resources/META-INF/spring/jdbc.properties @@ -20,4 +20,9 @@ DRIVERCLASS_NAME:org.drizzle.jdbc.DrizzleDriver PROTOCOL:jdbc SUB_PROTOCOL:mysql:thin -PORT:3306 \ No newline at end of file +PORT:3306 + +fineract_tenants_driver:org.drizzle.jdbc.DrizzleDriver +fineract_tenants_url:jdbc:mysql:thin://localhost:3306/fineract_tenants +fineract_tenants_uid:root +fineract_tenants_pwd:mysql \ No newline at end of file diff --git a/fineract-provider/src/main/resources/META-INF/spring/jndi.xml b/fineract-provider/src/main/resources/META-INF/spring/jndi.xml deleted file mode 100644 index f19d771919a..00000000000 --- a/fineract-provider/src/main/resources/META-INF/spring/jndi.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - diff --git a/fineract-provider/src/main/resources/logback.xml b/fineract-provider/src/main/resources/logback.xml index 9a17a18004c..86480653ab2 100644 --- a/fineract-provider/src/main/resources/logback.xml +++ b/fineract-provider/src/main/resources/logback.xml @@ -44,6 +44,7 @@ + diff --git a/fineract-provider/src/main/webapp/META-INF/context.xml b/fineract-provider/src/main/webapp/META-INF/context.xml deleted file mode 100644 index 381cc5bd47e..00000000000 --- a/fineract-provider/src/main/webapp/META-INF/context.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/fineract-provider/src/test/java/org/apache/fineract/infrastructure/configuration/spring/TestsWithoutDatabaseAndNoJobsConfiguration.java b/fineract-provider/src/test/java/org/apache/fineract/infrastructure/configuration/spring/TestsWithoutDatabaseAndNoJobsConfiguration.java index 1d512a656be..1ed373f2f9e 100644 --- a/fineract-provider/src/test/java/org/apache/fineract/infrastructure/configuration/spring/TestsWithoutDatabaseAndNoJobsConfiguration.java +++ b/fineract-provider/src/test/java/org/apache/fineract/infrastructure/configuration/spring/TestsWithoutDatabaseAndNoJobsConfiguration.java @@ -39,7 +39,7 @@ public class TestsWithoutDatabaseAndNoJobsConfiguration extends AbstractApplicat */ @Bean public TenantDatabaseUpgradeService tenantDatabaseUpgradeService() { - return new TenantDatabaseUpgradeService(null, null, null) { + return new TenantDatabaseUpgradeService(null, null) { @Override public void upgradeAllTenants() { // NOOP @@ -62,7 +62,7 @@ public JobRegisterService jobRegisterServiceImpl() { * DataSource with Mockito RETURNS_MOCKS black magic. */ @Bean - public DataSource tenantDataSourceJndi() { + public DataSource hikariTenantDataSource() { DataSource mockDataSource = Mockito.mock(DataSource.class, Mockito.RETURNS_MOCKS); return mockDataSource; } diff --git a/fineract-provider/src/test/resources/META-INF/context.xml b/fineract-provider/src/test/resources/META-INF/context.xml deleted file mode 100644 index d567d54c43a..00000000000 --- a/fineract-provider/src/test/resources/META-INF/context.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - \ No newline at end of file From 99794914a5a1542392d890525fd20a38a093b357 Mon Sep 17 00:00:00 2001 From: Michael Vorburger Date: Mon, 23 Mar 2020 01:04:44 +0100 Subject: [PATCH 25/37] Fix wrong @OneToOne to @ManyToOne in AbstractAuditableCustom --- .../infrastructure/core/domain/AbstractAuditableCustom.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/domain/AbstractAuditableCustom.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/domain/AbstractAuditableCustom.java index 44928bdf0bc..032808162e6 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/domain/AbstractAuditableCustom.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/domain/AbstractAuditableCustom.java @@ -25,8 +25,8 @@ import javax.persistence.Column; import javax.persistence.FetchType; import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; import javax.persistence.MappedSuperclass; -import javax.persistence.OneToOne; import javax.persistence.Temporal; import javax.persistence.TemporalType; import org.apache.fineract.useradministration.domain.AppUser; @@ -50,7 +50,7 @@ public abstract class AbstractAuditableCustom extend private static final long serialVersionUID = 141481953116476081L; - @OneToOne(fetch=FetchType.LAZY) + @ManyToOne(fetch=FetchType.LAZY) @JoinColumn(name = "createdby_id") private AppUser createdBy; @@ -58,7 +58,7 @@ public abstract class AbstractAuditableCustom extend @Temporal(TemporalType.TIMESTAMP) private Date createdDate; - @OneToOne(fetch=FetchType.LAZY) + @ManyToOne(fetch=FetchType.LAZY) @JoinColumn(name = "lastmodifiedby_id") private AppUser lastModifiedBy; From 5f2ba51f5a447131368217726527714d4adf361c Mon Sep 17 00:00:00 2001 From: Michael Vorburger Date: Sat, 28 Mar 2020 13:52:11 +0100 Subject: [PATCH 26/37] Minor clean ups in DataSource Connection Pool related code --- .../core/boot/JDBCDriverConfig.java | 35 ++++---- .../core/domain/FineractPlatformTenant.java | 1 - .../FineractPlatformTenantConnection.java | 88 +------------------ .../TomcatJdbcDataSourcePerTenantService.java | 27 +++--- 4 files changed, 29 insertions(+), 122 deletions(-) diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/boot/JDBCDriverConfig.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/boot/JDBCDriverConfig.java index 39aa036d9dd..11d2cfc0341 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/boot/JDBCDriverConfig.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/boot/JDBCDriverConfig.java @@ -27,41 +27,41 @@ @Service public class JDBCDriverConfig { - private final static String DRIVER_CLASS_PROPERTYNAME = "DRIVERCLASS_NAME" ; - private final static String PROTOCOL_PROPERTYNAME = "PROTOCOL" ; - private final static String SUBPROTOCOL_PROPERTYNAME = "SUB_PROTOCOL" ; - private final static String PORT_PROPERTYNAME = "PORT" ; + private final static String DRIVER_CLASS_PROPERTYNAME = "DRIVERCLASS_NAME"; + private final static String PROTOCOL_PROPERTYNAME = "PROTOCOL"; + private final static String SUBPROTOCOL_PROPERTYNAME = "SUB_PROTOCOL"; + private final static String PORT_PROPERTYNAME = "PORT"; - private String driverClassName ; - private String protocol ; - private String subProtocol ; - private Integer port ; + private String driverClassName; + private String protocol; + private String subProtocol; + private Integer port; - @Autowired ApplicationContext context ; + @Autowired ApplicationContext context; @PostConstruct protected void init() { Environment environment = context.getEnvironment() ; - driverClassName = (String)environment.getProperty(DRIVER_CLASS_PROPERTYNAME) ; - protocol = (String) environment.getProperty(PROTOCOL_PROPERTYNAME) ; - subProtocol = (String) environment.getProperty(SUBPROTOCOL_PROPERTYNAME) ; - port = Integer.parseInt((String) environment.getProperty(PORT_PROPERTYNAME)) ; + driverClassName = environment.getProperty(DRIVER_CLASS_PROPERTYNAME) ; + protocol = environment.getProperty(PROTOCOL_PROPERTYNAME) ; + subProtocol = environment.getProperty(SUBPROTOCOL_PROPERTYNAME) ; + port = Integer.parseInt(environment.getProperty(PORT_PROPERTYNAME)) ; } public String getDriverClassName() { - return this.driverClassName ; + return this.driverClassName; } public String getProtocol() { - return this.protocol ; + return this.protocol; } public String getSubProtocol() { - return this.subProtocol ; + return this.subProtocol; } public Integer getPort() { - return this.port ; + return this.port; } public String constructProtocol(String schemaServer, String schemaServerPort, String schemaName) { @@ -69,5 +69,4 @@ public String constructProtocol(String schemaServer, String schemaServerPort, St .append('/').append(schemaName).toString(); return url; } - } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/domain/FineractPlatformTenant.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/domain/FineractPlatformTenant.java index a462c92dcca..fb1c0c3fb1e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/domain/FineractPlatformTenant.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/domain/FineractPlatformTenant.java @@ -54,5 +54,4 @@ public String getTimezoneId() { public FineractPlatformTenantConnection getConnection() { return connection; } - } \ No newline at end of file diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/domain/FineractPlatformTenantConnection.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/domain/FineractPlatformTenantConnection.java index 54613bb1ef1..54395765cae 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/domain/FineractPlatformTenantConnection.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/domain/FineractPlatformTenantConnection.java @@ -20,8 +20,7 @@ /** - * Holds DB server connection details. - * + * Holds Tenant's DB server connection connection details. */ public class FineractPlatformTenantConnection { @@ -77,161 +76,78 @@ public FineractPlatformTenantConnection(final Long connectionId,final String sch this.testOnBorrow=tesOnBorrow; } - //The Connection Protocol should be built based on jdbc.properties. We can't hard code this here and also, constructing protocol is not this class - //responsibility - /*public String databaseURL() { - final String url = new StringBuilder("jdbc:mysql:thin://").append(this.schemaServer).append(':').append(this.schemaServerPort) - .append('/').append(this.schemaName).toString(); - return url; - }*/ - - /** - * @return the schemaServer - */ public String getSchemaServer() { return this.schemaServer; } - - /** - * @return the schemaServerPort - */ public String getSchemaServerPort() { return this.schemaServerPort; } - - /** - * @return the schemaUsername - */ public String getSchemaUsername() { return this.schemaUsername; } - - /** - * @return the schemaPassword - */ public String getSchemaPassword() { return this.schemaPassword; } - - /** - * @return the autoUpdateEnabled - */ public boolean isAutoUpdateEnabled() { return this.autoUpdateEnabled; } - - /** - * @return the initialSize - */ public int getInitialSize() { return this.initialSize; } - - /** - * @return the validationInterval - */ public long getValidationInterval() { return this.validationInterval; } - - /** - * @return the removeAbandoned - */ public boolean isRemoveAbandoned() { return this.removeAbandoned; } - - /** - * @return the removeAbandonedTimeout - */ public int getRemoveAbandonedTimeout() { return this.removeAbandonedTimeout; } - - /** - * @return the logAbandoned - */ public boolean isLogAbandoned() { return this.logAbandoned; } - - /** - * @return the abandonWhenPercentageFull - */ public int getAbandonWhenPercentageFull() { return this.abandonWhenPercentageFull; } - - /** - * @return the maxActive - */ public int getMaxActive() { return this.maxActive; } - - /** - * @return the minIdle - */ public int getMinIdle() { return this.minIdle; } - - /** - * @return the maxIdle - */ public int getMaxIdle() { return this.maxIdle; } - - /** - * @return the suspectTimeout - */ public int getSuspectTimeout() { return this.suspectTimeout; } - - /** - * @return the timeBetweenEvictionRunsMillis - */ public int getTimeBetweenEvictionRunsMillis() { return this.timeBetweenEvictionRunsMillis; } - - /** - * @return the minEvictableIdleTimeMillis - */ public int getMinEvictableIdleTimeMillis() { return this.minEvictableIdleTimeMillis; } - - /** - * @return the maxRetriesOnDeadlock - */ public int getMaxRetriesOnDeadlock() { return this.maxRetriesOnDeadlock; } - - /** - * @return the maxIntervalBetweenRetries - */ public int getMaxIntervalBetweenRetries() { return this.maxIntervalBetweenRetries; } @@ -249,6 +165,6 @@ public String getSchemaName() { } @Override public String toString() { - return this.schemaName+":"+this.schemaServer+":"+this.schemaServerPort; + return this.schemaName + ":" + this.schemaServer + ":" + this.schemaServerPort; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/service/TomcatJdbcDataSourcePerTenantService.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/service/TomcatJdbcDataSourcePerTenantService.java index 2318db9b725..48a2bbb56fb 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/service/TomcatJdbcDataSourcePerTenantService.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/service/TomcatJdbcDataSourcePerTenantService.java @@ -31,7 +31,7 @@ import org.springframework.stereotype.Service; /** - * Implementation that returns a new or existing tomcat 7 jdbc connection pool + * Implementation that returns a new or existing connection pool * datasource based on the tenant details stored in a {@link ThreadLocal} * variable for this request. * @@ -45,7 +45,7 @@ public class TomcatJdbcDataSourcePerTenantService implements RoutingDataSourceSe private final DataSource tenantDataSource; @Autowired - private JDBCDriverConfig driverConfig ; + private JDBCDriverConfig driverConfig; @Autowired public TomcatJdbcDataSourcePerTenantService(final @Qualifier("hikariTenantDataSource") DataSource tenantDataSource) { @@ -54,7 +54,6 @@ public TomcatJdbcDataSourcePerTenantService(final @Qualifier("hikariTenantDataSo @Override public DataSource retrieveDataSource() { - // default to tenant database datasource DataSource tenantDataSource = this.tenantDataSource; @@ -63,12 +62,10 @@ public DataSource retrieveDataSource() { final FineractPlatformTenantConnection tenantConnection = tenant.getConnection(); synchronized (this.tenantToDataSourceMap) { - // if tenantConnection information available switch to - // appropriate - // datasource - // for that tenant. - if (this.tenantToDataSourceMap.containsKey(tenantConnection.getConnectionId())) { - tenantDataSource = this.tenantToDataSourceMap.get(tenantConnection.getConnectionId()); + // if tenantConnection information available switch to the appropriate datasource for that tenant. + DataSource possibleDS = this.tenantToDataSourceMap.get(tenantConnection.getConnectionId()); + if (possibleDS != null) { + tenantDataSource = possibleDS; } else { tenantDataSource = createNewDataSourceFor(tenantConnection); this.tenantToDataSourceMap.put(tenantConnection.getConnectionId(), tenantDataSource); @@ -79,13 +76,9 @@ public DataSource retrieveDataSource() { return tenantDataSource; } - // creates the data source oltp and report databases + // creates the tenant data source for the oltp and report database private DataSource createNewDataSourceFor(final FineractPlatformTenantConnection tenantConnectionObj) { - // see - // http://www.tomcatexpert.com/blog/2010/04/01/configuring-jdbc-pool-high-concurrency - - // see also org.apache.fineract.DataSourceProperties.setDefaults() - String jdbcUrl = this.driverConfig.constructProtocol(tenantConnectionObj.getSchemaServer(), tenantConnectionObj.getSchemaServerPort(), tenantConnectionObj.getSchemaName()); + String jdbcUrl = this.driverConfig.constructProtocol(tenantConnectionObj.getSchemaServer(), tenantConnectionObj.getSchemaServerPort(), tenantConnectionObj.getSchemaName()); HikariConfig config = new HikariConfig(); config.setDriverClassName(this.driverConfig.getDriverClassName()); @@ -93,12 +86,12 @@ private DataSource createNewDataSourceFor(final FineractPlatformTenantConnection config.setJdbcUrl(jdbcUrl); config.setUsername(tenantConnectionObj.getSchemaUsername()); config.setPassword(tenantConnectionObj.getSchemaPassword()); - config.setConnectionTestQuery("SELECT 1"); config.setValidationTimeout(tenantConnectionObj.getValidationInterval()); - config.setAutoCommit(true); + // https://github.com/brettwooldridge/HikariCP/wiki/MySQL-Configuration + return new HikariDataSource(config); } } \ No newline at end of file From 53e8658d74604acaf6e3b959f2431c31f7c0d867 Mon Sep 17 00:00:00 2001 From: Michael Vorburger Date: Sat, 28 Mar 2020 15:06:15 +0100 Subject: [PATCH 27/37] apply Hikari's recommended MySQL Configuration (FINERACT-796) from https://github.com/brettwooldridge/HikariCP/wiki/MySQL-Configuration and https://github.com/brettwooldridge/HikariCP/wiki/JDBC-Logging#mysql-connectorj --- .../TomcatJdbcDataSourcePerTenantService.java | 21 +++++++++++++++++++ .../META-INF/spring/hikariDataSource.xml | 13 ++++++++---- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/service/TomcatJdbcDataSourcePerTenantService.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/service/TomcatJdbcDataSourcePerTenantService.java index 48a2bbb56fb..71be36e66b7 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/service/TomcatJdbcDataSourcePerTenantService.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/service/TomcatJdbcDataSourcePerTenantService.java @@ -86,11 +86,32 @@ private DataSource createNewDataSourceFor(final FineractPlatformTenantConnection config.setJdbcUrl(jdbcUrl); config.setUsername(tenantConnectionObj.getSchemaUsername()); config.setPassword(tenantConnectionObj.getSchemaPassword()); + config.setMinimumIdle(tenantConnectionObj.getInitialSize()); + config.setMaximumPoolSize(tenantConnectionObj.getMaxActive()); config.setConnectionTestQuery("SELECT 1"); config.setValidationTimeout(tenantConnectionObj.getValidationInterval()); config.setAutoCommit(true); + // https://github.com/brettwooldridge/HikariCP/wiki/MBean-(JMX)-Monitoring-and-Management + config.setRegisterMbeans(true); + // https://github.com/brettwooldridge/HikariCP/wiki/MySQL-Configuration + // These are the properties for each Tenant DB; the same configuration is also in src/main/resources/META-INF/spring/hikariDataSource.xml for the all Tenants DB --> + config.addDataSourceProperty("cachePrepStmts", "true"); + config.addDataSourceProperty("prepStmtCacheSize", "250"); + config.addDataSourceProperty("prepStmtCacheSqlLimit", "2048"); + config.addDataSourceProperty("useServerPrepStmts", "true"); + config.addDataSourceProperty("useLocalSessionState", "true"); + config.addDataSourceProperty("rewriteBatchedStatements", "true"); + config.addDataSourceProperty("cacheResultSetMetadata", "true"); + config.addDataSourceProperty("cacheServerConfiguration", "true"); + config.addDataSourceProperty("elideSetAutoCommits", "true"); + config.addDataSourceProperty("maintainTimeStats", "false"); + + // https://github.com/brettwooldridge/HikariCP/wiki/JDBC-Logging#mysql-connectorj + config.addDataSourceProperty("logger", "com.mysql.jdbc.log.StandardLogger"); + config.addDataSourceProperty("logSlowQueries", "true"); + config.addDataSourceProperty("dumpQueriesOnException", "true"); return new HikariDataSource(config); } diff --git a/fineract-provider/src/main/resources/META-INF/spring/hikariDataSource.xml b/fineract-provider/src/main/resources/META-INF/spring/hikariDataSource.xml index 1ee21089778..1ba0ba0299a 100644 --- a/fineract-provider/src/main/resources/META-INF/spring/hikariDataSource.xml +++ b/fineract-provider/src/main/resources/META-INF/spring/hikariDataSource.xml @@ -44,21 +44,26 @@ - + + true 250 2048 true true - true true true true - true + false + + + com.mysql.jdbc.log.StandardLogger + true + true - + From 4ccbcba3a6ac3be2766a7d0dba9df6740b2429df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vorburger=20=E2=9B=91=EF=B8=8F?= Date: Sat, 28 Mar 2020 15:28:38 +0100 Subject: [PATCH 28/37] add Eclipse Checkstyle plugin tip to README --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3b5d610a43b..e0887eef66c 100644 --- a/README.md +++ b/README.md @@ -110,9 +110,10 @@ and the `mysqlserver` environment variable is now no longer supported.)_ Checkstyle ============ -This project enforces [its code conventions](fineract-provider/config/checkstyle/checkstyle.xml) using Checkstyle. +This project enforces its code conventions using [checkstyle.xml](fineract-provider/config/checkstyle/checkstyle.xml). It is configured to run automatically during the normal Gradle build, and fail if there are any style violations detected. We recommend that you configure your favourite Java IDE to match those conventions. For Eclipse, you can File > Import > General > Preferences our [config/fineractdev-eclipse-preferences.epf](config/fineractdev-eclipse-preferences.epf). +You could also use Checkstyle directly in your IDE (but you don't neccesarily have to, it may just be more convenient for you). For Eclipse, use https://checkstyle.org/eclipse-cs/ and load our checkstyle.xml into it. Version From 402c41dd9520d5931336e2babf91098baa668d30 Mon Sep 17 00:00:00 2001 From: Manthan Surkar <42006277+thesmallstar@users.noreply.github.com> Date: Thu, 2 Apr 2020 02:59:15 +0530 Subject: [PATCH 29/37] Add Jacoco to measure code coverage (FINERACT-725 / PR #742) * Added Code Coverage Section in Readme --- README.md | 8 ++++++++ fineract-provider/build.gradle | 15 +++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/README.md b/README.md index e0887eef66c..6e77bfc7b95 100644 --- a/README.md +++ b/README.md @@ -115,6 +115,14 @@ We recommend that you configure your favourite Java IDE to match those conventio File > Import > General > Preferences our [config/fineractdev-eclipse-preferences.epf](config/fineractdev-eclipse-preferences.epf). You could also use Checkstyle directly in your IDE (but you don't neccesarily have to, it may just be more convenient for you). For Eclipse, use https://checkstyle.org/eclipse-cs/ and load our checkstyle.xml into it. +Code Coverage Reports +============ + +The project uses Jacoco to measure unit tests code coverage, to generate a report run the following command: + + `./gradlew clean build jacocoTestReport` + +Generated reports can be found in build/code-coverage directory. Version ============ diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index 1a4759338de..6fea4dbb823 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -26,6 +26,7 @@ project.ext.jerseyVersion = '1.17' buildscript { ext { openJPAVersion = '3.1.0' + jacocoVersion = '0.8.5' } repositories { jcenter() @@ -66,6 +67,7 @@ apply plugin: 'openjpa' apply plugin: "com.github.spotbugs" apply plugin: 'checkstyle' apply plugin: 'com.github.andygoossens.gradle-modernizer-plugin' +apply plugin: 'jacoco' // apply plugin: 'pmd' dependencyManagement { @@ -155,6 +157,19 @@ openjpa { } } +jacoco { + toolVersion = jacocoVersion + reportsDir = file("$buildDir/reports/jacoco") +} + +jacocoTestReport{ + reports{ + html.enabled=true + xml.enabled=true + html.destination file("${buildDir}/code-coverage") + } +} + rat { xmlOutput = false htmlOutput = false From a0a82a07485b44d6aca3cdf00dbd49007a9fef9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vorburger=20=E2=9B=91=EF=B8=8F?= Date: Mon, 6 Apr 2020 12:03:11 +0200 Subject: [PATCH 30/37] add link to Release Process page on Wiki to README --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 6e77bfc7b95..4337caa091b 100644 --- a/README.md +++ b/README.md @@ -191,6 +191,8 @@ documents the process through which you can become a committer in this project. [Pull Request Size Limit](https://cwiki.apache.org/confluence/display/FINERACT/Pull+Request+Size+Limit) documents that we cannot accept huge "code dump" Pull Requests, with some related suggestions. +[How to Release Apache Fineract](https://cwiki.apache.org/confluence/x/DRwIB) documents the process how we make the source code that is available here in this git repository into a binary release ZIP available on http://fineract.apache.org. + More Information ============ From 110684bf30fd693dd8ad7a4f01c5bb5f9e20ac28 Mon Sep 17 00:00:00 2001 From: Manthan Surkar <42006277+thesmallstar@users.noreply.github.com> Date: Mon, 6 Apr 2020 22:53:46 +0530 Subject: [PATCH 31/37] Added: IntelliJ Checkstyle plugin tip to README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4337caa091b..42c577bf76b 100644 --- a/README.md +++ b/README.md @@ -113,7 +113,7 @@ Checkstyle This project enforces its code conventions using [checkstyle.xml](fineract-provider/config/checkstyle/checkstyle.xml). It is configured to run automatically during the normal Gradle build, and fail if there are any style violations detected. We recommend that you configure your favourite Java IDE to match those conventions. For Eclipse, you can File > Import > General > Preferences our [config/fineractdev-eclipse-preferences.epf](config/fineractdev-eclipse-preferences.epf). -You could also use Checkstyle directly in your IDE (but you don't neccesarily have to, it may just be more convenient for you). For Eclipse, use https://checkstyle.org/eclipse-cs/ and load our checkstyle.xml into it. +You could also use Checkstyle directly in your IDE (but you don't neccesarily have to, it may just be more convenient for you). For Eclipse, use https://checkstyle.org/eclipse-cs/ and load our checkstyle.xml into it, for IntelliJ you can use [CheckStyle-IDEA](https://plugins.jetbrains.com/plugin/1065-checkstyle-idea). Code Coverage Reports ============ From eb8a3572ae4ae3eb6dfb97cd7ec274ec27b099fd Mon Sep 17 00:00:00 2001 From: Natasha <20606687+nnatarajan@users.noreply.github.com> Date: Sun, 5 Apr 2020 18:20:52 -0600 Subject: [PATCH 32/37] FINERACT-122 added clientId, officeId, and groupId. --- ...heduleRequestWritePlatformServiceImpl.java | 32 +++++++++++++++---- 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/service/LoanRescheduleRequestWritePlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/service/LoanRescheduleRequestWritePlatformServiceImpl.java index dd70facb1e1..faa3c1698af 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/service/LoanRescheduleRequestWritePlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/service/LoanRescheduleRequestWritePlatformServiceImpl.java @@ -282,8 +282,14 @@ public CommandProcessingResult create(JsonCommand jsonCommand) { this.loanRescheduleRequestRepository.save(loanRescheduleRequest); this.loanRepositoryWrapper.save(loan); - return new CommandProcessingResultBuilder().withCommandId(jsonCommand.commandId()).withEntityId(loanRescheduleRequest.getId()) - .withLoanId(loan.getId()).build(); + return new CommandProcessingResultBuilder() + .withCommandId(jsonCommand.commandId()) + .withEntityId(loanRescheduleRequest.getId()) + .withLoanId(loan.getId()) + .withClientId(loan.getClientId()) + .withOfficeId(loan.getOfficeId()) + .withGroupId(loan.getGroupId()) + .build(); } catch (final DataIntegrityViolationException dve) { @@ -485,8 +491,15 @@ public CommandProcessingResult approve(JsonCommand jsonCommand) { this.loanAccountDomainService.recalculateAccruals(loan, true); - return new CommandProcessingResultBuilder().withCommandId(jsonCommand.commandId()).withEntityId(loanRescheduleRequestId) - .withLoanId(loanRescheduleRequest.getLoan().getId()).with(changes).build(); + return new CommandProcessingResultBuilder() + .withCommandId(jsonCommand.commandId()) + .withEntityId(loanRescheduleRequestId) + .withLoanId(loanRescheduleRequest.getLoan().getId()) + .with(changes) + .withClientId(loan.getClientId()) + .withOfficeId(loan.getOfficeId()) + .withGroupId(loan.getGroupId()) + .build(); } catch (final DataIntegrityViolationException dve) { @@ -563,8 +576,15 @@ public CommandProcessingResult reject(JsonCommand jsonCommand) { } } - return new CommandProcessingResultBuilder().withCommandId(jsonCommand.commandId()).withEntityId(loanRescheduleRequestId) - .withLoanId(loanRescheduleRequest.getLoan().getId()).with(changes).build(); + return new CommandProcessingResultBuilder() + .withCommandId(jsonCommand.commandId()) + .withEntityId(loanRescheduleRequestId) + .withLoanId(loanRescheduleRequest.getLoan().getId()) + .with(changes) + .withClientId(loanRescheduleRequest.getLoan().getClientId()) + .withOfficeId(loanRescheduleRequest.getLoan().getOfficeId()) + .withGroupId(loanRescheduleRequest.getLoan().getGroupId()) + .build(); } catch (final DataIntegrityViolationException dve) { From d0c8c6a01221f2c0fed5f2d9cdee4dcae779d57e Mon Sep 17 00:00:00 2001 From: Natasha <20606687+nnatarajan@users.noreply.github.com> Date: Sun, 5 Apr 2020 19:31:53 -0600 Subject: [PATCH 33/37] FINERACT-538 populated updated and created address --- .../address/service/AddressWritePlatformServiceImpl.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/address/service/AddressWritePlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/address/service/AddressWritePlatformServiceImpl.java index 8e8d066e21c..1b980897df6 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/address/service/AddressWritePlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/address/service/AddressWritePlatformServiceImpl.java @@ -35,6 +35,7 @@ import org.apache.fineract.portfolio.client.domain.ClientAddressRepository; import org.apache.fineract.portfolio.client.domain.ClientAddressRepositoryWrapper; import org.apache.fineract.portfolio.client.domain.ClientRepositoryWrapper; +import org.joda.time.LocalDate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -88,6 +89,8 @@ public CommandProcessingResult addClientAddress(final Long clientId, final Long final CodeValue addressTypeIdObj = this.codeValueRepository.getOne(addressTypeId); final Address add = Address.fromJson(command, stateIdobj, countryIdObj); + add.setCreatedOn(LocalDate.now()); + add.setUpdatedOn(LocalDate.now()); this.addressRepository.save(add); final Long addressid = add.getId(); final Address addobj = this.addressRepository.getOne(addressid); @@ -135,6 +138,8 @@ public CommandProcessingResult addNewClientAddress(final Client client, final Js final CodeValue addressTypeIdObj = this.codeValueRepository.getOne(addressTypeId); final Address add = Address.fromJsonObject(jsonObject, stateIdobj, countryIdObj); + add.setCreatedOn(LocalDate.now()); + add.setUpdatedOn(LocalDate.now()); this.addressRepository.save(add); final Long addressid = add.getId(); final Address addobj = this.addressRepository.getOne(addressid); @@ -269,7 +274,7 @@ public CommandProcessingResult updateClientAddress(final Long clientId, final Js } if (is_address_update) { - + addobj.setUpdatedOn(LocalDate.now()); this.addressRepository.save(addobj); } From ae4117052bd3eb8965f88bd6b8d98ef17693d812 Mon Sep 17 00:00:00 2001 From: Michael Vorburger Date: Mon, 23 Mar 2020 01:31:23 +0100 Subject: [PATCH 34/37] add missing doc to AbstractPersistableCustom & AbstractAuditableCustom --- .../core/domain/AbstractAuditableCustom.java | 51 +------------------ .../domain/AbstractPersistableCustom.java | 45 +++++++++------- 2 files changed, 28 insertions(+), 68 deletions(-) diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/domain/AbstractAuditableCustom.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/domain/AbstractAuditableCustom.java index 032808162e6..41a615f6006 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/domain/AbstractAuditableCustom.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/domain/AbstractAuditableCustom.java @@ -35,9 +35,9 @@ /** * A custom copy of {@link AbstractAuditable} to override the column names used - * on database. + * on database. It also uses Instant instead of LocalDateTime for created and modified. * - * Abstract base class for auditable entities. Stores the audition values in + * Abstract base class for auditable entities. Stores the audit values in * persistent fields. * * @param @@ -66,88 +66,41 @@ public abstract class AbstractAuditableCustom extend @Temporal(TemporalType.TIMESTAMP) private Date lastModifiedDate; - /* - * (non-Javadoc) - * - * @see org.springframework.data.domain.Auditable#getCreatedBy() - */ @Override public Optional getCreatedBy() { return Optional.ofNullable(this.createdBy); } - /* - * (non-Javadoc) - * - * @see - * org.springframework.data.domain.Auditable#setCreatedBy(java.lang.Object) - */ @Override public void setCreatedBy(final AppUser createdBy) { - this.createdBy = createdBy; } - /* - * (non-Javadoc) - * - * @see org.springframework.data.domain.Auditable#getCreatedDate() - */ @Override public Optional getCreatedDate() { return null == this.createdDate ? Optional.empty() : Optional.of(this.createdDate.toInstant()); } - /* - * (non-Javadoc) - * - * @see - * org.springframework.data.domain.Auditable#setCreatedDate(T) - */ @Override public void setCreatedDate(final Instant createdDate) { this.createdDate = null == createdDate ? null : Date.from(createdDate); } - /* - * (non-Javadoc) - * - * @see org.springframework.data.domain.Auditable#getLastModifiedBy() - */ @Override public Optional getLastModifiedBy() { return Optional.ofNullable(this.lastModifiedBy); } - /* - * (non-Javadoc) - * - * @see - * org.springframework.data.domain.Auditable#setLastModifiedBy(java.lang - * .Object) - */ @Override public void setLastModifiedBy(final AppUser lastModifiedBy) { - this.lastModifiedBy = lastModifiedBy; } - /* - * (non-Javadoc) - * - * @see org.springframework.data.domain.Auditable#getLastModifiedDate() - */ @Override public Optional getLastModifiedDate() { return null == this.lastModifiedDate ? Optional.empty() : Optional.of(this.lastModifiedDate.toInstant()); } - /* - * (non-Javadoc) - * - * @see - * org.springframework.data.domain.Auditable#setLastModifiedDate(T) - */ @Override public void setLastModifiedDate(final Instant lastModifiedDate) { this.lastModifiedDate = null == lastModifiedDate ? null : Date.from(lastModifiedDate); diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/domain/AbstractPersistableCustom.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/domain/AbstractPersistableCustom.java index 2e0586ae8ab..6a16c3d9103 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/domain/AbstractPersistableCustom.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/domain/AbstractPersistableCustom.java @@ -25,30 +25,37 @@ import javax.persistence.MappedSuperclass; import org.springframework.data.domain.Persistable; - +/** + * Abstract base class for entities. + * + * Inspired by {@link org.springframework.data.jpa.domain.AbstractPersistable}, but + * Id is always Long (and this class thus does not require generic parameterization), + * and auto-generation is of strategy {@link javax.persistence.GenerationType#IDENTITY}. + * + * The {@link #equals(Object)} and {@link #hashCode()} methods are NOT implemented here, + * which is untypical for JPA (it's usually implemented based on the Id), because + * "we end up with issues on OpenJPA" (TODO clarify this). + */ @MappedSuperclass public abstract class AbstractPersistableCustom implements Persistable, Serializable { - private static final long serialVersionUID = 9181640245194392646L; - - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Long id; - - @Override - public Long getId() { - return id; - } + private static final long serialVersionUID = 9181640245194392646L; - protected void setId(final Long id) { - this.id = id; - } + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; - @Override - public boolean isNew() { + @Override + public Long getId() { + return id; + } - return null == this.id; - } + protected void setId(final Long id) { + this.id = id; + } - // We have removed toString(), hashCode() and equals() methods here, because by adding them here, we end up with issues on OpenJPA. + @Override + public boolean isNew() { + return null == this.id; + } } From dccea1d65e5a37fb7ca98b470f9ae418c6e8f6d6 Mon Sep 17 00:00:00 2001 From: Michael Vorburger Date: Mon, 23 Mar 2020 01:33:22 +0100 Subject: [PATCH 35/37] add @Transient to AbstractPersistableCustom isNew() see https://jira.spring.io/browse/DATAJPA-622 Even though we don't use Hibernate, copying this annotation from the original class in Spring Data seems prudent - just in case. It should not cause any harm or side effects on OpenJPA. --- .../infrastructure/core/domain/AbstractPersistableCustom.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/domain/AbstractPersistableCustom.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/domain/AbstractPersistableCustom.java index 6a16c3d9103..1670922f774 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/domain/AbstractPersistableCustom.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/domain/AbstractPersistableCustom.java @@ -23,6 +23,7 @@ import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.MappedSuperclass; +import javax.persistence.Transient; import org.springframework.data.domain.Persistable; /** @@ -55,6 +56,7 @@ protected void setId(final Long id) { } @Override + @Transient // DATAJPA-622 public boolean isNew() { return null == this.id; } From 09d0cfaa521eaeca82e1be27ee15e7219796fb24 Mon Sep 17 00:00:00 2001 From: Michael Vorburger Date: Mon, 23 Mar 2020 01:42:08 +0100 Subject: [PATCH 36/37] Remove AbstractPersistableCustom's PK parameterization Because both are pointless, as the PK @Id is hard-coded to Long anyway, and the U is (rightfully) fixed to always be an AppUser here. --- .../apache/fineract/accounting/closure/domain/GLClosure.java | 2 +- .../domain/FinancialActivityAccount.java | 2 +- .../apache/fineract/accounting/glaccount/domain/GLAccount.java | 2 +- .../fineract/accounting/glaccount/domain/TrialBalance.java | 2 +- .../fineract/accounting/journalentry/domain/JournalEntry.java | 2 +- .../domain/ProductToGLAccountMapping.java | 2 +- .../provisioning/domain/LoanProductProvisioningEntry.java | 2 +- .../accounting/provisioning/domain/ProvisioningEntry.java | 2 +- .../apache/fineract/accounting/rule/domain/AccountingRule.java | 2 +- .../fineract/accounting/rule/domain/AccountingTagRule.java | 2 +- .../main/java/org/apache/fineract/adhocquery/domain/AdHoc.java | 2 +- .../org/apache/fineract/commands/domain/CommandSource.java | 2 +- .../accountnumberformat/domain/AccountNumberFormat.java | 2 +- .../infrastructure/bulkimport/domain/ImportDocument.java | 2 +- .../fineract/infrastructure/cache/domain/PlatformCache.java | 2 +- .../infrastructure/campaigns/email/domain/EmailCampaign.java | 2 +- .../campaigns/email/domain/EmailConfiguration.java | 2 +- .../infrastructure/campaigns/email/domain/EmailMessage.java | 2 +- .../infrastructure/campaigns/sms/domain/SmsCampaign.java | 2 +- .../org/apache/fineract/infrastructure/codes/domain/Code.java | 2 +- .../apache/fineract/infrastructure/codes/domain/CodeValue.java | 2 +- .../infrastructure/configuration/domain/ExternalService.java | 2 +- .../configuration/domain/GlobalConfigurationProperty.java | 2 +- .../infrastructure/core/domain/AbstractAuditableCustom.java | 3 +-- .../infrastructure/core/domain/AbstractPersistableCustom.java | 2 +- .../infrastructure/creditbureau/domain/CreditBureau.java | 2 +- .../creditbureau/domain/CreditBureauConfiguration.java | 2 +- .../creditbureau/domain/CreditBureauLoanProductMapping.java | 2 +- .../creditbureau/domain/OrganisationCreditBureau.java | 2 +- .../dataqueries/domain/EntityDatatableChecks.java | 2 +- .../fineract/infrastructure/dataqueries/domain/Report.java | 2 +- .../infrastructure/dataqueries/domain/ReportParameter.java | 2 +- .../dataqueries/domain/ReportParameterUsage.java | 2 +- .../infrastructure/documentmanagement/domain/Document.java | 2 +- .../infrastructure/documentmanagement/domain/Image.java | 2 +- .../entityaccess/domain/FineractEntityAccess.java | 2 +- .../entityaccess/domain/FineractEntityRelation.java | 2 +- .../entityaccess/domain/FineractEntityToEntityMapping.java | 2 +- .../fineract/infrastructure/gcm/domain/DeviceRegistration.java | 2 +- .../org/apache/fineract/infrastructure/hooks/domain/Hook.java | 2 +- .../infrastructure/hooks/domain/HookConfiguration.java | 2 +- .../fineract/infrastructure/hooks/domain/HookResource.java | 2 +- .../fineract/infrastructure/hooks/domain/HookTemplate.java | 2 +- .../apache/fineract/infrastructure/hooks/domain/Schema.java | 2 +- .../fineract/infrastructure/jobs/domain/JobParameter.java | 2 +- .../infrastructure/jobs/domain/ScheduledJobDetail.java | 2 +- .../infrastructure/jobs/domain/ScheduledJobRunHistory.java | 2 +- .../fineract/infrastructure/jobs/domain/SchedulerDetail.java | 2 +- .../reportmailingjob/domain/ReportMailingJob.java | 2 +- .../reportmailingjob/domain/ReportMailingJobConfiguration.java | 2 +- .../reportmailingjob/domain/ReportMailingJobRunHistory.java | 2 +- .../fineract/infrastructure/security/domain/TFAccessToken.java | 2 +- .../infrastructure/security/domain/TwoFactorConfiguration.java | 2 +- .../apache/fineract/infrastructure/sms/domain/SmsMessage.java | 2 +- .../fineract/infrastructure/survey/domain/Likelihood.java | 2 +- .../fineract/interoperation/domain/InteropIdentifier.java | 2 +- .../org/apache/fineract/mix/domain/MixTaxonomyMapping.java | 2 +- .../org/apache/fineract/notification/domain/Notification.java | 2 +- .../fineract/notification/domain/NotificationMapper.java | 2 +- .../java/org/apache/fineract/notification/domain/Topic.java | 2 +- .../apache/fineract/notification/domain/TopicSubscriber.java | 2 +- .../apache/fineract/organisation/holiday/domain/Holiday.java | 2 +- .../organisation/monetary/domain/ApplicationCurrency.java | 2 +- .../org/apache/fineract/organisation/office/domain/Office.java | 2 +- .../fineract/organisation/office/domain/OfficeTransaction.java | 2 +- .../organisation/office/domain/OrganisationCurrency.java | 2 +- .../provisioning/domain/LoanProductProvisionCriteria.java | 2 +- .../organisation/provisioning/domain/ProvisioningCategory.java | 2 +- .../organisation/provisioning/domain/ProvisioningCriteria.java | 2 +- .../provisioning/domain/ProvisioningCriteriaDefinition.java | 2 +- .../org/apache/fineract/organisation/staff/domain/Staff.java | 2 +- .../apache/fineract/organisation/teller/domain/Cashier.java | 2 +- .../organisation/teller/domain/CashierTransaction.java | 2 +- .../org/apache/fineract/organisation/teller/domain/Teller.java | 2 +- .../fineract/organisation/teller/domain/TellerTransaction.java | 2 +- .../fineract/organisation/workingdays/domain/WorkingDays.java | 2 +- .../fineract/portfolio/account/domain/AccountAssociations.java | 2 +- .../portfolio/account/domain/AccountTransferDetails.java | 2 +- .../account/domain/AccountTransferStandingInstruction.java | 2 +- .../portfolio/account/domain/AccountTransferTransaction.java | 2 +- .../org/apache/fineract/portfolio/address/domain/Address.java | 2 +- .../fineract/portfolio/address/domain/FieldConfiguration.java | 2 +- .../apache/fineract/portfolio/calendar/domain/Calendar.java | 2 +- .../fineract/portfolio/calendar/domain/CalendarHistory.java | 2 +- .../fineract/portfolio/calendar/domain/CalendarInstance.java | 2 +- .../org/apache/fineract/portfolio/charge/domain/Charge.java | 2 +- .../org/apache/fineract/portfolio/client/domain/Client.java | 2 +- .../apache/fineract/portfolio/client/domain/ClientAddress.java | 2 +- .../apache/fineract/portfolio/client/domain/ClientCharge.java | 2 +- .../fineract/portfolio/client/domain/ClientChargePaidBy.java | 2 +- .../fineract/portfolio/client/domain/ClientFamilyMembers.java | 2 +- .../fineract/portfolio/client/domain/ClientIdentifier.java | 2 +- .../fineract/portfolio/client/domain/ClientNonPerson.java | 2 +- .../fineract/portfolio/client/domain/ClientTransaction.java | 2 +- .../portfolio/client/domain/ClientTransferDetails.java | 2 +- .../fineract/portfolio/collateral/domain/LoanCollateral.java | 2 +- .../fineract/portfolio/floatingrates/domain/FloatingRate.java | 2 +- .../portfolio/floatingrates/domain/FloatingRatePeriod.java | 2 +- .../java/org/apache/fineract/portfolio/fund/domain/Fund.java | 2 +- .../java/org/apache/fineract/portfolio/group/domain/Group.java | 2 +- .../org/apache/fineract/portfolio/group/domain/GroupLevel.java | 2 +- .../org/apache/fineract/portfolio/group/domain/GroupRole.java | 2 +- .../portfolio/group/domain/StaffAssignmentHistory.java | 2 +- .../portfolio/interestratechart/domain/InterestIncentives.java | 2 +- .../portfolio/interestratechart/domain/InterestRateChart.java | 2 +- .../interestratechart/domain/InterestRateChartSlab.java | 2 +- .../org/apache/fineract/portfolio/loanaccount/domain/Loan.java | 2 +- .../fineract/portfolio/loanaccount/domain/LoanCharge.java | 2 +- .../portfolio/loanaccount/domain/LoanChargePaidBy.java | 2 +- .../portfolio/loanaccount/domain/LoanDisbursementDetails.java | 2 +- .../portfolio/loanaccount/domain/LoanInstallmentCharge.java | 2 +- .../domain/LoanInterestRecalcualtionAdditionalDetails.java | 2 +- .../loanaccount/domain/LoanInterestRecalculationDetails.java | 2 +- .../loanaccount/domain/LoanOfficerAssignmentHistory.java | 2 +- .../loanaccount/domain/LoanOverdueInstallmentCharge.java | 2 +- .../loanaccount/domain/LoanRepaymentScheduleInstallment.java | 2 +- .../domain/LoanRescheduleRequestToTermVariationMapping.java | 2 +- .../portfolio/loanaccount/domain/LoanTermVariations.java | 2 +- .../portfolio/loanaccount/domain/LoanTopupDetails.java | 2 +- .../portfolio/loanaccount/domain/LoanTrancheCharge.java | 2 +- .../loanaccount/domain/LoanTrancheDisbursementCharge.java | 2 +- .../fineract/portfolio/loanaccount/domain/LoanTransaction.java | 2 +- .../domain/LoanTransactionToRepaymentScheduleMapping.java | 2 +- .../portfolio/loanaccount/guarantor/domain/Guarantor.java | 2 +- .../loanaccount/guarantor/domain/GuarantorFundingDetails.java | 2 +- .../guarantor/domain/GuarantorFundingTransaction.java | 2 +- .../loanschedule/domain/LoanRepaymentScheduleHistory.java | 2 +- .../rescheduleloan/domain/LoanRescheduleRequest.java | 2 +- .../fineract/portfolio/loanproduct/domain/LoanProduct.java | 2 +- .../loanproduct/domain/LoanProductBorrowerCycleVariations.java | 2 +- .../loanproduct/domain/LoanProductConfigurableAttributes.java | 2 +- .../portfolio/loanproduct/domain/LoanProductFloatingRates.java | 2 +- .../loanproduct/domain/LoanProductGuaranteeDetails.java | 2 +- .../domain/LoanProductInterestRecalculationDetails.java | 2 +- .../domain/LoanProductVariableInstallmentConfig.java | 2 +- .../loanproduct/domain/LoanTransactionProcessingStrategy.java | 2 +- .../portfolio/loanproduct/productmix/domain/ProductMix.java | 2 +- .../portfolio/meeting/attendance/domain/ClientAttendance.java | 2 +- .../org/apache/fineract/portfolio/meeting/domain/Meeting.java | 2 +- .../java/org/apache/fineract/portfolio/note/domain/Note.java | 2 +- .../fineract/portfolio/paymentdetail/domain/PaymentDetail.java | 2 +- .../fineract/portfolio/paymenttype/domain/PaymentType.java | 2 +- .../java/org/apache/fineract/portfolio/rate/domain/Rate.java | 2 +- .../savings/domain/DepositAccountInterestIncentive.java | 2 +- .../savings/domain/DepositAccountInterestIncentives.java | 2 +- .../savings/domain/DepositAccountInterestRateChart.java | 2 +- .../savings/domain/DepositAccountInterestRateChartSlabs.java | 2 +- .../savings/domain/DepositAccountOnHoldTransaction.java | 2 +- .../savings/domain/DepositAccountRecurringDetail.java | 2 +- .../savings/domain/DepositAccountTermAndPreClosure.java | 2 +- .../savings/domain/DepositProductRecurringDetail.java | 2 +- .../savings/domain/DepositProductTermAndPreClosure.java | 2 +- .../savings/domain/RecurringDepositScheduleInstallment.java | 2 +- .../fineract/portfolio/savings/domain/SavingsAccount.java | 2 +- .../portfolio/savings/domain/SavingsAccountCharge.java | 2 +- .../portfolio/savings/domain/SavingsAccountChargePaidBy.java | 2 +- .../portfolio/savings/domain/SavingsAccountTransaction.java | 2 +- .../savings/domain/SavingsAccountTransactionTaxDetails.java | 2 +- .../savings/domain/SavingsOfficerAssignmentHistory.java | 2 +- .../fineract/portfolio/savings/domain/SavingsProduct.java | 2 +- .../portfolio/self/account/domain/SelfBeneficiariesTPT.java | 2 +- .../apache/fineract/portfolio/self/pockets/domain/Pocket.java | 2 +- .../portfolio/self/pockets/domain/PocketAccountMapping.java | 2 +- .../self/registration/domain/SelfServiceRegistration.java | 2 +- .../fineract/portfolio/shareaccounts/domain/ShareAccount.java | 2 +- .../portfolio/shareaccounts/domain/ShareAccountCharge.java | 2 +- .../shareaccounts/domain/ShareAccountChargePaidBy.java | 2 +- .../shareaccounts/domain/ShareAccountDividendDetails.java | 2 +- .../shareaccounts/domain/ShareAccountTransaction.java | 2 +- .../fineract/portfolio/shareproducts/domain/ShareProduct.java | 2 +- .../domain/ShareProductDividendPayOutDetails.java | 2 +- .../shareproducts/domain/ShareProductMarketPrice.java | 2 +- .../org/apache/fineract/portfolio/tax/domain/TaxComponent.java | 2 +- .../fineract/portfolio/tax/domain/TaxComponentHistory.java | 2 +- .../org/apache/fineract/portfolio/tax/domain/TaxGroup.java | 2 +- .../apache/fineract/portfolio/tax/domain/TaxGroupMappings.java | 2 +- .../main/java/org/apache/fineract/spm/domain/Component.java | 2 +- .../main/java/org/apache/fineract/spm/domain/LookupTable.java | 2 +- .../src/main/java/org/apache/fineract/spm/domain/Question.java | 2 +- .../src/main/java/org/apache/fineract/spm/domain/Response.java | 2 +- .../main/java/org/apache/fineract/spm/domain/Scorecard.java | 2 +- .../src/main/java/org/apache/fineract/spm/domain/Survey.java | 2 +- .../java/org/apache/fineract/template/domain/Template.java | 2 +- .../org/apache/fineract/template/domain/TemplateMapper.java | 2 +- .../org/apache/fineract/useradministration/domain/AppUser.java | 2 +- .../useradministration/domain/AppUserClientMapping.java | 2 +- .../useradministration/domain/AppUserPreviousPassword.java | 2 +- .../useradministration/domain/PasswordValidationPolicy.java | 2 +- .../apache/fineract/useradministration/domain/Permission.java | 2 +- .../org/apache/fineract/useradministration/domain/Role.java | 2 +- 190 files changed, 190 insertions(+), 191 deletions(-) diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/domain/GLClosure.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/domain/GLClosure.java index 7e029b8f2d7..9d7840d2bb3 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/domain/GLClosure.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/domain/GLClosure.java @@ -38,7 +38,7 @@ @Entity @Table(name = "acc_gl_closure", uniqueConstraints = { @UniqueConstraint(columnNames = { "office_id", "closing_date" }, name = "office_id_closing_date") }) -public class GLClosure extends AbstractAuditableCustom { +public class GLClosure extends AbstractAuditableCustom { @ManyToOne @JoinColumn(name = "office_id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/domain/FinancialActivityAccount.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/domain/FinancialActivityAccount.java index 6527993842e..ff1772456bf 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/domain/FinancialActivityAccount.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/domain/FinancialActivityAccount.java @@ -29,7 +29,7 @@ @Entity @Table(name = "acc_gl_financial_activity_account") -public class FinancialActivityAccount extends AbstractPersistableCustom { +public class FinancialActivityAccount extends AbstractPersistableCustom { @ManyToOne(fetch = FetchType.EAGER) @JoinColumn(name = "gl_account_id") diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/domain/GLAccount.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/domain/GLAccount.java index ceaa6817d0c..f864842da8c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/domain/GLAccount.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/domain/GLAccount.java @@ -39,7 +39,7 @@ @Entity @Table(name = "acc_gl_account", uniqueConstraints = { @UniqueConstraint(columnNames = { "gl_code" }, name = "acc_gl_code") }) -public class GLAccount extends AbstractPersistableCustom { +public class GLAccount extends AbstractPersistableCustom { @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "parent_id") diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/domain/TrialBalance.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/domain/TrialBalance.java index 8e9543a8e7d..9951ad666d3 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/domain/TrialBalance.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/domain/TrialBalance.java @@ -32,7 +32,7 @@ @Entity @Table(name = "m_trial_balance") -public class TrialBalance extends AbstractPersistableCustom { +public class TrialBalance extends AbstractPersistableCustom { @Column(name = "office_id", nullable = false) private Long officeId; diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/domain/JournalEntry.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/domain/JournalEntry.java index 666c47a348f..7a19501f203 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/domain/JournalEntry.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/domain/JournalEntry.java @@ -40,7 +40,7 @@ @Entity @Table(name = "acc_gl_journal_entry") -public class JournalEntry extends AbstractAuditableCustom { +public class JournalEntry extends AbstractAuditableCustom { @ManyToOne @JoinColumn(name = "office_id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/domain/ProductToGLAccountMapping.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/domain/ProductToGLAccountMapping.java index d67cdf3b974..14a9762e7c0 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/domain/ProductToGLAccountMapping.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/domain/ProductToGLAccountMapping.java @@ -32,7 +32,7 @@ @Entity @Table(name = "acc_product_mapping", uniqueConstraints = { @UniqueConstraint(columnNames = { "product_id", "product_type", "financial_account_type", "payment_type" }, name = "financial_action") }) -public class ProductToGLAccountMapping extends AbstractPersistableCustom { +public class ProductToGLAccountMapping extends AbstractPersistableCustom { @ManyToOne(optional=true) @JoinColumn(name = "gl_account_id") diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/provisioning/domain/LoanProductProvisioningEntry.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/provisioning/domain/LoanProductProvisioningEntry.java index f31474ae54f..7ca5588d60c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/provisioning/domain/LoanProductProvisioningEntry.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/provisioning/domain/LoanProductProvisioningEntry.java @@ -33,7 +33,7 @@ @Entity @Table(name = "m_loanproduct_provisioning_entry") -public class LoanProductProvisioningEntry extends AbstractPersistableCustom { +public class LoanProductProvisioningEntry extends AbstractPersistableCustom { @ManyToOne(optional = false) @JoinColumn(name = "history_id", referencedColumnName = "id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/provisioning/domain/ProvisioningEntry.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/provisioning/domain/ProvisioningEntry.java index ca83c1cd5b7..6ca065834de 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/provisioning/domain/ProvisioningEntry.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/provisioning/domain/ProvisioningEntry.java @@ -37,7 +37,7 @@ @Entity @Table(name = "m_provisioning_history") -public class ProvisioningEntry extends AbstractPersistableCustom { +public class ProvisioningEntry extends AbstractPersistableCustom { @Column(name = "journal_entry_created") private Boolean isJournalEntryCreated; diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/rule/domain/AccountingRule.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/rule/domain/AccountingRule.java index 143b24b47b9..c10b7cbcaad 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/rule/domain/AccountingRule.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/rule/domain/AccountingRule.java @@ -43,7 +43,7 @@ @Entity @Table(name = "acc_accounting_rule", uniqueConstraints = { @UniqueConstraint(columnNames = { "name" }, name = "accounting_rule_name_unique") }) -public class AccountingRule extends AbstractPersistableCustom { +public class AccountingRule extends AbstractPersistableCustom { @Column(name = "name", nullable = false, length = 500) private String name; diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/rule/domain/AccountingTagRule.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/rule/domain/AccountingTagRule.java index 54d343a5191..6af091e3d9b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/rule/domain/AccountingTagRule.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/rule/domain/AccountingTagRule.java @@ -30,7 +30,7 @@ @Entity @Table(name = "acc_rule_tags", uniqueConstraints = { @UniqueConstraint(columnNames = { "acc_rule_id", "tag_id", "acc_type_enum" }, name = "UNIQUE_ACCOUNT_RULE_TAGS") }) -public class AccountingTagRule extends AbstractPersistableCustom { +public class AccountingTagRule extends AbstractPersistableCustom { @ManyToOne @JoinColumn(name = "acc_rule_id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/adhocquery/domain/AdHoc.java b/fineract-provider/src/main/java/org/apache/fineract/adhocquery/domain/AdHoc.java index bb098a3fbbc..b92807a1859 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/adhocquery/domain/AdHoc.java +++ b/fineract-provider/src/main/java/org/apache/fineract/adhocquery/domain/AdHoc.java @@ -34,7 +34,7 @@ @Entity @Table(name = "m_adhoc") -public class AdHoc extends AbstractAuditableCustom { +public class AdHoc extends AbstractAuditableCustom { @Column(name = "name", length = 100) private String name; diff --git a/fineract-provider/src/main/java/org/apache/fineract/commands/domain/CommandSource.java b/fineract-provider/src/main/java/org/apache/fineract/commands/domain/CommandSource.java index 216d6b2ca8d..c6f843efb35 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/commands/domain/CommandSource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/commands/domain/CommandSource.java @@ -34,7 +34,7 @@ @Entity @Table(name = "m_portfolio_command_source") -public class CommandSource extends AbstractPersistableCustom { +public class CommandSource extends AbstractPersistableCustom { @Column(name = "action_name", nullable = true, length = 100) private String actionName; diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/domain/AccountNumberFormat.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/domain/AccountNumberFormat.java index 150d8a152fc..58d6a87f247 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/domain/AccountNumberFormat.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/domain/AccountNumberFormat.java @@ -28,7 +28,7 @@ @Entity @Table(name = AccountNumberFormatConstants.ACCOUNT_NUMBER_FORMAT_TABLE_NAME, uniqueConstraints = { @UniqueConstraint(columnNames = { AccountNumberFormatConstants.ACCOUNT_TYPE_ENUM_COLUMN_NAME }, name = AccountNumberFormatConstants.ACCOUNT_TYPE_UNIQUE_CONSTRAINT_NAME) }) -public class AccountNumberFormat extends AbstractPersistableCustom { +public class AccountNumberFormat extends AbstractPersistableCustom { @Column(name = AccountNumberFormatConstants.ACCOUNT_TYPE_ENUM_COLUMN_NAME, nullable = false) private Integer accountTypeEnum; diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/domain/ImportDocument.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/domain/ImportDocument.java index 4d17b331968..a8d8a7eb891 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/domain/ImportDocument.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/domain/ImportDocument.java @@ -34,7 +34,7 @@ @Entity @Table(name = "m_import_document") -public class ImportDocument extends AbstractPersistableCustom{ +public class ImportDocument extends AbstractPersistableCustom{ @OneToOne @JoinColumn(name = "document_id") diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/cache/domain/PlatformCache.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/cache/domain/PlatformCache.java index e695797f201..abc02eeaf33 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/cache/domain/PlatformCache.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/cache/domain/PlatformCache.java @@ -25,7 +25,7 @@ @Entity @Table(name = "c_cache") -public class PlatformCache extends AbstractPersistableCustom { +public class PlatformCache extends AbstractPersistableCustom { @Column(name = "cache_type_enum") private Integer cacheType; diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/domain/EmailCampaign.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/domain/EmailCampaign.java index 6529397a570..0230e678a83 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/domain/EmailCampaign.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/domain/EmailCampaign.java @@ -50,7 +50,7 @@ @Entity @Table(name = "scheduled_email_campaign") -public class EmailCampaign extends AbstractPersistableCustom { +public class EmailCampaign extends AbstractPersistableCustom { @Column(name = "campaign_name", nullable = false) private String campaignName; diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/domain/EmailConfiguration.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/domain/EmailConfiguration.java index 069c9864088..5f06f487f65 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/domain/EmailConfiguration.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/domain/EmailConfiguration.java @@ -25,7 +25,7 @@ @Entity @Table(name = "scheduled_email_configuration") -public class EmailConfiguration extends AbstractPersistableCustom { +public class EmailConfiguration extends AbstractPersistableCustom { @Column(name = "name", nullable = false) private String name; diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/domain/EmailMessage.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/domain/EmailMessage.java index bee7d23f7aa..ddea71721fc 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/domain/EmailMessage.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/domain/EmailMessage.java @@ -39,7 +39,7 @@ @Entity @Table(name = "scheduled_email_messages_outbound") -public class EmailMessage extends AbstractPersistableCustom { +public class EmailMessage extends AbstractPersistableCustom { @ManyToOne @JoinColumn(name = "group_id", nullable = true) diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/domain/SmsCampaign.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/domain/SmsCampaign.java index c72deaf8909..089fcc552bc 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/domain/SmsCampaign.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/domain/SmsCampaign.java @@ -54,7 +54,7 @@ @Entity @Table(name = "sms_campaign", uniqueConstraints = {@UniqueConstraint(columnNames = { "campaign_name" }, name = "campaign_name_UNIQUE")}) -public class SmsCampaign extends AbstractPersistableCustom { +public class SmsCampaign extends AbstractPersistableCustom { @Column(name = "campaign_name", nullable = false) private String campaignName; diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/domain/Code.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/domain/Code.java index d5728c571d0..18e1c3b8bed 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/domain/Code.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/domain/Code.java @@ -35,7 +35,7 @@ @Entity @Table(name = "m_code", uniqueConstraints = { @UniqueConstraint(columnNames = { "code_name" }, name = "code_name") }) -public class Code extends AbstractPersistableCustom { +public class Code extends AbstractPersistableCustom { @Column(name = "code_name", length = 100) private String name; diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/domain/CodeValue.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/domain/CodeValue.java index 3857ff14824..87fd6ccba6f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/domain/CodeValue.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/domain/CodeValue.java @@ -34,7 +34,7 @@ @Entity @Table(name = "m_code_value", uniqueConstraints = { @UniqueConstraint(columnNames = { "code_id", "code_value" }, name = "code_value_duplicate") }) -public class CodeValue extends AbstractPersistableCustom { +public class CodeValue extends AbstractPersistableCustom { @Column(name = "code_value", length = 100) private String label; diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/domain/ExternalService.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/domain/ExternalService.java index 22fc6cdec02..31b4ac66935 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/domain/ExternalService.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/domain/ExternalService.java @@ -26,7 +26,7 @@ @Entity @Table(name = "c_external_service", uniqueConstraints = { @UniqueConstraint(columnNames = { "name" }, name = "name_UNIQUE") }) -public class ExternalService extends AbstractPersistableCustom { +public class ExternalService extends AbstractPersistableCustom { @Column(name = "name", length = 50) private String name; diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/domain/GlobalConfigurationProperty.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/domain/GlobalConfigurationProperty.java index c7089ae9272..6dc15ef3415 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/domain/GlobalConfigurationProperty.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/domain/GlobalConfigurationProperty.java @@ -32,7 +32,7 @@ @Entity @Table(name = "c_configuration") -public class GlobalConfigurationProperty extends AbstractPersistableCustom { +public class GlobalConfigurationProperty extends AbstractPersistableCustom { @Column(name = "name", nullable = false) private String name; diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/domain/AbstractAuditableCustom.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/domain/AbstractAuditableCustom.java index 41a615f6006..db0cf988726 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/domain/AbstractAuditableCustom.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/domain/AbstractAuditableCustom.java @@ -18,7 +18,6 @@ */ package org.apache.fineract.infrastructure.core.domain; -import java.io.Serializable; import java.time.Instant; import java.util.Date; import java.util.Optional; @@ -46,7 +45,7 @@ * the type of the auditing type's identifier */ @MappedSuperclass -public abstract class AbstractAuditableCustom extends AbstractPersistableCustom implements Auditable { +public abstract class AbstractAuditableCustom extends AbstractPersistableCustom implements Auditable { private static final long serialVersionUID = 141481953116476081L; diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/domain/AbstractPersistableCustom.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/domain/AbstractPersistableCustom.java index 1670922f774..c7e36633a8b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/domain/AbstractPersistableCustom.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/domain/AbstractPersistableCustom.java @@ -38,7 +38,7 @@ * "we end up with issues on OpenJPA" (TODO clarify this). */ @MappedSuperclass -public abstract class AbstractPersistableCustom implements Persistable, Serializable { +public abstract class AbstractPersistableCustom implements Persistable, Serializable { private static final long serialVersionUID = 9181640245194392646L; diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/creditbureau/domain/CreditBureau.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/creditbureau/domain/CreditBureau.java index b9a4823dc76..b46d46a446c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/creditbureau/domain/CreditBureau.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/creditbureau/domain/CreditBureau.java @@ -29,7 +29,7 @@ @Entity @Table(name = "m_creditbureau") -public class CreditBureau extends AbstractPersistableCustom { +public class CreditBureau extends AbstractPersistableCustom { private String name; diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/creditbureau/domain/CreditBureauConfiguration.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/creditbureau/domain/CreditBureauConfiguration.java index 54e8a4d1585..d6f8191122f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/creditbureau/domain/CreditBureauConfiguration.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/creditbureau/domain/CreditBureauConfiguration.java @@ -28,7 +28,7 @@ @Entity @Table(name = "m_creditbureau_configuration") -public class CreditBureauConfiguration extends AbstractPersistableCustom { +public class CreditBureauConfiguration extends AbstractPersistableCustom { @Column(name = "configkey") private String configurationKey; diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/creditbureau/domain/CreditBureauLoanProductMapping.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/creditbureau/domain/CreditBureauLoanProductMapping.java index 91162ec9032..7e3e572059e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/creditbureau/domain/CreditBureauLoanProductMapping.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/creditbureau/domain/CreditBureauLoanProductMapping.java @@ -30,7 +30,7 @@ @Entity @Table(name = "m_creditbureau_loanproduct_mapping") -public class CreditBureauLoanProductMapping extends AbstractPersistableCustom { +public class CreditBureauLoanProductMapping extends AbstractPersistableCustom { @Column(name = "is_CreditCheck_Mandatory") private boolean isCreditCheckMandatory; diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/creditbureau/domain/OrganisationCreditBureau.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/creditbureau/domain/OrganisationCreditBureau.java index cbd01159da3..b60fc247da0 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/creditbureau/domain/OrganisationCreditBureau.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/creditbureau/domain/OrganisationCreditBureau.java @@ -30,7 +30,7 @@ @Entity @Table(name = "m_organisation_creditbureau") -public class OrganisationCreditBureau extends AbstractPersistableCustom { +public class OrganisationCreditBureau extends AbstractPersistableCustom { private String alias; diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/domain/EntityDatatableChecks.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/domain/EntityDatatableChecks.java index 07e81733d92..d3a55e135cd 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/domain/EntityDatatableChecks.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/domain/EntityDatatableChecks.java @@ -27,7 +27,7 @@ @Entity @Table(name = "m_entity_datatable_check") -public class EntityDatatableChecks extends AbstractPersistableCustom { +public class EntityDatatableChecks extends AbstractPersistableCustom { @Column(name = "application_table_name", nullable = false) private String entity; diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/domain/Report.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/domain/Report.java index b1500d86953..0b5894af90a 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/domain/Report.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/domain/Report.java @@ -43,7 +43,7 @@ @Entity @Table(name = "stretchy_report", uniqueConstraints = { @UniqueConstraint(columnNames = { "report_name" }, name = "unq_report_name") }) -public final class Report extends AbstractPersistableCustom { +public final class Report extends AbstractPersistableCustom { @Column(name = "report_name", nullable = false, unique = true) private String reportName; diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/domain/ReportParameter.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/domain/ReportParameter.java index 6a43ac374f8..80d212b733f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/domain/ReportParameter.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/domain/ReportParameter.java @@ -24,7 +24,7 @@ @Entity @Table(name = "stretchy_parameter") -public class ReportParameter extends AbstractPersistableCustom { +public class ReportParameter extends AbstractPersistableCustom { protected ReportParameter() { // diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/domain/ReportParameterUsage.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/domain/ReportParameterUsage.java index ba5ba2264d2..2924b94970f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/domain/ReportParameterUsage.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/domain/ReportParameterUsage.java @@ -27,7 +27,7 @@ @Entity @Table(name = "stretchy_report_parameter") -public final class ReportParameterUsage extends AbstractPersistableCustom { +public final class ReportParameterUsage extends AbstractPersistableCustom { @ManyToOne(optional = false) @JoinColumn(name = "report_id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/domain/Document.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/domain/Document.java index 022da29d045..c20db2a3584 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/domain/Document.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/domain/Document.java @@ -27,7 +27,7 @@ @Entity @Table(name = "m_document") -public class Document extends AbstractPersistableCustom { +public class Document extends AbstractPersistableCustom { @Column(name = "parent_entity_type", length = 50) private String parentEntityType; diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/domain/Image.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/domain/Image.java index 76c255b67fe..a7231e03c70 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/domain/Image.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/domain/Image.java @@ -25,7 +25,7 @@ @Entity @Table(name = "m_image") -public final class Image extends AbstractPersistableCustom { +public final class Image extends AbstractPersistableCustom { @Column(name = "location", length = 500) private String location; diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/domain/FineractEntityAccess.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/domain/FineractEntityAccess.java index 4293cc343f4..77c431c96c0 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/domain/FineractEntityAccess.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/domain/FineractEntityAccess.java @@ -32,7 +32,7 @@ @Entity @Table(name = "m_entity_to_entity_access") -public class FineractEntityAccess extends AbstractPersistableCustom { +public class FineractEntityAccess extends AbstractPersistableCustom { @Column(name = "entity_type", length = 50) private String entityType; diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/domain/FineractEntityRelation.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/domain/FineractEntityRelation.java index 23786d46abf..5a53ff8cb26 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/domain/FineractEntityRelation.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/domain/FineractEntityRelation.java @@ -29,7 +29,7 @@ @Entity @Table(name = "m_entity_relation") -public class FineractEntityRelation extends AbstractPersistableCustom { +public class FineractEntityRelation extends AbstractPersistableCustom { @OneToMany(cascade = CascadeType.ALL, mappedBy = "relationId", orphanRemoval = true) private Set fineractEntityToEntityMapping = new HashSet<>(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/domain/FineractEntityToEntityMapping.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/domain/FineractEntityToEntityMapping.java index e922ac8e111..e9ef0f329e2 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/domain/FineractEntityToEntityMapping.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/domain/FineractEntityToEntityMapping.java @@ -36,7 +36,7 @@ @Entity @Table(name = "m_entity_to_entity_mapping", uniqueConstraints = { @UniqueConstraint(columnNames = { "rel_id", "from_id", "to_id" }) }) -public class FineractEntityToEntityMapping extends AbstractPersistableCustom { +public class FineractEntityToEntityMapping extends AbstractPersistableCustom { @ManyToOne @JoinColumn(name = "rel_id") diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/gcm/domain/DeviceRegistration.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/gcm/domain/DeviceRegistration.java index d1bbd66855e..d82b3ecbfc1 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/gcm/domain/DeviceRegistration.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/gcm/domain/DeviceRegistration.java @@ -32,7 +32,7 @@ @Entity @Table(name = "client_device_registration") -public class DeviceRegistration extends AbstractPersistableCustom { +public class DeviceRegistration extends AbstractPersistableCustom { @OneToOne @JoinColumn(name = "client_id", nullable = false, unique = true) diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/hooks/domain/Hook.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/hooks/domain/Hook.java index ddedb56cf31..e65f8efe541 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/hooks/domain/Hook.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/hooks/domain/Hook.java @@ -47,7 +47,7 @@ @Entity @Table(name = "m_hook") -public class Hook extends AbstractAuditableCustom { +public class Hook extends AbstractAuditableCustom { @Column(name = "name", nullable = false, length = 100) private String name; diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/hooks/domain/HookConfiguration.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/hooks/domain/HookConfiguration.java index 456a01d5b97..88bd25d33ab 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/hooks/domain/HookConfiguration.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/hooks/domain/HookConfiguration.java @@ -27,7 +27,7 @@ @Entity @Table(name = "m_hook_configuration") -public class HookConfiguration extends AbstractPersistableCustom { +public class HookConfiguration extends AbstractPersistableCustom { @ManyToOne(optional = false) @JoinColumn(name = "hook_id", referencedColumnName = "id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/hooks/domain/HookResource.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/hooks/domain/HookResource.java index f52901c5f45..46f496fff63 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/hooks/domain/HookResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/hooks/domain/HookResource.java @@ -27,7 +27,7 @@ @Entity @Table(name = "m_hook_registered_events") -public class HookResource extends AbstractPersistableCustom { +public class HookResource extends AbstractPersistableCustom { @ManyToOne(optional = false) @JoinColumn(name = "hook_id", referencedColumnName = "id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/hooks/domain/HookTemplate.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/hooks/domain/HookTemplate.java index b208bf912d6..e92b9b2d75b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/hooks/domain/HookTemplate.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/hooks/domain/HookTemplate.java @@ -34,7 +34,7 @@ @Entity @Table(name = "m_hook_templates") -public class HookTemplate extends AbstractPersistableCustom { +public class HookTemplate extends AbstractPersistableCustom { @Column(name = "name", nullable = false, length = 100) private String name; diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/hooks/domain/Schema.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/hooks/domain/Schema.java index fd49263b5d8..3a387de6c7a 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/hooks/domain/Schema.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/hooks/domain/Schema.java @@ -27,7 +27,7 @@ @Entity @Table(name = "m_hook_schema") -public class Schema extends AbstractPersistableCustom { +public class Schema extends AbstractPersistableCustom { @ManyToOne(optional = false) @JoinColumn(name = "hook_template_id", referencedColumnName = "id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/domain/JobParameter.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/domain/JobParameter.java index 7871625bba4..515b648883e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/domain/JobParameter.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/domain/JobParameter.java @@ -26,7 +26,7 @@ @Entity @Table(name = "job_parameters") -public class JobParameter extends AbstractPersistableCustom { +public class JobParameter extends AbstractPersistableCustom { @Column(name = "job_id", nullable = false) private Long jobId; diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/domain/ScheduledJobDetail.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/domain/ScheduledJobDetail.java index cf01c860dff..9a2c92c25fe 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/domain/ScheduledJobDetail.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/domain/ScheduledJobDetail.java @@ -33,7 +33,7 @@ @Entity @Table(name = "job") -public class ScheduledJobDetail extends AbstractPersistableCustom { +public class ScheduledJobDetail extends AbstractPersistableCustom { @Column(name = "name") private String jobName; diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/domain/ScheduledJobRunHistory.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/domain/ScheduledJobRunHistory.java index 6df115c8430..202e24d8ced 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/domain/ScheduledJobRunHistory.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/domain/ScheduledJobRunHistory.java @@ -30,7 +30,7 @@ @Entity @Table(name = "job_run_history") -public class ScheduledJobRunHistory extends AbstractPersistableCustom { +public class ScheduledJobRunHistory extends AbstractPersistableCustom { @ManyToOne @JoinColumn(name = "job_id") diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/domain/SchedulerDetail.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/domain/SchedulerDetail.java index 43cd9ec1b1f..8f6598082ff 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/domain/SchedulerDetail.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/domain/SchedulerDetail.java @@ -25,7 +25,7 @@ @Entity @Table(name = "scheduler_detail") -public class SchedulerDetail extends AbstractPersistableCustom { +public class SchedulerDetail extends AbstractPersistableCustom { @Column(name = "execute_misfired_jobs") private boolean executeInstructionForMisfiredJobs; diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/domain/ReportMailingJob.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/domain/ReportMailingJob.java index 373dc184ee4..ce30f35063b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/domain/ReportMailingJob.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/domain/ReportMailingJob.java @@ -44,7 +44,7 @@ @Entity @Table(name = "m_report_mailing_job", uniqueConstraints = { @UniqueConstraint(columnNames = { "name" }, name = "unique_name") }) -public class ReportMailingJob extends AbstractAuditableCustom { +public class ReportMailingJob extends AbstractAuditableCustom { private static final long serialVersionUID = -2197602941230009227L; @Column(name = "name", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/domain/ReportMailingJobConfiguration.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/domain/ReportMailingJobConfiguration.java index 43d7cfe01d5..3170de26c0b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/domain/ReportMailingJobConfiguration.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/domain/ReportMailingJobConfiguration.java @@ -26,7 +26,7 @@ @Entity @Table(name = "m_report_mailing_job_configuration", uniqueConstraints = { @UniqueConstraint(columnNames = { "name" }, name = "unique_name") }) -public class ReportMailingJobConfiguration extends AbstractPersistableCustom { +public class ReportMailingJobConfiguration extends AbstractPersistableCustom { private static final long serialVersionUID = 3099279770861263184L; @Column(name = "name", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/domain/ReportMailingJobRunHistory.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/domain/ReportMailingJobRunHistory.java index 5b27b4df870..d801b6747e2 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/domain/ReportMailingJobRunHistory.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/reportmailingjob/domain/ReportMailingJobRunHistory.java @@ -31,7 +31,7 @@ @Entity @Table(name = "m_report_mailing_job_run_history") -public class ReportMailingJobRunHistory extends AbstractPersistableCustom { +public class ReportMailingJobRunHistory extends AbstractPersistableCustom { private static final long serialVersionUID = -3757370929988421076L; @ManyToOne diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/domain/TFAccessToken.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/domain/TFAccessToken.java index bdbeedb960f..8ae59be1510 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/domain/TFAccessToken.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/domain/TFAccessToken.java @@ -37,7 +37,7 @@ @Entity @Table(name = "twofactor_access_token", uniqueConstraints = {@UniqueConstraint(columnNames = { "token", "appuser_id" }, name = "token_appuser_UNIQUE")}) -public class TFAccessToken extends AbstractPersistableCustom { +public class TFAccessToken extends AbstractPersistableCustom { @Column(name = "token", nullable = false, length = 32) private String token; diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/domain/TwoFactorConfiguration.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/domain/TwoFactorConfiguration.java index ac39188ce55..1c9659689cd 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/domain/TwoFactorConfiguration.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/domain/TwoFactorConfiguration.java @@ -30,7 +30,7 @@ @Entity @Table(name = "twofactor_configuration", uniqueConstraints = {@UniqueConstraint(columnNames = { "name" }, name = "name_UNIQUE")}) -public class TwoFactorConfiguration extends AbstractPersistableCustom { +public class TwoFactorConfiguration extends AbstractPersistableCustom { @Column(name = "name", nullable = false, length = 32) private String name; diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/sms/domain/SmsMessage.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/sms/domain/SmsMessage.java index 416f273e8fa..f222f05b9ab 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/sms/domain/SmsMessage.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/sms/domain/SmsMessage.java @@ -40,7 +40,7 @@ @Entity @Table(name = "sms_messages_outbound") -public class SmsMessage extends AbstractPersistableCustom { +public class SmsMessage extends AbstractPersistableCustom { @Column(name = "external_id", nullable = true) private String externalId; diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/survey/domain/Likelihood.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/survey/domain/Likelihood.java index a9acab84ab1..93682961a2e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/survey/domain/Likelihood.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/survey/domain/Likelihood.java @@ -30,7 +30,7 @@ @Entity @Table(name = "ppi_likelihoods_ppi") -public final class Likelihood extends AbstractPersistableCustom { +public final class Likelihood extends AbstractPersistableCustom { @Column(name = "ppi_name", nullable = false) private String ppiName; diff --git a/fineract-provider/src/main/java/org/apache/fineract/interoperation/domain/InteropIdentifier.java b/fineract-provider/src/main/java/org/apache/fineract/interoperation/domain/InteropIdentifier.java index e2b87ee53c2..d129bcbb45e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/interoperation/domain/InteropIdentifier.java +++ b/fineract-provider/src/main/java/org/apache/fineract/interoperation/domain/InteropIdentifier.java @@ -38,7 +38,7 @@ @UniqueConstraint(name = "uk_hathor_identifier_account", columnNames = {"account_id", "type"}), @UniqueConstraint(name = "uk_hathor_identifier_value", columnNames = {"type", "a_value", "sub_value_or_type"}) }) -public class InteropIdentifier extends AbstractPersistableCustom { +public class InteropIdentifier extends AbstractPersistableCustom { @ManyToOne(optional = false) @JoinColumn(name = "account_id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/mix/domain/MixTaxonomyMapping.java b/fineract-provider/src/main/java/org/apache/fineract/mix/domain/MixTaxonomyMapping.java index 576c06fb683..87e1b033866 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/mix/domain/MixTaxonomyMapping.java +++ b/fineract-provider/src/main/java/org/apache/fineract/mix/domain/MixTaxonomyMapping.java @@ -27,7 +27,7 @@ @Entity @Table(name = "mix_taxonomy_mapping") -public class MixTaxonomyMapping extends AbstractPersistableCustom { +public class MixTaxonomyMapping extends AbstractPersistableCustom { @Column(name = "identifier") private String identifier; diff --git a/fineract-provider/src/main/java/org/apache/fineract/notification/domain/Notification.java b/fineract-provider/src/main/java/org/apache/fineract/notification/domain/Notification.java index d3bbfd41ff0..ccbc85bf143 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/notification/domain/Notification.java +++ b/fineract-provider/src/main/java/org/apache/fineract/notification/domain/Notification.java @@ -25,7 +25,7 @@ @Entity @Table(name = "notification_generator") -public class Notification extends AbstractPersistableCustom { +public class Notification extends AbstractPersistableCustom { @Column(name = "object_type") private String objectType; diff --git a/fineract-provider/src/main/java/org/apache/fineract/notification/domain/NotificationMapper.java b/fineract-provider/src/main/java/org/apache/fineract/notification/domain/NotificationMapper.java index c824b04ce79..64188a6211c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/notification/domain/NotificationMapper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/notification/domain/NotificationMapper.java @@ -29,7 +29,7 @@ @Entity @Table(name = "notification_mapper") -public class NotificationMapper extends AbstractPersistableCustom { +public class NotificationMapper extends AbstractPersistableCustom { @ManyToOne @JoinColumn(name = "notification_id") diff --git a/fineract-provider/src/main/java/org/apache/fineract/notification/domain/Topic.java b/fineract-provider/src/main/java/org/apache/fineract/notification/domain/Topic.java index e1582d3d4c1..081fa27b254 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/notification/domain/Topic.java +++ b/fineract-provider/src/main/java/org/apache/fineract/notification/domain/Topic.java @@ -26,7 +26,7 @@ @Entity @Table(name = "topic") -public class Topic extends AbstractPersistableCustom { +public class Topic extends AbstractPersistableCustom { @Column(name = "title", unique = true, nullable = false, length = 100) private String title; diff --git a/fineract-provider/src/main/java/org/apache/fineract/notification/domain/TopicSubscriber.java b/fineract-provider/src/main/java/org/apache/fineract/notification/domain/TopicSubscriber.java index 6871470f167..cf58ceb5978 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/notification/domain/TopicSubscriber.java +++ b/fineract-provider/src/main/java/org/apache/fineract/notification/domain/TopicSubscriber.java @@ -29,7 +29,7 @@ @Entity @Table(name = "topic_subscriber") -public class TopicSubscriber extends AbstractPersistableCustom { +public class TopicSubscriber extends AbstractPersistableCustom { @ManyToOne @JoinColumn(name = "topic_id") diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/holiday/domain/Holiday.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/holiday/domain/Holiday.java index 21b57791328..cfea7c7b801 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/holiday/domain/Holiday.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/holiday/domain/Holiday.java @@ -57,7 +57,7 @@ @Entity @Table(name = "m_holiday", uniqueConstraints = { @UniqueConstraint(columnNames = { "name" }, name = "holiday_name") }) -public class Holiday extends AbstractPersistableCustom { +public class Holiday extends AbstractPersistableCustom { @Column(name = "name", unique = true, nullable = false, length = 100) private String name; diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/monetary/domain/ApplicationCurrency.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/monetary/domain/ApplicationCurrency.java index c80ea204dfe..4308f282910 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/monetary/domain/ApplicationCurrency.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/monetary/domain/ApplicationCurrency.java @@ -27,7 +27,7 @@ @Entity @Table(name = "m_currency") -public class ApplicationCurrency extends AbstractPersistableCustom { +public class ApplicationCurrency extends AbstractPersistableCustom { @Column(name = "code", nullable = false, length = 3) private String code; diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/office/domain/Office.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/office/domain/Office.java index c3cdac67ce5..8b7ca054745 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/office/domain/Office.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/office/domain/Office.java @@ -44,7 +44,7 @@ @Entity @Table(name = "m_office", uniqueConstraints = { @UniqueConstraint(columnNames = { "name" }, name = "name_org"), @UniqueConstraint(columnNames = { "external_id" }, name = "externalid_org") }) -public class Office extends AbstractPersistableCustom implements Serializable { +public class Office extends AbstractPersistableCustom implements Serializable { @OneToMany(fetch = FetchType.LAZY) @JoinColumn(name = "parent_id") diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/office/domain/OfficeTransaction.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/office/domain/OfficeTransaction.java index 322bb3d8a5f..362f0defa82 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/office/domain/OfficeTransaction.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/office/domain/OfficeTransaction.java @@ -37,7 +37,7 @@ @Entity @Table(name = "m_office_transaction") -public class OfficeTransaction extends AbstractPersistableCustom { +public class OfficeTransaction extends AbstractPersistableCustom { @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "from_office_id") diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/office/domain/OrganisationCurrency.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/office/domain/OrganisationCurrency.java index dd1115d0e23..f236fa40083 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/office/domain/OrganisationCurrency.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/office/domain/OrganisationCurrency.java @@ -29,7 +29,7 @@ */ @Entity @Table(name = "m_organisation_currency") -public class OrganisationCurrency extends AbstractPersistableCustom { +public class OrganisationCurrency extends AbstractPersistableCustom { @Column(name = "code", nullable = false, length = 3) private String code; diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/domain/LoanProductProvisionCriteria.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/domain/LoanProductProvisionCriteria.java index a3f3b079245..3d5fc91f1ae 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/domain/LoanProductProvisionCriteria.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/domain/LoanProductProvisionCriteria.java @@ -28,7 +28,7 @@ @Entity @Table(name = "m_loanproduct_provisioning_mapping", uniqueConstraints = { @UniqueConstraint(columnNames = { "product_id" }, name = "product_id") }) -public class LoanProductProvisionCriteria extends AbstractPersistableCustom { +public class LoanProductProvisionCriteria extends AbstractPersistableCustom { @ManyToOne(optional = false) @JoinColumn(name = "criteria_id", referencedColumnName = "id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/domain/ProvisioningCategory.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/domain/ProvisioningCategory.java index 5829fec2163..9653b9af704 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/domain/ProvisioningCategory.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/domain/ProvisioningCategory.java @@ -29,7 +29,7 @@ @Entity @Table(name = "m_provision_category", uniqueConstraints = { @UniqueConstraint(columnNames = { "category_name" }, name = "category_name") }) -public class ProvisioningCategory extends AbstractPersistableCustom { +public class ProvisioningCategory extends AbstractPersistableCustom { @Column(name = "category_name", nullable = false, unique = true) private String categoryName; diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/domain/ProvisioningCriteria.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/domain/ProvisioningCriteria.java index 17e5c045f17..e9a1555bd9b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/domain/ProvisioningCriteria.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/domain/ProvisioningCriteria.java @@ -42,7 +42,7 @@ @Entity @Table(name = "m_provisioning_criteria", uniqueConstraints = { @UniqueConstraint(columnNames = { "criteria_name" }, name = "criteria_name") }) -public class ProvisioningCriteria extends AbstractAuditableCustom { +public class ProvisioningCriteria extends AbstractAuditableCustom { @Column(name = "criteria_name", nullable = false) private String criteriaName; diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/domain/ProvisioningCriteriaDefinition.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/domain/ProvisioningCriteriaDefinition.java index 0e0ba7e280f..eaa7bf2751c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/domain/ProvisioningCriteriaDefinition.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/domain/ProvisioningCriteriaDefinition.java @@ -29,7 +29,7 @@ @Entity @Table(name = "m_provisioning_criteria_definition") -public class ProvisioningCriteriaDefinition extends AbstractPersistableCustom { +public class ProvisioningCriteriaDefinition extends AbstractPersistableCustom { @ManyToOne(optional = false) @JoinColumn(name = "criteria_id", referencedColumnName = "id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/staff/domain/Staff.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/staff/domain/Staff.java index ce1b562ce30..ba95126fa43 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/staff/domain/Staff.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/staff/domain/Staff.java @@ -42,7 +42,7 @@ @Table(name = "m_staff", uniqueConstraints = { @UniqueConstraint(columnNames = { "display_name" }, name = "display_name"), @UniqueConstraint(columnNames = { "external_id" }, name = "external_id_UNIQUE"), @UniqueConstraint(columnNames = { "mobile_no" }, name = "mobile_no_UNIQUE") }) -public class Staff extends AbstractPersistableCustom { +public class Staff extends AbstractPersistableCustom { @Column(name = "firstname", length = 50) private String firstname; diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/domain/Cashier.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/domain/Cashier.java index adb0a41cadf..af2d2585ab5 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/domain/Cashier.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/domain/Cashier.java @@ -48,7 +48,7 @@ @Entity @Table(name = "m_cashiers", uniqueConstraints = { @UniqueConstraint(name = "ux_cashiers_staff_teller", columnNames = { "staff_id", "teller_id" }) }) -public class Cashier extends AbstractPersistableCustom { +public class Cashier extends AbstractPersistableCustom { // ManyToOne(fetch = FetchType.LAZY) // JoinColumn(name = "office_id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/domain/CashierTransaction.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/domain/CashierTransaction.java index a5b07275f51..d3591046534 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/domain/CashierTransaction.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/domain/CashierTransaction.java @@ -39,7 +39,7 @@ @Entity @Table(name = "m_cashier_transactions") -public class CashierTransaction extends AbstractPersistableCustom { +public class CashierTransaction extends AbstractPersistableCustom { @Transient private Office office; diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/domain/Teller.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/domain/Teller.java index ac55c8f6c38..9e9940c903c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/domain/Teller.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/domain/Teller.java @@ -43,7 +43,7 @@ @Table(name = "m_tellers", uniqueConstraints = { @UniqueConstraint(name = "ux_tellers_name", columnNames = {"name"}) }) -public class Teller extends AbstractPersistableCustom { +public class Teller extends AbstractPersistableCustom { @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "office_id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/domain/TellerTransaction.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/domain/TellerTransaction.java index f22a23f9525..255447d9e5f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/domain/TellerTransaction.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/domain/TellerTransaction.java @@ -33,7 +33,7 @@ @Entity @Table(name = "m_teller_transactions") -public class TellerTransaction extends AbstractPersistableCustom { +public class TellerTransaction extends AbstractPersistableCustom { @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "office_id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/workingdays/domain/WorkingDays.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/workingdays/domain/WorkingDays.java index 18ec0d117e0..132cb719636 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/workingdays/domain/WorkingDays.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/workingdays/domain/WorkingDays.java @@ -29,7 +29,7 @@ @Entity @Table(name = "m_working_days") -public class WorkingDays extends AbstractPersistableCustom { +public class WorkingDays extends AbstractPersistableCustom { @Column(name = "recurrence", length = 100, nullable = true) private String recurrence; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/domain/AccountAssociations.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/domain/AccountAssociations.java index f9ebb6d975e..c5d1c1e964a 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/domain/AccountAssociations.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/domain/AccountAssociations.java @@ -29,7 +29,7 @@ @Entity @Table(name = "m_portfolio_account_associations") -public class AccountAssociations extends AbstractPersistableCustom { +public class AccountAssociations extends AbstractPersistableCustom { @ManyToOne @JoinColumn(name = "loan_account_id", nullable = true) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/domain/AccountTransferDetails.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/domain/AccountTransferDetails.java index bb02bb4329b..9d65a904d00 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/domain/AccountTransferDetails.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/domain/AccountTransferDetails.java @@ -37,7 +37,7 @@ @Entity @Table(name = "m_account_transfer_details") -public class AccountTransferDetails extends AbstractPersistableCustom { +public class AccountTransferDetails extends AbstractPersistableCustom { @ManyToOne @JoinColumn(name = "from_office_id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/domain/AccountTransferStandingInstruction.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/domain/AccountTransferStandingInstruction.java index d5b28b7e215..5be569b9131 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/domain/AccountTransferStandingInstruction.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/domain/AccountTransferStandingInstruction.java @@ -56,7 +56,7 @@ @Entity @Table(name = "m_account_transfer_standing_instructions", uniqueConstraints = { @UniqueConstraint(columnNames = { "name" }, name = "name") }) -public class AccountTransferStandingInstruction extends AbstractPersistableCustom { +public class AccountTransferStandingInstruction extends AbstractPersistableCustom { @ManyToOne @JoinColumn(name = "account_transfer_details_id", nullable = true) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/domain/AccountTransferTransaction.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/domain/AccountTransferTransaction.java index 36f6c365941..4ecb4a23efa 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/domain/AccountTransferTransaction.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/domain/AccountTransferTransaction.java @@ -37,7 +37,7 @@ @Entity @Table(name = "m_account_transfer_transaction") -public class AccountTransferTransaction extends AbstractPersistableCustom { +public class AccountTransferTransaction extends AbstractPersistableCustom { @ManyToOne @JoinColumn(name = "account_transfer_details_id", nullable = true) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/address/domain/Address.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/address/domain/Address.java index c8b7f2dc66a..53d2aab2746 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/address/domain/Address.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/address/domain/Address.java @@ -40,7 +40,7 @@ @Entity @Table(name = "m_address") -public class Address extends AbstractPersistableCustom { +public class Address extends AbstractPersistableCustom { /* * @OneToMany(mappedBy = "address", cascade = CascadeType.ALL) private diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/address/domain/FieldConfiguration.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/address/domain/FieldConfiguration.java index 2b9bd9504c1..0e21768481f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/address/domain/FieldConfiguration.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/address/domain/FieldConfiguration.java @@ -25,7 +25,7 @@ @Entity @Table(name = "m_field_configuration") -public class FieldConfiguration extends AbstractPersistableCustom { +public class FieldConfiguration extends AbstractPersistableCustom { private String entity; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/domain/Calendar.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/domain/Calendar.java index dd67d649758..c938df6aa4e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/domain/Calendar.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/domain/Calendar.java @@ -53,7 +53,7 @@ @Entity @Table(name = "m_calendar") -public class Calendar extends AbstractAuditableCustom { +public class Calendar extends AbstractAuditableCustom { @Column(name = "title", length = 50, nullable = false) private String title; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/domain/CalendarHistory.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/domain/CalendarHistory.java index b67a57c6f7b..612718ab2b1 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/domain/CalendarHistory.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/domain/CalendarHistory.java @@ -31,7 +31,7 @@ @Entity @Table(name = "m_calendar_history") -public class CalendarHistory extends AbstractPersistableCustom { +public class CalendarHistory extends AbstractPersistableCustom { @ManyToOne(optional = false) @JoinColumn(name = "calendar_id", referencedColumnName = "id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/domain/CalendarInstance.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/domain/CalendarInstance.java index 923c23928c7..d20428aae73 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/domain/CalendarInstance.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/domain/CalendarInstance.java @@ -28,7 +28,7 @@ @Entity @Table(name = "m_calendar_instance") -public class CalendarInstance extends AbstractPersistableCustom { +public class CalendarInstance extends AbstractPersistableCustom { @ManyToOne(cascade = CascadeType.PERSIST) @JoinColumn(name = "calendar_id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/domain/Charge.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/domain/Charge.java index 33316a2cd92..7be7908969a 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/domain/Charge.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/domain/Charge.java @@ -52,7 +52,7 @@ @Entity @Table(name = "m_charge", uniqueConstraints = { @UniqueConstraint(columnNames = { "name" }, name = "name") }) -public class Charge extends AbstractPersistableCustom { +public class Charge extends AbstractPersistableCustom { @Column(name = "name", length = 100) private String name; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/Client.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/Client.java index d9871096016..758a468bee1 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/Client.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/Client.java @@ -60,7 +60,7 @@ @Entity @Table(name = "m_client", uniqueConstraints = { @UniqueConstraint(columnNames = { "account_no" }, name = "account_no_UNIQUE"), // @UniqueConstraint(columnNames = { "mobile_no" }, name = "mobile_no_UNIQUE") }) -public final class Client extends AbstractPersistableCustom { +public final class Client extends AbstractPersistableCustom { @Column(name = "account_no", length = 20, unique = true, nullable = false) private String accountNumber; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientAddress.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientAddress.java index 96ab3fe624a..f1f1fb2dd35 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientAddress.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientAddress.java @@ -29,7 +29,7 @@ @Entity @Table(name = "m_client_address") -public class ClientAddress extends AbstractPersistableCustom { +public class ClientAddress extends AbstractPersistableCustom { @ManyToOne private Client client; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientCharge.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientCharge.java index 12fa98dd96c..5d8f6a9d7e4 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientCharge.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientCharge.java @@ -41,7 +41,7 @@ @Entity @Table(name = "m_client_charge") -public class ClientCharge extends AbstractPersistableCustom { +public class ClientCharge extends AbstractPersistableCustom { @ManyToOne(optional = false) @JoinColumn(name = "client_id", referencedColumnName = "id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientChargePaidBy.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientChargePaidBy.java index 4f5b9685ad0..a50ff8f5ede 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientChargePaidBy.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientChargePaidBy.java @@ -28,7 +28,7 @@ @Entity @Table(name = "m_client_charge_paid_by") -public class ClientChargePaidBy extends AbstractPersistableCustom { +public class ClientChargePaidBy extends AbstractPersistableCustom { @ManyToOne @JoinColumn(name = "client_transaction_id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientFamilyMembers.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientFamilyMembers.java index 7e63a26b5bc..2ff4288fb4b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientFamilyMembers.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientFamilyMembers.java @@ -32,7 +32,7 @@ @Entity @Table(name = "m_family_members") -public class ClientFamilyMembers extends AbstractPersistableCustom { +public class ClientFamilyMembers extends AbstractPersistableCustom { @ManyToOne @JoinColumn(name="client_id") diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientIdentifier.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientIdentifier.java index 7f69ef45d0e..99829c21e13 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientIdentifier.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientIdentifier.java @@ -36,7 +36,7 @@ @Table(name = "m_client_identifier", uniqueConstraints = { @UniqueConstraint(columnNames = { "document_type_id", "document_key" }, name = "unique_identifier_key"), @UniqueConstraint(columnNames = { "client_id", "document_key", "active" }, name = "unique_active_client_identifier")}) -public class ClientIdentifier extends AbstractAuditableCustom { +public class ClientIdentifier extends AbstractAuditableCustom { @ManyToOne @JoinColumn(name = "client_id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientNonPerson.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientNonPerson.java index e67f9295616..0ef1b517df9 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientNonPerson.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientNonPerson.java @@ -43,7 +43,7 @@ @Entity @Table(name = "m_client_non_person") -public class ClientNonPerson extends AbstractPersistableCustom { +public class ClientNonPerson extends AbstractPersistableCustom { @OneToOne(optional = false) @JoinColumn(name = "client_id", referencedColumnName = "id", nullable = false, unique = true) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientTransaction.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientTransaction.java index ed3dcd1b6b5..91d9ffd18d4 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientTransaction.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientTransaction.java @@ -52,7 +52,7 @@ @Entity @Table(name = "m_client_transaction", uniqueConstraints = { @UniqueConstraint(columnNames = { "external_id" }, name = "external_id") }) -public class ClientTransaction extends AbstractPersistableCustom { +public class ClientTransaction extends AbstractPersistableCustom { @ManyToOne(optional = false) @JoinColumn(name = "client_id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientTransferDetails.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientTransferDetails.java index 3245fc623a5..f04fc51e2de 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientTransferDetails.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientTransferDetails.java @@ -30,7 +30,7 @@ @SuppressWarnings("serial") @Entity @Table(name = "m_client_transfer_details") -public class ClientTransferDetails extends AbstractPersistableCustom { +public class ClientTransferDetails extends AbstractPersistableCustom { @Column(name = "client_id", length = 20, unique = true, nullable = false) private Long clientId; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/domain/LoanCollateral.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/domain/LoanCollateral.java index de3802af806..22582c8efa3 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/domain/LoanCollateral.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/domain/LoanCollateral.java @@ -37,7 +37,7 @@ @Entity @Table(name = "m_loan_collateral") -public class LoanCollateral extends AbstractPersistableCustom { +public class LoanCollateral extends AbstractPersistableCustom { @ManyToOne(optional = false) @JoinColumn(name = "loan_id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/floatingrates/domain/FloatingRate.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/floatingrates/domain/FloatingRate.java index e258c6a5724..35fff2d56d3 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/floatingrates/domain/FloatingRate.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/floatingrates/domain/FloatingRate.java @@ -50,7 +50,7 @@ @Entity @Table(name = "m_floating_rates", uniqueConstraints = { @UniqueConstraint(columnNames = { "name" }, name = "unq_name") }) -public class FloatingRate extends AbstractPersistableCustom { +public class FloatingRate extends AbstractPersistableCustom { @Column(name = "name", length = 200, unique = true, nullable = false) private String name; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/floatingrates/domain/FloatingRatePeriod.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/floatingrates/domain/FloatingRatePeriod.java index 08570a38139..bf696b0c636 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/floatingrates/domain/FloatingRatePeriod.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/floatingrates/domain/FloatingRatePeriod.java @@ -35,7 +35,7 @@ @Entity @Table(name = "m_floating_rates_periods") -public class FloatingRatePeriod extends AbstractPersistableCustom { +public class FloatingRatePeriod extends AbstractPersistableCustom { @ManyToOne @JoinColumn(name = "floating_rates_id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/fund/domain/Fund.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/fund/domain/Fund.java index d95641a27eb..a3eaa0eb77e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/fund/domain/Fund.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/fund/domain/Fund.java @@ -31,7 +31,7 @@ @Entity @Table(name = "m_fund", uniqueConstraints = { @UniqueConstraint(columnNames = { "name" }, name = "fund_name_org"), @UniqueConstraint(columnNames = { "external_id" }, name = "fund_externalid_org") }) -public class Fund extends AbstractPersistableCustom { +public class Fund extends AbstractPersistableCustom { @Column(name = "name") private String name; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/domain/Group.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/domain/Group.java index d456e3f0c3b..9a141456672 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/domain/Group.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/domain/Group.java @@ -63,7 +63,7 @@ @Entity @Table(name = "m_group") -public final class Group extends AbstractPersistableCustom { +public final class Group extends AbstractPersistableCustom { @Column(name = "external_id", length = 100, unique = true) private String externalId; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/domain/GroupLevel.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/domain/GroupLevel.java index f39dfa0f2eb..35b9cf0e100 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/domain/GroupLevel.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/domain/GroupLevel.java @@ -25,7 +25,7 @@ @Entity @Table(name = "m_group_level") -public class GroupLevel extends AbstractPersistableCustom { +public class GroupLevel extends AbstractPersistableCustom { @Column(name = "parent_id") private Long parentId; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/domain/GroupRole.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/domain/GroupRole.java index 6a61c088503..c2a2f9bf317 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/domain/GroupRole.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/domain/GroupRole.java @@ -33,7 +33,7 @@ @Entity @Table(name = "m_group_roles") -public class GroupRole extends AbstractPersistableCustom { +public class GroupRole extends AbstractPersistableCustom { @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "group_id") diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/domain/StaffAssignmentHistory.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/domain/StaffAssignmentHistory.java index 261e4a94eb1..11b85758b66 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/domain/StaffAssignmentHistory.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/domain/StaffAssignmentHistory.java @@ -33,7 +33,7 @@ @Entity @Table(name = "m_staff_assignment_history") -public class StaffAssignmentHistory extends AbstractAuditableCustom { +public class StaffAssignmentHistory extends AbstractAuditableCustom { @ManyToOne @JoinColumn(name = "centre_id", nullable = true) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/domain/InterestIncentives.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/domain/InterestIncentives.java index 79199519476..937095f2a5f 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/domain/InterestIncentives.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/domain/InterestIncentives.java @@ -31,7 +31,7 @@ @Entity @Table(name = "m_interest_incentives") -public class InterestIncentives extends AbstractPersistableCustom { +public class InterestIncentives extends AbstractPersistableCustom { @ManyToOne @JoinColumn(name = "interest_rate_slab_id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/domain/InterestRateChart.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/domain/InterestRateChart.java index 06b084ce481..970f8478ec6 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/domain/InterestRateChart.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/domain/InterestRateChart.java @@ -58,7 +58,7 @@ @Entity @Table(name = "m_interest_rate_chart") -public class InterestRateChart extends AbstractPersistableCustom { +public class InterestRateChart extends AbstractPersistableCustom { @Embedded private InterestRateChartFields chartFields; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/domain/InterestRateChartSlab.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/domain/InterestRateChartSlab.java index 30a610d0272..2632adba148 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/domain/InterestRateChartSlab.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/domain/InterestRateChartSlab.java @@ -56,7 +56,7 @@ @Entity @Table(name = "m_interest_rate_slab") -public class InterestRateChartSlab extends AbstractPersistableCustom { +public class InterestRateChartSlab extends AbstractPersistableCustom { @Embedded private InterestRateChartSlabFields slabFields; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java index 5a979c8fd8b..eff1c247851 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java @@ -147,7 +147,7 @@ @Component @Table(name = "m_loan", uniqueConstraints = { @UniqueConstraint(columnNames = { "account_no" }, name = "loan_account_no_UNIQUE"), @UniqueConstraint(columnNames = { "external_id" }, name = "loan_externalid_UNIQUE") }) -public class Loan extends AbstractPersistableCustom { +public class Loan extends AbstractPersistableCustom { /** Disable optimistic locking till batch jobs failures can be fixed **/ @Version diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanCharge.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanCharge.java index f2ec60b2f26..b7b952698f6 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanCharge.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanCharge.java @@ -56,7 +56,7 @@ @Entity @Table(name = "m_loan_charge") -public class LoanCharge extends AbstractPersistableCustom { +public class LoanCharge extends AbstractPersistableCustom { @ManyToOne(optional = false) @JoinColumn(name = "loan_id", referencedColumnName = "id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanChargePaidBy.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanChargePaidBy.java index 51671b7c384..083d2c54b6a 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanChargePaidBy.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanChargePaidBy.java @@ -29,7 +29,7 @@ @Entity @Table(name = "m_loan_charge_paid_by") -public class LoanChargePaidBy extends AbstractPersistableCustom { +public class LoanChargePaidBy extends AbstractPersistableCustom { @ManyToOne @JoinColumn(name = "loan_transaction_id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanDisbursementDetails.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanDisbursementDetails.java index 3ab27b30707..be707f46705 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanDisbursementDetails.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanDisbursementDetails.java @@ -34,7 +34,7 @@ @Entity @Table(name = "m_loan_disbursement_detail") -public class LoanDisbursementDetails extends AbstractPersistableCustom { +public class LoanDisbursementDetails extends AbstractPersistableCustom { @ManyToOne @JoinColumn(name = "loan_id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanInstallmentCharge.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanInstallmentCharge.java index 7ff2919ba33..696423d00ee 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanInstallmentCharge.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanInstallmentCharge.java @@ -30,7 +30,7 @@ @Entity @Table(name = "m_loan_installment_charge") -public class LoanInstallmentCharge extends AbstractPersistableCustom implements Comparable { +public class LoanInstallmentCharge extends AbstractPersistableCustom implements Comparable { @ManyToOne(optional = false) @JoinColumn(name = "loan_charge_id", referencedColumnName = "id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanInterestRecalcualtionAdditionalDetails.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanInterestRecalcualtionAdditionalDetails.java index a4b257b68ad..25d67e11c60 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanInterestRecalcualtionAdditionalDetails.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanInterestRecalcualtionAdditionalDetails.java @@ -30,7 +30,7 @@ @Entity @Table(name = "m_loan_interest_recalculation_additional_details") -public class LoanInterestRecalcualtionAdditionalDetails extends AbstractPersistableCustom { +public class LoanInterestRecalcualtionAdditionalDetails extends AbstractPersistableCustom { @Temporal(TemporalType.DATE) @Column(name = "effective_date") diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanInterestRecalculationDetails.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanInterestRecalculationDetails.java index 662137b2cc4..1d1f5f6a282 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanInterestRecalculationDetails.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanInterestRecalculationDetails.java @@ -38,7 +38,7 @@ @Entity @Table(name = "m_loan_recalculation_details") -public class LoanInterestRecalculationDetails extends AbstractPersistableCustom { +public class LoanInterestRecalculationDetails extends AbstractPersistableCustom { @OneToOne @JoinColumn(name = "loan_id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanOfficerAssignmentHistory.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanOfficerAssignmentHistory.java index 92510a5603b..779ef44e4b1 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanOfficerAssignmentHistory.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanOfficerAssignmentHistory.java @@ -34,7 +34,7 @@ @Entity @Table(name = "m_loan_officer_assignment_history") -public class LoanOfficerAssignmentHistory extends AbstractAuditableCustom { +public class LoanOfficerAssignmentHistory extends AbstractAuditableCustom { @ManyToOne @JoinColumn(name = "loan_id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanOverdueInstallmentCharge.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanOverdueInstallmentCharge.java index 8ca59c4475f..cb3d2446cd8 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanOverdueInstallmentCharge.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanOverdueInstallmentCharge.java @@ -27,7 +27,7 @@ @Entity @Table(name = "m_loan_overdue_installment_charge") -public class LoanOverdueInstallmentCharge extends AbstractPersistableCustom { +public class LoanOverdueInstallmentCharge extends AbstractPersistableCustom { @ManyToOne(optional = false) @JoinColumn(name = "loan_charge_id", referencedColumnName = "id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanRepaymentScheduleInstallment.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanRepaymentScheduleInstallment.java index 0b50e389c1e..3555cbf716c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanRepaymentScheduleInstallment.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanRepaymentScheduleInstallment.java @@ -41,7 +41,7 @@ @Entity @Table(name = "m_loan_repayment_schedule") -public final class LoanRepaymentScheduleInstallment extends AbstractAuditableCustom implements Comparable { +public final class LoanRepaymentScheduleInstallment extends AbstractAuditableCustom implements Comparable { @ManyToOne(optional = false) @JoinColumn(name = "loan_id", referencedColumnName="id") diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanRescheduleRequestToTermVariationMapping.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanRescheduleRequestToTermVariationMapping.java index 676ae5a31fa..d3798bb93e1 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanRescheduleRequestToTermVariationMapping.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanRescheduleRequestToTermVariationMapping.java @@ -27,7 +27,7 @@ @Entity @Table(name="m_loan_reschedule_request_term_variations_mapping") -public class LoanRescheduleRequestToTermVariationMapping extends AbstractPersistableCustom { +public class LoanRescheduleRequestToTermVariationMapping extends AbstractPersistableCustom { @ManyToOne(optional = false, cascade = CascadeType.PERSIST) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTermVariations.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTermVariations.java index 801ae4cb920..8c3408c34a4 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTermVariations.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTermVariations.java @@ -37,7 +37,7 @@ @Entity @Table(name = "m_loan_term_variations") -public class LoanTermVariations extends AbstractPersistableCustom { +public class LoanTermVariations extends AbstractPersistableCustom { @ManyToOne(optional = false) @JoinColumn(name = "loan_id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTopupDetails.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTopupDetails.java index fe20bf9b0cf..12a670eaf36 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTopupDetails.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTopupDetails.java @@ -28,7 +28,7 @@ @Entity @Table(name = "m_loan_topup") -public class LoanTopupDetails extends AbstractPersistableCustom { +public class LoanTopupDetails extends AbstractPersistableCustom { @OneToOne @JoinColumn(name = "loan_id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTrancheCharge.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTrancheCharge.java index 9d1bb3645b5..267c20bca01 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTrancheCharge.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTrancheCharge.java @@ -28,7 +28,7 @@ @Entity @Table(name = "m_loan_tranche_charges") -public class LoanTrancheCharge extends AbstractPersistableCustom { +public class LoanTrancheCharge extends AbstractPersistableCustom { @ManyToOne(cascade = CascadeType.ALL, optional = false) @JoinColumn(name = "loan_id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTrancheDisbursementCharge.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTrancheDisbursementCharge.java index 73fe0e470a4..9a309ba2bcc 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTrancheDisbursementCharge.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTrancheDisbursementCharge.java @@ -27,7 +27,7 @@ @Entity @Table(name="m_loan_tranche_disbursement_charge") -public class LoanTrancheDisbursementCharge extends AbstractPersistableCustom { +public class LoanTrancheDisbursementCharge extends AbstractPersistableCustom { @ManyToOne @JoinColumn(name = "loan_charge_id", referencedColumnName = "id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTransaction.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTransaction.java index 5956a8e51e1..83cfabafe3d 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTransaction.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTransaction.java @@ -60,7 +60,7 @@ */ @Entity @Table(name = "m_loan_transaction", uniqueConstraints = { @UniqueConstraint(columnNames = { "external_id" }, name = "external_id_UNIQUE") }) -public class LoanTransaction extends AbstractPersistableCustom { +public class LoanTransaction extends AbstractPersistableCustom { @ManyToOne(optional = false) @JoinColumn(name = "loan_id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTransactionToRepaymentScheduleMapping.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTransactionToRepaymentScheduleMapping.java index cc2d50c6fc9..cea9f3427c1 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTransactionToRepaymentScheduleMapping.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTransactionToRepaymentScheduleMapping.java @@ -31,7 +31,7 @@ @Entity @Table(name = "m_loan_transaction_repayment_schedule_mapping") -public class LoanTransactionToRepaymentScheduleMapping extends AbstractPersistableCustom { +public class LoanTransactionToRepaymentScheduleMapping extends AbstractPersistableCustom { @ManyToOne(optional = false, cascade = CascadeType.PERSIST) @JoinColumn(name = "loan_repayment_schedule_id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/guarantor/domain/Guarantor.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/guarantor/domain/Guarantor.java index 4c60d136b67..31649181b5a 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/guarantor/domain/Guarantor.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/guarantor/domain/Guarantor.java @@ -42,7 +42,7 @@ @Entity @Table(name = "m_guarantor") -public class Guarantor extends AbstractPersistableCustom { +public class Guarantor extends AbstractPersistableCustom { @ManyToOne @JoinColumn(name = "loan_id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/guarantor/domain/GuarantorFundingDetails.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/guarantor/domain/GuarantorFundingDetails.java index 25f5ebbb9d3..0f70c2216dd 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/guarantor/domain/GuarantorFundingDetails.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/guarantor/domain/GuarantorFundingDetails.java @@ -36,7 +36,7 @@ @Entity @Table(name = "m_guarantor_funding_details") -public class GuarantorFundingDetails extends AbstractPersistableCustom { +public class GuarantorFundingDetails extends AbstractPersistableCustom { @ManyToOne @JoinColumn(name = "guarantor_id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/guarantor/domain/GuarantorFundingTransaction.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/guarantor/domain/GuarantorFundingTransaction.java index 231f56d23ae..56ff79fcd1c 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/guarantor/domain/GuarantorFundingTransaction.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/guarantor/domain/GuarantorFundingTransaction.java @@ -31,7 +31,7 @@ @Entity @Table(name = "m_guarantor_transaction") -public class GuarantorFundingTransaction extends AbstractPersistableCustom { +public class GuarantorFundingTransaction extends AbstractPersistableCustom { @ManyToOne @JoinColumn(name = "guarantor_fund_detail_id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/LoanRepaymentScheduleHistory.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/LoanRepaymentScheduleHistory.java index df78fedfd26..516912e068e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/LoanRepaymentScheduleHistory.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/LoanRepaymentScheduleHistory.java @@ -35,7 +35,7 @@ @Entity @Table(name = "m_loan_repayment_schedule_history") -public class LoanRepaymentScheduleHistory extends AbstractPersistableCustom { +public class LoanRepaymentScheduleHistory extends AbstractPersistableCustom { @ManyToOne(optional = false) @JoinColumn(name = "loan_id") diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/domain/LoanRescheduleRequest.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/domain/LoanRescheduleRequest.java index da8461a689d..e86ab0fe89c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/domain/LoanRescheduleRequest.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/domain/LoanRescheduleRequest.java @@ -43,7 +43,7 @@ @Entity @Table(name = "m_loan_reschedule_request") -public class LoanRescheduleRequest extends AbstractPersistableCustom { +public class LoanRescheduleRequest extends AbstractPersistableCustom { @ManyToOne @JoinColumn(name = "loan_id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProduct.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProduct.java index d64dd567123..5d78a589b3b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProduct.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProduct.java @@ -77,7 +77,7 @@ @Table(name = "m_product_loan", uniqueConstraints = { @UniqueConstraint(columnNames = { "name" }, name = "unq_name"), @UniqueConstraint(columnNames = { "external_id" }, name = "external_id_UNIQUE"), @UniqueConstraint(columnNames = { "short_name" }, name = "unq_short_name") }) -public class LoanProduct extends AbstractPersistableCustom { +public class LoanProduct extends AbstractPersistableCustom { @ManyToOne @JoinColumn(name = "fund_id", nullable = true) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProductBorrowerCycleVariations.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProductBorrowerCycleVariations.java index d0d43002148..280bbd94551 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProductBorrowerCycleVariations.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProductBorrowerCycleVariations.java @@ -29,7 +29,7 @@ @Entity @Table(name = "m_product_loan_variations_borrower_cycle") -public class LoanProductBorrowerCycleVariations extends AbstractPersistableCustom { +public class LoanProductBorrowerCycleVariations extends AbstractPersistableCustom { @ManyToOne @JoinColumn(name = "loan_product_id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProductConfigurableAttributes.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProductConfigurableAttributes.java index bf2ab98a68b..3d9133cec66 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProductConfigurableAttributes.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProductConfigurableAttributes.java @@ -31,7 +31,7 @@ @Entity @Table(name = "m_product_loan_configurable_attributes") -public class LoanProductConfigurableAttributes extends AbstractPersistableCustom implements Serializable { +public class LoanProductConfigurableAttributes extends AbstractPersistableCustom implements Serializable { @ManyToOne @JoinColumn(name = "loan_product_id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProductFloatingRates.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProductFloatingRates.java index 2f36cc87cd4..cb430d36649 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProductFloatingRates.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProductFloatingRates.java @@ -36,7 +36,7 @@ @Entity @Table(name = "m_product_loan_floating_rates") -public class LoanProductFloatingRates extends AbstractPersistableCustom { +public class LoanProductFloatingRates extends AbstractPersistableCustom { @OneToOne @JoinColumn(name = "loan_product_id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProductGuaranteeDetails.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProductGuaranteeDetails.java index 5c2efcc0b24..8f246a2b305 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProductGuaranteeDetails.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProductGuaranteeDetails.java @@ -37,7 +37,7 @@ @Entity @Table(name = "m_product_loan_guarantee_details") -public class LoanProductGuaranteeDetails extends AbstractPersistableCustom { +public class LoanProductGuaranteeDetails extends AbstractPersistableCustom { @OneToOne @JoinColumn(name = "loan_product_id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProductInterestRecalculationDetails.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProductInterestRecalculationDetails.java index 9b3473462f9..ab338c2d629 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProductInterestRecalculationDetails.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProductInterestRecalculationDetails.java @@ -36,7 +36,7 @@ @Entity @Table(name = "m_product_loan_recalculation_details") -public class LoanProductInterestRecalculationDetails extends AbstractPersistableCustom { +public class LoanProductInterestRecalculationDetails extends AbstractPersistableCustom { @OneToOne @JoinColumn(name = "product_id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProductVariableInstallmentConfig.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProductVariableInstallmentConfig.java index bad0cef58e7..889fd953120 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProductVariableInstallmentConfig.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProductVariableInstallmentConfig.java @@ -31,7 +31,7 @@ @Entity @Table(name = "m_product_loan_variable_installment_config") -public class LoanProductVariableInstallmentConfig extends AbstractPersistableCustom { +public class LoanProductVariableInstallmentConfig extends AbstractPersistableCustom { @OneToOne @JoinColumn(name = "loan_product_id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanTransactionProcessingStrategy.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanTransactionProcessingStrategy.java index e6e28a52eff..f5c3168bca8 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanTransactionProcessingStrategy.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanTransactionProcessingStrategy.java @@ -26,7 +26,7 @@ @Entity @Table(name = "ref_loan_transaction_processing_strategy") -public class LoanTransactionProcessingStrategy extends AbstractPersistableCustom { +public class LoanTransactionProcessingStrategy extends AbstractPersistableCustom { @Column(name = "code", unique = true) private String code; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/productmix/domain/ProductMix.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/productmix/domain/ProductMix.java index 7079949ace8..4ca7d301133 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/productmix/domain/ProductMix.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/productmix/domain/ProductMix.java @@ -27,7 +27,7 @@ @Entity @Table(name = "m_product_mix") -public class ProductMix extends AbstractPersistableCustom { +public class ProductMix extends AbstractPersistableCustom { @ManyToOne @JoinColumn(name = "product_id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/meeting/attendance/domain/ClientAttendance.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/meeting/attendance/domain/ClientAttendance.java index b47673ba63c..e28a859f0c6 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/meeting/attendance/domain/ClientAttendance.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/meeting/attendance/domain/ClientAttendance.java @@ -30,7 +30,7 @@ @Entity @Table(name = "m_client_attendance", uniqueConstraints = { @UniqueConstraint(columnNames = { "client_id", "meeting_id" }, name = "unique_client_meeting_attendance") }) -public class ClientAttendance extends AbstractPersistableCustom { +public class ClientAttendance extends AbstractPersistableCustom { @ManyToOne @JoinColumn(name = "client_id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/meeting/domain/Meeting.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/meeting/domain/Meeting.java index 970c253798b..104b19af1cd 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/meeting/domain/Meeting.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/meeting/domain/Meeting.java @@ -53,7 +53,7 @@ @Entity @Table(name = "m_meeting", uniqueConstraints = { @UniqueConstraint(columnNames = { "calendar_instance_id", "meeting_date" }, name = "unique_calendar_instance_id_meeting_date") }) -public class Meeting extends AbstractPersistableCustom { +public class Meeting extends AbstractPersistableCustom { @ManyToOne @JoinColumn(name = "calendar_instance_id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/note/domain/Note.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/note/domain/Note.java index fd443177eda..4e3e8a0641f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/note/domain/Note.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/note/domain/Note.java @@ -39,7 +39,7 @@ @Entity @Table(name = "m_note") -public class Note extends AbstractAuditableCustom { +public class Note extends AbstractAuditableCustom { @ManyToOne @JoinColumn(name = "client_id", nullable = true) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/paymentdetail/domain/PaymentDetail.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/paymentdetail/domain/PaymentDetail.java index c101bfcdb50..66351f222c6 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/paymentdetail/domain/PaymentDetail.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/paymentdetail/domain/PaymentDetail.java @@ -34,7 +34,7 @@ @Entity @Table(name = "m_payment_detail") -public final class PaymentDetail extends AbstractPersistableCustom { +public final class PaymentDetail extends AbstractPersistableCustom { @ManyToOne @JoinColumn(name = "payment_type_id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/paymenttype/domain/PaymentType.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/paymenttype/domain/PaymentType.java index 914dd422621..36e5acb4f79 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/paymenttype/domain/PaymentType.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/paymenttype/domain/PaymentType.java @@ -31,7 +31,7 @@ @Entity @Table(name = "m_payment_type") -public class PaymentType extends AbstractPersistableCustom { +public class PaymentType extends AbstractPersistableCustom { @Column(name = "value") private String name; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/domain/Rate.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/domain/Rate.java index 50d322a5e0a..444cda3d31c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/domain/Rate.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/domain/Rate.java @@ -41,7 +41,7 @@ @Entity @Table(name = "m_rate", uniqueConstraints = { @UniqueConstraint(columnNames = {"name"}, name = "name")}) -public class Rate extends AbstractAuditableCustom { +public class Rate extends AbstractAuditableCustom { @Column(name = "name", length = 250, unique = true) private String name; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositAccountInterestIncentive.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositAccountInterestIncentive.java index a6a4d948ee4..2974d0f067b 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositAccountInterestIncentive.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositAccountInterestIncentive.java @@ -28,7 +28,7 @@ @Entity @Table(name = "m_deposit_account_interest_incentives") -public class DepositAccountInterestIncentive extends AbstractPersistableCustom { +public class DepositAccountInterestIncentive extends AbstractPersistableCustom { @ManyToOne @JoinColumn(name = "deposit_account_interest_rate_slab_id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositAccountInterestIncentives.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositAccountInterestIncentives.java index a75684a990c..d09aec58835 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositAccountInterestIncentives.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositAccountInterestIncentives.java @@ -28,7 +28,7 @@ @Entity @Table(name = "m_savings_interest_incentives") -public class DepositAccountInterestIncentives extends AbstractPersistableCustom { +public class DepositAccountInterestIncentives extends AbstractPersistableCustom { @ManyToOne @JoinColumn(name = "deposit_account_interest_rate_slab_id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositAccountInterestRateChart.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositAccountInterestRateChart.java index b5d09f3b920..068d92624c2 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositAccountInterestRateChart.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositAccountInterestRateChart.java @@ -41,7 +41,7 @@ @Entity @Table(name = "m_savings_account_interest_rate_chart") -public class DepositAccountInterestRateChart extends AbstractPersistableCustom { +public class DepositAccountInterestRateChart extends AbstractPersistableCustom { @Embedded private InterestRateChartFields chartFields; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositAccountInterestRateChartSlabs.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositAccountInterestRateChartSlabs.java index a4cced7c6d8..3c4c2920c5f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositAccountInterestRateChartSlabs.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositAccountInterestRateChartSlabs.java @@ -35,7 +35,7 @@ @Entity @Table(name = "m_savings_account_interest_rate_slab") -public class DepositAccountInterestRateChartSlabs extends AbstractPersistableCustom { +public class DepositAccountInterestRateChartSlabs extends AbstractPersistableCustom { @Embedded private InterestRateChartSlabFields slabFields; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositAccountOnHoldTransaction.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositAccountOnHoldTransaction.java index 3e31cc6ba9d..c321fc055f9 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositAccountOnHoldTransaction.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositAccountOnHoldTransaction.java @@ -38,7 +38,7 @@ @Entity @Table(name = "m_deposit_account_on_hold_transaction") -public class DepositAccountOnHoldTransaction extends AbstractPersistableCustom { +public class DepositAccountOnHoldTransaction extends AbstractPersistableCustom { @ManyToOne @JoinColumn(name = "savings_account_id", nullable = true) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositAccountRecurringDetail.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositAccountRecurringDetail.java index 8c1fd7cd8c7..0a6c32efaf8 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositAccountRecurringDetail.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositAccountRecurringDetail.java @@ -43,7 +43,7 @@ @Entity @Table(name = "m_deposit_account_recurring_detail") -public class DepositAccountRecurringDetail extends AbstractPersistableCustom { +public class DepositAccountRecurringDetail extends AbstractPersistableCustom { @Column(name = "mandatory_recommended_deposit_amount", scale = 6, precision = 19, nullable = true) private BigDecimal mandatoryRecommendedDepositAmount; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositAccountTermAndPreClosure.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositAccountTermAndPreClosure.java index acb55f7f024..3b833a55299 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositAccountTermAndPreClosure.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositAccountTermAndPreClosure.java @@ -52,7 +52,7 @@ @Entity @Table(name = "m_deposit_account_term_and_preclosure") -public class DepositAccountTermAndPreClosure extends AbstractPersistableCustom { +public class DepositAccountTermAndPreClosure extends AbstractPersistableCustom { @Column(name = "deposit_amount", scale = 6, precision = 19, nullable = true) private BigDecimal depositAmount; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositProductRecurringDetail.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositProductRecurringDetail.java index a5ea5abdd88..70b755a801c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositProductRecurringDetail.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositProductRecurringDetail.java @@ -30,7 +30,7 @@ @Entity @Table(name = "m_deposit_product_recurring_detail") -public class DepositProductRecurringDetail extends AbstractPersistableCustom { +public class DepositProductRecurringDetail extends AbstractPersistableCustom { @Embedded private DepositRecurringDetail recurringDetail; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositProductTermAndPreClosure.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositProductTermAndPreClosure.java index aea2d974326..869f4484e0a 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositProductTermAndPreClosure.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositProductTermAndPreClosure.java @@ -31,7 +31,7 @@ @Entity @Table(name = "m_deposit_product_term_and_preclosure") -public class DepositProductTermAndPreClosure extends AbstractPersistableCustom { +public class DepositProductTermAndPreClosure extends AbstractPersistableCustom { @Embedded private DepositPreClosureDetail preClosureDetail; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/RecurringDepositScheduleInstallment.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/RecurringDepositScheduleInstallment.java index e8e0f1d73ef..fa52402cdc3 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/RecurringDepositScheduleInstallment.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/RecurringDepositScheduleInstallment.java @@ -35,7 +35,7 @@ @Entity @Table(name = "m_mandatory_savings_schedule") -public class RecurringDepositScheduleInstallment extends AbstractAuditableCustom { +public class RecurringDepositScheduleInstallment extends AbstractAuditableCustom { @ManyToOne(optional = false) @JoinColumn(name = "savings_account_id") diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccount.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccount.java index 2fa29c65a2a..a0e69204f09 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccount.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccount.java @@ -125,7 +125,7 @@ @Inheritance(strategy = InheritanceType.SINGLE_TABLE) @DiscriminatorColumn(name = "deposit_type_enum", discriminatorType = DiscriminatorType.INTEGER) @DiscriminatorValue("100") -public class SavingsAccount extends AbstractPersistableCustom { +public class SavingsAccount extends AbstractPersistableCustom { @Version int version; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountCharge.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountCharge.java index 0c2c3377826..34c838e2dcc 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountCharge.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountCharge.java @@ -57,7 +57,7 @@ */ @Entity @Table(name = "m_savings_account_charge") -public class SavingsAccountCharge extends AbstractPersistableCustom { +public class SavingsAccountCharge extends AbstractPersistableCustom { @ManyToOne(optional = false) @JoinColumn(name = "savings_account_id", referencedColumnName = "id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountChargePaidBy.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountChargePaidBy.java index 467d3384ca1..e2a7fbf99bd 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountChargePaidBy.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountChargePaidBy.java @@ -28,7 +28,7 @@ @Entity @Table(name = "m_savings_account_charge_paid_by") -public class SavingsAccountChargePaidBy extends AbstractPersistableCustom { +public class SavingsAccountChargePaidBy extends AbstractPersistableCustom { @ManyToOne @JoinColumn(name = "savings_account_transaction_id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountTransaction.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountTransaction.java index 3846db89b54..c1532b6e131 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountTransaction.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountTransaction.java @@ -60,7 +60,7 @@ */ @Entity @Table(name = "m_savings_account_transaction") -public final class SavingsAccountTransaction extends AbstractPersistableCustom { +public final class SavingsAccountTransaction extends AbstractPersistableCustom { @ManyToOne(optional = false) @JoinColumn(name = "savings_account_id", referencedColumnName="id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountTransactionTaxDetails.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountTransactionTaxDetails.java index c4c60167f5f..1f6ce1e3dd3 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountTransactionTaxDetails.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountTransactionTaxDetails.java @@ -30,7 +30,7 @@ @Entity @Table(name = "m_savings_account_transaction_tax_details") -public class SavingsAccountTransactionTaxDetails extends AbstractPersistableCustom { +public class SavingsAccountTransactionTaxDetails extends AbstractPersistableCustom { @ManyToOne @JoinColumn(name = "tax_component_id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsOfficerAssignmentHistory.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsOfficerAssignmentHistory.java index 56d9d654235..9da08fb49ca 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsOfficerAssignmentHistory.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsOfficerAssignmentHistory.java @@ -34,7 +34,7 @@ @Entity @Table(name = "m_savings_officer_assignment_history") -public class SavingsOfficerAssignmentHistory extends AbstractAuditableCustom { +public class SavingsOfficerAssignmentHistory extends AbstractAuditableCustom { @ManyToOne @JoinColumn(name = "account_id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsProduct.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsProduct.java index 6dc69536f86..bdc79fccc8d 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsProduct.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsProduct.java @@ -96,7 +96,7 @@ @Inheritance @DiscriminatorColumn(name = "deposit_type_enum", discriminatorType = DiscriminatorType.INTEGER) @DiscriminatorValue("100") -public class SavingsProduct extends AbstractPersistableCustom { +public class SavingsProduct extends AbstractPersistableCustom { @Column(name = "name", nullable = false, unique = true) protected String name; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/account/domain/SelfBeneficiariesTPT.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/account/domain/SelfBeneficiariesTPT.java index 90586e1191a..ea9b7c5b7ff 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/account/domain/SelfBeneficiariesTPT.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/account/domain/SelfBeneficiariesTPT.java @@ -32,7 +32,7 @@ @Entity @Table(name = "m_selfservice_beneficiaries_tpt", uniqueConstraints = { @UniqueConstraint(columnNames = { "name", "app_user_id", "is_active" }, name = "name") }) -public class SelfBeneficiariesTPT extends AbstractPersistableCustom { +public class SelfBeneficiariesTPT extends AbstractPersistableCustom { @Column(name = "app_user_id", nullable = false) private Long appUserId; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/pockets/domain/Pocket.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/pockets/domain/Pocket.java index da0ea8d8128..9ceabfc72f7 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/pockets/domain/Pocket.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/pockets/domain/Pocket.java @@ -29,7 +29,7 @@ @Entity @Table(name = "m_pocket", uniqueConstraints = { @UniqueConstraint(columnNames = { "app_user_id" }, name = "unique_app_user") }) -public class Pocket extends AbstractPersistableCustom { +public class Pocket extends AbstractPersistableCustom { @Column(name = "app_user_id", length = 20, nullable = false) private Long appUserId; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/pockets/domain/PocketAccountMapping.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/pockets/domain/PocketAccountMapping.java index 536547ceda7..c18a535848b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/pockets/domain/PocketAccountMapping.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/pockets/domain/PocketAccountMapping.java @@ -27,7 +27,7 @@ @SuppressWarnings("serial") @Entity @Table(name = "m_pocket_accounts_mapping") -public class PocketAccountMapping extends AbstractPersistableCustom { +public class PocketAccountMapping extends AbstractPersistableCustom { @Column(name = "pocket_id", length = 20, nullable = false) private Long pocketId; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/registration/domain/SelfServiceRegistration.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/registration/domain/SelfServiceRegistration.java index ac091f228b4..9f9916b0da2 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/registration/domain/SelfServiceRegistration.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/registration/domain/SelfServiceRegistration.java @@ -31,7 +31,7 @@ @Entity @Table(name = "request_audit_table") -public class SelfServiceRegistration extends AbstractPersistableCustom { +public class SelfServiceRegistration extends AbstractPersistableCustom { @ManyToOne @JoinColumn(name = "client_id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/domain/ShareAccount.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/domain/ShareAccount.java index e54cd7a7059..3f0f82feb27 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/domain/ShareAccount.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/domain/ShareAccount.java @@ -47,7 +47,7 @@ @Entity @Table(name = "m_share_account") -public class ShareAccount extends AbstractPersistableCustom { +public class ShareAccount extends AbstractPersistableCustom { @ManyToOne @JoinColumn(name = "client_id", nullable = true) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/domain/ShareAccountCharge.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/domain/ShareAccountCharge.java index dccd2b216a4..f9a4e77a2d3 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/domain/ShareAccountCharge.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/domain/ShareAccountCharge.java @@ -35,7 +35,7 @@ @Entity @Table(name = "m_share_account_charge") -public class ShareAccountCharge extends AbstractPersistableCustom { +public class ShareAccountCharge extends AbstractPersistableCustom { @ManyToOne(optional = false) @JoinColumn(name = "account_id", referencedColumnName = "id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/domain/ShareAccountChargePaidBy.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/domain/ShareAccountChargePaidBy.java index acbe2d95bb8..b9be358c879 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/domain/ShareAccountChargePaidBy.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/domain/ShareAccountChargePaidBy.java @@ -29,7 +29,7 @@ @Entity @Table(name = "m_share_account_charge_paid_by") -public class ShareAccountChargePaidBy extends AbstractPersistableCustom{ +public class ShareAccountChargePaidBy extends AbstractPersistableCustom{ @ManyToOne(optional = false) @JoinColumn(name = "share_transaction_id", referencedColumnName = "id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/domain/ShareAccountDividendDetails.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/domain/ShareAccountDividendDetails.java index 630cf5a4daa..54270103077 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/domain/ShareAccountDividendDetails.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/domain/ShareAccountDividendDetails.java @@ -26,7 +26,7 @@ @Entity @Table(name = "m_share_account_dividend_details") -public class ShareAccountDividendDetails extends AbstractPersistableCustom { +public class ShareAccountDividendDetails extends AbstractPersistableCustom { @Column(name = "account_id", nullable = false) private Long shareAccountId; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/domain/ShareAccountTransaction.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/domain/ShareAccountTransaction.java index ee14a33138e..493e2668a83 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/domain/ShareAccountTransaction.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/domain/ShareAccountTransaction.java @@ -36,7 +36,7 @@ @Entity @Table(name = "m_share_account_transactions") -public class ShareAccountTransaction extends AbstractPersistableCustom { +public class ShareAccountTransaction extends AbstractPersistableCustom { @ManyToOne(optional = false) @JoinColumn(name = "account_id", referencedColumnName = "id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareproducts/domain/ShareProduct.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareproducts/domain/ShareProduct.java index d2745047a08..5f1ba652661 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareproducts/domain/ShareProduct.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareproducts/domain/ShareProduct.java @@ -51,7 +51,7 @@ @SuppressWarnings("serial") @Entity @Table(name = "m_share_product") -public class ShareProduct extends AbstractAuditableCustom { +public class ShareProduct extends AbstractAuditableCustom { @Column(name = "name", nullable = false, unique = true) private String name; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareproducts/domain/ShareProductDividendPayOutDetails.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareproducts/domain/ShareProductDividendPayOutDetails.java index 56eb8f3b22f..f53d48e8562 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareproducts/domain/ShareProductDividendPayOutDetails.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareproducts/domain/ShareProductDividendPayOutDetails.java @@ -38,7 +38,7 @@ @Entity @Table(name = "m_share_product_dividend_pay_out") -public class ShareProductDividendPayOutDetails extends AbstractAuditableCustom { +public class ShareProductDividendPayOutDetails extends AbstractAuditableCustom { @Column(name = "product_id", nullable = true) private Long shareProductId; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareproducts/domain/ShareProductMarketPrice.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareproducts/domain/ShareProductMarketPrice.java index 1ada0501a1a..642342d34d4 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareproducts/domain/ShareProductMarketPrice.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareproducts/domain/ShareProductMarketPrice.java @@ -31,7 +31,7 @@ @Entity @Table(name = "m_share_product_market_price") -public class ShareProductMarketPrice extends AbstractPersistableCustom { +public class ShareProductMarketPrice extends AbstractPersistableCustom { @ManyToOne(optional = false) @JoinColumn(name = "product_id", referencedColumnName = "id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/tax/domain/TaxComponent.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/tax/domain/TaxComponent.java index 09ceb4edc74..307dfce1ac1 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/tax/domain/TaxComponent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/tax/domain/TaxComponent.java @@ -49,7 +49,7 @@ @Entity @Table(name = "m_tax_component") -public class TaxComponent extends AbstractAuditableCustom { +public class TaxComponent extends AbstractAuditableCustom { @Column(name = "name", length = 100) private String name; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/tax/domain/TaxComponentHistory.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/tax/domain/TaxComponentHistory.java index a1c2e1fab38..b355971a569 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/tax/domain/TaxComponentHistory.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/tax/domain/TaxComponentHistory.java @@ -31,7 +31,7 @@ @Entity @Table(name = "m_tax_component_history") -public class TaxComponentHistory extends AbstractAuditableCustom { +public class TaxComponentHistory extends AbstractAuditableCustom { @Column(name = "percentage", scale = 6, precision = 19, nullable = false) private BigDecimal percentage; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/tax/domain/TaxGroup.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/tax/domain/TaxGroup.java index 97eb93efa97..75347b61b8d 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/tax/domain/TaxGroup.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/tax/domain/TaxGroup.java @@ -40,7 +40,7 @@ @Entity @Table(name = "m_tax_group") -public class TaxGroup extends AbstractAuditableCustom { +public class TaxGroup extends AbstractAuditableCustom { @Column(name = "name", length = 100) private String name; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/tax/domain/TaxGroupMappings.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/tax/domain/TaxGroupMappings.java index f923d1b7ecf..24602754113 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/tax/domain/TaxGroupMappings.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/tax/domain/TaxGroupMappings.java @@ -36,7 +36,7 @@ @Entity @Table(name = "m_tax_group_mappings") -public class TaxGroupMappings extends AbstractAuditableCustom { +public class TaxGroupMappings extends AbstractAuditableCustom { @ManyToOne @JoinColumn(name = "tax_component_id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/spm/domain/Component.java b/fineract-provider/src/main/java/org/apache/fineract/spm/domain/Component.java index 517f62f9704..f8eba1905d0 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/spm/domain/Component.java +++ b/fineract-provider/src/main/java/org/apache/fineract/spm/domain/Component.java @@ -28,7 +28,7 @@ @Entity @Table(name = "m_survey_components") -public class Component extends AbstractPersistableCustom { +public class Component extends AbstractPersistableCustom { @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "survey_id") diff --git a/fineract-provider/src/main/java/org/apache/fineract/spm/domain/LookupTable.java b/fineract-provider/src/main/java/org/apache/fineract/spm/domain/LookupTable.java index 034fb45130c..9714ef57335 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/spm/domain/LookupTable.java +++ b/fineract-provider/src/main/java/org/apache/fineract/spm/domain/LookupTable.java @@ -28,7 +28,7 @@ @Entity @Table(name = "m_survey_lookup_tables") -public class LookupTable extends AbstractPersistableCustom { +public class LookupTable extends AbstractPersistableCustom { @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "survey_id") diff --git a/fineract-provider/src/main/java/org/apache/fineract/spm/domain/Question.java b/fineract-provider/src/main/java/org/apache/fineract/spm/domain/Question.java index 61644c4511b..405330e5532 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/spm/domain/Question.java +++ b/fineract-provider/src/main/java/org/apache/fineract/spm/domain/Question.java @@ -32,7 +32,7 @@ @Entity @Table(name = "m_survey_questions") -public class Question extends AbstractPersistableCustom { +public class Question extends AbstractPersistableCustom { @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "survey_id") diff --git a/fineract-provider/src/main/java/org/apache/fineract/spm/domain/Response.java b/fineract-provider/src/main/java/org/apache/fineract/spm/domain/Response.java index 748a0c71bd7..6f0685478d8 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/spm/domain/Response.java +++ b/fineract-provider/src/main/java/org/apache/fineract/spm/domain/Response.java @@ -28,7 +28,7 @@ @Entity @Table(name = "m_survey_responses") -public class Response extends AbstractPersistableCustom { +public class Response extends AbstractPersistableCustom { @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "question_id") diff --git a/fineract-provider/src/main/java/org/apache/fineract/spm/domain/Scorecard.java b/fineract-provider/src/main/java/org/apache/fineract/spm/domain/Scorecard.java index 3587ee1ab86..97a2a5bc857 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/spm/domain/Scorecard.java +++ b/fineract-provider/src/main/java/org/apache/fineract/spm/domain/Scorecard.java @@ -34,7 +34,7 @@ @Entity @Table(name = "m_survey_scorecards") -public class Scorecard extends AbstractPersistableCustom { +public class Scorecard extends AbstractPersistableCustom { @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "survey_id") diff --git a/fineract-provider/src/main/java/org/apache/fineract/spm/domain/Survey.java b/fineract-provider/src/main/java/org/apache/fineract/spm/domain/Survey.java index 994b0f3b12d..7a62ad525c3 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/spm/domain/Survey.java +++ b/fineract-provider/src/main/java/org/apache/fineract/spm/domain/Survey.java @@ -34,7 +34,7 @@ @Entity @Table(name = "m_surveys") -public class Survey extends AbstractPersistableCustom { +public class Survey extends AbstractPersistableCustom { @OneToMany(mappedBy = "survey", fetch = FetchType.EAGER, cascade = CascadeType.ALL, orphanRemoval=true) @OrderBy("sequenceNo") diff --git a/fineract-provider/src/main/java/org/apache/fineract/template/domain/Template.java b/fineract-provider/src/main/java/org/apache/fineract/template/domain/Template.java index 02a66d61bc4..54f165d6df6 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/template/domain/Template.java +++ b/fineract-provider/src/main/java/org/apache/fineract/template/domain/Template.java @@ -41,7 +41,7 @@ @Entity @Table(name = "m_template", uniqueConstraints = {@UniqueConstraint(columnNames = {"name"}, name = "unq_name")}) -public class Template extends AbstractPersistableCustom { +public class Template extends AbstractPersistableCustom { @Column(name = "name", nullable = false, unique = true) private String name; diff --git a/fineract-provider/src/main/java/org/apache/fineract/template/domain/TemplateMapper.java b/fineract-provider/src/main/java/org/apache/fineract/template/domain/TemplateMapper.java index a3aac47b87a..fd940244273 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/template/domain/TemplateMapper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/template/domain/TemplateMapper.java @@ -25,7 +25,7 @@ @Entity @Table(name = "m_templatemappers") -public class TemplateMapper extends AbstractPersistableCustom { +public class TemplateMapper extends AbstractPersistableCustom { @Column(name = "mapperorder") private int mapperorder; diff --git a/fineract-provider/src/main/java/org/apache/fineract/useradministration/domain/AppUser.java b/fineract-provider/src/main/java/org/apache/fineract/useradministration/domain/AppUser.java index 9d864b25b70..baafc7d2927 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/useradministration/domain/AppUser.java +++ b/fineract-provider/src/main/java/org/apache/fineract/useradministration/domain/AppUser.java @@ -59,7 +59,7 @@ @Entity @Table(name = "m_appuser", uniqueConstraints = @UniqueConstraint(columnNames = { "username" }, name = "username_org")) -public class AppUser extends AbstractPersistableCustom implements PlatformUser { +public class AppUser extends AbstractPersistableCustom implements PlatformUser { private final static Logger logger = LoggerFactory.getLogger(AppUser.class); diff --git a/fineract-provider/src/main/java/org/apache/fineract/useradministration/domain/AppUserClientMapping.java b/fineract-provider/src/main/java/org/apache/fineract/useradministration/domain/AppUserClientMapping.java index d51089e41ce..4ab5b5e0e9a 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/useradministration/domain/AppUserClientMapping.java +++ b/fineract-provider/src/main/java/org/apache/fineract/useradministration/domain/AppUserClientMapping.java @@ -28,7 +28,7 @@ @Entity @Table(name = "m_selfservice_user_client_mapping") -public class AppUserClientMapping extends AbstractPersistableCustom { +public class AppUserClientMapping extends AbstractPersistableCustom { @ManyToOne(optional = false, cascade = CascadeType.PERSIST) @JoinColumn(name = "client_id", nullable = false) diff --git a/fineract-provider/src/main/java/org/apache/fineract/useradministration/domain/AppUserPreviousPassword.java b/fineract-provider/src/main/java/org/apache/fineract/useradministration/domain/AppUserPreviousPassword.java index 81a7b8d79e3..160005de13b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/useradministration/domain/AppUserPreviousPassword.java +++ b/fineract-provider/src/main/java/org/apache/fineract/useradministration/domain/AppUserPreviousPassword.java @@ -29,7 +29,7 @@ @Entity @Table(name = "m_appuser_previous_password") -public class AppUserPreviousPassword extends AbstractPersistableCustom { +public class AppUserPreviousPassword extends AbstractPersistableCustom { @Column(name = "user_id", nullable = false) private Long userId; diff --git a/fineract-provider/src/main/java/org/apache/fineract/useradministration/domain/PasswordValidationPolicy.java b/fineract-provider/src/main/java/org/apache/fineract/useradministration/domain/PasswordValidationPolicy.java index 56c7f496aef..66e0114ec2d 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/useradministration/domain/PasswordValidationPolicy.java +++ b/fineract-provider/src/main/java/org/apache/fineract/useradministration/domain/PasswordValidationPolicy.java @@ -27,7 +27,7 @@ @Entity @Table(name = "m_password_validation_policy") -public class PasswordValidationPolicy extends AbstractPersistableCustom { +public class PasswordValidationPolicy extends AbstractPersistableCustom { @Column(name = "regex", nullable = false) private String regex; diff --git a/fineract-provider/src/main/java/org/apache/fineract/useradministration/domain/Permission.java b/fineract-provider/src/main/java/org/apache/fineract/useradministration/domain/Permission.java index eb7421eb3af..4d6c9796c31 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/useradministration/domain/Permission.java +++ b/fineract-provider/src/main/java/org/apache/fineract/useradministration/domain/Permission.java @@ -26,7 +26,7 @@ @Entity @Table(name = "m_permission") -public class Permission extends AbstractPersistableCustom implements Serializable { +public class Permission extends AbstractPersistableCustom implements Serializable { @Column(name = "grouping", nullable = false, length = 45) private String grouping; diff --git a/fineract-provider/src/main/java/org/apache/fineract/useradministration/domain/Role.java b/fineract-provider/src/main/java/org/apache/fineract/useradministration/domain/Role.java index 5c2dc75bab7..3dad910b0ad 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/useradministration/domain/Role.java +++ b/fineract-provider/src/main/java/org/apache/fineract/useradministration/domain/Role.java @@ -38,7 +38,7 @@ @Entity @Table(name = "m_role", uniqueConstraints = { @UniqueConstraint(columnNames = { "name" }, name = "unq_name") }) -public class Role extends AbstractPersistableCustom implements Serializable { +public class Role extends AbstractPersistableCustom implements Serializable { @Column(name = "name", unique = true, nullable = false, length = 100) private String name; From beee2e5330b35f07ed16ba7019b57b8ab75e4e02 Mon Sep 17 00:00:00 2001 From: thesmallstar Date: Sun, 5 Apr 2020 20:46:10 +0530 Subject: [PATCH 37/37] Fixed: Checkstyle Violations --- .../org/apache/fineract/accounting/closure/domain/GLClosure.java | 1 - .../fineract/accounting/journalentry/domain/JournalEntry.java | 1 - .../main/java/org/apache/fineract/adhocquery/domain/AdHoc.java | 1 - .../org/apache/fineract/infrastructure/hooks/domain/Hook.java | 1 - .../org/apache/fineract/portfolio/calendar/domain/Calendar.java | 1 - .../fineract/portfolio/client/domain/ClientIdentifier.java | 1 - .../fineract/portfolio/group/domain/StaffAssignmentHistory.java | 1 - .../loanaccount/domain/LoanOfficerAssignmentHistory.java | 1 - .../loanaccount/domain/LoanRepaymentScheduleInstallment.java | 1 - .../java/org/apache/fineract/portfolio/note/domain/Note.java | 1 - .../savings/domain/RecurringDepositScheduleInstallment.java | 1 - .../savings/domain/SavingsOfficerAssignmentHistory.java | 1 - .../shareproducts/domain/ShareProductDividendPayOutDetails.java | 1 - .../org/apache/fineract/portfolio/tax/domain/TaxComponent.java | 1 - .../fineract/portfolio/tax/domain/TaxComponentHistory.java | 1 - .../java/org/apache/fineract/portfolio/tax/domain/TaxGroup.java | 1 - .../apache/fineract/portfolio/tax/domain/TaxGroupMappings.java | 1 - 17 files changed, 17 deletions(-) diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/domain/GLClosure.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/domain/GLClosure.java index 9d7840d2bb3..eb855cc422c 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/domain/GLClosure.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/domain/GLClosure.java @@ -34,7 +34,6 @@ import org.apache.fineract.infrastructure.core.api.JsonCommand; import org.apache.fineract.infrastructure.core.domain.AbstractAuditableCustom; import org.apache.fineract.organisation.office.domain.Office; -import org.apache.fineract.useradministration.domain.AppUser; @Entity @Table(name = "acc_gl_closure", uniqueConstraints = { @UniqueConstraint(columnNames = { "office_id", "closing_date" }, name = "office_id_closing_date") }) diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/domain/JournalEntry.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/domain/JournalEntry.java index 7a19501f203..56cb6c83f7a 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/domain/JournalEntry.java +++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/domain/JournalEntry.java @@ -36,7 +36,6 @@ import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction; import org.apache.fineract.portfolio.paymentdetail.domain.PaymentDetail; import org.apache.fineract.portfolio.savings.domain.SavingsAccountTransaction; -import org.apache.fineract.useradministration.domain.AppUser; @Entity @Table(name = "acc_gl_journal_entry") diff --git a/fineract-provider/src/main/java/org/apache/fineract/adhocquery/domain/AdHoc.java b/fineract-provider/src/main/java/org/apache/fineract/adhocquery/domain/AdHoc.java index b92807a1859..3a7096fc5c3 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/adhocquery/domain/AdHoc.java +++ b/fineract-provider/src/main/java/org/apache/fineract/adhocquery/domain/AdHoc.java @@ -29,7 +29,6 @@ import org.apache.fineract.infrastructure.core.api.JsonCommand; import org.apache.fineract.infrastructure.core.domain.AbstractAuditableCustom; import org.apache.fineract.infrastructure.security.utils.SQLInjectionValidator; -import org.apache.fineract.useradministration.domain.AppUser; @Entity diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/hooks/domain/Hook.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/hooks/domain/Hook.java index e65f8efe541..ec559f8789b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/hooks/domain/Hook.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/hooks/domain/Hook.java @@ -42,7 +42,6 @@ import org.apache.fineract.infrastructure.core.api.JsonCommand; import org.apache.fineract.infrastructure.core.domain.AbstractAuditableCustom; import org.apache.fineract.template.domain.Template; -import org.apache.fineract.useradministration.domain.AppUser; import org.springframework.util.CollectionUtils; @Entity diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/domain/Calendar.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/domain/Calendar.java index c938df6aa4e..873de831c42 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/domain/Calendar.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/domain/Calendar.java @@ -47,7 +47,6 @@ import org.apache.fineract.portfolio.calendar.exception.CalendarParameterUpdateNotSupportedException; import org.apache.fineract.portfolio.calendar.service.CalendarUtils; import org.apache.fineract.portfolio.common.domain.NthDayType; -import org.apache.fineract.useradministration.domain.AppUser; import org.joda.time.LocalDate; import org.joda.time.LocalDateTime; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientIdentifier.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientIdentifier.java index 99829c21e13..a8a07996747 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientIdentifier.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientIdentifier.java @@ -30,7 +30,6 @@ import org.apache.fineract.infrastructure.codes.domain.CodeValue; import org.apache.fineract.infrastructure.core.api.JsonCommand; import org.apache.fineract.infrastructure.core.domain.AbstractAuditableCustom; -import org.apache.fineract.useradministration.domain.AppUser; @Entity @Table(name = "m_client_identifier", uniqueConstraints = { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/domain/StaffAssignmentHistory.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/domain/StaffAssignmentHistory.java index 11b85758b66..ecdd4bd49cb 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/domain/StaffAssignmentHistory.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/domain/StaffAssignmentHistory.java @@ -28,7 +28,6 @@ import javax.persistence.TemporalType; import org.apache.fineract.infrastructure.core.domain.AbstractAuditableCustom; import org.apache.fineract.organisation.staff.domain.Staff; -import org.apache.fineract.useradministration.domain.AppUser; import org.joda.time.LocalDate; @Entity diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanOfficerAssignmentHistory.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanOfficerAssignmentHistory.java index 779ef44e4b1..c521af5c5f8 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanOfficerAssignmentHistory.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanOfficerAssignmentHistory.java @@ -29,7 +29,6 @@ import org.apache.commons.lang.ObjectUtils; import org.apache.fineract.infrastructure.core.domain.AbstractAuditableCustom; import org.apache.fineract.organisation.staff.domain.Staff; -import org.apache.fineract.useradministration.domain.AppUser; import org.joda.time.LocalDate; @Entity diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanRepaymentScheduleInstallment.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanRepaymentScheduleInstallment.java index 3555cbf716c..946f77afed3 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanRepaymentScheduleInstallment.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanRepaymentScheduleInstallment.java @@ -36,7 +36,6 @@ import org.apache.fineract.infrastructure.core.domain.AbstractAuditableCustom; import org.apache.fineract.organisation.monetary.domain.MonetaryCurrency; import org.apache.fineract.organisation.monetary.domain.Money; -import org.apache.fineract.useradministration.domain.AppUser; import org.joda.time.LocalDate; @Entity diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/note/domain/Note.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/note/domain/Note.java index 4e3e8a0641f..c573339df7d 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/note/domain/Note.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/note/domain/Note.java @@ -35,7 +35,6 @@ import org.apache.fineract.portfolio.savings.domain.SavingsAccount; import org.apache.fineract.portfolio.savings.domain.SavingsAccountTransaction; import org.apache.fineract.portfolio.shareaccounts.domain.ShareAccount; -import org.apache.fineract.useradministration.domain.AppUser; @Entity @Table(name = "m_note") diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/RecurringDepositScheduleInstallment.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/RecurringDepositScheduleInstallment.java index fa52402cdc3..15f0d93b201 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/RecurringDepositScheduleInstallment.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/RecurringDepositScheduleInstallment.java @@ -30,7 +30,6 @@ import org.apache.fineract.infrastructure.core.domain.AbstractAuditableCustom; import org.apache.fineract.organisation.monetary.domain.MonetaryCurrency; import org.apache.fineract.organisation.monetary.domain.Money; -import org.apache.fineract.useradministration.domain.AppUser; import org.joda.time.LocalDate; @Entity diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsOfficerAssignmentHistory.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsOfficerAssignmentHistory.java index 9da08fb49ca..24862a948dc 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsOfficerAssignmentHistory.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsOfficerAssignmentHistory.java @@ -29,7 +29,6 @@ import org.apache.commons.lang.ObjectUtils; import org.apache.fineract.infrastructure.core.domain.AbstractAuditableCustom; import org.apache.fineract.organisation.staff.domain.Staff; -import org.apache.fineract.useradministration.domain.AppUser; import org.joda.time.LocalDate; @Entity diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareproducts/domain/ShareProductDividendPayOutDetails.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareproducts/domain/ShareProductDividendPayOutDetails.java index f53d48e8562..ac5b6e30464 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareproducts/domain/ShareProductDividendPayOutDetails.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareproducts/domain/ShareProductDividendPayOutDetails.java @@ -33,7 +33,6 @@ import javax.persistence.TemporalType; import org.apache.fineract.infrastructure.core.domain.AbstractAuditableCustom; import org.apache.fineract.portfolio.shareaccounts.domain.ShareAccountDividendDetails; -import org.apache.fineract.useradministration.domain.AppUser; import org.joda.time.LocalDate; @Entity diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/tax/domain/TaxComponent.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/tax/domain/TaxComponent.java index 307dfce1ac1..b09bf5a8b08 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/tax/domain/TaxComponent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/tax/domain/TaxComponent.java @@ -44,7 +44,6 @@ import org.apache.fineract.infrastructure.core.domain.AbstractAuditableCustom; import org.apache.fineract.infrastructure.core.service.DateUtils; import org.apache.fineract.portfolio.tax.api.TaxApiConstants; -import org.apache.fineract.useradministration.domain.AppUser; import org.joda.time.LocalDate; @Entity diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/tax/domain/TaxComponentHistory.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/tax/domain/TaxComponentHistory.java index b355971a569..6afa827bbfb 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/tax/domain/TaxComponentHistory.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/tax/domain/TaxComponentHistory.java @@ -26,7 +26,6 @@ import javax.persistence.Temporal; import javax.persistence.TemporalType; import org.apache.fineract.infrastructure.core.domain.AbstractAuditableCustom; -import org.apache.fineract.useradministration.domain.AppUser; import org.joda.time.LocalDate; @Entity diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/tax/domain/TaxGroup.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/tax/domain/TaxGroup.java index 75347b61b8d..50a524d86c0 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/tax/domain/TaxGroup.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/tax/domain/TaxGroup.java @@ -36,7 +36,6 @@ import org.apache.fineract.infrastructure.core.domain.AbstractAuditableCustom; import org.apache.fineract.portfolio.tax.api.TaxApiConstants; import org.apache.fineract.portfolio.tax.exception.TaxMappingNotFoundException; -import org.apache.fineract.useradministration.domain.AppUser; @Entity @Table(name = "m_tax_group") diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/tax/domain/TaxGroupMappings.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/tax/domain/TaxGroupMappings.java index 24602754113..c8dfca8c682 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/tax/domain/TaxGroupMappings.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/tax/domain/TaxGroupMappings.java @@ -31,7 +31,6 @@ import javax.persistence.TemporalType; import org.apache.fineract.infrastructure.core.domain.AbstractAuditableCustom; import org.apache.fineract.portfolio.tax.api.TaxApiConstants; -import org.apache.fineract.useradministration.domain.AppUser; import org.joda.time.LocalDate; @Entity