Commit ad9c88cd authored by Hando Lukats's avatar Hando Lukats
Browse files

TEIS-1324 added controller to patch risk statement assessment description

parent 3b8e4df9
package ee.sm.ti.teis.commongateway.riskassessments.riskstatementassessment.dto;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.UUID;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class PatchRiskStatementAssessmentDescriptionPublicDto {
@NotNull
private UUID riskStatementAssessmentId;
@NotNull
@Size(min = 3)
private String description;
}
......@@ -2,9 +2,9 @@ package ee.sm.ti.teis.commongateway.riskassessments.riskstatementassessment.requ
import ee.sm.ti.teis.AbstractDTO;
import ee.sm.ti.teis.ErrorDTO;
import ee.sm.ti.teis.commongateway.riskassessments.riskstatementassessment.dto.RiskStatementAssessmentPublicDto;
import ee.sm.ti.teis.commongateway.riskassessments.riskstatementassessment.dto.PatchRiskStatementAssessmentDescriptionPublicDto;
public class PatchRiskStatementAssessmentDescriptionPublicRequest extends AbstractDTO<RiskStatementAssessmentPublicDto, ErrorDTO> {
public class PatchRiskStatementAssessmentDescriptionPublicRequest extends AbstractDTO<PatchRiskStatementAssessmentDescriptionPublicDto, ErrorDTO> {
public static final String ROUTING_KEY = "api.PatchRiskStatementAssessmentDescriptionPublicRequest";
@Override
......
package ee.sm.ti.teis.commongateway.riskassessments.riskstatementassessment;
import ee.sm.ti.teis.commongateway.riskassessments.riskstatementassessment.dto.CreateRiskStatementAssessmentPublicDto;
import ee.sm.ti.teis.commongateway.riskassessments.riskstatementassessment.dto.PatchRiskStatementAssessmentDescriptionPublicDto;
import ee.sm.ti.teis.commongateway.riskassessments.riskstatementassessment.dto.RiskStatementAssessmentPublicDto;
import ee.sm.ti.teis.commongateway.riskassessments.riskstatementassessment.request.CreateRiskStatementAssessmentPublicRequest;
import ee.sm.ti.teis.commongateway.riskassessments.riskstatementassessment.request.DeleteRiskStatementAssessmentPublicRequest;
......@@ -78,10 +79,10 @@ public class RiskStatementAssessmentController extends TeisBaseController {
@ApiResponse(code = 404, message = "Sisendis esitatud andmetega objekti ei eksisteeri")})
@PatchMapping("{id}/description")
public RiskStatementAssessmentPublicDto updateDescription(@PathVariable UUID id,
@RequestBody RiskStatementAssessmentPublicDto dto,
@RequestBody PatchRiskStatementAssessmentDescriptionPublicDto dto,
@ApiIgnore RequestMetaDTO requestMetaDTO) {
PatchRiskStatementAssessmentDescriptionPublicRequest request = new PatchRiskStatementAssessmentDescriptionPublicRequest();
dto.setId(id);
dto.setRiskStatementAssessmentId(id);
request.setPayload(dto, requestMetaDTO);
return service.updateDescription(request);
......
Supports Markdown
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