Skip to content
Snippets Groups Projects
Commit e6af2393 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-7350 use simplified GrpcCreateCollaborationRequestData

parent 8c806bea
No related branches found
No related tags found
No related merge requests found
...@@ -121,6 +121,8 @@ public abstract class CollaborationRequestMapper { ...@@ -121,6 +121,8 @@ public abstract class CollaborationRequestMapper {
@Mapping(target = "allFields", ignore = true) @Mapping(target = "allFields", ignore = true)
public abstract GrpcCollaborationRequest toGrpcCollaborationRequest(CollaborationRequest request); public abstract GrpcCollaborationRequest toGrpcCollaborationRequest(CollaborationRequest request);
@Mapping(target = "organisationsEinheitId", source = "zustaendigeStelle.subjectId")
@Mapping(target = "organisationsEinheitIdBytes", ignore = true)
@Mapping(target = "mergeFrom", ignore = true) @Mapping(target = "mergeFrom", ignore = true)
@Mapping(target = "clearField", ignore = true) @Mapping(target = "clearField", ignore = true)
@Mapping(target = "clearOneof", ignore = true) @Mapping(target = "clearOneof", ignore = true)
...@@ -128,7 +130,6 @@ public abstract class CollaborationRequestMapper { ...@@ -128,7 +130,6 @@ public abstract class CollaborationRequestMapper {
@Mapping(target = "unknownFields", ignore = true) @Mapping(target = "unknownFields", ignore = true)
@Mapping(target = "vorgangIdBytes", ignore = true) @Mapping(target = "vorgangIdBytes", ignore = true)
@Mapping(target = "allFields", ignore = true) @Mapping(target = "allFields", ignore = true)
@Mapping(target = "mergeZustaendigeStelle", ignore = true)
public abstract GrpcCreateCollaborationRequestData toGrpcCreateCollaborationRequestData(CollaborationRequest request); public abstract GrpcCreateCollaborationRequestData toGrpcCreateCollaborationRequestData(CollaborationRequest request);
@Mapping(target = "id", expression = "java(toCollaborationRequestId(getStringProperty(CollaborationRequest.PROPERTY_ID, item.getItem())))") @Mapping(target = "id", expression = "java(toCollaborationRequestId(getStringProperty(CollaborationRequest.PROPERTY_ID, item.getItem())))")
......
...@@ -89,10 +89,6 @@ public class CollaborationService { ...@@ -89,10 +89,6 @@ public class CollaborationService {
commandService.addSubCommands(buildCreateCollaborationRequestRequest(enrichedRequest)); commandService.addSubCommands(buildCreateCollaborationRequestRequest(enrichedRequest));
} }
String getUserId() {
return userProfileService.getUserProfile().getId().toString();
}
OzgCloudCreateSubCommandsRequest buildCreateCollaborationRequestRequest(CollaborationRequest request) { OzgCloudCreateSubCommandsRequest buildCreateCollaborationRequestRequest(CollaborationRequest request) {
return OzgCloudCreateSubCommandsRequest.builder() return OzgCloudCreateSubCommandsRequest.builder()
.parentId(request.getCommandId()) .parentId(request.getCommandId())
...@@ -116,6 +112,10 @@ public class CollaborationService { ...@@ -116,6 +112,10 @@ public class CollaborationService {
return request.toBuilder().collaborationVorgangId(collaborationVorgangId).createdBy(getUserId()).build(); return request.toBuilder().collaborationVorgangId(collaborationVorgangId).createdBy(getUserId()).build();
} }
String getUserId() {
return userProfileService.getUserProfile().getId().toString();
}
OzgCloudCreateSubCommandsRequest buildCreateSubCommandsRequest(CollaborationRequest collaborationRequest, List<OzgCloudCommand> subCommands) { OzgCloudCreateSubCommandsRequest buildCreateSubCommandsRequest(CollaborationRequest collaborationRequest, List<OzgCloudCommand> subCommands) {
return OzgCloudCreateSubCommandsRequest.builder() return OzgCloudCreateSubCommandsRequest.builder()
.parentId(collaborationRequest.getCommandId()) .parentId(collaborationRequest.getCommandId())
......
...@@ -4,17 +4,9 @@ import de.ozgcloud.collaboration.CollaborationRequestTestFactory; ...@@ -4,17 +4,9 @@ import de.ozgcloud.collaboration.CollaborationRequestTestFactory;
import de.ozgcloud.collaboration.fachstelle.FachstelleTestFactory; import de.ozgcloud.collaboration.fachstelle.FachstelleTestFactory;
import de.ozgcloud.command.CommandTestFactory; import de.ozgcloud.command.CommandTestFactory;
import de.ozgcloud.vorgang.vorgang.GrpcCreateCollaborationRequestData; import de.ozgcloud.vorgang.vorgang.GrpcCreateCollaborationRequestData;
import de.ozgcloud.vorgang.vorgang.GrpcFachstelle;
import de.ozgcloud.vorgang.vorgang.GrpcFachstelleType;
public class GrpcCreateCollaborationRequestDataTestFactory { public class GrpcCreateCollaborationRequestDataTestFactory {
public static final GrpcFachstelle FACHSTELLE = GrpcFachstelle.newBuilder()
.setSubjectId(FachstelleTestFactory.SUBJECT_ID)
.setTechnicalId(FachstelleTestFactory.TECHNICAL_ID)
.setType(GrpcFachstelleType.valueOf(FachstelleTestFactory.TYPE.name()))
.build();
public static GrpcCreateCollaborationRequestData create() { public static GrpcCreateCollaborationRequestData create() {
return createBuilder().build(); return createBuilder().build();
} }
...@@ -23,6 +15,6 @@ public class GrpcCreateCollaborationRequestDataTestFactory { ...@@ -23,6 +15,6 @@ public class GrpcCreateCollaborationRequestDataTestFactory {
return GrpcCreateCollaborationRequestData.newBuilder() return GrpcCreateCollaborationRequestData.newBuilder()
.setCollaborationLevel(CollaborationRequestTestFactory.COLLABORATION_LEVEL) .setCollaborationLevel(CollaborationRequestTestFactory.COLLABORATION_LEVEL)
.setVorgangId(CommandTestFactory.VORGANG_ID) .setVorgangId(CommandTestFactory.VORGANG_ID)
.setZustaendigeStelle(FACHSTELLE); .setOrganisationsEinheitId(FachstelleTestFactory.SUBJECT_ID);
} }
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment