This is an automated email from the ASF dual-hosted git repository.
aleks pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract.git
The following commit(s) were added to refs/heads/develop by this push:
new bf9352ed7 Add custom Configuration class for accounting/journalentry
module (FINERACT-1932)
bf9352ed7 is described below
commit bf9352ed7e1b8d1fdc82abb06fbbaf4b795ad7c0
Author: Sinha, Abhinav <[email protected]>
AuthorDate: Mon Oct 23 12:46:17 2023 -0400
Add custom Configuration class for accounting/journalentry module
(FINERACT-1932)
---
.../service/AccountingProcessorHelper.java | 2 -
.../JournalEntryReadPlatformServiceImpl.java | 2 -
...EntryWritePlatformServiceJpaRepositoryImpl.java | 2 -
.../AccountingJournalEntryConfiguration.java | 105 +++++++++++++++++++++
4 files changed, 105 insertions(+), 6 deletions(-)
diff --git
a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/AccountingProcessorHelper.java
b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/AccountingProcessorHelper.java
index dd3c32002..0ca95a995 100644
---
a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/AccountingProcessorHelper.java
+++
b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/AccountingProcessorHelper.java
@@ -78,9 +78,7 @@ import
org.apache.fineract.portfolio.savings.domain.SavingsAccountTransaction;
import
org.apache.fineract.portfolio.savings.domain.SavingsAccountTransactionRepository;
import
org.apache.fineract.portfolio.shareaccounts.data.ShareAccountTransactionEnumData;
import org.springframework.dao.DataAccessException;
-import org.springframework.stereotype.Service;
-@Service
@RequiredArgsConstructor
public class AccountingProcessorHelper {
diff --git
a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/JournalEntryReadPlatformServiceImpl.java
b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/JournalEntryReadPlatformServiceImpl.java
index 8dfa84213..88a826c17 100644
---
a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/JournalEntryReadPlatformServiceImpl.java
+++
b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/JournalEntryReadPlatformServiceImpl.java
@@ -65,10 +65,8 @@ import
org.apache.fineract.portfolio.savings.service.SavingsEnumerations;
import org.springframework.dao.EmptyResultDataAccessException;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper;
-import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
-@Service
@RequiredArgsConstructor
public class JournalEntryReadPlatformServiceImpl implements
JournalEntryReadPlatformService {
diff --git
a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/JournalEntryWritePlatformServiceJpaRepositoryImpl.java
b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/JournalEntryWritePlatformServiceJpaRepositoryImpl.java
index 4e9683950..93b441c1c 100644
---
a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/JournalEntryWritePlatformServiceJpaRepositoryImpl.java
+++
b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/JournalEntryWritePlatformServiceJpaRepositoryImpl.java
@@ -81,11 +81,9 @@ import org.apache.fineract.useradministration.domain.AppUser;
import org.springframework.dao.DataIntegrityViolationException;
import org.springframework.dao.NonTransientDataAccessException;
import org.springframework.orm.jpa.JpaSystemException;
-import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
-@Service
@RequiredArgsConstructor
@Slf4j
public class JournalEntryWritePlatformServiceJpaRepositoryImpl implements
JournalEntryWritePlatformService {
diff --git
a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/starter/AccountingJournalEntryConfiguration.java
b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/starter/AccountingJournalEntryConfiguration.java
new file mode 100644
index 000000000..73a08c064
--- /dev/null
+++
b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/starter/AccountingJournalEntryConfiguration.java
@@ -0,0 +1,105 @@
+/**
+ * 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.accounting.journalentry.starter;
+
+import org.apache.fineract.accounting.closure.domain.GLClosureRepository;
+import
org.apache.fineract.accounting.financialactivityaccount.domain.FinancialActivityAccountRepositoryWrapper;
+import org.apache.fineract.accounting.glaccount.domain.GLAccountRepository;
+import
org.apache.fineract.accounting.glaccount.service.GLAccountReadPlatformService;
+import
org.apache.fineract.accounting.journalentry.domain.JournalEntryRepository;
+import
org.apache.fineract.accounting.journalentry.serialization.JournalEntryCommandFromApiJsonDeserializer;
+import
org.apache.fineract.accounting.journalentry.service.AccountingProcessorForLoanFactory;
+import
org.apache.fineract.accounting.journalentry.service.AccountingProcessorForSavingsFactory;
+import
org.apache.fineract.accounting.journalentry.service.AccountingProcessorForSharesFactory;
+import
org.apache.fineract.accounting.journalentry.service.AccountingProcessorHelper;
+import
org.apache.fineract.accounting.journalentry.service.CashBasedAccountingProcessorForClientTransactions;
+import
org.apache.fineract.accounting.journalentry.service.JournalEntryReadPlatformService;
+import
org.apache.fineract.accounting.journalentry.service.JournalEntryReadPlatformServiceImpl;
+import
org.apache.fineract.accounting.journalentry.service.JournalEntryWritePlatformService;
+import
org.apache.fineract.accounting.journalentry.service.JournalEntryWritePlatformServiceJpaRepositoryImpl;
+import
org.apache.fineract.accounting.producttoaccountmapping.domain.ProductToGLAccountMappingRepository;
+import org.apache.fineract.accounting.rule.domain.AccountingRuleRepository;
+import org.apache.fineract.infrastructure.core.service.PaginationHelper;
+import
org.apache.fineract.infrastructure.core.service.database.DatabaseSpecificSQLGenerator;
+import
org.apache.fineract.infrastructure.event.business.service.BusinessEventNotifierService;
+import
org.apache.fineract.infrastructure.security.service.PlatformSecurityContext;
+import org.apache.fineract.infrastructure.security.utils.ColumnValidator;
+import org.apache.fineract.organisation.office.domain.OfficeRepository;
+import org.apache.fineract.organisation.office.domain.OfficeRepositoryWrapper;
+import
org.apache.fineract.organisation.office.domain.OrganisationCurrencyRepositoryWrapper;
+import
org.apache.fineract.organisation.office.service.OfficeReadPlatformService;
+import
org.apache.fineract.portfolio.account.service.AccountTransfersReadPlatformService;
+import org.apache.fineract.portfolio.charge.domain.ChargeRepositoryWrapper;
+import org.apache.fineract.portfolio.client.domain.ClientTransactionRepository;
+import
org.apache.fineract.portfolio.loanaccount.domain.LoanTransactionRepository;
+import
org.apache.fineract.portfolio.paymentdetail.service.PaymentDetailWritePlatformService;
+import
org.apache.fineract.portfolio.savings.domain.SavingsAccountTransactionRepository;
+import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.jdbc.core.JdbcTemplate;
+
+@Configuration
+public class AccountingJournalEntryConfiguration {
+
+ @Bean
+ @ConditionalOnMissingBean(AccountingProcessorHelper.class)
+ public AccountingProcessorHelper
accountingProcessorHelper(JournalEntryRepository glJournalEntryRepository,
+ ProductToGLAccountMappingRepository accountMappingRepository,
+ FinancialActivityAccountRepositoryWrapper
financialActivityAccountRepository, GLClosureRepository closureRepository,
+ GLAccountRepository glAccountRepository, OfficeRepository
officeRepository, LoanTransactionRepository loanTransactionRepository,
+ ClientTransactionRepository clientTransactionRepository,
+ SavingsAccountTransactionRepository
savingsAccountTransactionRepository,
+ AccountTransfersReadPlatformService
accountTransfersReadPlatformService, ChargeRepositoryWrapper
chargeRepositoryWrapper,
+ BusinessEventNotifierService businessEventNotifierService) {
+ return new AccountingProcessorHelper(glJournalEntryRepository,
accountMappingRepository, financialActivityAccountRepository,
+ closureRepository, glAccountRepository, officeRepository,
loanTransactionRepository, clientTransactionRepository,
+ savingsAccountTransactionRepository,
accountTransfersReadPlatformService, chargeRepositoryWrapper,
+ businessEventNotifierService);
+ }
+
+ @Bean
+ @ConditionalOnMissingBean(JournalEntryReadPlatformService.class)
+ public JournalEntryReadPlatformService
journalEntryReadPlatformService(JdbcTemplate jdbcTemplate,
+ GLAccountReadPlatformService glAccountReadPlatformService,
OfficeReadPlatformService officeReadPlatformService,
+ ColumnValidator columnValidator,
FinancialActivityAccountRepositoryWrapper
financialActivityAccountRepositoryWrapper,
+ PaginationHelper paginationHelper, DatabaseSpecificSQLGenerator
sqlGenerator) {
+ return new JournalEntryReadPlatformServiceImpl(jdbcTemplate,
glAccountReadPlatformService, officeReadPlatformService,
+ columnValidator, financialActivityAccountRepositoryWrapper,
paginationHelper, sqlGenerator);
+ }
+
+ @Bean
+ @ConditionalOnMissingBean(JournalEntryWritePlatformService.class)
+ public JournalEntryWritePlatformService
journalEntryWritePlatformService(GLClosureRepository glClosureRepository,
+ GLAccountRepository glAccountRepository, JournalEntryRepository
glJournalEntryRepository,
+ OfficeRepositoryWrapper officeRepositoryWrapper,
AccountingProcessorForLoanFactory accountingProcessorForLoanFactory,
+ AccountingProcessorForSavingsFactory
accountingProcessorForSavingsFactory,
+ AccountingProcessorForSharesFactory
accountingProcessorForSharesFactory, AccountingProcessorHelper helper,
+ JournalEntryCommandFromApiJsonDeserializer
fromApiJsonDeserializer, AccountingRuleRepository accountingRuleRepository,
+ GLAccountReadPlatformService glAccountReadPlatformService,
OrganisationCurrencyRepositoryWrapper organisationCurrencyRepository,
+ PlatformSecurityContext context, PaymentDetailWritePlatformService
paymentDetailWritePlatformService,
+ FinancialActivityAccountRepositoryWrapper
financialActivityAccountRepositoryWrapper,
+ CashBasedAccountingProcessorForClientTransactions
accountingProcessorForClientTransactions) {
+ return new
JournalEntryWritePlatformServiceJpaRepositoryImpl(glClosureRepository,
glAccountRepository, glJournalEntryRepository,
+ officeRepositoryWrapper, accountingProcessorForLoanFactory,
accountingProcessorForSavingsFactory,
+ accountingProcessorForSharesFactory, helper,
fromApiJsonDeserializer, accountingRuleRepository,
+ glAccountReadPlatformService, organisationCurrencyRepository,
context, paymentDetailWritePlatformService,
+ financialActivityAccountRepositoryWrapper,
accountingProcessorForClientTransactions);
+ }
+}