Skip to content

Commit

Permalink
Feature/oppslag controller rydding (#3304)
Browse files Browse the repository at this point in the history
Fjernet endepunkter fra dolly-backend OppslagController + refaktorert
---------
Co-authored-by: stigus <[email protected]>
  • Loading branch information
krharum authored Oct 5, 2023
1 parent 182c46b commit 7ca45cd
Show file tree
Hide file tree
Showing 63 changed files with 119 additions and 1,021 deletions.
3 changes: 0 additions & 3 deletions apps/dolly-backend/config.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,12 @@ spec:
cluster: dev-gcp
outbound:
rules:
- application: generer-navn-service
- application: testnav-amelding-service
- application: testnav-arbeidsforhold-service
- application: testnav-inntektsmelding-service
- application: testnav-miljoer-service
- application: testnav-organisasjon-forvalter
- application: testnav-organisasjon-service
- application: testnav-organisasjon-tilgang-service
- application: testnav-pdl-forvalter-dev
- application: testnav-person-service
- application: testnav-synt-sykemelding-api
Expand All @@ -64,7 +62,6 @@ spec:
- host: testnav-pdl-proxy.dev-fss-pub.nais.io
- host: testnav-sigrunstub-proxy.dev-fss-pub.nais.io
- host: testnav-skjermingsregister-proxy.dev-fss-pub.nais.io
- host: testnav-statisk-data-forvalter-proxy.dev-fss-pub.nais.io
- host: testnav-udistub-proxy.dev-fss-pub.nais.io
- host: tps-forvalteren-dev-proxy.dev-fss-pub.nais.io
webproxy: true
Expand Down
4 changes: 0 additions & 4 deletions apps/dolly-backend/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,12 @@ spec:
namespace: navdig
outbound:
rules:
- application: generer-navn-service
- application: testnav-amelding-service
- application: testnav-arbeidsforhold-service
- application: testnav-inntektsmelding-service
- application: testnav-miljoer-service
- application: testnav-organisasjon-forvalter
- application: testnav-organisasjon-service
- application: testnav-organisasjon-tilgang-service
cluster: prod-gcp
- application: testnav-pdl-forvalter
- application: testnav-person-service
- application: testnav-synt-sykemelding-api
Expand All @@ -72,7 +69,6 @@ spec:
- host: testnav-pdl-proxy.dev-fss-pub.nais.io
- host: testnav-sigrunstub-proxy.dev-fss-pub.nais.io
- host: testnav-skjermingsregister-proxy.dev-fss-pub.nais.io
- host: testnav-statisk-data-forvalter-proxy.dev-fss-pub.nais.io
- host: testnav-udistub-proxy.dev-fss-pub.nais.io
- host: tps-forvalteren-proxy.dev-fss-pub.nais.io
webproxy: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import lombok.extern.slf4j.Slf4j;
import no.nav.dolly.bestilling.ConsumerStatus;
import no.nav.dolly.bestilling.arbeidsplassencv.command.ArbeidsplassenDeleteCVCommand;
import no.nav.dolly.bestilling.arbeidsplassencv.command.ArbeidsplassenGetCVCommand;
import no.nav.dolly.bestilling.arbeidsplassencv.command.ArbeidsplassenGodtaHjemmelCommand;
import no.nav.dolly.bestilling.arbeidsplassencv.command.ArbeidsplassenGodtaVilkaarCommand;
import no.nav.dolly.bestilling.arbeidsplassencv.command.ArbeidsplassenPostPersonCommand;
Expand Down Expand Up @@ -48,14 +47,6 @@ public ArbeidsplassenCVConsumer(
.build();
}

@Timed(name = "providers", tags = { "operation", "arbeidsplassen_getCV" })
public Flux<ArbeidsplassenCVStatusDTO> hentCV(String ident, String uuid) {

return tokenService.exchange(serviceProperties)
.flatMapMany(token -> new ArbeidsplassenGetCVCommand(webClient, ident, uuid, token.getTokenValue()).call())
.doOnNext(resultat -> log.info("Hentet CV for ident {} {}", ident, resultat));
}

@Timed(name = "providers", tags = { "operation", "arbeidsplassen_oppdaterCV" })
public Flux<ArbeidsplassenCVStatusDTO> oppdaterCV(String ident, PAMCVDTO arbeidsplassenCV, String uuid) {

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,24 @@
import no.nav.dolly.bestilling.inntektstub.command.InntektstubGetCommand;
import no.nav.dolly.bestilling.inntektstub.command.InntektstubPostCommand;
import no.nav.dolly.bestilling.inntektstub.domain.Inntektsinformasjon;
import no.nav.dolly.bestilling.inntektstub.domain.ValiderInntekt;
import no.nav.dolly.config.credentials.InntektstubProxyProperties;
import no.nav.dolly.metrics.Timed;
import no.nav.dolly.util.WebClientFilter;
import no.nav.testnav.libs.securitycore.config.UserConstant;
import no.nav.testnav.libs.securitycore.domain.ServerProperties;
import no.nav.testnav.libs.standalone.servletsecurity.exchange.TokenExchange;
import org.springframework.http.HttpHeaders;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.reactive.function.client.WebClient;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import reactor.util.retry.Retry;

import java.time.Duration;
import java.util.List;

import static no.nav.dolly.util.JacksonExchangeStrategyUtil.getJacksonStrategy;
import static no.nav.dolly.util.TokenXUtil.getUserJwt;

@Service
@Slf4j
public class InntektstubConsumer implements ConsumerStatus {

private static final String VALIDER_INNTEKTER_URL = "/api/v2/valider";

private static final int BLOCK_SIZE = 10;

private final WebClient webClient;
Expand Down Expand Up @@ -83,24 +74,6 @@ public Flux<Inntektsinformasjon> postInntekter(List<Inntektsinformasjon> inntekt
.flatMapMany(token -> new InntektstubPostCommand(webClient, inntektsinformasjon, token.getTokenValue()).call());
}

@Timed(name = "providers", tags = { "operation", "inntk_validerInntekt" })
public ResponseEntity<Object> validerInntekter(ValiderInntekt validerInntekt) {

return tokenService.exchange(serviceProperties)
.flatMap(token -> webClient.post()
.uri(uriBuilder -> uriBuilder
.path(VALIDER_INNTEKTER_URL)
.build())
.header(HttpHeaders.AUTHORIZATION, "Bearer " + token.getTokenValue())
.header(UserConstant.USER_HEADER_JWT, getUserJwt())
.bodyValue(validerInntekt)
.retrieve()
.toEntity(Object.class)
.retryWhen(Retry.backoff(3, Duration.ofSeconds(5))
.filter(WebClientFilter::is5xxException)))
.block();
}

@Override
public String serviceUrl() {
return serviceProperties.getUrl();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
package no.nav.dolly.bestilling.pensjonforvalter;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.netty.channel.ChannelOption;
import lombok.extern.slf4j.Slf4j;
import no.nav.dolly.bestilling.ConsumerStatus;
import no.nav.dolly.bestilling.pensjonforvalter.command.AnnullerSamboerCommand;
import no.nav.dolly.bestilling.pensjonforvalter.command.HentMiljoerCommand;
import no.nav.dolly.bestilling.pensjonforvalter.command.HentPoppInntekterCommand;
import no.nav.dolly.bestilling.pensjonforvalter.command.HentSamboerCommand;
import no.nav.dolly.bestilling.pensjonforvalter.command.HentTpForholdCommand;
import no.nav.dolly.bestilling.pensjonforvalter.command.LagreAlderspensjonCommand;
import no.nav.dolly.bestilling.pensjonforvalter.command.LagrePoppInntektCommand;
import no.nav.dolly.bestilling.pensjonforvalter.command.LagreSamboerCommand;
Expand Down Expand Up @@ -141,14 +138,6 @@ public Flux<PensjonforvalterResponse> lagreUforetrygd(PensjonUforetrygdRequest r
.flatMapMany(token -> new LagreUforetrygdCommand(webClient, token.getTokenValue(), request).call());
}

@Timed(name = "providers", tags = {"operation", "pen_getInntekter"})
public JsonNode getInntekter(String ident, String miljoe) {

return tokenService.exchange(serviceProperties)
.flatMap(token -> new HentPoppInntekterCommand(webClient, token.getTokenValue(), ident, miljoe).call())
.block();
}

@Timed(name = "providers", tags = {"operation", "pen_lagreTpForhold"})
public Flux<PensjonforvalterResponse> lagreTpForhold(PensjonTpForholdRequest pensjonTpForholdRequest) {

Expand All @@ -169,14 +158,6 @@ public void sletteTpForhold(List<String> identer) {
.subscribe(response -> log.info("Slettet mot PESYS (tp) i alle miljoer"));
}

@Timed(name = "providers", tags = {"operation", "pen_getTpForhold"})
public JsonNode getTpForhold(String ident, String miljoe) {

return tokenService.exchange(serviceProperties)
.flatMap(token -> new HentTpForholdCommand(webClient, token.getTokenValue(), ident, miljoe).call())
.block();
}

@Timed(name = "providers", tags = {"operation", "pen_lagreTpYtelse"})
public Flux<PensjonforvalterResponse> lagreTpYtelse(PensjonTpYtelseRequest pensjonTpYtelseRequest) {

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,6 @@ public SkjermingsRegisterConsumer(
.build();
}

@Timed(name = "providers", tags = {"operation", "skjermingsdata-hent"})
public SkjermingDataResponse getSkjerming(String ident) {

return tokenService.exchange(serviceProperties)
.flatMap(token -> new SkjermingsregisterGetCommand(webClient, ident, token.getTokenValue()).call())
.block();
}

@Timed(name = "providers", tags = {"operation", "skjermingsdata-slett"})
public Mono<List<Void>> deleteSkjerming(List<String> identer) {

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 7ca45cd

Please sign in to comment.