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 93b8ab867 Add custom Configuration class for organisation/office
module (FINERACT-1932)
93b8ab867 is described below
commit 93b8ab8678086ae146f9575b5298637992f2da70
Author: Sinha, Abhinav <[email protected]>
AuthorDate: Mon Oct 23 17:25:52 2023 -0400
Add custom Configuration class for organisation/office module
(FINERACT-1932)
---
.../service/OfficeReadPlatformServiceImpl.java | 2 -
...fficeWritePlatformServiceJpaRepositoryImpl.java | 2 -
.../starter/OrganisationOfficeConfiguration.java | 64 ++++++++++++++++++++++
3 files changed, 64 insertions(+), 4 deletions(-)
diff --git
a/fineract-provider/src/main/java/org/apache/fineract/organisation/office/service/OfficeReadPlatformServiceImpl.java
b/fineract-provider/src/main/java/org/apache/fineract/organisation/office/service/OfficeReadPlatformServiceImpl.java
index e606fa323..3b8b4914e 100644
---
a/fineract-provider/src/main/java/org/apache/fineract/organisation/office/service/OfficeReadPlatformServiceImpl.java
+++
b/fineract-provider/src/main/java/org/apache/fineract/organisation/office/service/OfficeReadPlatformServiceImpl.java
@@ -45,9 +45,7 @@ import org.springframework.cache.annotation.Cacheable;
import org.springframework.dao.EmptyResultDataAccessException;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper;
-import org.springframework.stereotype.Service;
-@Service
@RequiredArgsConstructor
public class OfficeReadPlatformServiceImpl implements
OfficeReadPlatformService {
diff --git
a/fineract-provider/src/main/java/org/apache/fineract/organisation/office/service/OfficeWritePlatformServiceJpaRepositoryImpl.java
b/fineract-provider/src/main/java/org/apache/fineract/organisation/office/service/OfficeWritePlatformServiceJpaRepositoryImpl.java
index a2e6395d7..4373e657f 100644
---
a/fineract-provider/src/main/java/org/apache/fineract/organisation/office/service/OfficeWritePlatformServiceJpaRepositoryImpl.java
+++
b/fineract-provider/src/main/java/org/apache/fineract/organisation/office/service/OfficeWritePlatformServiceJpaRepositoryImpl.java
@@ -44,10 +44,8 @@ import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Caching;
import org.springframework.dao.DataIntegrityViolationException;
import org.springframework.orm.jpa.JpaSystemException;
-import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
-@Service
@Slf4j
@RequiredArgsConstructor
public class OfficeWritePlatformServiceJpaRepositoryImpl implements
OfficeWritePlatformService {
diff --git
a/fineract-provider/src/main/java/org/apache/fineract/organisation/office/starter/OrganisationOfficeConfiguration.java
b/fineract-provider/src/main/java/org/apache/fineract/organisation/office/starter/OrganisationOfficeConfiguration.java
new file mode 100644
index 000000000..e07746e6c
--- /dev/null
+++
b/fineract-provider/src/main/java/org/apache/fineract/organisation/office/starter/OrganisationOfficeConfiguration.java
@@ -0,0 +1,64 @@
+/**
+ * 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.organisation.office.starter;
+
+import
org.apache.fineract.infrastructure.core.service.database.DatabaseSpecificSQLGenerator;
+import
org.apache.fineract.infrastructure.security.service.PlatformSecurityContext;
+import org.apache.fineract.infrastructure.security.utils.ColumnValidator;
+import
org.apache.fineract.organisation.monetary.domain.ApplicationCurrencyRepositoryWrapper;
+import
org.apache.fineract.organisation.monetary.service.CurrencyReadPlatformService;
+import org.apache.fineract.organisation.office.domain.OfficeRepository;
+import org.apache.fineract.organisation.office.domain.OfficeRepositoryWrapper;
+import
org.apache.fineract.organisation.office.domain.OfficeTransactionRepository;
+import org.apache.fineract.organisation.office.mapper.OfficeDataMapper;
+import
org.apache.fineract.organisation.office.serialization.OfficeCommandFromApiJsonDeserializer;
+import
org.apache.fineract.organisation.office.serialization.OfficeTransactionCommandFromApiJsonDeserializer;
+import
org.apache.fineract.organisation.office.service.OfficeReadPlatformService;
+import
org.apache.fineract.organisation.office.service.OfficeReadPlatformServiceImpl;
+import
org.apache.fineract.organisation.office.service.OfficeWritePlatformService;
+import
org.apache.fineract.organisation.office.service.OfficeWritePlatformServiceJpaRepositoryImpl;
+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 OrganisationOfficeConfiguration {
+
+ @Bean
+ @ConditionalOnMissingBean(OfficeReadPlatformService.class)
+ public OfficeReadPlatformService officeReadPlatformService(JdbcTemplate
jdbcTemplate, DatabaseSpecificSQLGenerator sqlGenerator,
+ PlatformSecurityContext context, CurrencyReadPlatformService
currencyReadPlatformService, ColumnValidator columnValidator,
+ OfficeRepository officeRepository, OfficeDataMapper
officeDataMapper) {
+ return new OfficeReadPlatformServiceImpl(jdbcTemplate, sqlGenerator,
context, currencyReadPlatformService, columnValidator,
+ officeRepository, officeDataMapper);
+ }
+
+ @Bean
+ @ConditionalOnMissingBean(OfficeWritePlatformService.class)
+ public OfficeWritePlatformService
officeWritePlatformService(PlatformSecurityContext context,
+ OfficeCommandFromApiJsonDeserializer fromApiJsonDeserializer,
+ OfficeTransactionCommandFromApiJsonDeserializer
moneyTransferCommandFromApiJsonDeserializer,
+ OfficeRepositoryWrapper officeRepositoryWrapper,
OfficeTransactionRepository officeTransactionRepository,
+ ApplicationCurrencyRepositoryWrapper
applicationCurrencyRepository) {
+ return new OfficeWritePlatformServiceJpaRepositoryImpl(context,
fromApiJsonDeserializer,
+ moneyTransferCommandFromApiJsonDeserializer,
officeRepositoryWrapper, officeTransactionRepository,
+ applicationCurrencyRepository);
+ }
+}