Skip to content

Commit

Permalink
Lagt til converter for LocalDate + LocalDateTime
Browse files Browse the repository at this point in the history
  • Loading branch information
krharum committed Oct 24, 2023
1 parent 194dddb commit f62fa7f
Show file tree
Hide file tree
Showing 47 changed files with 252 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.time.YearMonth;
import java.util.ArrayList;
Expand Down Expand Up @@ -43,7 +46,8 @@ public class RsAareg {

private RsAktoer arbeidsgiver;

@Schema(description = "Angir periode oppdateringen gjelder fra")
@Schema(description = "Angir periode oppdateringen gjelder fra", type = "string", pattern="^\\d{4}-\\d{2}$")
@Field(type = FieldType.Date, format = DateFormat.year_month, pattern = "uuuu-MM")
private YearMonth navArbeidsforholdPeriode;

@Schema(description = "Angir om posten er oppdatering")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.time.LocalDateTime;

Expand All @@ -19,10 +22,12 @@ public class RsAnsettelsesPeriode {
@Schema(description = "Dato fra-og-med",
type = "LocalDateTime",
requiredMode = Schema.RequiredMode.REQUIRED)
@Field(type = FieldType.Date, format = DateFormat.date_hour_minute_second, pattern = "uuuu-MM-dd'T'HH:mm:ss")
private LocalDateTime fom;

@Schema(description = "Dato til-og-med",
type = "LocalDateTime")
@Field(type = FieldType.Date, format = DateFormat.date_hour_minute_second, pattern = "uuuu-MM-dd'T'HH:mm:ss")
private LocalDateTime tom;

@Schema(description = "Årsak for avsluttet ansettelsesperiode (kodeverk: SluttÅrsakAareg)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.time.LocalDateTime;

Expand All @@ -28,8 +31,10 @@ public class RsArbeidsavtale {
private String avloenningstype;

@Schema(type = "LocalDateTime")
@Field(type = FieldType.Date, format = DateFormat.date_hour_minute_second, pattern = "uuuu-MM-dd'T'HH:mm:ss")
private LocalDateTime endringsdatoStillingsprosent;

@Field(type = FieldType.Date, format = DateFormat.date_hour_minute_second, pattern = "uuuu-MM-dd'T'HH:mm:ss")
private LocalDateTime sisteLoennsendringsdato;

private Double stillingsprosent;
Expand All @@ -44,5 +49,6 @@ public class RsArbeidsavtale {
private String ansettelsesform;

@Schema(type = "LocalDateTime")
@Field(type = FieldType.Date, format = DateFormat.date_hour_minute_second, pattern = "uuuu-MM-dd'T'HH:mm:ss")
private LocalDateTime endringsdatoLoenn;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.time.LocalDateTime;

Expand All @@ -19,9 +22,11 @@ public class RsPeriodeAareg {
@Schema(description = "Dato fra-og-med",
type = "LocalDateTime",
requiredMode = Schema.RequiredMode.REQUIRED)
@Field(type = FieldType.Date, format = DateFormat.date_hour_minute_second, pattern = "uuuu-MM-dd'T'HH:mm:ss")
private LocalDateTime fom;

@Schema(description = "Dato til-og-med",
type = "LocalDateTime")
@Field(type = FieldType.Date, format = DateFormat.date_hour_minute_second, pattern = "uuuu-MM-dd'T'HH:mm:ss")
private LocalDateTime tom;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.time.LocalDateTime;
import java.util.ArrayList;
Expand All @@ -23,10 +26,12 @@ public class RsPeriodeAmelding {
@Schema(description = "Dato fra-og-med",
type = "LocalDateTime",
requiredMode = Schema.RequiredMode.REQUIRED)
@Field(type = FieldType.Date, format = DateFormat.date_hour_minute_second, pattern = "uuuu-MM-dd'T'HH:mm:ss")
private LocalDateTime fom;

@Schema(description = "Dato til-og-med",
type = "LocalDateTime")
@Field(type = FieldType.Date, format = DateFormat.date_hour_minute_second, pattern = "uuuu-MM-dd'T'HH:mm:ss")
private LocalDateTime tom;

@Schema(description = "Samlet liste over periode",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.time.LocalDateTime;
import java.util.ArrayList;
Expand All @@ -19,6 +22,7 @@
public class Arenadata {

@Schema
@Field(type = FieldType.Date, format = DateFormat.date_hour_minute_second, pattern = "uuuu-MM-dd'T'HH:mm:ss")
private LocalDateTime aktiveringDato;

@Schema
Expand All @@ -31,6 +35,7 @@ public class Arenadata {
private Boolean automatiskInnsendingAvMeldekort;

@Schema(type = "LocalDateTime")
@Field(type = FieldType.Date, format = DateFormat.date_hour_minute_second, pattern = "uuuu-MM-dd'T'HH:mm:ss")
private LocalDateTime inaktiveringDato;

@Schema(description = "Om rettigheten aap115 skal aktiveres på personen")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.time.LocalDateTime;
import java.util.ArrayList;
Expand All @@ -25,13 +28,15 @@ public class RsArenaAap extends ArenaPeriode{
public enum VedtakType {O, E, G, S}

private String aktivitetsfase;
@Field(type = FieldType.Date, format = DateFormat.date_hour_minute_second, pattern = "uuuu-MM-dd'T'HH:mm:ss")
private LocalDateTime datoMottatt;
@Schema(description = "O = ny rettighet, S = sletting")
private VedtakType vedtaktype;
private List<Saksopplysning> genSaksopplysninger;
private MedlemFolketrygden medlemFolketrygden;
private List<AndreOkonomYtelser> andreOkonomYtelserListe;
private List<Saksopplysning> institusjonsopphold;
@Field(type = FieldType.Date, format = DateFormat.date_hour_minute_second, pattern = "uuuu-MM-dd'T'HH:mm:ss")
private LocalDateTime justertFra;
private List<Vilkaar> vilkaar;
private String utfall;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.time.LocalDateTime;
import java.util.ArrayList;
Expand All @@ -21,8 +24,11 @@ public class RsArenaAap115 {

public enum VedtaksType {O, S}

@Field(type = FieldType.Date, format = DateFormat.date_hour_minute_second, pattern = "uuuu-MM-dd'T'HH:mm:ss")
private LocalDateTime fraDato;
@Field(type = FieldType.Date, format = DateFormat.date_hour_minute_second, pattern = "uuuu-MM-dd'T'HH:mm:ss")
private LocalDateTime tilDato;
@Field(type = FieldType.Date, format = DateFormat.date_hour_minute_second, pattern = "uuuu-MM-dd'T'HH:mm:ss")
private LocalDateTime datoMottatt;

@Schema(description = "Gyldige verdier: O (ny), S (stans)")
Expand Down Expand Up @@ -56,6 +62,7 @@ public static class MedisinskOpplysning {
private String klassifisering;
private String diagnose;
private String kilde;
@Field(type = FieldType.Date, format = DateFormat.date_hour_minute_second, pattern = "uuuu-MM-dd'T'HH:mm:ss")
private LocalDateTime kildeDato;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.time.LocalDateTime;

Expand All @@ -22,5 +25,6 @@ public class RsArenaDagpenger extends ArenaPeriode {
private String rettighetKode;

@Schema(type = "LocalDateTime")
@Field(type = FieldType.Date, format = DateFormat.date_hour_minute_second, pattern = "uuuu-MM-dd'T'HH:mm:ss")
private LocalDateTime mottattDato;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.time.LocalDateTime;
import java.util.ArrayList;
Expand Down Expand Up @@ -55,6 +58,7 @@ public static class RolleTo {
private AdresseTo postAdresse;

@Schema(defaultValue = "dagens dato")
@Field(type = FieldType.Date, format = DateFormat.date_hour_minute_second, pattern = "uuuu-MM-dd'T'HH:mm:ss")
private LocalDateTime registreringsdato;

@Schema
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.time.LocalDate;
import java.time.LocalDateTime;
Expand Down Expand Up @@ -49,6 +52,7 @@ public static class RsHistarkDokument {
private String skannested;

@Schema(description = "Når saksmappen ble skannet")
@Field(type = FieldType.Date, format = DateFormat.date_hour_minute_second, pattern = "uuuu-MM-dd'T'HH:mm:ss")
private LocalDateTime skanningsTidspunkt;
@Schema(description = "Temakoder som forsendelsen tilhører, for eksempel “DAG” (Dagpenger)")
private List<String> temakoder;
Expand All @@ -60,9 +64,11 @@ public static class RsHistarkDokument {
private String enhetsnummer;

@Schema(description = "Startåret for saksmappen")
@Field(type = FieldType.Date, format = DateFormat.basic_date, pattern = "uuuu-MM-dd")
private LocalDate startAar;

@Schema(description = "Sluttåret for saksmappen")
@Field(type = FieldType.Date, format = DateFormat.basic_date, pattern = "uuuu-MM-dd")
private LocalDate sluttAar;

@Schema(description = "Selve PDF dokumentet. Ved fysisk dokument brukes bytearray.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.time.LocalDate;
import java.time.LocalDateTime;
Expand Down Expand Up @@ -60,6 +63,7 @@ public static class Inntektsmelding {
private List<RsNaturalYtelseDetaljer> opphoerAvNaturalytelseListe;
private List<RsPeriode> pleiepengerPerioder;
private RsRefusjon refusjon;
@Field(type = FieldType.Date, format = DateFormat.basic_date, pattern = "uuuu-MM-dd")
private LocalDate startdatoForeldrepengeperiode;
private RsSykepengerIArbeidsgiverperioden sykepengerIArbeidsgiverperioden;
private YtelseType ytelse;
Expand All @@ -86,6 +90,7 @@ public static class RsRefusjon {

private List<RsEndringIRefusjon> endringIRefusjonListe;
private Double refusjonsbeloepPrMnd;
@Field(type = FieldType.Date, format = DateFormat.basic_date, pattern = "uuuu-MM-dd")
private LocalDate refusjonsopphoersdato;
}

Expand All @@ -96,6 +101,7 @@ public static class RsRefusjon {
@JsonInclude(JsonInclude.Include.NON_NULL)
public static class RsEndringIRefusjon {

@Field(type = FieldType.Date, format = DateFormat.basic_date, pattern = "uuuu-MM-dd")
private LocalDate endringsdato;
private Double refusjonsbeloepPrMnd;
}
Expand All @@ -108,6 +114,7 @@ public static class RsEndringIRefusjon {
public static class RsNaturalYtelseDetaljer {

private Double beloepPrMnd;
@Field(type = FieldType.Date, format = DateFormat.basic_date, pattern = "uuuu-MM-dd")
private LocalDate fom;
private NaturalytelseType naturalytelseType;
}
Expand All @@ -131,6 +138,7 @@ public static class RsOmsorgspenger {
@JsonInclude(JsonInclude.Include.NON_NULL)
public static class RsDelvisFravaer {

@Field(type = FieldType.Date, format = DateFormat.basic_date, pattern = "uuuu-MM-dd")
private LocalDate dato;
private Double timer;
}
Expand All @@ -142,6 +150,7 @@ public static class RsDelvisFravaer {
@JsonInclude(JsonInclude.Include.NON_NULL)
public static class RsAvsendersystem {

@Field(type = FieldType.Date, format = DateFormat.date_hour_minute_second, pattern = "uuuu-MM-dd'T'HH:mm:ss")
private LocalDateTime innsendingstidspunkt;
private String systemnavn;
private String systemversjon;
Expand Down Expand Up @@ -190,6 +199,7 @@ public static class RsArbeidsforhold {
private String arbeidsforholdId;
private List<RsPeriode> avtaltFerieListe;
private RsAltinnInntekt beregnetInntekt;
@Field(type = FieldType.Date, format = DateFormat.basic_date, pattern = "uuuu-MM-dd")
private LocalDate foersteFravaersdag;
private List<RsGraderingIForeldrepenger> graderingIForeldrepengerListe;
private List<RsUtsettelseAvForeldrepenger> utsettelseAvForeldrepengerListe;
Expand Down Expand Up @@ -234,7 +244,9 @@ public static class RsAltinnInntekt {
@JsonInclude(JsonInclude.Include.NON_NULL)
public static class RsPeriode {

@Field(type = FieldType.Date, format = DateFormat.basic_date, pattern = "uuuu-MM-dd")
private LocalDate fom;
@Field(type = FieldType.Date, format = DateFormat.basic_date, pattern = "uuuu-MM-dd")
private LocalDate tom;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.time.LocalDateTime;
import java.util.ArrayList;
Expand Down Expand Up @@ -51,6 +54,7 @@ public class RsInntektsinformasjon {

private List<Historikk> historikk;

@Field(type = FieldType.Date, format = DateFormat.date_hour_minute_second, pattern = "uuuu-MM-dd'T'HH:mm:ss")
private LocalDateTime rapporteringsdato;

private Integer versjon;
Expand Down Expand Up @@ -125,10 +129,12 @@ public static class Arbeidsforhold {

@Schema(type = "LocalDateTime",
example = "yyyy-MM-dd")
@Field(type = FieldType.Date, format = DateFormat.date_hour_minute_second, pattern = "uuuu-MM-dd'T'HH:mm:ss")
private LocalDateTime startdato;

@Schema(type = "LocalDateTime",
example = "yyyy-MM-dd")
@Field(type = FieldType.Date, format = DateFormat.date_hour_minute_second, pattern = "uuuu-MM-dd'T'HH:mm:ss")
private LocalDateTime sluttdato;

private Double antallTimerPerUkeSomEnFullStillingTilsvarer;
Expand All @@ -146,10 +152,12 @@ public static class Arbeidsforhold {

@Schema(type = "LocalDateTime",
example = "yyyy-MM-dd")
@Field(type = FieldType.Date, format = DateFormat.date_hour_minute_second, pattern = "uuuu-MM-dd'T'HH:mm:ss")
private LocalDateTime sisteLoennsendringsdato;

@Schema(type = "LocalDateTime",
example = "yyyy-MM-dd")
@Field(type = FieldType.Date, format = DateFormat.date_hour_minute_second, pattern = "uuuu-MM-dd'T'HH:mm:ss")
private LocalDateTime sisteDatoForStillingsprosentendring;
}

Expand Down
Loading

0 comments on commit f62fa7f

Please sign in to comment.