From 9afc5d047f19f4dd132b414a55bb8e3ecf0c6352 Mon Sep 17 00:00:00 2001 From: stigus Date: Fri, 6 Dec 2024 14:36:51 +0100 Subject: [PATCH] DTO revert #deploy-test-sykemelding-api --- .../libs/dto/sykemelding/v1/AdresseDTO.java | 8 +++- .../libs/dto/sykemelding/v1/AktivitetDTO.java | 6 ++- .../dto/sykemelding/v1/ArbeidsgiverDTO.java | 8 +++- .../libs/dto/sykemelding/v1/DetaljerDTO.java | 10 ++-- .../libs/dto/sykemelding/v1/DiagnoseDTO.java | 6 ++- .../dto/sykemelding/v1/HelsepersonellDTO.java | 8 +++- .../dto/sykemelding/v1/OrganisasjonDTO.java | 14 ++++-- .../libs/dto/sykemelding/v1/PasientDTO.java | 8 +++- .../libs/dto/sykemelding/v1/PeriodeDTO.java | 8 +++- .../dto/sykemelding/v1/SykemeldingDTO.java | 46 +++++++++--------- .../v1/UtdypendeOpplysningerDTO.java | 47 ------------------- .../sykemelding/v1/ValidationResultDTO.java | 47 ------------------- 12 files changed, 75 insertions(+), 141 deletions(-) delete mode 100644 libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/sykemelding/v1/UtdypendeOpplysningerDTO.java delete mode 100644 libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/sykemelding/v1/ValidationResultDTO.java diff --git a/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/sykemelding/v1/AdresseDTO.java b/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/sykemelding/v1/AdresseDTO.java index 7d03c7cdbee..dc046646336 100644 --- a/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/sykemelding/v1/AdresseDTO.java +++ b/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/sykemelding/v1/AdresseDTO.java @@ -2,11 +2,15 @@ import lombok.AllArgsConstructor; import lombok.Builder; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.Value; -@Data +@Value @Builder @AllArgsConstructor +@NoArgsConstructor(force = true) +@EqualsAndHashCode public class AdresseDTO { private String gate; private String postnummer; diff --git a/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/sykemelding/v1/AktivitetDTO.java b/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/sykemelding/v1/AktivitetDTO.java index 7c8631b00d6..59ea89c02ca 100644 --- a/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/sykemelding/v1/AktivitetDTO.java +++ b/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/sykemelding/v1/AktivitetDTO.java @@ -3,11 +3,13 @@ import lombok.AllArgsConstructor; import lombok.Builder; -import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.Value; -@Data +@Value @Builder @AllArgsConstructor +@NoArgsConstructor(force = true) public class AktivitetDTO { private final Integer grad; private final Boolean reisetilskudd; diff --git a/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/sykemelding/v1/ArbeidsgiverDTO.java b/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/sykemelding/v1/ArbeidsgiverDTO.java index cc7a9472b3d..3b96842651c 100644 --- a/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/sykemelding/v1/ArbeidsgiverDTO.java +++ b/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/sykemelding/v1/ArbeidsgiverDTO.java @@ -2,11 +2,15 @@ import lombok.AllArgsConstructor; import lombok.Builder; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.Value; -@Data +@Value @Builder @AllArgsConstructor +@NoArgsConstructor(force = true) +@EqualsAndHashCode public class ArbeidsgiverDTO { private String navn; private String yrkesbetegnelse; diff --git a/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/sykemelding/v1/DetaljerDTO.java b/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/sykemelding/v1/DetaljerDTO.java index 28f0511c961..f751dcb3c76 100644 --- a/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/sykemelding/v1/DetaljerDTO.java +++ b/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/sykemelding/v1/DetaljerDTO.java @@ -2,11 +2,15 @@ import lombok.AllArgsConstructor; import lombok.Builder; -import lombok.Data; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; -@Data -@Builder +@Getter +@Setter +@NoArgsConstructor @AllArgsConstructor +@Builder public class DetaljerDTO { private String tiltakArbeidsplass; diff --git a/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/sykemelding/v1/DiagnoseDTO.java b/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/sykemelding/v1/DiagnoseDTO.java index 17cca7b5c5b..18ebbed0794 100644 --- a/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/sykemelding/v1/DiagnoseDTO.java +++ b/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/sykemelding/v1/DiagnoseDTO.java @@ -3,11 +3,13 @@ import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.Builder; -import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.Value; -@Data +@Value @Builder @AllArgsConstructor +@NoArgsConstructor(force = true) public class DiagnoseDTO { @JsonProperty private String diagnose; diff --git a/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/sykemelding/v1/HelsepersonellDTO.java b/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/sykemelding/v1/HelsepersonellDTO.java index 5971d77e909..d855e9b7b8e 100644 --- a/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/sykemelding/v1/HelsepersonellDTO.java +++ b/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/sykemelding/v1/HelsepersonellDTO.java @@ -3,11 +3,15 @@ import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.Builder; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.Value; -@Data +@Value @Builder @AllArgsConstructor +@NoArgsConstructor(force = true) +@EqualsAndHashCode public class HelsepersonellDTO { @JsonProperty private String ident; diff --git a/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/sykemelding/v1/OrganisasjonDTO.java b/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/sykemelding/v1/OrganisasjonDTO.java index 29f47e9b103..0e423729855 100644 --- a/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/sykemelding/v1/OrganisasjonDTO.java +++ b/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/sykemelding/v1/OrganisasjonDTO.java @@ -2,13 +2,17 @@ import lombok.AllArgsConstructor; import lombok.Builder; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.Value; -@Data +@Value @Builder @AllArgsConstructor +@NoArgsConstructor(force = true) +@EqualsAndHashCode public class OrganisasjonDTO { - private String navn; - private String orgNr; - private AdresseDTO adresse; + private final String navn; + private final String orgNr; + private final AdresseDTO adresse; } diff --git a/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/sykemelding/v1/PasientDTO.java b/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/sykemelding/v1/PasientDTO.java index bb3a9978e61..5711f9066fd 100644 --- a/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/sykemelding/v1/PasientDTO.java +++ b/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/sykemelding/v1/PasientDTO.java @@ -2,13 +2,17 @@ import lombok.AllArgsConstructor; import lombok.Builder; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.Value; import java.time.LocalDate; -@Data +@Value @Builder @AllArgsConstructor +@NoArgsConstructor(force = true) +@EqualsAndHashCode public class PasientDTO { private String ident; private String fornavn; diff --git a/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/sykemelding/v1/PeriodeDTO.java b/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/sykemelding/v1/PeriodeDTO.java index 5b59fe4d444..8d79436bb73 100644 --- a/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/sykemelding/v1/PeriodeDTO.java +++ b/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/sykemelding/v1/PeriodeDTO.java @@ -2,13 +2,17 @@ import lombok.AllArgsConstructor; import lombok.Builder; -import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.Value; import java.time.LocalDate; -@Data +@Value @Builder @AllArgsConstructor +@NoArgsConstructor(force = true) +@EqualsAndHashCode public class PeriodeDTO { private LocalDate fom; private LocalDate tom; diff --git a/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/sykemelding/v1/SykemeldingDTO.java b/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/sykemelding/v1/SykemeldingDTO.java index b06083ef234..7b91ea7221a 100644 --- a/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/sykemelding/v1/SykemeldingDTO.java +++ b/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/sykemelding/v1/SykemeldingDTO.java @@ -1,61 +1,57 @@ package no.nav.testnav.libs.dto.sykemelding.v1; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.Builder; -import lombok.Data; +import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; +import lombok.Value; import java.time.LocalDate; -import java.util.ArrayList; +import java.util.Collections; import java.util.List; -import static java.util.Objects.isNull; - -@Data +@Value @Builder @AllArgsConstructor @NoArgsConstructor(force = true) +@EqualsAndHashCode public class SykemeldingDTO { + @JsonProperty private LocalDate startDato; + @JsonProperty private PasientDTO pasient; + @JsonProperty private HelsepersonellDTO helsepersonell; + @JsonProperty private ArbeidsgiverDTO arbeidsgiver; + @JsonProperty private Boolean manglendeTilretteleggingPaaArbeidsplassen; + @JsonProperty private List perioder; + @JsonProperty private OrganisasjonDTO sender; + @JsonProperty private OrganisasjonDTO mottaker; + @JsonProperty private DiagnoseDTO hovedDiagnose; + @JsonProperty private List biDiagnoser; + @JsonProperty private DetaljerDTO detaljer; - private List utdypendeOpplysninger; + @JsonProperty private Boolean umiddelbarBistand; - public List getPerioder() { - - if (isNull(perioder)) { - perioder = new ArrayList<>(); - } - return perioder; - } - + @JsonIgnore public List getBiDiagnoser() { - - if (isNull(biDiagnoser)) { - biDiagnoser = new ArrayList<>(); + if (biDiagnoser == null) { + return Collections.emptyList(); } return biDiagnoser; } - public List getUtdypendeOpplysninger() { - - if (isNull(utdypendeOpplysninger)) { - utdypendeOpplysninger = new ArrayList<>(); - } - return utdypendeOpplysninger; - } - @JsonIgnore public Boolean getManglendeTilretteleggingPaaArbeidsplassen() { return manglendeTilretteleggingPaaArbeidsplassen != null && manglendeTilretteleggingPaaArbeidsplassen; diff --git a/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/sykemelding/v1/UtdypendeOpplysningerDTO.java b/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/sykemelding/v1/UtdypendeOpplysningerDTO.java deleted file mode 100644 index f9f66850c41..00000000000 --- a/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/sykemelding/v1/UtdypendeOpplysningerDTO.java +++ /dev/null @@ -1,47 +0,0 @@ -package no.nav.testnav.libs.dto.sykemelding.v1; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.ArrayList; -import java.util.List; - -import static java.util.Objects.isNull; - -@Data -@Builder -@AllArgsConstructor -public class UtdypendeOpplysningerDTO { - - private String spmGruppeId; - private String spmGruppeTekst; - private List spmSvar; - - public List getSpmSvar() { - - if (isNull(spmSvar)) { - spmSvar = new ArrayList<>(); - } - return spmSvar; - } - - public enum Restriksjon { - SKJERMET_FOR_ARBEIDSGIVER, - SKJERMET_FOR_PASIENT, - SKJERMET_FOR_NAV - } - - @Data - @Builder - @NoArgsConstructor - @AllArgsConstructor - public static class SvarType { - - private String spmId; - private String spmTekst; - private Restriksjon restriksjon; - private String svarTekst; - } -} diff --git a/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/sykemelding/v1/ValidationResultDTO.java b/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/sykemelding/v1/ValidationResultDTO.java deleted file mode 100644 index 3b7241057b8..00000000000 --- a/libs/data-transfer-objects/src/main/java/no/nav/testnav/libs/dto/sykemelding/v1/ValidationResultDTO.java +++ /dev/null @@ -1,47 +0,0 @@ -package no.nav.testnav.libs.dto.sykemelding.v1; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; -import org.springframework.http.HttpStatus; - -import java.util.ArrayList; -import java.util.List; - -import static java.util.Objects.isNull; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public class ValidationResultDTO { - - private HttpStatus httpStatus; - private String message; - - private AllowedValues status; - private List ruleHits; - - public List getRuleHits() { - - if (isNull(ruleHits)) { - ruleHits = new ArrayList<>(); - } - return ruleHits; - } - - @Data - @Builder - @NoArgsConstructor - @AllArgsConstructor - public static class Items { - - private String ruleName; - private String messageForSender; - private String messageForUser; - private AllowedValues ruleStatus; - } - - public enum AllowedValues {OK, MANUAL_PROCESSING, INVALID} -}