From 492dea0eb79e465857d8c5334cbd3d85f1db6d42 Mon Sep 17 00:00:00 2001 From: Erling Jahr Date: Thu, 5 Oct 2023 12:25:40 +0200 Subject: [PATCH] added DetailedExternalUser DTO --- .../externalUser/DetailedExternalUser.java | 17 +++++++++++++++++ .../no/fintlabs/externalUser/ExternalUser.java | 11 +++++++++++ .../externalUser/ExternalUserService.java | 1 - 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 src/main/java/no/fintlabs/externalUser/DetailedExternalUser.java diff --git a/src/main/java/no/fintlabs/externalUser/DetailedExternalUser.java b/src/main/java/no/fintlabs/externalUser/DetailedExternalUser.java new file mode 100644 index 0000000..c00933d --- /dev/null +++ b/src/main/java/no/fintlabs/externalUser/DetailedExternalUser.java @@ -0,0 +1,17 @@ +package no.fintlabs.externalUser; + +import lombok.Builder; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@Builder +public class DetailedExternalUser { + private Long id; + private String fullName; + private String userName; + private String organisationUnitName; + private String mobilePhone; + private String email; +} diff --git a/src/main/java/no/fintlabs/externalUser/ExternalUser.java b/src/main/java/no/fintlabs/externalUser/ExternalUser.java index 7fab4f3..5f060e6 100644 --- a/src/main/java/no/fintlabs/externalUser/ExternalUser.java +++ b/src/main/java/no/fintlabs/externalUser/ExternalUser.java @@ -42,6 +42,17 @@ public SimpelExternalUser toSimpleExternalUser() { .organisationUnitId(mainOrganisationUnitId) .build(); } + + public DetailedExternalUser toDetailedExternalUser(){ + return DetailedExternalUser + .builder() + .id(id) + .fullName(firstName +" "+ lastName) + .organisationUnitName(mainOrganisationUnitName) + .mobilePhone(mobilePhone) + .email(email) + .build(); + } } diff --git a/src/main/java/no/fintlabs/externalUser/ExternalUserService.java b/src/main/java/no/fintlabs/externalUser/ExternalUserService.java index 19f59bd..d11998c 100644 --- a/src/main/java/no/fintlabs/externalUser/ExternalUserService.java +++ b/src/main/java/no/fintlabs/externalUser/ExternalUserService.java @@ -7,7 +7,6 @@ import java.util.Optional; import java.util.function.Consumer; -import static com.ibm.icu.text.PluralRules.Operand.e; @Service @Slf4j