use of org.motechproject.mots.dto.VotoBlockDto in project mots by motech-implementations.
the class ModuleProgressService method updateModuleProgress.
/**
* Update Module Progress after call ends.
* @param votoCallLogDto log containing all Voto tree interactions in specific call
* @param callInterrupted true if last call was interrupted
*/
public void updateModuleProgress(VotoCallLogDto votoCallLogDto, boolean callInterrupted) {
String chwIvrId = votoCallLogDto.getChwIvrId();
Optional<ModuleProgress> interruptedModuleProgress = moduleProgressRepository.findByCommunityHealthWorkerIvrIdAndInterrupted(chwIvrId, true);
Iterator<VotoBlockDto> blockIterator = votoCallLogDto.getInteractions().iterator();
try {
if (interruptedModuleProgress.isPresent()) {
ModuleProgress moduleProgress = interruptedModuleProgress.get();
if (parseVotoModuleBlocks(votoCallLogDto, blockIterator, moduleProgress.getCourseModule().getIvrId(), callInterrupted)) {
return;
}
}
parseVotoMainMenuBlocks(votoCallLogDto, blockIterator, callInterrupted);
} catch (MotsException ex) {
LOGGER.error("Could not parse CallLog with id: " + votoCallLogDto.getLogId(), ex);
}
}
Aggregations