-
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.
feat. oppdatert endepunkt for aktsomhet til å sende med diskresjonsko…
…de internt
- Loading branch information
Showing
17 changed files
with
234 additions
and
158 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
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
20 changes: 20 additions & 0 deletions
20
src/main/java/no/nav/tag/tiltaksgjennomforing/persondata/PdlRequest.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,9 +1,29 @@ | ||
package no.nav.tag.tiltaksgjennomforing.persondata; | ||
|
||
import lombok.SneakyThrows; | ||
import lombok.Value; | ||
import org.springframework.core.io.Resource; | ||
import org.springframework.util.StreamUtils; | ||
|
||
import java.nio.charset.StandardCharsets; | ||
|
||
@Value | ||
public class PdlRequest { | ||
private final String query; | ||
private final PdlRequestVariables variables; | ||
|
||
public PdlRequest(String query, PdlRequestVariables variables) { | ||
this.query = query; | ||
this.variables = variables; | ||
} | ||
|
||
public PdlRequest(Resource resource, PdlRequestVariables variables) { | ||
this(resourceAsString(resource), variables); | ||
} | ||
|
||
@SneakyThrows | ||
private static String resourceAsString(Resource resource) { | ||
String filinnhold = StreamUtils.copyToString(resource.getInputStream(), StandardCharsets.UTF_8); | ||
return filinnhold.replaceAll("\\s+", " "); | ||
} | ||
} |
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
29 changes: 29 additions & 0 deletions
29
src/main/java/no/nav/tag/tiltaksgjennomforing/persondata/aktsomhet/Aktsomhet.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,29 @@ | ||
package no.nav.tag.tiltaksgjennomforing.persondata.aktsomhet; | ||
|
||
import no.nav.tag.tiltaksgjennomforing.autorisasjon.Diskresjonskode; | ||
|
||
public record Aktsomhet( | ||
boolean kreverAktsomhet, | ||
Diskresjonskode Diskresjonskode | ||
) { | ||
public static Aktsomhet intern(Diskresjonskode diskresjonskode) { | ||
return new Aktsomhet( | ||
diskresjonskode.erKode6Eller7(), | ||
diskresjonskode | ||
); | ||
} | ||
|
||
public static Aktsomhet ekstern(Diskresjonskode diskresjonskode) { | ||
return new Aktsomhet( | ||
diskresjonskode.erKode6Eller7(), | ||
null | ||
); | ||
} | ||
|
||
public static Aktsomhet tom() { | ||
return new Aktsomhet( | ||
false, | ||
no.nav.tag.tiltaksgjennomforing.autorisasjon.Diskresjonskode.UGRADERT | ||
); | ||
} | ||
} |
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
Oops, something went wrong.