FINERACT-1932: Add loan module (WIP)

This commit is contained in:
Adam Saghy
2023-05-25 17:57:28 +02:00
parent 105b4ed154
commit 2e3b96df19
352 changed files with 938 additions and 413 deletions
+3 -1
View File
@@ -30,6 +30,7 @@ buildscript {
'fineract-core',
'fineract-provider',
'fineract-investor',
'fineract-loan',
'integration-tests',
'twofactor-tests',
'oauth2-tests',
@@ -42,7 +43,8 @@ buildscript {
'fineract-avro-schemas',
'fineract-client',
'fineract-provider',
'fineract-investor'
'fineract-investor',
'fineract-loan'
].contains(it.name)
}
npmRepository = 'https://npm.pkg.github.com'
@@ -19,6 +19,7 @@
dependencies {
implementation(project(':fineract-core'))
implementation(project(':fineract-loan'))
implementation(project(':fineract-provider'))
implementation('org.springframework.boot:spring-boot-starter-data-jpa')
}
+1
View File
@@ -19,6 +19,7 @@
dependencies {
implementation(project(':fineract-core'))
implementation(project(':fineract-loan'))
implementation(project(':fineract-provider'))
implementation('org.springframework.boot:spring-boot-starter-data-jpa')
}
+1
View File
@@ -19,6 +19,7 @@
dependencies {
implementation(project(':fineract-core'))
implementation(project(':fineract-loan'))
implementation(project(':fineract-provider'))
implementation('org.springframework.batch:spring-batch-integration')
implementation('org.springframework.boot:spring-boot-starter-data-jpa')
@@ -19,5 +19,6 @@
dependencies {
implementation(project(':fineract-core'))
implementation(project(':fineract-loan'))
implementation(project(':fineract-provider'))
}
@@ -19,6 +19,7 @@
dependencies {
implementation(project(':fineract-core'))
implementation(project(':fineract-loan'))
implementation(project(':fineract-provider'))
implementation(project(':custom:acme:loan:cob'))
implementation(project(':custom:acme:loan:processor'))
+19
View File
@@ -22,6 +22,25 @@ apply plugin: 'java'
apply plugin: 'eclipse'
check.dependsOn('cucumber')
compileJava.doLast {
def mainSS = sourceSets.main
def source = mainSS.java.classesDirectory.get()
copy {
from file("src/main/resources/jpa/core/persistence.xml")
into "${source}/META-INF/"
}
javaexec {
description = 'Performs EclipseLink static weaving of entity classes'
def target = source
main 'org.eclipse.persistence.tools.weaving.jpa.StaticWeave'
args '-persistenceinfo', source, '-classpath', sourceSets.main.runtimeClasspath, source, target
classpath sourceSets.main.runtimeClasspath
}
delete {
delete "${source}/META-INF/persistence.xml"
}
}
configurations {
providedRuntime // needed for Spring Boot executable WAR
providedCompile
@@ -20,7 +20,6 @@ package org.apache.fineract.portfolio.charge.data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.MonthDay;
import java.util.Collection;
import java.util.List;
@@ -28,13 +27,9 @@ import java.util.Map;
import lombok.Getter;
import org.apache.fineract.accounting.glaccount.data.GLAccountData;
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
import org.apache.fineract.infrastructure.core.domain.ExternalId;
import org.apache.fineract.organisation.monetary.data.CurrencyData;
import org.apache.fineract.portfolio.charge.domain.ChargeTimeType;
import org.apache.fineract.portfolio.loanaccount.data.LoanChargeData;
import org.apache.fineract.portfolio.paymenttype.data.PaymentTypeData;
import org.apache.fineract.portfolio.savings.data.SavingsAccountChargeData;
import org.apache.fineract.portfolio.shareaccounts.data.ShareAccountChargeData;
import org.apache.fineract.portfolio.tax.data.TaxGroupData;
/**
@@ -301,62 +296,6 @@ public final class ChargeData implements Comparable<ChargeData>, Serializable {
return obj.id.compareTo(this.id);
}
public LoanChargeData toLoanChargeData() {
BigDecimal percentage = null;
if (this.chargeCalculationType.getId() == 2) {
percentage = this.amount;
}
return LoanChargeData.newLoanChargeDetails(this.id, this.name, this.currency, this.amount, percentage, this.chargeTimeType,
this.chargeCalculationType, this.penalty, this.chargePaymentMode, this.minCap, this.maxCap, ExternalId.empty());
}
public SavingsAccountChargeData toSavingsAccountChargeData() {
final Long savingsChargeId = null;
final Long savingsAccountId = null;
final BigDecimal amountPaid = BigDecimal.ZERO;
final BigDecimal amountWaived = BigDecimal.ZERO;
final BigDecimal amountWrittenOff = BigDecimal.ZERO;
final BigDecimal amountOutstanding = BigDecimal.ZERO;
final BigDecimal percentage = BigDecimal.ZERO;
final BigDecimal amountPercentageAppliedTo = BigDecimal.ZERO;
final Collection<ChargeData> chargeOptions = null;
final LocalDate dueAsOfDate = null;
final Boolean isActive = null;
final Boolean isFreeWithdrawal = null;
final Integer freeWithdrawalChargeFrequency = null;
final Integer restartFrequency = null;
final Integer restartFrequencyEnum = null;
final LocalDate inactivationDate = null;
return SavingsAccountChargeData.instance(savingsChargeId, this.id, savingsAccountId, this.name, this.currency, this.amount,
amountPaid, amountWaived, amountWrittenOff, amountOutstanding, this.chargeTimeType, dueAsOfDate, this.chargeCalculationType,
percentage, amountPercentageAppliedTo, chargeOptions, this.penalty, this.feeOnMonthDay, this.feeInterval, isActive,
isFreeWithdrawal, freeWithdrawalChargeFrequency, restartFrequency, restartFrequencyEnum, inactivationDate);
}
public ShareAccountChargeData toShareAccountChargeData() {
final Long shareChargeId = null;
final Long shareAccountId = null;
final BigDecimal amountPaid = BigDecimal.ZERO;
final BigDecimal amountWaived = BigDecimal.ZERO;
final BigDecimal amountWrittenOff = BigDecimal.ZERO;
final BigDecimal amountOutstanding = BigDecimal.ZERO;
final BigDecimal percentage = BigDecimal.ZERO;
final BigDecimal amountPercentageAppliedTo = BigDecimal.ZERO;
final Collection<ChargeData> chargeOptions = null;
final Boolean isActive = null;
final BigDecimal chargeAmountOrPercentage = BigDecimal.ZERO;
return new ShareAccountChargeData(shareChargeId, this.id, shareAccountId, this.name, this.currency, this.amount, amountPaid,
amountWaived, amountWrittenOff, amountOutstanding, this.chargeTimeType, this.chargeCalculationType, percentage,
amountPercentageAppliedTo, chargeOptions, isActive, chargeAmountOrPercentage);
}
public boolean isOverdueInstallmentCharge() {
boolean isOverdueInstallmentCharge = false;
if (this.chargeTimeType != null) {

Some files were not shown because too many files have changed in this diff Show More