This is an automated email from the ASF dual-hosted git repository.
arnold 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 245c00bd5 FINERACT-1932: Add starter Configuration class for
portfolio.interestratechart module
245c00bd5 is described below
commit 245c00bd592542cd3a2f58feff8bd9af4e2e68de
Author: Mohamed Magdi-Abdelmonem <[email protected]>
AuthorDate: Sat Oct 14 19:36:15 2023 +0300
FINERACT-1932: Add starter Configuration class for
portfolio.interestratechart module
---
.../service/InterestIncentiveAssembler.java | 10 +-
...tIncentivesDropdownReadPlatformServiceImpl.java | 4 +-
.../service/InterestRateChartAssembler.java | 14 +-
...stRateChartDropdownReadPlatformServiceImpl.java | 4 +-
.../InterestRateChartReadPlatformServiceImpl.java | 4 -
.../service/InterestRateChartSlabAssembler.java | 14 +-
...terestRateChartSlabReadPlatformServiceImpl.java | 25 +---
...tSlabWritePlatformServiceJpaRepositoryImpl.java | 25 +---
...ChartWritePlatformServiceJpaRepositoryImpl.java | 20 +--
.../starter/InterestRateChartConfiguration.java | 144 +++++++++++++++++++++
10 files changed, 163 insertions(+), 101 deletions(-)
diff --git
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/service/InterestIncentiveAssembler.java
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/service/InterestIncentiveAssembler.java
index 55e2f7a7e..36933b49b 100644
---
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/service/InterestIncentiveAssembler.java
+++
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/service/InterestIncentiveAssembler.java
@@ -36,6 +36,7 @@ import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
+import lombok.RequiredArgsConstructor;
import org.apache.fineract.infrastructure.core.data.ApiParameterError;
import org.apache.fineract.infrastructure.core.data.DataValidatorBuilder;
import
org.apache.fineract.infrastructure.core.exception.PlatformApiDataValidationException;
@@ -43,19 +44,12 @@ import
org.apache.fineract.infrastructure.core.serialization.FromJsonHelper;
import
org.apache.fineract.portfolio.interestratechart.domain.InterestIncentives;
import
org.apache.fineract.portfolio.interestratechart.domain.InterestIncentivesFields;
import
org.apache.fineract.portfolio.interestratechart.domain.InterestRateChartSlab;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-@Service
+@RequiredArgsConstructor
public class InterestIncentiveAssembler {
private final FromJsonHelper fromApiJsonHelper;
- @Autowired
- public InterestIncentiveAssembler(final FromJsonHelper fromApiJsonHelper) {
- this.fromApiJsonHelper = fromApiJsonHelper;
- }
-
public Collection<InterestIncentives> assembleIncentivesFrom(final
JsonElement element, InterestRateChartSlab interestRateChartSlab,
final Locale locale) {
final Collection<InterestIncentives> interestIncentivesSet = new
HashSet<>();
diff --git
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/service/InterestIncentivesDropdownReadPlatformServiceImpl.java
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/service/InterestIncentivesDropdownReadPlatformServiceImpl.java
index 1430b6cbb..28879b5ca 100755
---
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/service/InterestIncentivesDropdownReadPlatformServiceImpl.java
+++
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/service/InterestIncentivesDropdownReadPlatformServiceImpl.java
@@ -19,15 +19,15 @@
package org.apache.fineract.portfolio.interestratechart.service;
import java.util.Collection;
+import lombok.NoArgsConstructor;
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
import org.apache.fineract.portfolio.common.domain.ConditionType;
import org.apache.fineract.portfolio.common.service.CommonEnumerations;
import
org.apache.fineract.portfolio.interestratechart.incentive.InterestIncentiveAttributeName;
import
org.apache.fineract.portfolio.interestratechart.incentive.InterestIncentiveEntityType;
import
org.apache.fineract.portfolio.interestratechart.incentive.InterestIncentiveType;
-import org.springframework.stereotype.Service;
-@Service
+@NoArgsConstructor
public class InterestIncentivesDropdownReadPlatformServiceImpl implements
InterestIncentiveDropdownReadPlatformService {
@Override
diff --git
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/service/InterestRateChartAssembler.java
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/service/InterestRateChartAssembler.java
index 2d55e8c09..b4031c38f 100644
---
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/service/InterestRateChartAssembler.java
+++
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/service/InterestRateChartAssembler.java
@@ -31,6 +31,7 @@ import java.time.LocalDate;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
+import lombok.RequiredArgsConstructor;
import org.apache.fineract.infrastructure.core.api.JsonCommand;
import org.apache.fineract.infrastructure.core.data.ApiParameterError;
import org.apache.fineract.infrastructure.core.data.DataValidatorBuilder;
@@ -40,25 +41,14 @@ import
org.apache.fineract.portfolio.interestratechart.domain.InterestRateChart;
import
org.apache.fineract.portfolio.interestratechart.domain.InterestRateChartFields;
import
org.apache.fineract.portfolio.interestratechart.domain.InterestRateChartRepositoryWrapper;
import
org.apache.fineract.portfolio.interestratechart.domain.InterestRateChartSlab;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-@Service
+@RequiredArgsConstructor
public class InterestRateChartAssembler {
private final FromJsonHelper fromApiJsonHelper;
private final InterestRateChartRepositoryWrapper
interestRateChartRepositoryWrapper;
private final InterestRateChartSlabAssembler chartSlabAssembler;
- @Autowired
- public InterestRateChartAssembler(final FromJsonHelper fromApiJsonHelper,
- final InterestRateChartRepositoryWrapper
interestRateChartRepositoryWrapper,
- final InterestRateChartSlabAssembler chartSlabAssembler) {
- this.fromApiJsonHelper = fromApiJsonHelper;
- this.interestRateChartRepositoryWrapper =
interestRateChartRepositoryWrapper;
- this.chartSlabAssembler = chartSlabAssembler;
- }
-
/**
* Assembles a new {@link InterestRateChart} from JSON Slabs passed in
request
*/
diff --git
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/service/InterestRateChartDropdownReadPlatformServiceImpl.java
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/service/InterestRateChartDropdownReadPlatformServiceImpl.java
index bcbc72ea1..384845a59 100644
---
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/service/InterestRateChartDropdownReadPlatformServiceImpl.java
+++
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/service/InterestRateChartDropdownReadPlatformServiceImpl.java
@@ -19,11 +19,11 @@
package org.apache.fineract.portfolio.interestratechart.service;
import java.util.Collection;
+import lombok.NoArgsConstructor;
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
import org.apache.fineract.portfolio.common.domain.PeriodFrequencyType;
-import org.springframework.stereotype.Service;
-@Service
+@NoArgsConstructor
public class InterestRateChartDropdownReadPlatformServiceImpl implements
InterestRateChartDropdownReadPlatformService {
@Override
diff --git
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/service/InterestRateChartReadPlatformServiceImpl.java
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/service/InterestRateChartReadPlatformServiceImpl.java
index b7fc82a78..ea7aa652b 100644
---
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/service/InterestRateChartReadPlatformServiceImpl.java
+++
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/service/InterestRateChartReadPlatformServiceImpl.java
@@ -40,15 +40,12 @@ import
org.apache.fineract.portfolio.interestratechart.data.InterestRateChartSla
import
org.apache.fineract.portfolio.interestratechart.exception.InterestRateChartNotFoundException;
import
org.apache.fineract.portfolio.interestratechart.incentive.InterestIncentiveAttributeName;
import org.apache.fineract.portfolio.savings.data.DepositProductData;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataAccessException;
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
public class InterestRateChartReadPlatformServiceImpl implements
InterestRateChartReadPlatformService {
private final PlatformSecurityContext context;
@@ -59,7 +56,6 @@ public class InterestRateChartReadPlatformServiceImpl
implements InterestRateCha
private final InterestIncentiveDropdownReadPlatformService
interestIncentiveDropdownReadPlatformService;
private final CodeValueReadPlatformService codeValueReadPlatformService;
- @Autowired
public InterestRateChartReadPlatformServiceImpl(PlatformSecurityContext
context, final JdbcTemplate jdbcTemplate,
InterestRateChartDropdownReadPlatformService
chartDropdownReadPlatformService,
final InterestIncentiveDropdownReadPlatformService
interestIncentiveDropdownReadPlatformService,
diff --git
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/service/InterestRateChartSlabAssembler.java
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/service/InterestRateChartSlabAssembler.java
index eef49be9b..46b9cbe8b 100644
---
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/service/InterestRateChartSlabAssembler.java
+++
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/service/InterestRateChartSlabAssembler.java
@@ -38,6 +38,7 @@ import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
+import lombok.RequiredArgsConstructor;
import org.apache.fineract.infrastructure.core.api.JsonCommand;
import org.apache.fineract.infrastructure.core.data.ApiParameterError;
import org.apache.fineract.infrastructure.core.data.DataValidatorBuilder;
@@ -49,25 +50,14 @@ import
org.apache.fineract.portfolio.interestratechart.domain.InterestRateChartS
import
org.apache.fineract.portfolio.interestratechart.domain.InterestRateChartSlabFields;
import
org.apache.fineract.portfolio.interestratechart.exception.InterestRateChartSlabNotFoundException;
import org.apache.fineract.portfolio.savings.SavingsPeriodFrequencyType;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-@Service
+@RequiredArgsConstructor
public class InterestRateChartSlabAssembler {
private final FromJsonHelper fromApiJsonHelper;
private final InterestRateChartRepositoryWrapper
interestRateChartRepositoryWrapper;
private final InterestIncentiveAssembler incentiveAssembler;
- @Autowired
- public InterestRateChartSlabAssembler(final FromJsonHelper
fromApiJsonHelper,
- final InterestRateChartRepositoryWrapper
interestRateChartRepositoryWrapper,
- final InterestIncentiveAssembler incentiveAssembler) {
- this.fromApiJsonHelper = fromApiJsonHelper;
- this.interestRateChartRepositoryWrapper =
interestRateChartRepositoryWrapper;
- this.incentiveAssembler = incentiveAssembler;
- }
-
/**
* Assembles a new {@link InterestRateChartSlab} from JSON Slabs passed in
request
*/
diff --git
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/service/InterestRateChartSlabReadPlatformServiceImpl.java
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/service/InterestRateChartSlabReadPlatformServiceImpl.java
index d263e1cf3..a18269e79 100644
---
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/service/InterestRateChartSlabReadPlatformServiceImpl.java
+++
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/service/InterestRateChartSlabReadPlatformServiceImpl.java
@@ -24,6 +24,7 @@ import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
+import lombok.RequiredArgsConstructor;
import org.apache.fineract.infrastructure.codes.data.CodeValueData;
import
org.apache.fineract.infrastructure.codes.service.CodeValueReadPlatformService;
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
@@ -37,14 +38,13 @@ import
org.apache.fineract.portfolio.interestratechart.data.InterestIncentiveDat
import
org.apache.fineract.portfolio.interestratechart.data.InterestRateChartSlabData;
import
org.apache.fineract.portfolio.interestratechart.exception.InterestRateChartSlabNotFoundException;
import
org.apache.fineract.portfolio.interestratechart.incentive.InterestIncentiveAttributeName;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataAccessException;
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 InterestRateChartSlabReadPlatformServiceImpl implements
InterestRateChartSlabReadPlatformService {
private final PlatformSecurityContext context;
@@ -53,21 +53,6 @@ public class InterestRateChartSlabReadPlatformServiceImpl
implements InterestRat
private final InterestRateChartDropdownReadPlatformService
chartDropdownReadPlatformService;
private final InterestIncentiveDropdownReadPlatformService
interestIncentiveDropdownReadPlatformService;
private final CodeValueReadPlatformService codeValueReadPlatformService;
- private final DatabaseSpecificSQLGenerator sqlGenerator;
-
- @Autowired
- public
InterestRateChartSlabReadPlatformServiceImpl(PlatformSecurityContext context,
final JdbcTemplate jdbcTemplate,
- InterestRateChartDropdownReadPlatformService
chartDropdownReadPlatformService,
- final InterestIncentiveDropdownReadPlatformService
interestIncentiveDropdownReadPlatformService,
- final CodeValueReadPlatformService codeValueReadPlatformService,
DatabaseSpecificSQLGenerator sqlGenerator) {
- this.context = context;
- this.jdbcTemplate = jdbcTemplate;
- this.chartDropdownReadPlatformService =
chartDropdownReadPlatformService;
- this.interestIncentiveDropdownReadPlatformService =
interestIncentiveDropdownReadPlatformService;
- this.codeValueReadPlatformService = codeValueReadPlatformService;
- this.sqlGenerator = sqlGenerator;
- chartSlabExtractor = new InterestRateChartSlabExtractor(sqlGenerator);
- }
@Override
public Collection<InterestRateChartSlabData> retrieveAll(Long chartId) {
@@ -187,7 +172,7 @@ public class InterestRateChartSlabReadPlatformServiceImpl
implements InterestRat
}
- private static final class InterestRateChartSlabExtractor implements
ResultSetExtractor<Collection<InterestRateChartSlabData>> {
+ public static final class InterestRateChartSlabExtractor implements
ResultSetExtractor<Collection<InterestRateChartSlabData>> {
InterestRateChartSlabsMapper chartSlabsMapper;
InterestIncentiveMapper incentiveMapper = new
InterestIncentiveMapper();
@@ -198,7 +183,7 @@ public class InterestRateChartSlabReadPlatformServiceImpl
implements InterestRat
return this.schemaSql;
}
- private InterestRateChartSlabExtractor(DatabaseSpecificSQLGenerator
sqlGenerator) {
+ public InterestRateChartSlabExtractor(DatabaseSpecificSQLGenerator
sqlGenerator) {
chartSlabsMapper = new InterestRateChartSlabsMapper(sqlGenerator);
this.schemaSql = chartSlabsMapper.schema();
}
diff --git
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/service/InterestRateChartSlabWritePlatformServiceJpaRepositoryImpl.java
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/service/InterestRateChartSlabWritePlatformServiceJpaRepositoryImpl.java
index da096ad57..c1e0547dc 100644
---
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/service/InterestRateChartSlabWritePlatformServiceJpaRepositoryImpl.java
+++
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/service/InterestRateChartSlabWritePlatformServiceJpaRepositoryImpl.java
@@ -21,6 +21,7 @@ package
org.apache.fineract.portfolio.interestratechart.service;
import java.util.LinkedHashMap;
import java.util.Locale;
import java.util.Map;
+import lombok.RequiredArgsConstructor;
import org.apache.fineract.infrastructure.core.api.JsonCommand;
import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
import
org.apache.fineract.infrastructure.core.data.CommandProcessingResultBuilder;
@@ -30,17 +31,11 @@ import
org.apache.fineract.portfolio.interestratechart.domain.InterestRateChartR
import
org.apache.fineract.portfolio.interestratechart.domain.InterestRateChartSlab;
import
org.apache.fineract.portfolio.interestratechart.domain.InterestRateChartSlabRepository;
import org.apache.fineract.portfolio.savings.domain.SavingsProductRepository;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
-@Service
+@RequiredArgsConstructor
public class InterestRateChartSlabWritePlatformServiceJpaRepositoryImpl
implements InterestRateChartSlabWritePlatformService {
- @SuppressWarnings("unused")
- private static final Logger LOG =
LoggerFactory.getLogger(InterestRateChartSlabWritePlatformServiceJpaRepositoryImpl.class);
@SuppressWarnings("unused")
private final PlatformSecurityContext context;
private final InterestRateChartSlabDataValidator
interestRateChartSlabDataValidator;
@@ -53,22 +48,6 @@ public class
InterestRateChartSlabWritePlatformServiceJpaRepositoryImpl implemen
@SuppressWarnings("unused")
private final SavingsProductRepository savingsProductRepository;
- @Autowired
- public
InterestRateChartSlabWritePlatformServiceJpaRepositoryImpl(PlatformSecurityContext
context,
- final InterestRateChartSlabDataValidator
interestRateChartSlabDataValidator,
- final InterestRateChartAssembler interestRateChartAssembler,
- final InterestRateChartRepositoryWrapper
interestRateChartRepository, final SavingsProductRepository
savingsProductRepository,
- final InterestRateChartSlabRepository chartSlabRepository,
- final InterestRateChartSlabAssembler
interestRateChartSlabAssembler) {
- this.context = context;
- this.interestRateChartSlabDataValidator =
interestRateChartSlabDataValidator;
- this.interestRateChartAssembler = interestRateChartAssembler;
- this.interestRateChartRepository = interestRateChartRepository;
- this.savingsProductRepository = savingsProductRepository;
- this.chartSlabRepository = chartSlabRepository;
- this.interestRateChartSlabAssembler = interestRateChartSlabAssembler;
- }
-
@Override
@Transactional
public CommandProcessingResult create(JsonCommand command) {
diff --git
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/service/InterestRateChartWritePlatformServiceJpaRepositoryImpl.java
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/service/InterestRateChartWritePlatformServiceJpaRepositoryImpl.java
index eb8f2b7b7..92023a28e 100644
---
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/service/InterestRateChartWritePlatformServiceJpaRepositoryImpl.java
+++
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/service/InterestRateChartWritePlatformServiceJpaRepositoryImpl.java
@@ -20,6 +20,7 @@ package
org.apache.fineract.portfolio.interestratechart.service;
import java.util.LinkedHashMap;
import java.util.Map;
+import lombok.RequiredArgsConstructor;
import org.apache.fineract.infrastructure.core.api.JsonCommand;
import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
import
org.apache.fineract.infrastructure.core.data.CommandProcessingResultBuilder;
@@ -27,34 +28,17 @@ import
org.apache.fineract.infrastructure.security.service.PlatformSecurityConte
import
org.apache.fineract.portfolio.interestratechart.data.InterestRateChartDataValidator;
import
org.apache.fineract.portfolio.interestratechart.domain.InterestRateChart;
import
org.apache.fineract.portfolio.interestratechart.domain.InterestRateChartRepositoryWrapper;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
-@Service
+@RequiredArgsConstructor
public class InterestRateChartWritePlatformServiceJpaRepositoryImpl implements
InterestRateChartWritePlatformService {
- @SuppressWarnings("unused")
- private static final Logger LOG =
LoggerFactory.getLogger(InterestRateChartWritePlatformServiceJpaRepositoryImpl.class);
@SuppressWarnings("unused")
private final PlatformSecurityContext context;
private final InterestRateChartDataValidator
interestRateChartDataValidator;
private final InterestRateChartAssembler interestRateChartAssembler;
private final InterestRateChartRepositoryWrapper
interestRateChartRepository;
- @Autowired
- public
InterestRateChartWritePlatformServiceJpaRepositoryImpl(PlatformSecurityContext
context,
- final InterestRateChartDataValidator
interestRateChartDataValidator,
- final InterestRateChartAssembler interestRateChartAssembler,
- final InterestRateChartRepositoryWrapper
interestRateChartRepository) {
- this.context = context;
- this.interestRateChartDataValidator = interestRateChartDataValidator;
- this.interestRateChartAssembler = interestRateChartAssembler;
- this.interestRateChartRepository = interestRateChartRepository;
- }
-
@Override
@Transactional
public CommandProcessingResult create(JsonCommand command) {
diff --git
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/starter/InterestRateChartConfiguration.java
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/starter/InterestRateChartConfiguration.java
new file mode 100644
index 000000000..3c18b2327
--- /dev/null
+++
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/starter/InterestRateChartConfiguration.java
@@ -0,0 +1,144 @@
+/**
+ * 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.interestratechart.starter;
+
+import
org.apache.fineract.infrastructure.codes.service.CodeValueReadPlatformService;
+import org.apache.fineract.infrastructure.core.serialization.FromJsonHelper;
+import
org.apache.fineract.infrastructure.core.service.database.DatabaseSpecificSQLGenerator;
+import
org.apache.fineract.infrastructure.security.service.PlatformSecurityContext;
+import
org.apache.fineract.portfolio.interestratechart.data.InterestRateChartDataValidator;
+import
org.apache.fineract.portfolio.interestratechart.data.InterestRateChartSlabDataValidator;
+import
org.apache.fineract.portfolio.interestratechart.domain.InterestRateChartRepositoryWrapper;
+import
org.apache.fineract.portfolio.interestratechart.domain.InterestRateChartSlabRepository;
+import
org.apache.fineract.portfolio.interestratechart.service.InterestIncentiveAssembler;
+import
org.apache.fineract.portfolio.interestratechart.service.InterestIncentiveDropdownReadPlatformService;
+import
org.apache.fineract.portfolio.interestratechart.service.InterestIncentivesDropdownReadPlatformServiceImpl;
+import
org.apache.fineract.portfolio.interestratechart.service.InterestRateChartAssembler;
+import
org.apache.fineract.portfolio.interestratechart.service.InterestRateChartDropdownReadPlatformService;
+import
org.apache.fineract.portfolio.interestratechart.service.InterestRateChartDropdownReadPlatformServiceImpl;
+import
org.apache.fineract.portfolio.interestratechart.service.InterestRateChartReadPlatformService;
+import
org.apache.fineract.portfolio.interestratechart.service.InterestRateChartReadPlatformServiceImpl;
+import
org.apache.fineract.portfolio.interestratechart.service.InterestRateChartSlabAssembler;
+import
org.apache.fineract.portfolio.interestratechart.service.InterestRateChartSlabReadPlatformService;
+import
org.apache.fineract.portfolio.interestratechart.service.InterestRateChartSlabReadPlatformServiceImpl;
+import
org.apache.fineract.portfolio.interestratechart.service.InterestRateChartSlabWritePlatformService;
+import
org.apache.fineract.portfolio.interestratechart.service.InterestRateChartSlabWritePlatformServiceJpaRepositoryImpl;
+import
org.apache.fineract.portfolio.interestratechart.service.InterestRateChartWritePlatformService;
+import
org.apache.fineract.portfolio.interestratechart.service.InterestRateChartWritePlatformServiceJpaRepositoryImpl;
+import org.apache.fineract.portfolio.savings.domain.SavingsProductRepository;
+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 InterestRateChartConfiguration {
+
+ @Bean
+ @ConditionalOnMissingBean(InterestIncentiveAssembler.class)
+ public InterestIncentiveAssembler
interestIncentiveAssembler(FromJsonHelper fromApiJsonHelper) {
+ return new InterestIncentiveAssembler(fromApiJsonHelper);
+ }
+
+ @Bean
+
@ConditionalOnMissingBean(InterestIncentiveDropdownReadPlatformService.class)
+ public InterestIncentiveDropdownReadPlatformService
interestIncentiveDropdownReadPlatformService(
+
+ ) {
+ return new InterestIncentivesDropdownReadPlatformServiceImpl(
+
+ );
+ }
+
+ @Bean
+ @ConditionalOnMissingBean(InterestRateChartAssembler.class)
+ public InterestRateChartAssembler
interestRateChartAssembler(FromJsonHelper fromApiJsonHelper,
+ InterestRateChartRepositoryWrapper
interestRateChartRepositoryWrapper, InterestRateChartSlabAssembler
chartSlabAssembler) {
+ return new InterestRateChartAssembler(fromApiJsonHelper,
interestRateChartRepositoryWrapper, chartSlabAssembler);
+ }
+
+ @Bean
+
@ConditionalOnMissingBean(InterestRateChartDropdownReadPlatformService.class)
+ public InterestRateChartDropdownReadPlatformService
interestRateChartDropdownReadPlatformService(
+
+ ) {
+ return new InterestRateChartDropdownReadPlatformServiceImpl(
+
+ );
+ }
+
+ @Bean
+ @ConditionalOnMissingBean(InterestRateChartReadPlatformService.class)
+ public InterestRateChartReadPlatformService
interestRateChartReadPlatformService(PlatformSecurityContext context,
+ JdbcTemplate jdbcTemplate,
InterestRateChartDropdownReadPlatformService chartDropdownReadPlatformService,
+ InterestIncentiveDropdownReadPlatformService
interestIncentiveDropdownReadPlatformService,
+ CodeValueReadPlatformService codeValueReadPlatformService,
DatabaseSpecificSQLGenerator sqlGenerator) {
+ return new InterestRateChartReadPlatformServiceImpl(context,
jdbcTemplate, chartDropdownReadPlatformService,
+ interestIncentiveDropdownReadPlatformService,
codeValueReadPlatformService, sqlGenerator);
+ }
+
+ @Bean
+ @ConditionalOnMissingBean(InterestRateChartSlabAssembler.class)
+ public InterestRateChartSlabAssembler
interestRateChartSlabAssembler(FromJsonHelper fromApiJsonHelper,
+ InterestRateChartRepositoryWrapper
interestRateChartRepositoryWrapper, InterestIncentiveAssembler
incentiveAssembler) {
+ return new InterestRateChartSlabAssembler(fromApiJsonHelper,
interestRateChartRepositoryWrapper, incentiveAssembler);
+ }
+
+ @Bean
+ public
InterestRateChartSlabReadPlatformServiceImpl.InterestRateChartSlabExtractor
interestRateChartSlabExtractor(
+ DatabaseSpecificSQLGenerator sqlGenerator) {
+ return new
InterestRateChartSlabReadPlatformServiceImpl.InterestRateChartSlabExtractor(sqlGenerator);
+ }
+
+ @Bean
+ @ConditionalOnMissingBean(InterestRateChartSlabReadPlatformService.class)
+ public InterestRateChartSlabReadPlatformService
interestRateChartSlabReadPlatformService(
+
+ PlatformSecurityContext context, JdbcTemplate jdbcTemplate,
+
InterestRateChartSlabReadPlatformServiceImpl.InterestRateChartSlabExtractor
chartSlabExtractor,
+ InterestRateChartDropdownReadPlatformService
chartDropdownReadPlatformService,
+ InterestIncentiveDropdownReadPlatformService
interestIncentiveDropdownReadPlatformService,
+ CodeValueReadPlatformService codeValueReadPlatformService) {
+ return new InterestRateChartSlabReadPlatformServiceImpl(context,
jdbcTemplate, chartSlabExtractor, chartDropdownReadPlatformService,
+ interestIncentiveDropdownReadPlatformService,
codeValueReadPlatformService);
+ }
+
+ @Bean
+ @ConditionalOnMissingBean(InterestRateChartSlabWritePlatformService.class)
+ public InterestRateChartSlabWritePlatformService
interestRateChartSlabWritePlatformService(
+
+ PlatformSecurityContext context,
InterestRateChartSlabDataValidator interestRateChartSlabDataValidator,
+ InterestRateChartAssembler interestRateChartAssembler,
InterestRateChartSlabAssembler interestRateChartSlabAssembler,
+ InterestRateChartRepositoryWrapper interestRateChartRepository,
InterestRateChartSlabRepository chartSlabRepository,
+ SavingsProductRepository savingsProductRepository) {
+ return new
InterestRateChartSlabWritePlatformServiceJpaRepositoryImpl(context,
interestRateChartSlabDataValidator,
+ interestRateChartAssembler, interestRateChartSlabAssembler,
interestRateChartRepository, chartSlabRepository,
+ savingsProductRepository);
+ }
+
+ @Bean
+ @ConditionalOnMissingBean(InterestRateChartWritePlatformService.class)
+ public InterestRateChartWritePlatformService
interestRateChartWritePlatformService(PlatformSecurityContext context,
+ InterestRateChartDataValidator interestRateChartDataValidator,
InterestRateChartAssembler interestRateChartAssembler,
+ InterestRateChartRepositoryWrapper interestRateChartRepository) {
+ return new
InterestRateChartWritePlatformServiceJpaRepositoryImpl(context,
interestRateChartDataValidator,
+ interestRateChartAssembler, interestRateChartRepository);
+ }
+
+}