Resolved conflicts for GEPAFINBE-31.

This commit is contained in:
piyushkag
2024-11-25 19:10:24 +05:30
61 changed files with 1473 additions and 601 deletions

View File

@@ -115,7 +115,7 @@ public interface ApplicationAmendmentRequestApi {
@ExampleObject(value = ErrorConstants.BADREQUEST_ERROR_EXAMPLE) })) })
@GetMapping(value = "/beneficiary/user/{id}", produces = "application/json")
ResponseEntity<Response<List<ApplicationAmendmentRequestResponse>>> getAllAmendmentRequestByBeneficiaryId(HttpServletRequest request,
@Parameter(description = "Id", required = false) @PathVariable(value = "id",required = false) Long beneficiaryId);
@Parameter(description = "Id", required = false) @PathVariable(value = "id",required = false) Long beneficiaryUserId);
@Operation(summary = "Api to extend response days for an amendment request",
responses = {
@ApiResponse(responseCode = "200", description = "OK"),

View File

@@ -99,7 +99,7 @@ public interface ApplicationApi {
@PostMapping(value = "/call/{callId}",
produces = { "application/json" })
ResponseEntity<Response<ApplicationResponse>> createApplicationByCallId(HttpServletRequest request,
@Parameter(description = "The company ID", required = true) @RequestParam(value = "companyId", required = true) Long companyId,
@Parameter(description = "The company ID") @RequestParam(value = "companyId", required = false) Long companyId,
@Parameter(description = " Flow request object", required = true) @Valid @RequestBody ApplicationRequest applicationRequest,
@Parameter(description = "The call ID", required = true) @PathVariable("callId") Long callId);

View File

@@ -100,8 +100,8 @@ public interface CallApi {
@ExampleObject(value = ErrorConstants.BADREQUEST_ERROR_EXAMPLE) })) })
@GetMapping(value = "",
produces = { "application/json" })
ResponseEntity<Response<List<CallDetailsResponseBean>>> getAllCalls(HttpServletRequest request,@RequestParam(value = "companyId", required = false) Long companyId);
ResponseEntity<Response<List<CallDetailsResponseBean>>> getAllCalls(HttpServletRequest request,@RequestParam(value = "companyId", required = false) Long companyId , @RequestParam(value = "onlyPreferredCall", required = false, defaultValue = "false") Boolean onlyPreferredCall);
@Operation(summary = "Api to validate call",
responses = {

View File

@@ -14,6 +14,7 @@ import net.gepafin.tendermanagement.web.rest.api.errors.ErrorConstants;
import org.springframework.data.repository.query.Param;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
@@ -32,6 +33,7 @@ public interface CommunicationApi {
@ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
@ExampleObject(value = ErrorConstants.BADREQUEST_ERROR_EXAMPLE) })) })
@PostMapping(value = "/{amendmentId}", produces = { "application/json" })
@PreAuthorize("hasRole('ROLE_PRE_INSTRUCTOR') || hasRole('ROLE_BENEFICIARY')")
ResponseEntity<Response<CommunicationResponseBean>> addCommentToAmendmentRequest(HttpServletRequest request,
@RequestBody @Parameter CommunicationRequestBean communicationResponseBean, @PathVariable(value = "amendmentId") Long amendmentId);
@@ -43,7 +45,7 @@ public interface CommunicationApi {
@ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = @ExampleObject(value =
ErrorConstants.BADREQUEST_ERROR_EXAMPLE))) })
@GetMapping(value = "/{amendmentId}", produces = "application/json")
public ResponseEntity<Response<ApplicationAmendmentResponse>> getAmendmentComments(@PathVariable(value = "amendmentId") Long amendmentId);
public ResponseEntity<Response<ApplicationAmendmentResponse>> getAmendmentComments(HttpServletRequest request,@PathVariable(value = "amendmentId") Long amendmentId);
@Operation(summary = "Api to update communication comments", responses = { @ApiResponse(responseCode = "200", description = "OK"),
@ApiResponse(responseCode = "404", description = "Not Found", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
@@ -53,6 +55,7 @@ public interface CommunicationApi {
@ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
@ExampleObject(value = ErrorConstants.BADREQUEST_ERROR_EXAMPLE) })) })
@PutMapping(value = "/{amendmentId}/{commentId}", produces = { "application/json" })
@PreAuthorize("hasRole('ROLE_PRE_INSTRUCTOR') || hasRole('ROLE_BENEFICIARY')")
ResponseEntity<Response<CommunicationResponseBean>> updateCommunicationAmendment(HttpServletRequest request,
@RequestBody @Parameter CommunicationRequestBean communicationResponseBean, @PathVariable(value = "amendmentId") Long amendmentId, @PathVariable(value = "commentId") Long commentId);

