Commit ef1261f5 authored by Enriko Käsper's avatar Enriko Käsper
Browse files

Merge branch 'develop' into 'master'

Release: merge 'develop' into 'master' created by Enriko Käsper

See merge request teis/common-api-gateway!182
parents c0a755bc b538efc6
......@@ -8,8 +8,6 @@ import ee.sm.ti.teis.commongateway.proceedings.violation.request.ViolationsPubli
import ee.sm.ti.teis.gatewaycommon.controller.TeisBaseController;
import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
......@@ -26,10 +24,6 @@ public class ViolationController extends TeisBaseController {
private final ViolationProcessingService service;
@ApiOperation(value = "${teis.api.messages.proceedings.violations.get-violations}", response = ViolationPublicDto.class)
@ApiResponses(value = {
@ApiResponse(code = 400, message = "Sisendi parameetrid ei vasta nõuetele"),
@ApiResponse(code = 403, message = "Kasutajal ei ole õigust andmeobjekti pärida"),
@ApiResponse(code = 404, message = "Sisendis esitatud andmetega objekti ei eksisteeri")})
@GetMapping(produces = APPLICATION_JSON_VALUE)
public List<ViolationPublicDto> getViolations(@RequestParam(value = "proceduralActId", required = false) UUID proceduralActId,
@RequestParam(value = "proceedingId", required = false) UUID proceedingId,
......@@ -41,10 +35,6 @@ public class ViolationController extends TeisBaseController {
}
@ApiOperation(value = "${teis.api.messages.proceedings.violations.get-violations}", response = ViolationPublicDto.class)
@ApiResponses(value = {
@ApiResponse(code = 400, message = "Sisendi parameetrid ei vasta nõuetele"),
@ApiResponse(code = 403, message = "Kasutajal ei ole õigust andmeobjekti pärida"),
@ApiResponse(code = 404, message = "Sisendis esitatud andmetega objekti ei eksisteeri")})
@GetMapping(value = "/{id}", produces = APPLICATION_JSON_VALUE)
public ViolationPublicDto getViolation(@PathVariable UUID id, RequestMetaDTO requestMetaDTO) {
ViolationPublicRequest request = new ViolationPublicRequest();
......@@ -54,10 +44,6 @@ public class ViolationController extends TeisBaseController {
}
@ApiOperation(value = "${teis.api.messages.proceedings.violations.patch-violation}", response = ViolationPublicDto.class)
@ApiResponses(value = {
@ApiResponse(code = 400, message = "Sisendi parameetrid ei vasta nõuetele"),
@ApiResponse(code = 403, message = "Kasutajal ei ole õigust andmeobjekti pärida"),
@ApiResponse(code = 404, message = "Sisendis esitatud andmetega andmeobjekti ei eksisteeri")})
@PatchMapping("{id}/status")
public ViolationPublicDto updateStatus(@PathVariable UUID id, @RequestBody UpdateViolationStatusPublicDto dto,
RequestMetaDTO requestMetaDTO) {
......
......@@ -15,6 +15,7 @@ import org.springframework.stereotype.Service;
import java.util.List;
@Service
@Deprecated(since = "1.19.0-SNAPSHOT", forRemoval = true)
@RequiredArgsConstructor
public class ViolationProcessingService {
......
......@@ -2,51 +2,41 @@ package ee.sm.ti.teis.commongateway.proceedings.violationact;
import ee.sm.ti.teis.commongateway.proceedings.violationact.dto.ViolationActPublicDto;
import ee.sm.ti.teis.gatewaycommon.controller.TeisBaseController;
import ee.sm.ti.teis.gatewaycommon.rabbit.RequestProcessingService;
import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;
import java.util.UUID;
@RestController
@RequestMapping("violation-acts")
@RequiredArgsConstructor
public class ViolationActController extends TeisBaseController {
private final ViolationActProcessingService service;
private final RequestProcessingService service;
@ApiOperation(value = "${teis.api.messages.proceedings.get-violation-acts}", response = ViolationActPublicDto.class)
@ApiResponses(value = {
@ApiResponse(code = 400, message = "Sisendi parameetrid ei vasta nõuetele"),
@ApiResponse(code = 403, message = "Kasutajal ei ole õigust andmeobjekti pärida"),
@ApiResponse(code = 404, message = "Sisendis esitatud andmetega objekti ei eksisteeri")})
@GetMapping(produces = APPLICATION_JSON_VALUE)
@GetMapping
public List<ViolationActPublicDto> getViolationActs(
@RequestParam(value = "proceedingId", required = false) String proceedingId,
@RequestParam(value = "violationId", required = false) String violationId,
RequestMetaDTO requestMetaDTO) {
@RequestParam(value = "proceedingId", required = false) UUID proceedingId,
@RequestParam(value = "violationId", required = false) UUID violationId,
RequestMetaDTO requestMetaDTO) {
ViolationActsPublicRequest request = new ViolationActsPublicRequest();
request.setPayload(new ViolationActsPublicRequest.Parameters(proceedingId, violationId), requestMetaDTO);
return service.getViolationActs(request);
return (List<ViolationActPublicDto>) service.sendAndReceive(request);
}
@ApiOperation(value = "${teis.api.messages.proceedings.get-violation-act}", response = ViolationActPublicDto.class)
@ApiResponses(value = {
@ApiResponse(code = 400, message = "Sisendi parameetrid ei vasta nõuetele"),
@ApiResponse(code = 403, message = "Kasutajal ei ole õigust andmeobjekti pärida"),
@ApiResponse(code = 404, message = "Sisendis esitatud andmetega objekti ei eksisteeri")})
@GetMapping(value = "/{id}", produces = APPLICATION_JSON_VALUE)
public ViolationActPublicDto getViolationAct(@PathVariable(value = "id") String violationActId, RequestMetaDTO requestMetaDTO) {
@GetMapping("{id}")
public ViolationActPublicDto getViolationAct(@PathVariable UUID id, RequestMetaDTO requestMetaDTO) {
ViolationActPublicRequest request = new ViolationActPublicRequest();
request.setPayload(new ViolationActPublicRequest.Parameters(violationActId), requestMetaDTO);
request.setPayload(id, requestMetaDTO);
return service.getViolationAct(request);
return (ViolationActPublicDto) service.sendAndReceive(request);
}
}
package ee.sm.ti.teis.commongateway.proceedings.violationact;
import ee.sm.ti.teis.commongateway.proceedings.violationact.dto.ViolationActPublicDto;
import ee.sm.ti.teis.gatewaycommon.error.NoResponseFromRabbitException;
import lombok.RequiredArgsConstructor;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
@RequiredArgsConstructor
public class ViolationActProcessingService {
private final RabbitTemplate gwRabbitTemplate;
List<ViolationActPublicDto> getViolationActs(ViolationActsPublicRequest request) {
ViolationActsPublicResponse response =
(ViolationActsPublicResponse) gwRabbitTemplate.convertSendAndReceive(request.routingKey(), request);
if (response != null) {
return response.processResponse();
}
throw new NoResponseFromRabbitException(request.getRequestMetaDTO().getRequestId());
}
public ViolationActPublicDto getViolationAct(ViolationActPublicRequest request) {
ViolationActPublicResponse response =
(ViolationActPublicResponse) gwRabbitTemplate.convertSendAndReceive(request.routingKey(), request);
if (response != null) {
return response.processResponse();
}
throw new NoResponseFromRabbitException(request.getRequestMetaDTO().getRequestId());
}
}
......@@ -4,7 +4,9 @@ import ee.sm.ti.teis.commongateway.representative.search.RepresentativeSearchFil
import ee.sm.ti.teis.commongateway.role.RoleState;
import ee.sm.ti.teis.gatewaycommon.controller.TeisBaseController;
import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
import io.swagger.annotations.*;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
......@@ -21,7 +23,6 @@ public class RepresentativeController extends TeisBaseController {
private final RepresentativeProcessingService service;
@ApiOperation(value = "${teis.api.messages.get-representative}", response = RepresentativeDto.class)
@ApiResponses(value = {@ApiResponse(code = 404, message = "Sisendis esitatud andmetega esindajat ei eksisteeri")})
@ApiImplicitParams(@ApiImplicitParam(name = "id", value = "${teis.api.messages.get-representative-id}"))
@GetMapping("{id}")
public RepresentativeDto getRepresentative(@PathVariable UUID id, RequestMetaDTO requestMetaDTO) {
......@@ -32,7 +33,6 @@ public class RepresentativeController extends TeisBaseController {
}
@ApiOperation(value = "${teis.api.messages.get-representatives}", response = RepresentativeComplexDto.class)
@ApiResponses(value = {@ApiResponse(code = 404, message = "Sisendis esitatud andmetega esindajaid ei eksisteeri")})
@ApiImplicitParams({
@ApiImplicitParam(name = "personId", value = "${teis.api.messages.get-representative-personId}"),
@ApiImplicitParam(name = "employerId", value = "${teis.api.messages.get-representative-employerId}"),
......@@ -67,7 +67,6 @@ public class RepresentativeController extends TeisBaseController {
}
@ApiOperation(value = "${teis.api.messages.check-representative}", response = RepresentativeDto.class)
@ApiResponses(value = {@ApiResponse(code = 404, message = "Sisendis esitatud andmetega esindajat ei eksisteeri")})
@ApiImplicitParams(@ApiImplicitParam(name = "employerId", value = "${teis.api.messages.check-representative-id}"))
@GetMapping("check-representative/{employerId}")
public List<RoleState> checkRepresentative(@PathVariable(name = "employerId") UUID employerId, RequestMetaDTO requestMetaDTO) {
......@@ -100,10 +99,6 @@ public class RepresentativeController extends TeisBaseController {
}
@ApiOperation(value = "${teis.api.messages.patch-contacts}", response = RepresentativeDto.class)
@ApiResponses(value = {
@ApiResponse(code = 400, message = "Sisend ei vasta nõuetele"),
@ApiResponse(code = 403, message = "Kasutajal ei ole õigust andmeobjekti pärida"),
@ApiResponse(code = 404, message = "Sisendis viidatud objekti ei eksisteeri")})
@PatchMapping("{id}/contacts")
public RepresentativeDto updateContacts(@PathVariable UUID id, @RequestBody ContactInfoDto dto, RequestMetaDTO requestMetaDTO) {
UpdateRepresentativeContactsRequest request = new UpdateRepresentativeContactsRequest();
......
......@@ -9,6 +9,7 @@ import org.springframework.stereotype.Service;
import java.util.List;
@Service
@Deprecated(since = "1.19.0-SNAPSHOT", forRemoval = true)
@RequiredArgsConstructor
public class RepresentativeProcessingService {
......
......@@ -5,8 +5,6 @@ import ee.sm.ti.teis.commongateway.representative.authority.request.AuthoritiesR
import ee.sm.ti.teis.gatewaycommon.controller.TeisBaseController;
import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -23,9 +21,6 @@ public class AuthorityController extends TeisBaseController {
private final AuthorityProcessingService service;
@ApiOperation(value = "${teis.api.representatives.authority.get-list}", response = AuthorityDto.class)
@ApiResponses(value = {
@ApiResponse(code = 400, message = "Sisend ei vasta nõuetele."),
@ApiResponse(code = 403, message = "Kasutajal ei ole õigust esindaja andmeid saada.")})
@GetMapping
public List<AuthorityDto> getAuthorities(@RequestParam(required = false) Boolean includeAll, RequestMetaDTO requestMetaDTO) {
AuthoritiesRequest request = new AuthoritiesRequest();
......
......@@ -11,6 +11,7 @@ import org.springframework.stereotype.Service;
import java.util.List;
@Service
@Deprecated(since = "1.19.0-SNAPSHOT", forRemoval = true)
@RequiredArgsConstructor
public class AuthorityProcessingService {
......
......@@ -12,8 +12,6 @@ import ee.sm.ti.teis.gatewaycommon.controller.TeisBaseController;
import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
import ee.sm.ti.teis.types.enums.AuthorityType;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
......@@ -28,10 +26,6 @@ public class AuthorityPermissionController extends TeisBaseController {
private final AuthorityPermissionProcessingService service;
@ApiOperation(value = "${teis.api.representatives.authority-permission.create}", response = AuthorityPermissionDto.class)
@ApiResponses(value = {
@ApiResponse(code = 400, message = "Sisend ei vasta nõuetele (puuduvad kohustuslikud väärtused)."),
@ApiResponse(code = 403, message = "Kasutajal ei ole õigust andmeid salvestada."),
@ApiResponse(code = 404, message = "Sisendis viidatud isikut ei eksisteeri.")})
@PostMapping
public AuthorityPermissionDto create(@RequestBody CreateAuthorityPermissionDto dto,
RequestMetaDTO requestMetaDTO) {
......@@ -42,10 +36,6 @@ public class AuthorityPermissionController extends TeisBaseController {
}
@ApiOperation(value = "${teis.api.representatives.authority-permission.get-by-authority}", response = AuthorityPermissionAuthorityDto.class)
@ApiResponses(value = {
@ApiResponse(code = 400, message = "Sisend ei vasta nõuetele."),
@ApiResponse(code = 403, message = "Kasutajal ei ole õigust esindaja andmeid saada."),
@ApiResponse(code = 404, message = "Puudub sisendis viidatud andmeobjekt.")})
@GetMapping("authority")
public AuthorityPermissionAuthorityDto getByAuthority(@RequestParam UUID personId,
@RequestParam AuthorityType authorityType,
......@@ -58,10 +48,6 @@ public class AuthorityPermissionController extends TeisBaseController {
}
@ApiOperation(value = "${teis.api.representatives.authority-permission.get-by-grantor}", response = AuthorityPermissionDto.class)
@ApiResponses(value = {
@ApiResponse(code = 400, message = "Sisend ei vasta nõuetele."),
@ApiResponse(code = 403, message = "Kasutajal ei ole õigust esindaja andmeid saada."),
@ApiResponse(code = 404, message = "Puudub sisendis viidatud andmeobjekt.")})
@GetMapping("grantor")
public List<AuthorityPermissionDto> getByGrantor(@RequestParam UUID grantorId,
@RequestParam(required = false) Boolean includeAll,
......@@ -73,10 +59,6 @@ public class AuthorityPermissionController extends TeisBaseController {
}
@ApiOperation(value = "${teis.api.representatives.authority-permission.update-valid-until}", response = AuthorityPermissionDto.class)
@ApiResponses(value = {
@ApiResponse(code = 400, message = "Sisend ei vasta nõuetele."),
@ApiResponse(code = 403, message = "Kasutajal ei ole õigust esindaja andmeid saada."),
@ApiResponse(code = 404, message = "Puudub sisendis viidatud andmeobjekt.")})
@PatchMapping("{id}")
public AuthorityPermissionDto updateValidUntil(@PathVariable UUID id,
@RequestBody UpdateAuthorityPermissionValidUntilDto dto,
......
......@@ -13,6 +13,7 @@ import org.springframework.stereotype.Service;
import java.util.List;
@Service
@Deprecated(since = "1.19.0-SNAPSHOT", forRemoval = true)
@RequiredArgsConstructor
public class AuthorityPermissionProcessingService {
......
......@@ -7,8 +7,6 @@ import ee.sm.ti.teis.gatewaycommon.controller.TeisBaseController;
import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
import ee.sm.ti.teis.types.enums.AuthorityType;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Profile;
import org.springframework.web.bind.annotation.GetMapping;
......@@ -27,8 +25,6 @@ public class AuthorityPermissionTestController extends TeisBaseController {
private final AuthorityPermissionProcessingService service;
@ApiOperation(value = "${teis.api.representatives.authority-permission.validate}", response = ValidatedAuthorityDto.class)
@ApiResponses(value = {
@ApiResponse(code = 400, message = "Sisend ei vasta nõuetele")})
@GetMapping("validate")
public ValidatedAuthorityDto validate(@RequestParam(name = "personId") UUID personId,
@RequestParam(name = "grantorId") UUID grantorId,
......
......@@ -9,6 +9,7 @@ import org.springframework.stereotype.Service;
import java.util.List;
@Service
@Deprecated(since = "1.19.0-SNAPSHOT", forRemoval = true)
@RequiredArgsConstructor
public class RepresentativeLocationProcessingService {
......
......@@ -8,8 +8,6 @@ import ee.sm.ti.teis.commongateway.riskassessments.businesstype.request.Business
import ee.sm.ti.teis.gatewaycommon.controller.TeisBaseController;
import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
......@@ -24,9 +22,6 @@ public class BusinessTypeController extends TeisBaseController {
private final BusinessTypeProcessingService service;
@ApiOperation(value = "${teis.api.risk-assessments.business-type.get-list}", response = BusinessTypePublicLightDto.class)
@ApiResponses(value = {
@ApiResponse(code = 400, message = "Sisendi parameetrid ei vasta nõuetele"),
@ApiResponse(code = 403, message = "Kasutajal ei ole õigust andmeobjekti pärida")})
@GetMapping
public List<BusinessTypePublicLightDto> getBusinessTypes(@RequestParam(required = false) Boolean includeInactive,
RequestMetaDTO requestMetaDTO) {
......@@ -37,10 +32,6 @@ public class BusinessTypeController extends TeisBaseController {
}
@ApiOperation(value = "${teis.api.risk-assessments.business-type.get-object}", response = BusinessTypePublicDto.class)
@ApiResponses(value = {
@ApiResponse(code = 400, message = "Sisendi parameetrid ei vasta nõuetele"),
@ApiResponse(code = 403, message = "Kasutajal ei ole õigust andmeobjekti pärida"),
@ApiResponse(code = 404, message = "Sisendis esitatud andmetega objekti ei eksisteeri")})
@GetMapping("{id}")
public BusinessTypePublicDto getBusinessType(@PathVariable UUID id, @RequestParam(required = false) Boolean includeInactive,
@RequestParam(required = false) Boolean includeRiskFactors,
......
......@@ -14,6 +14,7 @@ import org.springframework.stereotype.Service;
import java.util.List;
@Service
@Deprecated(since = "1.19.0-SNAPSHOT", forRemoval = true)
@RequiredArgsConstructor
public class BusinessTypeProcessingService {
......
......@@ -6,8 +6,6 @@ import ee.sm.ti.teis.gatewaycommon.controller.TeisBaseController;
import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
import ee.sm.ti.teis.types.enums.RiskFactorAssessmentsOutputType;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
......@@ -22,8 +20,6 @@ public class RiskAssessmentController extends TeisBaseController {
private final RiskAssessmentProcessingService service;
@ApiOperation(value = "${teis.api.risk-assessments.risk-assessment.create}", response = RiskAssessmentPublicDto.class)
@ApiResponses(value = {
@ApiResponse(code = 403, message = "Kasutajal ei ole õigust andmeobjekti pärida")})
@PostMapping
public RiskAssessmentPublicDto create(@RequestBody CreateRiskAssessmentDto dto,
RequestMetaDTO requestMetaDTO) {
......@@ -34,8 +30,6 @@ public class RiskAssessmentController extends TeisBaseController {
}
@ApiOperation(value = "${teis.api.risk-assessments.risk-assessment.copy}", response = RiskAssessmentPublicDto.class)
@ApiResponses(value = {
@ApiResponse(code = 403, message = "Kasutajal ei ole õigust andmeobjekti pärida")})
@PostMapping("{id}/copy")
public RiskAssessmentPublicDto copy(@PathVariable UUID id, @RequestBody CopyRiskAssessmentDto dto,
RequestMetaDTO requestMetaDTO) {
......@@ -47,8 +41,6 @@ public class RiskAssessmentController extends TeisBaseController {
}
@ApiOperation(value = "${teis.api.risk-assessments.risk-assessment.get}", response = RiskAssessmentPublicDto.class)
@ApiResponses(value = {
@ApiResponse(code = 403, message = "Kasutajal ei ole õigust andmeobjekti pärida")})
@GetMapping
public List<RiskAssessmentPublicDto> getRiskAssessments(@RequestParam UUID employerId,
RequestMetaDTO requestMetaDTO) {
......@@ -59,10 +51,6 @@ public class RiskAssessmentController extends TeisBaseController {
}
@ApiOperation(value = "${teis.api.risk-assessments.risk-assessment.update-title}")
@ApiResponses(value = {
@ApiResponse(code = 400, message = "Sisendi parameetrid ei vasta nõuetele"),
@ApiResponse(code = 403, message = "Kasutajal ei ole õigust andmeobjekti pärida"),
@ApiResponse(code = 404, message = "Sisendis esitatud andmetega objekti ei eksisteeri")})
@PatchMapping("{id}/title")
public RiskAssessmentPublicDto updateTitle(@PathVariable UUID id,
@RequestBody UpdateRiskAssessmentTitleDto dto,
......@@ -75,10 +63,6 @@ public class RiskAssessmentController extends TeisBaseController {
}
@ApiOperation(value = "${teis.api.risk-assessments.risk-assessment.conclusion}", response = RiskAssessmentConclusionDto.class)
@ApiResponses(value = {
@ApiResponse(code = 400, message = "Sisendi parameetrid ei vasta nõuetele"),
@ApiResponse(code = 403, message = "Kasutajal ei ole õigust andmeobjekti pärida"),
@ApiResponse(code = 404, message = "Sisendis esitatud andmetega objekti ei eksisteeri")})
@GetMapping("{id}/conclusion")
public RiskAssessmentConclusionDto getConclusion(@PathVariable UUID id, RequestMetaDTO requestMetaDTO) {
RiskAssessmentConclusionPublicRequest request = new RiskAssessmentConclusionPublicRequest();
......@@ -88,10 +72,6 @@ public class RiskAssessmentController extends TeisBaseController {
}
@ApiOperation(value = "${teis.api.risk-assessments.risk-assessment.action-plan-conclusion}", response = RiskAssessmentActionPlanConclusionDto.class)
@ApiResponses(value = {
@ApiResponse(code = 400, message = "Sisend ei vasta nõuetele"),
@ApiResponse(code = 403, message = "Kasutajal puudub nõutav privileeg või õigus seda riskianalüüsi näha"),
@ApiResponse(code = 404, message = "Riskianalüüsi andmeobjekti ei leitud")})
@GetMapping("{id}/action-plan-conclusion")
public RiskAssessmentActionPlanConclusionDto getActionPlanConclusion(@PathVariable UUID id,
RequestMetaDTO requestMetaDTO) {
......@@ -102,8 +82,6 @@ public class RiskAssessmentController extends TeisBaseController {
}
@ApiOperation(value = "${teis.api.risk-assessments.risk-assessment.get-business-types}", response = RiskAssessmentPublicDto.class)
@ApiResponses(value = {
@ApiResponse(code = 403, message = "Kasutajal ei ole õigust andmeobjekti pärida")})
@GetMapping("{id}/business-types")
public RiskAssessmentPublicDto getRiskAssessmentBusinessTypes(@PathVariable UUID id,
RequestMetaDTO requestMetaDTO) {
......@@ -114,8 +92,6 @@ public class RiskAssessmentController extends TeisBaseController {
}
@ApiOperation(value = "${teis.api.risk-assessments.risk-assessment.get-by-id}", response = RiskAssessmentPublicDto.class)
@ApiResponses(value = {
@ApiResponse(code = 403, message = "Kasutajal ei ole õigust andmeobjekti pärida")})
@GetMapping("{id}")
public RiskAssessmentPublicDto getRiskAssessment(@PathVariable UUID id,
RequestMetaDTO requestMetaDTO) {
......@@ -126,10 +102,6 @@ public class RiskAssessmentController extends TeisBaseController {
}
@ApiOperation(value = "${teis.api.risk-assessments.risk-assessment.get-risk-factor-assessments}", response = RiskAssessmentPublicDto.class)
@ApiResponses(value = {
@ApiResponse(code = 400, message = "Sisend ei vasta nõuetele"),
@ApiResponse(code = 403, message = "Kasutajal puudub nõutav privileeg või õigus seda riskianalüüsi näha"),
@ApiResponse(code = 404, message = "Sisendis viidatud riskianalüüsi ei eksisteeri")})
@GetMapping("{id}/risk-factor-assessments")
public RiskAssessmentPublicDto getRiskFactorAssessment(@PathVariable UUID id,
@RequestParam(required = false) RiskFactorAssessmentsOutputType outputType, RequestMetaDTO requestMetaDTO) {
......@@ -140,10 +112,6 @@ public class RiskAssessmentController extends TeisBaseController {
}
@ApiOperation(value = "${teis.api.risk-assessments.risk-assessment.update-status}", response = RiskAssessmentPublicDto.class)
@ApiResponses(value = {
@ApiResponse(code = 400, message = "Sisendi parameetrid ei vasta nõuetele"),
@ApiResponse(code = 403, message = "Kasutajal ei ole õigust andmeobjekti pärida"),
@ApiResponse(code = 404, message = "Sisendis esitatud andmetega objekti ei eksisteeri")})
@PatchMapping("{id}/status")
public RiskAssessmentPublicDto updateStatus(@PathVariable UUID id,
@RequestBody UpdateRiskAssessmentStatusDto dto,
......
......@@ -13,6 +13,7 @@ import org.springframework.stereotype.Service;
import java.util.List;
@Service
@Deprecated(since = "1.19.0-SNAPSHOT", forRemoval = true)
@RequiredArgsConstructor
public class RiskAssessmentProcessingService {
......
......@@ -5,8 +5,6 @@ import ee.sm.ti.teis.commongateway.riskassessments.riskfactor.request.RiskFactor
import ee.sm.ti.teis.gatewaycommon.controller.TeisBaseController;
import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -23,8 +21,6 @@ public class RiskFactorController extends TeisBaseController {
private final RiskFactorProcessingService service;
@ApiOperation(value = "${teis.api.risk-assessments.risk-factor.get-list}", response = RiskFactorPublicDto.class)
@ApiResponses(value = {
@ApiResponse(code = 403, message = "Kasutajal ei ole õigust andmeobjekti pärida")})
@GetMapping
public List<RiskFactorPublicDto> getRiskFactors(@RequestParam(required = false) Boolean includeInactive,
RequestMetaDTO requestMetaDTO) {
......
......@@ -11,6 +11,7 @@ import org.springframework.stereotype.Service;
import java.util.List;
@Service
@Deprecated(since = "1.19.0-SNAPSHOT", forRemoval = true)
@RequiredArgsConstructor
public class RiskFactorProcessingService {
......
......@@ -6,8 +6,6 @@ import ee.sm.ti.teis.gatewaycommon.controller.TeisBaseController;
import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
import ee.sm.ti.teis.types.enums.RiskFactorAssessmentsOutputType;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
......@@ -21,10 +19,6 @@ public class RiskFactorAssessmentController extends TeisBaseController {
private final RiskFactorAssessmentProcessingService service;
@ApiOperation(value = "${teis.api.risk-assessments.risk-factor-assessment.create}", response = RiskFactorAssessmentPublicDto.class)
@ApiResponses(value = {
@ApiResponse(code = 400, message = "Sisend ei vasta nõuetele"),
@ApiResponse(code = 403, message = "Kasutajal puudub nõutav privileeg või ei ole õigust muuta seda riskianalüüsi."),
@ApiResponse(code = 404, message = "Ohu hindamisega seotavat riskianalüüsi või ohu kirjelduse andmeobjekti ei leitud.")})
@PostMapping
public RiskFactorAssessmentPublicDto create(@RequestBody CreateRiskFactorAssessmentDto dto,
RequestMetaDTO requestMetaDTO) {
......@@ -36,10 +30,6 @@ public class RiskFactorAssessmentController extends TeisBaseController {
@ApiOperation(value = "${teis.api.risk-assessments.risk-factor-assessment.update-risk-exists}",
response = RiskFactorAssessmentPublicLightDto.class)
@ApiResponses(value = {
@ApiResponse(code = 400, message = "Sisendi parameetrid ei vasta nõuetele"),
@ApiResponse(code = 403, message = "Kasutajal ei ole õigust andmeobjekti pärida"),
@ApiResponse(code = 404, message = "Sisendis esitatud andmetega objekti ei eksisteeri")})
@PatchMapping("{id}/risk-exists")
public RiskFactorAssessmentPublicLightDto updateRiskExists(@PathVariable UUID id,
@RequestBody UpdateRiskFactorAssessmentRiskExistsPublicDto dto,
......@@ -52,9 +42,6 @@ public class RiskFactorAssessmentController extends TeisBaseController {
}
@ApiOperation(value = "${teis.api.risk-assessments.risk-factor-assessment.delete}")
@ApiResponses(value = {
@ApiResponse(code = 400, message = "Sisendi parameetrid ei vasta nõuetele"),
@ApiResponse(code = 403, message = "Kasutajal ei ole õigust andmeobjekti pärida")})
@DeleteMapping("{id}")
public void delete(@PathVariable UUID id, RequestMetaDTO requestMetaDTO) {
DeleteRiskFactorAssessmentPublicRequest request = new DeleteRiskFactorAssessmentPublicRequest();
......@@ -65,10 +52,6 @@ public class RiskFactorAssessmentController extends TeisBaseController {