Resolved conflicts
This commit is contained in:
@@ -14,10 +14,12 @@ import net.gepafin.tendermanagement.model.response.ApplicationAmendmentRequestRe
|
||||
import net.gepafin.tendermanagement.model.response.ApplicationResponse;
|
||||
import net.gepafin.tendermanagement.model.response.PageableResponseBean;
|
||||
import net.gepafin.tendermanagement.model.response.SummaryPageResponseBean;
|
||||
import net.gepafin.tendermanagement.model.response.GetAllAmendmentResponseBean;
|
||||
import net.gepafin.tendermanagement.model.util.Response;
|
||||
import net.gepafin.tendermanagement.web.rest.api.errors.ErrorConstants;
|
||||
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.*;
|
||||
|
||||
@@ -85,9 +87,10 @@ public interface ApplicationAmendmentRequestApi {
|
||||
@ExampleObject(value = ErrorConstants.UNAUTHORIZED_ERROR_EXAMPLE) })),
|
||||
@ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@ExampleObject(value = ErrorConstants.BADREQUEST_ERROR_EXAMPLE) })) })
|
||||
@GetMapping(value = "/user/{id}", produces = "application/json")
|
||||
ResponseEntity<Response<List<ApplicationAmendmentRequestResponse>>> getAllApplicationAmendmentRequest(HttpServletRequest request,
|
||||
@Parameter(description = "The User ID", required = false) @PathVariable(value = "id",required = false) Long userId);
|
||||
@GetMapping(value = "/user", produces = "application/json")
|
||||
@PreAuthorize("hasRole('ROLE_SUPER_ADMIN') || hasRole('ROLE_INSTRUCTOR_MANAGER')|| hasRole('ROLE_PRE_INSTRUCTOR')")
|
||||
ResponseEntity<Response<List<GetAllAmendmentResponseBean>>> getAllApplicationAmendmentRequest(HttpServletRequest request,
|
||||
@Parameter(description = "The User ID", required = false) @RequestParam(value = "userId",required = false) Long userId);
|
||||
|
||||
@Operation(summary = "Api to update application amendment",
|
||||
responses = {
|
||||
|
||||
@@ -7,9 +7,12 @@ import io.swagger.v3.oas.annotations.media.ExampleObject;
|
||||
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.validation.Valid;
|
||||
import net.gepafin.tendermanagement.enums.FormActionEnum;
|
||||
import net.gepafin.tendermanagement.model.request.ApplicationEvaluationFormRequestBean;
|
||||
import net.gepafin.tendermanagement.model.request.ApplicationEvaluationRequest;
|
||||
import net.gepafin.tendermanagement.model.request.ApplicationRequestBean;
|
||||
import net.gepafin.tendermanagement.model.request.EvaluationDocumentRequest;
|
||||
import net.gepafin.tendermanagement.model.response.ApplicationEvaluationResponse;
|
||||
import net.gepafin.tendermanagement.model.response.*;
|
||||
import net.gepafin.tendermanagement.model.util.Response;
|
||||
import net.gepafin.tendermanagement.web.rest.api.errors.ErrorConstants;
|
||||
import org.springframework.http.MediaType;
|
||||
@@ -45,6 +48,7 @@ public interface ApplicationEvaluationApi {
|
||||
HttpServletRequest request,
|
||||
@Parameter(required = false) @RequestParam(value = "applicationId", required = false) Long applicationId,
|
||||
@Parameter( required = false) @RequestParam(value = "assignedApplicationId", required = false) Long assignedApplicationId);
|
||||
|
||||
@Operation(summary = "API to delete ApplicationEvaluation",
|
||||
responses = {
|
||||
@ApiResponse(responseCode = "200", description = "OK"),
|
||||
@@ -56,4 +60,49 @@ public interface ApplicationEvaluationApi {
|
||||
@Parameter( required = true) @PathVariable("id") Long id);
|
||||
|
||||
|
||||
@Operation(summary = "Api to create or update application evaluation form ( Evaluation V2 )",
|
||||
responses = {
|
||||
@ApiResponse(responseCode = "200", description = "OK"),
|
||||
@ApiResponse(responseCode = "404", description = "Not Found", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@ExampleObject(value = ErrorConstants.NOTFOUND_ERROR_EXAMPLE) })),
|
||||
@ApiResponse(responseCode = "401", description = "Unauthorized", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@ExampleObject(value = ErrorConstants.UNAUTHORIZED_ERROR_EXAMPLE) })),
|
||||
@ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@ExampleObject(value = ErrorConstants.BADREQUEST_ERROR_EXAMPLE) })) })
|
||||
@PutMapping(value = "/v2/assignedApplication/{id}",
|
||||
produces = { "application/json" })
|
||||
ResponseEntity<Response<ApplicationEvaluationFormResponse>> createApplicationEvaluation(HttpServletRequest request,
|
||||
@Valid @RequestBody ApplicationEvaluationFormRequestBean applicationEvaluationFormRequestBean,
|
||||
@Parameter(description = "Assigned Application ID", required = true) @PathVariable(value = "id", required = true) Long assignedApplicationId,
|
||||
@Parameter(description = "The evaluation form ID", required = true) @RequestParam("evaluationFormId") Long evaluationFormId);
|
||||
|
||||
@Operation(summary = "Api to get an application evaluation form (Evaluation V2)",
|
||||
responses = {
|
||||
@ApiResponse(responseCode = "200", description = "OK"),
|
||||
@ApiResponse(responseCode = "404", description = "Not Found", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@ExampleObject(value = ErrorConstants.NOTFOUND_ERROR_EXAMPLE) })),
|
||||
@ApiResponse(responseCode = "401", description = "Unauthorized", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@ExampleObject(value = ErrorConstants.UNAUTHORIZED_ERROR_EXAMPLE) })),
|
||||
@ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@ExampleObject(value = ErrorConstants.BADREQUEST_ERROR_EXAMPLE) })) })
|
||||
@GetMapping(value = "/v2", produces = "application/json")
|
||||
ResponseEntity<Response<ApplicationEvaluationFormResponse>> getApplicationEvaluationForm(HttpServletRequest request,
|
||||
@Parameter(required = false) @RequestParam(value = "applicationId", required = false) Long applicationId,
|
||||
@Parameter( required = false) @RequestParam(value = "assignedApplicationId", required = false) Long assignedApplicationId);
|
||||
|
||||
@Operation(summary = "Api to get application evaluation version",
|
||||
responses = {
|
||||
@ApiResponse(responseCode = "200", description = "OK"),
|
||||
@ApiResponse(responseCode = "404", description = "Not Found", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@ExampleObject(value = ErrorConstants.NOTFOUND_ERROR_EXAMPLE) })),
|
||||
@ApiResponse(responseCode = "401", description = "Unauthorized", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@ExampleObject(value = ErrorConstants.UNAUTHORIZED_ERROR_EXAMPLE) })),
|
||||
@ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@ExampleObject(value = ErrorConstants.BADREQUEST_ERROR_EXAMPLE) })) })
|
||||
@GetMapping(value = "/application/{id}/version", produces = { "application/json" })
|
||||
ResponseEntity<Response<ApplicationEvaluationVersionResponse>> getApplicationEvaluationVersion(HttpServletRequest request,
|
||||
@Parameter(description = "The application id", required = true) @PathVariable("id") Long id);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -7,8 +7,11 @@ import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.validation.Valid;
|
||||
import net.gepafin.tendermanagement.model.request.AssignedApplicationPageableRequestBean;
|
||||
import net.gepafin.tendermanagement.enums.ApplicationStatusTypeEnum;
|
||||
import net.gepafin.tendermanagement.enums.AssignedApplicationEnum;
|
||||
import net.gepafin.tendermanagement.model.request.AssignedApplicationsRequest;
|
||||
import net.gepafin.tendermanagement.model.request.UpdateAssignedApplicationRequest;
|
||||
import net.gepafin.tendermanagement.model.response.ApplicationResponse;
|
||||
import net.gepafin.tendermanagement.model.response.AssignedApplicationsResponse;
|
||||
import net.gepafin.tendermanagement.model.response.PageableResponseBean;
|
||||
import net.gepafin.tendermanagement.model.util.Response;
|
||||
@@ -68,7 +71,8 @@ public interface AssignedApplicationsApi {
|
||||
@ExampleObject(value = ErrorConstants.BADREQUEST_ERROR_EXAMPLE) })) })
|
||||
@GetMapping(value = "", produces = "application/json")
|
||||
ResponseEntity<Response<List<AssignedApplicationsResponse>>> getAllAssignedApplications(HttpServletRequest request,
|
||||
@Parameter(description = "The User ID", required = false) @RequestParam(value = "userId",required = false) Long userId);
|
||||
@Parameter(description = "The User ID", required = false) @RequestParam(value = "userId",required = false) Long userId,
|
||||
@Parameter(description = "Assigned application statuses" ,required = false) @RequestParam(value = "statuses",required = false) List<AssignedApplicationEnum> statusList);
|
||||
|
||||
@Operation(summary = "Api to update assigned application",
|
||||
responses = {
|
||||
@@ -99,6 +103,20 @@ public interface AssignedApplicationsApi {
|
||||
ResponseEntity<Response<AssignedApplicationsResponse>> getAssignedApplicationById(HttpServletRequest request,
|
||||
@Parameter(description = "The assigned application id", required = true) @PathVariable(value = "id", required = true) Long id);
|
||||
|
||||
@Operation(summary = "Api to update assigned application status",
|
||||
responses = {
|
||||
@ApiResponse(responseCode = "200", description = "OK"),
|
||||
@ApiResponse(responseCode = "404", description = "Not Found", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@ExampleObject(value = ErrorConstants.NOTFOUND_ERROR_EXAMPLE) })),
|
||||
@ApiResponse(responseCode = "401", description = "Unauthorized", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@ExampleObject(value = ErrorConstants.UNAUTHORIZED_ERROR_EXAMPLE) })),
|
||||
@ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@ExampleObject(value = ErrorConstants.BADREQUEST_ERROR_EXAMPLE) })) })
|
||||
@PutMapping(value = "/{id}/status", produces = { "application/json" })
|
||||
ResponseEntity<Response<AssignedApplicationsResponse>> updateAssignedApplicationStatus(HttpServletRequest request,
|
||||
@Parameter(description = "The assigned application id", required = true) @PathVariable("id") Long id,
|
||||
@Parameter(description = "status", required = true)@RequestParam(value = "status", required = true) AssignedApplicationEnum status);
|
||||
|
||||
|
||||
@Operation(summary = "Api to get all assigned applications by pagination",
|
||||
responses = {
|
||||
|
||||
@@ -3,7 +3,8 @@ package net.gepafin.tendermanagement.web.rest.api;
|
||||
import java.util.List;
|
||||
|
||||
import net.gepafin.tendermanagement.enums.CallStatusEnum;
|
||||
import net.gepafin.tendermanagement.model.request.CallPageableRequestBean;
|
||||
import net.gepafin.tendermanagement.enums.EvaluationVersionEnum;
|
||||
import net.gepafin.tendermanagement.model.request.*;
|
||||
import net.gepafin.tendermanagement.model.response.ApplicationResponse;
|
||||
import net.gepafin.tendermanagement.model.response.PageableResponseBean;
|
||||
import org.springframework.http.MediaType;
|
||||
@@ -19,9 +20,6 @@ import io.swagger.v3.oas.annotations.media.ExampleObject;
|
||||
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.validation.Valid;
|
||||
import net.gepafin.tendermanagement.model.request.CreateCallRequestStep1;
|
||||
import net.gepafin.tendermanagement.model.request.CreateCallRequestStep2;
|
||||
import net.gepafin.tendermanagement.model.request.UpdateCallRequestStep1;
|
||||
import net.gepafin.tendermanagement.model.response.CallDetailsResponseBean;
|
||||
import net.gepafin.tendermanagement.model.response.CallResponse;
|
||||
import net.gepafin.tendermanagement.model.util.Response;
|
||||
@@ -164,5 +162,20 @@ public interface CallApi {
|
||||
ResponseEntity<Response<PageableResponseBean<List<CallDetailsResponseBean>>>> getAllCallsByPagination(HttpServletRequest request,@RequestParam(value = "companyId", required = false) Long companyId , @RequestParam(value = "onlyPreferredCall", required = false, defaultValue = "false") Boolean onlyPreferredCall, @RequestBody CallPageableRequestBean callPageableRequestBean);
|
||||
|
||||
|
||||
@Operation(summary = "Api to update call step 2 (Evaluation V2)",
|
||||
responses = {
|
||||
@ApiResponse(responseCode = "200", description = "OK"),
|
||||
@ApiResponse(responseCode = "404", description = "Not Found", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@ExampleObject(value = ErrorConstants.NOTFOUND_ERROR_EXAMPLE) })),
|
||||
@ApiResponse(responseCode = "401", description = "Unauthorized", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@ExampleObject(value = ErrorConstants.UNAUTHORIZED_ERROR_EXAMPLE) })),
|
||||
@ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@ExampleObject(value = ErrorConstants.BADREQUEST_ERROR_EXAMPLE) }))
|
||||
})
|
||||
@PutMapping(value = "/step2-v2/{callId}", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
@PreAuthorize("hasRole('ROLE_SUPER_ADMIN')")
|
||||
public ResponseEntity<Response<CallResponse>> createCallStep2EvaluationV2(HttpServletRequest request,
|
||||
@Parameter(description = "The call id", required = true) @PathVariable("callId") Long callId,
|
||||
@Parameter(description = "Call request object", required = true) @Valid @RequestBody CreateCallRequestStep2EvaluationV2 createCallRequest);
|
||||
|
||||
}
|
||||
|
||||
@@ -6,7 +6,10 @@ import io.swagger.v3.oas.annotations.media.Content;
|
||||
import io.swagger.v3.oas.annotations.media.ExampleObject;
|
||||
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import net.gepafin.tendermanagement.model.response.*;
|
||||
import net.gepafin.tendermanagement.model.response.AmendmentWidgetResponseBean;
|
||||
import net.gepafin.tendermanagement.model.response.ApplicationWidgetResponseBean;
|
||||
import net.gepafin.tendermanagement.model.response.AssignedApplicationWidgetResponseBean;
|
||||
import net.gepafin.tendermanagement.model.response.BeneficiaryWidgetResponseBean;
|
||||
import net.gepafin.tendermanagement.model.response.SuperAdminWidgetResponseBean;
|
||||
import net.gepafin.tendermanagement.model.util.Response;
|
||||
@@ -17,6 +20,7 @@ import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
public interface DashboardApi {
|
||||
|
||||
@@ -61,5 +65,65 @@ public interface DashboardApi {
|
||||
produces = { "application/json" })
|
||||
@PreAuthorize("hasRole('ROLE_SUPER_ADMIN') || hasRole('ROLE_INSTRUCTOR_MANAGER')")
|
||||
ResponseEntity<Response<ApplicationWidgetResponseBean>> getApplicationDetails(HttpServletRequest request);
|
||||
@Operation(summary = "Api to get Soccorso details",
|
||||
responses = {
|
||||
@ApiResponse(responseCode = "200", description = "OK"),
|
||||
@ApiResponse(responseCode = "404", description = "Not Found", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@ExampleObject(value = ErrorConstants.NOTFOUND_ERROR_EXAMPLE) })),
|
||||
@ApiResponse(responseCode = "401", description = "Unauthorized", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@ExampleObject(value = ErrorConstants.UNAUTHORIZED_ERROR_EXAMPLE) })),
|
||||
@ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@ExampleObject(value = ErrorConstants.BADREQUEST_ERROR_EXAMPLE) })) })
|
||||
@GetMapping(value = "/amendment",
|
||||
produces = { "application/json" })
|
||||
@PreAuthorize("hasRole('ROLE_SUPER_ADMIN') || hasRole('ROLE_INSTRUCTOR_MANAGER')|| hasRole('ROLE_PRE_INSTRUCTOR')")
|
||||
ResponseEntity<Response<AmendmentWidgetResponseBean>> getAmendmentDetails(HttpServletRequest request);
|
||||
|
||||
|
||||
@Operation(summary = "Api to get Application details for Evaluation",
|
||||
responses = {
|
||||
@ApiResponse(responseCode = "200", description = "OK"),
|
||||
@ApiResponse(responseCode = "404", description = "Not Found", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@ExampleObject(value = ErrorConstants.NOTFOUND_ERROR_EXAMPLE) })),
|
||||
@ApiResponse(responseCode = "401", description = "Unauthorized", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@ExampleObject(value = ErrorConstants.UNAUTHORIZED_ERROR_EXAMPLE) })),
|
||||
@ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@ExampleObject(value = ErrorConstants.BADREQUEST_ERROR_EXAMPLE) })) })
|
||||
|
||||
@GetMapping(value = "/evaluation",
|
||||
produces = { "application/json" })
|
||||
@PreAuthorize("hasRole('ROLE_SUPER_ADMIN') || hasRole('ROLE_INSTRUCTOR_MANAGER')|| hasRole('ROLE_PRE_INSTRUCTOR')")
|
||||
ResponseEntity<Response<AssignedApplicationWidgetResponseBean>> getApplicationDetailsForEvaluation(HttpServletRequest request);
|
||||
|
||||
@Operation(summary = "Api to get Statistics page for beneficiary",
|
||||
responses = {
|
||||
@ApiResponse(responseCode = "200", description = "OK"),
|
||||
@ApiResponse(responseCode = "404", description = "Not Found", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@ExampleObject(value = ErrorConstants.NOTFOUND_ERROR_EXAMPLE) })),
|
||||
@ApiResponse(responseCode = "401", description = "Unauthorized", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@ExampleObject(value = ErrorConstants.UNAUTHORIZED_ERROR_EXAMPLE) })),
|
||||
@ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@ExampleObject(value = ErrorConstants.BADREQUEST_ERROR_EXAMPLE) })) })
|
||||
|
||||
@GetMapping(value = "/beneficiary/statistic/company/{companyId}",
|
||||
produces = { "application/json" })
|
||||
ResponseEntity<Response<BeneficiaryStatisticsResponseBean>> getStatisticsPageForBeneficiary(HttpServletRequest request,
|
||||
@Parameter(description = "The company id", required = true) @PathVariable(value = "companyId", required = true) Long companyId);
|
||||
|
||||
|
||||
|
||||
|
||||
@Operation(summary = "Api to get dashboard widget for pre instructor",
|
||||
responses = {
|
||||
@ApiResponse(responseCode = "200", description = "OK"),
|
||||
@ApiResponse(responseCode = "404", description = "Not Found", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@ExampleObject(value = ErrorConstants.NOTFOUND_ERROR_EXAMPLE) })),
|
||||
@ApiResponse(responseCode = "401", description = "Unauthorized", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@ExampleObject(value = ErrorConstants.UNAUTHORIZED_ERROR_EXAMPLE) })),
|
||||
@ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@ExampleObject(value = ErrorConstants.BADREQUEST_ERROR_EXAMPLE) })) })
|
||||
@GetMapping(value = "/instructor/amendment",
|
||||
produces = { "application/json" })
|
||||
@PreAuthorize("hasRole('ROLE_SUPER_ADMIN') || hasRole('ROLE_INSTRUCTOR_MANAGER')|| hasRole('ROLE_PRE_INSTRUCTOR')")
|
||||
ResponseEntity<Response<PreInstructorWidgetResponseBean>> getDashboardWidgetForPreInstructor(HttpServletRequest request, @Parameter(description = "The User ID", required = false) @RequestParam(value = "userId",required = false) Long userId);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
package net.gepafin.tendermanagement.web.rest.api;
|
||||
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.media.Content;
|
||||
import io.swagger.v3.oas.annotations.media.ExampleObject;
|
||||
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.validation.Valid;
|
||||
import net.gepafin.tendermanagement.model.request.EvaluationFormRequest;
|
||||
import net.gepafin.tendermanagement.model.response.EvaluationFormResponseBean;
|
||||
import net.gepafin.tendermanagement.model.response.FormResponseBean;
|
||||
import net.gepafin.tendermanagement.model.util.Response;
|
||||
import net.gepafin.tendermanagement.web.rest.api.errors.ErrorConstants;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public interface EvaluationFormApi {
|
||||
|
||||
@Operation(summary = "Api to create Evaluation form (Evaluation V2)",
|
||||
responses = {
|
||||
@ApiResponse(responseCode = "200", description = "OK"),
|
||||
@ApiResponse(responseCode = "404", description = "Not Found", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@ExampleObject(value = ErrorConstants.NOTFOUND_ERROR_EXAMPLE) })),
|
||||
@ApiResponse(responseCode = "401", description = "Unauthorized", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@ExampleObject(value = ErrorConstants.UNAUTHORIZED_ERROR_EXAMPLE) })),
|
||||
@ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@ExampleObject(value = ErrorConstants.BADREQUEST_ERROR_EXAMPLE) }))
|
||||
})
|
||||
@PostMapping(value = "/call/{callId}", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
@PreAuthorize("hasRole('ROLE_SUPER_ADMIN')")
|
||||
public ResponseEntity<Response<EvaluationFormResponseBean>> createEvaluationForm(HttpServletRequest request, @Parameter(description = "The call ID", required = true) @PathVariable("callId") Long callId,
|
||||
@Parameter(description = "evaluationForm request object", required = true)
|
||||
@Valid @RequestBody EvaluationFormRequest evaluationFormRequest);
|
||||
|
||||
|
||||
@Operation(summary = "Api to update Evaluation form (Evaluation V2)",
|
||||
responses = {
|
||||
@ApiResponse(responseCode = "200", description = "OK"),
|
||||
@ApiResponse(responseCode = "404", description = "Not Found", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@ExampleObject(value = ErrorConstants.NOTFOUND_ERROR_EXAMPLE) })),
|
||||
@ApiResponse(responseCode = "401", description = "Unauthorized", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@ExampleObject(value = ErrorConstants.UNAUTHORIZED_ERROR_EXAMPLE) })),
|
||||
@ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@ExampleObject(value = ErrorConstants.BADREQUEST_ERROR_EXAMPLE) })) })
|
||||
@PutMapping(value = "/{evaluationFormId}",
|
||||
produces = { "application/json" })
|
||||
@PreAuthorize("hasRole('ROLE_SUPER_ADMIN')")
|
||||
ResponseEntity<Response<EvaluationFormResponseBean>> updateEvaluationForm(HttpServletRequest request,
|
||||
@Parameter(description = "The Evaluation form ID", required = true) @PathVariable("evaluationFormId") Long evaluationFormId,
|
||||
@Parameter(description = "Evaluation form request object", required = true) @Valid @RequestBody EvaluationFormRequest evaluationFormRequest);
|
||||
|
||||
@Operation(summary = "Api to get Evaluation form by id (Evaluation V2)",
|
||||
responses = {
|
||||
@ApiResponse(responseCode = "200", description = "OK"),
|
||||
@ApiResponse(responseCode = "404", description = "Not Found", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@ExampleObject(value = ErrorConstants.NOTFOUND_ERROR_EXAMPLE) })),
|
||||
@ApiResponse(responseCode = "401", description = "Unauthorized", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@ExampleObject(value = ErrorConstants.UNAUTHORIZED_ERROR_EXAMPLE) })),
|
||||
@ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@ExampleObject(value = ErrorConstants.BADREQUEST_ERROR_EXAMPLE) })) })
|
||||
@GetMapping(value = "/{evaluationFormId}",
|
||||
produces = { "application/json" })
|
||||
ResponseEntity<Response<EvaluationFormResponseBean>> getEvaluationFormById(HttpServletRequest request,
|
||||
@Parameter(description = "The Evaluation form ID", required = true) @PathVariable("evaluationFormId") Long evaluationFormId);
|
||||
|
||||
|
||||
@Operation(summary = "Api to delete Evaluation form (Evaluation V2)",
|
||||
responses = {
|
||||
@ApiResponse(responseCode = "200", description = "OK"),
|
||||
@ApiResponse(responseCode = "404", description = "Not Found", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@ExampleObject(value = ErrorConstants.NOTFOUND_ERROR_EXAMPLE) })),
|
||||
@ApiResponse(responseCode = "401", description = "Unauthorized", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@ExampleObject(value = ErrorConstants.UNAUTHORIZED_ERROR_EXAMPLE) })),
|
||||
@ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@ExampleObject(value = ErrorConstants.BADREQUEST_ERROR_EXAMPLE) })) })
|
||||
@DeleteMapping(value = "/{evaluationFormId}")
|
||||
@PreAuthorize("hasRole('ROLE_SUPER_ADMIN')")
|
||||
ResponseEntity<Response<Void>> deleteEvaluationForm(HttpServletRequest request,
|
||||
@Parameter(description = "The Evaluation form ID", required = true) @PathVariable("evaluationFormId") Long evaluationFormId);
|
||||
|
||||
@Operation(summary = "Api to get Evaluation forms by callId (Evaluation V2)",
|
||||
responses = {
|
||||
@ApiResponse(responseCode = "200", description = "OK"),
|
||||
@ApiResponse(responseCode = "404", description = "Not Found", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@ExampleObject(value = ErrorConstants.NOTFOUND_ERROR_EXAMPLE) })),
|
||||
@ApiResponse(responseCode = "401", description = "Unauthorized", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@ExampleObject(value = ErrorConstants.UNAUTHORIZED_ERROR_EXAMPLE) })),
|
||||
@ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@ExampleObject(value = ErrorConstants.BADREQUEST_ERROR_EXAMPLE) })) })
|
||||
@GetMapping(value = "/call/{callId}",
|
||||
produces = { "application/json" })
|
||||
ResponseEntity<Response<EvaluationFormResponseBean>> getEvaluationFormByCallId(HttpServletRequest request,
|
||||
@Parameter(description = "The call ID", required = true) @PathVariable("callId") Long callId);
|
||||
|
||||
}
|
||||
@@ -49,7 +49,7 @@ public interface UserApi {
|
||||
return new ResponseEntity<Response<JWTToken>>(HttpStatus.NOT_IMPLEMENTED);
|
||||
}
|
||||
|
||||
@Operation(summary = "Api to update user",
|
||||
@Operation(summary = "Api to update user (Only for super admin)",
|
||||
responses = {
|
||||
@ApiResponse(responseCode = "200", description = "OK"),
|
||||
@ApiResponse(responseCode = "404", description = "Not Found", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@@ -260,6 +260,26 @@ public interface UserApi {
|
||||
@RequestBody UserPaginationRequestBean userPaginationRequestBean);
|
||||
|
||||
|
||||
@Operation(summary = "Api to update user",
|
||||
responses = {
|
||||
@ApiResponse(responseCode = "200", description = "OK"),
|
||||
@ApiResponse(responseCode = "404", description = "Not Found", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@ExampleObject(value = ErrorConstants.NOTFOUND_ERROR_EXAMPLE)})),
|
||||
@ApiResponse(responseCode = "401", description = "Unauthorized", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@ExampleObject(value = ErrorConstants.UNAUTHORIZED_ERROR_EXAMPLE)})),
|
||||
@ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@ExampleObject(value = ErrorConstants.BADREQUEST_ERROR_EXAMPLE)}))})
|
||||
@RequestMapping(value = "/{userId}/update-details",
|
||||
produces = {"application/json"},
|
||||
method = RequestMethod.PUT)
|
||||
default ResponseEntity<Response<UserResponseBean>> updateUserDetails(HttpServletRequest request,
|
||||
@Parameter(description = "The user id", required = true) @PathVariable("userId") Long userId,
|
||||
@Parameter(description = "User request object", required = true) @Valid @RequestBody UpdateUserReqForBeneficiary userReq) {
|
||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ public class GlobalExceptionHandler {
|
||||
@ResponseBody
|
||||
public Response<Object> handleCustomValidationException(final CustomValidationException ex) {
|
||||
log.error(ex.getMessage());
|
||||
log.error(ex.getLocalizedMessage(), ex);
|
||||
// log.error(ex.getLocalizedMessage(), ex);
|
||||
return new Response<>(null, ex.getStatus(), ex.getMessage());
|
||||
}
|
||||
|
||||
@@ -45,14 +45,14 @@ public class GlobalExceptionHandler {
|
||||
@ResponseBody
|
||||
public Response<Object> handleValidationException(final ValidationException ex) {
|
||||
log.error(ex.getMessage());
|
||||
log.error(ex.getLocalizedMessage(), ex);
|
||||
// log.error(ex.getLocalizedMessage(), ex);
|
||||
return new Response<>(ex.getErrors(), ex.getStatus(), ex.getMessage());
|
||||
}
|
||||
|
||||
@ExceptionHandler(ResourceNotFoundException.class)
|
||||
public ResponseEntity<Response<Void>> handleResourceNotFoundException(ResourceNotFoundException ex) {
|
||||
log.error(ex.getMessage());
|
||||
log.error(ex.getLocalizedMessage(), ex);
|
||||
// log.error(ex.getLocalizedMessage(), ex);
|
||||
return ResponseEntity.status(HttpStatus.NOT_FOUND)
|
||||
.body(new Response<>(null, ex.getStatus(), ex.getMessage()));
|
||||
}
|
||||
@@ -71,7 +71,7 @@ public class GlobalExceptionHandler {
|
||||
@ResponseBody
|
||||
public Response<Object> handleInvalidTokenException(final Throwable ex) {
|
||||
log.error(ex.getMessage());
|
||||
log.error(ex.getLocalizedMessage(), ex);
|
||||
// log.error(ex.getLocalizedMessage(), ex);
|
||||
return new Response<>(ex.getMessage(), Status.UNAUTHORIZED, Translator.toLocale("invalid_signature"));
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ public class GlobalExceptionHandler {
|
||||
@ResponseBody
|
||||
public Response<Object> unauthorizedAccessException(final Throwable ex) {
|
||||
log.error(ex.getMessage());
|
||||
log.error(ex.getLocalizedMessage(), ex);
|
||||
// log.error(ex.getLocalizedMessage(), ex);
|
||||
return new Response<>(null, Status.UNAUTHORIZED, ex.getMessage());
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ public class GlobalExceptionHandler {
|
||||
@ResponseBody
|
||||
public Response<Object> handleUnAuthorizedException(final Throwable ex) {
|
||||
log.error(ex.getMessage());
|
||||
log.error(ex.getLocalizedMessage(), ex);
|
||||
// log.error(ex.getLocalizedMessage(), ex);
|
||||
return new Response<>(null, Status.VALIDATION_ERROR, Translator.toLocale("invalid_login"));
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ import net.gepafin.tendermanagement.enums.UserActionLogsEnum;
|
||||
import net.gepafin.tendermanagement.model.request.*;
|
||||
import net.gepafin.tendermanagement.model.response.ApplicationAmendmentRequestResponse;
|
||||
import net.gepafin.tendermanagement.model.response.PageableResponseBean;
|
||||
import net.gepafin.tendermanagement.model.response.GetAllAmendmentResponseBean;
|
||||
import net.gepafin.tendermanagement.model.util.Response;
|
||||
import net.gepafin.tendermanagement.service.ApplicationAmendmentRequestService;
|
||||
import net.gepafin.tendermanagement.util.LoggingUtil;
|
||||
@@ -83,14 +84,14 @@ public class ApplicationAmendmentRequestController implements ApplicationAmendme
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseEntity<Response<List<ApplicationAmendmentRequestResponse>>> getAllApplicationAmendmentRequest(HttpServletRequest request,Long userId) {
|
||||
public ResponseEntity<Response<List<GetAllAmendmentResponseBean>>> getAllApplicationAmendmentRequest(HttpServletRequest request, Long userId) {
|
||||
log.info("Get All Applications Amendment Request");
|
||||
|
||||
/** This code is responsible for creating user action logs for the "get all application amendment by preInstructor user id" operation. **/
|
||||
loggingUtil.logUserAction(UserActionRequest.builder().request(request).actionType(UserActionLogsEnum.VIEW)
|
||||
.actionContext(UserActionContextEnum.GET_ALL_AMENDMENT_BY_PREINSTRUCTOR_USER_ID).build());
|
||||
|
||||
List<ApplicationAmendmentRequestResponse> applicationAmendmentRequestResponses = applicationAmendmentRequestService.getAllApplicationAmendmentRequest(request,userId);
|
||||
List<GetAllAmendmentResponseBean> applicationAmendmentRequestResponses = applicationAmendmentRequestService.getAllApplicationAmendmentRequest(request,userId);
|
||||
return ResponseEntity.status(HttpStatus.OK)
|
||||
.body(new Response<>(applicationAmendmentRequestResponses, Status.SUCCESS, Translator.toLocale(GepafinConstant.GET_APPLICATION_AMENDMENT_SUCCESS_MSG)));
|
||||
}
|
||||
|
||||
@@ -3,13 +3,11 @@ package net.gepafin.tendermanagement.web.rest.api.impl;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import net.gepafin.tendermanagement.config.Translator;
|
||||
import net.gepafin.tendermanagement.constants.GepafinConstant;
|
||||
import net.gepafin.tendermanagement.enums.FormActionEnum;
|
||||
import net.gepafin.tendermanagement.enums.UserActionContextEnum;
|
||||
import net.gepafin.tendermanagement.enums.UserActionLogsEnum;
|
||||
import net.gepafin.tendermanagement.model.request.ApplicationEvaluationRequest;
|
||||
import net.gepafin.tendermanagement.model.request.EvaluationDocumentRequest;
|
||||
import net.gepafin.tendermanagement.model.request.UserActionRequest;
|
||||
import net.gepafin.tendermanagement.model.response.ApplicationEvaluationResponse;
|
||||
import net.gepafin.tendermanagement.model.response.EvaluationDocumentResponse;
|
||||
import net.gepafin.tendermanagement.model.request.*;
|
||||
import net.gepafin.tendermanagement.model.response.*;
|
||||
import net.gepafin.tendermanagement.model.util.Response;
|
||||
import net.gepafin.tendermanagement.service.ApplicationEvaluationService;
|
||||
import net.gepafin.tendermanagement.util.LoggingUtil;
|
||||
@@ -83,4 +81,41 @@ public class ApplicationEvaluationApiController implements ApplicationEvaluation
|
||||
.body(new Response<>(null, Status.SUCCESS, Translator.toLocale(GepafinConstant.EVALUATION_DELETED_SUCCESSFULLY)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseEntity<Response<ApplicationEvaluationFormResponse>> createApplicationEvaluation(HttpServletRequest request, ApplicationEvaluationFormRequestBean applicationEvaluationFormRequestBean, Long assignedApplicationId, Long evaluationFormId) {
|
||||
|
||||
/** This code is responsible for creating user action logs for the "Create or update application evaluation form" operation. **/
|
||||
loggingUtil.logUserAction(
|
||||
UserActionRequest.builder().request(request).actionType(UserActionLogsEnum.UPDATE).actionContext(UserActionContextEnum.CREATE_UPDATE_APPLICATION_EVALUATION_FORM).build());
|
||||
|
||||
ApplicationEvaluationFormResponse applicationEvaluationResponseBean = applicationEvaluationService.createApplicationEvaluation(request, applicationEvaluationFormRequestBean, assignedApplicationId, evaluationFormId);
|
||||
|
||||
return ResponseEntity.status(HttpStatus.CREATED)
|
||||
.body(new Response<>(applicationEvaluationResponseBean, Status.SUCCESS, Translator.toLocale(GepafinConstant.EVALUATION_CREATED_SUCCESSFULLY)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseEntity<Response<ApplicationEvaluationFormResponse>> getApplicationEvaluationForm(HttpServletRequest request, Long applicationId, Long assignedApplicationId) {
|
||||
|
||||
/** This code is responsible for creating user action logs for the "get application evaluation form" operation. **/
|
||||
loggingUtil.logUserAction(UserActionRequest.builder().request(request).actionType(UserActionLogsEnum.VIEW).actionContext(UserActionContextEnum.GET_APPLICATION_EVALUATION_FORM).build());
|
||||
|
||||
ApplicationEvaluationFormResponse applicationEvaluationFormResponse = applicationEvaluationService.getApplicationEvaluationForm(request,applicationId,assignedApplicationId);
|
||||
return ResponseEntity.status(HttpStatus.OK)
|
||||
.body(new Response<>(applicationEvaluationFormResponse, Status.SUCCESS, Translator.toLocale(GepafinConstant.GET_APPLICATION_EVALUATION_FORM_SUCCESS_MSG)));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseEntity<Response<ApplicationEvaluationVersionResponse>> getApplicationEvaluationVersion(HttpServletRequest request, Long applicationId) {
|
||||
|
||||
/** This code is responsible for creating user action logs for the "get application evaluation version" operation. **/
|
||||
loggingUtil.logUserAction(UserActionRequest.builder().request(request).actionType(UserActionLogsEnum.VIEW).actionContext(UserActionContextEnum.GET_APPLICATION_EVALUATION_VERSION).build());
|
||||
|
||||
ApplicationEvaluationVersionResponse applicationEvaluationVersionResponse = applicationEvaluationService.getApplicationEvaluationVersion(request,applicationId);
|
||||
|
||||
return ResponseEntity.status(HttpStatus.OK)
|
||||
.body(new Response<>(applicationEvaluationVersionResponse, Status.SUCCESS, Translator.toLocale(GepafinConstant.GET_APPLICATION_EVALUATION_VERSION_SUCCESS_MSG)));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,12 +4,15 @@ import jakarta.servlet.http.HttpServletRequest;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import net.gepafin.tendermanagement.config.Translator;
|
||||
import net.gepafin.tendermanagement.constants.GepafinConstant;
|
||||
import net.gepafin.tendermanagement.enums.ApplicationStatusTypeEnum;
|
||||
import net.gepafin.tendermanagement.enums.AssignedApplicationEnum;
|
||||
import net.gepafin.tendermanagement.enums.UserActionContextEnum;
|
||||
import net.gepafin.tendermanagement.enums.UserActionLogsEnum;
|
||||
import net.gepafin.tendermanagement.model.request.AssignedApplicationPageableRequestBean;
|
||||
import net.gepafin.tendermanagement.model.request.AssignedApplicationsRequest;
|
||||
import net.gepafin.tendermanagement.model.request.UpdateAssignedApplicationRequest;
|
||||
import net.gepafin.tendermanagement.model.request.UserActionRequest;
|
||||
import net.gepafin.tendermanagement.model.response.ApplicationResponse;
|
||||
import net.gepafin.tendermanagement.model.response.AssignedApplicationsResponse;
|
||||
import net.gepafin.tendermanagement.model.response.NotificationResponse;
|
||||
import net.gepafin.tendermanagement.model.response.PageableResponseBean;
|
||||
@@ -59,12 +62,12 @@ public class AssignedApplicationsController implements AssignedApplicationsApi {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseEntity<Response<List<AssignedApplicationsResponse>>> getAllAssignedApplications(HttpServletRequest request, Long userId) {
|
||||
public ResponseEntity<Response<List<AssignedApplicationsResponse>>> getAllAssignedApplications(HttpServletRequest request, Long userId,List<AssignedApplicationEnum> statusList) {
|
||||
log.info("Get All Assigned Applications");
|
||||
/** This code is responsible for creating user action logs for the "get Assigned Applications" operation. **/
|
||||
loggingUtil.logUserAction(UserActionRequest.builder().request(request).actionType(UserActionLogsEnum.VIEW)
|
||||
.actionContext(UserActionContextEnum.GET_ASSIGNED_APPLICATION).build());
|
||||
List<AssignedApplicationsResponse> applications = assignedApplicationsService.getAllAssignedApplications(request, userId);
|
||||
List<AssignedApplicationsResponse> applications = assignedApplicationsService.getAllAssignedApplications(request, userId,statusList);
|
||||
return ResponseEntity.status(HttpStatus.OK)
|
||||
.body(new Response<>(applications, Status.SUCCESS, Translator.toLocale(GepafinConstant.GET_ASSIGNED_APPLICATION_SUCCESS_MSG)));
|
||||
}
|
||||
@@ -102,6 +105,17 @@ public class AssignedApplicationsController implements AssignedApplicationsApi {
|
||||
|
||||
}
|
||||
|
||||
public ResponseEntity<Response<AssignedApplicationsResponse>> updateAssignedApplicationStatus(HttpServletRequest request, Long assignedApplicationId, AssignedApplicationEnum status) {
|
||||
|
||||
/** This code is responsible for creating user action logs for the "update assigned application status" operation. **/
|
||||
loggingUtil.logUserAction(
|
||||
UserActionRequest.builder().request(request).actionType(UserActionLogsEnum.UPDATE).actionContext(UserActionContextEnum.UPDATE_ASSIGNED_APPLICATION_STATUS).build());
|
||||
|
||||
AssignedApplicationsResponse applicationResponse = assignedApplicationsService.updateAssignedApplicationStatus(request, assignedApplicationId, status);
|
||||
|
||||
return ResponseEntity.status(HttpStatus.OK)
|
||||
.body(new Response<>(applicationResponse, Status.SUCCESS, Translator.toLocale(GepafinConstant.ASSIGNED_APPLICATION_STATUS_UPDATED_SUCCESSFULLY)));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package net.gepafin.tendermanagement.web.rest.api.impl;
|
||||
import java.util.List;
|
||||
|
||||
import net.gepafin.tendermanagement.enums.CallStatusEnum;
|
||||
import net.gepafin.tendermanagement.enums.EvaluationVersionEnum;
|
||||
import net.gepafin.tendermanagement.enums.UserActionContextEnum;
|
||||
import net.gepafin.tendermanagement.enums.UserActionLogsEnum;
|
||||
import net.gepafin.tendermanagement.model.request.*;
|
||||
@@ -160,6 +161,17 @@ public class CallApiController implements CallApi {
|
||||
return ResponseEntity.status(HttpStatus.OK)
|
||||
.body(new Response<>(callsByPagination, Status.SUCCESS, Translator.toLocale(GepafinConstant.CALL_FETCH_SUCCESS_MSG)));
|
||||
}
|
||||
@Override
|
||||
@Transactional(rollbackFor=Exception.class)
|
||||
public ResponseEntity<Response<CallResponse>> createCallStep2EvaluationV2(HttpServletRequest request, Long callId, CreateCallRequestStep2EvaluationV2 createCallRequest) {
|
||||
|
||||
/** This code is responsible for creating user action logs for the "Create or update Call step 2 for Evaluation V2" operation. **/
|
||||
loggingUtil.logUserAction(UserActionRequest.builder().request(request).actionType(UserActionLogsEnum.UPDATE)
|
||||
.actionContext(UserActionContextEnum.EVALUATION_V2_CREATE_UPDATE_CALL_STEP_2).build());
|
||||
|
||||
CallResponse createCallStep2EvaluationV2 = callService.createCallStep2EvaluationV2(request, callId, createCallRequest);
|
||||
return ResponseEntity.status(HttpStatus.CREATED)
|
||||
.body(new Response<>(createCallStep2EvaluationV2, Status.SUCCESS, Translator.toLocale(GepafinConstant.CALL_CREATED_SUCCESSFULLY_MSG)));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -6,7 +6,10 @@ import net.gepafin.tendermanagement.constants.GepafinConstant;
|
||||
import net.gepafin.tendermanagement.enums.UserActionContextEnum;
|
||||
import net.gepafin.tendermanagement.enums.UserActionLogsEnum;
|
||||
import net.gepafin.tendermanagement.model.request.UserActionRequest;
|
||||
import net.gepafin.tendermanagement.model.response.*;
|
||||
import net.gepafin.tendermanagement.model.response.AmendmentWidgetResponseBean;
|
||||
import net.gepafin.tendermanagement.model.response.ApplicationWidgetResponseBean;
|
||||
import net.gepafin.tendermanagement.model.response.AssignedApplicationWidgetResponseBean;
|
||||
import net.gepafin.tendermanagement.model.response.BeneficiaryWidgetResponseBean;
|
||||
import net.gepafin.tendermanagement.model.response.SuperAdminWidgetResponseBean;
|
||||
import net.gepafin.tendermanagement.model.util.Response;
|
||||
@@ -60,4 +63,45 @@ public class DashboardApiController implements DashboardApi {
|
||||
return ResponseEntity.status(HttpStatus.CREATED)
|
||||
.body(new Response<>(widgetResponseBean, Status.SUCCESS, Translator.toLocale(GepafinConstant.DASHBOARD_WIDGET_FETCHED_SUCCESSFULLY)));
|
||||
}
|
||||
@Override
|
||||
public ResponseEntity<Response<AmendmentWidgetResponseBean>> getAmendmentDetails(HttpServletRequest request) {
|
||||
|
||||
/** This code is responsible for creating user action logs for the "Get dashboard widget for amendment page" operation. **/
|
||||
loggingUtil.logUserAction(UserActionRequest.builder().request(request).actionType(UserActionLogsEnum.VIEW).actionContext(UserActionContextEnum.GET_AMENDMENT_DETAILS).build());
|
||||
|
||||
AmendmentWidgetResponseBean widgetResponseBean= dashboardService.getAmendmentDetails(request);
|
||||
return ResponseEntity.status(HttpStatus.CREATED)
|
||||
.body(new Response<>(widgetResponseBean, Status.SUCCESS, Translator.toLocale(GepafinConstant.DASHBOARD_WIDGET_FETCHED_SUCCESSFULLY)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseEntity<Response<PreInstructorWidgetResponseBean>> getDashboardWidgetForPreInstructor(HttpServletRequest request,Long userId) {
|
||||
|
||||
/** This code is responsible for creating user action logs for the "Get dashboard stats widget for amendment page" operation. **/
|
||||
loggingUtil.logUserAction(UserActionRequest.builder().request(request).actionType(UserActionLogsEnum.VIEW).actionContext(UserActionContextEnum.GET_DASHBOARD_WIDGET_FOR_PRE_INSTRUCTOR).build());
|
||||
|
||||
PreInstructorWidgetResponseBean widgetResponseBean= dashboardService.getDashboardWidgetForPreInstructor(request,userId);
|
||||
return ResponseEntity.status(HttpStatus.CREATED)
|
||||
.body(new Response<>(widgetResponseBean, Status.SUCCESS, Translator.toLocale(GepafinConstant.DASHBOARD_WIDGET_FETCHED_SUCCESSFULLY)));
|
||||
}
|
||||
public ResponseEntity<Response<AssignedApplicationWidgetResponseBean>> getApplicationDetailsForEvaluation(HttpServletRequest request) {
|
||||
|
||||
/** This code is responsible for creating user action logs for the "Get Application Details for Evaluation" operation. **/
|
||||
loggingUtil.logUserAction(UserActionRequest.builder().request(request).actionType(UserActionLogsEnum.VIEW).actionContext(UserActionContextEnum.GET_APPLICATION_DETAILS_FOR_EVALUATION).build());
|
||||
|
||||
AssignedApplicationWidgetResponseBean widgetResponseBean= dashboardService.getApplicationDetailsForEvaluation(request);
|
||||
return ResponseEntity.status(HttpStatus.CREATED)
|
||||
.body(new Response<>(widgetResponseBean, Status.SUCCESS, Translator.toLocale(GepafinConstant.DASHBOARD_WIDGET_FETCHED_SUCCESSFULLY)));
|
||||
}
|
||||
@Override
|
||||
public ResponseEntity<Response<BeneficiaryStatisticsResponseBean>> getStatisticsPageForBeneficiary(HttpServletRequest request, Long companyId) {
|
||||
|
||||
/** This code is responsible for creating user action logs for the "Get statistics page for beneficiary" operation. **/
|
||||
loggingUtil.logUserAction(UserActionRequest.builder().request(request).actionType(UserActionLogsEnum.VIEW).actionContext(UserActionContextEnum.GET_STATISTICS_PAGE_FOR_BENEFICIARY).build());
|
||||
|
||||
BeneficiaryStatisticsResponseBean widgetResponseBean= dashboardService.getStatisticsPageForBeneficiary(request, companyId);
|
||||
return ResponseEntity.status(HttpStatus.CREATED)
|
||||
.body(new Response<>(widgetResponseBean, Status.SUCCESS, Translator.toLocale(GepafinConstant.DASHBOARD_WIDGET_FETCHED_SUCCESSFULLY)));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
package net.gepafin.tendermanagement.web.rest.api.impl;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import net.gepafin.tendermanagement.config.Translator;
|
||||
import net.gepafin.tendermanagement.constants.GepafinConstant;
|
||||
import net.gepafin.tendermanagement.enums.UserActionContextEnum;
|
||||
import net.gepafin.tendermanagement.enums.UserActionLogsEnum;
|
||||
import net.gepafin.tendermanagement.model.request.EvaluationFormRequest;
|
||||
import net.gepafin.tendermanagement.model.request.UserActionRequest;
|
||||
import net.gepafin.tendermanagement.model.response.EvaluationFormResponseBean;
|
||||
import net.gepafin.tendermanagement.model.util.Response;
|
||||
import net.gepafin.tendermanagement.service.EvaluationFormService;
|
||||
import net.gepafin.tendermanagement.util.LoggingUtil;
|
||||
import net.gepafin.tendermanagement.web.rest.api.EvaluationFormApi;
|
||||
import net.gepafin.tendermanagement.web.rest.api.errors.Status;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
@RestController
|
||||
@RequestMapping("${openapi.gepafin.base-path:/v1/evaluationForm}")
|
||||
public class EvaluationFormApiController implements EvaluationFormApi {
|
||||
|
||||
@Autowired
|
||||
private EvaluationFormService evaluationFormService;
|
||||
|
||||
@Autowired
|
||||
private LoggingUtil loggingUtil;
|
||||
|
||||
@Override
|
||||
public ResponseEntity<Response<EvaluationFormResponseBean>> createEvaluationForm(HttpServletRequest request, Long callId, EvaluationFormRequest evaluationFormRequest) {
|
||||
|
||||
/** This code is responsible for creating user action logs for the "Create Evaluation form" operation. **/
|
||||
loggingUtil.logUserAction(UserActionRequest.builder().request(request).actionType(UserActionLogsEnum.INSERT).actionContext(UserActionContextEnum.CREATE_EVALUATION_FORM).build());
|
||||
|
||||
EvaluationFormResponseBean evaluationFormResponseBean = evaluationFormService.createEvaluationForm(request,callId, evaluationFormRequest);
|
||||
return ResponseEntity.status(HttpStatus.CREATED)
|
||||
.body(new Response<>(evaluationFormResponseBean, Status.SUCCESS, Translator.toLocale(GepafinConstant.EVALUATION_FORM_CREATED_SUCCESSFULLY)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseEntity<Response<EvaluationFormResponseBean>> updateEvaluationForm(HttpServletRequest request, Long evaluationFormId, EvaluationFormRequest evaluationFormRequest) {
|
||||
|
||||
/** This code is responsible for creating user action logs for the "Update Evaluation form" operation. **/
|
||||
loggingUtil.logUserAction(UserActionRequest.builder().request(request).actionType(UserActionLogsEnum.UPDATE).actionContext(UserActionContextEnum.UPDATE_EVALUATION_FORM).build());
|
||||
|
||||
EvaluationFormResponseBean evaluationFormResponseBean = evaluationFormService.updateEvaluationForm(request, evaluationFormId, evaluationFormRequest);
|
||||
return ResponseEntity.status(HttpStatus.CREATED)
|
||||
.body(new Response<>(evaluationFormResponseBean, Status.SUCCESS, Translator.toLocale(GepafinConstant.EVALUATION_FORM_UPDATED_SUCCESSFULLY)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseEntity<Response<EvaluationFormResponseBean>> getEvaluationFormById(HttpServletRequest request, Long evaluationFormId) {
|
||||
|
||||
/** This code is responsible for creating user action logs for the "Get Evaluation form by id" operation. **/
|
||||
loggingUtil.logUserAction(UserActionRequest.builder().request(request).actionType(UserActionLogsEnum.VIEW).actionContext(UserActionContextEnum.GET_EVALUATION_FORM).build());
|
||||
|
||||
EvaluationFormResponseBean evaluationFormResponseBean= evaluationFormService.getEvaluationFormById(request,evaluationFormId);
|
||||
return ResponseEntity.status(HttpStatus.OK)
|
||||
.body(new Response<>(evaluationFormResponseBean, Status.SUCCESS, Translator.toLocale(GepafinConstant.EVALUATION_FORM_FETCHED_SUCCESSFULLY)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseEntity<Response<Void>> deleteEvaluationForm(HttpServletRequest request, Long evaluationFormId) {
|
||||
|
||||
/** This code is responsible for creating user action logs for the "delete Evaluation form" operation. **/
|
||||
loggingUtil.logUserAction(UserActionRequest.builder().request(request).actionType(UserActionLogsEnum.DELETE).actionContext(UserActionContextEnum.DELETE_EVALUATION_FORM).build());
|
||||
|
||||
evaluationFormService.deleteEvaluationForm(request,evaluationFormId);
|
||||
return ResponseEntity.status(HttpStatus.OK)
|
||||
.body(new Response<>(null, Status.SUCCESS, Translator.toLocale(GepafinConstant.EVALUATION_FORM_DELETED_SUCCESSFULLY)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseEntity<Response<EvaluationFormResponseBean>> getEvaluationFormByCallId(HttpServletRequest request, Long callId) {
|
||||
|
||||
/** This code is responsible for creating user action logs for the "Get Evaluation forms by call id" operation. **/
|
||||
loggingUtil.logUserAction(UserActionRequest.builder().request(request).actionType(UserActionLogsEnum.VIEW).actionContext(UserActionContextEnum.GET_EVALUATION_FORM).build());
|
||||
|
||||
EvaluationFormResponseBean evaluationFormResponseBean= evaluationFormService.getEvaluationFormByCallId(request,callId);
|
||||
return ResponseEntity.status(HttpStatus.OK)
|
||||
.body(new Response<>(evaluationFormResponseBean, Status.SUCCESS, Translator.toLocale(GepafinConstant.EVALUATION_FORM_FETCHED_SUCCESSFULLY)));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -254,10 +254,24 @@ public class UserApiController implements UserApi {
|
||||
loggingUtil.logUserAction(UserActionRequest.builder().request(request).actionType(UserActionLogsEnum.VIEW)
|
||||
.actionContext(UserActionContextEnum.GET_ALL_USER_BY_PAGINATION).build());
|
||||
|
||||
PageableResponseBean<List<UserResponseBean>> users = userService.getUserByPagination(request,userPaginationRequestBean);
|
||||
PageableResponseBean<List<UserResponseBean>> users = userService.getUserByPagination(request, userPaginationRequestBean);
|
||||
|
||||
return ResponseEntity.status(HttpStatus.OK).body(new Response<>(users, Status.SUCCESS, Translator.toLocale(GepafinConstant.GET_USERS_SUCCESS_MSG)));
|
||||
|
||||
}
|
||||
public ResponseEntity<Response<UserResponseBean>> updateUserDetails(HttpServletRequest request,
|
||||
@PathVariable("userId") Long userId,
|
||||
@Valid @RequestBody UpdateUserReqForBeneficiary userReq) {
|
||||
log.info("Update User for Beneficiary- User ID: {}, Request Body: {}", userId, userReq);
|
||||
|
||||
/** This code is responsible for "Updating user details by beneficiary" operation. **/
|
||||
loggingUtil.logUserAction(UserActionRequest.builder().request(request).actionType(UserActionLogsEnum.UPDATE)
|
||||
.actionContext(UserActionContextEnum.UPDATE_USER_DETAILS).build());
|
||||
|
||||
UserResponseBean updatedUser = userService.updateUserDetails(request, userId, userReq);
|
||||
|
||||
return ResponseEntity.status(HttpStatus.OK)
|
||||
.body(new Response<>(updatedUser, Status.SUCCESS, Translator.toLocale(GepafinConstant.USER_UPDATED_SUCCESS_MSG)));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user