Commit 800cf4b9 authored by Siiri Tann's avatar Siiri Tann
Browse files

Resolve TEIS-1751

parent ff2edbec
package ee.sm.ti.teis.officegateway.proceedings.proceeding.inspection.topic;
import ee.sm.ti.teis.commongateway.classifier.ClassifierItemLightDto;
import ee.sm.ti.teis.types.enums.ObjectStatus;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.UUID;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ProceedingInspectionTopicDto {
private UUID id;
private UUID proceedingId;
private UUID upperProceedingInspectionTopicId;
private String inspectionTopicId;
private Integer inspectionTopicLevel;
private String inspectionTopicName;
private String inspectionTopicDescription;
private Integer inspectionTopicSeqNo;
private ClassifierItemLightDto source;
private ObjectStatus objectStatus;
}
......@@ -11,6 +11,7 @@ import java.util.UUID;
@Data
@Builder
@Deprecated(since = "1.23.0", forRemoval = true)
@NoArgsConstructor
@AllArgsConstructor
public class ProceedingTopicDto {
......
......@@ -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() {
......@@ -25,4 +25,4 @@ public class UpdateProceedingTopicRequest extends AbstractDTO<UpdateProceedingTo
private UUID id;
private List<ClassifierItemLightDto> inspectionTopicCodes;
}
}
\ 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() {
......
......@@ -6,8 +6,8 @@ import ee.sm.ti.teis.officegateway.proceedings.proceeding.inspection.topic.Proce
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<ProceedingTopicDto>, ErrorDTO> {
public static final String ROUTING_KEY = "api.UpdateProceedingInspectionTopicResponse";
@Override
public String routingKey() {
......
......@@ -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() {
......@@ -29,4 +29,4 @@ class ProceedingTopicControllerTest extends OfficeApiGatewayTestBase {
void getTopics() {
assertThrows(NoResponseFromRabbitException.class, () -> controller.getTopics(randomUUID(), new RequestMetaDTO()));
}
}
\ No newline at end of file
}
......@@ -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,7 +18,7 @@ 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;
......@@ -27,23 +27,23 @@ public class ProceedingTopicController extends TeisBaseController {
@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);
@RequestBody List<ClassifierItemLightDto> inspectionTopicCodes,
RequestMetaDTO requestMetaDTO) {
UpdateProceedingInspectionTopicRequest request = new UpdateProceedingInspectionTopicRequest();
request.setPayload(new UpdateProceedingInspectionTopicRequest.Parameters(id, inspectionTopicCodes), requestMetaDTO);
return (List<ProceedingTopicDto>) 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);
}
}
theGroup=ee.sm.ti.teis
theVersion=1.22.0
theVersion=1.23.0-SNAPSHOT
commonsVersion=1.22.0
commonApiGatewayVersion=1.22.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