Skip to content

Commit

Permalink
Mer DTO endringer og logging
Browse files Browse the repository at this point in the history
#deploy-test-sykemelding-api
  • Loading branch information
stigus committed Dec 6, 2024
1 parent 1fc27ec commit 510dcee
Showing 1 changed file with 11 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
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;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor(force = true)
public class SykemeldingDTO {

private LocalDate startDato;
Expand All @@ -28,16 +28,8 @@ public class SykemeldingDTO {
private DiagnoseDTO hovedDiagnose;
private List<DiagnoseDTO> biDiagnoser;
private DetaljerDTO detaljer;
private Boolean umiddelbarBistand;
private List<UtdypendeOpplysningerDTO> utdypendeOpplysninger;

@JsonIgnore
public List<DiagnoseDTO> getBiDiagnoser() {
if (biDiagnoser == null) {
return Collections.emptyList();
}
return biDiagnoser;
}
private Boolean umiddelbarBistand;

public List<PeriodeDTO> getPerioder() {

Expand All @@ -47,6 +39,13 @@ public List<PeriodeDTO> getPerioder() {
return perioder;
}

public List<DiagnoseDTO> getBiDiagnoser() {

if (isNull(biDiagnoser)) {
biDiagnoser = new ArrayList<>();
}
return biDiagnoser;
}

public List<UtdypendeOpplysningerDTO> getUtdypendeOpplysninger() {

Expand All @@ -56,9 +55,8 @@ public List<UtdypendeOpplysningerDTO> getUtdypendeOpplysninger() {
return utdypendeOpplysninger;
}


@JsonIgnore
public Boolean getManglendeTilretteleggingPaaArbeidsplassen() {
return manglendeTilretteleggingPaaArbeidsplassen != null && manglendeTilretteleggingPaaArbeidsplassen;
}
}

0 comments on commit 510dcee

Please sign in to comment.