Commit 8de11484 authored by Siiri Tann's avatar Siiri Tann
Browse files

Merge branch 'develop' into 'master'

Release: merge 'develop' into 'master' created by Siiri Tann

See merge request teis/office-api-gateway!177
parents 5b0e4fa6 bdf93f61
# Changelog
## [1.23.0] - 2021-04-12
* TEIS-2111: added new field to procedural act minutes for template output
* TEIS-2078: updated API endpoint to return confirmation of the viewing reason being logged for risk assessment
* TEIS-2086: relocated GeneratedDocumentDto to common-api-gateway
* TEIS-1765: updated put proceedings inspection topics
* TEIS-1751: updated get proceedings inspection topics
## [1.22.0] - 2021-03-22
* TEIS-2073: fixed office api gateway MockMvc dependencies
......
package ee.sm.ti.teis.officegateway.docgen.dto;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class GeneratedDocumentDto {
private String templateId;
private String docName;
private String contentType;
private byte[] content;
}
......@@ -2,7 +2,7 @@ package ee.sm.ti.teis.officegateway.docgen.response;
import ee.sm.ti.teis.AbstractDTO;
import ee.sm.ti.teis.ErrorDTO;
import ee.sm.ti.teis.officegateway.docgen.dto.GeneratedDocumentDto;
import ee.sm.ti.teis.commongateway.docgen.dto.GeneratedDocumentDto;
public class PreviewDocumentResponse extends AbstractDTO<GeneratedDocumentDto, ErrorDTO> {
......
package ee.sm.ti.teis.officegateway.proceedings.proceduralact.dto;
import ee.sm.ti.teis.officegateway.proceedings.violation.dto.ViolationDto;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.*;
import javax.validation.constraints.NotNull;
import java.time.LocalDate;
......@@ -27,6 +23,8 @@ public class ProceduralActMinutes {
@NotNull
private LocalDate proceduralActGenerationDate;
@NotNull
private LocalDate proceduralActValidUntil;
@NotNull
private String proceduralActNumber;
@NotNull
private String proceduralActConductingTime;
......
......@@ -13,10 +13,16 @@ import java.util.UUID;
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ProceedingTopicDto {
public class ProceedingInspectionTopicDto {
private UUID id;
private UUID proceedingId;
private ClassifierItemLightDto inspectionTopic;
private UUID upperProceedingInspectionTopicId;
private String inspectionTopicId;
private Integer inspectionTopicLevel;
private String inspectionTopicName;
private String inspectionTopicDescription;
private Integer inspectionTopicSeqNo;
private ClassifierItemLightDto source;
private ObjectStatus objectStatus;
}
......@@ -5,11 +5,11 @@ import ee.sm.ti.teis.ErrorDTO;
import java.util.UUID;
public class ProceedingTopicRequest extends AbstractDTO<UUID, ErrorDTO> {
public static final String ROUTING_KEY = "api.ProceedingTopicRequest";
public class GetProceedingInspectionTopicRequest extends AbstractDTO<UUID, ErrorDTO> {
public static final String ROUTING_KEY = "api.GetProceedingInspectionTopicRequest";
@Override
public String routingKey() {
return ROUTING_KEY;
}
}
\ No newline at end of file
}
......@@ -10,8 +10,8 @@ import lombok.NoArgsConstructor;
import java.util.List;
import java.util.UUID;
public class UpdateProceedingTopicRequest extends AbstractDTO<UpdateProceedingTopicRequest.Parameters, ErrorDTO> {
public static final String ROUTING_KEY = "api.UpdateProceedingTopicRequest";
public class UpdateProceedingInspectionTopicRequest extends AbstractDTO<UpdateProceedingInspectionTopicRequest.Parameters, ErrorDTO> {
public static final String ROUTING_KEY = "api.UpdateProceedingInspectionTopicRequest";
@Override
public String routingKey() {
......@@ -23,6 +23,6 @@ public class UpdateProceedingTopicRequest extends AbstractDTO<UpdateProceedingTo
@NoArgsConstructor
public static class Parameters {
private UUID id;
private List<ClassifierItemLightDto> inspectionTopicCodes;
private List<ClassifierItemLightDto> inspectionTopics;
}
}
\ No newline at end of file
}
......@@ -2,12 +2,12 @@ package ee.sm.ti.teis.officegateway.proceedings.proceeding.inspection.topic.resp
import ee.sm.ti.teis.AbstractDTO;
import ee.sm.ti.teis.ErrorDTO;
import ee.sm.ti.teis.officegateway.proceedings.proceeding.inspection.topic.ProceedingTopicDto;
import ee.sm.ti.teis.officegateway.proceedings.proceeding.inspection.topic.ProceedingInspectionTopicDto;
import java.util.List;
public class ProceedingTopicResponse extends AbstractDTO<List<ProceedingTopicDto>, ErrorDTO> {
public static final String ROUTING_KEY = "api.ProceedingTopicResponse";
public class GetProceedingInspectionTopicResponse extends AbstractDTO<List<ProceedingInspectionTopicDto>, ErrorDTO> {
public static final String ROUTING_KEY = "api.GetProceedingInspectionTopicResponse";
@Override
public String routingKey() {
......
......@@ -2,12 +2,12 @@ package ee.sm.ti.teis.officegateway.proceedings.proceeding.inspection.topic.resp
import ee.sm.ti.teis.AbstractDTO;
import ee.sm.ti.teis.ErrorDTO;
import ee.sm.ti.teis.officegateway.proceedings.proceeding.inspection.topic.ProceedingTopicDto;
import ee.sm.ti.teis.officegateway.proceedings.proceeding.inspection.topic.ProceedingInspectionTopicDto;
import java.util.List;
public class UpdateProceedingTopicResponse extends AbstractDTO<List<ProceedingTopicDto>, ErrorDTO> {
public static final String ROUTING_KEY = "api.UpdateProceedingTopicResponse";
public class UpdateProceedingInspectionTopicResponse extends AbstractDTO<List<ProceedingInspectionTopicDto>, ErrorDTO> {
public static final String ROUTING_KEY = "api.UpdateProceedingInspectionTopicResponse";
@Override
public String routingKey() {
......
......@@ -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";
......
......@@ -13,10 +13,10 @@ import java.util.List;
import static java.util.UUID.randomUUID;
import static org.junit.jupiter.api.Assertions.assertThrows;
class ProceedingTopicControllerTest extends OfficeApiGatewayTestBase {
class ProceedingInspectionTopicControllerTest extends OfficeApiGatewayTestBase {
@Autowired
ProceedingTopicController controller;
ProceedingInspectionTopicController controller;
@Test
void updateTopics() {
......@@ -26,7 +26,7 @@ class ProceedingTopicControllerTest extends OfficeApiGatewayTestBase {
}
@Test
void getTopics() {
void getTopics_success() {
assertThrows(NoResponseFromRabbitException.class, () -> controller.getTopics(randomUUID(), new RequestMetaDTO()));
}
}
\ No newline at end of file
}
package ee.sm.ti.teis.officegateway.docgen;
import ee.sm.ti.teis.commongateway.docgen.dto.GeneratedDocumentDto;
import ee.sm.ti.teis.exceptions.TeisResourceNotFoundException;
import ee.sm.ti.teis.gatewaycommon.error.NoResponseFromRabbitException;
import ee.sm.ti.teis.officegateway.docgen.dto.GeneratedDocumentDto;
import ee.sm.ti.teis.officegateway.docgen.request.PreviewDocumentRequest;
import ee.sm.ti.teis.officegateway.docgen.response.PreviewDocumentResponse;
import lombok.RequiredArgsConstructor;
......
package ee.sm.ti.teis.officegateway.proceedings.proceduralact.service;
import ee.sm.ti.teis.commongateway.docgen.dto.GeneratedDocumentDto;
import ee.sm.ti.teis.exceptions.TeisResourceNotFoundException;
import ee.sm.ti.teis.gatewaycommon.error.NoResponseFromRabbitException;
import ee.sm.ti.teis.officegateway.docgen.dto.GeneratedDocumentDto;
import ee.sm.ti.teis.officegateway.docgen.response.PreviewDocumentResponse;
import ee.sm.ti.teis.officegateway.proceedings.proceduralact.dto.ProceduralActConductingTimeDto;
import ee.sm.ti.teis.officegateway.proceedings.proceduralact.dto.ProceduralActDto;
......
......@@ -149,8 +149,8 @@ public class ProceedingController extends TeisBaseController {
@ApiOperation(value = "${teis.api.docgen.preview}")
@GetMapping("{proceedingId}/notice-preview")
public void preview(@PathVariable String proceedingId,
RequestMetaDTO requestMetaDTO,
// TODO: refactor to use UUID instead of String
public void preview(@PathVariable String proceedingId, RequestMetaDTO requestMetaDTO,
HttpServletResponse response) {
ProceedingNoticePreviewRequest request = new ProceedingNoticePreviewRequest();
request.setPayload(new ProceedingNoticePreviewRequest.Parameters(UUID.fromString(proceedingId)), requestMetaDTO);
......
package ee.sm.ti.teis.officegateway.proceedings.proceeding;
import ee.sm.ti.teis.commongateway.docgen.dto.GeneratedDocumentDto;
import ee.sm.ti.teis.exceptions.TeisResourceNotFoundException;
import ee.sm.ti.teis.gatewaycommon.error.NoResponseFromRabbitException;
import ee.sm.ti.teis.officegateway.docgen.dto.GeneratedDocumentDto;
import ee.sm.ti.teis.officegateway.docgen.response.PreviewDocumentResponse;
import ee.sm.ti.teis.officegateway.proceedings.proceeding.request.ProceedingNoticePreviewRequest;
import lombok.RequiredArgsConstructor;
......
......@@ -3,8 +3,8 @@ package ee.sm.ti.teis.officegateway.proceedings.proceeding.inspection.topic;
import ee.sm.ti.teis.commongateway.classifier.ClassifierItemLightDto;
import ee.sm.ti.teis.gatewaycommon.controller.TeisBaseController;
import ee.sm.ti.teis.gatewaycommon.rabbit.RequestProcessingService;
import ee.sm.ti.teis.officegateway.proceedings.proceeding.inspection.topic.request.ProceedingTopicRequest;
import ee.sm.ti.teis.officegateway.proceedings.proceeding.inspection.topic.request.UpdateProceedingTopicRequest;
import ee.sm.ti.teis.officegateway.proceedings.proceeding.inspection.topic.request.GetProceedingInspectionTopicRequest;
import ee.sm.ti.teis.officegateway.proceedings.proceeding.inspection.topic.request.UpdateProceedingInspectionTopicRequest;
import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
......@@ -18,32 +18,32 @@ import java.util.UUID;
@RestController
@RequestMapping("proceedings/{id}/inspection-topics")
@RequiredArgsConstructor
public class ProceedingTopicController extends TeisBaseController {
public class ProceedingInspectionTopicController extends TeisBaseController {
private final RequestProcessingService service;
@ApiOperation(value = "${teis.api.messages.proceeding.put-proceeding-inspection-topics}",
response = ProceedingTopicDto.class)
response = ProceedingInspectionTopicDto.class)
@ApiImplicitParams(@ApiImplicitParam(name = "id", value = "${teis.api.messages.proceeding.id}"))
@PutMapping
public List<ProceedingTopicDto> updateTopics(@PathVariable UUID id,
@RequestBody List<ClassifierItemLightDto> inspectionTopicCodes,
RequestMetaDTO requestMetaDTO) {
UpdateProceedingTopicRequest request = new UpdateProceedingTopicRequest();
request.setPayload(new UpdateProceedingTopicRequest.Parameters(id, inspectionTopicCodes), requestMetaDTO);
public List<ProceedingInspectionTopicDto> updateTopics(@PathVariable UUID id,
@RequestBody(required = false) List<ClassifierItemLightDto> inspectionTopicCodes,
RequestMetaDTO requestMetaDTO) {
UpdateProceedingInspectionTopicRequest request = new UpdateProceedingInspectionTopicRequest();
request.setPayload(new UpdateProceedingInspectionTopicRequest.Parameters(id, inspectionTopicCodes), requestMetaDTO);
return (List<ProceedingTopicDto>) service.sendAndReceive(request);
return (List<ProceedingInspectionTopicDto>) service.sendAndReceive(request);
}
@ApiOperation(value = "${teis.api.messages.proceeding.get-proceeding-inspection-topics}",
response = ProceedingTopicDto.class)
response = ProceedingInspectionTopicDto.class)
@ApiImplicitParams(@ApiImplicitParam(name = "id", value = "${teis.api.messages.proceeding.id}"))
@GetMapping
public List<ProceedingTopicDto> getTopics(@PathVariable UUID id, RequestMetaDTO requestMetaDTO) {
ProceedingTopicRequest request = new ProceedingTopicRequest();
public List<ProceedingInspectionTopicDto> getTopics(@PathVariable UUID id, RequestMetaDTO requestMetaDTO) {
GetProceedingInspectionTopicRequest request = new GetProceedingInspectionTopicRequest();
request.setPayload(id, requestMetaDTO);
return (List<ProceedingTopicDto>) service.sendAndReceive(request);
return (List<ProceedingInspectionTopicDto>) service.sendAndReceive(request);
}
}
package ee.sm.ti.teis.officegateway.proceedings.violationact;
import ee.sm.ti.teis.commongateway.docgen.dto.GeneratedDocumentDto;
import ee.sm.ti.teis.exceptions.TeisResourceNotFoundException;
import ee.sm.ti.teis.gatewaycommon.error.NoResponseFromRabbitException;
import ee.sm.ti.teis.officegateway.docgen.dto.GeneratedDocumentDto;
import ee.sm.ti.teis.officegateway.docgen.response.PreviewDocumentResponse;
import ee.sm.ti.teis.officegateway.proceedings.violationact.request.PreviewViolationActDocumentRequest;
import lombok.RequiredArgsConstructor;
......
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)
......
theGroup=ee.sm.ti.teis
theVersion=1.22.0
commonsVersion=1.22.0
commonApiGatewayVersion=1.22.0
theVersion=1.23.0
commonsVersion=1.23.0
commonApiGatewayVersion=1.23.0
pluginVersion=1.3.0
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