FINERACT-1783: Customizeable LoanRepaymentScheduleTransactionProcessor

This commit is contained in:
Aleksandar Vidakovic
2022-11-01 14:08:02 +01:00
committed by Aleksandar Vidakovic
parent f2756b25bb
commit fc895fce05
99 changed files with 2015 additions and 2547 deletions
+2 -2
View File
@@ -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'
@@ -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;
}
}
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.1.xsd">
<changeSet author="acme" id="1">
<insert tableName="m_batch_business_steps">
<column name="job_name" value="LOAN_CLOSE_OF_BUSINESS"/>
<column name="step_name" value="ACME_LOAN_NOOP"/>
<column name="step_order" value="5"/>
</insert>
</changeSet>
</databaseChangeLog>
+25
View File
@@ -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'
@@ -0,0 +1,22 @@
/**
* 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.
*/
dependencies {
implementation(project(':fineract-provider'))
}
@@ -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;
}
}
+2 -2
View File
@@ -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'
@@ -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')
@@ -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<LoanRepaymentScheduleTransactionProcessor> processors) {
return new LoanRepaymentScheduleTransactionProcessorFactory(defaultLoanRepaymentScheduleTransactionProcessor, processors);
}
}
+1 -1
View File
@@ -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')