Fixed validation error issue in nex-prev api.

This commit is contained in:
piyushkag
2025-01-22 18:04:00 +05:30
parent 8416801d0b
commit 4957a91f41
3 changed files with 11 additions and 8 deletions

View File

@@ -402,7 +402,7 @@ public class ApplicationDao {
ApplicationResponse responseBean = new ApplicationResponse();
List<FlowEdgesEntity> flowEdgesList = flowEdgesRepository.findByCallId(applicationEntity.getCall().getId());
Long totalFormSteps = flowFormDao.calculateTotalSteps(flowEdgesList);
Long completedSteps= Long.valueOf(flowFormDao.getCompletedSteps(applicationEntity));
Long completedSteps= Long.valueOf(flowFormDao.getCompletedSteps(applicationEntity, false));
Integer progress = calculateProgress(totalFormSteps, completedSteps);
responseBean.setId(applicationEntity.getId());
responseBean.setProgress(progress);
@@ -1262,7 +1262,7 @@ public class ApplicationDao {
}
List<FlowEdgesEntity> flowEdgesList = flowEdgesRepository.findByCallId(applicationEntity.getCall().getId());
Long totalSteps = flowFormDao.calculateTotalSteps(flowEdgesList);
Integer completedSteps = flowFormDao.getCompletedSteps(applicationEntity);
Integer completedSteps = flowFormDao.getCompletedSteps(applicationEntity, true);
if (totalSteps.intValue() != completedSteps) {
throw new CustomValidationException(Status.BAD_REQUEST, Translator.toLocale(GepafinConstant.APPLICATION_IS_INCOMPLETE_MSG));
}