Commit 0e1502de authored by Kristel Meikas's avatar Kristel Meikas
Browse files

TEIS-2078: updated API endpoint to return confirmation of the viewing reason...

TEIS-2078: updated API endpoint to return confirmation of the viewing reason being logged for risk assessment
parent 7e22cb50
......@@ -2,8 +2,9 @@ package ee.sm.ti.teis.officegateway.riskassessments.riskassessment.response;
import ee.sm.ti.teis.AbstractDTO;
import ee.sm.ti.teis.ErrorDTO;
import ee.sm.ti.teis.commongateway.auditlog.dto.AuditLogItemExistsResponseDto;
public class RiskAssessmentViewingReasonResponse extends AbstractDTO<Void, ErrorDTO> {
public class RiskAssessmentViewingReasonResponse extends AbstractDTO<AuditLogItemExistsResponseDto, ErrorDTO> {
public static final String ROUTING_KEY = "api.RiskAssessmentViewingReasonResponse";
......
package ee.sm.ti.teis.officegateway.riskassessments.riskassessment;
import ee.sm.ti.teis.commongateway.auditlog.dto.AuditLogItemExistsResponseDto;
import ee.sm.ti.teis.commongateway.riskassessments.riskassessment.dto.RiskAssessmentPublicDto;
import ee.sm.ti.teis.commongateway.riskassessments.riskassessment.dto.UpdateRiskAssessmentTitleDto;
import ee.sm.ti.teis.gatewaycommon.controller.TeisBaseController;
......@@ -36,12 +37,13 @@ public class RiskAssessmentController extends TeisBaseController {
@ApiOperation(value = "${teis.api.risk-assessments.risk-assessment.viewing-reason}")
@PostMapping("{id}/viewing-reason")
public void viewingReason(@PathVariable UUID id, @RequestBody RiskAssessmentViewingReasonDto dto, RequestMetaDTO requestMetaDTO) {
public AuditLogItemExistsResponseDto viewingReason(@PathVariable UUID id,
@RequestBody RiskAssessmentViewingReasonDto dto, RequestMetaDTO requestMetaDTO) {
RiskAssessmentViewingReasonRequest request = new RiskAssessmentViewingReasonRequest();
dto.setId(id);
request.setPayload(dto, requestMetaDTO);
service.sendAndReceive(request);
return (AuditLogItemExistsResponseDto) service.sendAndReceive(request);
}
@ApiOperation(value = "${teis.api.risk-assessments.risk-assessment.create}", response = RiskAssessmentPublicDto.class)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment