Done ticket GEPAFINBE-223 & GEPAFINBE-224

This commit is contained in:
rajesh
2025-06-18 20:23:12 +05:30
parent ab549a0d80
commit 6d66037adb
20 changed files with 344 additions and 47 deletions

View File

@@ -56,4 +56,15 @@ public interface AppointmentApi {
ResponseEntity<Response<DocumentUploadResponse>> uploadDocumentToExternalSystem(HttpServletRequest request,
@Parameter(description = "The document id", required = true) @PathVariable(value = "documentId", required = true) Long documentId,
@RequestBody UploadDocToExternalSystemRequest docToExternalSystemRequest);
@Operation(summary = "API to get ndg by vatNumber", 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 = "/vatNumber/{vatNumber}", produces = MediaType.APPLICATION_JSON_VALUE)
ResponseEntity<Response<NdgResponse>> getNdgByVatNumber(HttpServletRequest request,@PathVariable(value = "vatNumber", required = true) @Parameter(description = "vatNumber",required = true)String vatNumber);
}

View File

@@ -169,4 +169,17 @@ public interface CompanyApi {
@PreAuthorize("hasRole('ROLE_SUPER_ADMIN') ")
ResponseEntity<Response<Void>> updateMissingVatCheckResponses(HttpServletRequest request,
@Parameter(description = "Limit request object ", required = true) @RequestBody LimitRequest limitRequest);
@Operation(summary = "Api to extract pec from the company json", 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 = "/pec", produces = { "application/json" })
@PreAuthorize("hasRole('ROLE_SUPER_ADMIN') ")
ResponseEntity<Response<Void>> extractPecFromJson(HttpServletRequest request);
}

View File

@@ -17,6 +17,7 @@ import net.gepafin.tendermanagement.service.AppointmentService;
import net.gepafin.tendermanagement.util.LoggingUtil;
import net.gepafin.tendermanagement.web.rest.api.AppointmentApi;
import net.gepafin.tendermanagement.web.rest.api.errors.Status;
import org.opensaml.xmlsec.signature.G;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
@@ -81,4 +82,19 @@ public class AppointmentController implements AppointmentApi {
.body(new Response<>(documentUploadResponse, Status.SUCCESS, Translator.toLocale(message)));
}
@Override
public ResponseEntity<Response<NdgResponse>> getNdgByVatNumber(HttpServletRequest request,String vatNumber) {
loggingUtil.logUserAction(
UserActionRequest.builder().request(request).actionType(UserActionLogsEnum.UPLOAD).actionContext(UserActionContextEnum.GET_NDG_BY_VAT_NUMBER).build());
NdgResponse ndgResponse= appointmentService.getNdgByVatNumber(request,vatNumber);
if(ndgResponse==null){
return ResponseEntity.status(HttpStatus.CREATED)
.body(new Response<>(ndgResponse, Status.NOT_FOUND, Translator.toLocale(GepafinConstant.NDG_NOT_FOUND)));
}
return ResponseEntity.status(HttpStatus.CREATED)
.body(new Response<>(ndgResponse, Status.SUCCESS, Translator.toLocale(GepafinConstant.NDG_FETCH_SUCCESSFULLY)));
}
}

View File

@@ -201,4 +201,17 @@ public class CompanyApiController implements CompanyApi{
return ResponseEntity.status(HttpStatus.OK)
.body(new Response<>(null, Status.SUCCESS, Translator.toLocale(GepafinConstant.COMPANY_UPDATED_SUCCESS_MSG)));
}
@Override
public ResponseEntity<Response<Void>> extractPecFromJson(HttpServletRequest request) {
log.info("Api to set pec from json field");
companyService.extractPecFromJson(request);
loggingUtil.logUserAction(UserActionRequest.builder().request(request).actionType(UserActionLogsEnum.UPDATE).actionContext(UserActionContextEnum.EXTRACT_PEC_FROM_COMPANY).build());
return ResponseEntity.status(HttpStatus.OK)
.body(new Response<>(null, Status.SUCCESS, Translator.toLocale(GepafinConstant.COMPANY_UPDATED_SUCCESS_MSG)));
}
}