Skip to content

Commit a3fb836

Browse files
Jose Alberto Hernandezadamsaghy
Jose Alberto Hernandez
authored andcommitted
FINERACT-1932: Fineract modularization - fineract-charge
1 parent e13a9cb commit a3fb836

File tree

53 files changed

+306
-8
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+306
-8
lines changed

build.gradle

+2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ buildscript {
3333
'fineract-branch',
3434
'fineract-document',
3535
'fineract-investor',
36+
'fineract-charge',
3637
'fineract-rates',
3738
'fineract-loan',
3839
'fineract-savings',
@@ -54,6 +55,7 @@ buildscript {
5455
'fineract-accounting',
5556
'fineract-provider',
5657
'fineract-investor',
58+
'fineract-charge',
5759
'fineract-rates',
5860
'fineract-loan',
5961
'fineract-savings',

fineract-accounting/dependencies.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ dependencies {
2525
// implementation dependencies are directly used (compiled against) in src/main (and src/test)
2626
//
2727
implementation(project(path: ':fineract-core'))
28+
implementation(project(path: ':fineract-charge'))
2829
implementation('org.apache.avro:avro')
2930
implementation(
3031
project(path: ':fineract-avro-schemas')

fineract-accounting/src/main/resources/jpa/accounting/persistence.xml

+2-1
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,14 @@
3535
<class>org.apache.fineract.infrastructure.codes.domain.CodeValue</class>
3636
<class>org.apache.fineract.infrastructure.core.domain.AbstractPersistableCustom</class>
3737
<class>org.apache.fineract.organisation.office.domain.Office</class>
38-
<class>org.apache.fineract.portfolio.charge.domain.Charge</class>
3938
<class>org.apache.fineract.portfolio.paymenttype.domain.PaymentType</class>
4039
<class>org.apache.fineract.portfolio.paymentdetail.domain.PaymentDetail</class>
4140
<class>org.apache.fineract.portfolio.tax.domain.TaxComponent</class>
4241
<class>org.apache.fineract.portfolio.tax.domain.TaxComponentHistory</class>
4342
<class>org.apache.fineract.portfolio.tax.domain.TaxGroup</class>
4443
<class>org.apache.fineract.portfolio.tax.domain.TaxGroupMappings</class>
44+
<!-- Fineract Charge module -->
45+
<class>org.apache.fineract.portfolio.charge.domain.Charge</class>
4546
<exclude-unlisted-classes>false</exclude-unlisted-classes>
4647
<properties>
4748
<property name="eclipselink.weaving" value="static" />

fineract-branch/src/main/resources/jpa/branch/persistence.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
<!-- You can find the runtime configuration in the JPAConfig class -->
3030
<persistence-unit name="jpa-pu" transaction-type="RESOURCE_LOCAL">
3131
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
32-
<!-- Fineract core module -->
3332
<class>org.apache.fineract.accounting.glaccount.domain.GLAccount</class>
3433
<class>org.apache.fineract.accounting.journalentry.domain.JournalEntry</class>
3534
<class>org.apache.fineract.infrastructure.core.domain.AbstractPersistableCustom</class>
@@ -53,7 +52,6 @@
5352
<class>org.apache.fineract.portfolio.fund.domain.Fund</class>
5453
<class>org.apache.fineract.portfolio.delinquency.domain.DelinquencyBucket</class>
5554
<class>org.apache.fineract.portfolio.delinquency.domain.DelinquencyRange</class>
56-
<class>org.apache.fineract.portfolio.charge.domain.Charge</class>
5755
<class>org.apache.fineract.portfolio.paymenttype.domain.PaymentType</class>
5856
<class>org.apache.fineract.portfolio.paymentdetail.domain.PaymentDetail</class>
5957
<class>org.apache.fineract.portfolio.tax.domain.TaxGroup</class>
@@ -69,6 +67,8 @@
6967
<class>org.apache.fineract.useradministration.domain.Role</class>
7068
<class>org.apache.fineract.useradministration.domain.Permission</class>
7169
<class>org.apache.fineract.useradministration.domain.AppUserClientMapping</class>
70+
<!-- Fineract core module -->
71+
<class>org.apache.fineract.portfolio.charge.domain.Charge</class>
7272
<exclude-unlisted-classes>false</exclude-unlisted-classes>
7373
<properties>
7474
<property name="eclipselink.weaving" value="static" />

fineract-charge/build.gradle

+106
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
/**
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
description = 'Fineract Charge'
20+
21+
apply plugin: 'java'
22+
apply plugin: 'eclipse'
23+
24+
compileJava.doLast {
25+
def mainSS = sourceSets.main
26+
def source = mainSS.java.classesDirectory.get()
27+
copy {
28+
from file("src/main/resources/jpa/charge/persistence.xml")
29+
into "${source}/META-INF/"
30+
}
31+
javaexec {
32+
description = 'Performs EclipseLink static weaving of entity classes'
33+
def target = source
34+
main 'org.eclipse.persistence.tools.weaving.jpa.StaticWeave'
35+
args '-persistenceinfo', source, source, target
36+
classpath sourceSets.main.runtimeClasspath
37+
}
38+
delete {
39+
delete "${source}/META-INF/persistence.xml"
40+
}
41+
}
42+
43+
// Configuration for Swagger documentation generation task
44+
// https://github.com/swagger-api/swagger-core/tree/master/modules/swagger-gradle-plugin
45+
import org.apache.tools.ant.filters.ReplaceTokens
46+
47+
48+
49+
configurations {
50+
providedRuntime // needed for Spring Boot executable WAR
51+
providedCompile
52+
compile() {
53+
exclude module: 'hibernate-entitymanager'
54+
exclude module: 'hibernate-validator'
55+
exclude module: 'activation'
56+
exclude module: 'bcmail-jdk14'
57+
exclude module: 'bcprov-jdk14'
58+
exclude module: 'bctsp-jdk14'
59+
exclude module: 'c3p0'
60+
exclude module: 'stax-api'
61+
exclude module: 'jaxb-api'
62+
exclude module: 'jaxb-impl'
63+
exclude module: 'jboss-logging'
64+
exclude module: 'itext-rtf'
65+
exclude module: 'classworlds'
66+
}
67+
runtime
68+
}
69+
70+
apply from: 'dependencies.gradle'
71+
72+
// Configuration for the modernizer plugin
73+
// https://github.com/andygoossens/gradle-modernizer-plugin
74+
modernizer {
75+
ignoreClassNamePatterns = [
76+
'.*AbstractPersistableCustom',
77+
'.*EntityTables',
78+
'.*domain.*'
79+
]
80+
}
81+
82+
// If we are running Gradle within Eclipse to enhance classes with OpenJPA,
83+
// set the classes directory to point to Eclipse's default build directory
84+
if (project.hasProperty('env') && project.getProperty('env') == 'eclipse') {
85+
sourceSets.main.java.outputDir = new File(rootProject.projectDir, "fineract-charge/bin/main")
86+
}
87+
88+
eclipse {
89+
project {
90+
buildCommand([ LaunchConfigHandle: "<project>/.externalToolBuilders/OpenJPA Enhance Builder.launch" ], 'org.eclipse.ui.externaltools.ExternalToolBuilder')
91+
}
92+
}
93+
94+
/* http://stackoverflow.com/questions/19653311/jpa-repository-works-in-idea-and-production-but-not-in-gradle */
95+
sourceSets.main.output.resourcesDir = sourceSets.main.java.classesDirectory
96+
sourceSets.test.output.resourcesDir = sourceSets.test.java.classesDirectory
97+
98+
if (!(project.hasProperty('env') && project.getProperty('env') == 'dev')) {
99+
sourceSets {
100+
test {
101+
java {
102+
exclude '**/core/boot/tests/**'
103+
}
104+
}
105+
}
106+
}

fineract-charge/dependencies.gradle

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
/**
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
dependencies {
21+
// Never use "compile" scope, but make all dependencies either 'implementation', 'runtimeOnly' or 'testCompile'.
22+
// Note that we never use 'api', because Fineract at least currently is a simple monolithic application ("WAR"), not a library.
23+
// We also (normally should have) no need to ever use 'compileOnly'.
24+
25+
// implementation dependencies are directly used (compiled against) in src/main (and src/test)
26+
//
27+
implementation(project(path: ':fineract-core'))
28+
29+
implementation(
30+
'org.springframework.boot:spring-boot-starter-web',
31+
'org.springframework.boot:spring-boot-starter-security',
32+
'jakarta.ws.rs:jakarta.ws.rs-api',
33+
'org.glassfish.jersey.media:jersey-media-multipart',
34+
35+
'com.google.guava:guava',
36+
'com.google.code.gson:gson',
37+
38+
'org.apache.commons:commons-lang3',
39+
40+
'com.jayway.jsonpath:json-path',
41+
42+
'com.github.spotbugs:spotbugs-annotations',
43+
'io.swagger.core.v3:swagger-annotations-jakarta',
44+
45+
'com.squareup.retrofit2:converter-gson',
46+
47+
'org.springdoc:springdoc-openapi-starter-webmvc-ui',
48+
'org.mapstruct:mapstruct',
49+
50+
'io.github.resilience4j:resilience4j-spring-boot3',
51+
'org.apache.httpcomponents:httpcore',
52+
)
53+
compileOnly 'org.projectlombok:lombok'
54+
annotationProcessor 'org.projectlombok:lombok'
55+
annotationProcessor 'org.mapstruct:mapstruct-processor'
56+
implementation ('org.springframework.boot:spring-boot-starter-data-jpa') {
57+
exclude group: 'org.hibernate'
58+
}
59+
implementation('org.eclipse.persistence:org.eclipse.persistence.jpa') {
60+
exclude group: 'org.eclipse.persistence', module: 'jakarta.persistence'
61+
}
62+
// testCompile dependencies are ONLY used in src/test, not src/main.
63+
// Do NOT repeat dependencies which are ALREADY in implementation or runtimeOnly!
64+
//
65+
testImplementation( 'io.github.classgraph:classgraph' )
66+
testImplementation ('org.springframework.boot:spring-boot-starter-test') {
67+
exclude group: 'com.jayway.jsonpath', module: 'json-path'
68+
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
69+
exclude group: 'jakarta.activation'
70+
exclude group: 'javax.activation'
71+
exclude group: 'org.skyscreamer'
72+
}
73+
testImplementation ('org.mockito:mockito-inline')
74+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
4+
Licensed to the Apache Software Foundation (ASF) under one
5+
or more contributor license agreements. See the NOTICE file
6+
distributed with this work for additional information
7+
regarding copyright ownership. The ASF licenses this file
8+
to you under the Apache License, Version 2.0 (the
9+
"License"); you may not use this file except in compliance
10+
with the License. You may obtain a copy of the License at
11+
12+
http://www.apache.org/licenses/LICENSE-2.0
13+
14+
Unless required by applicable law or agreed to in writing,
15+
software distributed under the License is distributed on an
16+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17+
KIND, either express or implied. See the License for the
18+
specific language governing permissions and limitations
19+
under the License.
20+
21+
-->
22+
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
23+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
24+
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.1.xsd">
25+
<!-- Sequence is starting from 6000 to make it easier to move existing liquibase changesets here -->
26+
</databaseChangeLog>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
4+
Licensed to the Apache Software Foundation (ASF) under one
5+
or more contributor license agreements. See the NOTICE file
6+
distributed with this work for additional information
7+
regarding copyright ownership. The ASF licenses this file
8+
to you under the Apache License, Version 2.0 (the
9+
"License"); you may not use this file except in compliance
10+
with the License. You may obtain a copy of the License at
11+
12+
http://www.apache.org/licenses/LICENSE-2.0
13+
14+
Unless required by applicable law or agreed to in writing,
15+
software distributed under the License is distributed on an
16+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17+
KIND, either express or implied. See the License for the
18+
specific language governing permissions and limitations
19+
under the License.
20+
21+
-->
22+
23+
24+
<persistence version="2.0"
25+
xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
26+
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
27+
28+
<!-- This file is only used for static weaving, nothing more. -->
29+
<!-- You can find the runtime configuration in the JPAConfig class -->
30+
<persistence-unit name="jpa-pu" transaction-type="RESOURCE_LOCAL">
31+
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
32+
<!-- Fineract core module -->
33+
<class>org.apache.fineract.accounting.glaccount.domain.GLAccount</class>
34+
<class>org.apache.fineract.accounting.journalentry.domain.JournalEntry</class>
35+
<class>org.apache.fineract.infrastructure.core.domain.AbstractPersistableCustom</class>
36+
<class>org.apache.fineract.infrastructure.core.domain.AbstractAuditableWithUTCDateTimeCustom</class>
37+
<class>org.apache.fineract.infrastructure.codes.domain.Code</class>
38+
<class>org.apache.fineract.infrastructure.codes.domain.CodeValue</class>
39+
<class>org.apache.fineract.infrastructure.documentmanagement.domain.Image</class>
40+
<class>org.apache.fineract.organisation.staff.domain.Staff</class>
41+
<class>org.apache.fineract.organisation.office.domain.Office</class>
42+
<class>org.apache.fineract.organisation.office.domain.OrganisationCurrency</class>
43+
<class>org.apache.fineract.organisation.monetary.domain.ApplicationCurrency</class>
44+
<class>org.apache.fineract.organisation.holiday.domain.Holiday</class>
45+
<class>org.apache.fineract.organisation.workingdays.domain.WorkingDays</class>
46+
<class>org.apache.fineract.portfolio.group.domain.Group</class>
47+
<class>org.apache.fineract.portfolio.group.domain.GroupLevel</class>
48+
<class>org.apache.fineract.portfolio.group.domain.StaffAssignmentHistory</class>
49+
<class>org.apache.fineract.portfolio.group.domain.GroupRole</class>
50+
<class>org.apache.fineract.portfolio.client.domain.Client</class>
51+
<class>org.apache.fineract.portfolio.client.domain.ClientIdentifier</class>
52+
<class>org.apache.fineract.portfolio.rate.domain.Rate</class>
53+
<class>org.apache.fineract.portfolio.fund.domain.Fund</class>
54+
<class>org.apache.fineract.portfolio.delinquency.domain.DelinquencyBucket</class>
55+
<class>org.apache.fineract.portfolio.delinquency.domain.DelinquencyRange</class>
56+
<class>org.apache.fineract.portfolio.paymenttype.domain.PaymentType</class>
57+
<class>org.apache.fineract.portfolio.paymentdetail.domain.PaymentDetail</class>
58+
<class>org.apache.fineract.portfolio.tax.domain.TaxGroup</class>
59+
<class>org.apache.fineract.portfolio.tax.domain.TaxGroupMappings</class>
60+
<class>org.apache.fineract.portfolio.tax.domain.TaxComponent</class>
61+
<class>org.apache.fineract.portfolio.tax.domain.TaxComponentHistory</class>
62+
<class>org.apache.fineract.portfolio.floatingrates.domain.FloatingRate</class>
63+
<class>org.apache.fineract.portfolio.floatingrates.domain.FloatingRatePeriod</class>
64+
<class>org.apache.fineract.portfolio.calendar.domain.Calendar</class>
65+
<class>org.apache.fineract.portfolio.calendar.domain.CalendarHistory</class>
66+
<class>org.apache.fineract.portfolio.calendar.domain.CalendarInstance</class>
67+
<class>org.apache.fineract.useradministration.domain.AppUser</class>
68+
<class>org.apache.fineract.useradministration.domain.Role</class>
69+
<class>org.apache.fineract.useradministration.domain.Permission</class>
70+
<class>org.apache.fineract.useradministration.domain.AppUserClientMapping</class>
71+
<exclude-unlisted-classes>false</exclude-unlisted-classes>
72+
<properties>
73+
<property name="eclipselink.weaving" value="static" />
74+
</properties>
75+
</persistence-unit>
76+
</persistence>

fineract-document/src/main/resources/jpa/document/persistence.xml

+2-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
<class>org.apache.fineract.portfolio.client.domain.Client</class>
5151
<class>org.apache.fineract.portfolio.client.domain.ClientIdentifier</class>
5252
<class>org.apache.fineract.portfolio.fund.domain.Fund</class>
53-
<class>org.apache.fineract.portfolio.charge.domain.Charge</class>
5453
<class>org.apache.fineract.portfolio.paymenttype.domain.PaymentType</class>
5554
<class>org.apache.fineract.portfolio.paymentdetail.domain.PaymentDetail</class>
5655
<class>org.apache.fineract.portfolio.tax.domain.TaxGroup</class>
@@ -64,6 +63,8 @@
6463
<class>org.apache.fineract.useradministration.domain.Role</class>
6564
<class>org.apache.fineract.useradministration.domain.Permission</class>
6665
<class>org.apache.fineract.useradministration.domain.AppUserClientMapping</class>
66+
<!-- Fineract Charge module -->
67+
<class>org.apache.fineract.portfolio.charge.domain.Charge</class>
6768
<exclude-unlisted-classes>false</exclude-unlisted-classes>
6869
<properties>
6970
<property name="eclipselink.weaving" value="static" />

fineract-investor/dependencies.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ dependencies {
2626
//
2727
implementation(project(path: ':fineract-core'))
2828
implementation(project(path: ':fineract-accounting'))
29+
implementation(project(path: ':fineract-charge'))
2930
implementation(project(path: ':fineract-loan'))
3031
implementation('org.apache.avro:avro')
3132
implementation(

fineract-loan/dependencies.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ dependencies {
2626
//
2727
implementation(project(path: ':fineract-core'))
2828
implementation(project(path: ':fineract-accounting'))
29+
implementation(project(path: ':fineract-charge'))
2930
implementation(project(path: ':fineract-rates'))
3031

3132
implementation(

0 commit comments

Comments
 (0)