Commit 99d71205 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/common-api-gateway!211
parents 81a93746 966422cb
# Changelog
## [1.25.0] - 2021-05-31
* TEIS-2082: new endpoint for testing getRolesByEmailRecipient. added email recipient field to RoleDefinitionPublicDto.
* TEIS-2084: new endpoint for testing: getting representative emails.
## [1.24.0] - 2021-05-03
* TEIS-2113: created REST endpoint for testing signing file as a stream
......
......@@ -40,5 +40,7 @@ public class ProceduralActPublicDto {
@Valid
@Builder.Default
private List<ProceduralActLocationPublicDto> proceduralActLocations = new ArrayList<>();
private Boolean conductedAct;
private String reasonOfNotConductedAct;
private ObjectStatus objectStatus;
}
package ee.sm.ti.teis.commongateway.representative;
import ee.sm.ti.teis.AbstractDTO;
import ee.sm.ti.teis.ErrorDTO;
import java.util.UUID;
public class GetRepresentativeEmailsRequest extends AbstractDTO<UUID, ErrorDTO> {
public static final String ROUTING_KEY = "api.GetRepresentativeEmailsRequest";
@Override
public String routingKey() {
return ROUTING_KEY;
}
}
package ee.sm.ti.teis.commongateway.representative;
import ee.sm.ti.teis.AbstractDTO;
import ee.sm.ti.teis.ErrorDTO;
import java.util.List;
public class GetRepresentativeEmailsResponse extends AbstractDTO<List<String>, ErrorDTO> {
public static final String ROUTING_KEY = "api.GetRepresentativeEmailsResponse";
@Override
public String routingKey() {
return ROUTING_KEY;
}
}
......@@ -23,6 +23,7 @@ public class RoleDefinitionPublicDto {
private String excludedRoleOverlap;
private Long defaultValidityPeriod;
private Boolean locationLink;
private Boolean emailRecipient;
private String objectStatus;
}
package ee.sm.ti.teis.commongateway.role;
import ee.sm.ti.teis.AbstractDTO;
import ee.sm.ti.teis.ErrorDTO;
public class TestRolesDefinitionsRequest extends AbstractDTO<Boolean, ErrorDTO> {
public static final String ROUTING_KEY = "api.RolesDefinitionsTestRequest";
@Override
public String routingKey() {
return ROUTING_KEY;
}
}
package ee.sm.ti.teis.commongateway.role;
import ee.sm.ti.teis.AbstractDTO;
import ee.sm.ti.teis.ErrorDTO;
import java.util.List;
public class TestRolesDefinitionsResponse extends AbstractDTO<List<RoleDefinitionPublicDto>, ErrorDTO> {
public static final String ROUTING_KEY = "api.RolesDefinitionsTestResponse";
@Override
public String routingKey() {
return ROUTING_KEY;
}
}
......@@ -47,4 +47,16 @@ class RoleTestControllerTest extends CommonApiGatewayTestBase {
verify(requestProcessingService).sendAndReceive(any(TestRolePrivilegesRequest.class));
}
@Test
void getRolesByEmailRecipient_success() {
when(requestProcessingService.sendAndReceive(any(TestRolesDefinitionsRequest.class)))
.thenReturn(List.of(new RoleDefinitionPublicDto()));
parameters.add("emailRecipient", "true");
mockMvcUtil.testGet(BASE_URL + "rolesbyemailrecipient", parameters, new TypeReference<List<RoleDefinitionPublicDto>>() {
});
verify(requestProcessingService).sendAndReceive(any(TestRolesDefinitionsRequest.class));
}
}
......@@ -6,11 +6,9 @@ import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Profile;
import org.springframework.web.bind.annotation.PatchMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.UUID;
@RestController
......@@ -29,4 +27,14 @@ public class RepresentativeTestController extends TeisBaseController {
service.sendAndReceive(request);
}
@ApiOperation(value = "${teis.api.messages.get-representative-emails}")
@GetMapping("employer-emails")
public List<String> getRepresentativeEmails(@RequestParam UUID employerId, RequestMetaDTO requestMetaDTO) {
GetRepresentativeEmailsRequest request = new GetRepresentativeEmailsRequest();
request.setPayload(employerId, requestMetaDTO);
return (List<String>) service.sendAndReceive(request);
}
}
......@@ -55,4 +55,14 @@ public class RoleTestController extends TeisBaseController {
return (Set<String>) service.sendAndReceive(request);
}
@ApiOperation(value = "${teis.api.messages.get-roles-by-email-recipient}")
@GetMapping("rolesbyemailrecipient")
public List<RoleDefinitionPublicDto> getRolesByEmailRecipient(@RequestParam(value = "emailRecipient") Boolean emailRecipient,
RequestMetaDTO requestMetaDTO) {
TestRolesDefinitionsRequest request = new TestRolesDefinitionsRequest();
request.setPayload(emailRecipient, requestMetaDTO);
return (List<RoleDefinitionPublicDto>) service.sendAndReceive(request);
}
}
......@@ -27,6 +27,7 @@ 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.patch-representative: Teenus märgib teatud rollis olevate töökeskkonna esindajad kehtetuks. Kasutatakse rollide haldamiseks.
teis.api.messages.get-representative-emails: Teenus väljastab ettevõtte identifikaatori alusel ettevõtte esindajate e-posti aadresside andmed.
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
teis.api.messages.post-representative-location-id-ex: dadcb5aa-f462-4c70-8de4-93cc4ba8c3d8
......@@ -40,6 +41,7 @@ teis.api.messages.patch-contacts: Isiku, kelle poolet esindajaks olemise andmeid
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.
teis.api.messages.get-role-definitions-privileges: Teenus väljastab rollide privileegid. Teenust kasutatakse selleks, et kui on teada kasutaja rollid, siis oleks võimalik teada saada kasutaja privileegid.
teis.api.messages.get-roles-by-email-recipient: Teenus väljastab kõik rollid, millel on vastav email recipient väärtusega märge.
teis.api.messages.get-role-definitions-privileges-ids: 346a9e4c-59c5-4368-8b1f-90e06e3b6514,86cd6b6e-1b53-4997-a2fd-630b06d33f74
teis.api.messages.post-audit-log: Teenus lisab uue uue audit logi kirje
teis.api.messages.get-audit-log: Teenus tagastab soovitud objektiga seotud audit logi kirjed. Kui sisendis on esindatud mõlemad id väljad, kasutatakse otsingus dataObjectId-d.
......
theGroup=ee.sm.ti.teis
theVersion=1.24.0
commonsVersion=1.24.0
theVersion=1.25.0
commonsVersion=1.25.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