Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions config/docker/compose/fineract.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
# under the License.
#

version: "3.8"

services:
fineract:
# user: "${FINERACT_USER}:${FINERACT_GROUP}"
Expand Down
2 changes: 1 addition & 1 deletion config/docker/env/fineract-common.env
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ FINERACT_REMOTE_JOB_MESSAGE_HANDLER_SPRING_EVENTS_ENABLED=true
FINERACT_INSECURE_HTTP_CLIENT=true
SPRING_PROFILES_ACTIVE=test,diagnostics
OTEL_SERVICE_NAME=fineract
JAVA_TOOL_OPTIONS="-Xmx1G -XX:MinRAMPercentage=25 -XX:MaxRAMPercentage=80 -XX:TieredStopAtLevel=1 -XX:+UseContainerSupport -XX:+UseStringDeduplication --add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.management/javax.management=ALL-UNNAMED --add-opens=java.naming/javax.naming=ALL-UNNAMED"
JAVA_TOOL_OPTIONS=" -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5000 -Xmx1G -XX:MinRAMPercentage=25 -XX:MaxRAMPercentage=80 -XX:TieredStopAtLevel=1 -XX:+UseContainerSupport -XX:+UseStringDeduplication --add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.management/javax.management=ALL-UNNAMED --add-opens=java.naming/javax.naming=ALL-UNNAMED"
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@
package com.acme.fineract.portfolio.note.service;

import lombok.extern.slf4j.Slf4j;
import org.apache.fineract.infrastructure.core.api.JsonCommand;
import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
import org.apache.fineract.portfolio.client.domain.Client;
import org.apache.fineract.portfolio.note.data.NoteCreateRequest;
import org.apache.fineract.portfolio.note.data.NoteCreateResponse;
import org.apache.fineract.portfolio.note.data.NoteDeleteRequest;
import org.apache.fineract.portfolio.note.data.NoteDeleteResponse;
import org.apache.fineract.portfolio.note.data.NoteUpdateRequest;
import org.apache.fineract.portfolio.note.data.NoteUpdateResponse;
import org.apache.fineract.portfolio.note.service.NoteWritePlatformService;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
Expand All @@ -38,27 +41,17 @@ public void afterPropertiesSet() throws Exception {
}

