Merge pull request #139 from Kitzanos/fixed-amendment-issue
Updated amendment process
This commit is contained in:
@@ -640,7 +640,9 @@ public class ApplicationEvaluationDao {
|
||||
// }
|
||||
// });
|
||||
applicationAmendmentRequestEntities.forEach(applicationAmendmentRequestEntity->{
|
||||
ApplicationAmendmentRequestEntity oldEntity = Utils.getClonedEntityForData(applicationAmendmentRequestEntity);
|
||||
updateAmendment(applicationAmendmentRequestEntity, amendmentFormFieldsMap.get(applicationAmendmentRequestEntity.getId()));
|
||||
loggingUtil.addVersionHistory(VersionHistoryRequest.builder().actionType(VersionActionTypeEnum.UPDATE).oldData(oldEntity).newData(applicationAmendmentRequestEntity).build());
|
||||
});
|
||||
applicationAmendmentRequestRepository.saveAll(applicationAmendmentRequestEntities);
|
||||
|
||||
@@ -1766,7 +1768,7 @@ public class ApplicationEvaluationDao {
|
||||
ApplicationEvaluationEntity oldApplicationEvaluation = Utils.getClonedEntityForData(existingEntity);
|
||||
AssignedApplicationsEntity oldAssignedApplication = Utils.getClonedEntityForData(assignedApplicationsEntity);
|
||||
|
||||
List<ApplicationAmendmentRequestEntity> amendmentRequest = applicationAmendmentRequestRepository.findAllByApplicationEvaluationIdAndStatusAndIsDeletedFalse(existingEntity.getId(),ApplicationAmendmentRequestEnum.AWAITING.getValue());
|
||||
List<ApplicationAmendmentRequestEntity> amendmentRequest = applicationAmendmentRequestRepository.findAllByApplicationEvaluationIdAndStatusAndIsDeletedFalse(existingEntity.getId(),List.of(ApplicationAmendmentRequestEnum.AWAITING.getValue(),ApplicationAmendmentRequestEnum.RESPONSE_RECEIVED.getValue()));
|
||||
if(amendmentRequest !=null && Boolean.FALSE.equals(amendmentRequest.isEmpty())){
|
||||
throw new CustomValidationException(Status.BAD_REQUEST,Translator.toLocale(GepafinConstant.APPLICATION_CANNOT_APPROVED_OR_REJECTED));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user