Skip to content

Commit

Permalink
DTO fix
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 c18ea0a commit 52f7ddb
Showing 1 changed file with 24 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,18 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.Value;
import lombok.Data;

import java.time.LocalDate;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

@Value
import static java.util.Objects.isNull;

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

@JsonProperty
Expand All @@ -29,20 +28,19 @@ public class SykemeldingDTO {
private ArbeidsgiverDTO arbeidsgiver;
@JsonProperty
private Boolean manglendeTilretteleggingPaaArbeidsplassen;
@JsonProperty
private List<PeriodeDTO> perioder;
@JsonProperty
private OrganisasjonDTO sender;
@JsonProperty
private OrganisasjonDTO mottaker;
@JsonProperty
private DiagnoseDTO hovedDiagnose;
@JsonProperty
private List<DiagnoseDTO> biDiagnoser;
@JsonProperty
private DetaljerDTO detaljer;
@JsonProperty
private Boolean umiddelbarBistand;
private List<UtdypendeOpplysningerDTO> utdypendeOpplysninger;

@JsonIgnore
public List<DiagnoseDTO> getBiDiagnoser() {
Expand All @@ -52,6 +50,24 @@ public List<DiagnoseDTO> getBiDiagnoser() {
return biDiagnoser;
}

public List<PeriodeDTO> getPerioder() {

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


public List<UtdypendeOpplysningerDTO> getUtdypendeOpplysninger() {

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


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

0 comments on commit 52f7ddb

Please sign in to comment.