diff --git a/src/main/java/net/gepafin/tendermanagement/dao/ApplicationDao.java b/src/main/java/net/gepafin/tendermanagement/dao/ApplicationDao.java index e3726e41..7e37d9a5 100644 --- a/src/main/java/net/gepafin/tendermanagement/dao/ApplicationDao.java +++ b/src/main/java/net/gepafin/tendermanagement/dao/ApplicationDao.java @@ -829,6 +829,9 @@ public class ApplicationDao { if (status.equals(ApplicationStatusTypeEnum.DRAFT) && Boolean.TRUE.equals(applicationEntity.getStatus().equals(ApplicationStatusTypeEnum.AWAITING.getValue()))) { applicationEntity.setStatus(status.getValue()); } + if(status.equals(ApplicationStatusTypeEnum.ADMISSIBLE) && Boolean.TRUE.equals(applicationEntity.getStatus().equals(ApplicationStatusTypeEnum.APPOINTMENT.getValue()))){ + applicationEntity.setStatus(status.getValue()); + } applicationEntity = applicationRepository.save(applicationEntity); if (!status.equals(ApplicationStatusTypeEnum.SUBMIT)) { diff --git a/src/main/java/net/gepafin/tendermanagement/dao/AppointmentDao.java b/src/main/java/net/gepafin/tendermanagement/dao/AppointmentDao.java index dd8b970c..c78638b0 100644 --- a/src/main/java/net/gepafin/tendermanagement/dao/AppointmentDao.java +++ b/src/main/java/net/gepafin/tendermanagement/dao/AppointmentDao.java @@ -14,6 +14,7 @@ import net.gepafin.tendermanagement.entities.ApplicationEntity; import net.gepafin.tendermanagement.entities.CompanyEntity; import net.gepafin.tendermanagement.entities.DocumentEntity; import net.gepafin.tendermanagement.entities.HubEntity; +import net.gepafin.tendermanagement.enums.ApplicationStatusTypeEnum; import net.gepafin.tendermanagement.enums.DocumentSourceTypeEnum; import net.gepafin.tendermanagement.enums.VersionActionTypeEnum; import net.gepafin.tendermanagement.model.request.AppointmentCreationRequest; @@ -192,6 +193,7 @@ public class AppointmentDao { ndgResponseToReturn.setNdg(application.getNdg()); } else if (visuraResponse.getIdVisura() != null) { application.setNdgStatus(GepafinConstant.NDG_IN_PROGRESS); + application.setStatus(ApplicationStatusTypeEnum.NDG.getValue()); applicationRepository.save(application); /** This code is responsible for adding a version history log for the "Updating ndg status in application" operation. **/ @@ -245,6 +247,7 @@ public class AppointmentDao { if (isNdgValid(ndg)) { company.setNdg(ndg); application.setNdgStatus(GepafinConstant.NDG_GENERATED); + application.setStatus(ApplicationStatusTypeEnum.NDG.getValue()); application.setNdg(ndg); applicationRepository.save(application); companyRepository.save(company); @@ -314,6 +317,7 @@ public class AppointmentDao { application.setNdg(ndg); application.setIdVisura(idVisura); application.setNdgStatus(GepafinConstant.NDG_GENERATED); + application.setStatus(ApplicationStatusTypeEnum.NDG.getValue()); company.setNdg(ndg); companyRepository.save(company); applicationRepository.save(application); @@ -631,6 +635,7 @@ public class AppointmentDao { if (appointmentId != null) { // Update application with the appointment ID application.setAppointmentId(appointmentId); + application.setStatus(ApplicationStatusTypeEnum.APPOINTMENT.getValue()); applicationRepository.save(application); // Log version history diff --git a/src/main/java/net/gepafin/tendermanagement/enums/ApplicationStatusTypeEnum.java b/src/main/java/net/gepafin/tendermanagement/enums/ApplicationStatusTypeEnum.java index db6fe287..b6fd00b3 100644 --- a/src/main/java/net/gepafin/tendermanagement/enums/ApplicationStatusTypeEnum.java +++ b/src/main/java/net/gepafin/tendermanagement/enums/ApplicationStatusTypeEnum.java @@ -12,7 +12,10 @@ public enum ApplicationStatusTypeEnum { SOCCORSO("SOCCORSO"), APPROVED("APPROVED"), REJECTED("REJECTED"), - EVALUATION("EVALUATION"); + EVALUATION("EVALUATION"), + APPOINTMENT("APPOINTMENT"), + NDG("NDG"), + ADMISSIBLE("ADMISSIBLE"); private String value;