Skip to content

Commit bb46397

Browse files
VictorPavfuriousvidakovic
authored andcommitted
FINERACT-2238: New command processing - Business Date Management (org.apache.fineract.infrastructure.businessdate)
1 parent d5958f3 commit bb46397

File tree

81 files changed

+1382
-1096
lines changed

Some content is hidden

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

81 files changed

+1382
-1096
lines changed

build.gradle

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ buildscript {
2828
[
2929
'fineract-api',
3030
'fineract-core',
31+
'fineract-validation',
3132
'fineract-command',
3233
'fineract-accounting',
3334
'fineract-provider',
@@ -57,6 +58,7 @@ buildscript {
5758
'fineract-api',
5859
'fineract-client',
5960
'fineract-core',
61+
'fineract-validation',
6062
'fineract-command',
6163
'fineract-accounting',
6264
'fineract-provider',
@@ -159,6 +161,10 @@ allprojects {
159161
}
160162

161163
configurations {
164+
implementation {
165+
exclude group: 'commons-logging', module: 'commons-logging'
166+
}
167+
162168
api {
163169
canBeResolved = true
164170
}
@@ -370,8 +376,18 @@ configure(project.fineractJavaProjects) {
370376
withJavadocJar()
371377
}
372378

373-
tasks.withType(ProcessResources) {
374-
destinationDir = layout.buildDirectory.dir('classes/java/main').get().asFile
379+
// TODO: we are forcing Gradle to do something it shouldn't! This effects Gradle caching AND breaks Liquibase!
380+
// tasks.withType(ProcessResources) {
381+
// destinationDir = layout.buildDirectory.dir('classes/java/main').get().asFile
382+
// }
383+
384+
processResources {
385+
destinationDir = file("${buildDir}/resources/main")
386+
387+
doLast {
388+
delete fileTree(dir: "${buildDir}/classes/java/main/db")
389+
delete fileTree(dir: "${buildDir}/classes/java/main/META-INF")
390+
}
375391
}
376392

377393
// Add performance optimizations

buildSrc/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import static org.slf4j.LoggerFactory.*
2121

2222
plugins {
23-
id 'io.spring.dependency-management' version '1.1.6'
23+
id 'io.spring.dependency-management' version '1.1.7'
2424
id 'groovy'
2525
id 'java-gradle-plugin'
2626
id 'groovy-gradle-plugin'

buildSrc/src/main/groovy/org.apache.fineract.dependencies.gradle

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ dependencyManagement {
3838
mavenBom 'software.amazon.awssdk:bom:2.29.9'
3939
mavenBom 'io.github.resilience4j:resilience4j-bom:2.2.0'
4040
mavenBom 'org.testcontainers:testcontainers-bom:1.20.4'
41+
mavenBom 'org.glassfish.jersey:jersey-bom:3.1.10'
4142
}
4243

4344
dependencies {
@@ -51,7 +52,6 @@ dependencyManagement {
5152
dependency 'ch.qos.logback.contrib:logback-jackson:0.1.5'
5253
dependency 'org.codehaus.janino:janino:3.1.12'
5354

54-
5555
dependency 'org.eclipse.persistence:org.eclipse.persistence.jpa:4.0.2'
5656
dependency 'com.google.guava:guava:33.1.0-jre'
5757
dependency 'com.google.code.gson:gson:2.11.0'
@@ -76,8 +76,13 @@ dependencyManagement {
7676
dependency 'org.ehcache:ehcache:3.10.8'
7777
dependency 'com.github.spullara.mustache.java:compiler:0.9.14'
7878
dependency 'com.jayway.jsonpath:json-path:2.9.0'
79-
dependency 'org.apache.tika:tika-core:2.9.3'
80-
dependency ('org.apache.tika:tika-parser-microsoft-module:2.9.3') {
79+
dependency ('org.apache.tika:tika-core:2.9.3') {
80+
exclude 'commons-logging:commons-logging'
81+
}
82+
dependency ('org.apache.tika:tika-core:2.9.3') {
83+
exclude 'commons-logging:commons-logging'
84+
}
85+
dependency ('org.apache.tika:tika-parser-miscoffice-module:2.9.3') {
8186
exclude 'org.bouncycastle:bcprov-jdk15on'
8287
exclude 'org.bouncycastle:bcmail-jdk15on'
8388
exclude 'org.bouncycastle:bcprov-jdk18on'
@@ -94,7 +99,7 @@ dependencyManagement {
9499
exclude 'org.apache.commons:commons-compress'
95100
exclude 'xml-apis:xml-apis'
96101
}
97-
dependency ('org.apache.tika:tika-parser-miscoffice-module:2.9.3') {
102+
dependency ('org.apache.tika:tika-parser-microsoft-module:2.9.3') {
98103
exclude 'org.bouncycastle:bcprov-jdk15on'
99104
exclude 'org.bouncycastle:bcmail-jdk15on'
100105
exclude 'org.bouncycastle:bcprov-jdk18on'
@@ -117,7 +122,6 @@ dependencyManagement {
117122
dependency 'jakarta.management.j2ee:jakarta.management.j2ee-api:1.1.4'
118123
dependency 'jakarta.jms:jakarta.jms-api:3.1.0'
119124
dependency 'jakarta.ws.rs:jakarta.ws.rs-api:3.1.0'
120-
dependency 'org.glassfish.jersey.media:jersey-media-multipart:3.1.10'
121125
dependency 'org.glassfish.jaxb:jaxb-runtime:2.3.6' // Swagger needs exactly this version
122126
dependency 'org.apache.bval:org.apache.bval.bundle:3.0.2'
123127
dependency 'joda-time:joda-time:2.13.1'
@@ -195,6 +199,8 @@ dependencyManagement {
195199
dependency ('jakarta.xml.bind:jakarta.xml.bind-api:4.0.2') {
196200
exclude 'jakarta.activation:jakarta.activation-api'
197201
}
202+
dependency 'jakarta.validation:jakarta.validation-api:3.1.1'
203+
dependency 'org.hibernate.validator:hibernate-validator:8.0.2.Final'
198204

199205
dependency ('org.liquibase:liquibase-core:4.31.1') {
200206
exclude 'javax.xml.bind:jaxb-api'
@@ -243,6 +249,7 @@ dependencyManagement {
243249
dependency 'org.assertj:assertj-core:3.26.3'
244250

245251
dependency 'org.apache.commons:commons-math3:3.6.1'
252+
dependency 'commons-beanutils:commons-beanutils:1.11.0'
246253

247254
dependency 'org.mockito:mockito-inline:5.2.0'
248255

fineract-command/dependencies.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ dependencies {
3838
'com.github.spotbugs:spotbugs-annotations',
3939
'org.mapstruct:mapstruct',
4040
'com.lmax:disruptor',
41-
'com.ibm.icu:icu4j',
42-
'org.yakworks:spring-icu4j',
4341
)
4442
implementation('org.eclipse.persistence:org.eclipse.persistence.jpa') {
4543
exclude group: 'org.eclipse.persistence', module: 'jakarta.persistence'
@@ -62,6 +60,7 @@ dependencies {
6260
exclude group: 'org.skyscreamer'
6361
}
6462
testImplementation (
63+
project(':fineract-validation'),
6564
'org.springframework.boot:spring-boot-starter-web',
6665
'org.mockito:mockito-inline',
6766
'org.openjdk.jmh:jmh-core',

fineract-command/src/main/java/org/apache/fineract/command/core/Command.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ public class Command<T> implements Serializable {
3434

3535
private UUID id;
3636

37+
private String idempotencyKey;
38+
3739
private OffsetDateTime createdAt;
3840

3941
private String tenantId;

fineract-command/src/main/java/org/apache/fineract/command/persistence/CommandRepository.java renamed to fineract-command/src/main/java/org/apache/fineract/command/persistence/domain/CommandRepository.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19-
package org.apache.fineract.command.persistence;
19+
package org.apache.fineract.command.persistence.domain;
2020

21-
import org.apache.fineract.command.persistence.domain.CommandEntity;
2221
import org.springframework.data.jpa.repository.JpaRepository;
2322
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
2423

fineract-command/src/main/java/org/apache/fineract/command/persistence/mapping/CommandJsonMapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
@Slf4j
3030
@RequiredArgsConstructor
3131
@Component
32-
public final class CommandJsonMapper {
32+
final class CommandJsonMapper {
3333

3434
private static final String CLASS_ATTRIBUTE = "@class";
3535
private final ObjectMapper mapper;

fineract-command/src/test/java/org/apache/fineract/command/CommandBaseTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
import java.util.Map;
2222
import lombok.extern.slf4j.Slf4j;
23-
import org.apache.fineract.command.persistence.CommandRepository;
23+
import org.apache.fineract.command.persistence.domain.CommandRepository;
2424
import org.apache.fineract.command.persistence.mapping.CommandMapper;
2525
import org.springframework.beans.factory.annotation.Autowired;
2626
import org.springframework.boot.test.context.SpringBootTest;

fineract-command/src/test/java/org/apache/fineract/command/TestConfiguration.java

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,11 @@
2323
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
2424
import org.springframework.boot.autoconfigure.orm.jpa.JpaProperties;
2525
import org.springframework.boot.context.properties.EnableConfigurationProperties;
26-
import org.springframework.context.MessageSource;
27-
import org.springframework.context.annotation.Bean;
2826
import org.springframework.context.annotation.ComponentScan;
2927
import org.springframework.context.annotation.Configuration;
3028
import org.springframework.context.annotation.PropertySource;
3129
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
3230
import org.springframework.scheduling.annotation.EnableAsync;
33-
import org.springframework.validation.Validator;
34-
import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean;
35-
import yakworks.i18n.icu.ICUBundleMessageSource;
3631

3732
@Slf4j
3833
@Configuration
@@ -42,22 +37,4 @@
4237
@EnableAsync
4338
@PropertySource("classpath:application-test.properties")
4439
@ComponentScan("org.apache.fineract.command.sample")
45-
public class TestConfiguration {
46-
47-
@Bean
48-
MessageSource messageSource() {
49-
var messageSource = new ICUBundleMessageSource();
50-
messageSource.setBasenames("classpath:org.apache.fineract.messages");
51-
messageSource.setDefaultEncoding("UTF-8");
52-
53-
return messageSource;
54-
}
55-
56-
@Bean
57-
Validator validatorFactoryBean(MessageSource messageSource) {
58-
var localValidatorFactoryBean = new LocalValidatorFactoryBean();
59-
localValidatorFactoryBean.setValidationMessageSource(messageSource);
60-
61-
return localValidatorFactoryBean;
62-
}
63-
}
40+
public class TestConfiguration {}

fineract-command/src/test/java/org/apache/fineract/command/sample/api/DummyApiController.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;
2323
import static org.springframework.http.MediaType.APPLICATION_PROBLEM_JSON_VALUE;
2424

25-
import jakarta.validation.Valid;
2625
import java.time.OffsetDateTime;
2726
import java.time.ZoneId;
2827
import java.util.UUID;
@@ -56,7 +55,7 @@ class DummyApiController {
5655

5756
@PostMapping("/sync")
5857
DummyResponse dummySync(@RequestHeader(value = COMMAND_REQUEST_ID, required = false) UUID requestId,
59-
@RequestHeader(value = "x-fineract-tenant-id", required = false) String tenantId, @Valid @RequestBody DummyRequest request) {
58+
@RequestHeader(value = "x-fineract-tenant-id", required = false) String tenantId, @RequestBody DummyRequest request) {
6059
var command = new DummyCommand();
6160
command.setId(requestId);
6261
command.setPayload(request);

0 commit comments

Comments
 (0)