Updated get endpoint for application evaluation(v2)

This commit is contained in:
Piyush
2025-02-03 18:06:55 +05:30
parent 7fc53897e2
commit ecee3159c8
3 changed files with 42 additions and 12 deletions

View File

@@ -139,6 +139,10 @@ public class ApplicationEvaluationDao {
@Autowired
private EvaluationFormRepository evaluationFormRepository;
@Autowired
private ObjectMapper objectMapper;
private ApplicationEvaluationEntity convertToEntity(UserEntity user, ApplicationEvaluationRequest req, Long assignedApplciationId) {
ApplicationEvaluationEntity entity = new ApplicationEvaluationEntity();
@@ -2161,17 +2165,13 @@ public class ApplicationEvaluationDao {
}
private ApplicationEvaluationFormResponse processEvaluationForm(ApplicationEvaluationEntity evaluationEntity){
ApplicationEvaluationFormResponse response = new ApplicationEvaluationFormResponse();
response.setApplicationId(evaluationEntity.getApplicationId());
response.setNote(evaluationEntity.getNote());
response.setStatus(evaluationEntity.getStatus());
response.setEvaluationVersion(EvaluationVersionEnum.valueOf(evaluationEntity.getEvaluationVersion()));
response.setAssignedApplicationId(evaluationEntity.getAssignedApplicationsEntity().getId());
Object convertedResponse = convertToResponse(evaluationEntity);
ApplicationEvaluationFormResponse response = objectMapper.convertValue(convertedResponse, ApplicationEvaluationFormResponse.class);
EvaluationFormEntity evaluationFormEntity = evaluationFormRepository.findByCallIdAndIsDeletedFalse(evaluationEntity.getAssignedApplicationsEntity().getApplication().getCall().getId());
if (evaluationFormEntity != null) {
response.setEvaluationFormId(evaluationFormEntity.getId());
response.setApplicationEvaluationFormResponse(convertEvaluationFormToResponse(evaluationFormEntity, evaluationEntity));
}