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
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.charge.service;

import lombok.RequiredArgsConstructor;
import org.apache.fineract.portfolio.charge.domain.Charge;
import org.apache.fineract.portfolio.charge.domain.ChargeRepositoryWrapper;
import org.apache.fineract.portfolio.client.contract.ClientChargeDefinitionData;
import org.apache.fineract.portfolio.client.contract.ClientChargeReadService;
import org.springframework.stereotype.Service;

@Service
@RequiredArgsConstructor
public class ClientChargeReadServiceImpl implements ClientChargeReadService {

private final ChargeRepositoryWrapper chargeRepository;

@Override
public ClientChargeDefinitionData retrieveClientChargeDefinition(final Long chargeId) {
final Charge charge = this.chargeRepository.findOneWithNotFoundDetection(chargeId);
return new ClientChargeDefinitionData(charge.getId(), charge.isClientCharge(), charge.isPenalty(), charge.getChargeTimeType(),
charge.getChargeCalculation(), charge.getAmount(), charge.getCurrencyCode(), charge.getIncomeAccountId());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/**
* 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.client.contract;

import org.apache.fineract.infrastructure.core.serialization.ApiRequestJsonSerializationSettings;

/**
* Core read-contract returning a client's account summary already serialized to JSON, so that the client feature does
* not need a compile-time dependency on {@code AccountSummaryCollectionData} (which transitively references the loan
* and shares domain types). Implemented by the account-details module.
*/
public interface ClientAccountSummaryReadService {

String retrieveClientAccountSummaryAsJson(Long clientId, ApiRequestJsonSerializationSettings settings);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/**
* 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.client.contract;

import java.util.List;
import org.apache.fineract.portfolio.charge.data.ChargeData;

/**
* Core read-contract exposing only the "charges applicable to clients" lookup required by the client feature, so that
* the client module does not need a compile-time dependency on the full {@code ChargeReadPlatformService}. Implemented
* by the charge read service.
*/
public interface ClientApplicableChargeReadService {

List<ChargeData> retrieveAllChargesApplicableToClients();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
* 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.client.contract;

import java.math.BigDecimal;

/**
* Minimal projection of a charge definition needed by the client feature to create/inspect a {@code ClientCharge}
* without a compile-time dependency on the charge domain types. Populated by the charge module.
*/
public record ClientChargeDefinitionData(Long chargeId, boolean applicableToClients, boolean penalty, Integer chargeTimeType,
Integer chargeCalculation, BigDecimal amount, String currencyCode, Long incomeAccountId) {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/**
* 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.client.contract;

/**
* Core read-contract exposing the charge-definition data required by the client feature, so that the client module does
* not need a compile-time dependency on the charge domain/repository types. Implemented by the charge module.
*/
public interface ClientChargeReadService {

ClientChargeDefinitionData retrieveClientChargeDefinition(Long chargeId);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/**
* 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.client.contract;

import java.util.List;
import org.apache.fineract.infrastructure.dataqueries.data.DatatableData;

/**
* Core read-contract exposing only the datatable-template lookup required by the client feature, so that the client
* module does not need a compile-time dependency on the full {@code EntityDatatableChecksReadService} (whose other
* methods reference {@code EntityDataTableChecksTemplateData} -> loan product data). Implemented by the data-queries
* module.
*/
public interface ClientDatatableChecksReadService {

List<DatatableData> retrieveTemplates(Integer status, String entity, Long productId);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/**
* 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.client.contract;

import java.util.Map;

/**
* Core write-contract exposing only the journal-entry posting behaviour required by the client feature, so that the
* client module does not need a compile-time dependency on the full {@code JournalEntryWritePlatformService} (which
* references loan/investor/provisioning types). Implemented by the accounting module.
*/
public interface ClientJournalEntryWriteService {

void createJournalEntriesForClientTransactions(Map<String, Object> accountingBridgeData);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/**
* 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.client.contract;

import java.util.List;
import org.apache.fineract.portfolio.client.data.ClientLoanStatusData;

/**
* Core read-contract returning the loan-status projection of a client's loans, so that the client feature does not need
* a compile-time dependency on the loan domain/repository types. Implemented by the loan module.
*/
public interface ClientLoanReadService {

List<ClientLoanStatusData> retrieveClientLoanStatuses(Long clientId);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/**
* 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.client.contract;

import org.apache.fineract.portfolio.client.domain.Client;

/**
* Core write-contract exposing only the note cleanup behaviour required by the client feature, so that the client
* module does not need a compile-time dependency on the note domain/repository types. Implemented by the note module.
*/
public interface ClientNoteWriteService {

void deleteNotesByClient(Client client);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/**
* 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.client.contract;

import java.util.List;
import org.apache.fineract.portfolio.loanaccount.guarantor.data.ObligeeData;

/**
* Core read-contract exposing only the obligee lookup required by the client feature, so that the client feature does
* not need a compile-time dependency on the full {@code GuarantorReadPlatformService}. Implemented by the guarantor
* module.
*/
public interface ClientObligeeReadService {

List<ObligeeData> retrieveObligeeDetails(Long clientId);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/**
* 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.client.contract;

import java.util.Collection;
import org.apache.fineract.portfolio.savings.data.SavingsAccountData;

/**
* Core read-contract exposing only the savings-account lookup required by the client feature, so that the client module
* does not need a compile-time dependency on the full {@code SavingsAccountReadPlatformService}. Implemented by the
* savings account read service.
*/
public interface ClientSavingsAccountLookupReadService {

Collection<SavingsAccountData> retrieveSavingsAccountsForClientLookup(Long clientId);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/**
* 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.client.contract;

import java.time.format.DateTimeFormatter;
import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
import org.apache.fineract.portfolio.client.domain.Client;

/**
* Core write-contract that creates the default savings account for a client being activated, so that the client module
* does not need a compile-time dependency on the savings application-process types. Implemented by the savings module.
*/
public interface ClientSavingsActivationService {

CommandProcessingResult createSavingsForClientActivation(Client client, DateTimeFormatter fmt);
}
Loading
Loading