Commit cbb0aea6 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/officials-service!66
parents 14ae950f fd45dda7
# Changelog
## [1.15.0] - 2022-05-20
* TEIS-3057: new endpoint for creating official in sequence
## [1.14.0] - 2022-03-28
* TEIS-2791: implemented functionality for updating classifier item cache in batches
......
theGroup=ee.sm.ti.teis
theVersion=1.14.0
commonsVersion=1.33.0
officeApiGatewayVersion=1.33.0
theVersion=1.15.0
commonsVersion=1.36.0
officeApiGatewayVersion=1.37.0
pluginVersion=1.5.0
......@@ -2,14 +2,14 @@ package ee.sm.ti.teis.officials.emtak;
import ee.sm.ti.teis.OfficialsAppTestBase;
import ee.sm.ti.teis.errors.CommonErrorCode;
import ee.sm.ti.teis.officegateway.official.dto.OfficialsGroupEmtakCodesData;
import ee.sm.ti.teis.officegateway.official.dto.OfficialsGroupEmtakDto;
import ee.sm.ti.teis.officegateway.official.request.CreateOfficialsGroupEmtakCodesRequest;
import ee.sm.ti.teis.officegateway.official.request.DeleteOfficialsGroupEmtakRequest;
import ee.sm.ti.teis.officegateway.official.request.OfficialsGroupEmtakCodesRequest;
import ee.sm.ti.teis.officegateway.official.response.CreateOfficialsGroupEmtakCodesResponse;
import ee.sm.ti.teis.officegateway.official.response.DeleteOfficialsGroupEmtakResponse;
import ee.sm.ti.teis.officegateway.official.response.OfficialsGroupEmtakCodesResponse;
import ee.sm.ti.teis.officegateway.officials.officialsgroup.dto.OfficialsGroupEmtakCodesData;
import ee.sm.ti.teis.officegateway.officials.officialsgroup.dto.OfficialsGroupEmtakDto;
import ee.sm.ti.teis.officegateway.officials.officialsgroup.request.CreateOfficialsGroupEmtakCodesRequest;
import ee.sm.ti.teis.officegateway.officials.officialsgroup.request.DeleteOfficialsGroupEmtakRequest;
import ee.sm.ti.teis.officegateway.officials.officialsgroup.request.OfficialsGroupEmtakCodesRequest;
import ee.sm.ti.teis.officegateway.officials.officialsgroup.response.CreateOfficialsGroupEmtakCodesResponse;
import ee.sm.ti.teis.officegateway.officials.officialsgroup.response.DeleteOfficialsGroupEmtakResponse;
import ee.sm.ti.teis.officegateway.officials.officialsgroup.response.OfficialsGroupEmtakCodesResponse;
import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
import ee.sm.ti.teis.servicerequest.UserType;
import ee.sm.ti.teis.types.enums.RolePrivilegeCode;
......
package ee.sm.ti.teis.officials.group.listener;
import ee.sm.ti.teis.OfficialsAppTestBase;
import ee.sm.ti.teis.officegateway.official.dto.OfficialUserDto;
import ee.sm.ti.teis.officegateway.official.dto.OfficialsGroupDto;
import ee.sm.ti.teis.officegateway.official.request.*;
import ee.sm.ti.teis.officegateway.official.response.*;
import ee.sm.ti.teis.officegateway.officials.officialsgroup.dto.OfficialsGroupDto;
import ee.sm.ti.teis.officegateway.officials.officialsgroup.request.*;
import ee.sm.ti.teis.officegateway.officials.officialsgroup.response.*;
import ee.sm.ti.teis.officegateway.officials.officialuser.dto.OfficialUserDto;
import ee.sm.ti.teis.officials.group.OfficialsGroupEntity;
import ee.sm.ti.teis.officials.group.OfficialsGroupRepository;
import ee.sm.ti.teis.officials.official.OfficialUserEntity;
......
package ee.sm.ti.teis.officials.group.listener;
import ee.sm.ti.teis.OfficialsAppTestBase;
import ee.sm.ti.teis.officegateway.official.dto.OfficialsGroupDto;
import ee.sm.ti.teis.officegateway.official.request.*;
import ee.sm.ti.teis.officegateway.official.response.*;
import ee.sm.ti.teis.officegateway.officials.officialsgroup.dto.OfficialsGroupDto;
import ee.sm.ti.teis.officegateway.officials.officialsgroup.request.*;
import ee.sm.ti.teis.officegateway.officials.officialsgroup.response.*;
import ee.sm.ti.teis.officials.group.OfficialsGroupEntity;
import ee.sm.ti.teis.officials.group.service.OfficialsGroupBusinessService;
import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
......
package ee.sm.ti.teis.officials.office.listener;
import ee.sm.ti.teis.OfficialsAppTestBase;
import ee.sm.ti.teis.officegateway.official.request.OfficesRequest;
import ee.sm.ti.teis.officegateway.official.response.OfficesResponse;
import ee.sm.ti.teis.officegateway.officials.offices.OfficesRequest;
import ee.sm.ti.teis.officegateway.officials.offices.OfficesResponse;
import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
import ee.sm.ti.teis.servicerequest.UserType;
import org.assertj.core.api.Assertions;
......
......@@ -2,10 +2,10 @@ package ee.sm.ti.teis.officials.office.listener;
import ee.sm.ti.teis.OfficialsAppTestBase;
import ee.sm.ti.teis.domain.officials.Office;
import ee.sm.ti.teis.officials.config.QueueConfig.OfficeDomainRequest;
import ee.sm.ti.teis.officials.config.QueueConfig.OfficeMsResponse;
import ee.sm.ti.teis.officials.config.QueueConfig.OfficesDomainRequest;
import ee.sm.ti.teis.officials.config.QueueConfig.OfficesMsResponse;
import ee.sm.ti.teis.officials.config.OfficeQueueConfig.OfficeDomainRequest;
import ee.sm.ti.teis.officials.config.OfficeQueueConfig.OfficeMsResponse;
import ee.sm.ti.teis.officials.config.OfficeQueueConfig.OfficesDomainRequest;
import ee.sm.ti.teis.officials.config.OfficeQueueConfig.OfficesMsResponse;
import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;
......
......@@ -3,10 +3,10 @@ package ee.sm.ti.teis.officials.official.listener;
import ee.sm.ti.teis.OfficialsAppTestBase;
import ee.sm.ti.teis.domain.officials.OfficialUser;
import ee.sm.ti.teis.errors.CommonErrorCode;
import ee.sm.ti.teis.officegateway.official.dto.OfficialUserDto;
import ee.sm.ti.teis.officegateway.official.dto.OfficialsGroupDto;
import ee.sm.ti.teis.officegateway.official.request.*;
import ee.sm.ti.teis.officegateway.official.response.*;
import ee.sm.ti.teis.officegateway.officials.officialsgroup.dto.OfficialsGroupDto;
import ee.sm.ti.teis.officegateway.officials.officialuser.dto.OfficialUserDto;
import ee.sm.ti.teis.officegateway.officials.officialuser.request.*;
import ee.sm.ti.teis.officegateway.officials.officialuser.response.*;
import ee.sm.ti.teis.officials.group.service.OfficialsGroupManagerService;
import ee.sm.ti.teis.officials.official.OfficialUserEntity;
import ee.sm.ti.teis.officials.official.service.OfficialBusinessService;
......
package ee.sm.ti.teis.officials.official.listener;
import ee.sm.ti.teis.OfficialsAppTestBase;
import ee.sm.ti.teis.officegateway.official.dto.OfficialUserDto;
import ee.sm.ti.teis.officegateway.official.dto.OfficialsGroupDto;
import ee.sm.ti.teis.officegateway.official.request.*;
import ee.sm.ti.teis.officegateway.official.response.*;
import ee.sm.ti.teis.officegateway.officials.officialsgroup.dto.OfficialsGroupDto;
import ee.sm.ti.teis.officegateway.officials.officialuser.dto.OfficialUserDto;
import ee.sm.ti.teis.officegateway.officials.officialuser.request.*;
import ee.sm.ti.teis.officegateway.officials.officialuser.response.*;
import ee.sm.ti.teis.officials.group.OfficialsGroupRepository;
import ee.sm.ti.teis.officials.official.OfficialUserEntity;
import ee.sm.ti.teis.officials.official.OfficialUserRepository;
......
......@@ -16,7 +16,7 @@ import javax.transaction.Transactional;
import java.util.Random;
import java.util.UUID;
import static ee.sm.ti.teis.officials.config.QueueConfig.*;
import static ee.sm.ti.teis.officials.config.OfficialUserQueueConfig.*;
import static ee.sm.ti.teis.types.enums.ObjectStatus.DELETED;
import static org.assertj.core.api.Assertions.assertThat;
......
package ee.sm.ti.teis.officials.officialinsequence;
import ee.sm.ti.teis.OfficialsAppTestBase;
import ee.sm.ti.teis.officegateway.officials.officialinsequence.dto.CreateOfficialInSequenceDto;
import ee.sm.ti.teis.officegateway.officials.officialinsequence.dto.OfficialInSequenceDto;
import ee.sm.ti.teis.officegateway.officials.officialinsequence.request.CreateOfficialInSequenceRequest;
import ee.sm.ti.teis.officegateway.officials.officialinsequence.response.CreateOfficialInSequenceResponse;
import ee.sm.ti.teis.officials.officialinsequence.listener.OfficialInSequenceGwListener;
import ee.sm.ti.teis.servicecommon.test.ListenerCreateRequestTestBase;
import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.UUID;
import static ee.sm.ti.teis.servicerequest.UserType.PERSON;
import static ee.sm.ti.teis.types.enums.ObjectStatus.CURRENT;
import static ee.sm.ti.teis.types.enums.RolePrivilegeCode.TI_MANAGE_OFFICIALS_SEQUENCES;
import static ee.sm.ti.teis.types.enums.RolePrivilegeCode.TI_VIEW_ACCIDENT;
import static ee.sm.ti.teis.utils.TestUtils.*;
import static java.lang.Boolean.FALSE;
import static java.lang.Boolean.TRUE;
import static org.assertj.core.api.Assertions.assertThat;
@Transactional
class CreateOfficialInSequenceGwListenerTest extends OfficialsAppTestBase implements ListenerCreateRequestTestBase {
public static final UUID SEQUENCE_ID = UUID.fromString("25c02b6b-2189-4736-9d61-4f9132c70dd5");
public static final UUID OFFICIAL_USER_ID = UUID.fromString("e0ee766d-4332-450a-9d9c-9835ae663d96");
public static final UUID DELETED_OFFICIALS_SEQUENCE_ID = UUID.fromString("c5c590ef-3231-481a-8a30-7274361c016d");
public static final UUID DELETED_OFFICIAL_USER_ID = UUID.fromString("2d2aa827-d92a-4f77-af3c-a9537ba31d7b");
CreateOfficialInSequenceRequest request;
CreateOfficialInSequenceDto payload;
CreateOfficialInSequenceResponse response;
RequestMetaDTO requestMetaDTO;
@Autowired
OfficialInSequenceGwListener listener;
@BeforeEach
void setUp() {
requestMetaDTO = createRandomOfficialUser(List.of(TI_MANAGE_OFFICIALS_SEQUENCES.name()));
request = new CreateOfficialInSequenceRequest();
payload = CreateOfficialInSequenceDto.builder()
.officialsSequenceId(SEQUENCE_ID)
.officialUserId(OFFICIAL_USER_ID)
.build();
request.setPayload(payload, requestMetaDTO);
}
@Override
@Test
public void missingRequiredPrivilege_forbidden() {
requestMetaDTO.setPrivileges(List.of(TI_VIEW_ACCIDENT.name()));
request.setPayload(payload, requestMetaDTO);
response = listener.create(request);
assertResponseForbidden(response.getError());
}
@Override
@Test
public void wrongUserType_forbidden() {
requestMetaDTO.setUserType(PERSON);
request.setPayload(payload, requestMetaDTO);
response = listener.create(request);
assertResponseForbidden(response.getError());
}
@Test
public void create_officialsSequenceIdMissing_badRequest() {
payload.setOfficialsSequenceId(null);
request.setPayload(payload, requestMetaDTO);
response = listener.create(request);
assertBadRequest(response.getError());
assertThat(response.getError().getViolations().stream()
.anyMatch(violation -> violation.getFieldName().contains("create.dto.officialsSequenceId") &&
violation.getCode().equals("NotNull")))
.isTrue();
}
@Test
public void create_officialUserIdMissing_badRequest() {
payload.setOfficialUserId(null);
request.setPayload(payload, requestMetaDTO);
response = listener.create(request);
assertBadRequest(response.getError());
assertThat(response.getError().getViolations().stream()
.anyMatch(violation -> violation.getFieldName().contains("create.dto.officialUserId") &&
violation.getCode().equals("NotNull")))
.isTrue();
}
@Test
public void create_sequenceDeleted_notFound() {
payload.setOfficialsSequenceId(DELETED_OFFICIALS_SEQUENCE_ID);
request.setPayload(payload, requestMetaDTO);
response = listener.create(request);
assertResponseNotFound(response.getError());
assertThat(response.getError().getMessage()).isEqualTo("Officials sequence not found");
}
@Test
public void create_officialUserDeleted_notFound() {
payload.setOfficialUserId(DELETED_OFFICIAL_USER_ID);
request.setPayload(payload, requestMetaDTO);
response = listener.create(request);
assertResponseNotFound(response.getError());
assertThat(response.getError().getMessage()).isEqualTo("Official user not found.");
}
@Test
public void create_officialUserInSequenceAlreadyExists_returnsExisting_success() {
payload.setOfficialUserId(UUID.fromString("3dac227f-a8af-4771-8d8b-01409ac7fef0"));
request.setPayload(payload, requestMetaDTO);
response = listener.create(request);
OfficialInSequenceDto dto = response.getPayload();
assertThat(dto.getId()).isEqualTo(UUID.fromString("16b34bc7-a28a-42cb-891c-2af9ad40c3f4"));
assertThat(dto.getOfficialUserId()).isEqualTo(payload.getOfficialUserId());
assertThat(dto.getOfficialsSequenceId()).isEqualTo(payload.getOfficialsSequenceId());
assertThat(dto.getActive()).isFalse();
}
@Override
@Test
public void create_minimumData_success() {
request.setPayload(payload, requestMetaDTO);
response = listener.create(request);
assertThat(response.getError()).isNull();
OfficialInSequenceDto dto = response.getPayload();
assertThat(dto.getId()).isNotNull();
assertThat(dto.getOfficialUserId()).isEqualTo(payload.getOfficialUserId());
assertThat(dto.getOfficialsSequenceId()).isEqualTo(payload.getOfficialsSequenceId());
assertThat(dto.getActive()).isTrue();
assertThat(dto.getObjectStatus()).isEqualTo(CURRENT);
}
@Override
@Test
public void create_fullData_success() {
payload.setActive(TRUE);
request.setPayload(payload, requestMetaDTO);
response = listener.create(request);
assertThat(response.getError()).isNull();
OfficialInSequenceDto dto = response.getPayload();
assertThat(dto.getId()).isNotNull();
assertThat(dto.getOfficialUserId()).isEqualTo(payload.getOfficialUserId());
assertThat(dto.getOfficialsSequenceId()).isEqualTo(payload.getOfficialsSequenceId());
assertThat(dto.getActive()).isTrue();
assertThat(dto.getObjectStatus()).isEqualTo(CURRENT);
}
@Test
public void create_activeFalse_success() {
payload.setActive(FALSE);
request.setPayload(payload, requestMetaDTO);
response = listener.create(request);
assertThat(response.getError()).isNull();
OfficialInSequenceDto dto = response.getPayload();
assertThat(dto.getId()).isNotNull();
assertThat(dto.getOfficialUserId()).isEqualTo(payload.getOfficialUserId());
assertThat(dto.getOfficialsSequenceId()).isEqualTo(payload.getOfficialsSequenceId());
assertThat(dto.getActive()).isFalse();
assertThat(dto.getObjectStatus()).isEqualTo(CURRENT);
}
}
package ee.sm.ti.teis.officials.officialinsequence;
import ee.sm.ti.teis.OfficialsAppTestBase;
import ee.sm.ti.teis.officegateway.official.request.DeleteOfficialInSequenceRequest;
import ee.sm.ti.teis.officegateway.official.response.DeleteOfficialInSequenceResponse;
import ee.sm.ti.teis.officegateway.officials.officialinsequence.request.DeleteOfficialInSequenceRequest;
import ee.sm.ti.teis.officegateway.officials.officialinsequence.response.DeleteOfficialInSequenceResponse;
import ee.sm.ti.teis.officials.officialinsequence.listener.OfficialInSequenceGwListener;
import ee.sm.ti.teis.officials.officialinsequence.service.OfficialInSequenceDataService;
import ee.sm.ti.teis.officials.officialssequence.OfficialsSequenceEntity;
......
package ee.sm.ti.teis.officials.officialinsequence;
import ee.sm.ti.teis.OfficialsAppTestBase;
import ee.sm.ti.teis.officegateway.official.dto.UpdateOfficialInSequenceDto;
import ee.sm.ti.teis.officegateway.official.request.UpdateOfficialInSequenceRequest;
import ee.sm.ti.teis.officegateway.official.response.UpdateOfficialInSequenceResponse;
import ee.sm.ti.teis.officegateway.officials.officialinsequence.dto.UpdateOfficialInSequenceDto;
import ee.sm.ti.teis.officegateway.officials.officialinsequence.request.UpdateOfficialInSequenceRequest;
import ee.sm.ti.teis.officegateway.officials.officialinsequence.response.UpdateOfficialInSequenceResponse;
import ee.sm.ti.teis.officials.officialinsequence.listener.OfficialInSequenceGwListener;
import ee.sm.ti.teis.officials.officialinsequence.service.OfficialInSequenceDataService;
import ee.sm.ti.teis.servicecommon.test.ListenerUpdateRequestTestBase;
......
package ee.sm.ti.teis.officials.officialssequence;
import ee.sm.ti.teis.OfficialsAppTestBase;
import ee.sm.ti.teis.officegateway.official.dto.OfficialUserInSequenceDetailsDto;
import ee.sm.ti.teis.officegateway.official.dto.OfficialsSequenceDetailsDto;
import ee.sm.ti.teis.officegateway.official.request.GetOfficialsSequenceRequest;
import ee.sm.ti.teis.officegateway.official.response.GetOfficialsSequenceResponse;
import ee.sm.ti.teis.officegateway.officials.officialinsequence.dto.OfficialUserInSequenceDetailsDto;
import ee.sm.ti.teis.officegateway.officials.officialssequence.dto.OfficialsSequenceDetailsDto;
import ee.sm.ti.teis.officegateway.officials.officialssequence.request.GetOfficialsSequenceRequest;
import ee.sm.ti.teis.officegateway.officials.officialssequence.response.GetOfficialsSequenceResponse;
import ee.sm.ti.teis.officials.officialssequence.listener.OfficialsSequenceGwListener;
import ee.sm.ti.teis.servicecommon.test.ListenerGetObjectRequestTestBase;
import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
......
package ee.sm.ti.teis.officials.officialssequence;
import ee.sm.ti.teis.OfficialsAppTestBase;
import ee.sm.ti.teis.officegateway.official.dto.OfficialUserInSequenceDto;
import ee.sm.ti.teis.officegateway.official.request.GetOfficialFromSequenceTestRequest;
import ee.sm.ti.teis.officegateway.official.response.GetOfficialFromSequenceTestResponse;
import ee.sm.ti.teis.officegateway.officials.officialinsequence.dto.OfficialUserInSequenceDto;
import ee.sm.ti.teis.officegateway.officials.officialinsequence.request.GetOfficialFromSequenceTestRequest;
import ee.sm.ti.teis.officegateway.officials.officialinsequence.response.GetOfficialFromSequenceTestResponse;
import ee.sm.ti.teis.officials.officialssequence.listener.OfficialsSequenceGwTestListener;
import ee.sm.ti.teis.officials.officialssequence.service.OfficialsSequenceDataService;
import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
......
......@@ -3,8 +3,8 @@ package ee.sm.ti.teis.officials.officialssequence;
import ee.sm.ti.teis.OfficialsAppTestBase;
import ee.sm.ti.teis.domain.officials.OfficialUserInSequence;
import ee.sm.ti.teis.domain.officials.OfficialsSequence;
import ee.sm.ti.teis.officials.config.QueueConfig.GetOfficialFromSequenceRequest;
import ee.sm.ti.teis.officials.config.QueueConfig.GetOfficialFromSequenceResponse;
import ee.sm.ti.teis.officials.config.OfficialsSequenceQueueConfig.GetOfficialFromSequenceRequest;
import ee.sm.ti.teis.officials.config.OfficialsSequenceQueueConfig.GetOfficialFromSequenceResponse;
import ee.sm.ti.teis.officials.officialssequence.listener.OfficialsSequenceMsListener;
import ee.sm.ti.teis.officials.officialssequence.service.OfficialsSequenceDataService;
import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
......
package ee.sm.ti.teis.officials.officialssequence;
import ee.sm.ti.teis.OfficialsAppTestBase;
import ee.sm.ti.teis.officegateway.official.dto.OfficialsSequenceDto;
import ee.sm.ti.teis.officegateway.official.request.GetOfficialsSequencesRequest;
import ee.sm.ti.teis.officegateway.official.response.GetOfficialsSequencesResponse;
import ee.sm.ti.teis.officegateway.officials.officialssequence.dto.OfficialsSequenceDto;
import ee.sm.ti.teis.officegateway.officials.officialssequence.request.GetOfficialsSequencesRequest;
import ee.sm.ti.teis.officegateway.officials.officialssequence.response.GetOfficialsSequencesResponse;
import ee.sm.ti.teis.officials.officialssequence.listener.OfficialsSequenceGwListener;
import ee.sm.ti.teis.servicecommon.test.ListenerGetListRequestTestBase;
import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
......
package ee.sm.ti.teis.officials.config;
import ee.sm.ti.teis.ErrorDTO;
import ee.sm.ti.teis.cache.office.OfficeCacheUpdateService;
import ee.sm.ti.teis.configuration.QueueList;
import ee.sm.ti.teis.configuration.TeisQueue;
import ee.sm.ti.teis.domain.officials.Office;
import ee.sm.ti.teis.domainrequest.DomainQueryDTO;
import ee.sm.ti.teis.domainrequest.DomainQueryResponseDto;
import ee.sm.ti.teis.domainrequest.DomainRequestDTO;
import ee.sm.ti.teis.domainrequest.DomainResponseDTO;
import ee.sm.ti.teis.officegateway.officials.offices.OfficesRequest;
import org.springframework.context.annotation.Configuration;
import java.util.ArrayList;
import java.util.List;
@Configuration
public class OfficeQueueConfig implements QueueList {
public static final String GW_OFFICES_QUEUE = "officials-service.gw.findOfficesRequest";
public static final String MS_OFFICES_QUEUE = "officials-service.ms.findOfficesRequest";
public static final String MS_OFFICE_QUEUE = "officials-service.ms.findOfficeRequest";
public static final String CS_OFFICES_QUEUE = "officials-service.cs.officesCacheRequests";
@Override
public void updateQueues(ArrayList<TeisQueue> queues) {
addGwQueue(queues, "gwFindOfficesQueue", OfficesRequest.ROUTING_KEY, GW_OFFICES_QUEUE);
addMsQueue(queues, "msFindOfficesQueue", new OfficesDomainRequest().routingKey(),
MS_OFFICES_QUEUE);
addMsQueue(queues, "msFindOfficeQueue", new OfficeDomainRequest().routingKey(),
MS_OFFICE_QUEUE);
addCsQueue(queues, "csOfficesQueue", new OfficeCacheUpdateService.OfficesDomainCacheRequest().routingKey(),
CS_OFFICES_QUEUE);
}
public static class OfficesDomainRequest extends DomainQueryDTO<Office, ErrorDTO> {
}
public static class OfficesMsResponse extends DomainQueryResponseDto<List<Office>, ErrorDTO> {
}
public static class OfficeDomainRequest extends DomainRequestDTO<Office, ErrorDTO> {
}
public static class OfficeMsResponse extends DomainResponseDTO<Office, ErrorDTO> {
}
}
package ee.sm.ti.teis.officials.config;
import ee.sm.ti.teis.configuration.QueueList;
import ee.sm.ti.teis.configuration.TeisQueue;
import ee.sm.ti.teis.officegateway.officials.officialinsequence.request.CreateOfficialInSequenceRequest;
import ee.sm.ti.teis.officegateway.officials.officialinsequence.request.DeleteOfficialInSequenceRequest;
import ee.sm.ti.teis.officegateway.officials.officialinsequence.request.UpdateOfficialInSequenceRequest;
import org.springframework.context.annotation.Configuration;
import java.util.ArrayList;
@Configuration
public class OfficialInSequenceQueueConfig implements QueueList {
public static final String GW_CREATE_OFFICIAL_IN_SEQUENCE_QUEUE = "officials-service.gw.createOfficialInSequenceRequest";
public static final String GW_DELETE_OFFICIAL_IN_SEQUENCE_QUEUE = "officials-service.gw.deleteOfficialInSequenceRequest";
public static final String GW_UPDATE_OFFICIAL_IN_SEQUENCE_QUEUE = "officials-service.gw.updateOfficialInSequenceRequest";
@Override
public void updateQueues(ArrayList<TeisQueue> queues) {
addGwQueue(queues, "gwCreateOfficialInSequenceQueue", CreateOfficialInSequenceRequest.ROUTING_KEY,
GW_CREATE_OFFICIAL_IN_SEQUENCE_QUEUE);
addGwQueue(queues, "gwDeleteOfficialInSequenceQueue", DeleteOfficialInSequenceRequest.ROUTING_KEY,
GW_DELETE_OFFICIAL_IN_SEQUENCE_QUEUE);
addGwQueue(queues, "gwUpdateOfficialInSequenceQueue", UpdateOfficialInSequenceRequest.ROUTING_KEY,
GW_UPDATE_OFFICIAL_IN_SEQUENCE_QUEUE);
}
}
......@@ -3,57 +3,33 @@ package ee.sm.ti.teis.officials.config;
import ee.sm.ti.teis.ErrorDTO;
import ee.sm.ti.teis.configuration.QueueList;
import ee.sm.ti.teis.configuration.TeisQueue;
import ee.sm.ti.teis.domain.officials.*;
import ee.sm.ti.teis.domain.officials.OfficialUser;
import ee.sm.ti.teis.domainrequest.*;
import ee.sm.ti.teis.officegateway.official.request.*;
import ee.sm.ti.teis.officegateway.officials.officialuser.request.*;
import ee.sm.ti.teis.servicecommon.util.TestDataImportService;
import org.springframework.context.annotation.Configuration;
import java.util.ArrayList;
import java.util.List;
import static ee.sm.ti.teis.cache.office.OfficeCacheUpdateService.OfficesDomainCacheRequest;
import static ee.sm.ti.teis.cache.officials.OfficialUserCacheUpdateService.OfficialUsersDomainCacheRequest;
import static ee.sm.ti.teis.cache.officials.OfficialsGroupCacheUpdateService.OfficialsGroupsDomainCacheRequest;
@Configuration
public class QueueConfig implements QueueList {
public class OfficialUserQueueConfig implements QueueList {
public static final String GW_CREATE_OFFICIAL_USER_QUEUE = "officials-service.gw.createUserRequest";
public static final String GW_OFFICIAL_USER_QUEUE = "officials-service.gw.findUserRequest";
public static final String GW_OFFICIAL_USERS_QUEUE = "officials-service.gw.findUsersRequest";
public static final String GW_DELETE_OFFICIAL_USER_QUEUE = "officials-service.gw.deleteUserRequest";
public static final String GW_UPDATE_OFFICIAL_USER_QUEUE = "officials-service.gw.updateUserRequest";
public static final String GW_CREATE_OFFICIALS_GROUP_QUEUE = "officials-service.gw.createGroupRequest";
public static final String GW_UPDATE_OFFICIALS_GROUP_QUEUE = "officials-service.gw.updateGroupRequest";
public static final String GW_DELETE_OFFICIALS_GROUP_QUEUE = "officials-service.gw.deleteGroupRequest";
public static final String GW_OFFICIALS_GROUPS_QUEUE = "officials-service.gw.findGroupsRequest";
public static final String GW_OFFICIALS_GROUP_QUEUE = "officials-service.gw.findGroupRequests";
public static final String GW_OFFICIALS_GROUP_EMTAK_CODES_QUEUE = "officials-service.gw.findGroupEmtakCodesRequest";
public static final String GW_CREATE_OFFICIALS_GROUP_EMTAK_CODES_QUEUE = "officials-service.gw.createGroupEmtakCodesRequest";
public static final String GW_DELETE_OFFICIALS_GROUP_EMTAK_QUEUE = "officials-service.gw.deleteGroupEmtakRequest";
public static final String GW_OFFICES_QUEUE = "officials-service.gw.findOfficesRequest";
public static final String GW_ADD_OFFICIALS_GROUP_MEMBERS_QUEUE = "officials-service.gw.addGroupMembersRequest";
public static final String GW_DELETE_OFFICIALS_GROUP_MEMBER_QUEUE = "officials-service.gw.deleteGroupMemberRequest";
public static final String GW_GET_OFFICIAL_FROM_SEQUENCE_TEST_QUEUE = "officials-service.gw.getOfficialFromSequenceTestRequest";
public static final String GW_GET_OFFICIALS_SEQUENCES_QUEUE = "officials-service.gw.getOfficialsSequencesRequest";
public static final String GW_GET_OFFICIALS_SEQUENCE_QUEUE = "officials-service.gw.getOfficialsSequenceRequest";
public static final String GW_DELETE_OFFICIAL_IN_SEQUENCE_QUEUE = "officials-service.gw.deleteOfficialInSequenceRequest";
public static final String GW_UPDATE_OFFICIAL_IN_SEQUENCE_QUEUE = "officials-service.gw.updateOfficialInSequenceRequest";
public static final String MS_OFFICIAL_USER_QUEUE = "officials-service.ms.findUserRequest";