View File

@@ -41,36 +41,39 @@ public class CallApiController implements CallApi {
private LoggingUtil loggingUtil;
@Override
@Transactional(rollbackFor=Exception.class)
public ResponseEntity<Response<CallResponse>> createCallStep1(HttpServletRequest request, CreateCallRequestStep1 createCallRequest) {
/** This code is responsible for creating user action logs for the "Create Call Step 1" operation. **/
loggingUtil.logUserAction(UserActionRequest.builder().request(request).actionType(UserActionLogsEnum.INSERT)
.actionContext(UserActionContextEnum.CREATE_CALL_STEP_1).build());
CallResponse createCallResponseBean = callService.createCallStep1(request, createCallRequest);
return ResponseEntity.status(HttpStatus.CREATED)
.body(new Response<>(createCallResponseBean, Status.SUCCESS, Translator.toLocale(GepafinConstant.CALL_CREATED_SUCCESSFULLY_MSG)));
}
@Override
@Transactional(rollbackFor=Exception.class)
public ResponseEntity<Response<CallResponse>> createCallStep2(HttpServletRequest request, Long callId, CreateCallRequestStep2 createCallRequest) {
/** This code is responsible for creating user action logs for the "Create or update Call step 2" operation. **/
loggingUtil.logUserAction(UserActionRequest.builder().request(request).actionType(UserActionLogsEnum.UPDATE)
.actionContext(UserActionContextEnum.CREATE_UPDATE_CALL_STEP_2).build());
CallResponse createCallResponseBean = callService.createCallStep2(request, callId, createCallRequest);
return ResponseEntity.status(HttpStatus.CREATED)
.body(new Response<>(createCallResponseBean, Status.SUCCESS, Translator.toLocale(GepafinConstant.CALL_CREATED_SUCCESSFULLY_MSG)));
}
@Override
@Transactional(rollbackFor=Exception.class)
public ResponseEntity<Response<CallResponse>> updateCallStep1(HttpServletRequest request, Long callId, UpdateCallRequestStep1 updateCallRequest) {
/** This code is responsible for creating user action logs for the "update Call step 1" operation. **/
loggingUtil.logUserAction(UserActionRequest.builder().request(request).actionType(UserActionLogsEnum.UPDATE)
.actionContext(UserActionContextEnum.UPDATE_CALL_STEP_1).build());
CallResponse createCallResponseBean = callService.updateCallStep1(request, callId, updateCallRequest);
return ResponseEntity.status(HttpStatus.CREATED)
.body(new Response<>(createCallResponseBean, Status.SUCCESS, Translator.toLocale(GepafinConstant.CALL_UPDATE_SUCCESSFULLY_MSG)));
@@ -78,39 +81,39 @@ public class CallApiController implements CallApi {
@Override
@Transactional
public ResponseEntity<Response<CallResponse>> getCallById(HttpServletRequest request, Long callId,Long companyId) {
/** This code is responsible for creating user action logs for the "get Call by id" operation. **/
loggingUtil.logUserAction(UserActionRequest.builder().request(request).actionType(UserActionLogsEnum.VIEW)
.actionContext(UserActionContextEnum.GET_CALL).build());
CallResponse createCallResponseBean = callService.getCallById(request, callId,companyId);
return ResponseEntity.status(HttpStatus.OK)
.body(new Response<>(createCallResponseBean, Status.SUCCESS, Translator.toLocale(GepafinConstant.CALL_FETCH_SUCCESS_MSG)));
}
@Override
public ResponseEntity<Response<List<CallDetailsResponseBean>>> getAllCalls(HttpServletRequest request,Long companyId) {
@Transactional
public ResponseEntity<Response<List<CallDetailsResponseBean>>> getAllCalls(HttpServletRequest request,Long companyId,Boolean onlyPreferredCall) {
/** This code is responsible for creating user action logs for the "get Calls" operation. **/
loggingUtil.logUserAction(UserActionRequest.builder().request(request).actionType(UserActionLogsEnum.VIEW)
.actionContext(UserActionContextEnum.GET_CALL).build());
List<CallDetailsResponseBean> calls = callService.getAllCalls(request,companyId);
/** This code is responsible for creating user action logs for the "get all Calls" operation. **/
loggingUtil.logUserAction(UserActionRequest.builder().request(request).actionType(UserActionLogsEnum.VIEW)
.actionContext(UserActionContextEnum.GET_CALL).build());
List<CallDetailsResponseBean> calls = callService.getAllCalls(request, companyId, onlyPreferredCall);
return ResponseEntity.status(HttpStatus.OK)
.body(new Response<>(calls, Status.SUCCESS, Translator.toLocale(GepafinConstant.CALL_FETCH_SUCCESS_MSG)));
}
@Override
public ResponseEntity<Response<CallResponse>> validateCallData(HttpServletRequest request, Long callId) {
/** This code is responsible for creating user action logs for the "validate Call" operation. **/
loggingUtil.logUserAction(UserActionRequest.builder().request(request).actionType(UserActionLogsEnum.UPDATE)
.actionContext(UserActionContextEnum.VALIDATE_CALL).build());
CallResponse call = callService.validateCallData(request, callId);
return ResponseEntity.status(HttpStatus.OK)
@@ -118,21 +121,21 @@ public class CallApiController implements CallApi {
}
@Override
public ResponseEntity<Response<CallResponse>> updateCallStatus(HttpServletRequest request, Long callId, CallStatusEnum status) {
/** This code is responsible for creating user action logs for the "update Call status" operation. **/
loggingUtil.logUserAction(UserActionRequest.builder().request(request).actionType(UserActionLogsEnum.UPDATE)
.actionContext(UserActionContextEnum.UPDATE_CALL_STATUS).build());
CallResponse updateCall = callService.updateCallStatus(request, callId, status);
return ResponseEntity.ok(new Response<>(updateCall, Status.SUCCESS, Translator.toLocale(GepafinConstant.UPDATE_CALL_STATUS_SUCCESS_MSG)));
}
@Override
public ResponseEntity<byte[]> downloadCallDocumentsAsZip(HttpServletRequest request, Long callId) {
/** This code is responsible for creating user action logs for the "download Call documents " operation. **/
loggingUtil.logUserAction(UserActionRequest.builder().request(request).actionType(UserActionLogsEnum.DOWNLOAD)
.actionContext(UserActionContextEnum.DOWNLOAD_CALL_DOCUMENT).build());
byte[] zipFile = callService.downloadCallDocumentsAsZip(request, callId);
HttpHeaders headers = new HttpHeaders();

View File

@@ -27,28 +27,28 @@ public class CommunicationController implements CommunicationApi {
public ResponseEntity<Response<CommunicationResponseBean>> addCommentToAmendmentRequest(HttpServletRequest request, CommunicationRequestBean communicationRequestBean,
Long amendmentId) {
CommunicationResponseBean communicationResponseBean = communicationService.addCommentToAmendmentRequest(communicationRequestBean, amendmentId);
CommunicationResponseBean communicationResponseBean = communicationService.addCommentToAmendmentRequest(request,communicationRequestBean, amendmentId);
return ResponseEntity.status(HttpStatus.CREATED)
.body(new Response<>(communicationResponseBean, Status.SUCCESS, Translator.toLocale(GepafinConstant.COMMUNICATION_ADDED_TO_AMENDMENT_REQUEST_SUCCESS)));
}
@Override
public ResponseEntity<Response<ApplicationAmendmentResponse>> getAmendmentComments(Long amendmentId) {
public ResponseEntity<Response<ApplicationAmendmentResponse>> getAmendmentComments(HttpServletRequest request,Long amendmentId) {
ApplicationAmendmentResponse response = communicationService.getAmendmentComments(amendmentId);
ApplicationAmendmentResponse response = communicationService.getAmendmentComments(request,amendmentId);
return ResponseEntity.ok(new Response<>(response, Status.SUCCESS, Translator.toLocale(GepafinConstant.AMENDMENT_FOUND_SUCCESS)));
}
@Override
public ResponseEntity<Response<CommunicationResponseBean>> updateCommunicationAmendment(HttpServletRequest request, CommunicationRequestBean communicationRequestBean,
Long amendmentId, Long commentId) {
CommunicationResponseBean communicationResponseBean = communicationService.updateAmendmentComment(communicationRequestBean, amendmentId, commentId);
CommunicationResponseBean communicationResponseBean = communicationService.updateAmendmentComment(request,communicationRequestBean, amendmentId, commentId);
return ResponseEntity.status(HttpStatus.OK)
.body(new Response<>(communicationResponseBean, Status.SUCCESS, Translator.toLocale(GepafinConstant.COMMENT_UPDATED_SUCCESS_MSG)));
}
@Override
public ResponseEntity<Response<String>> deleteApplicationAmendmentComment(HttpServletRequest request, Long applicationAmendId, Long commentId) {
String communicationResponseBean = communicationService.deleteComment(applicationAmendId, commentId);
String communicationResponseBean = communicationService.deleteComment(request,applicationAmendId, commentId);
return ResponseEntity.status(HttpStatus.OK)
.body(new Response<>(communicationResponseBean, Status.SUCCESS, Translator.toLocale(GepafinConstant.COMMENT_DELETED_SUCCESS_MSG)));
}