@Override
public CommandProcessingResult createNote(JsonCommand command) {
public NoteCreateResponse createNote(NoteCreateRequest request) {
throw new UnsupportedOperationException("createNote() is not yet implemented.");
}

@Override
public void createLoanTransactionNote(Long loanTransactionId, String note) {
throw new UnsupportedOperationException("createLoanTransactionNote() is not yet implemented.");
}

@Override
public CommandProcessingResult updateNote(JsonCommand command) {
public NoteUpdateResponse updateNote(NoteUpdateRequest request) {
throw new UnsupportedOperationException("updateNote() is not yet implemented.");
}

@Override
public CommandProcessingResult deleteNote(JsonCommand command) {
public NoteDeleteResponse deleteNote(NoteDeleteRequest request) {
throw new UnsupportedOperationException("deleteNote() is not yet implemented.");
}

@Override
public void createAndPersistClientNote(Client client, JsonCommand command) {
log.warn("createAndPersistClientNote() is intentionally left empty and does nothing.");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,13 @@
import static org.mockito.Mockito.mock;

import org.apache.fineract.infrastructure.core.config.FineractProperties;
import org.apache.fineract.infrastructure.core.serialization.FromJsonHelper;
import org.apache.fineract.infrastructure.core.service.database.RoutingDataSource;
import org.apache.fineract.infrastructure.core.service.database.RoutingDataSourceServiceFactory;
import org.apache.fineract.portfolio.client.domain.ClientRepositoryWrapper;
import org.apache.fineract.portfolio.group.domain.GroupRepository;
import org.apache.fineract.portfolio.loanaccount.domain.LoanRepositoryWrapper;
import org.apache.fineract.portfolio.loanaccount.domain.LoanTransactionRepository;
import org.apache.fineract.portfolio.note.domain.NoteRepository;
import org.apache.fineract.portfolio.note.serialization.NoteCommandFromApiJsonDeserializer;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.jdbc.core.JdbcTemplate;
Expand All @@ -38,11 +36,6 @@
public class TestDefaultConfiguration {
// NOTE: unfortunately an abastract base class that contains all these mock functions won't work

@Bean
public FromJsonHelper fromJsonHelper() {
return mock(FromJsonHelper.class);
}

@Bean
public RoutingDataSourceServiceFactory routingDataSourceServiceFactory() {
return mock(RoutingDataSourceServiceFactory.class);
Expand Down Expand Up @@ -82,9 +75,4 @@ public LoanRepositoryWrapper loanRepository() {
public LoanTransactionRepository loanTransactionRepository() {
return mock(LoanTransactionRepository.class);
}

@Bean
public NoteCommandFromApiJsonDeserializer fromApiJsonDeserializer(FromJsonHelper fromJsonHelper) {
return new NoteCommandFromApiJsonDeserializer(fromJsonHelper);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,13 @@

import static org.mockito.Mockito.mock;

import org.apache.fineract.infrastructure.core.serialization.FromJsonHelper;
import org.apache.fineract.infrastructure.core.service.database.RoutingDataSource;
import org.apache.fineract.infrastructure.core.service.database.RoutingDataSourceServiceFactory;
import org.apache.fineract.portfolio.client.domain.ClientRepositoryWrapper;
import org.apache.fineract.portfolio.group.domain.GroupRepository;
import org.apache.fineract.portfolio.loanaccount.domain.LoanRepositoryWrapper;
import org.apache.fineract.portfolio.loanaccount.domain.LoanTransactionRepository;
import org.apache.fineract.portfolio.note.domain.NoteRepository;
import org.apache.fineract.portfolio.note.serialization.NoteCommandFromApiJsonDeserializer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.jdbc.core.JdbcTemplate;
Expand All @@ -37,11 +35,6 @@
public class TestOverrideConfiguration {
// NOTE: unfortunately an abastract base class that contains all these mock functions won't work

@Bean
public FromJsonHelper fromJsonHelper() {
return mock(FromJsonHelper.class);
}

@Bean
public RoutingDataSourceServiceFactory routingDataSourceServiceFactory() {
return mock(RoutingDataSourceServiceFactory.class);
Expand Down Expand Up @@ -81,9 +74,4 @@ public LoanRepositoryWrapper loanRepository() {
public LoanTransactionRepository loanTransactionRepository() {
return mock(LoanTransactionRepository.class);
}

@Bean
public NoteCommandFromApiJsonDeserializer fromApiJsonDeserializer(FromJsonHelper fromJsonHelper) {
return new NoteCommandFromApiJsonDeserializer(fromJsonHelper);
}
}
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ services:
service: fineract
ports:
- "8443:8443"
- "5000:5000"
depends_on:
db:
condition: service_healthy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
*/
package org.apache.fineract.infrastructure.cache.data;

import java.io.Serial;
import java.io.Serializable;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
Expand All @@ -28,7 +30,10 @@
@Data
@NoArgsConstructor
@AllArgsConstructor
public final class CacheData {
public final class CacheData implements Serializable {

@Serial
private static final long serialVersionUID = 1L;

@SuppressWarnings("unused")
private EnumOptionData cacheType;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/**
* 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 org.apache.fineract.portfolio.note.data;

import io.swagger.v3.oas.annotations.Hidden;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import java.io.Serial;
import java.io.Serializable;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.fineract.portfolio.note.domain.NoteType;

@Builder
@Data
@NoArgsConstructor
@AllArgsConstructor
public class NoteCreateRequest implements Serializable {

@Serial
private static final long serialVersionUID = 1L;

@Hidden
private Long resourceId;
@Hidden
private NoteType type;
@Size(max = 1000, message = "{org.apache.fineract.portfolio.note.note.size}")
@NotNull(message = "{org.apache.fineract.portfolio.note.note.not-null}")
private String note;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/**
* 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 org.apache.fineract.portfolio.note.data;

import java.io.Serial;
import java.io.Serializable;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Builder
@Data
@NoArgsConstructor
@AllArgsConstructor
public class NoteCreateResponse implements Serializable {

@Serial
private static final long serialVersionUID = 1L;

private Long entityId;
private Long officeId;
private Long resourceId;
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,31 +18,37 @@
*/
package org.apache.fineract.portfolio.note.data;

import java.io.Serial;
import java.io.Serializable;
import java.time.OffsetDateTime;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.fineract.infrastructure.core.data.EnumOptionData;

/**
* Immutable data object represent note or case information about a client, loan or loan transaction.
*/
@Getter
@Builder
public class NoteData {
@Data
@NoArgsConstructor
@AllArgsConstructor
public class NoteData implements Serializable {

@Serial
private static final long serialVersionUID = 1L;

private final Long id;
private final Long clientId;
private final Long groupId;
private final Long loanId;
private final Long loanTransactionId;
private final Long depositAccountId;
private final Long savingAccountId;
private final EnumOptionData noteType;
private final String note;
private final Long createdById;
private final String createdByUsername;
private final OffsetDateTime createdOn;
private final Long updatedById;
private final String updatedByUsername;
private final OffsetDateTime updatedOn;
private Long id;
private Long clientId;
private Long groupId;
private Long loanId;
private Long loanTransactionId;
private Long depositAccountId;
private Long savingAccountId;
private EnumOptionData noteType;
private String note;
private Long createdById;
private String createdByUsername;
private OffsetDateTime createdOn;
private Long updatedById;
private String updatedByUsername;
private OffsetDateTime updatedOn;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/**
* 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 org.apache.fineract.portfolio.note.data;

import io.swagger.v3.oas.annotations.Hidden;
import java.io.Serial;
import java.io.Serializable;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.fineract.portfolio.note.domain.NoteType;

@Builder
@Data
@NoArgsConstructor
@AllArgsConstructor
public class NoteDeleteRequest implements Serializable {

@Serial
private static final long serialVersionUID = 1L;

@Hidden
private Long id;
@Hidden
private Long resourceId;
@Hidden
private NoteType type;
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,18 @@
import java.io.Serial;
import java.io.Serializable;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Builder
@Data
@NoArgsConstructor
@AllArgsConstructor
public class NoteRequest implements Serializable {
public class NoteDeleteResponse implements Serializable {

@Serial
private static final long serialVersionUID = 1L;

private String note;
private Long resourceId;
}
Loading
Loading