Commit 425beb1c authored by Kristel Meikas's avatar Kristel Meikas
Browse files

Merge branch 'develop' into 'master'

Release: merge 'develop' into 'master' created by Kristel Meikas

See merge request teis/common-api-gateway!199
parents 705744ec c3294cc5
......@@ -5,6 +5,7 @@ import ee.sm.ti.teis.commongateway.tasks.task.actionplan.request.*;
import ee.sm.ti.teis.commongateway.tasks.task.dto.TaskDto;
import ee.sm.ti.teis.commongateway.tasks.task.dto.TasksDto;
import ee.sm.ti.teis.gatewaycommon.controller.TeisBaseController;
import ee.sm.ti.teis.gatewaycommon.rabbit.RequestProcessingService;
import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
......@@ -17,7 +18,7 @@ import java.util.UUID;
@RequiredArgsConstructor
public class TaskActionPlanController extends TeisBaseController {
private final TaskActionPlanProcessingService service;
private final RequestProcessingService service;
@ApiOperation(value = "${teis.api.messages.task.action-plan.post}", response = TaskDto.class)
@PostMapping("action-plans")
......@@ -25,7 +26,7 @@ public class TaskActionPlanController extends TeisBaseController {
CreateTaskActionPlanRequest request = new CreateTaskActionPlanRequest();
request.setPayload(dto, requestMetaDTO);
return service.create(request);
return (TaskDto) service.sendAndReceive(request);
}
@ApiOperation(value = "${teis.api.messages.task.action-plan.delete}", response = TaskDto.class)
......@@ -34,7 +35,7 @@ public class TaskActionPlanController extends TeisBaseController {
DeleteTaskActionPlanRequest request = new DeleteTaskActionPlanRequest();
request.setPayload(id, requestMetaDTO);
service.delete(request);
service.sendAndReceive(request);
}
@ApiOperation(value = "${teis.api.messages.task.action-plan.put}", response = TaskDto.class)
......@@ -44,7 +45,7 @@ public class TaskActionPlanController extends TeisBaseController {
dto.setId(id);
request.setPayload(dto, requestMetaDTO);
return service.update(request);
return (TaskDto) service.sendAndReceive(request);
}
@ApiOperation(value = "${teis.api.messages.task.action-plan.get-task-action-plans}", response = TasksDto.class)
......@@ -53,7 +54,7 @@ public class TaskActionPlanController extends TeisBaseController {
GetTaskActionPlansRequest request = new GetTaskActionPlansRequest();
request.setPayload(dto, requestMetaDTO);
return service.getTaskActionPlans(request);
return (TasksDto) service.sendAndReceive(request);
}
@ApiOperation(value = "${teis.api.messages.task.action-plan.update-status}", response = TaskDto.class)
......@@ -63,25 +64,26 @@ public class TaskActionPlanController extends TeisBaseController {
dto.setId(id);
request.setPayload(dto, requestMetaDTO);
return service.updateStatus(request);
return (TaskDto) service.sendAndReceive(request);
}
@ApiOperation(value = "${teis.api.messages.task.action-plan.get-references}", response = TaskReferencesDto.class)
@GetMapping("action-plans/references")
public TaskReferencesDto getTaskReferences(RequestMetaDTO requestMetaDTO){
public TaskReferencesDto getTaskReferences(RequestMetaDTO requestMetaDTO) {
GetTaskReferencesRequest request = new GetTaskReferencesRequest();
request.setPayload(null, requestMetaDTO);
return service.getTaskReferences(request);
return (TaskReferencesDto) service.sendAndReceive(request);
}
@ApiOperation(value = "${teis.api.messages.task.action-plan.get-responsible-persons}", response = TaskResponsiblePersonsDto.class)
@GetMapping("action-plans/responsible-persons")
public TaskResponsiblePersonsDto getTaskResponsiblePersons(RequestMetaDTO requestMetaDTO){
public TaskResponsiblePersonsDto getTaskResponsiblePersons(RequestMetaDTO requestMetaDTO) {
GetTaskResponsiblePersonsRequest request = new GetTaskResponsiblePersonsRequest();
request.setPayload(null, requestMetaDTO);
return service.getTaskResponsiblePersons(request);
return (TaskResponsiblePersonsDto) service.sendAndReceive(request);
}
}
package ee.sm.ti.teis.commongateway.tasks.task.actionplan;
import ee.sm.ti.teis.commongateway.tasks.task.actionplan.dto.TaskReferencesDto;
import ee.sm.ti.teis.commongateway.tasks.task.actionplan.dto.TaskResponsiblePersonsDto;
import ee.sm.ti.teis.commongateway.tasks.task.actionplan.request.*;
import ee.sm.ti.teis.commongateway.tasks.task.actionplan.response.*;
import ee.sm.ti.teis.commongateway.tasks.task.dto.TaskDto;
import ee.sm.ti.teis.commongateway.tasks.task.dto.TasksDto;
import ee.sm.ti.teis.gatewaycommon.error.NoResponseFromRabbitException;
import lombok.RequiredArgsConstructor;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Service;
@Service
@Deprecated(since = "1.19.0", forRemoval = true)
@RequiredArgsConstructor
public class TaskActionPlanProcessingService {
private final RabbitTemplate gwRabbitTemplate;
public TaskDto create(CreateTaskActionPlanRequest request) {
CreateTaskActionPlanResponse response =
(CreateTaskActionPlanResponse) gwRabbitTemplate.convertSendAndReceive(request.routingKey(), request);
if (response != null) {
return response.processResponse();
}
throw new NoResponseFromRabbitException(request.getRequestMetaDTO().getRequestId());
}
public void delete(DeleteTaskActionPlanRequest request) {
DeleteTaskActionPlanResponse response =
(DeleteTaskActionPlanResponse) gwRabbitTemplate.convertSendAndReceive(request.routingKey(), request);
if (response != null) {
response.processResponse();
return;
}
throw new NoResponseFromRabbitException(request.getRequestMetaDTO().getRequestId());
}
public TaskDto update(UpdateTaskActionPlanRequest request) {
UpdateTaskActionPlanResponse response =
(UpdateTaskActionPlanResponse) gwRabbitTemplate.convertSendAndReceive(request.routingKey(), request);
if (response != null) {
return response.processResponse();
}
throw new NoResponseFromRabbitException(request.getRequestMetaDTO().getRequestId());
}
public TasksDto getTaskActionPlans(GetTaskActionPlansRequest request) {
GetTaskActionPlansResponse response =
(GetTaskActionPlansResponse) gwRabbitTemplate.convertSendAndReceive(request.routingKey(), request);
if (response != null) {
return response.processResponse();
}
throw new NoResponseFromRabbitException(request.getRequestMetaDTO().getRequestId());
}
public TaskDto updateStatus(UpdateTaskActionPlanStatusRequest request) {
UpdateTaskActionPlanStatusResponse response =
(UpdateTaskActionPlanStatusResponse) gwRabbitTemplate.convertSendAndReceive(request.routingKey(), request);
if (response != null) {
return response.processResponse();
}
throw new NoResponseFromRabbitException(request.getRequestMetaDTO().getRequestId());
}
public TaskReferencesDto getTaskReferences(GetTaskReferencesRequest request){
GetTaskReferencesResponse response =
(GetTaskReferencesResponse) gwRabbitTemplate.convertSendAndReceive(request.routingKey(), request);
if (response != null) {
return response.processResponse();
}
throw new NoResponseFromRabbitException(request.getRequestMetaDTO().getRequestId());
}
public TaskResponsiblePersonsDto getTaskResponsiblePersons(GetTaskResponsiblePersonsRequest request) {
GetTaskResponsiblePersonsResponse response =
(GetTaskResponsiblePersonsResponse) gwRabbitTemplate.convertSendAndReceive(request.routingKey(), request);
if (response != null) {
return response.processResponse();
}
throw new NoResponseFromRabbitException(request.getRequestMetaDTO().getRequestId());
}
}
package ee.sm.ti.teis.commongateway.tasks.task.assignee;
import ee.sm.ti.teis.commongateway.tasks.task.assignee.request.CreateTaskAssigneeRequest;
import ee.sm.ti.teis.commongateway.tasks.task.assignee.request.DeleteTaskAssigneeRequest;
import ee.sm.ti.teis.commongateway.tasks.task.assignee.response.CreateTaskAssigneeResponse;
import ee.sm.ti.teis.commongateway.tasks.task.assignee.response.DeleteTaskAssigneeResponse;
import ee.sm.ti.teis.gatewaycommon.error.NoResponseFromRabbitException;
import lombok.RequiredArgsConstructor;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Service;
@Service
@Deprecated(since = "1.19.0", forRemoval = true)
@RequiredArgsConstructor
public class TaskAssigneeProcessingService {
private final RabbitTemplate gwRabbitTemplate;
public void create(CreateTaskAssigneeRequest request) {
CreateTaskAssigneeResponse response =
(CreateTaskAssigneeResponse) gwRabbitTemplate.convertSendAndReceive(request.routingKey(), request);
if (response != null) {
response.processResponse();
return;
}
throw new NoResponseFromRabbitException(request.getRequestMetaDTO().getRequestId());
}
public void delete(DeleteTaskAssigneeRequest request) {
DeleteTaskAssigneeResponse response =
(DeleteTaskAssigneeResponse) gwRabbitTemplate.convertSendAndReceive(request.routingKey(), request);
if (response != null) {
response.processResponse();
return;
}
throw new NoResponseFromRabbitException(request.getRequestMetaDTO().getRequestId());
}
}
......@@ -3,6 +3,7 @@ package ee.sm.ti.teis.commongateway.tasks.task.assignee;
import ee.sm.ti.teis.commongateway.tasks.task.assignee.request.CreateTaskAssigneeRequest;
import ee.sm.ti.teis.commongateway.tasks.task.assignee.request.DeleteTaskAssigneeRequest;
import ee.sm.ti.teis.gatewaycommon.controller.TeisBaseController;
import ee.sm.ti.teis.gatewaycommon.rabbit.RequestProcessingService;
import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
......@@ -19,7 +20,7 @@ import org.springframework.web.bind.annotation.RestController;
@RequiredArgsConstructor
public class TaskAssigneeTestController extends TeisBaseController {
private final TaskAssigneeProcessingService service;
private final RequestProcessingService service;
@ApiOperation(value = "${teis.api.messages.task.assignees.create-task-assignee}")
@PostMapping
......@@ -27,7 +28,7 @@ public class TaskAssigneeTestController extends TeisBaseController {
CreateTaskAssigneeRequest request = new CreateTaskAssigneeRequest();
request.setPayload(dto, requestMetaDTO);
service.create(request);
service.sendAndReceive(request);
}
@ApiOperation(value = "${teis.api.messages.task.assignees.delete-task-assignee}")
......@@ -36,6 +37,6 @@ public class TaskAssigneeTestController extends TeisBaseController {
DeleteTaskAssigneeRequest request = new DeleteTaskAssigneeRequest();
request.setPayload(dto, requestMetaDTO);
service.delete(request);
service.sendAndReceive(request);
}
}
......@@ -26,10 +26,6 @@ teis.api.messages.delete-location: Teenus kustutab olemasoleva tegevuskoha
teis.api.messages.delete-location-id: Kustutava tegevuskoha id kood
teis.api.messages.get-representative: Väljastab TK esindaja identifikaatori alusel ettevõtte TK esindaja andmed
teis.api.messages.get-representatives: Väljastab sisestatud parameetrite alusel TK esindajate andmed
teis.api.messages.get-representative-id: objectStatus = CURRENT<br>e05b0516-fab9-4a8a-b847-b5e1013427cd<br>objectStatus = DELETED<br>e05b0516-fab9-4a8a-b847-b5e1013427de
teis.api.messages.get-representative-employerId: 96686dd3-8638-4a29-bdca-9708b25dfd63
teis.api.messages.get-representative-personId: 0bb3c0a5-f1bc-4c0d-8664-e94eec35c1c1
teis.api.messages.get-representative-validity: X = All, NOT_EXPIRED = Current and future.
teis.api.messages.patch-representative: Teenus märgib teatud rollis olevate töökeskkonna esindajad kehtetuks. Kasutatakse rollide haldamiseks.
teis.api.messages.post-representative: Teenus lisab uue TK esindaja andmed
teis.api.messages.post-representative-location: Teenus lisab TK esindaja andmete juurde viite tegevuskohale
......@@ -37,12 +33,9 @@ teis.api.messages.post-representative-location-id-ex: dadcb5aa-f462-4c70-8de4-93
teis.api.messages.post-representative-representative-id-ex: a18ba04b-893c-44e0-8a17-0f7471473992
teis.api.messages.delete-representative-location: Teenus kustutab esindaja tegevuskoha
teis.api.messages.check-representative: Teenus kontrollib, kas ettevõttel on olemas nõutaval arvul TK esindajaid.
teis.api.messages.check-representative-id: 6ccb12b1-44f7-4b76-a1ca-137702a3b80f
teis.api.messages.put-representative: Teenus muudab olemasoleva TK esindaja andmeid
teis.api.messages.delete-representative: Märgib TK esindaja kirje kustutatuks
teis.api.messages.get-last-contact: Teenus otsib, kas sisendis esitatud isik on olnud samas ettevõttes varasemalt TK esindaja ja kas on olemas varasemad kontaktandmed.
teis.api.messages.get-last-contact.employer-id: Ettevõtte, mille esindamise andmeid otsitakse.
teis.api.messages.get-last-contact.person-id: Isiku, kelle poolet esindajaks olemise andmeid otsitakse.
teis.api.messages.patch-contacts: Isiku, kelle poolet esindajaks olemise andmeid otsitakse.
teis.api.messages.auth-config: Tagastab autentimise jaoks vajalikud parameetrid
teis.api.messages.auth-token: Access tokeni pärimine ajutise ligipääsu koodi või refresh_tokeni alusel.
......@@ -93,6 +86,7 @@ teis.api.messages.proceeding.get-message-permissions: API abil on võimalik kont
teis.api.messages.task.post-task: Teenus salvestab uue ülesande.
teis.api.messages.task.get-tasks: Teenus väljastab ülesande andmeobjektid. Teenust kasutatakse ülesannete kuvamiseks.
teis.api.messages.task.get-tasks-count: Teenus väljastab ülesande andmeobjektide arvu. Teenust kasutatakse näiteks töölaual ülesannete kohta koondandmete kuvamiseks.
teis.api.messages.task.delete-task: Teenus kustutab ülesande andmed. Teenust kasutatakse siis, kui kustutatakse andmeobjekt, millega seoses ülesanne loodi.
teis.api.messages.task.assignees.create-task-assignee: Teenus lisab ülesandele või ülesannetele täitja.
teis.api.messages.task.assignees.delete-task-assignee: Teenus eemaldab ülesande (ülesannetelt) täitja (täitjad).
......
theGroup=ee.sm.ti.teis
theVersion=1.21.0
commonsVersion=1.21.0
theVersion=1.22.0
commonsVersion=1.22.0
pluginVersion=1.3.0
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