updated code

This commit is contained in:
rajesh
2024-09-16 13:51:53 +05:30
parent dac7eb10cd
commit 7babf437d6
5 changed files with 12 additions and 13 deletions

View File

@@ -223,13 +223,12 @@ public class FlowFormDao {
NextOrPreviousFormResponse nextOrPreviousFormResponse = new NextOrPreviousFormResponse(); NextOrPreviousFormResponse nextOrPreviousFormResponse = new NextOrPreviousFormResponse();
nextOrPreviousFormResponse.setNextFormId(getDefaultForm(applicationEntity)); nextOrPreviousFormResponse.setNextFormId(getDefaultForm(applicationEntity));
return nextOrPreviousFormResponse; return nextOrPreviousFormResponse;
}else { }
fromEntity = Optional fromEntity = Optional
.of(applicationFormRepository.findByApplicationIdAndFormId(applicationEntity.getId(), formId)) .of(applicationFormRepository.findByApplicationIdAndFormId(applicationEntity.getId(), formId))
.orElseThrow(() -> new ResourceNotFoundException(Status.NOT_FOUND, .orElseThrow(() -> new ResourceNotFoundException(Status.NOT_FOUND,
Translator.toLocale(GepafinConstant.FORM_NOT_FOUND))) Translator.toLocale(GepafinConstant.FORM_NOT_FOUND)))
.getForm(); .getForm();
}
NextOrPreviousFormResponse nextOrPreviousFormResponse = new NextOrPreviousFormResponse(); NextOrPreviousFormResponse nextOrPreviousFormResponse = new NextOrPreviousFormResponse();
if (action.equals(FormActionEnum.NEXT)) { if (action.equals(FormActionEnum.NEXT)) {

View File

@@ -27,7 +27,7 @@ public interface ApplicationService {
public ApplicationResponse createApplication(HttpServletRequest request, ApplicationRequest applicationRequest, Long callId); public ApplicationResponse createApplication(HttpServletRequest request, ApplicationRequest applicationRequest, Long callId);
public NextOrPreviousFormResponse getnextOrPreviousForm(HttpServletRequest request, Long applicationId, Long formId, FormActionEnum action); public NextOrPreviousFormResponse getNextOrPreviousForm(HttpServletRequest request, Long applicationId, Long formId, FormActionEnum action);
public void updateApplicationStatus(HttpServletRequest request, Long applicationId, ApplicationStatusTypeEnum status); public void updateApplicationStatus(HttpServletRequest request, Long applicationId, ApplicationStatusTypeEnum status);
} }

View File

@@ -71,7 +71,7 @@ public class ApplicationServiceImpl implements ApplicationService {
} }
@Override @Override
public NextOrPreviousFormResponse getnextOrPreviousForm(HttpServletRequest request, Long applicationId, Long formId, public NextOrPreviousFormResponse getNextOrPreviousForm(HttpServletRequest request, Long applicationId, Long formId,
FormActionEnum action) { FormActionEnum action) {
ApplicationEntity applicationEntity = validateApplication(applicationId); ApplicationEntity applicationEntity = validateApplication(applicationId);
return flowFormDao.getnextOrPreviousForm(applicationEntity, formId, action); return flowFormDao.getnextOrPreviousForm(applicationEntity, formId, action);

View File

@@ -28,7 +28,7 @@ import net.gepafin.tendermanagement.web.rest.api.errors.ErrorConstants;
@Validated @Validated
public interface ApplicationApi { public interface ApplicationApi {
@Operation(summary = "Api to create or update application", @Operation(summary = "Api to create application form",
responses = { responses = {
@ApiResponse(responseCode = "200", description = "OK"), @ApiResponse(responseCode = "200", description = "OK"),
@ApiResponse(responseCode = "404", description = "Not Found", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = { @ApiResponse(responseCode = "404", description = "Not Found", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
@@ -107,10 +107,10 @@ public interface ApplicationApi {
@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 = "/{applicationId}/form/next-previous", produces = "application/json") @GetMapping(value = "/{applicationId}/form/next-previous", produces = "application/json")
ResponseEntity<Response<NextOrPreviousFormResponse>> getnextOrPreviousForm(HttpServletRequest request, ResponseEntity<Response<NextOrPreviousFormResponse>> getNextOrPreviousForm(HttpServletRequest request,
@Parameter(description = "The applicaltion id", required = true) @PathVariable("applicationId") Long applicationId, @Parameter(description = "The applicaltion id", required = true) @PathVariable("applicationId") Long applicationId,
@Parameter(description = "The form id", required = false) @RequestParam(value = "formId", required = false) Long formId, @Parameter(description = "The form id", required = false) @RequestParam(value = "formId", required = false) Long formId,
@RequestParam("action") FormActionEnum action); @RequestParam(value = "action", required = false) FormActionEnum action);
@Operation(summary = "Api to update application status", @Operation(summary = "Api to update application status",

View File

@@ -74,9 +74,9 @@ public class ApplicationApiController implements ApplicationApi {
} }
@Override @Override
public ResponseEntity<Response<NextOrPreviousFormResponse>> getnextOrPreviousForm(HttpServletRequest request,Long applicationId, public ResponseEntity<Response<NextOrPreviousFormResponse>> getNextOrPreviousForm(HttpServletRequest request,Long applicationId,
Long formId, FormActionEnum action) { Long formId, FormActionEnum action) {
NextOrPreviousFormResponse data = applicationService.getnextOrPreviousForm(request, applicationId, formId, action); NextOrPreviousFormResponse data = applicationService.getNextOrPreviousForm(request, applicationId, formId, action);
log.info("Get Next Or Previous Form "); log.info("Get Next Or Previous Form ");
return ResponseEntity.status(HttpStatus.OK) return ResponseEntity.status(HttpStatus.OK)
.body(new Response<>(data, Status.SUCCESS, Translator.toLocale(GepafinConstant.GET_APPLICATION_SUCCESS_MSG))); .body(new Response<>(data, Status.SUCCESS, Translator.toLocale(GepafinConstant.GET_APPLICATION_SUCCESS_MSG)));