Add custom Configuration class for accounting/rule module (FINERACT-1932)
This commit is contained in:
committed by
Aleksandar Vidakovic
parent
1c652ba0a6
commit
a779abaf7d
-2
@@ -41,9 +41,7 @@ import org.springframework.dao.EmptyResultDataAccessException;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.jdbc.core.ResultSetExtractor;
|
||||
import org.springframework.jdbc.core.RowMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class AccountingRuleReadPlatformServiceImpl implements AccountingRuleReadPlatformService {
|
||||
|
||||
|
||||
-2
@@ -52,10 +52,8 @@ import org.apache.fineract.organisation.office.domain.OfficeRepositoryWrapper;
|
||||
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;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class AccountingRuleWritePlatformServiceJpaRepositoryImpl implements AccountingRuleWritePlatformService {
|
||||
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
/**
|
||||
* 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.rule.starter;
|
||||
|
||||
import org.apache.fineract.accounting.glaccount.domain.GLAccountRepositoryWrapper;
|
||||
import org.apache.fineract.accounting.glaccount.service.GLAccountReadPlatformService;
|
||||
import org.apache.fineract.accounting.rule.domain.AccountingRuleRepository;
|
||||
import org.apache.fineract.accounting.rule.domain.AccountingRuleRepositoryWrapper;
|
||||
import org.apache.fineract.accounting.rule.serialization.AccountingRuleCommandFromApiJsonDeserializer;
|
||||
import org.apache.fineract.accounting.rule.service.AccountingRuleReadPlatformService;
|
||||
import org.apache.fineract.accounting.rule.service.AccountingRuleReadPlatformServiceImpl;
|
||||
import org.apache.fineract.accounting.rule.service.AccountingRuleWritePlatformService;
|
||||
import org.apache.fineract.accounting.rule.service.AccountingRuleWritePlatformServiceJpaRepositoryImpl;
|
||||
import org.apache.fineract.infrastructure.codes.domain.CodeValueRepository;
|
||||
import org.apache.fineract.organisation.office.domain.OfficeRepositoryWrapper;
|
||||
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 AccountingRuleConfiguration {
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean(AccountingRuleReadPlatformService.class)
|
||||
public AccountingRuleReadPlatformService accountingRuleReadPlatformService(JdbcTemplate jdbcTemplate,
|
||||
GLAccountReadPlatformService glAccountReadPlatformService) {
|
||||
return new AccountingRuleReadPlatformServiceImpl(jdbcTemplate, glAccountReadPlatformService);
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean(AccountingRuleWritePlatformService.class)
|
||||
public AccountingRuleWritePlatformService accountingRuleWritePlatformService(
|
||||
AccountingRuleRepositoryWrapper accountingRuleRepositoryWrapper, AccountingRuleRepository accountingRuleRepository,
|
||||
GLAccountRepositoryWrapper accountRepositoryWrapper, OfficeRepositoryWrapper officeRepositoryWrapper,
|
||||
AccountingRuleCommandFromApiJsonDeserializer fromApiJsonDeserializer, CodeValueRepository codeValueRepository) {
|
||||
return new AccountingRuleWritePlatformServiceJpaRepositoryImpl(accountingRuleRepositoryWrapper, accountingRuleRepository,
|
||||
accountRepositoryWrapper, officeRepositoryWrapper, fromApiJsonDeserializer, codeValueRepository);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user