Updated get api t get amendment by application id
This commit is contained in:
@@ -539,15 +539,17 @@ public class ApplicationAmendmentRequestDao {
|
|||||||
return convertEntityToResponse(request);
|
return convertEntityToResponse(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ApplicationAmendmentRequestResponse getAmendmentByApplicationId(HttpServletRequest request, Long applicationId) {
|
public List<ApplicationAmendmentRequestResponse> getAmendmentByApplicationId(HttpServletRequest request, Long applicationId) {
|
||||||
log.info("Fetching the Amendment data from application id {}", applicationId);
|
log.info("Fetching the Amendment data from application id {}", applicationId);
|
||||||
ApplicationEntity application = applicationService.validateApplication(applicationId);
|
ApplicationEntity application = applicationService.validateApplication(applicationId);
|
||||||
ApplicationAmendmentRequestEntity applicationAmendmentRequestEntity=applicationAmendmentRequestRepository.findByApplicationIdAndIsDeletedFalse(application.getId());
|
List<ApplicationAmendmentRequestEntity> applicationAmendmentRequestEntity=applicationAmendmentRequestRepository.findByApplicationIdAndIsDeletedFalse(application.getId());
|
||||||
ApplicationAmendmentRequestResponse response=null;
|
ApplicationAmendmentRequestResponse response=null;
|
||||||
if(applicationAmendmentRequestEntity!=null) {
|
if(applicationAmendmentRequestEntity!=null) {
|
||||||
response = convertEntityToResponse(applicationAmendmentRequestEntity);
|
return applicationAmendmentRequestEntity.stream()
|
||||||
|
.map(this::convertEntityToResponse)
|
||||||
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
return response;
|
return null;
|
||||||
}
|
}
|
||||||
public ApplicationAmendmentRequestResponse updateApplicationAmendmentStatus(
|
public ApplicationAmendmentRequestResponse updateApplicationAmendmentStatus(
|
||||||
Long id,ApplicationAmendmentRequestEnum statusTypeEnum) {
|
Long id,ApplicationAmendmentRequestEnum statusTypeEnum) {
|
||||||
|
|||||||
@@ -23,7 +23,8 @@ public interface ApplicationAmendmentRequestRepository extends JpaRepository<App
|
|||||||
@Query(value = "SELECT amr FROM ApplicationAmendmentRequestEntity amr " + "WHERE amr.applicationEvaluationEntity.id = :id " + "AND amr.applicationEvaluationEntity.isDeleted = false")
|
@Query(value = "SELECT amr FROM ApplicationAmendmentRequestEntity amr " + "WHERE amr.applicationEvaluationEntity.id = :id " + "AND amr.applicationEvaluationEntity.isDeleted = false")
|
||||||
ApplicationAmendmentRequestEntity findByApplicationEvaluationIdAndIsDeletedFalse(Long id);
|
ApplicationAmendmentRequestEntity findByApplicationEvaluationIdAndIsDeletedFalse(Long id);
|
||||||
|
|
||||||
ApplicationAmendmentRequestEntity findByApplicationIdAndIsDeletedFalse(Long applicationId);
|
// ApplicationAmendmentRequestEntity findByApplicationIdAndIsDeletedFalse(Long applicationId);
|
||||||
|
|
||||||
|
List<ApplicationAmendmentRequestEntity> findByApplicationIdAndIsDeletedFalse(Long applicationId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ public interface ApplicationAmendmentRequestService {
|
|||||||
List<ApplicationAmendmentRequestResponse> getAllAmendmentRequestByBeneficiaryId(HttpServletRequest request,Long beneficiaryId);
|
List<ApplicationAmendmentRequestResponse> getAllAmendmentRequestByBeneficiaryId(HttpServletRequest request,Long beneficiaryId);
|
||||||
ApplicationAmendmentRequestResponse closeAmendmentRequest(HttpServletRequest request, Long id, CloseAmendmentRequest closeAmendmentRequest);
|
ApplicationAmendmentRequestResponse closeAmendmentRequest(HttpServletRequest request, Long id, CloseAmendmentRequest closeAmendmentRequest);
|
||||||
ApplicationAmendmentRequestResponse extendResponseDays(HttpServletRequest request, Long id, Long addedDays);
|
ApplicationAmendmentRequestResponse extendResponseDays(HttpServletRequest request, Long id, Long addedDays);
|
||||||
public ApplicationAmendmentRequestResponse getAmendmentByApplicationId(HttpServletRequest request,Long applicationId);
|
public List<ApplicationAmendmentRequestResponse> getAmendmentByApplicationId(HttpServletRequest request,Long applicationId);
|
||||||
public ApplicationAmendmentRequestResponse updateApplicationAmendmentStatus(HttpServletRequest request, Long applicationAmendmentId, ApplicationAmendmentRequestEnum status);
|
public ApplicationAmendmentRequestResponse updateApplicationAmendmentStatus(HttpServletRequest request, Long applicationAmendmentId, ApplicationAmendmentRequestEnum status);
|
||||||
|
|
||||||
void sendReminderEmail(HttpServletRequest request,Long amendmentId);
|
void sendReminderEmail(HttpServletRequest request,Long amendmentId);
|
||||||
|
|||||||
@@ -129,11 +129,11 @@ public class ApplicationAmendmentRequestServiceImpl implements ApplicationAmendm
|
|||||||
return applicationAmendmentRequestDao.extendResponseDays(id, addedDays);
|
return applicationAmendmentRequestDao.extendResponseDays(id, addedDays);
|
||||||
|
|
||||||
}
|
}
|
||||||
public ApplicationAmendmentRequestResponse getAmendmentByApplicationId(HttpServletRequest request, Long applicationId) {
|
public List<ApplicationAmendmentRequestResponse> getAmendmentByApplicationId(HttpServletRequest request, Long applicationId) {
|
||||||
ApplicationAmendmentRequestEntity amendment = applicationAmendmentRequestRepository.findByApplicationIdAndIsDeletedFalse(applicationId);
|
List <ApplicationAmendmentRequestEntity> amendment = applicationAmendmentRequestRepository.findByApplicationIdAndIsDeletedFalse(applicationId);
|
||||||
if(amendment!=null) {
|
if(amendment!=null) {
|
||||||
|
ApplicationAmendmentRequestEntity applicationAmendmentRequestEntity=amendment.get(0);
|
||||||
Optional<ApplicationEvaluationEntity> entityOptional = applicationEvaluationRepository.findByIdAndIsDeletedFalse(amendment.getApplicationEvaluationEntity().getId());
|
Optional<ApplicationEvaluationEntity> entityOptional = applicationEvaluationRepository.findByIdAndIsDeletedFalse(applicationAmendmentRequestEntity.getApplicationEvaluationEntity().getId());
|
||||||
if (entityOptional.isPresent()) {
|
if (entityOptional.isPresent()) {
|
||||||
UserEntity user = validator.validatePreInstructor(request, entityOptional.get().getUserId());
|
UserEntity user = validator.validatePreInstructor(request, entityOptional.get().getUserId());
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ public interface ApplicationAmendmentRequestApi {
|
|||||||
@ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
@ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||||
@ExampleObject(value = ErrorConstants.BADREQUEST_ERROR_EXAMPLE) })) })
|
@ExampleObject(value = ErrorConstants.BADREQUEST_ERROR_EXAMPLE) })) })
|
||||||
@GetMapping(value = "application/{id}", produces = "application/json")
|
@GetMapping(value = "application/{id}", produces = "application/json")
|
||||||
ResponseEntity<Response<ApplicationAmendmentRequestResponse>> getAmendmentByApplicationId(HttpServletRequest request, @Parameter(description = "The Application id", required = true) @PathVariable(value = "id", required = true) Long applicationId);
|
ResponseEntity<Response<List<ApplicationAmendmentRequestResponse>>> getAmendmentByApplicationId(HttpServletRequest request, @Parameter(description = "The Application id", required = true) @PathVariable(value = "id", required = true) Long applicationId);
|
||||||
|
|
||||||
@Operation(summary = "Api to update application amendment status",
|
@Operation(summary = "Api to update application amendment status",
|
||||||
responses = {
|
responses = {
|
||||||
|
|||||||
@@ -105,8 +105,8 @@ public class ApplicationAmendmentRequestController implements ApplicationAmendme
|
|||||||
.body(new Response<>(response, Status.SUCCESS, Translator.toLocale(GepafinConstant.RESPONSE_DAYS_EXTENDED_SUCCESS_MSG)));
|
.body(new Response<>(response, Status.SUCCESS, Translator.toLocale(GepafinConstant.RESPONSE_DAYS_EXTENDED_SUCCESS_MSG)));
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public ResponseEntity<Response<ApplicationAmendmentRequestResponse>> getAmendmentByApplicationId(HttpServletRequest request, Long applicationId) {
|
public ResponseEntity<Response<List<ApplicationAmendmentRequestResponse>>> getAmendmentByApplicationId(HttpServletRequest request, Long applicationId) {
|
||||||
ApplicationAmendmentRequestResponse applicationAmendmentBean = applicationAmendmentRequestService.getAmendmentByApplicationId(request,applicationId);
|
List<ApplicationAmendmentRequestResponse> applicationAmendmentBean = applicationAmendmentRequestService.getAmendmentByApplicationId(request,applicationId);
|
||||||
return ResponseEntity.status(HttpStatus.OK)
|
return ResponseEntity.status(HttpStatus.OK)
|
||||||
.body(new Response<>(applicationAmendmentBean, Status.SUCCESS, Translator.toLocale(GepafinConstant.APPLICATION_DATA_FOR_AMENDMENT_SUCCESS_MSG)));
|
.body(new Response<>(applicationAmendmentBean, Status.SUCCESS, Translator.toLocale(GepafinConstant.APPLICATION_DATA_FOR_AMENDMENT_SUCCESS_MSG)));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user