Skip to content

Commit

Permalink
DTO revert
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 9ab7e4b commit 9afc5d0
Show file tree
Hide file tree
Showing 12 changed files with 75 additions and 141 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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<PeriodeDTO> perioder;
@JsonProperty
private OrganisasjonDTO sender;
@JsonProperty
private OrganisasjonDTO mottaker;
@JsonProperty
private DiagnoseDTO hovedDiagnose;
@JsonProperty
private List<DiagnoseDTO> biDiagnoser;
@JsonProperty
private DetaljerDTO detaljer;
private List<UtdypendeOpplysningerDTO> utdypendeOpplysninger;
@JsonProperty
private Boolean umiddelbarBistand;

public List<PeriodeDTO> getPerioder() {

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

@JsonIgnore
public List<DiagnoseDTO> getBiDiagnoser() {

if (isNull(biDiagnoser)) {
biDiagnoser = new ArrayList<>();
if (biDiagnoser == null) {
return Collections.emptyList();
}
return biDiagnoser;
}

public List<UtdypendeOpplysningerDTO> getUtdypendeOpplysninger() {

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

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

This file was deleted.

This file was deleted.

0 comments on commit 9afc5d0

Please sign in to comment.