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 69c3d575b FINERACT-1932: Add stater configuration class for
provider.paymenttype services
69c3d575b is described below
commit 69c3d575b7315241581beb0f06c803343a3a6e35
Author: Mohamed Magdi-Abdelmonem <[email protected]>
AuthorDate: Tue Oct 3 21:10:20 2023 +0300
FINERACT-1932: Add stater configuration class for provider.paymenttype
services
---
.../PaymentTypeReadPlatformServiceImpl.java | 2 -
.../service/PaymentTypeWriteServiceImpl.java | 2 -
.../starter/PaymentTypeConfiguration.java | 50 ++++++++++++++++++++++
3 files changed, 50 insertions(+), 4 deletions(-)
diff --git
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/paymenttype/service/PaymentTypeReadPlatformServiceImpl.java
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/paymenttype/service/PaymentTypeReadPlatformServiceImpl.java
index a7edbd5d4..9b6588d0d 100644
---
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/paymenttype/service/PaymentTypeReadPlatformServiceImpl.java
+++
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/paymenttype/service/PaymentTypeReadPlatformServiceImpl.java
@@ -27,9 +27,7 @@ import
org.apache.fineract.portfolio.paymenttype.domain.PaymentType;
import
org.apache.fineract.portfolio.paymenttype.domain.PaymentTypeRepositoryWrapper;
import org.apache.fineract.portfolio.paymenttype.mapper.PaymentTypeMapper;
import org.springframework.cache.annotation.Cacheable;
-import org.springframework.stereotype.Service;
-@Service
@RequiredArgsConstructor
public class PaymentTypeReadPlatformServiceImpl implements
PaymentTypeReadPlatformService {
diff --git
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/paymenttype/service/PaymentTypeWriteServiceImpl.java
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/paymenttype/service/PaymentTypeWriteServiceImpl.java
index aa5a893c6..019b09cf5 100644
---
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/paymenttype/service/PaymentTypeWriteServiceImpl.java
+++
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/paymenttype/service/PaymentTypeWriteServiceImpl.java
@@ -32,9 +32,7 @@ import
org.apache.fineract.portfolio.paymenttype.domain.PaymentTypeRepositoryWra
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.dao.DataIntegrityViolationException;
import org.springframework.orm.jpa.JpaSystemException;
-import org.springframework.stereotype.Service;
-@Service
@RequiredArgsConstructor
public class PaymentTypeWriteServiceImpl implements PaymentTypeWriteService {
diff --git
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/paymenttype/starter/PaymentTypeConfiguration.java
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/paymenttype/starter/PaymentTypeConfiguration.java
new file mode 100644
index 000000000..c6c8ad523
--- /dev/null
+++
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/paymenttype/starter/PaymentTypeConfiguration.java
@@ -0,0 +1,50 @@
+/**
+ * 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.paymenttype.starter;
+
+import
org.apache.fineract.infrastructure.security.service.PlatformSecurityContext;
+import org.apache.fineract.portfolio.paymenttype.data.PaymentTypeDataValidator;
+import org.apache.fineract.portfolio.paymenttype.domain.PaymentTypeRepository;
+import
org.apache.fineract.portfolio.paymenttype.domain.PaymentTypeRepositoryWrapper;
+import org.apache.fineract.portfolio.paymenttype.mapper.PaymentTypeMapper;
+import
org.apache.fineract.portfolio.paymenttype.service.PaymentTypeReadPlatformService;
+import
org.apache.fineract.portfolio.paymenttype.service.PaymentTypeReadPlatformServiceImpl;
+import
org.apache.fineract.portfolio.paymenttype.service.PaymentTypeWriteService;
+import
org.apache.fineract.portfolio.paymenttype.service.PaymentTypeWriteServiceImpl;
+import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+@Configuration
+public class PaymentTypeConfiguration {
+
+ @Bean
+ @ConditionalOnMissingBean(PaymentTypeReadPlatformService.class)
+ PaymentTypeReadPlatformService
paymentTypeReadPlatformService(PlatformSecurityContext context,
PaymentTypeMapper paymentTypeMapper,
+ PaymentTypeRepositoryWrapper paymentTypeRepositoryWrapper) {
+ return new PaymentTypeReadPlatformServiceImpl(context,
paymentTypeMapper, paymentTypeRepositoryWrapper);
+ }
+
+ @Bean
+ @ConditionalOnMissingBean(PaymentTypeWriteService.class)
+ PaymentTypeWriteService paymentTypeWriteService(PaymentTypeRepository
repository, PaymentTypeRepositoryWrapper repositoryWrapper,
+ PaymentTypeDataValidator fromApiJsonDeserializer) {
+ return new PaymentTypeWriteServiceImpl(repository, repositoryWrapper,
fromApiJsonDeserializer);
+ }
+}