added current step in next/pervious api

This commit is contained in:
rajesh
2024-09-17 15:54:58 +05:30
parent 6959ac0a65
commit 021b7c3269
2 changed files with 9 additions and 0 deletions

View File

@@ -267,9 +267,16 @@ public class FlowFormDao {
if (flowEdgesList.size() == 1) {
totalFormSteps = 2l;
}
Long currentStep = 2l;
if (formEntity.getId().equals(formEntity.getCall().getInitialForm())) {
currentStep = 1l;
} else if (formEntity.getId().equals(formEntity.getCall().getFinalForm())) {
currentStep = 3l;
}
List<ApplicationFormEntity> applicationFormList = applicationFormRepository.findByApplicationId(applicationEntity.getId());
nextOrPreviousFormResponse.setTotalFormSteps(totalFormSteps);
nextOrPreviousFormResponse.setCompletedSteps(Long.valueOf(applicationFormList.size()));
nextOrPreviousFormResponse.setCurrentStep(currentStep);
return nextOrPreviousFormResponse;
}