diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/BulkLoansReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/BulkLoansReadPlatformServiceImpl.java index 20e8ac58583..48ba7dca4a5 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/BulkLoansReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/BulkLoansReadPlatformServiceImpl.java @@ -32,9 +32,7 @@ import org.apache.fineract.portfolio.group.domain.GroupingTypeStatus; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.RowMapper; -import org.springframework.stereotype.Service; -@Service @RequiredArgsConstructor public class BulkLoansReadPlatformServiceImpl implements BulkLoansReadPlatformService { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/GLIMAccountInfoReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/GLIMAccountInfoReadPlatformServiceImpl.java index 76a9936df36..82b630e9a72 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/GLIMAccountInfoReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/GLIMAccountInfoReadPlatformServiceImpl.java @@ -25,6 +25,7 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; +import lombok.RequiredArgsConstructor; import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext; import org.apache.fineract.portfolio.accountdetails.data.LoanAccountSummaryData; import org.apache.fineract.portfolio.accountdetails.service.AccountDetailsReadPlatformService; @@ -32,27 +33,16 @@ import org.apache.fineract.portfolio.loanaccount.data.GlimRepaymentTemplate; import org.apache.fineract.portfolio.loanaccount.data.GroupLoanIndividualMonitoringAccountData; import org.apache.fineract.portfolio.loanaccount.domain.LoanStatus; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.RowMapper; -import org.springframework.stereotype.Service; -@Service +@RequiredArgsConstructor public class GLIMAccountInfoReadPlatformServiceImpl implements GLIMAccountInfoReadPlatformService { private final JdbcTemplate jdbcTemplate; private final PlatformSecurityContext context; private final AccountDetailsReadPlatformService accountDetailsReadPlatforService; - @Autowired - public GLIMAccountInfoReadPlatformServiceImpl(final PlatformSecurityContext context, final JdbcTemplate jdbcTemplate, - final AccountDetailsReadPlatformService accountDetailsReadPlatforService) { - this.context = context; - this.jdbcTemplate = jdbcTemplate; - this.accountDetailsReadPlatforService = accountDetailsReadPlatforService; - - } - private static final class GLIMFieldsMapper implements RowMapper { public String schema() { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/GLIMAccountInfoWritePlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/GLIMAccountInfoWritePlatformServiceImpl.java index 23ca79539ac..f07da8036b0 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/GLIMAccountInfoWritePlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/GLIMAccountInfoWritePlatformServiceImpl.java @@ -20,15 +20,14 @@ package org.apache.fineract.portfolio.loanaccount.service; import java.math.BigDecimal; +import lombok.RequiredArgsConstructor; import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext; import org.apache.fineract.portfolio.group.domain.Group; import org.apache.fineract.portfolio.loanaccount.domain.GLIMAccountInfoRepository; import org.apache.fineract.portfolio.loanaccount.domain.GroupLoanIndividualMonitoringAccount; import org.apache.fineract.portfolio.loanaccount.domain.LoanRepository; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -@Service +@RequiredArgsConstructor public class GLIMAccountInfoWritePlatformServiceImpl implements GLIMAccountInfoWritePlatformService { private final PlatformSecurityContext context; @@ -37,14 +36,6 @@ public class GLIMAccountInfoWritePlatformServiceImpl implements GLIMAccountInfoW private final LoanRepository loanRepository; - @Autowired - public GLIMAccountInfoWritePlatformServiceImpl(final PlatformSecurityContext context, - final GLIMAccountInfoRepository glimAccountRepository, final LoanRepository loanRepository) { - this.context = context; - this.glimAccountRepository = glimAccountRepository; - this.loanRepository = loanRepository; - } - @Override public void addGLIMAccountInfo(String accountNumber, Group group, BigDecimal principalAmount, Long childAccountsCount, Boolean isAcceptingChild, Integer loanStatus, BigDecimal applicationId) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanAccrualPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanAccrualPlatformServiceImpl.java index abe7867f3ea..85a6a8dcfc9 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanAccrualPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanAccrualPlatformServiceImpl.java @@ -29,9 +29,7 @@ import org.apache.fineract.infrastructure.jobs.exception.JobExecutionException; import org.apache.fineract.portfolio.loanaccount.data.LoanScheduleAccrualData; import org.apache.fineract.portfolio.loanaccount.domain.Loan; -import org.springframework.stereotype.Service; -@Service @Slf4j @RequiredArgsConstructor public class LoanAccrualPlatformServiceImpl implements LoanAccrualPlatformService { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanAccrualTransactionBusinessEventServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanAccrualTransactionBusinessEventServiceImpl.java index 2afa34d7a7a..0a0c8499797 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanAccrualTransactionBusinessEventServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanAccrualTransactionBusinessEventServiceImpl.java @@ -24,9 +24,7 @@ import org.apache.fineract.infrastructure.event.business.service.BusinessEventNotifierService; import org.apache.fineract.portfolio.loanaccount.domain.Loan; import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction; -import org.springframework.stereotype.Service; -@Service @RequiredArgsConstructor public class LoanAccrualTransactionBusinessEventServiceImpl implements LoanAccrualTransactionBusinessEventService { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanAccrualWritePlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanAccrualWritePlatformServiceImpl.java index 69a84374782..dfe907b70f2 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanAccrualWritePlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanAccrualWritePlatformServiceImpl.java @@ -60,10 +60,8 @@ import org.apache.fineract.useradministration.domain.AppUser; import org.springframework.dao.DataAccessException; import org.springframework.jdbc.core.JdbcTemplate; -import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -@Service @RequiredArgsConstructor public class LoanAccrualWritePlatformServiceImpl implements LoanAccrualWritePlatformService { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanApplicationWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanApplicationWritePlatformServiceJpaRepositoryImpl.java index 13696fc18fe..ea34b502a40 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanApplicationWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanApplicationWritePlatformServiceJpaRepositoryImpl.java @@ -144,11 +144,9 @@ import org.apache.fineract.useradministration.domain.AppUser; import org.springframework.dao.DataIntegrityViolationException; import org.springframework.orm.jpa.JpaSystemException; -import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; -@Service @Slf4j @RequiredArgsConstructor public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements LoanApplicationWritePlatformService { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanArrearsAgingServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanArrearsAgingServiceImpl.java index 0401aa61967..93ecfb0dab3 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanArrearsAgingServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanArrearsAgingServiceImpl.java @@ -58,9 +58,7 @@ import org.springframework.dao.DataAccessException; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.ResultSetExtractor; -import org.springframework.stereotype.Service; -@Service @Slf4j @RequiredArgsConstructor public class LoanArrearsAgingServiceImpl implements LoanArrearsAgingService { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanAssembler.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanAssembler.java index 78a8eead90b..80f7a077041 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanAssembler.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanAssembler.java @@ -86,9 +86,7 @@ import org.apache.fineract.portfolio.loanproduct.exception.LoanProductNotFoundException; import org.apache.fineract.portfolio.rate.domain.Rate; import org.apache.fineract.portfolio.rate.service.RateAssembler; -import org.springframework.stereotype.Service; -@Service @RequiredArgsConstructor public class LoanAssembler { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanCalculateRepaymentPastDueService.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanCalculateRepaymentPastDueService.java index 15cf05d8a1c..23bdf788f6d 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanCalculateRepaymentPastDueService.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanCalculateRepaymentPastDueService.java @@ -22,14 +22,14 @@ import java.time.LocalDate; import java.util.List; import java.util.stream.Collectors; +import lombok.NoArgsConstructor; import org.apache.fineract.infrastructure.core.service.DateUtils; import org.apache.fineract.organisation.monetary.domain.MonetaryCurrency; import org.apache.fineract.portfolio.loanaccount.data.LoanRepaymentPastDueData; import org.apache.fineract.portfolio.loanaccount.domain.Loan; import org.apache.fineract.portfolio.loanaccount.domain.LoanRepaymentScheduleInstallment; -import org.springframework.stereotype.Component; -@Component +@NoArgsConstructor public class LoanCalculateRepaymentPastDueService { public LoanRepaymentPastDueData retrieveLoanRepaymentPastDueAmountTillDate(Loan loan) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanChargeAssembler.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanChargeAssembler.java index 827c8d3ef2b..5dd39775f4b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanChargeAssembler.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanChargeAssembler.java @@ -50,9 +50,7 @@ import org.apache.fineract.portfolio.loanproduct.domain.LoanProduct; import org.apache.fineract.portfolio.loanproduct.domain.LoanProductRepository; import org.apache.fineract.portfolio.loanproduct.exception.LoanProductNotFoundException; -import org.springframework.stereotype.Service; -@Service @RequiredArgsConstructor public class LoanChargeAssembler { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanChargePaidByReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanChargePaidByReadPlatformServiceImpl.java index 82591ec5ab7..976c04f2e31 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanChargePaidByReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanChargePaidByReadPlatformServiceImpl.java @@ -23,26 +23,18 @@ import java.sql.ResultSet; import java.sql.SQLException; import java.util.List; +import lombok.RequiredArgsConstructor; import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext; import org.apache.fineract.portfolio.loanaccount.data.LoanChargePaidByData; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.RowMapper; -import org.springframework.stereotype.Service; -@Service +@RequiredArgsConstructor public class LoanChargePaidByReadPlatformServiceImpl implements LoanChargePaidByReadPlatformService { private final JdbcTemplate jdbcTemplate; private final PlatformSecurityContext context; - @Autowired - public LoanChargePaidByReadPlatformServiceImpl(final PlatformSecurityContext context, final JdbcTemplate jdbcTemplate) { - this.context = context; - this.jdbcTemplate = jdbcTemplate; - - } - @Override public List getLoanChargesPaidByTransactionId(Long transactionId) { this.context.authenticatedUser(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanChargeReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanChargeReadPlatformServiceImpl.java index f61c454ff07..79d2e453298 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanChargeReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanChargeReadPlatformServiceImpl.java @@ -51,9 +51,7 @@ 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 LoanChargeReadPlatformServiceImpl implements LoanChargeReadPlatformService { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanChargeWritePlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanChargeWritePlatformServiceImpl.java index 27c292d5268..d155d19112d 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanChargeWritePlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanChargeWritePlatformServiceImpl.java @@ -130,11 +130,9 @@ import org.apache.fineract.portfolio.paymentdetail.domain.PaymentDetail; import org.apache.fineract.portfolio.paymentdetail.service.PaymentDetailWritePlatformService; import org.apache.fineract.portfolio.savings.domain.SavingsAccount; -import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @Slf4j -@Service @RequiredArgsConstructor public class LoanChargeWritePlatformServiceImpl implements LoanChargeWritePlatformService { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanReadPlatformServiceImpl.java index f4715ae18a0..4e71c64dfb6 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanReadPlatformServiceImpl.java @@ -141,12 +141,10 @@ import org.springframework.jdbc.core.ResultSetExtractor; import org.springframework.jdbc.core.RowMapper; import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; -import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; @AllArgsConstructor -@Service @Transactional(readOnly = true) public class LoanReadPlatformServiceImpl implements LoanReadPlatformService, LoanReadPlatformServiceCommon { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanStatusChangePlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanStatusChangePlatformServiceImpl.java index 241d608d1d5..5ca41a4f318 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanStatusChangePlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanStatusChangePlatformServiceImpl.java @@ -26,11 +26,9 @@ import org.apache.fineract.infrastructure.event.business.service.BusinessEventNotifierService; import org.apache.fineract.portfolio.loanaccount.domain.Loan; import org.apache.fineract.portfolio.loanaccount.domain.LoanAccountDomainServiceJpa; -import org.springframework.stereotype.Service; @Slf4j @RequiredArgsConstructor -@Service public class LoanStatusChangePlatformServiceImpl implements LoanStatusChangePlatformService { private final BusinessEventNotifierService businessEventNotifierService; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanUtilService.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanUtilService.java index 7c1450b569f..6ea1add5a29 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanUtilService.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanUtilService.java @@ -26,6 +26,7 @@ import java.util.List; import java.util.Locale; import java.util.Set; +import lombok.RequiredArgsConstructor; import org.apache.commons.lang3.StringUtils; import org.apache.fineract.infrastructure.configuration.domain.ConfigurationDomainService; import org.apache.fineract.infrastructure.core.exception.PlatformServiceUnavailableException; @@ -59,10 +60,8 @@ import org.apache.fineract.portfolio.loanaccount.domain.LoanTransactionType; import org.apache.fineract.portfolio.loanaccount.loanschedule.domain.LoanScheduleGeneratorFactory; import org.apache.fineract.portfolio.loanproduct.domain.LoanProductRelatedDetail; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; -@Component +@RequiredArgsConstructor public class LoanUtilService { private final ApplicationCurrencyRepositoryWrapper applicationCurrencyRepository; @@ -75,23 +74,6 @@ public class LoanUtilService { private final FromJsonHelper fromApiJsonHelper; private final CalendarReadPlatformService calendarReadPlatformService; - @Autowired - public LoanUtilService(final ApplicationCurrencyRepositoryWrapper applicationCurrencyRepository, - final CalendarInstanceRepository calendarInstanceRepository, final ConfigurationDomainService configurationDomainService, - final HolidayRepository holidayRepository, final WorkingDaysRepositoryWrapper workingDaysRepository, - final LoanScheduleGeneratorFactory loanScheduleFactory, final FloatingRatesReadPlatformService floatingRatesReadPlatformService, - final FromJsonHelper fromApiJsonHelper, final CalendarReadPlatformService calendarReadPlatformService) { - this.applicationCurrencyRepository = applicationCurrencyRepository; - this.calendarInstanceRepository = calendarInstanceRepository; - this.configurationDomainService = configurationDomainService; - this.holidayRepository = holidayRepository; - this.workingDaysRepository = workingDaysRepository; - this.loanScheduleFactory = loanScheduleFactory; - this.floatingRatesReadPlatformService = floatingRatesReadPlatformService; - this.fromApiJsonHelper = fromApiJsonHelper; - this.calendarReadPlatformService = calendarReadPlatformService; - } - public ScheduleGeneratorDTO buildScheduleGeneratorDTO(final Loan loan, final LocalDate recalculateFrom) { final HolidayDetailDTO holidayDetailDTO = null; return buildScheduleGeneratorDTO(loan, recalculateFrom, holidayDetailDTO); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java index 4f0e5ae5d00..ef4fbd40a80 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java @@ -197,10 +197,8 @@ import org.apache.fineract.useradministration.domain.AppUser; 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 LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatformService { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/RecalculateInterestPoster.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/RecalculateInterestPoster.java index 6d0846fefca..396af75ee2a 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/RecalculateInterestPoster.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/RecalculateInterestPoster.java @@ -22,18 +22,14 @@ import java.util.Collection; import java.util.List; import java.util.concurrent.Callable; +import lombok.NoArgsConstructor; +import lombok.extern.slf4j.Slf4j; import org.apache.fineract.infrastructure.jobs.exception.JobExecutionException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.context.annotation.Scope; -import org.springframework.stereotype.Component; -@Component -@Scope("prototype") +@NoArgsConstructor +@Slf4j public class RecalculateInterestPoster implements Callable { - private static final Logger LOG = LoggerFactory.getLogger(RecalculateInterestPoster.class); - private Collection loanIds; private LoanWritePlatformService loanWritePlatformService; @@ -50,7 +46,7 @@ public Void call() throws JobExecutionException { if (!loanIds.isEmpty()) { List errors = new ArrayList<>(); for (Long loanId : loanIds) { - LOG.debug("Loan ID {}", loanId); + log.debug("Loan ID {}", loanId); try { loanWritePlatformService.recalculateInterest(loanId); } catch (Exception e) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/ReplayedTransactionBusinessEventServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/ReplayedTransactionBusinessEventServiceImpl.java index 1359e00e6b6..6ac3ca3d181 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/ReplayedTransactionBusinessEventServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/ReplayedTransactionBusinessEventServiceImpl.java @@ -26,9 +26,7 @@ import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction; import org.apache.fineract.portfolio.loanaccount.domain.LoanTransactionRepository; import org.apache.fineract.portfolio.loanaccount.exception.LoanTransactionNotFoundException; -import org.springframework.stereotype.Service; -@Service @RequiredArgsConstructor public class ReplayedTransactionBusinessEventServiceImpl implements ReplayedTransactionBusinessEventService { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/starter/LoanAccountConfiguration.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/starter/LoanAccountConfiguration.java new file mode 100644 index 00000000000..7a4f324d85d --- /dev/null +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/starter/LoanAccountConfiguration.java @@ -0,0 +1,433 @@ +/** + * 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.loanaccount.starter; + +import org.apache.fineract.accounting.journalentry.service.JournalEntryWritePlatformService; +import org.apache.fineract.batch.exception.ErrorHandler; +import org.apache.fineract.cob.service.LoanAccountLockService; +import org.apache.fineract.infrastructure.accountnumberformat.domain.AccountNumberFormatRepositoryWrapper; +import org.apache.fineract.infrastructure.codes.domain.CodeValueRepositoryWrapper; +import org.apache.fineract.infrastructure.codes.service.CodeValueReadPlatformService; +import org.apache.fineract.infrastructure.configuration.domain.ConfigurationDomainService; +import org.apache.fineract.infrastructure.configuration.domain.GlobalConfigurationRepositoryWrapper; +import org.apache.fineract.infrastructure.core.serialization.FromJsonHelper; +import org.apache.fineract.infrastructure.core.service.ExternalIdFactory; +import org.apache.fineract.infrastructure.core.service.PaginationHelper; +import org.apache.fineract.infrastructure.core.service.database.DatabaseSpecificSQLGenerator; +import org.apache.fineract.infrastructure.dataqueries.service.EntityDatatableChecksWritePlatformService; +import org.apache.fineract.infrastructure.entityaccess.domain.FineractEntityRelationRepository; +import org.apache.fineract.infrastructure.entityaccess.domain.FineractEntityToEntityMappingRepository; +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.holiday.domain.HolidayRepository; +import org.apache.fineract.organisation.holiday.domain.HolidayRepositoryWrapper; +import org.apache.fineract.organisation.monetary.domain.ApplicationCurrencyRepositoryWrapper; +import org.apache.fineract.organisation.office.domain.OfficeRepository; +import org.apache.fineract.organisation.staff.domain.StaffRepository; +import org.apache.fineract.organisation.staff.service.StaffReadPlatformService; +import org.apache.fineract.organisation.teller.data.CashierTransactionDataValidator; +import org.apache.fineract.organisation.workingdays.domain.WorkingDaysRepositoryWrapper; +import org.apache.fineract.portfolio.account.domain.AccountAssociationsRepository; +import org.apache.fineract.portfolio.account.domain.AccountTransferDetailRepository; +import org.apache.fineract.portfolio.account.service.AccountAssociationsReadPlatformService; +import org.apache.fineract.portfolio.account.service.AccountTransfersReadPlatformService; +import org.apache.fineract.portfolio.account.service.AccountTransfersWritePlatformService; +import org.apache.fineract.portfolio.accountdetails.service.AccountDetailsReadPlatformService; +import org.apache.fineract.portfolio.calendar.domain.CalendarInstanceRepository; +import org.apache.fineract.portfolio.calendar.domain.CalendarRepository; +import org.apache.fineract.portfolio.calendar.service.CalendarReadPlatformService; +import org.apache.fineract.portfolio.charge.domain.ChargeRepositoryWrapper; +import org.apache.fineract.portfolio.charge.service.ChargeDropdownReadPlatformService; +import org.apache.fineract.portfolio.charge.service.ChargeReadPlatformService; +import org.apache.fineract.portfolio.client.domain.AccountNumberGenerator; +import org.apache.fineract.portfolio.client.domain.ClientRepositoryWrapper; +import org.apache.fineract.portfolio.client.service.ClientReadPlatformService; +import org.apache.fineract.portfolio.collateralmanagement.service.LoanCollateralAssembler; +import org.apache.fineract.portfolio.common.service.DropdownReadPlatformService; +import org.apache.fineract.portfolio.delinquency.service.DelinquencyReadPlatformService; +import org.apache.fineract.portfolio.floatingrates.service.FloatingRatesReadPlatformService; +import org.apache.fineract.portfolio.fund.domain.FundRepository; +import org.apache.fineract.portfolio.fund.service.FundReadPlatformService; +import org.apache.fineract.portfolio.group.domain.GroupRepository; +import org.apache.fineract.portfolio.group.domain.GroupRepositoryWrapper; +import org.apache.fineract.portfolio.group.service.GroupReadPlatformService; +import org.apache.fineract.portfolio.loanaccount.domain.GLIMAccountInfoRepository; +import org.apache.fineract.portfolio.loanaccount.domain.LoanAccountDomainService; +import org.apache.fineract.portfolio.loanaccount.domain.LoanAccountDomainServiceJpa; +import org.apache.fineract.portfolio.loanaccount.domain.LoanChargeRepository; +import org.apache.fineract.portfolio.loanaccount.domain.LoanDisbursementDetailsRepository; +import org.apache.fineract.portfolio.loanaccount.domain.LoanLifecycleStateMachine; +import org.apache.fineract.portfolio.loanaccount.domain.LoanRepaymentScheduleInstallmentRepository; +import org.apache.fineract.portfolio.loanaccount.domain.LoanRepaymentScheduleTransactionProcessorFactory; +import org.apache.fineract.portfolio.loanaccount.domain.LoanRepository; +import org.apache.fineract.portfolio.loanaccount.domain.LoanRepositoryWrapper; +import org.apache.fineract.portfolio.loanaccount.domain.LoanSummaryWrapper; +import org.apache.fineract.portfolio.loanaccount.domain.LoanTransactionRelationRepository; +import org.apache.fineract.portfolio.loanaccount.domain.LoanTransactionRepository; +import org.apache.fineract.portfolio.loanaccount.guarantor.service.GuarantorDomainService; +import org.apache.fineract.portfolio.loanaccount.loanschedule.domain.AprCalculator; +import org.apache.fineract.portfolio.loanaccount.loanschedule.domain.LoanScheduleGeneratorFactory; +import org.apache.fineract.portfolio.loanaccount.loanschedule.service.LoanScheduleAssembler; +import org.apache.fineract.portfolio.loanaccount.loanschedule.service.LoanScheduleCalculationPlatformService; +import org.apache.fineract.portfolio.loanaccount.loanschedule.service.LoanScheduleHistoryWritePlatformService; +import org.apache.fineract.portfolio.loanaccount.mapper.LoanTransactionRelationMapper; +import org.apache.fineract.portfolio.loanaccount.serialization.LoanApplicationCommandFromApiJsonHelper; +import org.apache.fineract.portfolio.loanaccount.serialization.LoanApplicationTransitionApiJsonValidator; +import org.apache.fineract.portfolio.loanaccount.serialization.LoanChargeApiJsonValidator; +import org.apache.fineract.portfolio.loanaccount.serialization.LoanEventApiJsonValidator; +import org.apache.fineract.portfolio.loanaccount.serialization.LoanUpdateCommandFromApiJsonDeserializer; +import org.apache.fineract.portfolio.loanaccount.service.BulkLoansReadPlatformService; +import org.apache.fineract.portfolio.loanaccount.service.BulkLoansReadPlatformServiceImpl; +import org.apache.fineract.portfolio.loanaccount.service.GLIMAccountInfoReadPlatformService; +import org.apache.fineract.portfolio.loanaccount.service.GLIMAccountInfoReadPlatformServiceImpl; +import org.apache.fineract.portfolio.loanaccount.service.GLIMAccountInfoWritePlatformService; +import org.apache.fineract.portfolio.loanaccount.service.GLIMAccountInfoWritePlatformServiceImpl; +import org.apache.fineract.portfolio.loanaccount.service.LoanAccrualPlatformService; +import org.apache.fineract.portfolio.loanaccount.service.LoanAccrualPlatformServiceImpl; +import org.apache.fineract.portfolio.loanaccount.service.LoanAccrualTransactionBusinessEventService; +import org.apache.fineract.portfolio.loanaccount.service.LoanAccrualTransactionBusinessEventServiceImpl; +import org.apache.fineract.portfolio.loanaccount.service.LoanAccrualWritePlatformService; +import org.apache.fineract.portfolio.loanaccount.service.LoanAccrualWritePlatformServiceImpl; +import org.apache.fineract.portfolio.loanaccount.service.LoanApplicationWritePlatformService; +import org.apache.fineract.portfolio.loanaccount.service.LoanApplicationWritePlatformServiceJpaRepositoryImpl; +import org.apache.fineract.portfolio.loanaccount.service.LoanArrearsAgingService; +import org.apache.fineract.portfolio.loanaccount.service.LoanArrearsAgingServiceImpl; +import org.apache.fineract.portfolio.loanaccount.service.LoanAssembler; +import org.apache.fineract.portfolio.loanaccount.service.LoanCalculateRepaymentPastDueService; +import org.apache.fineract.portfolio.loanaccount.service.LoanChargeAssembler; +import org.apache.fineract.portfolio.loanaccount.service.LoanChargePaidByReadPlatformService; +import org.apache.fineract.portfolio.loanaccount.service.LoanChargePaidByReadPlatformServiceImpl; +import org.apache.fineract.portfolio.loanaccount.service.LoanChargeReadPlatformService; +import org.apache.fineract.portfolio.loanaccount.service.LoanChargeReadPlatformServiceImpl; +import org.apache.fineract.portfolio.loanaccount.service.LoanChargeWritePlatformService; +import org.apache.fineract.portfolio.loanaccount.service.LoanChargeWritePlatformServiceImpl; +import org.apache.fineract.portfolio.loanaccount.service.LoanReadPlatformService; +import org.apache.fineract.portfolio.loanaccount.service.LoanReadPlatformServiceImpl; +import org.apache.fineract.portfolio.loanaccount.service.LoanStatusChangePlatformService; +import org.apache.fineract.portfolio.loanaccount.service.LoanStatusChangePlatformServiceImpl; +import org.apache.fineract.portfolio.loanaccount.service.LoanUtilService; +import org.apache.fineract.portfolio.loanaccount.service.LoanWritePlatformService; +import org.apache.fineract.portfolio.loanaccount.service.LoanWritePlatformServiceJpaRepositoryImpl; +import org.apache.fineract.portfolio.loanaccount.service.RecalculateInterestPoster; +import org.apache.fineract.portfolio.loanaccount.service.ReplayedTransactionBusinessEventService; +import org.apache.fineract.portfolio.loanaccount.service.ReplayedTransactionBusinessEventServiceImpl; +import org.apache.fineract.portfolio.loanproduct.domain.LoanProductRepository; +import org.apache.fineract.portfolio.loanproduct.serialization.LoanProductDataValidator; +import org.apache.fineract.portfolio.loanproduct.service.LoanDropdownReadPlatformService; +import org.apache.fineract.portfolio.loanproduct.service.LoanProductReadPlatformService; +import org.apache.fineract.portfolio.note.domain.NoteRepository; +import org.apache.fineract.portfolio.paymentdetail.service.PaymentDetailWritePlatformService; +import org.apache.fineract.portfolio.paymenttype.service.PaymentTypeReadPlatformService; +import org.apache.fineract.portfolio.rate.service.RateAssembler; +import org.apache.fineract.portfolio.repaymentwithpostdatedchecks.domain.PostDatedChecksRepository; +import org.apache.fineract.portfolio.repaymentwithpostdatedchecks.service.RepaymentWithPostDatedChecksAssembler; +import org.apache.fineract.portfolio.savings.domain.SavingsAccountAssembler; +import org.apache.fineract.portfolio.savings.service.GSIMReadPlatformService; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Scope; +import org.springframework.jdbc.core.JdbcTemplate; +import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; + +@Configuration +public class LoanAccountConfiguration { + + @Bean + @ConditionalOnMissingBean(BulkLoansReadPlatformService.class) + public BulkLoansReadPlatformService bulkLoansReadPlatformServicev(JdbcTemplate jdbcTemplate, PlatformSecurityContext context, + AccountDetailsReadPlatformService accountDetailsReadPlatformService) { + return new BulkLoansReadPlatformServiceImpl(jdbcTemplate, context, accountDetailsReadPlatformService); + } + + @Bean + @ConditionalOnMissingBean(GLIMAccountInfoReadPlatformService.class) + public GLIMAccountInfoReadPlatformService glimAccountInfoReadPlatformService(JdbcTemplate jdbcTemplate, PlatformSecurityContext context, + AccountDetailsReadPlatformService accountDetailsReadPlatforService) { + return new GLIMAccountInfoReadPlatformServiceImpl(jdbcTemplate, context, accountDetailsReadPlatforService); + } + + @Bean + @ConditionalOnMissingBean(GLIMAccountInfoWritePlatformService.class) + public GLIMAccountInfoWritePlatformService glimAccountInfoWritePlatformService(PlatformSecurityContext context, + GLIMAccountInfoRepository glimAccountRepository, + + LoanRepository loanRepository) { + return new GLIMAccountInfoWritePlatformServiceImpl(context, glimAccountRepository, loanRepository); + } + + @Bean + @ConditionalOnMissingBean(LoanAccrualPlatformService.class) + public LoanAccrualPlatformService loanAccrualPlatformService(LoanReadPlatformService loanReadPlatformService, + LoanAccrualWritePlatformService loanAccrualWritePlatformService) { + return new LoanAccrualPlatformServiceImpl(loanReadPlatformService, loanAccrualWritePlatformService); + } + + @Bean + @ConditionalOnMissingBean(LoanAccrualTransactionBusinessEventService.class) + public LoanAccrualTransactionBusinessEventService loanAccrualTransactionBusinessEventService( + + BusinessEventNotifierService businessEventNotifierService) { + return new LoanAccrualTransactionBusinessEventServiceImpl(businessEventNotifierService); + } + + @Bean + @ConditionalOnMissingBean(LoanAccrualWritePlatformService.class) + public LoanAccrualWritePlatformService loanAccrualWritePlatformService(LoanReadPlatformService loanReadPlatformService, + LoanChargeReadPlatformService loanChargeReadPlatformService, JdbcTemplate jdbcTemplate, + DatabaseSpecificSQLGenerator sqlGenerator, JournalEntryWritePlatformService journalEntryWritePlatformService, + PlatformSecurityContext context, LoanRepositoryWrapper loanRepositoryWrapper, LoanRepository loanRepository, + OfficeRepository officeRepository, BusinessEventNotifierService businessEventNotifierService, + LoanTransactionRepository loanTransactionRepository, + LoanAccrualTransactionBusinessEventService loanAccrualTransactionBusinessEventService, + ConfigurationDomainService configurationDomainService, ExternalIdFactory externalIdFactory) { + return new LoanAccrualWritePlatformServiceImpl(loanReadPlatformService, loanChargeReadPlatformService, jdbcTemplate, sqlGenerator, + journalEntryWritePlatformService, context, loanRepositoryWrapper, loanRepository, officeRepository, + businessEventNotifierService, loanTransactionRepository, loanAccrualTransactionBusinessEventService, + configurationDomainService, externalIdFactory); + } + + @Bean + @ConditionalOnMissingBean(LoanApplicationWritePlatformService.class) + public LoanApplicationWritePlatformService loanApplicationWritePlatformService(PlatformSecurityContext context, + FromJsonHelper fromJsonHelper, LoanApplicationTransitionApiJsonValidator loanApplicationTransitionApiJsonValidator, + LoanProductDataValidator loanProductCommandFromApiJsonDeserializer, + LoanApplicationCommandFromApiJsonHelper fromApiJsonDeserializer, LoanRepositoryWrapper loanRepositoryWrapper, + NoteRepository noteRepository, LoanScheduleCalculationPlatformService calculationPlatformService, LoanAssembler loanAssembler, + ClientRepositoryWrapper clientRepository, LoanProductRepository loanProductRepository, LoanChargeAssembler loanChargeAssembler, + LoanCollateralAssembler loanCollateralAssembler, AprCalculator aprCalculator, AccountNumberGenerator accountNumberGenerator, + LoanSummaryWrapper loanSummaryWrapper, GroupRepositoryWrapper groupRepository, + LoanRepaymentScheduleTransactionProcessorFactory loanRepaymentScheduleTransactionProcessorFactory, + CalendarRepository calendarRepository, CalendarInstanceRepository calendarInstanceRepository, + SavingsAccountAssembler savingsAccountAssembler, AccountAssociationsRepository accountAssociationsRepository, + LoanReadPlatformService loanReadPlatformService, AccountNumberFormatRepositoryWrapper accountNumberFormatRepository, + BusinessEventNotifierService businessEventNotifierService, ConfigurationDomainService configurationDomainService, + LoanScheduleAssembler loanScheduleAssembler, LoanUtilService loanUtilService, + CalendarReadPlatformService calendarReadPlatformService, + EntityDatatableChecksWritePlatformService entityDatatableChecksWritePlatformService, + GlobalConfigurationRepositoryWrapper globalConfigurationRepository, + FineractEntityToEntityMappingRepository entityMappingRepository, + FineractEntityRelationRepository fineractEntityRelationRepository, + LoanProductReadPlatformService loanProductReadPlatformService, + + RateAssembler rateAssembler, GLIMAccountInfoWritePlatformService glimAccountInfoWritePlatformService, + GLIMAccountInfoRepository glimRepository, LoanRepository loanRepository, GSIMReadPlatformService gsimReadPlatformService, + LoanLifecycleStateMachine defaultLoanLifecycleStateMachine) { + return new LoanApplicationWritePlatformServiceJpaRepositoryImpl(context, fromJsonHelper, loanApplicationTransitionApiJsonValidator, + loanProductCommandFromApiJsonDeserializer, fromApiJsonDeserializer, loanRepositoryWrapper, noteRepository, + calculationPlatformService, loanAssembler, clientRepository, loanProductRepository, loanChargeAssembler, + loanCollateralAssembler, aprCalculator, accountNumberGenerator, loanSummaryWrapper, groupRepository, + loanRepaymentScheduleTransactionProcessorFactory, calendarRepository, calendarInstanceRepository, savingsAccountAssembler, + accountAssociationsRepository, loanReadPlatformService, accountNumberFormatRepository, businessEventNotifierService, + configurationDomainService, loanScheduleAssembler, loanUtilService, calendarReadPlatformService, + entityDatatableChecksWritePlatformService, globalConfigurationRepository, entityMappingRepository, + fineractEntityRelationRepository, loanProductReadPlatformService, rateAssembler, glimAccountInfoWritePlatformService, + glimRepository, loanRepository, gsimReadPlatformService, defaultLoanLifecycleStateMachine); + } + + @Bean + @ConditionalOnMissingBean(LoanArrearsAgingService.class) + public LoanArrearsAgingService loanArrearsAgingService(JdbcTemplate jdbcTemplate, + BusinessEventNotifierService businessEventNotifierService, DatabaseSpecificSQLGenerator sqlGenerator) { + return new LoanArrearsAgingServiceImpl(jdbcTemplate, businessEventNotifierService, sqlGenerator); + } + + @Bean + @ConditionalOnMissingBean(LoanAssembler.class) + public LoanAssembler loanAssembler(FromJsonHelper fromApiJsonHelper, LoanRepositoryWrapper loanRepository, + LoanProductRepository loanProductRepository, ClientRepositoryWrapper clientRepository, GroupRepository groupRepository, + FundRepository fundRepository, StaffRepository staffRepository, CodeValueRepositoryWrapper codeValueRepository, + LoanScheduleAssembler loanScheduleAssembler, LoanChargeAssembler loanChargeAssembler, + LoanCollateralAssembler collateralAssembler, LoanSummaryWrapper loanSummaryWrapper, + LoanRepaymentScheduleTransactionProcessorFactory loanRepaymentScheduleTransactionProcessorFactory, + HolidayRepository holidayRepository, ConfigurationDomainService configurationDomainService, + WorkingDaysRepositoryWrapper workingDaysRepository, LoanUtilService loanUtilService, RateAssembler rateAssembler, + LoanLifecycleStateMachine defaultLoanLifecycleStateMachine, ExternalIdFactory externalIdFactory) { + return new LoanAssembler(fromApiJsonHelper, loanRepository, loanProductRepository, clientRepository, groupRepository, + fundRepository, staffRepository, codeValueRepository, loanScheduleAssembler, loanChargeAssembler, collateralAssembler, + loanSummaryWrapper, loanRepaymentScheduleTransactionProcessorFactory, holidayRepository, configurationDomainService, + workingDaysRepository, loanUtilService, rateAssembler, defaultLoanLifecycleStateMachine, externalIdFactory); + } + + @Bean + @ConditionalOnMissingBean(LoanCalculateRepaymentPastDueService.class) + public LoanCalculateRepaymentPastDueService loanCalculateRepaymentPastDueService() { + return new LoanCalculateRepaymentPastDueService(); + } + + @Bean + @ConditionalOnMissingBean(LoanChargeAssembler.class) + public LoanChargeAssembler loanChargeAssembler( + + FromJsonHelper fromApiJsonHelper, ChargeRepositoryWrapper chargeRepository, LoanChargeRepository loanChargeRepository, + LoanProductRepository loanProductRepository, ExternalIdFactory externalIdFactory) { + return new LoanChargeAssembler(fromApiJsonHelper, chargeRepository, loanChargeRepository, loanProductRepository, externalIdFactory); + } + + @Bean + @ConditionalOnMissingBean(LoanChargePaidByReadPlatformService.class) + public LoanChargePaidByReadPlatformService loanChargePaidByReadPlatformService(JdbcTemplate jdbcTemplate, + PlatformSecurityContext context) { + return new LoanChargePaidByReadPlatformServiceImpl(jdbcTemplate, context); + } + + @Bean + @ConditionalOnMissingBean(LoanChargeReadPlatformService.class) + public LoanChargeReadPlatformService loanChargeReadPlatformService(JdbcTemplate jdbcTemplate, + ChargeDropdownReadPlatformService chargeDropdownReadPlatformService, DropdownReadPlatformService dropdownReadPlatformService, + LoanChargeRepository loanChargeRepository) { + return new LoanChargeReadPlatformServiceImpl(jdbcTemplate, chargeDropdownReadPlatformService, dropdownReadPlatformService, + loanChargeRepository); + } + + @Bean + @ConditionalOnMissingBean(LoanChargeWritePlatformService.class) + public LoanChargeWritePlatformService loanChargeWritePlatformService(LoanChargeApiJsonValidator loanChargeApiJsonValidator, + LoanAssembler loanAssembler, ChargeRepositoryWrapper chargeRepository, + BusinessEventNotifierService businessEventNotifierService, LoanTransactionRepository loanTransactionRepository, + AccountTransfersWritePlatformService accountTransfersWritePlatformService, LoanRepositoryWrapper loanRepositoryWrapper, + JournalEntryWritePlatformService journalEntryWritePlatformService, LoanAccountDomainService loanAccountDomainService, + LoanChargeRepository loanChargeRepository, LoanWritePlatformService loanWritePlatformService, LoanUtilService loanUtilService, + LoanChargeReadPlatformService loanChargeReadPlatformService, LoanLifecycleStateMachine defaultLoanLifecycleStateMachine, + AccountAssociationsReadPlatformService accountAssociationsReadPlatformService, FromJsonHelper fromApiJsonHelper, + ConfigurationDomainService configurationDomainService, + LoanRepaymentScheduleTransactionProcessorFactory loanRepaymentScheduleTransactionProcessorFactory, + ExternalIdFactory externalIdFactory, AccountTransferDetailRepository accountTransferDetailRepository, + LoanChargeAssembler loanChargeAssembler, ReplayedTransactionBusinessEventService replayedTransactionBusinessEventService, + PaymentDetailWritePlatformService paymentDetailWritePlatformService, NoteRepository noteRepository, + LoanAccrualTransactionBusinessEventService loanAccrualTransactionBusinessEventService + + ) { + return new LoanChargeWritePlatformServiceImpl(loanChargeApiJsonValidator, loanAssembler, chargeRepository, + businessEventNotifierService, loanTransactionRepository, accountTransfersWritePlatformService, loanRepositoryWrapper, + journalEntryWritePlatformService, loanAccountDomainService, loanChargeRepository, loanWritePlatformService, loanUtilService, + loanChargeReadPlatformService, defaultLoanLifecycleStateMachine, accountAssociationsReadPlatformService, fromApiJsonHelper, + configurationDomainService, loanRepaymentScheduleTransactionProcessorFactory, externalIdFactory, + accountTransferDetailRepository, loanChargeAssembler, replayedTransactionBusinessEventService, + paymentDetailWritePlatformService, noteRepository, loanAccrualTransactionBusinessEventService); + } + + @Bean + @ConditionalOnMissingBean(LoanReadPlatformService.class) + public LoanReadPlatformService loanReadPlatformService(JdbcTemplate jdbcTemplate, PlatformSecurityContext context, + LoanRepositoryWrapper loanRepositoryWrapper, ApplicationCurrencyRepositoryWrapper applicationCurrencyRepository, + LoanProductReadPlatformService loanProductReadPlatformService, ClientReadPlatformService clientReadPlatformService, + GroupReadPlatformService groupReadPlatformService, LoanDropdownReadPlatformService loanDropdownReadPlatformService, + FundReadPlatformService fundReadPlatformService, ChargeReadPlatformService chargeReadPlatformService, + CodeValueReadPlatformService codeValueReadPlatformService, CalendarReadPlatformService calendarReadPlatformService, + StaffReadPlatformService staffReadPlatformService, PaginationHelper paginationHelper, + NamedParameterJdbcTemplate namedParameterJdbcTemplate, PaymentTypeReadPlatformService paymentTypeReadPlatformService, + LoanRepaymentScheduleTransactionProcessorFactory loanRepaymentScheduleTransactionProcessorFactory, + FloatingRatesReadPlatformService floatingRatesReadPlatformService, LoanUtilService loanUtilService, + ConfigurationDomainService configurationDomainService, AccountDetailsReadPlatformService accountDetailsReadPlatformService, + ColumnValidator columnValidator, DatabaseSpecificSQLGenerator sqlGenerator, + DelinquencyReadPlatformService delinquencyReadPlatformService, LoanTransactionRepository loanTransactionRepository, + LoanTransactionRelationRepository loanTransactionRelationRepository, + LoanTransactionRelationMapper loanTransactionRelationMapper, + LoanChargePaidByReadPlatformService loanChargePaidByReadPlatformService) { + return new LoanReadPlatformServiceImpl(jdbcTemplate, context, loanRepositoryWrapper, applicationCurrencyRepository, + loanProductReadPlatformService, clientReadPlatformService, groupReadPlatformService, loanDropdownReadPlatformService, + fundReadPlatformService, chargeReadPlatformService, codeValueReadPlatformService, calendarReadPlatformService, + staffReadPlatformService, paginationHelper, namedParameterJdbcTemplate, paymentTypeReadPlatformService, + loanRepaymentScheduleTransactionProcessorFactory, floatingRatesReadPlatformService, loanUtilService, + configurationDomainService, accountDetailsReadPlatformService, columnValidator, sqlGenerator, + delinquencyReadPlatformService, loanTransactionRepository, loanTransactionRelationRepository, loanTransactionRelationMapper, + loanChargePaidByReadPlatformService + + ); + } + + @Bean + @ConditionalOnMissingBean(LoanStatusChangePlatformService.class) + public LoanStatusChangePlatformService loanStatusChangePlatformService(BusinessEventNotifierService businessEventNotifierService, + LoanAccountDomainServiceJpa loanAccountDomainService) { + return new LoanStatusChangePlatformServiceImpl(businessEventNotifierService, loanAccountDomainService); + } + + @Bean + @ConditionalOnMissingBean(LoanUtilService.class) + public LoanUtilService loanUtilService(ApplicationCurrencyRepositoryWrapper applicationCurrencyRepository, + CalendarInstanceRepository calendarInstanceRepository, ConfigurationDomainService configurationDomainService, + HolidayRepository holidayRepository, WorkingDaysRepositoryWrapper workingDaysRepository, + LoanScheduleGeneratorFactory loanScheduleFactory, FloatingRatesReadPlatformService floatingRatesReadPlatformService, + FromJsonHelper fromApiJsonHelper, CalendarReadPlatformService calendarReadPlatformService) { + return new LoanUtilService(applicationCurrencyRepository, calendarInstanceRepository, configurationDomainService, holidayRepository, + workingDaysRepository, loanScheduleFactory, floatingRatesReadPlatformService, fromApiJsonHelper, + calendarReadPlatformService); + } + + @Bean + @ConditionalOnMissingBean(LoanWritePlatformService.class) + public LoanWritePlatformService loanWritePlatformService(PlatformSecurityContext context, + LoanEventApiJsonValidator loanEventApiJsonValidator, + LoanUpdateCommandFromApiJsonDeserializer loanUpdateCommandFromApiJsonDeserializer, LoanRepositoryWrapper loanRepositoryWrapper, + LoanAccountDomainService loanAccountDomainService, NoteRepository noteRepository, + LoanTransactionRepository loanTransactionRepository, LoanTransactionRelationRepository loanTransactionRelationRepository, + LoanAssembler loanAssembler, JournalEntryWritePlatformService journalEntryWritePlatformService, + CalendarInstanceRepository calendarInstanceRepository, PaymentDetailWritePlatformService paymentDetailWritePlatformService, + HolidayRepositoryWrapper holidayRepository, ConfigurationDomainService configurationDomainService, + WorkingDaysRepositoryWrapper workingDaysRepository, AccountTransfersWritePlatformService accountTransfersWritePlatformService, + AccountTransfersReadPlatformService accountTransfersReadPlatformService, + AccountAssociationsReadPlatformService accountAssociationsReadPlatformService, LoanReadPlatformService loanReadPlatformService, + FromJsonHelper fromApiJsonHelper, CalendarRepository calendarRepository, + LoanScheduleHistoryWritePlatformService loanScheduleHistoryWritePlatformService, + LoanApplicationCommandFromApiJsonHelper loanApplicationCommandFromApiJsonHelper, + AccountAssociationsRepository accountAssociationRepository, AccountTransferDetailRepository accountTransferDetailRepository, + BusinessEventNotifierService businessEventNotifierService, GuarantorDomainService guarantorDomainService, + LoanUtilService loanUtilService, LoanSummaryWrapper loanSummaryWrapper, + EntityDatatableChecksWritePlatformService entityDatatableChecksWritePlatformService, + LoanRepaymentScheduleTransactionProcessorFactory transactionProcessingStrategy, CodeValueRepositoryWrapper codeValueRepository, + CashierTransactionDataValidator cashierTransactionDataValidator, GLIMAccountInfoRepository glimRepository, + LoanRepository loanRepository, RepaymentWithPostDatedChecksAssembler repaymentWithPostDatedChecksAssembler, + PostDatedChecksRepository postDatedChecksRepository, LoanDisbursementDetailsRepository loanDisbursementDetailsRepository, + LoanRepaymentScheduleInstallmentRepository loanRepaymentScheduleInstallmentRepository, + LoanLifecycleStateMachine defaultLoanLifecycleStateMachine, LoanAccountLockService loanAccountLockService, + ExternalIdFactory externalIdFactory, ReplayedTransactionBusinessEventService replayedTransactionBusinessEventService, + LoanAccrualTransactionBusinessEventService loanAccrualTransactionBusinessEventService, ErrorHandler errorHandler) { + return new LoanWritePlatformServiceJpaRepositoryImpl(context, loanEventApiJsonValidator, loanUpdateCommandFromApiJsonDeserializer, + loanRepositoryWrapper, loanAccountDomainService, noteRepository, loanTransactionRepository, + loanTransactionRelationRepository, loanAssembler, journalEntryWritePlatformService, calendarInstanceRepository, + paymentDetailWritePlatformService, holidayRepository, configurationDomainService, workingDaysRepository, + accountTransfersWritePlatformService, accountTransfersReadPlatformService, accountAssociationsReadPlatformService, + loanReadPlatformService, fromApiJsonHelper, calendarRepository, loanScheduleHistoryWritePlatformService, + loanApplicationCommandFromApiJsonHelper, accountAssociationRepository, accountTransferDetailRepository, + businessEventNotifierService, guarantorDomainService, loanUtilService, loanSummaryWrapper, + entityDatatableChecksWritePlatformService, transactionProcessingStrategy, codeValueRepository, + cashierTransactionDataValidator, glimRepository, loanRepository, repaymentWithPostDatedChecksAssembler, + postDatedChecksRepository, loanDisbursementDetailsRepository, loanRepaymentScheduleInstallmentRepository, + defaultLoanLifecycleStateMachine, loanAccountLockService, externalIdFactory, replayedTransactionBusinessEventService, + loanAccrualTransactionBusinessEventService, errorHandler); + } + + @Bean + @Scope("prototype") + @ConditionalOnMissingBean(RecalculateInterestPoster.class) + public RecalculateInterestPoster recalculateInterestPoster() { + return new RecalculateInterestPoster(); + } + + @Bean + @ConditionalOnMissingBean(ReplayedTransactionBusinessEventService.class) + public ReplayedTransactionBusinessEventService replayedTransactionBusinessEventService( + BusinessEventNotifierService businessEventNotifierService, LoanTransactionRepository loanTransactionRepository) { + return new ReplayedTransactionBusinessEventServiceImpl(businessEventNotifierService, loanTransactionRepository); + } + +}