oleksii-novikov-onix commented on code in PR #5971: URL: https://github.com/apache/fineract/pull/5971#discussion_r3434631100
########## fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/service/WorkingCapitalLoanOriginatorWritePlatformService.java: ########## @@ -0,0 +1,125 @@ +/** + * 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.workingcapitalloan.service; + +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; +import org.apache.fineract.portfolio.loanorigination.domain.LoanOriginator; +import org.apache.fineract.portfolio.loanorigination.domain.LoanOriginatorRepository; +import org.apache.fineract.portfolio.loanorigination.domain.LoanOriginatorStatus; +import org.apache.fineract.portfolio.loanorigination.domain.WorkingCapitalLoanOriginatorMapping; +import org.apache.fineract.portfolio.loanorigination.domain.WorkingCapitalLoanOriginatorMappingRepository; +import org.apache.fineract.portfolio.loanorigination.exception.LoanOriginatorMappingAlreadyExistsException; +import org.apache.fineract.portfolio.loanorigination.exception.LoanOriginatorNotActiveException; +import org.apache.fineract.portfolio.loanorigination.exception.LoanOriginatorNotFoundException; +import org.apache.fineract.portfolio.loanorigination.exception.WorkingCapitalLoanOriginatorMappingNotFoundException; +import org.apache.fineract.portfolio.loanorigination.service.LoanOriginatorWritePlatformService; +import org.apache.fineract.portfolio.workingcapitalloan.domain.WorkingCapitalLoan; +import org.apache.fineract.portfolio.workingcapitalloan.exception.WorkingCapitalLoanApplicationNotInSubmittedStateCannotBeDeletedException; +import org.apache.fineract.portfolio.workingcapitalloan.exception.WorkingCapitalLoanNotFoundException; +import org.apache.fineract.portfolio.workingcapitalloan.exception.WorkingCapitalLoanNotInSubmittedStatusException; +import org.apache.fineract.portfolio.workingcapitalloan.repository.WorkingCapitalLoanRepository; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +@Service +@RequiredArgsConstructor +@Transactional +@ConditionalOnProperty(value = "fineract.module.loan-origination.enabled", havingValue = "true") +public class WorkingCapitalLoanOriginatorWritePlatformService implements LoanOriginatorWritePlatformService { Review Comment: Design concern: WorkingCapitalLoanOriginatorWritePlatformService is forced to implement LoanOriginatorWritePlatformService, including create/update/delete, which it can't implement This also requires marking the LoanOriginatorLinkingServiceImpl as `@Primary`. Suggestions: 1. Either drop implements LoanOriginatorWritePlatformService (the handlers already inject the concrete type, so `@Primary` becomes unnecessary) 2. Or extract a narrow attach/detach-only interface that both modules implement. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
