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 2a95343c497..dc0e5e03a57 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,13 +1,12 @@ package no.nav.testnav.libs.dto.sykemelding.v1; -import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; +import lombok.NoArgsConstructor; import java.time.LocalDate; import java.util.ArrayList; -import java.util.Collections; import java.util.List; import static java.util.Objects.isNull; @@ -15,6 +14,7 @@ @Data @Builder @AllArgsConstructor +@NoArgsConstructor(force = true) public class SykemeldingDTO { private LocalDate startDato; @@ -28,16 +28,8 @@ public class SykemeldingDTO { private DiagnoseDTO hovedDiagnose; private List biDiagnoser; private DetaljerDTO detaljer; - private Boolean umiddelbarBistand; private List utdypendeOpplysninger; - - @JsonIgnore - public List getBiDiagnoser() { - if (biDiagnoser == null) { - return Collections.emptyList(); - } - return biDiagnoser; - } + private Boolean umiddelbarBistand; public List getPerioder() { @@ -47,6 +39,13 @@ public List getPerioder() { return perioder; } + public List getBiDiagnoser() { + + if (isNull(biDiagnoser)) { + biDiagnoser = new ArrayList<>(); + } + return biDiagnoser; + } public List getUtdypendeOpplysninger() { @@ -56,9 +55,8 @@ public List getUtdypendeOpplysninger() { return utdypendeOpplysninger; } - - @JsonIgnore public Boolean getManglendeTilretteleggingPaaArbeidsplassen() { return manglendeTilretteleggingPaaArbeidsplassen != null && manglendeTilretteleggingPaaArbeidsplassen; } } +