added validation in call api

This commit is contained in:
harish
2024-09-03 14:52:07 +05:30
parent c05a5d22ee
commit 5b2cfcd594
7 changed files with 23 additions and 2 deletions

View File

@@ -8,6 +8,7 @@ import java.util.Objects;
import java.util.stream.Collectors;
import net.gepafin.tendermanagement.model.response.*;
import net.gepafin.tendermanagement.service.LookUpDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
@@ -65,7 +66,8 @@ public class CallDao {
@Autowired
private RegionRepository regionRepository;
@Autowired
private LookUpDataService lookUpDataService;
@Autowired
private LookUpDataRepository lookUpDataRepository;
@@ -405,6 +407,7 @@ public class CallDao {
LookUpDataEntity newEntity = new LookUpDataEntity();
newEntity.setValue(req.getValue());
newEntity.setType(type.getValue());
lookUpDataService.validateLookUpDataEntity(newEntity);
return lookUpDataRepository.save(newEntity);
}