Merge branch 'develop' of https://github.com/Kitzanos/GEPAFIN-BE into develop
This commit is contained in:
@@ -247,6 +247,7 @@ public class ApplicationAmendmentRequestDao {
|
||||
applicationAmendmentRequestResponse.setApplicationId(applicationId);
|
||||
applicationAmendmentRequestResponse.setApplicationEvaluationId(applicationAmendmentRequestEntity.getApplicationEvaluationEntity().getId());
|
||||
applicationAmendmentRequestResponse.setNote(applicationAmendmentRequestEntity.getNote());
|
||||
applicationAmendmentRequestResponse.setStatus(ApplicationAmendmentRequestEnum.valueOf(applicationAmendmentRequestEntity.getStatus()));
|
||||
applicationAmendmentRequestResponse.setResponseDays(applicationAmendmentRequestEntity.getResponseDays());
|
||||
applicationAmendmentRequestResponse.setInternalNote(applicationAmendmentRequestEntity.getInternalNote());
|
||||
LocalDateTime startDate = applicationAmendmentRequestEntity.getStartDate();
|
||||
@@ -430,7 +431,7 @@ public class ApplicationAmendmentRequestDao {
|
||||
.map(this::convertEntityToResponse)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
public ApplicationAmendmentRequestResponse closeAmendmentRequest(Long id, CloseAmendmentRequest closeAmendmentRequest){
|
||||
log.info("Closing application amendement with ID: {}", id);
|
||||
ApplicationAmendmentRequestEntity existingApplicationAmendment = validateApplicationAmendmentRequest(id);
|
||||
@@ -456,4 +457,28 @@ public class ApplicationAmendmentRequestDao {
|
||||
}
|
||||
return convertEntityToResponse(request);
|
||||
}
|
||||
|
||||
public ApplicationAmendmentRequestResponse getAmendmentByApplicationId(HttpServletRequest request, Long applicationId) {
|
||||
log.info("Fetching the Amendment data from application id {}", applicationId);
|
||||
ApplicationEntity application = applicationService.validateApplication(applicationId);
|
||||
ApplicationAmendmentRequestEntity applicationAmendmentRequestEntity=applicationAmendmentRequestRepository.findByApplicationIdAndIsDeletedFalse(application.getId());
|
||||
ApplicationAmendmentRequestResponse response=null;
|
||||
if(applicationAmendmentRequestEntity!=null) {
|
||||
response = convertEntityToResponse(applicationAmendmentRequestEntity);
|
||||
}
|
||||
return response;
|
||||
}
|
||||
public ApplicationAmendmentRequestResponse updateApplicationAmendmentStatus(
|
||||
Long id,ApplicationAmendmentRequestEnum statusTypeEnum) {
|
||||
|
||||
log.info("Updating application amendement with status: {}", id);
|
||||
ApplicationAmendmentRequestEntity existingApplicationAmendment = validateApplicationAmendmentRequest(id);
|
||||
if(Boolean.TRUE.equals(existingApplicationAmendment.getStatus().equals(ApplicationAmendmentRequestEnum.AWATING.getValue())) && Boolean.TRUE.equals(statusTypeEnum.equals(ApplicationAmendmentRequestEnum.RESPONSE_RECEIVED))){
|
||||
existingApplicationAmendment.setStatus(ApplicationAmendmentRequestEnum.RESPONSE_RECEIVED.getValue());
|
||||
applicationAmendmentRequestRepository.save(existingApplicationAmendment);
|
||||
}
|
||||
ApplicationAmendmentRequestResponse response = convertEntityToResponse(existingApplicationAmendment);
|
||||
log.info("Amendment status updated successfully: {}", response);
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user