Commit 17e7ab53 authored by Siiri Tann's avatar Siiri Tann
Browse files

Merge branch 'TEIS-408' into 'develop'

Resolve TEIS-408

Closes TEIS-408

See merge request teis/office-api-gateway!183
parents 66546524 19bc161f
package ee.sm.ti.teis.officegateway.proceedings.proceduralact.request;
import ee.sm.ti.teis.AbstractDTO;
import ee.sm.ti.teis.ErrorDTO;
import ee.sm.ti.teis.commongateway.classifier.ClassifierItemLightDto;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.UUID;
public class UpdateProceduralActInspectionTopicOutcomeRequest extends AbstractDTO<UpdateProceduralActInspectionTopicOutcomeRequest.Parameters, ErrorDTO> {
public static final String ROUTING_KEY = "api.UpdateProceduralActInspectionTopicOutcomeRequest";
@Override
public String routingKey() {
return ROUTING_KEY;
}
@Data
@AllArgsConstructor
@NoArgsConstructor
public static class Parameters {
private UUID topicId;
private ClassifierItemLightDto inspectionTopicOutcome;
}
}
package ee.sm.ti.teis.officegateway.proceedings.proceduralact.response;
import ee.sm.ti.teis.AbstractDTO;
import ee.sm.ti.teis.ErrorDTO;
import ee.sm.ti.teis.officegateway.proceedings.proceduralact.dto.ProceduralActInspectionTopicDto;
public class UpdateProceduralActInspectionTopicOutcomeResponse extends AbstractDTO<ProceduralActInspectionTopicDto, ErrorDTO> {
public static final String ROUTING_KEY = "api.UpdateProceduralActInspectionTopicOutcomeResponse";
@Override
public String routingKey() {
return ROUTING_KEY;
}
}
package ee.sm.ti.teis.officegateway.proceedings.proceduralact;
import ee.sm.ti.teis.commongateway.classifier.ClassifierItemLightDto;
import ee.sm.ti.teis.gatewaycommon.error.NoResponseFromRabbitException;
import ee.sm.ti.teis.officegateway.OfficeApiGatewayTestBase;
import ee.sm.ti.teis.officegateway.proceedings.proceduralact.controller.ProceduralActController;
......@@ -12,8 +11,6 @@ import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;
import static java.util.UUID.randomUUID;
import static org.junit.jupiter.api.Assertions.assertThrows;
......@@ -50,19 +47,6 @@ class ProceduralActControllerTest extends OfficeApiGatewayTestBase {
assertThrows(NoResponseFromRabbitException.class, () -> controller.delete(randomUUID(), new RequestMetaDTO()));
}
@Test
void getProceduralActInspectionTopics_badRequest() {
assertThrows(NoResponseFromRabbitException.class, () -> controller.getProceduralActInspectionTopics(randomUUID(),
new RequestMetaDTO()));
}
@Test
void putProceduralActInspectionTopics_badRequest() {
List<ClassifierItemLightDto> inspectionTopicCodes = new ArrayList<>();
assertThrows(NoResponseFromRabbitException.class, () ->
controller.updateProceduralActInspectionTopics(randomUUID(), inspectionTopicCodes, new RequestMetaDTO()));
}
@Test
void createProceduralActConductingTime_badRequest() {
assertThrows(NoResponseFromRabbitException.class, () ->
......
package ee.sm.ti.teis.officegateway.proceedings.proceduralact.inspection.topic;
import ee.sm.ti.teis.commongateway.classifier.ClassifierItemLightDto;
import ee.sm.ti.teis.gatewaycommon.error.NoResponseFromRabbitException;
import ee.sm.ti.teis.officegateway.OfficeApiGatewayTestBase;
import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.ArrayList;
import java.util.List;
import static java.util.UUID.randomUUID;
import static org.junit.jupiter.api.Assertions.assertThrows;
class ProceduralActInspectionTopicControllerTest extends OfficeApiGatewayTestBase {
@Autowired
ProceduralActInspectionTopicController controller;
@Test
void getProceduralActInspectionTopics_badRequest() {
assertThrows(NoResponseFromRabbitException.class, () -> controller.getProceduralActInspectionTopics(randomUUID(),
new RequestMetaDTO()));
}
@Test
void putProceduralActInspectionTopics_badRequest() {
List<ClassifierItemLightDto> inspectionTopicCodes = new ArrayList<>();
assertThrows(NoResponseFromRabbitException.class, () ->
controller.updateProceduralActInspectionTopics(randomUUID(), inspectionTopicCodes, new RequestMetaDTO()));
}
@Test
void patchProceduralActInspectionTopics_badRequest() {
ClassifierItemLightDto inspectionOutcome = new ClassifierItemLightDto();
assertThrows(NoResponseFromRabbitException.class, () ->
controller.updateProceduralActInspectionTopicOutcome(randomUUID(), inspectionOutcome, new RequestMetaDTO()));
}
}
package ee.sm.ti.teis.officegateway.proceedings.proceduralact.controller;
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.proceduralact.dto.ProceduralActConductingTimeDto;
import ee.sm.ti.teis.officegateway.proceedings.proceduralact.dto.ProceduralActDto;
import ee.sm.ti.teis.officegateway.proceedings.proceduralact.dto.ProceduralActInspectionTopicDto;
import ee.sm.ti.teis.officegateway.proceedings.proceduralact.request.*;
import ee.sm.ti.teis.officegateway.proceedings.proceduralact.service.ProceduralActProcessingService;
import ee.sm.ti.teis.officegateway.proceedings.supervision.dto.StatusDto;
......@@ -27,7 +25,7 @@ public class ProceduralActController extends TeisBaseController {
private final ProceduralActProcessingService processingService;
private final RequestProcessingService service;
@ApiOperation(value = "${teis.api.messages.proceeding.get-procedural-acts}", response = ProceduralActDto.class)
@ApiOperation(value = "${teis.api.proceeding.get-procedural-acts}", response = ProceduralActDto.class)
@GetMapping
public List<ProceduralActDto> getProceduralActs(@RequestParam(value = "proceedingId") UUID id,
RequestMetaDTO requestMetaDTO) {
......@@ -37,7 +35,7 @@ public class ProceduralActController extends TeisBaseController {
return (List<ProceduralActDto>) service.sendAndReceive(request);
}
@ApiOperation(value = "${teis.api.messages.proceeding.get-procedural-act}", response = ProceduralActDto.class)
@ApiOperation(value = "${teis.api.proceeding.get-procedural-act}", response = ProceduralActDto.class)
@GetMapping("{id}")
public ProceduralActDto getProceduralAct(@PathVariable UUID id, RequestMetaDTO requestMetaDTO) {
ProceduralActRequest request = new ProceduralActRequest();
......@@ -46,7 +44,7 @@ public class ProceduralActController extends TeisBaseController {
return (ProceduralActDto) service.sendAndReceive(request);
}
@ApiOperation(value = "${teis.api.messages.proceeding.post-procedural-act}", response = ProceduralActDto.class)
@ApiOperation(value = "${teis.api.proceeding.post-procedural-act}", response = ProceduralActDto.class)
@PostMapping
public ProceduralActDto create(@RequestBody ProceduralActDto dto, RequestMetaDTO requestMetaDTO) {
CreateProceduralActRequest request = new CreateProceduralActRequest();
......@@ -55,7 +53,7 @@ public class ProceduralActController extends TeisBaseController {
return (ProceduralActDto) service.sendAndReceive(request);
}
@ApiOperation(value = "${teis.api.messages.proceeding.post-procedural-act}", response = ProceduralActDto.class)
@ApiOperation(value = "${teis.api.proceeding.post-procedural-act}", response = ProceduralActDto.class)
@PutMapping("{id}")
public ProceduralActDto update(@PathVariable UUID id, @RequestBody ProceduralActDto dto,
RequestMetaDTO requestMetaDTO) {
......@@ -66,7 +64,7 @@ public class ProceduralActController extends TeisBaseController {
return (ProceduralActDto) service.sendAndReceive(request);
}
@ApiOperation(value = "${teis.api.messages.proceeding.patch-procedural-act}", response = ProceduralActDto.class)
@ApiOperation(value = "${teis.api.proceeding.patch-procedural-act}", response = ProceduralActDto.class)
@PatchMapping("{id}/status")
public ProceduralActDto updateStatus(@PathVariable UUID id, @RequestBody StatusDto statusDto,
RequestMetaDTO requestMetaDTO) {
......@@ -77,7 +75,7 @@ public class ProceduralActController extends TeisBaseController {
return (ProceduralActDto) service.sendAndReceive(request);
}
@ApiOperation(value = "${teis.api.messages.proceeding.delete-procedural-act}", response = ProceduralActDto.class)
@ApiOperation(value = "${teis.api.proceeding.delete-procedural-act}", response = ProceduralActDto.class)
@DeleteMapping("{id}")
public ProceduralActDto delete(@PathVariable UUID id, RequestMetaDTO requestMetaDTO) {
DeleteProceduralActRequest request = new DeleteProceduralActRequest();
......@@ -86,28 +84,7 @@ public class ProceduralActController extends TeisBaseController {
return (ProceduralActDto) service.sendAndReceive(request);
}
@ApiOperation(value = "${teis.api.messages.proceeding.get-procedural-act-inspection-topics}", response = ProceduralActInspectionTopicDto.class)
@GetMapping(value = "{id}/inspection-topics")
public List<ProceduralActInspectionTopicDto> getProceduralActInspectionTopics(@PathVariable UUID id,
RequestMetaDTO requestMetaDTO) {
ProceduralActInspectionTopicsRequest request = new ProceduralActInspectionTopicsRequest();
request.setPayload(id, requestMetaDTO);
return (List<ProceduralActInspectionTopicDto>) service.sendAndReceive(request);
}
@ApiOperation(value = "${teis.api.messages.proceeding.put-procedural-act-inspection-topics}", response = ProceduralActInspectionTopicDto.class)
@PutMapping(value = "{id}/inspection-topics")
public List<ProceduralActInspectionTopicDto> updateProceduralActInspectionTopics(@PathVariable UUID id,
@RequestBody(required = false) List<ClassifierItemLightDto> inspectionTopicCodes,
RequestMetaDTO requestMetaDTO) {
UpdateProceduralActInspectionTopicsRequest request = new UpdateProceduralActInspectionTopicsRequest();
request.setPayload(new UpdateProceduralActInspectionTopicsRequest.Parameters(id, inspectionTopicCodes), requestMetaDTO);
return (List<ProceduralActInspectionTopicDto>) service.sendAndReceive(request);
}
@ApiOperation(value = "${teis.api.messages.proceeding.post-procedural-act-conducting-time}", response = ProceduralActDto.class)
@ApiOperation(value = "${teis.api.proceeding.post-procedural-act-conducting-time}", response = ProceduralActDto.class)
@PostMapping(value = "{id}/conducting-time")
public ProceduralActConductingTimeDto createProceduralActConductingTime(@PathVariable UUID id,
@RequestBody ProceduralActConductingTimeDto dto, RequestMetaDTO requestMetaDTO) {
......@@ -118,7 +95,7 @@ public class ProceduralActController extends TeisBaseController {
return (ProceduralActConductingTimeDto) service.sendAndReceive(request);
}
@ApiOperation(value = "${teis.api.messages.proceeding.get-procedural-act-minutes-preview}")
@ApiOperation(value = "${teis.api.proceeding.get-procedural-act-minutes-preview}")
@GetMapping(value = "{id}/procedural-act-minutes-preview")
public void preview(@PathVariable UUID id, RequestMetaDTO requestMetaDTO, HttpServletResponse response) {
ProceduralActPreviewRequest request = new ProceduralActPreviewRequest();
......@@ -127,7 +104,7 @@ public class ProceduralActController extends TeisBaseController {
processingService.preview(request, response);
}
@ApiOperation(value = "${teis.api.messages.proceeding.procedural-act-feedback}")
@ApiOperation(value = "${teis.api.proceeding.procedural-act-feedback}")
@GetMapping(value = "feedback-addressees")
public void getFeedbackCSV(@RequestParam(required = false) LocalDate endDatePeriodStart,
@RequestParam(required = false) LocalDate endDatePeriodEnd,
......
package ee.sm.ti.teis.officegateway.proceedings.proceduralact.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.proceduralact.dto.ProceduralActInspectionTopicDto;
import ee.sm.ti.teis.officegateway.proceedings.proceduralact.request.ProceduralActInspectionTopicsRequest;
import ee.sm.ti.teis.officegateway.proceedings.proceduralact.request.UpdateProceduralActInspectionTopicOutcomeRequest;
import ee.sm.ti.teis.officegateway.proceedings.proceduralact.request.UpdateProceduralActInspectionTopicsRequest;
import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.UUID;
@RestController
@RequiredArgsConstructor
public class ProceduralActInspectionTopicController extends TeisBaseController {
private final RequestProcessingService service;
@ApiOperation(value = "${teis.api.proceeding.get-procedural-act-inspection-topics}", response = ProceduralActInspectionTopicDto.class)
@GetMapping(value = "procedural-acts/{id}/inspection-topics")
public List<ProceduralActInspectionTopicDto> getProceduralActInspectionTopics(@PathVariable UUID id, RequestMetaDTO requestMetaDTO) {
ProceduralActInspectionTopicsRequest request = new ProceduralActInspectionTopicsRequest();
request.setPayload(id, requestMetaDTO);
return (List<ProceduralActInspectionTopicDto>) service.sendAndReceive(request);
}
@ApiOperation(value = "${teis.api.proceeding.put-procedural-act-inspection-topics}", response = ProceduralActInspectionTopicDto.class)
@PutMapping(value = "procedural-acts/{id}/inspection-outcome")
public List<ProceduralActInspectionTopicDto> updateProceduralActInspectionTopics(@PathVariable UUID id,
@RequestBody(required = false) List<ClassifierItemLightDto> inspectionTopicCodes,
RequestMetaDTO requestMetaDTO) {
UpdateProceduralActInspectionTopicsRequest request = new UpdateProceduralActInspectionTopicsRequest();
request.setPayload(new UpdateProceduralActInspectionTopicsRequest.Parameters(id, inspectionTopicCodes), requestMetaDTO);
return (List<ProceduralActInspectionTopicDto>) service.sendAndReceive(request);
}
@ApiOperation(value = "${teis.api.proceeding.patch-procedural-act-inspection-topic-outcome}", response = ProceduralActInspectionTopicDto.class)
@PatchMapping(value = "procedural-act-inspection-topics/{topicId}/inspection-outcome")
public ProceduralActInspectionTopicDto updateProceduralActInspectionTopicOutcome(@PathVariable UUID topicId,
@RequestBody ClassifierItemLightDto inspectionOutcome,
RequestMetaDTO requestMetaDTO) {
UpdateProceduralActInspectionTopicOutcomeRequest request = new UpdateProceduralActInspectionTopicOutcomeRequest();
request.setPayload(new UpdateProceduralActInspectionTopicOutcomeRequest.Parameters(topicId, inspectionOutcome), requestMetaDTO);
return (ProceduralActInspectionTopicDto) service.sendAndReceive(request);
}
}
......@@ -51,12 +51,18 @@ teis.api.messages.proceeding.get-proceeding.comment: API lisab või muudab dokum
teis.api.messages.proceeding.inspection-document.create-inspection-document-read: Teenuse abil on võimalik salvestada menetluse dokumendi lugemise fakti. Salvestatakse ainult ametniku menetluse dokumendi lugemise faktid.
teis.api.messages.proceeding.get-procedural-acts: API väljastab kontrollide nimistu. Mõeldud menetlusega seotud kontrollide nimistu kuvamiseks.
teis.api.messages.proceeding.get-procedural-act: API väljastab soovitud kontrolli andmed.
teis.api.messages.proceeding.post-procedural-act: API abil on võimalik luua uus kontrolli objekt ja sellega seotud objektid. Mõeldud kontrolli andmete loomiseks.
teis.api.messages.proceeding.patch-procedural-act: API-ga muudetakse kontrolli staatust.
teis.api.messages.proceeding.delete-procedural-act: APIga on võimalik kustutada kontrolli objekti ja sellega seotud objektide andmeid. Mõeldud kontrolli kustutamiseks.
teis.api.messages.proceeding.procedural-act-feedback: API väljastab csv faili, milles on sisendis esitatud perioodil lõppenud menetluste kontrollide tagasiside adresaatite nimi ja e-posti aadress ning kontrolli läbiviinud TI teenistujate nimed.
teis.api.proceeding.get-procedural-acts: API väljastab kontrollide nimistu. Mõeldud menetlusega seotud kontrollide nimistu kuvamiseks.
teis.api.proceeding.get-procedural-act: API väljastab soovitud kontrolli andmed.
teis.api.proceeding.post-procedural-act: API abil on võimalik luua uus kontrolli objekt ja sellega seotud objektid. Mõeldud kontrolli andmete loomiseks.
teis.api.proceeding.patch-procedural-act: API-ga muudetakse kontrolli staatust.
teis.api.proceeding.delete-procedural-act: APIga on võimalik kustutada kontrolli objekti ja sellega seotud objektide andmeid. Mõeldud kontrolli kustutamiseks.
teis.api.proceeding.procedural-act-feedback: API väljastab csv faili, milles on sisendis esitatud perioodil lõppenud menetluste kontrollide tagasiside adresaatite nimi ja e-posti aadress ning kontrolli läbiviinud TI teenistujate nimed.
teis.api.proceeding.get-procedural-act-inspection-topics: API-ga on võimalik otsida kontrollile lisatud kontrolli teemasid.
teis.api.proceeding.put-procedural-act-inspection-topics: API-ga on võimalik muuta kontrollil kontrolliteemasid.
teis.api.proceeding.patch-procedural-act-inspection-topic-outcome: API-ga on võimalik muuta kontrolliga seotud kontrolliteemat kontrollituks või mittekontrollituks või ebaoluliseks.
teis.api.proceeding.post-procedural-act-conducting-time: API-ga on võimalik salvestada kontrolli läbiviimise aja objekti andmed.
teis.api.proceeding.get-procedural-act-minutes-preview: Teenus väljastab kontrolli protokolli faili eelvaate. Mõeldud kontrolli protokolli eelvaate faili kuvamiseks.
teis.api.messages.proceeding.get-violations: API väljastab puuduste nimistu. Mõeldud puuduste nimekirja kuvamiseks.
teis.api.messages.proceeding.get-violation: API väljastab puuduste nimistu. Mõeldud puuduste nimekirja kuvamiseks.
......@@ -78,12 +84,8 @@ teis.api.messages.get-procedural-act-comments: APIga tagastab antud proceduralAc
teis.api.messages.get-procedural-act-comment: APIga tagastab antud proceduralActComment id-ga kommentaari.
teis.api.messages.proceeding.delete-procedural-act-comment: APIga on võimalik kustutada kontrolli märkuse/kommentaari objekti. Mõeldud kontrolli märkuse/kommentaari kustutamiseks.
teis.api.messages.proceeding.put-procedural-act-comment: APIga on võimalik muuta kontrolli käigus lisatud kommentaare/märkmeid. Mõeldud kontrolli käigus kontrollile lisatavate kommentaaride/märkmete muutmiseks.
teis.api.messages.proceeding.get-procedural-act-inspection-topics: API-ga on võimalik otsida kontrollile lisatud kontrolli teemasid.
teis.api.messages.proceeding.put-procedural-act-inspection-topics: API-ga on võimalik muuta kontrollil kontrolliteemasid.
teis.api.messages.proceeding.post-procedural-act-conducting-time: API-ga on võimalik salvestada kontrolli läbiviimise aja objekti andmed.
teis.api.messages.proceeding.post-procedural-act-violation: API abil on võimalik luua uus puuduse fikseerimise aja objekt. Mõeldud lahendatamata puuduse uuesti fikseerimiseks uue kontrolli raames.
teis.api.messages.proceeding.delete-procedural-act-violation: API abil on võimalik kustutada puuduse fikseerimise aja objekti andmeid. Mõeldud korduva puuduse fikseerimise kustutamiseks.
teis.api.messages.proceeding.get-procedural-act-minutes-preview: Teenus väljastab kontrolli protokolli faili eelvaate. Mõeldud kontrolli protokolli eelvaate faili kuvamiseks.
teis.api.messages.proceeding.post-violation-act: API loob puuduse toimingu andmeobjekti ja sellega seotud andmeobjektid (ettekirjutus, sunniraha hoiatus, sunniraha määramine, puuduse lahendamise tähtaeg).
teis.api.messages.proceeding.get-violation-acts: API väljastab puudustega seotud toimingute (ettekirjutus, sunniraha hoiatus, sunniraha määramine) nimistu.
......
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