Added ndg and appointmentId field in evaluation response and ndg status of failure.
This commit is contained in:
@@ -134,7 +134,7 @@ public class AppointmentDao {
|
||||
// Validate application, company, and hub
|
||||
ApplicationEntity application = applicationService.validateApplication(applicationId);
|
||||
if (application.getNdgStatus() != null && application.getNdgStatus().equalsIgnoreCase(GepafinConstant.NDG_IN_PROGRESS)) {
|
||||
throw new CustomValidationException(Status.BAD_REQUEST, Translator.toLocale(GepafinConstant.NDG_GENERATION_IS_IN_PROGRESS));
|
||||
throw new CustomValidationException(Status.SUCCESS, Translator.toLocale(GepafinConstant.NDG_GENERATION_IS_IN_PROGRESS));
|
||||
}
|
||||
//cloned for old application data
|
||||
ApplicationEntity oldApplicationData = Utils.getClonedEntityForData(application);
|
||||
@@ -261,6 +261,11 @@ public class AppointmentDao {
|
||||
// Check if polling time has exceeded the limit
|
||||
if (System.currentTimeMillis() - startTime > TimeUnit.HOURS.toMillis(2)) {
|
||||
log.warn("Polling timed out for applicationId: {}", application.getId());
|
||||
// Mark NDG status as FAILED for this application
|
||||
application.setNdgStatus(GepafinConstant.NDG_FAILED);
|
||||
application.setStatus(ApplicationStatusTypeEnum.NDG.getValue());
|
||||
applicationRepository.save(application);
|
||||
log.info("NDG status marked as FAILED for applicationId: {}", application.getId());
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user