FINERACT-2238: New command processing - Business Date Management (org.apache.fineract.infrastructure.businessdate)

This commit is contained in:
viktorpavlenko
2025-06-26 00:49:05 +02:00
committed by Aleksandar Vidakovic
parent d5958f36c7
commit bb46397daa
81 changed files with 1385 additions and 1099 deletions
@@ -34,6 +34,8 @@ public class Command<T> implements Serializable {
private UUID id;
private String idempotencyKey;
private OffsetDateTime createdAt;
private String tenantId;
@@ -16,9 +16,8 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.fineract.command.persistence;
package org.apache.fineract.command.persistence.domain;
import org.apache.fineract.command.persistence.domain.CommandEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
@@ -29,7 +29,7 @@ import org.springframework.stereotype.Component;
@Slf4j
@RequiredArgsConstructor
@Component
public final class CommandJsonMapper {
final class CommandJsonMapper {
private static final String CLASS_ATTRIBUTE = "@class";
private final ObjectMapper mapper;
@@ -20,7 +20,7 @@ package org.apache.fineract.command;
import java.util.Map;
import lombok.extern.slf4j.Slf4j;
import org.apache.fineract.command.persistence.CommandRepository;
import org.apache.fineract.command.persistence.domain.CommandRepository;
import org.apache.fineract.command.persistence.mapping.CommandMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
@@ -23,16 +23,11 @@ import org.apache.fineract.command.core.CommandProperties;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.orm.jpa.JpaProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.MessageSource;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.validation.Validator;
import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean;
import yakworks.i18n.icu.ICUBundleMessageSource;
@Slf4j
@Configuration
@@ -42,22 +37,4 @@ import yakworks.i18n.icu.ICUBundleMessageSource;
@EnableAsync
@PropertySource("classpath:application-test.properties")
@ComponentScan("org.apache.fineract.command.sample")
public class TestConfiguration {
@Bean
MessageSource messageSource() {
var messageSource = new ICUBundleMessageSource();
messageSource.setBasenames("classpath:org.apache.fineract.messages");
messageSource.setDefaultEncoding("UTF-8");
return messageSource;
}
@Bean
Validator validatorFactoryBean(MessageSource messageSource) {
var localValidatorFactoryBean = new LocalValidatorFactoryBean();
localValidatorFactoryBean.setValidationMessageSource(messageSource);
return localValidatorFactoryBean;
}
}
public class TestConfiguration {}
@@ -22,7 +22,6 @@ import static org.apache.fineract.command.core.CommandConstants.COMMAND_REQUEST_
import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;
import static org.springframework.http.MediaType.APPLICATION_PROBLEM_JSON_VALUE;
import jakarta.validation.Valid;
import java.time.OffsetDateTime;
import java.time.ZoneId;
import java.util.UUID;
@@ -56,7 +55,7 @@ class DummyApiController {
@PostMapping("/sync")
DummyResponse dummySync(@RequestHeader(value = COMMAND_REQUEST_ID, required = false) UUID requestId,
@RequestHeader(value = "x-fineract-tenant-id", required = false) String tenantId, @Valid @RequestBody DummyRequest request) {
@RequestHeader(value = "x-fineract-tenant-id", required = false) String tenantId, @RequestBody DummyRequest request) {
var command = new DummyCommand();
command.setId(requestId);
command.setPayload(request);