Skip to content

Commit

Permalink
Endrer PersonRequestBody-objektet
Browse files Browse the repository at this point in the history
  • Loading branch information
JulieHillRoa committed Oct 11, 2023
1 parent ea86ee4 commit 755e7c3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,31 +37,31 @@ public class PersonV3Controller {
@PostMapping("/aktorid")
public AktoerId aktorid(@RequestBody PersonRequestBody personRequestBody) {
authService.stoppHvisEksternBruker();
Fnr fnr = Fnr.of(personRequestBody.fodselsnummer());
Fnr fnr = personRequestBody.fnr();
authService.sjekkLesetilgang(fnr);
return new AktoerId(authService.getAktorId(fnr));
}

@PostMapping("/tilgangTilBruker")
public boolean tilgangTilBruker(@RequestBody PersonRequestBody personRequestBody) {
return authService.harLesetilgang(Fnr.of(personRequestBody.fodselsnummer()));
return authService.harLesetilgang(personRequestBody.fnr());
}
@GetMapping("/geografisktilknytning")
public GeografiskTilknytning geografisktilknytning(@RequestBody PersonRequestBody personRequestBody) {
Fnr fodselsnummer = hentIdentForEksternEllerIntern(Fnr.of(personRequestBody.fodselsnummer()));
Fnr fodselsnummer = hentIdentForEksternEllerIntern(personRequestBody.fnr());
authService.sjekkLesetilgang(fodselsnummer);
return personV2Service.hentGeografiskTilknytning(fodselsnummer);
}

@GetMapping("/cv_jobbprofil")
public ResponseEntity<String> cvOgJobbprofil(@RequestBody PersonRequestBody personRequestBody) {
return cvJobbprofilService.hentCvJobbprofilJson(Fnr.of(personRequestBody.fodselsnummer()));
return cvJobbprofilService.hentCvJobbprofilJson(personRequestBody.fnr());
}

@GetMapping("/registrering")
public ResponseEntity<String> registrering(@RequestBody PersonRequestBody personRequestBody) {
authService.stoppHvisEksternBruker();
Fnr fnr = Fnr.of(personRequestBody.fodselsnummer());
Fnr fnr = personRequestBody.fnr();
authService.sjekkLesetilgang(fnr);
return registreringService.hentRegistrering(fnr);
}
Expand All @@ -70,7 +70,7 @@ public ResponseEntity<String> registrering(@RequestBody PersonRequestBody person
@Operation(summary = "Henter informasjon om en person fra PDL")
public PersonV2Data hentPerson(@RequestBody PersonRequestBody personRequestBody) {
authService.stoppHvisEksternBruker();
Fnr fnr = Fnr.of(personRequestBody.fodselsnummer());
Fnr fnr = personRequestBody.fnr();
authService.sjekkLesetilgang(fnr);
return personV2Service.hentFlettetPerson(fnr);
}
Expand All @@ -79,7 +79,7 @@ public PersonV2Data hentPerson(@RequestBody PersonRequestBody personRequestBody)
@Operation(summary = "Henter malform fra DIGDIR tjeneste")
public Malform malform(@RequestBody PersonRequestBody personRequestBody) {
authService.stoppHvisEksternBruker();
Fnr fnr = Fnr.of(personRequestBody.fodselsnummer());
Fnr fnr = personRequestBody.fnr();
authService.sjekkLesetilgang(fnr);

String malform = personV2Service.hentMalform(fnr);
Expand All @@ -90,7 +90,7 @@ public Malform malform(@RequestBody PersonRequestBody personRequestBody) {
@Operation(summary = "Henter informasjon om verge og fullmakt for en person fra PDL")
public VergeOgFullmaktData hentVergemaalOgFullmakt(@RequestBody PersonRequestBody personRequestBody) {
authService.stoppHvisEksternBruker();
Fnr fnr = Fnr.of(personRequestBody.fodselsnummer());
Fnr fnr = personRequestBody.fnr();
authService.sjekkLesetilgang(fnr);
return personV2Service.hentVergeEllerFullmakt(fnr);
}
Expand All @@ -99,7 +99,7 @@ public VergeOgFullmaktData hentVergemaalOgFullmakt(@RequestBody PersonRequestBod
@Operation(summary = "Henter tolk informajon til en person fra PDL")
public TilrettelagtKommunikasjonData hentSpraakTolk(@RequestBody PersonRequestBody personRequestBody) {
authService.stoppHvisEksternBruker();
Fnr fnr = Fnr.of(personRequestBody.fodselsnummer());
Fnr fnr = personRequestBody.fnr();
authService.sjekkLesetilgang(fnr);
return personV2Service.hentSpraakTolkInfo(fnr);
}
Expand All @@ -108,7 +108,7 @@ public TilrettelagtKommunikasjonData hentSpraakTolk(@RequestBody PersonRequestBo
@Operation(summary = "Henter navn til en person fra PDL")
public PersonNavnV2 hentNavn(@RequestBody PersonRequestBody personRequestBody) {
authService.stoppHvisEksternBruker();
Fnr fnr = Fnr.of(personRequestBody.fodselsnummer());
Fnr fnr = personRequestBody.fnr();
authService.sjekkLesetilgang(fnr);
return personV2Service.hentNavn(fnr);
}
Expand All @@ -117,7 +117,7 @@ public PersonNavnV2 hentNavn(@RequestBody PersonRequestBody personRequestBody) {
@Operation(summary = "Henter postadresse til en person fra regoppslag")
public RegoppslagResponseDTO hentPostadresse(@RequestBody PersonRequestBody personRequestBody) {
authService.stoppHvisEksternBruker();
Fnr fnr = Fnr.of(personRequestBody.fodselsnummer());
Fnr fnr = personRequestBody.fnr();
authService.sjekkLesetilgang(fnr);
return regoppslagClient.hentPostadresse(fnr);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package no.nav.veilarbperson.domain;

import no.nav.common.types.identer.Fnr;

public record PersonRequestBody(
String fodselsnummer
Fnr fnr
) {
}

0 comments on commit 755e7c3

Please sign in to comment.