Aman-Mittal commented on code in PR #5851:
URL: https://github.com/apache/fineract/pull/5851#discussion_r3250035264


##########
fineract-provider/src/main/java/org/apache/fineract/template/service/TemplateDomainServiceImpl.java:
##########
@@ -0,0 +1,133 @@
+/**
+ * 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.template.service;
+
+import java.util.List;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.fineract.command.jdbc.store.mapping.CommandMapper;
+import org.apache.fineract.template.data.TemplateCreateRequest;
+import org.apache.fineract.template.data.TemplateCreateResponse;
+import org.apache.fineract.template.data.TemplateData;
+import org.apache.fineract.template.data.TemplateDeleteRequest;
+import org.apache.fineract.template.data.TemplateDeleteResponse;
+import org.apache.fineract.template.data.TemplateUpdateRequest;
+import org.apache.fineract.template.data.TemplateUpdateResponse;
+import org.apache.fineract.template.domain.Template;
+import org.apache.fineract.template.domain.TemplateEntity;
+import org.apache.fineract.template.domain.TemplateRepository;
+import org.apache.fineract.template.domain.TemplateType;
+import org.apache.fineract.template.exception.TemplateNotFoundException;
+import org.apache.fineract.template.exception.TemplateTypeInvalidException;
+import org.apache.fineract.template.mapper.TemplateMapper;
+import org.apache.fineract.template.mapper.TemplateMapperDataMapper;
+import 
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+@Slf4j
+@RequiredArgsConstructor
+@Service
+@ConditionalOnMissingBean(value = TemplateDomainService.class, ignored = 
TemplateDomainServiceImpl.class)
+public class TemplateDomainServiceImpl implements TemplateDomainService {
+
+    private final CommandMapper commandMapper;
+
+    private final TemplateRepository templateRepository;
+    private final TemplateMapper templateMapper;
+    private final TemplateMapperDataMapper templateMapperDataMapper;
+
+    @Override
+    public List<TemplateData> getAll() {
+        return templateRepository.findAll().stream().map(template -> 
TemplateData.builder().id(template.getId()).build()).toList();
+    }
+
+    @Override
+    public TemplateData findOneById(final Long id) {
+        return 
templateRepository.findById(id).map(templateMapper::map).orElseThrow(() -> new 
TemplateNotFoundException(id));
+    }
+
+    @Override
+    public List<TemplateData> getTemplate(String key, String templateName) {
+        return templateMapper.map(templateRepository.findByTemplateMapper(key, 
templateName));
+    }
+
+    @Transactional
+    @Override
+    public TemplateCreateResponse createTemplate(TemplateCreateRequest 
request) {
+        // FIXME: no validation here of the data in the command object, is

Review Comment:
   Seems like this is intentional



-- 
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]

Reply via email to