-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fjerne GET intrygd-grunnlag * TFP-5660 oppdatere infotrygd-saker * Tillate litt mer word
- Loading branch information
Showing
16 changed files
with
264 additions
and
344 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 0 additions & 7 deletions
7
.../src/main/java/no/nav/vedtak/felles/integrasjon/infotrygd/grunnlag/InfotrygdGrunnlag.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 6 additions & 1 deletion
7
.../java/no/nav/vedtak/felles/integrasjon/infotrygd/grunnlag/v1/respons/Arbeidskategori.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
package no.nav.vedtak.felles.integrasjon.infotrygd.grunnlag.v1.respons; | ||
|
||
public record Arbeidskategori(ArbeidskategoriKode kode, String termnavn) { | ||
public record Arbeidskategori(ArbeidskategoriKode kode, String termnavn) implements InfotrygdKode { | ||
|
||
@Override | ||
public String getKode() { | ||
return kode().getKode(); | ||
} | ||
|
||
} |
2 changes: 1 addition & 1 deletion
2
.../java/no/nav/vedtak/felles/integrasjon/infotrygd/grunnlag/v1/respons/Behandlingstema.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package no.nav.vedtak.felles.integrasjon.infotrygd.grunnlag.v1.respons; | ||
|
||
public record Behandlingstema(BehandlingstemaKode kode, String termnavn) { | ||
public record Behandlingstema(BehandlingstemaKode kode, String termnavn) implements InfotrygdKode { | ||
} |
13 changes: 13 additions & 0 deletions
13
...in/java/no/nav/vedtak/felles/integrasjon/infotrygd/grunnlag/v1/respons/InfotrygdKode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package no.nav.vedtak.felles.integrasjon.infotrygd.grunnlag.v1.respons; | ||
|
||
public interface InfotrygdKode { | ||
|
||
Enum<?> kode(); | ||
|
||
default String getKode() { | ||
return kode() != null ? kode().name() : null; | ||
} | ||
|
||
String termnavn(); | ||
|
||
} |
2 changes: 1 addition & 1 deletion
2
.../java/no/nav/vedtak/felles/integrasjon/infotrygd/grunnlag/v1/respons/Inntektsperiode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
package no.nav.vedtak.felles.integrasjon.infotrygd.grunnlag.v1.respons; | ||
|
||
public record Inntektsperiode(InntektsperiodeKode kode, String termnavn) { | ||
public record Inntektsperiode(InntektsperiodeKode kode, String termnavn) implements InfotrygdKode { | ||
|
||
} |
2 changes: 1 addition & 1 deletion
2
.../src/main/java/no/nav/vedtak/felles/integrasjon/infotrygd/grunnlag/v1/respons/Status.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package no.nav.vedtak.felles.integrasjon.infotrygd.grunnlag.v1.respons; | ||
|
||
public record Status(StatusKode kode, String termnavn) { | ||
public record Status(StatusKode kode, String termnavn) implements InfotrygdKode { | ||
} |
2 changes: 1 addition & 1 deletion
2
...nt/src/main/java/no/nav/vedtak/felles/integrasjon/infotrygd/grunnlag/v1/respons/Tema.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
package no.nav.vedtak.felles.integrasjon.infotrygd.grunnlag.v1.respons; | ||
|
||
public record Tema(TemaKode kode, String termnavn) { | ||
public record Tema(TemaKode kode, String termnavn) implements InfotrygdKode { | ||
|
||
} |
56 changes: 56 additions & 0 deletions
56
...rc/main/java/no/nav/vedtak/felles/integrasjon/infotrygd/saker/AbstractInfotrygdSaker.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package no.nav.vedtak.felles.integrasjon.infotrygd.saker; | ||
|
||
import java.util.Arrays; | ||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import no.nav.vedtak.exception.TekniskException; | ||
import no.nav.vedtak.felles.integrasjon.infotrygd.grunnlag.GrunnlagRequest; | ||
import no.nav.vedtak.felles.integrasjon.infotrygd.saker.v1.respons.InfotrygdSak; | ||
import no.nav.vedtak.felles.integrasjon.rest.RestClient; | ||
import no.nav.vedtak.felles.integrasjon.rest.RestConfig; | ||
import no.nav.vedtak.felles.integrasjon.rest.RestRequest; | ||
|
||
// Extend og annoter med endpoint, evt default. tokenConfig kan settes til TokenFlow.AZURE_CC | ||
public abstract class AbstractInfotrygdSaker implements InfotrygdSaker { | ||
protected static final Logger LOG = LoggerFactory.getLogger(AbstractInfotrygdSaker.class); | ||
|
||
private final RestClient restClient; | ||
private final RestConfig restConfig; | ||
|
||
protected AbstractInfotrygdSaker() { | ||
this(RestClient.client()); | ||
} | ||
|
||
protected AbstractInfotrygdSaker(RestClient client) { | ||
this.restClient = client; | ||
this.restConfig = RestConfig.forClient(this.getClass()); | ||
} | ||
|
||
@Override | ||
public List<InfotrygdSak> hentSaker(GrunnlagRequest request) { | ||
try { | ||
var rrequest = RestRequest.newPOSTJson(request, restConfig.endpoint(), restConfig); | ||
var resultat = restClient.send(rrequest, InfotrygdSak[].class); | ||
return Arrays.asList(resultat); | ||
} catch (Exception e) { | ||
throw new TekniskException("FP-180125", | ||
String.format("Tjeneste %s gir feil, meld til #infotrygd_replikering hvis dette skjer gjennom lengre tidsperiode.", | ||
restConfig.endpoint()), e); | ||
} | ||
} | ||
|
||
@Override | ||
public List<InfotrygdSak> hentSakerFailSoft(GrunnlagRequest request) { | ||
try { | ||
return hentSaker(request); | ||
} catch (Exception e) { | ||
LOG.warn("Feil ved oppslag mot {}, returnerer ingen grunnlag", restConfig.endpoint(), e); | ||
return Collections.emptyList(); | ||
} | ||
} | ||
|
||
} |
9 changes: 6 additions & 3 deletions
9
...klient/src/main/java/no/nav/vedtak/felles/integrasjon/infotrygd/saker/InfotrygdSaker.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
package no.nav.vedtak.felles.integrasjon.infotrygd.saker; | ||
|
||
import no.nav.vedtak.felles.integrasjon.infotrygd.saker.v1.respons.Saker; | ||
import java.util.List; | ||
|
||
import java.time.LocalDate; | ||
import no.nav.vedtak.felles.integrasjon.infotrygd.grunnlag.GrunnlagRequest; | ||
import no.nav.vedtak.felles.integrasjon.infotrygd.saker.v1.respons.InfotrygdSak; | ||
|
||
public interface InfotrygdSaker { | ||
|
||
Saker getSaker(String fnr, LocalDate fom); | ||
List<InfotrygdSak> hentSaker(GrunnlagRequest request); | ||
|
||
List<InfotrygdSak> hentSakerFailSoft(GrunnlagRequest request); | ||
|
||
} |
40 changes: 40 additions & 0 deletions
40
...c/main/java/no/nav/vedtak/felles/integrasjon/infotrygd/saker/v1/respons/InfotrygdSak.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package no.nav.vedtak.felles.integrasjon.infotrygd.saker.v1.respons; | ||
|
||
import java.time.LocalDate; | ||
|
||
public record InfotrygdSak(LocalDate iverksatt, SakResultat resultat, LocalDate registrert, Saksnummer sakId, LocalDate mottatt, | ||
SakType type, LocalDate vedtatt, SakValg valg, SakUndervalg undervalg, SakNivå nivaa) { | ||
|
||
|
||
|
||
public String saksBlokkNummer() { | ||
return sakId().blokk() + nrFra(sakId().nr()); | ||
} | ||
|
||
public String saksNummerBlokk() { | ||
return nrFra(sakId().nr()) + sakId().blokk(); | ||
} | ||
|
||
private static String nrFra(int nr) { | ||
return nr < 10 ? "0" + nr : String.valueOf(nr); | ||
} | ||
|
||
|
||
public record Saksnummer(String blokk, int nr) { } | ||
|
||
public interface InfotrygdKode { | ||
String kode(); | ||
String termnavn(); | ||
} | ||
|
||
public record SakValg(String kode, String termnavn) implements InfotrygdKode { } | ||
|
||
public record SakUndervalg(String kode, String termnavn) implements InfotrygdKode { } | ||
|
||
public record SakNivå(String kode, String termnavn) implements InfotrygdKode { } | ||
|
||
public record SakType(String kode, String termnavn) implements InfotrygdKode { } | ||
|
||
public record SakResultat(String kode, String termnavn) implements InfotrygdKode { } | ||
|
||
} |
84 changes: 0 additions & 84 deletions
84
...ient/src/main/java/no/nav/vedtak/felles/integrasjon/infotrygd/saker/v1/respons/Saker.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.