Added emailSendResponse in get Amendment Api
This commit is contained in:
@@ -654,12 +654,19 @@ public class ApplicationAmendmentRequestDao {
|
||||
log.info(" Application amendment deleted with ID: {}", id);
|
||||
}
|
||||
|
||||
public ApplicationAmendmentRequestResponse getApplicationAmendmentRequestById(Long id) {
|
||||
public ApplicationAmendmentRequestResponseBean getApplicationAmendmentRequestById(Long id) {
|
||||
log.info("Fetching application amendment with ID: {}", id);
|
||||
ApplicationAmendmentRequestEntity applicationAmendmentRequestEntity = validateApplicationAmendmentRequest(id);
|
||||
ApplicationAmendmentRequestResponse response = convertEntityToResponse(applicationAmendmentRequestEntity,true);
|
||||
log.info("Application Amendment fetched successfully by ID: {}", response);
|
||||
return response;
|
||||
ApplicationAmendmentRequestResponse sourceResponse = convertEntityToResponse(applicationAmendmentRequestEntity,true);
|
||||
ApplicationAmendmentRequestResponseBean targetResponse = Utils.convertSourceObjectToDestinationObject(
|
||||
sourceResponse, ApplicationAmendmentRequestResponseBean.class
|
||||
);
|
||||
|
||||
if (targetResponse != null) {
|
||||
targetResponse.setEmailSendResponse(applicationAmendmentRequestEntity.getEmailSendResponse());
|
||||
}
|
||||
log.info("Application Amendment fetched successfully by ID: {}", targetResponse);
|
||||
return targetResponse;
|
||||
}
|
||||
|
||||
public List<GetAllAmendmentResponseBean> getAllApplicationAmendmentRequest(HttpServletRequest request, Long userId) {
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package net.gepafin.tendermanagement.model.response;
|
||||
|
||||
import lombok.Data;
|
||||
import net.gepafin.tendermanagement.enums.ApplicationAmendmentRequestEnum;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class ApplicationAmendmentRequestResponseBean {
|
||||
private Long id;
|
||||
private String callEmail;
|
||||
private String note;
|
||||
private Long responseDays;
|
||||
private LocalDateTime startDate;
|
||||
private Boolean isSendNotification;
|
||||
private Boolean isSendEmail;
|
||||
private Long protocolNumber;
|
||||
private String callName;
|
||||
private String beneficiaryName;
|
||||
private String companyName;
|
||||
private List<AmendmentFormFieldResponse> formFields;
|
||||
private List<ApplicationFormFieldResponseBean> applicationFormFields;
|
||||
private List<DocumentResponseBean> amendmentDocuments;
|
||||
private String amendmentNotes;
|
||||
private Boolean valid;
|
||||
private Long applicationId;
|
||||
private Long applicationEvaluationId;
|
||||
private LocalDateTime evaluationEndDate;
|
||||
private LocalDateTime expirationDate;
|
||||
private List<CommunicationResponseBean> commentsList;
|
||||
private String internalNote;
|
||||
private ApplicationAmendmentRequestEnum status;
|
||||
private String emailTemplate;
|
||||
private List<EmailSendResponse> emailSendResponse;
|
||||
}
|
||||
@@ -16,7 +16,7 @@ public interface ApplicationAmendmentRequestService {
|
||||
public ApplicationAmendmentRequestResponse getApplicationDataForAmendment(HttpServletRequest request,Long applicationEvaluationId);
|
||||
public ApplicationAmendmentRequestResponse createApplicationAmendmentRequest(HttpServletRequest request, Long applicationEvaluationId , ApplicationAmendmentRequest applicationAmendmentRequest);
|
||||
void deleteApplicationAmendmentRequest(HttpServletRequest request, Long id);
|
||||
ApplicationAmendmentRequestResponse getApplicationAmendmentRequestById(HttpServletRequest request,Long id);
|
||||
ApplicationAmendmentRequestResponseBean getApplicationAmendmentRequestById(HttpServletRequest request,Long id);
|
||||
List<GetAllAmendmentResponseBean> getAllApplicationAmendmentRequest(HttpServletRequest request, Long userId);
|
||||
ApplicationAmendmentRequestResponse updateApplicationAmendment(HttpServletRequest request, Long id, ApplicationAmendmentRequestBean applicationAmendmentRequestBean);
|
||||
ApplicationAmendmentRequestEntity validateApplicationAmendmentRequest(Long applicationAmendmentId);
|
||||
|
||||
@@ -75,7 +75,7 @@ public class ApplicationAmendmentRequestServiceImpl implements ApplicationAmendm
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApplicationAmendmentRequestResponse getApplicationAmendmentRequestById(HttpServletRequest request,Long id) {
|
||||
public ApplicationAmendmentRequestResponseBean getApplicationAmendmentRequestById(HttpServletRequest request,Long id) {
|
||||
ApplicationAmendmentRequestEntity amendment = applicationAmendmentRequestRepository.findByIdAndIsDeletedFalse(id)
|
||||
.orElseThrow(() -> new ResourceNotFoundException(Status.NOT_FOUND,
|
||||
Translator.toLocale(GepafinConstant.APPLICATION_AMENDMENT_NOT_FOUND_MSG)));
|
||||
|
||||
@@ -72,7 +72,7 @@ public interface ApplicationAmendmentRequestApi {
|
||||
@ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@ExampleObject(value = ErrorConstants.BADREQUEST_ERROR_EXAMPLE) })) })
|
||||
@GetMapping(value = "", produces = "application/json")
|
||||
ResponseEntity<Response<ApplicationAmendmentRequestResponse>> getApplicationAmendmentRequestById(HttpServletRequest request,@Parameter(description = "The application amendment id", required = true) @RequestParam(value = "id", required = true) Long id);
|
||||
ResponseEntity<Response<ApplicationAmendmentRequestResponseBean>> getApplicationAmendmentRequestById(HttpServletRequest request,@Parameter(description = "The application amendment id", required = true) @RequestParam(value = "id", required = true) Long id);
|
||||
|
||||
@Operation(summary = "Api to get all applications amendment request by preInstructor user Id (deprecated)",
|
||||
responses = {
|
||||
|
||||
@@ -69,14 +69,14 @@ public class ApplicationAmendmentRequestController implements ApplicationAmendme
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseEntity<Response<ApplicationAmendmentRequestResponse>> getApplicationAmendmentRequestById(HttpServletRequest request,Long id) {
|
||||
public ResponseEntity<Response<ApplicationAmendmentRequestResponseBean>> getApplicationAmendmentRequestById(HttpServletRequest request,Long id) {
|
||||
log.info("Get Application Amendment Request By Id");
|
||||
|
||||
/** This code is responsible for creating user action logs for the "get application amendment by id" operation. **/
|
||||
loggingUtil.logUserAction(UserActionRequest.builder().request(request).actionType(UserActionLogsEnum.VIEW)
|
||||
.actionContext(UserActionContextEnum.GET_AMENDMENT).build());
|
||||
|
||||
ApplicationAmendmentRequestResponse applicationAmendmentRequestResponse = applicationAmendmentRequestService.getApplicationAmendmentRequestById(request,id);
|
||||
ApplicationAmendmentRequestResponseBean applicationAmendmentRequestResponse = applicationAmendmentRequestService.getApplicationAmendmentRequestById(request,id);
|
||||
return ResponseEntity.status(HttpStatus.OK)
|
||||
.body(new Response<>(applicationAmendmentRequestResponse, Status.SUCCESS, Translator.toLocale(GepafinConstant.GET_APPLICATION_AMENDMENT_SUCCESS_MSG)));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user