galovics commented on code in PR #3401: URL: https://github.com/apache/fineract/pull/3401#discussion_r1308715049
########## fineract-core/src/main/java/org/apache/fineract/organisation/office/mapper/OfficeDataMapper.java: ########## @@ -0,0 +1,31 @@ +/** + * 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.mapper; + +import org.apache.fineract.organisation.office.data.OfficeData; +import org.apache.fineract.organisation.office.domain.Office; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; + +@Mapper(componentModel = "spring") +public interface OfficeDataMapper { Review Comment: Pls use MapstructMapperConfig as a base configuration for every mapper. ########## fineract-provider/src/main/java/org/apache/fineract/organisation/office/service/OfficeReadPlatformServiceImpl.java: ########## @@ -34,35 +37,29 @@ import org.apache.fineract.organisation.monetary.service.CurrencyReadPlatformService; import org.apache.fineract.organisation.office.data.OfficeData; import org.apache.fineract.organisation.office.data.OfficeTransactionData; +import org.apache.fineract.organisation.office.domain.OfficeRepository; import org.apache.fineract.organisation.office.exception.OfficeNotFoundException; +import org.apache.fineract.organisation.office.mapper.OfficeDataMapper; import org.apache.fineract.useradministration.domain.AppUser; -import org.springframework.beans.factory.annotation.Autowired; 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 { private final JdbcTemplate jdbcTemplate; private final DatabaseSpecificSQLGenerator sqlGenerator; private final PlatformSecurityContext context; private final CurrencyReadPlatformService currencyReadPlatformService; private final ColumnValidator columnValidator; - private static final String nameDecoratedBaseOnHierarchy = "concat(substring('........................................', 1, ((LENGTH(o.hierarchy) - LENGTH(REPLACE(o.hierarchy, '.', '')) - 1) * 4)), o.name)"; - @Autowired - public OfficeReadPlatformServiceImpl(final PlatformSecurityContext context, - final CurrencyReadPlatformService currencyReadPlatformService, final JdbcTemplate jdbcTemplate, - final ColumnValidator columnValidator, DatabaseSpecificSQLGenerator sqlGenerator) { - this.context = context; - this.currencyReadPlatformService = currencyReadPlatformService; - this.columnValidator = columnValidator; - this.jdbcTemplate = jdbcTemplate; - this.sqlGenerator = sqlGenerator; - } + private final OfficeRepository officeRepository; + private final OfficeDataMapper officeDataMapper; + private static final String nameDecoratedBaseOnHierarchy = "concat(substring('........................................', 1, ((LENGTH(o.hierarchy) - LENGTH(REPLACE(o.hierarchy, '.', '')) - 1) * 4)), o.name)"; Review Comment: Are we using this? ########## fineract-provider/src/main/java/org/apache/fineract/organisation/office/api/OfficeSwaggerMapper.java: ########## @@ -0,0 +1,37 @@ +/** + * 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.api; + +import java.util.Map; +import java.util.Optional; +import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; +import org.mapstruct.Mapper; + +@Mapper(componentModel = "spring") +public interface OfficeSwaggerMapper { Review Comment: Same as for the other: MapstructMapperConfig -- 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]
