Applied validation for call in form

This commit is contained in:
rajesh
2024-09-03 19:34:52 +05:30
parent 566ea94a97
commit 64f0d7ab85

View File

@@ -91,6 +91,11 @@ public class FormDao {
formRepository.delete(formEntity); formRepository.delete(formEntity);
} }
public List<FormResponseBean> getFormsByCallId(Long callId){ public List<FormResponseBean> getFormsByCallId(Long callId){
CallEntity callEntity=callService.getCallEntityById(callId);
if(callEntity== null){
throw new CustomValidationException(Status.VALIDATION_ERROR,
Translator.toLocale(GepafinConstant.CALL_NOT_FOUND));
}
List<FormEntity> formEntities=formRepository.findByCallId(callId); List<FormEntity> formEntities=formRepository.findByCallId(callId);
List<FormResponseBean> formResponseBeanList = formEntities.stream() List<FormResponseBean> formResponseBeanList = formEntities.stream()
.map(req -> convertFormEntityToFormResponseBean(req)) .map(req -> convertFormEntityToFormResponseBean(req))