diff --git a/custom/acme/loan/cob/build.gradle b/custom/acme/loan/cob/build.gradle
index 104d04edc..04ca760dc 100644
--- a/custom/acme/loan/cob/build.gradle
+++ b/custom/acme/loan/cob/build.gradle
@@ -18,8 +18,8 @@
*/
description = 'ACME Corp.: Fineract COB Loan'
-group = 'com.acme.fineract.cob'
+group = 'com.acme.fineract'
-archivesBaseName = 'acme-fineract-cob-loan'
+archivesBaseName = 'acme-fineract-loan-cob'
apply from: 'dependencies.gradle'
diff --git a/custom/acme/loan/cob/src/main/java/com/acme/fineract/loan/cob/AcmeNoopBusinessStep.java b/custom/acme/loan/cob/src/main/java/com/acme/fineract/loan/cob/AcmeNoopBusinessStep.java
index 85d271d51..2217466d0 100644
--- a/custom/acme/loan/cob/src/main/java/com/acme/fineract/loan/cob/AcmeNoopBusinessStep.java
+++ b/custom/acme/loan/cob/src/main/java/com/acme/fineract/loan/cob/AcmeNoopBusinessStep.java
@@ -31,6 +31,10 @@ import org.springframework.stereotype.Component;
@RequiredArgsConstructor
public class AcmeNoopBusinessStep implements LoanCOBBusinessStep, InitializingBean {
+ private static final String ENUM_STYLED_NAME = "ACME_LOAN_NOOP";
+
+ private static final String HUMAN_READABLE_NAME = "ACME Loan Noop";
+
// NOTE: just to demonstrate that dependency injection is working
private final LoanAccountDomainService loanAccountDomainService;
@@ -46,11 +50,11 @@ public class AcmeNoopBusinessStep implements LoanCOBBusinessStep, InitializingBe
@Override
public String getEnumStyledName() {
- return "ACME_LOAN_NOOP";
+ return ENUM_STYLED_NAME;
}
@Override
public String getHumanReadableName() {
- return "ACME Loan Noop";
+ return HUMAN_READABLE_NAME;
}
}
diff --git a/custom/acme/loan/cob/src/main/resources/db/custom-changelog/0001_acme_loan_cob.xml b/custom/acme/loan/cob/src/main/resources/db/custom-changelog/0001_acme_loan_cob.xml
new file mode 100644
index 000000000..bd63bdc41
--- /dev/null
+++ b/custom/acme/loan/cob/src/main/resources/db/custom-changelog/0001_acme_loan_cob.xml
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/custom/acme/loan/processor/build.gradle b/custom/acme/loan/processor/build.gradle
new file mode 100644
index 000000000..c693255c9
--- /dev/null
+++ b/custom/acme/loan/processor/build.gradle
@@ -0,0 +1,25 @@
+/**
+ * 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.
+ */
+description = 'ACME Corp.: Fineract Loan Transaction Processors'
+
+group = 'com.acme.fineract'
+
+archivesBaseName = 'acme-fineract-loan-processor'
+
+apply from: 'dependencies.gradle'
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTransactionProcessingStrategyRepository.java b/custom/acme/loan/processor/dependencies.gradle
similarity index 61%
rename from fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTransactionProcessingStrategyRepository.java
rename to custom/acme/loan/processor/dependencies.gradle
index 49c875e08..59d668289 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTransactionProcessingStrategyRepository.java
+++ b/custom/acme/loan/processor/dependencies.gradle
@@ -16,13 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.fineract.portfolio.loanaccount.domain;
-import org.apache.fineract.portfolio.loanproduct.domain.LoanTransactionProcessingStrategy;
-import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
-
-public interface LoanTransactionProcessingStrategyRepository
- extends JpaRepository, JpaSpecificationExecutor {
- // no added behaviour
+dependencies {
+ implementation(project(':fineract-provider'))
}
diff --git a/custom/acme/loan/processor/src/main/java/com/acme/fineract/loan/processor/AcmeLoanRepaymentScheduleTransactionProcessor.java b/custom/acme/loan/processor/src/main/java/com/acme/fineract/loan/processor/AcmeLoanRepaymentScheduleTransactionProcessor.java
new file mode 100644
index 000000000..f53a94458
--- /dev/null
+++ b/custom/acme/loan/processor/src/main/java/com/acme/fineract/loan/processor/AcmeLoanRepaymentScheduleTransactionProcessor.java
@@ -0,0 +1,41 @@
+/**
+ * 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 com.acme.fineract.loan.processor;
+
+import org.apache.fineract.portfolio.loanaccount.domain.transactionprocessor.impl.FineractStyleLoanRepaymentScheduleTransactionProcessor;
+import org.springframework.stereotype.Component;
+
+@Component
+public class AcmeLoanRepaymentScheduleTransactionProcessor extends FineractStyleLoanRepaymentScheduleTransactionProcessor {
+
+ private static final String STRATEGY_CODE = "acme-standard-strategy";
+
+ private static final String STRATEGY_NAME = "ACME Corp.: standard loan transaction processing strategy";
+
+ @Override
+ public String getCode() {
+ return STRATEGY_CODE;
+ }
+
+ @Override
+ public String getName() {
+ return STRATEGY_NAME;
+ }
+
+}
diff --git a/custom/acme/loan/starter/build.gradle b/custom/acme/loan/starter/build.gradle
index 31e39823f..8620f5bfd 100644
--- a/custom/acme/loan/starter/build.gradle
+++ b/custom/acme/loan/starter/build.gradle
@@ -18,8 +18,8 @@
*/
description = 'ACME Corp.: Fineract COB Starter'
-group = 'com.acme.fineract.cob'
+group = 'com.acme.fineract'
-archivesBaseName = 'acme-fineract-cob-starter'
+archivesBaseName = 'acme-fineract-loan-starter'
apply from: 'dependencies.gradle'
diff --git a/custom/acme/loan/starter/dependencies.gradle b/custom/acme/loan/starter/dependencies.gradle
index 6276b6322..11225f482 100644
--- a/custom/acme/loan/starter/dependencies.gradle
+++ b/custom/acme/loan/starter/dependencies.gradle
@@ -18,7 +18,9 @@
*/
dependencies {
+ implementation(project(':fineract-provider'))
implementation(project(':custom:acme:loan:cob'))
+ implementation(project(':custom:acme:loan:processor'))
implementation('org.springframework.boot:spring-boot-starter')
testImplementation(project(':fineract-provider'))
testImplementation('org.springframework.boot:spring-boot-starter-jdbc')
diff --git a/custom/acme/loan/starter/src/main/java/com/acme/fineract/loan/starter/AcmeLoanAutoConfiguration.java b/custom/acme/loan/starter/src/main/java/com/acme/fineract/loan/starter/AcmeLoanAutoConfiguration.java
index 91dc820c0..8e4560a32 100644
--- a/custom/acme/loan/starter/src/main/java/com/acme/fineract/loan/starter/AcmeLoanAutoConfiguration.java
+++ b/custom/acme/loan/starter/src/main/java/com/acme/fineract/loan/starter/AcmeLoanAutoConfiguration.java
@@ -18,11 +18,25 @@
*/
package com.acme.fineract.loan.starter;
+import com.acme.fineract.loan.processor.AcmeLoanRepaymentScheduleTransactionProcessor;
+import java.util.List;
+import org.apache.fineract.portfolio.loanaccount.domain.LoanRepaymentScheduleTransactionProcessorFactory;
+import org.apache.fineract.portfolio.loanaccount.domain.transactionprocessor.LoanRepaymentScheduleTransactionProcessor;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.ComponentScans;
@AutoConfiguration
-@ComponentScan("com.acme.fineract.loan.cob")
+@ComponentScans({ @ComponentScan("com.acme.fineract.loan.cob"), @ComponentScan("com.acme.fineract.loan.processor") })
@ConditionalOnProperty("acme.loan.enabled")
-public class AcmeLoanAutoConfiguration {}
+public class AcmeLoanAutoConfiguration {
+
+ @Bean
+ public LoanRepaymentScheduleTransactionProcessorFactory loanRepaymentScheduleTransactionProcessorFactory(
+ AcmeLoanRepaymentScheduleTransactionProcessor defaultLoanRepaymentScheduleTransactionProcessor,
+ List processors) {
+ return new LoanRepaymentScheduleTransactionProcessorFactory(defaultLoanRepaymentScheduleTransactionProcessor, processors);
+ }
+}
diff --git a/custom/docker/build.gradle b/custom/docker/build.gradle
index 8d1a91711..98b65ed18 100644
--- a/custom/docker/build.gradle
+++ b/custom/docker/build.gradle
@@ -85,7 +85,7 @@ jib {
}
// NOTE: other custom dependencies
implementation 'org.mariadb.jdbc:mariadb-java-client:3.0.7'
- implementation 'mysql:mysql-connector-java:8.0.30'
+ implementation 'mysql:mysql-connector-java:8.0.31'
implementation 'org.postgresql:postgresql:42.5.0'
annotationProcessor('org.springframework.boot:spring-boot-autoconfigure-processor')
annotationProcessor('org.springframework.boot:spring-boot-configuration-processor')
diff --git a/fineract-avro-schemas/src/main/avro/loan/v1/LoanAccountDataV1.avsc b/fineract-avro-schemas/src/main/avro/loan/v1/LoanAccountDataV1.avsc
index c8e925c9c..ad628df93 100644
--- a/fineract-avro-schemas/src/main/avro/loan/v1/LoanAccountDataV1.avsc
+++ b/fineract-avro-schemas/src/main/avro/loan/v1/LoanAccountDataV1.avsc
@@ -341,10 +341,10 @@
},
{
"default": null,
- "name": "transactionProcessingStrategyId",
+ "name": "transactionProcessingStrategyCode",
"type": [
"null",
- "long"
+ "string"
]
},
{
diff --git a/fineract-avro-schemas/src/main/avro/loan/v1/LoanProductDataV1.avsc b/fineract-avro-schemas/src/main/avro/loan/v1/LoanProductDataV1.avsc
index 935c96906..35f6cff0b 100644
--- a/fineract-avro-schemas/src/main/avro/loan/v1/LoanProductDataV1.avsc
+++ b/fineract-avro-schemas/src/main/avro/loan/v1/LoanProductDataV1.avsc
@@ -341,10 +341,10 @@
},
{
"default": null,
- "name": "transactionProcessingStrategyId",
+ "name": "transactionProcessingStrategyCode",
"type": [
"null",
- "long"
+ "string"
]
},
{
diff --git a/fineract-db/multi-tenant-demo-backups/bare-bones-demo/bk_bare_bones_demo.sql b/fineract-db/multi-tenant-demo-backups/bare-bones-demo/bk_bare_bones_demo.sql
index 4e810f636..0c34151db 100644
--- a/fineract-db/multi-tenant-demo-backups/bare-bones-demo/bk_bare_bones_demo.sql
+++ b/fineract-db/multi-tenant-demo-backups/bare-bones-demo/bk_bare_bones_demo.sql
@@ -1011,7 +1011,6 @@ CREATE TABLE `m_loan` (
KEY `FKB6F935D87179A0CB` (`client_id`),
KEY `FKB6F935D8C8D4B434` (`product_id`),
KEY `FK7C885877240145` (`fund_id`),
- KEY `FK_loan_ltp_strategy` (`loan_transaction_strategy_id`),
KEY `FK_m_loan_m_staff` (`loan_officer_id`),
KEY `group_id` (`group_id`),
KEY `FK_m_loanpurpose_codevalue` (`loanpurpose_cv_id`),
@@ -1027,7 +1026,6 @@ CREATE TABLE `m_loan` (
CONSTRAINT `FK_approvedon_userid` FOREIGN KEY (`approvedon_userid`) REFERENCES `m_appuser` (`id`),
CONSTRAINT `FK_closedon_userid` FOREIGN KEY (`closedon_userid`) REFERENCES `m_appuser` (`id`),
CONSTRAINT `FK_disbursedon_userid` FOREIGN KEY (`disbursedon_userid`) REFERENCES `m_appuser` (`id`),
- CONSTRAINT `FK_loan_ltp_strategy` FOREIGN KEY (`loan_transaction_strategy_id`) REFERENCES `ref_loan_transaction_processing_strategy` (`id`),
CONSTRAINT `FK_m_loanpurpose_codevalue` FOREIGN KEY (`loanpurpose_cv_id`) REFERENCES `m_code_value` (`id`),
CONSTRAINT `FK_m_loan_m_staff` FOREIGN KEY (`loan_officer_id`) REFERENCES `m_staff` (`id`),
CONSTRAINT `FK_rejectedon_userid` FOREIGN KEY (`rejectedon_userid`) REFERENCES `m_appuser` (`id`),
@@ -1506,9 +1504,7 @@ CREATE TABLE `m_product_loan` (
PRIMARY KEY (`id`),
UNIQUE KEY `unq_name` (`name`),
KEY `FKA6A8A7D77240145` (`fund_id`),
- KEY `FK_ltp_strategy` (`loan_transaction_strategy_id`),
- CONSTRAINT `FKA6A8A7D77240145` FOREIGN KEY (`fund_id`) REFERENCES `m_fund` (`id`),
- CONSTRAINT `FK_ltp_strategy` FOREIGN KEY (`loan_transaction_strategy_id`) REFERENCES `ref_loan_transaction_processing_strategy` (`id`)
+ CONSTRAINT `FKA6A8A7D77240145` FOREIGN KEY (`fund_id`) REFERENCES `m_fund` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
/*!40101 SET character_set_client = @saved_cs_client */;
@@ -1770,36 +1766,6 @@ INSERT INTO `r_enum_value` VALUES ('amortization_method_enum',0,'Equal principle
/*!40000 ALTER TABLE `r_enum_value` ENABLE KEYS */;
UNLOCK TABLES;
---
--- Table structure for table `ref_loan_transaction_processing_strategy`
---
-
-DROP TABLE IF EXISTS `ref_loan_transaction_processing_strategy`;
-/*!40101 SET @saved_cs_client = @@character_set_client */;
-/*!40101 SET character_set_client = UTF8MB4 */;
-CREATE TABLE `ref_loan_transaction_processing_strategy` (
- `id` BIGINT NOT NULL AUTO_INCREMENT,
- `code` varchar(100) DEFAULT NULL,
- `name` varchar(255) DEFAULT NULL,
- `createdby_id` BIGINT DEFAULT NULL,
- `created_date` datetime DEFAULT NULL,
- `lastmodifiedby_id` BIGINT DEFAULT NULL,
- `lastmodified_date` datetime DEFAULT NULL,
- PRIMARY KEY (`id`),
- UNIQUE KEY `ltp_strategy_code` (`code`)
-) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=UTF8MB4;
-/*!40101 SET character_set_client = @saved_cs_client */;
-
---
--- Dumping data for table `ref_loan_transaction_processing_strategy`
---
-
-LOCK TABLES `ref_loan_transaction_processing_strategy` WRITE;
-/*!40000 ALTER TABLE `ref_loan_transaction_processing_strategy` DISABLE KEYS */;
-INSERT INTO `ref_loan_transaction_processing_strategy` VALUES (1,'mifos-standard-strategy','Mifos style',NULL,NULL,NULL,NULL),(2,'heavensfamily-strategy','Heavensfamily',NULL,NULL,NULL,NULL),(3,'creocore-strategy','Creocore',NULL,NULL,NULL,NULL),(4,'rbi-india-strategy','RBI (India)',NULL,NULL,NULL,NULL);
-/*!40000 ALTER TABLE `ref_loan_transaction_processing_strategy` ENABLE KEYS */;
-UNLOCK TABLES;
-
--
-- Table structure for table `rpt_sequence`
--
diff --git a/fineract-db/multi-tenant-demo-backups/bk_mifostenant_default.sql b/fineract-db/multi-tenant-demo-backups/bk_mifostenant_default.sql
index 61da348c6..ef70237b6 100644
--- a/fineract-db/multi-tenant-demo-backups/bk_mifostenant_default.sql
+++ b/fineract-db/multi-tenant-demo-backups/bk_mifostenant_default.sql
@@ -1012,7 +1012,6 @@ CREATE TABLE `m_loan` (
KEY `FKB6F935D87179A0CB` (`client_id`),
KEY `FKB6F935D8C8D4B434` (`product_id`),
KEY `FK7C885877240145` (`fund_id`),
- KEY `FK_loan_ltp_strategy` (`loan_transaction_strategy_id`),
KEY `FK_m_loan_m_staff` (`loan_officer_id`),
KEY `group_id` (`group_id`),
KEY `FK_m_loanpurpose_codevalue` (`loanpurpose_cv_id`),
@@ -1028,7 +1027,6 @@ CREATE TABLE `m_loan` (
CONSTRAINT `FK_approvedon_userid` FOREIGN KEY (`approvedon_userid`) REFERENCES `m_appuser` (`id`),
CONSTRAINT `FK_closedon_userid` FOREIGN KEY (`closedon_userid`) REFERENCES `m_appuser` (`id`),
CONSTRAINT `FK_disbursedon_userid` FOREIGN KEY (`disbursedon_userid`) REFERENCES `m_appuser` (`id`),
- CONSTRAINT `FK_loan_ltp_strategy` FOREIGN KEY (`loan_transaction_strategy_id`) REFERENCES `ref_loan_transaction_processing_strategy` (`id`),
CONSTRAINT `FK_m_loanpurpose_codevalue` FOREIGN KEY (`loanpurpose_cv_id`) REFERENCES `m_code_value` (`id`),
CONSTRAINT `FK_m_loan_m_staff` FOREIGN KEY (`loan_officer_id`) REFERENCES `m_staff` (`id`),
CONSTRAINT `FK_rejectedon_userid` FOREIGN KEY (`rejectedon_userid`) REFERENCES `m_appuser` (`id`),
@@ -1507,9 +1505,7 @@ CREATE TABLE `m_product_loan` (
PRIMARY KEY (`id`),
UNIQUE KEY `unq_name` (`name`),
KEY `FKA6A8A7D77240145` (`fund_id`),
- KEY `FK_ltp_strategy` (`loan_transaction_strategy_id`),
- CONSTRAINT `FKA6A8A7D77240145` FOREIGN KEY (`fund_id`) REFERENCES `m_fund` (`id`),
- CONSTRAINT `FK_ltp_strategy` FOREIGN KEY (`loan_transaction_strategy_id`) REFERENCES `ref_loan_transaction_processing_strategy` (`id`)
+ CONSTRAINT `FKA6A8A7D77240145` FOREIGN KEY (`fund_id`) REFERENCES `m_fund` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=UTF8MB4;
/*!40101 SET character_set_client = @saved_cs_client */;
@@ -1771,36 +1767,6 @@ INSERT INTO `r_enum_value` VALUES ('amortization_method_enum',0,'Equal principle
/*!40000 ALTER TABLE `r_enum_value` ENABLE KEYS */;
UNLOCK TABLES;
---
--- Table structure for table `ref_loan_transaction_processing_strategy`
---
-
-DROP TABLE IF EXISTS `ref_loan_transaction_processing_strategy`;
-/*!40101 SET @saved_cs_client = @@character_set_client */;
-/*!40101 SET character_set_client = UTF8MB4 */;
-CREATE TABLE `ref_loan_transaction_processing_strategy` (
- `id` BIGINT NOT NULL AUTO_INCREMENT,
- `code` varchar(100) DEFAULT NULL,
- `name` varchar(255) DEFAULT NULL,
- `createdby_id` BIGINT DEFAULT NULL,
- `created_date` datetime DEFAULT NULL,
- `lastmodifiedby_id` BIGINT DEFAULT NULL,
- `lastmodified_date` datetime DEFAULT NULL,
- PRIMARY KEY (`id`),
- UNIQUE KEY `ltp_strategy_code` (`code`)
-) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=UTF8MB4;
-/*!40101 SET character_set_client = @saved_cs_client */;
-
---
--- Dumping data for table `ref_loan_transaction_processing_strategy`
---
-
-LOCK TABLES `ref_loan_transaction_processing_strategy` WRITE;
-/*!40000 ALTER TABLE `ref_loan_transaction_processing_strategy` DISABLE KEYS */;
-INSERT INTO `ref_loan_transaction_processing_strategy` VALUES (1,'mifos-standard-strategy','Mifos style',NULL,NULL,NULL,NULL),(2,'heavensfamily-strategy','Heavensfamily',NULL,NULL,NULL,NULL),(3,'creocore-strategy','Creocore',NULL,NULL,NULL,NULL),(4,'rbi-india-strategy','RBI (India)',NULL,NULL,NULL,NULL);
-/*!40000 ALTER TABLE `ref_loan_transaction_processing_strategy` ENABLE KEYS */;
-UNLOCK TABLES;
-
--
-- Table structure for table `rpt_sequence`
--
diff --git a/fineract-db/multi-tenant-demo-backups/ceda/bk_ceda_trial.sql b/fineract-db/multi-tenant-demo-backups/ceda/bk_ceda_trial.sql
index 766a63645..5ed8ef07d 100644
--- a/fineract-db/multi-tenant-demo-backups/ceda/bk_ceda_trial.sql
+++ b/fineract-db/multi-tenant-demo-backups/ceda/bk_ceda_trial.sql
@@ -930,7 +930,6 @@ CREATE TABLE `m_loan` (
KEY `FKB6F935D87179A0CB` (`client_id`),
KEY `FKB6F935D8C8D4B434` (`product_id`),
KEY `FK7C885877240145` (`fund_id`),
- KEY `FK_loan_ltp_strategy` (`loan_transaction_strategy_id`),
KEY `FK_m_loan_m_staff` (`loan_officer_id`),
KEY `group_id` (`group_id`),
KEY `FK_m_loanpurpose_codevalue` (`loanpurpose_cv_id`),
@@ -946,7 +945,6 @@ CREATE TABLE `m_loan` (
CONSTRAINT `FK_approvedon_userid` FOREIGN KEY (`approvedon_userid`) REFERENCES `m_appuser` (`id`),
CONSTRAINT `FK_closedon_userid` FOREIGN KEY (`closedon_userid`) REFERENCES `m_appuser` (`id`),
CONSTRAINT `FK_disbursedon_userid` FOREIGN KEY (`disbursedon_userid`) REFERENCES `m_appuser` (`id`),
- CONSTRAINT `FK_loan_ltp_strategy` FOREIGN KEY (`loan_transaction_strategy_id`) REFERENCES `ref_loan_transaction_processing_strategy` (`id`),
CONSTRAINT `FK_m_loanpurpose_codevalue` FOREIGN KEY (`loanpurpose_cv_id`) REFERENCES `m_code_value` (`id`),
CONSTRAINT `FK_m_loan_m_staff` FOREIGN KEY (`loan_officer_id`) REFERENCES `m_staff` (`id`),
CONSTRAINT `FK_rejectedon_userid` FOREIGN KEY (`rejectedon_userid`) REFERENCES `m_appuser` (`id`),
@@ -1399,7 +1397,7 @@ CREATE TABLE `m_portfolio_command_source` (
LOCK TABLES `m_portfolio_command_source` WRITE;
/*!40000 ALTER TABLE `m_portfolio_command_source` DISABLE KEYS */;
-INSERT INTO `m_portfolio_command_source` VALUES (1,'CREATE','CLIENT',2,NULL,1,NULL,NULL,'/clients/template',1,NULL,'{\"officeId\":\"2\",\"firstname\":\"Test\",\"middlename\":\"\",\"lastname\":\"One\",\"fullname\":\"\",\"externalId\":\"\",\"dateFormat\":\"yyyy-MM-dd\",\"locale\":\"en\",\"joinedDate\":\"2011-02-01\"}',1,'2013-04-05 12:38:05',NULL,NULL,1),(2,'CREATE','LOAN',2,NULL,1,1,NULL,'/loans',1,NULL,'{\"clientId\":\"1\",\"dateFormat\":\"yyyy-MM-dd\",\"locale\":\"en\",\"productId\":\"1\",\"loanOfficerId\":\"2\",\"submittedOnDate\":\"2011-04-01\",\"loanPurposeId\":\"25\",\"principal\":\"1,000,000.00\",\"loanTermFrequency\":\"12\",\"loanTermFrequencyType\":\"2\",\"numberOfRepayments\":\"12\",\"repaymentEvery\":\"1\",\"repaymentFrequencyType\":\"2\",\"interestRatePerPeriod\":\"24\",\"interestRateFrequencyType\":\"3\",\"expectedDisbursementDate\":\"2011-04-01\",\"amortizationType\":\"1\",\"interestType\":\"1\",\"interestCalculationPeriodType\":\"1\",\"inArrearsTolerance\":\"\",\"transactionProcessingStrategyId\":\"2\",\"repaymentsStartingFromDate\":\"\",\"interestChargedFromDate\":\"\",\"charges\":[{\"chargeId\":\"1\",\"amount\":\"1,500\",\"dueDate\":\"2011-05-01\"},{\"chargeId\":\"1\",\"amount\":\"1,500\",\"dueDate\":\"2011-06-01\"},{\"chargeId\":\"1\",\"amount\":\"1,500\",\"dueDate\":\"2011-07-01\"},{\"chargeId\":\"1\",\"amount\":\"1,500\",\"dueDate\":\"2011-08-01\"},{\"chargeId\":\"1\",\"amount\":\"1,500\",\"dueDate\":\"2011-09-01\"},{\"chargeId\":\"1\",\"amount\":\"1,500\",\"dueDate\":\"2011-10-01\"},{\"chargeId\":\"1\",\"amount\":\"1,500\",\"dueDate\":\"2011-11-01\"},{\"chargeId\":\"1\",\"amount\":\"1,500\",\"dueDate\":\"2011-12-01\"},{\"chargeId\":\"1\",\"amount\":\"1,500\",\"dueDate\":\"2012-01-01\"},{\"chargeId\":\"1\",\"amount\":\"1,500\",\"dueDate\":\"2012-02-01\"},{\"chargeId\":\"1\",\"amount\":\"1,500\",\"dueDate\":\"2012-03-01\"},{\"chargeId\":\"1\",\"amount\":\"1,500\",\"dueDate\":\"2012-04-01\"}],\"collateral\":[{\"id\":\"\",\"type\":\"23\",\"description\":\" small description.\",\"value\":\"\"}]}',1,'2013-04-05 12:41:57',NULL,NULL,1),(3,'APPROVE','LOAN',2,NULL,1,1,NULL,'/loans/1',1,NULL,'{\"status\":{\"id\":200,\"code\":\"loanStatusType.approved\",\"value\":\"Approved\",\"pendingApproval\":false,\"waitingForDisbursal\":true,\"active\":false,\"closedObligationsMet\":false,\"closedWrittenOff\":false,\"closedRescheduled\":false,\"closed\":false,\"overpaid\":false},\"locale\":\"en\",\"dateFormat\":\"yyyy-MM-dd\",\"approvedOnDate\":\"2011-04-01\"}',1,'2013-04-05 12:42:09',NULL,NULL,1);
+INSERT INTO `m_portfolio_command_source` VALUES (1,'CREATE','CLIENT',2,NULL,1,NULL,NULL,'/clients/template',1,NULL,'{\"officeId\":\"2\",\"firstname\":\"Test\",\"middlename\":\"\",\"lastname\":\"One\",\"fullname\":\"\",\"externalId\":\"\",\"dateFormat\":\"yyyy-MM-dd\",\"locale\":\"en\",\"joinedDate\":\"2011-02-01\"}',1,'2013-04-05 12:38:05',NULL,NULL,1),(2,'CREATE','LOAN',2,NULL,1,1,NULL,'/loans',1,NULL,'{\"clientId\":\"1\",\"dateFormat\":\"yyyy-MM-dd\",\"locale\":\"en\",\"productId\":\"1\",\"loanOfficerId\":\"2\",\"submittedOnDate\":\"2011-04-01\",\"loanPurposeId\":\"25\",\"principal\":\"1,000,000.00\",\"loanTermFrequency\":\"12\",\"loanTermFrequencyType\":\"2\",\"numberOfRepayments\":\"12\",\"repaymentEvery\":\"1\",\"repaymentFrequencyType\":\"2\",\"interestRatePerPeriod\":\"24\",\"interestRateFrequencyType\":\"3\",\"expectedDisbursementDate\":\"2011-04-01\",\"amortizationType\":\"1\",\"interestType\":\"1\",\"interestCalculationPeriodType\":\"1\",\"inArrearsTolerance\":\"\",\"transactionProcessingStrategy\":\"heavensfamily-strategy\",\"repaymentsStartingFromDate\":\"\",\"interestChargedFromDate\":\"\",\"charges\":[{\"chargeId\":\"1\",\"amount\":\"1,500\",\"dueDate\":\"2011-05-01\"},{\"chargeId\":\"1\",\"amount\":\"1,500\",\"dueDate\":\"2011-06-01\"},{\"chargeId\":\"1\",\"amount\":\"1,500\",\"dueDate\":\"2011-07-01\"},{\"chargeId\":\"1\",\"amount\":\"1,500\",\"dueDate\":\"2011-08-01\"},{\"chargeId\":\"1\",\"amount\":\"1,500\",\"dueDate\":\"2011-09-01\"},{\"chargeId\":\"1\",\"amount\":\"1,500\",\"dueDate\":\"2011-10-01\"},{\"chargeId\":\"1\",\"amount\":\"1,500\",\"dueDate\":\"2011-11-01\"},{\"chargeId\":\"1\",\"amount\":\"1,500\",\"dueDate\":\"2011-12-01\"},{\"chargeId\":\"1\",\"amount\":\"1,500\",\"dueDate\":\"2012-01-01\"},{\"chargeId\":\"1\",\"amount\":\"1,500\",\"dueDate\":\"2012-02-01\"},{\"chargeId\":\"1\",\"amount\":\"1,500\",\"dueDate\":\"2012-03-01\"},{\"chargeId\":\"1\",\"amount\":\"1,500\",\"dueDate\":\"2012-04-01\"}],\"collateral\":[{\"id\":\"\",\"type\":\"23\",\"description\":\" small description.\",\"value\":\"\"}]}',1,'2013-04-05 12:41:57',NULL,NULL,1),(3,'APPROVE','LOAN',2,NULL,1,1,NULL,'/loans/1',1,NULL,'{\"status\":{\"id\":200,\"code\":\"loanStatusType.approved\",\"value\":\"Approved\",\"pendingApproval\":false,\"waitingForDisbursal\":true,\"active\":false,\"closedObligationsMet\":false,\"closedWrittenOff\":false,\"closedRescheduled\":false,\"closed\":false,\"overpaid\":false},\"locale\":\"en\",\"dateFormat\":\"yyyy-MM-dd\",\"approvedOnDate\":\"2011-04-01\"}',1,'2013-04-05 12:42:09',NULL,NULL,1);
/*!40000 ALTER TABLE `m_portfolio_command_source` ENABLE KEYS */;
UNLOCK TABLES;
@@ -1435,9 +1433,7 @@ CREATE TABLE `m_product_loan` (
PRIMARY KEY (`id`),
UNIQUE KEY `unq_name` (`name`),
KEY `FKA6A8A7D77240145` (`fund_id`),
- KEY `FK_ltp_strategy` (`loan_transaction_strategy_id`),
- CONSTRAINT `FKA6A8A7D77240145` FOREIGN KEY (`fund_id`) REFERENCES `m_fund` (`id`),
- CONSTRAINT `FK_ltp_strategy` FOREIGN KEY (`loan_transaction_strategy_id`) REFERENCES `ref_loan_transaction_processing_strategy` (`id`)
+ CONSTRAINT `FKA6A8A7D77240145` FOREIGN KEY (`fund_id`) REFERENCES `m_fund` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=UTF8MB4;
/*!40101 SET character_set_client = @saved_cs_client */;
@@ -1709,36 +1705,6 @@ INSERT INTO `r_enum_value` VALUES ('amortization_method_enum',0,'Equal principle
/*!40000 ALTER TABLE `r_enum_value` ENABLE KEYS */;
UNLOCK TABLES;
---
--- Table structure for table `ref_loan_transaction_processing_strategy`
---
-
-DROP TABLE IF EXISTS `ref_loan_transaction_processing_strategy`;
-/*!40101 SET @saved_cs_client = @@character_set_client */;
-/*!40101 SET character_set_client = UTF8MB4 */;
-CREATE TABLE `ref_loan_transaction_processing_strategy` (
- `id` BIGINT NOT NULL AUTO_INCREMENT,
- `code` varchar(100) DEFAULT NULL,
- `name` varchar(255) DEFAULT NULL,
- `createdby_id` BIGINT DEFAULT NULL,
- `created_date` datetime DEFAULT NULL,
- `lastmodifiedby_id` BIGINT DEFAULT NULL,
- `lastmodified_date` datetime DEFAULT NULL,
- PRIMARY KEY (`id`),
- UNIQUE KEY `ltp_strategy_code` (`code`)
-) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=UTF8MB4;
-/*!40101 SET character_set_client = @saved_cs_client */;
-
---
--- Dumping data for table `ref_loan_transaction_processing_strategy`
---
-
-LOCK TABLES `ref_loan_transaction_processing_strategy` WRITE;
-/*!40000 ALTER TABLE `ref_loan_transaction_processing_strategy` DISABLE KEYS */;
-INSERT INTO `ref_loan_transaction_processing_strategy` VALUES (2,'heavensfamily-strategy','Heavensfamily',NULL,NULL,NULL,NULL);
-/*!40000 ALTER TABLE `ref_loan_transaction_processing_strategy` ENABLE KEYS */;
-UNLOCK TABLES;
-
--
-- Table structure for table `rpt_sequence`
--
diff --git a/fineract-db/multi-tenant-demo-backups/ceda/bk_core_with_custom_and_coa.sql b/fineract-db/multi-tenant-demo-backups/ceda/bk_core_with_custom_and_coa.sql
index 0628d7668..f4672ec00 100644
--- a/fineract-db/multi-tenant-demo-backups/ceda/bk_core_with_custom_and_coa.sql
+++ b/fineract-db/multi-tenant-demo-backups/ceda/bk_core_with_custom_and_coa.sql
@@ -930,7 +930,6 @@ CREATE TABLE `m_loan` (
KEY `FKB6F935D87179A0CB` (`client_id`),
KEY `FKB6F935D8C8D4B434` (`product_id`),
KEY `FK7C885877240145` (`fund_id`),
- KEY `FK_loan_ltp_strategy` (`loan_transaction_strategy_id`),
KEY `FK_m_loan_m_staff` (`loan_officer_id`),
KEY `group_id` (`group_id`),
KEY `FK_m_loanpurpose_codevalue` (`loanpurpose_cv_id`),
@@ -946,7 +945,6 @@ CREATE TABLE `m_loan` (
CONSTRAINT `FK_approvedon_userid` FOREIGN KEY (`approvedon_userid`) REFERENCES `m_appuser` (`id`),
CONSTRAINT `FK_closedon_userid` FOREIGN KEY (`closedon_userid`) REFERENCES `m_appuser` (`id`),
CONSTRAINT `FK_disbursedon_userid` FOREIGN KEY (`disbursedon_userid`) REFERENCES `m_appuser` (`id`),
- CONSTRAINT `FK_loan_ltp_strategy` FOREIGN KEY (`loan_transaction_strategy_id`) REFERENCES `ref_loan_transaction_processing_strategy` (`id`),
CONSTRAINT `FK_m_loanpurpose_codevalue` FOREIGN KEY (`loanpurpose_cv_id`) REFERENCES `m_code_value` (`id`),
CONSTRAINT `FK_m_loan_m_staff` FOREIGN KEY (`loan_officer_id`) REFERENCES `m_staff` (`id`),
CONSTRAINT `FK_rejectedon_userid` FOREIGN KEY (`rejectedon_userid`) REFERENCES `m_appuser` (`id`),
@@ -1399,7 +1397,7 @@ CREATE TABLE `m_portfolio_command_source` (
LOCK TABLES `m_portfolio_command_source` WRITE;
/*!40000 ALTER TABLE `m_portfolio_command_source` DISABLE KEYS */;
-INSERT INTO `m_portfolio_command_source` VALUES (1,'CREATE','CLIENT',2,NULL,1,NULL,NULL,'/clients/template',1,NULL,'{\"officeId\":\"2\",\"firstname\":\"Test\",\"middlename\":\"\",\"lastname\":\"One\",\"fullname\":\"\",\"externalId\":\"\",\"dateFormat\":\"yyyy-MM-dd\",\"locale\":\"en\",\"joinedDate\":\"2011-02-01\"}',1,'2013-04-05 12:38:05',NULL,NULL,1),(2,'CREATE','LOAN',2,NULL,1,1,NULL,'/loans',1,NULL,'{\"clientId\":\"1\",\"dateFormat\":\"yyyy-MM-dd\",\"locale\":\"en\",\"productId\":\"1\",\"loanOfficerId\":\"2\",\"submittedOnDate\":\"2011-04-01\",\"loanPurposeId\":\"25\",\"principal\":\"1,000,000.00\",\"loanTermFrequency\":\"12\",\"loanTermFrequencyType\":\"2\",\"numberOfRepayments\":\"12\",\"repaymentEvery\":\"1\",\"repaymentFrequencyType\":\"2\",\"interestRatePerPeriod\":\"24\",\"interestRateFrequencyType\":\"3\",\"expectedDisbursementDate\":\"2011-04-01\",\"amortizationType\":\"1\",\"interestType\":\"1\",\"interestCalculationPeriodType\":\"1\",\"inArrearsTolerance\":\"\",\"transactionProcessingStrategyId\":\"2\",\"repaymentsStartingFromDate\":\"\",\"interestChargedFromDate\":\"\",\"charges\":[{\"chargeId\":\"1\",\"amount\":\"1,500\",\"dueDate\":\"2011-05-01\"},{\"chargeId\":\"1\",\"amount\":\"1,500\",\"dueDate\":\"2011-06-01\"},{\"chargeId\":\"1\",\"amount\":\"1,500\",\"dueDate\":\"2011-07-01\"},{\"chargeId\":\"1\",\"amount\":\"1,500\",\"dueDate\":\"2011-08-01\"},{\"chargeId\":\"1\",\"amount\":\"1,500\",\"dueDate\":\"2011-09-01\"},{\"chargeId\":\"1\",\"amount\":\"1,500\",\"dueDate\":\"2011-10-01\"},{\"chargeId\":\"1\",\"amount\":\"1,500\",\"dueDate\":\"2011-11-01\"},{\"chargeId\":\"1\",\"amount\":\"1,500\",\"dueDate\":\"2011-12-01\"},{\"chargeId\":\"1\",\"amount\":\"1,500\",\"dueDate\":\"2012-01-01\"},{\"chargeId\":\"1\",\"amount\":\"1,500\",\"dueDate\":\"2012-02-01\"},{\"chargeId\":\"1\",\"amount\":\"1,500\",\"dueDate\":\"2012-03-01\"},{\"chargeId\":\"1\",\"amount\":\"1,500\",\"dueDate\":\"2012-04-01\"}],\"collateral\":[{\"id\":\"\",\"type\":\"23\",\"description\":\" small description.\",\"value\":\"\"}]}',1,'2013-04-05 12:41:57',NULL,NULL,1),(3,'APPROVE','LOAN',2,NULL,1,1,NULL,'/loans/1',1,NULL,'{\"status\":{\"id\":200,\"code\":\"loanStatusType.approved\",\"value\":\"Approved\",\"pendingApproval\":false,\"waitingForDisbursal\":true,\"active\":false,\"closedObligationsMet\":false,\"closedWrittenOff\":false,\"closedRescheduled\":false,\"closed\":false,\"overpaid\":false},\"locale\":\"en\",\"dateFormat\":\"yyyy-MM-dd\",\"approvedOnDate\":\"2011-04-01\"}',1,'2013-04-05 12:42:09',NULL,NULL,1);
+INSERT INTO `m_portfolio_command_source` VALUES (1,'CREATE','CLIENT',2,NULL,1,NULL,NULL,'/clients/template',1,NULL,'{\"officeId\":\"2\",\"firstname\":\"Test\",\"middlename\":\"\",\"lastname\":\"One\",\"fullname\":\"\",\"externalId\":\"\",\"dateFormat\":\"yyyy-MM-dd\",\"locale\":\"en\",\"joinedDate\":\"2011-02-01\"}',1,'2013-04-05 12:38:05',NULL,NULL,1),(2,'CREATE','LOAN',2,NULL,1,1,NULL,'/loans',1,NULL,'{\"clientId\":\"1\",\"dateFormat\":\"yyyy-MM-dd\",\"locale\":\"en\",\"productId\":\"1\",\"loanOfficerId\":\"2\",\"submittedOnDate\":\"2011-04-01\",\"loanPurposeId\":\"25\",\"principal\":\"1,000,000.00\",\"loanTermFrequency\":\"12\",\"loanTermFrequencyType\":\"2\",\"numberOfRepayments\":\"12\",\"repaymentEvery\":\"1\",\"repaymentFrequencyType\":\"2\",\"interestRatePerPeriod\":\"24\",\"interestRateFrequencyType\":\"3\",\"expectedDisbursementDate\":\"2011-04-01\",\"amortizationType\":\"1\",\"interestType\":\"1\",\"interestCalculationPeriodType\":\"1\",\"inArrearsTolerance\":\"\",\"transactionProcessingStrategy\":\"heavensfamily-strategy\",\"repaymentsStartingFromDate\":\"\",\"interestChargedFromDate\":\"\",\"charges\":[{\"chargeId\":\"1\",\"amount\":\"1,500\",\"dueDate\":\"2011-05-01\"},{\"chargeId\":\"1\",\"amount\":\"1,500\",\"dueDate\":\"2011-06-01\"},{\"chargeId\":\"1\",\"amount\":\"1,500\",\"dueDate\":\"2011-07-01\"},{\"chargeId\":\"1\",\"amount\":\"1,500\",\"dueDate\":\"2011-08-01\"},{\"chargeId\":\"1\",\"amount\":\"1,500\",\"dueDate\":\"2011-09-01\"},{\"chargeId\":\"1\",\"amount\":\"1,500\",\"dueDate\":\"2011-10-01\"},{\"chargeId\":\"1\",\"amount\":\"1,500\",\"dueDate\":\"2011-11-01\"},{\"chargeId\":\"1\",\"amount\":\"1,500\",\"dueDate\":\"2011-12-01\"},{\"chargeId\":\"1\",\"amount\":\"1,500\",\"dueDate\":\"2012-01-01\"},{\"chargeId\":\"1\",\"amount\":\"1,500\",\"dueDate\":\"2012-02-01\"},{\"chargeId\":\"1\",\"amount\":\"1,500\",\"dueDate\":\"2012-03-01\"},{\"chargeId\":\"1\",\"amount\":\"1,500\",\"dueDate\":\"2012-04-01\"}],\"collateral\":[{\"id\":\"\",\"type\":\"23\",\"description\":\" small description.\",\"value\":\"\"}]}',1,'2013-04-05 12:41:57',NULL,NULL,1),(3,'APPROVE','LOAN',2,NULL,1,1,NULL,'/loans/1',1,NULL,'{\"status\":{\"id\":200,\"code\":\"loanStatusType.approved\",\"value\":\"Approved\",\"pendingApproval\":false,\"waitingForDisbursal\":true,\"active\":false,\"closedObligationsMet\":false,\"closedWrittenOff\":false,\"closedRescheduled\":false,\"closed\":false,\"overpaid\":false},\"locale\":\"en\",\"dateFormat\":\"yyyy-MM-dd\",\"approvedOnDate\":\"2011-04-01\"}',1,'2013-04-05 12:42:09',NULL,NULL,1);
/*!40000 ALTER TABLE `m_portfolio_command_source` ENABLE KEYS */;
UNLOCK TABLES;
@@ -1435,9 +1433,7 @@ CREATE TABLE `m_product_loan` (
PRIMARY KEY (`id`),
UNIQUE KEY `unq_name` (`name`),
KEY `FKA6A8A7D77240145` (`fund_id`),
- KEY `FK_ltp_strategy` (`loan_transaction_strategy_id`),
- CONSTRAINT `FKA6A8A7D77240145` FOREIGN KEY (`fund_id`) REFERENCES `m_fund` (`id`),
- CONSTRAINT `FK_ltp_strategy` FOREIGN KEY (`loan_transaction_strategy_id`) REFERENCES `ref_loan_transaction_processing_strategy` (`id`)
+ CONSTRAINT `FKA6A8A7D77240145` FOREIGN KEY (`fund_id`) REFERENCES `m_fund` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=UTF8MB4;
/*!40101 SET character_set_client = @saved_cs_client */;
@@ -1709,36 +1705,6 @@ INSERT INTO `r_enum_value` VALUES ('amortization_method_enum',0,'Equal principle
/*!40000 ALTER TABLE `r_enum_value` ENABLE KEYS */;
UNLOCK TABLES;
---
--- Table structure for table `ref_loan_transaction_processing_strategy`
---
-
-DROP TABLE IF EXISTS `ref_loan_transaction_processing_strategy`;
-/*!40101 SET @saved_cs_client = @@character_set_client */;
-/*!40101 SET character_set_client = UTF8MB4 */;
-CREATE TABLE `ref_loan_transaction_processing_strategy` (
- `id` BIGINT NOT NULL AUTO_INCREMENT,
- `code` varchar(100) DEFAULT NULL,
- `name` varchar(255) DEFAULT NULL,
- `createdby_id` BIGINT DEFAULT NULL,
- `created_date` datetime DEFAULT NULL,
- `lastmodifiedby_id` BIGINT DEFAULT NULL,
- `lastmodified_date` datetime DEFAULT NULL,
- PRIMARY KEY (`id`),
- UNIQUE KEY `ltp_strategy_code` (`code`)
-) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=UTF8MB4;
-/*!40101 SET character_set_client = @saved_cs_client */;
-
---
--- Dumping data for table `ref_loan_transaction_processing_strategy`
---
-
-LOCK TABLES `ref_loan_transaction_processing_strategy` WRITE;
-/*!40000 ALTER TABLE `ref_loan_transaction_processing_strategy` DISABLE KEYS */;
-INSERT INTO `ref_loan_transaction_processing_strategy` VALUES (2,'heavensfamily-strategy','Heavensfamily',NULL,NULL,NULL,NULL);
-/*!40000 ALTER TABLE `ref_loan_transaction_processing_strategy` ENABLE KEYS */;
-UNLOCK TABLES;
-
--
-- Table structure for table `rpt_sequence`
--
diff --git a/fineract-db/multi-tenant-demo-backups/ceda/ceda-schema-customisations.sql b/fineract-db/multi-tenant-demo-backups/ceda/ceda-schema-customisations.sql
index 7c30d33e2..324897f21 100644
--- a/fineract-db/multi-tenant-demo-backups/ceda/ceda-schema-customisations.sql
+++ b/fineract-db/multi-tenant-demo-backups/ceda/ceda-schema-customisations.sql
@@ -17,8 +17,6 @@
-- under the License.
--
-DELETE FROM `ref_loan_transaction_processing_strategy` WHERE id in (1, 3, 4);
-
INSERT INTO `m_code` (`code_name`, `is_system_defined`)
VALUES
('FieldOfEmployment', '0'),
diff --git a/fineract-db/multi-tenant-demo-backups/default-demo/bk_mifostenant-default.sql b/fineract-db/multi-tenant-demo-backups/default-demo/bk_mifostenant-default.sql
index 61da348c6..ef70237b6 100644
--- a/fineract-db/multi-tenant-demo-backups/default-demo/bk_mifostenant-default.sql
+++ b/fineract-db/multi-tenant-demo-backups/default-demo/bk_mifostenant-default.sql
@@ -1012,7 +1012,6 @@ CREATE TABLE `m_loan` (
KEY `FKB6F935D87179A0CB` (`client_id`),
KEY `FKB6F935D8C8D4B434` (`product_id`),
KEY `FK7C885877240145` (`fund_id`),
- KEY `FK_loan_ltp_strategy` (`loan_transaction_strategy_id`),
KEY `FK_m_loan_m_staff` (`loan_officer_id`),
KEY `group_id` (`group_id`),
KEY `FK_m_loanpurpose_codevalue` (`loanpurpose_cv_id`),
@@ -1028,7 +1027,6 @@ CREATE TABLE `m_loan` (
CONSTRAINT `FK_approvedon_userid` FOREIGN KEY (`approvedon_userid`) REFERENCES `m_appuser` (`id`),
CONSTRAINT `FK_closedon_userid` FOREIGN KEY (`closedon_userid`) REFERENCES `m_appuser` (`id`),
CONSTRAINT `FK_disbursedon_userid` FOREIGN KEY (`disbursedon_userid`) REFERENCES `m_appuser` (`id`),
- CONSTRAINT `FK_loan_ltp_strategy` FOREIGN KEY (`loan_transaction_strategy_id`) REFERENCES `ref_loan_transaction_processing_strategy` (`id`),
CONSTRAINT `FK_m_loanpurpose_codevalue` FOREIGN KEY (`loanpurpose_cv_id`) REFERENCES `m_code_value` (`id`),
CONSTRAINT `FK_m_loan_m_staff` FOREIGN KEY (`loan_officer_id`) REFERENCES `m_staff` (`id`),
CONSTRAINT `FK_rejectedon_userid` FOREIGN KEY (`rejectedon_userid`) REFERENCES `m_appuser` (`id`),
@@ -1507,9 +1505,7 @@ CREATE TABLE `m_product_loan` (
PRIMARY KEY (`id`),
UNIQUE KEY `unq_name` (`name`),
KEY `FKA6A8A7D77240145` (`fund_id`),
- KEY `FK_ltp_strategy` (`loan_transaction_strategy_id`),
- CONSTRAINT `FKA6A8A7D77240145` FOREIGN KEY (`fund_id`) REFERENCES `m_fund` (`id`),
- CONSTRAINT `FK_ltp_strategy` FOREIGN KEY (`loan_transaction_strategy_id`) REFERENCES `ref_loan_transaction_processing_strategy` (`id`)
+ CONSTRAINT `FKA6A8A7D77240145` FOREIGN KEY (`fund_id`) REFERENCES `m_fund` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=UTF8MB4;
/*!40101 SET character_set_client = @saved_cs_client */;
@@ -1771,36 +1767,6 @@ INSERT INTO `r_enum_value` VALUES ('amortization_method_enum',0,'Equal principle
/*!40000 ALTER TABLE `r_enum_value` ENABLE KEYS */;
UNLOCK TABLES;
---
--- Table structure for table `ref_loan_transaction_processing_strategy`
---
-
-DROP TABLE IF EXISTS `ref_loan_transaction_processing_strategy`;
-/*!40101 SET @saved_cs_client = @@character_set_client */;
-/*!40101 SET character_set_client = UTF8MB4 */;
-CREATE TABLE `ref_loan_transaction_processing_strategy` (
- `id` BIGINT NOT NULL AUTO_INCREMENT,
- `code` varchar(100) DEFAULT NULL,
- `name` varchar(255) DEFAULT NULL,
- `createdby_id` BIGINT DEFAULT NULL,
- `created_date` datetime DEFAULT NULL,
- `lastmodifiedby_id` BIGINT DEFAULT NULL,
- `lastmodified_date` datetime DEFAULT NULL,
- PRIMARY KEY (`id`),
- UNIQUE KEY `ltp_strategy_code` (`code`)
-) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=UTF8MB4;
-/*!40101 SET character_set_client = @saved_cs_client */;
-
---
--- Dumping data for table `ref_loan_transaction_processing_strategy`
---
-
-LOCK TABLES `ref_loan_transaction_processing_strategy` WRITE;
-/*!40000 ALTER TABLE `ref_loan_transaction_processing_strategy` DISABLE KEYS */;
-INSERT INTO `ref_loan_transaction_processing_strategy` VALUES (1,'mifos-standard-strategy','Mifos style',NULL,NULL,NULL,NULL),(2,'heavensfamily-strategy','Heavensfamily',NULL,NULL,NULL,NULL),(3,'creocore-strategy','Creocore',NULL,NULL,NULL,NULL),(4,'rbi-india-strategy','RBI (India)',NULL,NULL,NULL,NULL);
-/*!40000 ALTER TABLE `ref_loan_transaction_processing_strategy` ENABLE KEYS */;
-UNLOCK TABLES;
-
--
-- Table structure for table `rpt_sequence`
--
diff --git a/fineract-db/multi-tenant-demo-backups/latam-demo/bk_latam.sql b/fineract-db/multi-tenant-demo-backups/latam-demo/bk_latam.sql
index daa11df0d..9900ab12f 100644
--- a/fineract-db/multi-tenant-demo-backups/latam-demo/bk_latam.sql
+++ b/fineract-db/multi-tenant-demo-backups/latam-demo/bk_latam.sql
@@ -859,7 +859,6 @@ CREATE TABLE `m_loan` (
KEY `FKB6F935D87179A0CB` (`client_id`),
KEY `FKB6F935D8C8D4B434` (`product_id`),
KEY `FK7C885877240145` (`fund_id`),
- KEY `FK_loan_ltp_strategy` (`loan_transaction_strategy_id`),
KEY `FK_m_loan_m_staff` (`loan_officer_id`),
KEY `group_id` (`group_id`),
KEY `FK_m_loan_guarantor` (`guarantor_id`),
@@ -867,7 +866,6 @@ CREATE TABLE `m_loan` (
CONSTRAINT `FK7C885877240145` FOREIGN KEY (`fund_id`) REFERENCES `m_fund` (`id`),
CONSTRAINT `FKB6F935D87179A0CB` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`),
CONSTRAINT `FKB6F935D8C8D4B434` FOREIGN KEY (`product_id`) REFERENCES `m_product_loan` (`id`),
- CONSTRAINT `FK_loan_ltp_strategy` FOREIGN KEY (`loan_transaction_strategy_id`) REFERENCES `ref_loan_transaction_processing_strategy` (`id`),
CONSTRAINT `FK_m_loan_m_staff` FOREIGN KEY (`loan_officer_id`) REFERENCES `m_staff` (`id`),
CONSTRAINT `m_loan_ibfk_1` FOREIGN KEY (`group_id`) REFERENCES `m_group` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
@@ -1343,9 +1341,7 @@ CREATE TABLE `m_product_loan` (
`loan_transaction_strategy_id` BIGINT DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `FKA6A8A7D77240145` (`fund_id`),
- KEY `FK_ltp_strategy` (`loan_transaction_strategy_id`),
- CONSTRAINT `FKA6A8A7D77240145` FOREIGN KEY (`fund_id`) REFERENCES `m_fund` (`id`),
- CONSTRAINT `FK_ltp_strategy` FOREIGN KEY (`loan_transaction_strategy_id`) REFERENCES `ref_loan_transaction_processing_strategy` (`id`)
+ CONSTRAINT `FKA6A8A7D77240145` FOREIGN KEY (`fund_id`) REFERENCES `m_fund` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
/*!40101 SET character_set_client = @saved_cs_client */;
@@ -1687,36 +1683,6 @@ INSERT INTO `r_enum_value` VALUES ('amortization_method_enum',0,'Equal principle
/*!40000 ALTER TABLE `r_enum_value` ENABLE KEYS */;
UNLOCK TABLES;
---
--- Table structure for table `ref_loan_transaction_processing_strategy`
---
-
-DROP TABLE IF EXISTS `ref_loan_transaction_processing_strategy`;
-/*!40101 SET @saved_cs_client = @@character_set_client */;
-/*!40101 SET character_set_client = UTF8MB4 */;
-CREATE TABLE `ref_loan_transaction_processing_strategy` (
- `id` BIGINT NOT NULL AUTO_INCREMENT,
- `code` varchar(100) DEFAULT NULL,
- `name` varchar(255) DEFAULT NULL,
- `createdby_id` BIGINT DEFAULT NULL,
- `created_date` datetime DEFAULT NULL,
- `lastmodifiedby_id` BIGINT DEFAULT NULL,
- `lastmodified_date` datetime DEFAULT NULL,
- PRIMARY KEY (`id`),
- UNIQUE KEY `ltp_strategy_code` (`code`)
-) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=UTF8MB4;
-/*!40101 SET character_set_client = @saved_cs_client */;
-
---
--- Dumping data for table `ref_loan_transaction_processing_strategy`
---
-
-LOCK TABLES `ref_loan_transaction_processing_strategy` WRITE;
-/*!40000 ALTER TABLE `ref_loan_transaction_processing_strategy` DISABLE KEYS */;
-INSERT INTO `ref_loan_transaction_processing_strategy` VALUES (1,'mifos-standard-strategy','Mifos style',NULL,NULL,NULL,NULL),(2,'heavensfamily-strategy','Heavensfamily',NULL,NULL,NULL,NULL),(3,'creocore-strategy','Creocore',NULL,NULL,NULL,NULL),(4,'rbi-india-strategy','RBI (India)',NULL,NULL,NULL,NULL);
-/*!40000 ALTER TABLE `ref_loan_transaction_processing_strategy` ENABLE KEYS */;
-UNLOCK TABLES;
-
--
-- Table structure for table `rpt_sequence`
--
diff --git a/fineract-db/old-schema-files/0001a-mifosplatform-core-ddl-latest.sql b/fineract-db/old-schema-files/0001a-mifosplatform-core-ddl-latest.sql
index 9c5ba1890..a07826136 100644
--- a/fineract-db/old-schema-files/0001a-mifosplatform-core-ddl-latest.sql
+++ b/fineract-db/old-schema-files/0001a-mifosplatform-core-ddl-latest.sql
@@ -68,7 +68,6 @@ DROP TABLE IF EXISTS `m_savings_account`;
DROP TABLE IF EXISTS `m_savings_account_transaction`;
DROP TABLE IF EXISTS `m_savings_product`;
DROP TABLE IF EXISTS `m_staff`;
-DROP TABLE IF EXISTS `ref_loan_transaction_processing_strategy`;
DROP TABLE IF EXISTS `x_registered_table`;
-- drop reporting related tables
@@ -102,18 +101,6 @@ CREATE TABLE `m_organisation_currency` (
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
-CREATE TABLE `ref_loan_transaction_processing_strategy` (
- `id` BIGINT NOT NULL AUTO_INCREMENT,
- `code` varchar(100) DEFAULT NULL,
- `name` varchar(255) DEFAULT NULL,
- `createdby_id` BIGINT DEFAULT NULL,
- `created_date` datetime DEFAULT NULL,
- `lastmodifiedby_id` BIGINT DEFAULT NULL,
- `lastmodified_date` datetime DEFAULT NULL,
- PRIMARY KEY (`id`),
- UNIQUE KEY `ltp_strategy_code` (`code`)
-) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
-
CREATE TABLE `c_configuration` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`name` varchar(50) DEFAULT NULL,
@@ -482,9 +469,7 @@ CREATE TABLE `m_product_loan` (
PRIMARY KEY (`id`),
UNIQUE KEY `unq_name` (`name`),
KEY `FKA6A8A7D77240145` (`fund_id`),
- KEY `FK_ltp_strategy` (`loan_transaction_strategy_id`),
- CONSTRAINT `FKA6A8A7D77240145` FOREIGN KEY (`fund_id`) REFERENCES `m_fund` (`id`),
- CONSTRAINT `FK_ltp_strategy` FOREIGN KEY (`loan_transaction_strategy_id`) REFERENCES `ref_loan_transaction_processing_strategy` (`id`)
+ CONSTRAINT `FKA6A8A7D77240145` FOREIGN KEY (`fund_id`) REFERENCES `m_fund` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
CREATE TABLE `m_product_loan_charge` (
@@ -575,7 +560,6 @@ CREATE TABLE `m_loan` (
KEY `FKB6F935D87179A0CB` (`client_id`),
KEY `FKB6F935D8C8D4B434` (`product_id`),
KEY `FK7C885877240145` (`fund_id`),
- KEY `FK_loan_ltp_strategy` (`loan_transaction_strategy_id`),
KEY `FK_m_loan_m_staff` (`loan_officer_id`),
KEY `group_id` (`group_id`),
KEY `FK_m_loanpurpose_codevalue` (`loanpurpose_cv_id`),
@@ -591,7 +575,6 @@ CREATE TABLE `m_loan` (
CONSTRAINT `FK_approvedon_userid` FOREIGN KEY (`approvedon_userid`) REFERENCES `m_appuser` (`id`),
CONSTRAINT `FK_closedon_userid` FOREIGN KEY (`closedon_userid`) REFERENCES `m_appuser` (`id`),
CONSTRAINT `FK_disbursedon_userid` FOREIGN KEY (`disbursedon_userid`) REFERENCES `m_appuser` (`id`),
- CONSTRAINT `FK_loan_ltp_strategy` FOREIGN KEY (`loan_transaction_strategy_id`) REFERENCES `ref_loan_transaction_processing_strategy` (`id`),
CONSTRAINT `FK_m_loanpurpose_codevalue` FOREIGN KEY (`loanpurpose_cv_id`) REFERENCES `m_code_value` (`id`),
CONSTRAINT `FK_m_loan_m_staff` FOREIGN KEY (`loan_officer_id`) REFERENCES `m_staff` (`id`),
CONSTRAINT `FK_rejectedon_userid` FOREIGN KEY (`rejectedon_userid`) REFERENCES `m_appuser` (`id`),
diff --git a/fineract-db/old-schema-files/0002-mifosx-base-reference-data-utf8.sql b/fineract-db/old-schema-files/0002-mifosx-base-reference-data-utf8.sql
index 6795b0796..9810e799c 100644
--- a/fineract-db/old-schema-files/0002-mifosx-base-reference-data-utf8.sql
+++ b/fineract-db/old-schema-files/0002-mifosx-base-reference-data-utf8.sql
@@ -19,14 +19,6 @@
-- currency symbols may not apply through command line on windows so use a different client like mysql workbench
-INSERT INTO `ref_loan_transaction_processing_strategy`
-(`id`,`code`,`name`)
-VALUES
-(1, 'mifos-standard-strategy', 'Mifos style'),
-(2, 'heavensfamily-strategy', 'Heavensfamily'),
-(3, 'creocore-strategy', 'Creocore'),
-(4, 'rbi-india-strategy', 'RBI (India)');
-
INSERT INTO `c_configuration`
(`name`, `enabled`)
VALUES
diff --git a/fineract-doc/src/docs/en/chapters/architecture/modules.adoc b/fineract-doc/src/docs/en/chapters/architecture/modules.adoc
index 0349c060c..137e26ffa 100644
--- a/fineract-doc/src/docs/en/chapters/architecture/modules.adoc
+++ b/fineract-doc/src/docs/en/chapters/architecture/modules.adoc
@@ -1,91 +1,5 @@
= Modules
-NOTE: Currently modules are a proof of concept feature in Fineract.
+We are currently working towards a fully modular codebase and will publish more here when we are ready.
-== Custom modules
-
-Creating customizations for Fineract services is easy. The method described here will work both with our future module guidelines (aka "clean room" modules) and with the intermediary solution we will put in place to avoid major refactorings.
-
-The folder structure for modules is based on a convention that ensures that your extensions don't clash with Fineract's internals. This is to make sure that your downstream forks of Fineract are easy to sync. In the past we had all kinds of strategies to add custom code - including editing existing sources in `fineract-provider`. This is not recommended.
-
-IMPORTANT: At the moment the only service(s) we prepared to be overridden/replaced are `org.apache.fineract.portfolio.note.service.NoteReadPlatformService` and `org.apache.fineract.portfolio.note.service.NoteWritePlatformService`. Please reach out on the developer mailing list if you need other services.
-
-The recommended folder structure is very simple. If you follow this recommendation you'll get some additional benefits, e. g. you don't even have to edit `settings.gradle` to include your new custom modules. Your modules will also be automatically included in a custom Fineract Docker image build that you can use for your production deployments.
-
-Let's assume your company/org is called "ACME Inc." and you are trying to (fully/partially) replace an existing Fineract service, let's say those in `org.apache.fineract.portfolio.note`. The recommended folder structure would then look something like this:
-
-[plantuml, format=svg]
-----
-include::{diagramsdir}/custom-folder-structure.puml[]
-----
-
-As soon as we can publish Fineract module JARs to Maven Central you'll have more freedom to setup your projects (including to setup separate Git repos). But for now please follow these instructions:
-
-1. Create a folder under `custom` and name it according to your company/organisation (e. g. `acme` if your company is `ACME Inc.`); this way your custom modules can't clash even with other companies' modules
-2. Under your company folder create a folder for the `category` or `domain` your module is targeting; e. g. "loan", "client", "account" etc.
-3. Finally, setup `library` folders for the actual modules you want to create; usually that will be to replace/extend some existing service, so there could be a `service` folder, maybe even a `core` folder, e. g. if you want to add additional DTOs etc.; we have also an example for COB business steps
-4. Per `category`/`domain` you should have a `starter` library; means: a Spring Boot auto-configuration setup that makes including your module in Fineract easier ("hands-free"); the necessary parts for a auto-configuration library are a Spring Java configuration class (annotated with `@Configuration`) and a text file at `META-INF/spring.factories` in your starter resource folder:
-+
-[source,properties]
-----
-include::{rootdir}/custom/acme/note/starter/src/main/resources/META-INF/spring.factories[]
-----
-+
-Please make sure that your module libraries have proper `build.gradle` files:
-+
-[source,groovy]
-----
-include::{rootdir}/custom/acme/note/service/build.gradle[lines=19..]
-----
-+
-NOTE: You don't need to edit `settings.gradle` to add your modules/libraries. If you follow above convention they'll get included automatically.
-+
-5. The dependency.gradle file could look something like this:
-[source,groovy]
-----
-include::{rootdir}/custom/acme/note/service/dependencies.gradle[lines=19..]
-----
-
-NOTE: We've included by default some basic and useful dependencies for all custom modules, like Slf4j, Lombok, the usual testing frameworks (JUnit, Cucumber, Mockito etc.)
-
-IMPORTANT: Do not include your custom module in `fineract-provider`'s dependency.gradle file. This creates a circular dependency and will fail your build.
-
-=== Database Migrations
-
-If database migrations are needed as part of your customizations then you can add your own migration scripts. This is again based on conventions:
-
-1. Create folders `db/custom-changelog` in one of your `resources` folders; we recommend using the resources folder in your starter library, but actually any of your custom libs will do.
-2. Under `db/custom-changelog` create an XML changelog file, e. g. `changelog-acme-note.xml`; you are free to choose a name for this file, but we recommend being consistent to avoid classpath conflicts.
-3. Under `db/custom-changelog` create a folder `parts` for your specific changelogs
-
-[plantuml, format=svg]
-----
-include::{diagramsdir}/custom-db-migration-folder-structure.puml[]
-----
-
-And here an example migration script:
-
-[source,xml]
-----
-include::{rootdir}/custom/acme/note/starter/src/main/resources/db/custom-changelog/0001_acme_note_initial.xml[lines=22..]
-----
-
-IMPORTANT: By default custom database migration changelogs are executed in context `tenant_db`. That makes sure your changes will be applied to the tenant database (read: main database and not the tenant store database). In theory you could also target the tenant configuration database, but it's not recommended to do that.
-
-=== Deployment
-
-Custom modules (better: the JAR files) only need to be dropped in Fineract's `libs` folder if you run Fineract from the Spring Boot JAR file. Dynamic loading of external JARs is provided since Fineract version 1.5.0. For your convenience we've created a separate Docker image module that automatically includes your custom modules (see `custom/docker`). You can build this Docker image with
-
-[source,bash]
-----
-./gradlew :custom:docker:jibDockerBuild
-----
-
-The Docker image with included custom modules is called `fineract-custom`.
-
-NOTE: We'll provide soon a way to customize the Docker image parameters (image name, JVM implementation, JVM args, ports etc.).
-
-
-=== Outlook
-
-If this *proof of concept* is accepted we could prepare Fineract's services to be replaceable. This approach works already very well even if we don't have proper JAR libraries published on Maven Central. It's an important goal to separate customized code from Fineract's internals to have soon real modules.
+NOTE: Even if we are not quite there yet with full modularity you can already create your own custom modules to extend Fineract. Please see chapter <<_custom_modules>>.
\ No newline at end of file
diff --git a/fineract-doc/src/docs/en/chapters/custom/business-step.adoc b/fineract-doc/src/docs/en/chapters/custom/business-step.adoc
new file mode 100644
index 000000000..060bcdc49
--- /dev/null
+++ b/fineract-doc/src/docs/en/chapters/custom/business-step.adoc
@@ -0,0 +1,36 @@
+= Custom Business Steps
+
+It very easy to add your own business steps to Fineract's default steps:
+
+1. Create a custom module (e. g. `custom/acme/steps`, follow the instructions on how to create a custom module)
+2. Create a class that implements interace `org.apache.fineract.cob.COBBusinessStep`
+3. Provide the custom database migration to add the necessary information about your business step in table `m_batch_business_steps`
+
+.Business Step Interface
+[source,java]
+----
+include::{rootdir}/fineract-provider/src/main/java/org/apache/fineract/cob/COBBusinessStep.java[lines=19..]
+----
+
+== Business Step Implementation
+
+.Custom Business Step Implementation Example
+[source,java]
+----
+include::{rootdir}/custom/acme/loan/cob/src/main/java/com/acme/fineract/loan/cob/AcmeNoopBusinessStep.java[lines=19..]
+----
+
+As you can see this implementation is very simple and doesn't do much. There are some simple conventions though that you should follow implementing your own business steps:
+
+1. Make sure the value returned by method `getEnumStyledName()` is unique; it's a good idea to choose a prefix that reflects the name of your organization (in this example `ACME_`)
+2. You have more freedom for the value returned by `getHumanReadableName()`, but it's a good idea to keep this value as unique as possible
+
+== Business Step Database Migration
+
+.Business Step Database Migration Example
+[source,xml]
+----
+include::{rootdir}/custom/acme/loan/cob/src/main/resources/db/custom-changelog/0001_acme_loan_cob.xml[lines=22..]
+----
+
+NOTE: See also chapter about batch jobs in this documentation.
\ No newline at end of file
diff --git a/fineract-doc/src/docs/en/chapters/custom/database-migration.adoc b/fineract-doc/src/docs/en/chapters/custom/database-migration.adoc
new file mode 100644
index 000000000..6fc0e7982
--- /dev/null
+++ b/fineract-doc/src/docs/en/chapters/custom/database-migration.adoc
@@ -0,0 +1,21 @@
+= Custom Database Migration
+
+If database migrations are needed as part of your customizations then you can add your own migration scripts. This is again based on conventions:
+
+1. Create folders `db/custom-changelog` in one of your `resources` folders; we recommend using the resources folder in your starter library, but actually any of your custom libs will do.
+2. Under `db/custom-changelog` create an XML changelog file, e. g. `changelog-acme-note.xml`; you are free to choose a name for this file, but we recommend being consistent to avoid classpath conflicts.
+3. Under `db/custom-changelog` create a folder `parts` for your specific changelogs
+
+[plantuml, format=svg]
+----
+include::{diagramsdir}/custom-db-migration-folder-structure.puml[]
+----
+
+And here an example migration script:
+
+[source,xml]
+----
+include::{rootdir}/custom/acme/note/starter/src/main/resources/db/custom-changelog/0001_acme_note_initial.xml[lines=22..]
+----
+
+IMPORTANT: By default, custom database migration changelogs are executed in context `tenant_db`. That makes sure your changes will be applied to the tenant database (read: main database and not the tenant store database). In theory you could also target the tenant configuration database, but it's not recommended to do that.
diff --git a/fineract-doc/src/docs/en/chapters/custom/deployment.adoc b/fineract-doc/src/docs/en/chapters/custom/deployment.adoc
new file mode 100644
index 000000000..178e67ba4
--- /dev/null
+++ b/fineract-doc/src/docs/en/chapters/custom/deployment.adoc
@@ -0,0 +1,12 @@
+= Deploying Custom Modules
+
+Custom modules (better: the JAR files) only need to be dropped in Fineract's `libs` folder if you run Fineract from the Spring Boot JAR file. Dynamic loading of external JARs is provided since Fineract version 1.5.0. For your convenience we've created a separate Docker image module that automatically includes your custom modules (see `custom/docker`). You can build this Docker image with
+
+[source,bash]
+----
+./gradlew :custom:docker:jibDockerBuild
+----
+
+The Docker image with included custom modules is called `fineract-custom`.
+
+NOTE: We'll provide soon a way to customize the Docker image parameters (image name, JVM implementation, JVM args, ports etc.).
diff --git a/fineract-doc/src/docs/en/chapters/custom/index.adoc b/fineract-doc/src/docs/en/chapters/custom/index.adoc
new file mode 100644
index 000000000..12bd1eb08
--- /dev/null
+++ b/fineract-doc/src/docs/en/chapters/custom/index.adoc
@@ -0,0 +1,17 @@
+= Custom Modules
+
+NOTE: Currently modules are a proof of concept feature in Fineract.
+
+include::intro.adoc[leveloffset=+1]
+
+include::service.adoc[leveloffset=+1]
+
+include::business-step.adoc[leveloffset=+1]
+
+include::loan-transaction-processor.adoc[leveloffset=+1]
+
+include::database-migration.adoc[leveloffset=+1]
+
+include::deployment.adoc[leveloffset=+1]
+
+include::outlook.adoc[leveloffset=+1]
diff --git a/fineract-doc/src/docs/en/chapters/custom/intro.adoc b/fineract-doc/src/docs/en/chapters/custom/intro.adoc
new file mode 100644
index 000000000..7be11de7f
--- /dev/null
+++ b/fineract-doc/src/docs/en/chapters/custom/intro.adoc
@@ -0,0 +1,47 @@
+= Introduction
+
+Creating customizations for Fineract services is easy. The method described here will work both with our future module guidelines (aka "clean room" modules) and with the intermediary solution we will put in place to avoid major refactorings.
+
+The folder structure for modules is based on a convention that ensures that your extensions don't clash with Fineract's internals. This is to make sure that your downstream forks of Fineract are easy to sync. In the past we had all kinds of strategies to add custom code - including editing existing sources in `fineract-provider`. This is not recommended.
+
+IMPORTANT: At the moment the only service(s) we prepared to be overridden/replaced are `org.apache.fineract.portfolio.note.service.NoteReadPlatformService` and `org.apache.fineract.portfolio.note.service.NoteWritePlatformService`. Please reach out on the developer mailing list if you need other services.
+
+The recommended folder structure is very simple. If you follow this recommendation you'll get some additional benefits, e. g. you don't even have to edit `settings.gradle` to include your new custom modules. Your modules will also be automatically included in a custom Fineract Docker image build that you can use for your production deployments.
+
+Let's assume your company/org is called "ACME Inc." and you are trying to (fully/partially) replace an existing Fineract service, let's say those in `org.apache.fineract.portfolio.note`. The recommended folder structure would then look something like this:
+
+[plantuml, format=svg]
+----
+include::{diagramsdir}/custom-folder-structure.puml[]
+----
+
+As soon as we can publish Fineract module JARs to Maven Central you'll have more freedom to setup your projects (including to setup separate Git repos). But for now please follow these instructions:
+
+1. Create a folder under `custom` and name it according to your company/organisation (e. g. `acme` if your company is `ACME Inc.`); this way your custom modules can't clash even with other companies' modules
+2. Under your company folder create a folder for the `category` or `domain` your module is targeting; e. g. "loan", "client", "account" etc.
+3. Finally, setup `library` folders for the actual modules you want to create; usually that will be to replace/extend some existing service, so there could be a `service` folder, maybe even a `core` folder, e. g. if you want to add additional DTOs etc.; we have also an example for COB business steps
+4. Per `category`/`domain` you should have a `starter` library; means: a Spring Boot auto-configuration setup that makes including your module in Fineract easier ("hands-free"); the necessary parts for a auto-configuration library are a Spring Java configuration class (annotated with `@Configuration`) and a text file at `META-INF/spring.factories` in your starter resource folder:
++
+[source,properties]
+----
+include::{rootdir}/custom/acme/note/starter/src/main/resources/META-INF/spring.factories[]
+----
++
+Please make sure that your module libraries have proper `build.gradle` files:
++
+[source,groovy]
+----
+include::{rootdir}/custom/acme/note/service/build.gradle[lines=19..]
+----
++
+NOTE: You don't need to edit `settings.gradle` to add your modules/libraries. If you follow above convention they'll get included automatically.
++
+5. The dependency.gradle file could look something like this:
+[source,groovy]
+----
+include::{rootdir}/custom/acme/note/service/dependencies.gradle[lines=19..]
+----
+
+NOTE: We've included by default some basic and useful dependencies for all custom modules, like Slf4j, Lombok, the usual testing frameworks (JUnit, Cucumber, Mockito etc.)
+
+IMPORTANT: Do not include your custom module in `fineract-provider`'s dependency.gradle file. This creates a circular dependency and will fail your build.
diff --git a/fineract-doc/src/docs/en/chapters/custom/loan-transaction-processor.adoc b/fineract-doc/src/docs/en/chapters/custom/loan-transaction-processor.adoc
new file mode 100644
index 000000000..175c50b64
--- /dev/null
+++ b/fineract-doc/src/docs/en/chapters/custom/loan-transaction-processor.adoc
@@ -0,0 +1,114 @@
+= Custom Loan Transaction Processors
+
+Fineract has 7 built-in loan transaction processors:
+
+1. `org.apache.fineract.portfolio.loanaccount.domain.transactionprocessor.impl.CreocoreLoanRepaymentScheduleTransactionProcessor`
+2. `org.apache.fineract.portfolio.loanaccount.domain.transactionprocessor.impl.EarlyPaymentLoanRepaymentScheduleTransactionProcessor`
+3. `org.apache.fineract.portfolio.loanaccount.domain.transactionprocessor.impl.FineractStyleLoanRepaymentScheduleTransactionProcessor`
+4. `org.apache.fineract.portfolio.loanaccount.domain.transactionprocessor.impl.HeavensFamilyLoanRepaymentScheduleTransactionProcessor`
+5. `org.apache.fineract.portfolio.loanaccount.domain.transactionprocessor.impl.InterestPrincipalPenaltyFeesOrderLoanRepaymentScheduleTransactionProcessor`
+6. `org.apache.fineract.portfolio.loanaccount.domain.transactionprocessor.impl.PrincipalInterestPenaltyFeesOrderLoanRepaymentScheduleTransactionProcessor`
+7. `org.apache.fineract.portfolio.loanaccount.domain.transactionprocessor.impl.RBILoanRepaymentScheduleTransactionProcessor`
+
+.Default Loan Transaction Processor configuration
+[source,java]
+----
+include::{rootdir}/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/starter/LoanAccountAutoStarter.java[lines=38..80]
+----
+
+All default processor implementations are enabled by default, but can also be prevented from being loaded into memory by a simple configuration in `application.properties`. Use the environment variables you see below in your Kubernetes and Docker Compose deployments to override the default behavior.
+
+.Default Loan Transaction Processor Application Properties
+[source,properties]
+----
+include::{rootdir}/fineract-provider/src/main/resources/application.properties[lines=64..70]
+----
+
+== Implement Processors
+
+.Loan Transaction Processor Interface
+[source,java]
+----
+include::{rootdir}/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/transactionprocessor/LoanRepaymentScheduleTransactionProcessor.java[lines=19..]
+----
+
+.Custom Loan Transaction Processor Example
+[source,java]
+----
+include::{rootdir}/custom/acme/loan/processor/src/main/java/com/acme/fineract/loan/processor/AcmeLoanRepaymentScheduleTransactionProcessor.java[lines=19..]
+----
+
+The example implementation doesn't do much. We are just overriding one of the default processor implementations `org.apache.fineract.portfolio.loanaccount.domain.transactionprocessor.impl.FineractStyleLoanRepaymentScheduleTransactionProcessor` and give the custom processor it's own lookup code and name (descriptive text for display in UIs, e. g. when configuring a loan product). As usual it is a good idea to follow some simple conventions:
+
+1. Make sure the value returned by `getCode()` is unique. Prefixing it with characters that reflect your organization name (here `acme-`) is a good idea.
+2. You have more freedom for the descriptive test returned by `getName()`, but it is still a good idea to keep the value unique to avoid confusion.
+
+=== Method `getCode()`
+
+Lookup value that is used to pick a loan transaction processor (see processor factory).
+
+=== Method `getName()`
+
+Descriptive text about the loan transaction processor that is mostly used in user interfaces.
+
+=== Method `handleTransaction()`
+
+TBD
+
+=== Method `handleWriteOff()`
+
+TBD
+
+=== Method `handleRepaymentSchedule()`
+
+TBD
+
+=== Method `isInterestFirstRepaymentScheduleTransactionProcessor()`
+
+TBD
+
+=== Method `handleRefund()`
+
+TBD
+
+=== Method `handleChargeback()`
+
+TBD
+
+=== Method `processTransactionsFromDerivedFields()`
+
+TBD
+
+== Override Processor Factory
+
+The processor factory has no reference to any specific implementation of the loan transaction processor interface. All avaible implementations will be injected here (internal default and custom implementations). Processor instances can be looked up via method `determineProcessor()`. You can pass either the code of the processor or the processor's name to look it up. If a matching processor can't be found then the factory function will either return the default instance or fails with an exception depending on the configuration in `application.properties`.
+
+IMPORTANT: It is preferable to use the processor code to lookup processor instances. Lookups via processor names are only done in the import service via Excel sheets (should be fixed).
+
+.Loan Transaction Processor Factory Implementation
+[source,java]
+----
+include::{rootdir}/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanRepaymentScheduleTransactionProcessorFactory.java[lines=19..]
+----
+
+This is the default factory auto-configuration.
+
+.Loan Transaction Processor Factory Auto-Configuration
+[source,java]
+----
+include::{rootdir}/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/starter/LoanAccountAutoStarter.java[lines=81..87]
+----
+
+If you need then you can override this, e.g. because you want to set a different default processor then you can do so in your custom module's auto-configuration.
+
+.Custom Loan Transaction Processor Factory Auto-Configuration Example
+[source,java]
+----
+include::{rootdir}/custom/acme/loan/starter/src/main/java/com/acme/fineract/loan/starter/AcmeLoanAutoConfiguration.java[lines=36..41]
+----
+
+.Processor Lookup Failure Configuration Property
+[source,properties]
+----
+include::{rootdir}/fineract-provider/src/main/resources/application.properties[lines=71..71]
+----
diff --git a/fineract-doc/src/docs/en/chapters/custom/outlook.adoc b/fineract-doc/src/docs/en/chapters/custom/outlook.adoc
new file mode 100644
index 000000000..f53eb21e0
--- /dev/null
+++ b/fineract-doc/src/docs/en/chapters/custom/outlook.adoc
@@ -0,0 +1,3 @@
+= Outlook
+
+If this *proof of concept* is accepted we could prepare more of Fineract's internal services to be replaceable. This approach works already very well even if we don't have proper JAR libraries published on Maven Central. It's an important goal to separate customized code from Fineract's internals to have soon real modules.
diff --git a/fineract-doc/src/docs/en/chapters/custom/service-note.adoc b/fineract-doc/src/docs/en/chapters/custom/service-note.adoc
new file mode 100644
index 000000000..c88fadd6c
--- /dev/null
+++ b/fineract-doc/src/docs/en/chapters/custom/service-note.adoc
@@ -0,0 +1,29 @@
+= Note Service
+
+The Note service is responsible for ... TBD
+
+NOTE: We chose the note service because it's interface is very simple and has not many cross dependencies.
+
+== Interfaces
+
+.Note Read Service Interface
+[source,java]
+----
+include::{rootdir}/fineract-provider/src/main/java/org/apache/fineract/portfolio/note/service/NoteReadPlatformService.java[lines=19..]
+----
+
+.Note Write Service Interface
+[source,java]
+----
+include::{rootdir}/fineract-provider/src/main/java/org/apache/fineract/portfolio/note/service/NoteReadPlatformService.java[lines=19..]
+----
+
+== Auto Start Configuration
+
+The rules to replace the Note services are very simple. If you provide an alternative implementation of the services then the default implementations will *not* be loaded.
+
+.Note Auto Starter Configuration
+[source,java]
+----
+include::{rootdir}/fineract-provider/src/main/java/org/apache/fineract/portfolio/note/starter/NoteAutoConfiguration.java[lines=19..]
+----
diff --git a/fineract-doc/src/docs/en/chapters/custom/service.adoc b/fineract-doc/src/docs/en/chapters/custom/service.adoc
new file mode 100644
index 000000000..27045eac9
--- /dev/null
+++ b/fineract-doc/src/docs/en/chapters/custom/service.adoc
@@ -0,0 +1,5 @@
+= Custom Services
+
+NOTE: We are still trying to figure out which internal services make most sense to be pluggable. Please join the discussion and let us know if you have a specific requirement.
+
+include::service-note.adoc[leveloffset=+1]
diff --git a/fineract-doc/src/docs/en/colophon.adoc b/fineract-doc/src/docs/en/colophon.adoc
index 3a0e713da..c9a917891 100644
--- a/fineract-doc/src/docs/en/colophon.adoc
+++ b/fineract-doc/src/docs/en/colophon.adoc
@@ -19,6 +19,7 @@
| Michael Vorburger | mailto:mike@vorburger.ch[]
| Aleksandar Vidakovic | mailto:aleks@apache.org[]
| Arnold Galovics | mailto:arnold@apache.org[]
+| Adam Saghy | mailto:adamsaghy@gmail.com[]
|===
//ifdef::backend-pdf[]
@@ -34,7 +35,10 @@
| Arnold Galovics | Database architecture section | 2022-03-11 | 1.7.0
| Aleksandar Vidakovic | Module section | 2022-03-23 | 1.7.0
| Aleksandar Vidakovic | Release section, file re-organisation | 2022-04-18 | 1.7.0
+| Arnold Galovics | Spring Batch | 2022-03-11 | 1.7.0
| Aleksandar Vidakovic | AsciiDoc cheatsheet | 2022-05-09 | 1.7.0
+| Adam Saghy | Business data | 2022-06-13 | 1.7.0
+| Aleksandar Vidakovic | Custom modules and extensions | 2022-10-29 | 1.8.0
|===
toc::[]
diff --git a/fineract-doc/src/docs/en/images/multiple-batch-instances-diagram.png b/fineract-doc/src/docs/en/images/multiple-batch-instances-diagram.png
new file mode 100644
index 000000000..c08085855
Binary files /dev/null and b/fineract-doc/src/docs/en/images/multiple-batch-instances-diagram.png differ
diff --git a/fineract-doc/src/docs/en/images/multiple-read-instances-diagram.png b/fineract-doc/src/docs/en/images/multiple-read-instances-diagram.png
new file mode 100644
index 000000000..7f6da087b
Binary files /dev/null and b/fineract-doc/src/docs/en/images/multiple-read-instances-diagram.png differ
diff --git a/fineract-doc/src/docs/en/images/single-instance-diagram.png b/fineract-doc/src/docs/en/images/single-instance-diagram.png
new file mode 100644
index 000000000..bbcf7c2a9
Binary files /dev/null and b/fineract-doc/src/docs/en/images/single-instance-diagram.png differ
diff --git a/fineract-doc/src/docs/en/index.adoc b/fineract-doc/src/docs/en/index.adoc
index 3cb04b341..b31430c7d 100644
--- a/fineract-doc/src/docs/en/index.adoc
+++ b/fineract-doc/src/docs/en/index.adoc
@@ -37,6 +37,8 @@ include::chapters/architecture/index.adoc[leveloffset=+1]
include::chapters/development/index.adoc[leveloffset=+1]
+include::chapters/custom/index.adoc[leveloffset=+1]
+
include::chapters/security/index.adoc[leveloffset=+1]
include::chapters/testing/index.adoc[leveloffset=+1]
diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle
index 51b2c12f6..8ccbed967 100644
--- a/fineract-provider/build.gradle
+++ b/fineract-provider/build.gradle
@@ -152,7 +152,7 @@ configurations {
dependencies {
driver 'org.mariadb.jdbc:mariadb-java-client:3.0.8'
driver 'org.postgresql:postgresql:42.5.0'
- driver 'mysql:mysql-connector-java:8.0.30'
+ driver 'mysql:mysql-connector-java:8.0.31'
}
URLClassLoader loader = GroovyObject.class.classLoader
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/loan/LoanImportHandler.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/loan/LoanImportHandler.java
index 11ffbc05a..054846e20 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/loan/LoanImportHandler.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/loan/LoanImportHandler.java
@@ -28,6 +28,8 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.Objects;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
import org.apache.fineract.commands.domain.CommandWrapper;
import org.apache.fineract.commands.service.CommandWrapperBuilder;
import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService;
@@ -48,28 +50,25 @@ import org.apache.fineract.portfolio.loanaccount.data.LoanChargeData;
import org.apache.fineract.portfolio.loanaccount.data.LoanCollateralManagementData;
import org.apache.fineract.portfolio.loanaccount.data.LoanTransactionData;
import org.apache.fineract.portfolio.loanaccount.domain.LoanCharge;
+import org.apache.fineract.portfolio.loanaccount.domain.LoanRepaymentScheduleTransactionProcessorFactory;
+import org.apache.fineract.portfolio.loanaccount.domain.transactionprocessor.LoanRepaymentScheduleTransactionProcessor;
import org.apache.fineract.portfolio.loanaccount.exception.InvalidAmountOfCollateralQuantity;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.IndexedColors;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
+@Slf4j
+@RequiredArgsConstructor
@Service
public class LoanImportHandler implements ImportHandler {
public static final String EMPTY_STR = "";
- private static final Logger LOG = LoggerFactory.getLogger(LoanImportHandler.class);
private final PortfolioCommandSourceWritePlatformService commandsSourceWritePlatformService;
- @Autowired
- public LoanImportHandler(final PortfolioCommandSourceWritePlatformService commandsSourceWritePlatformService) {
- this.commandsSourceWritePlatformService = commandsSourceWritePlatformService;
- }
+ private final LoanRepaymentScheduleTransactionProcessorFactory loanRepaymentScheduleTransactionProcessorFactory;
@Override
public Count process(final Workbook workbook, final String locale, final String dateFormat) {
@@ -234,24 +233,17 @@ public class LoanImportHandler implements ImportHandler {
if (ImportHandlerUtils.readAsDouble(LoanConstants.ARREARS_TOLERANCE_COL, row) != null) {
arrearsTolerance = BigDecimal.valueOf(ImportHandlerUtils.readAsDouble(LoanConstants.ARREARS_TOLERANCE_COL, row));
}
- String repaymentStrategy = ImportHandlerUtils.readAsString(LoanConstants.REPAYMENT_STRATEGY_COL, row);
- Long repaymentStrategyId = null;
- if (repaymentStrategy != null) {
- if (repaymentStrategy.equalsIgnoreCase("Penalties, Fees, Interest, Principal order")) {
- repaymentStrategyId = 1L;
- } else if (repaymentStrategy.equalsIgnoreCase("HeavensFamily Unique")) {
- repaymentStrategyId = 2L;
- } else if (repaymentStrategy.equalsIgnoreCase("Creocore Unique")) {
- repaymentStrategyId = 3L;
- } else if (repaymentStrategy.equalsIgnoreCase("Overdue/Due Fee/Int,Principal")) {
- repaymentStrategyId = 4L;
- } else if (repaymentStrategy.equalsIgnoreCase("Principal, Interest, Penalties, Fees Order")) {
- repaymentStrategyId = 5L;
- } else if (repaymentStrategy.equalsIgnoreCase("Interest, Principal, Penalties, Fees Order")) {
- repaymentStrategyId = 6L;
- } else if (repaymentStrategy.equalsIgnoreCase("Early Repayment Strategy")) {
- repaymentStrategyId = 7L;
- }
+
+ String loanRepaymentScheduleTransactionProcessorStrategy = ImportHandlerUtils.readAsString(LoanConstants.REPAYMENT_STRATEGY_COL,
+ row);
+
+ LoanRepaymentScheduleTransactionProcessor loanRepaymentScheduleTransactionProcessor = loanRepaymentScheduleTransactionProcessorFactory
+ .determineProcessor(loanRepaymentScheduleTransactionProcessorStrategy);
+
+ String repaymentStrategyCode = "mifos-standard-strategy";
+
+ if (loanRepaymentScheduleTransactionProcessor != null) {
+ repaymentStrategyCode = loanRepaymentScheduleTransactionProcessor.getCode();
}
Integer graceOnPrincipalPayment = ImportHandlerUtils.readAsInt(LoanConstants.GRACE_ON_PRINCIPAL_PAYMENT_COL, row);
Integer graceOnInterestPayment = ImportHandlerUtils.readAsInt(LoanConstants.GRACE_ON_INTEREST_PAYMENT_COL, row);
@@ -355,7 +347,7 @@ public class LoanImportHandler implements ImportHandler {
return LoanAccountData.importInstanceIndividual(loanTypeEnumOption, clientId, productId, loanOfficerId, submittedOnDate,
fundId, principal, numberOfRepayments, repaidEvery, repaidEveryFrequencyEnums, loanTerm, loanTermFrequencyEnum,
nominalInterestRate, submittedOnDate, amortizationEnumOption, interestMethodEnum, interestCalculationPeriodEnum,
- arrearsTolerance, repaymentStrategyId, graceOnPrincipalPayment, graceOnInterestPayment, graceOnInterestCharged,
+ arrearsTolerance, repaymentStrategyCode, graceOnPrincipalPayment, graceOnInterestPayment, graceOnInterestCharged,
interestChargedFromDate, firstRepaymentOnDate, row.getRowNum(), externalId, null, charges, linkAccountId, locale,
dateFormat, loanCollateralManagementData);
} else if (loanType.equals("jlg")) {
@@ -364,7 +356,7 @@ public class LoanImportHandler implements ImportHandler {
return LoanAccountData.importInstanceIndividual(loanTypeEnumOption, clientId, productId, loanOfficerId, submittedOnDate,
fundId, principal, numberOfRepayments, repaidEvery, repaidEveryFrequencyEnums, loanTerm, loanTermFrequencyEnum,
nominalInterestRate, submittedOnDate, amortizationEnumOption, interestMethodEnum, interestCalculationPeriodEnum,
- arrearsTolerance, repaymentStrategyId, graceOnPrincipalPayment, graceOnInterestPayment, graceOnInterestCharged,
+ arrearsTolerance, repaymentStrategyCode, graceOnPrincipalPayment, graceOnInterestPayment, graceOnInterestCharged,
interestChargedFromDate, firstRepaymentOnDate, row.getRowNum(), externalId, groupId, charges, linkAccountId, locale,
dateFormat, null);
} else {
@@ -373,7 +365,7 @@ public class LoanImportHandler implements ImportHandler {
return LoanAccountData.importInstanceGroup(loanTypeEnumOption, groupIdforGroupLoan, productId, loanOfficerId,
submittedOnDate, fundId, principal, numberOfRepayments, repaidEvery, repaidEveryFrequencyEnums, loanTerm,
loanTermFrequencyEnum, nominalInterestRate, amortizationEnumOption, interestMethodEnum,
- interestCalculationPeriodEnum, arrearsTolerance, repaymentStrategyId, graceOnPrincipalPayment,
+ interestCalculationPeriodEnum, arrearsTolerance, repaymentStrategyCode, graceOnPrincipalPayment,
graceOnInterestPayment, graceOnInterestCharged, interestChargedFromDate, firstRepaymentOnDate, row.getRowNum(),
externalId, linkAccountId, locale, dateFormat);
}
@@ -426,7 +418,7 @@ public class LoanImportHandler implements ImportHandler {
statusCell.setCellStyle(ImportHandlerUtils.getCellStyle(workbook, IndexedColors.LIGHT_GREEN));
} catch (RuntimeException ex) {
errorCount++;
- LOG.error("Problem occurred in importEntity function", ex);
+ log.error("Problem occurred in importEntity function", ex);
errorMessage = ImportHandlerUtils.getErrorMessage(ex);
writeLoanErrorMessage(workbook, loanId, errorMessage, progressLevel, statusCell, errorReportCell, row);
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/populator/comparator/LoanComparatorByStatusActive.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/populator/comparator/LoanComparatorByStatusActive.java
index e046b015e..5bfc7721c 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/populator/comparator/LoanComparatorByStatusActive.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/populator/comparator/LoanComparatorByStatusActive.java
@@ -30,8 +30,8 @@ public class LoanComparatorByStatusActive implements Comparator
@Override
public int compare(LoanAccountData o1, LoanAccountData o2) {
- boolean isData1StatusActive = o1.getStatusStringValue().equals("Active");
- boolean isData2StatusActive = o2.getStatusStringValue().equals("Active");
+ boolean isData1StatusActive = o1.getStatus() != null && o1.getStatus().getValue().equals("Active");
+ boolean isData2StatusActive = o2.getStatus() != null && o2.getStatus().getValue().equals("Active");
// if both status active, these have the same rank
if (isData1StatusActive && isData2StatusActive) {
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/populator/guarantor/GuarantorWorkbookPopulator.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/populator/guarantor/GuarantorWorkbookPopulator.java
index 97b98f80d..a702d8b61 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/populator/guarantor/GuarantorWorkbookPopulator.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/populator/guarantor/GuarantorWorkbookPopulator.java
@@ -156,7 +156,7 @@ public class GuarantorWorkbookPopulator extends AbstractWorkbookPopulator {
}
writeString(GuarantorConstants.LOOKUP_CLIENT_NAME_COL, row, loan.getClientName() + "(" + loan.getClientId() + ")");
writeString(GuarantorConstants.LOOKUP_ACCOUNT_NO_COL, row,
- Long.parseLong(loan.getAccountNo()) + "-" + loan.getStatusStringValue());
+ Long.parseLong(loan.getAccountNo()) + "-" + loan.getStatus().getValue());
}
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/populator/loanrepayment/LoanRepaymentWorkbookPopulator.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/populator/loanrepayment/LoanRepaymentWorkbookPopulator.java
index 84f5ea855..5ed83bc73 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/populator/loanrepayment/LoanRepaymentWorkbookPopulator.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/populator/loanrepayment/LoanRepaymentWorkbookPopulator.java
@@ -234,15 +234,15 @@ public class LoanRepaymentWorkbookPopulator extends AbstractWorkbookPopulator {
row = loanRepaymentSheet.createRow(rowIndex++);
writeString(LoanRepaymentConstants.LOOKUP_CLIENT_NAME_COL, row, loan.getClientName() + "(" + loan.getClientId() + ")");
writeString(LoanRepaymentConstants.LOOKUP_CLIENT_EXTERNAL_ID, row, clientIdToClientExternalId.get(loan.getClientId()));
- writeString(LoanRepaymentConstants.LOOKUP_ACCOUNT_NO_COL, row, loan.getAccountNo() + "-" + loan.getStatusStringValue());
+ writeString(LoanRepaymentConstants.LOOKUP_ACCOUNT_NO_COL, row, loan.getAccountNo() + "-" + loan.getStatus().getValue());
writeString(LoanRepaymentConstants.LOOKUP_PRODUCT_COL, row, loan.getLoanProductName());
writeDouble(LoanRepaymentConstants.LOOKUP_PRINCIPAL_COL, row, loan.getPrincipal().doubleValue());
- if (loan.getTotalOutstandingAmount() != null) {
- writeBigDecimal(LoanRepaymentConstants.LOOKUP_TOTAL_OUTSTANDING_AMOUNT_COL, row, loan.getTotalOutstandingAmount());
+ if (loan.getSummary() != null && loan.getSummary().getTotalOutstanding() != null) {
+ writeBigDecimal(LoanRepaymentConstants.LOOKUP_TOTAL_OUTSTANDING_AMOUNT_COL, row, loan.getSummary().getTotalOutstanding());
}
- if (loan.getDisbursementDate() != null) {
- writeDate(LoanRepaymentConstants.LOOKUP_LOAN_DISBURSEMENT_DATE_COL, row, outputFormat.format(loan.getDisbursementDate()),
- dateCellStyle, dateFormat);
+ if (loan.getTimeline() != null && loan.getTimeline().getDisbursementDate() != null) {
+ writeDate(LoanRepaymentConstants.LOOKUP_LOAN_DISBURSEMENT_DATE_COL, row,
+ outputFormat.format(loan.getTimeline().getDisbursementDate()), dateCellStyle, dateFormat);
}
}
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/serialization/FromJsonHelper.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/serialization/FromJsonHelper.java
index 68949c896..239276d0b 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/serialization/FromJsonHelper.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/serialization/FromJsonHelper.java
@@ -37,12 +37,14 @@ import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
+import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.fineract.infrastructure.core.exception.InvalidJsonException;
import org.apache.fineract.infrastructure.core.exception.UnsupportedParameterException;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;
+@Slf4j
@Primary
@Component
public class FromJsonHelper {
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/external/service/serialization/mapper/loan/LoanAccountDataMapper.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/external/service/serialization/mapper/loan/LoanAccountDataMapper.java
index dd6007a2e..752af6587 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/external/service/serialization/mapper/loan/LoanAccountDataMapper.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/external/service/serialization/mapper/loan/LoanAccountDataMapper.java
@@ -22,9 +22,15 @@ import org.apache.fineract.avro.loan.v1.LoanAccountDataV1;
import org.apache.fineract.infrastructure.event.external.service.serialization.mapper.support.AvroMapperConfig;
import org.apache.fineract.portfolio.loanaccount.data.LoanAccountData;
import org.mapstruct.Mapper;
+import org.mapstruct.Mapping;
@Mapper(config = AvroMapperConfig.class)
public interface LoanAccountDataMapper {
+ // TODO: avoid prefix "is" in class attributes; I would recommend to fix this also in the Avro structures
+ @Mapping(source = "loanProductLinkedToFloatingRate", target = "isLoanProductLinkedToFloatingRate")
+ @Mapping(source = "floatingInterestRate", target = "isFloatingInterestRate")
+ @Mapping(source = "topup", target = "isTopup")
+ @Mapping(source = "interestRecalculationEnabled", target = "isInterestRecalculationEnabled")
LoanAccountDataV1 map(LoanAccountData source);
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/data/CalendarData.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/data/CalendarData.java
index e1295063a..aba4e210e 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/data/CalendarData.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/data/CalendarData.java
@@ -24,8 +24,9 @@ import java.time.LocalTime;
import java.time.OffsetDateTime;
import java.util.Collection;
import java.util.List;
-import lombok.EqualsAndHashCode;
-import lombok.Getter;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.experimental.Accessors;
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
import org.apache.fineract.portfolio.calendar.domain.CalendarFrequencyType;
import org.apache.fineract.portfolio.calendar.domain.CalendarRemindBy;
@@ -35,57 +36,55 @@ import org.apache.fineract.portfolio.calendar.service.CalendarEnumerations;
import org.apache.fineract.portfolio.calendar.service.CalendarUtils;
import org.apache.fineract.portfolio.common.domain.NthDayType;
-/**
- * Immutable data object representing a Calendar.
- */
-@Getter
-@EqualsAndHashCode
+@Data
+@NoArgsConstructor
+@Accessors(chain = true)
public final class CalendarData implements Serializable {
- private final Long id;
- private final Long calendarInstanceId;
- private final Long entityId;
- private final EnumOptionData entityType;
+ private Long id;
+ private Long calendarInstanceId;
+ private Long entityId;
+ private EnumOptionData entityType;
private String title;
- private final String description;
- private final String location;
- private final LocalDate startDate;
- private final LocalDate endDate;
- private final LocalTime meetingTime;
- private final Integer duration;
- private final EnumOptionData type;
- private final boolean repeating;
- private final String recurrence;
- private final EnumOptionData frequency;
- private final Integer interval;
- private final EnumOptionData repeatsOnDay;
- private final EnumOptionData repeatsOnNthDayOfMonth;
- private final EnumOptionData remindBy;
- private final Integer firstReminder;
- private final Integer secondReminder;
- private final Collection recurringDates;
- private final Collection nextTenRecurringDates;
- private final String humanReadable;
- private final LocalDate recentEligibleMeetingDate;
+ private String description;
+ private String location;
+ private LocalDate startDate;
+ private LocalDate endDate;
+ private LocalTime meetingTime;
+ private Integer duration;
+ private EnumOptionData type;
+ private boolean repeating;
+ private String recurrence;
+ private EnumOptionData frequency;
+ private Integer interval;
+ private EnumOptionData repeatsOnDay;
+ private EnumOptionData repeatsOnNthDayOfMonth;
+ private EnumOptionData remindBy;
+ private Integer firstReminder;
+ private Integer secondReminder;
+ private Collection recurringDates;
+ private Collection nextTenRecurringDates;
+ private String humanReadable;
+ private LocalDate recentEligibleMeetingDate;
- private final OffsetDateTime createdDate;
- private final OffsetDateTime lastUpdatedDate;
- private final Long createdByUserId;
- private final String createdByUsername;
- private final Long lastUpdatedByUserId;
- private final String lastUpdatedByUsername;
- private final Integer repeatsOnDayOfMonth;
+ private OffsetDateTime createdDate;
+ private OffsetDateTime lastUpdatedDate;
+ private Long createdByUserId;
+ private String createdByUsername;
+ private Long lastUpdatedByUserId;
+ private String lastUpdatedByUsername;
+ private Integer repeatsOnDayOfMonth;
// template related
- final List entityTypeOptions;
- final List calendarTypeOptions;
- final List remindByOptions;
- final List frequencyOptions;
- final List repeatsOnDayOptions;
- final List frequencyNthDayTypeOptions;
+ private List entityTypeOptions;
+ private List calendarTypeOptions;
+ private List remindByOptions;
+ private List frequencyOptions;
+ private List repeatsOnDayOptions;
+ private List frequencyNthDayTypeOptions;
// import fields
- private transient Integer rowIndex;
+ private Integer rowIndex;
private String dateFormat;
private String locale;
private String centerId;
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoanApiConstants.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoanApiConstants.java
index 087c80acf..82962c8c1 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoanApiConstants.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoanApiConstants.java
@@ -49,7 +49,7 @@ public interface LoanApiConstants {
String rejectedOnDateParameterName = "rejectedOnDate";
String withdrawnOnDateParameterName = "withdrawnOnDate";
- String transactionProcessingStrategyIdParameterName = "transactionProcessingStrategyId";
+ String transactionProcessingStrategyCodeParameterName = "transactionProcessingStrategyCode";
String loanPurposeIdParameterName = "loanPurposeId";
String loanOfficerIdParameterName = "loanOfficerId";
String fundIdParameterName = "fundId";
@@ -69,6 +69,7 @@ public interface LoanApiConstants {
String interestCalculationPeriodTypeParameterName = "interestCalculationPeriodType";
String interestTypeParameterName = "interestType";
String amortizationTypeParameterName = "amortizationType";
+ String amortizationTypeOptionsParameterName = "amortizationTypeOptions";
String repaymentFrequencyTypeParameterName = "repaymentFrequencyType";
String loanTermFrequencyTypeParameterName = "loanTermFrequencyType";
String loanTermFrequencyParameterName = "loanTermFrequency";
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 87be8ea40..8468e2e01 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
@@ -32,6 +32,7 @@ import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.tags.Tag;
import java.io.InputStream;
+import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
@@ -102,6 +103,7 @@ import org.apache.fineract.portfolio.charge.service.ChargeReadPlatformService;
import org.apache.fineract.portfolio.client.data.ClientData;
import org.apache.fineract.portfolio.collateralmanagement.data.LoanCollateralResponseData;
import org.apache.fineract.portfolio.collateralmanagement.service.LoanCollateralManagementReadPlatformService;
+import org.apache.fineract.portfolio.common.domain.PeriodFrequencyType;
import org.apache.fineract.portfolio.delinquency.api.DelinquencyApiResourceSwagger;
import org.apache.fineract.portfolio.delinquency.data.LoanDelinquencyTagHistoryData;
import org.apache.fineract.portfolio.delinquency.service.DelinquencyReadPlatformService;
@@ -121,6 +123,7 @@ import org.apache.fineract.portfolio.loanaccount.data.LoanTermVariationsData;
import org.apache.fineract.portfolio.loanaccount.data.LoanTransactionData;
import org.apache.fineract.portfolio.loanaccount.data.PaidInAdvanceData;
import org.apache.fineract.portfolio.loanaccount.data.RepaymentScheduleRelatedLoanData;
+import org.apache.fineract.portfolio.loanaccount.domain.LoanStatus;
import org.apache.fineract.portfolio.loanaccount.domain.LoanTermVariationType;
import org.apache.fineract.portfolio.loanaccount.exception.LoanTemplateTypeRequiredException;
import org.apache.fineract.portfolio.loanaccount.exception.NotSupportedLoanTemplateTypeException;
@@ -191,7 +194,7 @@ import org.springframework.util.CollectionUtils;
+ "Example Values: 0=Daily, 1=Same as repayment period\n" + "allowPartialPeriodInterestCalcualtion\n"
+ "This value will be supported along with interestCalculationPeriodType as Same as repayment period to calculate interest for partial periods. Example: Interest charged from is 5th of April , Principal is 10000 and interest is 1% per month then the interest will be (10000 * 1%)* (25/30) , it calculates for the month first then calculates exact periods between start date and end date(can be a decimal)\n"
+ "inArrearsTolerance\n" + "The amount that can be 'waived' at end of all loan payments because it is too small to worry about.\n"
- + "This is also the tolerance amount assessed when determining if a loan is in arrears.\n" + "transactionProcessingStrategyId\n"
+ + "This is also the tolerance amount assessed when determining if a loan is in arrears.\n" + "transactionProcessingStrategyCode\n"
+ "An enumeration that indicates the type of transaction processing strategy to be used. This relates to functionality that is also known as Payment Application Logic.\n"
+ "A number of out of the box approaches exist, some are custom to specific MFIs, some are more general and indicate the order in which payments are processed.\n"
+ "\n"
@@ -213,7 +216,7 @@ public class LoansApiResource {
"clientId", "group", "loanProductId", "loanProductName", "loanProductDescription", "isLoanProductLinkedToFloatingRate",
"fundId", "fundName", "loanPurposeId", "loanPurposeName", "loanOfficerId", "loanOfficerName", "currency", "principal",
"totalOverpaid", "inArrearsTolerance", "termFrequency", "termPeriodFrequencyType", "numberOfRepayments", "repaymentEvery",
- "interestRatePerPeriod", "annualInterestRate", "repaymentFrequencyType", "transactionProcessingStrategyId",
+ "interestRatePerPeriod", "annualInterestRate", "repaymentFrequencyType", "transactionProcessingStrategyCode",
"transactionProcessingStrategyName", "interestRateFrequencyType", "amortizationType", "interestType",
"interestCalculationPeriodType", LoanProductConstants.ALLOW_PARTIAL_PERIOD_INTEREST_CALCUALTION_PARAM_NAME,
"expectedFirstRepaymentOnDate", "graceOnPrincipalPayment", "recurringMoratoriumOnPrincipalPeriods", "graceOnInterestPayment",
@@ -345,11 +348,15 @@ public class LoansApiResource {
if (templateType.equals("individual") || templateType.equals("jlg")) {
if (clientId == null) {
- newLoanAccount = newLoanAccount == null ? LoanAccountData.emptyTemplate() : newLoanAccount;
+ newLoanAccount = newLoanAccount == null ? LoanAccountData.collateralTemplate(null) : newLoanAccount;
} else {
final LoanAccountData loanAccountClientDetails = this.loanReadPlatformService.retrieveClientDetailsTemplate(clientId);
- officeId = loanAccountClientDetails.officeId();
+ officeId = loanAccountClientDetails.getClientOfficeId();
+
+ if (officeId == null && loanAccountClientDetails.getGroup() != null) {
+ officeId = loanAccountClientDetails.getGroup().getOfficeId();
+ }
newLoanAccount = newLoanAccount == null ? loanAccountClientDetails
: LoanAccountData.populateClientDefaults(newLoanAccount, loanAccountClientDetails);
}
@@ -364,7 +371,7 @@ public class LoansApiResource {
} else if (templateType.equals("group")) {
final LoanAccountData loanAccountGroupData = this.loanReadPlatformService.retrieveGroupDetailsTemplate(groupId);
- officeId = loanAccountGroupData.groupOfficeId();
+ officeId = loanAccountGroupData.getGroup() != null ? loanAccountGroupData.getGroup().getOfficeId() : null;
calendarOptions = this.loanReadPlatformService.retrieveCalendars(groupId);
newLoanAccount = newLoanAccount == null ? loanAccountGroupData
: LoanAccountData.populateGroupDefaults(newLoanAccount, loanAccountGroupData);
@@ -373,7 +380,7 @@ public class LoansApiResource {
} else if (templateType.equals("jlgbulk")) {
// get group details along with members in that group
final LoanAccountData loanAccountGroupData = this.loanReadPlatformService.retrieveGroupAndMembersDetailsTemplate(groupId);
- officeId = loanAccountGroupData.groupOfficeId();
+ officeId = loanAccountGroupData.getGroup() != null ? loanAccountGroupData.getGroup().getOfficeId() : null;
calendarOptions = this.loanReadPlatformService.retrieveCalendars(groupId);
newLoanAccount = newLoanAccount == null ? loanAccountGroupData
: LoanAccountData.populateGroupDefaults(newLoanAccount, loanAccountGroupData);
@@ -471,7 +478,8 @@ public class LoansApiResource {
loanBasicDetails = LoanAccountData.withInterestRecalculationCalendarData(loanBasicDetails, calendarData,
compoundingCalendarData);
}
- if (loanBasicDetails.isMonthlyRepaymentFrequencyType()) {
+ if (loanBasicDetails.getRepaymentFrequencyType() != null
+ && loanBasicDetails.getRepaymentFrequencyType().getId().intValue() == PeriodFrequencyType.MONTHS.getValue()) {
Collection loanCalendarDatas = this.calendarReadPlatformService.retrieveCalendarsByEntity(loanId,
CalendarEntityType.LOANS.getValue(), null);
CalendarData calendarData = null;
@@ -542,9 +550,13 @@ public class LoansApiResource {
if (associationParameters.contains(DataTableApiConstant.repaymentScheduleAssociateParamName)) {
mandatoryResponseParameters.add(DataTableApiConstant.repaymentScheduleAssociateParamName);
- final RepaymentScheduleRelatedLoanData repaymentScheduleRelatedData = loanBasicDetails.repaymentScheduleRelatedData();
+ final RepaymentScheduleRelatedLoanData repaymentScheduleRelatedData = loanBasicDetails.getTimeline()
+ .repaymentScheduleRelatedData(loanBasicDetails.getCurrency(), loanBasicDetails.getPrincipal(),
+ loanBasicDetails.getApprovedPrincipal(), loanBasicDetails.getInArrearsTolerance(),
+ loanBasicDetails.getFeeChargesAtDisbursementCharged());
repaymentSchedule = this.loanReadPlatformService.retrieveRepaymentSchedule(loanId, repaymentScheduleRelatedData,
- disbursementData, loanBasicDetails.isInterestRecalculationEnabled(), loanBasicDetails.getTotalPaidFeeCharges());
+ disbursementData, loanBasicDetails.isInterestRecalculationEnabled(),
+ loanBasicDetails.getSummary() != null ? loanBasicDetails.getSummary().getFeeChargesPaid() : BigDecimal.ZERO);
if (associationParameters.contains(DataTableApiConstant.futureScheduleAssociateParamName)
&& loanBasicDetails.isInterestRecalculationEnabled()) {
@@ -553,7 +565,8 @@ public class LoansApiResource {
}
if (associationParameters.contains(DataTableApiConstant.originalScheduleAssociateParamName)
- && loanBasicDetails.isInterestRecalculationEnabled() && loanBasicDetails.isActive()) {
+ && loanBasicDetails.isInterestRecalculationEnabled()
+ && LoanStatus.fromInt(loanBasicDetails.getStatus().getId().intValue()).isActive()) {
mandatoryResponseParameters.add(DataTableApiConstant.originalScheduleAssociateParamName);
LoanScheduleData loanScheduleData = this.loanScheduleHistoryReadPlatformService.retrieveRepaymentArchiveSchedule(loanId,
repaymentScheduleRelatedData, disbursementData);
@@ -597,7 +610,7 @@ public class LoansApiResource {
if (associationParameters.contains(DataTableApiConstant.collectionAssociateParamName)) {
mandatoryResponseParameters.add(DataTableApiConstant.collectionAssociateParamName);
- if (loanBasicDetails.isActive()) {
+ if (LoanStatus.fromInt(loanBasicDetails.getStatus().getId().intValue()).isActive()) {
collectionData = this.loanReadPlatformService.retrieveLoanCollectionData(loanId);
}
}
@@ -655,8 +668,12 @@ public class LoansApiResource {
}
chargeTemplate = this.loanChargeReadPlatformService.retrieveLoanChargeTemplate();
- allowedLoanOfficers = this.loanReadPlatformService.retrieveAllowedLoanOfficers(loanBasicDetails.officeId(),
- staffInSelectedOfficeOnly);
+ Long officeId = loanBasicDetails.getClientOfficeId();
+
+ if (officeId == null && loanBasicDetails.getGroup() != null) {
+ officeId = loanBasicDetails.getGroup().getOfficeId();
+ }
+ allowedLoanOfficers = this.loanReadPlatformService.retrieveAllowedLoanOfficers(officeId, staffInSelectedOfficeOnly);
loanPurposeOptions = this.codeValueReadPlatformService.retrieveCodeValuesByCode("LoanPurpose");
loanCollateralOptions = this.codeValueReadPlatformService.retrieveCodeValuesByCode("LoanCollateral");
@@ -674,8 +691,8 @@ public class LoansApiResource {
mandatoryResponseParameters.add(DataTableApiConstant.linkedAccountAssociateParamName);
linkedAccount = this.accountAssociationsReadPlatformService.retriveLoanLinkedAssociation(loanId);
}
- if (loanBasicDetails.groupId() != null) {
- calendarOptions = this.loanReadPlatformService.retrieveCalendars(loanBasicDetails.groupId());
+ if (loanBasicDetails.getGroup() != null && loanBasicDetails.getGroup().getId() != null) {
+ calendarOptions = this.loanReadPlatformService.retrieveCalendars(loanBasicDetails.getGroup().getId());
}
if (loanBasicDetails.getProduct().isCanUseForTopup() && loanBasicDetails.getClientId() != null) {
@@ -745,7 +762,7 @@ public class LoansApiResource {
@Produces({ MediaType.APPLICATION_JSON })
@Operation(summary = "Calculate loan repayment schedule | Submit a new Loan Application", description = "It calculates the loan repayment Schedule\n"
+ "Submits a new loan application\n"
- + "Mandatory Fields: clientId, productId, principal, loanTermFrequency, loanTermFrequencyType, loanType, numberOfRepayments, repaymentEvery, repaymentFrequencyType, interestRatePerPeriod, amortizationType, interestType, interestCalculationPeriodType, transactionProcessingStrategyId, expectedDisbursementDate, submittedOnDate, loanType\n"
+ + "Mandatory Fields: clientId, productId, principal, loanTermFrequency, loanTermFrequencyType, loanType, numberOfRepayments, repaymentEvery, repaymentFrequencyType, interestRatePerPeriod, amortizationType, interestType, interestCalculationPeriodType, transactionProcessingStrategyCode, expectedDisbursementDate, submittedOnDate, loanType\n"
+ "Optional Fields: graceOnPrincipalPayment, graceOnInterestPayment, graceOnInterestCharged, linkAccountId, allowPartialPeriodInterestCalcualtion, fixedEmiAmount, maxOutstandingLoanBalance, disbursementData, graceOnArrearsAgeing, createStandingInstructionAtDisbursement (requires linkedAccountId if set to true)\n"
+ "Additional Mandatory Fields if interest recalculation is enabled for product and Rest frequency not same as repayment period: recalculationRestFrequencyDate\n"
+ "Additional Mandatory Fields if interest recalculation with interest/fee compounding is enabled for product and compounding frequency not same as repayment period: recalculationCompoundingFrequencyDate\n"
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoansApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoansApiResourceSwagger.java
index 00be3eb35..1049893b2 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoansApiResourceSwagger.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoansApiResourceSwagger.java
@@ -958,8 +958,8 @@ final class LoansApiResourceSwagger {
public BigDecimal fixedPrincipalPercentagePerInstallment;
public GetLoansLoanIdInterestType interestType;
public GetLoansLoanIdInterestCalculationPeriodType interestCalculationPeriodType;
- @Schema(example = "2")
- public Integer transactionProcessingStrategyId;
+ @Schema(example = "mifos-standard-strategy")
+ public String transactionProcessingStrategyCode;
public GetLoansLoanIdTimeline timeline;
public GetLoansLoanIdSummary summary;
public GetLoansLoanIdRepaymentSchedule repaymentSchedule;
@@ -1033,8 +1033,8 @@ final class LoansApiResourceSwagger {
public Integer interestCalculationPeriodType;
@Schema(example = "20 September 2011")
public String expectedDisbursementDate;
- @Schema(example = "2")
- public Integer transactionProcessingStrategyId;
+ @Schema(example = "mifos-standard-strategy")
+ public String transactionProcessingStrategyCode;
@Schema(example = "360", allowableValues = "1, 360, 364, 36")
public Integer daysInYearType;
@Schema(example = "individual")
@@ -1155,8 +1155,8 @@ final class LoansApiResourceSwagger {
public BigDecimal fixedPrincipalPercentagePerInstallment;
@Schema(example = "04 March 2014")
public String expectedDisbursementDate;
- @Schema(example = "1")
- public Integer transactionProcessingStrategyId;
+ @Schema(example = "mifos-standard-strategy")
+ public String transactionProcessingStrategyCode;
@Schema(example = "1")
public Long linkAccountId;
@Schema(example = "true")
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/data/CollectionData.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/data/CollectionData.java
index 35c685311..37882f00e 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/data/CollectionData.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/data/CollectionData.java
@@ -20,17 +20,23 @@ package org.apache.fineract.portfolio.loanaccount.data;
import java.math.BigDecimal;
import java.time.LocalDate;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.experimental.Accessors;
+@Data
+@NoArgsConstructor
+@Accessors(chain = true)
public final class CollectionData {
- private final BigDecimal availableDisbursementAmount;
- private final int pastDueDays;
- private final LocalDate nextPaymentDueDate;
- private final int delinquentDays;
- private final LocalDate delinquentDate;
- private final BigDecimal delinquentAmount;
- private final LocalDate lastPaymentDate;
- private final BigDecimal lastPaymentAmount;
+ private BigDecimal availableDisbursementAmount;
+ private int pastDueDays;
+ private LocalDate nextPaymentDueDate;
+ private int delinquentDays;
+ private LocalDate delinquentDate;
+ private BigDecimal delinquentAmount;
+ private LocalDate lastPaymentDate;
+ private BigDecimal lastPaymentAmount;
private CollectionData(BigDecimal availableDisbursementAmount, int pastDueDays, LocalDate nextPaymentDueDate, int delinquentDays,
LocalDate delinquentDate, BigDecimal delinquentAmount, LocalDate lastPaymentDate, BigDecimal lastPaymentAmount) {
@@ -55,36 +61,4 @@ public final class CollectionData {
final BigDecimal zero = BigDecimal.ZERO;
return new CollectionData(zero, 0, null, 0, null, zero, null, zero);
}
-
- public BigDecimal getAvailableDisbursementAmount() {
- return availableDisbursementAmount;
- }
-
- public int getPastDueDays() {
- return pastDueDays;
- }
-
- public LocalDate getNextPaymentDueDate() {
- return nextPaymentDueDate;
- }
-
- public int getDelinquentDays() {
- return delinquentDays;
- }
-
- public LocalDate getDelinquentDate() {
- return delinquentDate;
- }
-
- public BigDecimal getDelinquentAmount() {
- return delinquentAmount;
- }
-
- public LocalDate getLastPaymentDate() {
- return lastPaymentDate;
- }
-
- public BigDecimal getLastPaymentAmount() {
- return lastPaymentAmount;
- }
}
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 43c36eefb..98769f2bc 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
@@ -28,7 +28,9 @@ import java.util.List;
import java.util.Locale;
import java.util.Map;
import javax.persistence.Transient;
-import lombok.Getter;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.experimental.Accessors;
import org.apache.fineract.infrastructure.codes.data.CodeValueData;
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
import org.apache.fineract.infrastructure.dataqueries.data.DatatableData;
@@ -38,12 +40,10 @@ import org.apache.fineract.portfolio.account.data.PortfolioAccountData;
import org.apache.fineract.portfolio.accountdetails.data.LoanAccountSummaryData;
import org.apache.fineract.portfolio.calendar.data.CalendarData;
import org.apache.fineract.portfolio.charge.data.ChargeData;
-import org.apache.fineract.portfolio.common.domain.PeriodFrequencyType;
import org.apache.fineract.portfolio.delinquency.data.DelinquencyRangeData;
import org.apache.fineract.portfolio.floatingrates.data.InterestRatePeriodData;
import org.apache.fineract.portfolio.fund.data.FundData;
import org.apache.fineract.portfolio.group.data.GroupGeneralData;
-import org.apache.fineract.portfolio.loanaccount.domain.LoanStatus;
import org.apache.fineract.portfolio.loanaccount.guarantor.data.GuarantorData;
import org.apache.fineract.portfolio.loanaccount.loanschedule.data.LoanScheduleData;
import org.apache.fineract.portfolio.loanproduct.data.LoanProductBorrowerCycleVariationData;
@@ -52,182 +52,186 @@ import org.apache.fineract.portfolio.loanproduct.data.TransactionProcessingStrat
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.springframework.util.CollectionUtils;
-/**
- * Immutable data object representing loan account data.
- */
-@Getter
-public final class LoanAccountData {
+@Data
+@NoArgsConstructor
+@Accessors(chain = true)
+public class LoanAccountData {
// basic loan details
// identity
- private final Long id;
- private final String accountNo;
- private final String externalId;
+ private Long id;
+ private String accountNo;
+ private String externalId;
// status
- private final LoanStatusEnumData status;
- private final EnumOptionData subStatus;
+ private LoanStatusEnumData status;
+ private EnumOptionData subStatus;
// related to
- private final Long clientId;
- private final String clientAccountNo;
- private final String clientName;
- private final String clientExternalId;
- private final Long clientOfficeId;
- private final GroupGeneralData group;
- private final Long loanProductId;
- private final String loanProductName;
- private final String loanProductDescription;
- private final boolean isLoanProductLinkedToFloatingRate;
- private final Long fundId;
- private final String fundName;
- private final Long loanPurposeId;
- private final String loanPurposeName;
- private final Long loanOfficerId;
- private final String loanOfficerName;
- private final EnumOptionData loanType;
+ private Long clientId;
+ private String clientAccountNo;
+ private String clientName;
+ private String clientExternalId;
+ private Long clientOfficeId;
+ private GroupGeneralData group;
+ private Long loanProductId;
+ private String loanProductName;
+ private String loanProductDescription;
+ // TODO: avoid prefix "is"
+ private boolean isLoanProductLinkedToFloatingRate;
+ private Long fundId;
+ private String fundName;
+ private Long loanPurposeId;
+ private String loanPurposeName;
+ private Long loanOfficerId;
+ private String loanOfficerName;
+ private EnumOptionData loanType;
// terms
- private final CurrencyData currency;
- private final BigDecimal principal;
- private final BigDecimal approvedPrincipal;
- private final BigDecimal proposedPrincipal;
- private final BigDecimal netDisbursalAmount;
+ private CurrencyData currency;
+ private BigDecimal principal;
+ private BigDecimal approvedPrincipal;
+ private BigDecimal proposedPrincipal;
+ private BigDecimal netDisbursalAmount;
- private final Integer termFrequency;
- private final EnumOptionData termPeriodFrequencyType;
- private final Integer numberOfRepayments;
- private final Integer repaymentEvery;
- private final EnumOptionData repaymentFrequencyType;
- private final EnumOptionData repaymentFrequencyNthDayType;
- private final EnumOptionData repaymentFrequencyDayOfWeekType;
- private final BigDecimal interestRatePerPeriod;
- private final EnumOptionData interestRateFrequencyType;
- private final BigDecimal annualInterestRate;
- private final boolean isFloatingInterestRate;
- private final BigDecimal interestRateDifferential;
+ private Integer termFrequency;
+ private EnumOptionData termPeriodFrequencyType;
+ private Integer numberOfRepayments;
+ private Integer repaymentEvery;
+ private EnumOptionData repaymentFrequencyType;
+ private EnumOptionData repaymentFrequencyNthDayType;
+ private EnumOptionData repaymentFrequencyDayOfWeekType;
+ private BigDecimal interestRatePerPeriod;
+ private EnumOptionData interestRateFrequencyType;
+ private BigDecimal annualInterestRate;
+ // TODO: avoid prefix "is"
+ private boolean isFloatingInterestRate;
+ private BigDecimal interestRateDifferential;
// settings
- private final EnumOptionData amortizationType;
- private final EnumOptionData interestType;
- private final EnumOptionData interestCalculationPeriodType;
- private final Boolean allowPartialPeriodInterestCalculation;
- private final BigDecimal inArrearsTolerance;
- private final Long transactionProcessingStrategyId;
- private final String transactionProcessingStrategyName;
- private final Integer graceOnPrincipalPayment;
- private final Integer recurringMoratoriumOnPrincipalPeriods;
- private final Integer graceOnInterestPayment;
- private final Integer graceOnInterestCharged;
- private final Integer graceOnArrearsAgeing;
- private final LocalDate interestChargedFromDate;
- private final LocalDate expectedFirstRepaymentOnDate;
- private final Boolean syncDisbursementWithMeeting;
- private final Boolean disallowExpectedDisbursements;
+ private EnumOptionData amortizationType;
+ private EnumOptionData interestType;
+ private EnumOptionData interestCalculationPeriodType;
+ private Boolean allowPartialPeriodInterestCalculation;
+ private BigDecimal inArrearsTolerance;
+ private String transactionProcessingStrategyCode;
+ private String transactionProcessingStrategyName;
+ private Integer graceOnPrincipalPayment;
+ private Integer recurringMoratoriumOnPrincipalPeriods;
+ private Integer graceOnInterestPayment;
+ private Integer graceOnInterestCharged;
+ private Integer graceOnArrearsAgeing;
+ private LocalDate interestChargedFromDate;
+ private LocalDate expectedFirstRepaymentOnDate;
+ private Boolean syncDisbursementWithMeeting;
+ private Boolean disallowExpectedDisbursements;
// timeline
- private final LoanApplicationTimelineData timeline;
+ private LoanApplicationTimelineData timeline;
// totals
- private final LoanSummaryData summary;
+ private LoanSummaryData summary;
// associations
- private final LoanScheduleData repaymentSchedule;
- private final Collection transactions;
- private final Collection charges;
- private final Collection collateral;
- private final Collection guarantors;
- private final CalendarData meeting;
- private final Collection notes;
- private final Collection disbursementDetails;
- private final LoanScheduleData originalSchedule;
+ private LoanScheduleData repaymentSchedule;
+ private Collection transactions;
+ private Collection charges;
+ private Collection collateral;
+ private Collection guarantors;
+ private CalendarData meeting;
+ private Collection notes;
+ private Collection disbursementDetails;
+ private LoanScheduleData originalSchedule;
// template
- private final Collection productOptions;
- private final Collection loanOfficerOptions;
- private final Collection loanPurposeOptions;
- private final Collection fundOptions;
- private final Collection termFrequencyTypeOptions;
- private final Collection repaymentFrequencyTypeOptions;
- private final Collection repaymentFrequencyNthDayTypeOptions;
- private final Collection repaymentFrequencyDaysOfWeekTypeOptions;
+ private Collection productOptions;
+ private Collection loanOfficerOptions;
+ private Collection loanPurposeOptions;
+ private Collection fundOptions;
+ private Collection termFrequencyTypeOptions;
+ private Collection repaymentFrequencyTypeOptions;
+ private Collection repaymentFrequencyNthDayTypeOptions;
+ private Collection repaymentFrequencyDaysOfWeekTypeOptions;
- private final Collection interestRateFrequencyTypeOptions;
- private final Collection amortizationTypeOptions;
- private final Collection interestTypeOptions;
- private final Collection interestCalculationPeriodTypeOptions;
- private final Collection transactionProcessingStrategyOptions;
- private final Collection chargeOptions;
- private final Collection loanCollateralOptions;
- private final Collection calendarOptions;
+ private Collection interestRateFrequencyTypeOptions;
+ private Collection amortizationTypeOptions;
+ private Collection interestTypeOptions;
+ private Collection interestCalculationPeriodTypeOptions;
+ private Collection transactionProcessingStrategyOptions;
+ private Collection chargeOptions;
+ private Collection loanCollateralOptions;
+ private Collection calendarOptions;
@Transient
- private final BigDecimal feeChargesAtDisbursementCharged;
- private final BigDecimal totalOverpaid;
+ private BigDecimal feeChargesAtDisbursementCharged;
+ private BigDecimal totalOverpaid;
// loanCycle
- private final Integer loanCounter;
- private final Integer loanProductCounter;
+ private Integer loanCounter;
+ private Integer loanProductCounter;
// linkable account details
- private final PortfolioAccountData linkedAccount;
- private final Collection accountLinkingOptions;
+ private PortfolioAccountData linkedAccount;
+ private Collection accountLinkingOptions;
- private final Boolean multiDisburseLoan;
+ private Boolean multiDisburseLoan;
- private final Boolean canDefineInstallmentAmount;
+ private Boolean canDefineInstallmentAmount;
- private final BigDecimal fixedEmiAmount;
+ private BigDecimal fixedEmiAmount;
- private final BigDecimal maxOutstandingLoanBalance;
+ private BigDecimal maxOutstandingLoanBalance;
- private final Boolean canDisburse;
+ private Boolean canDisburse;
- private final Collection emiAmountVariations;
- private final Collection clientActiveLoanOptions;
- private final Boolean canUseForTopup;
- private final boolean isTopup;
- private final boolean fraud;
- private final Long closureLoanId;
- private final String closureLoanAccountNo;
- private final BigDecimal topupAmount;
+ private Collection emiAmountVariations;
+ private Collection clientActiveLoanOptions;
+ private Boolean canUseForTopup;
+ // TODO: avoid prefix "is"
+ private boolean isTopup;
+ private boolean fraud;
+ private Long closureLoanId;
+ private String closureLoanAccountNo;
+ private BigDecimal topupAmount;
private LoanProductData product;
- private final Map memberVariations;
+ private Map memberVariations;
- private final Boolean inArrears;
+ private Boolean inArrears;
+ // TODO: avoid prefix "is"
+ private Boolean isNPA;
+ private Collection overdueCharges;
- private final Boolean isNPA;
+ private EnumOptionData daysInMonthType;
+ private EnumOptionData daysInYearType;
+ // TODO: avoid prefix "is"
+ private boolean isInterestRecalculationEnabled;
- private final Collection overdueCharges;
-
- private final EnumOptionData daysInMonthType;
- private final EnumOptionData daysInYearType;
- private final boolean isInterestRecalculationEnabled;
-
- private final LoanInterestRecalculationData interestRecalculationData;
- private final Boolean createStandingInstructionAtDisbursement;
+ private LoanInterestRecalculationData interestRecalculationData;
+ private Boolean createStandingInstructionAtDisbursement;
// Paid In Advance
- private final PaidInAdvanceData paidInAdvance;
+ private PaidInAdvanceData paidInAdvance;
- private final Collection interestRatesPeriods;
+ private Collection interestRatesPeriods;
// VariableInstallments
- private final Boolean isVariableInstallmentsAllowed;
- private final Integer minimumGap;
- private final Integer maximumGap;
+ // TODO: avoid prefix "is"
+ private Boolean isVariableInstallmentsAllowed;
+ private Integer minimumGap;
+ private Integer maximumGap;
private List datatables = null;
- private final Boolean isEqualAmortization;
- private final BigDecimal fixedPrincipalPercentagePerInstallment;
+ // TODO: avoid prefix "is"
+ private Boolean isEqualAmortization;
+ private BigDecimal fixedPrincipalPercentagePerInstallment;
// Rate
- private final List rates;
- private final Boolean isRatesEnabled;
+ private List rates;
+ // TODO: avoid prefix "is"
+ private Boolean isRatesEnabled;
// import fields
private String dateFormat;
@@ -242,25 +246,32 @@ public final class LoanAccountData {
private Long groupId;
private LocalDate expectedDisbursementDate;
- private final CollectionData delinquent;
- private final DelinquencyRangeData delinquencyRange;
+ private CollectionData delinquent;
+ private DelinquencyRangeData delinquencyRange;
public static LoanAccountData importInstanceIndividual(EnumOptionData loanTypeEnumOption, Long clientId, Long productId,
Long loanOfficerId, LocalDate submittedOnDate, Long fundId, BigDecimal principal, Integer numberOfRepayments,
Integer repaymentEvery, EnumOptionData repaidEveryFrequencyEnums, Integer loanTermFrequency,
EnumOptionData loanTermFrequencyTypeEnum, BigDecimal nominalInterestRate, LocalDate expectedDisbursementDate,
EnumOptionData amortizationEnumOption, EnumOptionData interestMethodEnum, EnumOptionData interestCalculationPeriodTypeEnum,
- BigDecimal inArrearsTolerance, Long transactionProcessingStrategyId, Integer graceOnPrincipalPayment,
+ BigDecimal inArrearsTolerance, String transactionProcessingStrategyCode, Integer graceOnPrincipalPayment,
Integer graceOnInterestPayment, Integer graceOnInterestCharged, LocalDate interestChargedFromDate,
LocalDate repaymentsStartingFromDate, Integer rowIndex, String externalId, Long groupId, Collection charges,
String linkAccountId, String locale, String dateFormat, List loanCollateralManagementData) {
- return new LoanAccountData(loanTypeEnumOption, clientId, productId, loanOfficerId, submittedOnDate, fundId, principal,
- numberOfRepayments, repaymentEvery, repaidEveryFrequencyEnums, loanTermFrequency, loanTermFrequencyTypeEnum,
- nominalInterestRate, expectedDisbursementDate, amortizationEnumOption, interestMethodEnum,
- interestCalculationPeriodTypeEnum, inArrearsTolerance, transactionProcessingStrategyId, graceOnPrincipalPayment,
- graceOnInterestPayment, graceOnInterestCharged, interestChargedFromDate, repaymentsStartingFromDate, rowIndex, externalId,
- null, charges, linkAccountId, locale, dateFormat, loanCollateralManagementData);
+ return new LoanAccountData().setLoanType(loanTypeEnumOption).setClientId(clientId).setProductId(productId)
+ .setLoanOfficerId(loanOfficerId).setSubmittedOnDate(submittedOnDate).setFundId(fundId).setPrincipal(principal)
+ .setNumberOfRepayments(numberOfRepayments).setRepaymentEvery(repaymentEvery)
+ .setRepaymentFrequencyType(repaidEveryFrequencyEnums).setLoanTermFrequency(loanTermFrequency)
+ .setLoanTermFrequencyType(loanTermFrequencyTypeEnum).setInterestRatePerPeriod(nominalInterestRate)
+ .setExpectedDisbursementDate(expectedDisbursementDate).setAmortizationType(amortizationEnumOption)
+ .setInterestType(interestMethodEnum).setInterestCalculationPeriodType(interestCalculationPeriodTypeEnum)
+ .setInArrearsTolerance(inArrearsTolerance).setTransactionProcessingStrategyCode(transactionProcessingStrategyCode)
+ .setGraceOnPrincipalPayment(graceOnPrincipalPayment).setGraceOnInterestPayment(graceOnInterestPayment)
+ .setGraceOnInterestCharged(graceOnInterestCharged).setInterestChargedFromDate(interestChargedFromDate)
+ .setRepaymentsStartingFromDate(repaymentsStartingFromDate).setRowIndex(rowIndex).setExternalId(externalId)
+ .setGroupId(groupId).setCharges(charges).setLinkAccountId(linkAccountId).setLocale(locale).setDateFormat(dateFormat)
+ .setCollateral(loanCollateralManagementData);
}
public static LoanAccountData importInstanceGroup(EnumOptionData loanTypeEnumOption, Long groupIdforGroupLoan, Long productId,
@@ -268,334 +279,31 @@ public final class LoanAccountData {
Integer repaidEvery, EnumOptionData repaidEveryFrequencyEnums, Integer loanTermFrequency,
EnumOptionData loanTermFrequencyTypeEnum, BigDecimal nominalInterestRate, EnumOptionData amortizationEnumOption,
EnumOptionData interestMethodEnum, EnumOptionData interestCalculationPeriodEnum, BigDecimal arrearsTolerance,
- Long transactionProcessingStrategyId, Integer graceOnPrincipalPayment, Integer graceOnInterestPayment,
+ String transactionProcessingStrategyCode, Integer graceOnPrincipalPayment, Integer graceOnInterestPayment,
Integer graceOnInterestCharged, LocalDate interestChargedFromDate, LocalDate repaymentsStartingFromDate, Integer rowIndex,
String externalId, String linkAccountId, String locale, String dateFormat) {
- return new LoanAccountData(loanTypeEnumOption, groupIdforGroupLoan, productId, loanOfficerId, submittedOnDate, fundId, principal,
- numberOfRepayments, repaidEvery, repaidEveryFrequencyEnums, loanTermFrequency, loanTermFrequencyTypeEnum,
- nominalInterestRate, null, amortizationEnumOption, interestMethodEnum, interestCalculationPeriodEnum, arrearsTolerance,
- transactionProcessingStrategyId, graceOnPrincipalPayment, graceOnInterestPayment, graceOnInterestCharged,
- interestChargedFromDate, repaymentsStartingFromDate, rowIndex, externalId, null, null, linkAccountId, locale, dateFormat,
- null);
+ return new LoanAccountData().setLoanType(loanTypeEnumOption).setGroupId(groupIdforGroupLoan).setProductId(productId)
+ .setLoanOfficerId(loanOfficerId).setSubmittedOnDate(submittedOnDate).setFundId(fundId).setPrincipal(principal)
+ .setNumberOfRepayments(numberOfRepayments).setRepaymentEvery(repaidEvery)
+ .setRepaymentFrequencyType(repaidEveryFrequencyEnums).setLoanTermFrequency(loanTermFrequency)
+ .setLoanTermFrequencyType(loanTermFrequencyTypeEnum).setInterestRatePerPeriod(nominalInterestRate)
+ .setAmortizationTypeOptions(List.of(amortizationEnumOption)).setInterestType(interestMethodEnum)
+ .setInterestCalculationPeriodType(interestCalculationPeriodEnum).setInArrearsTolerance(arrearsTolerance)
+ .setTransactionProcessingStrategyCode(transactionProcessingStrategyCode).setGraceOnPrincipalPayment(graceOnPrincipalPayment)
+ .setGraceOnInterestPayment(graceOnInterestPayment).setGraceOnInterestCharged(graceOnInterestCharged)
+ .setInterestChargedFromDate(interestChargedFromDate).setRepaymentsStartingFromDate(repaymentsStartingFromDate)
+ .setRowIndex(rowIndex).setExternalId(externalId).setLinkAccountId(linkAccountId).setLocale(locale)
+ .setDateFormat(dateFormat);
}
- private LoanAccountData(EnumOptionData loanType, Long clientId, Long productId, Long loanOfficerId, LocalDate submittedOnDate,
- Long fundId, BigDecimal principal, Integer numberOfRepayments, Integer repaymentEvery, EnumOptionData repaymentFrequencyType,
- Integer loanTermFrequency, EnumOptionData loanTermFrequencyType, BigDecimal interestRatePerPeriod,
- LocalDate expectedDisbursementDate, EnumOptionData amortizationType, EnumOptionData interestType,
- EnumOptionData interestCalculationPeriodType, BigDecimal inArrearsTolerance, Long transactionProcessingStrategyId,
- Integer graceOnPrincipalPayment, Integer graceOnInterestPayment, Integer graceOnInterestCharged,
- LocalDate interestChargedFromDate, LocalDate repaymentsStartingFromDate, Integer rowIndex, String externalId, Long groupId,
- Collection charges, String linkAccountId, String locale, String dateFormat,
- Collection loanCollateralManagementData) {
- this.dateFormat = dateFormat;
- this.locale = locale;
- this.rowIndex = rowIndex;
- this.submittedOnDate = submittedOnDate;
- this.productId = productId;
- this.loanTermFrequency = loanTermFrequency;
- this.loanTermFrequencyType = loanTermFrequencyType;
- this.repaymentsStartingFromDate = repaymentsStartingFromDate;
- this.linkAccountId = linkAccountId;
- this.externalId = externalId;
- this.clientId = clientId;
- this.fundId = fundId;
- this.loanOfficerId = loanOfficerId;
- this.numberOfRepayments = numberOfRepayments;
- this.loanType = loanType;
- this.principal = principal;
- this.repaymentEvery = repaymentEvery;
- this.repaymentFrequencyType = repaymentFrequencyType;
- this.interestRatePerPeriod = interestRatePerPeriod;
- this.amortizationType = amortizationType;
- this.interestType = interestType;
- this.interestCalculationPeriodType = interestCalculationPeriodType;
- this.inArrearsTolerance = inArrearsTolerance;
- this.transactionProcessingStrategyId = transactionProcessingStrategyId;
- this.graceOnInterestPayment = graceOnInterestPayment;
- this.graceOnInterestCharged = graceOnInterestCharged;
- this.graceOnPrincipalPayment = graceOnPrincipalPayment;
- this.interestChargedFromDate = interestChargedFromDate;
- this.groupId = groupId;
- this.expectedDisbursementDate = expectedDisbursementDate;
- this.charges = charges;
- this.rates = null;
- this.id = null;
- this.accountNo = null;
-
- this.status = null;
- this.subStatus = null;
-
- this.clientAccountNo = null;
- this.clientName = null;
- this.clientOfficeId = null;
- this.clientExternalId = null;
- this.group = null;
- this.loanProductId = null;
- this.loanProductName = null;
- this.loanProductDescription = null;
- this.isLoanProductLinkedToFloatingRate = false;
-
- this.fundName = null;
- this.loanPurposeId = null;
- this.loanPurposeName = null;
-
- this.loanOfficerName = null;
-
- this.currency = null;
-
- this.approvedPrincipal = null;
- this.proposedPrincipal = null;
- this.netDisbursalAmount = null;
- this.termFrequency = null;
- this.termPeriodFrequencyType = null;
-
- this.repaymentFrequencyNthDayType = null;
- this.repaymentFrequencyDayOfWeekType = null;
-
- this.interestRateFrequencyType = null;
- this.annualInterestRate = null;
- this.isFloatingInterestRate = false;
- this.interestRateDifferential = null;
-
- this.allowPartialPeriodInterestCalculation = null;
-
- this.transactionProcessingStrategyName = null;
-
- this.recurringMoratoriumOnPrincipalPeriods = null;
-
- this.graceOnArrearsAgeing = null;
-
- this.expectedFirstRepaymentOnDate = null;
- this.syncDisbursementWithMeeting = null;
- this.timeline = null;
- this.summary = null;
- this.repaymentSchedule = null;
- this.transactions = null;
-
- this.collateral = loanCollateralManagementData;
- this.guarantors = null;
- this.meeting = null;
- this.notes = null;
- this.disbursementDetails = null;
- this.originalSchedule = null;
- this.productOptions = null;
- this.loanOfficerOptions = null;
- this.loanPurposeOptions = null;
- this.fundOptions = null;
- this.termFrequencyTypeOptions = null;
- this.repaymentFrequencyTypeOptions = null;
- this.repaymentFrequencyNthDayTypeOptions = null;
- this.repaymentFrequencyDaysOfWeekTypeOptions = null;
- this.interestRateFrequencyTypeOptions = null;
- this.amortizationTypeOptions = null;
- this.interestTypeOptions = null;
- this.interestCalculationPeriodTypeOptions = null;
- this.transactionProcessingStrategyOptions = null;
- this.chargeOptions = null;
- this.loanCollateralOptions = null;
- this.calendarOptions = null;
- this.feeChargesAtDisbursementCharged = null;
- this.totalOverpaid = null;
- this.loanCounter = null;
- this.loanProductCounter = null;
- this.linkedAccount = null;
- this.accountLinkingOptions = null;
- this.multiDisburseLoan = null;
- this.canDefineInstallmentAmount = null;
- this.fixedEmiAmount = null;
- this.maxOutstandingLoanBalance = null;
- this.canDisburse = null;
- this.emiAmountVariations = null;
- this.clientActiveLoanOptions = null;
- this.canUseForTopup = null;
- this.isTopup = false;
- this.closureLoanId = null;
- this.closureLoanAccountNo = null;
- this.topupAmount = null;
- this.memberVariations = null;
- this.inArrears = null;
- this.isNPA = null;
- this.overdueCharges = null;
- this.daysInMonthType = null;
- this.daysInYearType = null;
- this.isInterestRecalculationEnabled = false;
- this.interestRecalculationData = null;
- this.createStandingInstructionAtDisbursement = null;
- this.paidInAdvance = null;
- this.interestRatesPeriods = null;
- this.isVariableInstallmentsAllowed = null;
- this.minimumGap = null;
- this.maximumGap = null;
- this.isEqualAmortization = null;
- this.isRatesEnabled = false;
- this.fixedPrincipalPercentagePerInstallment = null;
- this.delinquent = null;
- this.delinquencyRange = null;
- this.disallowExpectedDisbursements = false;
- this.fraud = false;
- }
-
- public static final Comparator ClientNameComparator = new Comparator() {
-
- @Override
- public int compare(LoanAccountData loan1, LoanAccountData loan2) {
- String clientOfLoan1 = loan1.getClientName().toUpperCase(Locale.ENGLISH);
- String clientOfLoan2 = loan2.getClientName().toUpperCase(Locale.ENGLISH);
- return clientOfLoan1.compareTo(clientOfLoan2);
- }
- };
-
/**
* Used to produce a {@link LoanAccountData} with only collateral options for now.
*/
public static LoanAccountData collateralTemplate(final Collection loanCollateralOptions) {
- final Long id = null;
- final String accountNo = null;
- final LoanStatusEnumData status = null;
- final EnumOptionData subStatus = null;
- final String externalId = null;
- final Long clientId = null;
- final String clientName = null;
- final String clientAccountNo = null;
- final Long clientOfficeId = null;
- final String clientExternalId = null;
- final GroupGeneralData group = null;
- final EnumOptionData loanType = null;
- final Long loanProductId = null;
- final String loanProductName = null;
- final String loanProductDescription = null;
- final boolean isLoanProductLinkedToFloatingRate = false;
- final Long fundId = null;
- final String fundName = null;
- final Long loanPurposeId = null;
- final String loanPurposeName = null;
- final Long loanOfficerId = null;
- final String loanOfficerName = null;
- final CurrencyData currencyData = null;
- final BigDecimal proposedPrincipal = null;
- final BigDecimal principal = null;
- final BigDecimal netDisbursalAmount = null;
- final BigDecimal totalOverpaid = null;
- final BigDecimal inArrearsTolerance = null;
- final Integer termFrequency = null;
- final EnumOptionData termPeriodFrequencyType = null;
- final Integer numberOfRepayments = null;
- final Integer repaymentEvery = null;
- final EnumOptionData repaymentFrequencyType = null;
- final EnumOptionData repaymentFrequencyNthDayType = null;
- final EnumOptionData repaymentFrequencyDayOfWeekType = null;
- final Long transactionProcessingStrategyId = null;
- final String transactionProcessingStrategyName = null;
- final EnumOptionData amortizationType = null;
- final BigDecimal interestRatePerPeriod = null;
- final EnumOptionData interestRateFrequencyType = null;
- final BigDecimal annualInterestRate = null;
- final EnumOptionData interestType = null;
- final boolean isFloatingInterestRate = false;
- final BigDecimal interestRateDifferential = null;
- final EnumOptionData interestCalculationPeriodType = null;
- final Boolean allowPartialPeriodInterestCalcualtion = null;
- final LocalDate expectedFirstRepaymentOnDate = null;
- final Integer graceOnPrincipalPayment = null;
- final Integer recurringMoratoriumOnPrincipalPeriods = null;
- final Integer graceOnInterestPayment = null;
- final Integer graceOnInterestCharged = null;
- final Integer graceOnArrearsAgeing = null;
- final LocalDate interestChargedFromDate = null;
- final LoanApplicationTimelineData timeline = null;
- final LoanSummaryData summary = null;
- final BigDecimal feeChargesDueAtDisbursementCharged = null;
- final LoanScheduleData repaymentSchedule = null;
- final Collection transactions = null;
- final Collection charges = null;
- final Collection collateral = null;
- final Collection guarantors = null;
- final Collection notes = null;
- final CalendarData calendarData = null;
- final Collection productOptions = null;
- final Collection termFrequencyTypeOptions = null;
- final Collection repaymentFrequencyTypeOptions = null;
- final Collection repaymentFrequencyNthDayTypeOptions = null;
- final Collection repaymentFrequencyDayOfWeekTypeOptions = null;
- final Collection transactionProcessingStrategyOptions = null;
- final Collection interestRateFrequencyTypeOptions = null;
- final Collection amortizationTypeOptions = null;
- final Collection interestTypeOptions = null;
- final Collection interestCalculationPeriodTypeOptions = null;
- final Collection fundOptions = null;
- final Collection chargeOptions = null;
- final ChargeData chargeTemplate = null;
- final Collection loanOfficerOptions = null;
- final Collection loanPurposeOptions = null;
- final Collection calendarOptions = null;
- final Boolean syncDisbursementWithMeeting = null;
- final Integer loancounter = null;
- final Integer loanProductCounter = null;
- final Collection accountLinkingOptions = null;
- final PortfolioAccountData linkedAccount = null;
- final Collection disbursementData = null;
- final Boolean multiDisburseLoan = null;
- final Boolean canDefineInstallmentAmount = null;
- final BigDecimal fixedEmiAmount = null;
- final BigDecimal maxOutstandingLoanBalance = null;
- final Collection emiAmountVariations = null;
- final Map memberVariations = null;
- final LoanProductData product = null;
- final Boolean inArrears = null;
- final Boolean isNPA = null;
- final Collection overdueCharges = null;
-
- final EnumOptionData daysInMonthType = null;
- final EnumOptionData daysInYearType = null;
- final boolean isInterestRecalculationEnabled = false;
- final LoanInterestRecalculationData interestRecalculationData = null;
- final LoanScheduleData originalSchedule = null;
- final Boolean createStandingInstructionAtDisbursement = null;
- final PaidInAdvanceData paidInAdvance = null;
- final Collection interestRatesPeriods = null;
- final Boolean isVariableInstallmentsAllowed = Boolean.FALSE;
- final Integer minimumGap = null;
- final Integer maximumGap = null;
- final Boolean canUseForTopup = null;
- final Collection clientActiveLoanOptions = null;
- final boolean isTopup = false;
- final Long closureLoanId = null;
- final String closureLoanAccountNo = null;
- final BigDecimal topupAmount = null;
- final boolean isEqualAmortization = false;
- final List rates = null;
- final Boolean isRatesEnabled = false;
- final BigDecimal fixedPrincipalPercentagePerInstallment = null;
- final CollectionData delinquent = CollectionData.template();
- final DelinquencyRangeData delinquencyRange = null;
- final Boolean disallowExpectedDisbursements = false;
- final boolean fraud = false;
-
- return new LoanAccountData(id, accountNo, status, externalId, clientId, clientAccountNo, clientName, clientOfficeId,
- clientExternalId, group, loanType, loanProductId, loanProductName, loanProductDescription,
- isLoanProductLinkedToFloatingRate, fundId, fundName, loanPurposeId, loanPurposeName, loanOfficerId, loanOfficerName,
- currencyData, proposedPrincipal, principal, principal, netDisbursalAmount, totalOverpaid, inArrearsTolerance, termFrequency,
- termPeriodFrequencyType, numberOfRepayments, repaymentEvery, repaymentFrequencyType, repaymentFrequencyNthDayType,
- repaymentFrequencyDayOfWeekType, transactionProcessingStrategyId, transactionProcessingStrategyName, amortizationType,
- interestRatePerPeriod, interestRateFrequencyType, annualInterestRate, interestType, isFloatingInterestRate,
- interestRateDifferential, interestCalculationPeriodType, allowPartialPeriodInterestCalcualtion,
- expectedFirstRepaymentOnDate, graceOnPrincipalPayment, recurringMoratoriumOnPrincipalPeriods, graceOnInterestPayment,
- graceOnInterestCharged, interestChargedFromDate, timeline, summary, feeChargesDueAtDisbursementCharged, repaymentSchedule,
- transactions, charges, collateral, guarantors, calendarData, productOptions, termFrequencyTypeOptions,
- repaymentFrequencyTypeOptions, repaymentFrequencyNthDayTypeOptions, repaymentFrequencyDayOfWeekTypeOptions,
- transactionProcessingStrategyOptions, interestRateFrequencyTypeOptions, amortizationTypeOptions, interestTypeOptions,
- interestCalculationPeriodTypeOptions, fundOptions, chargeOptions, chargeTemplate, loanOfficerOptions, loanPurposeOptions,
- loanCollateralOptions, calendarOptions, syncDisbursementWithMeeting, loancounter, loanProductCounter, notes,
- accountLinkingOptions, linkedAccount, disbursementData, multiDisburseLoan, canDefineInstallmentAmount, fixedEmiAmount,
- 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, rates, isRatesEnabled, fixedPrincipalPercentagePerInstallment, delinquent, delinquencyRange,
- disallowExpectedDisbursements, fraud);
+ return new LoanAccountData().setIsVariableInstallmentsAllowed(false).setDelinquent(CollectionData.template())
+ .setLoanCollateralOptions(loanCollateralOptions);
}
/**
@@ -603,181 +311,72 @@ public final class LoanAccountData {
*/
public static LoanAccountData clientDefaults(final Long clientId, final String clientAccountNo, final String clientName,
final Long clientOfficeId, final String clientExternalId, final LocalDate expectedDisbursementDate) {
- final Long id = null;
- final String accountNo = null;
- final LoanStatusEnumData status = null;
- final EnumOptionData subStatus = null;
- final String externalId = null;
- final GroupGeneralData group = null;
- final EnumOptionData loanType = null;
- final String groupName = null;
- final Long loanProductId = null;
- final String loanProductName = null;
- final String loanProductDescription = null;
- final boolean isLoanProductLinkedToFloatingRate = false;
- final Long fundId = null;
- final String fundName = null;
- final Long loanPurposeId = null;
- final String loanPurposeName = null;
- final Long loanOfficerId = null;
- final String loanOfficerName = null;
- final CurrencyData currencyData = null;
- final BigDecimal proposedPrincipal = null;
- final BigDecimal principal = null;
- final BigDecimal netDisbursalAmount = null;
- final BigDecimal totalOverpaid = null;
- final BigDecimal inArrearsTolerance = null;
- final Integer termFrequency = null;
- final EnumOptionData termPeriodFrequencyType = null;
- final Integer numberOfRepayments = null;
- final Integer repaymentEvery = null;
- final EnumOptionData repaymentFrequencyType = null;
- final EnumOptionData repaymentFrequencyNthDayType = null;
- final EnumOptionData repaymentFrequencyDayOfWeekType = null;
- final Long transactionProcessingStrategyId = null;
- final String transactionProcessingStrategyName = null;
- final EnumOptionData amortizationType = null;
- final BigDecimal interestRatePerPeriod = null;
- final EnumOptionData interestRateFrequencyType = null;
- final BigDecimal annualInterestRate = null;
- final EnumOptionData interestType = null;
- final boolean isFloatingInterestRate = false;
- final BigDecimal interestRateDifferential = null;
- final EnumOptionData interestCalculationPeriodType = null;
- final Boolean allowPartialPeriodInterestCalcualtion = null;
- final LocalDate expectedFirstRepaymentOnDate = null;
- final Integer graceOnPrincipalPayment = null;
- final Integer recurringMoratoriumOnPrincipalPeriods = null;
- final Integer graceOnInterestPayment = null;
- final Integer graceOnArrearsAgeing = null;
- final Integer graceOnInterestCharged = null;
- final LocalDate interestChargedFromDate = null;
- final LoanApplicationTimelineData timeline = LoanApplicationTimelineData.templateDefault(expectedDisbursementDate);
- final LoanSummaryData summary = null;
- final BigDecimal feeChargesDueAtDisbursementCharged = null;
- final LoanScheduleData repaymentSchedule = null;
- final Collection transactions = null;
- final Collection charges = null;
- final Collection collateral = null;
- final Collection guarantors = null;
- final Collection notes = null;
- final CalendarData calendarData = null;
- final Collection productOptions = null;
- final Collection termFrequencyTypeOptions = null;
- final Collection repaymentFrequencyTypeOptions = null;
- final Collection repaymentFrequencyNthDayTypeOptions = null;
- final Collection repaymentFrequencyDayOfWeekTypeOptions = null;
- final Collection repaymentStrategyOptions = null;
- final Collection interestRateFrequencyTypeOptions = null;
- final Collection amortizationTypeOptions = null;
- final Collection interestTypeOptions = null;
- final Collection interestCalculationPeriodTypeOptions = null;
- final Collection fundOptions = null;
- final Collection chargeOptions = null;
- final ChargeData chargeTemplate = null;
- final Collection loanOfficerOptions = null;
- final Collection loanPurposeOptions = null;
- final Collection loanCollateralOptions = null;
- final Collection calendarOptions = null;
- final Boolean syncDisbursementWithMeeting = null;
- final Integer loancounter = null;
- final Integer loanProductCounter = null;
- final Collection accountLinkingOptions = null;
- final PortfolioAccountData linkedAccount = null;
- final Collection disbursementData = null;
- final Boolean multiDisburseLoan = null;
- final Boolean canDefineInstallmentAmount = null;
- final BigDecimal fixedEmiAmount = null;
- final BigDecimal maxOutstandingLoanBalance = null;
- final Collection emiAmountVariations = null;
- final Map memberVariations = null;
- final LoanProductData product = null;
- final Boolean inArrears = null;
- final Boolean isNPA = null;
- final Collection overdueCharges = null;
-
- final EnumOptionData daysInMonthType = null;
- final EnumOptionData daysInYearType = null;
- final boolean isInterestRecalculationEnabled = false;
- final LoanInterestRecalculationData interestRecalculationData = null;
- final LoanScheduleData originalSchedule = null;
- final Boolean createStandingInstructionAtDisbursement = null;
- final PaidInAdvanceData paidInAdvance = null;
- final Collection interestRatesPeriods = null;
-
- final Boolean isVariableInstallmentsAllowed = Boolean.FALSE;
- final Integer minimumGap = null;
- final Integer maximumGap = null;
- final Boolean canUseForTopup = null;
- final Collection clientActiveLoanOptions = null;
- final boolean isTopup = false;
- final Long closureLoanId = null;
- final String closureLoanAccountNo = null;
- final BigDecimal topupAmount = null;
- final boolean isEqualAmortization = false;
- final List rates = null;
- final Boolean isRatesEnabled = false;
- final BigDecimal fixedPrincipalPercentagePerInstallment = null;
- final CollectionData delinquent = CollectionData.template();
- final DelinquencyRangeData delinquencyRange = null;
- final Boolean disallowExpectedDisbursements = false;
- final boolean fraud = false;
-
- return new LoanAccountData(id, accountNo, status, externalId, clientId, clientAccountNo, clientName, clientOfficeId,
- clientExternalId, group, loanType, loanProductId, loanProductName, loanProductDescription,
- isLoanProductLinkedToFloatingRate, fundId, fundName, loanPurposeId, loanPurposeName, loanOfficerId, loanOfficerName,
- currencyData, proposedPrincipal, principal, principal, netDisbursalAmount, totalOverpaid, inArrearsTolerance, termFrequency,
- termPeriodFrequencyType, numberOfRepayments, repaymentEvery, repaymentFrequencyType, repaymentFrequencyNthDayType,
- repaymentFrequencyDayOfWeekType, transactionProcessingStrategyId, transactionProcessingStrategyName, amortizationType,
- interestRatePerPeriod, interestRateFrequencyType, annualInterestRate, interestType, isFloatingInterestRate,
- interestRateDifferential, interestCalculationPeriodType, allowPartialPeriodInterestCalcualtion,
- expectedFirstRepaymentOnDate, graceOnPrincipalPayment, recurringMoratoriumOnPrincipalPeriods, graceOnInterestPayment,
- graceOnInterestCharged, interestChargedFromDate, timeline, summary, feeChargesDueAtDisbursementCharged, repaymentSchedule,
- transactions, charges, collateral, guarantors, calendarData, productOptions, termFrequencyTypeOptions,
- repaymentFrequencyTypeOptions, repaymentFrequencyNthDayTypeOptions, repaymentFrequencyDayOfWeekTypeOptions,
- repaymentStrategyOptions, interestRateFrequencyTypeOptions, amortizationTypeOptions, interestTypeOptions,
- interestCalculationPeriodTypeOptions, fundOptions, chargeOptions, chargeTemplate, loanOfficerOptions, loanPurposeOptions,
- loanCollateralOptions, calendarOptions, syncDisbursementWithMeeting, loancounter, loanProductCounter, notes,
- accountLinkingOptions, linkedAccount, disbursementData, multiDisburseLoan, canDefineInstallmentAmount, fixedEmiAmount,
- 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, rates, isRatesEnabled, fixedPrincipalPercentagePerInstallment, delinquent, delinquencyRange,
- disallowExpectedDisbursements, fraud);
+ return new LoanAccountData().setTimeline(LoanApplicationTimelineData.templateDefault(expectedDisbursementDate))
+ .setIsVariableInstallmentsAllowed(false).setDelinquent(CollectionData.template()).setClientId(clientId)
+ .setClientAccountNo(clientAccountNo).setClientName(clientName).setClientOfficeId(clientOfficeId)
+ .setClientExternalId(clientExternalId).setExpectedDisbursementDate(expectedDisbursementDate);
}
public static LoanAccountData populateClientDefaults(final LoanAccountData acc, final LoanAccountData clientAcc) {
- return new LoanAccountData(acc.id, acc.accountNo, acc.status, acc.externalId, clientAcc.clientId, clientAcc.clientAccountNo,
- clientAcc.clientName, clientAcc.clientOfficeId, acc.clientExternalId, acc.group, acc.loanType, acc.loanProductId,
- acc.loanProductName, acc.loanProductDescription, acc.isLoanProductLinkedToFloatingRate, acc.fundId, acc.fundName,
- acc.loanPurposeId, acc.loanPurposeName, acc.loanOfficerId, acc.loanOfficerName, acc.currency, acc.proposedPrincipal,
- acc.principal, acc.approvedPrincipal, acc.netDisbursalAmount, acc.totalOverpaid, acc.inArrearsTolerance, acc.termFrequency,
- acc.termPeriodFrequencyType, acc.numberOfRepayments, acc.repaymentEvery, acc.repaymentFrequencyType,
- acc.repaymentFrequencyNthDayType, acc.repaymentFrequencyDayOfWeekType, acc.transactionProcessingStrategyId,
- acc.transactionProcessingStrategyName, acc.amortizationType, acc.interestRatePerPeriod, acc.interestRateFrequencyType,
- acc.annualInterestRate, acc.interestType, acc.isFloatingInterestRate, acc.interestRateDifferential,
- acc.interestCalculationPeriodType, acc.allowPartialPeriodInterestCalculation, acc.expectedFirstRepaymentOnDate,
- acc.graceOnPrincipalPayment, acc.recurringMoratoriumOnPrincipalPeriods, acc.graceOnInterestPayment,
- acc.graceOnInterestCharged, acc.interestChargedFromDate, clientAcc.timeline, acc.summary,
- acc.feeChargesAtDisbursementCharged, acc.repaymentSchedule, acc.transactions, acc.charges, acc.collateral, acc.guarantors,
- acc.meeting, acc.productOptions, acc.termFrequencyTypeOptions, acc.repaymentFrequencyTypeOptions,
- acc.repaymentFrequencyNthDayTypeOptions, acc.repaymentFrequencyDaysOfWeekTypeOptions,
- acc.transactionProcessingStrategyOptions, acc.interestRateFrequencyTypeOptions, acc.amortizationTypeOptions,
- acc.interestTypeOptions, acc.interestCalculationPeriodTypeOptions, acc.fundOptions, acc.chargeOptions, null,
- acc.loanOfficerOptions, acc.loanPurposeOptions, acc.loanCollateralOptions, acc.calendarOptions,
- acc.syncDisbursementWithMeeting, acc.loanCounter, acc.loanProductCounter, acc.notes, acc.accountLinkingOptions,
- acc.linkedAccount, acc.disbursementDetails, acc.multiDisburseLoan, acc.canDefineInstallmentAmount, acc.fixedEmiAmount,
- acc.maxOutstandingLoanBalance, acc.emiAmountVariations, acc.memberVariations, acc.product, acc.inArrears,
- acc.graceOnArrearsAgeing, acc.overdueCharges, 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.rates, acc.isRatesEnabled,
- acc.fixedPrincipalPercentagePerInstallment, acc.delinquent, acc.delinquencyRange, acc.disallowExpectedDisbursements,
- acc.fraud);
+ return new LoanAccountData().setId(acc.id).setAccountNo(acc.accountNo).setStatus(acc.status).setExternalId(acc.externalId)
+ .setClientId(clientAcc.clientId).setClientAccountNo(clientAcc.clientAccountNo).setClientName(clientAcc.clientName)
+ .setClientOfficeId(clientAcc.clientOfficeId).setClientExternalId(acc.clientExternalId).setGroup(acc.group)
+ .setLoanType(acc.loanType).setLoanProductId(acc.loanProductId).setLoanProductName(acc.loanProductName)
+ .setLoanProductDescription(acc.loanProductDescription)
+ .setLoanProductLinkedToFloatingRate(acc.isLoanProductLinkedToFloatingRate).setFundId(acc.fundId).setFundName(acc.fundName)
+ .setLoanPurposeId(acc.loanPurposeId).setLoanPurposeName(acc.loanPurposeName).setLoanOfficerId(acc.loanOfficerId)
+ .setLoanOfficerName(acc.loanOfficerName).setCurrency(acc.currency).setProposedPrincipal(acc.proposedPrincipal)
+ .setPrincipal(acc.principal).setApprovedPrincipal(acc.approvedPrincipal).setNetDisbursalAmount(acc.netDisbursalAmount)
+ .setTotalOverpaid(acc.totalOverpaid).setInArrearsTolerance(acc.inArrearsTolerance).setTermFrequency(acc.termFrequency)
+ .setTermPeriodFrequencyType(acc.termPeriodFrequencyType).setNumberOfRepayments(acc.numberOfRepayments)
+ .setRepaymentEvery(acc.repaymentEvery).setRepaymentFrequencyType(acc.repaymentFrequencyType)
+ .setRepaymentFrequencyNthDayType(acc.repaymentFrequencyNthDayType)
+ .setRepaymentFrequencyDayOfWeekType(acc.repaymentFrequencyDayOfWeekType)
+ .setTransactionProcessingStrategyCode(acc.transactionProcessingStrategyCode)
+ .setTransactionProcessingStrategyName(acc.transactionProcessingStrategyName).setAmortizationType(acc.amortizationType)
+ .setInterestRatePerPeriod(acc.interestRatePerPeriod).setInterestRateFrequencyType(acc.interestRateFrequencyType)
+ .setAnnualInterestRate(acc.annualInterestRate).setInterestType(acc.interestType)
+ .setFloatingInterestRate(acc.isFloatingInterestRate).setInterestRateDifferential(acc.interestRateDifferential)
+ .setInterestCalculationPeriodType(acc.interestCalculationPeriodType)
+ .setAllowPartialPeriodInterestCalculation(acc.allowPartialPeriodInterestCalculation)
+ .setExpectedFirstRepaymentOnDate(acc.expectedFirstRepaymentOnDate).setGraceOnPrincipalPayment(acc.graceOnPrincipalPayment)
+ .setRecurringMoratoriumOnPrincipalPeriods(acc.recurringMoratoriumOnPrincipalPeriods)
+ .setGraceOnInterestPayment(acc.graceOnInterestPayment).setGraceOnInterestCharged(acc.graceOnInterestCharged)
+ .setInterestChargedFromDate(acc.interestChargedFromDate).setTimeline(clientAcc.timeline).setSummary(acc.summary)
+ .setFeeChargesAtDisbursementCharged(acc.feeChargesAtDisbursementCharged).setRepaymentSchedule(acc.repaymentSchedule)
+ .setTransactions(acc.transactions).setCharges(acc.charges).setCollateral(acc.collateral).setGuarantors(acc.guarantors)
+ .setMeeting(acc.meeting).setProductOptions(acc.productOptions).setTermFrequencyTypeOptions(acc.termFrequencyTypeOptions)
+ .setRepaymentFrequencyTypeOptions(acc.repaymentFrequencyTypeOptions)
+ .setRepaymentFrequencyNthDayTypeOptions(acc.repaymentFrequencyNthDayTypeOptions)
+ .setRepaymentFrequencyDaysOfWeekTypeOptions(acc.repaymentFrequencyDaysOfWeekTypeOptions)
+ .setTransactionProcessingStrategyOptions(acc.transactionProcessingStrategyOptions)
+ .setInterestRateFrequencyTypeOptions(acc.interestRateFrequencyTypeOptions)
+ .setAmortizationTypeOptions(acc.amortizationTypeOptions).setInterestTypeOptions(acc.interestTypeOptions)
+ .setInterestCalculationPeriodTypeOptions(acc.interestCalculationPeriodTypeOptions).setFundOptions(acc.fundOptions)
+ .setChargeOptions(acc.chargeOptions).setLoanOfficerOptions(acc.loanOfficerOptions)
+ .setLoanPurposeOptions(acc.loanPurposeOptions).setLoanCollateralOptions(acc.loanCollateralOptions)
+ .setCalendarOptions(acc.calendarOptions).setSyncDisbursementWithMeeting(acc.syncDisbursementWithMeeting)
+ .setLoanCounter(acc.loanCounter).setLoanProductCounter(acc.loanProductCounter).setNotes(acc.notes)
+ .setAccountLinkingOptions(acc.accountLinkingOptions).setLinkedAccount(acc.linkedAccount)
+ .setDisbursementDetails(acc.disbursementDetails).setMultiDisburseLoan(acc.multiDisburseLoan)
+ .setCanDefineInstallmentAmount(acc.canDefineInstallmentAmount).setFixedEmiAmount(acc.fixedEmiAmount)
+ .setMaxOutstandingLoanBalance(acc.maxOutstandingLoanBalance).setEmiAmountVariations(acc.emiAmountVariations)
+ .setMemberVariations(acc.memberVariations).setProduct(acc.product).setInArrears(acc.inArrears)
+ .setGraceOnArrearsAgeing(acc.graceOnArrearsAgeing).setOverdueCharges(acc.overdueCharges).setIsNPA(acc.isNPA)
+ .setDaysInMonthType(acc.daysInMonthType).setDaysInYearType(acc.daysInYearType)
+ .setInterestRecalculationEnabled(acc.isInterestRecalculationEnabled)
+ .setInterestRecalculationData(acc.interestRecalculationData).setOriginalSchedule(acc.originalSchedule)
+ .setCreateStandingInstructionAtDisbursement(acc.createStandingInstructionAtDisbursement).setPaidInAdvance(acc.paidInAdvance)
+ .setInterestRatesPeriods(acc.interestRatesPeriods).setIsVariableInstallmentsAllowed(acc.isVariableInstallmentsAllowed)
+ .setMinimumGap(acc.minimumGap).setMaximumGap(acc.maximumGap).setSubStatus(acc.subStatus)
+ .setCanUseForTopup(acc.canUseForTopup).setClientActiveLoanOptions(acc.clientActiveLoanOptions).setTopup(acc.isTopup)
+ .setClosureLoanId(acc.closureLoanId).setClosureLoanAccountNo(acc.closureLoanAccountNo).setTopupAmount(acc.topupAmount)
+ .setIsEqualAmortization(acc.isEqualAmortization).setRates(acc.rates).setIsRatesEnabled(acc.isRatesEnabled)
+ .setFixedPrincipalPercentagePerInstallment(acc.fixedPrincipalPercentagePerInstallment).setDelinquent(acc.delinquent)
+ .setDelinquencyRange(acc.delinquencyRange).setDisallowExpectedDisbursements(acc.disallowExpectedDisbursements)
+ .setFraud(acc.fraud);
}
/**
@@ -785,184 +384,70 @@ public final class LoanAccountData {
*/
public static LoanAccountData groupDefaults(final GroupGeneralData group, final LocalDate expectedDisbursementDate) {
- final Long id = null;
- final String accountNo = null;
- final LoanStatusEnumData status = null;
- final EnumOptionData subStatus = null;
- final String externalId = null;
- final Long clientId = null;
- final String clientAccountNo = null;
- final String clientName = null;
- final Long clientOfficeId = null;
- final String clientExternalId = null;
- final EnumOptionData loanType = null;
- final Long loanProductId = null;
- final String loanProductName = null;
- final String loanProductDescription = null;
- final boolean isLoanProductLinkedToFloatingRate = false;
- final Long fundId = null;
- final String fundName = null;
- final Long loanPurposeId = null;
- final String loanPurposeName = null;
- final Long loanOfficerId = null;
- final String loanOfficerName = null;
- final CurrencyData currencyData = null;
- final BigDecimal proposedPrincipal = null;
- final BigDecimal principal = null;
- final BigDecimal netDisbursalAmount = null;
- final BigDecimal totalOverpaid = null;
- final BigDecimal inArrearsTolerance = null;
- final Integer termFrequency = null;
- final EnumOptionData termPeriodFrequencyType = null;
- final Integer numberOfRepayments = null;
- final Integer repaymentEvery = null;
- final EnumOptionData repaymentFrequencyType = null;
- final EnumOptionData repaymentFrequencyNthDayType = null;
- final EnumOptionData repaymentFrequencyDayOfWeekType = null;
- final Long transactionProcessingStrategyId = null;
- final String transactionProcessingStrategyName = null;
- final EnumOptionData amortizationType = null;
- final BigDecimal interestRatePerPeriod = null;
- final EnumOptionData interestRateFrequencyType = null;
- final BigDecimal annualInterestRate = null;
- final EnumOptionData interestType = null;
- final boolean isFloatingInterestRate = false;
- final BigDecimal interestRateDifferential = null;
- final EnumOptionData interestCalculationPeriodType = null;
- final Boolean allowPartialPeriodInterestCalcualtion = null;
- final LocalDate expectedFirstRepaymentOnDate = null;
- final Integer graceOnPrincipalPayment = null;
- final Integer recurringMoratoriumOnPrincipalPeriods = null;
- final Integer graceOnInterestPayment = null;
- final Integer graceOnInterestCharged = null;
- final Integer graceOnArrearsAgeing = null;
- final LocalDate interestChargedFromDate = null;
- final LoanApplicationTimelineData timeline = LoanApplicationTimelineData.templateDefault(expectedDisbursementDate);
- final LoanSummaryData summary = null;
- final BigDecimal feeChargesDueAtDisbursementCharged = null;
-
- final LoanScheduleData repaymentSchedule = null;
- final Collection transactions = null;
- final Collection charges = null;
- final Collection collateral = null;
- final Collection guarantors = null;
- final Collection notes = null;
- final CalendarData calendarData = null;
- final Collection productOptions = null;
- final Collection termFrequencyTypeOptions = null;
- final Collection repaymentFrequencyTypeOptions = null;
- final Collection repaymentFrequencyNthDayTypeOptions = null;
- final Collection repaymentFrequencyDayOfWeekTypeOptions = null;
- final Collection repaymentStrategyOptions = null;
- final Collection interestRateFrequencyTypeOptions = null;
- final Collection amortizationTypeOptions = null;
- final Collection interestTypeOptions = null;
- final Collection interestCalculationPeriodTypeOptions = null;
- final Collection fundOptions = null;
- final Collection chargeOptions = null;
- final ChargeData chargeTemplate = null;
- final Collection loanOfficerOptions = null;
- final Collection loanPurposeOptions = null;
- final Collection loanCollateralOptions = null;
- final Collection calendarOptions = null;
- final Boolean syncDisbursementWithMeeting = null;
- final Integer loancounter = null;
- final Integer loanProductCounter = null;
- final Collection accountLinkingOptions = null;
- final PortfolioAccountData linkedAccount = null;
- final Collection disbursementData = null;
- final Boolean multiDisburseLoan = null;
- final Boolean canDefineInstallmentAmount = null;
- final BigDecimal fixedEmiAmount = null;
- final BigDecimal maxOutstandingBalance = null;
- final Collection emiAmountVariations = null;
- final Map memberVariations = null;
- final LoanProductData product = null;
- final Boolean inArrears = null;
- final Boolean isNPA = null;
- final Collection overdueCharges = null;
-
- final EnumOptionData daysInMonthType = null;
- final EnumOptionData daysInYearType = null;
- final boolean isInterestRecalculationEnabled = false;
- final LoanInterestRecalculationData interestRecalculationData = null;
- final LoanScheduleData originalSchedule = null;
- final Boolean createStandingInstructionAtDisbursement = null;
- final PaidInAdvanceData paidInAdvance = null;
- final Collection interestRatesPeriods = null;
-
- final Boolean isVariableInstallmentsAllowed = Boolean.FALSE;
- final Integer minimumGap = null;
- final Integer maximumGap = null;
- final Boolean canUseForTopup = null;
- final Collection clientActiveLoanOptions = null;
- final boolean isTopup = false;
- final Long closureLoanId = null;
- final String closureLoanAccountNo = null;
- final BigDecimal topupAmount = null;
- final boolean isEqualAmortization = false;
- final List rates = null;
- final Boolean isRatesEnabled = false;
- final BigDecimal fixedPrincipalPercentagePerInstallment = null;
- final CollectionData delinquent = CollectionData.template();
- final DelinquencyRangeData delinquencyRange = null;
- final Boolean disallowExpectedDisbursements = false;
- final Boolean fraud = false;
-
- return new LoanAccountData(id, accountNo, status, externalId, clientId, clientAccountNo, clientName, clientOfficeId,
- clientExternalId, group, loanType, loanProductId, loanProductName, loanProductDescription,
- isLoanProductLinkedToFloatingRate, fundId, fundName, loanPurposeId, loanPurposeName, loanOfficerId, loanOfficerName,
- currencyData, proposedPrincipal, principal, principal, netDisbursalAmount, totalOverpaid, inArrearsTolerance, termFrequency,
- termPeriodFrequencyType, numberOfRepayments, repaymentEvery, repaymentFrequencyType, repaymentFrequencyNthDayType,
- repaymentFrequencyDayOfWeekType, transactionProcessingStrategyId, transactionProcessingStrategyName, amortizationType,
- interestRatePerPeriod, interestRateFrequencyType, annualInterestRate, interestType, isFloatingInterestRate,
- interestRateDifferential, interestCalculationPeriodType, allowPartialPeriodInterestCalcualtion,
- expectedFirstRepaymentOnDate, graceOnPrincipalPayment, recurringMoratoriumOnPrincipalPeriods, graceOnInterestPayment,
- graceOnInterestCharged, interestChargedFromDate, timeline, summary, feeChargesDueAtDisbursementCharged, repaymentSchedule,
- transactions, charges, collateral, guarantors, calendarData, productOptions, termFrequencyTypeOptions,
- repaymentFrequencyTypeOptions, repaymentFrequencyNthDayTypeOptions, repaymentFrequencyDayOfWeekTypeOptions,
- repaymentStrategyOptions, interestRateFrequencyTypeOptions, amortizationTypeOptions, interestTypeOptions,
- interestCalculationPeriodTypeOptions, fundOptions, chargeOptions, chargeTemplate, loanOfficerOptions, loanPurposeOptions,
- loanCollateralOptions, calendarOptions, syncDisbursementWithMeeting, loancounter, loanProductCounter, notes,
- accountLinkingOptions, linkedAccount, disbursementData, multiDisburseLoan, canDefineInstallmentAmount, fixedEmiAmount,
- 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, rates, isRatesEnabled, fixedPrincipalPercentagePerInstallment, delinquent, delinquencyRange,
- disallowExpectedDisbursements, fraud);
+ return new LoanAccountData().setTimeline(LoanApplicationTimelineData.templateDefault(expectedDisbursementDate))
+ .setIsVariableInstallmentsAllowed(false).setDelinquent(CollectionData.template()).setGroup(group)
+ .setExpectedDisbursementDate(expectedDisbursementDate);
}
public static LoanAccountData populateGroupDefaults(final LoanAccountData acc, final LoanAccountData groupAcc) {
- return new LoanAccountData(acc.id, acc.accountNo, acc.status, acc.externalId, acc.clientId, acc.clientAccountNo, acc.clientName,
- acc.clientOfficeId, acc.clientExternalId, groupAcc.group, acc.loanType, acc.loanProductId, acc.loanProductName,
- acc.loanProductDescription, acc.isLoanProductLinkedToFloatingRate, acc.fundId, acc.fundName, acc.loanPurposeId,
- acc.loanPurposeName, acc.loanOfficerId, acc.loanOfficerName, acc.currency, acc.proposedPrincipal, acc.principal,
- acc.approvedPrincipal, acc.netDisbursalAmount, acc.totalOverpaid, acc.inArrearsTolerance, acc.termFrequency,
- acc.termPeriodFrequencyType, acc.numberOfRepayments, acc.repaymentEvery, acc.repaymentFrequencyType,
- acc.repaymentFrequencyNthDayType, acc.repaymentFrequencyDayOfWeekType, acc.transactionProcessingStrategyId,
- acc.transactionProcessingStrategyName, acc.amortizationType, acc.interestRatePerPeriod, acc.interestRateFrequencyType,
- acc.annualInterestRate, acc.interestType, acc.isFloatingInterestRate, acc.interestRateDifferential,
- acc.interestCalculationPeriodType, acc.allowPartialPeriodInterestCalculation, acc.expectedFirstRepaymentOnDate,
- acc.graceOnPrincipalPayment, acc.recurringMoratoriumOnPrincipalPeriods, acc.graceOnInterestPayment,
- acc.graceOnInterestCharged, acc.interestChargedFromDate, groupAcc.timeline, acc.summary,
- acc.feeChargesAtDisbursementCharged, acc.repaymentSchedule, acc.transactions, acc.charges, acc.collateral, acc.guarantors,
- acc.meeting, acc.productOptions, acc.termFrequencyTypeOptions, acc.repaymentFrequencyTypeOptions,
- acc.repaymentFrequencyNthDayTypeOptions, acc.repaymentFrequencyDaysOfWeekTypeOptions,
- acc.transactionProcessingStrategyOptions, acc.interestRateFrequencyTypeOptions, acc.amortizationTypeOptions,
- acc.interestTypeOptions, acc.interestCalculationPeriodTypeOptions, acc.fundOptions, acc.chargeOptions, null,
- acc.loanOfficerOptions, acc.loanPurposeOptions, acc.loanCollateralOptions, acc.calendarOptions,
- acc.syncDisbursementWithMeeting, acc.loanCounter, acc.loanProductCounter, acc.notes, acc.accountLinkingOptions,
- acc.linkedAccount, acc.disbursementDetails, acc.multiDisburseLoan, acc.canDefineInstallmentAmount, acc.fixedEmiAmount,
- acc.maxOutstandingLoanBalance, acc.emiAmountVariations, acc.memberVariations, acc.product, acc.inArrears,
- acc.graceOnArrearsAgeing, acc.overdueCharges, 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.rates, acc.isRatesEnabled,
- acc.fixedPrincipalPercentagePerInstallment, acc.delinquent, acc.delinquencyRange, acc.disallowExpectedDisbursements,
- acc.fraud);
+ return new LoanAccountData().setId(acc.id).setAccountNo(acc.accountNo).setStatus(acc.status).setExternalId(acc.externalId)
+ .setClientId(acc.clientId).setClientAccountNo(acc.clientAccountNo).setClientName(acc.clientName)
+ .setClientOfficeId(acc.clientOfficeId).setClientExternalId(acc.clientExternalId).setGroup(groupAcc.group)
+ .setLoanType(acc.loanType).setLoanProductId(acc.loanProductId).setLoanProductName(acc.loanProductName)
+ .setLoanProductDescription(acc.loanProductDescription)
+ .setLoanProductLinkedToFloatingRate(acc.isLoanProductLinkedToFloatingRate).setFundId(acc.fundId).setFundName(acc.fundName)
+ .setLoanPurposeId(acc.loanPurposeId).setLoanPurposeName(acc.loanPurposeName).setLoanOfficerId(acc.loanOfficerId)
+ .setLoanOfficerName(acc.loanOfficerName).setCurrency(acc.currency).setProposedPrincipal(acc.proposedPrincipal)
+ .setPrincipal(acc.principal).setApprovedPrincipal(acc.approvedPrincipal).setNetDisbursalAmount(acc.netDisbursalAmount)
+ .setTotalOverpaid(acc.totalOverpaid).setInArrearsTolerance(acc.inArrearsTolerance).setTermFrequency(acc.termFrequency)
+ .setTermPeriodFrequencyType(acc.termPeriodFrequencyType).setNumberOfRepayments(acc.numberOfRepayments)
+ .setRepaymentEvery(acc.repaymentEvery).setRepaymentFrequencyType(acc.repaymentFrequencyType)
+ .setRepaymentFrequencyNthDayType(acc.repaymentFrequencyNthDayType)
+ .setRepaymentFrequencyDayOfWeekType(acc.repaymentFrequencyDayOfWeekType)
+ .setTransactionProcessingStrategyCode(acc.transactionProcessingStrategyCode)
+ .setTransactionProcessingStrategyName(acc.transactionProcessingStrategyName).setAmortizationType(acc.amortizationType)
+ .setInterestRatePerPeriod(acc.interestRatePerPeriod).setInterestRateFrequencyType(acc.interestRateFrequencyType)
+ .setAnnualInterestRate(acc.annualInterestRate).setInterestType(acc.interestType)
+ .setFloatingInterestRate(acc.isFloatingInterestRate).setInterestRateDifferential(acc.interestRateDifferential)
+ .setInterestCalculationPeriodType(acc.interestCalculationPeriodType)
+ .setAllowPartialPeriodInterestCalculation(acc.allowPartialPeriodInterestCalculation)
+ .setExpectedFirstRepaymentOnDate(acc.expectedFirstRepaymentOnDate).setGraceOnPrincipalPayment(acc.graceOnPrincipalPayment)
+ .setRecurringMoratoriumOnPrincipalPeriods(acc.recurringMoratoriumOnPrincipalPeriods)
+ .setGraceOnInterestPayment(acc.graceOnInterestPayment).setGraceOnInterestCharged(acc.graceOnInterestCharged)
+ .setInterestChargedFromDate(acc.interestChargedFromDate).setTimeline(groupAcc.timeline).setSummary(acc.summary)
+ .setFeeChargesAtDisbursementCharged(acc.feeChargesAtDisbursementCharged).setRepaymentSchedule(acc.repaymentSchedule)
+ .setTransactions(acc.transactions).setCharges(acc.charges).setCollateral(acc.collateral).setGuarantors(acc.guarantors)
+ .setMeeting(acc.meeting).setProductOptions(acc.productOptions).setTermFrequencyTypeOptions(acc.termFrequencyTypeOptions)
+ .setRepaymentFrequencyTypeOptions(acc.repaymentFrequencyTypeOptions)
+ .setRepaymentFrequencyNthDayTypeOptions(acc.repaymentFrequencyNthDayTypeOptions)
+ .setRepaymentFrequencyDaysOfWeekTypeOptions(acc.repaymentFrequencyDaysOfWeekTypeOptions)
+ .setTransactionProcessingStrategyOptions(acc.transactionProcessingStrategyOptions)
+ .setInterestRateFrequencyTypeOptions(acc.interestRateFrequencyTypeOptions)
+ .setAmortizationTypeOptions(acc.amortizationTypeOptions).setInterestTypeOptions(acc.interestTypeOptions)
+ .setInterestCalculationPeriodTypeOptions(acc.interestCalculationPeriodTypeOptions).setFundOptions(acc.fundOptions)
+ .setChargeOptions(acc.chargeOptions).setLoanOfficerOptions(acc.loanOfficerOptions)
+ .setLoanPurposeOptions(acc.loanPurposeOptions).setLoanCollateralOptions(acc.loanCollateralOptions)
+ .setCalendarOptions(acc.calendarOptions).setSyncDisbursementWithMeeting(acc.syncDisbursementWithMeeting)
+ .setLoanCounter(acc.loanCounter).setLoanProductCounter(acc.loanProductCounter).setNotes(acc.notes)
+ .setAccountLinkingOptions(acc.accountLinkingOptions).setLinkedAccount(acc.linkedAccount)
+ .setDisbursementDetails(acc.disbursementDetails).setMultiDisburseLoan(acc.multiDisburseLoan)
+ .setCanDefineInstallmentAmount(acc.canDefineInstallmentAmount).setFixedEmiAmount(acc.fixedEmiAmount)
+ .setMaxOutstandingLoanBalance(acc.maxOutstandingLoanBalance).setEmiAmountVariations(acc.emiAmountVariations)
+ .setMemberVariations(acc.memberVariations).setProduct(acc.product).setInArrears(acc.inArrears)
+ .setGraceOnArrearsAgeing(acc.graceOnArrearsAgeing).setOverdueCharges(acc.overdueCharges).setIsNPA(acc.isNPA)
+ .setDaysInMonthType(acc.daysInMonthType).setDaysInYearType(acc.daysInYearType)
+ .setInterestRecalculationEnabled(acc.isInterestRecalculationEnabled)
+ .setInterestRecalculationData(acc.interestRecalculationData).setOriginalSchedule(acc.originalSchedule)
+ .setCreateStandingInstructionAtDisbursement(acc.createStandingInstructionAtDisbursement).setPaidInAdvance(acc.paidInAdvance)
+ .setInterestRatesPeriods(acc.interestRatesPeriods).setIsVariableInstallmentsAllowed(acc.isVariableInstallmentsAllowed)
+ .setMinimumGap(acc.minimumGap).setMaximumGap(acc.maximumGap).setSubStatus(acc.subStatus)
+ .setCanUseForTopup(acc.canUseForTopup).setClientActiveLoanOptions(acc.clientActiveLoanOptions).setTopup(acc.isTopup)
+ .setClosureLoanId(acc.closureLoanId).setClosureLoanAccountNo(acc.closureLoanAccountNo).setTopupAmount(acc.topupAmount)
+ .setIsEqualAmortization(acc.isEqualAmortization).setRates(acc.rates).setIsRatesEnabled(acc.isRatesEnabled)
+ .setFixedPrincipalPercentagePerInstallment(acc.fixedPrincipalPercentagePerInstallment).setDelinquent(acc.delinquent)
+ .setDelinquencyRange(acc.delinquencyRange).setDisallowExpectedDisbursements(acc.disallowExpectedDisbursements)
+ .setFraud(acc.fraud);
}
public static LoanAccountData loanProductWithTemplateDefaults(final LoanProductData product,
@@ -976,45 +461,6 @@ public final class LoanAccountData {
final Collection loanPurposeOptions, final Collection loanCollateralOptions,
final Integer loanCycleNumber, final Collection clientActiveLoanOptions) {
- final Long id = null;
- final String accountNo = null;
- final LoanStatusEnumData status = null;
- final EnumOptionData subStatus = null;
- final String externalId = null;
- final Long clientId = null;
- final String clientAccountNo = null;
- final String clientName = null;
- final Long clientOfficeId = null;
- final String clientExternalId = null;
- final GroupGeneralData group = null;
- final EnumOptionData loanType = null;
- final Long loanPurposeId = null;
- final String loanPurposeName = null;
- final Long loanOfficerId = null;
- final String loanOfficerName = null;
-
- final BigDecimal totalOverpaid = null;
-
- final String transactionProcessingStrategyName = null;
-
- final LocalDate expectedFirstRepaymentOnDate = null;
- final LocalDate interestChargedFromDate = null;
- final LoanApplicationTimelineData timeline = null;
- final LoanSummaryData summary = null;
- final BigDecimal feeChargesDueAtDisbursementCharged = null;
- final ChargeData chargeTemplate = null;
- final Boolean syncDisbursementWithMeeting = null;
-
- final LoanScheduleData repaymentSchedule = null;
- final Collection transactions = null;
- final Collection collateral = null;
- final Collection guarantors = null;
- final Collection notes = null;
- final CalendarData calendarData = null;
- final Collection productOptions = null;
- final Collection calendarOptions = null;
- final Collection loanOfficerOptions = null;
-
final EnumOptionData termPeriodFrequencyType = product.getRepaymentFrequencyType();
final Collection charges = new ArrayList();
@@ -1024,17 +470,10 @@ public final class LoanAccountData {
}
}
- final Integer loancounter = null;
- final Integer loanProductCounter = null;
- final PortfolioAccountData linkedAccount = null;
- final Collection accountLinkingOptions = null;
- final Collection disbursementData = null;
- final Collection emiAmountVariations = null;
BigDecimal principal = null;
BigDecimal proposedPrincipal = null;
- BigDecimal netDisbursalAmount = null;
-
BigDecimal interestRatePerPeriod = null;
+
Integer numberOfRepayments = null;
if (product.isUseBorrowerCycle() && loanCycleNumber > 0) {
Collection principalVariationsForBorrowerCycle = product
@@ -1051,14 +490,16 @@ public final class LoanAccountData {
numberOfRepayments = numberofRepaymentval.intValue();
}
}
+
if (principal == null) {
principal = product.getPrincipal();
proposedPrincipal = principal;
}
// Add net get net disbursal amount from charges and principal
- netDisbursalAmount = principal;
- if (charges != null && !charges.isEmpty()) {
+ BigDecimal netDisbursalAmount = principal;
+
+ if (!charges.isEmpty()) {
for (LoanChargeData charge : charges) {
netDisbursalAmount = netDisbursalAmount.subtract(charge.getAmount());
}
@@ -1071,80 +512,48 @@ public final class LoanAccountData {
numberOfRepayments = product.getNumberOfRepayments();
}
- final Integer termFrequency = numberOfRepayments * product.getRepaymentEvery();
- final BigDecimal fixedEmi = null;
- Map memberVariations = null;
- final Boolean inArrears = null;
- final Boolean isNPA = null;
- final LoanScheduleData originalSchedule = null;
- final Boolean createStandingInstructionAtDisbursement = null;
- final PaidInAdvanceData paidInAdvance = null;
- final Collection interestRatesPeriods = null;
-
- final Boolean canUseForTopup = product.isCanUseForTopup();
- final boolean isTopup = false;
- final Long closureLoanId = null;
- final String closureLoanAccountNo = null;
- final BigDecimal topupAmount = null;
- final List rates = null;
- final Boolean isRatesEnabled = false;
- final CollectionData delinquent = CollectionData.template();
- final DelinquencyRangeData delinquencyRange = null;
- final boolean fraud = false;
-
- return new LoanAccountData(id, accountNo, status, externalId, clientId, clientAccountNo, clientName, clientOfficeId,
- clientExternalId, group, loanType, product.getId(), product.getName(), product.getDescription(),
- product.isLinkedToFloatingInterestRates(), product.getFundId(), product.getFundName(), loanPurposeId, loanPurposeName,
- loanOfficerId, loanOfficerName, product.getCurrency(), proposedPrincipal, principal, principal, netDisbursalAmount,
- totalOverpaid, product.getInArrearsTolerance(), termFrequency, termPeriodFrequencyType, numberOfRepayments,
- product.getRepaymentEvery(), product.getRepaymentFrequencyType(), null, null, product.getTransactionProcessingStrategyId(),
- transactionProcessingStrategyName, product.getAmortizationType(), interestRatePerPeriod,
- product.getInterestRateFrequencyType(), product.getAnnualInterestRate(), product.getInterestType(),
- product.isFloatingInterestRateCalculationAllowed(), product.getDefaultDifferentialLendingRate(),
- product.getInterestCalculationPeriodType(), product.isAllowPartialPeriodInterestCalculation(), expectedFirstRepaymentOnDate,
- product.getGraceOnPrincipalPayment(), product.getRecurringMoratoriumOnPrincipalPeriods(),
- product.getGraceOnInterestPayment(), product.getGraceOnInterestCharged(), interestChargedFromDate, timeline, summary,
- feeChargesDueAtDisbursementCharged, repaymentSchedule, transactions, charges, collateral, guarantors, calendarData,
- productOptions, termFrequencyTypeOptions, repaymentFrequencyTypeOptions, repaymentFrequencyNthDayTypeOptions,
- repaymentFrequencyDayOfWeekTypeOptions, repaymentStrategyOptions, interestRateFrequencyTypeOptions, amortizationTypeOptions,
- interestTypeOptions, interestCalculationPeriodTypeOptions, fundOptions, chargeOptions, chargeTemplate, loanOfficerOptions,
- loanPurposeOptions, loanCollateralOptions, calendarOptions, syncDisbursementWithMeeting, loancounter, loanProductCounter,
- notes, accountLinkingOptions, linkedAccount, disbursementData, product.getMultiDisburseLoan(),
- product.isCanDefineInstallmentAmount(), fixedEmi, product.getOutstandingLoanBalance(), emiAmountVariations,
- memberVariations, product, inArrears, product.getGraceOnArrearsAgeing(), product.overdueFeeCharges(), isNPA,
- product.getDaysInMonthType(), product.getDaysInYearType(), product.isInterestRecalculationEnabled(),
- product.toLoanInterestRecalculationData(), originalSchedule, createStandingInstructionAtDisbursement, paidInAdvance,
- interestRatesPeriods, product.isAllowVariableInstallments(), product.getMinimumGap(), product.getMaximumGap(), subStatus,
- canUseForTopup, clientActiveLoanOptions, isTopup, closureLoanId, closureLoanAccountNo, topupAmount,
- product.isEqualAmortization(), rates, isRatesEnabled, product.getFixedPrincipalPercentagePerInstallment(), delinquent,
- delinquencyRange, product.getDisallowExpectedDisbursements(), fraud);
+ return new LoanAccountData().setProductId(product.getId()).setLoanProductName(product.getName())
+ .setLoanProductDescription(product.getDescription())
+ .setLoanProductLinkedToFloatingRate(product.isLinkedToFloatingInterestRates()).setFundId(product.getFundId())
+ .setFundName(product.getFundName()).setCurrency(product.getCurrency()).setProposedPrincipal(proposedPrincipal)
+ .setPrincipal(principal).setApprovedPrincipal(principal).setNetDisbursalAmount(netDisbursalAmount)
+ .setInArrearsTolerance(product.getInArrearsTolerance()).setTermFrequency(numberOfRepayments * product.getRepaymentEvery())
+ .setTermPeriodFrequencyType(termPeriodFrequencyType).setNumberOfRepayments(numberOfRepayments)
+ .setRepaymentEvery(product.getRepaymentEvery()).setRepaymentFrequencyType(product.getRepaymentFrequencyType())
+ .setTransactionProcessingStrategyCode(product.getTransactionProcessingStrategyCode())
+ .setAmortizationType(product.getAmortizationType()).setInterestRatePerPeriod(interestRatePerPeriod)
+ .setInterestRateFrequencyType(product.getInterestRateFrequencyType()).setAnnualInterestRate(product.getAnnualInterestRate())
+ .setInterestType(product.getInterestType()).setFloatingInterestRate(product.isFloatingInterestRateCalculationAllowed())
+ .setInterestRateDifferential(product.getDefaultDifferentialLendingRate())
+ .setInterestCalculationPeriodType(product.getInterestCalculationPeriodType())
+ .setAllowPartialPeriodInterestCalculation(product.isAllowPartialPeriodInterestCalculation())
+ .setGraceOnPrincipalPayment(product.getGraceOnPrincipalPayment())
+ .setRecurringMoratoriumOnPrincipalPeriods(product.getRecurringMoratoriumOnPrincipalPeriods())
+ .setGraceOnInterestPayment(product.getGraceOnInterestPayment())
+ .setGraceOnInterestCharged(product.getGraceOnInterestCharged()).setCharges(charges)
+ .setTermFrequencyTypeOptions(termFrequencyTypeOptions).setRepaymentFrequencyTypeOptions(repaymentFrequencyTypeOptions)
+ .setRepaymentFrequencyDaysOfWeekTypeOptions(repaymentFrequencyDayOfWeekTypeOptions)
+ .setRepaymentFrequencyNthDayTypeOptions(repaymentFrequencyNthDayTypeOptions)
+ .setTransactionProcessingStrategyOptions(repaymentStrategyOptions)
+ .setInterestRateFrequencyTypeOptions(interestRateFrequencyTypeOptions).setAmortizationTypeOptions(amortizationTypeOptions)
+ .setInterestTypeOptions(interestTypeOptions).setInterestCalculationPeriodTypeOptions(interestCalculationPeriodTypeOptions)
+ .setFundOptions(fundOptions).setChargeOptions(chargeOptions).setLoanPurposeOptions(loanPurposeOptions)
+ .setLoanCollateralOptions(loanCollateralOptions).setMultiDisburseLoan(product.getMultiDisburseLoan())
+ .setCanDefineInstallmentAmount(product.isCanDefineInstallmentAmount())
+ .setMaxOutstandingLoanBalance(product.getOutstandingLoanBalance()).setProduct(product)
+ .setGraceOnArrearsAgeing(product.getGraceOnArrearsAgeing()).setOverdueCharges(product.overdueFeeCharges())
+ .setDaysInMonthType(product.getDaysInMonthType()).setDaysInYearType(product.getDaysInYearType())
+ .setInterestRecalculationEnabled(product.isInterestRecalculationEnabled())
+ .setInterestRecalculationData(product.toLoanInterestRecalculationData())
+ .setIsVariableInstallmentsAllowed(product.isAllowVariableInstallments()).setMinimumGap(product.getMinimumGap())
+ .setMaximumGap(product.getMaximumGap()).setTopup(product.isCanUseForTopup())
+ .setClientActiveLoanOptions(clientActiveLoanOptions).setIsEqualAmortization(product.isEqualAmortization())
+ .setFixedPrincipalPercentagePerInstallment(product.getFixedPrincipalPercentagePerInstallment())
+ .setDelinquent(CollectionData.template()).setDisallowExpectedDisbursements(product.getDisallowExpectedDisbursements());
}
public static LoanAccountData populateLoanProductDefaults(final LoanAccountData acc, final LoanProductData product) {
- final LoanScheduleData repaymentSchedule = null;
- final Collection transactions = null;
- final Collection collateral = null;
- final Collection guarantors = null;
- final Collection notes = null;
- final CalendarData calendarData = null;
- final Collection productOptions = null;
- final Collection termFrequencyTypeOptions = null;
- final Collection repaymentFrequencyTypeOptions = null;
- final Collection repaymentStrategyOptions = null;
- final Collection interestRateFrequencyTypeOptions = null;
- final Collection amortizationTypeOptions = null;
- final Collection interestTypeOptions = null;
- final Collection interestCalculationPeriodTypeOptions = null;
- final Collection fundOptions = null;
- final Collection chargeOptions = null;
- final ChargeData chargeTemplate = null;
- final Collection loanOfficerOptions = null;
- final Collection loanPurposeOptions = null;
- final Collection loanCollateralOptions = null;
- final Collection calendarOptions = null;
- final PaidInAdvanceData paidInAdvance = null;
-
final Integer termFrequency = product.getNumberOfRepayments() * product.getRepaymentEvery();
final EnumOptionData termPeriodFrequencyType = product.getRepaymentFrequencyType();
@@ -1154,41 +563,58 @@ public final class LoanAccountData {
}
BigDecimal netDisbursalAmount = product.getPrincipal();
- if (charges != null && !charges.isEmpty()) {
+ if (!charges.isEmpty()) {
for (LoanChargeData charge : charges) {
netDisbursalAmount = netDisbursalAmount.subtract(charge.getAmount());
}
}
final CollectionData delinquent = CollectionData.template();
- final DelinquencyRangeData delinquencyRange = null;
- return new LoanAccountData(acc.id, acc.accountNo, acc.status, acc.externalId, acc.clientId, acc.clientAccountNo, acc.clientName,
- acc.clientOfficeId, acc.clientExternalId, acc.group, acc.loanType, product.getId(), product.getName(),
- product.getDescription(), product.isLinkedToFloatingInterestRates(), product.getFundId(), product.getFundName(),
- acc.loanPurposeId, acc.loanPurposeName, acc.loanOfficerId, acc.loanOfficerName, product.getCurrency(),
- product.getPrincipal(), product.getPrincipal(), product.getPrincipal(), netDisbursalAmount, acc.totalOverpaid,
- product.getInArrearsTolerance(), termFrequency, termPeriodFrequencyType, product.getNumberOfRepayments(),
- product.getRepaymentEvery(), product.getRepaymentFrequencyType(), null, null, product.getTransactionProcessingStrategyId(),
- product.getTransactionProcessingStrategyName(), product.getAmortizationType(), product.getInterestRatePerPeriod(),
- product.getInterestRateFrequencyType(), product.getAnnualInterestRate(), product.getInterestType(),
- product.isFloatingInterestRateCalculationAllowed(), product.getDefaultDifferentialLendingRate(),
- product.getInterestCalculationPeriodType(), product.isAllowPartialPeriodInterestCalculation(),
- acc.expectedFirstRepaymentOnDate, product.getGraceOnPrincipalPayment(), product.getRecurringMoratoriumOnPrincipalPeriods(),
- product.getGraceOnInterestPayment(), product.getGraceOnInterestCharged(), acc.interestChargedFromDate, acc.timeline,
- acc.summary, acc.feeChargesAtDisbursementCharged, repaymentSchedule, transactions, charges, collateral, guarantors,
- calendarData, productOptions, termFrequencyTypeOptions, repaymentFrequencyTypeOptions, null, null, repaymentStrategyOptions,
- interestRateFrequencyTypeOptions, amortizationTypeOptions, interestTypeOptions, interestCalculationPeriodTypeOptions,
- fundOptions, chargeOptions, chargeTemplate, loanOfficerOptions, loanPurposeOptions, loanCollateralOptions, calendarOptions,
- acc.syncDisbursementWithMeeting, acc.loanCounter, acc.loanProductCounter, notes, acc.accountLinkingOptions,
- acc.linkedAccount, acc.disbursementDetails, product.getMultiDisburseLoan(), product.isCanDefineInstallmentAmount(),
- acc.fixedEmiAmount, product.getOutstandingLoanBalance(), acc.emiAmountVariations, acc.memberVariations, product,
- acc.inArrears, product.getGraceOnArrearsAgeing(), product.overdueFeeCharges(), acc.isNPA, product.getDaysInMonthType(),
- product.getDaysInYearType(), product.isInterestRecalculationEnabled(), product.toLoanInterestRecalculationData(),
- acc.originalSchedule, acc.createStandingInstructionAtDisbursement, paidInAdvance, acc.interestRatesPeriods,
- product.isAllowVariableInstallments(), product.getMinimumGap(), product.getMaximumGap(), acc.subStatus, acc.canUseForTopup,
- acc.clientActiveLoanOptions, acc.isTopup, acc.closureLoanId, acc.closureLoanAccountNo, acc.topupAmount,
- product.isEqualAmortization(), acc.rates, acc.isRatesEnabled, product.getFixedPrincipalPercentagePerInstallment(),
- delinquent, delinquencyRange, product.getDisallowExpectedDisbursements(), acc.fraud);
+ return new LoanAccountData().setId(acc.id).setAccountNo(acc.accountNo).setStatus(acc.status).setExternalId(acc.externalId)
+ .setClientId(acc.clientId).setClientAccountNo(acc.clientAccountNo).setClientName(acc.clientName)
+ .setClientOfficeId(acc.clientOfficeId).setClientExternalId(acc.clientExternalId).setGroup(acc.group)
+ .setLoanType(acc.loanType).setId(product.getId()).setLoanProductName(product.getName())
+ .setLoanProductDescription(product.getDescription())
+ .setLoanProductLinkedToFloatingRate(product.isLinkedToFloatingInterestRates()).setFundId(product.getFundId())
+ .setFundName(product.getFundName()).setLoanPurposeId(acc.loanPurposeId).setLoanPurposeName(acc.loanPurposeName)
+ .setLoanOfficerId(acc.loanOfficerId).setLoanOfficerName(acc.loanOfficerName).setCurrency(product.getCurrency())
+ .setPrincipal(product.getPrincipal()).setPrincipal(product.getPrincipal()).setPrincipal(product.getPrincipal())
+ .setNetDisbursalAmount(netDisbursalAmount).setTotalOverpaid(acc.totalOverpaid)
+ .setInArrearsTolerance(product.getInArrearsTolerance()).setTermFrequency(termFrequency)
+ .setTermPeriodFrequencyType(termPeriodFrequencyType).setNumberOfRepayments(product.getNumberOfRepayments())
+ .setRepaymentEvery(product.getRepaymentEvery()).setRepaymentFrequencyType(product.getRepaymentFrequencyType())
+ .setTransactionProcessingStrategyCode(product.getTransactionProcessingStrategyCode())
+ .setTransactionProcessingStrategyName(product.getTransactionProcessingStrategyName())
+ .setAmortizationType(product.getAmortizationType()).setInterestRatePerPeriod(product.getInterestRatePerPeriod())
+ .setInterestRateFrequencyType(product.getInterestRateFrequencyType()).setAnnualInterestRate(product.getAnnualInterestRate())
+ .setInterestType(product.getInterestType()).setFloatingInterestRate(product.isFloatingInterestRateCalculationAllowed())
+ .setInterestRateDifferential(product.getDefaultDifferentialLendingRate())
+ .setInterestCalculationPeriodType(product.getInterestCalculationPeriodType())
+ .setAllowPartialPeriodInterestCalculation(product.isAllowPartialPeriodInterestCalculation())
+ .setExpectedFirstRepaymentOnDate(acc.expectedFirstRepaymentOnDate)
+ .setGraceOnPrincipalPayment(product.getGraceOnPrincipalPayment())
+ .setRecurringMoratoriumOnPrincipalPeriods(product.getRecurringMoratoriumOnPrincipalPeriods())
+ .setGraceOnInterestPayment(product.getGraceOnInterestPayment())
+ .setGraceOnInterestCharged(product.getGraceOnInterestCharged()).setInterestChargedFromDate(acc.interestChargedFromDate)
+ .setTimeline(acc.timeline).setSummary(acc.summary).setFeeChargesAtDisbursementCharged(acc.feeChargesAtDisbursementCharged)
+ .setCharges(charges).setSyncDisbursementWithMeeting(acc.syncDisbursementWithMeeting).setLoanCounter(acc.loanCounter)
+ .setLoanProductCounter(acc.loanProductCounter).setAccountLinkingOptions(acc.accountLinkingOptions)
+ .setLinkedAccount(acc.linkedAccount).setDisbursementDetails(acc.disbursementDetails)
+ .setMultiDisburseLoan(product.getMultiDisburseLoan()).setCanDefineInstallmentAmount(product.isCanDefineInstallmentAmount())
+ .setFixedEmiAmount(acc.fixedEmiAmount).setMaxOutstandingLoanBalance(product.getOutstandingLoanBalance())
+ .setEmiAmountVariations(acc.emiAmountVariations).setMemberVariations(acc.memberVariations).setProduct(product)
+ .setInArrears(acc.inArrears).setGraceOnArrearsAgeing(product.getGraceOnArrearsAgeing())
+ .setOverdueCharges(product.overdueFeeCharges()).setIsNPA(acc.isNPA).setDaysInMonthType(product.getDaysInMonthType())
+ .setDaysInYearType(product.getDaysInYearType()).setInterestRecalculationEnabled(product.isInterestRecalculationEnabled())
+ .setInterestRecalculationData(product.toLoanInterestRecalculationData()).setOriginalSchedule(acc.originalSchedule)
+ .setCreateStandingInstructionAtDisbursement(acc.createStandingInstructionAtDisbursement)
+ .setInterestRatesPeriods(acc.interestRatesPeriods).setIsVariableInstallmentsAllowed(product.isAllowVariableInstallments())
+ .setMinimumGap(product.getMinimumGap()).setMaximumGap(product.getMaximumGap()).setSubStatus(acc.subStatus)
+ .setCanUseForTopup(acc.canUseForTopup).setClientActiveLoanOptions(acc.clientActiveLoanOptions).setTopup(acc.isTopup)
+ .setClosureLoanId(acc.closureLoanId).setClosureLoanAccountNo(acc.closureLoanAccountNo).setTopupAmount(acc.topupAmount)
+ .setIsEqualAmortization(product.isEqualAmortization()).setRates(acc.rates).setIsRatesEnabled(acc.isRatesEnabled)
+ .setFixedPrincipalPercentagePerInstallment(product.getFixedPrincipalPercentagePerInstallment()).setDelinquent(delinquent)
+ .setDisallowExpectedDisbursements(product.getDisallowExpectedDisbursements()).setFraud(acc.fraud);
}
/*
@@ -1203,7 +629,7 @@ public final class LoanAccountData {
final BigDecimal approvedPrincipal, final BigDecimal netDisbursalAmount, final BigDecimal totalOverpaid,
final BigDecimal inArrearsTolerance, final Integer termFrequency, final EnumOptionData termPeriodFrequencyType,
final Integer numberOfRepayments, final Integer repaymentEvery, final EnumOptionData repaymentFrequencyType,
- EnumOptionData repaymentFrequencyNthDayType, EnumOptionData repaymentFrequencyDayOfWeekType, final Long transactionStrategyId,
+ EnumOptionData repaymentFrequencyNthDayType, EnumOptionData repaymentFrequencyDayOfWeekType, final String transactionStrategy,
final String transactionStrategyName, final EnumOptionData amortizationType, final BigDecimal interestRatePerPeriod,
final EnumOptionData interestRateFrequencyType, final BigDecimal annualInterestRate, final EnumOptionData interestType,
final boolean isFloatingInterestRate, final BigDecimal interestRateDifferential,
@@ -1222,67 +648,44 @@ public final class LoanAccountData {
final BigDecimal topupAmount, final boolean isEqualAmortization, final BigDecimal fixedPrincipalPercentagePerInstallment,
final DelinquencyRangeData delinquencyRange, final boolean disallowExpectedDisbursements, final boolean fraud) {
- final LoanScheduleData repaymentSchedule = null;
- final Collection transactions = null;
- final Collection charges = null;
- final Collection collateral = null;
- final Collection guarantors = null;
- final Collection notes = null;
- final CalendarData calendarData = null;
- final Collection productOptions = null;
- final Collection termFrequencyTypeOptions = null;
- final Collection repaymentFrequencyTypeOptions = null;
- final Collection repaymentFrequencyNthDayTypeOptions = null;
- final Collection repaymentFrequencyDayOfWeekTypeOptions = null;
- final Collection repaymentStrategyOptions = null;
- final Collection interestRateFrequencyTypeOptions = null;
- final Collection amortizationTypeOptions = null;
- final Collection interestTypeOptions = null;
- final Collection interestCalculationPeriodTypeOptions = null;
- final Collection fundOptions = null;
- final Collection chargeOptions = null;
- final ChargeData chargeTemplate = null;
- final Collection loanOfficerOptions = null;
- final Collection loanPurposeOptions = null;
- final Collection loanCollateralOptions = null;
- final Collection calendarOptions = null;
- final Collection accountLinkingOptions = null;
- final PortfolioAccountData linkedAccount = null;
- final Collection disbursementData = null;
- final Collection emiAmountVariations = null;
- final Map memberVariations = null;
- final LoanProductData product = null;
- final Collection overdueCharges = null;
- final LoanScheduleData originalSchedule = null;
- final PaidInAdvanceData paidInAdvance = null;
- final Collection interestRatesPeriods = null;
- final Collection clientActiveLoanOptions = null;
- final List rates = null;
- final Boolean isRatesEnabled = false;
final CollectionData delinquent = CollectionData.template();
- return new LoanAccountData(id, accountNo, status, externalId, clientId, clientAccountNo, clientName, clientOfficeId,
- clientExternalId, group, loanType, loanProductId, loanProductName, loanProductDescription,
- isLoanProductLinkedToFloatingRate, fundId, fundName, loanPurposeId, loanPurposeName, loanOfficerId, loanOfficerName,
- currencyData, proposedPrincipal, principal, approvedPrincipal, netDisbursalAmount, totalOverpaid, inArrearsTolerance,
- termFrequency, termPeriodFrequencyType, numberOfRepayments, repaymentEvery, repaymentFrequencyType,
- repaymentFrequencyNthDayType, repaymentFrequencyDayOfWeekType, transactionStrategyId, transactionStrategyName,
- amortizationType, interestRatePerPeriod, interestRateFrequencyType, annualInterestRate, interestType,
- isFloatingInterestRate, interestRateDifferential, interestCalculationPeriodType, allowPartialPeriodInterestCalcualtion,
- expectedFirstRepaymentOnDate, graceOnPrincipalPayment, recurringMoratoriumOnPrincipalPeriods, graceOnInterestPayment,
- graceOnInterestCharged, interestChargedFromDate, timeline, loanSummary, feeChargesDueAtDisbursementCharged,
- repaymentSchedule, transactions, charges, collateral, guarantors, calendarData, productOptions, termFrequencyTypeOptions,
- repaymentFrequencyTypeOptions, repaymentFrequencyNthDayTypeOptions, repaymentFrequencyDayOfWeekTypeOptions,
- repaymentStrategyOptions, interestRateFrequencyTypeOptions, amortizationTypeOptions, interestTypeOptions,
- interestCalculationPeriodTypeOptions, fundOptions, chargeOptions, chargeTemplate, loanOfficerOptions, loanPurposeOptions,
- loanCollateralOptions, calendarOptions, syncDisbursementWithMeeting, loanCounter, loanProductCounter, notes,
- accountLinkingOptions, linkedAccount, disbursementData, multiDisburseLoan, canDefineInstallmentAmount, fixedEmiAmont,
- 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, rates, isRatesEnabled, fixedPrincipalPercentagePerInstallment, delinquent, delinquencyRange,
- disallowExpectedDisbursements, fraud);
+ return new LoanAccountData().setId(id).setAccountNo(accountNo).setStatus(status).setExternalId(externalId).setClientId(clientId)
+ .setClientAccountNo(clientAccountNo).setClientName(clientName).setClientOfficeId(clientOfficeId)
+ .setClientExternalId(clientExternalId).setGroup(group).setLoanType(loanType).setLoanProductId(loanProductId)
+ .setLoanProductName(loanProductName).setLoanProductDescription(loanProductDescription)
+ .setLoanProductLinkedToFloatingRate(isLoanProductLinkedToFloatingRate).setFundId(fundId).setFundName(fundName)
+ .setLoanPurposeId(loanPurposeId).setLoanPurposeName(loanPurposeName).setLoanOfficerId(loanOfficerId)
+ .setLoanOfficerName(loanOfficerName).setCurrency(currencyData).setProposedPrincipal(proposedPrincipal)
+ .setPrincipal(principal).setApprovedPrincipal(approvedPrincipal).setNetDisbursalAmount(netDisbursalAmount)
+ .setTotalOverpaid(totalOverpaid).setInArrearsTolerance(inArrearsTolerance).setTermFrequency(termFrequency)
+ .setTermPeriodFrequencyType(termPeriodFrequencyType).setNumberOfRepayments(numberOfRepayments)
+ .setRepaymentEvery(repaymentEvery).setRepaymentFrequencyType(repaymentFrequencyType)
+ .setRepaymentFrequencyNthDayType(repaymentFrequencyNthDayType)
+ .setRepaymentFrequencyDayOfWeekType(repaymentFrequencyDayOfWeekType)
+ .setTransactionProcessingStrategyCode(transactionStrategy).setTransactionProcessingStrategyName(transactionStrategyName)
+ .setAmortizationType(amortizationType).setInterestRatePerPeriod(interestRatePerPeriod)
+ .setInterestRateFrequencyType(interestRateFrequencyType).setAnnualInterestRate(annualInterestRate)
+ .setInterestType(interestType).setFloatingInterestRate(isFloatingInterestRate)
+ .setInterestRateDifferential(interestRateDifferential).setInterestCalculationPeriodType(interestCalculationPeriodType)
+ .setAllowPartialPeriodInterestCalculation(allowPartialPeriodInterestCalcualtion)
+ .setExpectedFirstRepaymentOnDate(expectedFirstRepaymentOnDate).setGraceOnPrincipalPayment(graceOnPrincipalPayment)
+ .setRecurringMoratoriumOnPrincipalPeriods(recurringMoratoriumOnPrincipalPeriods)
+ .setGraceOnInterestPayment(graceOnInterestPayment).setGraceOnInterestCharged(graceOnInterestCharged)
+ .setInterestChargedFromDate(interestChargedFromDate).setTimeline(timeline).setSummary(loanSummary)
+ .setFeeChargesAtDisbursementCharged(feeChargesDueAtDisbursementCharged)
+ .setSyncDisbursementWithMeeting(syncDisbursementWithMeeting).setLoanCounter(loanCounter)
+ .setLoanProductCounter(loanProductCounter).setMultiDisburseLoan(multiDisburseLoan)
+ .setCanDefineInstallmentAmount(canDefineInstallmentAmount).setFixedEmiAmount(fixedEmiAmont)
+ .setMaxOutstandingLoanBalance(outstandingLoanBalance).setInArrears(inArrears).setGraceOnArrearsAgeing(graceOnArrearsAgeing)
+ .setIsNPA(isNPA).setDaysInMonthType(daysInMonthType).setDaysInYearType(daysInYearType)
+ .setInterestRecalculationEnabled(isInterestRecalculationEnabled).setInterestRecalculationData(interestRecalculationData)
+ .setCreateStandingInstructionAtDisbursement(createStandingInstructionAtDisbursement)
+ .setIsVariableInstallmentsAllowed(isVariableInstallmentsAllowed).setMinimumGap(minimumGap).setMaximumGap(maximumGap)
+ .setSubStatus(subStatus).setCanUseForTopup(canUseForTopup).setTopup(isTopup).setClosureLoanId(closureLoanId)
+ .setClosureLoanAccountNo(closureLoanAccountNo).setTopupAmount(topupAmount).setIsEqualAmortization(isEqualAmortization)
+ .setFixedPrincipalPercentagePerInstallment(fixedPrincipalPercentagePerInstallment).setDelinquent(delinquent)
+ .setDelinquencyRange(delinquencyRange).setDisallowExpectedDisbursements(disallowExpectedDisbursements).setFraud(fraud);
}
/*
@@ -1308,36 +711,71 @@ public final class LoanAccountData {
final Collection clientActiveLoanOptions, final List rates, final Boolean isRatesEnabled,
final CollectionData delinquent) {
- return new LoanAccountData(acc.id, acc.accountNo, acc.status, acc.externalId, acc.clientId, acc.clientAccountNo, acc.clientName,
- acc.clientOfficeId, acc.clientExternalId, acc.group, acc.loanType, acc.loanProductId, acc.loanProductName,
- acc.loanProductDescription, acc.isLoanProductLinkedToFloatingRate, acc.fundId, acc.fundName, acc.loanPurposeId,
- acc.loanPurposeName, acc.loanOfficerId, acc.loanOfficerName, acc.currency, acc.proposedPrincipal, acc.principal,
- acc.approvedPrincipal, acc.netDisbursalAmount, acc.totalOverpaid, acc.inArrearsTolerance, acc.termFrequency,
- acc.termPeriodFrequencyType, acc.numberOfRepayments, acc.repaymentEvery, acc.repaymentFrequencyType,
- acc.repaymentFrequencyNthDayType, acc.repaymentFrequencyDayOfWeekType, acc.transactionProcessingStrategyId,
- acc.transactionProcessingStrategyName, acc.amortizationType, acc.interestRatePerPeriod, acc.interestRateFrequencyType,
- acc.annualInterestRate, acc.interestType, acc.isFloatingInterestRate, acc.interestRateDifferential,
- acc.interestCalculationPeriodType, acc.allowPartialPeriodInterestCalculation, acc.expectedFirstRepaymentOnDate,
- acc.graceOnPrincipalPayment, acc.recurringMoratoriumOnPrincipalPeriods, acc.graceOnInterestPayment,
- acc.graceOnInterestCharged, acc.interestChargedFromDate, acc.timeline, acc.summary, acc.feeChargesAtDisbursementCharged,
- repaymentSchedule, transactions, charges, collateral, guarantors, calendarData, productOptions, termFrequencyTypeOptions,
- repaymentFrequencyTypeOptions, repaymentFrequencyNthDayTypeOptions, repaymentFrequencyDayOfWeekTypeOptions,
- transactionProcessingStrategyOptions, interestRateFrequencyTypeOptions, amortizationTypeOptions, interestTypeOptions,
- interestCalculationPeriodTypeOptions, fundOptions, chargeOptions, chargeTemplate, loanOfficerOptions, loanPurposeOptions,
- loanCollateralOptions, calendarOptions, acc.syncDisbursementWithMeeting, acc.loanCounter, acc.loanProductCounter, notes,
- accountLinkingOptions, linkedAccount, disbursementDetails, acc.multiDisburseLoan, acc.canDefineInstallmentAmount,
- acc.fixedEmiAmount, acc.maxOutstandingLoanBalance, emiAmountVariations, acc.memberVariations, acc.product, acc.inArrears,
- acc.graceOnArrearsAgeing, overdueCharges, acc.isNPA, acc.daysInMonthType, acc.daysInYearType,
- 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, rates, isRatesEnabled,
- acc.fixedPrincipalPercentagePerInstallment, delinquent, acc.delinquencyRange, acc.disallowExpectedDisbursements, acc.fraud);
+ // TODO: why are these variables 'calendarData', 'chargeTemplate' never used (see original private constructor)
+
+ return new LoanAccountData().setId(acc.id).setAccountNo(acc.accountNo).setStatus(acc.status).setExternalId(acc.externalId)
+ .setClientId(acc.clientId).setClientAccountNo(acc.clientAccountNo).setClientName(acc.clientName)
+ .setClientOfficeId(acc.clientOfficeId).setClientExternalId(acc.clientExternalId).setGroup(acc.group)
+ .setLoanType(acc.loanType).setLoanProductId(acc.loanProductId).setLoanProductName(acc.loanProductName)
+ .setLoanProductDescription(acc.loanProductDescription)
+ .setLoanProductLinkedToFloatingRate(acc.isLoanProductLinkedToFloatingRate).setFundId(acc.fundId).setFundName(acc.fundName)
+ .setLoanPurposeId(acc.loanPurposeId).setLoanPurposeName(acc.loanPurposeName).setLoanOfficerId(acc.loanOfficerId)
+ .setLoanOfficerName(acc.loanOfficerName).setCurrency(acc.currency).setProposedPrincipal(acc.proposedPrincipal)
+ .setPrincipal(acc.principal).setApprovedPrincipal(acc.approvedPrincipal).setNetDisbursalAmount(acc.netDisbursalAmount)
+ .setTotalOverpaid(acc.totalOverpaid).setInArrearsTolerance(acc.inArrearsTolerance).setTermFrequency(acc.termFrequency)
+ .setTermPeriodFrequencyType(acc.termPeriodFrequencyType).setNumberOfRepayments(acc.numberOfRepayments)
+ .setRepaymentEvery(acc.repaymentEvery).setRepaymentFrequencyType(acc.repaymentFrequencyType)
+ .setRepaymentFrequencyNthDayType(acc.repaymentFrequencyNthDayType)
+ .setRepaymentFrequencyDayOfWeekType(acc.repaymentFrequencyDayOfWeekType)
+ .setTransactionProcessingStrategyCode(acc.transactionProcessingStrategyCode)
+ .setTransactionProcessingStrategyName(acc.transactionProcessingStrategyName).setAmortizationType(acc.amortizationType)
+ .setInterestRatePerPeriod(acc.interestRatePerPeriod).setInterestRateFrequencyType(acc.interestRateFrequencyType)
+ .setAnnualInterestRate(acc.annualInterestRate).setInterestType(acc.interestType)
+ .setFloatingInterestRate(acc.isFloatingInterestRate).setInterestRateDifferential(acc.interestRateDifferential)
+ .setInterestCalculationPeriodType(acc.interestCalculationPeriodType)
+ .setAllowPartialPeriodInterestCalculation(acc.allowPartialPeriodInterestCalculation)
+ .setExpectedFirstRepaymentOnDate(acc.expectedFirstRepaymentOnDate).setGraceOnPrincipalPayment(acc.graceOnPrincipalPayment)
+ .setRecurringMoratoriumOnPrincipalPeriods(acc.recurringMoratoriumOnPrincipalPeriods)
+ .setGraceOnInterestPayment(acc.graceOnInterestPayment).setGraceOnInterestCharged(acc.graceOnInterestCharged)
+ .setInterestChargedFromDate(acc.interestChargedFromDate).setTimeline(acc.timeline).setSummary(acc.summary)
+ .setFeeChargesAtDisbursementCharged(acc.feeChargesAtDisbursementCharged).setRepaymentSchedule(repaymentSchedule)
+ .setTransactions(transactions).setCharges(charges).setCollateral(collateral).setGuarantors(guarantors)
+ .setProductOptions(productOptions).setTermFrequencyTypeOptions(termFrequencyTypeOptions)
+ .setRepaymentFrequencyTypeOptions(repaymentFrequencyTypeOptions)
+ .setRepaymentFrequencyNthDayTypeOptions(repaymentFrequencyNthDayTypeOptions)
+ .setRepaymentFrequencyDaysOfWeekTypeOptions(repaymentFrequencyDayOfWeekTypeOptions)
+ .setTransactionProcessingStrategyOptions(transactionProcessingStrategyOptions)
+ .setInterestRateFrequencyTypeOptions(interestRateFrequencyTypeOptions).setAmortizationTypeOptions(amortizationTypeOptions)
+ .setInterestTypeOptions(interestTypeOptions).setInterestCalculationPeriodTypeOptions(interestCalculationPeriodTypeOptions)
+ .setFundOptions(fundOptions).setChargeOptions(chargeOptions).setLoanOfficerOptions(loanOfficerOptions)
+ .setLoanPurposeOptions(loanPurposeOptions).setLoanCollateralOptions(loanCollateralOptions)
+ // .setMeeting(calendarData)
+ .setCalendarOptions(calendarOptions).setSyncDisbursementWithMeeting(acc.syncDisbursementWithMeeting)
+ .setLoanCounter(acc.loanCounter).setLoanProductCounter(acc.loanProductCounter).setNotes(notes)
+ .setAccountLinkingOptions(accountLinkingOptions).setLinkedAccount(linkedAccount).setDisbursementDetails(disbursementDetails)
+ .setEmiAmountVariations(emiAmountVariations).setOverdueCharges(overdueCharges).setPaidInAdvance(paidInAdvance)
+ .setInterestRatesPeriods(interestRatesPeriods).setClientActiveLoanOptions(clientActiveLoanOptions).setRates(rates)
+ .setIsRatesEnabled(isRatesEnabled).setDelinquent(delinquent).setMultiDisburseLoan(acc.multiDisburseLoan)
+ .setCanDefineInstallmentAmount(acc.canDefineInstallmentAmount).setFixedEmiAmount(acc.fixedEmiAmount)
+ .setMaxOutstandingLoanBalance(acc.maxOutstandingLoanBalance).setMemberVariations(acc.memberVariations)
+ .setProduct(acc.product).setInArrears(acc.inArrears).setGraceOnArrearsAgeing(acc.graceOnArrearsAgeing).setIsNPA(acc.isNPA)
+ .setDaysInMonthType(acc.daysInMonthType).setDaysInYearType(acc.daysInYearType)
+ .setInterestRecalculationEnabled(acc.isInterestRecalculationEnabled)
+ .setInterestRecalculationData(acc.interestRecalculationData).setOriginalSchedule(acc.originalSchedule)
+ .setCreateStandingInstructionAtDisbursement(acc.createStandingInstructionAtDisbursement)
+ .setIsVariableInstallmentsAllowed(acc.isVariableInstallmentsAllowed).setMinimumGap(acc.minimumGap)
+ .setMaximumGap(acc.maximumGap).setSubStatus(acc.subStatus).setCanUseForTopup(acc.canUseForTopup).setTopup(acc.isTopup)
+ .setClosureLoanId(acc.closureLoanId).setClosureLoanAccountNo(acc.closureLoanAccountNo).setTopupAmount(acc.topupAmount)
+ .setIsEqualAmortization(acc.isEqualAmortization)
+ .setFixedPrincipalPercentagePerInstallment(acc.fixedPrincipalPercentagePerInstallment)
+ .setDelinquencyRange(acc.delinquencyRange).setDisallowExpectedDisbursements(acc.disallowExpectedDisbursements)
+ .setFraud(acc.fraud);
}
public static LoanAccountData associationsAndTemplate(final LoanAccountData acc, final Collection productOptions,
final Collection allowedLoanOfficers, final Collection calendarOptions,
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,
@@ -1350,33 +788,63 @@ public final class LoanAccountData {
public static LoanAccountData associateGroup(final LoanAccountData acc, final GroupGeneralData group) {
- return new LoanAccountData(acc.id, acc.accountNo, acc.status, acc.externalId, acc.clientId, acc.clientAccountNo, acc.clientName,
- acc.clientOfficeId, acc.clientExternalId, group, acc.loanType, acc.loanProductId, acc.loanProductName,
- acc.loanProductDescription, acc.isLoanProductLinkedToFloatingRate, acc.fundId, acc.fundName, acc.loanPurposeId,
- acc.loanPurposeName, acc.loanOfficerId, acc.loanOfficerName, acc.currency, acc.proposedPrincipal, acc.principal,
- acc.approvedPrincipal, acc.netDisbursalAmount, acc.totalOverpaid, acc.inArrearsTolerance, acc.termFrequency,
- acc.termPeriodFrequencyType, acc.numberOfRepayments, acc.repaymentEvery, acc.repaymentFrequencyType,
- acc.repaymentFrequencyNthDayType, acc.repaymentFrequencyDayOfWeekType, acc.transactionProcessingStrategyId,
- acc.transactionProcessingStrategyName, acc.amortizationType, acc.interestRatePerPeriod, acc.interestRateFrequencyType,
- acc.annualInterestRate, acc.interestType, acc.isFloatingInterestRate, acc.interestRateDifferential,
- acc.interestCalculationPeriodType, acc.allowPartialPeriodInterestCalculation, acc.expectedFirstRepaymentOnDate,
- acc.graceOnPrincipalPayment, acc.recurringMoratoriumOnPrincipalPeriods, acc.graceOnInterestPayment,
- acc.graceOnInterestCharged, acc.interestChargedFromDate, acc.timeline, acc.summary, acc.feeChargesAtDisbursementCharged,
- acc.repaymentSchedule, acc.transactions, acc.charges, acc.collateral, acc.guarantors, acc.meeting, acc.productOptions,
- acc.termFrequencyTypeOptions, acc.repaymentFrequencyTypeOptions, acc.repaymentFrequencyNthDayTypeOptions,
- acc.repaymentFrequencyDaysOfWeekTypeOptions, acc.transactionProcessingStrategyOptions, acc.interestRateFrequencyTypeOptions,
- acc.amortizationTypeOptions, acc.interestTypeOptions, acc.interestCalculationPeriodTypeOptions, acc.fundOptions,
- acc.chargeOptions, null, acc.loanOfficerOptions, acc.loanPurposeOptions, acc.loanCollateralOptions, acc.calendarOptions,
- acc.syncDisbursementWithMeeting, acc.loanCounter, acc.loanProductCounter, acc.notes, acc.accountLinkingOptions,
- acc.linkedAccount, acc.disbursementDetails, acc.multiDisburseLoan, acc.canDefineInstallmentAmount, acc.fixedEmiAmount,
- acc.maxOutstandingLoanBalance, acc.emiAmountVariations, acc.memberVariations, acc.product, acc.inArrears,
- acc.graceOnArrearsAgeing, acc.overdueCharges, 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.rates, acc.isRatesEnabled,
- acc.fixedPrincipalPercentagePerInstallment, acc.delinquent, acc.delinquencyRange, acc.disallowExpectedDisbursements,
- acc.fraud);
+ return new LoanAccountData().setId(acc.id).setAccountNo(acc.accountNo).setStatus(acc.status).setExternalId(acc.externalId)
+ .setClientId(acc.clientId).setClientAccountNo(acc.clientAccountNo).setClientName(acc.clientName)
+ .setClientOfficeId(acc.clientOfficeId).setClientExternalId(acc.clientExternalId).setGroup(group).setLoanType(acc.loanType)
+ .setLoanProductId(acc.loanProductId).setLoanProductName(acc.loanProductName)
+ .setLoanProductDescription(acc.loanProductDescription)
+ .setLoanProductLinkedToFloatingRate(acc.isLoanProductLinkedToFloatingRate).setFundId(acc.fundId).setFundName(acc.fundName)
+ .setLoanPurposeId(acc.loanPurposeId).setLoanPurposeName(acc.loanPurposeName).setLoanOfficerId(acc.loanOfficerId)
+ .setLoanOfficerName(acc.loanOfficerName).setCurrency(acc.currency).setProposedPrincipal(acc.proposedPrincipal)
+ .setPrincipal(acc.principal).setApprovedPrincipal(acc.approvedPrincipal).setNetDisbursalAmount(acc.netDisbursalAmount)
+ .setTotalOverpaid(acc.totalOverpaid).setInArrearsTolerance(acc.inArrearsTolerance).setTermFrequency(acc.termFrequency)
+ .setTermPeriodFrequencyType(acc.termPeriodFrequencyType).setNumberOfRepayments(acc.numberOfRepayments)
+ .setRepaymentEvery(acc.repaymentEvery).setRepaymentFrequencyType(acc.repaymentFrequencyType)
+ .setRepaymentFrequencyNthDayType(acc.repaymentFrequencyNthDayType)
+ .setRepaymentFrequencyDayOfWeekType(acc.repaymentFrequencyDayOfWeekType)
+ .setTransactionProcessingStrategyCode(acc.transactionProcessingStrategyCode)
+ .setTransactionProcessingStrategyName(acc.transactionProcessingStrategyName).setAmortizationType(acc.amortizationType)
+ .setInterestRatePerPeriod(acc.interestRatePerPeriod).setInterestRateFrequencyType(acc.interestRateFrequencyType)
+ .setAnnualInterestRate(acc.annualInterestRate).setInterestType(acc.interestType)
+ .setFloatingInterestRate(acc.isFloatingInterestRate).setInterestRateDifferential(acc.interestRateDifferential)
+ .setInterestCalculationPeriodType(acc.interestCalculationPeriodType)
+ .setAllowPartialPeriodInterestCalculation(acc.allowPartialPeriodInterestCalculation)
+ .setExpectedFirstRepaymentOnDate(acc.expectedFirstRepaymentOnDate).setGraceOnPrincipalPayment(acc.graceOnPrincipalPayment)
+ .setRecurringMoratoriumOnPrincipalPeriods(acc.recurringMoratoriumOnPrincipalPeriods)
+ .setGraceOnInterestPayment(acc.graceOnInterestPayment).setGraceOnInterestCharged(acc.graceOnInterestCharged)
+ .setInterestChargedFromDate(acc.interestChargedFromDate).setTimeline(acc.timeline).setSummary(acc.summary)
+ .setFeeChargesAtDisbursementCharged(acc.feeChargesAtDisbursementCharged).setRepaymentSchedule(acc.repaymentSchedule)
+ .setTransactions(acc.transactions).setCharges(acc.charges).setCollateral(acc.collateral).setGuarantors(acc.guarantors)
+ .setMeeting(acc.meeting).setProductOptions(acc.productOptions).setTermFrequencyTypeOptions(acc.termFrequencyTypeOptions)
+ .setRepaymentFrequencyTypeOptions(acc.repaymentFrequencyTypeOptions)
+ .setRepaymentFrequencyNthDayTypeOptions(acc.repaymentFrequencyNthDayTypeOptions)
+ .setRepaymentFrequencyDaysOfWeekTypeOptions(acc.repaymentFrequencyDaysOfWeekTypeOptions)
+ .setTransactionProcessingStrategyOptions(acc.transactionProcessingStrategyOptions)
+ .setInterestRateFrequencyTypeOptions(acc.interestRateFrequencyTypeOptions)
+ .setAmortizationTypeOptions(acc.amortizationTypeOptions).setInterestTypeOptions(acc.interestTypeOptions)
+ .setInterestCalculationPeriodTypeOptions(acc.interestCalculationPeriodTypeOptions).setFundOptions(acc.fundOptions)
+ .setChargeOptions(acc.chargeOptions).setLoanOfficerOptions(acc.loanOfficerOptions)
+ .setLoanPurposeOptions(acc.loanPurposeOptions).setLoanCollateralOptions(acc.loanCollateralOptions)
+ .setCalendarOptions(acc.calendarOptions).setSyncDisbursementWithMeeting(acc.syncDisbursementWithMeeting)
+ .setLoanCounter(acc.loanCounter).setLoanProductCounter(acc.loanProductCounter).setNotes(acc.notes)
+ .setAccountLinkingOptions(acc.accountLinkingOptions).setLinkedAccount(acc.linkedAccount)
+ .setDisbursementDetails(acc.disbursementDetails).setMultiDisburseLoan(acc.multiDisburseLoan)
+ .setCanDefineInstallmentAmount(acc.canDefineInstallmentAmount).setFixedEmiAmount(acc.fixedEmiAmount)
+ .setMaxOutstandingLoanBalance(acc.maxOutstandingLoanBalance).setEmiAmountVariations(acc.emiAmountVariations)
+ .setMemberVariations(acc.memberVariations).setProduct(acc.product).setInArrears(acc.inArrears)
+ .setGraceOnArrearsAgeing(acc.graceOnArrearsAgeing).setOverdueCharges(acc.overdueCharges).setIsNPA(acc.isNPA)
+ .setDaysInMonthType(acc.daysInMonthType).setDaysInYearType(acc.daysInYearType)
+ .setInterestRecalculationEnabled(acc.isInterestRecalculationEnabled)
+ .setInterestRecalculationData(acc.interestRecalculationData).setOriginalSchedule(acc.originalSchedule)
+ .setCreateStandingInstructionAtDisbursement(acc.createStandingInstructionAtDisbursement).setPaidInAdvance(acc.paidInAdvance)
+ .setInterestRatesPeriods(acc.interestRatesPeriods).setIsVariableInstallmentsAllowed(acc.isVariableInstallmentsAllowed)
+ .setMinimumGap(acc.minimumGap).setMaximumGap(acc.maximumGap).setSubStatus(acc.subStatus)
+ .setCanUseForTopup(acc.canUseForTopup).setClientActiveLoanOptions(acc.clientActiveLoanOptions).setTopup(acc.isTopup)
+ .setClosureLoanId(acc.closureLoanId).setClosureLoanAccountNo(acc.closureLoanAccountNo).setTopupAmount(acc.topupAmount)
+ .setIsEqualAmortization(acc.isEqualAmortization).setRates(acc.rates).setIsRatesEnabled(acc.isRatesEnabled)
+ .setFixedPrincipalPercentagePerInstallment(acc.fixedPrincipalPercentagePerInstallment).setDelinquent(acc.delinquent)
+ .setDelinquencyRange(acc.delinquencyRange).setDisallowExpectedDisbursements(acc.disallowExpectedDisbursements)
+ .setFraud(acc.fraud);
}
public static LoanAccountData associateMemberVariations(final LoanAccountData acc, final Map memberLoanCycle) {
@@ -1417,33 +885,63 @@ public final class LoanAccountData {
memberVariations.put(clientId, borrowerCycleData);
}
- return new LoanAccountData(acc.id, acc.accountNo, acc.status, acc.externalId, acc.clientId, acc.clientAccountNo, acc.clientName,
- acc.clientOfficeId, acc.clientExternalId, acc.group, acc.loanType, acc.loanProductId, acc.loanProductName,
- acc.loanProductDescription, acc.isLoanProductLinkedToFloatingRate, acc.fundId, acc.fundName, acc.loanPurposeId,
- acc.loanPurposeName, acc.loanOfficerId, acc.loanOfficerName, acc.currency, acc.proposedPrincipal, acc.principal,
- acc.approvedPrincipal, acc.netDisbursalAmount, acc.totalOverpaid, acc.inArrearsTolerance, acc.termFrequency,
- acc.termPeriodFrequencyType, acc.numberOfRepayments, acc.repaymentEvery, acc.repaymentFrequencyType,
- acc.repaymentFrequencyNthDayType, acc.repaymentFrequencyDayOfWeekType, acc.transactionProcessingStrategyId,
- acc.transactionProcessingStrategyName, acc.amortizationType, acc.interestRatePerPeriod, acc.interestRateFrequencyType,
- acc.annualInterestRate, acc.interestType, acc.isFloatingInterestRate, acc.interestRateDifferential,
- acc.interestCalculationPeriodType, acc.allowPartialPeriodInterestCalculation, acc.expectedFirstRepaymentOnDate,
- acc.graceOnPrincipalPayment, acc.recurringMoratoriumOnPrincipalPeriods, acc.graceOnInterestPayment,
- acc.graceOnInterestCharged, acc.interestChargedFromDate, acc.timeline, acc.summary, acc.feeChargesAtDisbursementCharged,
- acc.repaymentSchedule, acc.transactions, acc.charges, acc.collateral, acc.guarantors, acc.meeting, acc.productOptions,
- acc.termFrequencyTypeOptions, acc.repaymentFrequencyTypeOptions, acc.repaymentFrequencyNthDayTypeOptions,
- acc.repaymentFrequencyDaysOfWeekTypeOptions, acc.transactionProcessingStrategyOptions, acc.interestRateFrequencyTypeOptions,
- acc.amortizationTypeOptions, acc.interestTypeOptions, acc.interestCalculationPeriodTypeOptions, acc.fundOptions,
- acc.chargeOptions, null, acc.loanOfficerOptions, acc.loanPurposeOptions, acc.loanCollateralOptions, acc.calendarOptions,
- acc.syncDisbursementWithMeeting, acc.loanCounter, acc.loanProductCounter, acc.notes, acc.accountLinkingOptions,
- acc.linkedAccount, acc.disbursementDetails, acc.multiDisburseLoan, acc.canDefineInstallmentAmount, acc.fixedEmiAmount,
- acc.maxOutstandingLoanBalance, acc.emiAmountVariations, memberVariations, acc.product, acc.inArrears,
- acc.graceOnArrearsAgeing, acc.overdueCharges, 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.rates, acc.isRatesEnabled,
- acc.fixedPrincipalPercentagePerInstallment, acc.delinquent, acc.delinquencyRange, acc.disallowExpectedDisbursements,
- acc.fraud);
+ return new LoanAccountData().setId(acc.id).setAccountNo(acc.accountNo).setStatus(acc.status).setExternalId(acc.externalId)
+ .setClientId(acc.clientId).setClientAccountNo(acc.clientAccountNo).setClientName(acc.clientName)
+ .setClientOfficeId(acc.clientOfficeId).setClientExternalId(acc.clientExternalId).setGroup(acc.group)
+ .setLoanType(acc.loanType).setLoanProductId(acc.loanProductId).setLoanProductName(acc.loanProductName)
+ .setLoanProductDescription(acc.loanProductDescription)
+ .setLoanProductLinkedToFloatingRate(acc.isLoanProductLinkedToFloatingRate).setFundId(acc.fundId).setFundName(acc.fundName)
+ .setLoanPurposeId(acc.loanPurposeId).setLoanPurposeName(acc.loanPurposeName).setLoanOfficerId(acc.loanOfficerId)
+ .setLoanOfficerName(acc.loanOfficerName).setCurrency(acc.currency).setProposedPrincipal(acc.proposedPrincipal)
+ .setPrincipal(acc.principal).setApprovedPrincipal(acc.approvedPrincipal).setNetDisbursalAmount(acc.netDisbursalAmount)
+ .setTotalOverpaid(acc.totalOverpaid).setInArrearsTolerance(acc.inArrearsTolerance).setTermFrequency(acc.termFrequency)
+ .setTermPeriodFrequencyType(acc.termPeriodFrequencyType).setNumberOfRepayments(acc.numberOfRepayments)
+ .setRepaymentEvery(acc.repaymentEvery).setRepaymentFrequencyType(acc.repaymentFrequencyType)
+ .setRepaymentFrequencyNthDayType(acc.repaymentFrequencyNthDayType)
+ .setRepaymentFrequencyDayOfWeekType(acc.repaymentFrequencyDayOfWeekType)
+ .setTransactionProcessingStrategyCode(acc.transactionProcessingStrategyCode)
+ .setTransactionProcessingStrategyName(acc.transactionProcessingStrategyName).setAmortizationType(acc.amortizationType)
+ .setInterestRatePerPeriod(acc.interestRatePerPeriod).setInterestRateFrequencyType(acc.interestRateFrequencyType)
+ .setAnnualInterestRate(acc.annualInterestRate).setInterestType(acc.interestType)
+ .setFloatingInterestRate(acc.isFloatingInterestRate).setInterestRateDifferential(acc.interestRateDifferential)
+ .setInterestCalculationPeriodType(acc.interestCalculationPeriodType)
+ .setAllowPartialPeriodInterestCalculation(acc.allowPartialPeriodInterestCalculation)
+ .setExpectedFirstRepaymentOnDate(acc.expectedFirstRepaymentOnDate).setGraceOnPrincipalPayment(acc.graceOnPrincipalPayment)
+ .setRecurringMoratoriumOnPrincipalPeriods(acc.recurringMoratoriumOnPrincipalPeriods)
+ .setGraceOnInterestPayment(acc.graceOnInterestPayment).setGraceOnInterestCharged(acc.graceOnInterestCharged)
+ .setInterestChargedFromDate(acc.interestChargedFromDate).setTimeline(acc.timeline).setSummary(acc.summary)
+ .setFeeChargesAtDisbursementCharged(acc.feeChargesAtDisbursementCharged).setRepaymentSchedule(acc.repaymentSchedule)
+ .setTransactions(acc.transactions).setCharges(acc.charges).setCollateral(acc.collateral).setGuarantors(acc.guarantors)
+ .setMeeting(acc.meeting).setProductOptions(acc.productOptions).setTermFrequencyTypeOptions(acc.termFrequencyTypeOptions)
+ .setRepaymentFrequencyTypeOptions(acc.repaymentFrequencyTypeOptions)
+ .setRepaymentFrequencyNthDayTypeOptions(acc.repaymentFrequencyNthDayTypeOptions)
+ .setRepaymentFrequencyDaysOfWeekTypeOptions(acc.repaymentFrequencyDaysOfWeekTypeOptions)
+ .setTransactionProcessingStrategyOptions(acc.transactionProcessingStrategyOptions)
+ .setInterestRateFrequencyTypeOptions(acc.interestRateFrequencyTypeOptions)
+ .setAmortizationTypeOptions(acc.amortizationTypeOptions).setInterestTypeOptions(acc.interestTypeOptions)
+ .setInterestCalculationPeriodTypeOptions(acc.interestCalculationPeriodTypeOptions).setFundOptions(acc.fundOptions)
+ .setChargeOptions(acc.chargeOptions).setLoanOfficerOptions(acc.loanOfficerOptions)
+ .setLoanPurposeOptions(acc.loanPurposeOptions).setLoanCollateralOptions(acc.loanCollateralOptions)
+ .setCalendarOptions(acc.calendarOptions).setSyncDisbursementWithMeeting(acc.syncDisbursementWithMeeting)
+ .setLoanCounter(acc.loanCounter).setLoanProductCounter(acc.loanProductCounter).setNotes(acc.notes)
+ .setAccountLinkingOptions(acc.accountLinkingOptions).setLinkedAccount(acc.linkedAccount)
+ .setDisbursementDetails(acc.disbursementDetails).setMultiDisburseLoan(acc.multiDisburseLoan)
+ .setCanDefineInstallmentAmount(acc.canDefineInstallmentAmount).setFixedEmiAmount(acc.fixedEmiAmount)
+ .setMaxOutstandingLoanBalance(acc.maxOutstandingLoanBalance).setEmiAmountVariations(acc.emiAmountVariations)
+ .setMemberVariations(memberVariations).setProduct(acc.product).setInArrears(acc.inArrears)
+ .setGraceOnArrearsAgeing(acc.graceOnArrearsAgeing).setOverdueCharges(acc.overdueCharges).setIsNPA(acc.isNPA)
+ .setDaysInMonthType(acc.daysInMonthType).setDaysInYearType(acc.daysInYearType)
+ .setInterestRecalculationEnabled(acc.isInterestRecalculationEnabled)
+ .setInterestRecalculationData(acc.interestRecalculationData).setOriginalSchedule(acc.originalSchedule)
+ .setCreateStandingInstructionAtDisbursement(acc.createStandingInstructionAtDisbursement).setPaidInAdvance(acc.paidInAdvance)
+ .setInterestRatesPeriods(acc.interestRatesPeriods).setIsVariableInstallmentsAllowed(acc.isVariableInstallmentsAllowed)
+ .setMinimumGap(acc.minimumGap).setMaximumGap(acc.maximumGap).setSubStatus(acc.subStatus)
+ .setCanUseForTopup(acc.canUseForTopup).setClientActiveLoanOptions(acc.clientActiveLoanOptions).setTopup(acc.isTopup)
+ .setClosureLoanId(acc.closureLoanId).setClosureLoanAccountNo(acc.closureLoanAccountNo).setTopupAmount(acc.topupAmount)
+ .setIsEqualAmortization(acc.isEqualAmortization).setRates(acc.rates).setIsRatesEnabled(acc.isRatesEnabled)
+ .setFixedPrincipalPercentagePerInstallment(acc.fixedPrincipalPercentagePerInstallment).setDelinquent(acc.delinquent)
+ .setDelinquencyRange(acc.delinquencyRange).setDisallowExpectedDisbursements(acc.disallowExpectedDisbursements)
+ .setFraud(acc.fraud);
}
public static LoanAccountData withInterestRecalculationCalendarData(final LoanAccountData acc, final CalendarData calendarData,
@@ -1452,362 +950,189 @@ public final class LoanAccountData {
final LoanInterestRecalculationData interestRecalculationData = LoanInterestRecalculationData
.withCalendarData(acc.interestRecalculationData, calendarData, compoundingCalendarData);
- return new LoanAccountData(acc.id, acc.accountNo, acc.status, acc.externalId, acc.clientId, acc.clientAccountNo, acc.clientName,
- acc.clientOfficeId, acc.clientExternalId, acc.group, acc.loanType, acc.loanProductId, acc.loanProductName,
- acc.loanProductDescription, acc.isLoanProductLinkedToFloatingRate, acc.fundId, acc.fundName, acc.loanPurposeId,
- acc.loanPurposeName, acc.loanOfficerId, acc.loanOfficerName, acc.currency, acc.proposedPrincipal, acc.principal,
- acc.approvedPrincipal, acc.netDisbursalAmount, acc.totalOverpaid, acc.inArrearsTolerance, acc.termFrequency,
- acc.termPeriodFrequencyType, acc.numberOfRepayments, acc.repaymentEvery, acc.repaymentFrequencyType,
- acc.repaymentFrequencyNthDayType, acc.repaymentFrequencyDayOfWeekType, acc.transactionProcessingStrategyId,
- acc.transactionProcessingStrategyName, acc.amortizationType, acc.interestRatePerPeriod, acc.interestRateFrequencyType,
- acc.annualInterestRate, acc.interestType, acc.isFloatingInterestRate, acc.interestRateDifferential,
- acc.interestCalculationPeriodType, acc.allowPartialPeriodInterestCalculation, acc.expectedFirstRepaymentOnDate,
- acc.graceOnPrincipalPayment, acc.recurringMoratoriumOnPrincipalPeriods, acc.graceOnInterestPayment,
- acc.graceOnInterestCharged, acc.interestChargedFromDate, acc.timeline, acc.summary, acc.feeChargesAtDisbursementCharged,
- acc.repaymentSchedule, acc.transactions, acc.charges, acc.collateral, acc.guarantors, acc.meeting, acc.productOptions,
- acc.termFrequencyTypeOptions, acc.repaymentFrequencyTypeOptions, acc.repaymentFrequencyNthDayTypeOptions,
- acc.repaymentFrequencyDaysOfWeekTypeOptions, acc.transactionProcessingStrategyOptions, acc.interestRateFrequencyTypeOptions,
- acc.amortizationTypeOptions, acc.interestTypeOptions, acc.interestCalculationPeriodTypeOptions, acc.fundOptions,
- acc.chargeOptions, null, acc.loanOfficerOptions, acc.loanPurposeOptions, acc.loanCollateralOptions, acc.calendarOptions,
- acc.syncDisbursementWithMeeting, acc.loanCounter, acc.loanProductCounter, acc.notes, acc.accountLinkingOptions,
- acc.linkedAccount, acc.disbursementDetails, acc.multiDisburseLoan, acc.canDefineInstallmentAmount, acc.fixedEmiAmount,
- acc.maxOutstandingLoanBalance, acc.emiAmountVariations, acc.memberVariations, acc.product, acc.inArrears,
- acc.graceOnArrearsAgeing, acc.overdueCharges, acc.isNPA, acc.daysInMonthType, acc.daysInYearType,
- 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.rates, acc.isRatesEnabled,
- acc.fixedPrincipalPercentagePerInstallment, acc.delinquent, acc.delinquencyRange, acc.disallowExpectedDisbursements,
- acc.fraud);
+ return new LoanAccountData().setId(acc.id).setAccountNo(acc.accountNo).setStatus(acc.status).setExternalId(acc.externalId)
+ .setClientId(acc.clientId).setClientAccountNo(acc.clientAccountNo).setClientName(acc.clientName)
+ .setClientOfficeId(acc.clientOfficeId).setClientExternalId(acc.clientExternalId).setGroup(acc.group)
+ .setLoanType(acc.loanType).setLoanProductId(acc.loanProductId).setLoanProductName(acc.loanProductName)
+ .setLoanProductDescription(acc.loanProductDescription)
+ .setLoanProductLinkedToFloatingRate(acc.isLoanProductLinkedToFloatingRate).setFundId(acc.fundId).setFundName(acc.fundName)
+ .setLoanPurposeId(acc.loanPurposeId).setLoanPurposeName(acc.loanPurposeName).setLoanOfficerId(acc.loanOfficerId)
+ .setLoanOfficerName(acc.loanOfficerName).setCurrency(acc.currency).setProposedPrincipal(acc.proposedPrincipal)
+ .setPrincipal(acc.principal).setApprovedPrincipal(acc.approvedPrincipal).setNetDisbursalAmount(acc.netDisbursalAmount)
+ .setTotalOverpaid(acc.totalOverpaid).setInArrearsTolerance(acc.inArrearsTolerance).setTermFrequency(acc.termFrequency)
+ .setTermPeriodFrequencyType(acc.termPeriodFrequencyType).setNumberOfRepayments(acc.numberOfRepayments)
+ .setRepaymentEvery(acc.repaymentEvery).setRepaymentFrequencyType(acc.repaymentFrequencyType)
+ .setRepaymentFrequencyNthDayType(acc.repaymentFrequencyNthDayType)
+ .setRepaymentFrequencyDayOfWeekType(acc.repaymentFrequencyDayOfWeekType)
+ .setTransactionProcessingStrategyCode(acc.transactionProcessingStrategyCode)
+ .setTransactionProcessingStrategyName(acc.transactionProcessingStrategyName).setAmortizationType(acc.amortizationType)
+ .setInterestRatePerPeriod(acc.interestRatePerPeriod).setInterestRateFrequencyType(acc.interestRateFrequencyType)
+ .setAnnualInterestRate(acc.annualInterestRate).setInterestType(acc.interestType)
+ .setFloatingInterestRate(acc.isFloatingInterestRate).setInterestRateDifferential(acc.interestRateDifferential)
+ .setInterestCalculationPeriodType(acc.interestCalculationPeriodType)
+ .setAllowPartialPeriodInterestCalculation(acc.allowPartialPeriodInterestCalculation)
+ .setExpectedFirstRepaymentOnDate(acc.expectedFirstRepaymentOnDate).setGraceOnPrincipalPayment(acc.graceOnPrincipalPayment)
+ .setRecurringMoratoriumOnPrincipalPeriods(acc.recurringMoratoriumOnPrincipalPeriods)
+ .setGraceOnInterestPayment(acc.graceOnInterestPayment).setGraceOnInterestCharged(acc.graceOnInterestCharged)
+ .setInterestChargedFromDate(acc.interestChargedFromDate).setTimeline(acc.timeline).setSummary(acc.summary)
+ .setFeeChargesAtDisbursementCharged(acc.feeChargesAtDisbursementCharged).setRepaymentSchedule(acc.repaymentSchedule)
+ .setTransactions(acc.transactions).setCharges(acc.charges).setCollateral(acc.collateral).setGuarantors(acc.guarantors)
+ .setMeeting(acc.meeting).setProductOptions(acc.productOptions).setTermFrequencyTypeOptions(acc.termFrequencyTypeOptions)
+ .setRepaymentFrequencyTypeOptions(acc.repaymentFrequencyTypeOptions)
+ .setRepaymentFrequencyNthDayTypeOptions(acc.repaymentFrequencyNthDayTypeOptions)
+ .setRepaymentFrequencyDaysOfWeekTypeOptions(acc.repaymentFrequencyDaysOfWeekTypeOptions)
+ .setTransactionProcessingStrategyOptions(acc.transactionProcessingStrategyOptions)
+ .setInterestRateFrequencyTypeOptions(acc.interestRateFrequencyTypeOptions)
+ .setAmortizationTypeOptions(acc.amortizationTypeOptions).setInterestTypeOptions(acc.interestTypeOptions)
+ .setInterestCalculationPeriodTypeOptions(acc.interestCalculationPeriodTypeOptions).setFundOptions(acc.fundOptions)
+ .setChargeOptions(acc.chargeOptions).setLoanOfficerOptions(acc.loanOfficerOptions)
+ .setLoanPurposeOptions(acc.loanPurposeOptions).setLoanCollateralOptions(acc.loanCollateralOptions)
+ .setCalendarOptions(acc.calendarOptions).setSyncDisbursementWithMeeting(acc.syncDisbursementWithMeeting)
+ .setLoanCounter(acc.loanCounter).setLoanProductCounter(acc.loanProductCounter).setNotes(acc.notes)
+ .setAccountLinkingOptions(acc.accountLinkingOptions).setLinkedAccount(acc.linkedAccount)
+ .setDisbursementDetails(acc.disbursementDetails).setMultiDisburseLoan(acc.multiDisburseLoan)
+ .setCanDefineInstallmentAmount(acc.canDefineInstallmentAmount).setFixedEmiAmount(acc.fixedEmiAmount)
+ .setMaxOutstandingLoanBalance(acc.maxOutstandingLoanBalance).setEmiAmountVariations(acc.emiAmountVariations)
+ .setMemberVariations(acc.memberVariations).setProduct(acc.product).setInArrears(acc.inArrears)
+ .setGraceOnArrearsAgeing(acc.graceOnArrearsAgeing).setOverdueCharges(acc.overdueCharges).setIsNPA(acc.isNPA)
+ .setDaysInMonthType(acc.daysInMonthType).setDaysInYearType(acc.daysInYearType)
+ .setInterestRecalculationEnabled(acc.isInterestRecalculationEnabled).setInterestRecalculationData(interestRecalculationData)
+ .setOriginalSchedule(acc.originalSchedule)
+ .setCreateStandingInstructionAtDisbursement(acc.createStandingInstructionAtDisbursement).setPaidInAdvance(acc.paidInAdvance)
+ .setInterestRatesPeriods(acc.interestRatesPeriods).setIsVariableInstallmentsAllowed(acc.isVariableInstallmentsAllowed)
+ .setMinimumGap(acc.minimumGap).setMaximumGap(acc.maximumGap).setSubStatus(acc.subStatus)
+ .setCanUseForTopup(acc.canUseForTopup).setClientActiveLoanOptions(acc.clientActiveLoanOptions).setTopup(acc.isTopup)
+ .setClosureLoanId(acc.closureLoanId).setClosureLoanAccountNo(acc.closureLoanAccountNo).setTopupAmount(acc.topupAmount)
+ .setIsEqualAmortization(acc.isEqualAmortization).setRates(acc.rates).setIsRatesEnabled(acc.isRatesEnabled)
+ .setFixedPrincipalPercentagePerInstallment(acc.fixedPrincipalPercentagePerInstallment).setDelinquent(acc.delinquent)
+ .setDelinquencyRange(acc.delinquencyRange).setDisallowExpectedDisbursements(acc.disallowExpectedDisbursements)
+ .setFraud(acc.fraud);
}
public static LoanAccountData withLoanCalendarData(final LoanAccountData acc, final CalendarData calendarData) {
- return new LoanAccountData(acc.id, acc.accountNo, acc.status, acc.externalId, acc.clientId, acc.clientAccountNo, acc.clientName,
- acc.clientOfficeId, acc.clientExternalId, acc.group, acc.loanType, acc.loanProductId, acc.loanProductName,
- acc.loanProductDescription, acc.isLoanProductLinkedToFloatingRate, acc.fundId, acc.fundName, acc.loanPurposeId,
- acc.loanPurposeName, acc.loanOfficerId, acc.loanOfficerName, acc.currency, acc.proposedPrincipal, acc.principal,
- acc.approvedPrincipal, acc.netDisbursalAmount, acc.totalOverpaid, acc.inArrearsTolerance, acc.termFrequency,
- acc.termPeriodFrequencyType, acc.numberOfRepayments, acc.repaymentEvery, acc.repaymentFrequencyType,
- calendarData.getRepeatsOnNthDayOfMonth(), calendarData.getRepeatsOnDay(), acc.transactionProcessingStrategyId,
- acc.transactionProcessingStrategyName, acc.amortizationType, acc.interestRatePerPeriod, acc.interestRateFrequencyType,
- acc.annualInterestRate, acc.interestType, acc.isFloatingInterestRate, acc.interestRateDifferential,
- acc.interestCalculationPeriodType, acc.allowPartialPeriodInterestCalculation, acc.expectedFirstRepaymentOnDate,
- acc.graceOnPrincipalPayment, acc.recurringMoratoriumOnPrincipalPeriods, acc.graceOnInterestPayment,
- acc.graceOnInterestCharged, acc.interestChargedFromDate, acc.timeline, acc.summary, acc.feeChargesAtDisbursementCharged,
- acc.repaymentSchedule, acc.transactions, acc.charges, acc.collateral, acc.guarantors, acc.meeting, acc.productOptions,
- acc.termFrequencyTypeOptions, acc.repaymentFrequencyTypeOptions, acc.repaymentFrequencyNthDayTypeOptions,
- acc.repaymentFrequencyDaysOfWeekTypeOptions, acc.transactionProcessingStrategyOptions, acc.interestRateFrequencyTypeOptions,
- acc.amortizationTypeOptions, acc.interestTypeOptions, acc.interestCalculationPeriodTypeOptions, acc.fundOptions,
- acc.chargeOptions, null, acc.loanOfficerOptions, acc.loanPurposeOptions, acc.loanCollateralOptions, acc.calendarOptions,
- acc.syncDisbursementWithMeeting, acc.loanCounter, acc.loanProductCounter, acc.notes, acc.accountLinkingOptions,
- acc.linkedAccount, acc.disbursementDetails, acc.multiDisburseLoan, acc.canDefineInstallmentAmount, acc.fixedEmiAmount,
- acc.maxOutstandingLoanBalance, acc.emiAmountVariations, acc.memberVariations, acc.product, acc.inArrears,
- acc.graceOnArrearsAgeing, acc.overdueCharges, 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.rates, acc.isRatesEnabled,
- acc.fixedPrincipalPercentagePerInstallment, acc.delinquent, acc.delinquencyRange, acc.disallowExpectedDisbursements,
- acc.fraud);
+ return new LoanAccountData().setId(acc.id).setAccountNo(acc.accountNo).setStatus(acc.status).setExternalId(acc.externalId)
+ .setClientId(acc.clientId).setClientAccountNo(acc.clientAccountNo).setClientName(acc.clientName)
+ .setClientOfficeId(acc.clientOfficeId).setClientExternalId(acc.clientExternalId).setGroup(acc.group)
+ .setLoanType(acc.loanType).setLoanProductId(acc.loanProductId).setLoanProductName(acc.loanProductName)
+ .setLoanProductDescription(acc.loanProductDescription)
+ .setLoanProductLinkedToFloatingRate(acc.isLoanProductLinkedToFloatingRate).setFundId(acc.fundId).setFundName(acc.fundName)
+ .setLoanPurposeId(acc.loanPurposeId).setLoanPurposeName(acc.loanPurposeName).setLoanOfficerId(acc.loanOfficerId)
+ .setLoanOfficerName(acc.loanOfficerName).setCurrency(acc.currency).setProposedPrincipal(acc.proposedPrincipal)
+ .setPrincipal(acc.principal).setApprovedPrincipal(acc.approvedPrincipal).setNetDisbursalAmount(acc.netDisbursalAmount)
+ .setTotalOverpaid(acc.totalOverpaid).setInArrearsTolerance(acc.inArrearsTolerance).setTermFrequency(acc.termFrequency)
+ .setTermPeriodFrequencyType(acc.termPeriodFrequencyType).setNumberOfRepayments(acc.numberOfRepayments)
+ .setRepaymentEvery(acc.repaymentEvery).setRepaymentFrequencyType(acc.repaymentFrequencyType).setMeeting(calendarData)
+ .setTransactionProcessingStrategyCode(acc.transactionProcessingStrategyCode)
+ .setTransactionProcessingStrategyName(acc.transactionProcessingStrategyName).setAmortizationType(acc.amortizationType)
+ .setInterestRatePerPeriod(acc.interestRatePerPeriod).setInterestRateFrequencyType(acc.interestRateFrequencyType)
+ .setAnnualInterestRate(acc.annualInterestRate).setInterestType(acc.interestType)
+ .setFloatingInterestRate(acc.isFloatingInterestRate).setInterestRateDifferential(acc.interestRateDifferential)
+ .setInterestCalculationPeriodType(acc.interestCalculationPeriodType)
+ .setAllowPartialPeriodInterestCalculation(acc.allowPartialPeriodInterestCalculation)
+ .setExpectedFirstRepaymentOnDate(acc.expectedFirstRepaymentOnDate).setGraceOnPrincipalPayment(acc.graceOnPrincipalPayment)
+ .setRecurringMoratoriumOnPrincipalPeriods(acc.recurringMoratoriumOnPrincipalPeriods)
+ .setGraceOnInterestPayment(acc.graceOnInterestPayment).setGraceOnInterestCharged(acc.graceOnInterestCharged)
+ .setInterestChargedFromDate(acc.interestChargedFromDate).setTimeline(acc.timeline).setSummary(acc.summary)
+ .setFeeChargesAtDisbursementCharged(acc.feeChargesAtDisbursementCharged).setRepaymentSchedule(acc.repaymentSchedule)
+ .setTransactions(acc.transactions).setCharges(acc.charges).setCollateral(acc.collateral).setGuarantors(acc.guarantors)
+ .setMeeting(acc.meeting).setProductOptions(acc.productOptions).setTermFrequencyTypeOptions(acc.termFrequencyTypeOptions)
+ .setRepaymentFrequencyTypeOptions(acc.repaymentFrequencyTypeOptions)
+ .setRepaymentFrequencyNthDayTypeOptions(acc.repaymentFrequencyNthDayTypeOptions)
+ .setRepaymentFrequencyDaysOfWeekTypeOptions(acc.repaymentFrequencyDaysOfWeekTypeOptions)
+ .setTransactionProcessingStrategyOptions(acc.transactionProcessingStrategyOptions)
+ .setInterestRateFrequencyTypeOptions(acc.interestRateFrequencyTypeOptions)
+ .setAmortizationTypeOptions(acc.amortizationTypeOptions).setInterestTypeOptions(acc.interestTypeOptions)
+ .setInterestCalculationPeriodTypeOptions(acc.interestCalculationPeriodTypeOptions).setFundOptions(acc.fundOptions)
+ .setChargeOptions(acc.chargeOptions).setLoanOfficerOptions(acc.loanOfficerOptions)
+ .setLoanPurposeOptions(acc.loanPurposeOptions).setLoanCollateralOptions(acc.loanCollateralOptions)
+ .setCalendarOptions(acc.calendarOptions).setSyncDisbursementWithMeeting(acc.syncDisbursementWithMeeting)
+ .setLoanCounter(acc.loanCounter).setLoanProductCounter(acc.loanProductCounter).setNotes(acc.notes)
+ .setAccountLinkingOptions(acc.accountLinkingOptions).setLinkedAccount(acc.linkedAccount)
+ .setDisbursementDetails(acc.disbursementDetails).setMultiDisburseLoan(acc.multiDisburseLoan)
+ .setCanDefineInstallmentAmount(acc.canDefineInstallmentAmount).setFixedEmiAmount(acc.fixedEmiAmount)
+ .setMaxOutstandingLoanBalance(acc.maxOutstandingLoanBalance).setEmiAmountVariations(acc.emiAmountVariations)
+ .setMemberVariations(acc.memberVariations).setProduct(acc.product).setInArrears(acc.inArrears)
+ .setGraceOnArrearsAgeing(acc.graceOnArrearsAgeing).setOverdueCharges(acc.overdueCharges).setIsNPA(acc.isNPA)
+ .setDaysInMonthType(acc.daysInMonthType).setDaysInYearType(acc.daysInYearType)
+ .setInterestRecalculationEnabled(acc.isInterestRecalculationEnabled)
+ .setInterestRecalculationData(acc.interestRecalculationData).setOriginalSchedule(acc.originalSchedule)
+ .setCreateStandingInstructionAtDisbursement(acc.createStandingInstructionAtDisbursement).setPaidInAdvance(acc.paidInAdvance)
+ .setInterestRatesPeriods(acc.interestRatesPeriods).setIsVariableInstallmentsAllowed(acc.isVariableInstallmentsAllowed)
+ .setMinimumGap(acc.minimumGap).setMaximumGap(acc.maximumGap).setSubStatus(acc.subStatus)
+ .setCanUseForTopup(acc.canUseForTopup).setClientActiveLoanOptions(acc.clientActiveLoanOptions).setTopup(acc.isTopup)
+ .setClosureLoanId(acc.closureLoanId).setClosureLoanAccountNo(acc.closureLoanAccountNo).setTopupAmount(acc.topupAmount)
+ .setIsEqualAmortization(acc.isEqualAmortization).setRates(acc.rates).setIsRatesEnabled(acc.isRatesEnabled)
+ .setFixedPrincipalPercentagePerInstallment(acc.fixedPrincipalPercentagePerInstallment).setDelinquent(acc.delinquent)
+ .setDelinquencyRange(acc.delinquencyRange).setDisallowExpectedDisbursements(acc.disallowExpectedDisbursements)
+ .setFraud(acc.fraud);
}
public static LoanAccountData withOriginalSchedule(final LoanAccountData acc, final LoanScheduleData originalSchedule) {
- return new LoanAccountData(acc.id, acc.accountNo, acc.status, acc.externalId, acc.clientId, acc.clientAccountNo, acc.clientName,
- acc.clientOfficeId, acc.clientExternalId, acc.group, acc.loanType, acc.loanProductId, acc.loanProductName,
- acc.loanProductDescription, acc.isLoanProductLinkedToFloatingRate, acc.fundId, acc.fundName, acc.loanPurposeId,
- acc.loanPurposeName, acc.loanOfficerId, acc.loanOfficerName, acc.currency, acc.proposedPrincipal, acc.principal,
- acc.approvedPrincipal, acc.netDisbursalAmount, acc.totalOverpaid, acc.inArrearsTolerance, acc.termFrequency,
- acc.termPeriodFrequencyType, acc.numberOfRepayments, acc.repaymentEvery, acc.repaymentFrequencyType,
- acc.repaymentFrequencyNthDayType, acc.repaymentFrequencyDayOfWeekType, acc.transactionProcessingStrategyId,
- acc.transactionProcessingStrategyName, acc.amortizationType, acc.interestRatePerPeriod, acc.interestRateFrequencyType,
- acc.annualInterestRate, acc.interestType, acc.isFloatingInterestRate, acc.interestRateDifferential,
- acc.interestCalculationPeriodType, acc.allowPartialPeriodInterestCalculation, acc.expectedFirstRepaymentOnDate,
- acc.graceOnPrincipalPayment, acc.recurringMoratoriumOnPrincipalPeriods, acc.graceOnInterestPayment,
- acc.graceOnInterestCharged, acc.interestChargedFromDate, acc.timeline, acc.summary, acc.feeChargesAtDisbursementCharged,
- acc.repaymentSchedule, acc.transactions, acc.charges, acc.collateral, acc.guarantors, acc.meeting, acc.productOptions,
- acc.termFrequencyTypeOptions, acc.repaymentFrequencyTypeOptions, acc.repaymentFrequencyNthDayTypeOptions,
- acc.repaymentFrequencyDaysOfWeekTypeOptions, acc.transactionProcessingStrategyOptions, acc.interestRateFrequencyTypeOptions,
- acc.amortizationTypeOptions, acc.interestTypeOptions, acc.interestCalculationPeriodTypeOptions, acc.fundOptions,
- acc.chargeOptions, null, acc.loanOfficerOptions, acc.loanPurposeOptions, acc.loanCollateralOptions, acc.calendarOptions,
- acc.syncDisbursementWithMeeting, acc.loanCounter, acc.loanProductCounter, acc.notes, acc.accountLinkingOptions,
- acc.linkedAccount, acc.disbursementDetails, acc.multiDisburseLoan, acc.canDefineInstallmentAmount, acc.fixedEmiAmount,
- acc.maxOutstandingLoanBalance, acc.emiAmountVariations, acc.memberVariations, acc.product, acc.inArrears,
- acc.graceOnArrearsAgeing, acc.overdueCharges, acc.isNPA, acc.daysInMonthType, acc.daysInYearType,
- 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.rates, acc.isRatesEnabled,
- acc.fixedPrincipalPercentagePerInstallment, acc.delinquent, acc.delinquencyRange, acc.disallowExpectedDisbursements,
- acc.fraud);
+ return new LoanAccountData().setId(acc.id).setAccountNo(acc.accountNo).setStatus(acc.status).setExternalId(acc.externalId)
+ .setClientId(acc.clientId).setClientAccountNo(acc.clientAccountNo).setClientName(acc.clientName)
+ .setClientOfficeId(acc.clientOfficeId).setClientExternalId(acc.clientExternalId).setGroup(acc.group)
+ .setLoanType(acc.loanType).setLoanProductId(acc.loanProductId).setLoanProductName(acc.loanProductName)
+ .setLoanProductDescription(acc.loanProductDescription)
+ .setLoanProductLinkedToFloatingRate(acc.isLoanProductLinkedToFloatingRate).setFundId(acc.fundId).setFundName(acc.fundName)
+ .setLoanPurposeId(acc.loanPurposeId).setLoanPurposeName(acc.loanPurposeName).setLoanOfficerId(acc.loanOfficerId)
+ .setLoanOfficerName(acc.loanOfficerName).setCurrency(acc.currency).setProposedPrincipal(acc.proposedPrincipal)
+ .setPrincipal(acc.principal).setApprovedPrincipal(acc.approvedPrincipal).setNetDisbursalAmount(acc.netDisbursalAmount)
+ .setTotalOverpaid(acc.totalOverpaid).setInArrearsTolerance(acc.inArrearsTolerance).setTermFrequency(acc.termFrequency)
+ .setTermPeriodFrequencyType(acc.termPeriodFrequencyType).setNumberOfRepayments(acc.numberOfRepayments)
+ .setRepaymentEvery(acc.repaymentEvery).setRepaymentFrequencyType(acc.repaymentFrequencyType)
+ .setRepaymentFrequencyNthDayType(acc.repaymentFrequencyNthDayType)
+ .setRepaymentFrequencyDayOfWeekType(acc.repaymentFrequencyDayOfWeekType)
+ .setTransactionProcessingStrategyCode(acc.transactionProcessingStrategyCode)
+ .setTransactionProcessingStrategyName(acc.transactionProcessingStrategyName).setAmortizationType(acc.amortizationType)
+ .setInterestRatePerPeriod(acc.interestRatePerPeriod).setInterestRateFrequencyType(acc.interestRateFrequencyType)
+ .setAnnualInterestRate(acc.annualInterestRate).setInterestType(acc.interestType)
+ .setFloatingInterestRate(acc.isFloatingInterestRate).setInterestRateDifferential(acc.interestRateDifferential)
+ .setInterestCalculationPeriodType(acc.interestCalculationPeriodType)
+ .setAllowPartialPeriodInterestCalculation(acc.allowPartialPeriodInterestCalculation)
+ .setExpectedFirstRepaymentOnDate(acc.expectedFirstRepaymentOnDate).setGraceOnPrincipalPayment(acc.graceOnPrincipalPayment)
+ .setRecurringMoratoriumOnPrincipalPeriods(acc.recurringMoratoriumOnPrincipalPeriods)
+ .setGraceOnInterestPayment(acc.graceOnInterestPayment).setGraceOnInterestCharged(acc.graceOnInterestCharged)
+ .setInterestChargedFromDate(acc.interestChargedFromDate).setTimeline(acc.timeline).setSummary(acc.summary)
+ .setFeeChargesAtDisbursementCharged(acc.feeChargesAtDisbursementCharged).setRepaymentSchedule(acc.repaymentSchedule)
+ .setTransactions(acc.transactions).setCharges(acc.charges).setCollateral(acc.collateral).setGuarantors(acc.guarantors)
+ .setMeeting(acc.meeting).setProductOptions(acc.productOptions).setTermFrequencyTypeOptions(acc.termFrequencyTypeOptions)
+ .setRepaymentFrequencyTypeOptions(acc.repaymentFrequencyTypeOptions)
+ .setRepaymentFrequencyNthDayTypeOptions(acc.repaymentFrequencyNthDayTypeOptions)
+ .setRepaymentFrequencyDaysOfWeekTypeOptions(acc.repaymentFrequencyDaysOfWeekTypeOptions)
+ .setTransactionProcessingStrategyOptions(acc.transactionProcessingStrategyOptions)
+ .setInterestRateFrequencyTypeOptions(acc.interestRateFrequencyTypeOptions)
+ .setAmortizationTypeOptions(acc.amortizationTypeOptions).setInterestTypeOptions(acc.interestTypeOptions)
+ .setInterestCalculationPeriodTypeOptions(acc.interestCalculationPeriodTypeOptions).setFundOptions(acc.fundOptions)
+ .setChargeOptions(acc.chargeOptions).setLoanOfficerOptions(acc.loanOfficerOptions)
+ .setLoanPurposeOptions(acc.loanPurposeOptions).setLoanCollateralOptions(acc.loanCollateralOptions)
+ .setCalendarOptions(acc.calendarOptions).setSyncDisbursementWithMeeting(acc.syncDisbursementWithMeeting)
+ .setLoanCounter(acc.loanCounter).setLoanProductCounter(acc.loanProductCounter).setNotes(acc.notes)
+ .setAccountLinkingOptions(acc.accountLinkingOptions).setLinkedAccount(acc.linkedAccount)
+ .setDisbursementDetails(acc.disbursementDetails).setMultiDisburseLoan(acc.multiDisburseLoan)
+ .setCanDefineInstallmentAmount(acc.canDefineInstallmentAmount).setFixedEmiAmount(acc.fixedEmiAmount)
+ .setMaxOutstandingLoanBalance(acc.maxOutstandingLoanBalance).setEmiAmountVariations(acc.emiAmountVariations)
+ .setMemberVariations(acc.memberVariations).setProduct(acc.product).setInArrears(acc.inArrears)
+ .setGraceOnArrearsAgeing(acc.graceOnArrearsAgeing).setOverdueCharges(acc.overdueCharges).setIsNPA(acc.isNPA)
+ .setDaysInMonthType(acc.daysInMonthType).setDaysInYearType(acc.daysInYearType)
+ .setInterestRecalculationEnabled(acc.isInterestRecalculationEnabled)
+ .setInterestRecalculationData(acc.interestRecalculationData).setOriginalSchedule(originalSchedule)
+ .setCreateStandingInstructionAtDisbursement(acc.createStandingInstructionAtDisbursement).setPaidInAdvance(acc.paidInAdvance)
+ .setInterestRatesPeriods(acc.interestRatesPeriods).setIsVariableInstallmentsAllowed(acc.isVariableInstallmentsAllowed)
+ .setMinimumGap(acc.minimumGap).setMaximumGap(acc.maximumGap).setSubStatus(acc.subStatus)
+ .setCanUseForTopup(acc.canUseForTopup).setClientActiveLoanOptions(acc.clientActiveLoanOptions).setTopup(acc.isTopup)
+ .setClosureLoanId(acc.closureLoanId).setClosureLoanAccountNo(acc.closureLoanAccountNo).setTopupAmount(acc.topupAmount)
+ .setIsEqualAmortization(acc.isEqualAmortization).setRates(acc.rates).setIsRatesEnabled(acc.isRatesEnabled)
+ .setFixedPrincipalPercentagePerInstallment(acc.fixedPrincipalPercentagePerInstallment).setDelinquent(acc.delinquent)
+ .setDelinquencyRange(acc.delinquencyRange).setDisallowExpectedDisbursements(acc.disallowExpectedDisbursements)
+ .setFraud(acc.fraud);
}
- private LoanAccountData(final Long id, //
- final String accountNo, //
- final LoanStatusEnumData status, //
- final String externalId, //
- final Long clientId, final String clientAccountNo, final String clientName, final Long clientOfficeId,
- final String clientExternalId, //
- final GroupGeneralData group, final EnumOptionData loanType, final Long loanProductId, final String loanProductName,
- final String loanProductDescription, //
- final boolean isLoanProductLinkedToFloatingRate, final Long fundId, final String fundName, final Long loanPurposeId,
- final String loanPurposeName, //
- final Long loanOfficerId, final String loanOfficerName, //
- final CurrencyData currency, BigDecimal proposedPrincipal, final BigDecimal principal, final BigDecimal approvedPrincipal,
- final BigDecimal netDisbursalAmount, final BigDecimal totalOverpaid, //
- final BigDecimal inArrearsTolerance, final Integer termFrequency, //
- final EnumOptionData termPeriodFrequencyType, final Integer numberOfRepayments, final Integer repaymentEvery,
- final EnumOptionData repaymentFrequencyType, //
- final EnumOptionData repaymentFrequencyNthDayType, final EnumOptionData repaymentFrequencyDayOfWeekType,
- final Long transactionProcessingStrategyId, final String transactionProcessingStrategyName,
- final EnumOptionData amortizationType, final BigDecimal interestRatePerPeriod, final EnumOptionData interestRateFrequencyType,
- final BigDecimal annualInterestRate, final EnumOptionData interestType, final boolean isFloatingInterestRate,
- final BigDecimal interestRateDifferential, final EnumOptionData interestCalculationPeriodType,
- final Boolean allowPartialPeriodInterestCalculation, final LocalDate expectedFirstRepaymentOnDate,
- final Integer graceOnPrincipalPayment, final Integer recurringMoratoriumOnPrincipalPeriods,
- final Integer graceOnInterestPayment, final Integer graceOnInterestCharged, final LocalDate interestChargedFromDate,
- final LoanApplicationTimelineData timeline, final LoanSummaryData summary, final BigDecimal feeChargesDueAtDisbursementCharged,
- final LoanScheduleData repaymentSchedule, final Collection transactions,
- final Collection charges, final Collection collateral,
- final Collection guarantors, final CalendarData meeting, final Collection productOptions,
- final Collection termFrequencyTypeOptions, final Collection repaymentFrequencyTypeOptions,
- final Collection repaymentFrequencyNthDayTypeOptions,
- final Collection