Skip to content

Commit

Permalink
Fjerner all kontonummerkode, med unntak av kontonummer i grensesnitt.
Browse files Browse the repository at this point in the history
Co-authored-by: Julie Hill Roa <[email protected]>
  • Loading branch information
klaramargrethehelgemo and JulieHillRoa committed Nov 29, 2024
1 parent 19c7f87 commit d9a7e1f
Show file tree
Hide file tree
Showing 12 changed files with 7 additions and 392 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

7 changes: 0 additions & 7 deletions src/main/java/no/nav/veilarbperson/config/ClientConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
import no.nav.veilarbperson.client.digdir.DigdirClientImpl;
import no.nav.veilarbperson.client.kodeverk.KodeverkClient;
import no.nav.veilarbperson.client.kodeverk.KodeverkClientImpl;
import no.nav.veilarbperson.client.kontoregister.KontoregisterClient;
import no.nav.veilarbperson.client.kontoregister.KontoregisterClientImpl;
import no.nav.veilarbperson.client.nom.SkjermetClient;
import no.nav.veilarbperson.client.nom.SkjermetClientImpl;
import no.nav.veilarbperson.client.oppslagArbeidssoekerregisteret.OppslagArbeidssoekerregisteretClient;
Expand Down Expand Up @@ -73,11 +71,6 @@ public PamClient pamClient(EnvironmentProperties properties, AzureAdMachineToMac
}


@Bean
public KontoregisterClient kontoregisterClient(EnvironmentProperties properties, MachineToMachineTokenClient tokenClient) {
return new KontoregisterClientImpl(properties.getKontoregisterUrl(), () -> tokenClient.createMachineToMachineToken(properties.getKontoregisterScope()));
}

