adamsaghy commented on code in PR #5986: URL: https://github.com/apache/fineract/pull/5986#discussion_r3420125836
########## fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/retainedearning/RetainedEarningConfigurationService.java: ########## @@ -0,0 +1,63 @@ +/** + * 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.infrastructure.jobs.service.retainedearning; + +import static org.apache.fineract.infrastructure.jobs.service.retainedearning.RetainedEarningJobConstant.TRIAL_BALANCE_SUMMARY_WITH_ASSET_OWNER; + +import java.time.LocalDate; +import lombok.RequiredArgsConstructor; +import org.apache.fineract.infrastructure.configuration.domain.ConfigurationDomainService; +import org.springframework.stereotype.Component; + +/** + * Job-specific configuration wrapper that isolates retained earning config access from the platform-wide + * {@link ConfigurationDomainService}. Centralizes the fiscal year date calculation used by both the Reader and Writer. + */ +@Component +@RequiredArgsConstructor +public class RetainedEarningConfigurationService { + + private final ConfigurationDomainService configurationDomainService; + + public String getIncomeExpenseGlAccounts() { + return configurationDomainService.getIncomeExpenseGlAccounts(); + } + + public String getRetainedEarningGlAccount() { + return configurationDomainService.getRetainedEarningGlAccount(); + } + + public Long getOfficeId() { + Long value = configurationDomainService.getOfficeId(); + // use default office id value of 1 if not set + return value != null ? value : 1L; Review Comment: Not nice, but... -- 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]