@Bean
public SkjermetClient skjermetClient(EnvironmentProperties properties, AzureAdMachineToMachineTokenClient tokenClient) {
return new SkjermetClientImpl(properties.getSkjermedePersonerPipUrl(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import no.nav.common.types.identer.Fnr;
import no.nav.veilarbperson.client.kontoregister.HentKontoRequestDTO;
import no.nav.veilarbperson.client.kontoregister.KontoregisterClient;
import no.nav.veilarbperson.client.kontoregister.HentKontoResponseDTO;
import no.nav.veilarbperson.client.regoppslag.RegoppslagClient;
import no.nav.veilarbperson.client.regoppslag.RegoppslagResponseDTO;
import no.nav.veilarbperson.domain.*;
Expand All @@ -26,8 +23,6 @@ public class PersonV2Controller {
private final AuthService authService;
private final RegoppslagClient regoppslagClient;

private final KontoregisterClient kontoregisterClient;

@Deprecated
@GetMapping
@Operation(summary = "Henter informasjon om en person fra PDL")
Expand Down Expand Up @@ -83,13 +78,4 @@ public RegoppslagResponseDTO hentPostadresse(@RequestParam("fnr") Fnr fnr) {
authService.sjekkLesetilgang(fnr);
return regoppslagClient.hentPostadresse(fnr);
}
@PostMapping
@Operation(summary = "Henter kontonummer fra Kontoregister")
public HentKontoResponseDTO hentKontonummerFraKontoregister(@RequestParam("kontohaver") HentKontoRequestDTO kontohaver) {
Fnr fnr = new Fnr(kontohaver.getKontohaver());
authService.stoppHvisEksternBruker();
authService.sjekkLesetilgang(fnr);
return kontoregisterClient.hentKontonummer(kontohaver);
}

}
12 changes: 7 additions & 5 deletions src/main/java/no/nav/veilarbperson/service/PersonV2Service.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import java.util.stream.Stream;

import static java.util.Optional.ofNullable;
import static no.nav.veilarbperson.client.kontoregister.KontoregisterClientImpl.Mappers.fraNorg2Enhet;
import static no.nav.veilarbperson.utils.PersonV2DataMapper.*;
import static no.nav.veilarbperson.utils.VergeOgFullmaktDataMapper.*;

Expand Down Expand Up @@ -81,9 +80,7 @@ public PersonV2Data hentFlettetPerson(PersonFraPdlRequest personFraPdlRequest) {
}

public void flettInnKontonummer(PersonV2Data person) {
// HentKontoRequestDTO kontohaver = new HentKontoRequestDTO();
// kontohaver.setKontohaver(person.getFodselsnummer().toString());
// HentKontoResponseDTO kontoregisterKonto = kontoregisterClient.hentKontonummer(kontohaver);

person.setKontonummer(null);
}

Expand Down Expand Up @@ -182,6 +179,12 @@ private void flettGeografiskEnhet(PersonFraPdlRequest personFraPdlRequest, Perso
}
}

private Enhet fraNorg2Enhet(no.nav.common.client.norg2.Enhet enhet) {
{
return new Enhet(enhet.getEnhetNr(), enhet.getNavn());
}
}


public void flettKodeverk(PersonV2Data personV2Data) {
Optional<String> postnrIBostedsVegAdr = ofNullable(personV2Data.getBostedsadresse()).map(Bostedsadresse::getVegadresse).map(
Expand Down Expand Up @@ -363,5 +366,4 @@ public PersonNavnV2 hentNavn(PersonFraPdlRequest personFraPdlRequest) {

return PersonV2DataMapper.navnMapper(personNavn.getNavn());
}

}
43 changes: 0 additions & 43 deletions src/test/java/no/nav/veilarbperson/config/ClientTestConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,14 @@
import no.nav.veilarbperson.client.digdir.DigdirClient;
import no.nav.veilarbperson.client.digdir.DigdirKontaktinfo;
import no.nav.veilarbperson.client.kodeverk.KodeverkClient;
import no.nav.veilarbperson.client.kontoregister.HentKontoRequestDTO;
import no.nav.veilarbperson.client.kontoregister.HentKontoResponseDTO;
import no.nav.veilarbperson.client.kontoregister.KontoregisterClient;
import no.nav.veilarbperson.client.nom.SkjermetClient;
import no.nav.veilarbperson.client.oppslagArbeidssoekerregisteret.OppslagArbeidssoekerregisteretClient;
import no.nav.veilarbperson.client.oppslagArbeidssoekerregisteret.OppslagArbeidssoekerregisteretClientImpl;
import no.nav.veilarbperson.client.pam.PamClient;
import no.nav.veilarbperson.client.pdl.HentPerson;
import no.nav.veilarbperson.client.pdl.PdlClient;
import no.nav.veilarbperson.client.pdl.domain.PdlRequest;
import no.nav.veilarbperson.client.representasjon.RepresentasjonClient;
import no.nav.veilarbperson.client.veilarboppfolging.UnderOppfolging;
import no.nav.veilarbperson.client.veilarboppfolging.VeilarboppfolgingClient;
import okhttp3.Response;
import org.jetbrains.annotations.NotNull;
import org.mockito.Mockito;
import org.springframework.cloud.contract.wiremock.WireMockConfiguration;
import org.springframework.cloud.contract.wiremock.WireMockConfigurationCustomizer;
import org.springframework.context.annotation.Bean;
Expand Down Expand Up @@ -130,22 +122,6 @@ public HealthCheckResult checkHealth() {
};
}

@Bean
public KontoregisterClient kontoregisterClient() {
return new KontoregisterClient() {
@Override
public HentKontoResponseDTO hentKontonummer(HentKontoRequestDTO kontohaver) {
return new HentKontoResponseDTO();
}

@Override
public HealthCheckResult checkHealth() {
return HealthCheckResult.healthy();
}
};
}


@Bean
public SkjermetClient skjermetClient() {
return new SkjermetClient() {
Expand Down Expand Up @@ -233,25 +209,6 @@ public HealthCheckResult checkHealth() {
};
}

public RepresentasjonClient representasjonClient() {
return Mockito.mock(RepresentasjonClient.class);
}

@Bean
public PamClient pamClient() {
return new PamClient() {
@Override
public Response hentCvOgJobbprofil(Fnr fnr, boolean erBrukerManuell) {
return null;
}

@Override
public HealthCheckResult checkHealth() {
return HealthCheckResult.healthy();
}
};
}

@Bean
public SelfTestChecks selfTestChecks() {
return mock(SelfTestChecks.class);
Expand Down
Loading

0 comments on commit d9a7e1f

Please sign in to comment.